|
a/src/common/rclinit.h |
|
b/src/common/rclinit.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _RCLINIT_H_INCLUDED_
|
17 |
#ifndef _RCLINIT_H_INCLUDED_
|
18 |
#define _RCLINIT_H_INCLUDED_
|
18 |
#define _RCLINIT_H_INCLUDED_
|
19 |
/* @(#$Id: rclinit.h,v 1.4 2006-09-08 09:02:47 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: rclinit.h,v 1.5 2006-11-08 07:22:14 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
|
|
22 |
#ifndef NO_NAMESPACES
|
|
|
23 |
using std::string;
|
|
|
24 |
#endif
|
22 |
|
25 |
|
23 |
class RclConfig;
|
26 |
class RclConfig;
|
24 |
|
27 |
/**
|
|
|
28 |
* Initialize by reading configuration, opening log file, etc.
|
|
|
29 |
*
|
|
|
30 |
* @param flags misc modifiers
|
|
|
31 |
* @param cleanup function to call before exiting (atexit)
|
|
|
32 |
* @param sigcleanup function to call on terminal signal (INT/HUP...) This
|
|
|
33 |
* should typically set a flag which tells the program (recoll,
|
|
|
34 |
* recollindex etc.. to exit as soon as possible (after closing the db,
|
|
|
35 |
* etc.). cleanup will then be called by exit().
|
|
|
36 |
* @param reason in case of error: output string explaining things
|
|
|
37 |
* @param argcnf Configuration directory name from the command line (overriding
|
|
|
38 |
* default and environment
|
|
|
39 |
* @return the parsed configuration.
|
|
|
40 |
*/
|
|
|
41 |
enum RclInitFlags {RCLINIT_NONE=0, RCLINIT_DAEMON=1};
|
|
|
42 |
extern RclConfig *recollinit(RclInitFlags flags,
|
|
|
43 |
void (*cleanup)(void), void (*sigcleanup)(int),
|
|
|
44 |
string &reason, const string *argcnf = 0);
|
25 |
extern RclConfig *recollinit(void (*cleanup)(void), void (*sigcleanup)(int),
|
45 |
inline RclConfig *recollinit(void (*cleanup)(void), void (*sigcleanup)(int),
|
26 |
std::string &reason,
|
46 |
string &reason, const string *argcnf = 0) {
|
27 |
const std::string *argcnf = 0);
|
47 |
return recollinit(RCLINIT_NONE, cleanup, sigcleanup, reason, argcnf);
|
|
|
48 |
}
|
28 |
|
49 |
|
29 |
#endif /* _RCLINIT_H_INCLUDED_ */
|
50 |
#endif /* _RCLINIT_H_INCLUDED_ */
|