Back to index

citadel  8.12
serv_checkpoint.c
Go to the documentation of this file.
00001 /*
00002  * checkpointing module for the database
00003  *
00004  * Copyright (c) 1987-2011 by the citadel.org team
00005  *
00006  * This program is open source software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License as published
00008  * by the Free Software Foundation; either version 3 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00019  */
00020  
00021 #include "sysdep.h"
00022 #include <stdlib.h>
00023 #include <unistd.h>
00024 #include <stdio.h>
00025 #include <ctype.h>
00026 #include <string.h>
00027 #include <errno.h>
00028 #include <sys/types.h>
00029 #include <sys/stat.h>
00030 #include <dirent.h>
00031 
00032 #ifdef HAVE_DB_H
00033 #include <db.h>
00034 #elif defined(HAVE_DB4_DB_H)
00035 #include <db4/db.h>
00036 #else
00037 #error Neither <db.h> nor <db4/db.h> was found by configure. Install db4-devel.
00038 #endif
00039 
00040 
00041 #if DB_VERSION_MAJOR < 4 || DB_VERSION_MINOR < 1
00042 #error Citadel requires Berkeley DB v4.1 or newer.  Please upgrade.
00043 #endif
00044 
00045 #include <libcitadel.h>
00046 
00047 #include "citadel.h"
00048 #include "server.h"
00049 #include "citserver.h"
00050 #include "database.h"
00051 #include "msgbase.h"
00052 #include "sysdep_decls.h"
00053 #include "config.h"
00054 #include "threads.h"
00055 
00056 #include "ctdl_module.h"
00057 #include "context.h"
00058  
00059 
00060 
00061 CTDL_MODULE_INIT(checkpoint) {
00062        if (threading)
00063        {
00064               CtdlRegisterSessionHook(cdb_checkpoint, EVT_TIMER, PRIO_CLEANUP + 10);
00065        }
00066        /* return our module name for the log */
00067        return "checkpoint";
00068 }