1 /* queryparam.h - query program parameters Author: Kees J. Bot
4 #ifndef _MINIX__QUERYPARAM_H
5 #define _MINIX__QUERYPARAM_H
8 typedef size_t _mnx_size_t
;
10 struct export_param_list
{
11 char *name
; /* "variable", "[", ".field", or NULL. */
12 void *offset
; /* Address of a variable or field offset. */
13 size_t size
; /* Size of the resulting object. */
16 struct export_params
{
17 struct export_param_list
*list
; /* List of exported parameters. */
18 struct export_params
*next
; /* Link several sets of parameters. */
22 #define qp_stringize(var) #var
23 #define qp_dotstringize(var) "." #var
25 #define qp_stringize(var) "var"
26 #define qp_dotstringize(var) ".var"
28 #define QP_VARIABLE(var) { qp_stringize(var), &(var), sizeof(var) }
29 #define QP_ARRAY(var) { "[", 0, sizeof((var)[0]) }
30 #define QP_VECTOR(var,ptr,len) { qp_stringize(var), &(ptr), -1 },\
31 { "[", &(len), sizeof(*(ptr)) }
32 #define QP_FIELD(field, type) { qp_dotstringize(field), \
33 (void *)offsetof(type, field), \
34 sizeof(((type *)0)->field) }
35 #define QP_END() { 0, 0, 0 }
37 void qp_export(struct export_params
*_ex_params
);
38 int queryparam(int (*_qgetc
) (void), void **_paddress
, _mnx_size_t
40 _mnx_size_t
paramvalue(char **_value
, void *_address
, _mnx_size_t
42 #endif /* _MINIX__QUERYPARAM_H */
44 /* $PchId: queryparam.h,v 1.1 2005/06/28 14:31:26 philip Exp $ */