os_info.c File Reference

#include "module.h"

Include dependency graph for os_info.c:

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 Documentation

#define AUTHOR   "Rob"

Definition at line 21 of file os_info.c.

#define DEFAULT_DB_NAME   "os_info.db"

Definition at line 25 of file os_info.c.

#define LANG_NUM_STRINGS   10

Definition at line 28 of file os_info.c.

#define OCINFO_ADD_SUCCESS   4

Definition at line 34 of file os_info.c.

Referenced by myAddChanInfo().

#define OCINFO_DEL_SUCCESS   5

Definition at line 35 of file os_info.c.

Referenced by myAddChanInfo().

#define OCINFO_HELP   7

Definition at line 37 of file os_info.c.

Referenced by mChanHelp().

#define OCINFO_HELP_CMD   9

Definition at line 39 of file os_info.c.

Referenced by mMainChanHelp().

#define OCINFO_SYNTAX   3

Definition at line 33 of file os_info.c.

Referenced by myAddChanInfo().

#define OINFO_ADD_SUCCESS   1

Definition at line 31 of file os_info.c.

Referenced by myAddNickInfo().

#define OINFO_DEL_SUCCESS   2

Definition at line 32 of file os_info.c.

Referenced by myAddNickInfo().

#define OINFO_HELP   6

Definition at line 36 of file os_info.c.

Referenced by mNickHelp().

#define OINFO_HELP_CMD   8

Definition at line 38 of file os_info.c.

Referenced by mMainNickHelp().

#define OINFO_SYNTAX   0

Definition at line 30 of file os_info.c.

Referenced by myAddNickInfo().

#define VERSION   "$Id: os_info.c 1391 2008-04-06 15:07:31Z rob $"

Definition at line 22 of file os_info.c.


Function Documentation

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 
)

void m_AddLanguages ( void   ) 

manages the multilanguage stuff

int mBackupData ( int  argc,
char **  argv 
)

Backup our databases using the commands provided by Anope

Returns:
MOD_CONT

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

Returns:
MOD_CONT

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.

Returns:
0 for success

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

Returns:
0 for success

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

Returns:
0 for success

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.

Parameters:
u The user who executed this command
Returns:
MOD_CONT if we want to process other commands in this command stack, MOD_STOP if we dont

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.

Parameters:
u The user who executed this command
Returns:
MOD_CONT if we want to process other commands in this command stack, MOD_STOP if we dont

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

Parameters:
u The user who requested info
Returns:
MOD_CONT to continue processing commands or MOD_STOP to stop

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]

Parameters:
u The user who requested info
Returns:
MOD_CONT to continue processing commands or MOD_STOP to stop

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().


Variable Documentation

char* OSInfoDBName = NULL

Definition at line 43 of file os_info.c.

Referenced by AnopeFini(), mBackupData(), mLoadConfig(), and mSaveData().


Generated on Sun Oct 5 09:07:07 2008 for Anope by  doxygen 1.5.7.1