head 1.4; access; symbols; locks; strict; comment @ * @; 1.4 date 2002.01.16.14.22.14; author thl; state dead; branches; next 1.3; 1.3 date 2002.01.16.14.19.07; author thl; state Exp; branches; next 1.2; 1.2 date 2002.01.16.09.46.52; author thl; state Exp; branches; next 1.1; 1.1 date 2002.01.15.13.02.20; author thl; state Exp; branches; next ; desc @@ 1.4 log @switch from included to linked-in OSSP val variant @ text @ #ifndef __LMTP2NNTP_VAL_H__ #define __LMTP2NNTP_VAL_H__ #include enum { VAL_TYPE_VAL = 1<<0, VAL_TYPE_PTR = 1<<1, VAL_TYPE_CHAR = 1<<2, VAL_TYPE_SHORT = 1<<3, VAL_TYPE_INT = 1<<4, VAL_TYPE_LONG = 1<<5, VAL_TYPE_FLOAT = 1<<6, VAL_TYPE_DOUBLE = 1<<7 }; typedef enum { VAL_OK, VAL_ERR_ARG, VAL_ERR_USE, VAL_ERR_MEM, VAL_ERR_SYS } val_rc_t; struct val_s; typedef struct val_s val_t; typedef val_rc_t (*val_cb_t)(void *, const char *, int, const char *, void *); 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 *); val_rc_t val_set (val_t *, const char *, ...); val_rc_t val_get (val_t *, const char *, ...); val_rc_t val_vset (val_t *, const char *, va_list); val_rc_t val_vget (val_t *, const char *, va_list); val_rc_t val_apply (val_t *, const char *, int, val_cb_t, void *); #endif /* __LMTP2NNTP_VAL_H__ */ @ 1.3 log @commit for protocol reasons @ text @@ 1.2 log @val now supports OO-style variable names. lh now supports iteration through all elements and applying a callback to each. lmtp2nntp_config.c currently has sample code for lib val embedded, including a data dumper. @ text @d38 1 a38 1 val_rc_t val_apply (val_t *, val_cb_t cb, void *ctx); @ 1.1 log @map renamed to val and basic functionality successfully verified @ text @d2 3 d8 8 a15 7 VAL_TYPE_PTR = 1<<0, VAL_TYPE_CHAR = 1<<1, VAL_TYPE_SHORT = 1<<2, VAL_TYPE_INT = 1<<3, VAL_TYPE_LONG = 1<<4, VAL_TYPE_FLOAT = 1<<5, VAL_TYPE_DOUBLE = 1<<6 d20 4 a23 3 VAL_MEMORY, VAL_LH, VAL_UNKNOWN d29 2 d33 1 a33 1 val_rc_t val_reg (val_t *, const char *, int, void *); d38 3 @