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 Lesser 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 Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
33 CAMEL_ARG_IGNORE = 1, /* override/ignore an arg in-place */
35 CAMEL_ARG_FIRST = 1024, /* 1024 args reserved for arg system */
37 CAMEL_ARG_TYPE = 0xf0000000, /* type field for tags */
38 CAMEL_ARG_TAG = 0x0fffffff, /* tag field for args */
40 CAMEL_ARG_OBJ = 0x00000000, /* object */
41 CAMEL_ARG_INT = 0x10000000, /* int */
42 CAMEL_ARG_DBL = 0x20000000, /* double */
43 CAMEL_ARG_STR = 0x30000000, /* c string */
44 CAMEL_ARG_PTR = 0x40000000, /* ptr */
45 CAMEL_ARG_BOO = 0x50000000, /* bool */
48 typedef struct _CamelArg CamelArg;
49 typedef struct _CamelArgV CamelArgV;
51 typedef struct _CamelArgGet CamelArgGet;
52 typedef struct _CamelArgGetV CamelArgGetV;
74 #define ca_object u.ca_object
75 #define ca_int u.ca_int
76 #define ca_double u.ca_double
77 #define ca_str u.ca_str
78 #define ca_ptr u.ca_ptr
80 /* maximum no of args processed at any one time, not the max of all args */
81 #define CAMEL_ARGV_MAX (20)
86 CamelArg argv[CAMEL_ARGV_MAX];
89 struct _CamelArgGetV {
92 CamelArgGet argv[CAMEL_ARGV_MAX];
95 #define camel_argv_start(tv, last) va_start((tv)->ap, last)
96 #define camel_argv_end(tv) va_end((tv)->ap)
97 int camel_argv_build(CamelArgV *tv);
98 int camel_arggetv_build(CamelArgGetV *tv);
100 /* set an arg ignored */
101 #define camel_argv_ignore(tv, i) ((tv)->argv[i].tag = ((tv)->argv[i].tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE)
103 /* 'self-describing' property list */
104 typedef struct _CamelProperty CamelProperty;
106 struct _CamelProperty {
114 #endif /* CAMEL_ARG_H */