mdbindex.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <glib-object.h>
00028 #include <gtk/gtk.h>
00029
00030 #include "log.h"
00031 #include "index.h"
00032 #include "index_ipc.h"
00033
00034 extern void sync(void);
00035
00036 int main (int argc, char *argv[])
00037 {
00038 gtk_init(&argc, &argv);
00039 g_type_init();
00040
00041 if (argc != 2 && argc != 3) {
00042 fprintf(stderr, "Usage: mdbindex [dir] <--quick>\n");
00043 return 1;
00044 }
00045 gboolean skip_thumbnails = (argc == 3);
00046
00047 ipc_set_services(NULL, NULL);
00048
00049 printf("mdbindex: indexing %s (thumbs=%d)\n", argv[1], 1 - skip_thumbnails);
00050 u_int64_t start = getCurrentTime();
00051
00052 index_full(argv[1], skip_thumbnails);
00053
00054 u_int64_t end = getCurrentTime();
00055 u_int64_t diff = end - start;
00056 printf("mdbindex: indexing took %lld ms\n", diff / 1000);
00057 ipc_unset_services();
00058
00059 return 0;
00060 }
00061