void (*set_value_in_gw_item) (EGwItem *item, gpointer data);
void (*set_changes) (EGwItem *new_item, EGwItem *old_item);
-} mappings [] = {
+} mappings[] = {
{ E_CONTACT_UID, ELEMENT_TYPE_SIMPLE, "id"},
{ E_CONTACT_FILE_AS, ELEMENT_TYPE_SIMPLE, "name" },
member_info = g_strsplit (values [i], ";", -1);
attr = e_vcard_attribute_new (NULL, EVC_EMAIL);
- e_vcard_attribute_add_param_with_value (attr, e_vcard_attribute_param_new (EVC_X_DEST_CONTACT_UID), member_info [1]);
+ e_vcard_attribute_add_param_with_value (attr, e_vcard_attribute_param_new (EVC_X_DEST_CONTACT_UID), member_info[1]);
- if (member_info [2]) {
- gint len = strlen (member_info [2]);
+ if (member_info[2]) {
+ gint len = strlen (member_info[2]);
gchar *value;
if (member_info [2][0] == '\"' && member_info [2][len - 1] == '\"')
e_vcard_attribute_add_value (attr, value);
g_free (value);
} else {
- e_vcard_attribute_add_value (attr, member_info [0]);
+ e_vcard_attribute_add_value (attr, member_info[0]);
}
e_vcard_add_attribute (E_VCARD (contact), attr);
printf ("cn = %s \n", cn_values[0]);
*(member_info + j) =
g_strconcat (*(member_info + j),
- cn_values [0], NULL);
+ cn_values[0], NULL);
ldap_value_free (cn_values);
}
}
LAST_SIGNAL
};
-static guint signals [LAST_SIGNAL];
+static guint signals[LAST_SIGNAL];
static void
contacts_added_cb (EGdbusBookView *object, const gchar * const *vcards, EBookView *book_view)
LAST_SIGNAL
};
-static guint e_book_signals [LAST_SIGNAL];
+static guint e_book_signals[LAST_SIGNAL];
struct _EBookPrivate {
EGdbusBook *gdbus_book;
UNLOCK_FACTORY ();
- g_signal_emit (G_OBJECT (book), e_book_signals [BACKEND_DIED], 0);
+ g_signal_emit (G_OBJECT (book), e_book_signals[BACKEND_DIED], 0);
}
static void
{
GObjectClass *gobject_class = G_OBJECT_CLASS (e_book_class);
- e_book_signals [WRITABLE_STATUS] =
+ e_book_signals[WRITABLE_STATUS] =
g_signal_new ("writable_status",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_LAST,
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
- e_book_signals [CONNECTION_STATUS] =
+ e_book_signals[CONNECTION_STATUS] =
g_signal_new ("connection_status",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_LAST,
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
- e_book_signals [AUTH_REQUIRED] =
+ e_book_signals[AUTH_REQUIRED] =
g_signal_new ("auth_required",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_LAST,
e_book_marshal_NONE__NONE,
G_TYPE_NONE, 0);
- e_book_signals [BACKEND_DIED] =
+ e_book_signals[BACKEND_DIED] =
g_signal_new ("backend_died",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_LAST,
book->priv->writable = writable;
- g_signal_emit (G_OBJECT (book), e_book_signals [WRITABLE_STATUS], 0, writable);
+ g_signal_emit (G_OBJECT (book), e_book_signals[WRITABLE_STATUS], 0, writable);
}
static void
book->priv->connected = connected;
- g_signal_emit (G_OBJECT (book), e_book_signals [CONNECTION_STATUS], 0, connected);
+ g_signal_emit (G_OBJECT (book), e_book_signals[CONNECTION_STATUS], 0, connected);
}
static void
{
g_return_if_fail (E_IS_BOOK (book));
- g_signal_emit (G_OBJECT (book), e_book_signals [AUTH_REQUIRED], 0);
+ g_signal_emit (G_OBJECT (book), e_book_signals[AUTH_REQUIRED], 0);
}
/**
G_DEFINE_TYPE (EContact, e_contact, E_TYPE_VCARD)
struct _EContactPrivate {
- gchar *cached_strings [E_CONTACT_FIELD_LAST];
+ gchar *cached_strings[E_CONTACT_FIELD_LAST];
};
#define E_CONTACT_FIELD_TYPE_STRING 0x00000001 /* used for simple single valued attributes */
GList *p = e_vcard_attribute_get_values (attr);
EContactDate *date;
- if (p && p->data && ((gchar *) p->data) [0])
+ if (p && p->data && ((gchar *) p->data)[0])
date = e_contact_date_from_string ((gchar *) p->data);
else
date = NULL;
EContactName *name;
const gchar *org;
gchar *file_as_new = NULL;
- gchar *strings [4];
+ gchar *strings[4];
gchar **strings_p = strings;
name = e_contact_get (contact, E_CONTACT_NAME);
gpointer value = NULL;
g_return_val_if_fail (E_IS_CONTACT (contact), NULL);
- g_return_val_if_fail (field_info [field_id].t & E_CONTACT_FIELD_TYPE_STRING, NULL);
+ g_return_val_if_fail (field_info[field_id].t & E_CONTACT_FIELD_TYPE_STRING, NULL);
value = contact->priv->cached_strings[field_id];
E_CONTACT_IM_ICQ_WORK_3, /* Synthetic string field */
/* Convenience field for getting a name from the contact.
- Returns the first one of [File-As, Full Name, Org, Email1]
+ Returns the first one of[File-As, Full Name, Org, Email1]
to be set */
E_CONTACT_REV, /* string field to hold time of last update to this vcard*/
E_CONTACT_NAME_OR_ORG,
LAST_SIGNAL
};
-static guint signals [LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
static GObjectClass *parent_class;
parent_class = g_type_class_ref (G_TYPE_OBJECT);
- signals [CHANGED] =
+ signals[CHANGED] =
g_signal_new ("changed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
/* is there anything to do here? */
}
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
} else if (dest->priv->email_num != email_num) {
/* Splitting here would help the contact lists not rebuiding, so that it remembers ignored values */
g_object_ref (contact);
dest->priv->email_num = email_num;
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
}
}
e_destination_clear (dest);
dest->priv->source_uid = g_strdup (e_source_peek_uid (source));
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
}
}
dest->priv->contact = NULL;
}
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
}
}
g_free (dest->priv->source_uid);
dest->priv->source_uid = g_strdup (uid);
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
}
}
g_free (dest->priv->textrep);
dest->priv->textrep = NULL;
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
}
}
g_free (dest->priv->textrep);
dest->priv->textrep = NULL;
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
}
}
dest->priv->auto_recipient = value;
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
}
/**
while (iter) {
EDestination *list_dest = E_DESTINATION (iter->data);
-
+
if (!e_destination_empty (list_dest) && !list_dest->priv->ignored) {
- const char *name, *email;
+ const gchar *name, *email;
name = e_destination_get_name (list_dest);
email = e_destination_get_email (list_dest);
}
priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
} else if (priv->raw) {
- if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw))
- priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
+ if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw))
+ priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
} else {
- const char *name, *email;
+ const gchar *name, *email;
name = e_destination_get_name (dest);
email = e_destination_get_email (dest);
e_destination_clear (dest);
dest->priv->raw = g_strdup (raw);
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
}
}
if (dest->priv->wants_html_mail != flag) {
dest->priv->wants_html_mail = flag;
- g_signal_emit (dest, signals [CHANGED], 0);
+ g_signal_emit (dest, signals[CHANGED], 0);
}
}
if (g_utf8_strlen (word, -1) > 2 &&
g_unichar_isalpha (g_utf8_get_char (word)) &&
g_unichar_isalpha (g_utf8_get_char (g_utf8_next_char (word))) &&
- word [strlen (word) - 1] == '.')
+ word[strlen (word) - 1] == '.')
return word;
g_free (word);
/*
* Make sure we didn't just grab a cute nickname.
*/
- if (word [0] == '\"') {
+ if (word[0] == '\"') {
g_free (word);
return;
}
g_string_append_c (attr_str, '"');
- for (i = 0; value [i]; i++) {
+ for (i = 0; value[i]; i++) {
/* skip quotes in quoted string; it is not allowed */
- if (value [i] == '\"')
+ if (value[i] == '\"')
continue;
- g_string_append_c (attr_str, value [i]);
+ g_string_append_c (attr_str, value[i]);
}
g_string_append_c (attr_str, '"');
static gboolean
e_book_backend_summary_check_magic (EBookBackendSummary *summary, FILE *fp)
{
- gchar buf [PAS_SUMMARY_MAGIC_LEN + 1];
+ gchar buf[PAS_SUMMARY_MAGIC_LEN + 1];
gint rv;
memset (buf, 0, sizeof (buf));
/* TODO Do not replicate this in every backend */
static icaltimezone *
-resolve_tzid (const char *tzid, gpointer user_data)
+resolve_tzid (const gchar *tzid, gpointer user_data)
{
icaltimezone *zone;
-
+
zone = (!strcmp (tzid, "UTC"))
? icaltimezone_get_utc_timezone ()
: icaltimezone_get_builtin_timezone_from_tzid (tzid);
-
+
if (!zone)
zone = e_cal_backend_internal_get_timezone (E_CAL_BACKEND (user_data), tzid);
return zone;
}
-static gboolean
+static gboolean
put_component_to_store (ECalBackendCalDAV *cbdav,
ECalComponent *comp)
{
return e_cal_backend_store_put_component_with_time_range (priv->store, comp, time_start, time_end);
}
-
static ECalBackendSyncClass *parent_class = NULL;
static icaltimezone *caldav_internal_get_default_timezone (ECalBackend *backend);
&occur_start,
&occur_end);
-
bkend = E_CAL_BACKEND (backend);
list = prunning_by_time ?
static void free_refresh_data (ECalBackendFile *cbfile);
static icaltimezone *
-e_cal_backend_file_internal_get_timezone (ECalBackend *backend, const char *tzid);
+e_cal_backend_file_internal_get_timezone (ECalBackend *backend, const gchar *tzid);
static icaltimezone *
e_cal_backend_file_internal_get_default_timezone (ECalBackend *backend);
return tt;
}
-
/* Adds component to the interval tree
*/
static gboolean
return FALSE;
}
-static gboolean
+static gboolean
remove_component_from_intervaltree (ECalBackendFile *cbfile, ECalComponent *comp)
{
time_t time_start = -1, time_end = -1;
- const char *uid = NULL;
+ const gchar *uid = NULL;
gchar *rid;
ECalBackendFilePrivate *priv;
resolve_tzid, priv->icalcomp, priv->default_zone,
e_cal_backend_get_kind (E_CAL_BACKEND (cbfile)));
-
if (time_end != -1 && time_start > time_end) {
g_error ("Bogus component %s\n", e_cal_component_get_as_string (comp));
return FALSE;
match_data);
}
-
/* Get_objects_in_range handler for the file backend */
static void
e_cal_backend_file_get_object_list (ECalBackendSync *backend, EDataCal *cal, const gchar *sexp, GList **objects, GError **perror)
if (!prunning_by_time) {
g_hash_table_foreach (priv->comp_uid_hash, (GHFunc) match_object_sexp,
- &match_data);
+ &match_data);
} else {
objs_occuring_in_tw = e_intervaltree_search (priv->interval_tree,
occur_start, occur_end);
g_list_foreach(objs_occuring_in_tw, (GFunc) match_object_sexp_to_component,
- &match_data);
+ &match_data);
}
g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
if (!prunning_by_time) {
/* full scan */
g_hash_table_foreach (priv->comp_uid_hash, (GHFunc) match_object_sexp,
- &match_data);
+ &match_data);
e_debug_log(FALSE, E_DEBUG_LOG_DOMAIN_CAL_QUERIES, "---;%p;QUERY-ITEMS;%s;%s;%d", query,
e_data_cal_view_get_text (query), G_OBJECT_TYPE_NAME (backend),
objs_occuring_in_tw = e_intervaltree_search (priv->interval_tree, occur_start, occur_end);
g_list_foreach(objs_occuring_in_tw, (GFunc) match_object_sexp_to_component,
- &match_data);
+ &match_data);
e_debug_log(FALSE, E_DEBUG_LOG_DOMAIN_CAL_QUERIES, "---;%p;QUERY-ITEMS;%s;%s;%d", query,
e_data_cal_view_get_text (query), G_OBJECT_TYPE_NAME (backend),
#include <glib.h>
static void
-test_query_by_scanning_all_objects (ECalBackendFile* cbfile, const char *sexp, GList **objects)
+test_query_by_scanning_all_objects (ECalBackendFile* cbfile, const gchar *sexp, GList **objects)
{
MatchObjectData match_data;
ECalBackendFilePrivate *priv;
}
g_hash_table_foreach (priv->comp_uid_hash, (GHFunc) match_object_sexp,
- &match_data);
+ &match_data);
g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
for (l = list; l; l = l->next)
{
- const char *str = l->data;
+ const gchar *str = l->data;
ECalComponent *comp = e_cal_component_new_from_string (str);
- const char *uid;
+ const gchar *uid;
e_cal_component_get_uid (comp, &uid);
g_print ("%s\n", uid);
}
{
GList *l, *lsmaller;
- for (l = bigger ; l; l = l->next) {
- char *str = l->data;
- const char *uid;
+ for (l = bigger; l; l = l->next) {
+ gchar *str = l->data;
+ const gchar *uid;
ECalComponent *comp = e_cal_component_new_from_string (str);
gboolean found = FALSE;
e_cal_component_get_uid (comp, &uid);
for (lsmaller = smaller; lsmaller && !found; lsmaller = lsmaller->next)
{
- char *strsmaller = lsmaller->data;
- const char *uidsmaller;
+ gchar *strsmaller = lsmaller->data;
+ const gchar *uidsmaller;
ECalComponent *compsmaller = e_cal_component_new_from_string (strsmaller);
e_cal_component_get_uid (compsmaller, &uidsmaller);
}
static void
-test_query (ECalBackendFile* cbfile, const char* query)
+test_query (ECalBackendFile* cbfile, const gchar * query)
{
GList *objects = NULL, *all_objects = NULL;
exit (-1);
}
-
g_list_foreach(objects, (GFunc) g_free, NULL);
g_list_free (objects);
g_list_foreach(all_objects, (GFunc) g_free, NULL);
}
static void
-execute_query (ECalBackendFile* cbfile, const char* query)
+execute_query (ECalBackendFile* cbfile, const gchar * query)
{
GList *objects = NULL;
d (g_print ("Query %s\n", query));
e_cal_backend_file_get_object_list (E_CAL_BACKEND_SYNC (cbfile), NULL, query, &objects, NULL);
- if(objects == NULL)
+ if (objects == NULL)
{
g_message (G_STRLOC " failed to get objects\n");
exit(0);
static gboolean only_execute = FALSE;
static gchar *calendar_fname = NULL;
-static GOptionEntry entries[] =
+static GOptionEntry entries[] =
{
{ "test-file", 't', 0, G_OPTION_ARG_STRING, &fname, "File with prepared queries", NULL },
{ "only-execute", 'e', 0, G_OPTION_ARG_NONE, &only_execute, "Only execute, do not test query", NULL },
/* Always add at least this many bytes when extending the buffer. */
#define MIN_CHUNK 64
-static int
-private_getline (char **lineptr, size_t *n, FILE *stream)
+static gint
+private_getline (gchar **lineptr, gsize *n, FILE *stream)
{
- int nchars_avail;
- char *read_pos;
+ gint nchars_avail;
+ gchar *read_pos;
if (!lineptr || !n || !stream)
return -1;
return -1;
}
- nchars_avail = (int) *n;
+ nchars_avail = (gint) *n;
read_pos = *lineptr;
for (;;) {
- int c = getc (stream);
+ gint c = getc (stream);
if (nchars_avail < 2) {
if (*n > MIN_CHUNK)
else
*n += MIN_CHUNK;
- nchars_avail = (int)(*n + *lineptr - read_pos);
+ nchars_avail = (gint)(*n + *lineptr - read_pos);
*lineptr = (char *)realloc (*lineptr, *n);
if (!*lineptr)
return -1;
*read_pos = '\0';
- return (int)(read_pos - (*lineptr));
+ return (gint)(read_pos - (*lineptr));
}
-int
-main(int argc, char **argv)
+gint
+main(gint argc, gchar **argv)
{
- char * line = NULL;
- size_t len = 0;
- ssize_t read;
+ gchar * line = NULL;
+ gsize len = 0;
+ gssize read;
ECalBackendFile* cbfile;
- int num = 0;
+ gint num = 0;
GError *error = NULL;
GOptionContext *context;
FILE* fin = NULL;
t = e_gw_connection_get_date_from_string (reply_within);
temp = ctime (&t);
- temp [strlen (temp)-1] = '\0';
+ temp[strlen (temp)-1] = '\0';
value = g_strconcat (N_("Reply Requested: by "), temp, "\n\n", mess ? mess : "", NULL);
e_gw_item_set_message (item, (const gchar *) value);
g_free (value);
/* TODO Do not replicate this in every backend */
static icaltimezone *
-resolve_tzid (const char *tzid, gpointer user_data)
+resolve_tzid (const gchar *tzid, gpointer user_data)
{
icaltimezone *zone;
-
+
zone = (!strcmp (tzid, "UTC"))
? icaltimezone_get_utc_timezone ()
: icaltimezone_get_builtin_timezone_from_tzid (tzid);
-
+
if (!zone)
zone = e_cal_backend_internal_get_timezone (E_CAL_BACKEND (user_data), tzid);
GList *item_list = NULL, *total_list = NULL, *l;
GSList *cache_ids = NULL, *ls;
GPtrArray *uid_array = NULL;
- gchar t_str [26];
+ gchar t_str[26];
const gchar *local_utc_time = NULL, *time_string = NULL, *serv_time, *position;
gchar *attempts;
icaltimetype current;
dur = icaltime_subtract (current, old_local);
server_utc = icaltime_from_string (time_string);
icaltime_adjust (&server_utc, dur.days, dur.hours, dur.minutes, dur.seconds);
-
+
current_time = icaltime_as_timet_with_zone (server_utc, icaltimezone_get_utc_timezone ());
gmtime_r (¤t_time, &tm);
}
priv->first_delta_fetch = FALSE;
-
+
current_time = icaltime_as_timet_with_zone (current, icaltimezone_get_utc_timezone ());
gmtime_r (¤t_time, &tm);
strftime (t_str, 26, "%Y-%m-%dT%H:%M:%SZ", &tm);
}
*objects = NULL;
-
+
prunning_by_time = e_cal_backend_sexp_evaluate_occur_times(cbsexp,
&occur_start,
&occur_end);
/* TODO Do not replicate this in every backend */
static icaltimezone *
-resolve_tzid (const char *tzid, gpointer user_data)
+resolve_tzid (const gchar *tzid, gpointer user_data)
{
icaltimezone *zone;
-
+
zone = (!strcmp (tzid, "UTC"))
? icaltimezone_get_utc_timezone ()
: icaltimezone_get_builtin_timezone_from_tzid (tzid);
-
+
if (!zone)
zone = e_cal_backend_internal_get_timezone (E_CAL_BACKEND (user_data), tzid);
e_cal_backend_store_put_component_with_time_range (priv->store, comp, time_start, time_end);
}
-
static void
retrieval_done (SoupSession *session, SoupMessage *msg, ECalBackendHttp *cbhttp)
{
GList *objects = NULL;
ECalBackendSExp *cbsexp;
time_t occur_start = -1, occur_end = -1;
- gboolean prunning_by_time;
+ gboolean prunning_by_time;
cbhttp = E_CAL_BACKEND_HTTP (backend);
priv = cbhttp->priv;
/* TODO Do not replicate this in every backend */
static icaltimezone *
-resolve_tzid (const char *tzid, gpointer user_data)
+resolve_tzid (const gchar *tzid, gpointer user_data)
{
icaltimezone *zone;
-
+
zone = (!strcmp (tzid, "UTC"))
? icaltimezone_get_utc_timezone ()
: icaltimezone_get_builtin_timezone_from_tzid (tzid);
-
+
if (!zone)
zone = e_cal_backend_internal_get_timezone (E_CAL_BACKEND (user_data), tzid);
if (!icon_name)
return NULL;
- for (i = 0; categories [i].description; i++) {
- if (!g_ascii_strncasecmp (categories [i].icon_name,
+ for (i = 0; categories[i].description; i++) {
+ if (!g_ascii_strncasecmp (categories[i].icon_name,
icon_name, strlen(icon_name)))
- return _(categories [i].description);
+ return _(categories[i].description);
}
return NULL;
: e_cal_backend_store_get_components (priv->store);
for (l = components; l != NULL; l = g_slist_next (l)) {
- if (e_cal_backend_sexp_match_comp (sexp, E_CAL_COMPONENT (l->data), backend))
+ if (e_cal_backend_sexp_match_comp (sexp, E_CAL_COMPONENT (l->data), backend))
objects = g_list_append (objects, e_cal_component_get_as_string (l->data));
}
ids = g_strsplit (code_name, "/", 2);
- if (!ids || !ids [0] || !ids [1])
+ if (!ids || !ids[0] || !ids[1])
goto done;
model = gweather_xml_load_locations ();
if (!model)
goto done;
- search.code = ids [0];
- search.name = ids [1];
+ search.code = ids[0];
+ search.name = ids[1];
search.is_old = is_old;
search.location = NULL;
if (!hostname) {
#ifndef G_OS_WIN32
- static gchar buffer [512];
+ static gchar buffer[512];
if ((gethostname (buffer, sizeof (buffer) - 1) == 0) &&
- (buffer [0] != 0))
+ (buffer[0] != 0))
hostname = buffer;
else
hostname = "localhost";
/* For BYDAY modifier. A list of GINT_TO_POINTERs, in pairs.
The first of each pair is the weekday, 0 = Monday to 6 = Sunday.
- The second of each pair is the week number [+-]0-53. */
+ The second of each pair is the week number[+-]0-53. */
GList *byday;
/* For BYHOUR modifier. A list of GINT_TO_POINTERs, 0-23. */
gboolean refresh,
ECalRecurResolveTimezoneFn tz_cb,
gpointer tz_cb_data);
-
+
/* Localized nth-day-of-month strings. (Use with _() ) */
#ifdef G_OS_WIN32
extern const gchar **e_cal_get_recur_nth (void);
return TRUE;
}
-
/* Generates the absolute triggers for a component */
static void
generate_absolute_triggers (ECalComponent *comp, struct alarm_occurrence_data *aod,
timet = icaltime_as_timet_with_zone (*dt_time->value, zone ? zone : default_zone);
}
-
return timet;
}
g_return_if_fail (end != NULL);
e_cal_recur_ensure_end_dates (comp, FALSE, tz_cb, tz_cb_data);
-
+
/* Get dtstart of the component and convert it to UTC */
e_cal_component_get_dtstart (comp, &dt_start);
}
e_cal_component_get_due (comp, &dt_due);
- if(dt_due.value != NULL)
+ if (dt_due.value != NULL)
due_time = componenttime_to_utc_timet (&dt_due, tz_cb, tz_cb_data,
default_timezone);
icaltimezone *default_zone;
gchar *local_attachment_store;
-
+
/* For locking the operation while localling cache values like
static capabilities, cal address etc. */
GStaticRecMutex cache_lock;
if (g_once_init_enter (&enum_type__volatile)) {
GType enum_type;
- static GEnumValue values [] = {
+ static GEnumValue values[] = {
{ E_CAL_SOURCE_TYPE_EVENT, "Event", NULL},
{ E_CAL_SOURCE_TYPE_TODO, "ToDo", NULL},
{ E_CAL_SOURCE_TYPE_JOURNAL, "Journal", NULL},
if (g_once_init_enter (&enum_type__volatile)) {
GType enum_type;
- static GEnumValue values [] = {
+ static GEnumValue values[] = {
{ E_CAL_SET_MODE_SUCCESS, "ECalSetModeSuccess", "success" },
{ E_CAL_SET_MODE_ERROR, "ECalSetModeError", "error" },
{ E_CAL_SET_MODE_NOT_SUPPORTED, "ECalSetModeNotSupported", "unsupported" },
if (g_once_init_enter (&enum_type__volatile)) {
GType enum_type;
- static GEnumValue values [] = {
+ static GEnumValue values[] = {
{ CAL_MODE_INVALID, "CalModeInvalid", "invalid" },
{ CAL_MODE_LOCAL, "CalModeLocal", "local" },
{ CAL_MODE_REMOTE, "CalModeRemote", "remote" },
UNLOCK_FACTORY ();
- g_signal_emit (G_OBJECT (ecal), e_cal_signals [BACKEND_DIED], 0);
+ g_signal_emit (G_OBJECT (ecal), e_cal_signals[BACKEND_DIED], 0);
}
static void
priv = ecal->priv;
e_return_error_if_fail (priv->gdbus_cal, E_CALENDAR_STATUS_REPOSITORY_OFFLINE);
-
if (priv->load_state != E_CAL_LOAD_LOADED) {
E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_URI_NOT_LOADED, error);
}
LOCK_CACHE();
-
+
if (priv->capabilities) {
UNLOCK_CACHE();
E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_OK, error);
g_warning ("The component does not have a valid uid \n");
return FALSE;
}
-
+
g_static_rw_lock_writer_lock (&priv->lock);
obj = g_hash_table_lookup (priv->comp_uid_hash, uid);
if (obj == NULL) {
priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_writer_lock (&priv->lock);
-
+
obj = g_hash_table_lookup (priv->comp_uid_hash, uid);
if (obj == NULL) {
ret_val = FALSE;
if (remove_completely)
g_hash_table_remove (priv->comp_uid_hash, uid);
-
+
end:
g_static_rw_lock_writer_unlock (&priv->lock);
-
+
return ret_val;
-
+
}
static ECalComponent *
}
static icaltimezone *
-resolve_tzid (const char *tzid, gpointer user_data)
+resolve_tzid (const gchar *tzid, gpointer user_data)
{
icaltimezone *zone;
-
+
zone = (!strcmp (tzid, "UTC"))
? icaltimezone_get_utc_timezone ()
: icaltimezone_get_builtin_timezone_from_tzid (tzid);
-
+
if (!zone)
zone = (icaltimezone *) e_cal_backend_store_get_timezone (E_CAL_BACKEND_STORE (user_data), tzid);
return zone;
} */
-
static void
scan_vcalendar (ECalBackendStore *store, icalcomponent *top_icalcomp)
{
g_object_unref (comp);
continue;
}
-
+
dzone = e_cal_backend_store_get_default_timezone (store);
e_cal_util_get_component_occur_times (comp, &time_start, &time_end,
resolve_tzid, store, dzone, kind);
typedef struct _EIntervalNode EIntervalNode;
-static EIntervalNode*
+static EIntervalNode*
intervaltree_node_next (EIntervalTree *tree, EIntervalNode *x);
struct _EIntervalNode
EIntervalNode* parent;
};
-
struct _EIntervalTreePrivate
{
EIntervalNode *root;
EIntervalNode *nil;
GHashTable *id_node_hash;
- GStaticRecMutex mutex;
+ GStaticRecMutex mutex;
};
static inline gint
return -1;
/* x is right of y */
- if (y_end < x_start)
+ if (y_end < x_start)
return 1;
/* x and y overlap */
* Carry out left rotation on the node @x in tree @tree.
* Caller should hold the lock
**/
-static void
+static void
left_rotate (EIntervalTree *tree, EIntervalNode *x)
{
EIntervalTreePrivate *priv = tree->priv;
if (y->left != nil)
y->left->parent = x;
- y->parent = x->parent;
+ y->parent = x->parent;
/* instead of checking if x->parent is the root as in the book, we */
/* count on the root sentinel to implicitly take care of this case */
y = priv->root;
x = priv->root->left;
- while( x != nil)
+ while ( x != nil)
{
y = x;
EIntervalNode *x;
EIntervalNode *newNode;
const gchar *uid;
- gchar *rid;
+ gchar *rid;
g_return_val_if_fail (tree != NULL, FALSE);
g_return_val_if_fail (comp != NULL, FALSE);
g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), FALSE);
g_static_rec_mutex_lock (&priv->mutex);
-
- x = g_new (EIntervalNode, 1);
+
+ x = g_new (EIntervalNode, 1);
x->min = x->start = start;
x->max = x->end = end;
x->comp = g_object_ref (comp);
x->parent->red = FALSE;
x->parent->parent->red = TRUE;
right_rotate (tree, x->parent->parent);
- }
+ }
}
- else
+ else
{ /* case for x->parent == x->parent->parent->right */
y = x->parent->parent->left;
x->parent->red = FALSE;
x->parent->parent->red = TRUE;
left_rotate (tree, x->parent->parent);
- }
+ }
}
}
return TRUE;
}
-static EIntervalNode*
+static EIntervalNode*
intervaltree_node_next (EIntervalTree *tree, EIntervalNode *x)
{
- EIntervalTreePrivate *priv = tree->priv;
+ EIntervalTreePrivate *priv = tree->priv;
EIntervalNode *y;
EIntervalNode *nil = priv->nil;
EIntervalNode *root = priv->root;
g_return_val_if_fail (x != priv->nil, NULL);
if (nil != (y = x->right))
- {
+ {
/* find out minimum of right subtree of x (assignment to y is ok) */
while (y->left != nil)
y = y->left;
e_intervaltree_destroy (EIntervalTree *tree)
{
EIntervalTreePrivate *priv = tree->priv;
- EIntervalNode *node;
+ EIntervalNode *node;
GList *stack_start = NULL, *pos;
g_return_if_fail (tree != NULL);
w = x->parent->right;
}
- if ( (!w->right->red) && (!w->left->red) )
- {
+ if ((!w->right->red) && (!w->left->red))
+ {
w->red = TRUE;
x = x->parent;
}
else
- {
+ {
if (!w->right->red)
{
w->left->red = FALSE;
w = x->parent->left;
}
- if ( (!w->right->red) && (!w->left->red) )
- {
+ if ((!w->right->red) && (!w->left->red))
+ {
w->red = TRUE;
x = x->parent;
}
GList*
e_intervaltree_search (EIntervalTree *tree, time_t start, time_t end)
{
- EIntervalTreePrivate *priv = tree->priv;
- EIntervalNode *node;
+ EIntervalTreePrivate *priv = tree->priv;
+ EIntervalNode *node;
GList *list = NULL;
GList *stack_start = NULL, *pos;
g_return_val_if_fail (tree != NULL, NULL);
g_static_rec_mutex_lock (&priv->mutex);
-
+
stack_start = pos = g_list_insert (stack_start, priv->root->left, -1);
while (pos != NULL)
e_intervaltree_node_dump (EIntervalTree *tree, EIntervalNode *node, gint indent)
{
/*
- char start_time[32] = {0}, end_time[32] = {0};
+ gchar start_time[32] = {0}, end_time[32] = {0};
struct tm tm_start_time, tm_end_time;
localtime_r (&node->start, &tm_start_time);
e_intervaltree_node_dump (tree, node->right, indent + 2);
}
-
void
e_intervaltree_dump (EIntervalTree *tree)
{
}
#endif
-
/**
* Caller should hold the lock.
**/
EIntervalNode *root = priv->root;
g_return_val_if_fail (tree != NULL, FALSE);
-
- g_static_rec_mutex_lock (&priv->mutex);
+
+ g_static_rec_mutex_lock (&priv->mutex);
z = e_intervaltree_search_component (tree, uid, rid);
z->left->parent = z->right->parent = y;
if (z == z->parent->left)
- z->parent->left = y;
+ z->parent->left = y;
else
z->parent->right = y;
e_intervaltree_fixup_deletion (tree, x);
}
else
- y->red = z->red;
+ y->red = z->red;
}
else
- {
+ {
/* z is the node to be spliced out */
fixup_min_max_fields (tree, x->parent);
e_intervaltree_finalize (GObject *object)
{
EIntervalTreePrivate *priv = E_INTERVALTREE_GET_PRIVATE (object);
-
+
if (priv->root) {
g_free (priv->root);
priv->root = NULL;
}
-
+
if (priv->nil) {
g_free (priv->nil);
priv->nil = NULL;
}
-
+
if (priv->id_node_hash) {
g_hash_table_destroy (priv->id_node_hash);
priv->id_node_hash = NULL;
g_static_rec_mutex_free (&priv->mutex);
- G_OBJECT_CLASS (e_intervaltree_parent_class)->finalize (object);
+ G_OBJECT_CLASS (e_intervaltree_parent_class)->finalize (object);
}
static void
object_class->finalize = e_intervaltree_finalize;
}
-
static void
e_intervaltree_init (EIntervalTree *tree)
{
e_intervaltree_new (void)
{
EIntervalTree *tree;
- tree = g_object_new (E_TYPE_INTERVALTREE, NULL);
+ tree = g_object_new (E_TYPE_INTERVALTREE, NULL);
return tree;
}
struct _EIntervalTree
{
GObject parent;
- EIntervalTreePrivate *priv;
+ EIntervalTreePrivate *priv;
};
struct _EIntervalTreeClass
}
#ifdef TESTER
static void
-test_query (const char* query)
+test_query (const gchar * query)
{
ECalBackendSExp *sexp = e_cal_backend_sexp_new (query);
time_t start, end;
}
}
-int main(int argc, char **argv)
+gint main(gint argc, gchar **argv)
{
g_type_init();
if (priv->intervaltree) {
e_intervaltree_destroy (priv->intervaltree);
priv->intervaltree = e_intervaltree_new ();
- }
+ }
return (E_CAL_BACKEND_STORE_GET_CLASS (store))->clean (store);
}
ECalBackendStorePrivate *priv;
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
g_return_val_if_fail (uid != NULL, FALSE);
-
+
priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if ((E_CAL_BACKEND_STORE_GET_CLASS (store))->remove_component (store, uid, rid)) {
g_return_val_if_fail (store != NULL, NULL);
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), NULL);
-
+
priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if (!(l = e_intervaltree_search (priv->intervaltree, start, end)))
return NULL;
- for ( ; l != NULL; l = g_list_next (l)) {
+ for (; l != NULL; l = g_list_next (l)) {
ECalComponent *comp = l->data;
icalcomp = e_cal_component_get_icalcomponent (comp);
if (icalcomp) {
return list;
}
-
/**
* e_cal_backend_store_get_component_ids:
*
const gchar *uid);
GSList * e_cal_backend_store_get_components
(ECalBackendStore *store);
-GSList * e_cal_backend_store_get_components_occuring_in_range
- (ECalBackendStore *store,
- time_t start,
+GSList * e_cal_backend_store_get_components_occuring_in_range
+ (ECalBackendStore *store,
+ time_t start,
time_t end);
GSList * e_cal_backend_store_get_component_ids
(ECalBackendStore *store);
void e_cal_backend_store_freeze_changes
(ECalBackendStore *store);
void e_cal_backend_store_interval_tree_add_comp
- (ECalBackendStore *store,
+ (ECalBackendStore *store,
ECalComponent *comp,
time_t start,
time_t end);
/* fallback if tzid contains only the location of timezone */
gint i, slashes = 0;
- for (i = 0; tzid [i]; i++) {
- if (tzid [i] == '/')
+ for (i = 0; tzid[i]; i++) {
+ if (tzid[i] == '/')
slashes++;
}
i1 = (EInterval*) list1->data;
c1 = i1->comp;
-
while (!found && l2 != NULL)
{
c2 = (ECalComponent*) l2->data;
l1 = e_intervaltree_search (tree, start, end);
-
l2 = search_in_list (list, start, end);
if (!compare_interval_lists (l2, l1))
l1 = e_intervaltree_search (tree, start, end);
-
l2 = search_in_list (list, start, end);
if (!compare_interval_lists (l2, l1))
exit(-1);
}
-
g_free (rid);
g_object_unref (interval->comp);
g_free (l1->data);
gint i;
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "uid"))
- g_ptr_array_add (data->uids, (gchar *) (camel_pstring_strdup(cols [i])));
+ g_ptr_array_add (data->uids, (gchar *) (camel_pstring_strdup(cols[i])));
else if (!strcmp (name [i], "flags"))
- g_ptr_array_add (data->flags, GUINT_TO_POINTER(strtoul (cols [i], NULL, 10)));
+ g_ptr_array_add (data->flags, GUINT_TO_POINTER(strtoul (cols[i], NULL, 10)));
}
return 0;
gint i;
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "uid"))
- g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols [i])));
+ g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols[i])));
}
#else
- g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols [0])));
+ g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols[0])));
#endif
return 0;
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "uid"))
- uid = camel_pstring_strdup(cols [i]);
+ uid = camel_pstring_strdup(cols[i]);
else if (!strcmp (name [i], "preview"))
msg = g_strdup(cols[i]);
}
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "vuid"))
- g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols [i]+8)));
+ g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols[i]+8)));
}
#else
- g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols [0]+8)));
+ g_ptr_array_add (array, (gchar *) (camel_pstring_strdup(cols[0]+8)));
#endif
return 0;
d(g_print ("\nread_fir_callback called \n"));
#if 0
- record->folder_name = cols [0];
- record->version = cols [1];
+ record->folder_name = cols[0];
+ record->version = cols[1];
/* Just a sequential mapping of struct members to columns is enough I guess.
Needs some checking */
#else
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "folder_name"))
- record->folder_name = g_strdup(cols [i]);
+ record->folder_name = g_strdup(cols[i]);
else if (!strcmp (name [i], "version"))
- record->version = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->version = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "flags"))
- record->flags = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->flags = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "nextuid"))
- record->nextuid = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->nextuid = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "time"))
- record->time = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->time = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "saved_count"))
- record->saved_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->saved_count = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "unread_count"))
- record->unread_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->unread_count = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "deleted_count"))
- record->deleted_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->deleted_count = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "junk_count"))
- record->junk_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->junk_count = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "visible_count"))
- record->visible_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->visible_count = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "jnd_count"))
- record->jnd_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ record->jnd_count = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "bdata"))
- record->bdata = g_strdup (cols [i]);
+ record->bdata = g_strdup (cols[i]);
}
#endif
label = argv[0]->value.string;
- for (i = 0; new_labels [i]; i++) {
- if (label && strcmp (new_labels [i] + 6, label) == 0) {
- label = new_labels [i];
+ for (i = 0; new_labels[i]; i++) {
+ if (label && strcmp (new_labels[i] + 6, label) == 0) {
+ label = new_labels[i];
break;
}
}
if (!expr)
return FALSE;
- for (i = 0; in_memory_tokens [i]; i++) {
- if (strstr (expr, in_memory_tokens [i]))
+ for (i = 0; in_memory_tokens[i]; i++) {
+ if (strstr (expr, in_memory_tokens[i]))
return TRUE;
}
matches = (GPtrArray *) ref;
- g_ptr_array_add (matches, (gpointer) camel_pstring_strdup (cols [0]));
+ g_ptr_array_add (matches, (gpointer) camel_pstring_strdup (cols[0]));
return 0;
}
for (i = 0; i < ncol; ++i) {
if (!strcmp (name [i], "uid"))
- mir->uid = (gchar *) camel_pstring_strdup (cols [i]);
+ mir->uid = (gchar *) camel_pstring_strdup (cols[i]);
else if (!strcmp (name [i], "flags"))
- mir->flags = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ mir->flags = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "read"))
- mir->read = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
+ mir->read = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
else if (!strcmp (name [i], "deleted"))
- mir->deleted = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
+ mir->deleted = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
else if (!strcmp (name [i], "replied"))
- mir->replied = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
+ mir->replied = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
else if (!strcmp (name [i], "important"))
- mir->important = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
+ mir->important = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
else if (!strcmp (name [i], "junk"))
- mir->junk = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
+ mir->junk = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
else if (!strcmp (name [i], "attachment"))
- mir->attachment = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
+ mir->attachment = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
else if (!strcmp (name [i], "size"))
- mir->size = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+ mir->size = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "dsent"))
- mir->dsent = cols [i] ? strtol (cols [i], NULL, 10) : 0;
+ mir->dsent = cols[i] ? strtol (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "dreceived"))
- mir->dreceived = cols [i] ? strtol (cols [i], NULL, 10) : 0;
+ mir->dreceived = cols[i] ? strtol (cols[i], NULL, 10) : 0;
else if (!strcmp (name [i], "subject"))
- mir->subject = (gchar *) camel_pstring_strdup (cols [i]);
+ mir->subject = (gchar *) camel_pstring_strdup (cols[i]);
else if (!strcmp (name [i], "mail_from"))
- mir->from = (gchar *) camel_pstring_strdup (cols [i]);
+ mir->from = (gchar *) camel_pstring_strdup (cols[i]);
else if (!strcmp (name [i], "mail_to"))
- mir->to = (gchar *) camel_pstring_strdup (cols [i]);
+ mir->to = (gchar *) camel_pstring_strdup (cols[i]);
else if (!strcmp (name [i], "mail_cc"))
- mir->cc = (gchar *) camel_pstring_strdup(cols [i]);
+ mir->cc = (gchar *) camel_pstring_strdup(cols[i]);
else if (!strcmp (name [i], "mlist"))
- mir->mlist = (gchar *) camel_pstring_strdup (cols [i]);
+ mir->mlist = (gchar *) camel_pstring_strdup (cols[i]);
else if (!strcmp (name [i], "followup_flag"))
- mir->followup_flag = (gchar *) camel_pstring_strdup(cols [i]);
+ mir->followup_flag = (gchar *) camel_pstring_strdup(cols[i]);
else if (!strcmp (name [i], "followup_completed_on"))
- mir->followup_completed_on = (gchar *) camel_pstring_strdup(cols [i]);
+ mir->followup_completed_on = (gchar *) camel_pstring_strdup(cols[i]);
else if (!strcmp (name [i], "followup_due_by"))
- mir->followup_due_by = (gchar *) camel_pstring_strdup(cols [i]);
+ mir->followup_due_by = (gchar *) camel_pstring_strdup(cols[i]);
else if (!strcmp (name [i], "part"))
- mir->part = g_strdup (cols [i]);
+ mir->part = g_strdup (cols[i]);
else if (!strcmp (name [i], "labels"))
- mir->labels = g_strdup (cols [i]);
+ mir->labels = g_strdup (cols[i]);
else if (!strcmp (name [i], "usertags"))
- mir->usertags = g_strdup (cols [i]);
+ mir->usertags = g_strdup (cols[i]);
else if (!strcmp (name [i], "cinfo"))
- mir->cinfo = g_strdup(cols [i]);
+ mir->cinfo = g_strdup(cols[i]);
else if (!strcmp (name [i], "bdata"))
- mir->bdata = g_strdup(cols [i]);
+ mir->bdata = g_strdup(cols[i]);
/* Evolution itself doesn't yet use this, ignoring
else if (!strcmp (name [i], "bodystructure"))
- mir->bodystructure = g_strdup(cols [i]); */
+ mir->bodystructure = g_strdup(cols[i]); */
}
}
guint32 flags;
for (i = 0; i < info->uid_changed->len; i++) {
- flags = camel_folder_get_message_flags (folder, info->uid_changed->pdata [i]);
+ flags = camel_folder_get_message_flags (folder, info->uid_changed->pdata[i]);
if (flags & CAMEL_MESSAGE_JUNK_LEARN) {
if (flags & CAMEL_MESSAGE_JUNK) {
if (!junk)
junk = g_ptr_array_new ();
- g_ptr_array_add (junk, g_strdup (info->uid_changed->pdata [i]));
+ g_ptr_array_add (junk, g_strdup (info->uid_changed->pdata[i]));
} else {
if (!notjunk)
notjunk = g_ptr_array_new ();
- g_ptr_array_add (notjunk, g_strdup (info->uid_changed->pdata [i]));
+ g_ptr_array_add (notjunk, g_strdup (info->uid_changed->pdata[i]));
}
/* reset junk learn flag so that we don't process it again*/
- camel_folder_set_message_flags (folder, info->uid_changed->pdata [i], CAMEL_MESSAGE_JUNK_LEARN, 0);
+ camel_folder_set_message_flags (folder, info->uid_changed->pdata[i], CAMEL_MESSAGE_JUNK_LEARN, 0);
}
}
}
word *('.' word) @ domain |
*(word) '<' [ *('@' domain ) ':' ] word *( '.' word) @ domain |
- 1*word ':' [ word ... etc (mailbox, as above) ] ';'
+ 1*word ':'[ word ... etc (mailbox, as above) ] ';'
*/
/* mailbox:
static struct {
const gchar *name;
gint offset;
-} tz_offsets [] = {
+} tz_offsets[] = {
{ "UT", 0 },
{ "GMT", 0 },
{ "EST", -500 }, /* these are all US timezones. bloody yanks */
{ "Y", 1200 },
};
-static const gchar tm_months [][4] = {
+static const gchar tm_months[][4] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-static const gchar tm_days [][4] = {
+static const gchar tm_days[][4] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
static void
ntlm_lanmanager_hash (const gchar *password, gchar hash[21])
{
- guchar lm_password [15];
+ guchar lm_password[15];
DES_KS ks;
gint i;
- for (i = 0; i < 14 && password [i]; i++)
- lm_password [i] = toupper ((guchar) password [i]);
+ for (i = 0; i < 14 && password[i]; i++)
+ lm_password[i] = toupper ((guchar) password[i]);
for (; i < 15; i++)
- lm_password [i] = '\0';
+ lm_password[i] = '\0';
memcpy (hash, LM_PASSWORD_MAGIC, 21);
gint i, c, bit;
for (i = 0; i < 8; i++) {
- key [i] = KEYBITS (key_56, i * 7);
+ key[i] = KEYBITS (key_56, i * 7);
/* Fix parity */
for (c = bit = 0; bit < 8; bit++)
- if (key [i] & (1 << bit))
+ if (key[i] & (1 << bit))
c++;
if (!(c & 1))
- key [i] ^= 0x01;
+ key[i] ^= 0x01;
}
deskey (ks, key, 0);
if (sent_date) {
actual_time = e_gw_connection_get_date_from_string (sent_date);
mi->info.date_sent = actual_time;
- }
-
+ }
+
if (received_date) {
actual_time = e_gw_connection_get_date_from_string (received_date);
mi->info.date_received = actual_time;
} else
mi->info.date_received = actual_time;
-
+
if (!sent_date)
mi->info.date_sent = actual_time;
}
email = g_strsplit_set (from, "<>", -1);
- if (from [0] == '<') {
+ if (from[0] == '<') {
/* g_strsplit_set will add a dummy empty string as the first string if the first character in the
original string is one of the delimiters that you want to suppress.
Refer to g_strsplit_set documentation */
while (scan) {
digest = get_md5_digest ((const guchar *) scan->id);
- memcpy(mi->info.references->references [count].id.hash, digest, sizeof(mi->info.message_id.id.hash));
+ memcpy(mi->info.references->references[count].id.hash, digest, sizeof(mi->info.message_id.id.hash));
count++;
scan = scan->next;
camel_pstring_free(mi->info.to);
mi->info.to = camel_pstring_strdup (str_to->str);
mi->info.cc = camel_pstring_strdup (str_cc->str);
-
+
g_string_truncate (str_to, 0);
g_string_truncate (str_cc, 0);
}
time_t actual_time = e_gw_connection_get_date_from_string (temp_date);
mi->info.date_sent = mi->info.date_received = actual_time;
}
- } else
+ } else
groupwise_set_mail_mi_dates (mi, item);
mi->info.dirty = TRUE;
org->display_name = g_strdelimit (org->display_name, "<>", ' ');
str = g_string_append (str, org->display_name);
str = g_string_append (str, " ");
- } else if (org->email && org->email [0]) {
+ } else if (org->email && org->email[0]) {
str = g_string_append (str, org->email);
str = g_string_append (str, " ");
}
time_t actual_time = e_gw_connection_get_date_from_string (temp_date);
mi->info.date_sent = mi->info.date_received = actual_time;
}
- } else
+ } else
groupwise_set_mail_mi_dates (mi, item);
mi->info.uid = camel_pstring_strdup(e_gw_item_get_id(item));
t = e_gw_connection_get_date_from_string (reply_within);
temp = ctime (&t);
- temp [strlen (temp)-1] = '\0';
+ temp[strlen (temp)-1] = '\0';
value = g_strconcat (N_("Reply Requested: by "), temp, "\n\n", mess ? mess : "", NULL);
e_gw_item_set_message (item, (const gchar *) value);
g_free (value);
groupwise_provider.translation_domain = GETTEXT_PACKAGE;
if (use_imap)
- groupwise_provider.object_types[CAMEL_PROVIDER_STORE] = imap_provider->object_types [CAMEL_PROVIDER_STORE];
+ groupwise_provider.object_types[CAMEL_PROVIDER_STORE] = imap_provider->object_types[CAMEL_PROVIDER_STORE];
else {
groupwise_provider.object_types[CAMEL_PROVIDER_STORE] = camel_groupwise_store_get_type ();
groupwise_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = camel_groupwise_transport_get_type ();
server = g_hash_table_new (g_str_hash, g_str_equal);
cflags = g_strsplit (custom_flags, " ", -1);
- for (i = 0; cflags [i]; i++) {
- gchar *name = cflags [i];
+ for (i = 0; cflags[i]; i++) {
+ gchar *name = cflags[i];
if (name && *name) {
g_hash_table_insert (server, name, name);
if ((g_ascii_strcasecmp (ns->full_name, full_name) == 0 ||
(g_ascii_strncasecmp (ns->full_name, full_name, len) == 0
- && len + 1 == strlen (full_name) && full_name [len] == ns->sep))&& (!dir_sep || ns->sep == dir_sep)) {
+ && len + 1 == strlen (full_name) && full_name[len] == ns->sep))&& (!dir_sep || ns->sep == dir_sep)) {
break;
}
ns = ns->next;
for (i = 0 + (server_to_evo ? 0 : 1); labels[i]; i = i + 2) {
if (!g_ascii_strncasecmp (flag, labels[i], len))
- return labels [i + (server_to_evo ? 1 : -1)];
+ return labels[i + (server_to_evo ? 1 : -1)];
}
return "";
gint j;
for (j = job->u.copy_messages.last_index; j < i; j++)
- camel_folder_delete_message (job->folder, uids->pdata [j]);
+ camel_folder_delete_message (job->folder, uids->pdata[j]);
}
/* TODO copy the summary and cached messages to the new folder. We might need a sorted insert to avoid refreshing the dest folder */
changes = camel_folder_change_info_new ();
for (i = 0; i < uids->len; i++) {
- gchar *uid = uids->pdata [i];
+ gchar *uid = uids->pdata[i];
CamelMessageInfo *mi = camel_folder_summary_uid (folder->summary, uid);
if (mi) {
#define t(x) camel_imapx_debug(token, x)
#define io(x) camel_imapx_debug(io, x)
-
G_DEFINE_TYPE (CamelIMAPXStream, camel_imapx_stream, CAMEL_TYPE_STREAM)
static gint
for (i = 0 + (server_to_evo ? 0 : 1); labels[i]; i = i + 2) {
if (!g_ascii_strncasecmp (flag, labels[i], len))
- return labels [i + (server_to_evo ? 1 : -1)];
+ return labels[i + (server_to_evo ? 1 : -1)];
}
return flag;
/*
capability_data ::= "CAPABILITY" SPACE [1#capability SPACE] "IMAP4rev1"
- [SPACE 1#capability]
+ [SPACE 1#capability]
;; IMAP4rev1 servers which offer RFC 1730
;; compatibility MUST list "IMAP4" as the first
;; capability.
node->sep = *token;
} else {
if (*token)
- node->sep = node->path [strlen (node->path) - 1];
+ node->sep = node->path[strlen (node->path) - 1];
else
node->sep = '\0';
}
tail->next = node;
tail = node;
- if (*node->path && node->path [strlen (node->path) -1] == node->sep)
- node->path [strlen (node->path) - 1] = '\0';
+ if (*node->path && node->path[strlen (node->path) -1] == node->sep)
+ node->path[strlen (node->path) - 1] = '\0';
if (!g_ascii_strncasecmp (node->path, "INBOX", 5) &&
- (node->path [6] == '\0' || node->path [6] == node->sep ))
+ (node->path[6] == '\0' || node->path[6] == node->sep ))
memcpy (node->path, "INBOX", 5);
/* TODO remove full_name later. not required */
}
} else if (tok == IMAPX_TOK_TOKEN && !strcmp ((gchar *) token, "NIL")) {
- namespaces [n] = NULL;
+ namespaces[n] = NULL;
} else {
g_set_error (error, CAMEL_IMAPX_ERROR, 1, "namespace: expected either a '(' or NIL");
goto exception;
n++;
} while (n < 3);
- nsl->personal = namespaces [0];
- nsl->shared = namespaces [1];
- nsl->other = namespaces [2];
+ nsl->personal = namespaces[0];
+ nsl->shared = namespaces[1];
+ nsl->other = namespaces[2];
return nsl;
exception:
g_free (nsl);
for (i=0; i < 3; i++)
- imapx_namespace_clear (&namespaces [i]);
+ imapx_namespace_clear (&namespaces[i]);
return NULL;
}
;; future standard or standards-track
;; revisions of this specification.
-body_ext_1part ::= body_fld_md5 [SPACE body_fld_dsp
- [SPACE body_fld_lang
- [SPACE 1#body_extension]]]
+body_ext_1part ::= body_fld_md5[SPACE body_fld_dsp
+ [SPACE body_fld_lang
+ [SPACE 1#body_extension]]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch
body_ext_mpart ::= body_fld_param
- [SPACE body_fld_dsp SPACE body_fld_lang
- [SPACE 1#body_extension]]
+ [SPACE body_fld_dsp SPACE body_fld_lang
+ [SPACE 1#body_extension]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch
body_fld_param ::= "(" 1#(string SPACE string) ")" / nil
body_type_1part ::= (body_type_basic / body_type_msg / body_type_text)
- [SPACE body_ext_1part]
+ [SPACE body_ext_1part]
body_type_basic ::= media_basic SPACE body_fields
;; MESSAGE subtype MUST NOT be "RFC822"
body_type_mpart ::= 1*body SPACE media_subtype
- [SPACE body_ext_mpart]
+ [SPACE body_ext_mpart]
body_type_msg ::= media_message SPACE body_fields SPACE envelope
SPACE body SPACE body_fld_lines
media_basic ::= (<"> ("APPLICATION" / "AUDIO" / "IMAGE" /
"MESSAGE" / "VIDEO") <">) / string)
SPACE media_subtype
- ;; Defined in [MIME-IMT]
+ ;; Defined in[MIME-IMT]
media_message ::= <"> "MESSAGE" <"> SPACE <"> "RFC822" <">
- ;; Defined in [MIME-IMT]
+ ;; Defined in[MIME-IMT]
media_subtype ::= string
- ;; Defined in [MIME-IMT]
+ ;; Defined in[MIME-IMT]
media_text ::= <"> "TEXT" <"> SPACE media_subtype
- ;; Defined in [MIME-IMT]
+ ;; Defined in[MIME-IMT]
( "type" "subtype" body_fields [envelope body body_fld_lines]
- [body_fld_lines]
+ [body_fld_lines]
(("TEXT" "PLAIN" ("CHARSET"
"US-ASCII") NIL NIL "7BIT" 1152 23)("TEXT" "PLAIN"
/* although the grammars are different, they can be parsed the same way */
/* body_ext_1part ::= body_fld_md5 [SPACE body_fld_dsp
- [SPACE body_fld_lang
- [SPACE 1#body_extension]]]
+ [SPACE body_fld_lang
+ [SPACE 1#body_extension]]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch */
/* body_ext_mpart ::= body_fld_param
- [SPACE body_fld_dsp SPACE body_fld_lang
- [SPACE 1#body_extension]]
+ [SPACE body_fld_dsp SPACE body_fld_lang
+ [SPACE 1#body_extension]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch */
camel_imapx_stream_ungettoken(is, tok, token, len);
if (tok == '(') {
/* body_type_mpart ::= 1*body SPACE media_subtype
- [SPACE body_ext_mpart] */
+ [SPACE body_ext_mpart] */
cinfo = g_malloc0(sizeof(*cinfo));
last = (struct _CamelMessageContentInfo *)&cinfo->childs;
cinfo->type = camel_content_type_new("multipart", (gchar *) token);
/* body_ext_mpart ::= body_fld_param
- [SPACE body_fld_dsp SPACE body_fld_lang
- [SPACE 1#body_extension]]
+ [SPACE body_fld_dsp SPACE body_fld_lang
+ [SPACE 1#body_extension]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch */
}
} else {
/* body_type_1part ::= (body_type_basic / body_type_msg / body_type_text)
- [SPACE body_ext_1part]
+ [SPACE body_ext_1part]
body_type_basic ::= media_basic SPACE body_fields
body_type_text ::= media_text SPACE body_fields SPACE body_fld_lines
camel_imapx_stream_ungettoken(is, tok, token, len);
/* body_ext_1part ::= body_fld_md5 [SPACE body_fld_dsp
- [SPACE body_fld_lang
- [SPACE 1#body_extension]]]
+ [SPACE body_fld_lang
+ [SPACE 1#body_extension]]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch */
for (i = 0; i < str_len; i++) {
if (g_strstr_len (splits [i], -1, ":")) {
gchar **seq = g_strsplit (splits [i], ":", -1);
- guint32 uid1 = strtoul ((gchar *) seq [0], NULL, 10);
- guint32 uid2 = strtoul ((gchar *) seq [1], NULL, 10);
+ guint32 uid1 = strtoul ((gchar *) seq[0], NULL, 10);
+ guint32 uid2 = strtoul ((gchar *) seq[1], NULL, 10);
generate_uids_from_sequence (uids, uid1, uid2);
g_strfreev (seq);
#include <camel/camel.h>
gint
-main (gint argc, gchar *argv [])
+main (gint argc, gchar *argv[])
{
CamelSession *session;
gchar *uri = NULL;
return -1;
}
- uri = argv [1];
+ uri = argv[1];
g_thread_init (NULL);
system ("rm -rf /tmp/test-camel-imapx");
camel_init ("/tmp/test-camel-imapx", TRUE);
LAST_SIGNAL
};
-static guint signals [LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
static void dispose (GObject *);
static void finalize (GObject *);
if (!res)
return g_strdup (str);
- for (i = 0, j = 0; res [i]; i++) {
- if ((guchar)res[i] != 0xCC || res [i + 1] == 0) {
- res [j] = res [i];
+ for (i = 0, j = 0; res[i]; i++) {
+ if ((guchar)res[i] != 0xCC || res[i + 1] == 0) {
+ res[j] = res[i];
j++;
} else {
i++;
}
}
- res [j] = 0;
+ res[j] = 0;
return res;
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
e-debug-log.h: Ring buffer for logging debug messages
-
+
Copyright (C) 2006, 2007 Novell, Inc.
-
+
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-
+
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-
+
Author: Federico Mena-Quintero <federico@novell.com>
*/
LAST_SIGNAL
};
-static guint e_iterator_signals [LAST_SIGNAL] = { 0, };
+static guint e_iterator_signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (EIterator, e_iterator, G_TYPE_OBJECT)
object_class = G_OBJECT_CLASS(klass);
- e_iterator_signals [INVALIDATE] =
+ e_iterator_signals[INVALIDATE] =
g_signal_new ("invalidate",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
g_return_if_fail (iterator != NULL);
g_return_if_fail (E_IS_ITERATOR (iterator));
- g_signal_emit (iterator, e_iterator_signals [INVALIDATE], 0);
+ g_signal_emit (iterator, e_iterator_signals[INVALIDATE], 0);
}
/* FIXME: constant _TIME_MAX used in different files, move it somewhere */
#define _TIME_MAX ((time_t) INT_MAX) /* Max valid time_t */
-
static const GScannerConfig scanner_config =
{
( (gchar *) " \t\r\n") /* cset_skip_characters */,
/*
A B A and B
---- ---- ------- -
- norm(0) norm(0) norm(0)
- gen(1) norm(0) gen(1)
- norm(0) gen(1) gen(1)
- gen(1) gen(1) gen(1)
+ norm(0) norm(0) norm(0)
+ gen(1) norm(0) gen(1)
+ norm(0) gen(1) gen(1)
+ gen(1) gen(1) gen(1)
*/
g_return_val_if_fail (r != NULL, FALSE);
const gint operators_count = sizeof(operators) / sizeof(operators[0]);
-
static ESOperatorFunc*
get_operator_function(const gchar *fname)
{
{
ESGeneratorFunc *generator = NULL;
ESOperatorFunc *operator = NULL;
-
+
r(printf(" (function \"%s\"\n", t->value.func.sym->name));
r = e_sexp_result_new(f, ESEXP_RES_UNDEFINED);
return r;
}
-
/*
PARSER
*/
returned_buffer = g_malloc (xml_buffer_size + 1);
memcpy (returned_buffer, xml_buffer, xml_buffer_size);
- returned_buffer [xml_buffer_size] = '\0';
+ returned_buffer[xml_buffer_size] = '\0';
xmlFree (xml_buffer);
return returned_buffer;
g_str_has_suffix (source->priv->absolute_uri, source->priv->relative_uri)) {
gchar *tmp = source->priv->absolute_uri;
- tmp [strlen (tmp) - strlen (source->priv->relative_uri)] = 0;
+ tmp[strlen (tmp) - strlen (source->priv->relative_uri)] = 0;
source->priv->absolute_uri = g_strconcat (tmp, (gchar *)relative_uri, NULL);
g_free (tmp);
returned_buffer = g_malloc (xml_buffer_size + 1);
memcpy (returned_buffer, xml_buffer, xml_buffer_size);
- returned_buffer [xml_buffer_size] = '\0';
+ returned_buffer[xml_buffer_size] = '\0';
xmlFree (xml_buffer);
return returned_buffer;
format [0] = ("%x");
/* according to the current locale with forced 4-digit year*/
- format [1] = e_time_get_d_fmt_with_4digit_year ();
+ format[1] = e_time_get_d_fmt_with_4digit_year ();
/* strptime format of a weekday and a date. */
format [2] = _("%a %m/%d/%Y");
/* when we need to know about two digit year, then always first try
full year, because for example nl_NL have format %d-%m-%y and it
changes from two year itself, which isn't what we want */
- const gchar *tmp = format [1];
- format [1] = format [0];
- format [0] = tmp;
+ const gchar *tmp = format[1];
+ format[1] = format[0];
+ format[0] = tmp;
*two_digit_year = FALSE;
}
}
if (two_digit_year)
- g_free ((gchar *)format [0]);
+ g_free ((gchar *)format[0]);
else
- g_free ((gchar *)format [1]);
+ g_free ((gchar *)format[1]);
return status;
}
if (text) {
gint len = strlen (text), old_len = len;
- while (len > 0 && (text [len -1] == ' ' || text [len - 1] == ','))
+ while (len > 0 && (text[len -1] == ' ' || text[len - 1] == ','))
len--;
if (old_len != len) {
if (text) {
gint len = strlen (text), old_len = len;
- while (len > 0 && (text [len -1] == ' ' || text [len - 1] == ','))
+ while (len > 0 && (text[len -1] == ' ' || text[len - 1] == ','))
len--;
if (old_len != len) {
/* Update cached contact */
if (cached_contact != contact) {
g_object_unref (cached_contact);
- cached_contacts->pdata [n] = g_object_ref (contact);
+ cached_contacts->pdata[n] = g_object_ref (contact);
}
/* Emit changes for current view only */
gint stamp;
};
-static GType column_types [E_DESTINATION_STORE_NUM_COLUMNS];
+static GType column_types[E_DESTINATION_STORE_NUM_COLUMNS];
static void e_destination_store_tree_model_init (GtkTreeModelIface *iface);
G_DEFINE_TYPE_EXTENDED (
EDestinationStore, e_destination_store, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, e_destination_store_tree_model_init);
- column_types [E_DESTINATION_STORE_COLUMN_NAME] = G_TYPE_STRING;
- column_types [E_DESTINATION_STORE_COLUMN_EMAIL] = G_TYPE_STRING;
- column_types [E_DESTINATION_STORE_COLUMN_ADDRESS] = G_TYPE_STRING;
+ column_types[E_DESTINATION_STORE_COLUMN_NAME] = G_TYPE_STRING;
+ column_types[E_DESTINATION_STORE_COLUMN_EMAIL] = G_TYPE_STRING;
+ column_types[E_DESTINATION_STORE_COLUMN_ADDRESS] = G_TYPE_STRING;
)
static GtkTreeModelFlags e_destination_store_get_flags (GtkTreeModel *tree_model);
g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), G_TYPE_INVALID);
g_return_val_if_fail (index >= 0 && index < E_DESTINATION_STORE_NUM_COLUMNS, G_TYPE_INVALID);
- return column_types [index];
+ return column_types[index];
}
static gboolean
g_return_if_fail (column < E_DESTINATION_STORE_NUM_COLUMNS);
g_return_if_fail (ITER_IS_VALID (destination_store, iter));
- g_value_init (value, column_types [column]);
+ g_value_init (value, column_types[column]);
array = destination_store->priv->destinations;
gint char_pos = position - gap + i;
if (char_pos < 0 || char_pos >= len) {
- unichars [i] = '\0';
+ unichars[i] = '\0';
continue;
}
else
p = g_utf8_offset_to_pointer (string, char_pos);
- unichars [i] = g_utf8_get_char (p);
+ unichars[i] = g_utf8_get_char (p);
}
}
strv = g_strsplit (spaced_str, " ", 0);
- if (strv [0] && strv [1]) {
+ if (strv[0] && strv[1]) {
g_string_append (out, "(or ");
comma_str = g_strjoinv (", ", strv);
} else {
contact_match_cue (EContact *contact, const gchar *cue_str,
EContactField *matched_field, gint *matched_field_rank)
{
- EContactField fields [] = { E_CONTACT_FULL_NAME, E_CONTACT_NICKNAME, E_CONTACT_FILE_AS,
+ EContactField fields[] = { E_CONTACT_FULL_NAME, E_CONTACT_NICKNAME, E_CONTACT_FILE_AS,
E_CONTACT_EMAIL_1, E_CONTACT_EMAIL_2, E_CONTACT_EMAIL_3,
E_CONTACT_EMAIL_4 };
gchar *email;
/* Don't match e-mail addresses in contact lists */
if (e_contact_get (contact, E_CONTACT_IS_LIST) &&
- fields [i] >= E_CONTACT_FIRST_EMAIL_ID &&
- fields [i] <= E_CONTACT_LAST_EMAIL_ID)
+ fields[i] >= E_CONTACT_FIRST_EMAIL_ID &&
+ fields[i] <= E_CONTACT_LAST_EMAIL_ID)
continue;
- value = e_contact_get (contact, fields [i]);
+ value = e_contact_get (contact, fields[i]);
if (!value)
continue;
gint i;
/* keep character's case as user types */
- for (i = 0; textrep [i] && cue_str [i]; i++)
- textrep [i] = cue_str [i];
+ for (i = 0; textrep[i] && cue_str[i]; i++)
+ textrep[i] = cue_str[i];
gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), range_start, range_end);
gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), textrep, -1, &pos);
insert_unichar (ENameSelectorEntry *name_selector_entry, gint *pos, gunichar c)
{
const gchar *text;
- gunichar str_context [4];
- gchar buf [7];
+ gunichar str_context[4];
+ gchar buf[7];
gint len;
text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));
* - Before or after another space.
* - At start of string. */
- if (c == ' ' && (str_context [1] == ' ' || str_context [1] == '\0' || str_context [2] == ' '))
+ if (c == ' ' && (str_context[1] == ' ' || str_context[1] == '\0' || str_context[2] == ' '))
return 0;
/* Comma is not allowed:
gboolean at_start = FALSE;
gboolean at_end = FALSE;
- if (str_context [1] == ',' || str_context [1] == '\0')
+ if (str_context[1] == ',' || str_context[1] == '\0')
return 0;
/* We do this so we can avoid disturbing destinations with completed contacts
/* Generic case. Allowed spaces also end up here. */
len = g_unichar_to_utf8 (c, buf);
- buf [len] = '\0';
+ buf[len] = '\0';
gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), buf, -1, pos);
const gchar *text;
gint index_start, index_end;
gint selection_start, selection_end;
- gunichar str_context [2], str_b_context [2];
+ gunichar str_context[2], str_b_context[2];
gint len;
gint i;
gboolean del_space = FALSE, del_comma = FALSE;
addresses.
*/
- if (str_b_context [1] == '"') {
+ if (str_b_context[1] == '"') {
const gchar *p;
gint j;
p = text + end_pos;
g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry);
gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &cursor_pos);
g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry);
-
+
/* Place cursor at end of address */
gtk_editable_set_position (GTK_EDITABLE (name_selector_entry), cursor_pos);
gint range_start, range_end;
gint n;
- n = gtk_tree_path_get_indices (path) [0];
+ n = gtk_tree_path_get_indices (path)[0];
destination = e_destination_store_get_destination (name_selector_entry->priv->destination_store, iter);
if (!destination)
gint insert_pos;
gint n;
- n = gtk_tree_path_get_indices (path) [0];
+ n = gtk_tree_path_get_indices (path)[0];
destination = e_destination_store_get_destination (name_selector_entry->priv->destination_store, iter);
g_assert (n >= 0);
gchar *p0;
gint n;
- n = gtk_tree_path_get_indices (path) [0];
+ n = gtk_tree_path_get_indices (path)[0];
g_assert (n >= 0);
text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));
LAST_SIGNAL
};
-static guint signals [LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (ENameSelectorModel, e_name_selector_model, G_TYPE_OBJECT)
g_array_append_val (name_selector_model->priv->sections, section);
destinations_changed (name_selector_model);
- g_signal_emit (name_selector_model, signals [SECTION_ADDED], 0, name);
+ g_signal_emit (name_selector_model, signals[SECTION_ADDED], 0, name);
}
/**
g_array_remove_index_fast (name_selector_model->priv->sections, n); /* Order doesn't matter */
destinations_changed (name_selector_model);
- g_signal_emit (name_selector_model, signals [SECTION_REMOVED], 0, name);
+ g_signal_emit (name_selector_model, signals[SECTION_REMOVED], 0, name);
}
/**
break;
}
- index = gtk_tree_path_get_indices (path) [depth];
+ index = gtk_tree_path_get_indices (path)[depth];
node = &g_array_index (group, Node, index);
if (depth + 1 < gtk_tree_path_get_depth (path))
node->child_nodes = g_array_new (FALSE, FALSE, sizeof (Node));
group = node->child_nodes;
- parent_index = gtk_tree_path_get_indices (parent_path) [gtk_tree_path_get_depth (parent_path) - 1];
+ parent_index = gtk_tree_path_get_indices (parent_path)[gtk_tree_path_get_depth (parent_path) - 1];
} else {
if (!tree_model_generator->priv->root_nodes)
tree_model_generator->priv->root_nodes = g_array_new (FALSE, FALSE, sizeof (Node));
gtk_tree_path_free (parent_path);
- index = gtk_tree_path_get_indices (path) [gtk_tree_path_get_depth (path) - 1];
+ index = gtk_tree_path_get_indices (path)[gtk_tree_path_get_depth (path) - 1];
ETMG_DEBUG (g_print ("Inserting index %d into group of length %d\n", index, group->len));
index = MIN (index, group->len);
if (!group)
return;
- index = gtk_tree_path_get_indices (path) [gtk_tree_path_get_depth (path) - 1];
+ index = gtk_tree_path_get_indices (path)[gtk_tree_path_get_depth (path) - 1];
if (index >= group->len)
return;
break;
}
- index = gtk_tree_path_get_indices (child_path) [depth];
+ index = gtk_tree_path_get_indices (child_path)[depth];
generated_index = child_offset_to_generated_offset (group, index);
node = &g_array_index (group, Node, index);
group = node->child_nodes;
for (depth = 0; depth < gtk_tree_path_get_depth (path); depth++) {
Node *node;
- index = gtk_tree_path_get_indices (path) [depth];
+ index = gtk_tree_path_get_indices (path)[depth];
node = &g_array_index (group, Node, index);
if (depth + 1 < gtk_tree_path_get_depth (path))
break;
}
- index = gtk_tree_path_get_indices (generator_path) [depth];
+ index = gtk_tree_path_get_indices (generator_path)[depth];
child_index = generated_offset_to_child_offset (group, index, NULL);
node = &g_array_index (group, Node, child_index);
group = node->child_nodes;
Node *node;
gint child_index;
- index = gtk_tree_path_get_indices (path) [depth];
+ index = gtk_tree_path_get_indices (path)[depth];
child_index = generated_offset_to_child_offset (group, index, NULL);
if (child_index < 0)
return FALSE;
if (argc < 2)
gconf_path = "/apps/evolution/addressbook/sources";
else
- gconf_path = argv [1];
+ gconf_path = argv[1];
g_idle_add ((GSourceFunc) start_test, (gpointer) gconf_path);
if (argc < 2)
gconf_path = "/apps/evolution/calendar/sources";
else
- gconf_path = argv [1];
+ gconf_path = argv[1];
g_idle_add ((GSourceFunc) on_idle_create_widget, (gpointer) gconf_path);
if (argc < 2)
gconf_path = "/apps/evolution/calendar/sources";
else
- gconf_path = argv [1];
+ gconf_path = argv[1];
g_idle_add ((GSourceFunc) on_idle_create_widget, (gpointer) gconf_path);
soup_soap_message_start_element (msg, "byDay", NULL, NULL);
max_elements = G_N_ELEMENTS (rrule->by_day);
/* expand into a sequence of 'day' here */
- for (i = 0; i < max_elements && rrule->by_day [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
- const gchar *dow = e_gw_recur_get_day_of_week (rrule->by_day [i]);
+ for (i = 0; i < max_elements && rrule->by_day[i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
+ const gchar *dow = e_gw_recur_get_day_of_week (rrule->by_day[i]);
- if (rrule->by_setpos [i] == E_GW_ITEM_RECUR_END_MARKER)
+ if (rrule->by_setpos[i] == E_GW_ITEM_RECUR_END_MARKER)
e_gw_message_write_string_parameter (msg, "day", NULL, dow);
else {
- gchar occur [3];
+ gchar occur[3];
g_sprintf (occur, "%d", rrule->by_setpos [i]);
e_gw_message_write_string_parameter_with_attribute (msg, "day", NULL, dow, "occurrence", occur);
soup_soap_message_start_element (msg, "byMonthDay", NULL, NULL);
max_elements = G_N_ELEMENTS (rrule->by_month_day);
/* expand into a sequence of 'day' here */
- for (i = 0; i < max_elements && rrule->by_month_day [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
+ for (i = 0; i < max_elements && rrule->by_month_day[i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
/*TODO occurence attribute */
g_sprintf (month_day, "%d", rrule->by_month_day [i]);
e_gw_message_write_string_parameter (msg, "day", NULL, month_day);
soup_soap_message_start_element (msg, "byYearDay", NULL, NULL);
max_elements = G_N_ELEMENTS (rrule->by_year_day);
/* expand into a sequence of 'day' here */
- for (i = 0; i < max_elements && rrule->by_year_day [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
+ for (i = 0; i < max_elements && rrule->by_year_day[i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
/*TODO occurence attribute */
g_sprintf (year_day, "%d", rrule->by_year_day [i]);
e_gw_message_write_string_parameter (msg, "day", NULL, year_day);
soup_soap_message_start_element (msg, "byMonth", NULL, NULL);
max_elements = G_N_ELEMENTS (rrule->by_month);
/* expand into a sequence of 'month' here */
- for (i = 0; i < max_elements && rrule->by_month [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
+ for (i = 0; i < max_elements && rrule->by_month[i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
/*TODO occurence attribute */
g_sprintf (month, "%d", rrule->by_month [i]);
e_gw_message_write_string_parameter (msg, "month", NULL, month);
if (day < 1 || day > 7)
return "";
- return days_of_week [day-1];
+ return days_of_week[day-1];
}
gshort by_month_day[E_GW_ITEM_BY_MONTHDAY_SIZE];
gshort by_year_day[E_GW_ITEM_BY_YEARDAY_SIZE];
gshort by_month[E_GW_ITEM_BY_MONTH_SIZE];
- gshort by_setpos [E_GW_ITEM_BY_SETPOS_SIZE];
+ gshort by_setpos[E_GW_ITEM_BY_SETPOS_SIZE];
} EGwItemRecurrenceRule;
#define E_GW_ITEM_RECUR_END_MARKER 0x7f7f