a/src/index/recollindex.cpp b/src/index/recollindex.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.29 2006-12-21 09:22:31 dockes Exp $ (C) 2004 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.30 2006-12-24 07:40:26 dockes Exp $ (C) 2004 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
215
#define OPT_S     0x40
215
#define OPT_S     0x40
216
#define OPT_m     0x80
216
#define OPT_m     0x80
217
#define OPT_D     0x100
217
#define OPT_D     0x100
218
#define OPT_e     0x200
218
#define OPT_e     0x200
219
#define OPT_w     0x400
219
#define OPT_w     0x400
220
#define OPT_x     0x800
220
221
221
static const char usage [] =
222
static const char usage [] =
222
"\n"
223
"\n"
223
"recollindex [-h] \n"
224
"recollindex [-h] \n"
224
"    Print help\n"
225
"    Print help\n"
225
"recollindex [-z] \n"
226
"recollindex [-z] \n"
226
"    Index everything according to configuration file\n"
227
"    Index everything according to configuration file\n"
227
"    -z : reset database before starting indexation\n"
228
"    -z : reset database before starting indexation\n"
228
#ifdef RCL_MONITOR
229
#ifdef RCL_MONITOR
229
"recollindex -m [-D]\n"
230
"recollindex -m [-w <secs>] -x [-D]\n"
230
"    Perform real time indexation. Don't become a daemon if -D is set\n"
231
"    Perform real time indexation. Don't become a daemon if -D is set.\n"
232
"    -w sets number of seconds to wait before starting.\n"
233
"    -x disables exit on end of x11 session\n"
231
#endif
234
#endif
232
"recollindex -e <filename [filename ...]>\n"
235
"recollindex -e <filename [filename ...]>\n"
233
"    Purge data for individual files. No stem database updates\n"
236
"    Purge data for individual files. No stem database updates\n"
234
"recollindex -i <filename [filename ...]>\n"
237
"recollindex -i <filename [filename ...]>\n"
235
"    Index individual files. No database purge or stem database updates\n"
238
"    Index individual files. No database purge or stem database updates\n"
...
...
286
        case 'w':   op_flags |= OPT_w; if (argc < 2)  Usage();
289
        case 'w':   op_flags |= OPT_w; if (argc < 2)  Usage();
287
        if ((sscanf(*(++argv), "%d", &sleepsecs)) != 1) 
290
        if ((sscanf(*(++argv), "%d", &sleepsecs)) != 1) 
288
            Usage(); 
291
            Usage(); 
289
        argc--; goto b1;
292
        argc--; goto b1;
290
#endif
293
#endif
294
      case 'x': op_flags |= OPT_x; break;
291
        case 'z': op_flags |= OPT_z; break;
295
        case 'z': op_flags |= OPT_z; break;
292
        default: Usage(); break;
296
        default: Usage(); break;
293
        }
297
        }
294
    b1: argc--; argv++;
298
    b1: argc--; argv++;
295
    }
299
    }
...
...
350
        sleep(sleepsecs);
354
        sleep(sleepsecs);
351
    }
355
    }
352
    confindexer = new ConfIndexer(config, &updater);
356
    confindexer = new ConfIndexer(config, &updater);
353
    confindexer->index(rezero);
357
    confindexer->index(rezero);
354
    delete confindexer;
358
    delete confindexer;
359
  int opts = RCLMON_NONE;
360
  if (op_flags & OPT_D)
361
      opts |= RCLMON_NOFORK;
362
  if (op_flags & OPT_x)
363
      opts |= RCLMON_NOX11;
355
    if (startMonitor(config, (op_flags&OPT_D)!=0))
364
    if (startMonitor(config, opts))
356
        exit(0);
365
        exit(0);
357
    exit(1);
366
    exit(1);
358
#endif // MONITOR
367
#endif // MONITOR
359
368
360
#ifdef RCL_USE_ASPELL
369
#ifdef RCL_USE_ASPELL