#include "module.h"
Go to the source code of this file.
Defines | |
| #define | AUTHOR "Rob" |
| #define | VERSION "$Id: os_info.c 1391 2008-04-06 15:07:31Z rob $" |
| #define | DEFAULT_DB_NAME "os_info.db" |
| #define | LANG_NUM_STRINGS 10 |
| #define | OINFO_SYNTAX 0 |
| #define | OINFO_ADD_SUCCESS 1 |
| #define | OINFO_DEL_SUCCESS 2 |
| #define | OCINFO_SYNTAX 3 |
| #define | OCINFO_ADD_SUCCESS 4 |
| #define | OCINFO_DEL_SUCCESS 5 |
| #define | OINFO_HELP 6 |
| #define | OCINFO_HELP 7 |
| #define | OINFO_HELP_CMD 8 |
| #define | OCINFO_HELP_CMD 9 |
Functions | |
| int | myAddNickInfo (User *u) |
| int | myAddChanInfo (User *u) |
| int | myNickInfo (User *u) |
| int | myChanInfo (User *u) |
| int | mNickHelp (User *u) |
| int | mChanHelp (User *u) |
| void | mMainChanHelp (User *u) |
| void | mMainNickHelp (User *u) |
| void | m_AddLanguages (void) |
| int | mLoadData (void) |
| int | mSaveData (int argc, char **argv) |
| int | mBackupData (int argc, char **argv) |
| int | mLoadConfig () |
| int | mEventReload (int argc, char **argv) |
| int | AnopeInit (int argc, char **argv) |
| void | AnopeFini (void) |
Variables | |
| char * | OSInfoDBName = NULL |
| #define OCINFO_ADD_SUCCESS 4 |
| #define OCINFO_DEL_SUCCESS 5 |
| #define OCINFO_HELP 7 |
| #define OCINFO_HELP_CMD 9 |
| #define OCINFO_SYNTAX 3 |
| #define OINFO_ADD_SUCCESS 1 |
| #define OINFO_DEL_SUCCESS 2 |
| #define OINFO_HELP 6 |
| #define OINFO_HELP_CMD 8 |
| #define OINFO_SYNTAX 0 |
| #define VERSION "$Id: os_info.c 1391 2008-04-06 15:07:31Z rob $" |
| void AnopeFini | ( | void | ) |
Unload the module
Definition at line 121 of file os_info.c.
References EVENT_START, mSaveData(), OSInfoDBName, and sstrdup().
| int AnopeInit | ( | int | argc, | |
| char ** | argv | |||
| ) |
AnopeInit is called when the module is loaded
| argc | Argument count | |
| argv | Argument list |
Definition at line 70 of file os_info.c.
References alog(), AUTHOR, c, CHANSERV, createCommand(), createEventHook(), EVENT_DB_BACKUP, EVENT_DB_SAVING, EVENT_RELOAD, is_oper(), m_AddLanguages(), mBackupData(), mChanHelp(), mEventReload(), mLoadConfig(), mLoadData(), mMainChanHelp(), mMainNickHelp(), mNickHelp(), MOD_CONT, MOD_HEAD, MOD_STOP, MOD_TAIL, moduleAddAuthor(), moduleAddCommand(), moduleAddEventHook(), moduleAddHelp(), moduleAddVersion(), moduleSetChanHelp(), moduleSetNickHelp(), moduleSetType(), mSaveData(), myAddChanInfo(), myAddNickInfo(), myChanInfo(), myNickInfo(), NICKSERV, SUPPORTED, and VERSION.
| void m_AddLanguages | ( | void | ) |
manages the multilanguage stuff
| int mBackupData | ( | int | argc, | |
| char ** | argv | |||
| ) |
Backup our databases using the commands provided by Anope
Definition at line 460 of file os_info.c.
References MOD_CONT, ModuleDatabaseBackup(), and OSInfoDBName.
Referenced by AnopeInit().
| int mChanHelp | ( | User * | u | ) |
Definition at line 752 of file os_info.c.
References is_oper(), MOD_CONT, moduleNoticeLang(), notice_lang(), OCINFO_HELP, and s_ChanServ.
Referenced by AnopeInit().
| int mEventReload | ( | int | argc, | |
| char ** | argv | |||
| ) |
Manage the RELOAD EVENT
Definition at line 501 of file os_info.c.
References alog(), EVENT_START, mLoadConfig(), MOD_CONT, and stricmp().
Referenced by AnopeInit().
| int mLoadConfig | ( | void | ) |
Load the configuration directives from Services configuration file.
Definition at line 471 of file os_info.c.
References alog(), DEFAULT_DB_NAME, moduleGetConfigDirective(), OSInfoDBName, PARAM_RELOAD, PARAM_STRING, and sstrdup().
| int mLoadData | ( | void | ) |
Load data from the db file, and populate our OperInfo lines
| void mMainChanHelp | ( | User * | u | ) |
Definition at line 771 of file os_info.c.
References is_oper(), moduleNoticeLang(), OCINFO_HELP_CMD, and s_ChanServ.
Referenced by AnopeInit().
| void mMainNickHelp | ( | User * | u | ) |
Definition at line 763 of file os_info.c.
References is_oper(), moduleNoticeLang(), OINFO_HELP_CMD, and s_NickServ.
Referenced by AnopeInit().
| int mNickHelp | ( | User * | u | ) |
Definition at line 742 of file os_info.c.
References is_oper(), MOD_CONT, moduleNoticeLang(), notice_lang(), OINFO_HELP, and s_NickServ.
Referenced by AnopeInit().
| int mSaveData | ( | int | argc, | |
| char ** | argv | |||
| ) |
Save all our data to our db file First walk through the nick CORE list, and any nick core which has oper info attached to it, write to the file. Next do the same again for ChannelInfos
| int myAddChanInfo | ( | User * | u | ) |
Provide the user interface to add/remove/update oper information about a channel. We are going to assume that anyone who gets this far is an oper; the createCommand should have handled this checking for us and its tedious / a waste to do it twice.
| u | The user who executed this command |
Definition at line 215 of file os_info.c.
References cs_findchan(), MOD_CONT, moduleAddData(), chaninfo_::moduleData, moduleDelData(), moduleGetLastBuffer(), moduleNoticeLang(), myStrGetToken(), myStrGetTokenRemainder(), notice_lang(), OCINFO_ADD_SUCCESS, OCINFO_DEL_SUCCESS, OCINFO_SYNTAX, and s_ChanServ.
Referenced by AnopeInit().
| int myAddNickInfo | ( | User * | u | ) |
Provide the user interface to add/remove/update oper information about a nick. We are going to assume that anyone who gets this far is an oper; the createCommand should have handled this checking for us and its tedious / a waste to do it twice.
| u | The user who executed this command |
Definition at line 145 of file os_info.c.
References findnick(), MOD_CONT, moduleAddData(), nickcore_::moduleData, moduleDelData(), moduleGetLastBuffer(), moduleNoticeLang(), myStrGetToken(), myStrGetTokenRemainder(), nickalias_::nc, notice_lang(), OINFO_ADD_SUCCESS, OINFO_DEL_SUCCESS, OINFO_SYNTAX, and s_NickServ.
Referenced by AnopeInit().
| int myChanInfo | ( | User * | u | ) |
Called after a user does a /msg chanserv info chan
| u | The user who requested info |
Definition at line 317 of file os_info.c.
References cs_findchan(), is_oper(), MOD_CONT, chaninfo_::moduleData, moduleGetData(), moduleGetLastBuffer(), myStrGetToken(), notice_user(), and s_ChanServ.
Referenced by AnopeInit().
| int myNickInfo | ( | User * | u | ) |
Called after a user does a /msg nickserv info [nick]
| u | The user who requested info |
Definition at line 280 of file os_info.c.
References findnick(), is_oper(), MOD_CONT, nickcore_::moduleData, moduleGetData(), moduleGetLastBuffer(), myStrGetToken(), nickalias_::nc, notice_user(), and s_NickServ.
Referenced by AnopeInit().
| char* OSInfoDBName = NULL |
Definition at line 43 of file os_info.c.
Referenced by AnopeFini(), mBackupData(), mLoadConfig(), and mSaveData().
1.5.7.1