~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to calendar/libedata-cal/e-cal-backend-sexp.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
#include "e-cal-backend-sexp.h"
31
31
 
 
32
G_DEFINE_TYPE (ECalBackendSExp, e_cal_backend_sexp, G_TYPE_OBJECT)
 
33
 
32
34
static GObjectClass *parent_class;
33
35
 
34
36
typedef struct _SearchContext SearchContext;
56
58
 *
57
59
 * Processes the (time-now) sexp expression.
58
60
 *
59
 
 * Return value: The result of the function.
 
61
 * Returns: The result of the function.
60
62
 */
61
63
ESExpResult *
62
64
e_cal_backend_sexp_func_time_now (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
87
89
 *
88
90
 * Constructs a time_t value for the specified date.
89
91
 *
90
 
 * Return value: The result of the function.
 
92
 * Returns: The result of the function.
91
93
 */
92
94
ESExpResult *
93
95
e_cal_backend_sexp_func_make_time (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
147
149
 * FIXME: TIMEZONES - need to use a timezone or daylight saving changes will
148
150
 * make the result incorrect.
149
151
 *
150
 
 * Return value: The result of the function.
 
152
 * Returns: The result of the function.
151
153
 */
152
154
ESExpResult *
153
155
e_cal_backend_sexp_func_time_add_day (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
198
200
 *
199
201
 * FIXME: TIMEZONES - this uses the current Unix timezone.
200
202
 *
201
 
 * Return value: The result of the function.
 
203
 * Returns: The result of the function.
202
204
 */
203
205
ESExpResult *
204
206
e_cal_backend_sexp_func_time_day_begin (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
240
242
 *
241
243
 * FIXME: TIMEZONES - this uses the current Unix timezone.
242
244
 *
243
 
 * Return value: The result of the function.
 
245
 * Returns: The result of the function.
244
246
 */
245
247
ESExpResult *
246
248
e_cal_backend_sexp_func_time_day_end (ESExp *esexp, gint argc, ESExpResult **argv, gpointer data)
1167
1169
        LIST_PROP ( "category", "category", compare_category ),
1168
1170
        LIST_PROP ( "arbitrary", "arbitrary", compare_arbitrary )
1169
1171
};
1170
 
static gint num_prop_infos = sizeof(prop_info_table) / sizeof(prop_info_table[0]);
1171
1172
 
1172
1173
static ESExpResult *
1173
1174
entry_compare(SearchContext *ctx, struct _ESExp *f,
1188
1189
                propname = argv[0]->value.string;
1189
1190
 
1190
1191
                any_field = !strcmp(propname, "x-evolution-any-field");
1191
 
                for (i = 0; i < num_prop_infos; i ++) {
 
1192
                for (i = 0; i < G_N_ELEMENTS (prop_info_table); i ++) {
1192
1193
                        if (any_field
1193
1194
                            || !strcmp (prop_info_table[i].query_prop, propname)) {
1194
1195
                                info = &prop_info_table[i];
1279
1280
 *
1280
1281
 * Matches the given ECalComponent against the expression.
1281
1282
 *
1282
 
 * Return value: TRUE if the component matched the expression, FALSE if not.
 
1283
 * Returns: TRUE if the component matched the expression, FALSE if not.
1283
1284
 */
1284
1285
gboolean
1285
1286
e_cal_backend_sexp_match_comp (ECalBackendSExp *sexp, ECalComponent *comp, ECalBackend *backend)
1319
1320
 *
1320
1321
 * Match an iCalendar expression against the expression.
1321
1322
 *
1322
 
 * Return value: TRUE if the object matches the expression, FALSE if not.
 
1323
 * Returns: TRUE if the object matches the expression, FALSE if not.
1323
1324
 */
1324
1325
gboolean
1325
1326
e_cal_backend_sexp_match_object (ECalBackendSExp *sexp, const gchar *object, ECalBackend *backend)
1350
1351
 *
1351
1352
 * Creates a new #EXCalBackendSExp object.
1352
1353
 *
1353
 
 * Return value: The newly created ECalBackendSExp object.
 
1354
 * Returns: The newly created ECalBackendSExp object.
1354
1355
 */
1355
1356
ECalBackendSExp *
1356
1357
e_cal_backend_sexp_new (const gchar *text)
1389
1390
 *
1390
1391
 * Retrieve the text expression for the given ECalBackendSExp object.
1391
1392
 *
1392
 
 * Return value: The text expression.
 
1393
 * Returns: The text expression.
1393
1394
 */
1394
1395
const gchar *
1395
1396
e_cal_backend_sexp_text (ECalBackendSExp *sexp)
1445
1446
        sexp->priv = priv;
1446
1447
        priv->search_context = g_new (SearchContext, 1);
1447
1448
}
1448
 
 
1449
 
/**
1450
 
 * e_cal_backend_sexp_get_type:
1451
 
 *
1452
 
 * Registers the #ECalBackendSExp class if needed.
1453
 
 *
1454
 
 * Return value: The unique identifier of the class.
1455
 
 */
1456
 
GType
1457
 
e_cal_backend_sexp_get_type (void)
1458
 
{
1459
 
        static GType type = 0;
1460
 
 
1461
 
        if (! type) {
1462
 
                GTypeInfo info = {
1463
 
                        sizeof (ECalBackendSExpClass),
1464
 
                        NULL, /* base_class_init */
1465
 
                        NULL, /* base_class_finalize */
1466
 
                        (GClassInitFunc)  e_cal_backend_sexp_class_init,
1467
 
                        NULL, /* class_finalize */
1468
 
                        NULL, /* class_data */
1469
 
                        sizeof (ECalBackendSExp),
1470
 
                        0,    /* n_preallocs */
1471
 
                        (GInstanceInitFunc) e_cal_backend_sexp_init
1472
 
                };
1473
 
 
1474
 
                type = g_type_register_static (G_TYPE_OBJECT, "ECalBackendSExp", &info, 0);
1475
 
        }
1476
 
 
1477
 
        return type;
1478
 
}