From 4655d888677e71962722ad86f255a27386e1e621 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 7 May 2002 07:31:26 +0000 Subject: Check for LOGIN xxxx as well if debug is on, so we dont print passwords to 2002-05-07 Not Zed * camel-remote-store.c (remote_send_string): Check for LOGIN xxxx as well if debug is on, so we dont print passwords to evolution logs. * providers/imap/camel-imap-utils.c (imap_is_atom_char): This was really broken. 1. isprint() is locale dependent, and 2. it looked up an 8 bit value in a 7 bit table without truncating it. I've removed the isprint() stuff and just put it directly into the special table, which i've expanded to the right size too. * providers/imap/*: Applied patch from Preston Elder to make camel only use literals if it needs to for simple strings. Changed slightly to use imap_is_atom() and more consistent formatting. providers/imap/camel-imap-utils.c (imap_is_atom): Chagned from imap_needs_quoting(). ** Merged in camel-object2 branch. Simpler camelobject implementation + object args interface. * camel.c (camel_init): Call camel_object_get_type() to make sure camel_object_type is initialised. * camel-object.h (CAMEL_OBJECT_TYPE): Changed to return global camel_object_type pointer, not call camel_object_get_type. svn path=/trunk/; revision=16701 --- camel/camel-arg.h | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 camel/camel-arg.h (limited to 'camel/camel-arg.h') diff --git a/camel/camel-arg.h b/camel/camel-arg.h new file mode 100644 index 0000000000..7846018149 --- /dev/null +++ b/camel/camel-arg.h @@ -0,0 +1,109 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * Author: + * Michael Zucchi + * + * Copyright 2002 Ximian, Inc. (www.ximian.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +#ifndef CAMEL_ARG_H +#define CAMEL_ARG_H 1 + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus } */ + +#include +#include + +enum camel_arg_t { + CAMEL_ARG_END = 0, + CAMEL_ARG_IGNORE = 1, /* override/ignore an arg in-place */ + + CAMEL_ARG_FIRST = 1024, /* 1024 args reserved for arg system */ + + CAMEL_ARG_TYPE = 0xf0000000, /* type field for tags */ + CAMEL_ARG_TAG = 0x0fffffff, /* tag field for args */ + + CAMEL_ARG_OBJ = 0x00000000, /* object */ + CAMEL_ARG_INT = 0x10000000, /* int */ + CAMEL_ARG_DBL = 0x20000000, /* double */ + CAMEL_ARG_STR = 0x30000000, /* c string */ + CAMEL_ARG_PTR = 0x40000000, /* ptr */ +}; + +typedef struct _CamelArg CamelArg; +typedef struct _CamelArgV CamelArgV; + +typedef struct _CamelArgGet CamelArgGet; +typedef struct _CamelArgGetV CamelArgGetV; + +struct _CamelArg { + guint32 tag; + union { + void *ca_object; + int ca_int; + double ca_double; + char *ca_str; + void *ca_ptr; + } u; +}; +struct _CamelArgGet { + guint32 tag; + union { + void **ca_object; + int *ca_int; + double *ca_double; + char **ca_str; + void **ca_ptr; + } u; +}; +#define ca_object u.ca_object +#define ca_int u.ca_int +#define ca_double u.ca_double +#define ca_str u.ca_str +#define ca_ptr u.ca_ptr + +/* maximum no of args processed at any one time, not the max of all args */ +#define CAMEL_ARGV_MAX (20) + +struct _CamelArgV { + va_list ap; + int argc; + CamelArg argv[CAMEL_ARGV_MAX]; +}; + +struct _CamelArgGetV { + va_list ap; + int argc; + CamelArgGet argv[CAMEL_ARGV_MAX]; +}; + +#define camel_argv_start(tv, last) (va_start((tv)->ap, last)) +#define camel_argv_end(tv) (va_end((tv)->ap)) +int camel_argv_build(CamelArgV *tv); +int camel_arggetv_build(CamelArgGetV *tv); + +/* set an arg ignored */ +#define camel_argv_ignore(tv, i) ((tv)->argv[i].tag = ((tv)->argv[i].tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE) + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* CAMEL_ARG_H */ -- cgit v1.2.3