/** * services.h: Data structures related to services psuedo-clients. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2005 William Pitcock, et al. * Rights to this code are as documented in doc/pod/license.pod. * * $Id: services.h,v 1.6 2007/09/16 18:54:42 pippijn Exp $ */ #ifndef SERVICES_H #define SERVICES_H #include #include // service base class struct svs_t { char *nick; /* the IRC client's nickname */ char *user; /* the IRC client's username */ char *host; /* the IRC client's hostname */ char *real; /* the IRC client's realname */ char *disp; /* the IRC client's dispname */ service_t *me; /* our service struct */ }; /* core services */ struct chansvs_t : svs_t { bool fantasy; /* enable fantasy commands */ unsigned int ca_vop; /* xop access levels */ unsigned int ca_hop; unsigned int ca_aop; unsigned int ca_sop; char *trigger; /* trigger, e.g. !, ` or . */ bool changets; /* use TS to better deop people */ time_t expiry; /* expiry time */ unsigned maxchanacs; /* max entries in chanacs list */ unsigned maxfounders; /* max founders per channel */ }; struct globsvs_t : svs_t { }; struct opersvs_t : svs_t { }; struct memosvs_t : svs_t { }; struct gamesvs_t : svs_t { }; /* authentication services */ struct nicksvs_t : svs_t { bool spam; bool no_nick_ownership; time_t expiry; /* expiry time */ }; struct saslsvs_t : svs_t { }; /* help us keep consistent messages */ #define STR_INSUFFICIENT_PARAMS _("Insufficient parameters for \2%s\2.") #define STR_INVALID_PARAMS _("Invalid parameters for \2%s\2.") /* global.C */ E chansvs_t chansvs; E globsvs_t globsvs; E opersvs_t opersvs; E memosvs_t memosvs; E gamesvs_t gamesvs; E nicksvs_t nicksvs; E saslsvs_t saslsvs; /* servtree.c */ E service_t *fcmd_agent; /* services.c */ typedef std::pair service_pair; typedef std::map service_map; E service_map services; E unsigned authservice_loaded; E int use_myuser_access; E int use_svsignore; E int ban (user_t *source, channel_t *chan, user_t *target); E int remove_banlike (user_t *source, channel_t *chan, int type, user_t *target); E int remove_ban_exceptions (user_t *source, channel_t *chan, user_t *target); E void join (char const * const chan, char const * const nick); E void joinall (char *name); E void part (char *chan, char *nick); E void partall (char *name); E void verbose (mychan_t *mychan, char const * const fmt, ...); E void snoop (char const * const fmt, ...); E void notice (char const * const from, char const * const to, char const * const message, ...); E void notice (char const * const from, char const * const to, char const * const message, va_list va); E void command_fail (sourceinfo_t *si, fault::code code, char const * const fmt, ...); E void command_success_nodata (sourceinfo_t *si, char const * const fmt, ...); E void command_success_string (sourceinfo_t *si, char const * const result, char const * const fmt, ...); E void command_success_table (sourceinfo_t *si, table_t * table); E char const * const get_source_name (sourceinfo_t *si); E char const * const get_source_mask (sourceinfo_t *si); E char const * const get_oper_name (sourceinfo_t *si); E void wallops (char const * const , ...); E void verbose_wallops (char const * const, ...); /* ptasks.c */ E void handle_topic (channel_t *c, char const * const setter, time_t ts, char const * const topic); E int floodcheck (user_t *u, user_t *t); /* ctcp-common.c */ E void common_ctcp_init (void); E unsigned int handle_ctcp_common (sourceinfo_t *si, char *, char *); #endif