~ubuntu-branches/ubuntu/saucy/evolution-data-server/saucy

« back to all changes in this revision

Viewing changes to camel/camel-text-index.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-10-08 12:58:16 UTC
  • mfrom: (181.1.7 quantal)
  • Revision ID: package-import@ubuntu.com-20121008125816-i3n76e8c0m64e7xp
Tags: 3.6.0-0ubuntu2
* Fix LP: #1038047 part 1 - Don't abort in e_source_registry_new* when a
  problem occurs connecting to the Dbus service
  - add debian/patches/dont-abort-in-e_source_registry_new.patch
  - update debian/patches/series
* Fix LP: #1038047 part 2 - libedataserver depends on
  evolution-data-server-common to ensure that the GSettings schemas are
  present
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
251
251
                        data = 0;
252
252
                        wordid = camel_key_table_add (p->word_index, word, 0, 0);
253
253
                        if (wordid == 0) {
254
 
                                g_warning ("Could not create key entry for word '%s': %s\n",
255
 
                                           word, g_strerror (errno));
 
254
                                g_warning (
 
255
                                        "Could not create key entry for word '%s': %s\n",
 
256
                                        word, g_strerror (errno));
256
257
                                return;
257
258
                        }
258
259
                        if (camel_partition_table_add (p->word_hash, word, wordid) == -1) {
259
 
                                g_warning ("Could not create hash entry for word '%s': %s\n",
260
 
                                           word, g_strerror (errno));
 
260
                                g_warning (
 
261
                                        "Could not create hash entry for word '%s': %s\n",
 
262
                                        word, g_strerror (errno));
261
263
                                return;
262
264
                        }
263
265
                        rb->words++;
265
267
                } else {
266
268
                        data = camel_key_table_lookup (p->word_index, wordid, NULL, NULL);
267
269
                        if (data == 0) {
268
 
                                g_warning ("Could not find key entry for word '%s': %s\n",
269
 
                                           word, g_strerror (errno));
 
270
                                g_warning (
 
271
                                        "Could not find key entry for word '%s': %s\n",
 
272
                                        word, g_strerror (errno));
270
273
                                return;
271
274
                        }
272
275
                }
405
408
        s = strrchr (in, '/');
406
409
        if (s) {
407
410
                memcpy (o, in, s - in + 1);
408
 
                memcpy (o+(s-in+1), ".#", 2);
 
411
                memcpy (o + (s - in + 1), ".#", 2);
409
412
                strcpy (o + (s - in + 3), s + 1);
410
413
        } else {
411
414
                sprintf (o, ".#%s", in);
452
455
        savepath = alloca (i);
453
456
 
454
457
        strcpy (oldpath, idx->path);
455
 
        oldpath[strlen (oldpath)-strlen (".index")] = 0;
 
458
        oldpath[strlen (oldpath) - strlen (".index")] = 0;
456
459
 
457
460
        tmp_name (oldpath, newpath);
458
461
        sprintf (savepath, "%s~", oldpath);
515
518
         * have to do 1 at a time and its cheap */
516
519
        oldkeyid = 0;
517
520
        while ((oldkeyid = camel_key_table_next (oldp->word_index, oldkeyid, &name, &flags, &data))) {
518
 
                io(printf ("copying word '%s'\n", name));
 
521
                io (printf ("copying word '%s'\n", name));
519
522
                newdata = 0;
520
523
                newcount = 0;
521
524
                if (data) {
524
527
                }
525
528
                while (data) {
526
529
                        if (camel_key_file_read (oldp->links, &data, &count, &records) == -1) {
527
 
                                io (printf ("could not read from old keys at %d for word '%s'\n", (gint)data, name));
 
530
                                io (printf ("could not read from old keys at %d for word '%s'\n", (gint) data, name));
528
531
                                goto fail;
529
532
                        }
530
533
                        for (i = 0; i < count; i++) {
1205
1208
                                else
1206
1209
                                        len = k->u.keys[i - 1].offset;
1207
1210
                                len -= k->u.keys[i].offset;
1208
 
                                printf ("[%03d]: %08x %5d %06x %3d '%.*s'\n", i,
1209
 
                                       k->u.keys[i].data, k->u.keys[i].offset, k->u.keys[i].flags,
1210
 
                                       len, len, k->u.keydata + k->u.keys[i].offset);
 
1211
                                printf (
 
1212
                                        "[%03d]: %08x %5d %06x %3d '%.*s'\n", i,
 
1213
                                        k->u.keys[i].data, k->u.keys[i].offset, k->u.keys[i].flags,
 
1214
                                        len, len, k->u.keydata + k->u.keys[i].offset);
1211
1215
                        }
1212
1216
                } break;
1213
1217
                case PARTITION_MAP: {
1419
1423
                                printf ("Warning, read failed for word '%s', at data '%u'\n", word, data);
1420
1424
                                data = 0;
1421
1425
                        } else {
1422
 
                                printf ("(%d)\n", (gint)count);
 
1426
                                printf ("(%d)\n", (gint) count);
1423
1427
                                g_free (records);
1424
1428
                        }
1425
1429
                }
1890
1894
 
1891
1895
        camel_init (NULL, 0);
1892
1896
 
1893
 
        idx = (CamelIndex *)camel_text_index_new ("textindex", O_CREAT|O_RDWR|O_TRUNC);
 
1897
        idx = (CamelIndex *) camel_text_index_new ("textindex", O_CREAT | O_RDWR | O_TRUNC);
1894
1898
 
1895
1899
#if 1
1896
1900
        camel_index_compress (idx);