--- val.h 2002/01/16 14:17:56 1.2
+++ val.h 2002/01/16 20:24:10 1.3
@@ -33,6 +33,10 @@
#include <stdarg.h>
+/* maximum length of a structured value name */
+#define VAL_MAXNAME 1024
+
+/* the set of distinct value types */
enum {
VAL_TYPE_VAL = 1<<0,
VAL_TYPE_PTR = 1<<1,
@@ -44,19 +48,25 @@
VAL_TYPE_DOUBLE = 1<<7
};
+/* the set of return codes */
typedef enum {
- VAL_OK,
- VAL_ERR_ARG,
- VAL_ERR_USE,
- VAL_ERR_MEM,
- VAL_ERR_SYS
+ VAL_OK, /* everything ok */
+ VAL_ERR_ARG, /* error: invalid argument */
+ VAL_ERR_USE, /* error: invalid use */
+ VAL_ERR_MEM, /* error: no more memory */
+ VAL_ERR_HSH, /* error: hash table problem */
+ VAL_ERR_INT, /* error: internal error */
+ VAL_ERR_SYS /* error: system error (see errno) */
} val_rc_t;
+/* the opaque data structure and type */
struct val_s;
typedef struct val_s val_t;
+/* function type for use with val_apply() */
typedef val_rc_t (*val_cb_t)(void *, const char *, int, const char *, void *);
+/* set of API functions */
val_rc_t val_create (val_t **);
val_rc_t val_destroy (val_t *);
val_rc_t val_reg (val_t *, const char *, int, const char *, void *);
|