#include "services.h"
#include "nickserv.h"
#include "chanserv.h"
#include "db.h"
#include "hash/md5pw.h"
#include "memoserv.h"
#include "macro.h"
#include "hash.h"
#include "queue.h"
#include "log.h"
#include "infoserv.h"
Go to the source code of this file.
Defines | |
#define | NS_DIR "nickserv/" |
#define | CS_DIR "chanserv/" |
#define | OS_DIR "operserv/" |
#define | MS_DIR "memoserv/" |
#define | IS_DIR "infoserv/" |
#define | NS_DB NS_DIR"nickserv.db" |
#define | CS_DB CS_DIR"chanserv.db" |
#define | MS_DB MS_DIR"memoserv.db" |
#define | TRG_DB OS_DIR"trigger.db" |
#define | AKI_DB OS_DIR"akill.db" |
#define | IS_DB IS_DIR"infoserv.db" |
Functions | |
void | AppendBuffer (char **p, const char *) |
char * | str_dup (const char *) |
Allocates and returns a copy of the supplied string. | |
void | unexpected_eof (const char *file_name) |
Handle an unexpected EOF in database file error. | |
char * | dbReadString (FILE *fp) |
void | dbWriteString (FILE *fp, const char *istr) |
void | saveNickData (void) |
Saves the NickServ database to disk. | |
void | readNickData () |
Loads the NickServ database from disk. | |
void | saveChanUrls (RegChanList *first) |
Saves the URLS of channels to urls.txt. | |
void | saveChanData (RegChanList *first) |
Saves the ChanServ database to disk. | |
void | readChanData () |
Loads the ChanServ database from disk. | |
void | saveMemoData (void) |
Saves the Memo database to disk. | |
void | readMemoData (void) |
Loads the memo database from disk. | |
void | saveTriggerData (void) |
Saves the Clone rule database to disk. | |
void | readTriggerData (void) |
Loads the clone rule database from disk. | |
void | saveInfoData (void) |
Saves the InfoServ database to disk. | |
void | readInfoData (void) |
Loads the InfoServ database from disk. | |
void | sync_cfg (char *type) |
Periodic synchronizations (saves) of various databases. | |
Variables | |
RegId | top_regnick_idnum |
char | cryptstr [PASSLEN+2] |
Working crypt variable. | |
char | dbLine [2048] |
parse_t | state |
Parse state information for reading database files. |
Procedures for saving/loading the various services database files
Max Byrd
Greg Poma
James Hess
Definition in file db.c.
|
|
|
Definition at line 113 of file db.c. References AppendBuffer(), assert, and database_struct::is. Referenced by readInfoData(). |
|
Definition at line 144 of file db.c. References assert, parse_getarg(), and str_dup(). Referenced by saveInfoData(). |
|
Loads the ChanServ database from disk.
Definition at line 625 of file db.c. References addChanAkick(), addChanOp(), cakicklist_struct::added, addRegChan(), CENCRYPT, ChanServ, database_struct::cs, dbLine, fromBase64(), getRegChanData(), getRegNickData(), initRegChanData(), cakicklist_struct::mask, mostchans, caccesslist_struct::nickId, oalloc(), parse_getarg(), cakicklist_struct::reason, sSend(), sshutdown(), state, strncpyzt, caccesslist_struct::uflags, unexpected_eof(), and xorit(). Referenced by main(). |
|
Loads the InfoServ database from disk. There was still a crash bug in what was here before... cleaning this up .. allocate memory when it's needed, don't allocate it in the beginning and give it up later if superflous in a linked list load. -Mysidia
Definition at line 1213 of file db.c. References dbLine, dbReadString(), Newsitem::importance, database_struct::is, is_last_post_time, is_listhead, Newsitem::next, oalloc(), parse_getarg(), SomeNews, sshutdown(), state, strncpyzt, and unexpected_eof(). Referenced by main(). |
|
Loads the memo database from disk.
Definition at line 919 of file db.c. References memoblocklist_struct::blockId, dbLine, DEBUGCHAN, _memolist::flags, _memolist::from, getRegNickData(), LIST_ENTRY_INIT, LIST_INSERT_HEAD, MEMO_UNREAD, MemoServ, _memolist::memotxt, database_struct::ms, memoblocklist_struct::next, oalloc(), parse_getarg(), _memolist::realto, _memolist::sent, sSend(), sshutdown(), state, strncpyzt, _memolist::to, and unexpected_eof(). Referenced by readNickData(). |
|
Loads the NickServ database from disk.
Definition at line 262 of file db.c. References ADD_MEMO_BOX, addAccItem(), addOpData(), addRegNick(), assert, corelog, dbLine, DEBUGCHAN, fromBase64(), getRegNickData(), logDump(), NENCRYPT, database_struct::ns, oalloc(), OROOT, OSERVOP, parse_getarg(), readMemoData(), SetDynBuffer(), sSend(), sshutdown(), state, strncpyzt, unexpected_eof(), and xorit(). Referenced by main(). |
|
Loads the clone rule database from disk.
Definition at line 1102 of file db.c. References AddCrule(), CloneRule, corelog, dbLine, DEBUGCHAN, trigger_rule::flags, trigger_rule::kill_msg, logDump(), trigger_rule::mask, NewCrule(), OperServ, parse_getarg(), sSend(), state, strncpyzt, database_struct::trigger, trigger_rule::trigger, unexpected_eof(), trigger_rule::utrigger, and trigger_rule::warn_msg. Referenced by main(). |
|
Saves the InfoServ database to disk.
Definition at line 1177 of file db.c. References Newsitem::content, corelog, dbWriteString(), Newsitem::from, Newsitem::header, Newsitem::importance, InfoServ, database_struct::is, is_listhead, LOGCHAN, logDump(), myname, Newsitem::next, SomeNews, sSend(), and Newsitem::timestamp. Referenced by is_save(), and sshutdown(). |
|
Allocates and returns a copy of the supplied string.
|
|
Handle an unexpected EOF in database file error.
Definition at line 101 of file db.c. References corelog, logDump(), and sshutdown(). Referenced by readChanData(), readInfoData(), readMemoData(), readNickData(), and readTriggerData(). |
|
Working crypt variable. We'll set it up here as it is used in nearly all the functions
Definition at line 78 of file db.c. Referenced by saveChanData(), and saveNickData(). |
|
I don't know what you feel, but I think that having 2048 bytes allocated in static arrays all over is useless. Definition at line 85 of file db.c. Referenced by readChanData(), readInfoData(), readMemoData(), readNickData(), and readTriggerData(). |