ossp-pkg/lmtp2nntp/lmtp2nntp_val.h
#ifndef __LMTP2NNTP_VAL_H__
#define __LMTP2NNTP_VAL_H__
#include <stdarg.h>
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__ */