|
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.5 2006-11-08 07:22:14 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: rclinit.h,v 1.6 2007-05-21 13:30:21 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
22 |
#ifndef NO_NAMESPACES
|
22 |
#ifndef NO_NAMESPACES
|
23 |
using std::string;
|
23 |
using std::string;
|
24 |
#endif
|
24 |
#endif
|
25 |
|
25 |
|
26 |
class RclConfig;
|
26 |
class RclConfig;
|
27 |
/**
|
27 |
/**
|
28 |
* Initialize by reading configuration, opening log file, etc.
|
28 |
* Initialize by reading configuration, opening log file, etc.
|
|
|
29 |
*
|
|
|
30 |
* This must be called from the main thread before starting any others. It sets
|
|
|
31 |
* up the global signal handling. other threads must call recoll_threadinit()
|
|
|
32 |
* when starting.
|
29 |
*
|
33 |
*
|
30 |
* @param flags misc modifiers
|
34 |
* @param flags misc modifiers
|
31 |
* @param cleanup function to call before exiting (atexit)
|
35 |
* @param cleanup function to call before exiting (atexit)
|
32 |
* @param sigcleanup function to call on terminal signal (INT/HUP...) This
|
36 |
* @param sigcleanup function to call on terminal signal (INT/HUP...) This
|
33 |
* should typically set a flag which tells the program (recoll,
|
37 |
* should typically set a flag which tells the program (recoll,
|
|
... |
|
... |
44 |
string &reason, const string *argcnf = 0);
|
48 |
string &reason, const string *argcnf = 0);
|
45 |
inline RclConfig *recollinit(void (*cleanup)(void), void (*sigcleanup)(int),
|
49 |
inline RclConfig *recollinit(void (*cleanup)(void), void (*sigcleanup)(int),
|
46 |
string &reason, const string *argcnf = 0) {
|
50 |
string &reason, const string *argcnf = 0) {
|
47 |
return recollinit(RCLINIT_NONE, cleanup, sigcleanup, reason, argcnf);
|
51 |
return recollinit(RCLINIT_NONE, cleanup, sigcleanup, reason, argcnf);
|
48 |
}
|
52 |
}
|
|
|
53 |
// Threads need to call this. The main thread handles all signals.
|
|
|
54 |
extern void recoll_threadinit();
|
49 |
|
55 |
|
50 |
#endif /* _RCLINIT_H_INCLUDED_ */
|
56 |
#endif /* _RCLINIT_H_INCLUDED_ */
|