static struct UserInfo *userinfo_create(char *);
static void userinfo_free(struct UserInfo *source);
-static void m_ping(char **, unsigned int, char *, struct UserInfo *);
-static void m_invite(char **, unsigned int, char *, struct UserInfo *);
-static void m_privmsg(char **, unsigned int, char *, struct UserInfo *);
-static void m_ctcp(char **, unsigned int, char *, struct UserInfo *);
-static void m_notice(char **, unsigned int, char *, struct UserInfo *);
-static void m_perform(char **, unsigned int, char *, struct UserInfo *);
-static void m_userhost(char **, unsigned int, char *, struct UserInfo *);
-static void m_cannot_join(char **, unsigned int, char *, struct UserInfo *);
-static void m_kill(char **, unsigned int, char *, struct UserInfo *);
-
-extern struct cnode *nc_head;
+static void m_ping(char *[], unsigned int, char *, struct UserInfo *);
+static void m_invite(char *[], unsigned int, char *, struct UserInfo *);
+static void m_privmsg(char *[], unsigned int, char *, struct UserInfo *);
+static void m_ctcp(char *[], unsigned int, char *, struct UserInfo *);
+static void m_notice(char *[], unsigned int, char *, struct UserInfo *);
+static void m_perform(char *[], unsigned int, char *, struct UserInfo *);
+static void m_userhost(char *[], unsigned int, char *, struct UserInfo *);
+static void m_cannot_join(char *[], unsigned int, char *, struct UserInfo *);
+static void m_kill(char *[], unsigned int, char *, struct UserInfo *);
+
/*
* Certain variables we don't want to allocate memory for over and over
log_printf("IRC -> Timeout awaiting data from server.");
irc_reconnect();
- /* Make sure we dont do this again for a while */
+ /* Make sure we don't do this again for a while */
time(&IRC_LAST);
}
else if (delta >= IRCItem->readtimeout / 2)
{
/*
- * Generate some data so high ping times or bugs in certain
- * ircds (*cough* unreal *cough*) don't cause uneeded
+ * Generate some data so high ping times don't cause uneeded
* reconnections
*/
irc_send("PING :HOPM");
* the source (parv[0]) is a server.
*/
static void
-m_perform(char **parv, unsigned int parc, char *msg, struct UserInfo *notused)
+m_perform(char *parv[], unsigned int parc, char *msg, struct UserInfo *notused)
{
node_t *node;
* the source (parv[0]) is a server.
*/
static void
-m_ping(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p)
+m_ping(char *parv[], unsigned int parc, char *msg, struct UserInfo *source_p)
{
if (parc < 3)
return;
* the source (parv[0]) is a server.
*/
static void
-m_invite(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p)
+m_invite(char *parv[], unsigned int parc, char *msg, struct UserInfo *source_p)
{
- struct ChannelConf *channel;
+ struct ChannelConf *channel = NULL;
if (parc < 4)
return;
* the source (parv[0]) is a server.
*/
static void
-m_privmsg(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p)
+m_privmsg(char *parv[], unsigned int parc, char *msg, struct UserInfo *source_p)
{
- struct ChannelConf *channel;
+ struct ChannelConf *channel = NULL;
size_t nick_len;
if (source_p == NULL)
*
*/
static void
-m_ctcp(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p)
+m_ctcp(char *parv[], unsigned int parc, char *msg, struct UserInfo *source_p)
{
if (strncasecmp(parv[3], "\001VERSION\001", 9) == 0)
irc_send("NOTICE %s :\001VERSION Hybrid Open Proxy Monitor %s\001",
*
*/
static void
-m_notice(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p)
+m_notice(char *parv[], unsigned int parc, char *msg, struct UserInfo *source_p)
{
static regex_t *preg = NULL;
regmatch_t pmatch[5];
int errnum;
char *user[4];
- if (parc < 4)
- return;
-
/* Not interested in notices from users */
if (source_p)
return;
+ if (parc < 4)
+ return;
+
/* Compile the regular expression if it has not been already */
if (preg == NULL)
{
*
*/
static void
-m_userhost(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p)
+m_userhost(char *parv[], unsigned int parc, char *msg, struct UserInfo *source_p)
{
if (parc < 4)
return;
*
*/
static void
-m_cannot_join(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p)
+m_cannot_join(char *parv[], unsigned int parc, char *msg, struct UserInfo *source_p)
{
const struct ChannelConf *channel = NULL;
*
*/
static void
-m_kill(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p)
+m_kill(char *parv[], unsigned int parc, char *msg, struct UserInfo *source_p)
{
/* Restart hopm to rehash */
main_restart();
static list_t *MASKS = NULL; /* Associative list of masks->scanners */
-/* Negative Cache */
-struct cnode *nc_head;
-
-
/* Function declarations */
-
-struct scan_struct *scan_create(char **, char *);
-void scan_free(struct scan_struct *);
+static struct scan_struct *scan_create(char *[], char *);
+static void scan_free(struct scan_struct *);
static void scan_irckline(struct scan_struct *, const char *, const char *);
static void scan_negative(struct scan_struct *);
static void scan_log(OPM_REMOTE_T *);
*
*/
void
-scan_connect(char **user, char *msg)
+scan_connect(char *user[], char *msg)
{
struct sockaddr_in ip;
node_t *p, *p2;
* Return: Pointer to new scan_struct
*
*/
-struct scan_struct *
-scan_create(char **user, char *msg)
+static struct scan_struct *
+scan_create(char *user[], char *msg)
{
struct scan_struct *ss = xcalloc(sizeof *ss);
*
* Return: NONE
*/
-void
+static void
scan_free(struct scan_struct *ss)
{
if (ss == NULL)
ss->irc_nick, ss->irc_username, ss->irc_hostname);
/* Scan was a negative */
- if (!ss->positive)
+ if (ss->positive == 0)
scan_negative(ss);
}