/* Copyright (C) 2003, 2004 IRCtoo Network, Pasi Hirvonen */ #ifndef _DATABASE_H_ #define _DATABASE_H_ /* open a connetion to the database, only call this * at startup. */ int database_init(void); /* close connection, call when closing */ void database_deinit(void); /* load channels (do this only once, at startup) */ int database_load_channels(void); /* add channel to database */ int database_add_channel(const char *, const char *, time_t); /* load cycles */ int database_load_cycles(void); /* remove channel from databse */ int database_del_channel(const char *); /* send out a channel list */ void database_list_channels_to(irc_user *, const char *); /* call at startup, load the spam strings. */ int database_load_spamstrs(void); /* add and remove spam strings to/from database. */ int database_add_spamstr(struct spam_str *); int database_del_spamstr(unsigned long); /* modify flags of an existing spam string. */ int database_modify_flags(struct spam_str *, int); /* update comment and reason */ int database_update_reason(unsigned long id, const char *reason); int database_update_comment(unsigned long id, const char *comment); int database_update_matchdata(unsigned long, unsigned long, time_t); /* adding a cycle */ int database_add_cycle(const char *chan, const int delay); int database_del_cycle(const char *chan); /* forbidden channels */ int database_add_forbid(const char *channel, const char *addedby, const char *reason); int database_del_forbid(const char *channel); int database_is_forbid(const char *channel, char *reason); /* list cycles and forbids */ void database_list_forbids_to(irc_user *user, const char *chan); void database_list_cycles_to(irc_user *user, const char *chan); #endif /* _DATABASE_H_ */