Switch to unified view

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.31 2007-02-02 10:09:10 dockes Exp $ (C) 2004 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.32 2007-05-21 13:30:21 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
...
...
72
        "configuration for %s\n", config->getKeyDir().c_str());
72
        "configuration for %s\n", config->getKeyDir().c_str());
73
    return false;
73
    return false;
74
    }
74
    }
75
    // Check if there is already an indexer for the right db
75
    // Check if there is already an indexer for the right db
76
    if (dbindexer && dbindexer->getDbDir().compare(dbdir)) {
76
    if (dbindexer && dbindexer->getDbDir().compare(dbdir)) {
77
    delete dbindexer;
77
    deleteZ(dbindexer);
78
  dbindexer = 0;
79
    }
78
    }
80
79
81
    if (!dbindexer)
80
    if (!dbindexer)
82
    dbindexer = new DbIndexer(config, dbdir, &updater);
81
    dbindexer = new DbIndexer(config, dbdir, &updater);
83
82
...
...
197
    return false;
196
    return false;
198
}
197
}
199
198
200
static void cleanup()
199
static void cleanup()
201
{
200
{
202
    delete confindexer;
201
    deleteZ(confindexer);
203
    confindexer = 0;
204
    delete dbindexer;
202
    deleteZ(dbindexer);
205
    dbindexer = 0;
206
}
203
}
207
204
208
static const char *thisprog;
205
static const char *thisprog;
209
static int     op_flags;
206
static int     op_flags;
210
#define OPT_MOINS 0x1
207
#define OPT_MOINS 0x1
...
...
358
    if (!(op_flags & OPT_x) && !x11IsAlive())
355
    if (!(op_flags & OPT_x) && !x11IsAlive())
359
        exit(0);
356
        exit(0);
360
357
361
    confindexer = new ConfIndexer(config, &updater);
358
    confindexer = new ConfIndexer(config, &updater);
362
    confindexer->index(rezero);
359
    confindexer->index(rezero);
363
    delete confindexer;
360
    deleteZ(confindexer);
364
    int opts = RCLMON_NONE;
361
    int opts = RCLMON_NONE;
365
    if (op_flags & OPT_D)
362
    if (op_flags & OPT_D)
366
        opts |= RCLMON_NOFORK;
363
        opts |= RCLMON_NOFORK;
367
    if (op_flags & OPT_x)
364
    if (op_flags & OPT_x)
368
        opts |= RCLMON_NOX11;
365
        opts |= RCLMON_NOX11;
369
  if (startMonitor(config, opts))
366
  bool monret = startMonitor(config, opts);
370
      exit(0);
367
  MONDEB(("Monitor returned %d, exiting\n", monret));
371
  exit(1);
368
  exit(monret == false);
372
#endif // MONITOR
369
#endif // MONITOR
373
370
374
#ifdef RCL_USE_ASPELL
371
#ifdef RCL_USE_ASPELL
375
    } else if (op_flags & OPT_S) {
372
    } else if (op_flags & OPT_S) {
376
    makeDbIndexer(config);
373
    makeDbIndexer(config);