1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
4 * Michael Zucchi <notzed@ximian.com>
6 * Copyright 2002 Ximian, Inc. (www.ximian.com)
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
29 #endif /* __cplusplus } */
36 CAMEL_ARG_IGNORE = 1, /* override/ignore an arg in-place */
38 CAMEL_ARG_FIRST = 1024, /* 1024 args reserved for arg system */
40 CAMEL_ARG_TYPE = 0xf0000000, /* type field for tags */
41 CAMEL_ARG_TAG = 0x0fffffff, /* tag field for args */
43 CAMEL_ARG_OBJ = 0x00000000, /* object */
44 CAMEL_ARG_INT = 0x10000000, /* int */
45 CAMEL_ARG_DBL = 0x20000000, /* double */
46 CAMEL_ARG_STR = 0x30000000, /* c string */
47 CAMEL_ARG_PTR = 0x40000000, /* ptr */
48 CAMEL_ARG_BOO = 0x50000000, /* bool */
51 typedef struct _CamelArg CamelArg;
52 typedef struct _CamelArgV CamelArgV;
54 typedef struct _CamelArgGet CamelArgGet;
55 typedef struct _CamelArgGetV CamelArgGetV;
77 #define ca_object u.ca_object
78 #define ca_int u.ca_int
79 #define ca_double u.ca_double
80 #define ca_str u.ca_str
81 #define ca_ptr u.ca_ptr
83 /* maximum no of args processed at any one time, not the max of all args */
84 #define CAMEL_ARGV_MAX (20)
89 CamelArg argv[CAMEL_ARGV_MAX];
92 struct _CamelArgGetV {
95 CamelArgGet argv[CAMEL_ARGV_MAX];
98 #define camel_argv_start(tv, last) va_start((tv)->ap, last)
99 #define camel_argv_end(tv) va_end((tv)->ap)
100 int camel_argv_build(CamelArgV *tv);
101 int camel_arggetv_build(CamelArgGetV *tv);
103 /* set an arg ignored */
104 #define camel_argv_ignore(tv, i) ((tv)->argv[i].tag = ((tv)->argv[i].tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE)
106 /* 'self-describing' property list */
107 typedef struct _CamelProperty CamelProperty;
109 struct _CamelProperty {
117 #endif /* __cplusplus */
119 #endif /* CAMEL_ARG_H */