ff3154a57f8236325d4cbcfd48c77c458072e2ca
[citadel.git] / citadel / server / modules / checkpoint / serv_checkpoint.c
1 /*
2  * checkpointing module for the database
3  *
4  * Copyright (c) 1987-2022 by the citadel.org team
5  *
6  * This program is open source software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License, version 3.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  */
14  
15 #include "../../sysdep.h"
16 #include <stdlib.h>
17 #include <unistd.h>
18 #include <stdio.h>
19 #include <ctype.h>
20 #include <string.h>
21 #include <errno.h>
22
23 #include <libcitadel.h>
24
25 #include "../../citadel_defs.h"
26 #include "../../server.h"
27 #include "../../citserver.h"
28 #include "../../msgbase.h"
29 #include "../../sysdep_decls.h"
30 #include "../../config.h"
31 #include "../../threads.h"
32 #include "../../ctdl_module.h"
33 #include "../../context.h"
34
35 // Initialization function, called from modules_init.c
36 char *ctdl_module_init_checkpoint(void) {
37         if (threading) {
38                 CtdlRegisterSessionHook(cdb_checkpoint, EVT_TIMER, PRIO_CLEANUP + 10);
39         }
40         /* return our module name for the log */
41         return "checkpoint";
42 }