|
a/src/common/rclconfig.cpp |
|
b/src/common/rclconfig.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.25 2006-03-29 11:18:14 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.26 2006-03-29 13:08:08 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
|
|
... |
|
... |
15 |
* You should have received a copy of the GNU General Public License
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the
|
16 |
* along with this program; if not, write to the
|
17 |
* Free Software Foundation, Inc.,
|
17 |
* Free Software Foundation, Inc.,
|
18 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
18 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
19 |
*/
|
19 |
*/
|
|
|
20 |
#ifndef TEST_RCLCONFIG
|
20 |
#include <unistd.h>
|
21 |
#include <unistd.h>
|
21 |
#include <stdio.h>
|
22 |
#include <stdio.h>
|
22 |
#include <errno.h>
|
23 |
#include <errno.h>
|
23 |
#include <langinfo.h>
|
24 |
#include <langinfo.h>
|
24 |
|
25 |
|
|
... |
|
... |
382 |
if (r.stopsuffixes)
|
383 |
if (r.stopsuffixes)
|
383 |
stopsuffixes = new std::list<std::string>(*(r.stopsuffixes));
|
384 |
stopsuffixes = new std::list<std::string>(*(r.stopsuffixes));
|
384 |
defcharset = r.defcharset;
|
385 |
defcharset = r.defcharset;
|
385 |
guesscharset = r.guesscharset;
|
386 |
guesscharset = r.guesscharset;
|
386 |
}
|
387 |
}
|
|
|
388 |
|
|
|
389 |
#else // -> Test
|
|
|
390 |
|
|
|
391 |
#include <stdio.h>
|
|
|
392 |
#include <signal.h>
|
|
|
393 |
#include <sys/stat.h>
|
|
|
394 |
|
|
|
395 |
#include <iostream>
|
|
|
396 |
#include <list>
|
|
|
397 |
#include <string>
|
|
|
398 |
|
|
|
399 |
using namespace std;
|
|
|
400 |
|
|
|
401 |
#include "debuglog.h"
|
|
|
402 |
#include "rclinit.h"
|
|
|
403 |
#include "rclconfig.h"
|
|
|
404 |
|
|
|
405 |
int main(int, const char **)
|
|
|
406 |
{
|
|
|
407 |
string reason;
|
|
|
408 |
RclConfig *config = recollinit(0, 0, reason);
|
|
|
409 |
if (config == 0 || !config->ok()) {
|
|
|
410 |
cerr << "Configuration problem: " << reason << endl;
|
|
|
411 |
exit(1);
|
|
|
412 |
}
|
|
|
413 |
list<string> names = config->getConfNames("");
|
|
|
414 |
names.sort();
|
|
|
415 |
names.unique();
|
|
|
416 |
for (list<string>::iterator it = names.begin(); it != names.end();it++) {
|
|
|
417 |
string value;
|
|
|
418 |
config->getConfParam(*it, value);
|
|
|
419 |
cout << *it << " -> [" << value << "]" << endl;
|
|
|
420 |
}
|
|
|
421 |
}
|
|
|
422 |
|
|
|
423 |
#endif // TEST_RCLCONFIG
|