db_lock.h

来自「一个C语言写的快速贝叶斯垃圾邮件过滤工具」· C头文件 代码 · 共 48 行

H
48
字号
/** \file db_lock.h * \brief header file for bogofilter's crash detector * \author Matthias Andree * \date 2004 * * GNU GPL v2 */#ifndef DB_LOCK_H#define DB_LOCK_H/* function prototypes *//** create and open lock file in \a bogohomedir * \return * - 0 for success * - -1 for error */int	init_dbl(const char *bogohomedir);/** set the next free lock cell and initialize the periodic crash * checker, which will _exit() the program when another process has * crashed. Requires that init_dbl() has been called before. \return * - 0 for success * - -2 if a process has just crashed * - -1 for error */int	set_lock(void);/** end the periodic crash checker and unlock our lock cell, and closes * the lock file. Requires that init_dbl() and set_lock() have been * called before. \return * - 0 for success * - -1 for error */int	clear_lock(void);/** reinitialize the lock file, which must pre-exist. Requires that * init_dbl() has been called before.  \return * - 0 for success * - -1 for error */int	clear_lockfile(void);/** checks if a process has crashed previously. Requires that init_dbl() * has been called before. \return * - 0 if no process has previously crashed * - 1 if a process has crashed previously. */int	needs_recovery(void);#endif /* DB_LOCK_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?