2
** OSSP val - Value Access
3
** Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>
4
** Copyright (c) 2002-2004 The OSSP Project <http://www.ossp.org/>
5
** Copyright (c) 2002-2004 Cable & Wireless <http://www.cw.com/>
7
** This file is part of OSSP val, a value access library which
8
** can be found at http://www.ossp.org/pkg/lib/val/.
10
** Permission to use, copy, modify, and distribute this software for
11
** any purpose with or without fee is hereby granted, provided that
12
** the above copyright notice and this permission notice appear in all
15
** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
16
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18
** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
19
** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22
** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25
** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36
/* maximum length of a structured value name */
37
#define VAL_MAXNAME 1024
39
/* the set of distinct value types */
44
VAL_TYPE_SHORT = 1<<3,
47
VAL_TYPE_FLOAT = 1<<6,
48
VAL_TYPE_DOUBLE = 1<<7
51
/* the set of return codes */
53
VAL_OK, /* everything ok */
54
VAL_ERR_ARG, /* error: invalid argument */
55
VAL_ERR_USE, /* error: invalid use */
56
VAL_ERR_MEM, /* error: no more memory */
57
VAL_ERR_HSH, /* error: hash table problem */
58
VAL_ERR_INT, /* error: internal error */
59
VAL_ERR_SYS /* error: system error (see errno) */
62
/* the opaque data structure and type */
64
typedef struct val_s val_t;
66
/* function type for use with val_apply() */
67
typedef val_rc_t (*val_cb_t)(void *, const char *, int, const char *, void *);
69
/* unique library identifier */
70
extern const char val_id[];
72
/* set of API functions */
73
val_rc_t val_create (val_t **);
74
val_rc_t val_destroy (val_t *);
75
val_rc_t val_reg (val_t *, const char *, int, const char *, void *);
76
val_rc_t val_unreg (val_t *, const char *);
77
val_rc_t val_query (val_t *, const char *, int *, char **, void **);
78
val_rc_t val_set (val_t *, const char *, ...);
79
val_rc_t val_get (val_t *, const char *, ...);
80
val_rc_t val_vset (val_t *, const char *, va_list);
81
val_rc_t val_vget (val_t *, const char *, va_list);
82
val_rc_t val_apply (val_t *, const char *, int, val_cb_t, void *);
84
#endif /* __VAL_H__ */