diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 23:13:25 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-29 00:13:23 +0800 |
commit | fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056 (patch) | |
tree | ae78be371695c3dc18847b87d3f014f985aa3a40 /e-util | |
parent | 6f5464f34ceec9e5701e3e3e651a40f9e6b3a072 (diff) | |
download | gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.gz gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.zst gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.zip |
Prefer GLib basic types over C types.
Diffstat (limited to 'e-util')
63 files changed, 1126 insertions, 1126 deletions
diff --git a/e-util/e-bconf-map.c b/e-util/e-bconf-map.c index 9f97a441db..3e44526071 100644 --- a/e-util/e-bconf-map.c +++ b/e-util/e-bconf-map.c @@ -41,7 +41,7 @@ #define d(x) -static signed char hexnib[256] = { +static gchar hexnib[256] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, @@ -53,25 +53,25 @@ static signed char hexnib[256] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, }; -char * -e_bconf_hex_decode (const char *val) +gchar * +e_bconf_hex_decode (const gchar *val) { - const unsigned char *p = (const unsigned char *) val; - char *o, *res; + const guchar *p = (const guchar *) val; + gchar *o, *res; o = res = g_malloc (strlen (val) / 2 + 1); - for (p = (const unsigned char *)val; (p[0] && p[1]); p += 2) + for (p = (const guchar *)val; (p[0] && p[1]); p += 2) *o++ = (hexnib[p[0]] << 4) | hexnib[p[1]]; *o = 0; return res; } -char * -e_bconf_url_decode (const char *val) +gchar * +e_bconf_url_decode (const gchar *val) { - const unsigned char *p = (const unsigned char *) val; - char *o, *res, c; + const guchar *p = (const guchar *) val; + gchar *o, *res, c; o = res = g_malloc (strlen (val) + 1); while (*p) { @@ -90,22 +90,22 @@ e_bconf_url_decode (const char *val) xmlNodePtr -e_bconf_get_path (xmlDocPtr doc, const char *path) +e_bconf_get_path (xmlDocPtr doc, const gchar *path) { xmlNodePtr root; - char *val; - int found; + gchar *val; + gint found; root = doc->children; - if (strcmp ((char *)root->name, "bonobo-config") != 0) { + if (strcmp ((gchar *)root->name, "bonobo-config") != 0) { g_warning ("not bonobo-config xml file"); return NULL; } root = root->children; while (root) { - if (!strcmp ((char *)root->name, "section")) { - val = (char *)xmlGetProp (root, (const unsigned char *)"path"); + if (!strcmp ((gchar *)root->name, "section")) { + val = (gchar *)xmlGetProp (root, (const guchar *)"path"); found = val && strcmp (val, path) == 0; xmlFree (val); if (found) @@ -118,15 +118,15 @@ e_bconf_get_path (xmlDocPtr doc, const char *path) } xmlNodePtr -e_bconf_get_entry (xmlNodePtr root, const char *name) +e_bconf_get_entry (xmlNodePtr root, const gchar *name) { xmlNodePtr node = root->children; - int found; - char *val; + gint found; + gchar *val; while (node) { - if (!strcmp ((char *)node->name, "entry")) { - val = (char *)xmlGetProp (node, (const unsigned char *)"name"); + if (!strcmp ((gchar *)node->name, "entry")) { + val = (gchar *)xmlGetProp (node, (const guchar *)"name"); found = val && strcmp (val, name) == 0; xmlFree (val); if (found) @@ -138,13 +138,13 @@ e_bconf_get_entry (xmlNodePtr root, const char *name) return node; } -char * -e_bconf_get_value (xmlNodePtr root, const char *name) +gchar * +e_bconf_get_value (xmlNodePtr root, const gchar *name) { xmlNodePtr node = e_bconf_get_entry (root, name); - char *prop, *val = NULL; + gchar *prop, *val = NULL; - if (node && (prop = (char *)xmlGetProp (node, (const unsigned char *)"value"))) { + if (node && (prop = (gchar *)xmlGetProp (node, (const guchar *)"value"))) { val = g_strdup (prop); xmlFree (prop); } @@ -152,10 +152,10 @@ e_bconf_get_value (xmlNodePtr root, const char *name) return val; } -char * -e_bconf_get_bool (xmlNodePtr root, const char *name) +gchar * +e_bconf_get_bool (xmlNodePtr root, const gchar *name) { - char *val, *res; + gchar *val, *res; if ((val = e_bconf_get_value (root, name))) { res = g_strdup (val[0] == '1' ? "true" : "false"); @@ -166,10 +166,10 @@ e_bconf_get_bool (xmlNodePtr root, const char *name) return res; } -char * -e_bconf_get_long (xmlNodePtr root, const char *name) +gchar * +e_bconf_get_long (xmlNodePtr root, const gchar *name) { - char *val, *res; + gchar *val, *res; if ((val = e_bconf_get_value (root, name))) { res = g_strdup (val); @@ -180,10 +180,10 @@ e_bconf_get_long (xmlNodePtr root, const char *name) return res; } -char * -e_bconf_get_string (xmlNodePtr root, const char *name) +gchar * +e_bconf_get_string (xmlNodePtr root, const gchar *name) { - char *val, *res; + gchar *val, *res; if ((val = e_bconf_get_value (root, name))) { res = e_bconf_hex_decode (val); @@ -196,31 +196,31 @@ e_bconf_get_string (xmlNodePtr root, const char *name) /* lookup functions */ -typedef char * (* bconf_lookup_func) (xmlNodePtr root, const char *name, e_bconf_map_t *nap); +typedef gchar * (* bconf_lookup_func) (xmlNodePtr root, const gchar *name, e_bconf_map_t *nap); -static char * -bconf_lookup_bool (xmlNodePtr root, const char *name, e_bconf_map_t *map) +static gchar * +bconf_lookup_bool (xmlNodePtr root, const gchar *name, e_bconf_map_t *map) { return e_bconf_get_bool (root, name); } -static char * -bconf_lookup_long (xmlNodePtr root, const char *name, e_bconf_map_t *map) +static gchar * +bconf_lookup_long (xmlNodePtr root, const gchar *name, e_bconf_map_t *map) { return e_bconf_get_long (root, name); } -static char * -bconf_lookup_string (xmlNodePtr root, const char *name, e_bconf_map_t *map) +static gchar * +bconf_lookup_string (xmlNodePtr root, const gchar *name, e_bconf_map_t *map) { return e_bconf_get_string (root, name); } -static char * -bconf_lookup_enum (xmlNodePtr root, const char *name, e_bconf_map_t *map) +static gchar * +bconf_lookup_enum (xmlNodePtr root, const gchar *name, e_bconf_map_t *map) { - int index = 0, i; - char *val; + gint index = 0, i; + gchar *val; if ((val = e_bconf_get_value (root, name))) { index = atoi (val); @@ -240,11 +240,11 @@ static bconf_lookup_func lookup_table[] = { bconf_lookup_bool, bconf_lookup_long, bconf_lookup_string, bconf_lookup_enum }; -static char * -get_name (const char *in, int index) +static gchar * +get_name (const gchar *in, gint index) { GString *out = g_string_new (""); - char c, *res; + gchar c, *res; while ((c = *in++)) { if (c == '%') { @@ -269,14 +269,14 @@ get_name (const char *in, int index) } static void -build_xml (xmlNodePtr root, e_bconf_map_t *map, int index, xmlNodePtr source) +build_xml (xmlNodePtr root, e_bconf_map_t *map, gint index, xmlNodePtr source) { - char *name, *value; + gchar *name, *value; xmlNodePtr node; while (map->type != E_BCONF_MAP_END) { if ((map->type & E_BCONF_MAP_MASK) == E_BCONF_MAP_CHILD) { - node = xmlNewChild (root, NULL, (unsigned char *)map->to, NULL); + node = xmlNewChild (root, NULL, (guchar *)map->to, NULL); build_xml (node, map->child, index, source); } else { name = get_name (map->from, index); @@ -286,9 +286,9 @@ build_xml (xmlNodePtr root, e_bconf_map_t *map, int index, xmlNodePtr source) if (map->type & E_BCONF_MAP_CONTENT) { if (value && value[0]) - xmlNewTextChild (root, NULL, (unsigned char *)map->to, (unsigned char *)value); + xmlNewTextChild (root, NULL, (guchar *)map->to, (guchar *)value); } else { - xmlSetProp (root, (unsigned char *)map->to, (unsigned char *)value); + xmlSetProp (root, (guchar *)map->to, (guchar *)value); } g_free (value); @@ -299,15 +299,15 @@ build_xml (xmlNodePtr root, e_bconf_map_t *map, int index, xmlNodePtr source) } -int +gint e_bconf_import_xml_blob (GConfClient *gconf, xmlDocPtr config_xmldb, e_bconf_map_t *map, - const char *bconf_path, const char *gconf_path, - const char *name, const char *idparam) + const gchar *bconf_path, const gchar *gconf_path, + const gchar *name, const gchar *idparam) { xmlNodePtr source; - int count = 0, i; + gint count = 0, i; GSList *list, *l; - char *val; + gchar *val; source = e_bconf_get_path (config_xmldb, bconf_path); if (source) { @@ -323,18 +323,18 @@ e_bconf_import_xml_blob (GConfClient *gconf, xmlDocPtr config_xmldb, e_bconf_map xmlDocPtr doc; xmlNodePtr root; xmlChar *xmlbuf; - int n; + gint n; - doc = xmlNewDoc ((const unsigned char *)"1.0"); - root = xmlNewDocNode (doc, NULL, (unsigned char *)name, NULL); + doc = xmlNewDoc ((const guchar *)"1.0"); + root = xmlNewDocNode (doc, NULL, (guchar *)name, NULL); xmlDocSetRootElement (doc, root); /* This could be set with a MAP_UID type ... */ if (idparam) { - char buf[16]; + gchar buf[16]; sprintf (buf, "%d", i); - xmlSetProp (root, (unsigned char *)idparam, (unsigned char *)buf); + xmlSetProp (root, (guchar *)idparam, (guchar *)buf); } build_xml (root, map, i, source); @@ -361,17 +361,17 @@ e_bconf_import_xml_blob (GConfClient *gconf, xmlDocPtr config_xmldb, e_bconf_map } -static int gconf_type[] = { GCONF_VALUE_BOOL, GCONF_VALUE_BOOL, GCONF_VALUE_INT, GCONF_VALUE_STRING, GCONF_VALUE_STRING }; +static gint gconf_type[] = { GCONF_VALUE_BOOL, GCONF_VALUE_BOOL, GCONF_VALUE_INT, GCONF_VALUE_STRING, GCONF_VALUE_STRING }; -int +gint e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t *remap_list) { - char *path, *val, *tmp; + gchar *path, *val, *tmp; e_gconf_map_t *map; xmlNodePtr source; GSList *list, *l; - char buf[32]; - int i, j, k; + gchar buf[32]; + gint i, j, k; /* process all flat config */ for (i = 0; remap_list[i].root; i++) { @@ -453,8 +453,8 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * gconf_client_set_float (gconf, path, strtod (val, NULL), NULL); break; case E_GCONF_MAP_STRLIST: { - char *v = e_bconf_hex_decode (val); - char **t = g_strsplit (v, " !<-->!", 8196); + gchar *v = e_bconf_hex_decode (val); + gchar **t = g_strsplit (v, " !<-->!", 8196); list = NULL; for (k = 0; t[k]; k++) { @@ -473,11 +473,11 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * /* find the entry node */ while (node) { - if (!strcmp ((char *)node->name, "entry")) { - int found; + if (!strcmp ((gchar *)node->name, "entry")) { + gint found; - if ((tmp = (char *)xmlGetProp (node, (const unsigned char *)"name"))) { - found = strcmp ((char *)tmp, map[j].from) == 0; + if ((tmp = (gchar *)xmlGetProp (node, (const guchar *)"name"))) { + found = strcmp ((gchar *)tmp, map[j].from) == 0; xmlFree (tmp); if (found) break; @@ -491,7 +491,7 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * if (node) { node = node->children; while (node) { - if (strcmp ((char *)node->name, "any") == 0) + if (strcmp ((gchar *)node->name, "any") == 0) break; node = node->next; } @@ -501,7 +501,7 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * if (node) { node = node->children; while (node) { - if (strcmp ((char *)node->name, "value") == 0) + if (strcmp ((gchar *)node->name, "value") == 0) break; node = node->next; } @@ -510,7 +510,7 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * if (node) { node = node->children; while (node) { - if (strcmp ((char *)node->name, "value") == 0) + if (strcmp ((gchar *)node->name, "value") == 0) list = g_slist_append (list, xmlNodeGetContent (node)); node = node->next; } diff --git a/e-util/e-bconf-map.h b/e-util/e-bconf-map.h index 8c6ea6deec..57ba17e169 100644 --- a/e-util/e-bconf-map.h +++ b/e-util/e-bconf-map.h @@ -52,20 +52,20 @@ typedef struct _e_bconf_map { } e_bconf_map_t; -char *e_bconf_hex_decode (const char *val); -char *e_bconf_url_decode (const char *val); +gchar *e_bconf_hex_decode (const gchar *val); +gchar *e_bconf_url_decode (const gchar *val); -xmlNodePtr e_bconf_get_path (xmlDocPtr doc, const char *path); -xmlNodePtr e_bconf_get_entry (xmlNodePtr root, const char *name); +xmlNodePtr e_bconf_get_path (xmlDocPtr doc, const gchar *path); +xmlNodePtr e_bconf_get_entry (xmlNodePtr root, const gchar *name); -char *e_bconf_get_value (xmlNodePtr root, const char *name); -char *e_bconf_get_bool (xmlNodePtr root, const char *name); -char *e_bconf_get_long (xmlNodePtr root, const char *name); -char *e_bconf_get_string (xmlNodePtr root, const char *name); +gchar *e_bconf_get_value (xmlNodePtr root, const gchar *name); +gchar *e_bconf_get_bool (xmlNodePtr root, const gchar *name); +gchar *e_bconf_get_long (xmlNodePtr root, const gchar *name); +gchar *e_bconf_get_string (xmlNodePtr root, const gchar *name); -int e_bconf_import_xml_blob (GConfClient *gconf, xmlDocPtr config_xmldb, e_bconf_map_t *map, - const char *bconf_path, const char *gconf_path, - const char *name, const char *idparam); +gint e_bconf_import_xml_blob (GConfClient *gconf, xmlDocPtr config_xmldb, e_bconf_map_t *map, + const gchar *bconf_path, const gchar *gconf_path, + const gchar *name, const gchar *idparam); enum { @@ -93,7 +93,7 @@ typedef struct { e_gconf_map_t *map; } e_gconf_map_list_t; -int e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t *remap_list); +gint e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t *remap_list); #ifdef __cplusplus } diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c index e2cf15af43..551ffe2143 100644 --- a/e-util/e-bit-array.c +++ b/e-util/e-bit-array.c @@ -39,10 +39,10 @@ G_DEFINE_TYPE (EBitArray, e_bit_array, G_TYPE_OBJECT) static void -e_bit_array_insert_real(EBitArray *eba, int row) +e_bit_array_insert_real(EBitArray *eba, gint row) { - int box; - int i; + gint box; + gint i; if(eba->bit_count >= 0) { /* Add another word if needed. */ if ((eba->bit_count & 0x1f) == 0) { @@ -64,12 +64,12 @@ e_bit_array_insert_real(EBitArray *eba, int row) } static void -e_bit_array_delete_real(EBitArray *eba, int row, gboolean move_selection_mode) +e_bit_array_delete_real(EBitArray *eba, gint row, gboolean move_selection_mode) { - int box; - int i; - int last; - int selected = FALSE; + gint box; + gint i; + gint last; + gint selected = FALSE; if(eba->bit_count >= 0) { guint32 bitmask; box = row >> 5; @@ -105,34 +105,34 @@ e_bit_array_delete_real(EBitArray *eba, int row, gboolean move_selection_mode) /* FIXME : Improve efficiency here. */ void -e_bit_array_delete(EBitArray *eba, int row, int count) +e_bit_array_delete(EBitArray *eba, gint row, gint count) { - int i; + gint i; for (i = 0; i < count; i++) e_bit_array_delete_real(eba, row, FALSE); } /* FIXME : Improve efficiency here. */ void -e_bit_array_delete_single_mode(EBitArray *eba, int row, int count) +e_bit_array_delete_single_mode(EBitArray *eba, gint row, gint count) { - int i; + gint i; for (i = 0; i < count; i++) e_bit_array_delete_real(eba, row, TRUE); } /* FIXME : Improve efficiency here. */ void -e_bit_array_insert(EBitArray *eba, int row, int count) +e_bit_array_insert(EBitArray *eba, gint row, gint count) { - int i; + gint i; for (i = 0; i < count; i++) e_bit_array_insert_real(eba, row); } /* FIXME: Implement this more efficiently. */ void -e_bit_array_move_row(EBitArray *eba, int old_row, int new_row) +e_bit_array_move_row(EBitArray *eba, gint old_row, gint new_row) { e_bit_array_delete_real(eba, old_row, FALSE); e_bit_array_insert_real(eba, new_row); @@ -186,11 +186,11 @@ e_bit_array_foreach (EBitArray *eba, EForeachFunc callback, gpointer closure) { - int i; - int last = (eba->bit_count + 31) / 32; + gint i; + gint last = (eba->bit_count + 31) / 32; for (i = 0; i < last; i++) { if (eba->data[i]) { - int j; + gint j; guint32 value = eba->data[i]; for (j = 0; j < 32; j++) { if (value & 0x80000000) { @@ -231,8 +231,8 @@ gint e_bit_array_selected_count (EBitArray *eba) { gint count; - int i; - int last; + gint i; + gint last; if (!eba->data) return 0; @@ -242,7 +242,7 @@ e_bit_array_selected_count (EBitArray *eba) last = BOX(eba->bit_count - 1); for (i = 0; i <= last; i++) { - int j; + gint j; guint32 thiscount = 0; for (j = 0; j < 8; j++) thiscount += PART(eba->data[i], j); @@ -263,7 +263,7 @@ e_bit_array_selected_count (EBitArray *eba) void e_bit_array_select_all (EBitArray *eba) { - int i; + gint i; if (!eba->data) eba->data = g_new0 (guint32, (eba->bit_count + 31) / 32); @@ -275,8 +275,8 @@ e_bit_array_select_all (EBitArray *eba) /* need to zero out the bits corresponding to the rows not selected in the last full 32 bit mask */ if (eba->bit_count % 32) { - int unselected_mask = 0; - int num_unselected_in_last_byte = 32 - eba->bit_count % 32; + gint unselected_mask = 0; + gint num_unselected_in_last_byte = 32 - eba->bit_count % 32; for (i = 0; i < num_unselected_in_last_byte; i ++) unselected_mask |= 1 << i; @@ -295,7 +295,7 @@ e_bit_array_select_all (EBitArray *eba) void e_bit_array_invert_selection (EBitArray *eba) { - int i; + gint i; if (!eba->data) eba->data = g_new0 (guint32, (eba->bit_count + 31) / 32); @@ -305,7 +305,7 @@ e_bit_array_invert_selection (EBitArray *eba) } } -int +gint e_bit_array_bit_count (EBitArray *eba) { return eba->bit_count; @@ -314,7 +314,7 @@ e_bit_array_bit_count (EBitArray *eba) gboolean e_bit_array_cross_and (EBitArray *eba) { - int i; + gint i; for (i = 0; i < eba->bit_count / 32; i++) { if (eba->data[i] != ONES) return FALSE; @@ -327,7 +327,7 @@ e_bit_array_cross_and (EBitArray *eba) gboolean e_bit_array_cross_or (EBitArray *eba) { - int i; + gint i; for (i = 0; i < eba->bit_count / 32; i++) { if (eba->data[i] != 0) return TRUE; @@ -340,18 +340,18 @@ e_bit_array_cross_or (EBitArray *eba) #define OPERATE(object, i,mask,grow) ((grow) ? (((object)->data[(i)]) |= ((guint32) ~(mask))) : (((object)->data[(i)]) &= (mask))) void -e_bit_array_change_one_row(EBitArray *eba, int row, gboolean grow) +e_bit_array_change_one_row(EBitArray *eba, gint row, gboolean grow) { - int i; + gint i; i = BOX(row); OPERATE(eba, i, ~BITMASK(row), grow); } void -e_bit_array_change_range(EBitArray *eba, int start, int end, gboolean grow) +e_bit_array_change_range(EBitArray *eba, gint start, gint end, gboolean grow) { - int i, last; + gint i, last; if (start != end) { i = BOX(start); last = BOX(end); @@ -372,9 +372,9 @@ e_bit_array_change_range(EBitArray *eba, int start, int end, gboolean grow) } void -e_bit_array_select_single_row (EBitArray *eba, int row) +e_bit_array_select_single_row (EBitArray *eba, gint row) { - int i; + gint i; for (i = 0; i < ((eba->bit_count + 31) / 32); i++) { if (!((i == BOX(row) && eba->data[i] == BITMASK(row)) || (i != BOX(row) && eba->data[i] == 0))) { @@ -388,7 +388,7 @@ e_bit_array_select_single_row (EBitArray *eba, int row) } void -e_bit_array_toggle_single_row (EBitArray *eba, int row) +e_bit_array_toggle_single_row (EBitArray *eba, gint row) { if (eba->data[BOX(row)] & BITMASK(row)) eba->data[BOX(row)] &= ~BITMASK(row); @@ -415,7 +415,7 @@ e_bit_array_class_init (EBitArrayClass *klass) } EBitArray * -e_bit_array_new (int count) +e_bit_array_new (gint count) { EBitArray *eba = g_object_new (E_BIT_ARRAY_TYPE, NULL); eba->bit_count = count; diff --git a/e-util/e-bit-array.h b/e-util/e-bit-array.h index 34c8016094..a9bf113d5f 100644 --- a/e-util/e-bit-array.h +++ b/e-util/e-bit-array.h @@ -38,7 +38,7 @@ extern "C" { #ifndef _E_FOREACH_FUNC_H_ #define _E_FOREACH_FUNC_H_ -typedef void (*EForeachFunc) (int model_row, +typedef void (*EForeachFunc) (gint model_row, gpointer closure); #endif @@ -55,7 +55,7 @@ typedef struct { GType e_bit_array_get_type (void); -EBitArray *e_bit_array_new (int count); +EBitArray *e_bit_array_new (gint count); gboolean e_bit_array_value_at (EBitArray *selection, gint n); @@ -68,29 +68,29 @@ void e_bit_array_select_all (EBitArray *selection); void e_bit_array_invert_selection (EBitArray *selection); gint e_bit_array_bit_count (EBitArray *selection); void e_bit_array_change_one_row (EBitArray *selection, - int row, + gint row, gboolean grow); void e_bit_array_change_range (EBitArray *selection, - int start, - int end, + gint start, + gint end, gboolean grow); void e_bit_array_select_single_row (EBitArray *eba, - int row); + gint row); void e_bit_array_toggle_single_row (EBitArray *eba, - int row); + gint row); void e_bit_array_insert (EBitArray *esm, - int row, - int count); + gint row, + gint count); void e_bit_array_delete (EBitArray *esm, - int row, - int count); + gint row, + gint count); void e_bit_array_delete_single_mode (EBitArray *esm, - int row, - int count); + gint row, + gint count); void e_bit_array_move_row (EBitArray *esm, - int old_row, - int new_row); + gint old_row, + gint new_row); gboolean e_bit_array_cross_and (EBitArray *esm); gboolean e_bit_array_cross_or (EBitArray *esm); diff --git a/e-util/e-categories-config.c b/e-util/e-categories-config.c index c01b98cde4..14c8eae189 100644 --- a/e-util/e-categories-config.c +++ b/e-util/e-categories-config.c @@ -37,15 +37,15 @@ * given category. */ gboolean -e_categories_config_get_icon_for (const char *category, GdkPixmap **pixmap, GdkBitmap **mask) +e_categories_config_get_icon_for (const gchar *category, GdkPixmap **pixmap, GdkBitmap **mask) { - char *icon_file; + gchar *icon_file; GdkPixbuf *pixbuf; GdkBitmap *tmp_mask; g_return_val_if_fail (pixmap != NULL, FALSE); - icon_file = (char *) e_categories_get_icon_file_for (category); + icon_file = (gchar *) e_categories_get_icon_file_for (category); if (!icon_file) { *pixmap = NULL; if (mask != NULL) @@ -87,8 +87,8 @@ void e_categories_config_open_dialog_for_entry (GtkEntry *entry) { GtkDialog *dialog; - const char *text; - int result; + const gchar *text; + gint result; g_return_if_fail (entry != NULL); g_return_if_fail (GTK_IS_ENTRY (entry)); diff --git a/e-util/e-categories-config.h b/e-util/e-categories-config.h index bbd76f2a02..81ae0161a0 100644 --- a/e-util/e-categories-config.h +++ b/e-util/e-categories-config.h @@ -30,7 +30,7 @@ G_BEGIN_DECLS -gboolean e_categories_config_get_icon_for (const char *category, +gboolean e_categories_config_get_icon_for (const gchar *category, GdkPixmap **icon, GdkBitmap **mask); void e_categories_config_open_dialog_for_entry (GtkEntry *entry); diff --git a/e-util/e-config-listener.c b/e-util/e-config-listener.c index 7c1c6eb091..97360a7552 100644 --- a/e-util/e-config-listener.c +++ b/e-util/e-config-listener.c @@ -31,13 +31,13 @@ typedef struct { EConfigListener *cl; guint lid; - char *key; + gchar *key; GConfValueType type; union { gboolean v_bool; float v_float; long v_long; - char *v_str; + gchar *v_str; } value; gboolean used_default; } KeyData; @@ -215,7 +215,7 @@ property_change_cb (GConfEngine *engine, } static KeyData * -add_key (EConfigListener *cl, const char *key, GConfValueType type, +add_key (EConfigListener *cl, const gchar *key, GConfValueType type, gpointer value, gboolean used_default) { KeyData *kd; @@ -236,7 +236,7 @@ add_key (EConfigListener *cl, const char *key, GConfValueType type, memcpy (&kd->value.v_long, value, sizeof (long)); break; case GCONF_VALUE_STRING : - kd->value.v_str = g_strdup ((const char *) value); + kd->value.v_str = g_strdup ((const gchar *) value); break; default : break; @@ -256,14 +256,14 @@ add_key (EConfigListener *cl, const char *key, GConfValueType type, } gboolean -e_config_listener_get_boolean (EConfigListener *cl, const char *key) +e_config_listener_get_boolean (EConfigListener *cl, const gchar *key) { return e_config_listener_get_boolean_with_default (cl, key, FALSE, NULL); } gboolean e_config_listener_get_boolean_with_default (EConfigListener *cl, - const char *key, + const gchar *key, gboolean def, gboolean *used_default) { @@ -306,14 +306,14 @@ e_config_listener_get_boolean_with_default (EConfigListener *cl, } float -e_config_listener_get_float (EConfigListener *cl, const char *key) +e_config_listener_get_float (EConfigListener *cl, const gchar *key) { return e_config_listener_get_float_with_default (cl, key, 0.0, NULL); } float e_config_listener_get_float_with_default (EConfigListener *cl, - const char *key, + const gchar *key, float def, gboolean *used_default) { @@ -356,14 +356,14 @@ e_config_listener_get_float_with_default (EConfigListener *cl, } long -e_config_listener_get_long (EConfigListener *cl, const char *key) +e_config_listener_get_long (EConfigListener *cl, const gchar *key) { return e_config_listener_get_long_with_default (cl, key, 0, NULL); } long e_config_listener_get_long_with_default (EConfigListener *cl, - const char *key, + const gchar *key, long def, gboolean *used_default) { @@ -405,20 +405,20 @@ e_config_listener_get_long_with_default (EConfigListener *cl, return value; } -char * -e_config_listener_get_string (EConfigListener *cl, const char *key) +gchar * +e_config_listener_get_string (EConfigListener *cl, const gchar *key) { return e_config_listener_get_string_with_default (cl, key, NULL, NULL); } -char * +gchar * e_config_listener_get_string_with_default (EConfigListener *cl, - const char *key, - const char *def, + const gchar *key, + const gchar *def, gboolean *used_default) { GConfValue *conf_value; - char *str; + gchar *str; KeyData *kd; g_return_val_if_fail (E_IS_CONFIG_LISTENER (cl), NULL); @@ -456,7 +456,7 @@ e_config_listener_get_string_with_default (EConfigListener *cl, } void -e_config_listener_set_boolean (EConfigListener *cl, const char *key, gboolean value) +e_config_listener_set_boolean (EConfigListener *cl, const gchar *key, gboolean value) { KeyData *kd; GError *err = NULL; @@ -481,7 +481,7 @@ e_config_listener_set_boolean (EConfigListener *cl, const char *key, gboolean va } void -e_config_listener_set_float (EConfigListener *cl, const char *key, float value) +e_config_listener_set_float (EConfigListener *cl, const gchar *key, float value) { KeyData *kd; GError *err = NULL; @@ -506,7 +506,7 @@ e_config_listener_set_float (EConfigListener *cl, const char *key, float value) } void -e_config_listener_set_long (EConfigListener *cl, const char *key, long value) +e_config_listener_set_long (EConfigListener *cl, const gchar *key, long value) { KeyData *kd; GError *err = NULL; @@ -531,9 +531,9 @@ e_config_listener_set_long (EConfigListener *cl, const char *key, long value) } void -e_config_listener_set_string (EConfigListener *cl, const char *key, const char *value) +e_config_listener_set_string (EConfigListener *cl, const gchar *key, const gchar *value) { - char *s1, *s2; + gchar *s1, *s2; KeyData *kd; GError *err = NULL; @@ -541,7 +541,7 @@ e_config_listener_set_string (EConfigListener *cl, const char *key, const char * g_return_if_fail (key != NULL); /* check that the value is not the same */ - s1 = (char *) value; + s1 = (gchar *) value; s2 = e_config_listener_get_string_with_default (cl, key, NULL, NULL); if (!strcmp (s1 ? s1 : "", s2 ? s2 : "")) { g_free (s2); @@ -565,7 +565,7 @@ e_config_listener_set_string (EConfigListener *cl, const char *key, const char * } void -e_config_listener_remove_value (EConfigListener *cl, const char *key) +e_config_listener_remove_value (EConfigListener *cl, const gchar *key) { g_return_if_fail (E_IS_CONFIG_LISTENER (cl)); g_return_if_fail (key != NULL); @@ -575,7 +575,7 @@ e_config_listener_remove_value (EConfigListener *cl, const char *key) } void -e_config_listener_remove_dir (EConfigListener *cl, const char *dir) +e_config_listener_remove_dir (EConfigListener *cl, const gchar *dir) { GSList *slist, *iter; const gchar *key; diff --git a/e-util/e-config-listener.h b/e-util/e-config-listener.h index 4449d8f22c..47eb9c2e80 100644 --- a/e-util/e-config-listener.h +++ b/e-util/e-config-listener.h @@ -45,49 +45,49 @@ typedef struct { typedef struct { GObjectClass parent_class; - void (* key_changed) (EConfigListener *cl, const char *key); + void (* key_changed) (EConfigListener *cl, const gchar *key); } EConfigListenerClass; GType e_config_listener_get_type (void); EConfigListener *e_config_listener_new (void); -gboolean e_config_listener_get_boolean (EConfigListener *cl, const char *key); +gboolean e_config_listener_get_boolean (EConfigListener *cl, const gchar *key); gboolean e_config_listener_get_boolean_with_default (EConfigListener *cl, - const char *key, + const gchar *key, gboolean def, gboolean *used_default); -float e_config_listener_get_float (EConfigListener *cl, const char *key); +float e_config_listener_get_float (EConfigListener *cl, const gchar *key); float e_config_listener_get_float_with_default (EConfigListener *cl, - const char *key, + const gchar *key, float def, gboolean *used_default); -long e_config_listener_get_long (EConfigListener *cl, const char *key); +long e_config_listener_get_long (EConfigListener *cl, const gchar *key); long e_config_listener_get_long_with_default (EConfigListener *cl, - const char *key, + const gchar *key, long def, gboolean *used_default); -char *e_config_listener_get_string (EConfigListener *cl, const char *key); -char *e_config_listener_get_string_with_default (EConfigListener *cl, - const char *key, - const char *def, +gchar *e_config_listener_get_string (EConfigListener *cl, const gchar *key); +gchar *e_config_listener_get_string_with_default (EConfigListener *cl, + const gchar *key, + const gchar *def, gboolean *used_default); void e_config_listener_set_boolean (EConfigListener *cl, - const char *key, + const gchar *key, gboolean value); void e_config_listener_set_float (EConfigListener *cl, - const char *key, + const gchar *key, float value); void e_config_listener_set_long (EConfigListener *cl, - const char *key, + const gchar *key, long value); void e_config_listener_set_string (EConfigListener *cl, - const char *key, - const char *value); + const gchar *key, + const gchar *value); void e_config_listener_remove_value (EConfigListener *cl, - const char *key); + const gchar *key); void e_config_listener_remove_dir (EConfigListener *cl, - const char *dir); + const gchar *dir); G_END_DECLS diff --git a/e-util/e-config.c b/e-util/e-config.c index 5d0a7090f7..36f42451ae 100644 --- a/e-util/e-config.c +++ b/e-util/e-config.c @@ -43,9 +43,9 @@ struct _EConfigFactory { struct _EConfigFactory *next, *prev; - char *id; + gchar *id; EConfigFactoryFunc factory; - void *factory_data; + gpointer factory_data; }; struct _menu_node { @@ -55,7 +55,7 @@ struct _menu_node { EConfigItemsFunc free; EConfigItemsFunc abort; EConfigItemsFunc commit; - void *data; + gpointer data; }; struct _widget_node { @@ -74,9 +74,9 @@ struct _widget_node { struct _check_node { struct _check_node *next, *prev; - char *pageid; + gchar *pageid; EConfigCheckFunc check; - void *data; + gpointer data; }; struct _EConfigPrivate { @@ -211,7 +211,7 @@ e_config_get_type(void) * * Return value: @ep is returned. **/ -EConfig *e_config_construct(EConfig *ep, int type, const char *id) +EConfig *e_config_construct(EConfig *ep, gint type, const gchar *id) { g_return_val_if_fail (type == E_CONFIG_BOOK || type == E_CONFIG_DRUID, NULL); @@ -240,7 +240,7 @@ EConfig *e_config_construct(EConfig *ep, int type, const char *id) * TODO: perhaps commit and abort should just be signals. **/ void -e_config_add_items(EConfig *ec, GSList *items, EConfigItemsFunc commitfunc, EConfigItemsFunc abortfunc, EConfigItemsFunc freefunc, void *data) +e_config_add_items(EConfig *ec, GSList *items, EConfigItemsFunc commitfunc, EConfigItemsFunc abortfunc, EConfigItemsFunc freefunc, gpointer data) { struct _menu_node *node; @@ -272,7 +272,7 @@ e_config_add_items(EConfig *ec, GSList *items, EConfigItemsFunc commitfunc, ECon * the druid to continue or the notebook to close. **/ void -e_config_add_page_check(EConfig *ec, const char *pageid, EConfigCheckFunc check, void *data) +e_config_add_page_check(EConfig *ec, const gchar *pageid, EConfigCheckFunc check, gpointer data) { struct _check_node *cn; @@ -301,10 +301,10 @@ ec_add_static_items(EConfig *ec) } static int -ep_cmp(const void *ap, const void *bp) +ep_cmp(gconstpointer ap, gconstpointer bp) { - struct _widget_node *a = *((void **)ap); - struct _widget_node *b = *((void **)bp); + struct _widget_node *a = *((gpointer *)ap); + struct _widget_node *b = *((gpointer *)bp); return strcmp(a->item->path, b->item->path); } @@ -412,7 +412,7 @@ ec_rebuild(EConfig *emp) struct _EConfigPrivate *p = emp->priv; struct _widget_node *wn, *sectionnode = NULL, *pagenode = NULL; GtkWidget *book = NULL, *page = NULL, *section = NULL, *root = NULL, *druid = NULL; - int pageno = 0, sectionno = 0, itemno = 0; + gint pageno = 0, sectionno = 0, itemno = 0; d(printf("target changed, rebuilding:\n")); @@ -550,7 +550,7 @@ ec_rebuild(EConfig *emp) sectionno = 1; /* never want to hide these */ break; case E_CONFIG_PAGE: { - int connect = 0; /* connect druid signals */ + gint connect = 0; /* connect druid signals */ /* CONFIG_PAGEs depend on the config type. E_CONFIG_BOOK: @@ -662,7 +662,7 @@ ec_rebuild(EConfig *emp) } if (translated_label != NULL) { - char *txt = g_strdup_printf("<span weight=\"bold\">%s</span>", translated_label); + gchar *txt = g_strdup_printf("<span weight=\"bold\">%s</span>", translated_label); label = g_object_new(gtk_label_get_type(), "label", txt, @@ -824,7 +824,7 @@ e_config_create_widget(EConfig *emp) GPtrArray *items = g_ptr_array_new(); GSList *l; /*char *domain = NULL;*/ - int i; + gint i; g_return_val_if_fail (emp->target != NULL, NULL); @@ -864,7 +864,7 @@ e_config_create_widget(EConfig *emp) } static void -ec_dialog_response(GtkWidget *d, int id, EConfig *ec) +ec_dialog_response(GtkWidget *d, gint id, EConfig *ec) { if (id == GTK_RESPONSE_OK) e_config_commit(ec); @@ -892,7 +892,7 @@ ec_dialog_response(GtkWidget *d, int id, EConfig *ec) * Return value: The window widget. This is also stored in @emp.window. **/ GtkWidget * -e_config_create_window(EConfig *emp, struct _GtkWindow *parent, const char *title) +e_config_create_window(EConfig *emp, struct _GtkWindow *parent, const gchar *title) { GtkWidget *w; @@ -1037,7 +1037,7 @@ void e_config_commit(EConfig *ec) * * Return value: FALSE if the data is inconsistent/incomplete. **/ -gboolean e_config_page_check(EConfig *ec, const char *pageid) +gboolean e_config_page_check(EConfig *ec, const gchar *pageid) { struct _EConfigPrivate *p = ec->priv; struct _check_node *mnode; @@ -1062,7 +1062,7 @@ gboolean e_config_page_check(EConfig *ec, const char *pageid) * Return value: The page widget. It will be the root GtkNotebook * container or the GnomeDruidPage object. **/ -GtkWidget *e_config_page_get(EConfig *ec, const char *pageid) +GtkWidget *e_config_page_get(EConfig *ec, const gchar *pageid) { struct _widget_node *wn; @@ -1088,10 +1088,10 @@ GtkWidget *e_config_page_get(EConfig *ec, const char *pageid) * Return value: The path of the next page, or @NULL if @pageid was the * last configured and visible page. **/ -const char *e_config_page_next(EConfig *ec, const char *pageid) +const gchar *e_config_page_next(EConfig *ec, const gchar *pageid) { struct _widget_node *wn; - int found; + gint found; found = pageid == NULL ? 1:0; for (wn = (struct _widget_node *)ec->priv->widgets.head;wn->next;wn=wn->next) @@ -1119,10 +1119,10 @@ const char *e_config_page_next(EConfig *ec, const char *pageid) * Return value: The path of the previous page, or @NULL if @pageid was the * first configured and visible page. **/ -const char *e_config_page_prev(EConfig *ec, const char *pageid) +const gchar *e_config_page_prev(EConfig *ec, const gchar *pageid) { struct _widget_node *wn; - int found; + gint found; found = pageid == NULL ? 1:0; for (wn = (struct _widget_node *)ec->priv->widgets.tailpred;wn->prev;wn=wn->prev) @@ -1158,7 +1158,7 @@ const char *e_config_page_prev(EConfig *ec, const char *pageid) * Return value: A handle to the factory. **/ EConfigFactory * -e_config_class_add_factory(EConfigClass *klass, const char *id, EConfigFactoryFunc func, void *data) +e_config_class_add_factory(EConfigClass *klass, const gchar *id, EConfigFactoryFunc func, gpointer data) { struct _EConfigFactory *f = g_malloc0(sizeof(*f)); @@ -1193,7 +1193,7 @@ e_config_class_remove_factory(EConfigClass *klass, EConfigFactory *f) * Allocate a new config target suitable for this class. Implementing * classes will define the actual content of the target. **/ -void *e_config_target_new(EConfig *ep, int type, size_t size) +gpointer e_config_target_new(EConfig *ep, gint type, size_t size) { EConfigTarget *t; @@ -1219,7 +1219,7 @@ void *e_config_target_new(EConfig *ep, int type, size_t size) * free custom targets. **/ void -e_config_target_free(EConfig *ep, void *o) +e_config_target_free(EConfig *ep, gpointer o) { EConfigTarget *t = o; @@ -1253,7 +1253,7 @@ e_config_target_free(EConfig *ep, void *o) */ -static void *emph_parent_class; +static gpointer emph_parent_class; #define emph ((EConfigHook *)eph) static const EPluginHookTargetKey ech_item_types[] = { @@ -1271,7 +1271,7 @@ static const EPluginHookTargetKey ech_item_types[] = { }; static void -ech_commit(EConfig *ec, GSList *items, void *data) +ech_commit(EConfig *ec, GSList *items, gpointer data) { struct _EConfigHookGroup *group = data; @@ -1280,7 +1280,7 @@ ech_commit(EConfig *ec, GSList *items, void *data) } static void -ech_abort(EConfig *ec, GSList *items, void *data) +ech_abort(EConfig *ec, GSList *items, gpointer data) { struct _EConfigHookGroup *group = data; @@ -1289,7 +1289,7 @@ ech_abort(EConfig *ec, GSList *items, void *data) } static gboolean -ech_check(EConfig *ec, const char *pageid, void *data) +ech_check(EConfig *ec, const gchar *pageid, gpointer data) { struct _EConfigHookGroup *group = data; EConfigHookPageCheckData hdata; @@ -1305,7 +1305,7 @@ ech_check(EConfig *ec, const char *pageid, void *data) } static void -ech_config_factory(EConfig *emp, void *data) +ech_config_factory(EConfig *emp, gpointer data) { struct _EConfigHookGroup *group = data; @@ -1342,7 +1342,7 @@ emph_free_group(struct _EConfigHookGroup *group) } static struct _GtkWidget * -ech_config_widget_factory(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, void *data) +ech_config_widget_factory(EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data) { struct _EConfigHookGroup *group = data; @@ -1355,7 +1355,7 @@ ech_config_widget_factory(EConfig *ec, EConfigItem *item, GtkWidget *parent, Gtk hdata.parent = parent; hdata.old = old; - return (struct _GtkWidget *)e_plugin_invoke(group->hook->hook.plugin, (char *)item->user_data, &hdata); + return (struct _GtkWidget *)e_plugin_invoke(group->hook->hook.plugin, (gchar *)item->user_data, &hdata); } else return NULL; } @@ -1380,7 +1380,7 @@ emph_construct_item(EPluginHook *eph, EConfigHookGroup *menu, xmlNodePtr root, E if (item->user_data) item->factory = ech_config_widget_factory; - d(printf(" path=%s label=%s factory=%s\n", item->path, item->label, (char *)item->user_data)); + d(printf(" path=%s label=%s factory=%s\n", item->path, item->label, (gchar *)item->user_data)); return item; error: @@ -1396,12 +1396,12 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) xmlNodePtr node; EConfigHookTargetMap *map; EConfigHookClass *klass = (EConfigHookClass *)G_OBJECT_GET_CLASS(eph); - char *tmp; + gchar *tmp; d(printf(" loading menu\n")); menu = g_malloc0(sizeof(*menu)); - tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); + tmp = (gchar *)xmlGetProp(root, (const guchar *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -1422,7 +1422,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) menu->hook = (EConfigHook *)eph; node = root->children; while (node) { - if (0 == strcmp((char *)node->name, "item")) { + if (0 == strcmp((gchar *)node->name, "item")) { struct _EConfigItem *item; item = emph_construct_item(eph, menu, node, map); @@ -1453,7 +1453,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp((char *)node->name, "group") == 0) { + if (strcmp((gchar *)node->name, "group") == 0) { struct _EConfigHookGroup *group; group = emph_construct_menu(eph, node); @@ -1534,5 +1534,5 @@ e_config_hook_get_type(void) **/ void e_config_hook_class_add_target_map(EConfigHookClass *klass, const EConfigHookTargetMap *map) { - g_hash_table_insert(klass->target_map, (void *)map->type, (void *)map); + g_hash_table_insert(klass->target_map, (gpointer)map->type, (gpointer)map); } diff --git a/e-util/e-config.h b/e-util/e-config.h index b128005c64..afb897477f 100644 --- a/e-util/e-config.h +++ b/e-util/e-config.h @@ -44,13 +44,13 @@ typedef struct _EConfigItem EConfigItem; typedef struct _EConfigFactory EConfigFactory; typedef struct _EConfigTarget EConfigTarget; -typedef void (*EConfigFactoryFunc)(EConfig *ec, void *data); +typedef void (*EConfigFactoryFunc)(EConfig *ec, gpointer data); -typedef gboolean (*EConfigCheckFunc)(EConfig *ec, const char *pageid, void *data); +typedef gboolean (*EConfigCheckFunc)(EConfig *ec, const gchar *pageid, gpointer data); -typedef void (*EConfigItemsFunc)(EConfig *ec, GSList *items, void *data); +typedef void (*EConfigItemsFunc)(EConfig *ec, GSList *items, gpointer data); -typedef struct _GtkWidget * (*EConfigItemFactoryFunc)(EConfig *ec, EConfigItem *, struct _GtkWidget *parent, struct _GtkWidget *old, void *data); +typedef struct _GtkWidget * (*EConfigItemFactoryFunc)(EConfig *ec, EConfigItem *, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data); /* ok so this is all a bit bogussy we need to map to glade stuff instead */ @@ -144,10 +144,10 @@ enum _e_config_t { **/ struct _EConfigItem { enum _e_config_t type; - char *path; /* absolute path, must sort ascii-lexographically into the right spot */ - char *label; + gchar *path; /* absolute path, must sort ascii-lexographically into the right spot */ + gchar *label; EConfigItemFactoryFunc factory; - void *user_data; + gpointer user_data; }; /** @@ -194,9 +194,9 @@ struct _EConfig { struct _EConfigPrivate *priv; - int type; /* E_CONFIG_BOOK or E_CONFIG_DRUID */ + gint type; /* E_CONFIG_BOOK or E_CONFIG_DRUID */ - char *id; + gchar *id; EConfigTarget *target; @@ -230,31 +230,31 @@ struct _EConfigClass { GType e_config_get_type(void); /* Static class methods */ -EConfigFactory *e_config_class_add_factory(EConfigClass *klass, const char *id, EConfigFactoryFunc func, void *data); +EConfigFactory *e_config_class_add_factory(EConfigClass *klass, const gchar *id, EConfigFactoryFunc func, gpointer data); void e_config_class_remove_factory(EConfigClass *klass, EConfigFactory *f); -EConfig *e_config_construct(EConfig *, int type, const char *id); +EConfig *e_config_construct(EConfig *, gint type, const gchar *id); -void e_config_add_items(EConfig *, GSList *items, EConfigItemsFunc commitfunc, EConfigItemsFunc abortfunc, EConfigItemsFunc freefunc, void *data); -void e_config_add_page_check(EConfig *, const char *pageid, EConfigCheckFunc, void *data); +void e_config_add_items(EConfig *, GSList *items, EConfigItemsFunc commitfunc, EConfigItemsFunc abortfunc, EConfigItemsFunc freefunc, gpointer data); +void e_config_add_page_check(EConfig *, const gchar *pageid, EConfigCheckFunc, gpointer data); void e_config_set_target(EConfig *emp, EConfigTarget *target); struct _GtkWidget *e_config_create_widget(EConfig *); -struct _GtkWidget *e_config_create_window(EConfig *emp, struct _GtkWindow *parent, const char *title); +struct _GtkWidget *e_config_create_window(EConfig *emp, struct _GtkWindow *parent, const gchar *title); void e_config_target_changed(EConfig *emp, e_config_target_change_t how); -gboolean e_config_page_check(EConfig *, const char *); +gboolean e_config_page_check(EConfig *, const gchar *); -struct _GtkWidget *e_config_page_get(EConfig *ec, const char *pageid); -const char *e_config_page_next(EConfig *ec, const char *pageid); -const char *e_config_page_prev(EConfig *ec, const char *pageid); +struct _GtkWidget *e_config_page_get(EConfig *ec, const gchar *pageid); +const gchar *e_config_page_next(EConfig *ec, const gchar *pageid); +const gchar *e_config_page_prev(EConfig *ec, const gchar *pageid); void e_config_abort(EConfig *); void e_config_commit(EConfig *); -void *e_config_target_new(EConfig *, int type, size_t size); -void e_config_target_free(EConfig *, void *); +gpointer e_config_target_new(EConfig *, gint type, size_t size); +void e_config_target_free(EConfig *, gpointer ); /* ********************************************************************** */ @@ -314,7 +314,7 @@ struct _EConfigHookItemFactoryData { struct _EConfigHookPageCheckData { EConfig *config; EConfigTarget *target; - const char *pageid; + const gchar *pageid; }; /** @@ -336,12 +336,12 @@ struct _EConfigHookPageCheckData { **/ struct _EConfigHookGroup { struct _EConfigHook *hook; /* parent pointer */ - char *id; /* target menu id for these config items */ - int target_type; /* target type of this group */ + gchar *id; /* target menu id for these config items */ + gint target_type; /* target type of this group */ GSList *items; /* items to add to group */ - char *check; /* validate handler, if set */ - char *commit; /* commit handler, if set */ - char *abort; /* abort handler, if set */ + gchar *check; /* validate handler, if set */ + gchar *commit; /* commit handler, if set */ + gchar *abort; /* abort handler, if set */ }; /** diff --git a/e-util/e-corba-utils.c b/e-util/e-corba-utils.c index f673370bfc..338b88efee 100644 --- a/e-util/e-corba-utils.c +++ b/e-util/e-corba-utils.c @@ -28,7 +28,7 @@ const CORBA_char * -e_safe_corba_string (const char *s) +e_safe_corba_string (const gchar *s) { if (s == NULL) return (CORBA_char *) ""; @@ -37,7 +37,7 @@ e_safe_corba_string (const char *s) } CORBA_char * -e_safe_corba_string_dup (const char *s) +e_safe_corba_string_dup (const gchar *s) { return CORBA_string_dup (e_safe_corba_string (s)); } diff --git a/e-util/e-corba-utils.h b/e-util/e-corba-utils.h index b6da7240e7..c7527ebe26 100644 --- a/e-util/e-corba-utils.h +++ b/e-util/e-corba-utils.h @@ -25,7 +25,7 @@ #include <orbit/orbit.h> -const CORBA_char *e_safe_corba_string (const char *s); -CORBA_char *e_safe_corba_string_dup (const char *s); +const CORBA_char *e_safe_corba_string (const gchar *s); +CORBA_char *e_safe_corba_string_dup (const gchar *s); #endif diff --git a/e-util/e-dialog-utils.c b/e-util/e-dialog-utils.c index 978033541a..b209c84633 100644 --- a/e-util/e-dialog-utils.c +++ b/e-util/e-dialog-utils.c @@ -53,11 +53,11 @@ * button. **/ void -e_notice (gpointer parent, GtkMessageType type, const char *format, ...) +e_notice (gpointer parent, GtkMessageType type, const gchar *format, ...) { GtkWidget *dialog; va_list args; - char *str; + gchar *str; va_start (args, format); str = g_strdup_vprintf (format, args); @@ -87,11 +87,11 @@ e_notice (gpointer parent, GtkMessageType type, const char *format, ...) * window argument. **/ void -e_notice_with_xid (GdkNativeWindow parent, GtkMessageType type, const char *format, ...) +e_notice_with_xid (GdkNativeWindow parent, GtkMessageType type, const gchar *format, ...) { GtkWidget *dialog; va_list args; - char *str; + gchar *str; va_start (args, format); str = g_strdup_vprintf (format, args); @@ -121,9 +121,9 @@ window_is_wm_toplevel (Display *display, Window window) { static Atom WM_STATE = None; unsigned long nitems, after; - unsigned char *data = NULL; + guchar *data = NULL; Atom type = None; - int format; + gint format; if (!WM_STATE) WM_STATE = XInternAtom (display, "WM_STATE", False); @@ -132,7 +132,7 @@ window_is_wm_toplevel (Display *display, Window window) AnyPropertyType, &type, &format, &nitems, &after, &data) == Success) { if (data) - XFree((char*)data); + XFree((gchar *)data); if (type) return TRUE; } @@ -160,7 +160,7 @@ e_dialog_set_transient_for (GtkWindow *dialog, GtkWidget *toplevel; #ifdef GDK_WINDOWING_X11 Window parent, root_ret, *children; - unsigned int numchildren; + guint numchildren; Display *display; Status status; #endif @@ -248,8 +248,8 @@ static void save_ok (GtkWidget *widget, gpointer data) { GtkWidget *fs; - char **filename = data; - char *uri; + gchar **filename = data; + gchar *uri; fs = gtk_widget_get_toplevel (widget); uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fs)); @@ -271,11 +271,11 @@ filechooser_response (GtkWidget *fc, gint response_id, gpointer data) gtk_widget_destroy (fc); } -char * -e_file_dialog_save (const char *title, const char *fname) +gchar * +e_file_dialog_save (const gchar *title, const gchar *fname) { GtkWidget *selection; - char *filename = NULL; + gchar *filename = NULL; selection = e_file_get_save_filesel(NULL, title, fname, GTK_FILE_CHOOSER_ACTION_SAVE); @@ -294,8 +294,8 @@ static void save_folder_ok (GtkWidget *widget, gpointer data) { GtkWidget *fs; - char **filename = data; - char *uri; + gchar **filename = data; + gchar *uri; fs = gtk_widget_get_toplevel (widget); uri = gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (fs)); @@ -315,11 +315,11 @@ folderchooser_response (GtkWidget *fc, gint response_id, gpointer data) gtk_widget_destroy (fc); } -char * -e_file_dialog_save_folder (const char *title) +gchar * +e_file_dialog_save_folder (const gchar *title) { GtkWidget *selection; - char *filename = NULL; + gchar *filename = NULL; selection = e_file_get_save_filesel(NULL, title, NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); g_signal_connect (G_OBJECT (selection), "response", G_CALLBACK (folderchooser_response), &filename); @@ -344,10 +344,10 @@ e_file_dialog_save_folder (const char *title) * no signals connected and is not shown. **/ GtkWidget * -e_file_get_save_filesel (GtkWidget *parent, const char *title, const char *name, GtkFileChooserAction action) +e_file_get_save_filesel (GtkWidget *parent, const gchar *title, const gchar *name, GtkFileChooserAction action) { GtkWidget *filesel; - char *uri; + gchar *uri; filesel = gtk_file_chooser_dialog_new (title, NULL, @@ -382,10 +382,10 @@ e_file_get_save_filesel (GtkWidget *parent, const char *title, const char *name, * it. Returns the users choice. **/ gboolean -e_file_can_save(GtkWindow *parent, const char *uri) +e_file_can_save(GtkWindow *parent, const gchar *uri) { struct stat st; - char *path; + gchar *path; gboolean res; if (!uri || uri[0] == 0) @@ -421,9 +421,9 @@ e_file_can_save(GtkWindow *parent, const char *uri) } gboolean -e_file_check_local (const char *name) +e_file_check_local (const gchar *name) { - char *uri; + gchar *uri; uri = e_util_uri_to_filename (name); if (uri) { diff --git a/e-util/e-dialog-utils.h b/e-util/e-dialog-utils.h index 6b9956ddf9..153c018918 100644 --- a/e-util/e-dialog-utils.h +++ b/e-util/e-dialog-utils.h @@ -27,11 +27,11 @@ void e_notice (gpointer parent, GtkMessageType type, - const char *format, + const gchar *format, ...); void e_notice_with_xid (GdkNativeWindow parent, GtkMessageType type, - const char *format, + const gchar *format, ...); void e_dialog_set_transient_for (GtkWindow *dialog, @@ -39,14 +39,14 @@ void e_dialog_set_transient_for (GtkWindow *dialog, void e_dialog_set_transient_for_xid (GtkWindow *dialog, GdkNativeWindow xid); -char *e_file_dialog_save (const char *title, const char *fname); +gchar *e_file_dialog_save (const gchar *title, const gchar *fname); -char *e_file_dialog_save_folder (const char *title); +gchar *e_file_dialog_save_folder (const gchar *title); -GtkWidget * e_file_get_save_filesel (GtkWidget *parent, const char *title, const char *name, GtkFileChooserAction action); +GtkWidget * e_file_get_save_filesel (GtkWidget *parent, const gchar *title, const gchar *name, GtkFileChooserAction action); -gboolean e_file_can_save(GtkWindow *parent, const char *uri); -gboolean e_file_check_local(const char *name); +gboolean e_file_can_save(GtkWindow *parent, const gchar *uri); +gboolean e_file_check_local(const gchar *name); #endif diff --git a/e-util/e-dialog-widgets.c b/e-util/e-dialog-widgets.c index 98e1be7a74..ae53a17ca7 100644 --- a/e-util/e-dialog-widgets.c +++ b/e-util/e-dialog-widgets.c @@ -80,9 +80,9 @@ get_dialog_hooks (GtkWidget *dialog) * values for the items are provided as a -1-terminated array. */ static int -value_to_index (const int *value_map, int value) +value_to_index (const gint *value_map, gint value) { - int i; + gint i; for (i = 0; value_map[i] != -1; i++) if (value_map[i] == value) @@ -95,9 +95,9 @@ value_to_index (const int *value_map, int value) * function above. */ static int -index_to_value (const int *value_map, int index) +index_to_value (const gint *value_map, gint index) { - int i; + gint i; /* We do this the hard way, i.e. not as a simple array reference, to * check for correctness. @@ -114,13 +114,13 @@ index_to_value (const int *value_map, int index) static void hook_radio (GtkWidget *dialog, GtkRadioButton *radio, gpointer value_var, gpointer info) { - const int *value_map; - int *value; + const gint *value_map; + gint *value; /* Set the value */ - value = (int *) value_var; - value_map = (const int *) info; + value = (gint *) value_var; + value_map = (const gint *) info; e_dialog_radio_set (GTK_WIDGET (radio), *value, value_map); } @@ -129,11 +129,11 @@ hook_radio (GtkWidget *dialog, GtkRadioButton *radio, gpointer value_var, gpoint static void get_radio_value (GtkRadioButton *radio, gpointer value_var, gpointer info) { - int *value; - const int *value_map; + gint *value; + const gint *value_map; - value = (int *) value_var; - value_map = (const int *) info; + value = (gint *) value_var; + value_map = (const gint *) info; *value = e_dialog_radio_get (GTK_WIDGET (radio), value_map); } @@ -191,11 +191,11 @@ get_spin_button_value (GtkSpinButton *spin, gpointer value_var, gpointer info) static void hook_editable (GtkWidget *dialog, GtkEditable *editable, gpointer value_var, gpointer info) { - char **value; + gchar **value; /* Set the value */ - value = (char **) value_var; + value = (gchar **) value_var; e_dialog_editable_set (GTK_WIDGET (editable), *value); } @@ -204,9 +204,9 @@ hook_editable (GtkWidget *dialog, GtkEditable *editable, gpointer value_var, gpo static void get_editable_value (GtkEditable *editable, gpointer value_var, gpointer data) { - char **value; + gchar **value; - value = (char **) value_var; + value = (gchar **) value_var; if (*value) g_free (*value); @@ -221,9 +221,9 @@ get_editable_value (GtkEditable *editable, gpointer value_var, gpointer data) * Sets the string value inside a #GtkEditable-derived widget. **/ void -e_dialog_editable_set (GtkWidget *widget, const char *value) +e_dialog_editable_set (GtkWidget *widget, const gchar *value) { - int pos = 0; + gint pos = 0; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_EDITABLE (widget)); @@ -244,7 +244,7 @@ e_dialog_editable_set (GtkWidget *widget, const char *value) * This function can return NULL if the string could not be converted from * GTK+'s encoding into UTF8. **/ -char * +gchar * e_dialog_editable_get (GtkWidget *widget) { g_return_val_if_fail (widget != NULL, NULL); @@ -268,10 +268,10 @@ e_dialog_editable_get (GtkWidget *widget) * specified as { NEAREST_NEIGHBOR, BILINEAR, HYPERBOLIC, -1 }. **/ void -e_dialog_radio_set (GtkWidget *widget, int value, const int *value_map) +e_dialog_radio_set (GtkWidget *widget, gint value, const gint *value_map) { GSList *group, *l; - int i; + gint i; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_RADIO_BUTTON (widget)); @@ -307,11 +307,11 @@ e_dialog_radio_set (GtkWidget *widget, int value, const int *value_map) * Return value: Enumeration value which corresponds to the selected item in the * radio group. **/ -int -e_dialog_radio_get (GtkWidget *widget, const int *value_map) +gint +e_dialog_radio_get (GtkWidget *widget, const gint *value_map) { GSList *group, *l; - int i, v; + gint i, v; g_return_val_if_fail (widget != NULL, -1); g_return_val_if_fail (GTK_IS_RADIO_BUTTON (widget), -1); @@ -428,7 +428,7 @@ e_dialog_spin_get_double (GtkWidget *widget) * * Return value: Numeric value. **/ -int +gint e_dialog_spin_get_int (GtkWidget *widget) { double value; @@ -451,9 +451,9 @@ e_dialog_spin_get_int (GtkWidget *widget) * indices. **/ void -e_dialog_combo_box_set (GtkWidget *widget, int value, const int *value_map) +e_dialog_combo_box_set (GtkWidget *widget, gint value, const gint *value_map) { - int i; + gint i; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_COMBO_BOX (widget)); @@ -480,10 +480,10 @@ e_dialog_combo_box_set (GtkWidget *widget, int value, const int *value_map) * Return value: Enumeration value which corresponds to the selected item in the * combo box. **/ -int -e_dialog_combo_box_get (GtkWidget *widget, const int *value_map) +gint +e_dialog_combo_box_get (GtkWidget *widget, const gint *value_map) { - int i; + gint i; g_return_val_if_fail (widget != NULL, -1); g_return_val_if_fail (GTK_IS_COMBO_BOX (widget), -1); @@ -506,7 +506,7 @@ e_dialog_combo_box_get (GtkWidget *widget, const int *value_map) * e_dialog_radio_set() for details). * * Hooks a widget from a dialog box to the variable it will modify. Supported - * widgets are: #GtkEditable (char *), #GtkRadioButton (int/value_map pair; see + * widgets are: #GtkEditable (gchar *), #GtkRadioButton (int/value_map pair; see * e_dialog_radio_set() for more information), #GtkTogglebutton (gboolean), * #GtkSpinButton (double), #GtkOptionMenu (int/value_map pair), and * #GnomeDateEdit (time_t). @@ -615,7 +615,7 @@ e_dialog_get_values (GtkWidget *dialog) * otherwise. **/ gboolean -e_dialog_xml_widget_hook_value (GladeXML *xml, GtkWidget *dialog, const char *widget_name, +e_dialog_xml_widget_hook_value (GladeXML *xml, GtkWidget *dialog, const gchar *widget_name, gpointer value_var, gpointer info) { GtkWidget *widget; diff --git a/e-util/e-dialog-widgets.h b/e-util/e-dialog-widgets.h index b7f838539d..b40edc832a 100644 --- a/e-util/e-dialog-widgets.h +++ b/e-util/e-dialog-widgets.h @@ -30,28 +30,28 @@ -void e_dialog_editable_set (GtkWidget *widget, const char *value); -char *e_dialog_editable_get (GtkWidget *widget); +void e_dialog_editable_set (GtkWidget *widget, const gchar *value); +gchar *e_dialog_editable_get (GtkWidget *widget); -void e_dialog_radio_set (GtkWidget *widget, int value, const int *value_map); -int e_dialog_radio_get (GtkWidget *widget, const int *value_map); +void e_dialog_radio_set (GtkWidget *widget, gint value, const gint *value_map); +gint e_dialog_radio_get (GtkWidget *widget, const gint *value_map); void e_dialog_toggle_set (GtkWidget *widget, gboolean value); gboolean e_dialog_toggle_get (GtkWidget *widget); void e_dialog_spin_set (GtkWidget *widget, double value); double e_dialog_spin_get_double (GtkWidget *widget); -int e_dialog_spin_get_int (GtkWidget *widget); +gint e_dialog_spin_get_int (GtkWidget *widget); -void e_dialog_combo_box_set (GtkWidget *widget, int value, const int *value_map); -int e_dialog_combo_box_get (GtkWidget *widget, const int *value_map); +void e_dialog_combo_box_set (GtkWidget *widget, gint value, const gint *value_map); +gint e_dialog_combo_box_get (GtkWidget *widget, const gint *value_map); gboolean e_dialog_widget_hook_value (GtkWidget *dialog, GtkWidget *widget, gpointer value_var, gpointer info); void e_dialog_get_values (GtkWidget *dialog); -gboolean e_dialog_xml_widget_hook_value (GladeXML *xml, GtkWidget *dialog, const char *widget_name, +gboolean e_dialog_xml_widget_hook_value (GladeXML *xml, GtkWidget *dialog, const gchar *widget_name, gpointer value_var, gpointer info); diff --git a/e-util/e-error.c b/e-util/e-error.c index f2067950bc..c35e8b2dde 100644 --- a/e-util/e-error.c +++ b/e-util/e-error.c @@ -99,9 +99,9 @@ static struct { }; static int -map_response(const char *name) +map_response(const gchar *name) { - int i; + gint i; for (i=0;i<sizeof(response_map)/sizeof(response_map[0]);i++) if (!strcmp(name, response_map[i].name)) @@ -122,9 +122,9 @@ static struct { }; static int -map_type(const char *name) +map_type(const gchar *name) { - int i; + gint i; if (name) { for (i=0;i<sizeof(type_map)/sizeof(type_map[0]);i++) @@ -151,14 +151,14 @@ map_type(const char *name) */ static void -ee_load(const char *path) +ee_load(const gchar *path) { xmlDocPtr doc = NULL; xmlNodePtr root, error, scan; struct _e_error *e; struct _e_error_button *lastbutton; struct _e_error_table *table; - char *tmp; + gchar *tmp; d(printf("loading error file %s\n", path)); @@ -170,8 +170,8 @@ ee_load(const char *path) root = xmlDocGetRootElement(doc); if (root == NULL - || strcmp((char *)root->name, "error-list") != 0 - || (tmp = (char *)xmlGetProp(root, (const unsigned char *)"domain")) == NULL) { + || strcmp((gchar *)root->name, "error-list") != 0 + || (tmp = (gchar *)xmlGetProp(root, (const guchar *)"domain")) == NULL) { g_warning("Error file '%s' invalid format", path); xmlFreeDoc(doc); return; @@ -179,19 +179,19 @@ ee_load(const char *path) table = g_hash_table_lookup(error_table, tmp); if (table == NULL) { - char *tmp2; + gchar *tmp2; table = g_malloc0(sizeof(*table)); table->domain = g_strdup(tmp); table->errors = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(error_table, (gpointer) table->domain, table); - tmp2 = (char *)xmlGetProp(root, (const unsigned char *)"translation-domain"); + tmp2 = (gchar *)xmlGetProp(root, (const guchar *)"translation-domain"); if (tmp2) { table->translation_domain = g_strdup(tmp2); xmlFree(tmp2); - tmp2 = (char *)xmlGetProp(root, (const unsigned char *)"translation-localedir"); + tmp2 = (gchar *)xmlGetProp(root, (const guchar *)"translation-localedir"); if (tmp2) { bindtextdomain(table->translation_domain, tmp2); xmlFree(tmp2); @@ -202,8 +202,8 @@ ee_load(const char *path) xmlFree(tmp); for (error = root->children;error;error = error->next) { - if (!strcmp((char *)error->name, "error")) { - tmp = (char *)xmlGetProp(error, (const unsigned char *)"id"); + if (!strcmp((gchar *)error->name, "error")) { + tmp = (gchar *)xmlGetProp(error, (const guchar *)"id"); if (tmp == NULL) continue; @@ -214,25 +214,25 @@ ee_load(const char *path) xmlFree(tmp); lastbutton = (struct _e_error_button *)&e->buttons; - tmp = (char *)xmlGetProp(error, (const unsigned char *)"modal"); + tmp = (gchar *)xmlGetProp(error, (const guchar *)"modal"); if (tmp) { if (!strcmp(tmp, "true")) e->flags |= GTK_DIALOG_MODAL; xmlFree(tmp); } - tmp = (char *)xmlGetProp(error, (const unsigned char *)"type"); + tmp = (gchar *)xmlGetProp(error, (const guchar *)"type"); e->type = map_type(tmp); if (tmp) xmlFree(tmp); - tmp = (char *)xmlGetProp(error, (const unsigned char *)"default"); + tmp = (gchar *)xmlGetProp(error, (const guchar *)"default"); if (tmp) { e->default_response = map_response(tmp); xmlFree(tmp); } - tmp = (char *)xmlGetProp(error, (const unsigned char *)"scroll"); + tmp = (gchar *)xmlGetProp(error, (const guchar *)"scroll"); if (tmp) { if (!strcmp(tmp, "yes")) e->scroll = TRUE; @@ -240,46 +240,46 @@ ee_load(const char *path) } for (scan = error->children;scan;scan=scan->next) { - if (!strcmp((char *)scan->name, "primary")) { - if ((tmp = (char *)xmlNodeGetContent(scan))) { + if (!strcmp((gchar *)scan->name, "primary")) { + if ((tmp = (gchar *)xmlNodeGetContent(scan))) { e->primary = g_strdup(dgettext(table->translation_domain, tmp)); xmlFree(tmp); } - } else if (!strcmp((char *)scan->name, "secondary")) { - if ((tmp = (char *)xmlNodeGetContent(scan))) { + } else if (!strcmp((gchar *)scan->name, "secondary")) { + if ((tmp = (gchar *)xmlNodeGetContent(scan))) { e->secondary = g_strdup(dgettext(table->translation_domain, tmp)); xmlFree(tmp); } - } else if (!strcmp((char *)scan->name, "title")) { - if ((tmp = (char *)xmlNodeGetContent(scan))) { + } else if (!strcmp((gchar *)scan->name, "title")) { + if ((tmp = (gchar *)xmlNodeGetContent(scan))) { e->title = g_strdup(dgettext(table->translation_domain, tmp)); xmlFree(tmp); } - } else if (!strcmp((char *)scan->name, "help")) { - tmp = (char *)xmlGetProp(scan, (const unsigned char *)"uri"); + } else if (!strcmp((gchar *)scan->name, "help")) { + tmp = (gchar *)xmlGetProp(scan, (const guchar *)"uri"); if (tmp) { e->help_uri = g_strdup(tmp); xmlFree(tmp); } - } else if (!strcmp((char *)scan->name, "button")) { + } else if (!strcmp((gchar *)scan->name, "button")) { struct _e_error_button *b; gchar *label = NULL; gchar *stock = NULL; b = g_malloc0(sizeof(*b)); - tmp = (char *)xmlGetProp(scan, (const unsigned char *)"stock"); + tmp = (gchar *)xmlGetProp(scan, (const guchar *)"stock"); if (tmp) { stock = g_strdup(tmp); b->stock = stock; xmlFree(tmp); } - tmp = (char *)xmlGetProp(scan, (const unsigned char *)"label"); + tmp = (gchar *)xmlGetProp(scan, (const guchar *)"label"); if (tmp) { label = g_strdup(dgettext(table->translation_domain, tmp)); b->label = label; xmlFree(tmp); } - tmp = (char *)xmlGetProp(scan, (const unsigned char *)"response"); + tmp = (gchar *)xmlGetProp(scan, (const guchar *)"response"); if (tmp) { b->response = map_response(tmp); xmlFree(tmp); @@ -308,10 +308,10 @@ static void ee_load_tables(void) { GDir *dir; - const char *d; - char *base; + const gchar *d; + gchar *base; struct _e_error_table *table; - int i; + gint i; if (error_table != NULL) return; @@ -335,7 +335,7 @@ ee_load_tables(void) } while ( (d = g_dir_read_name(dir)) ) { - char *path; + gchar *path; if (d[0] == '.') continue; @@ -351,9 +351,9 @@ ee_load_tables(void) /* unfortunately, gmarkup_escape doesn't expose its gstring based api :( */ static void -ee_append_text(GString *out, const char *text) +ee_append_text(GString *out, const gchar *text) { - char c; + gchar c; while ( (c=*text++) ) { if (c == '<') @@ -372,11 +372,11 @@ ee_append_text(GString *out, const char *text) } static void -ee_build_label(GString *out, const char *fmt, GPtrArray *args, +ee_build_label(GString *out, const gchar *fmt, GPtrArray *args, gboolean escape_args) { - const char *end, *newstart; - int id; + const gchar *end, *newstart; + gint id; while (fmt && (newstart = strchr(fmt, '{')) @@ -406,13 +406,13 @@ ee_response(GtkWidget *w, guint button, struct _e_error *e) } GtkWidget * -e_error_newv(GtkWindow *parent, const char *tag, const char *arg0, va_list ap) +e_error_newv(GtkWindow *parent, const gchar *tag, const gchar *arg0, va_list ap) { struct _e_error_table *table; struct _e_error *e; struct _e_error_button *b; GtkWidget *hbox, *w, *scroll=NULL; - char *tmp, *domain, *id; + gchar *tmp, *domain, *id; GString *out, *oerr; GPtrArray *args; GtkDialog *dialog; @@ -503,10 +503,10 @@ e_error_newv(GtkWindow *parent, const char *tag, const char *arg0, va_list ap) gtk_box_pack_start((GtkBox *)hbox, w, FALSE, FALSE, 12); args = g_ptr_array_new(); - tmp = (char *)arg0; + tmp = (gchar *)arg0; while (tmp) { g_ptr_array_add(args, tmp); - tmp = va_arg(ap, char *); + tmp = va_arg(ap, gchar *); } out = g_string_new(""); @@ -581,7 +581,7 @@ e_error_newv(GtkWindow *parent, const char *tag, const char *arg0, va_list ap) * dialog asynchronously. **/ struct _GtkWidget * -e_error_new(struct _GtkWindow *parent, const char *tag, const char *arg0, ...) +e_error_new(struct _GtkWindow *parent, const gchar *tag, const gchar *arg0, ...) { GtkWidget *w; va_list ap; @@ -593,11 +593,11 @@ e_error_new(struct _GtkWindow *parent, const char *tag, const char *arg0, ...) return w; } -int -e_error_runv(GtkWindow *parent, const char *tag, const char *arg0, va_list ap) +gint +e_error_runv(GtkWindow *parent, const gchar *tag, const gchar *arg0, va_list ap) { GtkWidget *w; - int res; + gint res; w = e_error_newv(parent, tag, arg0, ap); @@ -618,12 +618,12 @@ e_error_runv(GtkWindow *parent, const char *tag, const char *arg0, va_list ap) * * Return value: The response id of the button pressed. **/ -int -e_error_run(GtkWindow *parent, const char *tag, const char *arg0, ...) +gint +e_error_run(GtkWindow *parent, const gchar *tag, const gchar *arg0, ...) { GtkWidget *w; va_list ap; - int res; + gint res; va_start(ap, arg0); w = e_error_newv(parent, tag, arg0, ap); diff --git a/e-util/e-error.h b/e-util/e-error.h index 014f74ee88..6b66a6da31 100644 --- a/e-util/e-error.h +++ b/e-util/e-error.h @@ -50,11 +50,11 @@ struct _GtkWindow; #define E_ERROR_NO_LOAD_FILE "system:no-save-file" /* Note that all errors returned are standard GtkDialoge's */ -struct _GtkWidget *e_error_new(struct _GtkWindow *parent, const char *tag, const char *arg0, ...); -struct _GtkWidget *e_error_newv(struct _GtkWindow *parent, const char *tag, const char *arg0, va_list ap); +struct _GtkWidget *e_error_new(struct _GtkWindow *parent, const gchar *tag, const gchar *arg0, ...); +struct _GtkWidget *e_error_newv(struct _GtkWindow *parent, const gchar *tag, const gchar *arg0, va_list ap); -int e_error_run(struct _GtkWindow *parent, const char *tag, const char *arg0, ...); -int e_error_runv(struct _GtkWindow *parent, const char *tag, const char *arg0, va_list ap); +gint e_error_run(struct _GtkWindow *parent, const gchar *tag, const gchar *arg0, ...); +gint e_error_runv(struct _GtkWindow *parent, const gchar *tag, const gchar *arg0, va_list ap); guint e_error_count_buttons (GtkDialog *dialog); diff --git a/e-util/e-event.c b/e-util/e-event.c index ab96701abc..d449030c0b 100644 --- a/e-util/e-event.c +++ b/e-util/e-event.c @@ -39,16 +39,16 @@ struct _EEventFactory { struct _EEventFactory *next, *prev; - char *menuid; + gchar *menuid; EEventFactoryFunc factory; - void *factory_data; + gpointer factory_data; }; struct _event_node { struct _event_node *next, *prev; GSList *events; - void *data; + gpointer data; EEventItemsFunc freefunc; }; @@ -155,7 +155,7 @@ e_event_get_type(void) * * Return value: Returns @ep. **/ -EEvent *e_event_construct(EEvent *ep, const char *id) +EEvent *e_event_construct(EEvent *ep, const gchar *id) { ep->id = g_strdup(id); @@ -173,8 +173,8 @@ EEvent *e_event_construct(EEvent *ep, const char *id) * * Return value: An opaque key which can later be passed to remove_items. **/ -void * -e_event_add_items(EEvent *emp, GSList *items, EEventItemsFunc freefunc, void *data) +gpointer +e_event_add_items(EEvent *emp, GSList *items, EEventItemsFunc freefunc, gpointer data) { struct _event_node *node; @@ -190,7 +190,7 @@ e_event_add_items(EEvent *emp, GSList *items, EEventItemsFunc freefunc, void *da emp->priv->sorted = NULL; } - return (void *)node; + return (gpointer)node; } /** @@ -202,7 +202,7 @@ e_event_add_items(EEvent *emp, GSList *items, EEventItemsFunc freefunc, void *da * added, and may only be removed once. **/ void -e_event_remove_items(EEvent *emp, void *handle) +e_event_remove_items(EEvent *emp, gpointer handle) { struct _event_node *node = handle; @@ -219,10 +219,10 @@ e_event_remove_items(EEvent *emp, void *handle) } static int -ee_cmp(const void *ap, const void *bp) +ee_cmp(gconstpointer ap, gconstpointer bp) { - int a = ((struct _event_info **)ap)[0]->item->priority; - int b = ((struct _event_info **)bp)[0]->item->priority; + gint a = ((struct _event_info **)ap)[0]->item->priority; + gint b = ((struct _event_info **)bp)[0]->item->priority; if (a < b) return 1; @@ -242,7 +242,7 @@ ee_cmp(const void *ap, const void *bp) * emission is complete. **/ void -e_event_emit(EEvent *emp, const char *id, EEventTarget *target) +e_event_emit(EEvent *emp, const gchar *id, EEventTarget *target) { struct _EEventPrivate *p = emp->priv; GSList *events; @@ -306,7 +306,7 @@ e_event_emit(EEvent *emp, const char *id, EEventTarget *target) * the implementation to define the available target types and their * structure. **/ -void *e_event_target_new(EEvent *ep, int type, size_t size) +gpointer e_event_target_new(EEvent *ep, gint type, size_t size) { EEventTarget *t; @@ -331,7 +331,7 @@ void *e_event_target_new(EEvent *ep, int type, size_t size) * Free a target. This invokes the virtual free method on the EEventClass. **/ void -e_event_target_free(EEvent *ep, void *o) +e_event_target_free(EEvent *ep, gpointer o) { EEventTarget *t = o; @@ -380,7 +380,7 @@ e_event_target_free(EEvent *ep, void *o) */ -static void *emph_parent_class; +static gpointer emph_parent_class; #define emph ((EEventHook *)eph) /* must have 1:1 correspondence with e-event types in order */ @@ -391,7 +391,7 @@ static const EPluginHookTargetKey emph_item_types[] = { }; static void -emph_event_handle(EEvent *ee, EEventItem *item, void *data) +emph_event_handle(EEvent *ee, EEventItem *item, gpointer data) { struct _EEventHook *hook = data; @@ -399,19 +399,19 @@ emph_event_handle(EEvent *ee, EEventItem *item, void *data) if (!hook->hook.plugin->enabled) return; - e_plugin_invoke(hook->hook.plugin, (char *)item->user_data, ee->target); + e_plugin_invoke(hook->hook.plugin, (gchar *)item->user_data, ee->target); } static void emph_free_item(struct _EEventItem *item) { - g_free((char *)item->id); + g_free((gchar *)item->id); g_free(item->user_data); g_free(item); } static void -emph_free_items(EEvent *ee, GSList *items, void *data) +emph_free_items(EEvent *ee, GSList *items, gpointer data) { /*EPluginHook *eph = data;*/ @@ -424,11 +424,11 @@ emph_construct_item(EPluginHook *eph, xmlNodePtr root, EEventHookClass *klass) { struct _EEventItem *item; EEventHookTargetMap *map; - char *tmp; + gchar *tmp; item = g_malloc0(sizeof(*item)); - tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); + tmp = (gchar *)xmlGetProp(root, (const guchar *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -473,7 +473,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp((char *)node->name, "event") == 0) { + if (strcmp((gchar *)node->name, "event") == 0) { struct _EEventItem *item; item = emph_construct_item(eph, node, klass); @@ -551,5 +551,5 @@ e_event_hook_get_type(void) **/ void e_event_hook_class_add_target_map(EEventHookClass *klass, const EEventHookTargetMap *map) { - g_hash_table_insert(klass->target_map, (void *)map->type, (void *)map); + g_hash_table_insert(klass->target_map, (gpointer)map->type, (gpointer)map); } diff --git a/e-util/e-event.h b/e-util/e-event.h index 5b4e3f44ab..5ae3b61d1b 100644 --- a/e-util/e-event.h +++ b/e-util/e-event.h @@ -44,9 +44,9 @@ typedef struct _EEventItem EEventItem; typedef struct _EEventFactory EEventFactory; /* anonymous type */ typedef struct _EEventTarget EEventTarget; -typedef void (*EEventItemsFunc)(EEvent *ee, GSList *items, void *data); -typedef void (*EEventFunc)(EEvent *ee, EEventItem *item, void *data); -typedef void (*EEventFactoryFunc)(EEvent *ee, void *); +typedef void (*EEventItemsFunc)(EEvent *ee, GSList *items, gpointer data); +typedef void (*EEventFunc)(EEvent *ee, EEventItem *item, gpointer data); +typedef void (*EEventFactoryFunc)(EEvent *ee, gpointer ); /** * enum _e_event_t - Event type. @@ -86,11 +86,11 @@ enum _e_event_t { **/ struct _EEventItem { enum _e_event_t type; - int priority; /* priority of event */ - const char *id; /* event id */ - int target_type; + gint priority; /* priority of event */ + const gchar *id; /* event id */ + gint target_type; EEventFunc handle; - void *user_data; + gpointer user_data; guint32 enable; /* enable mask */ }; @@ -133,7 +133,7 @@ struct _EEvent { GObject object; struct _EEventPrivate *priv; - char *id; + gchar *id; EEventTarget *target; /* current target during event emission */ }; @@ -156,15 +156,15 @@ struct _EEventClass { GType e_event_get_type(void); -EEvent *e_event_construct(EEvent *, const char *id); +EEvent *e_event_construct(EEvent *, const gchar *id); -void *e_event_add_items(EEvent *emp, GSList *items, EEventItemsFunc freefunc, void *data); -void e_event_remove_items(EEvent *emp, void *handle); +gpointer e_event_add_items(EEvent *emp, GSList *items, EEventItemsFunc freefunc, gpointer data); +void e_event_remove_items(EEvent *emp, gpointer handle); -void e_event_emit(EEvent *, const char *id, EEventTarget *); +void e_event_emit(EEvent *, const gchar *id, EEventTarget *); -void *e_event_target_new(EEvent *, int type, size_t size); -void e_event_target_free(EEvent *, void *); +gpointer e_event_target_new(EEvent *, gint type, size_t size); +void e_event_target_free(EEvent *, gpointer ); /* ********************************************************************** */ diff --git a/e-util/e-folder-map.c b/e-util/e-folder-map.c index d74817ecfe..c77772f289 100644 --- a/e-util/e-folder-map.c +++ b/e-util/e-folder-map.c @@ -41,11 +41,11 @@ #define d(x) static gboolean -is_type_folder (const char *metadata, const char *search_type) +is_type_folder (const gchar *metadata, const gchar *search_type) { xmlNodePtr node; xmlDocPtr doc; - char *type; + gchar *type; doc = e_xml_parse_file (metadata); if (!doc) { @@ -59,7 +59,7 @@ is_type_folder (const char *metadata, const char *search_type) return FALSE; } - if (!node->name || strcmp ((char *)node->name, "efolder") != 0) { + if (!node->name || strcmp ((gchar *)node->name, "efolder") != 0) { g_warning ("`%s' corrupt: root node is not 'efolder'", metadata); xmlFreeDoc (doc); return FALSE; @@ -67,8 +67,8 @@ is_type_folder (const char *metadata, const char *search_type) node = node->children; while (node != NULL) { - if (node->name && !strcmp ((char *)node->name, "type")) { - type = (char *)xmlNodeGetContent (node); + if (node->name && !strcmp ((gchar *)node->name, "type")) { + type = (gchar *)xmlNodeGetContent (node); if (!strcmp (type, search_type)) { xmlFreeDoc (doc); xmlFree (type); @@ -90,10 +90,10 @@ is_type_folder (const char *metadata, const char *search_type) } static void -e_folder_map_dir (const char *dirname, const char *type, GSList **dir_list) +e_folder_map_dir (const gchar *dirname, const gchar *type, GSList **dir_list) { - char *path; - const char *name; + gchar *path; + const gchar *name; GDir *dir; GError *error = NULL; @@ -129,7 +129,7 @@ e_folder_map_dir (const char *dirname, const char *type, GSList **dir_list) } while ((name = g_dir_read_name (dir))) { - char *full_path; + gchar *full_path; if (*name == '.') continue; @@ -152,7 +152,7 @@ e_folder_map_dir (const char *dirname, const char *type, GSList **dir_list) GSList * e_folder_map_local_folders (const gchar *local_dir, const gchar *type) { - const char *name; + const gchar *name; GDir *dir; GSList *dir_list = NULL; GError *error = NULL; @@ -164,7 +164,7 @@ e_folder_map_local_folders (const gchar *local_dir, const gchar *type) } while ((name = g_dir_read_name (dir))) { - char *full_path; + gchar *full_path; if (*name == '.') continue; diff --git a/e-util/e-fsutils.c b/e-util/e-fsutils.c index 27480959c4..335fad4aff 100644 --- a/e-util/e-fsutils.c +++ b/e-util/e-fsutils.c @@ -60,10 +60,10 @@ * Return value: The number of 1024 byte blocks used by the * filesystem. **/ -long e_fsutils_usage(const char *inpath) +long e_fsutils_usage(const gchar *inpath) { GDir *dir; - const char *d; + const gchar *d; long size = 0; GSList *paths; @@ -71,7 +71,7 @@ long e_fsutils_usage(const char *inpath) paths = g_slist_prepend(NULL, g_strdup(inpath)); while (paths) { - char *path = paths->data; + gchar *path = paths->data; paths = g_slist_remove_link(paths, paths); @@ -82,7 +82,7 @@ long e_fsutils_usage(const char *inpath) } while ((d = g_dir_read_name(dir))) { - char *full_path; + gchar *full_path; struct stat st; full_path = g_build_filename(path, d, NULL); @@ -129,7 +129,7 @@ fail: * blocks. **/ long -e_fsutils_avail(const char *path) +e_fsutils_avail(const gchar *path) { #if defined(HAVE_STATVFS) struct statvfs stfs; diff --git a/e-util/e-fsutils.h b/e-util/e-fsutils.h index 76a03f5441..d675b39e80 100644 --- a/e-util/e-fsutils.h +++ b/e-util/e-fsutils.h @@ -27,8 +27,8 @@ G_BEGIN_DECLS -long e_fsutils_usage(const char *path); -long e_fsutils_avail(const char *path); +long e_fsutils_usage(const gchar *path); +long e_fsutils_avail(const gchar *path); G_END_DECLS diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index 4958f0806e..619cb6599e 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -27,11 +27,11 @@ #include "e-html-utils.h" -static char * -check_size (char **buffer, int *buffer_size, char *out, int len) +static gchar * +check_size (gchar **buffer, gint *buffer_size, gchar *out, gint len) { if (out + len + 1> *buffer + *buffer_size) { - int index = out - *buffer; + gint index = out - *buffer; *buffer_size = MAX (index + len + 1, *buffer_size * 2); *buffer = g_realloc (*buffer, *buffer_size); @@ -49,7 +49,7 @@ check_size (char **buffer, int *buffer_size, char *out, int len) * 4 = allowed dns chars * 8 = non-url chars: "| */ -static int special_chars[] = { +static gint special_chars[] = { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, /* nul - 0x0f */ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, /* 0x10 - 0x1f */ 9, 2, 9, 0, 0, 0, 0, 3, 1, 3, 0, 0, 3, 6, 6, 0, /* sp - / */ @@ -68,11 +68,11 @@ static int special_chars[] = { /* (http|https|ftp|nntp)://[^ "|/]+\.([^ "|]*[^ ,.!?;:>)\]}`'"|_-])+ */ /* www\.[A-Za-z0-9.-]+(/([^ "|]*[^ ,.!?;:>)\]}`'"|_-])+) */ -static char * -url_extract (const unsigned char **text, gboolean full_url) +static gchar * +url_extract (const guchar **text, gboolean full_url) { - const unsigned char *end = *text, *p; - char *out; + const guchar *end = *text, *p; + gchar *out; while (*end && is_url_char (*end)) end++; @@ -96,16 +96,16 @@ url_extract (const unsigned char **text, gboolean full_url) return NULL; } - out = g_strndup ((char *)*text, end - *text); + out = g_strndup ((gchar *)*text, end - *text); *text = end; return out; } -static char * -email_address_extract (const unsigned char **cur, char **out, const unsigned char *linestart) +static gchar * +email_address_extract (const guchar **cur, gchar **out, const guchar *linestart) { - const unsigned char *start, *end, *dot; - char *addr; + const guchar *start, *end, *dot; + gchar *addr; /* *cur points to the '@'. Look backward for a valid local-part */ for (start = *cur; start - 1 >= linestart && is_addr_char (*(start - 1)); start--) @@ -130,7 +130,7 @@ email_address_extract (const unsigned char **cur, char **out, const unsigned cha if (dot > end) return NULL; - addr = g_strndup ((char *)start, end - start); + addr = g_strndup ((gchar *)start, end - start); *out -= *cur - start; *cur = end; @@ -138,9 +138,9 @@ email_address_extract (const unsigned char **cur, char **out, const unsigned cha } static gboolean -is_citation (const unsigned char *c, gboolean saw_citation) +is_citation (const guchar *c, gboolean saw_citation) { - const unsigned char *p; + const guchar *p; if (*c != '>') return FALSE; @@ -148,7 +148,7 @@ is_citation (const unsigned char *c, gboolean saw_citation) /* A line that starts with a ">" is a citation, unless it's * just mbox From-mangling... */ - if (strncmp ((const char *)c, ">From ", 6) != 0) + if (strncmp ((const gchar *)c, ">From ", 6) != 0) return TRUE; /* If the previous line was a citation, then say this @@ -158,7 +158,7 @@ is_citation (const unsigned char *c, gboolean saw_citation) return TRUE; /* Same if the next line is */ - p = (const unsigned char *)strchr ((const char *)c, '\n'); + p = (const guchar *)strchr ((const gchar *)c, '\n'); if (p && *++p == '>') return TRUE; @@ -211,13 +211,13 @@ is_citation (const unsigned char *c, gboolean saw_citation) * - E_TEXT_TO_HTML_CITE: quote the text with "> " at the start of each * line. **/ -char * -e_text_to_html_full (const char *input, unsigned int flags, guint32 color) +gchar * +e_text_to_html_full (const gchar *input, guint flags, guint32 color) { - const unsigned char *cur, *next, *linestart; - char *buffer = NULL; - char *out = NULL; - int buffer_size = 0, col; + const guchar *cur, *next, *linestart; + gchar *buffer = NULL; + gchar *out = NULL; + gint buffer_size = 0, col; gboolean colored = FALSE, saw_citation = FALSE; /* Allocate a translation buffer. */ @@ -230,7 +230,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) col = 0; - for (cur = linestart = (const unsigned char *)input; cur && *cur; cur = next) { + for (cur = linestart = (const guchar *)input; cur && *cur; cur = next) { gunichar u; if (flags & E_TEXT_TO_HTML_MARK_CITATION && col == 0) { @@ -261,28 +261,28 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) out += sprintf (out, "> "); } - u = g_utf8_get_char ((char *)cur); + u = g_utf8_get_char ((gchar *)cur); if (g_unichar_isalpha (u) && (flags & E_TEXT_TO_HTML_CONVERT_URLS)) { - char *tmpurl = NULL, *refurl = NULL, *dispurl = NULL; - - if (!g_ascii_strncasecmp ((char *)cur, "http://", 7) || - !g_ascii_strncasecmp ((char *)cur, "https://", 8) || - !g_ascii_strncasecmp ((char *)cur, "ftp://", 6) || - !g_ascii_strncasecmp ((char *)cur, "nntp://", 7) || - !g_ascii_strncasecmp ((char *)cur, "mailto:", 7) || - !g_ascii_strncasecmp ((char *)cur, "news:", 5) || - !g_ascii_strncasecmp ((char *)cur, "file:", 5) || - !g_ascii_strncasecmp ((char *)cur, "callto:", 7) || - !g_ascii_strncasecmp ((char *)cur, "h323:", 5) || - !g_ascii_strncasecmp ((char *)cur, "sip:", 4) || - !g_ascii_strncasecmp ((char *)cur, "webcal:", 7)) { + gchar *tmpurl = NULL, *refurl = NULL, *dispurl = NULL; + + if (!g_ascii_strncasecmp ((gchar *)cur, "http://", 7) || + !g_ascii_strncasecmp ((gchar *)cur, "https://", 8) || + !g_ascii_strncasecmp ((gchar *)cur, "ftp://", 6) || + !g_ascii_strncasecmp ((gchar *)cur, "nntp://", 7) || + !g_ascii_strncasecmp ((gchar *)cur, "mailto:", 7) || + !g_ascii_strncasecmp ((gchar *)cur, "news:", 5) || + !g_ascii_strncasecmp ((gchar *)cur, "file:", 5) || + !g_ascii_strncasecmp ((gchar *)cur, "callto:", 7) || + !g_ascii_strncasecmp ((gchar *)cur, "h323:", 5) || + !g_ascii_strncasecmp ((gchar *)cur, "sip:", 4) || + !g_ascii_strncasecmp ((gchar *)cur, "webcal:", 7)) { tmpurl = url_extract (&cur, TRUE); if (tmpurl) { refurl = e_text_to_html (tmpurl, 0); dispurl = g_strdup (refurl); } - } else if (!g_ascii_strncasecmp ((char *)cur, "www.", 4) && + } else if (!g_ascii_strncasecmp ((gchar *)cur, "www.", 4) && is_url_char (*(cur + 4))) { tmpurl = url_extract (&cur, FALSE); if (tmpurl) { @@ -307,11 +307,11 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) if (!*cur) break; - u = g_utf8_get_char ((char *)cur); + u = g_utf8_get_char ((gchar *)cur); } if (u == '@' && (flags & E_TEXT_TO_HTML_CONVERT_ADDRESSES)) { - char *addr, *dispaddr, *outaddr; + gchar *addr, *dispaddr, *outaddr; addr = email_address_extract (&cur, &out, linestart); if (addr) { @@ -327,7 +327,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) if (!*cur) break; - u = g_utf8_get_char ((char *)cur); + u = g_utf8_get_char ((gchar *)cur); } } @@ -338,7 +338,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) u = *cur; next = cur + 1; } else - next = (const unsigned char *)g_utf8_next_char (cur); + next = (const guchar *)g_utf8_next_char (cur); out = check_size (&buffer, &buffer_size, out, 10); @@ -393,7 +393,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) case ' ': if (flags & E_TEXT_TO_HTML_CONVERT_SPACES) { - if (cur == (const unsigned char *)input || + if (cur == (const guchar *)input || *(cur + 1) == ' ' || *(cur + 1) == '\t' || *(cur - 1) == '\n') { strcpy (out, " "); @@ -429,8 +429,8 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) return buffer; } -char * -e_text_to_html (const char *input, unsigned int flags) +gchar * +e_text_to_html (const gchar *input, guint flags) { return e_text_to_html_full (input, flags, 0); } @@ -439,7 +439,7 @@ e_text_to_html (const char *input, unsigned int flags) #ifdef E_HTML_UTILS_TEST struct { - char *text, *url; + gchar *text, *url; } url_tests[] = { { "bob@foo.com", "mailto:bob@foo.com" }, { "Ends with bob@foo.com", "mailto:bob@foo.com" }, @@ -487,13 +487,13 @@ struct { { "Ewwwwww.Gross.", NULL }, }; -int num_url_tests = G_N_ELEMENTS (url_tests); +gint num_url_tests = G_N_ELEMENTS (url_tests); -int -main (int argc, char **argv) +gint +main (gint argc, gchar **argv) { - int i, errors = 0; - char *html, *url, *p; + gint i, errors = 0; + gchar *html, *url, *p; for (i = 0; i < num_url_tests; i++) { html = e_text_to_html (url_tests[i].text, E_TEXT_TO_HTML_CONVERT_URLS | E_TEXT_TO_HTML_CONVERT_ADDRESSES); diff --git a/e-util/e-html-utils.h b/e-util/e-html-utils.h index 55e67ba915..f87e82f9b1 100644 --- a/e-util/e-html-utils.h +++ b/e-util/e-html-utils.h @@ -34,7 +34,7 @@ #define E_TEXT_TO_HTML_ESCAPE_8BIT (1 << 6) #define E_TEXT_TO_HTML_CITE (1 << 7) -char *e_text_to_html_full (const char *input, unsigned int flags, guint32 color); -char *e_text_to_html (const char *input, unsigned int flags); +gchar *e_text_to_html_full (const gchar *input, guint flags, guint32 color); +gchar *e_text_to_html (const gchar *input, guint flags); #endif /* __E_HTML_UTILS__ */ diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c index 5b1cd2f9bd..dddd4fa431 100644 --- a/e-util/e-icon-factory.c +++ b/e-util/e-icon-factory.c @@ -44,7 +44,7 @@ #define d(x) typedef struct { - char *name; + gchar *name; GdkPixbuf *pixbuf; } Icon; @@ -58,7 +58,7 @@ static GStaticMutex mutex = G_STATIC_MUTEX_INIT; /* Note: takes ownership of the pixbufs (eg. does not ref them) */ static Icon * -icon_new (const char *name, GdkPixbuf *pixbuf) +icon_new (const gchar *name, GdkPixbuf *pixbuf) { Icon *icon; @@ -79,10 +79,10 @@ icon_free (Icon *icon) } static Icon * -load_icon (const char *icon_key, const char *icon_name, int size, int scale) +load_icon (const gchar *icon_key, const gchar *icon_name, gint size, gint scale) { GdkPixbuf *pixbuf, *unscaled = NULL; - char *basename, *filename = NULL; + gchar *basename, *filename = NULL; if (g_path_is_absolute (icon_name)) filename = g_strdup (icon_name); @@ -100,10 +100,10 @@ load_icon (const char *icon_key, const char *icon_name, int size, int scale) if (!filename || !(unscaled = gdk_pixbuf_new_from_file (filename, NULL))) { if (scale) { - const char *dent; - int width; + const gchar *dent; + gint width; GDir *dir; - char *x; + gchar *x; if (!(dir = g_dir_open (EVOLUTION_ICONSDIR, 0, NULL))) { goto done; @@ -203,9 +203,9 @@ e_icon_factory_init (void) G_CALLBACK (icon_theme_changed_cb), NULL); broken16_pixbuf = gdk_pixbuf_new_from_xpm_data ( - (const char **) broken_image_16_xpm); + (const gchar **) broken_image_16_xpm); broken24_pixbuf = gdk_pixbuf_new_from_xpm_data ( - (const char **) broken_image_24_xpm); + (const gchar **) broken_image_24_xpm); } /** @@ -281,9 +281,9 @@ e_icon_factory_get_icon (const gchar *icon_name, GtkIconSize icon_size) { GdkPixbuf *pixbuf; - char *icon_key; + gchar *icon_key; Icon *icon; - int size, width, height; + gint size, width, height; g_return_val_if_fail (icon_name != NULL, NULL); @@ -325,7 +325,7 @@ e_icon_factory_get_icon (const gchar *icon_name, * @return Scaled pixbuf. **/ GdkPixbuf * -e_icon_factory_pixbuf_scale (GdkPixbuf *pixbuf, int width, int height) +e_icon_factory_pixbuf_scale (GdkPixbuf *pixbuf, gint width, gint height) { g_return_val_if_fail (pixbuf != NULL, NULL); diff --git a/e-util/e-import.c b/e-util/e-import.c index ccc44d7daa..84c8a24605 100644 --- a/e-util/e-import.c +++ b/e-util/e-import.c @@ -46,11 +46,11 @@ struct _EImportImporters { EImportImporter *importer; EImportImporterFunc free; - void *data; + gpointer data; }; struct _EImportPrivate { - int dummy; + gint dummy; }; static GObjectClass *ep_parent; @@ -149,14 +149,14 @@ e_import_get_type(void) * * Return value: @ep is returned. **/ -EImport *e_import_construct(EImport *ep, const char *id) +EImport *e_import_construct(EImport *ep, const gchar *id) { ep->id = g_strdup(id); return ep; } -EImport *e_import_new(const char *id) +EImport *e_import_new(const gchar *id) { EImport *ei = g_object_new(e_import_get_type(), NULL); @@ -180,7 +180,7 @@ EImport *e_import_new(const char *id) * When complete, the @done callback will be called. **/ void -e_import_import(EImport *ei, EImportTarget *t, EImportImporter *im, EImportStatusFunc status, EImportCompleteFunc done, void *data) +e_import_import(EImport *ei, EImportTarget *t, EImportImporter *im, EImportStatusFunc status, EImportCompleteFunc done, gpointer data) { g_return_if_fail(im != NULL); g_return_if_fail(im != NULL); @@ -234,7 +234,7 @@ void e_import_complete(EImport *ei, EImportTarget *target) ei->done(ei, ei->done_data); } -void e_import_status(EImport *ei, EImportTarget *target, const char *what, int pc) +void e_import_status(EImport *ei, EImportTarget *target, const gchar *what, gint pc) { if (ei->status) ei->status(ei, what, pc, ei->done_data); @@ -285,7 +285,7 @@ e_import_get_importers(EImport *emp, EImportTarget *target) * **/ void -e_import_class_add_importer(EImportClass *klass, EImportImporter *importer, EImportImporterFunc freefunc, void *data) +e_import_class_add_importer(EImportClass *klass, EImportImporter *importer, EImportImporterFunc freefunc, gpointer data) { struct _EImportImporters *node, *ei, *en; @@ -337,7 +337,7 @@ void e_import_class_remove_importer(EImportClass *klass, EImportImporter *f) * Allocate a new import target suitable for this class. Implementing * classes will define the actual content of the target. **/ -void *e_import_target_new(EImport *ep, int type, size_t size) +gpointer e_import_target_new(EImport *ep, gint type, size_t size) { EImportTarget *t; @@ -364,14 +364,14 @@ void *e_import_target_new(EImport *ep, int type, size_t size) * free custom targets. **/ void -e_import_target_free(EImport *ep, void *o) +e_import_target_free(EImport *ep, gpointer o) { EImportTarget *t = o; ((EImportClass *)G_OBJECT_GET_CLASS(ep))->target_free(ep, t); } -EImportTargetURI *e_import_target_new_uri(EImport *ei, const char *suri, const char *duri) +EImportTargetURI *e_import_target_new_uri(EImport *ei, const gchar *suri, const gchar *duri) { EImportTargetURI *t = e_import_target_new(ei, E_IMPORT_TARGET_URI, sizeof(*t)); @@ -381,7 +381,7 @@ EImportTargetURI *e_import_target_new_uri(EImport *ei, const char *suri, const c return t; } -EImportTargetHome *e_import_target_new_home(EImport *ei, const char *home) +EImportTargetHome *e_import_target_new_home(EImport *ei, const gchar *home) { EImportTargetHome *t = e_import_target_new(ei, E_IMPORT_TARGET_HOME, sizeof(*t)); @@ -417,7 +417,7 @@ EImportTargetHome *e_import_target_new_home(EImport *ei, const char *home) */ -static void *emph_parent_class; +static gpointer emph_parent_class; #define emph ((EImportHook *)eph) static const EImportHookTargetMask eih_no_masks[] = { @@ -463,7 +463,7 @@ static void eih_cancel(EImport *ei, EImportTarget *target, EImportImporter *im) } static void -eih_free_importer(EImportImporter *im, void *data) +eih_free_importer(EImportImporter *im, gpointer data) { EImportHookImporter *ihook = (EImportHookImporter *)im; @@ -479,12 +479,12 @@ emph_construct_importer(EPluginHook *eph, xmlNodePtr root) struct _EImportHookImporter *item; EImportHookTargetMap *map; EImportHookClass *klass = (EImportHookClass *)G_OBJECT_GET_CLASS(eph); - char *tmp; + gchar *tmp; d(printf(" loading import item\n")); item = g_malloc0(sizeof(*item)); - tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); + tmp = (gchar *)xmlGetProp(root, (const guchar *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -535,7 +535,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp((char *)node->name, "importer") == 0) { + if (strcmp((gchar *)node->name, "importer") == 0) { struct _EImportHookImporter *ihook; ihook = emph_construct_importer(eph, node); @@ -565,7 +565,7 @@ emph_finalise(GObject *o) static void emph_class_init(EPluginHookClass *klass) { - int i; + gint i; ((GObjectClass *)klass)->finalize = emph_finalise; klass->construct = emph_construct; @@ -626,5 +626,5 @@ e_import_hook_get_type(void) **/ void e_import_hook_class_add_target_map(EImportHookClass *klass, const EImportHookTargetMap *map) { - g_hash_table_insert(klass->target_map, (void *)map->type, (void *)map); + g_hash_table_insert(klass->target_map, (gpointer)map->type, (gpointer)map); } diff --git a/e-util/e-import.h b/e-util/e-import.h index 4ca1ef1829..760544667d 100644 --- a/e-util/e-import.h +++ b/e-util/e-import.h @@ -44,11 +44,11 @@ typedef struct _EImportImporter EImportImporter; typedef struct _EImportFactory EImportFactory; typedef struct _EImportTarget EImportTarget; -typedef void (*EImportCompleteFunc)(EImport *ei, void *data); -typedef void (*EImportStatusFunc)(EImport *ei, const char *what, int pc, void *data); +typedef void (*EImportCompleteFunc)(EImport *ei, gpointer data); +typedef void (*EImportStatusFunc)(EImport *ei, const gchar *what, gint pc, gpointer data); -typedef void (*EImportFactoryFunc)(EImport *ei, void *data); -typedef void (*EImportImporterFunc)(EImportImporter *importer, void *data); +typedef void (*EImportFactoryFunc)(EImport *ei, gpointer data); +typedef void (*EImportImporterFunc)(EImportImporter *importer, gpointer data); typedef gboolean (*EImportSupportedFunc)(EImport *ei, EImportTarget *, EImportImporter *im); typedef struct _GtkWidget *(*EImportWidgetFunc)(EImport *ei, EImportTarget *, EImportImporter *im); typedef void (*EImportImportFunc)(EImport *ei, EImportTarget *, EImportImporter *im); @@ -75,18 +75,18 @@ enum _e_import_target_t { struct _EImportImporter { enum _e_import_target_t type; - int pri; + gint pri; EImportSupportedFunc supported; EImportWidgetFunc get_widget; EImportImportFunc import; EImportImportFunc cancel; - void *user_data; + gpointer user_data; /* ?? */ - char *name; - char *description; + gchar *name; + gchar *description; }; /** @@ -117,14 +117,14 @@ typedef struct _EImportTargetHome EImportTargetHome; struct _EImportTargetURI { struct _EImportTarget target; - char *uri_src; - char *uri_dest; + gchar *uri_src; + gchar *uri_dest; }; struct _EImportTargetHome { struct _EImportTarget target; - char *homedir; + gchar *homedir; }; /** @@ -140,11 +140,11 @@ struct _EImportTargetHome { struct _EImport { GObject object; - char *id; + gchar *id; EImportStatusFunc status; EImportCompleteFunc done; - void *done_data; + gpointer done_data; }; /** @@ -170,29 +170,29 @@ struct _EImportClass { GType e_import_get_type(void); -EImport *e_import_new(const char *id); +EImport *e_import_new(const gchar *id); /* Static class methods */ -void e_import_class_add_importer(EImportClass *klass, EImportImporter *importer, EImportImporterFunc freefunc, void *data); +void e_import_class_add_importer(EImportClass *klass, EImportImporter *importer, EImportImporterFunc freefunc, gpointer data); void e_import_class_remove_importer(EImportClass *klass, EImportImporter *f); GSList *e_import_get_importers(EImport *emp, EImportTarget *target); -EImport *e_import_construct(EImport *, const char *id); +EImport *e_import_construct(EImport *, const gchar *id); -void e_import_import(EImport *ei, EImportTarget *, EImportImporter *, EImportStatusFunc status, EImportCompleteFunc done, void *data); +void e_import_import(EImport *ei, EImportTarget *, EImportImporter *, EImportStatusFunc status, EImportCompleteFunc done, gpointer data); void e_import_cancel(EImport *, EImportTarget *, EImportImporter *); struct _GtkWidget *e_import_get_widget(EImport *ei, EImportTarget *, EImportImporter *); -void e_import_status(EImport *, EImportTarget *, const char *what, int pc); +void e_import_status(EImport *, EImportTarget *, const gchar *what, gint pc); void e_import_complete(EImport *, EImportTarget *); -void *e_import_target_new(EImport *ep, int type, size_t size); -void e_import_target_free(EImport *ep, void *o); +gpointer e_import_target_new(EImport *ep, gint type, size_t size); +void e_import_target_free(EImport *ep, gpointer o); -EImportTargetURI *e_import_target_new_uri(EImport *ei, const char *suri, const char *duri); -EImportTargetHome *e_import_target_new_home(EImport *ei, const char *home); +EImportTargetURI *e_import_target_new_uri(EImport *ei, const gchar *suri, const gchar *duri); +EImportTargetHome *e_import_target_new_home(EImport *ei, const gchar *home); /* ********************************************************************** */ @@ -216,10 +216,10 @@ struct _EImportHookImporter { /* user_data == EImportHook */ - char *supported; - char *get_widget; - char *import; - char *cancel; + gchar *supported; + gchar *get_widget; + gchar *import; + gchar *cancel; }; /** diff --git a/e-util/e-menu.c b/e-util/e-menu.c index e5472d6bbc..4687e97fb1 100644 --- a/e-util/e-menu.c +++ b/e-util/e-menu.c @@ -42,9 +42,9 @@ struct _EMenuFactory { struct _EMenuFactory *next, *prev; - char *menuid; + gchar *menuid; EMenuFactoryFunc factory; - void *factory_data; + gpointer factory_data; }; struct _item_node { @@ -64,7 +64,7 @@ struct _menu_node { GSList *pixmaps; EMenuItemsFunc freefunc; - void *data; + gpointer data; /* a copy of items wrapped in an item_node, for bonobo * callback mapping */ @@ -183,7 +183,7 @@ e_menu_get_type(void) * * Return value: Returns @em. **/ -EMenu *e_menu_construct(EMenu *em, const char *menuid) +EMenu *e_menu_construct(EMenu *em, const gchar *menuid) { struct _EMenuFactory *f; EMenuClass *klass; @@ -232,8 +232,8 @@ EMenu *e_menu_construct(EMenu *em, const char *menuid) * * Return value: A handle that can be passed to remove_items as required. **/ -void * -e_menu_add_items(EMenu *emp, GSList *items, GSList *uifiles, GSList *pixmaps, EMenuItemsFunc freefunc, void *data) +gpointer +e_menu_add_items(EMenu *emp, GSList *items, GSList *uifiles, GSList *pixmaps, EMenuItemsFunc freefunc, gpointer data) { struct _menu_node *node; GSList *l; @@ -276,7 +276,7 @@ e_menu_add_items(EMenu *emp, GSList *items, GSList *uifiles, GSList *pixmaps, EM /* FIXME: add the menu's to a running menu if it is there? */ - return (void *)node; + return (gpointer)node; } /** @@ -287,7 +287,7 @@ e_menu_add_items(EMenu *emp, GSList *items, GSList *uifiles, GSList *pixmaps, EM * Remove menu items previously added. **/ void -e_menu_remove_items(EMenu *emp, void *handle) +e_menu_remove_items(EMenu *emp, gpointer handle) { struct _menu_node *node = handle; struct _item_node *inode; @@ -318,7 +318,7 @@ e_menu_remove_items(EMenu *emp, void *handle) } static void -em_activate_toggle(BonoboUIComponent *component, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) +em_activate_toggle(BonoboUIComponent *component, const gchar *path, Bonobo_UIComponent_EventType type, const gchar *state, gpointer data) { struct _item_node *inode = data; @@ -329,7 +329,7 @@ em_activate_toggle(BonoboUIComponent *component, const char *path, Bonobo_UIComp } static void -em_activate(BonoboUIComponent *uic, void *data, const char *cname) +em_activate(BonoboUIComponent *uic, gpointer data, const gchar *cname) { struct _item_node *inode = data; @@ -350,7 +350,7 @@ em_activate(BonoboUIComponent *uic, void *data, const char *cname) * This should always be called in the strict sequence of activate, then * deactivate, repeated any number of times. **/ -void e_menu_activate(EMenu *em, struct _BonoboUIComponent *uic, int act) +void e_menu_activate(EMenu *em, struct _BonoboUIComponent *uic, gint act) { struct _EMenuPrivate *p = em->priv; struct _menu_node *mw; @@ -358,7 +358,7 @@ void e_menu_activate(EMenu *em, struct _BonoboUIComponent *uic, int act) if (act) { GArray *verbs; - int i; + gint i; em->uic = uic; @@ -432,7 +432,7 @@ void e_menu_activate(EMenu *em, struct _BonoboUIComponent *uic, int act) * This is used by the owner of the menu and view to update the menu * system based on user input or changed system state. **/ -void e_menu_update_target(EMenu *em, void *tp) +void e_menu_update_target(EMenu *em, gpointer tp) { struct _EMenuPrivate *p = em->priv; EMenuTarget *t = tp; @@ -457,7 +457,7 @@ void e_menu_update_target(EMenu *em, void *tp) for (mw = (struct _menu_node *)p->menus.head;mw->next;mw=mw->next) { for (l = mw->items;l;l=g_slist_next(l)) { EMenuItem *item = l->data; - int state; + gint state; d(printf("checking item '%s' mask %08x against target %08x\n", item->verb, item->enable, mask)); @@ -487,7 +487,7 @@ void e_menu_update_target(EMenu *em, void *tp) * Return value: A handle to the factory. **/ EMenuFactory * -e_menu_class_add_factory(EMenuClass *klass, const char *menuid, EMenuFactoryFunc func, void *data) +e_menu_class_add_factory(EMenuClass *klass, const gchar *menuid, EMenuFactoryFunc func, gpointer data) { struct _EMenuFactory *f = g_malloc0(sizeof(*f)); @@ -538,7 +538,7 @@ e_menu_class_remove_factory(EMenuClass *klass, EMenuFactory *f) * to specify the actual target size, which may vary depending on the * implementing class. **/ -void *e_menu_target_new(EMenu *ep, int type, size_t size) +gpointer e_menu_target_new(EMenu *ep, gint type, size_t size) { EMenuTarget *t; @@ -563,7 +563,7 @@ void *e_menu_target_new(EMenu *ep, int type, size_t size) * Free a target. **/ void -e_menu_target_free(EMenu *ep, void *o) +e_menu_target_free(EMenu *ep, gpointer o) { EMenuTarget *t = o; @@ -601,7 +601,7 @@ e_menu_target_free(EMenu *ep, void *o) */ -static void *emph_parent_class; +static gpointer emph_parent_class; #define emph ((EMenuHook *)eph) /* must have 1:1 correspondence with e-menu types in order */ @@ -624,28 +624,28 @@ static const EPluginHookTargetKey emph_pixmap_sizes[] = { }; static void -emph_menu_activate(EMenu *em, EMenuItem *item, void *data) +emph_menu_activate(EMenu *em, EMenuItem *item, gpointer data) { EMenuHook *hook = data; - d(printf("invoking plugin hook '%s' %p\n", (char *)item->user_data, em->target)); + d(printf("invoking plugin hook '%s' %p\n", (gchar *)item->user_data, em->target)); e_plugin_invoke(hook->hook.plugin, item->user_data, em->target); } static void -emph_menu_toggle_activate(EMenu *em, EMenuItem *item, int state, void *data) +emph_menu_toggle_activate(EMenu *em, EMenuItem *item, gint state, gpointer data) { EMenuHook *hook = data; /* FIXME: where does the toggle state go? */ - d(printf("invoking plugin hook '%s' %p\n", (char *)item->user_data, em->target)); + d(printf("invoking plugin hook '%s' %p\n", (gchar *)item->user_data, em->target)); e_plugin_invoke(hook->hook.plugin, item->user_data, em->target); } static void -emph_menu_factory(EMenu *emp, void *data) +emph_menu_factory(EMenu *emp, gpointer data) { struct _EMenuHookMenu *menu = data; @@ -754,13 +754,13 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) xmlNodePtr node; EMenuHookTargetMap *map; EMenuHookClass *klass = (EMenuHookClass *)G_OBJECT_GET_CLASS(eph); - char *tmp; + gchar *tmp; d(printf(" loading menu\n")); menu = g_malloc0(sizeof(*menu)); menu->hook = (EMenuHook *)eph; - tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); + tmp = (gchar *)xmlGetProp(root, (const guchar *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -777,14 +777,14 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) } node = root->children; while (node) { - if (0 == strcmp((char *)node->name, "item")) { + if (0 == strcmp((gchar *)node->name, "item")) { struct _EMenuItem *item; item = emph_construct_item(eph, menu, node, map); if (item) menu->items = g_slist_append(menu->items, item); - } else if (0 == strcmp((char *)node->name, "ui")) { - tmp = (char *)xmlGetProp(node, (const unsigned char *)"file"); + } else if (0 == strcmp((gchar *)node->name, "ui")) { + tmp = (gchar *)xmlGetProp(node, (const guchar *)"file"); if (tmp) { EMenuUIFile *ui = g_malloc0(sizeof(*ui)); @@ -792,7 +792,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) xmlFree(tmp); #ifdef G_OS_WIN32 { - char *mapped_location = + gchar *mapped_location = e_util_replace_prefix (EVOLUTION_PREFIX, e_util_get_prefix (), ui->filename); @@ -804,7 +804,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) ui->appname = g_strdup("Evolution"); menu->uis = g_slist_append(menu->uis, ui); } - } else if (0 == strcmp((char *)node->name, "pixmap")) { + } else if (0 == strcmp((gchar *)node->name, "pixmap")) { struct _EMenuPixmap *pixmap; pixmap = emph_construct_pixmap(eph, menu, node); @@ -839,7 +839,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp((char *)node->name, "menu") == 0) { + if (strcmp((gchar *)node->name, "menu") == 0) { struct _EMenuHookMenu *menu; menu = emph_construct_menu(eph, node); @@ -921,5 +921,5 @@ e_menu_hook_get_type(void) **/ void e_menu_hook_class_add_target_map(EMenuHookClass *klass, const EMenuHookTargetMap *map) { - g_hash_table_insert(klass->target_map, (void *)map->type, (void *)map); + g_hash_table_insert(klass->target_map, (gpointer)map->type, (gpointer)map); } diff --git a/e-util/e-menu.h b/e-util/e-menu.h index 5df8f11b28..42e03572ae 100644 --- a/e-util/e-menu.h +++ b/e-util/e-menu.h @@ -47,10 +47,10 @@ typedef struct _EMenuPixmap EMenuPixmap; typedef struct _EMenuFactory EMenuFactory; /* anonymous type */ typedef struct _EMenuTarget EMenuTarget; -typedef void (*EMenuFactoryFunc)(EMenu *emp, void *data); -typedef void (*EMenuActivateFunc)(EMenu *, EMenuItem *, void *data); -typedef void (*EMenuToggleActivateFunc)(EMenu *, EMenuItem *, int state, void *data); -typedef void (*EMenuItemsFunc)(EMenu *, GSList *items, GSList *uifiles, GSList *pixmaps, void *data); +typedef void (*EMenuFactoryFunc)(EMenu *emp, gpointer data); +typedef void (*EMenuActivateFunc)(EMenu *, EMenuItem *, gpointer data); +typedef void (*EMenuToggleActivateFunc)(EMenu *, EMenuItem *, gint state, gpointer data); +typedef void (*EMenuItemsFunc)(EMenu *, GSList *items, GSList *uifiles, GSList *pixmaps, gpointer data); /** * enum _e_menu_t - Menu item type. @@ -90,10 +90,10 @@ enum _e_menu_t { **/ struct _EMenuItem { enum _e_menu_t type; - char *path; /* full path? can we just create it from verb? */ - char *verb; /* command verb */ + gchar *path; /* full path? can we just create it from verb? */ + gchar *verb; /* command verb */ GCallback activate; /* depends on type, the bonobo activate callback */ - void *user_data; /* up to caller to use */ + gpointer user_data; /* up to caller to use */ guint32 visible; /* is visible mask */ guint32 enable; /* is enable mask */ }; @@ -112,10 +112,10 @@ struct _EMenuItem { * supplied separately from the menu definition. **/ struct _EMenuPixmap { - char *command; - char *name; - int size; - char *pixmap; + gchar *command; + gchar *name; + gint size; + gchar *pixmap; }; /** @@ -129,9 +129,9 @@ struct _EMenuPixmap { * the menu is activated. **/ struct _EMenuUIFile { - char *appdir; - char *appname; - char *filename; + gchar *appdir; + gchar *appname; + gchar *filename; }; /** @@ -178,7 +178,7 @@ struct _EMenu { GObject object; struct _EMenuPrivate *priv; - char *menuid; + gchar *menuid; struct _BonoboUIComponent *uic; EMenuTarget *target; }; @@ -208,22 +208,22 @@ struct _EMenuClass { GType e_menu_get_type(void); /* Static class methods */ -EMenuFactory *e_menu_class_add_factory(EMenuClass *klass, const char *menuid, EMenuFactoryFunc func, void *data); +EMenuFactory *e_menu_class_add_factory(EMenuClass *klass, const gchar *menuid, EMenuFactoryFunc func, gpointer data); void e_menu_class_remove_factory(EMenuClass *klass, EMenuFactory *f); -EMenu *e_menu_construct(EMenu *menu, const char *menuid); +EMenu *e_menu_construct(EMenu *menu, const gchar *menuid); -void e_menu_add_ui(EMenu *, const char *appdir, const char *appname, const char *filename); -void e_menu_add_pixmap(EMenu *, const char *cmd, const char *name, int size); +void e_menu_add_ui(EMenu *, const gchar *appdir, const gchar *appname, const gchar *filename); +void e_menu_add_pixmap(EMenu *, const gchar *cmd, const gchar *name, gint size); -void *e_menu_add_items(EMenu *emp, GSList *items, GSList *uifiles, GSList *pixmaps, EMenuItemsFunc freefunc, void *data); -void e_menu_remove_items(EMenu *emp, void *handle); +gpointer e_menu_add_items(EMenu *emp, GSList *items, GSList *uifiles, GSList *pixmaps, EMenuItemsFunc freefunc, gpointer data); +void e_menu_remove_items(EMenu *emp, gpointer handle); -void e_menu_activate(EMenu *, struct _BonoboUIComponent *uic, int act); -void e_menu_update_target(EMenu *, void *); +void e_menu_activate(EMenu *, struct _BonoboUIComponent *uic, gint act); +void e_menu_update_target(EMenu *, gpointer ); -void *e_menu_target_new(EMenu *, int type, size_t size); -void e_menu_target_free(EMenu *, void *); +gpointer e_menu_target_new(EMenu *, gint type, size_t size); +void e_menu_target_free(EMenu *, gpointer ); /* ********************************************************************** */ @@ -263,8 +263,8 @@ typedef void (*EMenuHookFunc)(struct _EPlugin *plugin, EMenuTarget *target); **/ struct _EMenuHookMenu { struct _EMenuHook *hook; /* parent pointer */ - char *id; /* target menu id for these menu items */ - int target_type; /* target type, not used */ + gchar *id; /* target menu id for these menu items */ + gint target_type; /* target type, not used */ GSList *items; /* items to add to menu */ GSList *uis; /* ui files */ GSList *pixmaps; /* pixmap descriptors */ diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index 682563907c..0044b2e085 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -51,14 +51,14 @@ #define TEMP_SCAN (60) static int -expire_dir_rec(const char *base, time_t now) +expire_dir_rec(const gchar *base, time_t now) { GDir *dir; - const char *d; + const gchar *d; GString *path; size_t len; struct stat st; - int count = 0; + gint count = 0; d(printf("expire dir '%s'\n", base)); @@ -109,7 +109,7 @@ get_dir (gboolean make) static time_t last = 0; #ifdef TEMP_HOME - char *tmpdir = NULL; + gchar *tmpdir = NULL; tmpdir = g_build_filename(e_get_user_data_dir (), "cache", "tmp", NULL); path = g_string_new(tmpdir); @@ -122,7 +122,7 @@ get_dir (gboolean make) path = g_string_new("/tmp/evolution-"); g_string_append_printf (path, "%d", (int) getuid ()); if (make) { - int ret; + gint ret; /* shoot now, ask questions later */ ret = g_mkdir (path->str, S_IRWXU); @@ -163,11 +163,11 @@ get_dir (gboolean make) return path; } -char * -e_mktemp (const char *template) +gchar * +e_mktemp (const gchar *template) { GString *path; - char *ret; + gchar *ret; path = get_dir (TRUE); if (!path) @@ -186,11 +186,11 @@ e_mktemp (const char *template) } -int -e_mkstemp (const char *template) +gint +e_mkstemp (const gchar *template) { GString *path; - int fd; + gint fd; path = get_dir (TRUE); if (!path) @@ -209,11 +209,11 @@ e_mkstemp (const char *template) } -char * -e_mkdtemp (const char *template) +gchar * +e_mkdtemp (const gchar *template) { GString *path; - char *tmpdir; + gchar *tmpdir; path = get_dir (TRUE); if (!path) diff --git a/e-util/e-mktemp.h b/e-util/e-mktemp.h index 01dbd18119..c9b1d55b18 100644 --- a/e-util/e-mktemp.h +++ b/e-util/e-mktemp.h @@ -24,10 +24,10 @@ #ifndef __E_MKTEMP_H__ #define __E_MKTEMP_H__ -char *e_mktemp (const char *template); +gchar *e_mktemp (const gchar *template); -int e_mkstemp (const char *template); +gint e_mkstemp (const gchar *template); -char *e_mkdtemp (const char *template); +gchar *e_mkdtemp (const gchar *template); #endif /* __E_MKTEMP_H__ */ diff --git a/e-util/e-non-intrusive-error-dialog.c b/e-util/e-non-intrusive-error-dialog.c index bb24a2360e..9e874524e4 100644 --- a/e-util/e-non-intrusive-error-dialog.c +++ b/e-util/e-non-intrusive-error-dialog.c @@ -89,7 +89,7 @@ eni_render_date (GtkTreeViewColumn *column, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { time_t t; - char sdt[100]; /* Should be sufficient? */ + gchar sdt[100]; /* Should be sufficient? */ gtk_tree_model_get (model, iter, COL_TIME, &t, -1); strftime (sdt, 100, "%x %X", localtime (&t)); @@ -97,9 +97,9 @@ eni_render_date (GtkTreeViewColumn *column, GtkCellRenderer *renderer, } static void -eni_append_logs (const char *txt, GtkListStore *store) +eni_append_logs (const gchar *txt, GtkListStore *store) { - char **str; + gchar **str; str = g_strsplit (txt, ":", 3); if (str[0] && str[1] && str[2]) { @@ -119,7 +119,7 @@ eni_append_logs (const char *txt, GtkListStore *store) } static guint -eni_config_get_error_level (const char *path) +eni_config_get_error_level (const gchar *path) { GConfClient *gconf_client; guint error_level; @@ -132,7 +132,7 @@ eni_config_get_error_level (const char *path) } guint -eni_config_get_error_timeout (const char *path) +eni_config_get_error_timeout (const gchar *path) { GConfClient *gconf_client; guint error_time; @@ -145,14 +145,14 @@ eni_config_get_error_timeout (const char *path) } static void -eni_error_timeout_changed (GtkSpinButton *b, void *data) +eni_error_timeout_changed (GtkSpinButton *b, gpointer data) { GConfClient *gconf_client; - int value = gtk_spin_button_get_value_as_int (b); + gint value = gtk_spin_button_get_value_as_int (b); gconf_client = gconf_client_get_default (); - gconf_client_set_int (gconf_client, (char *) data, value, NULL); + gconf_client_set_int (gconf_client, (gchar *) data, value, NULL); g_object_unref (gconf_client); } @@ -160,17 +160,17 @@ static void eni_error_level_value_changed (GtkComboBox *w, gpointer *data) { GConfClient *gconf_client; - int value = gtk_combo_box_get_active (w); + gint value = gtk_combo_box_get_active (w); gconf_client = gconf_client_get_default (); - gconf_client_set_int (gconf_client, (char *) data, value, NULL); + gconf_client_set_int (gconf_client, (gchar *) data, value, NULL); g_object_unref (gconf_client); } void -eni_show_logger(ELogger *logger, GtkWidget *top,const char *error_timeout_path, const char *error_level_path) +eni_show_logger(ELogger *logger, GtkWidget *top,const gchar *error_timeout_path, const gchar *error_level_path) { GtkWidget *container; GtkWidget *label; @@ -181,7 +181,7 @@ eni_show_logger(ELogger *logger, GtkWidget *top,const char *error_timeout_path, GtkListStore *store; GtkCellRenderer *renderer; GtkTreeViewColumn *column; - int i; + gint i; toplevel = gtk_widget_get_toplevel (top); diff --git a/e-util/e-non-intrusive-error-dialog.h b/e-util/e-non-intrusive-error-dialog.h index 827e17f868..7b93ba1098 100644 --- a/e-util/e-non-intrusive-error-dialog.h +++ b/e-util/e-non-intrusive-error-dialog.h @@ -50,11 +50,11 @@ enum }; /* eni - error non intrusive*/ -guint eni_config_get_error_timeout (const char *path); +guint eni_config_get_error_timeout (const gchar *path); void eni_show_logger (ELogger *logger, GtkWidget *widget, - const char *error_timeout_path, - const char *error_level_path); + const gchar *error_timeout_path, + const gchar *error_level_path); G_END_DECLS diff --git a/e-util/e-pilot-map.c b/e-util/e-pilot-map.c index b2338ccead..80eb361027 100644 --- a/e-util/e-pilot-map.c +++ b/e-util/e-pilot-map.c @@ -34,7 +34,7 @@ typedef struct { - char *uid; + gchar *uid; gboolean archived; gboolean touched; } EPilotMapPidNode; @@ -53,9 +53,9 @@ typedef struct } EPilotMapWriteData; static void -real_e_pilot_map_insert (EPilotMap *map, guint32 pid, const char *uid, gboolean archived, gboolean touch) +real_e_pilot_map_insert (EPilotMap *map, guint32 pid, const gchar *uid, gboolean archived, gboolean touch) { - char *new_uid; + gchar *new_uid; guint32 *new_pid; EPilotMapPidNode *pnode; EPilotMapUidNode *unode; @@ -92,35 +92,35 @@ real_e_pilot_map_insert (EPilotMap *map, guint32 pid, const char *uid, gboolean } static void -map_set_node_timet (xmlNodePtr node, const char *name, time_t t) +map_set_node_timet (xmlNodePtr node, const gchar *name, time_t t) { - char *tstring; + gchar *tstring; tstring = g_strdup_printf ("%ld", t); - xmlSetProp (node, (unsigned char *)name, (unsigned char *)tstring); + xmlSetProp (node, (guchar *)name, (guchar *)tstring); g_free (tstring); } static void -map_sax_start_element (void *data, const xmlChar *name, +map_sax_start_element (gpointer data, const xmlChar *name, const xmlChar **attrs) { EPilotMap *map = (EPilotMap *)data; - if (!strcmp ((char *)name, "PilotMap")) { + if (!strcmp ((gchar *)name, "PilotMap")) { while (attrs && *attrs != NULL) { const xmlChar **val = attrs; val++; - if (!strcmp ((char *)*attrs, "timestamp")) - map->since = (time_t)strtoul ((char *)*val, NULL, 0); + if (!strcmp ((gchar *)*attrs, "timestamp")) + map->since = (time_t)strtoul ((gchar *)*val, NULL, 0); attrs = ++val; } } - if (!strcmp ((char *)name, "map")) { - const char *uid = NULL; + if (!strcmp ((gchar *)name, "map")) { + const gchar *uid = NULL; guint32 pid = 0; gboolean archived = FALSE; @@ -128,14 +128,14 @@ map_sax_start_element (void *data, const xmlChar *name, const xmlChar **val = attrs; val++; - if (!strcmp ((char *)*attrs, "uid")) - uid = (char *)*val; + if (!strcmp ((gchar *)*attrs, "uid")) + uid = (gchar *)*val; - if (!strcmp ((char *)*attrs, "pilot_id")) - pid = strtoul ((char *)*val, NULL, 0); + if (!strcmp ((gchar *)*attrs, "pilot_id")) + pid = strtoul ((gchar *)*val, NULL, 0); - if (!strcmp ((char *)*attrs, "archived")) - archived = strtoul ((char *)*val, NULL, 0)== 1 ? TRUE : FALSE; + if (!strcmp ((gchar *)*attrs, "archived")) + archived = strtoul ((gchar *)*val, NULL, 0)== 1 ? TRUE : FALSE; attrs = ++val; } @@ -152,25 +152,25 @@ map_write_foreach (gpointer key, gpointer value, gpointer data) { EPilotMapWriteData *wd = data; xmlNodePtr root = wd->root; - char *uid = key; + gchar *uid = key; EPilotMapUidNode *unode = value; xmlNodePtr mnode; if (wd->touched_only && !unode->touched) return; - mnode = xmlNewChild (root, NULL, (const unsigned char *)"map", NULL); - xmlSetProp (mnode, (const unsigned char *)"uid", (unsigned char *)uid); + mnode = xmlNewChild (root, NULL, (const guchar *)"map", NULL); + xmlSetProp (mnode, (const guchar *)"uid", (guchar *)uid); if (unode->archived) { - xmlSetProp (mnode, (const unsigned char *)"archived", (const unsigned char *)"1"); + xmlSetProp (mnode, (const guchar *)"archived", (const guchar *)"1"); } else { - char *pidstr; + gchar *pidstr; pidstr = g_strdup_printf ("%d", unode->pid); - xmlSetProp (mnode, (const unsigned char *)"pilot_id", (unsigned char *)pidstr); + xmlSetProp (mnode, (const guchar *)"pilot_id", (guchar *)pidstr); g_free (pidstr); - xmlSetProp (mnode, (const unsigned char *)"archived", (const unsigned char *)"0"); + xmlSetProp (mnode, (const guchar *)"archived", (const guchar *)"0"); } } @@ -190,7 +190,7 @@ e_pilot_map_pid_is_archived (EPilotMap *map, guint32 pid) } gboolean -e_pilot_map_uid_is_archived (EPilotMap *map, const char *uid) +e_pilot_map_uid_is_archived (EPilotMap *map, const gchar *uid) { EPilotMapUidNode *unode; @@ -206,7 +206,7 @@ e_pilot_map_uid_is_archived (EPilotMap *map, const char *uid) } void -e_pilot_map_insert (EPilotMap *map, guint32 pid, const char *uid, gboolean archived) +e_pilot_map_insert (EPilotMap *map, guint32 pid, const gchar *uid, gboolean archived) { EPilotMapPidNode *pnode; EPilotMapUidNode *unode; @@ -250,7 +250,7 @@ e_pilot_map_remove_by_pid (EPilotMap *map, guint32 pid) } void -e_pilot_map_remove_by_uid (EPilotMap *map, const char *uid) +e_pilot_map_remove_by_uid (EPilotMap *map, const gchar *uid) { EPilotMapPidNode *pnode; EPilotMapUidNode *unode; @@ -270,7 +270,7 @@ e_pilot_map_remove_by_uid (EPilotMap *map, const char *uid) guint32 -e_pilot_map_lookup_pid (EPilotMap *map, const char *uid, gboolean touch) +e_pilot_map_lookup_pid (EPilotMap *map, const gchar *uid, gboolean touch) { EPilotMapUidNode *unode = NULL; @@ -294,7 +294,7 @@ e_pilot_map_lookup_pid (EPilotMap *map, const char *uid, gboolean touch) return unode->pid; } -const char * +const gchar * e_pilot_map_lookup_uid (EPilotMap *map, guint32 pid, gboolean touch) { EPilotMapPidNode *pnode = NULL; @@ -319,8 +319,8 @@ e_pilot_map_lookup_uid (EPilotMap *map, guint32 pid, gboolean touch) return pnode->uid; } -int -e_pilot_map_read (const char *filename, EPilotMap **map) +gint +e_pilot_map_read (const gchar *filename, EPilotMap **map) { xmlSAXHandler handler; EPilotMap *new_map; @@ -357,22 +357,22 @@ e_pilot_map_read (const char *filename, EPilotMap **map) return 0; } -int -e_pilot_map_write (const char *filename, EPilotMap *map) +gint +e_pilot_map_write (const gchar *filename, EPilotMap *map) { EPilotMapWriteData wd; xmlDocPtr doc; - int ret; + gint ret; g_return_val_if_fail (filename != NULL, -1); g_return_val_if_fail (map != NULL, -1); - doc = xmlNewDoc ((const unsigned char *)"1.0"); + doc = xmlNewDoc ((const guchar *)"1.0"); if (doc == NULL) { g_warning ("Pilot map file could not be created\n"); return -1; } - xmlDocSetRootElement (doc, xmlNewDocNode(doc, NULL, (const unsigned char *)"PilotMap", NULL)); + xmlDocSetRootElement (doc, xmlNewDocNode(doc, NULL, (const guchar *)"PilotMap", NULL)); map->since = time (NULL); map_set_node_timet (xmlDocGetRootElement (doc), "timestamp", map->since); diff --git a/e-util/e-pilot-map.h b/e-util/e-pilot-map.h index 46eaf54199..32bcc942bf 100644 --- a/e-util/e-pilot-map.h +++ b/e-util/e-pilot-map.h @@ -41,17 +41,17 @@ struct _EPilotMap }; gboolean e_pilot_map_pid_is_archived (EPilotMap *map, guint32 pid); -gboolean e_pilot_map_uid_is_archived (EPilotMap *map, const char *uid); +gboolean e_pilot_map_uid_is_archived (EPilotMap *map, const gchar *uid); -void e_pilot_map_insert (EPilotMap *map, guint32 pid, const char *uid, gboolean archived); +void e_pilot_map_insert (EPilotMap *map, guint32 pid, const gchar *uid, gboolean archived); void e_pilot_map_remove_by_pid (EPilotMap *map, guint32 pid); -void e_pilot_map_remove_by_uid (EPilotMap *map, const char *uid); +void e_pilot_map_remove_by_uid (EPilotMap *map, const gchar *uid); -guint32 e_pilot_map_lookup_pid (EPilotMap *map, const char *uid, gboolean touch); -const char * e_pilot_map_lookup_uid (EPilotMap *map, guint32 pid, gboolean touch); +guint32 e_pilot_map_lookup_pid (EPilotMap *map, const gchar *uid, gboolean touch); +const gchar * e_pilot_map_lookup_uid (EPilotMap *map, guint32 pid, gboolean touch); -int e_pilot_map_read (const char *filename, EPilotMap **map); -int e_pilot_map_write (const char *filename, EPilotMap *map); +gint e_pilot_map_read (const gchar *filename, EPilotMap **map); +gint e_pilot_map_write (const gchar *filename, EPilotMap *map); void e_pilot_map_clear (EPilotMap *map); diff --git a/e-util/e-pilot-util.c b/e-util/e-pilot-util.c index 582c9458e1..94c86a1084 100644 --- a/e-util/e-pilot-util.c +++ b/e-util/e-pilot-util.c @@ -30,11 +30,11 @@ #include "e-pilot-util.h" -char * -e_pilot_utf8_to_pchar (const char *string) +gchar * +e_pilot_utf8_to_pchar (const gchar *string) { - char *pstring = NULL; - int res; + gchar *pstring = NULL; + gint res; if (!string) return NULL; @@ -47,11 +47,11 @@ e_pilot_utf8_to_pchar (const char *string) return pstring; } -char * -e_pilot_utf8_from_pchar (const char *string) +gchar * +e_pilot_utf8_from_pchar (const gchar *string) { - char *ustring = NULL; - int res; + gchar *ustring = NULL; + gint res; if (!string) return NULL; diff --git a/e-util/e-pilot-util.h b/e-util/e-pilot-util.h index 0d7aebbd87..476320c58b 100644 --- a/e-util/e-pilot-util.h +++ b/e-util/e-pilot-util.h @@ -29,8 +29,8 @@ #ifndef E_PILOT_UTIL_H #define E_PILOT_UTIL_H -char *e_pilot_utf8_to_pchar (const char *string); -char *e_pilot_utf8_from_pchar (const char *string); +gchar *e_pilot_utf8_to_pchar (const gchar *string); +gchar *e_pilot_utf8_from_pchar (const gchar *string); ESource *e_pilot_get_sync_source (ESourceList *source_list); void e_pilot_set_sync_source (ESourceList *source_list, ESource *source); diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c index 7516fb3f09..61cf2c5e9f 100644 --- a/e-util/e-plugin.c +++ b/e-util/e-plugin.c @@ -88,7 +88,7 @@ struct _plugin_doc { struct _plugin_doc *next; struct _plugin_doc *prev; - char *filename; + gchar *filename; xmlDocPtr doc; GSList *plugin_hooks; /* EPlugin objects with pending hooks */ @@ -101,14 +101,14 @@ enum { }; static gboolean -ep_check_enabled (const char *id) +ep_check_enabled (const gchar *id) { /* Return TRUE if 'id' is NOT in the disabled list. */ return !g_slist_find_custom (ep_disabled, id, (GCompareFunc) strcmp); } static void -ep_set_enabled (const char *id, int state) +ep_set_enabled (const gchar *id, gint state) { /* Bail out if no change to state, when expressed as a boolean: */ if ((state == 0) == (ep_check_enabled(id) == 0)) @@ -135,14 +135,14 @@ static int ep_construct (EPlugin *ep, xmlNodePtr root) { xmlNodePtr node; - int res = -1; - char *localedir; + gint res = -1; + gchar *localedir; ep->domain = e_plugin_xml_prop(root, "domain"); if (ep->domain && (localedir = e_plugin_xml_prop(root, "localedir"))) { #ifdef G_OS_WIN32 - char *mapped_localedir = + gchar *mapped_localedir = e_util_replace_prefix (EVOLUTION_PREFIX, e_util_get_prefix (), localedir); @@ -159,10 +159,10 @@ ep_construct (EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp((char *)node->name, "hook") == 0) { + if (strcmp((gchar *)node->name, "hook") == 0) { struct _EPluginHook *hook; EPluginHookClass *type; - char *class = e_plugin_xml_prop(node, "class"); + gchar *class = e_plugin_xml_prop(node, "class"); if (class == NULL) { g_warning("Plugin '%s' load failed in '%s', missing class property for hook", ep->id, ep->path); @@ -198,11 +198,11 @@ ep_construct (EPlugin *ep, xmlNodePtr root) g_hash_table_insert (ep_plugins_pending_hooks, oldclass, l); ep->hooks_pending = g_slist_prepend (ep->hooks_pending, node); } - } else if (strcmp((char *)node->name, "description") == 0) { + } else if (strcmp((gchar *)node->name, "description") == 0) { ep->description = e_plugin_xml_content_domain(node, ep->domain); - } else if (strcmp((char *)node->name, "author") == 0) { - char *name = e_plugin_xml_prop(node, "name"); - char *email = e_plugin_xml_prop(node, "email"); + } else if (strcmp((gchar *)node->name, "author") == 0) { + gchar *name = e_plugin_xml_prop(node, "name"); + gchar *email = e_plugin_xml_prop(node, "email"); if (name || email) { EPluginAuthor *epa = g_malloc0(sizeof(*epa)); @@ -220,7 +220,7 @@ fail: } static void -ep_enable (EPlugin *ep, int state) +ep_enable (EPlugin *ep, gint state) { GSList *iter; @@ -331,7 +331,7 @@ e_plugin_get_type (void) static GType type = 0; if (G_UNLIKELY (type == 0)) { - char *path, *col, *p; + gchar *path, *col, *p; static const GTypeInfo type_info = { sizeof (EPluginClass), @@ -375,7 +375,7 @@ e_plugin_get_type (void) static EPlugin * ep_load_plugin(xmlNodePtr root, struct _plugin_doc *pdoc) { - char *prop, *id; + gchar *prop, *id; EPluginClass *class; EPlugin *ep; @@ -391,7 +391,7 @@ ep_load_plugin(xmlNodePtr root, struct _plugin_doc *pdoc) return NULL; } - prop = (char *)xmlGetProp(root, (const unsigned char *)"type"); + prop = (gchar *)xmlGetProp(root, (const guchar *)"type"); if (prop == NULL) { g_free(id); g_warning("Invalid e-plugin entry in '%s': no type", pdoc->filename); @@ -421,13 +421,13 @@ ep_load_plugin(xmlNodePtr root, struct _plugin_doc *pdoc) } static int -ep_load(const char *filename, int load_level) +ep_load(const gchar *filename, gint load_level) { xmlDocPtr doc; xmlNodePtr root; - int res = -1; + gint res = -1; EPlugin *ep = NULL; - int cache = FALSE; + gint cache = FALSE; struct _plugin_doc *pdoc; doc = e_xml_parse_file (filename); @@ -435,7 +435,7 @@ ep_load(const char *filename, int load_level) return -1; root = xmlDocGetRootElement(doc); - if (strcmp((char *)root->name, "e-plugin-list") != 0) { + if (strcmp((gchar *)root->name, "e-plugin-list") != 0) { g_warning("No <e-plugin-list> root element: %s", filename); xmlFreeDoc(doc); return -1; @@ -446,8 +446,8 @@ ep_load(const char *filename, int load_level) pdoc->filename = g_strdup(filename); for (root = root->children; root ; root = root->next) { - if (strcmp((char *)root->name, "e-plugin") == 0) { - char *plugin_load_level, *is_system_plugin; + if (strcmp((gchar *)root->name, "e-plugin") == 0) { + gchar *plugin_load_level, *is_system_plugin; plugin_load_level = NULL; plugin_load_level = e_plugin_xml_prop (root, "load_level"); @@ -506,7 +506,7 @@ ep_load(const char *filename, int load_level) static int ep_load_pending(EPlugin *ep, EPluginHookClass *type) { - int res = 0; + gint res = 0; GSList *l, *p; phd(printf("New hook type registered '%s', loading pending hooks on plugin '%s'\n", type->id, ep->id)); @@ -516,7 +516,7 @@ ep_load_pending(EPlugin *ep, EPluginHookClass *type) while (l) { GSList *n = l->next; xmlNodePtr node = l->data; - char *class = (char *)xmlGetProp(node, (const unsigned char *)"class"); + gchar *class = (gchar *)xmlGetProp(node, (const guchar *)"class"); EPluginHook *hook; phd(printf(" checking pending hook '%s'\n", class?class:"<unknown>")); @@ -569,7 +569,7 @@ ep_load_pending(EPlugin *ep, EPluginHookClass *type) * Plugin definitions are XML files ending in the extension ".eplug". **/ void -e_plugin_add_load_path(const char *path) +e_plugin_add_load_path(const gchar *path) { ep_path = g_slist_append(ep_path, g_strdup(path)); } @@ -582,11 +582,11 @@ e_plugin_add_load_path(const char *path) * * Return value: Returns -1 if an error occurred. **/ -int +gint e_plugin_load_plugins(void) { GSList *l; - int i; + gint i; if (ep_types == NULL) { g_warning("no plugin types defined"); @@ -596,8 +596,8 @@ e_plugin_load_plugins(void) for (i=0; i < 3; i++) { for (l = ep_path;l;l = g_slist_next(l)) { GDir *dir; - const char *d; - char *path = l->data; + const gchar *d; + gchar *path = l->data; pd(printf("scanning plugin dir '%s'\n", path)); @@ -609,7 +609,7 @@ e_plugin_load_plugins(void) while ( (d = g_dir_read_name(dir)) ) { if (g_str_has_suffix (d, ".eplug")) { - char * name = g_build_filename(path, d, NULL); + gchar * name = g_build_filename(path, d, NULL); ep_load(name, i); g_free(name); @@ -649,7 +649,7 @@ e_plugin_register_type(GType type) pd(printf("register plugin type '%s'\n", class->type)); - g_hash_table_insert(ep_types, (void *)class->type, class); + g_hash_table_insert(ep_types, (gpointer)class->type, class); /* check for pending plugins */ pdoc = (struct _plugin_doc *)ep_plugin_docs.head; @@ -660,9 +660,9 @@ e_plugin_register_type(GType type) for (l=pdoc->plugins;l;l=g_slist_next(l)) { xmlNodePtr root = l->data; - char *prop_type; + gchar *prop_type; - prop_type = (char *)xmlGetProp(root, (const unsigned char *)"type"); + prop_type = (gchar *)xmlGetProp(root, (const guchar *)"type"); if (!strcmp(prop_type, class->type)) add = g_slist_append(add, l->data); xmlFree(prop_type); @@ -688,7 +688,7 @@ e_plugin_register_type(GType type) } static void -ep_list_plugin(void *key, void *val, void *dat) +ep_list_plugin(gpointer key, gpointer val, gpointer dat) { GSList **l = (GSList **)dat; @@ -725,7 +725,7 @@ e_plugin_list_plugins(void) * * Return value: The return from the construct virtual method. **/ -int +gint e_plugin_construct(EPlugin *ep, xmlNodePtr root) { EPluginClass *class; @@ -751,8 +751,8 @@ e_plugin_construct(EPlugin *ep, xmlNodePtr root) * * Return value: The return of the plugin invocation. **/ -void * -e_plugin_invoke(EPlugin *ep, const char *name, void *data) +gpointer +e_plugin_invoke(EPlugin *ep, const gchar *name, gpointer data) { EPluginClass *class; @@ -778,8 +778,8 @@ e_plugin_invoke(EPlugin *ep, const char *name, void *data) * * Return value: the symbol value, or %NULL if not found **/ -void * -e_plugin_get_symbol(EPlugin *ep, const char *name) +gpointer +e_plugin_get_symbol(EPlugin *ep, const gchar *name) { EPluginClass *class; @@ -801,7 +801,7 @@ e_plugin_get_symbol(EPlugin *ep, const char *name) * THIS IS NOT FULLY IMPLEMENTED YET **/ void -e_plugin_enable(EPlugin *ep, int state) +e_plugin_enable(EPlugin *ep, gint state) { EPluginClass *class; @@ -852,15 +852,15 @@ e_plugin_get_configure_widget (EPlugin *ep) * Return value: The property, allocated in GLib memory, or NULL if no * such property exists. **/ -char * -e_plugin_xml_prop(xmlNodePtr node, const char *id) +gchar * +e_plugin_xml_prop(xmlNodePtr node, const gchar *id) { - char *p = (char *)xmlGetProp(node, (const unsigned char *)id); + gchar *p = (gchar *)xmlGetProp(node, (const guchar *)id); if (g_mem_is_system_malloc()) { return p; } else { - char * out = g_strdup(p); + gchar * out = g_strdup(p); if (p) xmlFree(p); @@ -880,12 +880,12 @@ e_plugin_xml_prop(xmlNodePtr node, const char *id) * Return value: The property, allocated in GLib memory, or NULL if no * such property exists. **/ -char * -e_plugin_xml_prop_domain(xmlNodePtr node, const char *id, const char *domain) +gchar * +e_plugin_xml_prop_domain(xmlNodePtr node, const gchar *id, const gchar *domain) { - char *p, *out; + gchar *p, *out; - p = (char *)xmlGetProp(node, (const unsigned char *)id); + p = (gchar *)xmlGetProp(node, (const guchar *)id); if (p == NULL) return NULL; @@ -908,10 +908,10 @@ e_plugin_xml_prop_domain(xmlNodePtr node, const char *id, const char *domain) * * Return value: The value if set, or @def if not. **/ -int -e_plugin_xml_int(xmlNodePtr node, const char *id, int def) +gint +e_plugin_xml_int(xmlNodePtr node, const gchar *id, gint def) { - char *p = (char *)xmlGetProp(node, (const unsigned char *)id); + gchar *p = (gchar *)xmlGetProp(node, (const guchar *)id); if (p) return atoi(p); @@ -929,15 +929,15 @@ e_plugin_xml_int(xmlNodePtr node, const char *id, int def) * * Return value: The node content, allocated in GLib memory. **/ -char * +gchar * e_plugin_xml_content(xmlNodePtr node) { - char *p = (char *)xmlNodeGetContent(node); + gchar *p = (gchar *)xmlNodeGetContent(node); if (g_mem_is_system_malloc()) { return p; } else { - char * out = g_strdup(p); + gchar * out = g_strdup(p); if (p) xmlFree(p); @@ -956,12 +956,12 @@ e_plugin_xml_content(xmlNodePtr node) * * Return value: The node content, allocated in GLib memory. **/ -char * -e_plugin_xml_content_domain(xmlNodePtr node, const char *domain) +gchar * +e_plugin_xml_content_domain(xmlNodePtr node, const gchar *domain) { - char *p, *out; + gchar *p, *out; - p = (char *)xmlNodeGetContent(node); + p = (gchar *)xmlNodeGetContent(node); if (p == NULL) return NULL; @@ -1005,7 +1005,7 @@ epl_loadmodule(EPlugin *ep, gboolean fatal) return -1; } - if (g_module_symbol(epl->module, "e_plugin_lib_enable", (void *)&enable)) { + if (g_module_symbol(epl->module, "e_plugin_lib_enable", (gpointer)&enable)) { if (enable(epl, TRUE) != 0) { ep->enabled = FALSE; g_module_close(epl->module); @@ -1033,8 +1033,8 @@ e_plugin_load_plugins_with_missing_symbols (void) missing_symbols = NULL; } -static void * -epl_invoke(EPlugin *ep, const char *name, void *data) +static gpointer +epl_invoke(EPlugin *ep, const gchar *name, gpointer data) { EPluginLib *epl = E_PLUGIN_LIB (ep); EPluginLibFunc cb; @@ -1047,7 +1047,7 @@ epl_invoke(EPlugin *ep, const char *name, void *data) if (epl_loadmodule(ep, FALSE) != 0) return NULL; - if (!g_module_symbol(epl->module, name, (void *)&cb)) { + if (!g_module_symbol(epl->module, name, (gpointer)&cb)) { g_warning("Cannot resolve symbol '%s' in plugin '%s' (not exported?)", name, epl->location); return NULL; } @@ -1055,7 +1055,7 @@ epl_invoke(EPlugin *ep, const char *name, void *data) return cb(epl, data); } -static void * +static gpointer epl_get_symbol(EPlugin *ep, const gchar *name) { EPluginLib *epl = E_PLUGIN_LIB (ep); @@ -1086,7 +1086,7 @@ epl_construct(EPlugin *ep, xmlNodePtr root) } #ifdef G_OS_WIN32 { - char *mapped_location = + gchar *mapped_location = e_util_replace_prefix (EVOLUTION_PREFIX, e_util_get_prefix (), epl->location); @@ -1098,9 +1098,9 @@ epl_construct(EPlugin *ep, xmlNodePtr root) if (ep->enabled) { xmlChar *tmp; - tmp = xmlGetProp(root, (const unsigned char *)"load-on-startup"); + tmp = xmlGetProp(root, (const guchar *)"load-on-startup"); if (tmp) { - if (strcmp ((const char *)tmp, "after-ui") == 0) { + if (strcmp ((const gchar *)tmp, "after-ui") == 0) { missing_symbols = g_list_prepend (missing_symbols, g_object_ref (ep)); } else { if (epl_loadmodule(ep, FALSE) != 0) { @@ -1128,7 +1128,7 @@ epl_get_configure_widget (EPlugin *ep) return NULL; } - if (g_module_symbol (epl->module, "e_plugin_lib_get_configure_widget", (void *)&get_configure_widget)) { + if (g_module_symbol (epl->module, "e_plugin_lib_get_configure_widget", (gpointer)&get_configure_widget)) { pd (printf ("\n g_module_symbol is loaded\n")); return (GtkWidget*) get_configure_widget (epl); } @@ -1136,7 +1136,7 @@ epl_get_configure_widget (EPlugin *ep) } static void -epl_enable(EPlugin *ep, int state) +epl_enable(EPlugin *ep, gint state) { EPluginLib *epl = E_PLUGIN_LIB (ep); EPluginLibEnableFunc enable; @@ -1151,7 +1151,7 @@ epl_enable(EPlugin *ep, int state) if (epl_loadmodule(ep, FALSE) != 0) return; - if (g_module_symbol(epl->module, "e_plugin_lib_enable", (void *)&enable)) { + if (g_module_symbol(epl->module, "e_plugin_lib_enable", (gpointer)&enable)) { if (enable(epl, state) != 0) return; } @@ -1243,7 +1243,7 @@ eph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) } static void -eph_enable(EPluginHook *eph, int state) +eph_enable(EPluginHook *eph, gint state) { /* NOOP */ } @@ -1302,7 +1302,7 @@ e_plugin_hook_get_type(void) * THIS IS NOT FULY IMEPLEMENTED YET **/ void -e_plugin_hook_enable (EPluginHook *eph, int state) +e_plugin_hook_enable (EPluginHook *eph, gint state) { EPluginHookClass *class; @@ -1336,7 +1336,7 @@ e_plugin_hook_register_type(GType type) klass = g_type_class_ref(type); - oldklass = g_hash_table_lookup(eph_types, (void *)klass->id); + oldklass = g_hash_table_lookup(eph_types, (gpointer)klass->id); if (oldklass == klass) { g_type_class_unref(klass); return; @@ -1346,7 +1346,7 @@ e_plugin_hook_register_type(GType type) } phd(printf("register plugin hook type '%s'\n", klass->id)); - g_hash_table_insert(eph_types, (void *)klass->id, klass); + g_hash_table_insert(eph_types, (gpointer)klass->id, klass); /* if we've already loaded a plugin that needed this hook but it didn't exist, re-load it now */ @@ -1371,7 +1371,7 @@ e_plugin_hook_register_type(GType type) ndoc = pdoc->next; while (ndoc) { if (pdoc->doc) { - int cache = pdoc->plugins != NULL; + gint cache = pdoc->plugins != NULL; for (l=pdoc->plugin_hooks;!cache && l;l=g_slist_next(l)) cache |= (((EPlugin *)l->data)->hooks_pending != NULL); @@ -1407,12 +1407,12 @@ e_plugin_hook_register_type(GType type) * integer values of the corresponding string id's stored in the @map. **/ guint32 -e_plugin_hook_mask(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const char *prop) +e_plugin_hook_mask(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const gchar *prop) { - char *val, *p, *start, c; + gchar *val, *p, *start, c; guint32 mask = 0; - val = (char *)xmlGetProp(root, (const unsigned char *)prop); + val = (gchar *)xmlGetProp(root, (const guchar *)prop); if (val == NULL) return 0; @@ -1424,7 +1424,7 @@ e_plugin_hook_mask(xmlNodePtr root, const struct _EPluginHookTargetKey *map, con c = *p; *p = 0; if (start != p) { - int i; + gint i; for (i=0;map[i].key;i++) { if (!strcmp(map[i].key, start)) { @@ -1458,12 +1458,12 @@ e_plugin_hook_mask(xmlNodePtr root, const struct _EPluginHookTargetKey *map, con * integer value, if not, then ~0. **/ guint32 -e_plugin_hook_id(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const char *prop) +e_plugin_hook_id(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const gchar *prop) { - char *val; - int i; + gchar *val; + gint i; - val = (char *)xmlGetProp(root, (const unsigned char *)prop); + val = (gchar *)xmlGetProp(root, (const guchar *)prop); if (val == NULL) return ~0; @@ -1485,7 +1485,7 @@ e_plugin_hook_id(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const static gpointer epth_parent_class; static int -epth_load_plugin(void *d) +epth_load_plugin(gpointer d) { EPluginHook *eph = d; EPluginTypeHook *epth = d; @@ -1513,7 +1513,7 @@ epth_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp((char *)node->name, "plugin-type") == 0) { + if (strcmp((gchar *)node->name, "plugin-type") == 0) { epth->get_type = e_plugin_xml_prop(node, "get-type"); /* We need to run this in an idle handler, * since at this point the parent EPlugin wont diff --git a/e-util/e-plugin.h b/e-util/e-plugin.h index 54855d0b95..64f4ccd2e5 100644 --- a/e-util/e-plugin.h +++ b/e-util/e-plugin.h @@ -54,8 +54,8 @@ typedef struct _EPluginClass EPluginClass; /* Structure to define the author(s) names and addresses */ typedef struct _EPluginAuthor EPluginAuthor; struct _EPluginAuthor { - char *name; - char *email; + gchar *name; + gchar *email; }; /** @@ -80,13 +80,13 @@ struct _EPluginAuthor { struct _EPlugin { GObject object; - char *id; - char *path; + gchar *id; + gchar *path; GSList *hooks_pending; - char *description; - char *name; - char *domain; + gchar *description; + gchar *name; + gchar *domain; GSList *hooks; GSList *authors; /* EPluginAuthor structures */ @@ -120,38 +120,38 @@ struct _EPlugin { struct _EPluginClass { GObjectClass parent_class; - const char *type; + const gchar *type; - int (*construct)(EPlugin *, xmlNodePtr root); - void *(*get_symbol)(EPlugin *, const char *name); - void *(*invoke)(EPlugin *, const char *name, void *data); - void (*enable)(EPlugin *, int state); + gint (*construct)(EPlugin *, xmlNodePtr root); + gpointer (*get_symbol)(EPlugin *, const gchar *name); + gpointer (*invoke)(EPlugin *, const gchar *name, gpointer data); + void (*enable)(EPlugin *, gint state); GtkWidget *(*get_configure_widget)(EPlugin *); }; GType e_plugin_get_type(void); -int e_plugin_construct(EPlugin *ep, xmlNodePtr root); -void e_plugin_add_load_path(const char *); -int e_plugin_load_plugins(void); +gint e_plugin_construct(EPlugin *ep, xmlNodePtr root); +void e_plugin_add_load_path(const gchar *); +gint e_plugin_load_plugins(void); void e_plugin_load_plugins_with_missing_symbols(void); GSList * e_plugin_list_plugins(void); void e_plugin_register_type(GType type); -void *e_plugin_get_symbol(EPlugin *ep, const char *name); -void *e_plugin_invoke(EPlugin *ep, const char *name, void *data); -void e_plugin_enable(EPlugin *eph, int state); +gpointer e_plugin_get_symbol(EPlugin *ep, const gchar *name); +gpointer e_plugin_invoke(EPlugin *ep, const gchar *name, gpointer data); +void e_plugin_enable(EPlugin *eph, gint state); GtkWidget *e_plugin_get_configure_widget (EPlugin *ep); /* static helpers */ /* maps prop or content to 'g memory' */ -char *e_plugin_xml_prop(xmlNodePtr node, const char *id); -char *e_plugin_xml_prop_domain(xmlNodePtr node, const char *id, const char *domain); -int e_plugin_xml_int(xmlNodePtr node, const char *id, int def); -char *e_plugin_xml_content(xmlNodePtr node); -char *e_plugin_xml_content_domain(xmlNodePtr node, const char *domain); +gchar *e_plugin_xml_prop(xmlNodePtr node, const gchar *id); +gchar *e_plugin_xml_prop_domain(xmlNodePtr node, const gchar *id, const gchar *domain); +gint e_plugin_xml_int(xmlNodePtr node, const gchar *id, gint def); +gchar *e_plugin_xml_content(xmlNodePtr node); +gchar *e_plugin_xml_content_domain(xmlNodePtr node, const gchar *domain); /* ********************************************************************** */ #include <gmodule.h> @@ -179,12 +179,12 @@ typedef struct _EPluginLib EPluginLib; typedef struct _EPluginLibClass EPluginLibClass; /* The callback signature used for epluginlib methods */ -typedef void *(*EPluginLibFunc)(EPluginLib *ep, void *data); +typedef gpointer (*EPluginLibFunc)(EPluginLib *ep, gpointer data); /* The setup method, this will be called when the plugin is * initialised. In the future it may also be called when the plugin * is disabled. */ -typedef int (*EPluginLibEnableFunc)(EPluginLib *ep, int enable); -typedef void *(*EPluginLibGetConfigureWidgetFunc)(EPluginLib *ep); +typedef gint (*EPluginLibEnableFunc)(EPluginLib *ep, gint enable); +typedef gpointer (*EPluginLibGetConfigureWidgetFunc)(EPluginLib *ep); /** * struct _EPluginLib - @@ -203,7 +203,7 @@ typedef void *(*EPluginLibGetConfigureWidgetFunc)(EPluginLib *ep); struct _EPluginLib { EPlugin plugin; - char *location; + gchar *location; GModule *module; }; @@ -258,7 +258,7 @@ typedef struct _EPluginHookTargetKey EPluginHookTargetKey; * helper functions to simplify plugin hook subclassing. **/ struct _EPluginHookTargetKey { - const char *key; + const gchar *key; guint32 value; }; @@ -275,8 +275,8 @@ struct _EPluginHookTargetKey { * when reading the XML plugin hook definitions. **/ struct _EPluginHookTargetMap { - const char *type; - int id; + const gchar *type; + gint id; const struct _EPluginHookTargetKey *mask_bits; /* null terminated array */ }; @@ -315,10 +315,10 @@ struct _EPluginHook { struct _EPluginHookClass { GObjectClass parent_class; - const char *id; + const gchar *id; - int (*construct)(EPluginHook *eph, EPlugin *ep, xmlNodePtr root); - void (*enable)(EPluginHook *eph, int state); + gint (*construct)(EPluginHook *eph, EPlugin *ep, xmlNodePtr root); + void (*enable)(EPluginHook *eph, gint state); }; GType e_plugin_hook_get_type(void); @@ -326,11 +326,11 @@ GType e_plugin_hook_get_type(void); void e_plugin_hook_register_type(GType type); EPluginHook * e_plugin_hook_new(EPlugin *ep, xmlNodePtr root); -void e_plugin_hook_enable(EPluginHook *eph, int state); +void e_plugin_hook_enable(EPluginHook *eph, gint state); /* static methods */ -guint32 e_plugin_hook_mask(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const char *prop); -guint32 e_plugin_hook_id(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const char *prop); +guint32 e_plugin_hook_mask(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const gchar *prop); +guint32 e_plugin_hook_id(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const gchar *prop); /* ********************************************************************** */ @@ -365,7 +365,7 @@ typedef struct _EPluginTypeHookClass EPluginTypeHookClass; struct _EPluginTypeHook { EPluginHook hook; - char *get_type; + gchar *get_type; guint idle; }; diff --git a/e-util/e-popup.c b/e-util/e-popup.c index bcd152713c..9bb63748dd 100644 --- a/e-util/e-popup.c +++ b/e-util/e-popup.c @@ -38,9 +38,9 @@ struct _EPopupFactory { struct _EPopupFactory *next, *prev; - char *menuid; + gchar *menuid; EPopupFactoryFunc factory; - void *factory_data; + gpointer factory_data; }; /* Used for the "activate" signal callback data to re-map to the api */ @@ -63,9 +63,9 @@ struct _menu_node { EPopup *popup; GSList *menu; - char *domain; + gchar *domain; EPopupItemsFunc freefunc; - void *data; + gpointer data; struct _item_node *items; }; @@ -188,7 +188,7 @@ e_popup_get_type(void) * * Return value: A new EPopup. **/ -EPopup *e_popup_new(const char *menuid) +EPopup *e_popup_new(const gchar *menuid) { EPopup *ep = g_object_new(e_popup_get_type(), NULL); @@ -206,7 +206,7 @@ EPopup *e_popup_new(const char *menuid) * * Return value: Returns @ep. **/ -EPopup *e_popup_construct(EPopup *ep, const char *menuid) +EPopup *e_popup_construct(EPopup *ep, const gchar *menuid) { ep->menuid = g_strdup(menuid); @@ -229,7 +229,7 @@ EPopup *e_popup_construct(EPopup *ep, const char *menuid) * built to create a complex heirarchy of menus. **/ void -e_popup_add_items(EPopup *emp, GSList *items, const char *domain, EPopupItemsFunc freefunc, void *data) +e_popup_add_items(EPopup *emp, GSList *items, const gchar *domain, EPopupItemsFunc freefunc, gpointer data) { struct _menu_node *node; @@ -264,10 +264,10 @@ ep_add_static_items(EPopup *emp) } static int -ep_cmp(const void *ap, const void *bp) +ep_cmp(gconstpointer ap, gconstpointer bp) { - struct _item_node *a = *((void **)ap); - struct _item_node *b = *((void **)bp); + struct _item_node *a = *((gpointer *)ap); + struct _item_node *b = *((gpointer *)bp); return strcmp(a->item->path, b->item->path); } @@ -375,7 +375,7 @@ ep_build_tree(struct _item_node *inode, guint32 mask) gtk_widget_show (item->image); break; case E_POPUP_RADIO: { - char *ppath = inode->parent?inode->parent->item->path:NULL; + gchar *ppath = inode->parent?inode->parent->item->path:NULL; menuitem = (GtkMenuItem *)gtk_radio_menu_item_new(g_hash_table_lookup(group_hash, ppath)); g_hash_table_insert(group_hash, ppath, gtk_radio_menu_item_get_group((GtkRadioMenuItem *)menuitem)); @@ -459,7 +459,7 @@ e_popup_create_menu(EPopup *emp, EPopupTarget *target, guint32 mask) GString *ppath = g_string_new(""); GHashTable *tree_hash = g_hash_table_new(g_str_hash, g_str_equal); EDList head = E_DLIST_INITIALISER(head); - int i; + gint i; emp->target = target; ep_add_static_items(emp); @@ -510,7 +510,7 @@ e_popup_create_menu(EPopup *emp, EPopupTarget *target, guint32 mask) struct _item_node *inode = items->pdata[i], *pnode; struct _item_node *nextnode = (i + 1 < items->len) ? items->pdata[i+1] : NULL; struct _EPopupItem *item = inode->item; - const char *tmp; + const gchar *tmp; if (nextnode && !strcmp (nextnode->item->path, item->path)) { d(printf ("skipping item %s\n", item->path)); @@ -607,7 +607,7 @@ e_popup_create_menu_once(EPopup *emp, EPopupTarget *target, guint32 mask) * it later. **/ EPopupFactory * -e_popup_class_add_factory(EPopupClass *klass, const char *menuid, EPopupFactoryFunc func, void *data) +e_popup_class_add_factory(EPopupClass *klass, const gchar *menuid, EPopupFactoryFunc func, gpointer data) { struct _EPopupFactory *f = g_malloc0(sizeof(*f)); @@ -648,7 +648,7 @@ e_popup_class_remove_factory(EPopupClass *klass, EPopupFactory *f) * * Allocate a new popup target suitable for this popup type. **/ -void *e_popup_target_new(EPopup *ep, int type, size_t size) +gpointer e_popup_target_new(EPopup *ep, gint type, size_t size) { EPopupTarget *t; @@ -675,7 +675,7 @@ void *e_popup_target_new(EPopup *ep, int type, size_t size) * only required if you are using the target for other purposes. **/ void -e_popup_target_free(EPopup *ep, void *o) +e_popup_target_free(EPopup *ep, gpointer o) { EPopupTarget *t = o; @@ -710,7 +710,7 @@ e_popup_target_free(EPopup *ep, void *o) */ -static void *emph_parent_class; +static gpointer emph_parent_class; #define emph ((EPopupHook *)eph) /* must have 1:1 correspondence with e-popup types in order */ @@ -725,15 +725,15 @@ static const EPluginHookTargetKey emph_item_types[] = { }; static void -emph_popup_activate(EPopup *ep, EPopupItem *item, void *data) +emph_popup_activate(EPopup *ep, EPopupItem *item, gpointer data) { EPopupHook *hook = data; - e_plugin_invoke(hook->hook.plugin, (char *)item->user_data, ep->target); + e_plugin_invoke(hook->hook.plugin, (gchar *)item->user_data, ep->target); } static void -emph_popup_factory(EPopup *emp, void *data) +emph_popup_factory(EPopup *emp, gpointer data) { struct _EPopupHookMenu *menu = data; @@ -811,13 +811,13 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) xmlNodePtr node; EPopupHookTargetMap *map; EPopupHookClass *klass = (EPopupHookClass *)G_OBJECT_GET_CLASS(eph); - char *tmp; + gchar *tmp; d(printf(" loading menu\n")); menu = g_malloc0(sizeof(*menu)); menu->hook = (EPopupHook *)eph; - tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); + tmp = (gchar *)xmlGetProp(root, (const guchar *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -837,7 +837,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) node = root->children; while (node) { - if (0 == strcmp((char *)node->name, "item")) { + if (0 == strcmp((gchar *)node->name, "item")) { struct _EPopupItem *item; item = emph_construct_item(eph, menu, node, map); @@ -868,7 +868,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp((char *)node->name, "menu") == 0) { + if (strcmp((gchar *)node->name, "menu") == 0) { struct _EPopupHookMenu *menu; menu = emph_construct_menu(eph, node); @@ -949,5 +949,5 @@ e_popup_hook_get_type(void) **/ void e_popup_hook_class_add_target_map(EPopupHookClass *klass, const EPopupHookTargetMap *map) { - g_hash_table_insert(klass->target_map, (void *)map->type, (void *)map); + g_hash_table_insert(klass->target_map, (gpointer)map->type, (gpointer)map); } diff --git a/e-util/e-popup.h b/e-util/e-popup.h index 65c51ce65f..0f430af801 100644 --- a/e-util/e-popup.h +++ b/e-util/e-popup.h @@ -44,9 +44,9 @@ typedef struct _EPopupItem EPopupItem; typedef struct _EPopupFactory EPopupFactory; /* anonymous type */ typedef struct _EPopupTarget EPopupTarget; -typedef void (*EPopupActivateFunc)(EPopup *ep, EPopupItem *item, void *data); -typedef void (*EPopupFactoryFunc)(EPopup *emp, void *data); -typedef void (*EPopupItemsFunc)(EPopup *ep, GSList *items, void *data); +typedef void (*EPopupActivateFunc)(EPopup *ep, EPopupItem *item, gpointer data); +typedef void (*EPopupFactoryFunc)(EPopup *emp, gpointer data); +typedef void (*EPopupItemsFunc)(EPopup *ep, GSList *items, gpointer data); /** * enum _e_popup_t - Popup item type enumeration. @@ -116,11 +116,11 @@ enum _e_popup_t { */ struct _EPopupItem { enum _e_popup_t type; - char *path; /* absolute path! must sort ascii-lexographically into the right spot */ - char *label; + gchar *path; /* absolute path! must sort ascii-lexographically into the right spot */ + gchar *label; EPopupActivateFunc activate; - void *user_data; /* user data, not passed directly to @activate */ - void *image; /* char* for item type, GtkWidget * for image type */ + gpointer user_data; /* user data, not passed directly to @activate */ + gpointer image; /* gchar * for item type, GtkWidget * for image type */ guint32 visible; /* visibility mask */ guint32 enable; /* sensitivity mask */ }; @@ -168,7 +168,7 @@ struct _EPopup { struct _EPopupPrivate *priv; - char *menuid; + gchar *menuid; EPopupTarget *target; }; @@ -198,23 +198,23 @@ struct _EPopupClass { GType e_popup_get_type(void); -EPopup *e_popup_new(const char *menuid); +EPopup *e_popup_new(const gchar *menuid); /* Static class methods */ -EPopupFactory *e_popup_class_add_factory(EPopupClass *klass, const char *menuid, EPopupFactoryFunc func, void *data); +EPopupFactory *e_popup_class_add_factory(EPopupClass *klass, const gchar *menuid, EPopupFactoryFunc func, gpointer data); void e_popup_class_remove_factory(EPopupClass *klass, EPopupFactory *f); -EPopup *e_popup_construct(EPopup *, const char *menuid); +EPopup *e_popup_construct(EPopup *, const gchar *menuid); -void e_popup_add_items(EPopup *, GSList *items, const char *domain, EPopupItemsFunc freefunc, void *data); +void e_popup_add_items(EPopup *, GSList *items, const gchar *domain, EPopupItemsFunc freefunc, gpointer data); void e_popup_add_static_items(EPopup *emp, EPopupTarget *target); /* do not call e_popup_create_menu, it can leak structures if not used right */ struct _GtkMenu *e_popup_create_menu(EPopup *, EPopupTarget *, guint32 mask); struct _GtkMenu *e_popup_create_menu_once(EPopup *emp, EPopupTarget *, guint32 mask); -void *e_popup_target_new(EPopup *, int type, size_t size); -void e_popup_target_free(EPopup *, void *); +gpointer e_popup_target_new(EPopup *, gint type, size_t size); +void e_popup_target_free(EPopup *, gpointer ); /* ********************************************************************** */ @@ -250,10 +250,10 @@ typedef void (*EPopupHookFunc)(struct _EPlugin *plugin, EPopupTarget *target); */ struct _EPopupHookMenu { struct _EPopupHook *hook; /* parent pointer */ - char *id; /* target menu id for these menu items */ - int target_type; /* target type of this menu */ + gchar *id; /* target menu id for these menu items */ + gint target_type; /* target type of this menu */ GSList *items; /* items to add to menu */ - char *factory; /* optional factory to call for adding menu items */ + gchar *factory; /* optional factory to call for adding menu items */ }; /** diff --git a/e-util/e-profile-event.c b/e-util/e-profile-event.c index ee98ad8b75..297fcf5739 100644 --- a/e-util/e-profile-event.c +++ b/e-util/e-profile-event.c @@ -109,7 +109,7 @@ EProfileEvent *e_profile_event_peek(void) } EProfileEventTarget * -e_profile_event_target_new(EProfileEvent *eme, const char *id, const char *uid, guint32 flags) +e_profile_event_target_new(EProfileEvent *eme, const gchar *id, const gchar *uid, guint32 flags) { EProfileEventTarget *t = e_event_target_new(&eme->popup, E_PROFILE_EVENT_TARGET, sizeof(*t)); GTimeVal tv; @@ -126,7 +126,7 @@ e_profile_event_target_new(EProfileEvent *eme, const char *id, const char *uid, #ifdef ENABLE_PROFILING void -e_profile_event_emit(const char *id, const char *uid, guint32 flags) +e_profile_event_emit(const gchar *id, const gchar *uid, guint32 flags) { EProfileEvent *epe = e_profile_event_peek(); EProfileEventTarget *t = e_profile_event_target_new(epe, id, uid, flags); @@ -137,14 +137,14 @@ e_profile_event_emit(const char *id, const char *uid, guint32 flags) /* simply keep macro from header file expand to "nothing". #undef e_profile_event_emit static void -e_profile_event_emit(const char *id, const char *uid, guint32 flags) +e_profile_event_emit(const gchar *id, const gchar *uid, guint32 flags) { }*/ #endif /* ********************************************************************** */ -static void *emeh_parent_class; +static gpointer emeh_parent_class; #define emeh ((EProfileEventHook *)eph) static const EEventHookTargetMask emeh_profile_masks[] = { @@ -170,7 +170,7 @@ emeh_finalise(GObject *o) static void emeh_class_init(EPluginHookClass *klass) { - int i; + gint i; ((GObjectClass *)klass)->finalize = emeh_finalise; ((EPluginHookClass *)klass)->id = "org.gnome.evolution.profile.events:1.0"; diff --git a/e-util/e-profile-event.h b/e-util/e-profile-event.h index c20a5f1044..5caa50cf4d 100644 --- a/e-util/e-profile-event.h +++ b/e-util/e-profile-event.h @@ -58,8 +58,8 @@ struct _EProfileEventTarget { EEventTarget target; struct timeval tv; - char *id; /* id of event */ - char *uid; /* uid of event (folder/message, etc) */ + gchar *id; /* id of event */ + gchar *uid; /* uid of event (folder/message, etc) */ }; typedef struct _EEventItem EProfileEventItem; @@ -79,11 +79,11 @@ GType e_profile_event_get_type(void); EProfileEvent *e_profile_event_peek(void); -EProfileEventTarget *e_profile_event_target_new(EProfileEvent *emp, const char *id, const char *uid, guint32 flags); +EProfileEventTarget *e_profile_event_target_new(EProfileEvent *emp, const gchar *id, const gchar *uid, guint32 flags); /* we don't want ANY rubbish code lying around if we have profiling off */ #ifdef ENABLE_PROFILING -void e_profile_event_emit(const char *id, const char *uid, guint32 flags); +void e_profile_event_emit(const gchar *id, const gchar *uid, guint32 flags); #else #define e_profile_event_emit(a, b, c) #endif diff --git a/e-util/e-request.c b/e-util/e-request.c index 2175c75b2a..3cd23968b2 100644 --- a/e-util/e-request.c +++ b/e-util/e-request.c @@ -39,14 +39,14 @@ * Return value: %NULL if the user cancelled the dialog, the inserted * string (in UTF8) otherwise. The string must be freed by the caller. **/ -char * +gchar * e_request_string (GtkWindow *parent, - const char *title, - const char *prompt, - const char *default_string) + const gchar *title, + const gchar *prompt, + const gchar *default_string) { GtkWidget *prompt_label; - char *text; + gchar *text; GtkWidget *dialog; GtkWidget *entry; GtkWidget *vbox; diff --git a/e-util/e-request.h b/e-util/e-request.h index ae822db83e..63eacdf8bb 100644 --- a/e-util/e-request.h +++ b/e-util/e-request.h @@ -25,9 +25,9 @@ #include <gtk/gtk.h> -char *e_request_string (GtkWindow *parent, - const char *title, - const char *prompt, - const char *default_string); +gchar *e_request_string (GtkWindow *parent, + const gchar *title, + const gchar *prompt, + const gchar *default_string); #endif diff --git a/e-util/e-signature-list.c b/e-util/e-signature-list.c index eaedddaf50..1480f37e68 100644 --- a/e-util/e-signature-list.c +++ b/e-util/e-signature-list.c @@ -175,7 +175,7 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, EList *old_sigs; EIterator *iter; gboolean found; - char *uid; + gchar *uid; old_sigs = e_list_duplicate (E_LIST (signature_list)); @@ -252,8 +252,8 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, signature_list->priv->resave = resave; } -static void * -copy_func (const void *data, void *closure) +static gpointer +copy_func (gconstpointer data, gpointer closure) { GObject *object = (GObject *)data; @@ -263,7 +263,7 @@ copy_func (const void *data, void *closure) } static void -free_func (void *data, void *closure) +free_func (gpointer data, gpointer closure) { g_object_unref (data); } @@ -338,7 +338,7 @@ e_signature_list_save (ESignatureList *signature_list) GSList *list = NULL; ESignature *signature; EIterator *iter; - char *xmlbuf; + gchar *xmlbuf; for (iter = e_list_get_iterator (E_LIST (signature_list)); e_iterator_is_valid (iter); @@ -430,7 +430,7 @@ e_signature_list_remove (ESignatureList *signatures, ESignature *signature) * Return value: The signature or NULL if it doesn't exist. **/ const ESignature * -e_signature_list_find (ESignatureList *signatures, e_signature_find_t type, const char *key) +e_signature_list_find (ESignatureList *signatures, e_signature_find_t type, const gchar *key) { const ESignature *signature = NULL; EIterator *it; @@ -444,7 +444,7 @@ e_signature_list_find (ESignatureList *signatures, e_signature_find_t type, cons for (it = e_list_get_iterator ((EList *) signatures); e_iterator_is_valid (it); e_iterator_next (it)) { - int found = 0; + gint found = 0; signature = (const ESignature *) e_iterator_get (it); diff --git a/e-util/e-signature-list.h b/e-util/e-signature-list.h index 8d8caed0a8..1c27a12453 100644 --- a/e-util/e-signature-list.h +++ b/e-util/e-signature-list.h @@ -71,6 +71,6 @@ void e_signature_list_add (ESignatureList *signature_list, ESignature *signature void e_signature_list_change (ESignatureList *signature_list, ESignature *signature); void e_signature_list_remove (ESignatureList *signature_list, ESignature *signature); -const ESignature *e_signature_list_find (ESignatureList *signature_list, e_signature_find_t type, const char *key); +const ESignature *e_signature_list_find (ESignatureList *signature_list, e_signature_find_t type, const gchar *key); #endif /* __E_SIGNATURE_LIST__ */ diff --git a/e-util/e-signature.c b/e-util/e-signature.c index 1cbed6b66b..60659f8c55 100644 --- a/e-util/e-signature.c +++ b/e-util/e-signature.c @@ -124,7 +124,7 @@ e_signature_new (void) * if @xml could not be parsed as valid signature data. **/ ESignature * -e_signature_new_from_xml (const char *xml) +e_signature_new_from_xml (const gchar *xml) { ESignature *signature; @@ -139,12 +139,12 @@ e_signature_new_from_xml (const char *xml) static gboolean -xml_set_bool (xmlNodePtr node, const char *name, gboolean *val) +xml_set_bool (xmlNodePtr node, const gchar *name, gboolean *val) { gboolean bool; - char *buf; + gchar *buf; - if ((buf = (char *)xmlGetProp (node, (const unsigned char *)name))) { + if ((buf = (gchar *)xmlGetProp (node, (const guchar *)name))) { bool = (!strcmp (buf, "true") || !strcmp (buf, "yes")); xmlFree (buf); @@ -158,11 +158,11 @@ xml_set_bool (xmlNodePtr node, const char *name, gboolean *val) } static gboolean -xml_set_prop (xmlNodePtr node, const char *name, char **val) +xml_set_prop (xmlNodePtr node, const gchar *name, gchar **val) { - char *buf, *new_val; + gchar *buf, *new_val; - buf = (char *)xmlGetProp (node, (const unsigned char *)name); + buf = (gchar *)xmlGetProp (node, (const guchar *)name); new_val = g_strdup (buf); xmlFree (buf); @@ -180,11 +180,11 @@ xml_set_prop (xmlNodePtr node, const char *name, char **val) } static gboolean -xml_set_content (xmlNodePtr node, char **val) +xml_set_content (xmlNodePtr node, gchar **val) { - char *buf, *new_val; + gchar *buf, *new_val; - buf = (char *)xmlNodeGetContent (node); + buf = (gchar *)xmlNodeGetContent (node); new_val = g_strdup (buf); xmlFree (buf); @@ -210,18 +210,18 @@ xml_set_content (xmlNodePtr node, char **val) * (or %NULL if @xml could not be parsed or did not contain a uid). * The caller must free this string. **/ -char * -e_signature_uid_from_xml (const char *xml) +gchar * +e_signature_uid_from_xml (const gchar *xml) { xmlNodePtr node; xmlDocPtr doc; - char *uid = NULL; + gchar *uid = NULL; - if (!(doc = xmlParseDoc ((unsigned char *) xml))) + if (!(doc = xmlParseDoc ((guchar *) xml))) return NULL; node = doc->children; - if (strcmp ((char *)node->name, "signature") != 0) { + if (strcmp ((gchar *)node->name, "signature") != 0) { xmlFreeDoc (doc); return NULL; } @@ -243,19 +243,19 @@ e_signature_uid_from_xml (const char *xml) * Returns %TRUE if the signature was loaded or %FALSE otherwise. **/ gboolean -e_signature_set_from_xml (ESignature *signature, const char *xml) +e_signature_set_from_xml (ESignature *signature, const gchar *xml) { gboolean changed = FALSE; xmlNodePtr node, cur; xmlDocPtr doc; gboolean bool; - char *buf; + gchar *buf; - if (!(doc = xmlParseDoc ((unsigned char *) xml))) + if (!(doc = xmlParseDoc ((guchar *) xml))) return FALSE; node = doc->children; - if (strcmp ((char *)node->name, "signature") != 0) { + if (strcmp ((gchar *)node->name, "signature") != 0) { xmlFreeDoc (doc); return FALSE; } @@ -292,11 +292,11 @@ e_signature_set_from_xml (ESignature *signature, const char *xml) cur = node->children; while (cur) { - if (!strcmp ((char *)cur->name, "filename")) { + if (!strcmp ((gchar *)cur->name, "filename")) { changed |= xml_set_content (cur, &signature->filename); changed |= xml_set_bool (cur, "script", &signature->script); break; - } else if (!strcmp ((char *)cur->name, "script")) { + } else if (!strcmp ((gchar *)cur->name, "script")) { /* this is for handling 1.4 signature script definitions */ changed |= xml_set_content (cur, &signature->filename); if (!signature->script) { @@ -322,35 +322,35 @@ e_signature_set_from_xml (ESignature *signature, const char *xml) * Return value: an XML representation of @signature, which the caller * must free. **/ -char * +gchar * e_signature_to_xml (ESignature *signature) { xmlChar *xmlbuf; - char *tmp; + gchar *tmp; xmlNodePtr root, node; xmlDocPtr doc; - int n; + gint n; - doc = xmlNewDoc ((const unsigned char *)"1.0"); + doc = xmlNewDoc ((const guchar *)"1.0"); - root = xmlNewDocNode (doc, NULL, (const unsigned char *)"signature", NULL); + root = xmlNewDocNode (doc, NULL, (const guchar *)"signature", NULL); xmlDocSetRootElement (doc, root); - xmlSetProp (root, (const unsigned char *)"name", (unsigned char *)signature->name); - xmlSetProp (root, (const unsigned char *)"uid", (unsigned char *)signature->uid); - xmlSetProp (root, (const unsigned char *)"auto", (const unsigned char *)(signature->autogen ? "true" : "false")); + xmlSetProp (root, (const guchar *)"name", (guchar *)signature->name); + xmlSetProp (root, (const guchar *)"uid", (guchar *)signature->uid); + xmlSetProp (root, (const guchar *)"auto", (const guchar *)(signature->autogen ? "true" : "false")); if (!signature->autogen) { - xmlSetProp (root, (const unsigned char *)"format", (const unsigned char *)(signature->html ? "text/html" : "text/plain")); + xmlSetProp (root, (const guchar *)"format", (const guchar *)(signature->html ? "text/html" : "text/plain")); if (signature->filename) { - node = xmlNewTextChild (root, NULL, (const unsigned char *)"filename", (unsigned char *)signature->filename); + node = xmlNewTextChild (root, NULL, (const guchar *)"filename", (guchar *)signature->filename); if (signature->script) - xmlSetProp (node, (const unsigned char *)"script", (const unsigned char *)"true"); + xmlSetProp (node, (const guchar *)"script", (const guchar *)"true"); } } else { /* this is to make Evolution-1.4 and older 1.5 versions happy */ - xmlSetProp (root, (const unsigned char *)"format", (const unsigned char *)"text/html"); + xmlSetProp (root, (const guchar *)"format", (const guchar *)"text/html"); } xmlDocDumpMemory (doc, &xmlbuf, &n); diff --git a/e-util/e-signature.h b/e-util/e-signature.h index cc8591b421..e965f9c65e 100644 --- a/e-util/e-signature.h +++ b/e-util/e-signature.h @@ -47,9 +47,9 @@ struct _ESignature { gboolean script; gboolean html; - char *filename; - char *name; - char *uid; + gchar *filename; + gchar *name; + gchar *uid; }; struct _ESignatureClass { @@ -61,13 +61,13 @@ struct _ESignatureClass { GType e_signature_get_type (void); ESignature *e_signature_new (void); -ESignature *e_signature_new_from_xml (const char *xml); +ESignature *e_signature_new_from_xml (const gchar *xml); -char *e_signature_uid_from_xml (const char *xml); +gchar *e_signature_uid_from_xml (const gchar *xml); -gboolean e_signature_set_from_xml (ESignature *sig, const char *xml); +gboolean e_signature_set_from_xml (ESignature *sig, const gchar *xml); -char *e_signature_to_xml (ESignature *sig); +gchar *e_signature_to_xml (ESignature *sig); #ifdef __cplusplus } diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c index 060c3f441a..a708550a12 100644 --- a/e-util/e-sorter-array.c +++ b/e-util/e-sorter-array.c @@ -37,23 +37,23 @@ G_DEFINE_TYPE (ESorterArray, e_sorter_array, E_SORTER_TYPE) static void esa_sort (ESorterArray *esa); static void esa_backsort (ESorterArray *esa); -static gint esa_model_to_sorted (ESorter *sorter, int row); -static gint esa_sorted_to_model (ESorter *sorter, int row); -static void esa_get_model_to_sorted_array (ESorter *sorter, int **array, int *count); -static void esa_get_sorted_to_model_array (ESorter *sorter, int **array, int *count); +static gint esa_model_to_sorted (ESorter *sorter, gint row); +static gint esa_sorted_to_model (ESorter *sorter, gint row); +static void esa_get_model_to_sorted_array (ESorter *sorter, gint **array, gint *count); +static void esa_get_sorted_to_model_array (ESorter *sorter, gint **array, gint *count); static gboolean esa_needs_sorting (ESorter *esa); #define ESA_NEEDS_SORTING(esa) (((ESorterArray *) (esa))->compare != NULL) static int -esort_callback(const void *data1, const void *data2, gpointer user_data) +esort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) { ESorterArray *esa = user_data; - int ret_val; - int int1, int2; + gint ret_val; + gint int1, int2; - int1 = *(int *)data1; - int2 = *(int *)data2; + int1 = *(gint *)data1; + int2 = *(gint *)data2; ret_val = esa->compare (int1, int2, esa->closure); if (ret_val != 0) @@ -69,8 +69,8 @@ esort_callback(const void *data1, const void *data2, gpointer user_data) static void esa_sort(ESorterArray *esa) { - int rows; - int i; + gint rows; + gint i; if (esa->sorted) return; @@ -90,7 +90,7 @@ esa_sort(ESorterArray *esa) static void esa_backsort(ESorterArray *esa) { - int i, rows; + gint i, rows; if (esa->backsorted) return; @@ -108,7 +108,7 @@ esa_backsort(ESorterArray *esa) static gint -esa_model_to_sorted (ESorter *es, int row) +esa_model_to_sorted (ESorter *es, gint row) { ESorterArray *esa = E_SORTER_ARRAY(es); @@ -125,7 +125,7 @@ esa_model_to_sorted (ESorter *es, int row) } static gint -esa_sorted_to_model (ESorter *es, int row) +esa_sorted_to_model (ESorter *es, gint row) { ESorterArray *esa = (ESorterArray *) es; @@ -142,7 +142,7 @@ esa_sorted_to_model (ESorter *es, int row) } static void -esa_get_model_to_sorted_array (ESorter *es, int **array, int *count) +esa_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) { ESorterArray *esa = E_SORTER_ARRAY(es); if (array || count) { @@ -156,7 +156,7 @@ esa_get_model_to_sorted_array (ESorter *es, int **array, int *count) } static void -esa_get_sorted_to_model_array (ESorter *es, int **array, int *count) +esa_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) { ESorterArray *esa = E_SORTER_ARRAY(es); if (array || count) { @@ -187,23 +187,23 @@ e_sorter_array_clean(ESorterArray *esa) } void -e_sorter_array_set_count (ESorterArray *esa, int count) +e_sorter_array_set_count (ESorterArray *esa, gint count) { e_sorter_array_clean (esa); esa->rows = count; } void -e_sorter_array_append (ESorterArray *esa, int count) +e_sorter_array_append (ESorterArray *esa, gint count) { - int i; + gint i; g_free(esa->backsorted); esa->backsorted = NULL; if (esa->sorted) { esa->sorted = g_renew(int, esa->sorted, esa->rows + count); for (i = 0; i < count; i++) { - int value = esa->rows; + gint value = esa->rows; size_t pos; e_bsearch (&value, esa->sorted, esa->rows, sizeof (int), esort_callback, esa, &pos, NULL); memmove (esa->sorted + pos + 1, esa->sorted + pos, sizeof (int) * (esa->rows - pos)); diff --git a/e-util/e-sorter-array.h b/e-util/e-sorter-array.h index a02f5d9635..9a1d3fcfef 100644 --- a/e-util/e-sorter-array.h +++ b/e-util/e-sorter-array.h @@ -37,8 +37,8 @@ G_BEGIN_DECLS #ifndef _E_COMPARE_ROWS_FUNC_H_ #define _E_COMPARE_ROWS_FUNC_H_ -typedef int (*ECompareRowsFunc) (int row1, - int row2, +typedef gint (*ECompareRowsFunc) (gint row1, + gint row2, gpointer closure); #endif @@ -49,10 +49,10 @@ typedef struct { gpointer closure; /* If needs_sorting is 0, then model_to_sorted and sorted_to_model are no-ops. */ - int *sorted; - int *backsorted; + gint *sorted; + gint *backsorted; - int rows; + gint rows; } ESorterArray; typedef struct { @@ -67,9 +67,9 @@ ESorterArray *e_sorter_array_new (ECompareRowsFunc compare, gpointer closure); void e_sorter_array_clean (ESorterArray *esa); void e_sorter_array_set_count (ESorterArray *esa, - int count); + gint count); void e_sorter_array_append (ESorterArray *esa, - int count); + gint count); G_END_DECLS diff --git a/e-util/e-sorter.c b/e-util/e-sorter.c index f63e5e1172..602b189075 100644 --- a/e-util/e-sorter.c +++ b/e-util/e-sorter.c @@ -34,10 +34,10 @@ G_DEFINE_TYPE (ESorter, e_sorter, G_TYPE_OBJECT) -static gint es_model_to_sorted (ESorter *es, int row); -static gint es_sorted_to_model (ESorter *es, int row); -static void es_get_model_to_sorted_array (ESorter *es, int **array, int *count); -static void es_get_sorted_to_model_array (ESorter *es, int **array, int *count); +static gint es_model_to_sorted (ESorter *es, gint row); +static gint es_sorted_to_model (ESorter *es, gint row); +static void es_get_model_to_sorted_array (ESorter *es, gint **array, gint *count); +static void es_get_sorted_to_model_array (ESorter *es, gint **array, gint *count); static gboolean es_needs_sorting(ESorter *es); static void @@ -65,25 +65,25 @@ e_sorter_new (void) static gint -es_model_to_sorted (ESorter *es, int row) +es_model_to_sorted (ESorter *es, gint row) { return row; } static gint -es_sorted_to_model (ESorter *es, int row) +es_sorted_to_model (ESorter *es, gint row) { return row; } static void -es_get_model_to_sorted_array (ESorter *es, int **array, int *count) +es_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) { } static void -es_get_sorted_to_model_array (ESorter *es, int **array, int *count) +es_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) { } @@ -95,7 +95,7 @@ es_needs_sorting(ESorter *es) } gint -e_sorter_model_to_sorted (ESorter *es, int row) +e_sorter_model_to_sorted (ESorter *es, gint row) { g_return_val_if_fail(es != NULL, -1); g_return_val_if_fail(row >= 0, -1); @@ -107,7 +107,7 @@ e_sorter_model_to_sorted (ESorter *es, int row) } gint -e_sorter_sorted_to_model (ESorter *es, int row) +e_sorter_sorted_to_model (ESorter *es, gint row) { g_return_val_if_fail(es != NULL, -1); g_return_val_if_fail(row >= 0, -1); @@ -120,7 +120,7 @@ e_sorter_sorted_to_model (ESorter *es, int row) void -e_sorter_get_model_to_sorted_array (ESorter *es, int **array, int *count) +e_sorter_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) { g_return_if_fail(es != NULL); @@ -129,7 +129,7 @@ e_sorter_get_model_to_sorted_array (ESorter *es, int **array, int *count) } void -e_sorter_get_sorted_to_model_array (ESorter *es, int **array, int *count) +e_sorter_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) { g_return_if_fail(es != NULL); diff --git a/e-util/e-sorter.h b/e-util/e-sorter.h index d64851bc70..579d9bd36d 100644 --- a/e-util/e-sorter.h +++ b/e-util/e-sorter.h @@ -44,16 +44,16 @@ typedef struct { typedef struct { GObjectClass parent_class; gint (*model_to_sorted) (ESorter *sorter, - int row); + gint row); gint (*sorted_to_model) (ESorter *sorter, - int row); + gint row); void (*get_model_to_sorted_array) (ESorter *sorter, - int **array, - int *count); + gint **array, + gint *count); void (*get_sorted_to_model_array) (ESorter *sorter, - int **array, - int *count); + gint **array, + gint *count); gboolean (*needs_sorting) (ESorter *sorter); } ESorterClass; @@ -62,16 +62,16 @@ GType e_sorter_get_type (void); ESorter *e_sorter_new (void); gint e_sorter_model_to_sorted (ESorter *sorter, - int row); + gint row); gint e_sorter_sorted_to_model (ESorter *sorter, - int row); + gint row); void e_sorter_get_model_to_sorted_array (ESorter *sorter, - int **array, - int *count); + gint **array, + gint *count); void e_sorter_get_sorted_to_model_array (ESorter *sorter, - int **array, - int *count); + gint **array, + gint *count); gboolean e_sorter_needs_sorting (ESorter *sorter); diff --git a/e-util/e-util-labels.c b/e-util/e-util-labels.c index ba1d0113a0..1241e7092f 100644 --- a/e-util/e-util-labels.c +++ b/e-util/e-util-labels.c @@ -62,8 +62,8 @@ e_util_labels_parse (GConfClient *client) { GSList *labels, *list, *head; EUtilLabel *label; - char *buf; - int num = 0; + gchar *buf; + gint num = 0; gboolean unref_client = client == NULL; labels = NULL; @@ -74,7 +74,7 @@ e_util_labels_parse (GConfClient *client) head = gconf_client_get_list (client, E_UTIL_LABELS_GCONF_KEY, GCONF_VALUE_STRING, NULL); for (list = head; list; list = list->next) { - char *color, *name, *tag; + gchar *color, *name, *tag; name = buf = list->data; color = strrchr (buf, ':'); if (color == NULL) { @@ -210,7 +210,7 @@ flush_labels_cache (GSList *labels, gboolean free_labels) * @return Pointer to cache data if label with such tag exists or NULL. Do not free it! **/ static EUtilLabel * -find_label (GSList *labels, const char *tag) +find_label (GSList *labels, const gchar *tag) { GSList *l; @@ -227,12 +227,12 @@ find_label (GSList *labels, const char *tag) } -static char * -tag_from_name (const char *name) +static gchar * +tag_from_name (const gchar *name) { /* this does thunderbird, just do not ask */ - char *s1, *s2, *p; - const char *bads = " ()/{%*<>\\\""; + gchar *s1, *s2, *p; + const gchar *bads = " ()/{%*<>\\\""; if (!name || !*name) return NULL; @@ -263,12 +263,12 @@ tag_from_name (const char *name) * It will return NULL when the tag will be same as already existed. * Tag name is generated in similar way as in Thunderbird. **/ -char * -e_util_labels_add (const char *name, const GdkColor *color) +gchar * +e_util_labels_add (const gchar *name, const GdkColor *color) { EUtilLabel *label; GSList *labels; - char *tag; + gchar *tag; g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (color != NULL, NULL); @@ -303,14 +303,14 @@ e_util_labels_add (const char *name, const GdkColor *color) * @return Tag for newly added label or NULL, if something failed. * Returned value should be freed with g_free. **/ -char * -e_util_labels_add_with_dlg (GtkWindow *parent, const char *tag) +gchar * +e_util_labels_add_with_dlg (GtkWindow *parent, const gchar *tag) { GtkWidget *table, *dialog, *l, *e, *c; - const char *name; + const gchar *name; GdkColor color; gboolean is_edit = FALSE; - char *new_tag = NULL; + gchar *new_tag = NULL; GSList *labels; table = gtk_table_new (2, 2, FALSE); @@ -353,7 +353,7 @@ e_util_labels_add_with_dlg (GtkWindow *parent, const char *tag) gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), table, TRUE, TRUE, 0); while (!new_tag) { - const char *error = NULL; + const gchar *error = NULL; if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { name = gtk_entry_get_text (GTK_ENTRY (e)); @@ -388,7 +388,7 @@ e_util_labels_add_with_dlg (GtkWindow *parent, const char *tag) * @return Whether was removed. **/ gboolean -e_util_labels_remove (const char *tag) +e_util_labels_remove (const gchar *tag) { EUtilLabel *label; GSList *labels; @@ -419,7 +419,7 @@ e_util_labels_remove (const char *tag) * @return Whether successfully saved. **/ gboolean -e_util_labels_set_data (const char *tag, const char *name, const GdkColor *color) +e_util_labels_set_data (const gchar *tag, const gchar *name, const GdkColor *color) { EUtilLabel *label; GSList *labels; @@ -451,9 +451,9 @@ e_util_labels_set_data (const char *tag, const char *name, const GdkColor *color * @return Whether the tag is one of default/system labels or not. **/ gboolean -e_util_labels_is_system (const char *tag) +e_util_labels_is_system (const gchar *tag) { - int i; + gint i; if (!tag) return FALSE; @@ -472,10 +472,10 @@ e_util_labels_is_system (const char *tag) * @param old_tag Tag of the label from old version of Evolution. * @return New tag name equivalent with the old tag, or NULL if no such name existed before. **/ -const char * -e_util_labels_get_new_tag (const char *old_tag) +const gchar * +e_util_labels_get_new_tag (const gchar *old_tag) { - int i; + gint i; if (!old_tag) return NULL; @@ -497,8 +497,8 @@ e_util_labels_get_new_tag (const char *old_tag) * @param tag Tag of the label of our interest. * @return Name of the label with that tag or NULL, if no such label exists. **/ -const char * -e_util_labels_get_name (GSList *labels, const char *tag) +const gchar * +e_util_labels_get_name (GSList *labels, const gchar *tag) { EUtilLabel *label; @@ -520,7 +520,7 @@ e_util_labels_get_name (GSList *labels, const char *tag) * @return Whether found such label and color has been set. **/ gboolean -e_util_labels_get_color (GSList *labels, const char *tag, GdkColor *color) +e_util_labels_get_color (GSList *labels, const gchar *tag, GdkColor *color) { EUtilLabel *label; @@ -542,8 +542,8 @@ e_util_labels_get_color (GSList *labels, const char *tag, GdkColor *color) * @param tag Tag of the label of our interest. * @return String representation of that label, or NULL, is no such label exists. **/ -const char * -e_util_labels_get_color_str (GSList *labels, const char *tag) +const gchar * +e_util_labels_get_color_str (GSList *labels, const gchar *tag) { EUtilLabel *label; @@ -568,7 +568,7 @@ e_util_labels_get_filter_options (void) for (l = known; l; l = l->next) { EUtilLabel *label = l->data; - const char *tag; + const gchar *tag; struct _filter_option *fo; if (!label) diff --git a/e-util/e-util-labels.h b/e-util/e-util-labels.h index 725f740d89..16d67f11ef 100644 --- a/e-util/e-util-labels.h +++ b/e-util/e-util-labels.h @@ -37,17 +37,17 @@ typedef struct { GSList * e_util_labels_parse (struct _GConfClient *client); void e_util_labels_free (GSList *labels); -char * e_util_labels_add (const char *name, const GdkColor *color); -char * e_util_labels_add_with_dlg (struct _GtkWindow *parent, const char *tag); -gboolean e_util_labels_remove (const char *tag); -gboolean e_util_labels_set_data (const char *tag, const char *name, const GdkColor *color); +gchar * e_util_labels_add (const gchar *name, const GdkColor *color); +gchar * e_util_labels_add_with_dlg (struct _GtkWindow *parent, const gchar *tag); +gboolean e_util_labels_remove (const gchar *tag); +gboolean e_util_labels_set_data (const gchar *tag, const gchar *name, const GdkColor *color); -gboolean e_util_labels_is_system (const char *tag); -const char *e_util_labels_get_new_tag (const char *old_tag); +gboolean e_util_labels_is_system (const gchar *tag); +const gchar *e_util_labels_get_new_tag (const gchar *old_tag); -const char *e_util_labels_get_name (GSList *labels, const char *tag); -gboolean e_util_labels_get_color (GSList *labels, const char *tag, GdkColor *color); -const char *e_util_labels_get_color_str (GSList *labels, const char *tag); +const gchar *e_util_labels_get_name (GSList *labels, const gchar *tag); +gboolean e_util_labels_get_color (GSList *labels, const gchar *tag, GdkColor *color); +const gchar *e_util_labels_get_color_str (GSList *labels, const gchar *tag); GSList * e_util_labels_get_filter_options (void); diff --git a/e-util/e-util-private.h b/e-util/e-util-private.h index f7d84dea37..7c77f12d27 100644 --- a/e-util/e-util-private.h +++ b/e-util/e-util-private.h @@ -35,26 +35,26 @@ #define fsync(fd) 0 -const char *_e_get_category_icons (void) G_GNUC_CONST; -const char *_e_get_datadir (void) G_GNUC_CONST; -const char *_e_get_ecpsdir (void) G_GNUC_CONST; -const char *_e_get_etspecdir (void) G_GNUC_CONST; -const char *_e_get_galviewsdir (void) G_GNUC_CONST; -const char *_e_get_gladedir (void) G_GNUC_CONST; -const char *_e_get_helpdir (void) G_GNUC_CONST; -const char *_e_get_iconsdir (void) G_GNUC_CONST; -const char *_e_get_imagesdir (void) G_GNUC_CONST; -const char *_e_get_libdir (void) G_GNUC_CONST; -const char *_e_get_libexecdir (void) G_GNUC_CONST; -const char *_e_get_localedir (void) G_GNUC_CONST; -const char *_e_get_plugindir (void) G_GNUC_CONST; -const char *_e_get_prefix (void) G_GNUC_CONST; -const char *_e_get_privdatadir (void) G_GNUC_CONST; -const char *_e_get_search_rule_dir (void) G_GNUC_CONST; -const char *_e_get_sounddir (void) G_GNUC_CONST; -const char *_e_get_sysconfdir (void) G_GNUC_CONST; -const char *_e_get_toolsdir (void) G_GNUC_CONST; -const char *_e_get_uidir (void) G_GNUC_CONST; +const gchar *_e_get_category_icons (void) G_GNUC_CONST; +const gchar *_e_get_datadir (void) G_GNUC_CONST; +const gchar *_e_get_ecpsdir (void) G_GNUC_CONST; +const gchar *_e_get_etspecdir (void) G_GNUC_CONST; +const gchar *_e_get_galviewsdir (void) G_GNUC_CONST; +const gchar *_e_get_gladedir (void) G_GNUC_CONST; +const gchar *_e_get_helpdir (void) G_GNUC_CONST; +const gchar *_e_get_iconsdir (void) G_GNUC_CONST; +const gchar *_e_get_imagesdir (void) G_GNUC_CONST; +const gchar *_e_get_libdir (void) G_GNUC_CONST; +const gchar *_e_get_libexecdir (void) G_GNUC_CONST; +const gchar *_e_get_localedir (void) G_GNUC_CONST; +const gchar *_e_get_plugindir (void) G_GNUC_CONST; +const gchar *_e_get_prefix (void) G_GNUC_CONST; +const gchar *_e_get_privdatadir (void) G_GNUC_CONST; +const gchar *_e_get_search_rule_dir (void) G_GNUC_CONST; +const gchar *_e_get_sounddir (void) G_GNUC_CONST; +const gchar *_e_get_sysconfdir (void) G_GNUC_CONST; +const gchar *_e_get_toolsdir (void) G_GNUC_CONST; +const gchar *_e_get_uidir (void) G_GNUC_CONST; #undef DATADIR #define DATADIR _e_get_datadir () diff --git a/e-util/e-util.c b/e-util/e-util.c index 533dc2d740..408a201c0a 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -378,12 +378,12 @@ e_action_group_remove_all_actions (GtkActionGroup *action_group) * Strips underscores from a string in the same way @gtk_label_new_with_mnemonis does. * The returned string should be freed. */ -char * -e_str_without_underscores (const char *s) +gchar * +e_str_without_underscores (const gchar *s) { - char *new_string; - const char *sp; - char *dp; + gchar *new_string; + const gchar *sp; + gchar *dp; new_string = g_malloc (strlen (s) + 1); @@ -1273,10 +1273,10 @@ get_lock_filename (void) gboolean e_file_lock_create () { - const char *fname = get_lock_filename (); + const gchar *fname = get_lock_filename (); gboolean status = FALSE; - int fd = g_creat (fname, S_IRUSR|S_IWUSR); + gint fd = g_creat (fname, S_IRUSR|S_IWUSR); if (fd == -1){ g_warning ("Lock file '%s' creation failed, error %d\n", fname, errno); } else { @@ -1290,7 +1290,7 @@ e_file_lock_create () void e_file_lock_destroy () { - const char *fname = get_lock_filename (); + const gchar *fname = get_lock_filename (); if (g_unlink (fname) == -1){ g_warning ("Lock destroy: failed to unlink file '%s'!",fname); @@ -1300,7 +1300,7 @@ e_file_lock_destroy () gboolean e_file_lock_exists () { - const char *fname = get_lock_filename (); + const gchar *fname = get_lock_filename (); return g_file_test (fname, G_FILE_TEST_EXISTS); } @@ -1313,10 +1313,10 @@ e_file_lock_exists () * * Guesses mime_type for the given filename. **/ -char * -e_util_guess_mime_type (const char *filename, gboolean localfile) +gchar * +e_util_guess_mime_type (const gchar *filename, gboolean localfile) { - char *mime_type = NULL; + gchar *mime_type = NULL; g_return_val_if_fail (filename != NULL, NULL); @@ -1364,11 +1364,11 @@ e_util_guess_mime_type (const char *filename, gboolean localfile) * * Converts local file name to URI. **/ -char * -e_util_filename_to_uri (const char *filename) +gchar * +e_util_filename_to_uri (const gchar *filename) { GFile *file; - char *uri = NULL; + gchar *uri = NULL; g_return_val_if_fail (filename != NULL, NULL); @@ -1389,11 +1389,11 @@ e_util_filename_to_uri (const char *filename) * * Converts URI to local file name. NULL indicates no such local file name exists. **/ -char * -e_util_uri_to_filename (const char *uri) +gchar * +e_util_uri_to_filename (const gchar *uri) { GFile *file; - char *filename = NULL; + gchar *filename = NULL; g_return_val_if_fail (uri != NULL, NULL); @@ -1420,7 +1420,7 @@ e_util_uri_to_filename (const char *uri) * Mount point should be already mounted when calling this function. **/ gboolean -e_util_read_file (const char *filename, gboolean filename_is_uri, char **buffer, gsize *read, GError **error) +e_util_read_file (const gchar *filename, gboolean filename_is_uri, gchar **buffer, gsize *read, GError **error) { GFile *file; GFileInfo *info; @@ -1445,7 +1445,7 @@ e_util_read_file (const char *filename, gboolean filename_is_uri, char **buffer, if (!err && info) { guint64 sz; - char *buff; + gchar *buff; sz = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_STANDARD_SIZE); buff = g_malloc (sizeof (char) * sz); @@ -1495,7 +1495,7 @@ e_util_get_category_filter_options (void) clist = e_categories_get_list (); for (l = clist; l; l = l->next) { - const char *cname = l->data; + const gchar *cname = l->data; struct _filter_option *fo = g_new0 (struct _filter_option, 1); fo->title = g_strdup (cname); diff --git a/e-util/e-util.h b/e-util/e-util.h index e5126213f3..9cea65a6eb 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -58,7 +58,7 @@ gint e_action_compare_by_label (GtkAction *action1, void e_action_group_remove_all_actions (GtkActionGroup *action_group); -char * e_str_without_underscores (const char *s); +gchar * e_str_without_underscores (const gchar *s); gint e_str_compare (gconstpointer x, gconstpointer y); gint e_str_case_compare (gconstpointer x, @@ -113,8 +113,8 @@ gchar * e_ascii_dtostr (gchar *buffer, const gchar *format, gdouble d); -/* Alternating char * and int arguments with a NULL char * to end. - Less than 0 for the int means copy the whole string. */ +/* Alternating gchar * and gint arguments with a NULL gchar * to end. + Less than 0 for the gint means copy the whole string. */ gchar * e_strdup_append_strings (gchar *first_string, ...); diff --git a/e-util/e-win32-reloc.c b/e-util/e-win32-reloc.c index 04c70afd75..a080518d4c 100644 --- a/e-util/e-win32-reloc.c +++ b/e-util/e-win32-reloc.c @@ -32,28 +32,28 @@ /* localedir uses system codepage as it is passed to the non-UTF8ified * gettext library */ -static const char *localedir = NULL; +static const gchar *localedir = NULL; /* The others are in UTF-8 */ -static const char *category_icons; -static const char *datadir; -static const char *ecpsdir; -static const char *etspecdir; -static const char *galviewsdir; -static const char *gladedir; -static const char *helpdir; -static const char *iconsdir; -static const char *imagesdir; -static const char *libdir; -static const char *libexecdir; -static const char *plugindir; -static const char *prefix; -static const char *privdatadir; -static const char *search_rule_dir; -static const char *sounddir; -static const char *sysconfdir; -static const char *toolsdir; -static const char *uidir; +static const gchar *category_icons; +static const gchar *datadir; +static const gchar *ecpsdir; +static const gchar *etspecdir; +static const gchar *galviewsdir; +static const gchar *gladedir; +static const gchar *helpdir; +static const gchar *iconsdir; +static const gchar *imagesdir; +static const gchar *libdir; +static const gchar *libexecdir; +static const gchar *plugindir; +static const gchar *prefix; +static const gchar *privdatadir; +static const gchar *search_rule_dir; +static const gchar *sounddir; +static const gchar *sysconfdir; +static const gchar *toolsdir; +static const gchar *uidir; static HMODULE hmodule; G_LOCK_DEFINE_STATIC (mutex); @@ -77,9 +77,9 @@ DllMain (HINSTANCE hinstDLL, return TRUE; } -static char * -replace_prefix (const char *runtime_prefix, - const char *configure_time_path) +static gchar * +replace_prefix (const gchar *runtime_prefix, + const gchar *configure_time_path) { if (runtime_prefix && strncmp (configure_time_path, EVOLUTION_PREFIX "/", @@ -94,8 +94,8 @@ replace_prefix (const char *runtime_prefix, static void setup (void) { - char *full_prefix; - char *cp_prefix; + gchar *full_prefix; + gchar *cp_prefix; G_LOCK (mutex); if (localedir != NULL) { @@ -150,7 +150,7 @@ setup (void) #include "e-util-private.h" /* For prototypes */ #define GETTER(varbl) \ -const char * \ +const gchar * \ _e_get_##varbl (void) \ { \ setup (); \ diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c index 73dd415a6d..3f651e99b4 100644 --- a/e-util/e-xml-utils.c +++ b/e-util/e-xml-utils.c @@ -75,7 +75,7 @@ e_xml_get_child_by_name_by_lang (const xmlNode *parent, } for (child = parent->xmlChildrenNode; child != NULL; child = child->next) { if (xmlStrcmp (child->name, child_name) == 0) { - xmlChar *this_lang = xmlGetProp (child, (const unsigned char *)"lang"); + xmlChar *this_lang = xmlGetProp (child, (const guchar *)"lang"); if (this_lang == NULL) { C = child; } else if (xmlStrcmp(this_lang, (xmlChar *)lang) == 0) { @@ -103,10 +103,10 @@ e_xml_get_child_by_name_by_lang_list_with_score (const xmlNode *parent, for (node = parent->xmlChildrenNode; node != NULL; node = node->next) { xmlChar *lang; - if (node->name == NULL || strcmp ((char *)node->name, name) != 0) { + if (node->name == NULL || strcmp ((gchar *)node->name, name) != 0) { continue; } - lang = xmlGetProp (node, (const unsigned char *)"xml:lang"); + lang = xmlGetProp (node, (const guchar *)"xml:lang"); if (lang != NULL) { const GList *l; gint i; @@ -114,7 +114,7 @@ e_xml_get_child_by_name_by_lang_list_with_score (const xmlNode *parent, for (l = lang_list, i = 0; l != NULL && i < *best_lang_score; l = l->next, i++) { - if (strcmp ((char *) l->data, (char *)lang) == 0) { + if (strcmp ((gchar *) l->data, (gchar *)lang) == 0) { best_node = node; *best_lang_score = i; } @@ -153,7 +153,7 @@ e_xml_get_child_by_name_by_lang_list (const xmlNode *parent, language_names = g_get_language_names (); while (*language_names != NULL) lang_list = g_list_append ( - (GList *)lang_list, (char *)*language_names++); + (GList *)lang_list, (gchar *)*language_names++); } return e_xml_get_child_by_name_by_lang_list_with_score (parent,name, @@ -176,10 +176,10 @@ e_xml_get_child_by_name_no_lang (const xmlNode *parent, const gchar *name) for (node = parent->xmlChildrenNode; node != NULL; node = node->next) { xmlChar *lang; - if (node->name == NULL || strcmp ((char *)node->name, name) != 0) { + if (node->name == NULL || strcmp ((gchar *)node->name, name) != 0) { continue; } - lang = xmlGetProp (node, (const unsigned char *)"xml:lang"); + lang = xmlGetProp (node, (const guchar *)"xml:lang"); if (lang == NULL) { return node; } @@ -211,7 +211,7 @@ e_xml_get_integer_prop_by_name_with_default (const xmlNode *parent, prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - (void) sscanf ((char *)prop, "%d", &ret_val); + (void) sscanf ((gchar *)prop, "%d", &ret_val); xmlFree (prop); } return ret_val; @@ -228,7 +228,7 @@ e_xml_set_integer_prop_by_name (xmlNode *parent, g_return_if_fail (prop_name != NULL); valuestr = g_strdup_printf ("%d", value); - xmlSetProp (parent, prop_name, (unsigned char *)valuestr); + xmlSetProp (parent, prop_name, (guchar *)valuestr); g_free (valuestr); } @@ -254,7 +254,7 @@ e_xml_get_uint_prop_by_name_with_default (const xmlNode *parent, prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - (void) sscanf ((char *)prop, "%u", &ret_val); + (void) sscanf ((gchar *)prop, "%u", &ret_val); xmlFree (prop); } return ret_val; @@ -271,7 +271,7 @@ e_xml_set_uint_prop_by_name (xmlNode *parent, g_return_if_fail (prop_name != NULL); valuestr = g_strdup_printf ("%u", value); - xmlSetProp (parent, prop_name, (unsigned char *)valuestr); + xmlSetProp (parent, prop_name, (guchar *)valuestr); g_free (valuestr); } @@ -300,9 +300,9 @@ e_xml_get_bool_prop_by_name_with_default(const xmlNode *parent, prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - if (g_ascii_strcasecmp ((char *)prop, "true") == 0) { + if (g_ascii_strcasecmp ((gchar *)prop, "true") == 0) { ret_val = TRUE; - } else if (g_ascii_strcasecmp ((char *)prop, "false") == 0) { + } else if (g_ascii_strcasecmp ((gchar *)prop, "false") == 0) { ret_val = FALSE; } xmlFree(prop); @@ -317,9 +317,9 @@ e_xml_set_bool_prop_by_name (xmlNode *parent, const xmlChar *prop_name, gboolean g_return_if_fail (prop_name != NULL); if (value) { - xmlSetProp (parent, prop_name, (const unsigned char *)"true"); + xmlSetProp (parent, prop_name, (const guchar *)"true"); } else { - xmlSetProp (parent, prop_name, (const unsigned char *)"false"); + xmlSetProp (parent, prop_name, (const guchar *)"false"); } } @@ -343,7 +343,7 @@ e_xml_get_double_prop_by_name_with_default (const xmlNode *parent, const xmlChar prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - ret_val = e_flexible_strtod ((char *)prop, NULL); + ret_val = e_flexible_strtod ((gchar *)prop, NULL); xmlFree (prop); } return ret_val; @@ -352,8 +352,8 @@ e_xml_get_double_prop_by_name_with_default (const xmlNode *parent, const xmlChar void e_xml_set_double_prop_by_name(xmlNode *parent, const xmlChar *prop_name, gdouble value) { - char buffer[E_ASCII_DTOSTR_BUF_SIZE]; - char *format; + gchar buffer[E_ASCII_DTOSTR_BUF_SIZE]; + gchar *format; g_return_if_fail (parent != NULL); g_return_if_fail (prop_name != NULL); @@ -366,7 +366,7 @@ e_xml_set_double_prop_by_name(xmlNode *parent, const xmlChar *prop_name, gdouble e_ascii_dtostr (buffer, sizeof (buffer), format, value); g_free (format); - xmlSetProp (parent, prop_name, (const unsigned char *)buffer); + xmlSetProp (parent, prop_name, (const guchar *)buffer); } gchar * @@ -389,7 +389,7 @@ e_xml_get_string_prop_by_name_with_default (const xmlNode *parent, const xmlChar prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - ret_val = g_strdup ((char *)prop); + ret_val = g_strdup ((gchar *)prop); xmlFree (prop); } else { ret_val = g_strdup (def); @@ -404,7 +404,7 @@ e_xml_set_string_prop_by_name (xmlNode *parent, const xmlChar *prop_name, const g_return_if_fail (prop_name != NULL); if (value != NULL) { - xmlSetProp (parent, prop_name, (unsigned char *)value); + xmlSetProp (parent, prop_name, (guchar *)value); } } @@ -420,15 +420,15 @@ e_xml_get_translated_string_prop_by_name (const xmlNode *parent, const xmlChar * prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - ret_val = g_strdup ((char *)prop); + ret_val = g_strdup ((gchar *)prop); xmlFree (prop); return ret_val; } combined_name = g_strdup_printf("_%s", prop_name); - prop = xmlGetProp ((xmlNode *) parent, (unsigned char *)combined_name); + prop = xmlGetProp ((xmlNode *) parent, (guchar *)combined_name); if (prop != NULL) { - ret_val = g_strdup (gettext((char *)prop)); + ret_val = g_strdup (gettext((gchar *)prop)); xmlFree (prop); } g_free(combined_name); diff --git a/e-util/gconf-bridge.c b/e-util/gconf-bridge.c index f0fd2ed3e2..2c0f0f2d4f 100644 --- a/e-util/gconf-bridge.c +++ b/e-util/gconf-bridge.c @@ -46,7 +46,7 @@ typedef struct { gboolean delayed_mode; - char *key; + gchar *key; guint val_notify_id; GSList *val_changes; /* List of changes made to GConf value, that have not received change notification @@ -66,7 +66,7 @@ typedef struct { gboolean bind_size; gboolean bind_pos; - char *key_prefix; + gchar *key_prefix; GtkWindow *window; gulong configure_event_id; @@ -79,7 +79,7 @@ typedef struct { BindingType type; guint id; - char *key; + gchar *key; guint val_notify_id; GSList *val_changes; /* List of changes made to GConf value, that have not received change notification @@ -479,14 +479,14 @@ prop_binding_object_destroyed (gpointer user_data, **/ guint gconf_bridge_bind_property_full (GConfBridge *bridge, - const char *key, + const gchar *key, GObject *object, - const char *prop, + const gchar *prop, gboolean delayed_sync) { GParamSpec *pspec; PropBinding *binding; - char *signal; + gchar *signal; GConfValue *val; g_return_val_if_fail (bridge != NULL, 0); @@ -593,8 +593,8 @@ static gboolean window_binding_perform_scheduled_sync (WindowBinding *binding) { if (binding->bind_size) { - int width, height; - char *key; + gint width, height; + gchar *key; GdkWindowState state; state = gdk_window_get_state (GTK_WIDGET (binding->window)->window); @@ -621,8 +621,8 @@ window_binding_perform_scheduled_sync (WindowBinding *binding) } if (binding->bind_pos) { - int x, y; - char *key; + gint x, y; + gchar *key; gtk_window_get_position (binding->window, &x, &y); @@ -727,7 +727,7 @@ window_binding_window_destroyed (gpointer user_data, **/ guint gconf_bridge_bind_window (GConfBridge *bridge, - const char *key_prefix, + const gchar *key_prefix, GtkWindow *window, gboolean bind_size, gboolean bind_pos) @@ -751,7 +751,7 @@ gconf_bridge_bind_window (GConfBridge *bridge, /* Set up GConf keys & sync window to GConf values */ if (bind_size) { - char *key; + gchar *key; GConfValue *width_val, *height_val, *maximized_val; key = g_strconcat (key_prefix, "_width", NULL); @@ -788,7 +788,7 @@ gconf_bridge_bind_window (GConfBridge *bridge, } if (bind_pos) { - char *key; + gchar *key; GConfValue *x_val, *y_val; key = g_strconcat (key_prefix, "_x", NULL); @@ -891,7 +891,7 @@ list_store_binding_sync_pref_to_store (ListStoreBinding *binding, list = gconf_value_get_list (value); for (l = list; l; l = l->next) { GConfValue *l_value; - const char *string; + const gchar *string; l_value = (GConfValue *) l->data; string = gconf_value_get_string (l_value); @@ -915,7 +915,7 @@ list_store_binding_sync_store_to_pref (ListStoreBinding *binding) GtkTreeModel *tree_model; GtkTreeIter iter; GSList *list; - int res; + gint res; GConfValue *gconf_value; tree_model = GTK_TREE_MODEL (binding->list_store); @@ -924,7 +924,7 @@ list_store_binding_sync_store_to_pref (ListStoreBinding *binding) list = NULL; res = gtk_tree_model_get_iter_first (tree_model, &iter); while (res) { - char *string; + gchar *string; GConfValue *tmp_value; gtk_tree_model_get (tree_model, &iter, @@ -1035,7 +1035,7 @@ list_store_binding_store_changed_cb (ListStoreBinding *binding) **/ guint gconf_bridge_bind_string_list_store (GConfBridge *bridge, - const char *key, + const gchar *key, GtkListStore *list_store) { GtkTreeModel *tree_model; @@ -1216,7 +1216,7 @@ error_handler (GConfClient *client, g_warning ("GConf error:\n %s", error->message); if (!shown_dialog) { - char *message; + gchar *message; GtkWidget *dlg; message = g_strdup_printf (_("GConf error: %s"), diff --git a/e-util/gconf-bridge.h b/e-util/gconf-bridge.h index 7edd2476dd..b3cdd2bbeb 100644 --- a/e-util/gconf-bridge.h +++ b/e-util/gconf-bridge.h @@ -36,9 +36,9 @@ GConfBridge *gconf_bridge_get (void); GConfClient *gconf_bridge_get_client (GConfBridge *bridge); guint gconf_bridge_bind_property_full (GConfBridge *bridge, - const char *key, + const gchar *key, GObject *object, - const char *prop, + const gchar *prop, gboolean delayed_sync); /** @@ -71,7 +71,7 @@ guint gconf_bridge_bind_property_full (GConfBridge *bridge, (object), (prop), TRUE) guint gconf_bridge_bind_window (GConfBridge *bridge, - const char *key_prefix, + const gchar *key_prefix, GtkWindow *window, gboolean bind_size, gboolean bind_pos); @@ -105,7 +105,7 @@ guint gconf_bridge_bind_window (GConfBridge *bridge, gconf_bridge_bind_window ((bridge), (key_prefix), (window), FALSE, TRUE) guint gconf_bridge_bind_string_list_store (GConfBridge *bridge, - const char *key, + const gchar *key, GtkListStore *list_store); void gconf_bridge_unbind (GConfBridge *bridge, |