This repository has been archived on 2025-02-12. You can view files and clone it, but cannot push or open issues or pull requests.
NeoStats-NeoIRCd/include/hook.h

96 lines
2.1 KiB
C
Raw Normal View History

2002-08-13 14:34:25 +00:00
/*
* NeoIRCd: NeoStats Group. Based on Hybird7
2002-08-13 14:34:25 +00:00
* hook.h: A header for the hooks into parts of ircd.
*
* Copyright (C) 2002 by the past and present ircd coders, and others.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: hook.h,v 1.4 2002/10/31 13:01:54 fishwaldo Exp $
2002-08-13 14:34:25 +00:00
*/
#ifndef __HOOK_H_INCLUDED
#define __HOOK_H_INCLUDED
#include "tools.h"
typedef struct
{
char *name;
dlink_list hooks;
} hook;
/* we don't define the arguments to hookfn, because they can
vary between different hooks */
typedef int (*hookfn)(void *data);
/* this is used when a hook is called by an m_function
stand data you'd need in that situation */
struct hook_mfunc_data
{
struct Client *client_p;
struct Client *source_p;
int parc;
char **parv;
};
struct hook_stats_data
{
struct Client *source_p;
char statchar;
char *name;
};
struct hook_links_data
{
struct Client *client_p;
struct Client *source_p;
int parc;
char **parv;
char statchar;
char *mask;
};
struct hook_spy_data
{
struct Client *source_p;
};
struct hook_io_data
{
struct Client *connection;
char *data;
unsigned int len;
};
struct hook_burst_channel
{
struct Client *client;
struct Channel *chptr;
};
int hook_add_event(char *);
int hook_add_hook(char *, hookfn *);
int hook_call_event(char *, void *);
int hook_del_event(char *);
int hook_del_hook(char *event, hookfn *fn);
void init_hooks(void);
hook *find_hook(char *);
2002-08-13 14:34:25 +00:00
#endif