diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2012-11-19 21:28:28 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2012-11-19 21:28:28 +0000 |
commit | ed37ac064d4ce8611e2af0ddcf416139cd887395 (patch) | |
tree | 856da1e2110d27cb98aee2c7560ac5f58d95377e /include | |
parent | 3e1b0138a8d550aadee2e78b094f6dfb2a7a82aa (diff) |
- conf_db.c: import backup/restore cleanups from 5.1.24
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1668 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'include')
-rw-r--r-- | include/conf_db.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/include/conf_db.h b/include/conf_db.h index 8d8b5ef..7cdc555 100644 --- a/include/conf_db.h +++ b/include/conf_db.h @@ -1,7 +1,7 @@ /* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * - * Copyright (C) 1996-2002 by Andrew Church <achurch@achurch.org> + * Copyright (C) 1996-2009 by Andrew Church <achurch@achurch.org> * Copyright (C) 2012 by the Hybrid Development Team. * * This program is free software; you can redistribute it and/or modify @@ -30,21 +30,19 @@ struct dbFILE { - int mode; /**< 'r' for reading, 'w' for writing */ - FILE *fp; /**< The normal file descriptor */ - FILE *backupfp; /**< Open file pointer to a backup copy of - * the database file (if non-NULL) */ + char mode; /**< 'r' for reading, 'w' for writing */ + FILE *fp; /**< The file pointer itself */ char filename[PATH_MAX + 1]; /**< Name of the database file */ - char backupname[PATH_MAX + 1]; /**< Name of the backup file */ + char tempname[PATH_MAX + 1]; /**< Name of the temporary file (for writing) */ }; extern void check_file_version(struct dbFILE *); extern uint32_t get_file_version(struct dbFILE *); extern int write_file_version(struct dbFILE *, uint32_t); -extern struct dbFILE *open_db(const char *, const char *, const char *, uint32_t); +extern struct dbFILE *open_db(const char *, const char *, uint32_t); extern void restore_db(struct dbFILE *); /* Restore to state before open_db() */ -extern void close_db(struct dbFILE *); +extern int close_db(struct dbFILE *); extern void backup_databases(void); #define read_db(f,buf,len) (fread((buf),1,(len),(f)->fp)) |