add swifi to the build/install.
[minix.git] / servers / inet / minix3 / queryparam.h
blob7415fab4393023237c2e32c65ce24b65ce2591e8
1 /* queryparam.h - query program parameters Author: Kees J. Bot
2 * 22 Apr 1994
3 */
4 #ifndef _MINIX__QUERYPARAM_H
5 #define _MINIX__QUERYPARAM_H
7 #include <ansi.h>
9 typedef size_t _mnx_size_t;
11 struct export_param_list {
12 char *name; /* "variable", "[", ".field", or NULL. */
13 void *offset; /* Address of a variable or field offset. */
14 size_t size; /* Size of the resulting object. */
17 struct export_params {
18 struct export_param_list *list; /* List of exported parameters. */
19 struct export_params *next; /* Link several sets of parameters. */
22 #ifdef __STDC__
23 #define qp_stringize(var) #var
24 #define qp_dotstringize(var) "." #var
25 #else
26 #define qp_stringize(var) "var"
27 #define qp_dotstringize(var) ".var"
28 #endif
29 #define QP_VARIABLE(var) { qp_stringize(var), &(var), sizeof(var) }
30 #define QP_ARRAY(var) { "[", 0, sizeof((var)[0]) }
31 #define QP_VECTOR(var,ptr,len) { qp_stringize(var), &(ptr), -1 },\
32 { "[", &(len), sizeof(*(ptr)) }
33 #define QP_FIELD(field, type) { qp_dotstringize(field), \
34 (void *)offsetof(type, field), \
35 sizeof(((type *)0)->field) }
36 #define QP_END() { 0, 0, 0 }
38 void qp_export _ARGS((struct export_params *_ex_params));
39 int queryparam _ARGS((int (*_qgetc) _ARGS((void)), void **_paddress,
40 _mnx_size_t *_psize));
41 _mnx_size_t paramvalue _ARGS((char **_value, void *_address,
42 _mnx_size_t _size));
43 #endif /* _MINIX__QUERYPARAM_H */
45 /* $PchId: queryparam.h,v 1.1 2005/06/28 14:31:26 philip Exp $ */