aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-arg.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-05-07 15:31:26 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-05-07 15:31:26 +0800
commit4655d888677e71962722ad86f255a27386e1e621 (patch)
treea72629c9b63c2b16ca71fc3b666735cfd14b6bef /camel/camel-arg.c
parent1acd03710d50072259f91bae1a9e2395c6bdfac7 (diff)
downloadgsoc2013-evolution-4655d888677e71962722ad86f255a27386e1e621.tar
gsoc2013-evolution-4655d888677e71962722ad86f255a27386e1e621.tar.gz
gsoc2013-evolution-4655d888677e71962722ad86f255a27386e1e621.tar.bz2
gsoc2013-evolution-4655d888677e71962722ad86f255a27386e1e621.tar.lz
gsoc2013-evolution-4655d888677e71962722ad86f255a27386e1e621.tar.xz
gsoc2013-evolution-4655d888677e71962722ad86f255a27386e1e621.tar.zst
gsoc2013-evolution-4655d888677e71962722ad86f255a27386e1e621.zip
Check for LOGIN xxxx as well if debug is on, so we dont print passwords to
2002-05-07 Not Zed <NotZed@Ximian.com> * 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 <prez@magick.tm> 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
Diffstat (limited to 'camel/camel-arg.c')
-rw-r--r--camel/camel-arg.c124
1 files changed, 124 insertions, 0 deletions
diff --git a/camel/camel-arg.c b/camel/camel-arg.c
new file mode 100644
index 0000000000..bc6ececd2e
--- /dev/null
+++ b/camel/camel-arg.c
@@ -0,0 +1,124 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- *
+ *
+ * Author:
+ * Michael Zucchi <notzed@ximian.com>
+ *
+ * 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
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "camel-arg.h"
+
+int camel_argv_build(CamelArgV *tv)
+{
+ register guint32 tag;
+ register int i;
+ register CamelArg *a;
+ int more = TRUE;
+
+ for (i=0;i<CAMEL_ARGV_MAX;i++) {
+ a = &tv->argv[i];
+
+ if ( (tag = va_arg(tv->ap, guint32)) == 0) {
+ more = FALSE;
+ break;
+ }
+
+ a->tag = tag;
+
+ switch((tag & CAMEL_ARG_TYPE)) {
+ case CAMEL_ARG_OBJ:
+ a->ca_object = va_arg(tv->ap, void *);
+ break;
+ case CAMEL_ARG_INT:
+ a->ca_int = va_arg(tv->ap, int);
+ break;
+ case CAMEL_ARG_DBL:
+ a->ca_double = va_arg(tv->ap, double);
+ break;
+ case CAMEL_ARG_STR:
+ a->ca_str = va_arg(tv->ap, char *);
+ break;
+ case CAMEL_ARG_PTR:
+ a->ca_ptr = va_arg(tv->ap, void *);
+ break;
+ default:
+ printf("Error, unknown type, truncating result\n");
+ more = FALSE;
+ goto fail;
+ }
+
+ }
+fail:
+ tv->argc = i;
+
+ return more;
+}
+
+int camel_arggetv_build(CamelArgGetV *tv)
+{
+ register guint32 tag;
+ register int i;
+ register CamelArgGet *a;
+ int more = TRUE;
+
+ for (i=0;i<CAMEL_ARGV_MAX;i++) {
+ a = &tv->argv[i];
+
+ if ( (tag = va_arg(tv->ap, guint32)) == 0) {
+ more = FALSE;
+ break;
+ }
+
+ a->tag = tag;
+
+ switch((tag & CAMEL_ARG_TYPE)) {
+ case CAMEL_ARG_OBJ:
+ a->ca_object = va_arg(tv->ap, void **);
+ *a->ca_object = NULL;
+ break;
+ case CAMEL_ARG_INT:
+ a->ca_int = va_arg(tv->ap, int *);
+ *a->ca_int = 0;
+ break;
+ case CAMEL_ARG_DBL:
+ a->ca_double = va_arg(tv->ap, double *);
+ *a->ca_double = 0.0;
+ break;
+ case CAMEL_ARG_STR:
+ a->ca_str = va_arg(tv->ap, char **);
+ *a->ca_str = NULL;
+ break;
+ case CAMEL_ARG_PTR:
+ a->ca_ptr = va_arg(tv->ap, void **);
+ *a->ca_ptr = NULL;
+ break;
+ default:
+ printf("Error, unknown type, truncating result\n");
+ more = FALSE;
+ goto fail;
+ }
+
+ }
+fail:
+ tv->argc = i;
+
+ return more;
+}