--- lmtp2nntp_config.c 2002/01/14 12:23:21 1.3
+++ lmtp2nntp_config.c 2002/01/15 13:02:20 1.4
@@ -44,6 +44,7 @@
// #include "lmtp2nntp_shpat.h"
// #include "lmtp2nntp_daemon.h"
#include "lmtp2nntp_popt.h"
+#include "lmtp2nntp_val.h"
/* third party (linked in) */
#include "str.h"
@@ -137,6 +138,37 @@
ctx->option_childsmax = 10;
{
+ int testint = 10;
+ int testintout = 100;
+ val_rc_t rc;
+ val_t *v;
+
+ if ((rc = val_create(&v)) != VAL_OK)
+ die("val_create");
+
+ printf("DEBUG: testint = %d, testintout = %d\n", testint, testintout);
+
+ if ((rc = val_reg(v, "foo", VAL_TYPE_INT, (void *)&testint)) != VAL_OK)
+ die("val_reg");
+
+ testint++;
+ if ((rc = val_get(v, "foo", &testintout)) != VAL_OK)
+ die("val_get");
+ printf("DEBUG: testint = %d, testintout = %d\n", testint, testintout);
+
+ if ((rc = val_set(v, "foo", 2)) != VAL_OK)
+ die("val_set");
+ if ((rc = val_get(v, "foo", &testintout)) != VAL_OK)
+ die("val_get");
+ printf("DEBUG: testint = %d, testintout = %d\n", testint, testintout);
+
+ if ((rc = val_destroy(v)) != VAL_OK)
+ die("val_destroy");
+
+ return;
+ }
+
+ {
char c;
char *cp;
@@ -159,6 +191,37 @@
return;
}
+/* Braindump
+
+ fuer configure
+
+ich brauche eine Tabelle, die alle optionen in langer und kurzer Form
+enthaelt, Angabe ob flag, single- oder multivalue, callbacks fuer die
+syntaxpruefung des human-readable inputs, die conversion ins interne binaryformat sowie rueckwandlung in
+human-readable format. Dazu informationen fuer help.
+ */
+
+/* Braindump
+
+ fuer var
+
+ich brauche eine struktur, aus der man ersehen kann, welche variablen es gibt.
+ {
+ struct "system.uname.sysname", varstring,
+ struct "system.uname.nodename",
+ struct "system.uname.release",
+ struct "system.uname.version",
+ struct "system.uname.machine",
+
+ <<< ctx->progname = strdup(argv[0]);
+ <<< foo = ctx->progname;
+
+ >>> rc = varreg("main.progname", &ctx->progname);
+ >>> rc = varset("main.progname", strdup(argv[0])); //equivalent to ctx->progname = strdup(argv[0]);
+ >>> rc = varget("main.progname", &foo); //equivalent to foo = ctx->progname
+ }
+ */
+
{
const char *filename = "example.conf";
struct stat sb;
|