env->set_errcall (env, file_errcall);
/* Set the allocation routines to the non-aborting GLib functions */
- env->set_alloc (env, (gpointer (*)(size_t))g_try_malloc,
- (gpointer (*)(gpointer , size_t))g_try_realloc,
+ env->set_alloc (env, (gpointer (*)(gsize))g_try_malloc,
+ (gpointer (*)(gpointer , gsize))g_try_realloc,
g_free);
db_error = (*env->open) (env, NULL, DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_THREAD, 0);
* prototype that db_env_set_func_open() wants for the open method.
*/
-static int
+static gint
my_open (const gchar *name, gint oflag, ...)
{
gint mode = 0;
if (oflag & O_CREAT) {
va_list arg;
va_start (arg, oflag);
- mode = va_arg (arg, int);
+ mode = va_arg (arg, gint);
va_end (arg);
}
e_book_backend_google_create_contact (EBookBackendSync *backend,
EDataBook *book,
guint32 opid,
- const char *vcard_str,
+ const gchar *vcard_str,
EContact **out_contact)
{
EBookBackendGooglePrivate *priv;
e_book_backend_google_modify_contact (EBookBackendSync *backend,
EDataBook *book,
guint32 opid,
- const char *vcard_str,
+ const gchar *vcard_str,
EContact **out_contact)
{
EBookBackendGooglePrivate *priv;
e_book_backend_google_get_contact (EBookBackendSync *backend,
EDataBook *book,
guint32 opid,
- const char *uid,
- char **vcard_str)
+ const gchar *uid,
+ gchar **vcard_str)
{
EBookBackendGooglePrivate *priv;
EBookBackendSyncStatus status = GNOME_Evolution_Addressbook_OtherError;
e_book_backend_google_get_contact_list (EBookBackendSync *backend,
EDataBook *book,
guint32 opid,
- const char *query,
+ const gchar *query,
GList **contacts)
{
EBookBackendGooglePrivate *priv;
e_book_backend_google_authenticate_user (EBookBackendSync *backend,
EDataBook *book,
guint32 opid,
- const char *username,
- const char *password,
- const char *auth_method)
+ const gchar *username,
+ const gchar *password,
+ const gchar *auth_method)
{
EBookBackendGooglePrivate *priv;
EBookBackendSyncStatus status = GNOME_Evolution_Addressbook_Success;
e_book_backend_google_get_changes (EBookBackendSync *backend,
EDataBook *book,
guint32 opid,
- const char *change_id,
+ const gchar *change_id,
GList **changes_out)
{
__debug__ (G_STRFUNC);
if (old_ims && new_ims) {
old_ims_copy = g_list_copy (old_ims);
- for ( ; new_ims != NULL; new_ims = g_list_next (new_ims)) {
+ for (; new_ims != NULL; new_ims = g_list_next (new_ims)) {
im1 = new_ims->data;
temp = old_ims;
populate_birth_date (EContact *contact, gpointer data)
{
EGwItem *item;
- gchar *value ;
+ gchar *value;
EContactDate *date;
item = E_GW_ITEM (data);
item = E_GW_ITEM (data);
email_list = e_gw_item_get_email_list(item);
- for (i =0 ; i < 3 && email_list; i++, email_list = g_list_next (email_list)) {
+ for (i =0; i < 3 && email_list; i++, email_list = g_list_next (email_list)) {
if (email_list->data)
e_contact_set (contact, email_fields[i], email_list->data);
}
contact = E_CONTACT (data);
email_list = NULL;
- for (i =0 ; i < 3; i++) {
+ for (i =0; i < 3; i++) {
email = e_contact_get (contact, email_fields[i]);
if(email)
email_list = g_list_append (email_list, g_strdup (email));
if (old_list && new_list) {
old_list_copy = g_list_copy (old_list);
- for ( ; new_list != NULL; new_list = g_list_next (new_list)) {
+ for (; new_list != NULL; new_list = g_list_next (new_list)) {
string1 = new_list->data;
temp = old_list;
populate_full_name (EContact *contact, gpointer data)
{
EGwItem *item;
- FullName *full_name ;
+ FullName *full_name;
gchar *full_name_string;
item = E_GW_ITEM(data);
emails_without_ids = NULL;
dest_without_ids = NULL;
- for ( ;temp != NULL; temp = g_list_next (temp)) {
+ for (;temp != NULL; temp = g_list_next (temp)) {
EVCardAttribute *attr = temp->data;
EDestination *dest;
id = email = NULL;
* arbitrary contacts and then add them as members to the group.
*/
- temp = emails_without_ids ;
+ temp = emails_without_ids;
dtemp = dest_without_ids;
- for (; temp != NULL && dtemp != NULL ; temp = g_list_next (temp), dtemp = g_list_next(dtemp)) {
+ for (; temp != NULL && dtemp != NULL; temp = g_list_next (temp), dtemp = g_list_next(dtemp)) {
EContact *new_contact = e_contact_new ();
EGwItem *new_item = e_gw_item_new_empty ();
FullName *full_name;
static void
set_member_changes (EGwItem *new_item, EGwItem *old_item, EBookBackendGroupwise *egwb)
{
- GList *old_members, *new_members ;
+ GList *old_members, *new_members;
GList *old_ids, *new_ids, *additions, *deletions;
old_ids = new_ids = additions = deletions = NULL;
old_members = e_gw_item_get_member_list (old_item);
new_members = e_gw_item_get_member_list (new_item);
- for ( ;old_members != NULL; old_members = g_list_next (old_members)) {
+ for (;old_members != NULL; old_members = g_list_next (old_members)) {
EGroupMember *member;
member = (EGroupMember *)old_members->data;
old_ids = g_list_append (old_ids, member->id);
}
- for ( ;new_members != NULL; new_members = g_list_next (new_members)) {
+ for (;new_members != NULL; new_members = g_list_next (new_members)) {
EGroupMember *member;
member = (EGroupMember *)new_members->data;
new_ids = g_list_append (new_ids, member->id);
if (old_category_list && new_category_list) {
old_categories_copy = g_list_copy (old_category_list);
- for ( ; new_category_list != NULL; new_category_list = g_list_next (new_category_list)) {
+ for (; new_category_list != NULL; new_category_list = g_list_next (new_category_list)) {
category1 = new_category_list->data;
temp = old_category_list;
categories_matched = FALSE;
return;
}
- for ( ; id_list != NULL; id_list = g_list_next (id_list)) {
+ for (; id_list != NULL; id_list = g_list_next (id_list)) {
id = (gchar *) id_list->data;
e_gw_connection_remove_item (ebgw->priv->cnc, ebgw->priv->container_id, id);
deleted_ids = g_list_append (deleted_ids, id);
const gchar *id)
{
EBookBackendGroupwise *gwb;
- gint status ;
+ gint status;
EGwItem *item;
EContact *contact;
gchar *vcard;
gboolean is_auto_completion = FALSE;
gchar *search_string = NULL;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
gwb = closure->bg;
gw_items = NULL;
gchar *status_msg;
GTimeVal start, end;
GTimeVal tstart, tend;
- unsigned long diff;
+ gulong diff;
if(!ebgw)
return NULL;
gchar *query_string;
GList *contacts, *temp_list = NULL;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
if (enable_debug) {
g_get_current_time(&start);
EDataBookView *book_view;
GroupwiseBackendSearchClosure *closure;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
if (!ebgw)
return FALSE;
EBookBackendGroupwisePrivate *priv;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
gchar *cache_file_name;
struct stat buf;
time_t mod_time;
if (!ebgw->priv->file_db) {
e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_OtherError);
- return ;
+ return;
}
if (e_book_backend_db_cache_is_populated (ebgw->priv->file_db)) {
if (enable_debug)
if (enable_debug)
printf ("\ne_book_backend_groupwise_get_supported_fields...\n");
- for (i = 0; i < G_N_ELEMENTS (mappings) ; i ++)
+ for (i = 0; i < G_N_ELEMENTS (mappings); i ++)
fields = g_list_append (fields, g_strdup (e_contact_field_name (mappings[i].field_id)));
fields = g_list_append (fields, g_strdup (e_contact_field_name (E_CONTACT_EMAIL_2)));
fields = g_list_append (fields, g_strdup (e_contact_field_name (E_CONTACT_EMAIL_3)));
GHashTable *attr_hash = g_hash_table_new (g_str_hash, g_str_equal);
for (i = 0; i < num_prop_infos; i ++)
- g_hash_table_insert (attr_hash, (gpointer) prop_info[i].ldap_attr, (gchar*)e_contact_field_name (prop_info[i].field_id));
+ g_hash_table_insert (attr_hash, (gpointer) prop_info[i].ldap_attr, (gchar *)e_contact_field_name (prop_info[i].field_id));
if (oc->oc_at_oids_must)
add_to_supported_fields (bl, oc->oc_at_oids_must, attr_hash);
}
#endif
-static int
+static gint
query_ldap_root_dse (EBookBackendLDAP *bl)
{
#define MAX_DSE_ATTRS 20
EBookBackendLDAPPrivate *blpriv = bl->priv;
gint protocol_version = LDAP_VERSION3;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
#ifdef SUNLDAP
gint ldap_flag;
#endif
e_book_backend_ldap_reconnect (EBookBackendLDAP *bl, EDataBookView *book_view, gint ldap_status)
{
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
if (enable_debug) {
printf ("e_book_backend_ldap_reconnect ... \n");
g_static_rec_mutex_unlock (&bl->priv->op_hash_mutex);
}
-static int
+static gint
ldap_error_to_response (gint ldap_error)
{
if (ldap_error == LDAP_SUCCESS)
EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
gint msg_type;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
if (enable_debug) {
printf ("get_contact_handler ... \n");
EDataBookView *book_view;
gint ldap_error;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
switch (bl->priv->mode) {
LDAPMessage *e;
gint msg_type;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
if (enable_debug) {
printf ("contact_list_handler ...\n");
gint ldap_error;
gchar *ldap_query;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
if (enable_debug) {
printf ("e_book_backend_ldap_get_contact_list ... \n");
ldap_data->list = g_list_prepend(ldap_data->list, g_strjoinv(" ", strings));
- for (i = 0 ; i < argc + 2; i ++)
+ for (i = 0; i < argc + 2; i ++)
g_free (strings[i]);
g_free (strings);
ldap_data->list = g_list_prepend(ldap_data->list, g_strjoinv(" ", strings));
- for (i = 0 ; i < argc + 2; i ++)
+ for (i = 0; i < argc + 2; i ++)
g_free (strings[i]);
g_free (strings);
strings[2] = data.list->data;
strings[3] = g_strdup (")");
retval = g_strjoinv (" ", strings);
- for (i = 0 ; i < 4; i ++)
+ for (i = 0; i < 4; i ++)
g_free (strings[i]);
g_free (strings);
}
do {
g_static_rec_mutex_lock (&eds_ldap_handler_lock);
if ((ldap_error = ldap_search_ext_s (bl->priv->ldap,
- values[j],
- LDAP_SCOPE_BASE,
- NULL,
- (gchar **) grpattrs, 0,
- NULL,
- NULL,
- NULL,
- view_limit,
- &result)) == LDAP_SUCCESS) {
+ values[j],
+ LDAP_SCOPE_BASE,
+ NULL,
+ (gchar **) grpattrs, 0,
+ NULL,
+ NULL,
+ NULL,
+ view_limit,
+ &result)) == LDAP_SUCCESS) {
/* find the e-mail ids of members */
cn_values = ldap_get_values (bl->priv->ldap, result, "cn");
email_values = ldap_get_values (bl->priv->ldap, result, "mail");
LDAPMessage *e;
gint msg_type;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
d(printf ("ldap_search_handler (%p)\n", view));
if (enable_debug)
GList *contacts;
GList *l;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
if (enable_debug) {
printf ("e_book_backend_ldap_search ... \n");
gint msg_type;
EDataBookView *book_view;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
if (enable_debug) {
printf ("generate_cache_handler ... \n");
gint contact_list_msgid;
gint ldap_error;
GTimeVal start, end;
- unsigned long diff;
+ gulong diff;
if (enable_debug) {
printf ("generating offline cache ... \n");
if (status != GNOME_Evolution_Addressbook_Success) {
e_data_book_respond_authenticate_user (book,
opid, status);
- return ;
+ return;
}
}
if (status != GNOME_Evolution_Addressbook_Success) {
e_data_book_respond_authenticate_user (book,
opid, status);
- return ;
+ return;
}
}
ldap_error = ldap_sasl_bind_s (bl->priv->ldap,
gchar *sval;
};
-static int
+static gint
get_token( const gchar ** sp, gchar ** token_val )
{
gint kind;
static gchar *ldap_utf8_strchr( const gchar *str, const gchar *chr )
{
- for( ; *str != '\0'; LDAP_UTF8_INCR(str) ) {
+ for(; *str != '\0'; LDAP_UTF8_INCR(str) ) {
if( ldap_x_utf8_to_ucs4( str ) == ldap_x_utf8_to_ucs4( chr ) ) {
return (gchar *) str;
}
return NULL;
}
-static size_t ldap_utf8_strcspn( const gchar *str, const gchar *set )
+static gsize ldap_utf8_strcspn( const gchar *str, const gchar *set )
{
const gchar *cstr;
const gchar *cset;
return cstr - str;
}
-static size_t ldap_utf8_strspn( const gchar *str, const gchar *set )
+static gsize ldap_utf8_strspn( const gchar *str, const gchar *set )
{
const gchar *cstr;
const gchar *cset;
typedef struct ldap_url_desc {
struct ldap_url_desc *lud_next;
- char *lud_scheme;
- char *lud_host;
- int lud_port;
- char *lud_dn;
- char **lud_attrs;
- int lud_scope;
- char *lud_filter;
- char **lud_exts;
- int lud_crit_exts;
+ gchar *lud_scheme;
+ gchar *lud_host;
+ gint lud_port;
+ gchar *lud_dn;
+ gchar **lud_attrs;
+ gint lud_scope;
+ gchar *lud_filter;
+ gchar **lud_exts;
+ gint lud_crit_exts;
} LDAPURLDesc;
/* from url.c */
LDAP_FREE( ludp );
}
-static int
+static gint
ldap_int_unhex( gint c )
{
return( c >= '0' && c <= '9' ? c - '0'
* Remove URL hex escapes from s... done in place. The basic concept for
* this routine is borrowed from the WWW library HTUnEscape() routine.
*/
- char *p;
+ gchar *p;
for ( p = s; *s != '\0'; ++s ) {
if ( *s == '%' ) {
static gchar **
ldap_str2charray( const gchar *str_in, const gchar *brkstr )
{
- char **res;
- char *str, *s;
- char *lasts;
- int i;
+ gchar **res;
+ gchar *str, *s;
+ gchar *lasts;
+ gint i;
/* protect the input string from strtok */
str = LDAP_STRDUP( str_in );
res[i] = LDAP_STRDUP( s );
if(res[i] == NULL) {
- for( --i ; i >= 0 ; i-- ) {
+ for( --i; i >= 0; i-- ) {
LDAP_FREE( res[i] );
}
LDAP_FREE( res );
return( res );
}
-static int
+static gint
ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
{
/*
*/
LDAPURLDesc *ludp;
- char *p, *q, *r;
- int i, enclosed;
+ gchar *p, *q, *r;
+ gint i, enclosed;
const gchar *scheme = NULL;
const gchar *url_tmp;
gchar *url;
}
if ( q != NULL ) {
- char *next;
+ gchar *next;
*q++ = '\0';
ldap_pvt_hex_unescape( q );
return LDAP_URL_SUCCESS;
}
-static int
+static gint
ldap_url_parse( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
{
gint rc = ldap_url_parse_ext( url_in, ludpp );
break;
if (book_view != NULL) {
- float percent = 100.0 / count * i;
+ gfloat percent = 100.0 / count * i;
gchar buf[100];
- snprintf(buf, sizeof(buf), "Loading Contacts (%d%%)", (int)percent);
+ snprintf(buf, sizeof(buf), "Loading Contacts (%d%%)", (gint)percent);
e_data_book_view_notify_status_message(book_view, buf);
}
{
GString *str = g_string_new ("(");
GString *encoded = g_string_new ("");
- int i;
- char *s = NULL;
+ gint i;
+ gchar *s = NULL;
const gchar *cs;
switch (q->type) {
{
CORBA_Environment ev;
Bonobo_ServerInfoList *info_list = NULL;
- int i;
+ gint i;
const gchar *query;
GList *factories = NULL;
if (attr) {
GList *v = e_vcard_attribute_get_values (attr);
- rv = v && v->data && !g_ascii_strcasecmp ((char*)v->data, "true");
+ rv = v && v->data && !g_ascii_strcasecmp ((gchar *)v->data, "true");
return rv ? (gpointer) "1" : NULL;
}
}
} EContactName;
typedef struct {
- double latitude;
- double longitude;
+ gdouble latitude;
+ gdouble longitude;
} EContactGeo;
typedef enum {
/* Q: Please tell me this is only for assertion
reasons. If this is considered to be ok behavior then you
- shouldn't use g_return's. Just a reminder ;-)
+ shouldn't use g_return's. Just a reminder;-)
A: Yes, this is just an assertion. (Though it does find the
length of the vector in the process...)
strv = g_new0 (gchar *, len + 1);
for (i = 0, j = 0; destv[i]; i++) {
if (!e_destination_empty (destv[i])) {
- const char *addr = e_destination_get_address (destv[i]);
- strv[j++] = addr ? (char *) addr : (gchar *) "";
+ const gchar *addr = e_destination_get_address (destv[i]);
+ strv[j++] = addr ? (gchar *) addr : (gchar *) "";
}
}
gint suffix_idx;
} ENameWesternIdxs;
-static int
+static gint
e_name_western_str_count_words (const gchar *str)
{
gint word_count;
return g_string_free (words, FALSE);
}
-static int
+static gint
e_name_western_max (const gint a, const gint b)
{
if (a > b)
idxs->nick_idx = start_idx;
}
-static int
+static gint
e_name_western_last_get_max_idx (ENameWestern *name, ENameWesternIdxs *idxs)
{
gint max_idx = -1;
/* skip forward until we hit a character in @s, CRLF, or \0. leave *p
pointing at the character that causes us to stop */
static void
-skip_until (char **p, const char *s)
+skip_until (gchar **p, const gchar *s)
{
gchar *lp;
while (*lp != '\r' && *lp != '\0') {
gboolean s_matches = FALSE;
- const char *ls;
+ const gchar *ls;
for (ls = s; *ls; ls = g_utf8_next_char (ls)) {
if (g_utf8_get_char (ls) == g_utf8_get_char (lp)) {
s_matches = TRUE;
}
else {
if (str->len > 0) {
- const char *param_name;
+ const gchar *param_name;
if (!g_ascii_strcasecmp (str->str,
"quoted-printable")) {
param_name = "ENCODING";
static void
parse (EVCard *evc, const gchar *str)
{
- gchar *buf ;
+ gchar *buf;
gchar *p;
EVCardAttribute *attr;
g_string_append (attr_str, escaped_value);
if (v->next) {
/* XXX toshok - i hate you, rfc 2426.
- why doesn't CATEGORIES use a ; like
+ why doesn't CATEGORIES use a; like
a normal list attribute? */
if (!g_ascii_strcasecmp (attr->name, "CATEGORIES"))
g_string_append_c (attr_str, ',');
lcache = l = e_file_cache_get_objects (E_FILE_CACHE (cache));
- for ( ; l != NULL; l = g_slist_next (l)) {
+ for (; l != NULL; l = g_slist_next (l)) {
vcard_str = l->data;
if (vcard_str && !strncmp (vcard_str, "BEGIN:VCARD", 11)) {
contact = e_contact_new_from_vcard (vcard_str);
e_book_backend_db_cache_get_contact (DB *db, const gchar *uid)
{
DBT uid_dbt, vcard_dbt;
- int db_error;
+ gint db_error;
EContact *contact = NULL;
g_return_val_if_fail (uid != NULL, NULL);
EContact *contact)
{
DBT uid_dbt, vcard_dbt;
- int db_error;
- char *vcard_str;
+ gint db_error;
+ gchar *vcard_str;
const gchar *uid;
uid = e_contact_get_const (contact, E_CONTACT_UID);
{
DBT uid_dbt;
- int db_error;
+ gint db_error;
g_return_val_if_fail (uid != NULL, FALSE);
e_book_backend_db_cache_check_contact (DB *db, const gchar *uid)
{
DBT uid_dbt, vcard_dbt;
- int db_error;
+ gint db_error;
g_return_val_if_fail (uid != NULL, FALSE);
{
DBC *dbc;
DBT uid_dbt, vcard_dbt;
- int db_error;
+ gint db_error;
GList *list = NULL;
EBookBackendSExp *sexp = NULL;
EContact *contact;
e_book_backend_db_cache_set_populated (DB *db)
{
DBT uid_dbt, vcard_dbt;
- int db_error;
+ gint db_error;
string_to_dbt ("populated", &uid_dbt);
string_to_dbt ("TRUE", &vcard_dbt);
e_book_backend_db_cache_is_populated (DB *db)
{
DBT uid_dbt, vcard_dbt;
- int db_error;
+ gint db_error;
string_to_dbt ("populated", &uid_dbt);
memset(&vcard_dbt, 0, sizeof(vcard_dbt));
#define QUERY_STRING1
#define QUERY_STRING2
-static const gchar* queries[] = {
+static const gchar * queries[] = {
"(exists \"full_name\")",
"(contains \"full_name\" \"Miguel\")"
}
#if 0
-static int
+static gint
xp_object_get_number (xmlXPathObjectPtr result)
{
gint ret = -1;
GList *cobjs, *created = NULL, *modified = NULL, *put_to_cache = NULL;
GList *citer;
gboolean res;
- int len;
+ gint len;
gint i;
priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
ECalBackendSyncStatus result;
ECalBackendCalDAVPrivate *priv;
ESource *source;
- const char *os_val;
+ const gchar *os_val;
const gchar *uri;
gsize len;
const gchar *refresh;
}
buf = icalcomponent_as_ical_string_r (priv->icalcomp);
- g_output_stream_write_all (G_OUTPUT_STREAM (stream), buf, strlen (buf) * sizeof (char), NULL, NULL, &e);
+ g_output_stream_write_all (G_OUTPUT_STREAM (stream), buf, strlen (buf) * sizeof (gchar), NULL, NULL, &e);
g_free (buf);
if (e) {
attach_store = g_build_filename (g_get_home_dir (),
".evolution/calendar/local/system", NULL);
- for (l = attach_list; l ; l = l->next) {
+ for (l = attach_list; l; l = l->next) {
gchar *sfname = (gchar *)l->data;
gchar *filename, *new_filename;
GMappedFile *mapped_file;
}
-static int
+static gint
get_actual_count (ECalComponent *comp, ECalBackendGroupwise *cbgw)
{
gint count = 0;
/* Show the progress information */
num++;
- percent = ((float) num/total) * 100;
+ percent = ((gfloat) num/total) * 100;
/* FIXME The total obtained from the server is wrong. Sometimes the num can
be greater than the total. The following makes sure that the percentage is not >= 100 */
icalcomponent *ical_comp;
struct icaltimetype itt;
ECalComponentDateTime dt;
- char *uid;
+ gchar *uid;
GSList *text_list = NULL;
ECalComponentText *description;
ESource *source;
}
}
-static int
+static gint
decodePOP (gchar data)
{
gint ret;
}
static void
-decodeSnowfall (gchar *data, float *low, float *high)
+decodeSnowfall (gchar *data, gfloat *low, gfloat *high)
{
gchar num[3];
num[2] = '\0';
gint fahrenheit = atoi(data);
if (fahrenheit >= 900)
fahrenheit = (fahrenheit - 900) * -1;
- return ((float)(fahrenheit-32)) * 5.0f / 9.0f;
+ return ((gfloat)(fahrenheit-32)) * 5.0f / 9.0f;
}
static void
{
icaltimezone *icomp;
const gchar *tail;
- size_t len;
+ gsize len;
gchar *buffer;
icomp = icaltimezone_get_builtin_timezone (location);
{
const gchar *location;
const gchar *systzid;
- size_t len = strlen(tzid);
- ssize_t eostr;
+ gsize len = strlen(tzid);
+ gssize eostr;
/*
* Try without any trailing spaces/digits: they might have been added
if (counter) {
gchar *fulltzid = g_strdup_printf("TZID:%s", value);
- size_t baselen = strlen("TZID:") + strlen(tzid);
- size_t fulllen = strlen(fulltzid);
+ gsize baselen = strlen("TZID:") + strlen(tzid);
+ gsize fulllen = strlen(fulltzid);
gchar *tzidprop;
/*
* Map TZID with counter suffix back to basename.
}
/* Counts the elements in the by_xxx fields of an icalrecurrencetype */
-static int
+static gint
count_by_xxx (short *field, gint max_elements)
{
gint i;
l = NULL;
for (i = 0; i < max_elements && array[i] != ICAL_RECURRENCE_ARRAY_MAX; i++)
- l = g_list_prepend (l, GINT_TO_POINTER ((int) (array[i])));
+ l = g_list_prepend (l, GINT_TO_POINTER ((gint) (array[i])));
return g_list_reverse (l);
}
system_timezone_read_etc_localtime_content (void)
{
struct stat stat_localtime;
- char *localtime_content = NULL;
+ gchar *localtime_content = NULL;
gsize localtime_content_len = -1;
- char *retval;
+ gchar *retval;
if (g_stat (ETC_LOCALTIME, &stat_localtime) != 0)
return NULL;
/* Returns the number of days in the month. Year is the normal year, e.g. 2001.
Month is 0 (Jan) to 11 (Dec). */
-int time_days_in_month (gint year, gint month);
+gint time_days_in_month (gint year, gint month);
/* Returns the 1-based day number within the year of the specified date.
Year is the normal year, e.g. 2001. Month is 0 to 11. */
-int time_day_of_year (gint day, gint month, gint year);
+gint time_day_of_year (gint day, gint month, gint year);
/* Returns the day of the week for the specified date, 0 (Sun) to 6 (Sat).
For the days that were removed on the Gregorian reformation, it returns
Thursday. Year is the normal year, e.g. 2001. Month is 0 to 11. */
-int time_day_of_week (gint day, gint month, gint year);
+gint time_day_of_week (gint day, gint month, gint year);
/* Returns whether the specified year is a leap year. Year is the normal year,
e.g. 2001. */
/* Returns the number of leap years since year 1 up to (but not including) the
specified year. Year is the normal year, e.g. 2001. */
-int time_leap_years_up_to (gint year);
+gint time_leap_years_up_to (gint year);
/* Convert to or from an ISO 8601 representation of a time, in UTC,
e.g. "20010708T183000Z". */
ESExpResult *result;
icaltimezone *zone;
ECalComponentDateTime dt;
- time_t due_t ;
+ time_t due_t;
gboolean retval;
/* Check argument types */
else if (g_str_equal (pr, "LOW") && *priority > 5)
return TRUE;
else if (g_str_equal (pr, "UNDEFINED") && (!priority || !*priority))
- return TRUE ;
+ return TRUE;
return FALSE;
}
static gboolean
matches_status (ECalComponent *comp ,const gchar *str)
{
- icalproperty_status status ;
+ icalproperty_status status;
if (!*str)
return FALSE;
uristr = e_cal_backend_get_uri (backend);
g_assert (uristr != NULL);
- uri = g_strdup_printf("%s:%d", uristr, (int)e_cal_backend_get_kind(backend));
+ uri = g_strdup_printf("%s:%d", uristr, (gint)e_cal_backend_get_kind(backend));
g_mutex_lock (priv->backends_mutex);
return CORBA_OBJECT_NIL;
}
- uri_type_string = g_strdup_printf ("%s:%d", str_uri, (int)calobjtype_to_icalkind (type));
+ uri_type_string = g_strdup_printf ("%s:%d", str_uri, (gint)calobjtype_to_icalkind (type));
g_free(str_uri);
/* Find the associated backend factory (if any) */
if (e_cal_component_is_instance (comp)) {
gchar *str;
- str = e_cal_component_get_recurid_as_string (comp) ;
+ str = e_cal_component_get_recurid_as_string (comp);
real_uid = g_strdup_printf ("%s@%s", uid, str);
g_free (str);
} else
lib_LTLIBRARIES = libcamel-1.2.la libcamel-provider-1.2.la
INCLUDES = -I.. -I$(srcdir)/.. \
- -I$(top_srcdir)/intl \
-DCAMEL_LIBEXECDIR=\""$(camellibexecdir)"\" \
-DCAMEL_PROVIDERDIR=\""$(camel_providerdir)"\" \
-DG_LOG_DOMAIN=\"camel\" \
CamelType camel_address_get_type (void);
CamelAddress *camel_address_new (void);
CamelAddress *camel_address_new_clone (const CamelAddress *addr);
-int camel_address_length (CamelAddress *addr);
+gint camel_address_length (CamelAddress *addr);
-int camel_address_decode (CamelAddress *addr, const gchar *raw);
-char *camel_address_encode (CamelAddress *addr);
-int camel_address_unformat (CamelAddress *addr, const gchar *raw);
-char *camel_address_format (CamelAddress *addr);
+gint camel_address_decode (CamelAddress *addr, const gchar *raw);
+gchar *camel_address_encode (CamelAddress *addr);
+gint camel_address_unformat (CamelAddress *addr, const gchar *raw);
+gchar *camel_address_format (CamelAddress *addr);
-int camel_address_cat (CamelAddress *dest, const CamelAddress *source);
-int camel_address_copy (CamelAddress *dest, const CamelAddress *source);
+gint camel_address_cat (CamelAddress *dest, const CamelAddress *source);
+gint camel_address_copy (CamelAddress *dest, const CamelAddress *source);
void camel_address_remove (CamelAddress *addr, gint index);
a->ca_object = va_arg(tv->ap, gpointer );
break;
case CAMEL_ARG_INT:
- a->ca_int = va_arg(tv->ap, int);
+ a->ca_int = va_arg(tv->ap, gint);
break;
case CAMEL_ARG_DBL:
a->ca_double = va_arg(tv->ap, double);
a->ca_ptr = va_arg(tv->ap, gpointer );
break;
case CAMEL_ARG_BOO:
- a->ca_int = va_arg(tv->ap, int) != 0;
+ a->ca_int = va_arg(tv->ap, gint) != 0;
break;
default:
printf("Error, unknown type, truncating result\n");
*a->ca_int = 0;
break;
case CAMEL_ARG_DBL:
- a->ca_double = va_arg(tv->ap, double *);
+ a->ca_double = va_arg(tv->ap, gdouble *);
*a->ca_double = 0.0;
break;
case CAMEL_ARG_STR:
CAMEL_ARG_OBJ = 0x00000000, /* object */
CAMEL_ARG_INT = 0x10000000, /* gint */
- CAMEL_ARG_DBL = 0x20000000, /* double */
+ CAMEL_ARG_DBL = 0x20000000, /* gdouble */
CAMEL_ARG_STR = 0x30000000, /* c string */
CAMEL_ARG_PTR = 0x40000000, /* ptr */
CAMEL_ARG_BOO = 0x50000000 /* bool */
union {
gpointer ca_object;
gint ca_int;
- double ca_double;
+ gdouble ca_double;
gchar *ca_str;
gpointer ca_ptr;
} u;
union {
gpointer *ca_object;
gint *ca_int;
- double *ca_double;
+ gdouble *ca_double;
gchar **ca_str;
gpointer *ca_ptr;
} u;
struct _CamelProperty {
guint32 tag;
- gchar *name;
- gchar *description;
+ const gchar *name;
+ const gchar *description;
};
G_END_DECLS
static gint sync_nolock(CamelBlockFile *bs);
static gint sync_block_nolock(CamelBlockFile *bs, CamelBlock *bl);
-static int
+static gint
block_file_validate_root(CamelBlockFile *bs)
{
CamelBlockRoot *br;
d(printf("version: %.8s (%.8s)\n", bs->root->version, bs->version));
d(printf("block size: %d (%d)%s\n", br->block_size, bs->block_size,
br->block_size != bs->block_size ? " BAD":" OK"));
- d(printf("free: %ld (%d add size < %ld)%s\n", (long)br->free, br->free / bs->block_size * bs->block_size, (long)st.st_size,
+ d(printf("free: %ld (%d add size < %ld)%s\n", (glong)br->free, br->free / bs->block_size * bs->block_size, (glong)st.st_size,
(br->free > st.st_size) || (br->free % bs->block_size) != 0 ? " BAD":" OK"));
- d(printf("last: %ld (%d and size: %ld)%s\n", (long)br->last, br->last / bs->block_size * bs->block_size, (long)st.st_size,
+ d(printf("last: %ld (%d and size: %ld)%s\n", (glong)br->last, br->last / bs->block_size * bs->block_size, (glong)st.st_size,
(br->last != st.st_size) || ((br->last % bs->block_size) != 0) ? " BAD": " OK"));
d(printf("flags: %s\n", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC"));
g_warning("version: %.8s (%.8s)", bs->root->version, bs->version);
g_warning("block size: %d (%d)%s", br->block_size, bs->block_size,
br->block_size != bs->block_size ? " BAD":" OK");
- g_warning("free: %ld (%d add size < %ld)%s", (long)br->free, br->free / bs->block_size * bs->block_size, (long)st.st_size,
+ g_warning("free: %ld (%d add size < %ld)%s", (glong)br->free, br->free / bs->block_size * bs->block_size, (glong)st.st_size,
(br->free > st.st_size) || (br->free % bs->block_size) != 0 ? " BAD":" OK");
- g_warning("last: %ld (%d and size: %ld)%s", (long)br->last, br->last / bs->block_size * bs->block_size, (long)st.st_size,
+ g_warning("last: %ld (%d and size: %ld)%s", (glong)br->last, br->last / bs->block_size * bs->block_size, (glong)st.st_size,
(br->last != st.st_size) || ((br->last % bs->block_size) != 0) ? " BAD": " OK");
g_warning("flags: %s", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC");
}
return 0;
}
-static int
+static gint
block_file_init_root(CamelBlockFile *bs)
{
CamelBlockRoot *br = bs->root;
}
/* 'use' a block file for io */
-static int
+static gint
block_file_use(CamelBlockFile *bs)
{
struct _CamelBlockFilePrivate *nw, *nn, *p = bs->priv;
CAMEL_BLOCK_FILE_UNLOCK(bs, io_lock);
errno = ENOENT;
return -1;
- } else
+ } else {
d(printf("Turning block file online: %s\n", bs->path));
+ }
if ((bs->fd = g_open(bs->path, bs->flags|O_BINARY, 0600)) == -1) {
err = errno;
*
* Return value: The new block file, or NULL if it could not be created.
**/
-CamelBlockFile *camel_block_file_new(const gchar *path, gint flags, const gchar version[8], size_t block_size)
+CamelBlockFile *camel_block_file_new(const gchar *path, gint flags, const gchar version[8], gsize block_size)
{
CamelBlockFile *bs;
CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
}
-static int
+static gint
sync_block_nolock(CamelBlockFile *bs, CamelBlock *bl)
{
d(printf("Sync block %08x: %s\n", bl->id, (bl->flags & CAMEL_BLOCK_DIRTY)?"dirty":"clean"));
return 0;
}
-static int
+static gint
sync_nolock(CamelBlockFile *bs)
{
CamelBlock *bl, *bn;
}
/* 'use' a key file for io */
-static int
+static gint
key_file_use(CamelKeyFile *bs)
{
struct _CamelKeyFilePrivate *nw, *nn, *p = bs->priv;
CamelKeyFile *bf;
gint err, fd;
- gchar *flag;
+ const gchar *flag;
/* We want to:
remove file from active list
CAMEL_KEY_FILE_UNLOCK(bs, lock);
errno = ENOENT;
return -1;
- } else
+ } else {
d(printf("Turning key file online: '%s'\n", bs->path));
+ }
if ((bs->flags & O_ACCMODE) == O_RDONLY)
flag = "rb";
* Return value: -1 on io error. The key file will remain unchanged.
**/
gint
-camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, size_t len, camel_key_t *records)
+camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, gsize len, camel_key_t *records)
{
camel_block_t next;
guint32 size;
* Return value: -1 on io error.
**/
gint
-camel_key_file_read(CamelKeyFile *kf, camel_block_t *start, size_t *len, camel_key_t **records)
+camel_key_file_read(CamelKeyFile *kf, camel_block_t *start, gsize *len, camel_key_t **records)
{
guint32 size;
- long pos = *start;
+ glong pos = *start;
camel_block_t next;
gint ret = -1;
gint flags;
gint fd;
- size_t block_size;
+ gsize block_size;
CamelBlockRoot *root;
CamelBlock *root_block;
CamelType camel_block_file_get_type(void);
-CamelBlockFile *camel_block_file_new(const gchar *path, gint flags, const gchar version[8], size_t block_size);
+CamelBlockFile *camel_block_file_new(const gchar *path, gint flags, const gchar version[8], gsize block_size);
gint camel_block_file_rename(CamelBlockFile *bs, const gchar *path);
gint camel_block_file_delete(CamelBlockFile *kf);
CamelType camel_key_file_get_type(void);
CamelKeyFile * camel_key_file_new(const gchar *path, gint flags, const gchar version[8]);
-int camel_key_file_rename(CamelKeyFile *kf, const gchar *path);
-int camel_key_file_delete(CamelKeyFile *kf);
+gint camel_key_file_rename(CamelKeyFile *kf, const gchar *path);
+gint camel_key_file_delete(CamelKeyFile *kf);
-gint camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, size_t len, camel_key_t *records);
-gint camel_key_file_read(CamelKeyFile *kf, camel_block_t *start, size_t *len, camel_key_t **records);
+gint camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, gsize len, camel_key_t *records);
+gint camel_key_file_read(CamelKeyFile *kf, camel_block_t *start, gsize *len, camel_key_t **records);
G_END_DECLS
}
-static int
+static gint
certdb_header_load (CamelCertDB *certdb, FILE *istream)
{
if (camel_file_util_decode_uint32 (istream, &certdb->version) == -1)
return -1;
}
-static int
+static gint
certdb_header_save (CamelCertDB *certdb, FILE *ostream)
{
if (camel_file_util_encode_uint32 (ostream, certdb->version) == -1)
return 0;
}
-static int
+static gint
certdb_cert_save (CamelCertDB *certdb, CamelCert *cert, FILE *ostream)
{
if (camel_file_util_encode_string (ostream, cert->issuer) == -1)
return h;
}
-static int
+static gint
block_equal (gconstpointer v1, gconstpointer v2)
{
return !memcmp (v1, v2, 256);
guchar *block = NULL;
guint bit = 0x01;
GHashTable *table_hash;
- size_t inleft, outleft;
+ gsize inleft, outleft;
gchar *inbuf, *outbuf;
guint32 out[128], c;
gchar in[128];
}
/* Mutibyte tables */
- for ( ; tables[j].name && tables[j].multibyte; j++) {
+ for (; tables[j].name && tables[j].multibyte; j++) {
cd = iconv_open (tables[j].name, UCS);
if (cd == (iconv_t) -1)
continue;
outbuf = in;
outleft = sizeof (in);
- if (iconv (cd, &inbuf, &inleft, &outbuf, &outleft) != (size_t) -1) {
+ if (iconv (cd, &inbuf, &inleft, &outbuf, &outleft) != (gsize) -1) {
/* this is a legal character in charset table[j].name */
iconv (cd, NULL, NULL, &outbuf, &outleft);
encoding_map[i++] |= bit;
void
camel_charset_init (CamelCharset *c)
{
- c->mask = (unsigned int) ~0;
+ c->mask = (guint) ~0;
c->level = 0;
}
context->session = session;
}
-static int
+static gint
cipher_sign (CamelCipherContext *ctx, const gchar *userid, CamelCipherHash hash,
struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
{
return valid;
}
-static int
+static gint
cipher_encrypt (CamelCipherContext *context, const gchar *userid, GPtrArray *recipients,
struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
{
return valid;
}
-static int
+static gint
cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istream, CamelException *ex)
{
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
return CCC_CLASS (context)->import_keys (context, istream, ex);
}
-static int
+static gint
cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
struct _CamelStream *ostream, CamelException *ex)
{
void camel_cipher_validity_free (CamelCipherValidity *validity);
/* utility functions */
-int camel_cipher_canonical_to_stream(CamelMimePart *part, guint32 flags, CamelStream *ostream);
+gint camel_cipher_canonical_to_stream(CamelMimePart *part, guint32 flags, CamelStream *ostream);
G_END_DECLS
#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
static gint construct_from_stream(CamelDataWrapper *, CamelStream *);
-static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static ssize_t decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
+static gssize write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
+static gssize decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
static void set_mime_type (CamelDataWrapper *data_wrapper, const gchar *mime_type);
static gchar *get_mime_type (CamelDataWrapper *data_wrapper);
static CamelContentType *get_mime_type_field (CamelDataWrapper *data_wrapper);
return (CamelDataWrapper *) camel_object_new (CAMEL_DATA_WRAPPER_TYPE);
}
-static ssize_t
+static gssize
write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
- ssize_t ret;
+ gssize ret;
if (data_wrapper->stream == NULL) {
return -1;
*
* Returns: the number of bytes written, or %-1 on fail
**/
-ssize_t
+gssize
camel_data_wrapper_write_to_stream (CamelDataWrapper *data_wrapper,
CamelStream *stream)
{
}
-static ssize_t
+static gssize
decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
CamelMimeFilter *filter;
CamelStream *fstream;
- ssize_t ret;
+ gssize ret;
fstream = (CamelStream *) camel_stream_filter_new_with_stream (stream);
*
* Returns: the number of bytes written, or %-1 on fail
**/
-ssize_t
+gssize
camel_data_wrapper_decode_to_stream (CamelDataWrapper *data_wrapper,
CamelStream *stream)
{
}
-static int
+static gint
construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
if (data_wrapper->stream)
void (*set_mime_type_field) (CamelDataWrapper *data_wrapper,
CamelContentType *mime_type_field);
- ssize_t (*write_to_stream) (CamelDataWrapper *data_wrapper,
+ gssize (*write_to_stream) (CamelDataWrapper *data_wrapper,
CamelStream *stream);
- ssize_t (*decode_to_stream) (CamelDataWrapper *data_wrapper,
+ gssize (*decode_to_stream) (CamelDataWrapper *data_wrapper,
CamelStream *stream);
gint (*construct_from_stream) (CamelDataWrapper *data_wrapper,
/* public methods */
CamelDataWrapper *camel_data_wrapper_new(void);
-ssize_t camel_data_wrapper_write_to_stream (CamelDataWrapper *data_wrapper,
+gssize camel_data_wrapper_write_to_stream (CamelDataWrapper *data_wrapper,
CamelStream *stream);
-ssize_t camel_data_wrapper_decode_to_stream (CamelDataWrapper *data_wrapper,
+gssize camel_data_wrapper_decode_to_stream (CamelDataWrapper *data_wrapper,
CamelStream *stream);
void camel_data_wrapper_set_mime_type (CamelDataWrapper *data_wrapper,
gint flags;
} CamelSqlite3File;
-static int
+static gint
call_old_file_Sync (CamelSqlite3File *cFile, gint flags)
{
g_return_val_if_fail (old_vfs != NULL, SQLITE_ERROR);
}
#define def_subclassed(_nm, _params, _call) \
-static int \
+static gint \
camel_sqlite3_file_ ## _nm _params \
{ \
CamelSqlite3File *cFile; \
#undef def_subclassed
-static int
+static gint
camel_sqlite3_file_xCheckReservedLock (sqlite3_file *pFile, gint *pResOut)
{
CamelSqlite3File *cFile;
return ((gint (*)(sqlite3_file *, gint *)) (cFile->old_vfs_file->pMethods->xCheckReservedLock)) (cFile->old_vfs_file, pResOut);
}
-static int
+static gint
camel_sqlite3_file_xClose (sqlite3_file *pFile)
{
CamelSqlite3File *cFile;
return res;
}
-static int
+static gint
camel_sqlite3_file_xSync (sqlite3_file *pFile, gint flags)
{
CamelSqlite3File *cFile;
return SQLITE_OK;
}
-static int
+static gint
camel_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs, const gchar *zPath, sqlite3_file *pFile, gint flags, gint *pOutFlags)
{
static GStaticRecMutex only_once_lock = G_STATIC_REC_MUTEX_INIT;
static gint write_mir (CamelDB *cdb, const gchar *folder_name, CamelMIRecord *record, CamelException *ex, gboolean delete_old_record);
-static int
+static gint
cdb_sql_exec (sqlite3 *db, const gchar * stmt, CamelException *ex)
{
gchar *errmsg = NULL;
return ret;
}
-static int
+static gint
count_cb (gpointer data, gint argc, gchar **argv, gchar **azColName)
{
gint i;
}
gint
-camel_db_delete_uid_from_vfolder_transaction (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex)
+camel_db_delete_uid_from_vfolder_transaction (CamelDB *db, const gchar *folder_name, const gchar *vuid, CamelException *ex)
{
gchar *del_query;
gint ret;
GPtrArray *uids;
GPtrArray *flags;
};
-static int
+static gint
read_uids_flags_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
struct _db_data_uids_flags *data= (struct _db_data_uids_flags *) ref;
return ret;
}
-static int
+static gint
read_uids_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
GPtrArray *array = (GPtrArray *) ref;
return array;
}
-static int
+static gint
read_preview_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
GHashTable *hash = (GHashTable *)ref;
return ret;
}
-static int
+static gint
read_vuids_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
GPtrArray *array = (GPtrArray *)ref;
gint
camel_db_create_folders_table (CamelDB *cdb, CamelException *ex)
{
- gchar *query = "CREATE TABLE IF NOT EXISTS folders ( folder_name TEXT PRIMARY KEY, version REAL, flags INTEGER, nextuid INTEGER, time NUMERIC, saved_count INTEGER, unread_count INTEGER, deleted_count INTEGER, junk_count INTEGER, visible_count INTEGER, jnd_count INTEGER, bdata TEXT )";
+ const gchar *query = "CREATE TABLE IF NOT EXISTS folders ( folder_name TEXT PRIMARY KEY, version REAL, flags INTEGER, nextuid INTEGER, time NUMERIC, saved_count INTEGER, unread_count INTEGER, deleted_count INTEGER, junk_count INTEGER, visible_count INTEGER, jnd_count INTEGER, bdata TEXT )";
CAMEL_DB_RELEASE_SQLITE_MEMORY;
return ((camel_db_command (cdb, query, ex)));
}
-static int
+static gint
camel_db_create_message_info_table (CamelDB *cdb, const gchar *folder_name, CamelException *ex)
{
gint ret;
return ret;
}
-static int
+static gint
camel_db_migrate_folder_prepare (CamelDB *cdb, const gchar *folder_name, gint version, CamelException *ex)
{
gint ret = 0;
return ret;
}
-static int
+static gint
camel_db_migrate_folder_recreate (CamelDB *cdb, const gchar *folder_name, gint version, CamelException *ex)
{
gint ret = 0;
return ret;
}
-static int
+static gint
camel_db_write_folder_version (CamelDB *cdb, const gchar *folder_name, gint old_version, CamelException *ex)
{
gint ret = 0;
return ret;
}
-static int
+static gint
camel_db_get_folder_version (CamelDB *cdb, const gchar *folder_name, CamelException *ex)
{
gint version = -1, ret;
return write_mir (cdb, folder_name, record, ex, TRUE);
}
-static int
+static gint
write_mir (CamelDB *cdb, const gchar *folder_name, CamelMIRecord *record, CamelException *ex, gboolean delete_old_record)
{
gint ret;
- gchar *del_query;
+ /*char *del_query;*/
gchar *ins_query;
/* FIXME: We should migrate from this DELETE followed by INSERT model to an INSERT OR REPLACE model as pointed out by pvanhoof */
folder_name, record->uid, record->flags,
record->msg_type, record->read, record->deleted, record->replied,
record->important, record->junk, record->attachment, record->dirty,
- record->size, (long long) record->dsent, (long long) record->dreceived,
+ record->size, (gint64) record->dsent, (gint64) record->dreceived,
record->subject, record->from, record->to,
record->cc, record->mlist, record->followup_flag,
record->followup_completed_on, record->followup_due_by,
return ret;
}
-static int
+static gint
read_fir_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
CamelFIRecord *record = *(CamelFIRecord **) ref;
return (ret);
}
-static int
+static gint
camel_db_create_deleted_table (CamelDB *cdb, CamelException *ex)
{
gint ret;
return ret;
}
-static int
+static gint
camel_db_trim_deleted_table (CamelDB *cdb, CamelException *ex)
{
gint ret = 0;
return ret;
}
-static int
-cdb_delete_ids (CamelDB *cdb, const gchar * folder_name, GSList *uids, gchar *uid_prefix, const gchar *field, CamelException *ex)
+static gint
+cdb_delete_ids (CamelDB *cdb, const gchar * folder_name, GSList *uids, const gchar *uid_prefix, const gchar *field, CamelException *ex)
{
gchar *tmp;
gint ret;
}
gint
-camel_db_delete_vuids (CamelDB *cdb, const gchar * folder_name, gchar *hash, GSList *uids, CamelException *ex)
+camel_db_delete_vuids (CamelDB *cdb, const gchar * folder_name, const gchar *hash, GSList *uids, CamelException *ex)
{
return cdb_delete_ids (cdb, folder_name, uids, hash, "vuid", ex);
}
typedef struct _CamelDBPrivate CamelDBPrivate;
-typedef int(*CamelDBCollate)(gpointer ,int,gconstpointer ,int,gconstpointer );
+typedef gint(*CamelDBCollate)(gpointer ,int,gconstpointer ,int,gconstpointer );
struct _CamelDB {
sqlite3 *db;
gint camel_db_delete_uid (CamelDB *cdb, const gchar *folder, const gchar *uid, CamelException *ex);
/*int camel_db_delete_uids (CamelDB *cdb, CamelException *ex, gint nargs, ... );*/
gint camel_db_delete_uids (CamelDB *cdb, const gchar * folder_name, GSList *uids, CamelException *ex);
-gint camel_db_delete_vuids (CamelDB *cdb, const gchar * folder_name, gchar *shash, GSList *uids, CamelException *ex);
+gint camel_db_delete_vuids (CamelDB *cdb, const gchar * folder_name, const gchar *shash, GSList *uids, CamelException *ex);
gint camel_db_create_folders_table (CamelDB *cdb, CamelException *ex);
gint camel_db_select (CamelDB *cdb, const gchar * stmt, CamelDBSelectCB callback, gpointer data, CamelException *ex);
gint camel_db_create_vfolder (CamelDB *db, const gchar *folder_name, CamelException *ex);
gint camel_db_recreate_vfolder (CamelDB *db, const gchar *folder_name, CamelException *ex);
gint camel_db_delete_uid_from_vfolder (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex);
-gint camel_db_delete_uid_from_vfolder_transaction (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex);
+gint camel_db_delete_uid_from_vfolder_transaction (CamelDB *db, const gchar *folder_name, const gchar *vuid, CamelException *ex);
GPtrArray * camel_db_get_vuids_from_vfolder (CamelDB *db, gchar *folder_name, gchar *filter, CamelException *ex);
gint camel_db_add_to_vfolder (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex);
gint camel_db_add_to_vfolder_transaction (CamelDB *db, gchar *folder_name, gchar *vuid, CamelException *ex);
#endif
default:
internal_error (__FILE__, __LINE__, "\
-Invalid hw breakpoint type %d in i386_length_and_rw_bits.\n", (int)type);
+Invalid hw breakpoint type %d in i386_length_and_rw_bits.\n", (gint)type);
}
switch (len)
}
-static int
+static gint
digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
/* CamelDigestStore doesn't currently have anything to set */
return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
}
-static int
+static gint
digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
/* CamelDigestStore doesn't currently have anything to get */
}
-static int
+static gint
diary_encode_uids (CamelDiscoDiary *diary, GPtrArray *uids)
{
gint i, status;
{
guint32 action;
off_t size;
- double pc;
+ gdouble pc;
d(printf("disco diary replay\n"));
return camel_disco_folder_type;
}
-static int
+static gint
disco_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
gint i, count=0;
return 0;
}
-static int
+static gint
disco_setv(CamelObject *object, CamelException *ex, CamelArgV *args)
{
gint save = 0;
return camel_disco_store_type;
}
-static int
+static gint
disco_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
/* CamelDiscoStore doesn't currently have anything to set */
return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
}
-static int
+static gint
disco_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
/* CamelDiscoStore doesn't currently have anything to get */
}
#define CFU_ENCODE_T(type) \
-int \
+gint \
camel_file_util_encode_##type(FILE *out, type value) \
{ \
gint i; \
}
#define CFU_DECODE_T(type) \
-int \
+gint \
camel_file_util_decode_##type(FILE *in, type *dest) \
{ \
type save = 0; \
CFU_DECODE_T(off_t)
/**
- * camel_file_util_encode_size_t:
+ * camel_file_util_encode_gsize:
* @out: file to output to
* @value: value to output
*
- * Encode an size_t type.
+ * Encode an gsize type.
*
* Return value: %0 on success, %-1 on error.
**/
-CFU_ENCODE_T(size_t)
+CFU_ENCODE_T(gsize)
/**
- * camel_file_util_decode_size_t:
+ * camel_file_util_decode_gsize:
* @in: file to read from
* @dest: pointer to a variable to put the value in
*
- * Decode an size_t type.
+ * Decode an gsize type.
*
* Return value: %0 on success, %-1 on failure.
**/
-CFU_DECODE_T(size_t)
+CFU_DECODE_T(gsize)
/**
* Return value: %0 on success, %-1 on error.
**/
gint
-camel_file_util_encode_fixed_string (FILE *out, const gchar *str, size_t len)
+camel_file_util_encode_fixed_string (FILE *out, const gchar *str, gsize len)
{
gchar buf[len];
* Return value: %0 on success, %-1 on error.
**/
gint
-camel_file_util_decode_fixed_string (FILE *in, gchar **str, size_t len)
+camel_file_util_decode_fixed_string (FILE *in, gchar **str, gsize len)
{
register gchar *ret;
* Returns: number of bytes read or -1 on fail. On failure, errno will
* be set appropriately.
**/
-ssize_t
-camel_read (gint fd, gchar *buf, size_t n)
+gssize
+camel_read (gint fd, gchar *buf, gsize n)
{
- ssize_t nread;
+ gssize nread;
gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
* Returns: number of bytes written or -1 on fail. On failure, errno will
* be set appropriately.
**/
-ssize_t
-camel_write (gint fd, const gchar *buf, size_t n)
+gssize
+camel_write (gint fd, const gchar *buf, gsize n)
{
- ssize_t w, written = 0;
+ gssize w, written = 0;
gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
* be set appropriately. If the socket is nonblocking
* camel_read_socket() will retry the read until it gets something.
**/
-ssize_t
-camel_read_socket (gint fd, gchar *buf, size_t n)
+gssize
+camel_read_socket (gint fd, gchar *buf, gsize n)
{
#ifndef G_OS_WIN32
return camel_read (fd, buf, n);
#else
- ssize_t nread;
+ gssize nread;
gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
* Returns: number of bytes written or -1 on fail. On failure, errno will
* be set appropriately.
**/
-ssize_t
-camel_write_socket (gint fd, const gchar *buf, size_t n)
+gssize
+camel_write_socket (gint fd, const gchar *buf, gsize n)
{
#ifndef G_OS_WIN32
return camel_write (fd, buf, n);
#else
- ssize_t w, written = 0;
+ gssize w, written = 0;
gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
gint camel_file_util_decode_time_t (FILE *in, time_t *dest);
gint camel_file_util_encode_off_t (FILE *out, off_t value);
gint camel_file_util_decode_off_t (FILE *in, off_t *dest);
-gint camel_file_util_encode_size_t (FILE *out, size_t value);
-gint camel_file_util_decode_size_t (FILE *in, size_t *dest);
+gint camel_file_util_encode_gsize (FILE *out, gsize value);
+gint camel_file_util_decode_gsize (FILE *in, gsize *dest);
gint camel_file_util_encode_string (FILE *out, const gchar *str);
gint camel_file_util_decode_string (FILE *in, gchar **str);
-gint camel_file_util_encode_fixed_string (FILE *out, const gchar *str, size_t len);
-gint camel_file_util_decode_fixed_string (FILE *in, gchar **str, size_t len);
+gint camel_file_util_encode_fixed_string (FILE *out, const gchar *str, gsize len);
+gint camel_file_util_decode_fixed_string (FILE *in, gchar **str, gsize len);
gchar *camel_file_util_safe_filename (const gchar *name);
* camel_read_socket() and camel_write_socket(). These are cancellable
* also on Win32.
*/
-ssize_t camel_read (gint fd, gchar *buf, size_t n);
-ssize_t camel_write (gint fd, const gchar *buf, size_t n);
+gssize camel_read (gint fd, gchar *buf, gsize n);
+gssize camel_write (gint fd, const gchar *buf, gsize n);
-ssize_t camel_read_socket (gint fd, gchar *buf, size_t n);
-ssize_t camel_write_socket (gint fd, const gchar *buf, size_t n);
+gssize camel_read_socket (gint fd, gchar *buf, gsize n);
+gssize camel_write_socket (gint fd, const gchar *buf, gsize n);
gchar *camel_file_util_savename(const gchar *filename);
/* these are our filter actions - each must have a callback */
static struct {
- gchar *name;
+ const gchar *name;
ESExpFunc *func;
gint type; /* set to 1 if a function can perform shortcut evaluation, or
doesn't execute everything, 0 otherwise */
g_main_loop_quit (child_watch_data->loop);
}
-static int
+static gint
pipe_to_system (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
}
/* flush/close all folders */
-static int
+static gint
close_folders (CamelFilterDriver *driver)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
}
-static int
+static gint
decode_flags_from_xev(const gchar *xev, CamelMessageInfoBase *mi)
{
guint32 uid, flags = 0;
const gchar *xev;
if (st.st_size > 0)
- pc = (int)(100.0 * ((double)camel_mime_parser_tell (mp) / (double)st.st_size));
+ pc = (gint)(100.0 * ((double)camel_mime_parser_tell (mp) / (double)st.st_size));
report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d (%d%%)"), i, pc);
/* builtin functions */
static struct {
- gchar *name;
+ const gchar *name;
ESExpFunc *func;
gint type; /* set to 1 if a function can perform shortcut evaluation, or
doesn't execute everything, 0 otherwise */
g_main_loop_quit (child_watch_data->loop);
}
-static int
+static gint
run_command (struct _ESExp *f, gint argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
CamelMimeMessage *message;
#endif
static struct {
- gchar *name;
+ const gchar *name;
gint offset;
gint flags; /* 0x02 = immediate, 0x01 = always enter */
} builtins[] = {
header = camel_message_info_subject(search->current);
} else if (!g_ascii_strcasecmp(headername, "date")) {
/* FIXME: not a very useful form of the date */
- sprintf(strbuf, "%d", (int)camel_message_info_date_sent(search->current));
+ sprintf(strbuf, "%d", (gint)camel_message_info_date_sent(search->current));
header = strbuf;
} else if (!g_ascii_strcasecmp(headername, "from")) {
header = camel_message_info_from(search->current);
g_ptr_array_add(iter_data->uids, key);
}
-static int
+static gint
match_message_index(CamelIndex *idx, const gchar *uid, const gchar *match, CamelException *ex)
{
CamelIndexCursor *wc, *nc;
return r;
}
-static int
+static gint
read_uid_callback (gpointer ref, gint ncol, gchar ** cols, gchar **name)
{
GPtrArray *matches;
static gint summary_header_load(CamelFolderSummary *, FILE *);
static gint summary_header_save(CamelFolderSummary *, FILE *);
+#if 0
static gint summary_meta_header_load(CamelFolderSummary *, FILE *);
static gint summary_meta_header_save(CamelFolderSummary *, FILE *);
-
+#endif
static CamelMessageInfo * message_info_new_from_header(CamelFolderSummary *, struct _camel_header_raw *);
static CamelMessageInfo * message_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
static CamelMessageInfo * message_info_new_from_message(CamelFolderSummary *s, CamelMimeMessage *msg);
static CamelMessageInfo * message_info_load(CamelFolderSummary *, FILE *);
-static int message_info_save(CamelFolderSummary *, FILE *, CamelMessageInfo *);
-static int meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMessageInfo *info);
+static gint message_info_save(CamelFolderSummary *, FILE *, CamelMessageInfo *);
+static gint meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMessageInfo *info);
static void message_info_free(CamelFolderSummary *, CamelMessageInfo *);
static CamelMessageContentInfo * content_info_new_from_header(CamelFolderSummary *, struct _camel_header_raw *);
static CamelMessageContentInfo * content_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
static CamelMessageContentInfo * content_info_new_from_message(CamelFolderSummary *s, CamelMimePart *mp);
static CamelMessageContentInfo * content_info_load(CamelFolderSummary *, FILE *);
-static int content_info_save(CamelFolderSummary *, FILE *, CamelMessageContentInfo *);
+static gint content_info_save(CamelFolderSummary *, FILE *, CamelMessageContentInfo *);
static void content_info_free(CamelFolderSummary *, CamelMessageContentInfo *);
static gint save_message_infos_to_db (CamelFolderSummary *s, gboolean fresh_mir, CamelException *ex);
(*count)++;
}
-static int
+static gint
cfs_count_dirty (CamelFolderSummary *s)
{
gint count = 0;
}
}
+#if 0
static void
camel_folder_summary_dump (CamelFolderSummary *s)
{
printf("%s\t", (gchar *)s->uids->pdata[i]);
printf("\n");
}
+#endif
GHashTable *
camel_folder_summary_get_flag_cache (CamelFolderSummary *summary)
}
}
-static int
+static gint
camel_read_mir_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
{
struct _db_pass_data *data = (struct _db_pass_data *) ref;
/* saves the content descriptions, recursively */
-static int
+static gint
perform_content_info_save_to_db (CamelFolderSummary *s, CamelMessageContentInfo *ci, CamelMIRecord *record)
{
CamelMessageContentInfo *part;
}
/* saves the content descriptions, recursively */
-static int
+#if 0
+static gint
perform_content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
{
CamelMessageContentInfo *part;
return 0;
}
+#endif
typedef struct {
CamelException *ex;
camel_db_camel_mir_free (mir);
}
-static int
+static gint
save_message_infos_to_db (CamelFolderSummary *s, gboolean fresh_mirs, CamelException *ex)
{
CamelDB *cdb = s->folder->parent_store->cdb_w;
return ret;
}
-static int
+static gint
summary_assign_uid(CamelFolderSummary *s, CamelMessageInfo *info)
{
const gchar *uid;
{
CamelMessageInfo *info = NULL;
gchar *buffer;
- size_t len;
+ gsize len;
struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
off_t start;
CamelIndexName *name = NULL;
/* This function returns 0 on success. So the caller should not bother,
deleting the uid from db when the return value is non-zero */
-static int
+static gint
summary_remove_uid (CamelFolderSummary *s, const gchar *uid)
{
gint i;
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
if (!ret && camel_db_delete_uid (s->folder->parent_store->cdb_w, s->folder->full_name, camel_message_info_uid(info), NULL) != 0)
- return ;
+ return;
camel_message_info_free(info);
}
if (!ret && camel_db_delete_uid (s->folder->parent_store->cdb_w, s->folder->full_name, tmpid, NULL) != 0) {
g_free(tmpid);
- return ;
+ return;
}
g_free (tmpid);
}
/* This is a tokenisation mechanism for strings written to the
summary - to save space.
This list can have at most 31 words. */
-static gchar * tokens[] = {
+static const gchar * tokens[] = {
"7bit",
"8bit",
"alternative",
*/
#ifdef USE_BSEARCH
-static int
+static gint
token_search_cmp(gchar *key, gchar **index)
{
d(printf("comparing '%s' to '%s'\n", key, *index));
if (len <= 16) {
gchar lower[32];
- gchar **match;
+ const gchar **match;
for (i=0;i<len;i++)
lower[i] = tolower(str[i]);
return n;
}
-static int
+static gint
my_list_size(struct _node **list)
{
gint len = 0;
return len;
}
-static int
+#if 0
+static gint
summary_meta_header_load(CamelFolderSummary *s, FILE *in)
{
if (!s->meta_summary->path)
return 0;
}
+#endif
-static int
+static gint
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *record)
{
io(printf("Loading header from db \n"));
return 0;
}
-static int
+static gint
summary_header_load(CamelFolderSummary *s, FILE *in)
{
if (!s->summary_path)
io(printf("Loading header\n"));
- if (camel_file_util_decode_fixed_int32(in, &s->version) == -1)
+ if (camel_file_util_decode_fixed_int32(in, (gint32 *) &s->version) == -1)
return -1;
/* Legacy version check, before version 12 we have no upgrade knowledge */
return -1;
}
- if (!(s->version < 0x100 && s->version >= 13))
+ if (!(s->version < 0x100 && s->version >= 13)) {
io(printf("Loading legacy summary\n"));
- else
+ } else {
io(printf("loading new-format summary\n"));
+ }
/* legacy version */
- if (camel_file_util_decode_fixed_int32(in, &s->flags) == -1
- || camel_file_util_decode_fixed_int32(in, &s->nextuid) == -1
+ if (camel_file_util_decode_fixed_int32(in, (gint32 *) &s->flags) == -1
+ || camel_file_util_decode_fixed_int32(in, (gint32 *) &s->nextuid) == -1
|| camel_file_util_decode_time_t(in, &s->time) == -1
- || camel_file_util_decode_fixed_int32(in, &s->saved_count) == -1) {
+ || camel_file_util_decode_fixed_int32(in, (gint32 *) &s->saved_count) == -1) {
return -1;
}
/* version 13 */
if (s->version < 0x100 && s->version >= 13
- && (camel_file_util_decode_fixed_int32(in, &s->unread_count) == -1
- || camel_file_util_decode_fixed_int32(in, &s->deleted_count) == -1
- || camel_file_util_decode_fixed_int32(in, &s->junk_count) == -1)) {
+ && (camel_file_util_decode_fixed_int32(in, (gint32 *) &s->unread_count) == -1
+ || camel_file_util_decode_fixed_int32(in, (gint32 *) &s->deleted_count) == -1
+ || camel_file_util_decode_fixed_int32(in, (gint32 *) &s->junk_count) == -1)) {
return -1;
}
return record;
}
-static int
+static gint
summary_header_save(CamelFolderSummary *s, FILE *out)
{
gint unread = 0, deleted = 0, junk = 0, count, i;
return camel_file_util_encode_fixed_int32(out, junk);
}
-static int
+#if 0
+static gint
summary_meta_header_save(CamelFolderSummary *s, FILE *out_meta)
{
fseek(out_meta, 0, SEEK_SET);
return ferror(out_meta);
}
+#endif
/* are these even useful for anything??? */
static CamelMessageInfo *
mi->content = NULL;
- camel_file_util_decode_fixed_int32(in, &mi->message_id.id.part.hi);
- camel_file_util_decode_fixed_int32(in, &mi->message_id.id.part.lo);
+ camel_file_util_decode_fixed_int32(in, (gint32 *) &mi->message_id.id.part.hi);
+ camel_file_util_decode_fixed_int32(in, (gint32 *) &mi->message_id.id.part.lo);
if (camel_file_util_decode_uint32(in, &count) == -1)
goto error;
mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
mi->references->size = count;
for (i=0;i<count;i++) {
- camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.hi);
- camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.lo);
+ camel_file_util_decode_fixed_int32(in, (gint32 *) &mi->references->references[i].id.part.hi);
+ camel_file_util_decode_fixed_int32(in, (gint32 *) &mi->references->references[i].id.part.lo);
}
}
return NULL;
}
-static int
+static gint
meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMessageInfo *info)
{
time_t timestamp;
tmp = g_string_new (NULL);
if (mi->references) {
- g_string_append_printf (tmp, "%lu %lu %lu", (long unsigned)mi->message_id.id.part.hi, (long unsigned)mi->message_id.id.part.lo, (long unsigned)mi->references->size);
+ g_string_append_printf (tmp, "%lu %lu %lu", (gulong)mi->message_id.id.part.hi, (gulong)mi->message_id.id.part.lo, (gulong)mi->references->size);
for (i=0;i<mi->references->size;i++)
- g_string_append_printf (tmp, " %lu %lu", (long unsigned)mi->references->references[i].id.part.hi, (long unsigned)mi->references->references[i].id.part.lo);
+ g_string_append_printf (tmp, " %lu %lu", (gulong)mi->references->references[i].id.part.hi, (gulong)mi->references->references[i].id.part.lo);
} else {
- g_string_append_printf (tmp, "%lu %lu %lu", (long unsigned)mi->message_id.id.part.hi, (long unsigned)mi->message_id.id.part.lo, (unsigned long) 0);
+ g_string_append_printf (tmp, "%lu %lu %lu", (gulong)mi->message_id.id.part.hi, (gulong)mi->message_id.id.part.lo, (gulong) 0);
}
record->part = tmp->str;
g_string_free (tmp, FALSE);
tmp = g_string_new (NULL);
count = camel_tag_list_size(&mi->user_tags);
- g_string_append_printf (tmp, "%lu", (long unsigned)count);
+ g_string_append_printf (tmp, "%lu", (gulong)count);
tag = mi->user_tags;
while (tag) {
/* FIXME: Should we handle empty tags? Can it be empty? If it potential crasher ahead*/
- g_string_append_printf (tmp, " %lu-%s %lu-%s", (long unsigned)strlen(tag->name), tag->name, (long unsigned)strlen(tag->value), tag->value);
+ g_string_append_printf (tmp, " %lu-%s %lu-%s", (gulong)strlen(tag->name), tag->name, (gulong)strlen(tag->value), tag->value);
tag = tag->next;
}
record->usertags = tmp->str;
}
-static int
+static gint
message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
{
guint32 count;
return NULL;
}
-static int
+static gint
content_info_to_db(CamelFolderSummary *s, CamelMessageContentInfo *ci, CamelMIRecord *record)
{
CamelContentType *ct;
ct = ci->type;
if (ct) {
if (ct->type)
- g_string_append_printf (str, " %d-%s", (int) strlen (ct->type), ct->type);
+ g_string_append_printf (str, " %d-%s", (gint) strlen (ct->type), ct->type);
else
g_string_append_printf (str, " 0-");
if (ct->subtype)
- g_string_append_printf (str, " %d-%s", (int) strlen (ct->subtype), ct->subtype);
+ g_string_append_printf (str, " %d-%s", (gint) strlen (ct->subtype), ct->subtype);
else
g_string_append_printf (str, " 0-");
g_string_append_printf (str, " %d", my_list_size((struct _node **)&ct->params));
hp = ct->params;
while (hp) {
if (hp->name)
- g_string_append_printf (str, " %d-%s", (int)strlen(hp->name), hp->name);
+ g_string_append_printf (str, " %d-%s", (gint)strlen(hp->name), hp->name);
else
g_string_append_printf (str, " 0-");
if (hp->value)
- g_string_append_printf (str, " %d-%s", (int)strlen (hp->value), hp->value);
+ g_string_append_printf (str, " %d-%s", (gint)strlen (hp->value), hp->value);
else
g_string_append_printf (str, " 0-");
hp = hp->next;
}
if (ci->id)
- g_string_append_printf (str, " %d-%s", (int)strlen (ci->id), ci->id);
+ g_string_append_printf (str, " %d-%s", (gint)strlen (ci->id), ci->id);
else
g_string_append_printf (str, " 0-");
if (ci->description)
- g_string_append_printf (str, " %d-%s", (int)strlen (ci->description), ci->description);
+ g_string_append_printf (str, " %d-%s", (gint)strlen (ci->description), ci->description);
else
g_string_append_printf (str, " 0-");
if (ci->encoding)
- g_string_append_printf (str, " %d-%s", (int)strlen (ci->encoding), ci->encoding);
+ g_string_append_printf (str, " %d-%s", (gint)strlen (ci->encoding), ci->encoding);
else
g_string_append_printf (str, " 0-");
g_string_append_printf (str, " %u", ci->size);
return 0;
}
-static int
+static gint
content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
{
CamelContentType *ct;
summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimeParser *mp)
{
gint state;
- size_t len;
+ gsize len;
gchar *buffer;
CamelMessageContentInfo *info = NULL;
CamelContentType *ct;
}
static struct flag_names_t {
- gchar *name;
+ const gchar *name;
guint32 value;
} flag_names[] = {
{ "answered", CAMEL_MESSAGE_ANSWERED },
printf ("%scontent-type: <unset>\n", p);
printf ("%scontent-transfer-encoding: %s\n", p, ci->encoding ? ci->encoding : "(null)");
printf ("%scontent-description: %s\n", p, ci->description ? ci->description : "(null)");
- printf ("%ssize: %lu\n", p, (unsigned long) ci->size);
+ printf ("%ssize: %lu\n", p, (gulong) ci->size);
ci = ci->childs;
while (ci) {
camel_content_info_dump (ci, depth + 1);
CamelMessageInfo * (*message_info_new_from_parser)(CamelFolderSummary *, CamelMimeParser *);
CamelMessageInfo * (*message_info_new_from_message)(CamelFolderSummary *, CamelMimeMessage *);
CamelMessageInfo * (*message_info_load)(CamelFolderSummary *, FILE *);
- int (*message_info_save)(CamelFolderSummary *, FILE *, CamelMessageInfo *);
- int (*meta_message_info_save)(CamelFolderSummary *, FILE *, FILE *, CamelMessageInfo *);
+ gint (*message_info_save)(CamelFolderSummary *, FILE *, CamelMessageInfo *);
+ gint (*meta_message_info_save)(CamelFolderSummary *, FILE *, FILE *, CamelMessageInfo *);
void (*message_info_free)(CamelFolderSummary *, CamelMessageInfo *);
CamelMessageInfo * (*message_info_clone)(CamelFolderSummary *, const CamelMessageInfo *);
CamelMessageContentInfo * (*content_info_new_from_parser)(CamelFolderSummary *, CamelMimeParser *);
CamelMessageContentInfo * (*content_info_new_from_message)(CamelFolderSummary *, CamelMimePart *);
CamelMessageContentInfo * (*content_info_load)(CamelFolderSummary *, FILE *);
- int (*content_info_save)(CamelFolderSummary *, FILE *, CamelMessageContentInfo *);
+ gint (*content_info_save)(CamelFolderSummary *, FILE *, CamelMessageContentInfo *);
void (*content_info_free)(CamelFolderSummary *, CamelMessageContentInfo *);
CamelMessageInfo * (*message_info_from_uid) (CamelFolderSummary *, const gchar *);
/* get the next uid */
gboolean camel_flag_get(CamelFlag **list, const gchar *name);
gboolean camel_flag_set(CamelFlag **list, const gchar *name, gboolean value);
gboolean camel_flag_list_copy(CamelFlag **to, CamelFlag **from);
-int camel_flag_list_size(CamelFlag **list);
+gint camel_flag_list_size(CamelFlag **list);
void camel_flag_list_free(CamelFlag **list);
guint32 camel_system_flag (const gchar *name);
gboolean camel_system_flag_get (guint32 flags, const gchar *name);
/* message tag operations */
-const char *camel_tag_get(CamelTag **list, const gchar *name);
+const gchar *camel_tag_get(CamelTag **list, const gchar *name);
gboolean camel_tag_set(CamelTag **list, const gchar *name, const gchar *value);
gboolean camel_tag_list_copy(CamelTag **to, CamelTag **from);
-int camel_tag_list_size(CamelTag **list);
+gint camel_tag_list_size(CamelTag **list);
void camel_tag_list_free(CamelTag **list);
/* Summary may be null */
GHashTable *visited;
};
-static int
+static gint
dump_tree_rec(struct _tree_info *info, CamelFolderThreadNode *c, gint depth)
{
gchar *p;
return count;
}
-static int
+static gint
sort_node(gconstpointer a, gconstpointer b)
{
const CamelFolderThreadNode *a1 = ((CamelFolderThreadNode **)a)[0];
CamelFolderThreadNode *c, *child, *head;
#ifdef TIMEIT
struct timeval start, end;
- unsigned long diff;
+ gulong diff;
gettimeofday(&start, NULL);
#endif
if (fsummary->len - camel_folder_summary_cache_size (folder->summary) > 50)
camel_folder_summary_reload_from_db (folder->summary, NULL);
- for (i = 0 ; i < fsummary->len ; i++) {
- CamelMessageInfo *info ;
+ for (i = 0; i < fsummary->len; i++) {
+ CamelMessageInfo *info;
gchar *uid = fsummary->pdata[i];
if (wanted == NULL || g_hash_table_lookup(wanted, uid) != NULL) {
#ifdef TIMEIT
struct timeval start, end;
- unsigned long diff;
+ gulong diff;
gettimeofday(&start, NULL);
#endif
#define d(x)
#define w(x)
-extern gint camel_verbose_debug;
-
static CamelObjectClass *parent_class = NULL;
/* Returns the class for a CamelFolder */
CF_CLASS (folder)->refresh_info (folder, ex);
}
-static int
+static gint
folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
CAMEL_FOLDER_REC_UNLOCK(folder, lock);
}
-static int
+static gint
get_message_count (CamelFolder *folder)
{
g_return_val_if_fail(folder->summary != NULL, -1);
gint i;
argv = g_ptr_array_new ();
- g_ptr_array_add (argv, "gpg");
+ g_ptr_array_add (argv, (guint8 *) "gpg");
- g_ptr_array_add (argv, "--verbose");
- g_ptr_array_add (argv, "--no-secmem-warning");
- g_ptr_array_add (argv, "--no-greeting");
- g_ptr_array_add (argv, "--no-tty");
+ g_ptr_array_add (argv, (guint8 *) "--verbose");
+ g_ptr_array_add (argv, (guint8 *) "--no-secmem-warning");
+ g_ptr_array_add (argv, (guint8 *) "--no-greeting");
+ g_ptr_array_add (argv, (guint8 *) "--no-tty");
if (passwd_fd == -1) {
/* only use batch mode if we don't intend on using the
interactive --command-fd option */
- g_ptr_array_add (argv, "--batch");
- g_ptr_array_add (argv, "--yes");
+ g_ptr_array_add (argv, (guint8 *) "--batch");
+ g_ptr_array_add (argv, (guint8 *) "--yes");
}
*sfd = buf = g_strdup_printf ("--status-fd=%d", status_fd);
switch (gpg->mode) {
case GPG_CTX_MODE_SIGN:
- g_ptr_array_add (argv, "--sign");
- g_ptr_array_add (argv, "--detach");
+ g_ptr_array_add (argv, (guint8 *) "--sign");
+ g_ptr_array_add (argv, (guint8 *) "--detach");
if (gpg->armor)
- g_ptr_array_add (argv, "--armor");
+ g_ptr_array_add (argv, (guint8 *) "--armor");
hash_str = gpg_hash_str (gpg->hash);
if (hash_str)
- g_ptr_array_add (argv, (gchar *) hash_str);
+ g_ptr_array_add (argv, (guint8 *) hash_str);
if (gpg->userid) {
- g_ptr_array_add (argv, "-u");
- g_ptr_array_add (argv, (gchar *) gpg->userid);
+ g_ptr_array_add (argv, (guint8 *) "-u");
+ g_ptr_array_add (argv, (guint8 *) gpg->userid);
}
- g_ptr_array_add (argv, "--output");
- g_ptr_array_add (argv, "-");
+ g_ptr_array_add (argv, (guint8 *) "--output");
+ g_ptr_array_add (argv, (guint8 *) "-");
break;
case GPG_CTX_MODE_VERIFY:
if (!camel_session_is_online (gpg->session)) {
/* this is a deprecated flag to gpg since 1.0.7 */
/*g_ptr_array_add (argv, "--no-auto-key-retrieve");*/
- g_ptr_array_add (argv, "--keyserver-options");
- g_ptr_array_add (argv, "no-auto-key-retrieve");
+ g_ptr_array_add (argv, (guint8 *) "--keyserver-options");
+ g_ptr_array_add (argv, (guint8 *) "no-auto-key-retrieve");
}
- g_ptr_array_add (argv, "--verify");
+ g_ptr_array_add (argv, (guint8 *) "--verify");
if (gpg->sigfile)
g_ptr_array_add (argv, gpg->sigfile);
- g_ptr_array_add (argv, "-");
+ g_ptr_array_add (argv, (guint8 *) "-");
break;
case GPG_CTX_MODE_ENCRYPT:
- g_ptr_array_add (argv, "--encrypt");
+ g_ptr_array_add (argv, (guint8 *) "--encrypt");
if (gpg->armor)
- g_ptr_array_add (argv, "--armor");
+ g_ptr_array_add (argv, (guint8 *) "--armor");
if (gpg->always_trust)
- g_ptr_array_add (argv, "--always-trust");
+ g_ptr_array_add (argv, (guint8 *) "--always-trust");
if (gpg->userid) {
- g_ptr_array_add (argv, "-u");
- g_ptr_array_add (argv, (gchar *) gpg->userid);
+ g_ptr_array_add (argv, (guint8 *) "-u");
+ g_ptr_array_add (argv, (guint8 *) gpg->userid);
}
if (gpg->recipients) {
for (i = 0; i < gpg->recipients->len; i++) {
- g_ptr_array_add (argv, "-r");
+ g_ptr_array_add (argv, (guint8 *) "-r");
g_ptr_array_add (argv, gpg->recipients->pdata[i]);
}
}
- g_ptr_array_add (argv, "--output");
- g_ptr_array_add (argv, "-");
+ g_ptr_array_add (argv, (guint8 *) "--output");
+ g_ptr_array_add (argv, (guint8 *) "-");
break;
case GPG_CTX_MODE_DECRYPT:
- g_ptr_array_add (argv, "--decrypt");
- g_ptr_array_add (argv, "--output");
- g_ptr_array_add (argv, "-");
+ g_ptr_array_add (argv, (guint8 *) "--decrypt");
+ g_ptr_array_add (argv, (guint8 *) "--output");
+ g_ptr_array_add (argv, (guint8 *) "-");
break;
case GPG_CTX_MODE_IMPORT:
- g_ptr_array_add (argv, "--import");
- g_ptr_array_add (argv, "-");
+ g_ptr_array_add (argv, (guint8 *) "--import");
+ g_ptr_array_add (argv, (guint8 *) "-");
break;
case GPG_CTX_MODE_EXPORT:
if (gpg->armor)
- g_ptr_array_add (argv, "--armor");
- g_ptr_array_add (argv, "--export");
+ g_ptr_array_add (argv, (guint8 *) "--armor");
+ g_ptr_array_add (argv, (guint8 *) "--export");
for (i = 0; i < gpg->recipients->len; i++)
g_ptr_array_add (argv, gpg->recipients->pdata[i]);
break;
#endif
-static int
+static gint
gpg_ctx_op_start (struct _GpgCtx *gpg)
{
#ifndef G_OS_WIN32
return inptr;
}
-static int
+static gint
gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
{
register guchar *inptr;
const guchar *status;
- size_t nread, nwritten;
+ gsize nread, nwritten;
gint len;
parse:
#endif
-static int
+static gint
gpg_ctx_op_step (struct _GpgCtx *gpg, CamelException *ex)
{
#ifndef G_OS_WIN32
if (polls[2].revents & (G_IO_IN|G_IO_HUP)) {
/* read the status message and decide what to do... */
gchar buffer[4096];
- ssize_t nread;
+ gssize nread;
d(printf ("reading from gpg's status-fd...\n"));
if ((polls[0].revents & (G_IO_IN|G_IO_HUP)) && gpg->ostream) {
gchar buffer[4096];
- ssize_t nread;
+ gssize nread;
d(printf ("reading gpg's stdout...\n"));
goto exception;
if (nread > 0) {
- if (camel_stream_write (gpg->ostream, buffer, (size_t) nread) == -1)
+ if (camel_stream_write (gpg->ostream, buffer, (gsize) nread) == -1)
goto exception;
} else {
gpg->seen_eof1 = TRUE;
if (polls[1].revents & (G_IO_IN|G_IO_HUP)) {
gchar buffer[4096];
- ssize_t nread;
+ gssize nread;
d(printf ("reading gpg's stderr...\n"));
}
if ((polls[4].revents & (G_IO_OUT|G_IO_HUP)) && gpg->need_passwd && gpg->send_passwd) {
- ssize_t w, nwritten = 0;
- size_t n;
+ gssize w, nwritten = 0;
+ gsize n;
d(printf ("sending gpg our passphrase...\n"));
if ((polls[3].revents & (G_IO_OUT|G_IO_HUP)) && gpg->istream) {
gchar buffer[4096];
- ssize_t nread;
+ gssize nread;
d(printf ("writing to gpg's stdin...\n"));
/* write our stream to gpg's stdin */
nread = camel_stream_read (gpg->istream, buffer, sizeof (buffer));
if (nread > 0) {
- ssize_t w, nwritten = 0;
+ gssize w, nwritten = 0;
do {
do {
}
#endif
-static int
+static gint
gpg_ctx_op_wait (struct _GpgCtx *gpg)
{
#ifndef G_OS_WIN32
-static int
+static gint
gpg_sign (CamelCipherContext *context, const gchar *userid, CamelCipherHash hash, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
{
struct _GpgCtx *gpg = NULL;
return NULL;
}
-static int
+static gint
gpg_encrypt (CamelCipherContext *context, const gchar *userid, GPtrArray *recipients, struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
{
CamelGpgContext *ctx = (CamelGpgContext *) context;
return valid;
}
-static int
+static gint
gpg_import_keys (CamelCipherContext *context, CamelStream *istream, CamelException *ex)
{
struct _GpgCtx *gpg;
return res;
}
-static int
+static gint
gpg_export_keys (CamelCipherContext *context, GPtrArray *keys, CamelStream *ostream, CamelException *ex)
{
struct _GpgCtx *gpg;
static CamelStreamClass *parent_class = NULL;
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint stream_flush (CamelStream *stream);
static gint stream_close (CamelStream *stream);
static gint stream_reset (CamelStream *stream);
{
const guchar *inptr = in;
- while (*inptr && !isspace ((int) *inptr))
+ while (*inptr && !isspace ((gint) *inptr))
inptr++;
- while (*inptr && isspace ((int) *inptr))
+ while (*inptr && isspace ((gint) *inptr))
inptr++;
return (const gchar *) inptr;
}
-static int
+static gint
http_get_statuscode (CamelHttpStream *http)
{
const gchar *token;
return -1;
}
-static int
+static gint
http_get_headers (CamelHttpStream *http)
{
struct _camel_header_raw *headers, *node, *tail;
const gchar *type;
gchar *buf;
- size_t len;
+ gsize len;
gint err;
if (http->parser)
return -1;
}
-static int
+static gint
http_method_invoke (CamelHttpStream *http)
{
const gchar *method = NULL;
}
g_free (url);
- if (http->authrealm)
+ if (http->authrealm) {
d(printf("HTTP Stream Sending: WWW-Authenticate: %s\n", http->authrealm));
+ }
if (http->authrealm && camel_stream_printf (http->raw, "WWW-Authenticate: %s\r\n", http->authrealm) == -1) {
http_disconnect(http);
return -1;
}
- if (http->authpass && http->proxy)
+ if (http->authpass && http->proxy) {
d(printf("HTTP Stream Sending: Proxy-Aurhorization: Basic %s\n", http->authpass));
+ }
if (http->authpass && http->proxy && camel_stream_printf (http->raw, "Proxy-Authorization: Basic %s\r\n",
http->authpass) == -1) {
return 0;
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelHttpStream *http = CAMEL_HTTP_STREAM (stream);
const gchar *parser_buf;
- ssize_t nread;
+ gssize nread;
if (http->method != CAMEL_HTTP_METHOD_GET && http->method != CAMEL_HTTP_METHOD_HEAD) {
errno = EIO;
return nread;
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
return -1;
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
CamelHttpStream *http = (CamelHttpStream *) stream;
return 0;
}
-static int
+static gint
stream_close (CamelStream *stream)
{
CamelHttpStream *http = (CamelHttpStream *) stream;
return 0;
}
-static int
+static gint
stream_reset (CamelStream *stream)
{
CamelHttpStream *http = CAMEL_HTTP_STREAM (stream);
static gchar *locale_lang = NULL;
struct {
- gchar *charset;
- gchar *iconv_name;
+ const gchar *charset;
+ const gchar *iconv_name;
} known_iconv_charsets[] = {
#if 0
/* charset name, iconv-friendly charset name */
/* work around some broken iconv implementations
* that die if the length arguments are NULL
*/
- size_t buggy_iconv_len = 0;
+ gsize buggy_iconv_len = 0;
gchar *buggy_iconv_buf = NULL;
/* resets the converter */
* camel_iconv_charset_name() so that we don't have to keep track of all
* the aliases too. */
static struct {
- gchar *charset;
- gchar *lang;
+ const gchar *charset;
+ const gchar *lang;
} cjkr_lang_map[] = {
{ "Big5", "zh" },
{ "BIG5HKSCS", "zh" },
#include "camel-object.h"
#include "camel-text-index.h"
-static void
+extern gint camel_init(const gchar *certdb_dir, gboolean nss_init);
+
+G_GNUC_NORETURN static void
do_usage(gchar *argv0)
{
fprintf(stderr, "Usage: %s [ compress | dump | info ] file(s) ...\n", argv0);
exit(1);
}
-static int
+static gint
do_compress(gint argc, gchar **argv)
{
gint i;
return 0;
}
-static int
+static gint
do_dump(gint argc, gchar **argv)
{
gint i;
return 0;
}
-static int
+static gint
do_info(gint argc, gchar **argv)
{
gint i;
return 1;
}
-static int
+static gint
do_check(gint argc, gchar **argv)
{
gint i;
gint main(gint argc, gchar **argv)
{
- extern gint camel_init(const gchar *certdb_dir, gboolean nss_init);
-
if (argc<2)
do_usage(argv[0]);
#include "camel-mime-filter-index.h"
#include "camel-stream-fs.h"
-static int
+static gint
do_perf(gint argc, gchar **argv)
{
CamelIndex *idx;
DIR *dir;
- gchar *path = "/home/notzed/evolution/local/Inbox/mbox/cur";
+ const gchar *path = "/home/notzed/evolution/local/Inbox/mbox/cur";
struct dirent *d;
CamelStream *null, *filter, *stream;
CamelMimeFilterIndex *filter_index;
g_free(b);
}
-size_t
-camel_index_name_add_buffer(CamelIndexName *idn, const gchar *buffer, size_t len)
+gsize
+camel_index_name_add_buffer(CamelIndexName *idn, const gchar *buffer, gsize len)
{
return CIN_CLASS(idn)->add_buffer(idn, buffer, len);
}
gint (*sync)(CamelIndexName *name);
void (*add_word)(CamelIndexName *name, const gchar *word);
- size_t (*add_buffer)(CamelIndexName *name, const gchar *buffer, size_t len);
+ gsize (*add_buffer)(CamelIndexName *name, const gchar *buffer, gsize len);
};
CamelType camel_index_name_get_type (void);
CamelIndexName *camel_index_name_new(CamelIndex *idx, const gchar *name);
void camel_index_name_add_word(CamelIndexName *name, const gchar *word);
-size_t camel_index_name_add_buffer(CamelIndexName *name, const gchar *buffer, size_t len);
+gsize camel_index_name_add_buffer(CamelIndexName *name, const gchar *buffer, gsize len);
/* ********************************************************************** */
struct _CamelIndexClass {
CamelObjectClass parent_class;
- int (*sync)(CamelIndex *idx);
- int (*compress)(CamelIndex *idx);
- int (*delete)(CamelIndex *idx);
+ gint (*sync)(CamelIndex *idx);
+ gint (*compress)(CamelIndex *idx);
+ gint (*delete)(CamelIndex *idx);
- int (*rename)(CamelIndex *idx, const gchar *path);
+ gint (*rename)(CamelIndex *idx, const gchar *path);
- int (*has_name)(CamelIndex *idx, const gchar *name);
+ gint (*has_name)(CamelIndex *idx, const gchar *name);
CamelIndexName * (*add_name)(CamelIndex *idx, const gchar *name);
- int (*write_name)(CamelIndex *idx, CamelIndexName *idn);
+ gint (*write_name)(CamelIndex *idx, CamelIndexName *idn);
CamelIndexCursor * (*find_name)(CamelIndex *idx, const gchar *name);
void (*delete_name)(CamelIndex *idx, const gchar *name);
CamelIndexCursor * (*find)(CamelIndex *idx, const gchar *word);
CamelIndex *camel_index_new(const gchar *path, gint flags);
void camel_index_construct(CamelIndex *, const gchar *path, gint flags);
-int camel_index_rename(CamelIndex *, const gchar *path);
+gint camel_index_rename(CamelIndex *, const gchar *path);
void camel_index_set_normalise(CamelIndex *idx, CamelIndexNorm func, gpointer data);
gint camel_index_sync(CamelIndex *idx);
gint camel_index_compress(CamelIndex *idx);
-int camel_index_delete(CamelIndex *idx);
+gint camel_index_delete(CamelIndex *idx);
gint camel_index_has_name(CamelIndex *idx, const gchar *name);
CamelIndexName *camel_index_add_name(CamelIndex *idx, const gchar *name);
return type;
}
-static int
+static gint
internet_decode (CamelAddress *a, const gchar *raw)
{
struct _camel_header_address *ha, *n;
return ret;
}
-static int
+static gint
internet_unformat(CamelAddress *a, const gchar *raw)
{
gchar *buffer, *p, *name, *addr;
name = NULL;
addr = p;
do {
- c = (unsigned char)*p++;
+ c = (guchar)*p++;
switch (c) {
/* removes quotes, they should only be around the total name anyway */
case '"':
return ret;
}
-static int
+static gint
internet_cat (CamelAddress *dest, const CamelAddress *source)
{
gint i;
CamelType camel_internet_address_get_type (void);
CamelInternetAddress *camel_internet_address_new (void);
-int camel_internet_address_add (CamelInternetAddress *addr, const gchar *name, const gchar *address);
+gint camel_internet_address_add (CamelInternetAddress *addr, const gchar *name, const gchar *address);
gboolean camel_internet_address_get (const CamelInternetAddress *addr, gint index, const gchar **namep, const gchar **addressp);
-int camel_internet_address_find_name(CamelInternetAddress *addr, const gchar *name, const gchar **addressp);
-int camel_internet_address_find_address(CamelInternetAddress *addr, const gchar *address, const gchar **namep);
+gint camel_internet_address_find_name(CamelInternetAddress *addr, const gchar *name, const gchar **addressp);
+gint camel_internet_address_find_address(CamelInternetAddress *addr, const gchar *address, const gchar **namep);
/* utility functions, for network/display formatting */
gchar * camel_internet_address_encode_address(gint *len, const gchar *name, const gchar *addr);
#include "camel-mime-utils.h"
static void reset(CamelMimeFilter *mf);
-static void complete(CamelMimeFilter *mf, gchar *in, size_t len,
- size_t prespace, gchar **out,
- size_t *outlen, size_t *outprespace);
-static void filter(CamelMimeFilter *mf, gchar *in, size_t len,
- size_t prespace, gchar **out,
- size_t *outlen, size_t *outprespace);
+static void complete(CamelMimeFilter *mf, const gchar *in, gsize len,
+ gsize prespace, gchar **out,
+ gsize *outlen, gsize *outprespace);
+static void filter(CamelMimeFilter *mf, const gchar *in, gsize len,
+ gsize prespace, gchar **out,
+ gsize *outlen, gsize *outprespace);
static void camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *klass);
static void camel_mime_filter_basic_init (CamelMimeFilterBasic *obj);
}
static void
-complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
- size_t newlen = 0;
+ gsize newlen = 0;
switch(f->type) {
case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
return;
donothing:
- *out = in;
+ *out = (gchar *) in;
*outlen = len;
*outprespace = prespace;
}
/* here we do all of the basic mime filtering */
static void
-filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
- size_t newlen;
+ gsize newlen;
switch(f->type) {
case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
break;
case CAMEL_MIME_FILTER_BASIC_UU_DEC:
if (!(f->state & CAMEL_UUDECODE_STATE_BEGIN)) {
- register gchar *inptr, *inend;
- size_t left;
+ const gchar *inptr, *inend;
+ gsize left;
inptr = in;
inend = inptr + len;
}
/* go to the next line */
- for ( ; inptr < inend && *inptr != '\n'; inptr++);
+ for (; inptr < inend && *inptr != '\n'; inptr++);
if (inptr < inend)
inptr++;
return;
donothing:
- *out = in;
+ *out = (gchar *) in;
*outlen = len;
*outprespace = prespace;
}
}
static void
-filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterBestenc *f = (CamelMimeFilterBestenc *)mf;
register guchar *p, *pend;
camel_charset_step(&f->charset, in, len);
donothing:
- *out = in;
+ *out = (gchar *) in;
*outlen = len;
*outprespace = prespace;
}
static void
-complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterBestenc *f = (CamelMimeFilterBestenc *)mf;
#include "camel-mime-filter-canon.h"
-static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, gchar *in, size_t len,
- size_t prespace, gchar **out, size_t *outlen,
- size_t *outprespace);
+static void filter (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
+static void complete (CamelMimeFilter *f, const gchar *in, gsize len,
+ gsize prespace, gchar **out, gsize *outlen,
+ gsize *outprespace);
static void reset (CamelMimeFilter *f);
}
static void
-filter_run(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace, gint last)
+filter_run(CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace, gint last)
{
register guchar *inptr, c;
const guchar *inend, *start;
}
static void
-filter(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
filter_run(f, in, len, prespace, out, outlen, outprespace, FALSE);
}
static void
-complete(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
filter_run(f, in, len, prespace, out, outlen, outprespace, TRUE);
}
CamelMimeFilterCharset *f = (CamelMimeFilterCharset *)mf;
gchar buf[16];
gchar *buffer;
- size_t outlen = 16;
+ gsize outlen = 16;
/* what happens with the output bytes if this resets the state? */
if (f->ic != (iconv_t) -1) {
}
static void
-complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterCharset *charset = (CamelMimeFilterCharset *)mf;
- size_t inleft, outleft, converted = 0;
+ gsize inleft, outleft, converted = 0;
const gchar *inbuf;
gchar *outbuf;
if (inleft > 0) {
do {
converted = camel_iconv (charset->ic, &inbuf, &inleft, &outbuf, &outleft);
- if (converted == (size_t) -1) {
+ if (converted == (gsize) -1) {
if (errno == E2BIG) {
/*
* E2BIG There is not sufficient room at *outbuf.
} else
goto noop;
}
- } while (((int) inleft) > 0);
+ } while (((gint) inleft) > 0);
}
/* flush the iconv conversion */
noop:
- *out = in;
+ *out = (gchar *) in;
*outlen = len;
*outprespace = prespace;
}
static void
-filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterCharset *charset = (CamelMimeFilterCharset *)mf;
- size_t inleft, outleft, converted = 0;
+ gsize inleft, outleft, converted = 0;
const gchar *inbuf;
gchar *outbuf;
do {
converted = camel_iconv (charset->ic, &inbuf, &inleft, &outbuf, &outleft);
- if (converted == (size_t) -1) {
+ if (converted == (gsize) -1) {
if (errno == E2BIG || errno == EINVAL)
break;
goto noop;
}
}
- } while (((int) inleft) > 0);
+ } while (((gint) inleft) > 0);
- if (((int) inleft) > 0) {
+ if (((gint) inleft) > 0) {
/* We've either got an E2BIG or EINVAL. Save the
remainder of the buffer as we'll process this next
time through */
noop:
- *out = in;
+ *out = (gchar *) in;
*outlen = len;
*outprespace = prespace;
}
#include "camel-mime-filter-crlf.h"
-static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, gchar *in, size_t len,
- size_t prespace, gchar **out, size_t *outlen,
- size_t *outprespace);
+static void filter (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
+static void complete (CamelMimeFilter *f, const gchar *in, gsize len,
+ gsize prespace, gchar **out, gsize *outlen,
+ gsize *outprespace);
static void reset (CamelMimeFilter *f);
}
static void
-filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterCRLF *crlf = (CamelMimeFilterCRLF *)f;
register const gchar *inptr;
}
static void
-complete (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+complete (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
if (len)
filter (f, in, len, prespace, out, outlen, outprespace);
static gchar *param_parse_lang (const gchar *inptr, gint inlen);
static struct {
- gchar *enriched;
- gchar *html;
+ const gchar *enriched;
+ const gchar *html;
gboolean needs_param;
EnrichedParamParser parse_param; /* parses *and* validates the input */
} enriched_tags[] = {
static void camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter);
static void camel_mime_filter_enriched_finalize (CamelObject *obj);
-static void filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
-static void filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
+static void filter_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
+static void filter_complete (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
static void filter_reset (CamelMimeFilter *filter);
if (!enriched_hash) {
enriched_hash = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
for (i = 0; i < NUM_ENRICHED_TAGS; i++)
- g_hash_table_insert (enriched_hash, enriched_tags[i].enriched,
- enriched_tags[i].html);
+ g_hash_table_insert (
+ enriched_hash,
+ (gpointer) enriched_tags[i].enriched,
+ (gpointer) enriched_tags[i].html);
}
}
#define IS_RICHTEXT CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT
static void
-enriched_to_html (CamelMimeFilter *filter, gchar *in, size_t inlen, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace, gboolean flush)
+enriched_to_html (CamelMimeFilter *filter, const gchar *in, gsize inlen, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace, gboolean flush)
{
CamelMimeFilterEnriched *enriched = (CamelMimeFilterEnriched *) filter;
const gchar *tag, *inend, *outend;
backup:
if (flush) {
- size_t offset, grow;
+ gsize offset, grow;
grow = (inend - inptr) * 2 + 20;
offset = outptr - filter->outbuf;
}
static void
-filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
enriched_to_html (filter, in, len, prespace, out, outlen, outprespace, FALSE);
}
static void
-filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
enriched_to_html (filter, in, len, prespace, out, outlen, outprespace, TRUE);
}
camel_enriched_to_html(const gchar *in, guint32 flags)
{
CamelMimeFilter *filter;
- size_t outlen, outpre;
+ gsize outlen, outpre;
gchar *outbuf;
if (in == NULL)
struct fromnode {
struct fromnode *next;
- gchar *pointer;
+ const gchar *pointer;
};
static void
-complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
- *out = in;
+ *out = (gchar *) in;
*outlen = len;
*outprespace = prespace;
}
/* Yes, it is complicated ... */
static void
-filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+filter(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterFrom *f = (CamelMimeFilterFrom *)mf;
- register gchar *inptr, *inend;
+ const gchar *inptr, *inend;
gint left;
gint midline = f->midline;
gint fromcount = 0;
d(printf("Filtered '%.*s'\n", *outlen, *out));
} else {
- *out = in;
+ *out = (gchar *) in;
*outlen = inend - in;
*outprespace = prespace;
static void camel_mime_filter_gzip_init (CamelMimeFilterGZip *filter, CamelMimeFilterGZipClass *klass);
static void camel_mime_filter_gzip_finalize (CamelObject *object);
-static void filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
-static void filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
+static void filter_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
+static void filter_complete (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
static void filter_reset (CamelMimeFilter *filter);
static void
-gzip_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace, gint flush)
+gzip_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace, gint flush)
{
CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
struct _CamelMimeFilterGZipPrivate *priv = gzip->priv;
fprintf (stderr, "gzip: %d: %s\n", retval, priv->stream->msg);
if (flush == Z_FULL_FLUSH) {
- size_t n;
+ gsize n;
n = filter->outsize - priv->stream->avail_out;
camel_mime_filter_set_size (filter, n + (priv->stream->avail_in * 2) + 12, TRUE);
}
static void
-gunzip_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace, gint flush)
+gunzip_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace, gint flush)
{
CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
struct _CamelMimeFilterGZipPrivate *priv = gzip->priv;
fprintf (stderr, "gunzip: %d: %s\n", retval, priv->stream->msg);
if (flush == Z_FULL_FLUSH) {
- size_t n;
+ gsize n;
if (priv->stream->avail_in == 0) {
/* FIXME: extract & compare calculated crc32 and isize values? */
}
static void
-filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
}
static void
-filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
}
static void
-run(CamelMimeFilter *mf, gchar *in, size_t inlen, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace, gint last)
+run(CamelMimeFilter *mf, const gchar *in, gsize inlen, gsize prespace, gchar **out, gsize *outlenptr, gsize *outprespace, gint last)
{
CamelMimeFilterHTML *f = (CamelMimeFilterHTML *) mf;
camel_html_parser_t state;
gchar *outp;
- d(printf("converting html:\n%.*s\n", (int)inlen, in));
+ d(printf("converting html:\n%.*s\n", (gint)inlen, in));
/* We should generally shrink the data, but this'll do */
camel_mime_filter_set_size (mf, inlen * 2 + 256, FALSE);
*outlenptr = outp - mf->outbuf;
*outprespace = mf->outbuf - mf->outreal;
- d(printf("converted html end:\n%.*s\n", (int)*outlenptr, *out));
+ d(printf("converted html end:\n%.*s\n", (gint)*outlenptr, *out));
}
static void
-complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace)
+complete(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlenptr, gsize *outprespace)
{
run(mf, in, len, prespace, out, outlenptr, outprespace, TRUE);
}
static void
-filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace)
+filter(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlenptr, gsize *outprespace)
{
run(mf, in, len, prespace, out, outlenptr, outprespace, FALSE);
}
}
static void
-complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace)
+complete(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlenptr, gsize *outprespace)
{
CamelMimeFilterIndex *f = (CamelMimeFilterIndex *)mf;
camel_index_name_add_buffer(f->name, NULL, 0);
donothing:
- *out = in;
+ *out = (gchar *) in;
*outlenptr = len;
*outprespace = prespace;
}
static void
-filter(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlenptr, size_t *outprespace)
+filter(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlenptr, gsize *outprespace)
{
CamelMimeFilterIndex *f = (CamelMimeFilterIndex *)mf;
camel_index_name_add_buffer(f->name, in, len);
donothing:
- *out = in;
+ *out = (gchar *) in;
*outlenptr = len;
*outprespace = prespace;
}
{
if (filter->index) {
gchar *out;
- size_t outlen, outspace;
+ gsize outlen, outspace;
camel_mime_filter_complete((CamelMimeFilter *)filter, "", 0, 0, &out, &outlen, &outspace);
camel_object_unref (index);
#include "camel-mime-filter-linewrap.h"
-static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, gchar *in, size_t len,
- size_t prespace, gchar **out, size_t *outlen,
- size_t *outprespace);
+static void filter (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
+static void complete (CamelMimeFilter *f, const gchar *in, gsize len,
+ gsize prespace, gchar **out, gsize *outlen,
+ gsize *outprespace);
static void reset (CamelMimeFilter *f);
}
static void
-filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterLinewrap *linewrap = (CamelMimeFilterLinewrap *)f;
- gchar *inend, *p, *q;
+ gchar *q;
+ const gchar *inend, *p;
gint nchars = linewrap->nchars;
/* we'll be adding chars here so we need a bigger buffer */
}
static void
-complete (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+complete (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
if (len)
filter (f, in, len, prespace, out, outlen, outprespace);
#include "camel-mime-filter-pgp.h"
-static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, gchar *in, size_t len,
- size_t prespace, gchar **out, size_t *outlen,
- size_t *outprespace);
+static void filter (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
+static void complete (CamelMimeFilter *f, const gchar *in, gsize len,
+ gsize prespace, gchar **out, gsize *outlen,
+ gsize *outprespace);
static void reset (CamelMimeFilter *f);
enum {
#define END_PGP_SIGNATURE_LEN (sizeof (END_PGP_SIGNATURE) - 1)
static void
-filter_run(CamelMimeFilter *f, gchar *in, size_t inlen, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace, gint last)
+filter_run(CamelMimeFilter *f, const gchar *in, gsize inlen, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace, gint last)
{
CamelMimeFilterPgp *pgp = (CamelMimeFilterPgp *) f;
const gchar *start, *inend = in + inlen;
register const gchar *inptr = in;
register gchar *o;
gboolean blank;
- size_t len;
+ gsize len;
/* only need as much space as the input, we're stripping chars */
camel_mime_filter_set_size (f, inlen, FALSE);
}
static void
-filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+filter (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
filter_run (f, in, len, prespace, out, outlen, outprespace, FALSE);
}
static void
-complete (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+complete (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
filter_run (f, in, len, prespace, out, outlen, outprespace, TRUE);
}
}
static void
-filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterProgress *progress = (CamelMimeFilterProgress *) filter;
- double percent;
+ gdouble percent;
progress->count += len;
else
percent = 100.0;
- camel_operation_progress (progress->operation, (int) percent);
+ camel_operation_progress (progress->operation, (gint) percent);
*outprespace = prespace;
*outlen = len;
- *out = in;
+ *out = (gchar *) in;
}
static void
-filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
filter_filter (filter, in, len, prespace, out, outlen, outprespace);
}
* Returns: a new #CamelMimeFilter object
**/
CamelMimeFilter *
-camel_mime_filter_progress_new (CamelOperation *operation, size_t total)
+camel_mime_filter_progress_new (CamelOperation *operation, gsize total)
{
CamelMimeFilter *filter;
CamelMimeFilter parent;
CamelOperation *operation;
- size_t total;
- size_t count;
+ gsize total;
+ gsize count;
};
struct _CamelMimeFilterProgressClass {
CamelType camel_mime_filter_progress_get_type (void);
-CamelMimeFilter *camel_mime_filter_progress_new (CamelOperation *operation, size_t total);
+CamelMimeFilter *camel_mime_filter_progress_new (CamelOperation *operation, gsize total);
G_END_DECLS
#include "camel-mime-filter-save.h"
#include "camel-stream-mem.h"
-static void filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, gchar *in, size_t len,
- size_t prespace, gchar **out, size_t *outlen,
- size_t *outprespace);
+static void filter (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
+static void complete (CamelMimeFilter *f, const gchar *in, gsize len,
+ gsize prespace, gchar **out, gsize *outlen,
+ gsize *outprespace);
static void reset (CamelMimeFilter *f);
}
static void
-filter (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterSave *save = (CamelMimeFilterSave *) f;
if (save->stream)
camel_stream_write (save->stream, in, len);
- *out = in;
+ *out = (gchar *) in;
*outlen = len;
*outprespace = f->outpre;
}
static void
-complete (CamelMimeFilter *f, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+complete (CamelMimeFilter *f, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
if (len)
filter (f, in, len, prespace, out, outlen, outprespace);
static gchar *
-check_size (CamelMimeFilter *filter, gchar *outptr, gchar **outend, size_t len)
+check_size (CamelMimeFilter *filter, gchar *outptr, gchar **outend, gsize len)
{
- size_t offset;
+ gsize offset;
if (*outend - outptr >= len)
return outptr;
static gchar *
append_string_verbatim (CamelMimeFilter *filter, const gchar *str, gchar *outptr, gchar **outend)
{
- size_t len = strlen (str);
+ gsize len = strlen (str);
outptr = check_size (filter, outptr, outend, len);
memcpy(outptr, str, len);
return outptr;
}
-static int
+static gint
citation_depth (const gchar *in)
{
register const gchar *inptr = in;
}
static void
-html_convert (CamelMimeFilter *filter, gchar *in, size_t inlen, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace, gboolean flush)
+html_convert (CamelMimeFilter *filter, const gchar *in, gsize inlen, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace, gboolean flush)
{
CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
- register gchar *inptr, *outptr;
- gchar *start, *outend;
+ const gchar *inptr;
+ gchar *outptr, *outend;
+ const gchar *start;
const gchar *inend;
gint depth;
*outlen = outptr - filter->outbuf;
*outprespace = filter->outpre;
} else {
- *out = in;
+ *out = (gchar *) in;
*outlen = 0;
*outprespace = 0;
}
#define CONVERT_URLS (CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES)
if (html->flags & CONVERT_URLS) {
- size_t matchlen, len;
+ gsize matchlen, len;
urlmatch_t match;
len = inptr - start;
}
static void
-filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
html_convert (filter, in, len, prespace, out, outlen, outprespace, FALSE);
}
static void
-filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
html_convert (filter, in, len, prespace, out, outlen, outprespace, TRUE);
}
camel_text_to_html (const gchar *in, guint32 flags, guint32 colour)
{
CamelMimeFilter *filter;
- size_t outlen, outpre;
+ gsize outlen, outpre;
gchar *outbuf;
g_return_val_if_fail (in != NULL, NULL);
}
static void
-filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) filter;
register guchar *inptr;
}
}
- *out = in;
+ *out = (gchar *) in;
*outlen = len;
*outprespace = prespace;
}
static void
-filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
filter_filter (filter, in, len, prespace, out, outlen, outprespace);
}
static void camel_mime_filter_yenc_class_init (CamelMimeFilterYencClass *klass);
static void camel_mime_filter_yenc_init (CamelMimeFilterYenc *filter, CamelMimeFilterYencClass *klass);
-static void filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
-static void filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
+static void filter_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
+static void filter_complete (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
static void filter_reset (CamelMimeFilter *filter);
/* here we do all of the basic yEnc filtering */
static void
-filter_filter (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_filter (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterYenc *yenc = (CamelMimeFilterYenc *) filter;
- size_t newlen = 0;
+ gsize newlen = 0;
switch (yenc->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
break;
case CAMEL_MIME_FILTER_YENC_DIRECTION_DECODE:
if (!(yenc->state & CAMEL_MIME_YDECODE_STATE_DECODE)) {
- register gchar *inptr, *inend;
- size_t left;
+ const gchar *inptr, *inend;
+ gsize left;
inptr = in;
inend = inptr + len;
}
static void
-filter_complete (CamelMimeFilter *filter, gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+filter_complete (CamelMimeFilter *filter, const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
CamelMimeFilterYenc *yenc = (CamelMimeFilterYenc *) filter;
- size_t newlen = 0;
+ gsize newlen = 0;
switch (yenc->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
};
-#define yenc_crc_add(crc, c) (yenc_crc_table[(((int) (crc)) ^ ((unsigned char) (c))) & 0xff] ^ ((((int) (crc)) >> 8) & 0x00ffffff))
+#define yenc_crc_add(crc, c) (yenc_crc_table[(((gint) (crc)) ^ ((guchar) (c))) & 0xff] ^ ((((gint) (crc)) >> 8) & 0x00ffffff))
#define YENC_NEWLINE_ESCAPE (CAMEL_MIME_YDECODE_STATE_EOLN | CAMEL_MIME_YDECODE_STATE_ESCAPE)
*
* Returns: the number of bytes decoded
**/
-size_t
-camel_ydecode_step (const guchar *in, size_t inlen, guchar *out,
+gsize
+camel_ydecode_step (const guchar *in, gsize inlen, guchar *out,
gint *state, guint32 *pcrc, guint32 *crc)
{
register const guchar *inptr;
*
* Returns: the number of bytes encoded
**/
-size_t
-camel_yencode_step (const guchar *in, size_t inlen, guchar *out,
+gsize
+camel_yencode_step (const guchar *in, gsize inlen, guchar *out,
gint *state, guint32 *pcrc, guint32 *crc)
{
register const guchar *inptr;
*
* Returns: the number of bytes encoded.
**/
-size_t
-camel_yencode_close (const guchar *in, size_t inlen, guchar *out,
+gsize
+camel_yencode_close (const guchar *in, gsize inlen, guchar *out,
gint *state, guint32 *pcrc, guint32 *crc)
{
register guchar *outptr;
guint32 camel_mime_filter_yenc_get_crc (CamelMimeFilterYenc *yenc);
-size_t camel_ydecode_step (const guchar *in, size_t inlen, guchar *out,
+gsize camel_ydecode_step (const guchar *in, gsize inlen, guchar *out,
gint *state, guint32 *pcrc, guint32 *crc);
-size_t camel_yencode_step (const guchar *in, size_t inlen, guchar *out,
+gsize camel_yencode_step (const guchar *in, gsize inlen, guchar *out,
gint *state, guint32 *pcrc, guint32 *crc);
-size_t camel_yencode_close (const guchar *in, size_t inlen, guchar *out,
+gsize camel_yencode_close (const guchar *in, gsize inlen, guchar *out,
gint *state, guint32 *pcrc, guint32 *crc);
G_END_DECLS
struct _CamelMimeFilterPrivate {
gchar *inbuf;
- size_t inlen;
+ gsize inlen;
};
#define PRE_HEAD (64)
static CamelObjectClass *camel_mime_filter_parent;
-static void complete (CamelMimeFilter *mf, gchar *in, size_t len,
- size_t prespace, gchar **out, size_t *outlen,
- size_t *outprespace);
+static void complete (CamelMimeFilter *mf, const gchar *in, gsize len,
+ gsize prespace, gchar **out, gsize *outlen,
+ gsize *outprespace);
static void
camel_mime_filter_class_init (CamelMimeFilterClass *klass)
}
static void
-complete(CamelMimeFilter *mf, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace)
+complete(CamelMimeFilter *mf, const gchar *in, gsize len, gsize prespace, gchar **out, gsize *outlen, gsize *outprespace)
{
/* default - do nothing */
}
#endif
static void filter_run(CamelMimeFilter *f,
- gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace,
+ const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace,
void (*filterfunc)(CamelMimeFilter *f,
- gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace))
+ const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace))
{
struct _CamelMimeFilterPrivate *p;
/* preload any backed up data */
if (f->backlen > 0) {
- memcpy(in-f->backlen, f->backbuf, f->backlen);
+ memcpy((gchar *) in-f->backlen, f->backbuf, f->backlen);
in -= f->backlen;
len += f->backlen;
prespace -= f->backlen;
**/
void
camel_mime_filter_filter (CamelMimeFilter *filter,
- gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+ const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
if (FCLASS(filter)->filter)
filter_run(filter, in, len, prespace, out, outlen, outprespace, FCLASS(filter)->filter);
**/
void
camel_mime_filter_complete (CamelMimeFilter *filter,
- gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace)
+ const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace)
{
if (FCLASS(filter)->complete)
filter_run(filter, in, len, prespace, out, outlen, outprespace, FCLASS(filter)->complete);
* Note: New calls replace old data.
**/
void
-camel_mime_filter_backup(CamelMimeFilter *filter, const gchar *data, size_t length)
+camel_mime_filter_backup(CamelMimeFilter *filter, const gchar *data, gsize length)
{
if (filter->backsize < length) {
/* g_realloc copies data, unnecessary overhead */
* for filter output.
**/
void
-camel_mime_filter_set_size(CamelMimeFilter *filter, size_t size, gint keep)
+camel_mime_filter_set_size(CamelMimeFilter *filter, gsize size, gint keep)
{
if (filter->outsize < size) {
gint offset = filter->outptr - filter->outreal;
gchar *outreal; /* real malloc'd buffer */
gchar *outbuf; /* first 'writable' position allowed (outreal + outpre) */
gchar *outptr;
- size_t outsize;
- size_t outpre; /* prespace of this buffer */
+ gsize outsize;
+ gsize outpre; /* prespace of this buffer */
gchar *backbuf;
- size_t backsize;
- size_t backlen; /* significant data there */
+ gsize backsize;
+ gsize backlen; /* significant data there */
};
struct _CamelMimeFilterClass {
/* virtual functions */
void (*filter)(CamelMimeFilter *f,
- gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
+ const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
void (*complete)(CamelMimeFilter *f,
- gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
+ const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
void (*reset)(CamelMimeFilter *f);
};
CamelMimeFilter *camel_mime_filter_new (void);
void camel_mime_filter_filter(CamelMimeFilter *filter,
- gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
+ const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
void camel_mime_filter_complete(CamelMimeFilter *filter,
- gchar *in, size_t len, size_t prespace,
- gchar **out, size_t *outlen, size_t *outprespace);
+ const gchar *in, gsize len, gsize prespace,
+ gchar **out, gsize *outlen, gsize *outprespace);
void camel_mime_filter_reset(CamelMimeFilter *filter);
/* sets/returns number of bytes backed up on the input */
-void camel_mime_filter_backup(CamelMimeFilter *filter, const gchar *data, size_t length);
+void camel_mime_filter_backup(CamelMimeFilter *filter, const gchar *data, gsize length);
/* ensure this much size available for filter output */
-void camel_mime_filter_set_size(CamelMimeFilter *filter, size_t size, gint keep);
+void camel_mime_filter_set_size(CamelMimeFilter *filter, gsize size, gint keep);
G_END_DECLS
HEADER_MESSAGE_ID
} CamelHeaderType;
-static gchar *header_names[] = {
+static const gchar *header_names[] = {
/* dont include HEADER_UNKNOWN string */
"From", "Reply-To", "Subject", "To", "Resent-To", "Cc", "Resent-Cc",
"Bcc", "Resent-Bcc", "Date", "Message-Id", NULL
static CamelMimePartClass *parent_class = NULL;
-static gchar *recipient_names[] = {
+static const gchar *recipient_names[] = {
"To", "Cc", "Bcc", "Resent-To", "Resent-Cc", "Resent-Bcc", NULL
};
-static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
+static gssize write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
static void add_header (CamelMedium *medium, const gchar *name, gconstpointer value);
static void set_header (CamelMedium *medium, const gchar *name, gconstpointer value);
static void remove_header (CamelMedium *medium, const gchar *name);
header_name_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
for (i = 0;header_names[i]; i++)
- g_hash_table_insert (header_name_table, header_names[i], GINT_TO_POINTER(i+1));
+ g_hash_table_insert (
+ header_name_table,
+ (gpointer) header_names[i],
+ GINT_TO_POINTER(i+1));
/* virtual method overload */
camel_data_wrapper_class->write_to_stream = write_to_stream;
mime_message->recipients = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
for (i=0;recipient_names[i];i++) {
- g_hash_table_insert(mime_message->recipients, recipient_names[i], camel_internet_address_new());
+ g_hash_table_insert (
+ mime_message->recipients,
+ (gpointer) recipient_names[i],
+ camel_internet_address_new ());
}
mime_message->subject = NULL;
}
/* mime_message */
-static int
+static gint
construct_from_parser (CamelMimePart *dw, CamelMimeParser *mp)
{
gchar *buf;
- size_t len;
+ gsize len;
gint state;
gint ret;
gint err;
return ret;
}
-static ssize_t
+static gssize
write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
CamelMimeMessage *mm = CAMEL_MIME_MESSAGE (data_wrapper);
CamelMimeFilter *filter;
};
-static void folder_scan_step(struct _header_scan_state *s, gchar **databuffer, size_t *datalength);
+static void folder_scan_step(struct _header_scan_state *s, gchar **databuffer, gsize *datalength);
static void folder_scan_drop_step(struct _header_scan_state *s);
static gint folder_scan_init_with_fd(struct _header_scan_state *s, gint fd);
static gint folder_scan_init_with_stream(struct _header_scan_state *s, CamelStream *stream);
static struct _header_scan_state *folder_scan_init(void);
static void folder_scan_close(struct _header_scan_state *s);
-static struct _header_scan_stack *folder_scan_content(struct _header_scan_state *s, gint *lastone, gchar **data, size_t *length);
+static struct _header_scan_stack *folder_scan_content(struct _header_scan_state *s, gint *lastone, gchar **data, gsize *length);
static struct _header_scan_stack *folder_scan_header(struct _header_scan_state *s, gint *lastone);
static gint folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save);
static off_t folder_seek(struct _header_scan_state *s, off_t offset, gint whence);
* is returned.
**/
camel_mime_parser_state_t
-camel_mime_parser_step (CamelMimeParser *parser, gchar **databuffer, size_t *datalength)
+camel_mime_parser_step (CamelMimeParser *parser, gchar **databuffer, gsize *datalength)
{
struct _header_scan_state *s = _PRIVATE (parser);
if (s->unstep <= 0) {
gchar *dummy;
- size_t dummylength;
+ gsize dummylength;
if (databuffer == NULL) {
databuffer = &dummy;
/* ********************************************************************** */
/* read the next bit of data, ensure there is enough room 'atleast' bytes */
-static int
+static gint
folder_read(struct _header_scan_state *s)
{
gint len;
}
}
-static int
+static gint
folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save)
{
gint atleast = s->atleast;
/* otherwise, complete header, add it */
s->outptr[0] = 0;
- h(printf("header '%s' at %d\n", s->outbuf, (int)s->header_start));
+ h(printf("header '%s' at %d\n", s->outbuf, (gint)s->header_start));
header_raw_append_parse(&h->headers, s->outbuf, s->header_start);
s->outptr = s->outbuf;
}
static struct _header_scan_stack *
-folder_scan_content(struct _header_scan_state *s, gint *lastone, gchar **data, size_t *length)
+folder_scan_content(struct _header_scan_state *s, gint *lastone, gchar **data, gsize *length)
{
gint atleast = s->atleast, newatleast;
register gchar *inptr;
s->eof = FALSE;
}
-static int
+static gint
folder_scan_init_with_fd(struct _header_scan_state *s, gint fd)
{
folder_scan_reset(s);
return 0;
}
-static int
+static gint
folder_scan_init_with_stream(struct _header_scan_state *s, CamelStream *stream)
{
folder_scan_reset(s);
#define USE_FROM
static void
-folder_scan_step(struct _header_scan_state *s, gchar **databuffer, size_t *datalength)
+folder_scan_step(struct _header_scan_state *s, gchar **databuffer, gsize *datalength)
{
struct _header_scan_stack *h, *hb;
const gchar *content;
gint type, state, seenlast;
CamelContentType *ct = NULL;
struct _header_scan_filter *f;
- size_t presize;
+ gsize presize;
/* printf("\nSCAN PASS: state = %d '%s'\n", s->state, states[s->state]);*/
hb = folder_scan_content (s, &state, databuffer, datalength);
d(printf ("\n\nOriginal content: '"));
- d(fwrite(*databuffer, sizeof(char), *datalength, stdout));
+ d(fwrite(*databuffer, sizeof(gchar), *datalength, stdout));
d(printf("'\n"));
if (*datalength > 0) {
camel_mime_filter_filter(f->filter, *databuffer, *datalength, presize,
databuffer, datalength, &presize);
d(printf("Filtered content (%s): '", ((CamelObject *)f->filter)->klass->name));
- d(fwrite(*databuffer, sizeof(char), *datalength, stdout));
+ d(fwrite(*databuffer, sizeof(gchar), *datalength, stdout));
d(printf("'\n"));
f = f->next;
}
gint fd;
struct _header_scan_state *s;
gchar *data;
- size_t len;
+ gsize len;
gint state;
gchar *name = "/tmp/evmail/Inbox";
struct _header_scan_stack *h;
CamelMimeParser *camel_mime_parser_new (void);
/* quick-fix for parser not erroring, we can find out if it had an error afterwards */
-int camel_mime_parser_errno (CamelMimeParser *parser);
+gint camel_mime_parser_errno (CamelMimeParser *parser);
/* using an fd will be a little faster, but not much (over a simple stream) */
-int camel_mime_parser_init_with_fd (CamelMimeParser *m, gint fd);
-int camel_mime_parser_init_with_stream (CamelMimeParser *m, CamelStream *stream);
+gint camel_mime_parser_init_with_fd (CamelMimeParser *m, gint fd);
+gint camel_mime_parser_init_with_stream (CamelMimeParser *m, CamelStream *stream);
/* get the stream or fd back of the parser */
CamelStream *camel_mime_parser_stream (CamelMimeParser *parser);
-int camel_mime_parser_fd (CamelMimeParser *parser);
+gint camel_mime_parser_fd (CamelMimeParser *parser);
/* scan 'From' separators? */
void camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from);
gint camel_mime_parser_set_header_regex (CamelMimeParser *parser, gchar *matchstr);
/* normal interface */
-camel_mime_parser_state_t camel_mime_parser_step (CamelMimeParser *parser, gchar **databuffer, size_t *datalength);
+camel_mime_parser_state_t camel_mime_parser_step (CamelMimeParser *parser, gchar **databuffer, gsize *datalength);
void camel_mime_parser_unstep (CamelMimeParser *parser);
void camel_mime_parser_drop_step (CamelMimeParser *parser);
camel_mime_parser_state_t camel_mime_parser_state (CamelMimeParser *parser);
gchar *buf;
GByteArray *buffer;
CamelStream *mem;
- size_t len;
+ gsize len;
d(printf ("simple_data_wrapper_construct_from_parser()\n"));
#define CMD_CLASS(so) CAMEL_MEDIUM_CLASS (CAMEL_OBJECT_GET_CLASS(so))
/* from CamelDataWrapper */
-static ssize_t write_to_stream (CamelDataWrapper *dw, CamelStream *stream);
-static int construct_from_stream (CamelDataWrapper *dw, CamelStream *stream);
+static gssize write_to_stream (CamelDataWrapper *dw, CamelStream *stream);
+static gint construct_from_stream (CamelDataWrapper *dw, CamelStream *stream);
/* from CamelMedium */
static void add_header (CamelMedium *medium, const gchar *name, gconstpointer value);
static void set_disposition (CamelMimePart *mime_part, const gchar *disposition);
/* format output of headers */
-static ssize_t write_references(CamelStream *stream, struct _camel_header_raw *h);
+static gssize write_references(CamelStream *stream, struct _camel_header_raw *h);
/*static gint write_fold(CamelStream *stream, struct _camel_header_raw *h);*/
-static ssize_t write_raw(CamelStream *stream, struct _camel_header_raw *h);
+static gssize write_raw(CamelStream *stream, struct _camel_header_raw *h);
/* loads in a hash table the set of header names we */
static void
init_header_name_table(void)
{
- header_name_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
- g_hash_table_insert (header_name_table, "Content-Description", (gpointer)HEADER_DESCRIPTION);
- g_hash_table_insert (header_name_table, "Content-Disposition", (gpointer)HEADER_DISPOSITION);
- g_hash_table_insert (header_name_table, "Content-id", (gpointer)HEADER_CONTENT_ID);
- g_hash_table_insert (header_name_table, "Content-Transfer-Encoding", (gpointer)HEADER_ENCODING);
- g_hash_table_insert (header_name_table, "Content-MD5", (gpointer)HEADER_CONTENT_MD5);
- g_hash_table_insert (header_name_table, "Content-Location", (gpointer)HEADER_CONTENT_LOCATION);
- g_hash_table_insert (header_name_table, "Content-Type", (gpointer)HEADER_CONTENT_TYPE);
-
- header_formatted_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
- g_hash_table_insert(header_formatted_table, "Content-Type", write_raw);
- g_hash_table_insert(header_formatted_table, "Content-Disposition", write_raw);
- g_hash_table_insert(header_formatted_table, "To", write_raw);
- g_hash_table_insert(header_formatted_table, "From", write_raw);
- g_hash_table_insert(header_formatted_table, "Reply-To", write_raw);
- g_hash_table_insert(header_formatted_table, "Cc", write_raw);
- g_hash_table_insert(header_formatted_table, "Bcc", write_raw);
- g_hash_table_insert(header_formatted_table, "Message-ID", write_raw);
- g_hash_table_insert(header_formatted_table, "In-Reply-To", write_raw);
- g_hash_table_insert(header_formatted_table, "References", write_references);
+ header_name_table = g_hash_table_new (
+ camel_strcase_hash, camel_strcase_equal);
+ g_hash_table_insert (
+ header_name_table,
+ (gpointer) "Content-Description",
+ (gpointer) HEADER_DESCRIPTION);
+ g_hash_table_insert (
+ header_name_table,
+ (gpointer) "Content-Disposition",
+ (gpointer) HEADER_DISPOSITION);
+ g_hash_table_insert (
+ header_name_table,
+ (gpointer) "Content-id",
+ (gpointer) HEADER_CONTENT_ID);
+ g_hash_table_insert (
+ header_name_table,
+ (gpointer) "Content-Transfer-Encoding",
+ (gpointer) HEADER_ENCODING);
+ g_hash_table_insert (
+ header_name_table,
+ (gpointer) "Content-MD5",
+ (gpointer) HEADER_CONTENT_MD5);
+ g_hash_table_insert (
+ header_name_table,
+ (gpointer) "Content-Location",
+ (gpointer) HEADER_CONTENT_LOCATION);
+ g_hash_table_insert (
+ header_name_table,
+ (gpointer) "Content-Type",
+ (gpointer) HEADER_CONTENT_TYPE);
+
+ header_formatted_table = g_hash_table_new (
+ camel_strcase_hash, camel_strcase_equal);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "Content-Type", write_raw);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "Content-Disposition", write_raw);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "To", write_raw);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "From", write_raw);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "Reply-To", write_raw);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "Cc", write_raw);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "Bcc", write_raw);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "Message-ID", write_raw);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "In-Reply-To", write_raw);
+ g_hash_table_insert (
+ header_formatted_table,
+ (gpointer) "References", write_references);
}
static void
/**********************************************************************/
-static ssize_t
+static gssize
write_references(CamelStream *stream, struct _camel_header_raw *h)
{
- ssize_t len, out, total;
+ gssize len, out, total;
gchar *v, *ids, *ide;
/* this is only approximate, based on the next >, this way it retains any content
#if 0
/* not needed - yet - handled by default case */
-static ssize_t
+static gssize
write_fold(CamelStream *stream, struct _camel_header_raw *h)
{
gchar *val;
}
#endif
-static ssize_t
+static gssize
write_raw(CamelStream *stream, struct _camel_header_raw *h)
{
gchar *val = h->value;
return camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val);
}
-static ssize_t
+static gssize
write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
{
CamelMimePart *mp = CAMEL_MIME_PART (dw);
CamelMedium *medium = CAMEL_MEDIUM (dw);
CamelStream *ostream = stream;
CamelDataWrapper *content;
- ssize_t total = 0;
- ssize_t count;
+ gssize total = 0;
+ gssize count;
gint errnosav;
d(printf("mime_part::write_to_stream\n"));
if (mp->headers) {
struct _camel_header_raw *h = mp->headers;
gchar *val;
- ssize_t (*writefn)(CamelStream *stream, struct _camel_header_raw *);
+ gssize (*writefn)(CamelStream *stream, struct _camel_header_raw *);
/* fold/write the headers. But dont fold headers that are already formatted
(e.g. ones with parameter-lists, that we know about, and have created) */
}
/* mime_part */
-static int
+static gint
construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp)
{
CamelDataWrapper *dw = (CamelDataWrapper *) mime_part;
struct _camel_header_raw *headers;
const gchar *content;
gchar *buf;
- size_t len;
+ gsize len;
gint err;
d(printf("mime_part::construct_from_parser()\n"));
return CMP_CLASS (mime_part)->construct_from_parser (mime_part, mp);
}
-static int
+static gint
construct_from_stream(CamelDataWrapper *dw, CamelStream *s)
{
CamelMimeParser *mp;
*
* Returns: the size of the MIME part's content in bytes.
**/
-size_t
+gsize
camel_mime_part_get_content_size (CamelMimePart *mime_part)
{
CamelStreamNull *null;
CamelDataWrapper *dw;
- size_t size;
+ gsize size;
g_return_val_if_fail (CAMEL_IS_MIME_PART (mime_part), 0);
CamelContentType *camel_mime_part_get_content_type (CamelMimePart *mime_part);
/* construction */
-int camel_mime_part_construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *parser);
+gint camel_mime_part_construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *parser);
/* utility functions */
void camel_mime_part_set_content (CamelMimePart *mime_part,
const gchar *data, gint length, const gchar *type);
-size_t camel_mime_part_get_content_size (CamelMimePart *mime_part);
+gsize camel_mime_part_get_content_size (CamelMimePart *mime_part);
G_END_DECLS
*
* Returns: the number of bytes encoded
**/
-size_t
-camel_base64_encode_close(guchar *in, size_t inlen, gboolean break_lines, guchar *out, gint *state, gint *save)
+gsize
+camel_base64_encode_close(guchar *in, gsize inlen, gboolean break_lines, guchar *out, gint *state, gint *save)
{
gsize bytes = 0;
*
* Returns: the number of bytes encoded
**/
-size_t
-camel_base64_encode_step(guchar *in, size_t len, gboolean break_lines, guchar *out, gint *state, gint *save)
+gsize
+camel_base64_encode_step(guchar *in, gsize len, gboolean break_lines, guchar *out, gint *state, gint *save)
{
return g_base64_encode_step (in, len, break_lines, (gchar *) out, state, save);
}
*
* Returns: the number of bytes decoded (which have been dumped in @out)
**/
-size_t
-camel_base64_decode_step(guchar *in, size_t len, guchar *out, gint *state, guint *save)
+gsize
+camel_base64_decode_step(guchar *in, gsize len, guchar *out, gint *state, guint *save)
{
return g_base64_decode_step ((gchar *) in, len, out, state, save);
}
* Returns: a string containing the base64 encoded data
**/
gchar *
-camel_base64_encode_simple (const gchar *data, size_t len)
+camel_base64_encode_simple (const gchar *data, gsize len)
{
return g_base64_encode ((const guchar *) data, len);
}
*
* Returns: the new length of @data
**/
-size_t
-camel_base64_decode_simple (gchar *data, size_t len)
+gsize
+camel_base64_decode_simple (gchar *data, gsize len)
{
guchar *out_data;
gsize out_len = 0;
*
* Returns: the number of bytes encoded
**/
-size_t
-camel_uuencode_close (guchar *in, size_t len, guchar *out, guchar *uubuf, gint *state, guint32 *save)
+gsize
+camel_uuencode_close (guchar *in, gsize len, guchar *out, guchar *uubuf, gint *state, guint32 *save)
{
register guchar *outptr, *bufptr;
register guint32 saved;
*
* Returns: the number of bytes encoded
**/
-size_t
-camel_uuencode_step (guchar *in, size_t len, guchar *out, guchar *uubuf, gint *state, guint32 *save)
+gsize
+camel_uuencode_step (guchar *in, gsize len, guchar *out, guchar *uubuf, gint *state, guint32 *save)
{
register guchar *inptr, *outptr, *bufptr;
guchar *inend;
*
* Returns: the number of bytes decoded
**/
-size_t
-camel_uudecode_step (guchar *in, size_t len, guchar *out, gint *state, guint32 *save)
+gsize
+camel_uudecode_step (guchar *in, gsize len, guchar *out, gint *state, guint32 *save)
{
register guchar *inptr, *outptr;
guchar *inend, ch;
*
* Returns: the number of bytes encoded
**/
-size_t
-camel_quoted_encode_close(guchar *in, size_t len, guchar *out, gint *state, gint *save)
+gsize
+camel_quoted_encode_close(guchar *in, gsize len, guchar *out, gint *state, gint *save)
{
register guchar *outptr = out;
gint last;
*
* Returns: the number of bytes encoded
**/
-size_t
-camel_quoted_encode_step (guchar *in, size_t len, guchar *out, gint *statep, gint *save)
+gsize
+camel_quoted_encode_step (guchar *in, gsize len, guchar *out, gint *statep, gint *save)
{
register guchar *inptr, *outptr, *inend;
guchar c;
*
* Returns: the number of bytes decoded
**/
-size_t
-camel_quoted_decode_step(guchar *in, size_t len, guchar *out, gint *savestate, gint *saveme)
+gsize
+camel_quoted_decode_step(guchar *in, gsize len, guchar *out, gint *savestate, gint *saveme)
{
register guchar *inptr, *outptr;
guchar *inend, c;
this is for the "Q" encoding of international words,
which is slightly different than plain quoted-printable (mainly by allowing 0x20 <> _)
*/
-static size_t
-quoted_decode(const guchar *in, size_t len, guchar *out)
+static gsize
+quoted_decode(const guchar *in, gsize len, guchar *out)
{
register const guchar *inptr;
register guchar *outptr;
/* rfc2047 version of quoted-printable */
/* safemask is the mask to apply to the camel_mime_special_table to determine what
characters can safely be included without encoding */
-static size_t
-quoted_encode (const guchar *in, size_t len, guchar *out, unsigned short safemask)
+static gsize
+quoted_encode (const guchar *in, gsize len, guchar *out, unsigned short safemask)
{
register const guchar *inptr, *inend;
guchar *outptr;
}
static gchar *
-camel_iconv_strndup (iconv_t cd, const gchar *string, size_t n)
+camel_iconv_strndup (iconv_t cd, const gchar *string, gsize n)
{
- size_t inleft, outleft, converted = 0;
+ gsize inleft, outleft, converted = 0;
gchar *out, *outbuf;
const gchar *inbuf;
- size_t outlen;
+ gsize outlen;
gint errnosav;
if (cd == (iconv_t) -1)
outleft = outlen - converted;
converted = iconv (cd, (gchar **) &inbuf, &inleft, &outbuf, &outleft);
- if (converted == (size_t) -1) {
+ if (converted == (gsize) -1) {
if (errno != E2BIG && errno != EINVAL)
goto fail;
}
return NULL;
}
-#define is_ascii(c) isascii ((int) ((unsigned char) (c)))
+#define is_ascii(c) isascii ((gint) ((guchar) (c)))
static gchar *
-decode_8bit (const gchar *text, size_t len, const gchar *default_charset)
+decode_8bit (const gchar *text, gsize len, const gchar *default_charset)
{
const gchar *charsets[4] = { "UTF-8", NULL, NULL, NULL };
- size_t inleft, outleft, outlen, rc, min, n;
+ gsize inleft, outleft, outlen, rc, min, n;
const gchar *locale_charset, *best;
gchar *out, *outbuf;
const gchar *inbuf;
do {
rc = iconv (cd, (gchar **) &inbuf, &inleft, &outbuf, &outleft);
- if (rc == (size_t) -1) {
+ if (rc == (gsize) -1) {
if (errno == EINVAL) {
/* incomplete sequence at the end of the input buffer */
n += inleft;
if (errno == E2BIG) {
outlen += (inleft * 2) + 16;
- rc = (size_t) (outbuf - out);
+ rc = (gsize) (outbuf - out);
out = g_realloc (out, outlen + 1);
outleft = outlen - rc;
outbuf = out + rc;
camel_iconv_close (cd);
- if (rc != (size_t) -1 && n == 0)
+ if (rc != (gsize) -1 && n == 0)
return out;
if (n < min) {
do {
rc = iconv (cd, (gchar **) &inbuf, &inleft, &outbuf, &outleft);
- if (rc == (size_t) -1) {
+ if (rc == (gsize) -1) {
if (errno == EINVAL) {
/* incomplete sequence at the end of the input buffer */
break;
/* decode an rfc2047 encoded-word token */
static gchar *
-rfc2047_decode_word (const gchar *in, size_t inlen, const gchar *default_charset)
+rfc2047_decode_word (const gchar *in, gsize inlen, const gchar *default_charset)
{
const guchar *instart = (const guchar *) in;
- const register guchar *inptr = instart + 2;
+ const guchar *inptr = instart + 2;
const guchar *inend = instart + inlen - 2;
guchar *decoded;
const gchar *charset;
gchar *charenc, *p;
guint32 save = 0;
- ssize_t declen;
+ gssize declen;
gint state = 0;
- size_t len;
+ gsize len;
iconv_t cd;
gchar *buf;
according to the rfc's. Anyway, since the conversion to utf-8
is trivial, just do it here without iconv */
static GString *
-append_latin1 (GString *out, const gchar *in, size_t len)
+append_latin1 (GString *out, const gchar *in, gsize len)
{
guint c;
while (len) {
- c = (unsigned int)*in++;
+ c = (guint)*in++;
len--;
if (c & 0x80) {
out = g_string_append_c (out, 0xc0 | ((c >> 6) & 0x3)); /* 110000xx */
return out;
}
-static int
-append_8bit (GString *out, const gchar *inbuf, size_t inlen, const gchar *charset)
+static gint
+append_8bit (GString *out, const gchar *inbuf, gsize inlen, const gchar *charset)
{
gchar *outbase, *outbuf;
- size_t outlen;
+ gsize outlen;
iconv_t ic;
ic = camel_iconv_open ("UTF-8", charset);
outlen = inlen * 6 + 16;
outbuf = outbase = g_malloc(outlen);
- if (camel_iconv (ic, &inbuf, &inlen, &outbuf, &outlen) == (size_t) -1) {
+ if (camel_iconv (ic, &inbuf, &inlen, &outbuf, &outlen) == (gsize) -1) {
w(g_warning("Conversion to '%s' failed: %s", charset, g_strerror (errno)));
g_free(outbase);
camel_iconv_close (ic);
}
static GString *
-append_quoted_pair (GString *str, const gchar *in, size_t inlen)
+append_quoted_pair (GString *str, const gchar *in, gsize inlen)
{
register const gchar *inptr = in;
const gchar *inend = in + inlen;
register const gchar *inptr = in;
gboolean encoded = FALSE;
const gchar *lwsp, *text;
- size_t nlwsp, n;
+ gsize nlwsp, n;
gboolean ascii;
gchar *decoded;
GString *out;
while (camel_mime_is_lwsp (*inptr))
inptr++;
- nlwsp = (size_t) (inptr - lwsp);
+ nlwsp = (gsize) (inptr - lwsp);
if (*inptr != '\0') {
text = inptr;
}
}
- n = (size_t) (inptr - text);
+ n = (gsize) (inptr - text);
if (is_rfc2047_encoded_word (text, n)) {
if ((decoded = rfc2047_decode_word (text, n, default_charset))) {
/* rfc2047 states that you must ignore all
/* FIXME: needs a way to cache iconv opens for different charsets? */
static void
-rfc2047_encode_word(GString *outstring, const gchar *in, size_t len, const gchar *type, unsigned short safemask)
+rfc2047_encode_word(GString *outstring, const gchar *in, gsize len, const gchar *type, unsigned short safemask)
{
iconv_t ic = (iconv_t) -1;
gchar *buffer, *out, *ascii;
- size_t inlen, outlen, enclen, bufflen;
+ gsize inlen, outlen, enclen, bufflen;
const gchar *inptr, *p;
gint first = 1;
ic = camel_iconv_open (type, "UTF-8");
while (inlen) {
- ssize_t convlen, proclen;
+ gssize convlen, proclen;
gint i;
/* break up words into smaller bits, what we really want is encoded + overhead < 75,
hopefully-small-enough chunks, and leave it at that */
convlen = MIN(inlen, CAMEL_FOLD_PREENCODED);
p = inptr;
- if (camel_iconv (ic, &inptr, &convlen, &out, &outlen) == (size_t) -1 && errno != EINVAL) {
+ if (camel_iconv (ic, &inptr, (gsize *) &convlen, &out, &outlen) == (gsize) -1 && errno != EINVAL) {
w(g_warning("Conversion problem: conversion truncated: %s", g_strerror (errno)));
/* blah, we include it anyway, better than infinite loop ... */
inptr += convlen;
/* apply quoted-string rules to a string */
static void
-quote_word(GString *out, gboolean do_quotes, const gchar *start, size_t len)
+quote_word(GString *out, gboolean do_quotes, const gchar *start, gsize len)
{
gint i, c;
wordl = words;
while (wordl) {
const gchar *start;
- size_t len;
+ gsize len;
word = wordl->data;
{
const gchar *inptr = *in;
gchar *out = NULL, *outptr;
- size_t outlen;
+ gsize outlen;
gint c;
header_decode_lwsp(&inptr);
#define HEXVAL(c) (isdigit (c) ? (c) - '0' : tolower (c) - 'a' + 10)
static gchar *
-hex_decode (const gchar *in, size_t len)
+hex_decode (const gchar *in, gsize len)
{
const guchar *inend = (const guchar *) (in + len);
guchar *inptr, *outptr;
/* Tries to convert @in @from charset @to charset. Any failure, we get no data out rather than partial conversion */
static gchar *
-header_convert(const gchar *to, const gchar *from, const gchar *in, size_t inlen)
+header_convert(const gchar *to, const gchar *from, const gchar *in, gsize inlen)
{
iconv_t ic;
- size_t outlen, ret;
+ gsize outlen, ret;
gchar *outbuf, *outbase, *result = NULL;
ic = camel_iconv_open(to, from);
outbuf = outbase = g_malloc(outlen);
ret = camel_iconv(ic, &in, &inlen, &outbuf, &outlen);
- if (ret != (size_t) -1) {
+ if (ret != (gsize) -1) {
camel_iconv(ic, NULL, 0, &outbuf, &outlen);
*outbuf = '\0';
result = g_strdup(outbase);
*/
static gchar *
-rfc2184_decode (const gchar *in, size_t len)
+rfc2184_decode (const gchar *in, gsize len)
{
const gchar *inptr = in;
const gchar *inend = in + len;
pre = header_decode_word (&inptr);
if (pre) {
- size_t l = strlen (last);
- size_t p = strlen (pre);
+ gsize l = strlen (last);
+ gsize p = strlen (pre);
/* dont append ' ' between sucsessive encoded words */
if ((l>6 && last[l-2] == '?' && last[l-1] == '=')
gint index;
};
-static int
+static gint
rfc2184_param_cmp(gconstpointer ap, gconstpointer bp)
{
const struct _rfc2184_param *a = *(gpointer *)ap;
} else {
node->value = value;
for (;*value;value++)
- if (!isascii((unsigned char)*value))
+ if (!isascii((guchar)*value))
*value = '_';
}
} else
g_return_val_if_fail (in != NULL, NULL);
if (is_filename) {
- if (!g_utf8_validate (inptr, -1, NULL)) {
+ if (!g_utf8_validate ((gchar *) inptr, -1, NULL)) {
GString *buff = g_string_new ("");
for (; inptr && *inptr; inptr++) {
g_string_append_c (buff, *inptr);
}
- outbuf = g_string_free (buff, FALSE);
+ outbuf = (guchar *) g_string_free (buff, FALSE);
inptr = outbuf;
}
gboolean encoded = FALSE;
gboolean quote = FALSE;
gint here = out->len;
- size_t nlen, vlen;
+ gsize nlen, vlen;
gchar *value;
if (!p->value) {
gchar *q = ptr;
gint j = 2;
- for ( ; j > 0 && q > inptr && *q != '%'; j--, q--);
+ for (; j > 0 && q > inptr && *q != '%'; j--, q--);
if (*q == '%')
ptr = q;
}
d = g_malloc(sizeof(*d));
d->refcount = 1;
d->disposition = decode_token(&inptr);
- if (d->disposition == NULL)
+ if (d->disposition == NULL) {
w(g_warning("Empty disposition type"));
+ }
d->params = header_decode_param_list(&inptr);
return d;
}
};
static struct {
- gchar *name;
+ const gchar *name;
gint offset;
} tz_offsets [] = {
{ "UT", 0 },
struct _date_token *next;
guchar mask;
const gchar *start;
- size_t len;
+ gsize len;
};
static struct _date_token *
if (*start == '\0')
break;
- mask = camel_datetok_table[(unsigned char) *start];
+ mask = camel_datetok_table[(guchar) *start];
/* find the end of this token */
end = start + 1;
while (*end && !strchr ("-/,\t\r\n ", *end))
- mask |= camel_datetok_table[(unsigned char) *end++];
+ mask |= camel_datetok_table[(guchar) *end++];
if (end != start) {
token = g_malloc (sizeof (struct _date_token));
return tokens;
}
-static int
-decode_int (const gchar *in, size_t inlen)
+static gint
+decode_int (const gchar *in, gsize inlen)
{
register const gchar *inptr;
gint sign = 1, val = 0;
} else if (*inptr == '+')
inptr++;
- for ( ; inptr < inend; inptr++) {
+ for (; inptr < inend; inptr++) {
if (!(*inptr >= '0' && *inptr <= '9'))
return -1;
else
}
#if 0
-static int
+static gint
get_days_in_month (gint month, gint year)
{
switch (month) {
}
#endif
-static int
-get_wday (const gchar *in, size_t inlen)
+static gint
+get_wday (const gchar *in, gsize inlen)
{
gint wday;
return -1; /* unknown week day */
}
-static int
-get_mday (const gchar *in, size_t inlen)
+static gint
+get_mday (const gchar *in, gsize inlen)
{
gint mday;
return mday;
}
-static int
-get_month (const gchar *in, size_t inlen)
+static gint
+get_month (const gchar *in, gsize inlen)
{
gint i;
return -1; /* unknown month */
}
-static int
-get_year (const gchar *in, size_t inlen)
+static gint
+get_year (const gchar *in, gsize inlen)
{
gint year;
}
static gboolean
-get_time (const gchar *in, size_t inlen, gint *hour, gint *min, gint *sec)
+get_time (const gchar *in, gsize inlen, gint *hour, gint *min, gint *sec)
{
register const gchar *inptr;
gint *val, colons = 0;
return TRUE;
}
-static int
+static gint
get_tzone (struct _date_token **token)
{
const gchar *inptr, *inend;
- size_t inlen;
+ gsize inlen;
gint i, t;
for (i = 0; *token && i < 2; *token = (*token)->next, i++) {
}
for (t = 0; t < 15; t++) {
- size_t len = strlen (tz_offsets[t].name);
+ gsize len = strlen (tz_offsets[t].name);
if (len != inlen)
continue;
camel_header_raw_append_parse(struct _camel_header_raw **list, const gchar *header, gint offset)
{
register const gchar *in;
- size_t fieldlen;
+ gsize fieldlen;
gchar *name;
in = header;
#define COUNT_LOCK() pthread_mutex_lock (&count_lock)
#define COUNT_UNLOCK() pthread_mutex_unlock (&count_lock)
gchar host[MAXHOSTNAMELEN];
- gchar *name;
+ const gchar *name;
static gint count = 0;
gchar *msgid;
gint retval;
name = "localhost.localdomain";
COUNT_LOCK ();
- msgid = g_strdup_printf ("%d.%d.%d.camel@%s", (int) time (NULL), getpid (), count++, name);
+ msgid = g_strdup_printf ("%d.%d.%d.camel@%s", (gint) time (NULL), getpid (), count++, name);
COUNT_UNLOCK ();
if (ai)
static struct {
- gchar *name;
- gchar *pattern;
+ const gchar *name;
+ const gchar *pattern;
regex_t regex;
} mail_list_magic[] = {
/* List-Post: <mailto:gnome-hackers@gnome.org> */
errcode = regcomp(&mail_list_magic[i].regex, mail_list_magic[i].pattern, REG_EXTENDED|REG_ICASE);
if (errcode != 0) {
gchar *errstr;
- size_t len;
+ gsize len;
len = regerror(errcode, &mail_list_magic[i].regex, NULL, 0);
errstr = g_malloc0(len + 1);
}
gchar *
-camel_header_address_fold (const gchar *in, size_t headerlen)
+camel_header_address_fold (const gchar *in, gsize headerlen)
{
- size_t len, outlen;
+ gsize len, outlen;
const gchar *inptr = in, *space, *p, *n;
GString *out;
gchar *ret;
/* simple header folding */
/* will work even if the header is already folded */
gchar *
-camel_header_fold(const gchar *in, size_t headerlen)
+camel_header_fold(const gchar *in, gsize headerlen)
{
- size_t len, outlen, tmplen;
+ gsize len, outlen, tmplen;
const gchar *inptr = in, *space, *p, *n;
GString *out;
gchar *ret;
gchar *camel_header_raw_check_mailing_list (struct _camel_header_raw **list);
/* fold a header */
-gchar *camel_header_address_fold (const gchar *in, size_t headerlen);
-gchar *camel_header_fold (const gchar *in, size_t headerlen);
+gchar *camel_header_address_fold (const gchar *in, gsize headerlen);
+gchar *camel_header_fold (const gchar *in, gsize headerlen);
gchar *camel_header_unfold (const gchar *in);
/* decode a header which is a simple token */
#ifndef CAMEL_DISABLE_DEPRECATED
/* do incremental base64/quoted-printable (de/en)coding */
-size_t camel_base64_decode_step (guchar *in, size_t len, guchar *out, gint *state, guint *save);
+gsize camel_base64_decode_step (guchar *in, gsize len, guchar *out, gint *state, guint *save);
-size_t camel_base64_encode_step (guchar *in, size_t inlen, gboolean break_lines, guchar *out, gint *state, gint *save);
-size_t camel_base64_encode_close (guchar *in, size_t inlen, gboolean break_lines, guchar *out, gint *state, gint *save);
+gsize camel_base64_encode_step (guchar *in, gsize inlen, gboolean break_lines, guchar *out, gint *state, gint *save);
+gsize camel_base64_encode_close (guchar *in, gsize inlen, gboolean break_lines, guchar *out, gint *state, gint *save);
#endif
-size_t camel_uudecode_step (guchar *in, size_t inlen, guchar *out, gint *state, guint32 *save);
+gsize camel_uudecode_step (guchar *in, gsize inlen, guchar *out, gint *state, guint32 *save);
-size_t camel_uuencode_step (guchar *in, size_t len, guchar *out, guchar *uubuf, gint *state,
+gsize camel_uuencode_step (guchar *in, gsize len, guchar *out, guchar *uubuf, gint *state,
guint32 *save);
-size_t camel_uuencode_close (guchar *in, size_t len, guchar *out, guchar *uubuf, gint *state,
+gsize camel_uuencode_close (guchar *in, gsize len, guchar *out, guchar *uubuf, gint *state,
guint32 *save);
-size_t camel_quoted_decode_step (guchar *in, size_t len, guchar *out, gint *savestate, gint *saveme);
+gsize camel_quoted_decode_step (guchar *in, gsize len, guchar *out, gint *savestate, gint *saveme);
-size_t camel_quoted_encode_step (guchar *in, size_t len, guchar *out, gint *state, gint *save);
-size_t camel_quoted_encode_close (guchar *in, size_t len, guchar *out, gint *state, gint *save);
+gsize camel_quoted_encode_step (guchar *in, gsize len, guchar *out, gint *state, gint *save);
+gsize camel_quoted_encode_close (guchar *in, gsize len, guchar *out, gint *state, gint *save);
#ifndef CAMEL_DISABLE_DEPRECATED
-gchar *camel_base64_encode_simple (const gchar *data, size_t len);
-size_t camel_base64_decode_simple (gchar *data, size_t len);
+gchar *camel_base64_encode_simple (const gchar *data, gsize len);
+gsize camel_base64_decode_simple (gchar *data, gsize len);
#endif
/* camel ctype type functions for rfc822/rfc2047/other, which are non-locale specific */
extern unsigned short camel_mime_special_table[256];
-#define camel_mime_is_ctrl(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_CTRL) != 0)
-#define camel_mime_is_lwsp(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_LWSP) != 0)
-#define camel_mime_is_tspecial(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_TSPECIAL) != 0)
-#define camel_mime_is_type(x, t) ((camel_mime_special_table[(unsigned char)(x)] & (t)) != 0)
-#define camel_mime_is_ttoken(x) ((camel_mime_special_table[(unsigned char)(x)] & (CAMEL_MIME_IS_TSPECIAL|CAMEL_MIME_IS_LWSP|CAMEL_MIME_IS_CTRL)) == 0)
-#define camel_mime_is_atom(x) ((camel_mime_special_table[(unsigned char)(x)] & (CAMEL_MIME_IS_SPECIAL|CAMEL_MIME_IS_SPACE|CAMEL_MIME_IS_CTRL)) == 0)
-#define camel_mime_is_dtext(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_DSPECIAL) == 0)
-#define camel_mime_is_fieldname(x) ((camel_mime_special_table[(unsigned char)(x)] & (CAMEL_MIME_IS_CTRL|CAMEL_MIME_IS_SPACE)) == 0)
-#define camel_mime_is_qpsafe(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_QPSAFE) != 0)
-#define camel_mime_is_especial(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_ESPECIAL) != 0)
-#define camel_mime_is_psafe(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_PSAFE) != 0)
-#define camel_mime_is_attrchar(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_ATTRCHAR) != 0)
+#define camel_mime_is_ctrl(x) ((camel_mime_special_table[(guchar)(x)] & CAMEL_MIME_IS_CTRL) != 0)
+#define camel_mime_is_lwsp(x) ((camel_mime_special_table[(guchar)(x)] & CAMEL_MIME_IS_LWSP) != 0)
+#define camel_mime_is_tspecial(x) ((camel_mime_special_table[(guchar)(x)] & CAMEL_MIME_IS_TSPECIAL) != 0)
+#define camel_mime_is_type(x, t) ((camel_mime_special_table[(guchar)(x)] & (t)) != 0)
+#define camel_mime_is_ttoken(x) ((camel_mime_special_table[(guchar)(x)] & (CAMEL_MIME_IS_TSPECIAL|CAMEL_MIME_IS_LWSP|CAMEL_MIME_IS_CTRL)) == 0)
+#define camel_mime_is_atom(x) ((camel_mime_special_table[(guchar)(x)] & (CAMEL_MIME_IS_SPECIAL|CAMEL_MIME_IS_SPACE|CAMEL_MIME_IS_CTRL)) == 0)
+#define camel_mime_is_dtext(x) ((camel_mime_special_table[(guchar)(x)] & CAMEL_MIME_IS_DSPECIAL) == 0)
+#define camel_mime_is_fieldname(x) ((camel_mime_special_table[(guchar)(x)] & (CAMEL_MIME_IS_CTRL|CAMEL_MIME_IS_SPACE)) == 0)
+#define camel_mime_is_qpsafe(x) ((camel_mime_special_table[(guchar)(x)] & CAMEL_MIME_IS_QPSAFE) != 0)
+#define camel_mime_is_especial(x) ((camel_mime_special_table[(guchar)(x)] & CAMEL_MIME_IS_ESPECIAL) != 0)
+#define camel_mime_is_psafe(x) ((camel_mime_special_table[(guchar)(x)] & CAMEL_MIME_IS_PSAFE) != 0)
+#define camel_mime_is_attrchar(x) ((camel_mime_special_table[(guchar)(x)] & CAMEL_MIME_IS_ATTRCHAR) != 0)
G_END_DECLS
#endif
#ifdef HAVE_BROKEN_SPOOL
-static gint camel_movemail_copy_filter(gint fromfd, gint tofd, off_t start, size_t bytes, CamelMimeFilter *filter);
+static gint camel_movemail_copy_filter(gint fromfd, gint tofd, off_t start, gsize bytes, CamelMimeFilter *filter);
static gint camel_movemail_solaris (gint oldsfd, gint dfd, CamelException *ex);
#else
/* these could probably be exposed as a utility? (but only mbox needs it) */
#endif
#if 0
-static gint camel_movemail_copy(gint fromfd, gint tofd, off_t start, size_t bytes);
+static gint camel_movemail_copy(gint fromfd, gint tofd, off_t start, gsize bytes);
#endif
/**
#endif
#ifndef HAVE_BROKEN_SPOOL
-static int
+static gint
camel_movemail_copy_file(gint sfd, gint dfd, CamelException *ex)
{
gint nread, nwrote;
#endif
#if 0
-static int
-camel_movemail_copy(gint fromfd, gint tofd, off_t start, size_t bytes)
+static gint
+camel_movemail_copy(gint fromfd, gint tofd, off_t start, gsize bytes)
{
gchar buffer[4096];
gint written = 0;
#define PRE_SIZE (32)
#ifdef HAVE_BROKEN_SPOOL
-static int
-camel_movemail_copy_filter(gint fromfd, gint tofd, off_t start, size_t bytes, CamelMimeFilter *filter)
+static gint
+camel_movemail_copy_filter(gint fromfd, gint tofd, off_t start, gsize bytes, CamelMimeFilter *filter)
{
gchar buffer[4096+PRE_SIZE];
gint written = 0;
/* write the headers back out again, but not he Content-Length header, because we dont
want to maintain it! */
-static int
+static gint
solaris_header_write(gint fd, struct _camel_header_raw *header)
{
struct iovec iv[4];
/* Well, since Solaris is a tad broken wrt its 'mbox' folder format,
we must convert it to a real mbox format. Thankfully this is
mostly pretty easy */
-static int
+static gint
camel_movemail_solaris (gint oldsfd, gint dfd, CamelException *ex)
{
CamelMimeParser *mp;
cl = camel_mime_parser_header(mp, "content-length", NULL);
if (cl == NULL) {
- g_warning("Required Content-Length header is missing from solaris mail box @ %d", (int)camel_mime_parser_tell(mp));
+ g_warning("Required Content-Length header is missing from solaris mail box @ %d", (gint)camel_mime_parser_tell(mp));
camel_mime_parser_drop_step(mp);
camel_mime_parser_drop_step(mp);
camel_mime_parser_step(mp, &buffer, &len);
#endif
};
-static int
+static gint
msgport_pipe (gint *fds)
{
#ifndef G_OS_WIN32
}
#ifdef HAVE_NSS
-static int
+static gint
msgport_prpipe (PRFileDesc **fds)
{
#ifdef G_OS_WIN32
static CamelMimePart *signed_get_part (CamelMultipart *multipart, guint index);
static guint signed_get_number (CamelMultipart *multipart);
-static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
+static gssize write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
static void set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type);
static gint construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
static gint signed_construct_from_parser (CamelMultipart *multipart, struct _CamelMimeParser *mp);
return multipart;
}
-static int
+static gint
skip_content(CamelMimeParser *cmp)
{
gchar *buf;
- size_t len;
+ gsize len;
gint state;
switch (camel_mime_parser_state(cmp)) {
return 0;
}
-static int
+static gint
parse_content(CamelMultipartSigned *mps)
{
CamelMimeParser *cmp;
CamelStreamMem *mem;
const gchar *boundary;
gchar *buf;
- size_t len;
+ gsize len;
gint state;
boundary = camel_multipart_get_boundary(mp);
}
}
-static int
+static gint
construct_from_stream(CamelDataWrapper *data_wrapper, CamelStream *stream)
{
CamelMultipartSigned *mps = (CamelMultipartSigned *)data_wrapper;
return 0;
}
-static int
+static gint
signed_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
{
gint err;
CamelContentType *content_type;
CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
gchar *buf;
- size_t len;
+ gsize len;
CamelStream *mem;
/* we *must not* be in multipart state, otherwise the mime parser will
return 0;
}
-static ssize_t
+static gssize
write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
CamelMultipartSigned *mps = (CamelMultipartSigned *)data_wrapper;
CamelMultipart *mp = (CamelMultipart *)mps;
const gchar *boundary;
- ssize_t total = 0;
- ssize_t count;
+ gssize total = 0;
+ gssize count;
/* we have 3 basic cases:
1. constructed, we write out the data wrapper stream we got
static void set_boundary (CamelMultipart *multipart,
const gchar *boundary);
static const gchar * get_boundary (CamelMultipart *multipart);
-static ssize_t write_to_stream (CamelDataWrapper *data_wrapper,
+static gssize write_to_stream (CamelDataWrapper *data_wrapper,
CamelStream *stream);
static gint construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp);
/* Generate a fairly random boundary string. */
bgen = g_strdup_printf ("%p:%lu:%lu", (gpointer) multipart,
- (unsigned long) getpid(),
- (unsigned long) time(NULL));
+ (gulong) getpid(),
+ (gulong) time(NULL));
checksum = g_checksum_new (G_CHECKSUM_MD5);
g_checksum_update (checksum, (guchar *) bgen, -1);
}
/* this is MIME specific, doesn't belong here really */
-static ssize_t
+static gssize
write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
CamelMultipart *multipart = CAMEL_MULTIPART (data_wrapper);
const gchar *boundary;
- ssize_t total = 0;
- ssize_t count;
+ gssize total = 0;
+ gssize count;
GList *node;
/* get the bundary text */
}
}
-static int
+static gint
construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
{
gint err;
CamelContentType *content_type;
CamelMimePart *bodypart;
gchar *buf;
- size_t len;
+ gsize len;
g_assert(camel_mime_parser_state(mp) == CAMEL_MIME_PARSER_STATE_MULTIPART);
void camel_multipart_set_preface (CamelMultipart *multipart, const gchar *preface);
void camel_multipart_set_postface (CamelMultipart *multipart, const gchar *postface);
-int camel_multipart_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *parser);
+gint camel_multipart_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *parser);
G_END_DECLS
/* some helpful utils for IPv6 lookups */
#define IPv6_BUFLEN_MIN (sizeof (gchar *) * 3)
-static int
+static gint
ai_to_herr (gint error)
{
switch (error) {
#endif /* ENABLE_IPv6 */
-static int
+static gint
camel_gethostbyname_r (const gchar *name, struct hostent *host,
- gchar *buf, size_t buflen, gint *herr)
+ gchar *buf, gsize buflen, gint *herr)
{
#ifdef ENABLE_IPv6
struct addrinfo hints, *res;
#endif /* ENABLE_IPv6 */
}
-static int
+static gint
camel_gethostbyaddr_r (const gchar *addr, gint addrlen, gint type, struct hostent *host,
- gchar *buf, size_t buflen, gint *herr)
+ gchar *buf, gsize buflen, gint *herr)
{
#ifdef ENABLE_IPv6
gint retval, len;
}
/* returns -1 if we didn't wait for reply from thread */
-static int
+static gint
cs_waitinfo(gpointer (worker)(gpointer), struct _addrinfo_msg *msg, const gchar *error, CamelException *ex)
{
CamelMsgPort *reply_port;
gint ai_family;
gint ai_socktype;
gint ai_protocol;
- size_t ai_addrlen;
+ gsize ai_addrlen;
struct sockaddr *ai_addr;
gchar *ai_canonname;
struct addrinfo *ai_next;
}
/* since newsgropus are 7bit ascii, decode/unformat are the same */
-static int
+static gint
nntp_decode(CamelAddress *a, const gchar *raw)
{
struct _camel_header_newsgroup *ha, *n;
return ret;
}
-static int
+static gint
nntp_cat (CamelAddress *dest, const CamelAddress *source)
{
gint i;
CamelType camel_nntp_address_get_type (void);
CamelNNTPAddress *camel_nntp_address_new (void);
-int camel_nntp_address_add (CamelNNTPAddress *a, const gchar *name);
+gint camel_nntp_address_add (CamelNNTPAddress *a, const gchar *name);
gboolean camel_nntp_address_get (const CamelNNTPAddress *a, gint index, const gchar **namep);
G_END_DECLS
o->klass = NULL;
}
-static int
+static gint
cobject_getv(CamelObject *o, CamelException *ex, CamelArgGetV *args)
{
gint i;
return 0;
}
-static int
+static gint
cobject_setv(CamelObject *o, CamelException *ex, CamelArgV *args)
{
gint i;
*/
-static int
+static gint
cobject_state_read(CamelObject *obj, FILE *fp)
{
guint32 i, count, version;
}
/* TODO: should pass exception around */
-static int
+static gint
cobject_state_write(CamelObject *obj, FILE *fp)
{
gint32 count, i;
/* CamelInterface base methods */
-static void
+G_GNUC_NORETURN static void
cinterface_init(CamelObject *o, CamelObjectClass *klass)
{
g_error("Cannot instantiate interfaces, trying to instantiate '%s'", klass->name);
- abort();
}
-static int
+static gint
cinterface_getv(CamelObject *o, CamelException *ex, CamelArgGetV *args)
{
return 0;
}
-static int
+static gint
cinterface_setv(CamelObject *o, CamelException *ex, CamelArgV *args)
{
return 0;
static CamelType
co_type_register(CamelType parent, const gchar * name,
/*guint ver, guint rev,*/
- size_t object_size, size_t klass_size,
+ gsize object_size, gsize klass_size,
CamelObjectClassInitFunc class_init,
CamelObjectClassFinalizeFunc class_finalise,
CamelObjectInitFunc object_init,
{
CamelObjectClass *klass;
/*int offset;
- size_t size;*/
+ gsize size;*/
TYPE_LOCK();
CamelType
camel_type_register(CamelType parent, const gchar * name,
/*guint ver, guint rev,*/
- size_t object_size, size_t klass_size,
+ gsize object_size, gsize klass_size,
CamelObjectClassInitFunc class_init,
CamelObjectClassFinalizeFunc class_finalise,
CamelObjectInitFunc object_init,
CamelType
camel_interface_register(CamelType parent, const gchar *name,
- size_t class_size,
+ gsize class_size,
CamelObjectClassInitFunc class_init,
CamelObjectClassFinalizeFunc class_finalise)
{
return o->hooks;
}
-unsigned int
+guint
camel_object_hook_event(gpointer vo, const gchar * name, CamelObjectEventHookFunc func, gpointer data)
{
CamelObject *obj = vo;
/* ********************************************************************** */
-gpointer camel_iterator_new(CamelIteratorVTable *klass, size_t size)
+gpointer camel_iterator_new(CamelIteratorVTable *klass, gsize size)
{
CamelIterator *it;
#include <glib.h>
#include <stdio.h> /* FILE */
-#include <stdlib.h> /* size_t */
+#include <stdlib.h> /* gsize */
#include <stdarg.h>
#include <pthread.h>
/* The type system .... it's pretty simple..... */
void camel_type_init (void);
CamelType camel_type_register(CamelType parent, const gchar * name, /*guint ver, guint rev,*/
- size_t instance_size,
- size_t classfuncs_size,
+ gsize instance_size,
+ gsize classfuncs_size,
CamelObjectClassInitFunc class_init,
CamelObjectClassFinalizeFunc class_finalize,
CamelObjectInitFunc instance_init,
#ifndef CAMEL_DISABLE_DEPRECATED
CamelType camel_interface_register(CamelType parent, const gchar *name,
- size_t classfuncs_size,
+ gsize classfuncs_size,
CamelObjectClassInitFunc class_init,
CamelObjectClassFinalizeFunc class_finalize);
#endif /* CAMEL_DISABLE_DEPRECATED */
/* subclasses adds new fields afterwards */
};
-gpointer camel_iterator_new(CamelIteratorVTable *klass, size_t size);
+gpointer camel_iterator_new(CamelIteratorVTable *klass, gsize size);
void camel_iterator_free(gpointer it);
gconstpointer camel_iterator_next(gpointer it, CamelException *ex);
void camel_iterator_reset(gpointer it);
;
}
-static int
+static gint
offline_folder_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelArgGetV props;
return 0;
}
-static int
+static gint
offline_folder_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
CamelOfflineFolder *folder = (CamelOfflineFolder *) object;
typedef struct _CamelOperationMsg {
CamelMsg msg;
-} CamelOperationMsg ;
+} CamelOperationMsg;
static void
co_createspecific(void)
camel_block_file_unref_block(cpi->blocks, block);
}
-static int
+static gint
keys_cmp(gconstpointer ap, gconstpointer bp)
{
const CamelPartitionKey *a = ap;
#else
if (kb->used >=127 || index >= kb->used) {
g_warning("Block %x: Invalid index or content: index %d used %d\n", blockid, index, kb->used);
- return ;
+ return;
}
#endif
l = l->next;
}
- g_hash_table_insert(provider_table, provider->protocol, provider);
+ g_hash_table_insert (
+ provider_table,
+ (gpointer) provider->protocol, provider);
UNLOCK();
}
{
CamelProvider *provider = NULL;
gchar *protocol;
- size_t len;
+ gsize len;
g_return_val_if_fail (url_string != NULL, NULL);
g_return_val_if_fail (provider_table != NULL, NULL);
typedef struct {
CamelProviderConfType type;
- gchar *name, *depname;
- gchar *text, *value;
+ const gchar *name, *depname;
+ const gchar *text, *value;
} CamelProviderConfEntry;
/* Some defaults */
typedef struct {
/* Provider name used in CamelURLs. */
- gchar *protocol;
+ const gchar *protocol;
/* Provider name as used by people. (May be the same as protocol) */
- gchar *name;
+ const gchar *name;
/* Description of the provider. A novice user should be able
* to read this description, and the information provided by
* this provider is relevant to him, and if so, which
* information goes with it.
*/
- gchar *description;
+ const gchar *description;
/* The category of message that this provider works with.
* (evolution-mail will only list a provider in the store/transport
* config dialogs if its domain is "mail".)
*/
- gchar *domain;
+ const gchar *domain;
/* Flags describing the provider, flags describing its URLs */
gint flags, url_flags;
/* gettext translation domain (NULL for providers in the
* evolution source tree).
*/
- gchar *translation_domain;
+ const gchar *translation_domain;
/* This string points to the provider's gconf key value
*/
};
typedef struct {
- gchar *name;
+ const gchar *name;
guint type;
} DataType;
/* generate the cnonce */
bgen = g_strdup_printf ("%p:%lu:%lu", (gpointer) resp,
- (unsigned long) getpid (),
- (unsigned long) time (NULL));
+ (gulong) getpid (),
+ (gulong) time (NULL));
checksum = g_checksum_new (G_CHECKSUM_MD5);
g_checksum_update (checksum, (guchar *) bgen, -1);
g_checksum_get_digest (checksum, digest, &length);
/* Encode the username using the requested charset */
gchar *username, *outbuf;
const gchar *charset;
- size_t len, outlen;
+ gsize len, outlen;
const gchar *inbuf;
iconv_t cd;
outbuf = username = g_malloc0 (outlen + 1);
inbuf = resp->username;
- if (cd == (iconv_t) -1 || camel_iconv (cd, &inbuf, &len, &outbuf, &outlen) == (size_t) -1) {
+ if (cd == (iconv_t) -1 || camel_iconv (cd, &inbuf, &len, &outbuf, &outlen) == (gsize) -1) {
/* We can't convert to UTF-8 - pretend we never got a charset param? */
g_free (resp->charset);
resp->charset = NULL;
/* DES */
typedef guint32 DES_KS[16][2]; /* Single-key DES key schedule */
-static void deskey (DES_KS, guchar *, int);
+static void deskey (DES_KS, guchar *, gint);
static void des (DES_KS, guchar *);
gint i;
for (i = 0; i < 14 && password [i]; i++)
- lm_password [i] = toupper ((unsigned char) password [i]);
+ lm_password [i] = toupper ((guchar) password [i]);
for (; i < 15; i++)
lm_password [i] = '\0';
return 1; \
} G_STMT_END
-static int
+static gint
camel_ustrcasecmp (const gchar *ps1, const gchar *ps2)
{
gunichar u1, u2 = 0;
return 0;
}
-static int
-camel_ustrncasecmp (const gchar *ps1, const gchar *ps2, size_t len)
+static gint
+camel_ustrncasecmp (const gchar *ps1, const gchar *ps2, gsize len)
{
gunichar u1, u2 = 0;
const guchar *s1 = (const guchar *)ps1;
}
/* value is the match value suitable for exact match if required */
-static int
+static gint
header_match(const gchar *value, const gchar *match, camel_search_match_t how)
{
const guchar *p;
/* 'builtin' functions */
static struct {
- gchar *name;
+ const gchar *name;
ESExpFunc *func;
gint immediate :1;
} symbols[] = {
for(i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
if (symbols[i].immediate)
e_sexp_add_ifunction(sexp, 0, symbols[i].name,
- symbols[i].func, NULL);
+ (ESExpIFunc *) symbols[i].func, NULL);
else
e_sexp_add_function(sexp, 0, symbols[i].name,
symbols[i].func, NULL);
static GScannerConfig config =
{
- (
+ ((gchar *)
" \t\n\r"
- ) /* cset_skip_characters */,
- (
+ ) /* cset_skip_characters */,
+ ((gchar *)
G_CSET_a_2_z
G_CSET_A_2_Z
- ) /* cset_identifier_first */,
- (
+ ) /* cset_identifier_first */,
+ ((gchar *)
G_CSET_a_2_z
"_-0123456789"
G_CSET_A_2_Z
- ) /* cset_identifier_nth */,
- ( "" ) /* cpair_comment_single */,
- FALSE /* case_sensitive */,
+ ) /* cset_identifier_nth */,
+ ((gchar *) "" ) /* cpair_comment_single */,
+ FALSE /* case_sensitive */,
TRUE /* skip_comment_multi */,
TRUE /* skip_comment_single */,
TRUE /* scan_comment_multi */,
TRUE /* scan_identifier */,
TRUE /* scan_identifier_1char */,
FALSE /* scan_identifier_NULL */,
- TRUE /* scan_symbols */,
+ TRUE /* scan_symbols */,
FALSE /* scan_binary */,
FALSE /* scan_octal */,
- FALSE /* scan_float */,
+ FALSE /* scan_float */,
FALSE /* scan_hex */,
FALSE /* scan_hex_dollar */,
TRUE /* scan_string_sq */,
gchar post_token; /* post token to apppend with substitute */
gchar rval; /* rhs value for binary ops */
gint level; /* depth in the hier */
- gint prefix:1 ; /* unary operator to be searched ?*/
- gint sys_node:1 ; /* is it a predefined term ? */
+ gint prefix:1; /* unary operator to be searched ?*/
+ gint sys_node:1; /* is it a predefined term ? */
gint ignore_lhs:1; /* ignore lhs value ?*/
gint swap :1;
gint prenode :1;
* */
/* Configuration of your sexp expression */
-static Node elements[] = { {"header-contains", "LIKE", 3, '%', '%', 0, 0, 0 , 1, 0, 0, 0, 0, 0},
- {"system-flag", "=", 2, ' ', ' ', '1', 0, 1, 1, 0, 0, 0, 0, 0},
- {"match-all", "", 0, ' ', ' ', 0, 0, 0, 1, 0, 0, 0, 0, 0},
- {"cast-int", "", 0, ' ', ' ', 0, 0, 0, 1, 0, 0, 0, 0, 0},
- { "header-matches", "LIKE", 3, '%', '%', 0, 0, 1, 1, 0, 0, 0, 0, 0},
- { "header-ends-with", "LIKE", 3, '%', ' ', 0, 0, 0, 1, 0, 0, 0, 0, 0},
- { "header-exists", "NOTNULL", 2, ' ', ' ', ' ', 0, 0, 1, 0, 0, 0, 0, 0},
- { "user-tag", "usertags", 3, '%', '%', 0, 0, 1, 1, 1, 0, 0, 0, 0},
- { "user-flag", "labels LIKE", 2, '%', '%', 0, 0, 0, 1, 0, 1, 0, 0, 0},
- { "header-starts-with", "LIKE", 3, ' ', '%', 0, 0, 0, 1, 0, 0, 0, 0, 0},
- { "get-sent-date", "dsent", 2, ' ', ' ', 0, 0, 1, 1, 0, 0, 0, 0, 1, 0 },
- { "get-received-date", "dreceived", 2, ' ', ' ', 0, 0, 1, 1, 0, 0, 0, 0, 1, 0 },
- { "get-size", "size", 2, ' ', ' ', ' ', 0, 1, 1, 0, 0, 0, 0, 1},
- {"match-threads", "", 0, ' ', ' ', 0, 0, 0, 1, 0, 0, 0, 0, 0},
+static Node elements[] = { { (gchar *) "header-contains", (gchar *) "LIKE", 3, '%', '%', 0, 0, 0 , 1, 0, 0, 0, 0, 0},
+ { (gchar *) "system-flag", (gchar *) "=", 2, ' ', ' ', '1', 0, 1, 1, 0, 0, 0, 0, 0},
+ { (gchar *) "match-all", (gchar *) "", 0, ' ', ' ', 0, 0, 0, 1, 0, 0, 0, 0, 0},
+ { (gchar *) "cast-int", (gchar *) "", 0, ' ', ' ', 0, 0, 0, 1, 0, 0, 0, 0, 0},
+ { (gchar *) "header-matches", (gchar *) "LIKE", 3, '%', '%', 0, 0, 1, 1, 0, 0, 0, 0, 0},
+ { (gchar *) "header-ends-with", (gchar *) "LIKE", 3, '%', ' ', 0, 0, 0, 1, 0, 0, 0, 0, 0},
+ { (gchar *) "header-exists", (gchar *) "NOTNULL", 2, ' ', ' ', ' ', 0, 0, 1, 0, 0, 0, 0, 0},
+ { (gchar *) "user-tag", (gchar *) "usertags", 3, '%', '%', 0, 0, 1, 1, 1, 0, 0, 0, 0},
+ { (gchar *) "user-flag", (gchar *) "labels LIKE", 2, '%', '%', 0, 0, 0, 1, 0, 1, 0, 0, 0},
+ { (gchar *) "header-starts-with", (gchar *) "LIKE", 3, ' ', '%', 0, 0, 0, 1, 0, 0, 0, 0, 0},
+ { (gchar *) "get-sent-date", (gchar *) "dsent", 2, ' ', ' ', 0, 0, 1, 1, 0, 0, 0, 0, 1, 0 },
+ { (gchar *) "get-received-date", (gchar *) "dreceived", 2, ' ', ' ', 0, 0, 1, 1, 0, 0, 0, 0, 1, 0 },
+ { (gchar *) "get-size", (gchar *) "size", 2, ' ', ' ', ' ', 0, 1, 1, 0, 0, 0, 0, 1},
+ { (gchar *) "match-threads", (gchar *) "", 0, ' ', ' ', 0, 0, 0, 1, 0, 0, 0, 0, 0},
};
#if 0
{ "get-sent-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_sent_date), 1 },
g_free (node);
}
-static void
-g_list_dump (GList *l)
-{
- while (l) {
- printf("%s\t", (gchar *)l->data);
- l = l->next;
- }
-}
-
+#if 0
static void
g_node_dump (GList *l)
{
l = l->next;
}
printf("\n");
-
}
+#endif
gchar *
escape_values (gchar *str)
if (g_ascii_strcasecmp (pnode->token, "user-flag") == 0) {
/* Colloct all after '+' and append them to one token. Go till you find ')' */
- token = g_scanner_get_next_token (scanner) ;
+ token = g_scanner_get_next_token (scanner);
while (token != G_TOKEN_RIGHT_PAREN) {
astr = g_strdup_printf ("%s%s", bstr?bstr:"", scanner->value.v_string);
g_free (bstr); bstr = astr;
} else {
/* should be the date fns*/
/* Colloct all after '+' and append them to one token. Go till you find ')' */
- token = g_scanner_get_next_token (scanner) ;
- while (token >= 0 && !g_scanner_eof(scanner) && lvl >=0 ) {
+ token = g_scanner_get_next_token (scanner);
+ while (!g_scanner_eof(scanner) && lvl >=0 ) {
if (token == G_TOKEN_RIGHT_PAREN) {
d(printf(")\n"));
lvl--;
gint lvl=0, lval=0;
/* Colloct all after '+' and append them to one token. Go till you find ')' */
- token = g_scanner_get_next_token (scanner) ;
- while (token >= 0 && !g_scanner_eof(scanner) && lvl >=0 ) {
+ token = g_scanner_get_next_token (scanner);
+ while (!g_scanner_eof(scanner) && lvl >=0 ) {
if (token == G_TOKEN_RIGHT_PAREN) {
lvl--;
token = g_scanner_get_next_token (scanner);
d(printf("lvl = %ld\n", lval));
node = g_new0 (Node, 1);
node->token = bstr;
- node->exact_token = g_strdup_printf("%ld", (long)lval);
+ node->exact_token = g_strdup_printf("%ld", (glong)lval);
node->nodes = pnode->nodes > 0 ? pnode->nodes - 1:0;
node->prefix = 0;
node->rval = ' ';
Node *pnode = operands->data, *node;
node = g_new0 (Node, 1);
- node->token = g_strdup_printf ("%ld", scanner->value.v_int) ;
+ node->token = g_strdup_printf ("%ld", scanner->value.v_int);
node->exact_token = g_strdup_printf ("%ld", scanner->value.v_int);
node->nodes = pnode->nodes > 0 ? pnode->nodes - 1:0;
node->prefix = 0;
pnode = NULL;
if (len == 3) {
- gchar *prefix = NULL;
+ const gchar *prefix = NULL;
gchar *str, *sqstr, *escstr;
gint dyn_lvl;
Node *opnode = operators->data;
- gchar *temp_op="";
+ const gchar *temp_op="";
if (n3->level < n2->level)
dyn_lvl = n2->level;
return CSS_CLASS (stream)->tell (stream);
}
-static int
+static gint
set_bounds (CamelSeekableStream *stream, off_t start, off_t end)
{
/* store the bounds */
}
/* a default implementation of reset for seekable streams */
-static int
+static gint
reset (CamelStream *stream)
{
CamelSeekableStream *seekable_stream;
off_t camel_seekable_stream_seek (CamelSeekableStream *stream, off_t offset,
CamelStreamSeekPolicy policy);
off_t camel_seekable_stream_tell (CamelSeekableStream *stream);
-int camel_seekable_stream_set_bounds (CamelSeekableStream *stream, off_t start, off_t end);
+gint camel_seekable_stream_set_bounds (CamelSeekableStream *stream, off_t start, off_t end);
G_END_DECLS
/* Returns the class for a CamelSeekableSubStream */
#define CSS_CLASS(so) CAMEL_SEEKABLE_SUBSTREAM_CLASS (CAMEL_OBJECT(so)->klass)
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
+static gint stream_flush (CamelStream *stream);
+static gint stream_close (CamelStream *stream);
static gboolean eos (CamelStream *stream);
static off_t stream_seek (CamelSeekableStream *stream, off_t offset,
CamelStreamSeekPolicy policy);
return camel_seekable_stream_seek (parent, (off_t) seekable_stream->position, CAMEL_STREAM_SET) == seekable_stream->position;
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelSeekableStream *parent;
CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM (stream);
CamelSeekableSubstream *seekable_substream = CAMEL_SEEKABLE_SUBSTREAM (stream);
- ssize_t v;
+ gssize v;
if (n == 0)
return 0;
return v;
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
CamelSeekableStream *parent;
CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM(stream);
CamelSeekableSubstream *seekable_substream = CAMEL_SEEKABLE_SUBSTREAM(stream);
- ssize_t v;
+ gssize v;
if (n == 0)
return 0;
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
CamelSeekableSubstream *sus = (CamelSeekableSubstream *)stream;
return camel_stream_flush(CAMEL_STREAM(sus->parent_stream));
}
-static int
+static gint
stream_close (CamelStream *stream)
{
/* we dont really want to close the substream ... */
}
-static int
+static gint
service_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
CamelService *service = (CamelService *) object;
return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
}
-static int
+static gint
service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelService *service = (CamelService *) object;
/* query_auth_types returns a GList of these */
typedef struct {
- gchar *name; /* user-friendly name */
- gchar *description;
- gchar *authproto;
+ const gchar *name; /* user-friendly name */
+ const gchar *description;
+ const gchar *authproto;
gboolean need_password; /* needs a password to authenticate */
} CamelServiceAuthType;
camel_session_thread_msg_free(session, msg);
}
-static int
+static gint
session_thread_queue (CamelSession *session,
CamelSessionThreadMsg *msg,
gint flags)
/* used for decode content callback, for streaming decode */
static void
-sm_write_stream(gpointer arg, const gchar *buf, unsigned long len)
+sm_write_stream(gpointer arg, const gchar *buf, gulong len)
{
camel_stream_write((CamelStream *)arg, buf, len);
}
}
static const gchar *
-nss_error_to_string (long errorcode)
+nss_error_to_string (glong errorcode)
{
#define cs(a,b) case a: return b;
static void
set_nss_error (CamelException *ex, const gchar *def_error)
{
- long err_code;
+ glong err_code;
g_return_if_fail (def_error != NULL);
if (!err_str)
err_str = "Uknown error.";
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "%s (%d) - %s", err_str, (int) err_code, def_error);
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "%s (%d) - %s", err_str, (gint) err_code, def_error);
}
}
return NULL;
}
-static int
+static gint
sm_sign(CamelCipherContext *context, const gchar *userid, CamelCipherHash hash, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
{
gint res = -1;
return valid;
}
-static int
+static gint
sm_encrypt(CamelCipherContext *context, const gchar *userid, GPtrArray *recipients, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
{
struct _CamelSMIMEContextPrivate *p = ((CamelSMIMEContext *)context)->priv;
return valid;
}
-static int
+static gint
sm_import_keys(CamelCipherContext *context, CamelStream *istream, CamelException *ex)
{
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("import keys: unimplemented"));
return -1;
}
-static int
+static gint
sm_export_keys(CamelCipherContext *context, GPtrArray *keys, CamelStream *ostream, CamelException *ex)
{
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("export keys: unimplemented"));
static CamelStoreInfo * store_info_new(CamelStoreSummary *, const gchar *);
static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
-static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
+static gint store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
+static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, gint);
static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
static void camel_store_summary_class_init (CamelStoreSummaryClass *klass);
}
}
-static int
+static gint
summary_header_load(CamelStoreSummary *s, FILE *in)
{
gint32 version, flags, count;
return 0;
}
-static int
+static gint
summary_header_save(CamelStoreSummary *s, FILE *out)
{
fseek(out, 0, SEEK_SET);
return NULL;
}
-static int
+static gint
store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *info)
{
io(printf("Saving folder info\n"));
/* create/save/load an individual message info */
CamelStoreInfo * (*store_info_new)(CamelStoreSummary *, const gchar *path);
CamelStoreInfo * (*store_info_load)(CamelStoreSummary *, FILE *);
- int (*store_info_save)(CamelStoreSummary *, FILE *, CamelStoreInfo *);
+ gint (*store_info_save)(CamelStoreSummary *, FILE *, CamelStoreInfo *);
void (*store_info_free)(CamelStoreSummary *, CamelStoreInfo *);
/* virtualise access methods */
- const gchar *(*store_info_string)(CamelStoreSummary *, const CamelStoreInfo *, int);
+ const gchar *(*store_info_string)(CamelStoreSummary *, const CamelStoreInfo *, gint);
void (*store_info_set_string)(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
};
return camel_store_type;
}
-static int
+static gint
store_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
/* CamelStore doesn't currently have anything to set */
return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
}
-static int
+static gint
store_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
/* CamelStore doesn't currently have anything to get */
if (camel_db_create_folders_table (store->cdb_r, ex))
g_warning ("something went wrong terribly during db creation \n");
- else
+ else {
d(printf ("folders table successfully created \n"));
+ }
if (camel_exception_is_set (ex))
return;
return g_slice_new0 (CamelFolderInfo);
}
-static int
+static gint
folder_info_cmp (gconstpointer ap, gconstpointer bp)
{
const CamelFolderInfo *a = ((CamelFolderInfo **)ap)[0];
sep = strrchr (path, separator);
if (sep)
*sep = '\0';
- else
+ else {
d(g_warning ("huh, no \"%c\" in \"%s\"?", separator, fi->uri));
+ }
pfi->full_name = g_strdup (path);
#define BUF_SIZE 1024
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint stream_flush (CamelStream *stream);
static gint stream_close (CamelStream *stream);
static gboolean stream_eos (CamelStream *stream);
return CAMEL_STREAM (sbf);
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
- ssize_t bytes_read = 1;
- ssize_t bytes_left;
+ gssize bytes_read = 1;
+ gssize bytes_left;
gchar *bptr = buffer;
g_return_val_if_fail( (sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_READ, 0);
} else {
bytes_read = camel_stream_read(sbf->stream, (gchar *) sbf->buf, sbf->size);
if (bytes_read>0) {
- size_t bytes_used = bytes_read > n ? n : bytes_read;
+ gsize bytes_used = bytes_read > n ? n : bytes_read;
sbf->ptr = sbf->buf;
sbf->end = sbf->buf+bytes_read;
memcpy(bptr, sbf->ptr, bytes_used);
}
}
- return (ssize_t)(bptr - buffer);
+ return (gssize)(bptr - buffer);
}
/* only returns the number passed in, or -1 on an error */
-static ssize_t
-stream_write_all(CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write_all(CamelStream *stream, const gchar *buffer, gsize n)
{
- size_t left = n, w;
+ gsize left = n, w;
while (left > 0) {
w = camel_stream_write(stream, buffer, left);
return n;
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
- ssize_t total = n;
- ssize_t left, todo;
+ gssize total = n;
+ gssize left, todo;
g_return_val_if_fail( (sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE, 0);
return total;
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
if ((sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE) {
- size_t len = sbf->ptr - sbf->buf;
+ gsize len = sbf->ptr - sbf->buf;
if (camel_stream_write (sbf->stream, (const gchar *) sbf->buf, len) == -1)
return -1;
return camel_stream_flush(sbf->stream);
}
-static int
+static gint
stream_close (CamelStream *stream)
{
CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
sbf->ptr = (guchar *) inptr;
*outptr = 0;
- return (int)(outptr - buf);
+ return (gint)(outptr - buf);
}
/**
gchar *buffer; /* READ_SIZE bytes */
gchar *filtered; /* the filtered data */
- size_t filteredlen;
+ gsize filteredlen;
guint last_was_read:1; /* was the last op read or write? */
guint flushed:1; /* were the filters flushed? */
static void camel_stream_filter_class_init (CamelStreamFilterClass *klass);
static void camel_stream_filter_init (CamelStreamFilter *obj);
-static ssize_t do_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t do_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize do_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize do_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint do_flush (CamelStream *stream);
static gint do_close (CamelStream *stream);
static gboolean do_eos (CamelStream *stream);
}
}
-static ssize_t
-do_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+do_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
- ssize_t size;
+ gssize size;
struct _filter *f;
p->last_was_read = TRUE;
g_check(p->realbuffer);
if (p->filteredlen<=0) {
- size_t presize = READ_PAD;
+ gsize presize = READ_PAD;
size = camel_stream_read(filter->source, p->buffer, READ_SIZE);
if (size <= 0) {
p->filteredlen = size;
d(printf ("\n\nOriginal content (%s): '", ((CamelObject *)filter->source)->klass->name));
- d(fwrite(p->filtered, sizeof(char), p->filteredlen, stdout));
+ d(fwrite(p->filtered, sizeof(gchar), p->filteredlen, stdout));
d(printf("'\n"));
while (f) {
g_check(p->realbuffer);
d(printf ("Filtered content (%s): '", ((CamelObject *)f->filter)->klass->name));
- d(fwrite(p->filtered, sizeof(char), p->filteredlen, stdout));
+ d(fwrite(p->filtered, sizeof(gchar), p->filteredlen, stdout));
d(printf("'\n"));
f = f->next;
/* Note: Since the caller expects to write out as much as they asked us to
write (for 'success'), we return what they asked us to write (for 'success')
rather than the true number of written bytes */
-static ssize_t
-do_write (CamelStream *stream, const gchar *buf, size_t n)
+static gssize
+do_write (CamelStream *stream, const gchar *buf, gsize n)
{
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
struct _filter *f;
- size_t presize, len, left = n;
+ gsize presize, len, left = n;
gchar *buffer, realbuffer[READ_SIZE+READ_PAD];
p->last_was_read = FALSE;
d(printf ("\n\nWriting: Original content (%s): '", ((CamelObject *)filter->source)->klass->name));
- d(fwrite(buf, sizeof(char), n, stdout));
+ d(fwrite(buf, sizeof(gchar), n, stdout));
d(printf("'\n"));
g_check(p->realbuffer);
g_check(p->realbuffer);
d(printf ("Filtered content (%s): '", ((CamelObject *)f->filter)->klass->name));
- d(fwrite(buffer, sizeof(char), len, stdout));
+ d(fwrite(buffer, sizeof(gchar), len, stdout));
d(printf("'\n"));
f = f->next;
return n;
}
-static int
+static gint
do_flush (CamelStream *stream)
{
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
struct _filter *f;
gchar *buffer;
- size_t presize;
- size_t len;
+ gsize presize;
+ gsize len;
if (p->last_was_read)
return 0;
- buffer = "";
+ buffer = (gchar *) "";
len = 0;
presize = 0;
f = p->filters;
d(printf ("\n\nFlushing: Original content (%s): '", ((CamelObject *)filter->source)->klass->name));
- d(fwrite(buffer, sizeof(char), len, stdout));
+ d(fwrite(buffer, sizeof(gchar), len, stdout));
d(printf("'\n"));
while (f) {
camel_mime_filter_complete(f->filter, buffer, len, presize, &buffer, &len, &presize);
d(printf ("Filtered content (%s): '", ((CamelObject *)f->filter)->klass->name));
- d(fwrite(buffer, sizeof(char), len, stdout));
+ d(fwrite(buffer, sizeof(gchar), len, stdout));
d(printf("'\n"));
f = f->next;
return camel_stream_flush(filter->source);
}
-static int
+static gint
do_close (CamelStream *stream)
{
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
return camel_stream_eos(filter->source);
}
-static int
+static gint
do_reset (CamelStream *stream)
{
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
/* Returns the class for a CamelStreamFS */
#define CSFS_CLASS(so) CAMEL_STREAM_FS_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint stream_flush (CamelStream *stream);
static gint stream_close (CamelStream *stream);
static off_t stream_seek (CamelSeekableStream *stream, off_t offset,
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
- ssize_t nread;
+ gssize nread;
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
n = MIN (seekable->bound_end - seekable->position, n);
return nread;
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
- ssize_t nwritten;
+ gssize nwritten;
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
n = MIN (seekable->bound_end - seekable->position, n);
return nwritten;
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
return fsync(((CamelStreamFs *)stream)->fd);
}
-static int
+static gint
stream_close (CamelStream *stream)
{
if (close (((CamelStreamFs *)stream)->fd) == -1)
/* Returns the class for a CamelStreamMem */
#define CSM_CLASS(so) CAMEL_STREAM_MEM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gboolean stream_eos (CamelStream *stream);
static off_t stream_seek (CamelSeekableStream *stream, off_t offset,
CamelStreamSeekPolicy policy);
}
/* could probably be a util method */
-static void clear_mem(gpointer p, size_t len)
+static void clear_mem(gpointer p, gsize len)
{
gchar *s = p;
* Returns: a new #CamelStreamMem
**/
CamelStream *
-camel_stream_mem_new_with_buffer (const gchar *buffer, size_t len)
+camel_stream_mem_new_with_buffer (const gchar *buffer, gsize len)
{
GByteArray *ba;
* and so may have resource implications to consider.
**/
void
-camel_stream_mem_set_buffer (CamelStreamMem *mem, const gchar *buffer, size_t len)
+camel_stream_mem_set_buffer (CamelStreamMem *mem, const gchar *buffer, gsize len)
{
GByteArray *ba;
}
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelStreamMem *camel_stream_mem = CAMEL_STREAM_MEM (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
- ssize_t nread;
+ gssize nread;
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
n = MIN(seekable->bound_end - seekable->position, n);
return nread;
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
- ssize_t nwrite = n;
+ gssize nwrite = n;
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
nwrite = MIN(seekable->bound_end - seekable->position, n);
/* public methods */
CamelStream *camel_stream_mem_new(void);
CamelStream *camel_stream_mem_new_with_byte_array(GByteArray *buffer);
-CamelStream *camel_stream_mem_new_with_buffer(const gchar *buffer, size_t len);
+CamelStream *camel_stream_mem_new_with_buffer(const gchar *buffer, gsize len);
/* 'secure' data, currently just clears memory on finalise */
void camel_stream_mem_set_secure(CamelStreamMem *mem);
/* these are really only here for implementing classes */
void camel_stream_mem_set_byte_array(CamelStreamMem *mem, GByteArray *buffer);
-void camel_stream_mem_set_buffer(CamelStreamMem *mem, const gchar *buffer, size_t len);
+void camel_stream_mem_set_buffer(CamelStreamMem *mem, const gchar *buffer, gsize len);
G_END_DECLS
#define CS_CLASS(so) CAMEL_STREAM_NULL_CLASS(CAMEL_OBJECT_GET_CLASS(so))
/* dummy implementations, for a NULL stream */
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n) { return 0; }
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n) { ((CamelStreamNull *)stream)->written += n; return n; }
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n) { return 0; }
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n) { ((CamelStreamNull *)stream)->written += n; return n; }
static gint stream_close (CamelStream *stream) { return 0; }
static gint stream_flush (CamelStream *stream) { return 0; }
static gboolean stream_eos (CamelStream *stream) { return TRUE; }
struct _CamelStreamNull {
CamelStream parent;
- size_t written;
+ gsize written;
};
struct _CamelStreamNullClass {
#define CS_CLASS(so) CAMEL_STREAM_PROCESS_CLASS(CAMEL_OBJECT_GET_CLASS(so))
/* dummy implementations, for a PROCESS stream */
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint stream_close (CamelStream *stream);
static gint stream_flush (CamelStream *stream);
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelStreamProcess *stream_process = CAMEL_STREAM_PROCESS (stream);
return camel_read (stream_process->sockfd, buffer, n);
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
CamelStreamProcess *stream_process = CAMEL_STREAM_PROCESS (stream);
return camel_write (stream_process->sockfd, buffer, n);
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
return 0;
}
-static int
+static gint
stream_close (CamelStream *object)
{
CamelStreamProcess *stream = CAMEL_STREAM_PROCESS (object);
return 0;
}
-static void
+G_GNUC_NORETURN static void
do_exec_command (gint fd, const gchar *command, gchar **env)
{
gint i, maxopen;
/* Set up child's environment. We _add_ to it, don't use execle,
because otherwise we'd destroy stuff like SSH_AUTH_SOCK etc. */
- for ( ; env && *env; env++)
+ for (; env && *env; env++)
putenv(*env);
execl ("/bin/sh", "/bin/sh", "-c", command, NULL);
/* Returns the class for a CamelStreamVFS */
#define CSVFS_CLASS(so) CAMEL_STREAM_VFS_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint stream_flush (CamelStream *stream);
static gint stream_close (CamelStream *stream);
return G_IS_OUTPUT_STREAM (stream_vfs->stream);
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
gssize nread;
GError *error = NULL;
return nread;
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
gboolean success;
gsize bytes_written;
return success ? bytes_written : -1;
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
CamelStreamVFS *stream_vfs = CAMEL_STREAM_VFS (stream);
return 0;
}
-static int
+static gint
stream_close (CamelStream *stream)
{
CamelStreamVFS *stream_vfs = CAMEL_STREAM_VFS (stream);
#define CS_CLASS(so) CAMEL_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
/* default implementations, do very little */
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n) { return 0; }
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n) { return n; }
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n) { return 0; }
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n) { return n; }
static gint stream_close (CamelStream *stream) { return 0; }
static gint stream_flush (CamelStream *stream) { return 0; }
static gboolean stream_eos (CamelStream *stream) { return stream->eos; }
* Returns: the number of bytes actually read, or %-1 on error and set
* errno.
**/
-ssize_t
-camel_stream_read (CamelStream *stream, gchar *buffer, size_t n)
+gssize
+camel_stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
g_return_val_if_fail (n == 0 || buffer, -1);
* Returns: the number of bytes written to the stream, or %-1 on error
* along with setting errno.
**/
-ssize_t
-camel_stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+gssize
+camel_stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
g_return_val_if_fail (n == 0 || buffer, -1);
*
* Returns: the number of characters written or %-1 on error.
**/
-ssize_t
+gssize
camel_stream_write_string (CamelStream *stream, const gchar *string)
{
return camel_stream_write (stream, string, strlen (string));
*
* Returns: the number of characters written or %-1 on error.
**/
-ssize_t
+gssize
camel_stream_printf (CamelStream *stream, const gchar *fmt, ... )
{
va_list args;
gchar *string;
- ssize_t ret;
+ gssize ret;
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
* Returns: %-1 on error, or the number of bytes succesfully
* copied across streams.
**/
-ssize_t
+gssize
camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream)
{
gchar tmp_buf[4096];
- ssize_t total = 0;
- ssize_t nb_read;
- ssize_t nb_written;
+ gssize total = 0;
+ gssize nb_read;
+ gssize nb_written;
g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
g_return_val_if_fail (CAMEL_IS_STREAM (output_stream), -1);
nb_written = 0;
while (nb_written < nb_read) {
- ssize_t len = camel_stream_write (output_stream, tmp_buf + nb_written,
+ gssize len = camel_stream_write (output_stream, tmp_buf + nb_written,
nb_read - nb_written);
if (len < 0)
return -1;
/* Virtual methods */
- ssize_t (*read) (CamelStream *stream, gchar *buffer, size_t n);
- ssize_t (*write) (CamelStream *stream, const gchar *buffer, size_t n);
+ gssize (*read) (CamelStream *stream, gchar *buffer, gsize n);
+ gssize (*write) (CamelStream *stream, const gchar *buffer, gsize n);
gint (*close) (CamelStream *stream);
gint (*flush) (CamelStream *stream);
gboolean (*eos) (CamelStream *stream);
CamelType camel_stream_get_type (void);
/* public methods */
-ssize_t camel_stream_read (CamelStream *stream, gchar *buffer, size_t n);
-ssize_t camel_stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+gssize camel_stream_read (CamelStream *stream, gchar *buffer, gsize n);
+gssize camel_stream_write (CamelStream *stream, const gchar *buffer, gsize n);
gint camel_stream_flush (CamelStream *stream);
gint camel_stream_close (CamelStream *stream);
gboolean camel_stream_eos (CamelStream *stream);
gint camel_stream_reset (CamelStream *stream);
/* utility macros and funcs */
-ssize_t camel_stream_write_string (CamelStream *stream, const gchar *string);
-ssize_t camel_stream_printf (CamelStream *stream, const gchar *fmt, ... ) G_GNUC_PRINTF (2, 3);
-ssize_t camel_stream_vprintf (CamelStream *stream, const gchar *fmt, va_list ap);
+gssize camel_stream_write_string (CamelStream *stream, const gchar *string);
+gssize camel_stream_printf (CamelStream *stream, const gchar *fmt, ... ) G_GNUC_PRINTF (2, 3);
+gssize camel_stream_vprintf (CamelStream *stream, const gchar *fmt, va_list ap);
/* Write a whole stream to another stream, until eof or error on
* either stream.
*/
-ssize_t camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream);
+gssize camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream);
G_END_DECLS
const gchar *p = (gchar *) v;
guint h = 0, g;
- for ( ; *p != '\0'; p++) {
+ for (; *p != '\0'; p++) {
h = (h << 4) + g_ascii_toupper (*p);
if ((g = h & 0xf0000000)) {
h = h ^ (g >> 24);
/* Returns the class for a CamelTcpStreamSSL */
#define CTSR_CLASS(so) CAMEL_TCP_STREAM_SSL_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint stream_flush (CamelStream *stream);
static gint stream_close (CamelStream *stream);
}
-static int
+static gint
ssl_errno (SSL *ssl, gint ret)
{
switch (SSL_get_error (ssl, ret)) {
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
SSL *ssl = openssl->priv->ssl;
- ssize_t nread;
+ gssize nread;
gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
return nread;
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
SSL *ssl = openssl->priv->ssl;
- ssize_t w, written = 0;
+ gssize w, written = 0;
gint cancel_fd;
if (camel_operation_cancel_check (NULL)) {
return written;
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
return 0;
}
}
-static int
+static gint
stream_close (CamelStream *stream)
{
close_ssl_connection (((CamelTcpStreamSSL *)stream)->priv->ssl);
/* this is a 'cancellable' connect, cancellable from camel_operation_cancel etc */
/* returns -1 & errno == EINTR if the connection was cancelled */
-static int
+static gint
socket_connect (struct hostent *h, gint port)
{
#ifdef ENABLE_IPv6
errno = EINTR;
return -1;
} else {
- len = sizeof (int);
+ len = sizeof (gint);
if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &len) == -1) {
close (fd);
}
}
-static int
+static gint
ssl_verify (gint ok, X509_STORE_CTX *ctx)
{
guchar md5sum[16], fingerprint[40], *f;
return ssl;
}
-static int
+static gint
stream_connect (CamelTcpStream *stream, struct hostent *host, gint port)
{
CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
}
-static int
+static gint
get_sockopt_level (const CamelSockOptData *data)
{
switch (data->option) {
}
}
-static int
+static gint
get_sockopt_optname (const CamelSockOptData *data)
{
switch (data->option) {
}
}
-static int
+static gint
stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
{
gint optname, optlen;
(socklen_t *) &optlen);
}
-static int
+static gint
stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
{
gint optname;
/* Returns the class for a CamelTcpStreamRaw */
#define CTSR_CLASS(so) CAMEL_TCP_STREAM_RAW_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint stream_flush (CamelStream *stream);
static gint stream_close (CamelStream *stream);
}
#ifdef SIMULATE_FLAKY_NETWORK
-static ssize_t
-flaky_tcp_write (gint fd, const gchar *buffer, size_t buflen)
+static gssize
+flaky_tcp_write (gint fd, const gchar *buffer, gsize buflen)
{
- size_t len = buflen;
- ssize_t nwritten;
+ gsize len = buflen;
+ gssize nwritten;
gint val;
if (buflen == 0)
return 0;
- val = 1 + (int) (10.0 * rand () / (RAND_MAX + 1.0));
+ val = 1 + (gint) (10.0 * rand () / (RAND_MAX + 1.0));
switch (val) {
case 1:
case 4:
case 5:
case 6:
- len = 1 + (size_t) (buflen * rand () / (RAND_MAX + 1.0));
+ len = 1 + (gsize) (buflen * rand () / (RAND_MAX + 1.0));
len = MIN (len, buflen);
/* fall through... */
default:
- printf ("flaky_tcp_write (%d, ..., %d): (%d) '%.*s'", fd, buflen, len, (int) len, buffer);
+ printf ("flaky_tcp_write (%d, ..., %d): (%d) '%.*s'", fd, buflen, len, (gint) len, buffer);
nwritten = write (fd, buffer, len);
if (nwritten < 0)
printf (" errno => %s\n", g_strerror (errno));
#define write(fd, buffer, buflen) flaky_tcp_write (fd, buffer, buflen)
-static ssize_t
-flaky_tcp_read (gint fd, gchar *buffer, size_t buflen)
+static gssize
+flaky_tcp_read (gint fd, gchar *buffer, gsize buflen)
{
- size_t len = buflen;
- ssize_t nread;
+ gsize len = buflen;
+ gssize nread;
gint val;
if (buflen == 0)
return 0;
- val = 1 + (int) (10.0 * rand () / (RAND_MAX + 1.0));
+ val = 1 + (gint) (10.0 * rand () / (RAND_MAX + 1.0));
switch (val) {
case 1:
case 8:
case 9:
case 10:
- len = 1 + (size_t) (10.0 * rand () / (RAND_MAX + 1.0));
+ len = 1 + (gsize) (10.0 * rand () / (RAND_MAX + 1.0));
len = MIN (len, buflen);
/* fall through... */
default:
return CAMEL_STREAM (stream);
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
return camel_read_socket (raw->sockfd, buffer, n);
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
return camel_write_socket (raw->sockfd, buffer, n);
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
return 0;
}
-static int
+static gint
stream_close (CamelStream *stream)
{
if (SOCKET_CLOSE (((CamelTcpStreamRaw *)stream)->sockfd) == -1)
/* this is a 'cancellable' connect, cancellable from camel_operation_cancel etc */
/* returns -1 & errno == EINTR if the connection was cancelled */
-static int
+static gint
socket_connect(struct addrinfo *h)
{
struct timeval tv;
errno = EINTR;
return -1;
} else {
- len = sizeof (int);
+ len = sizeof (gint);
if (getsockopt (fd, SOL_SOCKET, SO_ERROR, (gchar *) &ret, &len) == -1) {
errnosav = errno;
return fd;
}
-static int
+static gint
stream_connect (CamelTcpStream *stream, struct addrinfo *host)
{
CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
return -1;
}
-static int
+static gint
get_sockopt_level (const CamelSockOptData *data)
{
switch (data->option) {
}
}
-static int
+static gint
get_sockopt_optname (const CamelSockOptData *data)
{
switch (data->option) {
}
}
-static int
+static gint
stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
{
gint optname, optlen;
(socklen_t *) &optlen);
}
-static int
+static gint
stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
{
gint optname;
/* Returns the class for a CamelTcpStreamSSL */
#define CTSS_CLASS(so) CAMEL_TCP_STREAM_SSL_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint stream_flush (CamelStream *stream);
static gint stream_close (CamelStream *stream);
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelTcpStreamSSL *tcp_stream_ssl = CAMEL_TCP_STREAM_SSL (stream);
PRFileDesc *cancel_fd;
- ssize_t nread;
+ gssize nread;
if (camel_operation_cancel_check (NULL)) {
errno = EINTR;
return nread;
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
CamelTcpStreamSSL *tcp_stream_ssl = CAMEL_TCP_STREAM_SSL (stream);
- ssize_t w, written = 0;
+ gssize w, written = 0;
PRFileDesc *cancel_fd;
if (camel_operation_cancel_check (NULL)) {
return written;
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
/*return PR_Sync (((CamelTcpStreamSSL *)stream)->priv->sockfd);*/
return 0;
}
-static int
+static gint
stream_close (CamelStream *stream)
{
if (((CamelTcpStreamSSL *)stream)->priv->sockfd == NULL) {
return ssl_fd;
}
-static int
+static gint
sockaddr_to_praddr(struct sockaddr *s, gint len, PRNetAddr *addr)
{
/* We assume the ip addresses are the same size - they have to be anyway.
return -1;
}
-static int
+static gint
socket_connect(CamelTcpStream *stream, struct addrinfo *host)
{
CamelTcpStreamSSL *ssl = CAMEL_TCP_STREAM_SSL (stream);
return 0;
}
-static int
+static gint
stream_connect(CamelTcpStream *stream, struct addrinfo *host)
{
while (host) {
return -1;
}
-static int
+static gint
stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
{
PRSocketOptionData sodata;
return 0;
}
-static int
+static gint
stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
{
PRSocketOptionData sodata;
}
-static int
+static gint
tcp_connect (CamelTcpStream *stream, struct addrinfo *host)
{
w(g_warning ("CamelTcpStream::connect called on default implementation"));
return CTS_CLASS (stream)->connect (stream, host);
}
-static int
+static gint
tcp_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
{
w(g_warning ("CamelTcpStream::getsockopt called on default implementation"));
return CTS_CLASS (stream)->getsockopt (stream, data);
}
-static int
+static gint
tcp_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
{
w(g_warning ("CamelTcpStream::setsockopt called on default implementation"));
gboolean mcast_loopback; /* IP multicast loopback */
gboolean no_delay; /* Don't delay send to coalesce packets */
gboolean broadcast; /* Enable broadcast */
- size_t max_segment; /* Maximum segment size */
- size_t recv_buffer_size; /* Receive buffer size */
- size_t send_buffer_size; /* Send buffer size */
+ gsize max_segment; /* Maximum segment size */
+ gsize recv_buffer_size; /* Receive buffer size */
+ gsize send_buffer_size; /* Send buffer size */
CamelLinger linger; /* Time to linger on close if data present */
} value;
} CamelSockOptData;
gint record_index;
- size_t record_count;
+ gsize record_count;
camel_key_t *records;
gchar *current;
}
}
-static int
+static gint
text_index_sync(CamelIndex *idx)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
}
}
-static int
+static gint
text_index_compress(CamelIndex *idx)
{
gint ret;
}
/* Attempt to recover index space by compressing the indices */
-static int
+static gint
text_index_compress_nosync(CamelIndex *idx)
{
CamelTextIndex *newidx;
gchar *name = NULL;
guint flags;
gchar *newpath, *savepath, *oldpath;
- size_t count, newcount;
+ gsize count, newcount;
camel_key_t *records, newrecords[256];
struct _CamelTextIndexRoot *rb;
rb->names++;
camel_partition_table_add(newp->name_hash, name, newkeyid);
g_hash_table_insert(remap, GINT_TO_POINTER(oldkeyid), GINT_TO_POINTER(newkeyid));
- } else
+ } else {
io(printf("deleted name '%s'\n", name));
+ }
g_free(name);
name = NULL;
deleted |= flags;
}
while (data) {
if (camel_key_file_read(oldp->links, &data, &count, &records) == -1) {
- io(printf("could not read from old keys at %d for word '%s'\n", (int)data, name));
+ io(printf("could not read from old keys at %d for word '%s'\n", (gint)data, name));
goto fail;
}
for (i=0;i<count;i++) {
return ret;
}
-static int
+static gint
text_index_delete(CamelIndex *idx)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
return ret;
}
-static int
+static gint
text_index_rename(CamelIndex *idx, const gchar *path)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
return 0;
}
-static int
+static gint
text_index_has_name(CamelIndex *idx, const gchar *name)
{
struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
text_index_add_name_to_word(idn->index, word, tin->priv->nameid);
}
-static int
+static gint
text_index_write_name(CamelIndex *idx, CamelIndexName *idn)
{
/* force 'flush' of any outstanding data */
camel_block_t data;
gchar *oldword;
camel_key_t *records;
- size_t count;
+ gsize count;
GHashTable *names, *deleted, *words, *keys, *name_word, *word_word;
printf("Warning, read failed for word '%s', at data '%u'\n", word, data);
data = 0;
} else {
- printf("(%d)\n", (int)count);
+ printf("(%d)\n", (gint)count);
g_free(records);
}
}
return 0;
}
-static size_t
-text_index_name_add_buffer(CamelIndexName *idn, const gchar *buffer, size_t len)
+static gsize
+text_index_name_add_buffer(CamelIndexName *idn, const gchar *buffer, gsize len)
{
CamelTextIndexNamePrivate *p = CIN_PRIVATE(idn);
const guchar *ptr, *ptrend;
}
-static int
+static gint
transport_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
/* CamelTransport doesn't currently have anything to set */
return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
}
-static int
+static gint
transport_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
/* CamelTransport doesn't currently have anything to get */
static inline gunichar
-trie_utf8_getc (const guchar **in, size_t inlen)
+trie_utf8_getc (const guchar **in, gsize inlen)
{
register const guchar *inptr = *in;
const guchar *inend = inptr + inlen;
gint *matched_id)
{
const guchar *inptr, *inend, *prev, *pat;
- register size_t inlen = buflen;
+ register gsize inlen = buflen;
struct _trie_state *q;
struct _trie_match *m = NULL; /* init to please gcc */
gunichar c;
gchar *filename;
GHashTable *uids;
guint level;
- size_t expired;
- size_t size;
+ gsize expired;
+ gsize size;
gint fd;
} CamelUIDCache;
gboolean
-camel_url_scanner_scan (CamelUrlScanner *scanner, const gchar *in, size_t inlen, urlmatch_t *match)
+camel_url_scanner_scan (CamelUrlScanner *scanner, const gchar *in, gsize inlen, urlmatch_t *match)
{
const gchar *pos;
const guchar *inptr, *inend;
IS_URLSAFE = (1 << 7)
};
-#define is_ctrl(x) ((url_scanner_table[(unsigned char)(x)] & IS_CTRL) != 0)
-#define is_lwsp(x) ((url_scanner_table[(unsigned char)(x)] & IS_LWSP) != 0)
-#define is_atom(x) ((url_scanner_table[(unsigned char)(x)] & (IS_SPECIAL|IS_SPACE|IS_CTRL)) == 0)
-#define is_alpha(x) ((url_scanner_table[(unsigned char)(x)] & IS_ALPHA) != 0)
-#define is_digit(x) ((url_scanner_table[(unsigned char)(x)] & IS_DIGIT) != 0)
-#define is_domain(x) ((url_scanner_table[(unsigned char)(x)] & IS_DOMAIN) != 0)
-#define is_urlsafe(x) ((url_scanner_table[(unsigned char)(x)] & (IS_ALPHA|IS_DIGIT|IS_URLSAFE)) != 0)
+#define is_ctrl(x) ((url_scanner_table[(guchar)(x)] & IS_CTRL) != 0)
+#define is_lwsp(x) ((url_scanner_table[(guchar)(x)] & IS_LWSP) != 0)
+#define is_atom(x) ((url_scanner_table[(guchar)(x)] & (IS_SPECIAL|IS_SPACE|IS_CTRL)) == 0)
+#define is_alpha(x) ((url_scanner_table[(guchar)(x)] & IS_ALPHA) != 0)
+#define is_digit(x) ((url_scanner_table[(guchar)(x)] & IS_DIGIT) != 0)
+#define is_domain(x) ((url_scanner_table[(guchar)(x)] & IS_DOMAIN) != 0)
+#define is_urlsafe(x) ((url_scanner_table[(guchar)(x)] & (IS_ALPHA|IS_DIGIT|IS_URLSAFE)) != 0)
static const struct {
}
static char
-url_stop_at_brace (const gchar *in, size_t so, gchar *open_brace)
+url_stop_at_brace (const gchar *in, gsize so, gchar *open_brace)
{
gint i;
gboolean camel_url_addrspec_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
typedef struct {
- gchar *pattern;
- gchar *prefix;
+ const gchar *pattern;
+ const gchar *prefix;
CamelUrlScanFunc start;
CamelUrlScanFunc end;
} urlpattern_t;
void camel_url_scanner_add (CamelUrlScanner *scanner, urlpattern_t *pattern);
-gboolean camel_url_scanner_scan (CamelUrlScanner *scanner, const gchar *in, size_t inlen, urlmatch_t *match);
+gboolean camel_url_scanner_scan (CamelUrlScanner *scanner, const gchar *in, gsize inlen, urlmatch_t *match);
G_END_DECLS
/* Find protocol: initial [a-z+.-]* substring until ":" */
p = url_string;
- while (p < end && (isalnum ((unsigned char)*p) ||
+ while (p < end && (isalnum ((guchar)*p) ||
*p == '.' || *p == '+' || *p == '-'))
p++;
last = base->path ? strrchr (base->path, '/') : NULL;
if (last) {
newpath = g_strdup_printf ("%.*s/%s",
- (int)(last - base->path),
+ (gint)(last - base->path),
base->path,
url->path);
} else
while (*s) {
if (url_encoded_char[*s] ||
(extra_enc_chars && strchr (extra_enc_chars, *s)))
- g_string_append_printf (str, "%%%02x", (int)*s++);
+ g_string_append_printf (str, "%%%02x", (gint)*s++);
else
g_string_append_c (str, *s++);
}
return hash;
}
-static int
+static gint
check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
{
return camel_folder_count_by_expression(f, expr, ex);
}
-static int
-count_result (CamelFolderSummary *summary, gchar *query, CamelException *ex)
+static gint
+count_result (CamelFolderSummary *summary, const gchar *query, CamelException *ex)
{
CamelFolder *folder = summary->folder;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
#endif
if (vf->priv->unread_vfolder == 1) {
/* Cleanup Junk/Trash uids */
+ GSList *del = NULL;
gint i, count;
count = folder->summary->uids->len;
- GSList *del = NULL;
for (i=0; i < count; i++) {
CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (folder->summary, i);
vuid = g_malloc(strlen(uid)+9);
memcpy(vuid, hash, 8);
strcpy(vuid+8, uid);
- g_ptr_array_add(result, camel_pstring_strdup(vuid));
+ g_ptr_array_add(result, (gpointer) camel_pstring_strdup(vuid));
g_free(vuid);
}
camel_folder_search_free(f, matches);
/* build query contents for a single folder */
-static int
+static gint
vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
{
GPtrArray *match, *all;
}
/* This entire code will be useless, since we sync the counts always. */
-static int
+static gint
vf_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
static void vee_delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex);
static void vee_rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
-static void vee_sync (CamelStore *store, gint expunge, CamelException *ex);
static CamelFolder *vee_get_trash (CamelStore *store, CamelException *ex);
static CamelFolder *vee_get_junk (CamelStore *store, CamelException *ex);
store_class->free_folder_info = camel_store_free_folder_info_full;
((CamelServiceClass *)store_class)->construct = construct;
- /* store_class->sync = vee_sync; */
store_class->get_trash = vee_get_trash;
store_class->get_junk = vee_get_junk;
}
return (CamelFolder *)vf;
}
-static void
-vee_sync(CamelStore *store, gint expunge, CamelException *ex)
-{
- /* noop */;
-}
-
static CamelFolder *
vee_get_trash (CamelStore *store, CamelException *ex)
{
return NULL;
}
-static int
+static gint
vee_folder_cmp(gconstpointer ap, gconstpointer bp)
{
return strcmp(((CamelFolder **)ap)[0]->full_name, ((CamelFolder **)bp)[0]->full_name);
}
/* This entire code will be useless, since we sync the counts always. */
-static int
+static gint
vtrash_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
}
}
-/* FIXME[disk-summary] rewrite the same way as camel-vee-summary.c */
-static GPtrArray *
-vtrash_search_by_expression(CamelFolder *folder, const gchar *expression, CamelException *ex)
-{
- GList *node;
- GPtrArray *matches, *result = g_ptr_array_new(), *uids = g_ptr_array_new();
- struct _CamelVeeFolderPrivate *p = ((CamelVeeFolder *)folder)->priv;
- GPtrArray *infos = camel_folder_get_summary(folder);
-
- /* we optimise the search by only searching for messages which we have anyway */
- CAMEL_VEE_FOLDER_LOCK(folder, subfolder_lock);
- node = p->folders;
- while (node) {
- CamelFolder *f = node->data;
- gint i;
- gchar hash[8];
-
- camel_vee_folder_hash_folder(f, hash);
-
- for (i=0;i<infos->len;i++) {
- CamelVeeMessageInfo *vmi = (CamelVeeMessageInfo *) camel_folder_summary_uid (folder->summary, infos->pdata[i]);
- if (!vmi)
- continue;
- /* if (camel_message_info_flags(mi) & ((CamelVTrashFolder *)folder)->bit) */
- if (vmi->summary == f->summary) /* Belongs to this folder */
- g_ptr_array_add(uids, (gpointer)camel_pstring_strdup(infos->pdata[i]+8));
- camel_message_info_free (vmi);
- }
-
- /* FIXME[disk-summary] search in the DB of the folder, for
- * the expression, with the vtrash bit (junk/trash) */
- if (uids->len > 0
- && (matches = camel_folder_search_by_uids(f, expression, uids, NULL))) {
- for (i = 0; i < matches->len; i++) {
- gchar *uid = matches->pdata[i], *vuid;
-
- vuid = g_malloc(strlen(uid)+9);
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
- g_ptr_array_add(result, (gpointer) camel_pstring_strdup(vuid));
- g_free (vuid);
- }
- camel_folder_search_free(f, matches);
- }
- g_ptr_array_set_size(uids, 0);
-
- node = g_list_next(node);
- }
- camel_folder_free_summary (folder, infos);
- CAMEL_VEE_FOLDER_UNLOCK(folder, subfolder_lock);
-
- g_ptr_array_foreach (uids, (GFunc) camel_pstring_free, NULL);
- g_ptr_array_free(uids, TRUE);
-
- return result;
-}
-
-static GPtrArray *
-vtrash_search_by_uids(CamelFolder *folder, const gchar *expression, GPtrArray *uids, CamelException *ex)
-{
- GList *node;
- GPtrArray *matches, *result = g_ptr_array_new(), *folder_uids = g_ptr_array_new();
- struct _CamelVeeFolderPrivate *p = ((CamelVeeFolder *)folder)->priv;
-
- CAMEL_VEE_FOLDER_LOCK(folder, subfolder_lock);
-
- node = p->folders;
- while (node) {
- CamelFolder *f = node->data;
- gint i;
- gchar hash[8];
-
- camel_vee_folder_hash_folder(f, hash);
-
- /* map the vfolder uid's to the source folder uid's first */
- /* FIXME[disk-summary] check this. is it uids od folder_uids */
- /*g_ptr_array_set_size(uids, 0);*/
- g_ptr_array_set_size (folder_uids, 0);
- for (i=0;i<uids->len;i++) {
- gchar *uid = uids->pdata[i];
-
- /*if (strlen(uid) >= 8 && strncmp(uid, hash, 8) == 0) {*/
- if (strncmp(uid, hash, 8) == 0) {
-#if 0
- CamelMessageInfo *mi;
- /* FIXME[disk-summary] is it really reqd, if
- * so uncomment it */
- mi = camel_folder_get_message_info(f, uid+8);
- if (mi) {
- if(camel_message_info_flags(mi) & ((CamelVTrashFolder *)folder)->bit)
- g_ptr_array_add(folder_uids, uid+8);
- camel_folder_free_message_info(f, mi);
- }
-#endif
- }
- }
-
- if (folder_uids->len > 0
- && (matches = camel_folder_search_by_uids(f, expression, folder_uids, ex))) {
- for (i = 0; i < matches->len; i++) {
- gchar *uid = matches->pdata[i], *vuid;
-
- vuid = g_malloc(strlen(uid)+9);
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
- g_ptr_array_add(result, (gpointer) camel_pstring_strdup(vuid));
- g_free (vuid);
- }
- camel_folder_search_free(f, matches);
- }
- node = g_list_next(node);
- }
-
- CAMEL_VEE_FOLDER_UNLOCK(folder, subfolder_lock);
-
- g_ptr_array_free(folder_uids, TRUE);
-
- return result;
-}
-
-static void
-vtrash_uid_removed(CamelVTrashFolder *vf, const gchar *uid, gchar hash[8])
-{
- gchar *vuid;
-
- vuid = g_alloca(strlen(uid)+9);
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
- camel_folder_change_info_remove_uid(((CamelVeeFolder *)vf)->changes, vuid);
- camel_folder_summary_remove_uid(((CamelFolder *)vf)->summary, vuid);
-}
-
-static void
-vtrash_uid_added(CamelVTrashFolder *vf, const gchar *uid, CamelFolderSummary *ssummary, gchar hash[8])
-{
- gchar *vuid;
- CamelVeeMessageInfo *vinfo;
-
- vuid = g_alloca(strlen(uid)+9);
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
- vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid(((CamelFolder *)vf)->summary, vuid);
- if (vinfo == NULL) {
- CamelMessageInfo *tinfo;
- tinfo = (CamelMessageInfo *) camel_vee_summary_add((CamelVeeSummary *)((CamelFolder *)vf)->summary, ssummary, uid, hash);
- if (tinfo) {
- camel_folder_change_info_add_uid(((CamelVeeFolder *)vf)->changes, vuid);
- camel_message_info_free (tinfo);
- }
- }
-}
-
-static void
-vtrash_folder_changed(CamelVeeFolder *vf, CamelFolder *sub, CamelFolderChangeInfo *changes)
-{
- CamelMessageInfo *info;
- gchar hash[8];
- CamelFolderChangeInfo *vf_changes = NULL;
- gint i;
-
- camel_vee_folder_hash_folder(sub, hash);
-
- CAMEL_VEE_FOLDER_LOCK(vf, summary_lock);
-
- /* remove any removed that we also have */
- for (i=0;i<changes->uid_removed->len;i++)
- vtrash_uid_removed((CamelVTrashFolder *)vf, (const gchar *)changes->uid_removed->pdata[i], hash);
-
- /* check any changed still deleted/junked */
- for (i=0;i<changes->uid_changed->len;i++) {
- const gchar *uid = changes->uid_changed->pdata[i];
-
- info = camel_folder_get_message_info(sub, uid);
- if (info == NULL)
- continue;
-
- if ((camel_message_info_flags(info) & ((CamelVTrashFolder *)vf)->bit) == 0)
- vtrash_uid_removed((CamelVTrashFolder *)vf, uid, hash);
- else
- vtrash_uid_added((CamelVTrashFolder *)vf, uid, sub->summary, hash);
-
- camel_message_info_free(info);
- }
-
- /* add any new ones which are already matching */
- for (i=0;i<changes->uid_added->len;i++) {
- const gchar *uid = changes->uid_added->pdata[i];
-
- info = camel_folder_get_message_info(sub, uid);
- if (info == NULL)
- continue;
-
- if ((camel_message_info_flags(info) & ((CamelVTrashFolder *)vf)->bit) != 0)
- vtrash_uid_added((CamelVTrashFolder *)vf, uid, sub->summary, hash);
-
- camel_message_info_free(info);
- }
-
- if (camel_folder_change_info_changed(((CamelVeeFolder *)vf)->changes)) {
- vf_changes = ((CamelVeeFolder *)vf)->changes;
- ((CamelVeeFolder *)vf)->changes = camel_folder_change_info_new();
- }
-
- CAMEL_VEE_FOLDER_UNLOCK(vf, summary_lock);
-
- if (vf_changes) {
- camel_object_trigger_event(vf, "folder_changed", vf_changes);
- camel_folder_change_info_free(vf_changes);
- }
-}
-
-static void
-vtrash_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
-{
- GPtrArray *infos=NULL;
- gint i;
- gchar hash[8], *shash;
- CamelFolderChangeInfo *vf_changes = NULL;
-
- camel_vee_folder_hash_folder(sub, hash);
- shash = g_strdup_printf("%c%c%c%c%c%c%c%c", hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7]);
- if (!g_hash_table_lookup (vf->hashes, shash))
- g_hash_table_insert (vf->hashes, g_strdup(shash), sub->summary);
-
- CAMEL_VEE_FOLDER_LOCK(vf, summary_lock);
-
- if (((CamelVTrashFolder *)vf)->bit == CAMEL_MESSAGE_DELETED) {
- infos = camel_db_get_folder_deleted_uids (sub->parent_store->cdb_w, sub->full_name, NULL);
- if (infos) {
- ((CamelFolder *)vf)->summary->saved_count += infos->len;
- ((CamelFolder *)vf)->summary->deleted_count += infos->len;
- }
- }
- else if (((CamelVTrashFolder *)vf)->bit == CAMEL_MESSAGE_JUNK)
- infos = camel_db_get_folder_junk_uids (sub->parent_store->cdb_w, sub->full_name, NULL);
-
- if (!infos) {
- CAMEL_VEE_FOLDER_UNLOCK(vf, summary_lock);
- g_free (shash);
- return;
- }
-
- for (i=0;i<infos->len;i++) {
- gchar *uid = infos->pdata[i];
- vtrash_uid_added((CamelVTrashFolder *)vf, uid, sub->summary, hash);
- }
-
- g_ptr_array_foreach (infos, (GFunc) camel_pstring_free, NULL);
- g_ptr_array_free (infos, TRUE);
-
- if (camel_folder_change_info_changed(vf->changes)) {
- vf_changes = vf->changes;
- vf->changes = camel_folder_change_info_new();
- }
-
- CAMEL_VEE_FOLDER_UNLOCK(vf, summary_lock);
-
- if (vf_changes) {
- camel_object_trigger_event(vf, "folder_changed", vf_changes);
- camel_folder_change_info_free(vf_changes);
- }
-
- g_free(shash);
-}
-
-static void
-vtrash_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
-{
- GPtrArray *infos;
- gint i;
- gchar hash[8], *shash;
- CamelFolderChangeInfo *vf_changes = NULL;
- CamelFolderSummary *ssummary = sub->summary;
- gint start, last;
-
-
-
- CAMEL_VEE_FOLDER_LOCK(vf, summary_lock);
-
- start = -1;
- last = -1;
- infos = camel_folder_get_summary ((CamelFolder *) vf);
- for (i=0;i<infos->len;i++) {
-
- CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *) camel_folder_summary_uid (((CamelFolder *)vf)->summary, infos->pdata[i]);
- if (mi == NULL)
- continue;
- if (mi->summary == NULL) {
- camel_message_info_free (mi);
- continue;
- }
-
- if (mi->summary == ssummary) {
- const gchar *uid = camel_message_info_uid(mi);
-
- camel_folder_change_info_remove_uid(vf->changes, uid);
-
- if (last == -1) {
- last = start = i;
- } else if (last+1 == i) {
- last = i;
- } else {
- camel_folder_summary_remove_range(((CamelFolder *)vf)->summary, start, last);
- i -= (last-start)+1;
- start = last = i;
- }
- }
- camel_message_info_free (mi);
- }
- camel_folder_free_summary(sub, infos);
-
- if (last != -1)
- camel_folder_summary_remove_range(((CamelFolder *)vf)->summary, start, last);
-
- if (camel_folder_change_info_changed(vf->changes)) {
- vf_changes = vf->changes;
- vf->changes = camel_folder_change_info_new();
- }
-
- CAMEL_VEE_FOLDER_UNLOCK(vf, summary_lock);
-
- camel_vee_folder_hash_folder(sub, hash);
- shash = g_strdup_printf("%c%c%c%c%c%c%c%c", hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7]);
- if (g_hash_table_lookup (vf->hashes, shash))
- g_hash_table_remove (vf->hashes, shash);
- g_free(shash);
- if (vf_changes) {
- camel_object_trigger_event(vf, "folder_changed", vf_changes);
- camel_folder_change_info_free(vf_changes);
- }
-}
-
-static int
-vtrash_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
-{
- /* we should always be in sync */
- return 0;
-}
-
static void
camel_vtrash_folder_class_init (CamelVTrashFolderClass *klass)
{
folder_class->append_message = vtrash_append_message;
folder_class->transfer_messages_to = vtrash_transfer_messages_to;
- /* Not required, lets use the base class search function */
- /* folder_class->search_by_expression = vtrash_search_by_expression; */
- /* folder_class->search_by_uids = vtrash_search_by_uids; */
-#if 0
- ((CamelVeeFolderClass *)klass)->add_folder = vtrash_add_folder;
- ((CamelVeeFolderClass *)klass)->remove_folder = vtrash_remove_folder;
- ((CamelVeeFolderClass *)klass)->rebuild_folder = vtrash_rebuild_folder;
-
- ((CamelVeeFolderClass *)klass)->folder_changed = vtrash_folder_changed;
-#endif
}
sqlite3 *db;
-static int
+static gint
callback (gpointer data, gint argc, gchar **argv, gchar **azColName)
{
gint i;
return 0;
}
-static int
+static gint
select_stmt (const gchar * stmt) {
gchar *errmsg;
gint ret;
return ret;
}
-static int
+static gint
sql_stmt(const gchar * stmt) {
gchar *errmsg;
gint ret;
#define CREATE_STMT "CREATE TABLE %s (uid TEXT PRIMARY KEY, gflags INTEGER, isize INTEGER, dsent INTEGER, dreceived INTEGER, jsubject TEXT, ffrom TEXT, tto TEXT, cc TEXT, mlist TEXT, part TEXT, userflags TEXT, usertags TEXT, bdata TEXT)"
-static int
+static gint
create_table (const gchar *tablename)
{
gchar *cmd = malloc (sizeof(CREATE_STMT)+20);
};
+extern gint camel_application_is_exiting;
+
/*prototypes*/
static void groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *destination, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex);
static gint gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
EGwConnection *cnc;
EGwItem *item;
CamelStream *stream, *cache_stream;
- gint errno;
/* see if it is there in cache */
return NULL;
}
- container_id = g_strdup (camel_groupwise_store_container_id_lookup (gw_store, folder->full_name)) ;
+ container_id = g_strdup (camel_groupwise_store_container_id_lookup (gw_store, folder->full_name));
cnc = cnc_lookup (priv);
type = e_gw_item_get_item_type (item);
if (type == E_GW_ITEM_TYPE_APPOINTMENT || type == E_GW_ITEM_TYPE_NOTE || type == E_GW_ITEM_TYPE_TASK) {
+ time_t actual_time;
gint offset = 0;
dtstring = e_gw_item_get_start_date (item);
- time_t actual_time = e_gw_connection_get_date_from_string (dtstring);
+ actual_time = e_gw_connection_get_date_from_string (dtstring);
camel_mime_message_set_date (msg, actual_time, offset);
return;
}
gchar *status_opt = NULL;
gboolean enabled;
- for (rl = recipient_list ; rl != NULL ; rl = rl->next) {
+ for (rl = recipient_list; rl != NULL; rl = rl->next) {
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
enabled = recp->status_enabled;
}
cnc = cnc_lookup (priv);
- container_id = camel_groupwise_store_container_id_lookup (gw_store, folder->full_name) ;
+ container_id = camel_groupwise_store_container_id_lookup (gw_store, folder->full_name);
CAMEL_SERVICE_REC_LOCK (gw_store, connect_lock);
if (!camel_groupwise_store_connected (gw_store, ex)) {
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
if (folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED)
- return ;
+ return;
count = camel_folder_summary_count (folder->summary);
CAMEL_GROUPWISE_FOLDER_REC_LOCK (folder, cache_lock);
- for (i=0 ; i < count ; i++) {
+ for (i=0; i < count; i++) {
guint32 flags = 0;
info = camel_folder_summary_index (folder->summary, i);
gw_info = (CamelGroupwiseMessageInfo *) info;
update_update (CamelSession *session, CamelSessionThreadMsg *msg)
{
- extern gint camel_application_is_exiting;
-
struct _folder_update_msg *m = (struct _folder_update_msg *)msg;
EGwConnectionStatus status;
CamelException *ex = NULL;
if (camel_application_is_exiting) {
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
- return ;
+ return;
}
item_list = NULL;
}
}
-static int
+static gint
check_for_new_mails_count (CamelGroupwiseSummary *gw_summary, GSList *ids)
{
CamelFolderSummary *summary = (CamelFolderSummary *) gw_summary;
return count;
}
-static int
+static gint
compare_ids (gpointer a, gpointer b, gpointer data)
{
EGwItem *item1 = (EGwItem *) a;
return strcmp (id1, id2);
}
-static int
+static gint
get_merge_lists_new_count (CamelGroupwiseSummary *summary, GSList *new, GSList *modified, GSList **merged)
{
GSList *l, *element;
return;
}
- container_id = g_strdup (camel_groupwise_store_container_id_lookup (gw_store, folder->full_name)) ;
+ container_id = g_strdup (camel_groupwise_store_container_id_lookup (gw_store, folder->full_name));
if (!container_id) {
d (printf ("\nERROR - Container id not present. Cannot refresh info for %s\n", folder->full_name));
/*Get the New Items*/
if (!is_proxy) {
- gchar *source;
+ const gchar *source;
if ( !strcmp (folder->full_name, RECEIVED) || !strcmp(folder->full_name, SENT) ) {
source = NULL;
camel_operation_start (NULL, _("Fetching summary information for new messages in %s"), folder->name);
- for ( ; item_list != NULL ; item_list = g_list_next (item_list) ) {
- EGwItem *temp_item ;
+ for (; item_list != NULL; item_list = g_list_next (item_list) ) {
+ EGwItem *temp_item;
EGwItem *item;
EGwItemType type = E_GW_ITEM_TYPE_UNKNOWN;
EGwItemOrganizer *org;
is_junk = TRUE;
}
- for (; item_list != NULL ; item_list = g_list_next (item_list) ) {
+ for (; item_list != NULL; item_list = g_list_next (item_list) ) {
EGwItem *item = (EGwItem *)item_list->data;
EGwItemType type = E_GW_ITEM_TYPE_UNKNOWN;
EGwItemOrganizer *org;
EGwConnectionStatus status;
EGwConnection *cnc;
CamelMultipart *multipart = NULL;
- gint errno;
gchar *body = NULL;
gint body_len = 0;
const gchar *uid = NULL;
} /* if Mime.822 or TEXT.htm */
if (!ignore_mime_822) {
- for (al = attach_list ; al != NULL ; al = al->next) {
+ for (al = attach_list; al != NULL; al = al->next) {
EGwItemAttachment *attach = (EGwItemAttachment *)al->data;
if (!g_ascii_strcasecmp (attach->name, "Mime.822")) {
if (attach->size > MAX_ATTACHMENT_SIZE) {
gboolean has_boundary = FALSE;
GSList *al;
- for (al = attach_list ; al != NULL ; al = al->next) {
+ for (al = attach_list; al != NULL; al = al->next) {
EGwItemAttachment *attach = (EGwItemAttachment *)al->data;
gchar *attachment = NULL;
gint len = 0;
CAMEL_SERVICE_REC_LOCK (folder->parent_store, connect_lock);
/*Get the container id*/
- container_id = camel_groupwise_store_container_id_lookup (gw_store, folder->full_name) ;
+ container_id = camel_groupwise_store_container_id_lookup (gw_store, folder->full_name);
item = camel_groupwise_util_item_from_message (cnc, message, CAMEL_ADDRESS (message->from));
/*Set the source*/
/* A function to compare uids, inspired by strcmp .
This code was used in some other provider also , imap4rev1 iirc */
-static int
+static gint
uid_compar (gconstpointer va, gconstpointer vb)
{
const gchar **sa = (const gchar **)va, **sb = (const gchar **)vb;
- unsigned long a, b;
+ gulong a, b;
a = strtoul (*sa, NULL, 10);
b = strtoul (*sb, NULL, 10);
*transferred_uids = NULL;
if (delete_originals)
- source_container_id = camel_groupwise_store_container_id_lookup (gw_store, source->full_name) ;
+ source_container_id = camel_groupwise_store_container_id_lookup (gw_store, source->full_name);
else
source_container_id = NULL;
- dest_container_id = camel_groupwise_store_container_id_lookup (gw_store, destination->full_name) ;
+ dest_container_id = camel_groupwise_store_container_id_lookup (gw_store, destination->full_name);
CAMEL_SERVICE_REC_LOCK (source->parent_store, connect_lock);
/* check for offline operation */
changes = camel_folder_change_info_new ();
- container_id = g_strdup (camel_groupwise_store_container_id_lookup (groupwise_store, folder->full_name)) ;
+ container_id = g_strdup (camel_groupwise_store_container_id_lookup (groupwise_store, folder->full_name));
max = camel_folder_summary_count (folder->summary);
for (i = 0; i < max; i++) {
return camel_groupwise_folder_type;
}
-static int
+static gint
gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
gint i, count = 0;
guint32 tag;
- for (i=0 ; i<args->argc ; i++) {
+ for (i=0; i<args->argc; i++) {
CamelArgGet *arg = &args->argv[i];
tag = arg->tag;
recp_list = e_gw_item_get_recipient_list (item);
if (recp_list) {
- GSList *rl ;
+ GSList *rl;
- for (rl = recp_list ; rl != NULL ; rl = rl->next) {
+ for (rl = recp_list; rl != NULL; rl = rl->next) {
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
g_string_append_printf (gstr,
"ATTENDEE;CN= %s;ROLE= REQ-PARTICIPANT:\nMAILTO:%s\n",
if (attach_list) {
GSList *al;
- for (al = attach_list ; al != NULL ; al = al->next) {
+ for (al = attach_list; al != NULL; al = al->next) {
EGwItemAttachment *attach = (EGwItemAttachment *)al->data;
g_string_append_printf (gstr, "ATTACH:%s\n", attach->id);
}
if (recp_list) {
GSList *rl;
- for (rl = recp_list ; rl != NULL ; rl = rl->next) {
+ for (rl = recp_list; rl != NULL; rl = rl->next) {
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
g_string_append_printf (gstr,
"ATTENDEE;CN= %s;ROLE= REQ-PARTICIPANT:\nMAILTO:%s\n",
CamelType camel_groupwise_folder_get_type (void);
/* implemented */
-CamelFolder * camel_gw_folder_new(CamelStore *store, const gchar *folder_dir, const gchar *folder_name, CamelException *ex) ;
-void gw_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex) ;
+CamelFolder * camel_gw_folder_new(CamelStore *store, const gchar *folder_dir, const gchar *folder_name, CamelException *ex);
+void gw_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex);
void groupwise_refresh_folder(CamelFolder *folder, CamelException *ex);
G_END_DECLS
return NULL;
}
-static int
+static gint
groupwise_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out)
{
CamelGroupwiseJournalEntry *groupwise_entry = (CamelGroupwiseJournalEntry *) entry;
dest->size = src->size;
}
-static int
+static gint
groupwise_entry_play_append (CamelOfflineJournal *journal, CamelGroupwiseJournalEntry *entry, CamelException *ex)
{
CamelGroupwiseFolder *gw_folder = (CamelGroupwiseFolder *) journal->folder;
return 0;
}
-static int
+static gint
groupwise_entry_play_transfer (CamelOfflineJournal *journal, CamelGroupwiseJournalEntry *entry, CamelException *ex)
{
CamelGroupwiseFolder *gw_folder = (CamelGroupwiseFolder *) journal->folder;
return -1;
}
-static int
+static gint
groupwise_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex)
{
CamelGroupwiseJournalEntry *groupwise_entry = (CamelGroupwiseJournalEntry *) entry;
CamelException *ex)
{
CamelOfflineJournal *journal = (CamelOfflineJournal *) groupwise_journal;
- CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(journal->folder->parent_store) ;
+ CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(journal->folder->parent_store);
CamelGroupwiseJournalEntry *entry;
gchar *uid;
TRUE
};
-static int
+static gint
groupwise_auto_detect_cb (CamelURL *url, GHashTable **auto_detected,
CamelException *ex)
{
static gint summary_header_load(CamelStoreSummary *, FILE *);
static gint summary_header_save(CamelStoreSummary *, FILE *);
-static CamelStoreInfo *store_info_load(CamelStoreSummary *s, FILE *in) ;
-static gint store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi) ;
-static void store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi) ;
-static void store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str) ;
+static CamelStoreInfo *store_info_load(CamelStoreSummary *s, FILE *in);
+static gint store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi);
+static void store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi);
+static void store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str);
-static const gchar *store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type) ;
-CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_find_full(CamelGroupwiseStoreSummary *s, const gchar *full) ;
+static const gchar *store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type);
+CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_find_full(CamelGroupwiseStoreSummary *s, const gchar *full);
static void camel_groupwise_store_summary_class_init (CamelGroupwiseStoreSummaryClass *klass);
static void camel_groupwise_store_summary_init (CamelGroupwiseStoreSummary *obj);
return 0;
}
-static int
+static gint
namespace_save(CamelStoreSummary *s, FILE *in, CamelGroupwiseStoreNamespace *ns)
{
if (camel_file_util_encode_string(in, ns->path) == -1
gchar *
camel_groupwise_store_summary_path_to_full(CamelGroupwiseStoreSummary *s, const gchar *path, gchar dir_sep)
{
- guchar *full, *f;
+ gchar *full, *f;
guint32 c, v = 0;
const gchar *p;
gint state=0;
else {
if (c == '/')
c = dir_sep;
- camel_utf8_putc(&f, c);
+ camel_utf8_putc((guchar **) &f, c);
}
break;
case 1:
case 2:
state = 0;
v |= hexnib(c);
- camel_utf8_putc(&f, v);
+ camel_utf8_putc((guchar **) &f, v);
break;
}
}
- camel_utf8_putc(&f, c);
+ camel_utf8_putc((guchar **) &f, c);
/* merge old path part if required */
f = g_strdup (full);
g_free(f);
f = full;
}
- return f ;
+ return f;
}
CamelGroupwiseStoreNamespace *
if (info) {
d(printf(" '%s' -> '%s'\n", pathu8, full_name));
camel_store_info_set_string((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_STORE_INFO_LAST, full_name);
- } else
+ } else {
d(printf(" failed\n"));
+ }
return info;
}
-static int
+static gint
summary_header_load(CamelStoreSummary *s, FILE *in)
{
- CamelGroupwiseStoreSummary *summary = (CamelGroupwiseStoreSummary *)s ;
- gint32 version, capabilities, count ;
+ CamelGroupwiseStoreSummary *summary = (CamelGroupwiseStoreSummary *)s;
+ gint32 version, capabilities, count;
- namespace_clear (s) ;
+ namespace_clear (s);
if (camel_groupwise_store_summary_parent->summary_header_load ((CamelStoreSummary *)s, in) == -1
|| camel_file_util_decode_fixed_int32(in, &version) == -1)
- return -1 ;
+ return -1;
- summary->version = version ;
+ summary->version = version;
if (camel_file_util_decode_fixed_int32(in, &capabilities) == -1
|| camel_file_util_decode_fixed_int32(in, &count) == -1
|| count > 1)
return -1;
- summary->capabilities = capabilities ;
+ summary->capabilities = capabilities;
if (count == 1) {
if ((summary->namespace = namespace_load (s, in)) == NULL)
- return -1 ;
+ return -1;
}
- return 0 ;
+ return 0;
}
-static int
+static gint
summary_header_save(CamelStoreSummary *s, FILE *out)
{
- CamelGroupwiseStoreSummary *summary = (CamelGroupwiseStoreSummary *) s ;
- guint32 count ;
+ CamelGroupwiseStoreSummary *summary = (CamelGroupwiseStoreSummary *) s;
+ guint32 count;
- count = summary->namespace?1:0 ;
+ count = summary->namespace?1:0;
if (camel_groupwise_store_summary_parent->summary_header_save((CamelStoreSummary *)s, out) == -1
|| camel_file_util_encode_fixed_int32(out, 0) == -1
|| camel_file_util_encode_fixed_int32(out, summary->capabilities) == -1
return -1;
- return 0 ;
+ return 0;
}
static CamelStoreInfo *
return (CamelStoreInfo *)si;
}
-static int
+static gint
store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
{
CamelGroupwiseStoreInfo *summary = (CamelGroupwiseStoreInfo *)mi;
CamelType camel_groupwise_store_summary_get_type (void);
CamelGroupwiseStoreSummary *camel_groupwise_store_summary_new (void);
-CamelGroupwiseStoreInfo *camel_groupwise_store_summary_full_name(CamelGroupwiseStoreSummary *s, const gchar *full_name) ;
-CamelGroupwiseStoreInfo *camel_groupwise_store_summary_add_from_full(CamelGroupwiseStoreSummary *s, const gchar *full, gchar dir_sep) ;
+CamelGroupwiseStoreInfo *camel_groupwise_store_summary_full_name(CamelGroupwiseStoreSummary *s, const gchar *full_name);
+CamelGroupwiseStoreInfo *camel_groupwise_store_summary_add_from_full(CamelGroupwiseStoreSummary *s, const gchar *full, gchar dir_sep);
-gchar *camel_groupwise_store_summary_full_to_path(CamelGroupwiseStoreSummary *s, const gchar *full_name, gchar dir_sep) ;
-gchar *camel_groupwise_store_summary_path_to_full(CamelGroupwiseStoreSummary *s, const gchar *path, gchar dir_sep) ;
-gchar *camel_groupwise_store_summary_full_from_path(CamelGroupwiseStoreSummary *s, const gchar *path) ;
+gchar *camel_groupwise_store_summary_full_to_path(CamelGroupwiseStoreSummary *s, const gchar *full_name, gchar dir_sep);
+gchar *camel_groupwise_store_summary_path_to_full(CamelGroupwiseStoreSummary *s, const gchar *path, gchar dir_sep);
+gchar *camel_groupwise_store_summary_full_from_path(CamelGroupwiseStoreSummary *s, const gchar *path);
-CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_new(CamelGroupwiseStoreSummary *s, const gchar *full_name, gchar dir_sep) ;
-CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_find_path(CamelGroupwiseStoreSummary *s, const gchar *path) ;
-void camel_groupwise_store_summary_namespace_set(CamelGroupwiseStoreSummary *s, CamelGroupwiseStoreNamespace *ns) ;
+CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_new(CamelGroupwiseStoreSummary *s, const gchar *full_name, gchar dir_sep);
+CamelGroupwiseStoreNamespace *camel_groupwise_store_summary_namespace_find_path(CamelGroupwiseStoreSummary *s, const gchar *path);
+void camel_groupwise_store_summary_namespace_set(CamelGroupwiseStoreSummary *s, CamelGroupwiseStoreNamespace *ns);
#define camel_groupwise_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_LAST))
}
/*populate the hash table for finding the mapping from container id <-> folder name*/
- for (;temp_list != NULL ; temp_list = g_list_next (temp_list) ) {
+ for (;temp_list != NULL; temp_list = g_list_next (temp_list) ) {
const gchar *name, *id, *parent;
name = e_gw_container_get_name (E_GW_CONTAINER (temp_list->data));
id = e_gw_container_get_id(E_GW_CONTAINER(temp_list->data));
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
CamelFolderInfo *root = NULL;
- gchar *parent_name, *folder_name, *child_container_id, *parent_id;
+ const gchar *parent_name, *folder_name, *child_container_id, *parent_id;
gint status;
parent_name = "";
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
CamelFolderInfo *root = NULL;
- gchar *parent_id , *child_container_id;
+ const gchar *parent_id;
+ gchar *child_container_id;
gint status;
if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
return FALSE;
}
-static int
+static gint
match_path(const gchar *path, const gchar *name)
{
gchar p, n;
static gint gw_summary_header_load (CamelFolderSummary *, FILE *);
static gint gw_summary_header_save (CamelFolderSummary *, FILE *);
-static CamelMessageInfo *gw_message_info_load (CamelFolderSummary *s, FILE *in) ;
+static CamelMessageInfo *gw_message_info_load (CamelFolderSummary *s, FILE *in);
-static gint gw_message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info) ;
-static CamelMessageContentInfo * gw_content_info_load (CamelFolderSummary *s, FILE *in) ;
-static gint gw_content_info_save (CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *info) ;
+static gint gw_message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info);
+static CamelMessageContentInfo * gw_content_info_load (CamelFolderSummary *s, FILE *in);
+static gint gw_content_info_save (CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *info);
static gboolean gw_info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set);
static gint summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir);
/*End of Prototypes*/
-static CamelFolderSummaryClass *camel_groupwise_summary_parent ;
+static CamelFolderSummaryClass *camel_groupwise_summary_parent;
CamelType
camel_groupwise_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS (camel_type_get_global_classfuncs (camel_folder_summary_get_type()));
- cfs_class->message_info_clone = gw_message_info_clone ;
+ cfs_class->message_info_clone = gw_message_info_clone;
cfs_class->summary_header_load = gw_summary_header_load;
cfs_class->summary_header_save = gw_summary_header_save;
cfs_class->message_info_load = gw_message_info_load;
CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (
camel_object_new (camel_groupwise_summary_get_type ()));
- summary->folder = folder ;
+ summary->folder = folder;
camel_folder_summary_set_build_content (summary, TRUE);
camel_folder_summary_set_filename (summary, filename);
return summary;
}
-static int
+static gint
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
{
CamelGroupwiseSummary *gms = CAMEL_GROUPWISE_SUMMARY (s);
gchar *part;
if (camel_groupwise_summary_parent->summary_header_from_db (s, mir) == -1)
- return -1 ;
+ return -1;
part = mir->bdata;
return 0;
}
-static int
+static gint
gw_summary_header_load (CamelFolderSummary *s, FILE *in)
{
CamelGroupwiseSummary *gms = CAMEL_GROUPWISE_SUMMARY (s);
if (camel_groupwise_summary_parent->summary_header_load (s, in) == -1)
- return -1 ;
+ return -1;
if (camel_file_util_decode_fixed_int32(in, &gms->version) == -1
|| camel_file_util_decode_fixed_int32(in, &gms->validity) == -1)
if (camel_file_util_decode_string (in, &gms->time_string) == -1)
return -1;
- return 0 ;
+ return 0;
}
}
-static int
+static gint
gw_summary_header_save (CamelFolderSummary *s, FILE *out)
{
CamelGroupwiseSummary *gms = CAMEL_GROUPWISE_SUMMARY(s);
static CamelMessageInfo *
gw_message_info_load (CamelFolderSummary *s, FILE *in)
{
- CamelMessageInfo *info ;
- CamelGroupwiseMessageInfo *gw_info ;
+ CamelMessageInfo *info;
+ CamelGroupwiseMessageInfo *gw_info;
- info = camel_groupwise_summary_parent->message_info_load(s,in) ;
+ info = camel_groupwise_summary_parent->message_info_load(s,in);
if (info) {
- gw_info = (CamelGroupwiseMessageInfo*) info ;
+ gw_info = (CamelGroupwiseMessageInfo*) info;
if (camel_file_util_decode_uint32 (in, &gw_info->server_flags) == -1)
- goto error ;
+ goto error;
}
- return info ;
+ return info;
error:
- camel_message_info_free (info) ;
- return NULL ;
+ camel_message_info_free (info);
+ return NULL;
}
static CamelMIRecord *
return mir;
}
-static int
+static gint
gw_message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
{
CamelGroupwiseMessageInfo *gw_info = (CamelGroupwiseMessageInfo *)info;
return camel_folder_summary_content_info_new (s);
}
-static int
+static gint
content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir)
{
}
}
-static int
+static gint
gw_content_info_save (CamelFolderSummary *s, FILE *out,
CamelMessageContentInfo *info)
{
void
camel_gw_summary_add_offline (CamelFolderSummary *summary, const gchar *uid, CamelMimeMessage *message, const CamelMessageInfo *info)
{
- CamelGroupwiseMessageInfo *mi ;
- const CamelFlag *flag ;
- const CamelTag *tag ;
+ CamelGroupwiseMessageInfo *mi;
+ const CamelFlag *flag;
+ const CamelTag *tag;
/* Create summary entry */
- mi = (CamelGroupwiseMessageInfo *)camel_folder_summary_info_new_from_message (summary, message) ;
+ mi = (CamelGroupwiseMessageInfo *)camel_folder_summary_info_new_from_message (summary, message);
/* Copy flags 'n' tags */
- mi->info.flags = camel_message_info_flags(info) ;
+ mi->info.flags = camel_message_info_flags(info);
- flag = camel_message_info_user_flags(info) ;
+ flag = camel_message_info_user_flags(info);
while (flag) {
camel_message_info_set_user_flag((CamelMessageInfo *)mi, flag->name, TRUE);
flag = flag->next;
G_BEGIN_DECLS
-typedef struct _CamelGroupwiseSummary CamelGroupwiseSummary ;
-typedef struct _CamelGroupwiseSummaryClass CamelGroupwiseSummaryClass ;
-typedef struct _CamelGroupwiseMessageInfo CamelGroupwiseMessageInfo ;
-typedef struct _CamelGroupwiseMessageContentInfo CamelGroupwiseMessageContentInfo ;
+typedef struct _CamelGroupwiseSummary CamelGroupwiseSummary;
+typedef struct _CamelGroupwiseSummaryClass CamelGroupwiseSummaryClass;
+typedef struct _CamelGroupwiseMessageInfo CamelGroupwiseMessageInfo;
+typedef struct _CamelGroupwiseMessageContentInfo CamelGroupwiseMessageContentInfo;
/* extra summary flags*/
enum {
struct _CamelGroupwiseMessageContentInfo {
- CamelMessageContentInfo info ;
+ CamelMessageContentInfo info;
} ;
struct _CamelGroupwiseSummaryClass {
- CamelFolderSummaryClass parent_class ;
+ CamelFolderSummaryClass parent_class;
} ;
-CamelType camel_groupwise_summary_get_type (void) ;
+CamelType camel_groupwise_summary_get_type (void);
-CamelFolderSummary *camel_groupwise_summary_new (struct _CamelFolder *folder, const gchar *filename) ;
+CamelFolderSummary *camel_groupwise_summary_new (struct _CamelFolder *folder, const gchar *filename);
-void camel_gw_summary_add_offline (CamelFolderSummary *summary, const gchar *uid, CamelMimeMessage *messgae, const CamelMessageInfo *info) ;
+void camel_gw_summary_add_offline (CamelFolderSummary *summary, const gchar *uid, CamelMimeMessage *messgae, const CamelMessageInfo *info);
-void camel_gw_summary_add_offline_uncached (CamelFolderSummary *summary, const gchar *uid, const CamelMessageInfo *info) ;
+void camel_gw_summary_add_offline_uncached (CamelFolderSummary *summary, const gchar *uid, const CamelMessageInfo *info);
void groupwise_summary_clear (CamelFolderSummary *summary, gboolean uncache);
G_END_DECLS
typedef struct {
CamelTransport parent_object;
- gboolean connected ;
+ gboolean connected;
} CamelGroupwiseTransport;
EGwItemRecipient *recipient;
total_add = camel_address_length (recipients);
- for (i=0 ; i<total_add ; i++) {
+ for (i=0; i<total_add; i++) {
const gchar *name = NULL, *addr = NULL;
if(camel_internet_address_get ((CamelInternetAddress *)recipients, i , &name, &addr )) {
gchar *
gw_concat ( const gchar *prefix, const gchar *suffix)
{
- size_t len;
+ gsize len;
len = strlen (prefix);
if (len == 0 || prefix[len - 1] == '/')
gint i;
part_count = camel_multipart_get_number (mp);
- for ( i=0 ; i<part_count ; i++) {
+ for ( i=0; i<part_count; i++) {
CamelContentType *type;
CamelMimePart *part;
CamelStreamMem *content = (CamelStreamMem *)camel_stream_mem_new ();
TRUE
};
-static int
+static gint
hula_auto_detect_cb (CamelURL *url, GHashTable **auto_detected,
CamelException *ex)
{
#include "camel-imap-store.h"
#include "camel-imap-utils.h"
-extern gint camel_verbose_debug;
-
static gboolean imap_command_start (CamelImapStore *store, CamelFolder *folder,
const gchar *cmd, CamelException *ex);
static CamelImapResponse *imap_read_response (CamelImapStore *store,
imap_command_start (CamelImapStore *store, CamelFolder *folder,
const gchar *cmd, CamelException *ex)
{
- ssize_t nwritten;
+ gssize nwritten;
if (!store->ostream) {
camel_exception_set (ex, CAMEL_EXCEPTION_STORE_INVALID, _("No output stream"));
**/
CamelImapResponse *
camel_imap_command_continuation (CamelImapStore *store, const gchar *cmd,
- size_t cmdlen, CamelException *ex)
+ gsize cmdlen, CamelException *ex)
{
if (!camel_imap_store_connected (store, ex))
return NULL;
/* XGWMOVE response is the same as an EXPUNGE response */
if (!expunged) {
expunged = g_array_new (FALSE, FALSE,
- sizeof (int));
+ sizeof (gint));
}
g_array_append_val (expunged, number);
}
switch (*++p) {
case 'd':
- num = va_arg (ap, int);
+ num = va_arg (ap, gint);
g_ptr_array_add (args, GINT_TO_POINTER (num));
start = p + 1;
len += 10;
const gchar *fmt, ...);
CamelImapResponse *camel_imap_command_continuation (CamelImapStore *store,
const gchar *cmd,
- size_t cmdlen,
+ gsize cmdlen,
CamelException *ex);
void camel_imap_response_free (CamelImapStore *store,
* octets) */
#define UID_SET_LIMIT (768)
+extern gint camel_application_is_exiting;
#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o)))
static CamelOfflineFolderClass *offline_folder_class = NULL;
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
CamelImapSummary *imap_summary = CAMEL_IMAP_SUMMARY (folder->summary);
- unsigned long exists = 0, validity = 0, val, uid;
+ gulong exists = 0, validity = 0, val, uid;
guint32 perm_flags = 0;
GData *fetch_data;
gint i, count;
count = camel_folder_summary_count (folder->summary);
for (i = 0; i < response->untagged->len; i++) {
- resp = response->untagged->pdata[i] + 2;
+ resp = (gchar *) response->untagged->pdata[i] + 2;
if (!g_ascii_strncasecmp (resp, "FLAGS ", 6) && !perm_flags) {
resp += 6;
folder->permanent_flags = perm_flags;
} else if (!g_ascii_strncasecmp (resp, "OK [UIDVALIDITY ", 16)) {
validity = strtoul (resp + 16, NULL, 10);
- } else if (isdigit ((unsigned char)*resp)) {
- unsigned long num = strtoul (resp, &resp, 10);
+ } else if (isdigit ((guchar)*resp)) {
+ gulong num = strtoul (resp, &resp, 10);
if (!g_ascii_strncasecmp (resp, " EXISTS", 7)) {
exists = num;
return camel_imap_message_cache_get_filename (imap_folder->cache, uid, "", ex);
}
-static int
+static gint
imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
return 0;
}
-static int
+static gint
imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
gint save = 0;
CamelImapResponse *response;
CamelStoreInfo *si;
gint check_rescan = -1;
- extern gint camel_application_is_exiting;
if (CAMEL_OFFLINE_STORE (imap_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
return;
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- extern gint camel_application_is_exiting;
struct {
gchar *uid;
guint32 flags;
* to sync up with the server. So either way, we remove it
* from the summary.
*/
- removed = g_array_new (FALSE, FALSE, sizeof (int));
+ removed = g_array_new (FALSE, FALSE, sizeof (gint));
if (summary_len - camel_folder_summary_cache_size (folder->summary) > 50)
camel_folder_summary_reload_from_db (folder->summary, ex);
CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
}
-static int
+static gint
uid_compar (gconstpointer va, gconstpointer vb)
{
const gchar **sa = (const gchar **)va, **sb = (const gchar **)vb;
- unsigned long a, b;
+ gulong a, b;
a = strtoul (*sa, NULL, 10);
b = strtoul (*sb, NULL, 10);
if (result[8] == ' ') {
gchar *uid, *lasts = NULL;
- unsigned long euid, kuid;
+ gulong euid, kuid;
gint ei, ki;
keep_uids = g_ptr_array_new ();
G_LOCK (lock);
res = g_strdup_printf ("tempuid-%lx-%d",
- (unsigned long) time (NULL),
+ (gulong) time (NULL),
counter++);
G_UNLOCK (lock);
for (first = i; i < uids->len; i++) {
uid = uids->pdata[i];
- if (!isdigit ((unsigned char)*uid)) {
+ if (!isdigit ((guchar)*uid)) {
uid = camel_imap_journal_uidmap_lookup ((CamelIMAPJournal *) CAMEL_IMAP_FOLDER (source)->journal, uid);
if (!uid)
break;
*stack = node;
}
-static int
+static gint
part_spec_pop (struct _part_spec_stack **stack)
{
struct _part_spec_stack *node;
struct _part_spec_stack *stack = NULL;
CamelMessageContentInfo *node;
gchar *part_spec, *buf;
- size_t len = 1;
+ gsize len = 1;
gint part;
node = ci;
#define IMAP_PRETEND_SIZEOF_SIZE 20
#define IMAP_PRETEND_SIZEOF_HEADERS 2000
-static gchar *tm_months[] = {
+static const gchar *tm_months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
*hour = *min = *sec = 0;
val = hour;
- for (inptr = *in; *inptr && !isspace ((int) *inptr); inptr++) {
+ for (inptr = *in; *inptr && !isspace ((gint) *inptr); inptr++) {
if (*inptr == ':') {
colons++;
switch (colons) {
default:
return FALSE;
}
- } else if (!isdigit ((int) *inptr))
+ } else if (!isdigit ((gint) *inptr))
return FALSE;
else
*val = (*val * 10) + (*inptr - '0');
CamelStream *stream;
gchar *uid, *resp, *tempuid;
GData *data;
- extern gint camel_application_is_exiting;
gint k = 0, ct;
if (store->server_level >= IMAP_LEVEL_IMAP4REV1) {
GArray *expunged, CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- extern gint camel_application_is_exiting;
CamelFolderChangeInfo *changes;
gint len;
gchar *uid;
GData *data = NULL;
gchar *start, *part_spec = NULL, *body = NULL, *uid = NULL, *idate = NULL;
gboolean cache_header = TRUE, header = FALSE;
- size_t body_len = 0;
+ gsize body_len = 0;
if (*response != '(') {
- long seq;
+ glong seq;
if (*response != '*' || *(response + 1) != ' ')
return NULL;
g_datalist_set_data_full (&data, "CUSTOM.FLAGS", custom_flags, g_free);
}
} else if (!g_ascii_strncasecmp (response, "RFC822.SIZE ", 12)) {
- unsigned long size;
+ gulong size;
response += 12;
size = strtoul (response, &response, 10);
if (resp && g_str_has_prefix (resp, "* QUOTA ")) {
gboolean skipped = TRUE;
- size_t sz;
+ gsize sz;
gchar *astr;
resp = resp + 8;
u = strtoull (used, NULL, 10);
t = strtoull (total, NULL, 10);
- if (u >= 0 && t > 0) {
+ if (t > 0) {
CamelFolderQuotaInfo *info = camel_folder_quota_info_new (name, u, t);
if (last)
entry->uids = decode_uids (in);
if (!entry->uids)
goto exception;
- if (camel_file_util_decode_uint32 (in, &entry->move) == -1)
+ if (camel_file_util_decode_uint32 (in, (guint32 *) &entry->move) == -1)
goto exception;
break;
default:
return NULL;
}
-static int
+static gint
encode_uids (FILE *file, GPtrArray *uids)
{
gint i, status;
return status;
}
-static int
+static gint
imap_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out)
{
CamelIMAPJournalEntry *imap_entry = (CamelIMAPJournalEntry *) entry;
return hash;
}
-static int
+static gint
check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
return strcmp (s1, s2) == 0;
}
-static int
+static gint
imap_url_equal (gconstpointer a, gconstpointer b)
{
const CamelURL *u1 = a, *u2 = b;
hash[16] = 0;
}
-static int
+static gint
save_match(CamelImapSearch *is, struct _match_record *mr)
{
guint32 mark = MATCH_MARK;
return mr;
}
-static int
+static gint
sync_match(CamelImapSearch *is, struct _match_record *mr)
{
gchar *p, *result, *lasts = NULL;
/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const gchar *);*/
static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
-static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
+static gint store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
+static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, gint);
static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
static void camel_imap_store_summary_class_init (CamelImapStoreSummaryClass *klass);
if (!g_ascii_strcasecmp(full_name, "inbox"))
info->info.flags |= CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_TYPE_INBOX;
- } else
+ } else {
d(printf(" failed\n"));
+ }
return info;
}
return ns;
}
-static int
+static gint
namespace_save(CamelStoreSummary *s, FILE *in, CamelImapStoreNamespace *ns)
{
if (camel_file_util_encode_string(in, ns->path) == -1
return 0;
}
-static int
+static gint
summary_header_load(CamelStoreSummary *s, FILE *in)
{
CamelImapStoreSummary *is = (CamelImapStoreSummary *)s;
return 0;
}
-static int
+static gint
summary_header_save(CamelStoreSummary *s, FILE *out)
{
CamelImapStoreSummary *is = (CamelImapStoreSummary *)s;
return (CamelStoreInfo *)mi;
}
-static int
+static gint
store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
{
CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
}
}
-static int
+static gint
imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
CamelImapStore *store = (CamelImapStore *) object;
return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
}
-static int
+static gint
imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelImapStore *store = (CamelImapStore *) object;
if (!strcmp (ssl_options[i].value, ssl_mode))
break;
mode = ssl_options[i].mode;
- serv = ssl_options[i].serv;
+ serv = (gchar *) ssl_options[i].serv;
port = ssl_options[i].port;
} else {
mode = MODE_CLEAR;
- serv = "imap";
+ serv = (gchar *) "imap";
port = IMAP_PORT;
}
if (service->url->port) {
serv = g_alloca (16);
- sprintf ((char *)serv, "%d", service->url->port);
+ sprintf ((gchar *)serv, "%d", service->url->port);
port = NULL;
}
CamelImapResponse *response;
/*struct _namespaces *namespaces;*/
gchar *result, *name;
- size_t len;
+ gsize len;
CamelImapStoreNamespace *ns;
if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
if (parent_real != NULL) {
gboolean need_convert = FALSE;
gchar *resp, *thisone;
- gint i, flags;
+ gint flags;
+ gint i;
if (!(response = camel_imap_command (imap_store, NULL, ex, "LIST \"\" %G", parent_real))) {
CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
count = camel_store_summary_count((CamelStoreSummary *)imap_store->summary);
for (i=0;i<count;i++) {
- const char *full_name;
+ const gchar *full_name;
si = camel_store_summary_index((CamelStoreSummary *)imap_store->summary, i);
if (si == NULL)
camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
continue;
}
-
+
if (imap_match_pattern (imap_store->dir_sep, pattern, full_name)) {
if ((fi = g_hash_table_lookup(present, camel_store_info_path(imap_store->summary, si))) != NULL) {
if (((fi->flags ^ si->flags) & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED)) {
for (i=0;i<camel_store_summary_count((CamelStoreSummary *)imap_store->summary);i++) {
CamelStoreInfo *si = camel_store_summary_index((CamelStoreSummary *)imap_store->summary, i);
- const char *full_name;
+ const gchar *full_name;
if (si == NULL)
continue;
}
-ssize_t
+gssize
camel_imap_store_readline (CamelImapStore *store, gchar **dest, CamelException *ex)
{
CamelStreamBuffer *stream;
gchar linebuf[1024] = {0};
GByteArray *ba;
- ssize_t nread;
+ gssize nread;
g_return_val_if_fail (CAMEL_IS_IMAP_STORE (store), -1);
g_return_val_if_fail (dest, -1);
nread--;
}
- *dest = (gchar *)ba->data;
+ *dest = (gchar *) ba->data;
g_byte_array_free (ba, FALSE);
return nread;
CamelImapMsg *camel_imap_msg_new(void (*receive)(CamelImapStore *store, struct _CamelImapMsg *m),
void (*free)(CamelImapStore *store, struct _CamelImapMsg *m),
- size_t size);
+ gsize size);
void camel_imap_msg_queue(CamelImapStore *store, CamelImapMsg *msg);
G_END_DECLS
gboolean camel_imap_store_connected (CamelImapStore *store, CamelException *ex);
-ssize_t camel_imap_store_readline (CamelImapStore *store, gchar **dest, CamelException *ex);
+gssize camel_imap_store_readline (CamelImapStore *store, gchar **dest, CamelException *ex);
G_END_DECLS
s->content_info_size = sizeof(CamelImapMessageContentInfo);
}
-static int
+static gint
sort_uid_cmp (gpointer enc, gint len1, gpointer data1, gint len2, gpointer data2)
{
static gchar *sa1=NULL, *sa2=NULL;
return (a1 < a1) ? -1 : (a1 > a2) ? 1 : 0;
}
-static int
+static gint
uid_compare (gconstpointer va, gconstpointer vb)
{
const gchar **sa = (const gchar **)va, **sb = (const gchar **)vb;
- unsigned long a, b;
+ gulong a, b;
a = strtoul (*sa, NULL, 10);
b = strtoul (*sb, NULL, 10);
return summary;
}
-static int
+static gint
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
{
CamelImapSummary *ims = CAMEL_IMAP_SUMMARY (s);
return 0;
}
-static int
+static gint
summary_header_load (CamelFolderSummary *s, FILE *in)
{
CamelImapSummary *ims = CAMEL_IMAP_SUMMARY (s);
return camel_file_util_decode_uint32(in, &ims->validity);
/* Version 1 */
- if (camel_file_util_decode_fixed_int32(in, &ims->version) == -1)
+ if (camel_file_util_decode_fixed_int32(in, (gint32 *) &ims->version) == -1)
return -1;
if (ims->version == 2) {
return -1;
}
- if (camel_file_util_decode_fixed_int32(in, &ims->validity) == -1)
+ if (camel_file_util_decode_fixed_int32(in, (gint32 *) &ims->validity) == -1)
return -1;
if (ims->version > CAMEL_IMAP_SUMMARY_VERSION) {
return fir;
}
-static int
+static gint
summary_header_save (CamelFolderSummary *s, FILE *out)
{
CamelImapSummary *ims = CAMEL_IMAP_SUMMARY(s);
return mir;
}
-static int
+static gint
message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
{
CamelImapMessageInfo *iinfo = (CamelImapMessageInfo *)info;
return camel_folder_summary_content_info_new (s);
}
-static int
+static gint
content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir)
{
gchar *oldr;
}
}
-static int
+static gint
content_info_save (CamelFolderSummary *s, FILE *out,
CamelMessageContentInfo *info)
{
struct _namespace *list, *tail, *node;
const gchar *inptr;
gchar *astring;
- size_t len;
+ gsize len;
inptr = *in;
{
gboolean is_lsub = FALSE;
const gchar *word;
- size_t len;
+ gsize len;
if (*buf != '*')
return FALSE;
register guchar c;
register const gchar *p = in;
- while ((c = (unsigned char)*p)) {
+ while ((c = (guchar)*p)) {
if (!imap_is_atom_char(c))
return FALSE;
p++;
/**
* imap_parse_string_generic:
* @str_p: a pointer to a string
- * @len: a pointer to a size_t to return the length in
+ * @len: a pointer to a gsize to return the length in
* @type: type of string (#IMAP_STRING, #IMAP_ASTRING, or #IMAP_NSTRING)
* to parse.
*
* latter, it will point to the character after the NIL.)
**/
gchar *
-imap_parse_string_generic (const gchar **str_p, size_t *len, gint type)
+imap_parse_string_generic (const gchar **str_p, gsize *len, gint type)
{
const gchar *str = *str_p;
gchar *out;
return NULL;
else if (*str == '"') {
gchar *p;
- size_t size;
+ gsize size;
str++;
size = strcspn (str, "\"") + 1;
*str_p += 3;
*len = 0;
return NULL;
- } else if (type == IMAP_ASTRING && imap_is_atom_char ((unsigned char)*str)) {
- while (imap_is_atom_char ((unsigned char) *str))
+ } else if (type == IMAP_ASTRING && imap_is_atom_char ((guchar)*str)) {
+ while (imap_is_atom_char ((guchar) *str))
str++;
*len = str - *str_p;
else
*str_p = NULL;
} else if (*str == '{') {
- unsigned long len;
+ gulong len;
len = strtoul (str + 1, (gchar **) &str, 10);
if (*str != '}' || *(str + 1) != '\n' ||
skip_char (str_p, ')');
}
-static int
+static gint
parse_params (const gchar **parms_p, CamelContentType *type)
{
const gchar *parms = *parms_p;
gchar *name, *value;
- size_t len;
+ gsize len;
if (!g_ascii_strncasecmp (parms, "nil", 3)) {
*parms_p += 3;
CamelContentType *ctype = NULL;
gchar *description = NULL;
gchar *encoding = NULL;
- size_t len;
- size_t size;
+ gsize len;
+ gsize size;
gchar *p;
if (*inptr++ != '(')
if (size == 0)
goto exception;
- inptr = (const guchar *) p;
+ inptr = (const gchar *) p;
if (camel_content_type_is (ctype, "message", "rfc822")) {
/* body_type_msg */
/* lines */
strtoul ((const gchar *) inptr, &p, 10);
- inptr = (const guchar *) p;
+ inptr = (const gchar *) p;
} else if (camel_content_type_is (ctype, "text", "*")) {
if (!inptr || *inptr++ != ' ')
goto exception;
/* lines */
strtoul ((const gchar *) inptr, &p, 10);
- inptr = (const guchar *) p;
+ inptr = (const gchar *) p;
} else {
/* body_type_basic */
}
}
-static inline unsigned long
+static inline gulong
get_summary_uid_numeric (CamelFolderSummary *summary, gint index)
{
- unsigned long uid;
+ gulong uid;
gchar *suid;
suid = camel_folder_summary_uid_from_index (summary, index);
* Return value: the set, which the caller must free with g_free()
**/
gchar *
-imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, gint uid, ssize_t maxlen, gint *lastuid)
+imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, gint uid, gssize maxlen, gint *lastuid)
{
- unsigned long last_uid, next_summary_uid, this_uid;
+ gulong last_uid, next_summary_uid, this_uid;
gboolean range = FALSE;
gint si, scount;
GString *gset;
/* Find the next UID in the summary after the one we
* just wrote out.
*/
- for ( ; last_uid >= next_summary_uid && si < scount; si++)
+ for (; last_uid >= next_summary_uid && si < scount; si++)
next_summary_uid = get_summary_uid_numeric (summary, si);
if (last_uid >= next_summary_uid)
- next_summary_uid = (unsigned long) -1;
+ next_summary_uid = (gulong) -1;
/* Now get the next UID from @uids */
this_uid = strtoul (uids->pdata[uid], NULL, 10);
{
GPtrArray *arr;
gchar *p, *q;
- unsigned long uid, suid;
+ gulong uid, suid;
gint si, scount;
arr = g_ptr_array_new ();
gchar *
imap_concat (CamelImapStore *imap_store, const gchar *prefix, const gchar *suffix)
{
- size_t len;
+ gsize len;
len = strlen (prefix);
if (len == 0 || prefix[len - 1] == imap_store->dir_sep)
}
gchar *
-imap_mailbox_encode (const guchar *in, size_t inlen)
+imap_mailbox_encode (const guchar *in, gsize inlen)
{
gchar *buf;
}
gchar *
-imap_mailbox_decode (const guchar *in, size_t inlen)
+imap_mailbox_decode (const guchar *in, gsize inlen)
{
gchar *buf;
enum { IMAP_STRING, IMAP_NSTRING, IMAP_ASTRING };
-gchar *imap_parse_string_generic (const gchar **str_p, size_t *len, gint type);
+gchar *imap_parse_string_generic (const gchar **str_p, gsize *len, gint type);
#define imap_parse_string(str_p, len_p) \
imap_parse_string_generic (str_p, len_p, IMAP_STRING)
void imap_skip_list (const gchar **str_p);
-gchar *imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, gint uid, ssize_t maxlen, gint *lastuid);
+gchar *imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, gint uid, gssize maxlen, gint *lastuid);
GPtrArray *imap_uid_set_to_array (CamelFolderSummary *summary, const gchar *uids);
void imap_uid_array_free (GPtrArray *arr);
gchar *imap_concat (CamelImapStore *imap_store, const gchar *prefix, const gchar *suffix);
gchar *imap_namespace_concat (CamelImapStore *store, const gchar *name);
-gchar *imap_mailbox_encode (const guchar *in, size_t inlen);
-gchar *imap_mailbox_decode (const guchar *in, size_t inlen);
+gchar *imap_mailbox_encode (const guchar *in, gsize inlen);
+gchar *imap_mailbox_decode (const guchar *in, gsize inlen);
typedef gboolean (*IMAPPathFindFoldersCallback) (const gchar *physical_path, const gchar *path, gpointer user_data);
/* Returns the class for a CamelDataWrapper */
#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static ssize_t write_to_stream (CamelDataWrapper *imap_wrapper, CamelStream *stream);
+static gssize write_to_stream (CamelDataWrapper *imap_wrapper, CamelStream *stream);
static void
camel_imap_wrapper_class_init (CamelImapWrapperClass *camel_imap_wrapper_class)
}
-static ssize_t
+static gssize
write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
CamelImapWrapper *imap_wrapper = CAMEL_IMAP_WRAPPER (data_wrapper);
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/camel \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
-I$(top_srcdir) \
$(CAMEL_CFLAGS) \
$(GNOME_INCLUDEDIR) \
IMAP4_STRING_LITERAL,
};
-static int
+static gint
imap4_string_get_type (const gchar *str)
{
gint type = 0;
}
#endif
-static size_t
+static gsize
camel_imap4_literal_length (CamelIMAP4Literal *literal)
{
CamelStream *stream, *null;
CamelMimeFilter *crlf;
- size_t len;
+ gsize len;
if (literal->type == CAMEL_IMAP4_LITERAL_STRING)
return strlen (literal->literal.string);
gchar *function, **strv;
guint u;
gchar *string;
- size_t len;
+ gsize len;
gpointer obj;
gint c, d;
break;
case 'c':
/* character */
- c = va_arg (args, int);
+ c = va_arg (args, gint);
g_string_append_c (str, c);
break;
case 'd':
/* integer */
- d = va_arg (args, int);
+ d = va_arg (args, gint);
g_string_append_printf (str, "%d", d);
break;
case 'u':
/* unsigned integer */
- u = va_arg (args, unsigned int);
+ u = va_arg (args, guint);
g_string_append_printf (str, "%u", u);
break;
case 'F':
}
-static int
+static gint
imap4_literal_write_to_stream (CamelIMAP4Literal *literal, CamelStream *stream)
{
CamelStream *istream, *ostream = NULL;
fprintf (stderr, "{%u}", token->v.literal);
break;
default:
- fprintf (stderr, "%c", (unsigned char) (token->token & 0xff));
+ fprintf (stderr, "%c", (guchar) (token->token & 0xff));
break;
}
}
CamelIMAP4Literal *literal;
camel_imap4_token_t token;
guchar *linebuf;
- size_t len;
+ gsize len;
g_assert (ic->part != NULL);
typedef gint (* CamelIMAP4PlusCallback) (struct _CamelIMAP4Engine *engine,
CamelIMAP4Command *ic,
const guchar *linebuf,
- size_t linelen, CamelException *ex);
+ gsize linelen, CamelException *ex);
typedef gint (* CamelIMAP4UntaggedCallback) (struct _CamelIMAP4Engine *engine,
CamelIMAP4Command *ic,
typedef struct _CamelIMAP4CommandPart {
struct _CamelIMAP4CommandPart *next;
guchar *buffer;
- size_t buflen;
+ gsize buflen;
CamelIMAP4Literal *literal;
} CamelIMAP4CommandPart;
{ NULL, 0 }
};
-static int
+static gint
parse_xgwextensions (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index, camel_imap4_token_t *token, CamelException *ex)
{
gint i;
return TRUE;
}
-static int
+static gint
engine_parse_capability (CamelIMAP4Engine *engine, gint sentinel, CamelException *ex)
{
camel_imap4_token_t token;
return 0;
}
-static int
+static gint
engine_parse_flags_list (CamelIMAP4Engine *engine, CamelIMAP4RespCode *resp, gint perm, CamelException *ex)
{
guint32 flags = 0;
return 0;
}
-static int
+static gint
engine_parse_flags (CamelIMAP4Engine *engine, CamelException *ex)
{
camel_imap4_token_t token;
return 0;
}
-static int
+static gint
engine_parse_namespace (CamelIMAP4Engine *engine, CamelException *ex)
{
CamelIMAP4Namespace *namespaces[3], *node, *tail;
camel_imap4_resp_code_t code;
camel_imap4_token_t token;
guchar *linebuf;
- size_t len;
+ gsize len;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
return -1;
if (!strcmp ("EXISTS", token->v.atom)) {
camel_imap4_summary_set_exists (folder->summary, v);
} else if (!strcmp ("EXPUNGE", token->v.atom) || !strcmp ("XGWMOVE", token->v.atom)) {
- camel_imap4_summary_expunge (folder->summary, (int) v);
+ camel_imap4_summary_expunge (folder->summary, (gint) v);
} else if (!strcmp ("RECENT", token->v.atom)) {
camel_imap4_summary_set_recent (folder->summary, v);
} else if (ic && (untagged = g_hash_table_lookup (ic->untagged, token->v.atom))) {
}
-static int
+static gint
imap4_process_command (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
{
gint retval;
}
-static int
+static gint
engine_state_change (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
{
const gchar *cmd;
camel_imap4_token_t token;
guchar *literal;
gint retval;
- size_t n;
+ gsize n;
do {
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
* Returns: 0 on success or -1 on fail
**/
gint
-camel_imap4_engine_line (CamelIMAP4Engine *engine, guchar **line, size_t *len, CamelException *ex)
+camel_imap4_engine_line (CamelIMAP4Engine *engine, guchar **line, gsize *len, CamelException *ex)
{
GByteArray *linebuf = NULL;
guchar *buf;
- size_t buflen;
+ gsize buflen;
gint retval;
if (line != NULL)
* Returns: 0 on success or -1 on fail.
**/
gint
-camel_imap4_engine_literal (CamelIMAP4Engine *engine, guchar **literal, size_t *len, CamelException *ex)
+camel_imap4_engine_literal (CamelIMAP4Engine *engine, guchar **literal, gsize *len, CamelException *ex)
{
GByteArray *literalbuf = NULL;
guchar *buf;
- size_t buflen;
+ gsize buflen;
gint retval;
if (literal != NULL)
camel_imap4_engine_nstring (CamelIMAP4Engine *engine, guchar **nstring, CamelException *ex)
{
camel_imap4_token_t token;
- size_t n;
+ gsize n;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
return -1;
/* stream wrapper utility functions */
gint camel_imap4_engine_next_token (CamelIMAP4Engine *engine, struct _camel_imap4_token_t *token, CamelException *ex);
-gint camel_imap4_engine_line (CamelIMAP4Engine *engine, guchar **line, size_t *len, CamelException *ex);
-gint camel_imap4_engine_literal (CamelIMAP4Engine *engine, guchar **literal, size_t *len, CamelException *ex);
+gint camel_imap4_engine_line (CamelIMAP4Engine *engine, guchar **line, gsize *len, CamelException *ex);
+gint camel_imap4_engine_literal (CamelIMAP4Engine *engine, guchar **literal, gsize *len, CamelException *ex);
gint camel_imap4_engine_nstring (CamelIMAP4Engine *engine, guchar **nstring, CamelException *ex);
gint camel_imap4_engine_eat_line (CamelIMAP4Engine *engine, CamelException *ex);
return camel_data_cache_get_filename (imap4_folder->cache, "cache", uid, ex);
}
-static int
+static gint
imap4_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelIMAP4Folder *folder = (CamelIMAP4Folder *) object;
return 0;
}
-static int
+static gint
imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
CamelIMAP4Folder *folder = (CamelIMAP4Folder *) object;
};
-static int
+static gint
imap4_sync_flag (CamelFolder *folder, GPtrArray *infos, gchar onoff, const gchar *flag, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) folder->parent_store)->engine;
return 0;
}
-static int
+static gint
imap4_sync_changes (CamelFolder *folder, GPtrArray *sync, CamelException *ex)
{
CamelIMAP4MessageInfo *iinfo;
CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
}
-static int
+static gint
untagged_fetch (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index, camel_imap4_token_t *token, CamelException *ex)
{
CamelFolderSummary *summary = ((CamelFolder *) engine->folder)->summary;
}
-static int
+static gint
info_uid_sort (const CamelMessageInfo **info0, const CamelMessageInfo **info1)
{
guint32 uid0, uid1;
return NULL;
}
-static int
+static gint
imap4_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out)
{
CamelIMAP4JournalEntry *imap4_entry = (CamelIMAP4JournalEntry *) entry;
dest->size = src->size;
}
-static int
+static gint
imap4_entry_play_append (CamelOfflineJournal *journal, CamelIMAP4JournalEntry *entry, CamelException *ex)
{
CamelIMAP4Folder *imap4_folder = (CamelIMAP4Folder *) journal->folder;
return 0;
}
-static int
+static gint
imap4_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex)
{
CamelIMAP4JournalEntry *imap4_entry = (CamelIMAP4JournalEntry *) entry;
return hash;
}
-static int
+static gint
check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL) {
return strcmp (s1, s2) == 0;
}
-static int
+static gint
imap4_url_equal (gconstpointer a, gconstpointer b)
{
const CamelURL *u1 = a, *u2 = b;
}
-static int
+static gint
untagged_search (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index, camel_imap4_token_t *token, CamelException *ex)
{
CamelFolderSummary *summary = ((CamelFolder *) engine->folder)->summary;
const gchar *expr;
ESExpResult *r;
gint id, i, n;
- size_t used;
+ gsize used;
gchar *set;
if (((CamelOfflineStore *) engine->service)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
if (!utf8_search) {
inptr = (guchar *) argv[i]->value.string;
while (*inptr != '\0') {
- if (!isascii ((int) *inptr)) {
+ if (!isascii ((gint) *inptr)) {
utf8_search = TRUE;
break;
}
extern guchar camel_imap4_specials[256];
-#define is_atom(x) ((camel_imap4_specials[(unsigned char)(x)] & (IS_ASPECIAL|IS_SPACE|IS_CTRL|IS_WILDCARD|IS_QSPECIAL)) == 0)
-#define is_ctrl(x) ((camel_imap4_specials[(unsigned char)(x)] & IS_CTRL) != 0)
-#define is_lwsp(x) ((camel_imap4_specials[(unsigned char)(x)] & IS_LWSP) != 0)
-#define is_type(x, t) ((camel_imap4_specials[(unsigned char)(x)] & (t)) != 0)
-#define is_qsafe(x) ((camel_imap4_specials[(unsigned char)(x)] & (IS_QSPECIAL|IS_CTRL)) == 0)
-#define is_wild(x) ((camel_imap4_specials[(unsigned char)(x)] & IS_WILDCARD) != 0)
+#define is_atom(x) ((camel_imap4_specials[(guchar)(x)] & (IS_ASPECIAL|IS_SPACE|IS_CTRL|IS_WILDCARD|IS_QSPECIAL)) == 0)
+#define is_ctrl(x) ((camel_imap4_specials[(guchar)(x)] & IS_CTRL) != 0)
+#define is_lwsp(x) ((camel_imap4_specials[(guchar)(x)] & IS_LWSP) != 0)
+#define is_type(x, t) ((camel_imap4_specials[(guchar)(x)] & (t)) != 0)
+#define is_qsafe(x) ((camel_imap4_specials[(guchar)(x)] & (IS_QSPECIAL|IS_CTRL)) == 0)
+#define is_wild(x) ((camel_imap4_specials[(guchar)(x)] & IS_WILDCARD) != 0)
void camel_imap4_specials_init (void);
return NULL;
}
-static int
+static gint
summary_header_load (CamelStoreSummary *s, FILE *in)
{
CamelIMAP4StoreSummary *is = (CamelIMAP4StoreSummary *) s;
return 0;
}
-static int
+static gint
save_namespaces (FILE *out, CamelIMAP4NamespaceList *nsl)
{
CamelIMAP4Namespace *ns, *cur = NULL;
return 0;
}
-static int
+static gint
summary_header_save (CamelStoreSummary *s, FILE *out)
{
CamelIMAP4StoreSummary *is = (CamelIMAP4StoreSummary *) s;
return parent_class->store_info_load (s, in);
}
-static int
+static gint
store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *info)
{
return parent_class->store_info_save (s, out, info);
CamelFolderInfo *fi;
GPtrArray *folders;
CamelStoreInfo *si;
- size_t toplen, len;
+ gsize toplen, len;
gint i;
toplen = strlen (top);
return g_str_hash (key);
}
-static int
+static gint
imap4_compare_folder_name (gconstpointer a, gconstpointer b)
{
gconstpointer aname = a, bname = b;
return ret;
}
-static int
-sasl_auth (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, const guchar *linebuf, size_t linelen, CamelException *ex)
+static gint
+sasl_auth (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, const guchar *linebuf, gsize linelen, CamelException *ex)
{
/* Perform a single challenge iteration */
CamelSasl *sasl = ic->user_data;
return 0;
}
-static int
+static gint
imap4_try_authenticate (CamelIMAP4Engine *engine, gboolean reprompt, const gchar *errmsg, CamelException *ex)
{
CamelService *service = engine->service;
CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
}
-static int
+static gint
list_sort (const camel_imap4_list_t **list0, const camel_imap4_list_t **list1)
{
return strcmp ((*list0)->name, (*list1)->name);
}
if (*top != '\0') {
- size_t len;
+ gsize len;
gchar sep;
len = strlen (pattern);
static void camel_imap4_stream_init (CamelIMAP4Stream *stream, CamelIMAP4StreamClass *klass);
static void camel_imap4_stream_finalize (CamelObject *object);
-static ssize_t stream_read (CamelStream *stream, gchar *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const gchar *buffer, size_t n);
+static gssize stream_read (CamelStream *stream, gchar *buffer, gsize n);
+static gssize stream_write (CamelStream *stream, const gchar *buffer, gsize n);
static gint stream_flush (CamelStream *stream);
static gint stream_close (CamelStream *stream);
static gboolean stream_eos (CamelStream *stream);
}
-static ssize_t
+static gssize
imap4_fill (CamelIMAP4Stream *imap4)
{
guchar *inbuf, *inptr, *inend;
- ssize_t nread;
- size_t inlen;
+ gssize nread;
+ gsize inlen;
if (imap4->disconnected) {
errno = EINVAL;
inptr = inbuf;
inbuf += inlen;
} else if (inptr > imap4->realbuf) {
- size_t shift;
+ gsize shift;
shift = MIN (inptr - imap4->realbuf, inend - inbuf);
memmove (inptr - shift, inptr, inlen);
return imap4->inend - imap4->inptr;
}
-static ssize_t
-stream_read (CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read (CamelStream *stream, gchar *buffer, gsize n)
{
CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
- ssize_t len, nread = 0;
+ gssize len, nread = 0;
if (imap4->mode == CAMEL_IMAP4_STREAM_MODE_LITERAL) {
/* don't let our caller read past the end of the literal */
return nread;
}
-static ssize_t
-stream_write (CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write (CamelStream *stream, const gchar *buffer, gsize n)
{
CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
- ssize_t nwritten;
+ gssize nwritten;
if (imap4->disconnected) {
errno = EINVAL;
return nwritten;
}
-static int
+static gint
stream_flush (CamelStream *stream)
{
CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
return camel_stream_flush (imap4->stream);
}
-static int
+static gint
stream_close (CamelStream *stream)
{
CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
register guchar *inptr;
guchar *inend, *start, *p;
gboolean escaped = FALSE;
- size_t literal = 0;
+ gsize literal = 0;
guint32 nz_number;
gint ret;
if ((p = strchr (inptr, '}')) && strchr (p, '\n')) {
inptr++;
- while (isdigit ((int) *inptr) && literal < UINT_MAX / 10)
+ while (isdigit ((gint) *inptr) && literal < UINT_MAX / 10)
literal = (literal * 10) + (*inptr++ - '0');
if (*inptr != '}') {
- if (isdigit ((int) *inptr))
+ if (isdigit ((gint) *inptr))
g_warning ("illegal literal identifier: literal too large");
else if (*inptr != '+')
g_warning ("illegal literal identifier: garbage following size");
* read is incomplete.
**/
gint
-camel_imap4_stream_line (CamelIMAP4Stream *stream, guchar **line, size_t *len)
+camel_imap4_stream_line (CamelIMAP4Stream *stream, guchar **line, gsize *len)
{
register guchar *inptr;
guchar *inend;
* has been reached or -1 on fail.
**/
gint
-camel_imap4_stream_literal (CamelIMAP4Stream *stream, guchar **literal, size_t *len)
+camel_imap4_stream_literal (CamelIMAP4Stream *stream, guchar **literal, gsize *len)
{
guchar *inptr, *inend;
- size_t nread;
+ gsize nread;
g_return_val_if_fail (CAMEL_IS_IMAP4_STREAM (stream), -1);
g_return_val_if_fail (stream->mode == CAMEL_IMAP4_STREAM_MODE_LITERAL, -1);
gchar *atom;
gchar *flag;
gchar *qstring;
- size_t literal;
+ gsize literal;
guint32 number;
} v;
} camel_imap4_token_t;
guint mode:1; /* TOKEN vs LITERAL */
guint eol:1; /* end-of-literal */
- size_t literal;
+ gsize literal;
/* i/o buffers */
guchar realbuf[IMAP4_READ_PRELEN + IMAP4_READ_BUFLEN + 1];
gint camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *token);
gint camel_imap4_stream_unget_token (CamelIMAP4Stream *stream, camel_imap4_token_t *token);
-gint camel_imap4_stream_line (CamelIMAP4Stream *stream, guchar **line, size_t *len);
-gint camel_imap4_stream_literal (CamelIMAP4Stream *stream, guchar **literal, size_t *len);
+gint camel_imap4_stream_line (CamelIMAP4Stream *stream, guchar **line, gsize *len);
+gint camel_imap4_stream_literal (CamelIMAP4Stream *stream, guchar **literal, gsize *len);
G_END_DECLS
return summary;
}
-static int
+static gint
imap4_header_load (CamelFolderSummary *summary, FILE *fin)
{
CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
return 0;
}
-static int
+static gint
imap4_header_save (CamelFolderSummary *summary, FILE *fout)
{
CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
return 0;
}
-static int
+static gint
envelope_decode_address (CamelIMAP4Engine *engine, GString *addrs, CamelException *ex)
{
gchar *addr, *name = NULL, *user = NULL;
camel_imap4_token_t token;
const gchar *domain = NULL;
gint part = 0;
- size_t n;
+ gsize n;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
return -1;
return -1;
}
-static int
+static gint
envelope_decode_addresses (CamelIMAP4Engine *engine, gchar **addrlist, CamelException *ex)
{
camel_imap4_token_t token;
return 0;
}
-static int
+static gint
envelope_decode_date (CamelIMAP4Engine *engine, time_t *date, CamelException *ex)
{
guchar *literal = NULL;
camel_imap4_token_t token;
const gchar *nstring;
- size_t n;
+ gsize n;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
return -1;
return 0;
}
-static int
+static gint
envelope_decode_nstring (CamelIMAP4Engine *engine, gchar **nstring, gboolean rfc2047, CamelException *ex)
{
camel_imap4_token_t token;
guchar *literal;
- size_t n;
+ gsize n;
if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
return -1;
return references;
}
-static int
+static gint
decode_envelope (CamelIMAP4Engine *engine, CamelMessageInfo *info, camel_imap4_token_t *token, CamelException *ex)
{
CamelIMAP4MessageInfo *iinfo = (CamelIMAP4MessageInfo *) info;
*hour = *min = *sec = 0;
val = hour;
- for ( ; *inptr && !isspace ((int) *inptr); inptr++) {
+ for (; *inptr && !isspace ((gint) *inptr); inptr++) {
if (*inptr == ':') {
colons++;
switch (colons) {
default:
return FALSE;
}
- } else if (!isdigit ((int) *inptr))
+ } else if (!isdigit ((gint) *inptr))
return FALSE;
else
*val = (*val * 10) + (*inptr - '0');
g_free (fetch);
}
-static int
+static gint
untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index, camel_imap4_token_t *token, CamelException *ex)
{
struct imap4_fetch_all_t *fetch = ic->user_data;
* client expunged messages in the range
* before fetch->first in the period between
* our previous attempt and now. */
- size_t movelen = added->len * sizeof (gpointer);
- size_t extra = index - fetch->first;
+ gsize movelen = added->len * sizeof (gpointer);
+ gsize extra = index - fetch->first;
gpointer dest;
g_assert (fetch->all);
fetch->total += extra;
fetch->first = index;
} else if (index > (added->len + (fetch->first - 1))) {
- size_t extra = index - (added->len + (fetch->first - 1));
+ gsize extra = index - (added->len + (fetch->first - 1));
g_ptr_array_set_size (added, added->len + extra);
fetch->total += extra;
}
guchar *literal;
const gchar *refs, *str;
gchar *mlist;
- size_t n;
+ gsize n;
/* '(' */
if (camel_imap4_engine_next_token (engine, token, ex) == -1)
return NULL;
}
-static int
+static gint
imap4_message_info_save (CamelFolderSummary *summary, FILE *fout, CamelMessageInfo *info)
{
CamelIMAP4MessageInfo *minfo = (CamelIMAP4MessageInfo *) info;
return camel_folder_summary_content_info_new (summary);
}
-static int
+static gint
imap4_content_info_save (CamelFolderSummary *summary, FILE *out, CamelMessageContentInfo *info)
{
if (info->type) {
}
#if 0
-static int
+static gint
info_uid_sort (const CamelMessageInfo **info0, const CamelMessageInfo **info1)
{
guint32 uid0, uid1;
{
CamelFolderInfo *cur, *fi, *root = NULL;
const gchar *p;
- size_t n = 0;
+ gsize n = 0;
gchar *pname;
gint i;
}
-char
+gchar
camel_imap4_get_path_delim (CamelIMAP4StoreSummary *s, const gchar *full_name)
{
CamelIMAP4Namespace *namespace;
const gchar *slash;
- size_t len;
+ gsize len;
gchar *top;
g_return_val_if_fail (s->namespaces != NULL, '/');
CamelFolderSummary *summary;
struct _uidset_range *ranges;
struct _uidset_range *tail;
- size_t maxlen, setlen;
+ gsize maxlen, setlen;
};
static void
}
static void
-uidset_init (struct _uidset *uidset, CamelFolderSummary *summary, size_t maxlen)
+uidset_init (struct _uidset *uidset, CamelFolderSummary *summary, gsize maxlen)
{
uidset->ranges = g_new (struct _uidset_range, 1);
uidset->ranges->first = (guint32) -1;
}
/* returns: -1 on full-and-not-added, 0 on added-and-not-full or 1 on added-and-full */
-static int
+static gint
uidset_add (struct _uidset *uidset, CamelMessageInfo *info)
{
GPtrArray *messages = uidset->summary->messages;
struct _uidset_range *node, *tail = uidset->tail;
const gchar *iuid = camel_message_info_uid (info);
- size_t uidlen, len;
+ gsize uidlen, len;
const gchar *colon;
guint32 index;
}
gint
-camel_imap4_get_uid_set (CamelIMAP4Engine *engine, CamelFolderSummary *summary, GPtrArray *infos, gint cur, size_t linelen, gchar **set)
+camel_imap4_get_uid_set (CamelIMAP4Engine *engine, CamelFolderSummary *summary, GPtrArray *infos, gint cur, gsize linelen, gchar **set)
{
struct _uidset uidset;
- size_t maxlen;
+ gsize maxlen;
gint rv = 0;
gint i;
g_string_append (errmsg, _("No data"));
break;
default:
- g_string_append_c (errmsg, (unsigned char) (token->token & 0xff));
+ g_string_append_c (errmsg, (guchar) (token->token & 0xff));
break;
}
guint32 flags = 0;
GString *literal;
gchar delim;
- size_t n;
+ gsize n;
gint i;
if (camel_imap4_engine_next_token (engine, token, ex) == -1)
camel_imap4_status_t *status;
guchar *literal;
gchar *mailbox;
- size_t len;
+ gsize len;
gint type;
gint i;
default:
fprintf (stderr, "Unexpected token in IMAP4 untagged STATUS response: %s%c\n",
token->token == CAMEL_IMAP4_TOKEN_NIL ? "NIL" : "",
- (unsigned char) (token->token & 0xff));
+ (guchar) (token->token & 0xff));
camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
return -1;
}
gchar camel_imap4_get_path_delim (struct _CamelIMAP4StoreSummary *s, const gchar *full_name);
-gint camel_imap4_get_uid_set (struct _CamelIMAP4Engine *engine, struct _CamelFolderSummary *summary, GPtrArray *infos, gint cur, size_t linelen, gchar **set);
+gint camel_imap4_get_uid_set (struct _CamelIMAP4Engine *engine, struct _CamelFolderSummary *summary, GPtrArray *infos, gint cur, gsize linelen, gchar **set);
void camel_imap4_utils_set_unexpected_token_error (CamelException *ex, struct _CamelIMAP4Engine *engine, struct _camel_imap4_token_t *token);
INCLUDES = -I.. \
-I$(srcdir)/.. \
-I$(top_srcdir)/camel \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
-I$(top_srcdir) \
$(CAMEL_CFLAGS) \
$(GNOME_INCLUDEDIR) \
return res;
}
-static int
+static gint
driver_resp_list(CamelIMAPPEngine *ie, guint32 idx, CamelIMAPPDriver *id)
{
struct _list_info *linfo;
}
}
-static int
+static gint
driver_resp_exists(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata)
{
/* should this be an event instead? */
return camel_imapp_engine_skip(ie);
}
-static int
+static gint
driver_resp_expunge(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata)
{
printf("got expunge response %u\n", id);
return camel_imapp_engine_skip(ie);
}
-static int
+static gint
driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata)
{
struct _fetch_info *finfo = NULL;
*p++ = toupper(c);
case IMAP_TOK_INT:
printf(" cap: '%s'\n", token);
- for (i=0;i<(int)(sizeof(capa_table)/sizeof(capa_table[0]));i++)
+ for (i=0;i<(gint)(sizeof(capa_table)/sizeof(capa_table[0]));i++)
if (strcmp(token, capa_table[i].name))
ie->capa |= capa_table[i].flag;
break;
if (tok == IMAP_TOK_LITERAL) {
camel_imapp_stream_set_literal(imap->stream, len);
while ((tok = camel_imapp_stream_getl(imap->stream, &token, &len)) > 0) {
- printf("Skip literal data '%.*s'\n", (int)len, token);
+ printf("Skip literal data '%.*s'\n", (gint)len, token);
}
}
} while (tok != '\n' && tok >= 0);
}
/* handle any untagged responses */
-static int
+static gint
iterate_untagged(CamelIMAPPEngine *imap)
{
guint id, len;
/* handle any continuation requests
either data continuations, or auth continuation */
-static int
+static gint
iterate_continuation(CamelIMAPPEngine *imap)
{
CamelIMAPPCommand *ic;
}
/* handle a completion line */
-static int
+static gint
iterate_completion(CamelIMAPPEngine *imap, guchar *token)
{
CamelIMAPPCommand *ic;
static void
imap_engine_command_complete(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic)
{
- c(printf("completing command buffer is [%d] '%.*s'\n", ic->mem->buffer->len, (int)ic->mem->buffer->len, ic->mem->buffer->data));
+ c(printf("completing command buffer is [%d] '%.*s'\n", ic->mem->buffer->len, (gint)ic->mem->buffer->len, ic->mem->buffer->data));
c(printf("command has %d parts\n", len(&ic->parts)));
if (ic->mem->buffer->len > 0)
imap_engine_command_add_part(imap, ic, CAMEL_IMAPP_COMMAND_SIMPLE, NULL);
gint zero;
gchar *s;
gint d;
- long gint l;
+ glong gint l;
guint32 f;
CamelStream *S;
CamelDataWrapper *D;
imap_write_flags((CamelStream *)ic->mem, f);
break;
case 'c':
- d = va_arg(ap, int);
+ d = va_arg(ap, gint);
ch = d;
camel_stream_write((CamelStream *)ic->mem, &ch, 1);
break;
case 'd': /* int/unsigned */
case 'u':
if (llong) {
- l = va_arg(ap, long int);
- c(printf("got long gint '%d'\n", (int)l));
+ l = va_arg(ap, glong gint);
+ c(printf("got glong gint '%d'\n", (gint)l));
memcpy(buffer, start, p-start);
buffer[p-start] = 0;
camel_stream_printf((CamelStream *)ic->mem, buffer, l);
} else {
- d = va_arg(ap, int);
+ d = va_arg(ap, gint);
c(printf("got gint '%d'\n", d));
memcpy(buffer, start, p-start);
buffer[p-start] = 0;
CamelIMAPPEngine *camel_imapp_engine_new(CamelIMAPPStream *stream);
void camel_imapp_engine_add_handler(CamelIMAPPEngine *imap, const gchar *response, CamelIMAPPEngineFunc func, gpointer data);
-int camel_imapp_engine_iterate(CamelIMAPPEngine *imap, CamelIMAPPCommand *wait); /* throws PARSE,IO exception */
-int camel_imapp_engine_skip(CamelIMAPPEngine *imap);
-int camel_imapp_engine_capabilities(CamelIMAPPEngine *imap);
+gint camel_imapp_engine_iterate(CamelIMAPPEngine *imap, CamelIMAPPCommand *wait); /* throws PARSE,IO exception */
+gint camel_imapp_engine_skip(CamelIMAPPEngine *imap);
+gint camel_imapp_engine_capabilities(CamelIMAPPEngine *imap);
CamelIMAPPCommand *camel_imapp_engine_command_new (CamelIMAPPEngine *imap, const gchar *name, const gchar *select, const gchar *fmt, ...);
void camel_imapp_engine_command_complete(CamelIMAPPEngine *imap, struct _CamelIMAPPCommand *, CamelIMAPPCommandFunc func, gpointer data);
/* Returns the class for a CamelStream */
#define CS_CLASS(so) CAMEL_IMAPP_FETCH_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-static ssize_t
-stream_read(CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read(CamelStream *stream, gchar *buffer, gsize n)
{
CamelIMAPPFetchStream *is = (CamelIMAPPFetchStream *)stream;
- ssize_t max;
+ gssize max;
/* make sure we have all the data read in */
while (camel_imapp_engine_iterate(is->engine, is->command)>0)
return max;
}
-static ssize_t
-stream_write(CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write(CamelStream *stream, const gchar *buffer, gsize n)
{
CamelIMAPPFetchStream *is = (CamelIMAPPFetchStream *)stream;
return camel_stream_write(is->source, buffer, n);
}
-static int
+static gint
stream_close(CamelStream *stream)
{
/* nop? */
return 0;
}
-static int
+static gint
stream_flush(CamelStream *stream)
{
/* nop? */
return is->literal == 0;
}
-static int
+static gint
stream_reset(CamelStream *stream)
{
/* nop? reset literal mode? */
/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const gchar *);*/
static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
-static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
+static gint store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
+static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, gint);
static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
static void camel_imapp_store_summary_class_init (CamelIMAPPStoreSummaryClass *klass);
return ns;
}
-static int
+static gint
namespace_save(CamelStoreSummary *s, FILE *in, CamelIMAPPStoreNamespace *ns)
{
if (camel_file_util_encode_string(in, ns->path) == -1
return 0;
}
-static int
+static gint
summary_header_load(CamelStoreSummary *s, FILE *in)
{
CamelIMAPPStoreSummary *is = (CamelIMAPPStoreSummary *)s;
return 0;
}
-static int
+static gint
summary_header_save(CamelStoreSummary *s, FILE *out)
{
CamelIMAPPStoreSummary *is = (CamelIMAPPStoreSummary *)s;
return (CamelStoreInfo *)mi;
}
-static int
+static gint
store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
{
CamelIMAPPStoreInfo *isi = (CamelIMAPPStoreInfo *)mi;
if (pfi)
plen = strlen(pname);
- for(;(*ip)<(int)folders->len;) {
+ for(;(*ip)<(gint)folders->len;) {
CamelFolderInfo *fi;
struct _list_info *li;
camel_imapp_engine_command_free(istore->driver->engine, ic);
printf("got folder list:\n");
- for (i=0;i<(int)istore->pending_list->len;i++) {
+ for (i=0;i<(gint)istore->pending_list->len;i++) {
struct _list_info *linfo = istore->pending_list->pdata[i];
printf("%s (%c)\n", linfo->name, linfo->separator);
#define CAMEL_IMAPP_STREAM_SIZE (4096)
#define CAMEL_IMAPP_STREAM_TOKEN (4096) /* maximum token size */
-static int
+static gint
stream_fill(CamelIMAPPStream *is)
{
gint left = 0;
return -1;
}
-static ssize_t
-stream_read(CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read(CamelStream *stream, gchar *buffer, gsize n)
{
CamelIMAPPStream *is = (CamelIMAPPStream *)stream;
- ssize_t max;
+ gssize max;
if (is->literal == 0 || n == 0)
return 0;
return max;
}
-static ssize_t
-stream_write(CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write(CamelStream *stream, const gchar *buffer, gsize n)
{
CamelIMAPPStream *is = (CamelIMAPPStream *)stream;
return camel_stream_write(is->source, buffer, n);
}
-static int
+static gint
stream_close(CamelStream *stream)
{
/* nop? */
return 0;
}
-static int
+static gint
stream_flush(CamelStream *stream)
{
/* nop? */
return is->literal == 0;
}
-static int
+static gint
stream_reset(CamelStream *stream)
{
/* nop? reset literal mode? */
gint i;
guchar *p, c;
- for (i=0;i<(int)(sizeof(is_masks)/sizeof(is_masks[0]));i++) {
+ for (i=0;i<(gint)(sizeof(is_masks)/sizeof(is_masks[0]));i++) {
p = is_masks[i].chars;
while ((c = *p++))
imap_specials[c] |= is_masks[i].mask;
#if 0
-static int
+static gint
skip_ws(CamelIMAPPStream *is, guchar *pp, guchar *pe)
{
register guchar c, *p;
void camel_imapp_stream_ungettoken (CamelIMAPPStream *is, camel_imapp_token_t tok, guchar *token, guint len);
void camel_imapp_stream_set_literal (CamelIMAPPStream *is, guint literal);
-int camel_imapp_stream_gets (CamelIMAPPStream *is, guchar **start, guint *len);
-int camel_imapp_stream_getl (CamelIMAPPStream *is, guchar **start, guint *len);
+gint camel_imapp_stream_gets (CamelIMAPPStream *is, guchar **start, guint *len);
+gint camel_imapp_stream_getl (CamelIMAPPStream *is, guchar **start, guint *len);
/* all throw IO,PARSE exceptions */
/* gets an atom, upper-cases */
-int camel_imapp_stream_atom (CamelIMAPPStream *is, guchar **start, guint *len);
+gint camel_imapp_stream_atom (CamelIMAPPStream *is, guchar **start, guint *len);
/* gets an atom or string */
-int camel_imapp_stream_astring (CamelIMAPPStream *is, guchar **start);
+gint camel_imapp_stream_astring (CamelIMAPPStream *is, guchar **start);
/* gets a NIL or a string, start==NULL if NIL */
-int camel_imapp_stream_nstring (CamelIMAPPStream *is, guchar **start);
+gint camel_imapp_stream_nstring (CamelIMAPPStream *is, guchar **start);
/* gets a NIL or string into a stream, stream==NULL if NIL */
-int camel_imapp_stream_nstring_stream(CamelIMAPPStream *is, CamelStream **stream);
+gint camel_imapp_stream_nstring_stream(CamelIMAPPStream *is, CamelStream **stream);
/* gets 'text' */
-int camel_imapp_stream_text (CamelIMAPPStream *is, guchar **text);
+gint camel_imapp_stream_text (CamelIMAPPStream *is, guchar **text);
/* gets a 'number' */
guint32 camel_imapp_stream_number(CamelIMAPPStream *is);
}
-static int
+static gint
summary_header_load(CamelFolderSummary *s, FILE *in)
{
CamelIMAPPSummary *ims = CAMEL_IMAPP_SUMMARY(s);
return 0;
}
-static int
+static gint
summary_header_save(CamelFolderSummary *s, FILE *out)
{
CamelIMAPPSummary *ims = CAMEL_IMAPP_SUMMARY(s);
return NULL;
}
-static int
+static gint
message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
{
CamelIMAPPMessageInfo *iinfo =(CamelIMAPPMessageInfo *)info;
#ifdef __GNUC__
__inline
#endif
-static unsigned int
+static guint
imap_hash (register const gchar *str, register guint len)
{
static guchar asso_values[] =
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39
};
- return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
+ return len + asso_values[(guchar)str[len - 1]] + asso_values[(guchar)str[0]];
}
#ifdef __GNUC__
p = token;
while ((c=*p))
*p++ = toupper(c);
- for (i=0;i<(int)(sizeof(flag_table)/sizeof(flag_table[0]));i++)
+ for (i=0;i<(gint)(sizeof(flag_table)/sizeof(flag_table[0]));i++)
if (!strcmp(token, flag_table[i].name))
flags |= flag_table[i].flag;
} else if (tok != ')') {
if (camel_stream_write(stream, "(", 1) == -1)
camel_exception_throw(1, "io error: %s", g_strerror(errno));
- for (i=0;flags!=0 && i<(int)(sizeof(flag_table)/sizeof(flag_table[0]));i++) {
+ for (i=0;flags!=0 && i<(gint)(sizeof(flag_table)/sizeof(flag_table[0]));i++) {
if (flag_table[i].flag & flags) {
if (camel_stream_write(stream, flag_table[i].name, strlen(flag_table[i].name)) == -1)
camel_exception_throw(1, "io error: %s", g_strerror(errno));
/* we have a literal string */
camel_imapp_stream_set_literal(is, len);
while ((tok = camel_imapp_stream_getl(is, &token, &len)) > 0) {
- d(printf("Skip literal data '%.*s'\n", (int)len, token));
+ d(printf("Skip literal data '%.*s'\n", (gint)len, token));
}
break;
camel_content_info_dump(finfo->cinfo, 0);
}
if (finfo->got & FETCH_SIZE)
- camel_stream_printf(sout, "Size: %d\n", (int)finfo->size);
+ camel_stream_printf(sout, "Size: %d\n", (gint)finfo->size);
if (finfo->got & FETCH_BODY)
- camel_stream_printf(sout, "Offset: %d\n", (int)finfo->offset);
+ camel_stream_printf(sout, "Offset: %d\n", (gint)finfo->offset);
if (finfo->got & FETCH_FLAGS)
- camel_stream_printf(sout, "Flags: %08x\n", (int)finfo->flags);
+ camel_stream_printf(sout, "Flags: %08x\n", (gint)finfo->flags);
if (finfo->date)
camel_stream_printf(sout, "Date: '%s'\n", finfo->date);
if (finfo->section)
p = token;
while ((c=*p))
*p++ = toupper(c);
- for (i=0;i<(int)(sizeof(list_flag_table)/sizeof(list_flag_table[0]));i++)
+ for (i=0;i<(gint)(sizeof(list_flag_table)/sizeof(list_flag_table[0]));i++)
if (!strcmp(token, list_flag_table[i].name))
linfo->flags |= list_flag_table[i].flag;
} else {
INCLUDES = \
-I$(top_srcdir)/camel \
- -I$(top_srcdir)/intl \
-I$(top_srcdir) \
$(CAMEL_CFLAGS) \
-DG_LOG_DOMAIN=\"camel-local-provider\"
return 0;
}
-static int
+static gint
local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
switch (tag & CAMEL_ARG_TAG) {
case CAMEL_OBJECT_ARG_DESCRIPTION:
if (folder->description == NULL) {
- gchar *tmp, *path;
+ const gchar *tmp;
+ gchar *path;
/* check some common prefixes to shorten the name */
tmp = ((CamelService *)folder->parent_store)->url->path;
return ((CamelObjectClass *)parent_class)->getv(object, ex, args);
}
-static int
+static gint
local_setv(CamelObject *object, CamelException *ex, CamelArgV *args)
{
gint i;
return ((CamelObjectClass *)parent_class)->setv(object, ex, args);
}
-static int
+static gint
local_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
{
return 0;
return hash;
}
-static int
+static gint
check_equal (gchar *s1, gchar *s2)
{
if (s1 == NULL || *s1 == 0) {
return strcmp (s1, s2) == 0;
}
-static int
+static gint
local_url_equal(gconstpointer v, gconstpointer v2)
{
const CamelURL *u1 = v, *u2 = v2;
camel_object_ref((CamelObject *)index);
}
-static int
+static gint
local_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex)
{
d(g_print ("\nlocal_summary_load called \n"));
return outlen;
}
-static int
+static gint
local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
/* FIXME: sync index here ? */
return 0;
}
-static int
+static gint
local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
gint ret = 0;
return ret;
}
-static int
+static gint
local_summary_need_index(void) {
return 1;
}
return ret;
}
-static int
+static gint
local_summary_decode_x_evolution(CamelLocalSummary *cls, const gchar *xev, CamelLocalMessageInfo *mi)
{
struct _camel_header_param *params, *scan;
}
-static int
+static gint
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *fir)
{
CamelLocalSummary *cls = (CamelLocalSummary *)s;
}
-static int
+static gint
summary_header_load(CamelFolderSummary *s, FILE *in)
{
CamelLocalSummary *cls = (CamelLocalSummary *)s;
return 0;
/* otherwise load the version number */
- return camel_file_util_decode_fixed_int32(in, &cls->version);
+ return camel_file_util_decode_fixed_int32(in, (gint32 *) &cls->version);
}
static struct _CamelFIRecord *
return fir;
}
-static int
+static gint
summary_header_save(CamelFolderSummary *s, FILE *out)
{
/*CamelLocalSummary *cls = (CamelLocalSummary *)s;*/
static void maildir_finalize(CamelObject * object);
-static int
+static gint
maildir_folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
return fi;
}
-static int
+static gint
scan_dirs(CamelStore *store, guint32 flags, CamelFolderInfo *topfi, CamelURL *url, CamelException *ex)
{
CamelDList queue = CAMEL_DLIST_INITIALISER(queue);
if (mds->priv->current_file) {
#if 0
gchar *p1, *p2, *p3;
- unsigned long uid;
+ gulong uid;
#endif
/* if setting from a file, grab the flags from it */
camel_maildir_info_set_filename(mi, g_strdup(mds->priv->current_file));
return ret;
}
-static int
+static gint
camel_maildir_summary_add (CamelLocalSummary *cls, const gchar *name, gint forceindex)
{
CamelMaildirSummary *maildirs = (CamelMaildirSummary *)cls;
camel_message_info_free(info);
}
-static int
+static gint
maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, CamelException *ex)
{
DIR *dir;
}
/* sync the summary with the ondisk files. */
-static int
+static gint
maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changes, CamelException *ex)
{
gint count, i;
|| camel_mime_parser_tell_start_from(parser) != frompos) {
g_warning("Summary doesn't match the folder contents! eek!\n"
- " expecting offset %ld got %ld, state = %d", (long int)frompos,
- (long int)camel_mime_parser_tell_start_from(parser),
+ " expecting offset %ld got %ld, state = %d", (glong)frompos,
+ (glong)camel_mime_parser_tell_start_from(parser),
camel_mime_parser_state(parser));
camel_object_unref((CamelObject *)parser);
return camel_mbox_store_type;
}
-static gchar *extensions[] = {
+static const gchar *extensions[] = {
".msf", ".ev-summary", ".ev-summary-meta", ".ibex.index", ".ibex.index.data", ".cmeta", ".lock", ".db", ".journal"
};
return info;
}
-static int
+static gint
xrename(CamelStore *store, const gchar *old_name, const gchar *new_name, const gchar *ext, gboolean missingok)
{
CamelLocalStore *ls = (CamelLocalStore *)store;
static CamelMessageInfo * message_info_new_from_header(CamelFolderSummary *, struct _camel_header_raw *);
static CamelMessageInfo * message_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
static CamelMessageInfo * message_info_load (CamelFolderSummary *, FILE *);
-static int message_info_save (CamelFolderSummary *, FILE *, CamelMessageInfo *);
-static int meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMessageInfo *mi);
+static gint message_info_save (CamelFolderSummary *, FILE *, CamelMessageInfo *);
+static gint meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMessageInfo *mi);
/*static void message_info_free (CamelFolderSummary *, CamelMessageInfo *);*/
static gchar *mbox_summary_encode_x_evolution (CamelLocalSummary *cls, const CamelLocalMessageInfo *mi);
}
}
-static int
+static gint
summary_header_from_db (CamelFolderSummary *s, struct _CamelFIRecord *fir)
{
CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(s);
}
-static int
+static gint
summary_header_load(CamelFolderSummary *s, FILE *in)
{
CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(s);
return camel_file_util_decode_uint32(in, (guint32 *) &mbs->folder_size);
/* version 1 */
- if (camel_file_util_decode_fixed_int32(in, &mbs->version) == -1
- || camel_file_util_decode_size_t(in, &mbs->folder_size) == -1)
+ if (camel_file_util_decode_fixed_int32(in, (gint32 *) &mbs->version) == -1
+ || camel_file_util_decode_gsize(in, &mbs->folder_size) == -1)
return -1;
return 0;
fir = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->summary_header_to_db (s, ex);
if (fir) {
tmp = fir->bdata;
- fir->bdata = g_strdup_printf ("%s %d %d", tmp ? tmp : "", CAMEL_MBOX_SUMMARY_VERSION, (int) mbs->folder_size);
+ fir->bdata = g_strdup_printf ("%s %d %d", tmp ? tmp : "", CAMEL_MBOX_SUMMARY_VERSION, (gint) mbs->folder_size);
g_free (tmp);
}
return fir;
}
-static int
+static gint
summary_header_save(CamelFolderSummary *s, FILE *out)
{
CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(s);
camel_file_util_encode_fixed_int32(out, CAMEL_MBOX_SUMMARY_VERSION);
- return camel_file_util_encode_size_t(out, mbs->folder_size);
+ return camel_file_util_encode_gsize(out, mbs->folder_size);
}
static CamelMessageInfo *
return NULL;
}
-static int
+static gint
meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMessageInfo *mi)
{
CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
}
-static int
+static gint
message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *mi)
{
CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
}
/* like summary_rebuild, but also do changeinfo stuff (if supplied) */
-static int
+static gint
summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
gint i, count;
off_t size = 0;
GSList *del = NULL;
- d(printf("Calling summary update, from pos %d\n", (int)offset));
+ d(printf("Calling summary update, from pos %d\n", (gint)offset));
cls->index_force = FALSE;
CamelMessageInfo *info;
off_t pc = camel_mime_parser_tell_start_from (mp) + 1;
- camel_operation_progress (NULL, (int) (((float) pc / size) * 100));
+ camel_operation_progress (NULL, (gint) (((gfloat) pc / size) * 100));
info = camel_folder_summary_add_from_parser(s, mp);
if (info == NULL) {
return ok;
}
-static int
+static gint
mbox_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, CamelException *ex)
{
CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
}
/* perform a full sync */
-static int
+static gint
mbox_summary_sync_full(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
CamelLocalSummary *cls = (CamelLocalSummary *)mbs;
}
/* perform a quick sync - only system flags have changed */
-static int
+static gint
mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
CamelLocalSummary *cls = (CamelLocalSummary *)mbs;
continue;
}
- d(printf("Updating message %s: %d\n", camel_message_info_uid(info), (int)info->frompos));
+ d(printf("Updating message %s: %d\n", camel_message_info_uid(info), (gint)info->frompos));
camel_mime_parser_seek(mp, info->frompos, SEEK_SET);
if (camel_mime_parser_tell_start_from(mp) != info->frompos) {
g_warning("Didn't get the next message where I expected (%d) got %d instead",
- (int)info->frompos, (int)camel_mime_parser_tell_start_from(mp));
+ (gint)info->frompos, (gint)camel_mime_parser_tell_start_from(mp));
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
_("Summary and folder mismatch, even after a sync"));
goto error;
return -1;
}
-static int
+static gint
mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
struct stat st;
gint i, count;
CamelMboxMessageInfo *info = NULL;
gchar *buffer, *xevnew = NULL;
- size_t len;
+ gsize len;
const gchar *fromline;
gint lastdel = FALSE;
gboolean touched = FALSE;
d(printf("Looking at message %s\n", camel_message_info_uid(info)));
- d(printf("seeking (%s) to %d\n", ((CamelMessageInfo *) info)->uid, (int)info->frompos));
+ d(printf("seeking (%s) to %d\n", ((CamelMessageInfo *) info)->uid, (gint)info->frompos));
if (lastdel)
camel_mime_parser_seek(mp, info->frompos, SEEK_SET);
if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_FROM) {
- g_warning("Expected a From line here, didn't get it %d", (int)camel_mime_parser_tell(mp));
+ g_warning("Expected a From line here, didn't get it %d", (gint)camel_mime_parser_tell(mp));
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
_("Summary and folder mismatch, even after a sync"));
goto error;
if (camel_mime_parser_tell_start_from(mp) != info->frompos) {
g_warning("Didn't get the next message where I expected (%d) got %d instead",
- (int)info->frompos, (int)camel_mime_parser_tell_start_from(mp));
+ (gint)info->frompos, (gint)camel_mime_parser_tell_start_from(mp));
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
_("Summary and folder mismatch, even after a sync"));
goto error;
camel_mime_parser_drop_step(mp);
if (info) {
- d(printf("looking for message content to copy across from %d\n", (int)camel_mime_parser_tell(mp)));
+ d(printf("looking for message content to copy across from %d\n", (gint)camel_mime_parser_tell(mp)));
while (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_PRE_FROM) {
/*d(printf("copying mbox contents to temporary: '%.*s'\n", len, buffer));*/
if (write(fdout, buffer, len) != len) {
goto error;
}
- d(printf("we are now at %d, from = %d\n", (int)camel_mime_parser_tell(mp),
- (int)camel_mime_parser_tell_start_from(mp)));
+ d(printf("we are now at %d, from = %d\n", (gint)camel_mime_parser_tell(mp),
+ (gint)camel_mime_parser_tell_start_from(mp)));
camel_mime_parser_unstep(mp);
camel_message_info_free((CamelMessageInfo *)info);
info = NULL;
static void
encode_status(guint32 flags, gchar status[8])
{
- size_t i;
+ gsize i;
gchar *p;
p = status;
{
const gchar *p;
guint32 flags = 0;
- size_t i;
+ gsize i;
gchar c;
p = status;
CamelFolderChangeInfo *changes; /* used to build change sets */
guint32 version;
- size_t folder_size; /* size of the mbox file, last sync */
+ gsize folder_size; /* size of the mbox file, last sync */
guint xstatus:1; /* do we store/honour xstatus/status headers */
};
}
-static int
+static gint
mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
DIR *dir;
}
/* sync the summary file with the ondisk files */
-static int
+static gint
mh_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changes, CamelException *ex)
{
gint count, i;
return (CamelLocalSummary *)camel_spool_summary_new((CamelFolder *)lf, folder);
}
-static int
+static gint
spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
{
gint retry = 0;
static void free_folder_info (CamelStore *store, CamelFolderInfo *fi);
static void delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex);
-static void rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex);
static gchar *spool_get_meta_path(CamelLocalStore *ls, const gchar *full_name, const gchar *ext);
static gchar *spool_get_full_path(CamelLocalStore *ls, const gchar *full_name);
return new;
}
-static int
+static gint
spool_summary_load(CamelLocalSummary *cls, gint forceindex, CamelException *ex)
{
g_warning("spool summary - not loading anything\n");
}
/* perform a full sync */
-static int
+static gint
spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
gint fd = -1, fdout = -1;
return -1;
}
-static int
+static gint
spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
gint i, work, count;
return 0;
}
-static int
+static gint
spool_summary_need_index(void) {
return 0;
}
INCLUDES = -I../.. \
-I$(top_srcdir) \
-I$(top_srcdir)/camel \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
-I$(top_srcdir) \
$(CAMEL_CFLAGS) \
$(GNOME_INCLUDEDIR) \
CamelNNTPGroupList *list;
FILE *fp;
gchar buf[300];
- unsigned long time;
+ gulong time;
g_free (root_dir);
fp = g_fopen (grouplist_file, "r");
return;
}
- fprintf (fp, "%lu\n", (long)group_list->time);
+ fprintf (fp, "%lu\n", (glong)group_list->time);
g_list_foreach (group_list->group_list, (GFunc)save_entry, fp);
return new_group;
}
-static int
+static gint
camel_nntp_newsrc_group_get_highest_article_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *group)
{
if (!group || group->ranges->len == 0)
return g_array_index(group->ranges, ArticleRange, group->ranges->len - 1).high;
}
-static int
+static gint
camel_nntp_newsrc_group_get_num_articles_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *group)
{
gint i;
static void
-camel_nntp_newsrc_group_mark_range_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *group, long low, long high)
+camel_nntp_newsrc_group_mark_range_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *group, glong low, glong high)
{
gint i;
}
void
-camel_nntp_newsrc_mark_range_read(CamelNNTPNewsrc *newsrc, const gchar *group_name, long low, long high)
+camel_nntp_newsrc_mark_range_read(CamelNNTPNewsrc *newsrc, const gchar *group_name, glong low, glong high)
{
NewsrcGroup *group;
/* swap them if they're in the wrong order. */
if (low > high) {
- long tmp;
+ glong tmp;
tmp = high;
high = low;
}
gboolean
-camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc, const gchar *group_name, long num)
+camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc, const gchar *group_name, glong num)
{
gint i;
NewsrcGroup *group;
void camel_nntp_newsrc_mark_article_read (CamelNNTPNewsrc *newsrc,
const gchar *group_name, gint num);
void camel_nntp_newsrc_mark_range_read (CamelNNTPNewsrc *newsrc,
- const gchar *group_name, long low, long high);
+ const gchar *group_name, glong low, glong high);
gboolean camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc,
- const gchar *group_name, long num);
+ const gchar *group_name, glong num);
gboolean camel_nntp_newsrc_group_is_subscribed (CamelNNTPNewsrc *newsrc, const gchar *group_name);
void camel_nntp_newsrc_subscribe_group (CamelNNTPNewsrc *newsrc, const gchar *group_name);
/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const gchar *);*/
static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
-static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
+static gint store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
+static const gchar *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, gint);
static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const gchar *);
static void camel_nntp_store_summary_class_init (CamelNNTPStoreSummaryClass *klass);
if (info) {
d(printf(" '%s' -> '%s'\n", pathu8, full_name));
camel_store_info_set_string((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_NNTP_STORE_INFO_FULL_NAME, full_name);
- } else
+ } else {
d(printf(" failed\n"));
+ }
return info;
}
-static int
+static gint
summary_header_load (CamelStoreSummary *s, FILE *in)
{
CamelNNTPStoreSummary *is = (CamelNNTPStoreSummary *) s;
return 0;
}
-static int
+static gint
summary_header_save (CamelStoreSummary *s, FILE *out)
{
CamelNNTPStoreSummary *is = (CamelNNTPStoreSummary *) s;
return (CamelStoreInfo *) ni;
}
-static int
+static gint
store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
{
CamelNNTPStoreInfo *isi = (CamelNNTPStoreInfo *)mi;
{ "bytes", 2 },
};
-static int
+static gint
xover_setup(CamelNNTPStore *store, CamelException *ex)
{
gint ret, i;
}
static struct {
- gchar *value;
- gchar *serv;
- gchar *port;
+ const gchar *value;
+ const gchar *serv;
+ const gchar *port;
gint mode;
} ssl_options[] = {
{ "", "nntps", NNTPS_PORT, MODE_SSL }, /* really old (1.x) */
if (!strcmp (ssl_options[i].value, ssl_mode))
break;
mode = ssl_options[i].mode;
- serv = ssl_options[i].serv;
+ serv = (gchar *) ssl_options[i].serv;
port = ssl_options[i].port;
} else {
mode = MODE_CLEAR;
- serv = "nntp";
+ serv = (gchar *) "nntp";
port = NNTP_PORT;
}
g_free (tmp);
camel_url_free (summary_url);
- if (camel_store_summary_load ((CamelStoreSummary *)nntp_store->summary) == 0)
- ;
+ camel_store_summary_load ((CamelStoreSummary *)nntp_store->summary);
/* get options */
if (camel_url_get_param (url, "show_short_notation"))
return camel_nntp_store_type;
}
-static int
+static gint
camel_nntp_try_authenticate (CamelNNTPStore *store, CamelException *ex)
{
CamelService *service = (CamelService *) store;
camel_stream_write((CamelStream *)store->mem, s, strlen(s));
break;
case 'd':
- d = va_arg(ap, int);
+ d = va_arg(ap, gint);
camel_stream_printf((CamelStream *)store->mem, "%d", d);
break;
case 'u':
- u = va_arg(ap, unsigned int);
+ u = va_arg(ap, guint);
camel_stream_printf((CamelStream *)store->mem, "%u", u);
break;
case 'm':
camel_stream_printf((CamelStream *)store->mem, "<%s>", s);
break;
case 'r':
- u = va_arg(ap, unsigned int);
- u2 = va_arg(ap, unsigned int);
+ u = va_arg(ap, guint);
+ u2 = va_arg(ap, guint);
if (u == u2)
camel_stream_printf((CamelStream *)store->mem, "%u", u);
else
}
camel_stream_write ((CamelStream *) store->mem, (const gchar *) ps, p-ps-1);
- dd(printf("NNTP_COMMAND: '%.*s'\n", (int)store->mem->buffer->len, store->mem->buffer->data));
+ dd(printf("NNTP_COMMAND: '%.*s'\n", (gint)store->mem->buffer->len, store->mem->buffer->data));
camel_stream_write ((CamelStream *) store->mem, "\r\n", 2);
if (camel_stream_write((CamelStream *) store->stream, (const gchar *) store->mem->buffer->data, store->mem->buffer->len) == -1)
#define CAMEL_NNTP_STREAM_SIZE (4096)
#define CAMEL_NNTP_STREAM_LINE_SIZE (1024) /* maximum line size */
-static int
+static gint
stream_fill(CamelNNTPStream *is)
{
gint left = 0;
return 0;
}
-static ssize_t
-stream_read(CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read(CamelStream *stream, gchar *buffer, gsize n)
{
CamelNNTPStream *is = (CamelNNTPStream *)stream;
gchar *o, *oe;
is->ptr = p+3;
is->mode = CAMEL_NNTP_STREAM_EOD;
is->state = 0;
- dd(printf("NNTP_STREAM_READ(%d):\n%.*s\n", (int)(o-buffer), (int)(o-buffer), buffer));
+ dd(printf("NNTP_STREAM_READ(%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
return o-buffer;
}
p++;
is->ptr = p;
is->state = state;
- dd(printf("NNTP_STREAM_READ(%d):\n%.*s\n", (int)(o-buffer), (int)(o-buffer), buffer));
+ dd(printf("NNTP_STREAM_READ(%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
return o-buffer;
}
-static ssize_t
-stream_write(CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write(CamelStream *stream, const gchar *buffer, gsize n)
{
CamelNNTPStream *is = (CamelNNTPStream *)stream;
return camel_stream_write(is->source, buffer, n);
}
-static int
+static gint
stream_close(CamelStream *stream)
{
/* nop? */
return 0;
}
-static int
+static gint
stream_flush(CamelStream *stream)
{
/* nop? */
return is->mode != CAMEL_NNTP_STREAM_DATA;
}
-static int
+static gint
stream_reset(CamelStream *stream)
{
/* nop? reset literal mode? */
*len = max;
is->ptr += max;
- dd(printf("NNTP_STREAM_GETS(%s,%d): '%.*s'\n", end==NULL?"more":"last", *len, (int)*len, *start));
+ dd(printf("NNTP_STREAM_GETS(%s,%d): '%.*s'\n", end==NULL?"more":"last", *len, (gint)*len, *start));
return end == NULL?1:0;
}
is->mode = CAMEL_NNTP_STREAM_EOD;
is->state = 0;
- dd(printf("NNTP_STREAM_GETD(%s,%d): '%.*s'\n", "last", *len, (int)*len, *start));
+ dd(printf("NNTP_STREAM_GETD(%s,%d): '%.*s'\n", "last", *len, (gint)*len, *start));
return 0;
}
*start = s;
is->state = 1;
- dd(printf("NNTP_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (int)*len, *start));
+ dd(printf("NNTP_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
return 1;
}
*len = p-s;
*start = s;
- dd(printf("NNTP_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (int)*len, *start));
+ dd(printf("NNTP_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
return 1;
}
void camel_nntp_stream_set_mode (CamelNNTPStream *is, camel_nntp_stream_mode_t mode);
gint camel_nntp_stream_line (CamelNNTPStream *is, guchar **data, guint *len);
-int camel_nntp_stream_gets (CamelNNTPStream *is, guchar **start, guint *len);
-int camel_nntp_stream_getd (CamelNNTPStream *is, guchar **start, guint *len);
+gint camel_nntp_stream_gets (CamelNNTPStream *is, guchar **start, guint *len);
+gint camel_nntp_stream_getd (CamelNNTPStream *is, guchar **start, guint *len);
G_END_DECLS
return (CamelMessageInfo *)mi;
}
-static int
+static gint
summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
{
CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(s);
return 0;
}
-static int
+static gint
summary_header_load(CamelFolderSummary *s, FILE *in)
{
CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(s);
/* Legacy version */
if (s->version == 0x20c) {
- camel_file_util_decode_fixed_int32(in, &cns->high);
- return camel_file_util_decode_fixed_int32(in, &cns->low);
+ camel_file_util_decode_fixed_int32(in, (gint32 *) &cns->high);
+ return camel_file_util_decode_fixed_int32(in, (gint32 *) &cns->low);
}
- if (camel_file_util_decode_fixed_int32(in, &cns->version) == -1)
+ if (camel_file_util_decode_fixed_int32(in, (gint32 *) &cns->version) == -1)
return -1;
if (cns->version > CAMEL_NNTP_SUMMARY_VERSION) {
return -1;
}
- if (camel_file_util_decode_fixed_int32(in, &cns->high) == -1
- || camel_file_util_decode_fixed_int32(in, &cns->low) == -1)
+ if (camel_file_util_decode_fixed_int32(in, (gint32 *) &cns->high) == -1
+ || camel_file_util_decode_fixed_int32(in, (gint32 *) &cns->low) == -1)
return -1;
return 0;
return fir;
}
-static int
+static gint
summary_header_save(CamelFolderSummary *s, FILE *out)
{
CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(s);
/* ********************************************************************** */
/* Note: This will be called from camel_nntp_command, so only use camel_nntp_raw_command */
-static int
+static gint
add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, guint high, guint low, CamelFolderChangeInfo *changes, CamelException *ex)
{
CamelFolderSummary *s;
CamelMessageInfoBase *mi;
struct _camel_header_raw *headers = NULL;
gchar *line, *tab;
- gint len, ret;
+ guint len;
+ gint ret;
guint n, count, total, size;
struct _xover_header *xover;
}
/* Note: This will be called from camel_nntp_command, so only use camel_nntp_raw_command */
-static int
+static gint
add_range_head(CamelNNTPSummary *cns, CamelNNTPStore *store, guint high, guint low, CamelFolderChangeInfo *changes, CamelException *ex)
{
CamelFolderSummary *s;
}
#endif
-static inline int
+static inline gint
uid_num (CamelFolderSummary *summary, gint index)
{
gchar *tmp;
INCLUDES = \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
$(CAMEL_CFLAGS) \
-DG_LOG_DOMAIN=\"camel-pop3-provider\"
for the server to accept our data when pipelining */
#define CAMEL_POP3_SEND_LIMIT (1024)
+extern CamelServiceAuthType camel_pop3_password_authtype;
+extern CamelServiceAuthType camel_pop3_apop_authtype;
extern gint camel_verbose_debug;
#define dd(x) (camel_verbose_debug?(x):0)
return camel_pop3_engine_type;
}
-static int
+static gint
read_greeting (CamelPOP3Engine *pe)
{
- extern CamelServiceAuthType camel_pop3_password_authtype;
- extern CamelServiceAuthType camel_pop3_apop_authtype;
guchar *line, *apop, *apopend;
guint len;
/* TODO: read implementation too?
etc? */
static struct {
- gchar *cap;
+ const gchar *cap;
guint32 flag;
} capa[] = {
{ "APOP" , CAMEL_POP3_CAP_APOP },
}
/* returns true if the command was sent, false if it was just queued */
-static int
+static gint
engine_command_queue(CamelPOP3Engine *pe, CamelPOP3Command *pc)
{
if (((pe->capa & CAMEL_POP3_CAP_PIPE) == 0 || (pe->sentlen + strlen(pc->data)) > CAMEL_POP3_SEND_LIMIT)
void camel_pop3_engine_command_free(CamelPOP3Engine *pe, CamelPOP3Command *pc);
-int camel_pop3_engine_iterate (CamelPOP3Engine *pe, CamelPOP3Command *pc);
+gint camel_pop3_engine_iterate (CamelPOP3Engine *pe, CamelPOP3Command *pc);
CamelPOP3Command *camel_pop3_engine_command_new (CamelPOP3Engine *pe, guint32 flags, CamelPOP3CommandFunc func, gpointer data, const gchar *fmt, ...);
d(printf("%s(%d): fi->uid=[%s]\n", __FILE__, __LINE__, fi->uid));
if (pop3_get_message_time_from_cache (folder, fi->uid, &message_time)) {
- double time_diff = difftime(temp,message_time);
+ gdouble time_diff = difftime(temp,message_time);
gint day_lag = time_diff/(60*60*24);
d(printf("%s(%d): message_time= [%ld]\n", __FILE__, __LINE__, message_time));
}
static struct {
- gchar *value;
- gchar *serv;
- gchar *port;
+ const gchar *value;
+ const gchar *serv;
+ const gchar *port;
gint mode;
} ssl_options[] = {
{ "", "pop3s", POP3S_PORT, MODE_SSL }, /* really old (1.x) */
if (!strcmp (ssl_options[i].value, ssl_mode))
break;
mode = ssl_options[i].mode;
- serv = ssl_options[i].serv;
+ serv = (gchar *) ssl_options[i].serv;
port = ssl_options[i].port;
} else {
mode = MODE_CLEAR;
- serv = "pop3";
+ serv = (gchar *) "pop3";
port = POP3S_PORT;
}
camel_service_disconnect (CAMEL_SERVICE (store), FALSE, ex);
}
-static int
+static gint
try_sasl(CamelPOP3Store *store, const gchar *mech, CamelException *ex)
{
CamelPOP3Stream *stream = store->engine->stream;
return -1;
}
-static int
+static gint
pop3_try_authenticate (CamelService *service, gboolean reprompt, const gchar *errmsg, CamelException *ex)
{
CamelPOP3Store *store = (CamelPOP3Store *)service;
d = store->engine->apop;
while (*d != '\0') {
- if (!isascii((int)*d)) {
+ if (!isascii((gint)*d)) {
/* README for Translators: The string APOP should not be translated */
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
#define CAMEL_POP3_STREAM_SIZE (4096)
#define CAMEL_POP3_STREAM_LINE (1024) /* maximum line size */
-static int
+static gint
stream_fill(CamelPOP3Stream *is)
{
gint left = 0;
return 0;
}
-static ssize_t
-stream_read(CamelStream *stream, gchar *buffer, size_t n)
+static gssize
+stream_read(CamelStream *stream, gchar *buffer, gsize n)
{
CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
gchar *o, *oe;
is->ptr = p+3;
is->mode = CAMEL_POP3_STREAM_EOD;
is->state = 0;
- dd(printf("POP3_STREAM_READ(%d):\n%.*s\n", (int)(o-buffer), (int)(o-buffer), buffer));
+ dd(printf("POP3_STREAM_READ(%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
return o-buffer;
}
p++;
is->ptr = p;
is->state = state;
- dd(printf("POP3_STREAM_READ(%d):\n%.*s\n", (int)(o-buffer), (int)(o-buffer), buffer));
+ dd(printf("POP3_STREAM_READ(%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
return o-buffer;
}
-static ssize_t
-stream_write(CamelStream *stream, const gchar *buffer, size_t n)
+static gssize
+stream_write(CamelStream *stream, const gchar *buffer, gsize n)
{
CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
if (strncmp (buffer, "PASS ", 5) != 0)
- dd(printf("POP3_STREAM_WRITE(%d):\n%.*s\n", (int)n, (int)n, buffer));
+ dd(printf("POP3_STREAM_WRITE(%d):\n%.*s\n", (gint)n, (gint)n, buffer));
else
- dd(printf("POP3_STREAM_WRITE(%d):\nPASS xxxxxxxx\n", (int)n));
+ dd(printf("POP3_STREAM_WRITE(%d):\nPASS xxxxxxxx\n", (gint)n));
return camel_stream_write(is->source, buffer, n);
}
-static int
+static gint
stream_close(CamelStream *stream)
{
/* nop? */
return 0;
}
-static int
+static gint
stream_flush(CamelStream *stream)
{
/* nop? */
return is->mode != CAMEL_POP3_STREAM_DATA;
}
-static int
+static gint
stream_reset(CamelStream *stream)
{
/* nop? reset literal mode? */
*len = max;
is->ptr += max;
- dd(printf("POP3_STREAM_GETS(%s,%d): '%.*s'\n", end==NULL?"more":"last", *len, (int)*len, *start));
+ dd(printf("POP3_STREAM_GETS(%s,%d): '%.*s'\n", end==NULL?"more":"last", *len, (gint)*len, *start));
return end == NULL?1:0;
}
is->mode = CAMEL_POP3_STREAM_EOD;
is->state = 0;
- dd(printf("POP3_STREAM_GETD(%s,%d): '%.*s'\n", "last", *len, (int)*len, *start));
+ dd(printf("POP3_STREAM_GETD(%s,%d): '%.*s'\n", "last", *len, (gint)*len, *start));
return 0;
}
*start = s;
is->state = 1;
- dd(printf("POP3_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (int)*len, *start));
+ dd(printf("POP3_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
return 1;
}
*len = p-s;
*start = s;
- dd(printf("POP3_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (int)*len, *start));
+ dd(printf("POP3_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
return 1;
}
void camel_pop3_stream_set_mode (CamelPOP3Stream *is, camel_pop3_stream_mode_t mode);
gint camel_pop3_stream_line (CamelPOP3Stream *is, guchar **data, guint *len);
-int camel_pop3_stream_gets (CamelPOP3Stream *is, guchar **start, guint *len);
-int camel_pop3_stream_getd (CamelPOP3Stream *is, guchar **start, guint *len);
+gint camel_pop3_stream_gets (CamelPOP3Stream *is, guchar **start, guint *len);
+gint camel_pop3_stream_getd (CamelPOP3Stream *is, guchar **start, guint *len);
G_END_DECLS
-I.. \
-I$(srcdir)/.. \
-I$(srcdir)/../../.. \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
$(CAMEL_CFLAGS) \
$(GNOME_INCLUDEDIR) \
INCLUDES = \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
$(CAMEL_CFLAGS) \
-DG_LOG_DOMAIN=\"camel-smtp-provider\"
}
static struct {
- gchar *value;
- gchar *serv;
- gchar *port;
+ const gchar *value;
+ const gchar *serv;
+ const gchar *port;
gint mode;
} ssl_options[] = {
{ "", "smtps", SMTPS_PORT, MODE_SSL }, /* really old (1.x) */
if (!strcmp (ssl_options[i].value, ssl_mode))
break;
mode = ssl_options[i].mode;
- serv = ssl_options[i].serv;
+ serv = (gchar *) ssl_options[i].serv;
port = ssl_options[i].port;
} else {
mode = MODE_CLEAR;
- serv = "smtp";
+ serv = (gchar *) "smtp";
port = SMTP_PORT;
}
/* advance to the first token */
start = buffer;
- while (isspace ((int) *start) || *start == '=')
+ while (isspace ((gint) *start) || *start == '=')
start++;
if (!*start)
table = g_hash_table_new (g_str_hash, g_str_equal);
- for ( ; *start; ) {
+ for (; *start; ) {
gchar *type;
/* advance to the end of the token */
end = start;
- while (*end && !isspace ((int) *end))
+ while (*end && !isspace ((gint) *end))
end++;
type = g_strndup ((gchar *) start, end - start);
/* advance to the next token */
start = end;
- while (isspace ((int) *start))
+ while (isspace ((gint) *start))
start++;
}
const guchar *token;
token = (const guchar *) buf;
- while (*token && !isspace ((int) *token))
+ while (*token && !isspace ((gint) *token))
token++;
- while (*token && isspace ((int) *token))
+ while (*token && isspace ((gint) *token))
token++;
return (const gchar *) token;
* hexadecimal digits
*/
static gchar *
-smtp_decode_status_code (const gchar *in, size_t len)
+smtp_decode_status_code (const gchar *in, gsize len)
{
guchar *inptr, *outptr;
const guchar *inend;
INCLUDES = \
-I$(includedir) \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
-I$(top_srcdir)/camel/tests/lib \
-DG_LOG_DOMAIN=\"evolution-tests\" \
{ NULL, NULL, NULL, "maildir:/tmp/camel-test/maildir#testbox/foo", "foo", "testbox/foo", CAMEL_FOLDER_NOCHILDREN, -1, -1 },
};
-static int
+static gint
cmp_fi(gconstpointer a, gconstpointer b)
{
const CamelFolderInfo *fa = ((const CamelFolderInfo **)a)[0];
INCLUDES = \
-I$(includedir) \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
-I$(top_srcdir)/camel \
-DCAMEL_BUILD_DIR=\"$(top_builddir)/camel\" \
$(CAMEL_CFLAGS)
pull();
}
-static int
+static gint
safe_strcmp(const gchar *a, const gchar *b)
{
if (a == NULL && b == NULL)
printf (" ");
while (start < inptr) {
- fputc (isprint ((int) *start) ? *start : '.', stdout);
+ fputc (isprint ((gint) *start) ? *start : '.', stdout);
start++;
}
INCLUDES = \
-I$(includedir) \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
-I$(top_srcdir)/camel/tests/lib \
-DG_LOG_DOMAIN=\"evolution-tests\" \
iconv_t ic = iconv_open(to, from);
gchar *out, *outp;
const gchar *inp;
- size_t inlen, outlen;
+ gsize inlen, outlen;
if (ic == (iconv_t)-1)
return g_strdup(in);
INCLUDES = \
-I$(includedir) \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
-I$(top_srcdir)/camel/tests/lib \
-DG_LOG_DOMAIN=\"evolution-tests\" \
gint
main (gint argc, gchar **argv)
{
- ssize_t comp_progress, comp_correct_chunk, comp_filter_chunk;
+ gssize comp_progress, comp_correct_chunk, comp_filter_chunk;
gchar comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
CamelStream *source;
CamelStream *correct;
break;
while (comp_filter_chunk < comp_correct_chunk) {
- ssize_t delta;
+ gssize delta;
delta = camel_stream_read (CAMEL_STREAM (filter),
comp_filter + comp_filter_chunk,
CamelMimeFilter *sh;
gchar *work;
gint i;
- ssize_t comp_progress, comp_correct_chunk, comp_filter_chunk;
+ gssize comp_progress, comp_correct_chunk, comp_filter_chunk;
gint comp_i;
gchar comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
break;
while (comp_filter_chunk < comp_correct_chunk) {
- ssize_t delta;
+ gssize delta;
delta = camel_stream_read (CAMEL_STREAM (filter),
comp_filter + comp_filter_chunk,
INCLUDES = \
-I$(includedir) \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
-I$(top_srcdir)/camel/tests/lib \
-DG_LOG_DOMAIN=\"evolution-tests\" \
{ "\"quoted\"", 1, { { "quoted", CAMEL_SEARCH_WORD_SIMPLE } } },
{ "\"quoted double\"", 1, { { "quoted double", CAMEL_SEARCH_WORD_COMPLEX } } },
{ "\"quoted double\" compl;ex", 2, { { "quoted double", CAMEL_SEARCH_WORD_COMPLEX }, { "compl;ex", CAMEL_SEARCH_WORD_COMPLEX } } },
- { "\"quoted double \\\" escaped\"", 1, { { "quoted double \" escaped", CAMEL_SEARCH_WORD_COMPLEX } } },
+ { "\"quoted gdouble \\\" escaped\"", 1, { { "quoted gdouble \" escaped", CAMEL_SEARCH_WORD_COMPLEX } } },
{ "\"quoted\\\"double\" \\\" escaped\\\"", 3, { { "quoted\"double", CAMEL_SEARCH_WORD_COMPLEX }, {"\"", CAMEL_SEARCH_WORD_COMPLEX}, { "escaped\"", CAMEL_SEARCH_WORD_COMPLEX } } },
{ "\\\"escaped", 1, { { "\"escaped", CAMEL_SEARCH_WORD_COMPLEX } } },
INCLUDES = \
-I$(includedir) \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
-I$(top_srcdir)/camel/tests/lib \
-DG_LOG_DOMAIN=\"evolution-tests\" \
INCLUDES = \
-I$(includedir) \
-I$(top_srcdir) \
- -I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
-I$(top_srcdir)/camel/tests/lib \
-DG_LOG_DOMAIN=\"evolution-tests\" \
@Returns:
-<!-- ##### FUNCTION camel_file_util_encode_size_t ##### -->
-<para>
-
-</para>
-
-@out:
-@value:
-@Returns:
-
-
-<!-- ##### FUNCTION camel_file_util_decode_size_t ##### -->
-<para>
-
-</para>
-
-@in:
-@dest:
-@Returns:
-
-
<!-- ##### FUNCTION camel_file_util_encode_string ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION camel_file_util_decode_size_t ##### -->
+<para>
+
+</para>
+
+@in:
+@dest:
+@Returns:
+
+<!-- ##### FUNCTION camel_file_util_encode_size_t ##### -->
+<para>
+
+</para>
+
+@out:
+@value:
+@Returns:
+
<!-- ##### FUNCTION camel_folder_summary_array_free ##### -->
<para>
return g_strdup_printf ("%s-copy", filename);
}
-static int
+static gint
cp_file (const gchar *src, const gchar *dest)
{
gint i;
return (i == -1) ? -1 : 0;
}
-static int
+static gint
touch_file (const gchar *file)
{
gint o;
return close (o);
}
-static int
+static gint
resume_upgrade (const gchar *filename, const gchar *copy_filename, const gchar *check_filename)
{
DB *db;
e_account_item_t type, const gchar *);
void e_account_set_int (EAccount *,
- e_account_item_t type, int);
+ e_account_item_t type, gint);
void e_account_set_bool (EAccount *,
e_account_item_t type, gboolean);
return g_strdup (str);
for (i = 0, j = 0; res [i]; i++) {
- if ((unsigned char)res[i] != 0xCC || res [i + 1] == 0) {
+ if ((guchar)res[i] != 0xCC || res [i + 1] == 0) {
res [j] = res [i];
j++;
} else {
*
* Returns: The number of characters placed in @s.
**/
-size_t e_strftime(gchar *s, size_t max, const gchar *fmt, const struct tm *tm)
+gsize e_strftime(gchar *s, gsize max, const gchar *fmt, const struct tm *tm)
{
- size_t ret;
+ gsize ret;
#ifdef HAVE_LKSTRFTIME
ret = strftime(s, max, fmt, tm);
#else
*
* Returns: The number of characters placed in @s.
**/
-size_t
-e_utf8_strftime(gchar *s, size_t max, const gchar *fmt, const struct tm *tm)
+gsize
+e_utf8_strftime(gchar *s, gsize max, const gchar *fmt, const struct tm *tm)
{
- size_t sz, ret;
+ gsize sz, ret;
gchar *locale_fmt, *buf;
locale_fmt = g_locale_from_utf8(fmt, -1, NULL, &sz, NULL);
/* 64-bit Windows */
return (guint64) t.p;
#else
- return (int) t.p;
+ return (gint) t.p;
#endif
#else
/* Just return a checksum of the contents of the pthread_t */
gchar *e_util_unicode_get_utf8 (const gchar *text, gunichar *out);
const gchar *e_util_utf8_strstrcase (const gchar *haystack, const gchar *needle);
const gchar *e_util_utf8_strstrcasedecomp (const gchar *haystack, const gchar *needle);
-int e_util_utf8_strcasecmp (const gchar *s1, const gchar *s2);
+gint e_util_utf8_strcasecmp (const gchar *s1, const gchar *s2);
gchar *e_util_utf8_remove_accents (const gchar *str);
guint64 e_util_pthread_id (pthread_t t);
void e_filename_make_safe (gchar *string);
-size_t e_utf8_strftime(gchar *s, size_t max, const gchar *fmt, const struct tm *tm);
-size_t e_strftime(gchar *s, size_t max, const gchar *fmt, const struct tm *tm);
+gsize e_utf8_strftime(gchar *s, gsize max, const gchar *fmt, const struct tm *tm);
+gsize e_strftime(gchar *s, gsize max, const gchar *fmt, const struct tm *tm);
#ifdef G_OS_WIN32
const gchar *e_util_get_prefix (void) G_GNUC_CONST;
/* work around some broken iconv implementations
* that die if the length arguments are NULL
*/
- size_t buggy_iconv_len = 0;
+ gsize buggy_iconv_len = 0;
gchar *buggy_iconv_buf = NULL;
/* resets the converter */
return ip;
}
-size_t e_iconv(iconv_t cd, const gchar **inbuf, size_t *inbytesleft, gchar ** outbuf, size_t *outbytesleft)
+gsize e_iconv(iconv_t cd, const gchar **inbuf, gsize *inbytesleft, gchar ** outbuf, gsize *outbytesleft)
{
return iconv(cd, (gchar **) inbuf, inbytesleft, outbuf, outbytesleft);
}
const gchar *e_iconv_charset_name(const gchar *charset);
iconv_t e_iconv_open(const gchar *oto, const gchar *ofrom);
-size_t e_iconv(iconv_t cd, const gchar **inbuf, size_t *inbytesleft, gchar ** outbuf, size_t *outbytesleft);
+gsize e_iconv(iconv_t cd, const gchar **inbuf, gsize *inbytesleft, gchar ** outbuf, gsize *outbytesleft);
void e_iconv_close(iconv_t ip);
const gchar *e_iconv_locale_charset(void);
static time_end(const gchar *desc)
{
- unsigned long diff;
+ gulong diff;
struct timeval end;
gettimeofday(&end, NULL);
string array classes
*/
-#define STRV_UNPACKED ((unsigned char)(~0))
+#define STRV_UNPACKED ((guchar)(~0))
struct _EStrv {
guchar length; /* how many entries we have (or the token STRV_UNPACKED) */
#ifdef PROFILE_POOLV
static gulong poolv_hits = 0;
static gulong poolv_misses = 0;
-static unsigned long poolv_mem, poolv_count;
+static gulong poolv_mem, poolv_count;
#endif
#ifdef G_THREADS_ENABLED
printf("poolv profile: %lu hits, %lu misses: %d%% hit rate, memory: %lu, instances: %lu\n",
poolv_hits, poolv_misses,
- (int)(100.0 * ((double) poolv_hits / (double) (poolv_hits + poolv_misses))),
+ (gint)(100.0 * ((double) poolv_hits / (double) (poolv_hits + poolv_misses))),
poolv_mem, poolv_count);
last_time = new_time;
#define E_IS_STATUS_INTR() (errno == EINTR)
#endif
-static int
+static gint
e_pipe (gint *fds)
{
#ifndef G_OS_WIN32
GMutex *lock;
GHashTable *key_table;
EDList lru_list;
- size_t node_size;
+ gsize node_size;
gint node_count;
time_t timeout;
GFreeFunc node_free;
* Return value:
**/
EMCache *
-em_cache_new(time_t timeout, size_t nodesize, GFreeFunc nodefree)
+em_cache_new(time_t timeout, gsize nodesize, GFreeFunc nodefree)
{
struct _EMCache *emc;
};
#ifdef HAVE_NSS
-static int
+static gint
e_prpipe (PRFileDesc **fds)
{
#ifdef G_OS_WIN32
{
gint fd;
EMsg *msg;
- gint id = (int)data;
+ gint id = (gint)data;
fd_set rfds;
fd = e_msgport_fd(server_port);
gpointer server(gpointer data)
{
EMsg *msg;
- gint id = (int)data;
+ gint id = (gint)data;
while (1) {
printf("server %d: waiting\n", id);
time_t stamp;
};
-EMCache *em_cache_new(time_t timeout, size_t nodesize, GFreeFunc nodefree);
+EMCache *em_cache_new(time_t timeout, gsize nodesize, GFreeFunc nodefree);
void em_cache_destroy(EMCache *emc);
EMCacheNode *em_cache_lookup(EMCache *emc, const gchar *key);
EMCacheNode *em_cache_node_new(EMCache *emc, const gchar *key);
Comparison operators:
- bool = (< gint int)
- bool = (> gint int)
- bool = (= gint int)
+ bool = (< gint gint)
+ bool = (> gint gint)
+ bool = (= gint gint)
bool = (< string string)
bool = (> string string)
static struct _ESExpTerm * parse_value(ESExp *f);
#ifdef TESTER
-static void parse_dump_term(struct _ESExpTerm *t, int depth);
+static void parse_dump_term(struct _ESExpTerm *t, gint depth);
#endif
#ifdef E_SEXP_IS_G_OBJECT
printf("bool: %c\n", r->value.bool?'t':'f');
break;
case ESEXP_RES_TIME:
- printf("time_t: %ld\n", (long) r->value.time);
+ printf("time_t: %ld\n", (glong) r->value.time);
break;
case ESEXP_RES_UNDEFINED:
printf(" <undefined>\n");
printf(" #%c", t->value.bool?'t':'f');
break;
case ESEXP_TERM_TIME:
- printf(" %ld", (long) t->value.time);
+ printf(" %ld", (glong) t->value.time);
break;
case ESEXP_TERM_IFUNC:
case ESEXP_TERM_FUNC:
/* load in builtin symbols? */
for(i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
if (symbols[i].type == 1) {
- e_sexp_add_ifunction(s, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, (void *)&symbols[i]);
+ e_sexp_add_ifunction(s, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, (gpointer)&symbols[i]);
} else {
- e_sexp_add_function(s, 0, symbols[i].name, symbols[i].func, (void *)&symbols[i]);
+ e_sexp_add_function(s, 0, symbols[i].name, symbols[i].func, (gpointer)&symbols[i]);
}
}
#endif
void
-e_sexp_add_function(ESExp *f, int scope, const char *name, ESExpFunc *func, void *data)
+e_sexp_add_function(ESExp *f, gint scope, const gchar *name, ESExpFunc *func, gpointer data)
{
struct _ESExpSymbol *s;
}
void
-e_sexp_add_ifunction(ESExp *f, int scope, const char *name, ESExpIFunc *ifunc, void *data)
+e_sexp_add_ifunction(ESExp *f, gint scope, const gchar *name, ESExpIFunc *ifunc, gpointer data)
{
struct _ESExpSymbol *s;
}
void
-e_sexp_remove_symbol(ESExp *f, int scope, const char *name)
+e_sexp_remove_symbol(ESExp *f, gint scope, const gchar *name)
{
gint oldscope;
struct _ESExpSymbol *s;
void e_sexp_ref (ESExp *f);
void e_sexp_unref (ESExp *f);
#endif
-void e_sexp_add_function (ESExp *f, int scope, const char *name, ESExpFunc *func, void *data);
-void e_sexp_add_ifunction (ESExp *f, int scope, const char *name, ESExpIFunc *func, void *data);
-void e_sexp_add_variable (ESExp *f, int scope, char *name, ESExpTerm *value);
-void e_sexp_remove_symbol (ESExp *f, int scope, const char *name);
-int e_sexp_set_scope (ESExp *f, int scope);
+void e_sexp_add_function (ESExp *f, gint scope, const gchar *name, ESExpFunc *func, gpointer data);
+void e_sexp_add_ifunction (ESExp *f, gint scope, const gchar *name, ESExpIFunc *func, gpointer data);
+void e_sexp_add_variable (ESExp *f, gint scope, gchar *name, ESExpTerm *value);
+void e_sexp_remove_symbol (ESExp *f, gint scope, const gchar *name);
+gint e_sexp_set_scope (ESExp *f, gint scope);
void e_sexp_input_text (ESExp *f, const gchar *text, gint len);
void e_sexp_input_file (ESExp *f, gint fd);
-int e_sexp_parse (ESExp *f);
+gint e_sexp_parse (ESExp *f);
ESExpResult *e_sexp_eval (ESExp *f);
ESExpResult *e_sexp_term_eval (struct _ESExp *f, struct _ESExpTerm *t);
/* If there is mismatch, free the conf_list and return FALSE */
if (!conf_to_list) {
- for (p = conf_list; p != NULL ; p = p->next) {
+ for (p = conf_list; p != NULL; p = p->next) {
gconf_xml = (gchar *) p->data;
g_free (gconf_xml);
}
/* From list to conf */
- for (p = groups ; p != NULL; p = p->next) {
+ for (p = groups; p != NULL; p = p->next) {
group = E_SOURCE_GROUP (p->data);
source_group_xml = e_source_group_to_xml (group);
}
- for (p = conf_list; p != NULL ; p = p->next) {
+ for (p = conf_list; p != NULL; p = p->next) {
gconf_xml = (gchar *) p->data;
g_free (gconf_xml);
}
#define match_char(ch1, ch2) if (ch1 != ch2) return NULL
#if defined _LIBC && defined __GNUC__ && __GNUC__ >= 2
# define match_string(cs1, s2) \
- ({ size_t len = strlen (cs1); \
+ ({ gsize len = strlen (cs1); \
gint result = __strncasecmp_l ((cs1), (s2), len, locale) == 0; \
if (result) (s2) += len; \
result; })
const gchar *rp_backup;
gint cnt;
- size_t val;
+ gsize val;
gint have_I, is_pm;
gint century, want_century;
gint want_era;
gint have_uweek, have_wweek;
gint week_no;
#ifdef _NL_CURRENT
- size_t num_eras;
+ gsize num_eras;
#endif
struct era_entry *era;
num_eras = _NL_CURRENT_WORD (LC_TIME,
_NL_TIME_ERA_NUM_ENTRIES);
- for (era_cnt = 0; era_cnt < (int) num_eras;
+ for (era_cnt = 0; era_cnt < (gint) num_eras;
++era_cnt, rp = rp_backup)
{
era = _nl_select_era_entry (era_cnt
break;
}
}
- if (era_cnt != (int) num_eras)
+ if (era_cnt != (gint) num_eras)
break;
era_cnt = -1;
num_eras = _NL_CURRENT_WORD (LC_TIME,
_NL_TIME_ERA_NUM_ENTRIES);
- for (era_cnt = 0; era_cnt < (int) num_eras; ++era_cnt)
+ for (era_cnt = 0; era_cnt < (gint) num_eras; ++era_cnt)
{
era = _nl_select_era_entry (era_cnt
HELPER_LOCALE_ARG);
}
}
}
- if (era_cnt != (int) num_eras)
+ if (era_cnt != (gint) num_eras)
break;
era_cnt = -1;
{
num_eras = _NL_CURRENT_WORD (LC_TIME,
_NL_TIME_ERA_NUM_ENTRIES);
- for (era_cnt = 0; era_cnt < (int) num_eras;
+ for (era_cnt = 0; era_cnt < (gint) num_eras;
++era_cnt, rp = rp_backup)
{
era = _nl_select_era_entry (era_cnt HELPER_LOCALE_ARG);
if (era != NULL && recursive (era->era_format))
break;
}
- if (era_cnt == (int) num_eras)
+ if (era_cnt == (gint) num_eras)
{
era_cnt = -1;
if (*decided == loc)
return E_TIME_PARSE_INVALID;
/* Skip whitespace */
- while (n = (int)((unsigned char)*pos), isspace (n) != 0)
+ while (n = (gint)((guchar)*pos), isspace (n) != 0)
pos++;
/* Try each of the formats in turn */
* E_TIME_PARSE_INVALID if the string could not be parsed.
*/
ETimeParseStatus
-e_time_parse_date_and_time_ex (const char *value,
+e_time_parse_date_and_time_ex (const gchar *value,
struct tm *result,
gboolean *two_digit_year)
{
}
ETimeParseStatus
-e_time_parse_date_and_time (const char *value,
+e_time_parse_date_and_time (const gchar *value,
struct tm *result)
{
return e_time_parse_date_and_time_ex (value, result, NULL);
gboolean use_24_hour_format,
gboolean show_midnight,
gboolean show_zero_seconds,
- char *buffer,
- int buffer_size)
+ gchar *buffer,
+ gint buffer_size)
{
gchar *format;
e_time_format_time (struct tm *date_tm,
gboolean use_24_hour_format,
gboolean show_zero_seconds,
- char *buffer,
- int buffer_size)
+ gchar *buffer,
+ gint buffer_size)
{
gchar *format;
} ETimeParseStatus;
/* Tries to parse a string containing a date and time. */
-ETimeParseStatus e_time_parse_date_and_time (const char *value,
+ETimeParseStatus e_time_parse_date_and_time (const gchar *value,
struct tm *result);
/* Tries to parse a string containing a date. */
-ETimeParseStatus e_time_parse_date (const char *value,
+ETimeParseStatus e_time_parse_date (const gchar *value,
struct tm *result);
/* have same behavior like those functions above with two_digit_year set to NULL */
-ETimeParseStatus e_time_parse_date_and_time_ex (const char *value,
+ETimeParseStatus e_time_parse_date_and_time_ex (const gchar *value,
struct tm *result,
gboolean *two_digit_year);
-ETimeParseStatus e_time_parse_date_ex (const char *value,
+ETimeParseStatus e_time_parse_date_ex (const gchar *value,
struct tm *result,
gboolean *two_digit_year);
/* Tries to parse a string containing a time. */
-ETimeParseStatus e_time_parse_time (const char *value,
+ETimeParseStatus e_time_parse_time (const gchar *value,
struct tm *result);
/* Turns a struct tm into a string like "Wed 3/12/00 12:00:00 AM". */
gboolean use_24_hour_format,
gboolean show_midnight,
gboolean show_zero_seconds,
- char *buffer,
- int buffer_size);
+ gchar *buffer,
+ gint buffer_size);
/* Formats a time from a struct tm, e.g. "01:59 PM". */
void e_time_format_time (struct tm *date_tm,
gboolean use_24_hour_format,
gboolean show_zero_seconds,
- char *buffer,
- int buffer_size);
+ gchar *buffer,
+ gint buffer_size);
/* Like mktime(3), but assumes UTC instead of local timezone. */
static inline gunichar
-trie_utf8_getc (const guchar **in, size_t inlen)
+trie_utf8_getc (const guchar **in, gsize inlen)
{
register const guchar *inptr = *in;
const guchar *inend = inptr + inlen;
* Returns: The matched pattern, or %NULL if no pattern is matched.
**/
const gchar *
-e_trie_search (ETrie *trie, const gchar *buffer, size_t buflen, gint *matched_id)
+e_trie_search (ETrie *trie, const gchar *buffer, gsize buflen, gint *matched_id)
{
const guchar *inptr, *inend, *prev, *pat;
- register size_t inlen = buflen;
+ register gsize inlen = buflen;
struct _trie_state *q;
struct _trie_match *m = NULL; /* init to please gcc */
gunichar c;
void e_trie_add (ETrie *trie, const gchar *pattern, gint pattern_id);
-const gchar *e_trie_search (ETrie *trie, const gchar *buffer, size_t buflen, gint *matched_id);
+const gchar *e_trie_search (ETrie *trie, const gchar *buffer, gsize buflen, gint *matched_id);
#ifdef __cplusplus
}
}
return g_strdup_printf ("%lu.%lu.%d@%s",
- (unsigned long) time (NULL),
- (unsigned long) getpid (),
+ (gulong) time (NULL),
+ (gulong) getpid (),
serial++,
hostname);
}
/* find protocol: initial [a-z+.-]* substring until ":" */
p = uri_string;
- while (p < end && (isalnum ((unsigned char) *p) ||
+ while (p < end && (isalnum ((guchar) *p) ||
*p == '.' || *p == '+' || *p == '-'))
p++;
{
gchar *filesave;
xmlChar *xmlbuf;
- size_t n, written = 0;
+ gsize n, written = 0;
gint ret, fd, size;
gint errnosave;
- ssize_t w;
+ gssize w;
gchar *dirname = g_path_get_dirname (filename);
gchar *basename = g_path_get_basename (filename);
gchar *savebasename = g_strconcat (".#", basename, NULL);
return -1;
}
- n = (size_t) size;
+ n = (gsize) size;
do {
do {
w = write (fd, xmlbuf + written, n - written);
}
-static int
+static gint
idle_dump_callback (gpointer unused_data)
{
dump_list ();
}
-static int
+static gint
on_idle_do_stuff (gpointer unused_data)
{
GConfClient *client = gconf_client_get_default ();
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (name_selector_dialog->contact_sort),
&iter, path)) {
gtk_tree_path_free (path);
- return ;
+ return;
}
gtk_tree_path_free (path);
if (pixbuf) {
gint w, h;
- double scale = 1.0;
+ gdouble scale = 1.0;
w = gdk_pixbuf_get_width (pixbuf);
h = gdk_pixbuf_get_height (pixbuf);
GList *email_list=NULL;
GList *l;
gint i;
- char *edit_label;
- char *cut_label;
+ gchar *edit_label;
+ gchar *cut_label;
gchar *copy_label;
- int email_num, len;
+ gint email_num, len;
GSList *group = NULL;
gboolean is_list;
gboolean show_menu = FALSE;
GtkWidget *menu_item;
GList *email_list = NULL, *l;
gint i;
- int email_num, len;
+ gint email_num, len;
gchar *delete_label;
GSList *group = NULL;
gboolean is_list;
free_rebuild_data (rebuild_data);
}
-static int
+static gint
on_idle_rebuild_model_callback (ESourceSelector *selector)
{
rebuild_model (selector);
gtk_tree_path_next (generated_path);
}
- for ( ; i < node->n_generated; ) {
+ for (; i < node->n_generated; ) {
node->n_generated--;
row_deleted (tree_model_generator, generated_path);
}
- for ( ; i < n_generated; i++) {
+ for (; i < n_generated; i++) {
node->n_generated++;
row_inserted (tree_model_generator, generated_path);
gtk_tree_path_next (generated_path);
/* FIXME: Converting the path to an iter every time is inefficient */
- for ( ; node->n_generated; ) {
+ for (; node->n_generated; ) {
node->n_generated--;
row_deleted (tree_model_generator, generated_path);
}
}
-static int
+static gint
on_idle_create_widget (const gchar *gconf_path)
{
GtkWidget *window;
e_source_selector_show_selection (selector, gtk_toggle_button_get_active (button));
}
-static int
+static gint
on_idle_create_widget (const gchar *gconf_path)
{
GtkWidget *window;
#endif /* __cplusplus */
gboolean e2k_actions_extract (guint8 **data,
- int *len,
+ gint *len,
GPtrArray **actions);
void e2k_actions_append (GByteArray *ba,
GPtrArray *actions);
E2kAction *e2k_action_bounce (E2kActionBounceCode bounce_code);
E2kAction *e2k_action_forward (E2kAddrList *list);
E2kAction *e2k_action_delegate (E2kAddrList *list);
-E2kAction *e2k_action_tag (const char *propname,
+E2kAction *e2k_action_tag (const gchar *propname,
E2kPropType type,
gpointer value);
E2kAction *e2k_action_delete (void);
void e2k_action_free (E2kAction *act);
-E2kAddrList *e2k_addr_list_new (int nentries);
+E2kAddrList *e2k_addr_list_new (gint nentries);
void e2k_addr_list_set_local (E2kAddrList *list,
- int entry_num,
- const char *display_name,
- const char *exchange_dn,
- const char *email);
+ gint entry_num,
+ const gchar *display_name,
+ const gchar *exchange_dn,
+ const gchar *email);
void e2k_addr_list_set_oneoff (E2kAddrList *list,
- int entry_num,
- const char *display_name,
- const char *email);
+ gint entry_num,
+ const gchar *display_name,
+ const gchar *email);
void e2k_addr_list_free (E2kAddrList *list);
#ifdef __cplusplus
p = config_data;
while (1) {
- for (name = p; isspace ((unsigned char)*name); name++)
+ for (name = p; isspace ((guchar)*name); name++)
;
p = strchr (name, ':');
E2K_MAKE_TYPE (e2k_global_catalog, E2kGlobalCatalog, class_init, init, PARENT_TYPE)
-static int
+static gint
gc_ldap_result (LDAP *ldap, E2kOperation *op,
gint msgid, LDAPMessage **msg)
{
return LDAP_SUCCESS;
}
-static int
+static gint
gc_search (E2kGlobalCatalog *gc, E2kOperation *op,
const gchar *base, gint scope, const gchar *filter,
const gchar **attrs, LDAPMessage **msg)
}
#ifdef HAVE_LDAP_NTLM_BIND
-static int
+static gint
ntlm_bind (E2kGlobalCatalog *gc, E2kOperation *op, LDAP *ldap)
{
LDAPMessage *msg;
}
#endif
-static int
+static gint
connect_ldap (E2kGlobalCatalog *gc, E2kOperation *op, LDAP *ldap)
{
gint ldap_error;
return ldap_error;
}
-static int
+static gint
get_ldap_connection (E2kGlobalCatalog *gc, E2kOperation *op,
const gchar *server, gint port,
LDAP **ldap)
return ldap_error;
}
-static int
+static gint
get_gc_connection (E2kGlobalCatalog *gc, E2kOperation *op)
{
gint err;
return dn;
}
-double
+gdouble
lookup_passwd_max_age (E2kGlobalCatalog *gc, E2kOperation *op)
{
gchar **values = NULL, *filter = NULL, *val=NULL;
LDAP *ldap;
LDAPMessage *msg=NULL;
gint ldap_error, msgid;
- double maxAge=0;
+ gdouble maxAge=0;
gchar *dn=NULL;
attrs[0] = "maxPwdAge";
E2kGlobalCatalogCallback callback,
gpointer user_data);
-double lookup_passwd_max_age (E2kGlobalCatalog *gc,
+gdouble lookup_passwd_max_age (E2kGlobalCatalog *gc,
E2kOperation *op);
*
* Return value: the abbreviation used for prop's namespace
**/
-char
+gchar
e2k_prop_namespace_abbrev (const gchar *prop)
{
const gchar *div = get_div (prop);
gboolean value);
void e2k_properties_set_float (E2kProperties *props,
const gchar *propname,
- float value);
+ gfloat value);
void e2k_properties_set_date (E2kProperties *props,
const gchar *propname,
gchar *value);
static const gchar *is_types[] = { NULL, NULL, NULL, NULL, "is", "is not" };
static const gchar *date_types[] = { "before", "before", "after", "after", NULL, NULL };
-static const gchar *size_types[] = { "less than", "less than", "greater than", "greater than", NULL, NULL };
+static const gchar *gsizeypes[] = { "less than", "less than", "greater than", "greater than", NULL, NULL };
#if 0
static gboolean
(xmlChar *) "type",
(xmlChar *) "1");
- timestamp = g_strdup_printf ("%lu", (unsigned long)e2k_parse_timestamp (pv->value));
+ timestamp = g_strdup_printf ("%lu", (gulong)e2k_parse_timestamp (pv->value));
xmlSetProp (
node,
(xmlChar *) "value",
}
case E2K_PROPTAG_PR_MESSAGE_SIZE:
- relation = relop_to_name (relop, negated, size_types);
+ relation = relop_to_name (relop, negated, gsizeypes);
if (!relation)
return FALSE;
/* This determines the relative ordering of any two ACEs in a SID.
* See docs/security for details.
*/
-static int
+static gint
ace_compar (E2k_ACE *ace1, E2k_ACE *ace2, E2kSecurityDescriptor *sd)
{
E2kSidType t1;
/* Subauthorities. */
for (sa = 0; sa < sid->priv->binary_sid->SubAuthorityCount; sa++) {
g_string_append_printf (string, "-%lu",
- (unsigned long) GUINT32_FROM_LE (sid->priv->binary_sid->SubAuthority[sa]));
+ (gulong) GUINT32_FROM_LE (sid->priv->binary_sid->SubAuthority[sa]));
}
sid->priv->string_sid = string->str;
/* Find protocol: initial [a-z+.-]* substring until ":" */
p = uri_string;
- while (p < end && (isalnum ((unsigned char)*p) ||
+ while (p < end && (isalnum ((guchar)*p) ||
*p == '.' || *p == '+' || *p == '-'))
p++;
break;
case 1:
escape:
- g_string_append_printf (str, "%%%02x", (int)*s++);
+ g_string_append_printf (str, "%%%02x", (gint)*s++);
break;
default:
g_string_append_c (str, *s++);
{
const gchar *p;
guint8 buf[44], byte;
- int endlen;
+ gint endlen;
p = *permanenturl;
if (strspn (p, "0123456789abcdefABCDEF") != 32)
test_quit ();
}
-static int
+static gint
mp_compar (gconstpointer k, gconstpointer m)
{
const gchar *key = k;
gpointer value;
} EBrowseProp;
-static int
+static gint
prop_compar (gconstpointer a, gconstpointer b)
{
EBrowseProp **pa = (gpointer)a;
printf ("%s: %s (0x%lx)\n",
e2k_sid_get_display_name (sid),
e2k_permissions_role_get_name (role),
- (unsigned long)perms);
+ (gulong)perms);
}
g_list_free (sids);
E2kGlobalCatalogLookupType type;
guint32 flags;
gint i, pwd_exp_days;
- double maxAge;
+ gdouble maxAge;
if (*user == '/')
type = E2K_GLOBAL_CATALOG_LOOKUP_BY_LEGACY_EXCHANGE_DN;
maxAge = lookup_passwd_max_age (gc, &op);
printf("Password max age is %f \n", maxAge);
- pwd_exp_days = (maxAge * 0.000000100)/86400 ;
+ pwd_exp_days = (maxAge * 0.000000100)/86400;
printf("Password expiery period is %d \n", pwd_exp_days);
e2k_operation_free (&op);
*
* Return value: @folder's size
**/
-long long int
+gint64
e_folder_exchange_get_folder_size (EFolder *folder)
{
g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), -1);
void e_folder_exchange_set_permanent_uri (EFolder *folder,
const gchar *permanent_uri);
-long long int e_folder_exchange_get_folder_size (EFolder *folder);
+gint64 e_folder_exchange_get_folder_size (EFolder *folder);
void e_folder_exchange_set_folder_size (EFolder *folder, gint64 folder_size);
gboolean e_folder_exchange_get_has_subfolders (EFolder *folder);
}
#endif
-static int
+static gint
find_passwd_exp_period (ExchangeAccount *account, E2kGlobalCatalogEntry *entry)
{
- double max_pwd_age = 0;
+ gdouble max_pwd_age = 0;
gint max_pwd_age_days;
E2kOperation gcop;
E2kGlobalCatalogStatus gcstatus;
return folder;
}
-static int
+static gint
folder_comparator (gconstpointer a, gconstpointer b)
{
EFolder **fa = (EFolder **)a;
*
* Return the value of the quota limit reached.
*
- * Return value: an int
+ * Return value: an gint
**/
gint
exchange_account_get_quota_limit (ExchangeAccount *account)
const gchar *std_uri_prop);
ExchangeHierarchy *exchange_account_get_hierarchy_by_email (ExchangeAccount *account, const gchar *email);
-char *exchange_account_get_authtype (ExchangeAccount *account);
+gchar *exchange_account_get_authtype (ExchangeAccount *account);
E2kContext *exchange_account_connect (ExchangeAccount *acct,
const gchar *pword,
void exchange_account_rescan_tree (ExchangeAccount *acct);
-char *exchange_account_get_password (ExchangeAccount *acct);
+gchar *exchange_account_get_password (ExchangeAccount *acct);
ExchangeAccountResult exchange_account_set_password (ExchangeAccount *acct,
gchar *old_password,
groups = e_source_list_peek_groups (source_list);
found_group = FALSE;
- for ( ; groups != NULL && !found_group; groups = g_slist_next (groups)) {
+ for (; groups != NULL && !found_group; groups = g_slist_next (groups)) {
group = E_SOURCE_GROUP (groups->data);
if (strcmp (e_source_group_peek_name (group), account->account_name) == 0
sources = e_source_group_peek_sources (group);
- for( ; sources != NULL; sources = g_slist_next (sources)) {
+ for(; sources != NULL; sources = g_slist_next (sources)) {
source = E_SOURCE (sources->data);
read_uri = e_source_get_uri (source);
};
static gboolean
-free_fsize_table (gpointer key, gpointer value, gpointer data)
+free_fgsizeable (gpointer key, gpointer value, gpointer data)
{
folder_info *f_info = (folder_info *) value;
{
ExchangeFolderSize *fsize = EXCHANGE_FOLDER_SIZE (object);
- g_hash_table_foreach_remove (fsize->priv->table, free_fsize_table, NULL);
+ g_hash_table_foreach_remove (fsize->priv->table, free_fgsizeable, NULL);
g_hash_table_destroy (fsize->priv->table);
g_hash_table_foreach_remove (fsize->priv->row_refs, free_row_refs, NULL);
g_hash_table_destroy (fsize->priv->row_refs);
{
folder_info *f_info, *cached_info;
ExchangeFolderSizePrivate *priv;
- GHashTable *folder_size_table;
+ GHashTable *folder_gsizeable;
GtkTreeRowReference *row;
GtkTreeIter iter;
GtkTreePath *path;
g_return_if_fail (EXCHANGE_IS_FOLDER_SIZE (fsize));
priv = fsize->priv;
- folder_size_table = priv->table;
+ folder_gsizeable = priv->table;
- cached_info = g_hash_table_lookup (folder_size_table, folder_name);
+ cached_info = g_hash_table_lookup (folder_gsizeable, folder_name);
if (cached_info) {
if (cached_info->folder_size == folder_size) {
return;
f_info = g_new0(folder_info, 1);
f_info->folder_name = g_strdup (folder_name);
f_info->folder_size = folder_size;
- g_hash_table_insert (folder_size_table, f_info->folder_name, f_info);
+ g_hash_table_insert (folder_gsizeable, f_info->folder_name, f_info);
gtk_list_store_append (fsize->priv->model, &iter);
gtk_list_store_set (fsize->priv->model, &iter,
const gchar *folder_name)
{
ExchangeFolderSizePrivate *priv;
- GHashTable *folder_size_table;
+ GHashTable *folder_gsizeable;
folder_info *cached_info;
GtkTreeRowReference *row;
GtkTreeIter iter;
g_return_if_fail (folder_name != NULL);
priv = fsize->priv;
- folder_size_table = priv->table;
+ folder_gsizeable = priv->table;
- cached_info = g_hash_table_lookup (folder_size_table, folder_name);
+ cached_info = g_hash_table_lookup (folder_gsizeable, folder_name);
if (cached_info) {
row = g_hash_table_lookup (priv->row_refs, folder_name);
path = gtk_tree_row_reference_get_path (row);
- g_hash_table_remove (folder_size_table, folder_name);
+ g_hash_table_remove (folder_gsizeable, folder_name);
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (fsize->priv->model), &iter, path)) {
gtk_list_store_remove (fsize->priv->model, &iter);
}
const gchar *folder_name)
{
ExchangeFolderSizePrivate *priv;
- GHashTable *folder_size_table;
+ GHashTable *folder_gsizeable;
folder_info *cached_info;
g_return_val_if_fail (EXCHANGE_IS_FOLDER_SIZE (fsize), -1);
priv = fsize->priv;
- folder_size_table = priv->table;
+ folder_gsizeable = priv->table;
- cached_info = g_hash_table_lookup (folder_size_table, folder_name);
+ cached_info = g_hash_table_lookup (folder_gsizeable, folder_name);
if (cached_info) {
return cached_info->folder_size;
}
source_uri);
props = g_hash_table_new (g_str_hash, g_str_equal);
- g_hash_table_insert (props, (gpointer) "name", (char *)hierarchy_name);
+ g_hash_table_insert (props, (gpointer) "name", (gchar *)hierarchy_name);
g_hash_table_insert (props, (gpointer) "physical_uri_prefix",
- (char *)physical_uri_prefix);
+ (gchar *)physical_uri_prefix);
g_hash_table_insert (props, (gpointer) "internal_uri_prefix",
- (char *)internal_uri_prefix);
- g_hash_table_insert (props, (gpointer) "owner_name", (char *)owner_name);
- g_hash_table_insert (props, (gpointer) "owner_email", (char *)owner_email);
- g_hash_table_insert (props, (gpointer) "source_uri", (char *)source_uri);
+ (gchar *)internal_uri_prefix);
+ g_hash_table_insert (props, (gpointer) "owner_name", (gchar *)owner_name);
+ g_hash_table_insert (props, (gpointer) "owner_email", (gchar *)owner_email);
+ g_hash_table_insert (props, (gpointer) "source_uri", (gchar *)source_uri);
mf_path = e_folder_exchange_get_storage_file (hier->toplevel, "hierarchy.xml");
doc = e_xml_from_hash (props, E_XML_HASH_TYPE_PROPERTY,
hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
gpointer user_data)
{
- const gchar *internal_uri ;
+ const gchar *internal_uri;
gchar *mf_path;
g_return_if_fail (E_IS_FOLDER (folder));
E2K_PR_EXCHANGE_FOLDER_SIZE);
/* FIXME : Find a better way of doing this */
- fsize_d = g_ascii_strtod (folder_size, NULL)/1024 ;
+ fsize_d = g_ascii_strtod (folder_size, NULL)/1024;
exchange_account_folder_size_add (hier->account, name, fsize_d);
}
void exchange_hierarchy_rescan (ExchangeHierarchy *hier);
ExchangeAccountFolderResult exchange_hierarchy_scan_subtree (ExchangeHierarchy *hier,
EFolder *folder,
- int mode);
+ gint mode);
ExchangeAccountFolderResult exchange_hierarchy_create_folder (ExchangeHierarchy *hier,
EFolder *parent,
gchar *buf = g_malloc (len / 2 + 1), *p = buf;
while (len > 0) {
- *p = (char)*mem;
+ *p = (gchar)*mem;
p++;
mem += 2;
len -= 2;
guchar key[8];
gint i, c, bit;
- key[0] = (key_56[0]) ;
+ key[0] = (key_56[0]);
key[1] = (key_56[1] >> 1) | ((key_56[0] << 7) & 0xFF);
key[2] = (key_56[2] >> 2) | ((key_56[1] << 6) & 0xFF);
key[3] = (key_56[3] >> 3) | ((key_56[2] << 5) & 0xFF);
guint i;
for (i = 0; i < 14 && password [i]; i++)
- lm_password [i] = toupper ((unsigned char) password [i]);
+ lm_password [i] = toupper ((guchar) password [i]);
for (; i < sizeof (lm_password); i++)
lm_password [i] = '\0';
gchar *user_email;
gchar *user_uuid;
gchar *version;
- gchar *server_time ;
+ gchar *server_time;
GHashTable *categories_by_name;
GHashTable *categories_by_id;
GList *book_list;
}
if (priv->version) {
- g_free (priv->version) ;
- priv->opts = NULL ;
+ g_free (priv->version);
+ priv->opts = NULL;
}
if (priv->server_time) {
- g_free (priv->server_time) ;
- priv->server_time = NULL ;
+ g_free (priv->server_time);
+ priv->server_time = NULL;
}
if (priv->proxy) {
e_gw_message_write_string_parameter (msg, "id", NULL, id);
if (view)
- e_gw_message_write_string_parameter (msg, "view", NULL, view) ;
+ e_gw_message_write_string_parameter (msg, "view", NULL, view);
e_gw_message_write_footer (msg);
/* send message to server */
const gchar *
e_gw_connection_get_server_time (EGwConnection *cnc)
{
- g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL) ;
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL);
- return (const gchar *) cnc->priv->server_time ;
+ return (const gchar *) cnc->priv->server_time;
}
gchar *
return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
}
- *cursor =(int) g_ascii_strtod (value, NULL);
+ *cursor =(gint) g_ascii_strtod (value, NULL);
g_free (value);
g_object_unref (response);
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
- SoupSoapParameter *param ;
+ SoupSoapParameter *param;
EGwConnectionStatus status = E_GW_CONNECTION_STATUS_UNKNOWN;
msg = e_gw_message_new_with_header (e_gw_connection_get_uri (cnc), e_gw_connection_get_session_id(cnc), "createItemRequest");
g_object_unref (msg);
return status;
} else {
- param = soup_soap_response_get_first_parameter_by_name (response, "id") ;
- *container_id = soup_soap_parameter_get_string_value(param) ;
- printf ("CONTAINER ID %s \n", *container_id) ;
+ param = soup_soap_response_get_first_parameter_by_name (response, "id");
+ *container_id = soup_soap_parameter_get_string_value(param);
+ printf ("CONTAINER ID %s \n", *container_id);
}
- return status ;
+ return status;
}
SoupSoapMessage *msg;
SoupSoapResponse *response;
EGwConnectionStatus status;
- SoupSoapParameter *param ;
- gchar *buffer = NULL, *buf_length = NULL ;
+ SoupSoapParameter *param;
+ gchar *buffer = NULL, *buf_length = NULL;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
}
- param = soup_soap_response_get_first_parameter_by_name (response, "part") ;
+ param = soup_soap_response_get_first_parameter_by_name (response, "part");
if (param) {
- buf_length = soup_soap_parameter_get_property (param, "length") ;
- buffer = soup_soap_parameter_get_string_value (param) ;
+ buf_length = soup_soap_parameter_get_property (param, "length");
+ buffer = soup_soap_parameter_get_string_value (param);
}
if (buffer && buf_length && atoi (buf_length) > 0) {
- gsize len = atoi (buf_length) ;
- *attachment = (gchar *) g_base64_decode (buffer,&len) ;
- *attach_length = len ;
+ gsize len = atoi (buf_length);
+ *attachment = (gchar *) g_base64_decode (buffer,&len);
+ *attach_length = len;
} else {
*attachment = NULL;
*attach_length = 0;
}
/* free memory */
- g_free (buffer) ;
- g_free (buf_length) ;
+ g_free (buffer);
+ g_free (buf_length);
g_object_unref (response);
g_object_unref (msg);
SoupSoapMessage *msg;
SoupSoapResponse *response;
EGwConnectionStatus status;
- SoupSoapParameter *param ;
+ SoupSoapParameter *param;
gchar *buffer = NULL, *buf_length = NULL, *o_return = NULL;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
}
- param = soup_soap_response_get_first_parameter_by_name (response, "part") ;
+ param = soup_soap_response_get_first_parameter_by_name (response, "part");
if (param) {
- buf_length = soup_soap_parameter_get_property (param, "length") ;
- o_return = soup_soap_parameter_get_property (param, "offset") ;
- buffer = soup_soap_parameter_get_string_value (param) ;
+ buf_length = soup_soap_parameter_get_property (param, "length");
+ o_return = soup_soap_parameter_get_property (param, "offset");
+ buffer = soup_soap_parameter_get_string_value (param);
}
if (buffer && buf_length && atoi (buf_length) > 0) {
- gint len = atoi (buf_length) ;
+ gint len = atoi (buf_length);
*attachment = g_strdup (buffer);
*attach_length = len;
if (len && o_return)
}
/* free memory */
- g_free (buffer) ;
- g_free (buf_length) ;
+ g_free (buffer);
+ g_free (buf_length);
g_free (o_return);
g_object_unref (response);
g_object_unref (msg);
soup_soap_message_start_element (msg, "updates", NULL, NULL);
soup_soap_message_start_element (msg, "update", NULL, NULL);
e_gw_message_write_string_parameter (msg, "name", NULL, new_name);
- soup_soap_message_end_element (msg) ;
- soup_soap_message_end_element (msg) ;
+ soup_soap_message_end_element (msg);
+ soup_soap_message_end_element (msg);
e_gw_message_write_footer (msg);
e_gw_message_write_string_parameter (msg, "id", NULL, id);
if (view)
- e_gw_message_write_string_parameter (msg, "view", NULL, view) ;
+ e_gw_message_write_string_parameter (msg, "view", NULL, view);
e_gw_message_write_footer (msg);
/* send message to server */
e_gw_message_write_string_parameter (msg, "id", NULL, id);
if (view)
- e_gw_message_write_string_parameter (msg, "view", NULL, view) ;
+ e_gw_message_write_string_parameter (msg, "view", NULL, view);
if (embed)
e_gw_message_write_int_parameter (msg, "embed", NULL,1);
SoupSoapParameter *subparam, *field_param, *val_param;
if (param == NULL)
- return ;
+ return;
else {
/* parse these parameters into junk settings*/
for (subparam = soup_soap_parameter_get_first_child_by_name (param, "setting");
}
static void
-msg_add_settings (SoupSoapMessage *msg, const gchar *field, int value)
+msg_add_settings (SoupSoapMessage *msg, const gchar *field, gint value)
{
soup_soap_message_start_element (msg, "setting", NULL, NULL);
e_gw_message_write_string_parameter (msg, "field", NULL, field);
/* TODO:This has to go either in a generic file or specific to junk*/
typedef struct {
- gchar *id ;
+ gchar *id;
gchar *match;
gchar *matchType;
gchar *lastUsed;
const gchar *e_gw_connection_get_user_name (EGwConnection *cnc);
const gchar *e_gw_connection_get_user_email (EGwConnection *cnc);
const gchar *e_gw_connection_get_user_uuid (EGwConnection *cnc);
-const char *e_gw_connection_get_version (EGwConnection *cnc);
-const char *e_gw_connection_get_server_time (EGwConnection *cnc) ;
+const gchar *e_gw_connection_get_version (EGwConnection *cnc);
+const gchar *e_gw_connection_get_server_time (EGwConnection *cnc);
time_t e_gw_connection_get_date_from_string (const gchar *dtstring);
EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, const gchar *container, const gchar *view, gchar **start_date, const gchar *message_list, const gchar *item_types, const gchar *item_sources, gint count, GSList **item_list);
-EGwConnectionStatus e_gw_connection_create_folder(EGwConnection *cnc, const gchar *parent_name,const gchar *folder_name, gchar **container_id) ;
+EGwConnectionStatus e_gw_connection_create_folder(EGwConnection *cnc, const gchar *parent_name,const gchar *folder_name, gchar **container_id);
EGwConnectionStatus
-e_gw_connection_get_attachment (EGwConnection *cnc, const gchar *id, gint offset, gint length, const gchar **attachment, gint *attach_length) ;
+e_gw_connection_get_attachment (EGwConnection *cnc, const gchar *id, gint offset, gint length, const gchar **attachment, gint *attach_length);
EGwConnectionStatus e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const gchar *id, gint offset, gint length, const gchar **attachment, gint *attach_length, gint *offset_r);
-EGwConnectionStatus e_gw_connection_add_item (EGwConnection *cnc, const gchar *container, const gchar *id) ;
-EGwConnectionStatus e_gw_connection_add_items (EGwConnection *cnc, const gchar *container, GList *item_ids) ;
+EGwConnectionStatus e_gw_connection_add_item (EGwConnection *cnc, const gchar *container, const gchar *id);
+EGwConnectionStatus e_gw_connection_add_items (EGwConnection *cnc, const gchar *container, GList *item_ids);
EGwConnectionStatus e_gw_connection_move_item (EGwConnection *cnc, const gchar *id, const gchar *dest_container_id, const gchar *from_container_id);
-EGwConnectionStatus e_gw_connection_rename_folder (EGwConnection *cnc, const gchar *id ,const gchar *new_name) ;
+EGwConnectionStatus e_gw_connection_rename_folder (EGwConnection *cnc, const gchar *id ,const gchar *new_name);
EGwConnectionStatus e_gw_connection_get_settings (EGwConnection *cnc, EGwSendOptions **opts);
EGwConnectionStatus e_gw_connection_modify_settings (EGwConnection *cnc, EGwSendOptions *opts);
EGwConnectionStatus e_gw_connection_share_folder (EGwConnection *cnc, gchar *id, GList *new_list, const gchar *sub, const gchar *mesg ,int flag);
EGwConnectionStatus e_gw_connection_purge_deleted_items (EGwConnection *cnc);
EGwConnectionStatus e_gw_connection_purge_selected_items (EGwConnection *cnc, GList *item_ids);
-EGwConnectionStatus e_gw_connection_mark_read(EGwConnection *cnc, GList *item_ids) ;
-EGwConnectionStatus e_gw_connection_mark_unread(EGwConnection *cnc, GList *item_ids) ;
-EGwConnectionStatus e_gw_connection_reply_item (EGwConnection *cnc, const gchar *id, const gchar *view, EGwItem **item) ;
+EGwConnectionStatus e_gw_connection_mark_read(EGwConnection *cnc, GList *item_ids);
+EGwConnectionStatus e_gw_connection_mark_unread(EGwConnection *cnc, GList *item_ids);
+EGwConnectionStatus e_gw_connection_reply_item (EGwConnection *cnc, const gchar *id, const gchar *view, EGwItem **item);
EGwConnectionStatus e_gw_connection_forward_item (EGwConnection *cnc, const gchar *id, const gchar *view, gboolean embed, EGwItem **item);
EGwConnectionStatus e_gw_connection_create_junk_entry (EGwConnection *cnc, const gchar *value, const gchar *match_type , const gchar *list_type);
EGwConnectionStatus e_gw_connection_get_junk_settings (EGwConnection *cnc, gint *use_junk, gint *use_block, gint *use_pab, gint *persistence);
gchar *name;
gchar *id;
gchar *parent;
- guint32 unread ;
- guint32 total ;
+ guint32 unread;
+ guint32 total;
gint sequence;
gchar *owner;
GList *user_list;
gchar *modified;
- EGwContainerType type ;
- gboolean is_root ;
+ EGwContainerType type;
+ gboolean is_root;
gboolean is_writable;
gboolean is_frequent_contacts; /*indicates whether this folder is frequent contacts or not */
gboolean is_shared_by_me;
g_free (user->email);
g_free (user);
}
- return ;
+ return;
}
static void
subparam = soup_soap_parameter_get_first_child_by_name (param, "parent");
if (!subparam) {
e_gw_container_set_parent_id (container, "");
- container->priv->is_root = TRUE ;
+ container->priv->is_root = TRUE;
} else {
value = soup_soap_parameter_get_string_value (subparam);
e_gw_container_set_parent_id (container, (const gchar *) value);
- g_free (value) ;
+ g_free (value);
}
/*retrieve the folder type*/
- subparam = soup_soap_parameter_get_first_child_by_name (param, "folderType") ;
+ subparam = soup_soap_parameter_get_first_child_by_name (param, "folderType");
if (!subparam)
- container->priv->type = E_GW_CONTAINER_TYPE_FOLDER ;
+ container->priv->type = E_GW_CONTAINER_TYPE_FOLDER;
else {
value = soup_soap_parameter_get_string_value (subparam);
if (!strcmp (value, "Root"))
- container->priv->type = E_GW_CONTAINER_TYPE_ROOT ;
+ container->priv->type = E_GW_CONTAINER_TYPE_ROOT;
else if (!strcmp (value, "Mailbox"))
- container->priv->type = E_GW_CONTAINER_TYPE_INBOX ;
+ container->priv->type = E_GW_CONTAINER_TYPE_INBOX;
else if (!strcmp (value, "SentItems"))
container->priv->type = E_GW_CONTAINER_TYPE_SENT;
else if (!strcmp (value, "Calendar"))
- container->priv->type = E_GW_CONTAINER_TYPE_CALENDAR ;
+ container->priv->type = E_GW_CONTAINER_TYPE_CALENDAR;
else if (!strcmp (value, "Contacts"))
- container->priv->type = E_GW_CONTAINER_TYPE_CONTACTS ;
+ container->priv->type = E_GW_CONTAINER_TYPE_CONTACTS;
else if (!strcmp (value, "Draft"))
- container->priv->type = E_GW_CONTAINER_TYPE_DRAFT ;
+ container->priv->type = E_GW_CONTAINER_TYPE_DRAFT;
else if (!strcmp (value, "Trash"))
- container->priv->type = E_GW_CONTAINER_TYPE_TRASH ;
+ container->priv->type = E_GW_CONTAINER_TYPE_TRASH;
else if (!strcmp (value, "JunkMail"))
container->priv->type = E_GW_CONTAINER_TYPE_JUNK;
- g_free (value) ;
+ g_free (value);
}
subparam = soup_soap_parameter_get_first_child_by_name (param, "isSystemFolder");
/* retrive the unread and total count */
- subparam = soup_soap_parameter_get_first_child_by_name (param, "hasUnread") ;
+ subparam = soup_soap_parameter_get_first_child_by_name (param, "hasUnread");
if (!subparam) {
- container->priv->unread = 0 ;
+ container->priv->unread = 0;
} else {
- subparam = soup_soap_parameter_get_first_child_by_name (param, "unreadCount") ;
+ subparam = soup_soap_parameter_get_first_child_by_name (param, "unreadCount");
if (subparam) {
- value = soup_soap_parameter_get_string_value (subparam) ;
+ value = soup_soap_parameter_get_string_value (subparam);
if (value)
- container->priv->unread = atoi(value) ;
+ container->priv->unread = atoi(value);
else
- container->priv->unread = 0 ; /*XXX:should it be 0?*/
+ container->priv->unread = 0; /*XXX:should it be 0?*/
- g_free (value) ;
+ g_free (value);
}
}
- subparam = soup_soap_parameter_get_first_child_by_name (param, "count") ;
+ subparam = soup_soap_parameter_get_first_child_by_name (param, "count");
if (subparam) {
- value = soup_soap_parameter_get_string_value (subparam) ;
+ value = soup_soap_parameter_get_string_value (subparam);
if (value)
- container->priv->total = atoi(value) ;
- g_free (value) ;
+ container->priv->total = atoi(value);
+ g_free (value);
}
/* Is shared by me*/
subparam = soup_soap_parameter_get_first_child_by_name (param, "isSharedByMe");
{
g_return_val_if_fail (E_IS_GW_CONTAINER (container), 0);
- return (int)container->priv->sequence;
+ return (gint)container->priv->sequence;
}
static void
void
e_gw_container_set_parent_id (EGwContainer *container, const gchar *parent_id)
{
- EGwContainerPrivate *priv ;
+ EGwContainerPrivate *priv;
g_return_if_fail (E_IS_GW_CONTAINER (container));
g_return_if_fail (parent_id != NULL);
- priv = container->priv ;
+ priv = container->priv;
if (priv->parent)
- g_free (priv->parent) ;
+ g_free (priv->parent);
- priv->parent = g_strdup (parent_id) ;
+ priv->parent = g_strdup (parent_id);
}
guint32
e_gw_container_get_total_count (EGwContainer *container)
{
- g_return_val_if_fail (E_IS_GW_CONTAINER (container), -1) ;
+ g_return_val_if_fail (E_IS_GW_CONTAINER (container), -1);
- return container->priv->total ;
+ return container->priv->total;
}
guint32
e_gw_container_get_unread_count (EGwContainer *container)
{
- g_return_val_if_fail (E_IS_GW_CONTAINER (container), -1) ;
+ g_return_val_if_fail (E_IS_GW_CONTAINER (container), -1);
- return container->priv->unread ;
+ return container->priv->unread;
}
gboolean
e_gw_container_is_root (EGwContainer *container)
{
- g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE) ;
+ g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE);
- return container->priv->is_root ;
+ return container->priv->is_root;
}
EGwContainerType
e_gw_container_get_container_type (EGwContainer *container)
{
- g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE) ;
- return container->priv->type ;
+ g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE);
+ return container->priv->type;
}
/* flag specifies whether we are adding to acl or deleting one or more entries*/
E_GW_CONTAINER_TYPE_JUNK,
E_GW_CONTAINER_TYPE_FOLDER
-} EGwContainerType ;
+} EGwContainerType;
GType e_gw_container_get_type (void);
EGwContainer *e_gw_container_new_from_soap_parameter (SoupSoapParameter *param);
void e_gw_container_set_name (EGwContainer *container, const gchar *new_name);
const gchar *e_gw_container_get_id (EGwContainer *container);
void e_gw_container_set_id (EGwContainer *container, const gchar *new_id);
-const gchar *e_gw_container_get_parent_id (EGwContainer *container) ;
-void e_gw_container_set_parent_id (EGwContainer *container, const gchar *parent_id) ;
-guint32 e_gw_container_get_total_count (EGwContainer *container) ;
-guint32 e_gw_container_get_unread_count (EGwContainer *container) ;
+const gchar *e_gw_container_get_parent_id (EGwContainer *container);
+void e_gw_container_set_parent_id (EGwContainer *container, const gchar *parent_id);
+guint32 e_gw_container_get_total_count (EGwContainer *container);
+guint32 e_gw_container_get_unread_count (EGwContainer *container);
gboolean e_gw_container_get_is_writable (EGwContainer *container);
void e_gw_container_set_is_writable (EGwContainer *container, gboolean writable);
gboolean e_gw_container_get_is_frequent_contacts (EGwContainer *container);
void e_gw_container_set_is_frequent_contacts (EGwContainer *container, gboolean is_frequent_contacts);
-gboolean e_gw_container_is_root (EGwContainer *container) ;
+gboolean e_gw_container_is_root (EGwContainer *container);
const gchar * e_gw_container_get_owner(EGwContainer *container);
const gchar * e_gw_container_get_modified(EGwContainer *container);
gint e_gw_container_get_sequence(EGwContainer *container);
gboolean e_gw_container_get_is_shared_by_me(EGwContainer *container);
gboolean e_gw_container_get_is_shared_to_me(EGwContainer *container);
-int e_gw_container_get_rights(EGwContainer *container, gchar *email);
-EGwContainerType e_gw_container_get_container_type (EGwContainer *container) ;
+gint e_gw_container_get_rights(EGwContainer *container, gchar *email);
+EGwContainerType e_gw_container_get_container_type (EGwContainer *container);
void e_gw_container_get_user_list(EGwContainer *container, GList **user_list);
void e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, const gchar *sub, const gchar *mesg, gint flag);
gboolean e_gw_container_get_is_system_folder (EGwContainer *container);
gchar *str;
str = g_base64_encode ((guchar *) priv->message, strlen (priv->message));
- dtstring = g_strdup_printf ("%d", (int)strlen (str));
+ dtstring = g_strdup_printf ("%d", (gint)strlen (str));
soup_soap_message_add_attribute (msg, "length", dtstring, NULL, NULL);
g_free (dtstring);
soup_soap_message_write_string (msg, str);
str = g_base64_encode ((guchar *) priv->message, strlen (priv->message));
/*str = g_strdup (priv->message);*/
- str_len = g_strdup_printf ("%d", str ? (int)strlen (str) : 0);
+ str_len = g_strdup_printf ("%d", str ? (gint)strlen (str) : 0);
soup_soap_message_start_element (msg, "part", NULL, NULL);
soup_soap_message_add_attribute (msg, "length", str_len, NULL, NULL);
soup_soap_message_add_attribute (msg, "contentType", priv->content_type, NULL, NULL);
gchar *str, *message;
str = g_base64_encode ((guchar *) priv->message, strlen (priv->message));
- message = g_strdup_printf ("%d", (int)strlen (str));
+ message = g_strdup_printf ("%d", (gint)strlen (str));
soup_soap_message_add_attribute (msg, "length", message, NULL, NULL);
g_free (message);
soup_soap_message_write_string (msg, str);
} EGwItemOrganizer;
typedef struct {
- gchar *id ;
- gchar *name ;
+ gchar *id;
+ gchar *name;
gchar *item_reference;
gchar *contentid;
- gchar *contentType ;
- gint size ;
- gchar *date ;
- gchar *data ;
+ gchar *contentType;
+ gint size;
+ gchar *date;
+ gchar *data;
gboolean hidden;
-} EGwItemAttachment ;
+} EGwItemAttachment;
typedef enum {
E_GW_ITEM_NOTIFY_NONE,
void e_gw_item_set_completed (EGwItem *item, gboolean new_completed);
gboolean e_gw_item_get_is_allday_event (EGwItem *item);
void e_gw_item_set_is_allday_event (EGwItem *item, gboolean is_allday);
-char* e_gw_item_get_field_value (EGwItem *item, const gchar *field_name);
-void e_gw_item_set_field_value (EGwItem *item, const gchar *field_name, char* field_value);
+gchar * e_gw_item_get_field_value (EGwItem *item, const gchar *field_name);
+void e_gw_item_set_field_value (EGwItem *item, const gchar *field_name, gchar * field_value);
GList* e_gw_item_get_email_list (EGwItem *item);
void e_gw_item_set_email_list (EGwItem *item, GList *email_list);
FullName* e_gw_item_get_full_name (EGwItem *item);
void e_gw_item_set_im_list (EGwItem *item, GList *im_list);
void e_gw_item_set_categories (EGwItem *item, GList *category_list);
GList* e_gw_item_get_categories (EGwItem *item);
-void e_gw_item_set_to (EGwItem *item, const gchar *to) ;
-const gchar * e_gw_item_get_to (EGwItem *item) ;
-const gchar *e_gw_item_get_msg_content_type (EGwItem *item) ;
+void e_gw_item_set_to (EGwItem *item, const gchar *to);
+const gchar * e_gw_item_get_to (EGwItem *item);
+const gchar *e_gw_item_get_msg_content_type (EGwItem *item);
guint32 e_gw_item_get_item_status (EGwItem *item);
-void e_gw_item_set_content_type (EGwItem *item, const gchar *content_type) ;
+void e_gw_item_set_content_type (EGwItem *item, const gchar *content_type);
void e_gw_item_set_link_info (EGwItem *item, EGwItemLinkInfo *info);
EGwItemLinkInfo *e_gw_item_get_link_info (EGwItem *item);
-char *e_gw_item_get_content_type (EGwItem *item) ;
+gchar *e_gw_item_get_content_type (EGwItem *item);
const gchar *e_gw_item_get_msg_body_id (EGwItem *item);
-int e_gw_item_get_mail_size (EGwItem *item);
+gint e_gw_item_get_mail_size (EGwItem *item);
void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, const gchar *field_name, gpointer field_value);
gboolean e_gw_item_append_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg);
void e_gw_item_set_category_name (EGwItem *item, gchar *cateogry_name);
EGwItemOrganizer *e_gw_item_get_organizer (EGwItem *item);
void e_gw_item_set_organizer (EGwItem *item, EGwItemOrganizer *organizer);
-GSList * e_gw_item_get_attach_id_list (EGwItem *item) ;
-void e_gw_item_set_attach_id_list (EGwItem *item, GSList *attach_list) ;
+GSList * e_gw_item_get_attach_id_list (EGwItem *item);
+void e_gw_item_set_attach_id_list (EGwItem *item, GSList *attach_list);
GSList *e_gw_item_get_recurrence_dates (EGwItem *item);
}
void
-e_gw_message_write_int_parameter (SoupSoapMessage *msg, const gchar *name, const gchar *prefix, long value)
+e_gw_message_write_int_parameter (SoupSoapMessage *msg, const gchar *name, const gchar *prefix, glong value)
{
soup_soap_message_start_element (msg, name, prefix, NULL);
soup_soap_message_write_int (msg, value);
const gchar *name,
const gchar *prefix,
const gchar *value);
-void e_gw_message_write_int_parameter (SoupSoapMessage *msg, const gchar *name, const gchar *prefix, long value);
+void e_gw_message_write_int_parameter (SoupSoapMessage *msg, const gchar *name, const gchar *prefix, glong value);
void e_gw_message_write_footer (SoupSoapMessage *msg);
{
SoupSoapParameter *subparam, *field_param, *val_param;
- for (subparam = soup_soap_parameter_get_first_child_by_name(group_param, "setting") ;
- subparam != NULL ;
+ for (subparam = soup_soap_parameter_get_first_child_by_name(group_param, "setting");
+ subparam != NULL;
subparam = soup_soap_parameter_get_next_child_by_name (subparam, "setting")) {
gchar *field = NULL, *val = NULL;
{
SoupSoapParameter *subparam, *field_param, *val_param;
- for (subparam = soup_soap_parameter_get_first_child_by_name(group_param, "setting") ;
- subparam != NULL ;
+ for (subparam = soup_soap_parameter_get_first_child_by_name(group_param, "setting");
+ subparam != NULL;
subparam = soup_soap_parameter_get_next_child_by_name (subparam, "setting")) {
gchar *field = NULL, *val = NULL;
field_param = soup_soap_parameter_get_first_child_by_name (subparam, "field");
{
SoupSoapParameter *subparam, *field_param, *val_param;
- for (subparam = soup_soap_parameter_get_first_child_by_name(group_param, "setting") ;
- subparam != NULL ;
+ for (subparam = soup_soap_parameter_get_first_child_by_name(group_param, "setting");
+ subparam != NULL;
subparam = soup_soap_parameter_get_next_child_by_name (subparam, "setting")) {
gchar *field = NULL, *val = NULL;
field_param = soup_soap_parameter_get_first_child_by_name (subparam, "field");
priv = opts->priv;
- for (group_param = soup_soap_parameter_get_first_child_by_name(param, "group") ;
- group_param != NULL ;
+ for (group_param = soup_soap_parameter_get_first_child_by_name(param, "group");
+ group_param != NULL;
group_param = soup_soap_parameter_get_next_child_by_name (group_param, "group")) {
gchar *temp = NULL;
* Writes the stringified value of @d as the current element's content.
*/
void
-soup_soap_message_write_double (SoupSoapMessage *msg, double d)
+soup_soap_message_write_double (SoupSoapMessage *msg, gdouble d)
{
gchar *str = g_strdup_printf ("%f", d);
soup_soap_message_write_string (msg, str);
const gchar *ns_uri);
void soup_soap_message_end_header_element (SoupSoapMessage *msg);
void soup_soap_message_write_int (SoupSoapMessage *msg, glong i);
-void soup_soap_message_write_double (SoupSoapMessage *msg, double d);
+void soup_soap_message_write_double (SoupSoapMessage *msg, gdouble d);
void soup_soap_message_write_base64 (SoupSoapMessage *msg, const gchar *string, gint len);
void soup_soap_message_write_time (SoupSoapMessage *msg, const time_t *timeval);
void soup_soap_message_write_string (SoupSoapMessage *msg, const gchar *string);