From acdd664f5104862243db8c3a0689d5ac4ede774e Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 15 May 2002 16:19:25 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'GNOME_UTILS_2_0_2'. svn path=/tags/GNOME_UTILS_2_0_2/; revision=16870 --- camel/camel-index-control.c | 211 -------------------------------------------- 1 file changed, 211 deletions(-) delete mode 100644 camel/camel-index-control.c (limited to 'camel/camel-index-control.c') diff --git a/camel/camel-index-control.c b/camel/camel-index-control.c deleted file mode 100644 index f1f4dd234d..0000000000 --- a/camel/camel-index-control.c +++ /dev/null @@ -1,211 +0,0 @@ - -/* Command to manually force a compression/dump of an index file */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "e-util/e-msgport.h" -#include "e-util/e-memory.h" - -#include "camel/camel-object.h" - -#include "camel-text-index.h" - -#include - -static void -do_usage(char *argv0) -{ - fprintf(stderr, "Usage: %s [ compress | dump | info ] file(s) ...\n", argv0); - fprintf(stderr, " compress - compress (an) index file(s)\n"); - fprintf(stderr, " dump - dump (an) index file's content to stdout\n"); - fprintf(stderr, " info - dump summary info to stdout\n"); - exit(1); -} - -static int -do_compress(int argc, char **argv) -{ - int i; - CamelIndex *idx; - - for (i=2;i -#include -#include "camel-stream-null.h" -#include "camel-stream-filter.h" -#include "camel-mime-filter-index.h" -#include "camel-stream-fs.h" - -static int -do_perf(int argc, char **argv) -{ - CamelIndex *idx; - DIR *dir; - char *path = "/home/notzed/evolution/local/Inbox/mbox/cur"; - struct dirent *d; - CamelStream *null, *filter, *stream; - CamelMimeFilterIndex *filter_index; - char *name; - CamelIndexName *idn; - - dir = opendir(path); - if (dir == NULL) { - perror("open dir"); - return 1; - } - - idx = (CamelIndex *)camel_text_index_new("/tmp/index", O_TRUNC|O_CREAT|O_RDWR); - if (idx == NULL) { - perror("open index"); - return 1; - } - - null = camel_stream_null_new(); - filter = (CamelStream *)camel_stream_filter_new_with_stream(null); - camel_object_unref((CamelObject *)null); - filter_index = camel_mime_filter_index_new_index(idx); - camel_stream_filter_add((CamelStreamFilter *)filter, (CamelMimeFilter *)filter_index); - - while ((d = readdir(dir))) { - printf("indexing '%s'\n", d->d_name); - - idn = camel_index_add_name(idx, d->d_name); - camel_mime_filter_index_set_name(filter_index, idn); - name = g_strdup_printf("%s/%s", path, d->d_name); - stream = camel_stream_fs_new_with_name(name, O_RDONLY, 0); - camel_stream_write_to_stream(stream, filter); - camel_object_unref((CamelObject *)stream); - g_free(name); - - camel_index_write_name(idx, idn); - camel_object_unref((CamelObject *)idn); - camel_mime_filter_index_set_name(filter_index, NULL); - } - - closedir(dir); - - camel_index_sync(idx); - camel_object_unref((CamelObject *)idx); - - camel_object_unref((CamelObject *)filter); - camel_object_unref((CamelObject *)filter_index); - - return 0; -} -- cgit v1.2.3