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

« back to all changes in this revision

Viewing changes to camel/camel-search-sql-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:
32
32
#include <stdlib.h>
33
33
#include <glib.h>
34
34
#include "camel-search-sql-sexp.h"
35
 
#include "libedataserver/e-sexp.h"
36
35
#define d(x) /* x;printf("\n"); */
37
36
 
38
37
#ifdef TEST_MAIN
465
464
        if (argc != 1) {
466
465
                r->value.string = g_strdup ("(0)");
467
466
        } else {
468
 
                tstr = g_strdup_printf("%%%s%%", argv[0]->value.string);
 
467
                tstr = g_strdup_printf("%s", argv[0]->value.string);
469
468
                qstr = get_db_safe_string(tstr);
470
469
                g_free(tstr);
471
 
                r->value.string = g_strdup_printf("(labels LIKE %s)", qstr);
 
470
                r->value.string = g_strdup_printf("(labels MATCH %s)", qstr);
472
471
                g_free(qstr);
473
472
        }
474
473
 
571
570
static struct {
572
571
        const gchar *name;
573
572
        ESExpFunc *func;
574
 
        gint immediate :1;
 
573
        guint immediate :1;
575
574
} symbols[] = {
576
575
        { "and", (ESExpFunc *) func_and, 1 },
577
576
        { "or", (ESExpFunc *) func_or, 1},
600
599
/*      { "uid", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, uid), 1 }, */
601
600
};
602
601
 
 
602
/**
 
603
 * camel_sexp_to_sql_sexp:
 
604
 *
 
605
 * Since: 2.26
 
606
 **/
603
607
gchar *
604
608
camel_sexp_to_sql_sexp (const gchar *sql)
605
609
{
610
614
 
611
615
        sexp = e_sexp_new();
612
616
 
613
 
        for (i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
 
617
        for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
614
618
                if (symbols[i].immediate)
615
619
                        e_sexp_add_ifunction(sexp, 0, symbols[i].name,
616
620
                                             (ESExpIFunc *) symbols[i].func, NULL);