source: trunk/minix/servers/inet/minix3/queryparam.h@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.4 KB
RevLine 
[9]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
6
7#include <ansi.h>
8
9typedef size_t _mnx_size_t;
10
11struct 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. */
15};
16
17struct export_params {
18 struct export_param_list *list; /* List of exported parameters. */
19 struct export_params *next; /* Link several sets of parameters. */
20};
21
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 }
37
38void qp_export _ARGS((struct export_params *_ex_params));
39int 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 */
44
45/* $PchId: queryparam.h,v 1.1 2005/06/28 14:31:26 philip Exp $ */
Note: See TracBrowser for help on using the repository browser.