mdbindex.c

Go to the documentation of this file.
00001 /*
00002  * File Name: mdbindex.c
00003  */
00004 
00005 /*
00006  * This file is part of mdbindex.
00007  *
00008  * ctb is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * ctb is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 /**
00023  * Copyright (C) 2008 iRex Technologies B.V.
00024  * All rights reserved.
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 
Generated by  doxygen 1.6.2-20100208