* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-data-wrapper.h"
static GtkObjectClass *parent_class=NULL;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-folder.h"
#include "gstring-util.h"
g_assert(folder->parent_store);
g_assert(folder->name);
- if ( CF_CLASS(folder)->exists(folder) ) return TRUE;
+ if (CF_CLASS(folder)->exists(folder))
+ return TRUE;
+
sep = camel_store_get_separator(folder->parent_store);
- if (folder->parent_folder) camel_folder_create(folder->parent_folder);
+ if (folder->parent_folder)
+ camel_folder_create(folder->parent_folder);
else {
if (folder->full_name) {
- dich_result = g_string_dichotomy(folder->full_name, sep, &prefix, NULL, DICHOTOMY_STRIP_TRAILING | DICHOTOMY_RIGHT_DIR);
+ dich_result = g_string_dichotomy(
+ folder->full_name, sep, &prefix, NULL,
+ GSTRING_DICHOTOMY_STRIP_TRAILING | GSTRING_DICHOTOMY_RIGHT_DIR);
if (dich_result!='o') {
g_warning("I have to handle the case where the path is not OK\n");
return FALSE;
* USA
*/
-
+#include <config.h>
#include "camel-log.h"
int camel_debug_level = 10;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-mime-message.h"
#include <stdio.h>
#include "gmime-content-field.h"
{
GList *recipients_list;
CAMEL_LOG (FULL_DEBUG,"CamelMimeMessage::_set_recipient_list_from_string parsing ##%s##\n", recipients_string->str);
- recipients_list = g_string_split (recipients_string, ',', "\t ", TRIM_STRIP_TRAILING | TRIM_STRIP_LEADING);
+ recipients_list = g_string_split (
+ recipients_string, ',', "\t ",
+ GSTRING_TRIM_STRIP_TRAILING | GSTRING_TRIM_STRIP_LEADING);
g_hash_table_insert (message->recipients, recipient_type, recipients_list);
}
CamelMimePartClass parent_class;
/* Virtual methods */
- void (*set_received_date) (CamelMimeMessage *mime_message, GString *received_date);
+ void (*set_received_date) (CamelMimeMessage *mime_message,
+ GString *received_date);
GString * (*get_received_date) (CamelMimeMessage *mime_message);
- GString * (*get_sent_date) (CamelMimeMessage *mime_message);
- void (*set_reply_to) (CamelMimeMessage *mime_message, GString *reply_to);
- GString * (*get_reply_to) (CamelMimeMessage *mime_message);
- void (*set_subject) (CamelMimeMessage *mime_message, GString *subject);
- GString * (*get_subject) (CamelMimeMessage *mime_message);
- void (*set_from) (CamelMimeMessage *mime_message, GString *from);
- GString * (*get_from) (CamelMimeMessage *mime_message);
- void (*add_recipient) (CamelMimeMessage *mime_message, GString *recipient_type, GString *recipient);
- void (*remove_recipient) (CamelMimeMessage *mime_message, GString *recipient_type, GString *recipient);
- GList * (*get_recipients) (CamelMimeMessage *mime_message, GString *recipient_type);
- void (*set_flag) (CamelMimeMessage *mime_message, GString *flag, gboolean value);
- gboolean (*get_flag) (CamelMimeMessage *mime_message, GString *flag);
-
- void (*set_message_number) (CamelMimeMessage *mime_message, guint number);
- guint (*get_message_number) (CamelMimeMessage *mime_message);
-
+ GString * (*get_sent_date) (CamelMimeMessage *mime_message);
+ void (*set_reply_to) (CamelMimeMessage *mime_message,
+ GString *reply_to);
+ GString * (*get_reply_to) (CamelMimeMessage *mime_message);
+ void (*set_subject) (CamelMimeMessage *mime_message,
+ GString *subject);
+ GString * (*get_subject) (CamelMimeMessage *mime_message);
+ void (*set_from) (CamelMimeMessage *mime_message,
+ GString *from);
+ GString * (*get_from) (CamelMimeMessage *mime_message);
+ void (*add_recipient) (CamelMimeMessage *mime_message,
+ GString *recipient_type,
+ GString *recipient);
+ void (*remove_recipient) (CamelMimeMessage *mime_message,
+ GString *recipient_type,
+ GString *recipient);
+ GList * (*get_recipients) (CamelMimeMessage *mime_message,
+ GString *recipient_type);
+ void (*set_flag) (CamelMimeMessage *mime_message,
+ GString *flag, gboolean value);
+ gboolean (*get_flag) (CamelMimeMessage *mime_message,
+ GString *flag);
+
+ void (*set_message_number)(CamelMimeMessage *mime_message,
+ guint number);
+ guint (*get_message_number)(CamelMimeMessage *mime_message);
} CamelMimeMessageClass;
CamelMimeMessage *camel_mime_message_new_with_session (CamelSession *session);
-void camel_mime_message_set_received_date (CamelMimeMessage *mime_message, GString *received_date);
-GString *camel_mime_message_get_received_date (CamelMimeMessage *mime_message);
-GString *camel_mime_message_get_sent_date (CamelMimeMessage *mime_message);
-void camel_mime_message_set_reply_to (CamelMimeMessage *mime_message, GString *reply_to);
-GString *camel_mime_message_get_reply_to (CamelMimeMessage *mime_message);
-void camel_mime_message_set_subject (CamelMimeMessage *mime_message, GString *subject);
-GString *camel_mime_message_get_subject (CamelMimeMessage *mime_message);
-void camel_mime_message_set_from (CamelMimeMessage *mime_message, GString *from);
-GString *camel_mime_message_get_from (CamelMimeMessage *mime_message);
-
-void camel_mime_message_add_recipient (CamelMimeMessage *mime_message, GString *recipient_type, GString *recipient);
-void camel_mime_message_remove_recipient (CamelMimeMessage *mime_message, GString *recipient_type, GString *recipient);
-GList *camel_mime_message_get_recipients (CamelMimeMessage *mime_message, GString *recipient_type);
-
-void camel_mime_message_set_flag (CamelMimeMessage *mime_message, GString *flag, gboolean value);
-gboolean camel_mime_message_get_flag (CamelMimeMessage *mime_message, GString *flag);
-
-guint camel_mime_message_get_message_number (CamelMimeMessage *mime_message);
+void camel_mime_message_set_received_date (CamelMimeMessage *mime_message,
+ GString *received_date);
+GString *camel_mime_message_get_received_date (CamelMimeMessage *mime_message);
+GString *camel_mime_message_get_sent_date (CamelMimeMessage *mime_message);
+void camel_mime_message_set_reply_to (CamelMimeMessage *mime_message,
+ GString *reply_to);
+GString *camel_mime_message_get_reply_to (CamelMimeMessage *mime_message);
+void camel_mime_message_set_subject (CamelMimeMessage *mime_message,
+ GString *subject);
+GString *camel_mime_message_get_subject (CamelMimeMessage *mime_message);
+void camel_mime_message_set_from (CamelMimeMessage *mime_message, GString *from);
+GString *camel_mime_message_get_from (CamelMimeMessage *mime_message);
+
+void camel_mime_message_add_recipient (CamelMimeMessage *mime_message,
+ GString *recipient_type,
+ GString *recipient);
+void camel_mime_message_remove_recipient (CamelMimeMessage *mime_message,
+ GString *recipient_type,
+ GString *recipient);
+GList *camel_mime_message_get_recipients (CamelMimeMessage *mime_message,
+ GString *recipient_type);
+
+void camel_mime_message_set_flag (CamelMimeMessage *mime_message,
+ GString *flag, gboolean value);
+gboolean camel_mime_message_get_flag (CamelMimeMessage *mime_message,
+ GString *flag);
+
+guint camel_mime_message_get_message_number (CamelMimeMessage *mime_message);
#ifdef __cplusplus
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-mime-part.h"
#include <stdio.h>
#include "gmime-content-field.h"
/* public methods */
-void camel_mime_part_add_header (CamelMimePart *mime_part, GString *header_name, GString *header_value);
-void camel_mime_part_remove_header (CamelMimePart *mime_part, GString *header_name);
-GString *camel_mime_part_get_header (CamelMimePart *mime_part, GString *header_name);
-void camel_mime_part_set_description (CamelMimePart *mime_part, GString *description);
-GString *camel_mime_part_get_description (CamelMimePart *mime_part);
-void camel_mime_part_set_disposition (CamelMimePart *mime_part, GString *disposition);
-GString *camel_mime_part_get_disposition (CamelMimePart *mime_part);
-void camel_mime_part_set_filename (CamelMimePart *mime_part, GString *filename);
-GString *camel_mime_part_get_filename (CamelMimePart *mime_part);
-GString *camel_mime_part_get_content_id (CamelMimePart *mime_part);
-GString *camel_mime_part_get_content_MD5 (CamelMimePart *mime_part);
-void camel_mime_part_set_encoding (CamelMimePart *mime_part, GString *encoding);
-GString *camel_mime_part_get_encoding (CamelMimePart *mime_part);
-void camel_mime_part_set_content_languages (CamelMimePart *mime_part, GList *content_languages);
-GList *camel_mime_part_get_content_languages (CamelMimePart *mime_part);
-void camel_mime_part_set_header_lines (CamelMimePart *mime_part, GList *header_lines);
-GList *camel_mime_part_get_header_lines (CamelMimePart *mime_part);
+void camel_mime_part_add_header (CamelMimePart *mime_part,
+ GString *header_name,
+ GString *header_value);
+void camel_mime_part_remove_header (CamelMimePart *mime_part,
+ GString *header_name);
+GString *camel_mime_part_get_header (CamelMimePart *mime_part,
+ GString *header_name);
+void camel_mime_part_set_description (CamelMimePart *mime_part,
+ GString *description);
+GString *camel_mime_part_get_description (CamelMimePart *mime_part);
+void camel_mime_part_set_disposition (CamelMimePart *mime_part,
+ GString *disposition);
+GString *camel_mime_part_get_disposition (CamelMimePart *mime_part);
+void camel_mime_part_set_filename (CamelMimePart *mime_part,
+ GString *filename);
+GString *camel_mime_part_get_filename (CamelMimePart *mime_part);
+GString *camel_mime_part_get_content_id (CamelMimePart *mime_part);
+GString *camel_mime_part_get_content_MD5 (CamelMimePart *mime_part);
+void camel_mime_part_set_encoding (CamelMimePart *mime_part,
+ GString *encoding);
+GString *camel_mime_part_get_encoding (CamelMimePart *mime_part);
+void camel_mime_part_set_content_languages (CamelMimePart *mime_part,
+ GList *content_languages);
+GList *camel_mime_part_get_content_languages (CamelMimePart *mime_part);
+void camel_mime_part_set_header_lines (CamelMimePart *mime_part,
+ GList *header_lines);
+GList *camel_mime_part_get_header_lines (CamelMimePart *mime_part);
#ifdef __cplusplus
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-service.h"
static GtkObjectClass *parent_class=NULL;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-session.h"
#include "gstring-util.h"
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-simple-data-wrapper.h"
static CamelDataWrapperClass *parent_class=NULL;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-store.h"
static GtkObjectClass *parent_class=NULL;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-stream-fs.h"
#include <sys/types.h>
#include <sys/stat.h>
static CamelStreamClass *parent_class=NULL;
-/* Returns the class for a CamelMimeMessage */
+/* Returns the class for a CamelStreamFS */
#define CS_CLASS(so) CAMEL_STREAM_FS_CLASS (GTK_OBJECT(so)->klass)
static gint _read (CamelStream *stream, gchar *buffer, gint n);
CAMEL_LOG (FULL_DEBUG, "Entering CamelStream::new_with_name, name=\"%s\", mode=%d\n", name->str, mode);
v = stat (name->str, &s);
- if (mode & CAMEL_STREAM_FS_READ)
- if (mode & CAMEL_STREAM_FS_WRITE) flags = O_RDWR | O_CREAT;
- else flags = O_RDONLY;
- else
- if (mode & CAMEL_STREAM_FS_WRITE) flags = O_WRONLY | O_CREAT;
- else return NULL;
-
+ if (mode & CAMEL_STREAM_FS_READ){
+ if (mode & CAMEL_STREAM_FS_WRITE)
+ flags = O_RDWR | O_CREAT;
+ else
+ flags = O_RDONLY;
+ } else {
+ if (mode & CAMEL_STREAM_FS_WRITE)
+ flags = O_WRONLY | O_CREAT;
+ else
+ return NULL;
+ }
if ( (mode & CAMEL_STREAM_FS_READ) && !(mode & CAMEL_STREAM_FS_WRITE) )
if (v == -1) return NULL;
CamelStream parent_object;
GString *name;
int fd;
-
} CamelStreamFs;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
-
+#include <config.h>
#include "camel-stream.h"
-static CamelStreamClass *parent_class=NULL;
+static CamelStreamClass *parent_class = NULL;
/* Returns the class for a CamelMimeMessage */
#define CS_CLASS(so) CAMEL_STREAM_CLASS (GTK_OBJECT(so)->klass)
-static gint _read (CamelStream *stream, gchar *buffer, gint n);
-static gint _write (CamelStream *stream, gchar *buffer, gint n);
-static void _flush (CamelStream *stream);
-static gint _available (CamelStream *stream);
-static gboolean _eos (CamelStream *stream);
-static void _close (CamelStream *stream);
+static void
+default_camel_flush (CamelStream *stream)
+{
+ /* nothing */
+}
+static void
+default_camel_close (CamelStream *stream)
+{
+ /* nothing */
+}
static void
camel_stream_class_init (CamelStreamClass *camel_stream_class)
parent_class = gtk_type_class (gtk_object_get_type ());
/* virtual method definition */
- camel_stream_class->read = _read;
- camel_stream_class->write = _write;
- camel_stream_class->flush = _flush;
- camel_stream_class->available = _available;
- camel_stream_class->eos = _eos;
- camel_stream_class->close = _close;
+ camel_stream_class->read = NULL;
+ camel_stream_class->write = NULL;
+ camel_stream_class->flush = default_camel_flush;
+ camel_stream_class->available = NULL;
+ camel_stream_class->eos = NULL;
+ camel_stream_class->close = default_camel_close;
/* virtual method overload */
-
}
-
-
GtkType
camel_stream_get_type (void)
{
return camel_stream_type;
}
-
-
/**
- * _read: read bytes from a stream
- * @stream: stream
- * @buffer: buffer where bytes are stored
- * @n: max number of bytes to read
- *
+ * camel_stream_read:
+ * @stream: a CamelStream.
+ * @buffer: buffer where bytes pulled from the stream are stored.
+ * @n: max number of bytes to read.
*
+ * Read at most @n bytes from the @stream object and stores them
+ * in the buffer pointed at by @buffer.
*
* Return value: number of bytes actually read.
**/
-static gint
-_read (CamelStream *stream, gchar *buffer, gint n)
-{
-
-}
-
gint
camel_stream_read (CamelStream *stream, gchar *buffer, gint n)
{
}
/**
- * _write: read bytes to a stream
- * @stream: the stream
- * @buffer: byte buffer
+ * camel_stream_write:
+ * @stream: a CamelStream object.
+ * @buffer: buffer to write.
* @n: number of bytes to write
- *
- *
- *
+ *
+ * Write @n bytes from the buffer pointed at by @buffer into @stream.
+ *
* Return value: the number of bytes actually written
* in the stream.
**/
-static gint
-_write (CamelStream *stream, gchar *buffer, gint n)
-{
-
-}
-
gint
camel_stream_write (CamelStream *stream, gchar *buffer, gint n)
{
- CS_CLASS (stream)->write (stream, buffer, n);
+ return CS_CLASS (stream)->write (stream, buffer, n);
}
-
-
/**
- * _flush: flush pending changes
- * @stream: the stream
- *
+ * camel_stream_flush:
+ * @stream: a CamelStream object
*
+ * Flushes the contents of the stream to its backing store.
**/
-static void
-_flush (CamelStream *stream)
+void
+camel_stream_flush (CamelStream *stream)
{
-
+ return CS_CLASS (stream)->flush (stream);
}
-
-
/**
- * _available: return the number of bytes available for reading
- * @stream: the stream
- *
- * Return the number of bytes available without blocking.
+ * camel_stream_available:
+ * @stream: a CamelStream object
*
- * Return value: the number of bytes available
+ * Return value: the number of bytes available.
**/
static gint
-_available (CamelStream *stream)
+camel_stream_available (CamelStream *stream)
{
-
+ return CS_CLASS (stream)->available (stream);
}
-
/**
- * _eos: test if there are bytes left to read
- * @stream: the stream
- *
+ * camle_stream_eos:
+ * @stream: a CamelStream object
*
+ * Test if there are bytes left to read on the @stream object.
*
- * Return value: true if all stream has been read
+ * Return value: %TRUE if all the contents on the stream has been read, or
+ * %FALSE if information is still available.
**/
static gboolean
-_eos (CamelStream *stream)
+camel_stream_eos (CamelStream *stream)
{
-
+ return CS_CLASS (stream)->eos (stream);
}
/**
- * _close: close a stream
- * @stream: the stream
- *
+ * camel_stram_close:
+ * @stream: a CamelStream object.
*
+ * Close the @stream object.
**/
-static void
-_close (CamelStream *stream)
-{
-
-}
-
void
camel_stream_close (CamelStream *stream)
{
CS_CLASS (stream)->close (stream);
}
-
-
-
-
/***************** Utility functions ********************/
+/**
+ * came_stream_write_strings:
+ * @stream: a CamelStream object.
+ * @...: A %NULL terminated list of strings.
+ *
+ * This is a utility function that writes the list of
+ * strings into the @stream object.
+ */
void
camel_stream_write_strings (CamelStream *stream, ... )
{
string = va_arg (args, char *);
while (string) {
- camel_stream_write_string(stream, string);
+ camel_stream_write_string (stream, string);
string = va_arg (args, char *);
}
va_end (args);
GtkObjectClass parent_class;
/* Virtual methods */
-gint (*read) (CamelStream *stream, gchar *buffer, gint n);
-gint (*write) (CamelStream *stream, gchar *buffer, gint n);
-void (*flush) (CamelStream *stream);
-gint (*available) (CamelStream *stream);
-gboolean (*eos) (CamelStream *stream);
-void (*close) (CamelStream *stream);
-
+ gint (*read) (CamelStream *stream, gchar *buffer, gint n);
+ gint (*write) (CamelStream *stream, gchar *buffer, gint n);
+ void (*flush) (CamelStream *stream);
+ gint (*available) (CamelStream *stream);
+ gboolean (*eos) (CamelStream *stream);
+ void (*close) (CamelStream *stream);
} CamelStreamClass;
/* public methods */
-gint camel_stream_read (CamelStream *stream, gchar *buffer, gint n);
-gint camel_stream_write (CamelStream *stream, gchar *buffer, gint n);
-void camel_stream_close (CamelStream *stream);
+gint camel_stream_read (CamelStream *stream, gchar *buffer, gint n);
+gint camel_stream_write (CamelStream *stream, gchar *buffer, gint n);
+void camel_stream_flush (CamelStream *stream);
+gint camel_stream_available (CamelStream *stream);
+gboolean camel_stream_eos (CamelStream *stream);
+void camel_stream_close (CamelStream *stream);
/* utility macros and funcs */
#define camel_stream_write_string(stream, string) camel_stream_write ((stream), (string), strlen (string))
* USA
*/
-
-
-
+#include <config.h>
#include "gmime-content-field.h"
#include "gstring-util.h"
#include "camel-log.h"
* USA
*/
-
-
+#include <config.h>
#include "gmime-utils.h"
#include "gstring-util.h"
#include "camel-log.h"
g_assert (header_table);
if ( (header_line) && (header_line->str) ) {
- dich_result = g_string_dichotomy(header_line, ':', &header_name, &header_value, DICHOTOMY_NONE);
+ dich_result = g_string_dichotomy (
+ header_line, ':', &header_name, &header_value,
+ GSTRING_DICHOTOMY_NONE);
if (dich_result != 'o')
camel_log(WARNING,
"store_header_pair_from_gstring : dichotomy result is %c"
"header line is :\n--\n%s\n--\n");
else {
- g_string_trim (header_value, " \t", TRIM_STRIP_LEADING | TRIM_STRIP_TRAILING);
+ g_string_trim (
+ header_value, " \t",
+ GSTRING_TRIM_STRIP_LEADING | GSTRING_TRIM_STRIP_TRAILING);
g_hash_table_insert (header_table, header_name, header_value);
}
}
-
+#include <config.h>
#include "gstring-util.h"
#include "camel-log.h"
/**
- * g_string_dichotomy : return the strings before and/or after
+ * g_string_dichotomy:
+ * @sep : separator
+ * @prefix: pointer to be field by the prefix object
+ * the prefix is not returned when the given pointer is NULL
+ * @suffix: pointer to be field by the suffix object
+ * the suffix is not returned when the given pointer is NULL
+ *
+ * Return the strings before and/or after
* the last occurence of the specified separator
*
* This routine returns the string before and/or after
* suffix is set to NULL and result is set to 'n'
* When the operation succedeed, the return value is 'o'
*
- * @sep : separator
- * @prefix: pointer to be field by the prefix object
- * the prefix is not returned when the given pointer is NULL
- * @suffix: pointer to be field by the suffix object
- * the suffix is not returned when the given pointer is NULL
- *
* @Return Value : result of the operation ('o', 'l' or 'n')
*
**/
gchar
-g_string_dichotomy (GString *string, gchar sep, GString **prefix, GString **suffix, DichotomyOption options)
+g_string_dichotomy (GString *string, gchar sep, GString **prefix, GString **suffix,
+ GStringDichotomyOption options)
{
gchar *str, *tmp;
gint pos, len, first;
g_assert( tmp=string->str );
len = strlen(tmp);
if (!len) {
- if (prefix) *prefix=NULL;
- if (suffix) *suffix=NULL;
+ if (prefix)
+ *prefix=NULL;
+ if (suffix)
+ *suffix=NULL;
CAMEL_LOG(FULL_DEBUG,"string_dichotomy: string is empty\n");
return 'n';
}
first = 0;
- if ( (options & DICHOTOMY_STRIP_LEADING ) && (tmp[first] == sep) )
+ if ( (options & GSTRING_DICHOTOMY_STRIP_LEADING ) && (tmp[first] == sep) )
do {first++;} while ( (first<len) && (tmp[first] == sep) );
- if (options & DICHOTOMY_STRIP_TRAILING )
+ if (options & GSTRING_DICHOTOMY_STRIP_TRAILING )
while (tmp[len-1] == sep)
len--;
return 'n';
}
- if (options & DICHOTOMY_RIGHT_DIR) {
+ if (options & GSTRING_DICHOTOMY_RIGHT_DIR) {
pos = len;
do {
GList *
-g_string_split (GString *string, char sep, gchar *trim_chars, TrimOption trim_options)
+g_string_split (GString *string, char sep, gchar *trim_chars, GStringTrimOption trim_options)
{
GList *result = NULL;
gint first, last, pos;
}
-
-
void
-g_string_trim (GString *string, gchar *chars, TrimOption options)
+g_string_trim (GString *string, gchar *chars, GStringTrimOption options)
{
gint first_ok;
gint last_ok;
CAMEL_LOG(FULL_DEBUG,"**\nentering g_string_trim::\n");
- if ((!string) || (!string->str)) return;
+ if ((!string) || (!string->str))
+ return;
str = string->str;
length = strlen (str);
- if (!length) return;
+ if (!length)
+ return;
first_ok = 0;
last_ok = length - 1;
CAMEL_LOG (FULL_DEBUG,"g_string_trim:: trim_options:%d\n", options);
- if (options & TRIM_STRIP_LEADING)
+ if (options & GSTRING_TRIM_STRIP_LEADING)
while ( (first_ok <= last_ok) && (strchr (chars, str[first_ok])) )
first_ok++;
- if (options & TRIM_STRIP_TRAILING)
+ if (options & GSTRING_TRIM_STRIP_TRAILING)
while ( (first_ok <= last_ok) && (strchr (chars, str[last_ok])) )
last_ok++;
- CAMEL_LOG (FULL_DEBUG,"g_string_trim::\n\t\"%s\":first ok:%d last_ok:%d\n", string->str, first_ok, last_ok);
- if (first_ok>0) g_string_erase (string, 0, first_ok);
- if (last_ok<length-1) g_string_truncate (string, last_ok - first_ok +1);
+ CAMEL_LOG (FULL_DEBUG,"g_string_trim::\n\t\"%s\":first ok:%d last_ok:%d\n",
+ string->str, first_ok, last_ok);
+
+ if (first_ok > 0)
+ g_string_erase (string, 0, first_ok);
+
+ if (last_ok < length-1)
+ g_string_truncate (string, last_ok - first_ok +1);
}
#include <glib.h>
typedef enum {
- DICHOTOMY_NONE = 0,
- DICHOTOMY_RIGHT_DIR = 1,
- DICHOTOMY_STRIP_TRAILING = 2,
- DICHOTOMY_STRIP_LEADING = 4,
+ GSTRING_DICHOTOMY_NONE = 0,
+ GSTRING_DICHOTOMY_RIGHT_DIR = 1,
+ GSTRING_DICHOTOMY_STRIP_TRAILING = 2,
+ GSTRING_DICHOTOMY_STRIP_LEADING = 4,
-} DichotomyOption;
+} GStringDichotomyOption;
typedef enum {
- TRIM_NONE = 0,
- TRIM_STRIP_TRAILING = 1,
- TRIM_STRIP_LEADING = 2,
-
-} TrimOption;
+ GSTRING_TRIM_NONE = 0,
+ GSTRING_TRIM_STRIP_TRAILING = 1,
+ GSTRING_TRIM_STRIP_LEADING = 2,
+} GStringTrimOption;
-gboolean g_string_equals(GString *string1, GString *string2);
-GString *g_string_clone(GString *string);
-gchar g_string_dichotomy( GString *string, gchar sep, GString **prefix, GString **suffix, DichotomyOption options);
-void g_string_append_g_string(GString *dest_string, GString *other_string);
+gboolean g_string_equals (GString *string1, GString *string2);
+GString *g_string_clone (GString *string);
+gchar g_string_dichotomy (GString *string, gchar sep,
+ GString **prefix, GString **suffix,
+ GStringDichotomyOption options);
+void g_string_append_g_string (GString *dest_string,
+ GString *other_string);
-gboolean g_string_equal_for_hash (gconstpointer v, gconstpointer v2);
+gboolean g_string_equal_for_hash (gconstpointer v, gconstpointer v2);
gboolean g_string_equal_for_glist (gconstpointer v, gconstpointer v2);
-guint g_string_hash (gconstpointer v);
-void g_string_list_free (GList *string_list);
+guint g_string_hash (gconstpointer v);
+void g_string_list_free (GList *string_list);
-GList *g_string_split (GString *string, char sep, gchar *trim_chars, TrimOption trim_options);
-void g_string_trim (GString *string, gchar *chars, TrimOption options);
+GList *g_string_split (GString *string, char sep,
+ gchar *trim_chars, GStringTrimOption trim_options);
+void g_string_trim (GString *string, gchar *chars,
+ GStringTrimOption options);
#ifdef __cplusplus
}
/*
XXX TODO: recover the words between #'s or ?'s after the path */
-
+#include <config.h>
#include "url-util.h"
/* general item finder */