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
29 #include "camel-arg.h"
31 int camel_argv_build(CamelArgV *tv)
38 for (i=0;i<CAMEL_ARGV_MAX;i++) {
41 if ( (tag = va_arg(tv->ap, guint32)) == 0) {
48 switch((tag & CAMEL_ARG_TYPE)) {
50 a->ca_object = va_arg(tv->ap, void *);
53 a->ca_int = va_arg(tv->ap, int);
56 a->ca_double = va_arg(tv->ap, double);
59 a->ca_str = va_arg(tv->ap, char *);
62 a->ca_ptr = va_arg(tv->ap, void *);
65 a->ca_int = va_arg(tv->ap, int) != 0;
68 printf("Error, unknown type, truncating result\n");
80 int camel_arggetv_build(CamelArgGetV *tv)
84 register CamelArgGet *a;
87 for (i=0;i<CAMEL_ARGV_MAX;i++) {
90 if ( (tag = va_arg(tv->ap, guint32)) == 0) {
97 switch((tag & CAMEL_ARG_TYPE)) {
99 a->ca_object = va_arg(tv->ap, void **);
100 *a->ca_object = NULL;
104 a->ca_int = va_arg(tv->ap, int *);
108 a->ca_double = va_arg(tv->ap, double *);
112 a->ca_str = va_arg(tv->ap, char **);
116 a->ca_ptr = va_arg(tv->ap, void **);
120 printf("Error, unknown type, truncating result\n");