1 /* 2 * hook.h.proto: header for hook.c 3 * 4 * Copyright (c) 1990 Michael Sandrof. 5 * Copyright (c) 1991, 1992 Troy Rollo. 6 * Copyright (c) 1992-2000 Matthew R. Green. 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 3. The name of the author may not be used to endorse or promote products 18 * derived from this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 25 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33 /* 34 * NOTE: This file is automatically created! 35 * 36 * from: @(#) Id: hook.h.proto,v 1.28 2000/04/04 03:10:48 mrg Exp 37 * @(#)$Id: hook.h.proto,v 1.28 2000/04/04 03:10:48 mrg Exp $ 38 */ 39 40 #ifndef __hook_h_ 41 # define __hook_h_ 42 43 /* Hook: The structure of the entries of the hook functions lists */ 44 typedef struct hook_stru 45 { 46 struct hook_stru *next; /* pointer to next element in list */ 47 u_char *nick; /* The Nickname */ 48 int not; /* If true, this entry should be 49 * ignored when matched, otherwise it 50 * is a normal entry */ 51 int noisy; /* flag indicating how much output 52 * should be given */ 53 int server; /* the server in which this hook 54 * applies. (-1 if none). If bit 0x1000 55 * is set, then no other hooks are 56 * tried in the given server if all the 57 * server specific ones fail 58 */ 59 int sernum; /* The serial number for this hook. This 60 * is used for hooks which will be 61 * concurrent with others of the same 62 * pattern. The default is 0, which 63 * means, of course, no special 64 * behaviour. If any 1 hook suppresses 65 * the * default output, output will be 66 * suppressed. 67 */ 68 u_char *stuff; /* The this that gets done */ 69 int global; /* set if loaded from `global' */ 70 } Hook; 71 72 /* HookFunc: A little structure to keep track of the various hook functions */ 73 typedef struct 74 { 75 char *name; /* name of the function */ 76 Hook *list; /* pointer to head of the list for this 77 * function */ 78 int params; /* number of parameters expected */ 79 int mark; 80 unsigned flags; 81 } HookFunc; 82 83 /* 84 * NumericList: a special list type to dynamically handle numeric hook 85 * requests 86 */ 87 typedef struct numericlist_stru 88 { 89 struct numericlist_stru *next; 90 char *name; 91 Hook *list; 92 } NumericList; 93 94 #define ACTION_LIST 0 95 #define CHANNEL_NICK_LIST 1 96 #define CHANNEL_SIGNOFF_LIST 2 97 #define CONNECT_LIST 3 98 #define CTCP_LIST 4 99 #define CTCP_REPLY_LIST 5 100 #define DCC_CHAT_LIST 6 101 #define DCC_CONNECT_LIST 7 102 #define DCC_ERROR_LIST 8 103 #define DCC_LOST_LIST 9 104 #define DCC_RAW_LIST 10 105 #define DCC_REQUEST_LIST 11 106 #define DISCONNECT_LIST 12 107 #define ENCRYPTED_NOTICE_LIST 13 108 #define ENCRYPTED_PRIVMSG_LIST 14 109 #define EXEC_LIST 15 110 #define EXEC_ERRORS_LIST 16 111 #define EXEC_EXIT_LIST 17 112 #define EXEC_PROMPT_LIST 18 113 #define EXIT_LIST 19 114 #define FLOOD_LIST 20 115 #define HELP_LIST 21 116 #define HOOK_LIST 22 117 /* 118 * Ninja does not support ICB 119 #define ICB_STATUS_LIST X 120 #define ICB_ERROR_LIST X 121 */ 122 #define IDLE_LIST 23 123 #define INPUT_LIST 24 124 #define INVITE_LIST 25 125 #define JOIN_LIST 26 126 #define KICK_LIST 27 127 #define LEAVE_LIST 28 128 #define LIST_LIST 29 129 #define MAIL_LIST 30 130 #define MODE_LIST 31 131 #define MSG_LIST 32 132 #define MSG_GROUP_LIST 33 133 #define NAMES_LIST 34 134 #define NICKNAME_LIST 35 135 #define NOTE_LIST 36 136 #define NOTICE_LIST 37 137 #define NOTIFY_SIGNOFF_LIST 38 138 #define NOTIFY_SIGNON_LIST 39 139 #define PUBLIC_LIST 40 140 #define PUBLIC_MSG_LIST 41 141 #define PUBLIC_NOTICE_LIST 42 142 #define PUBLIC_OTHER_LIST 43 143 #define RAW_IRC_LIST 44 144 #define SEND_ACTION_LIST 45 145 #define SEND_DCC_CHAT_LIST 46 146 #define SEND_MSG_LIST 47 147 #define SEND_NOTICE_LIST 48 148 #define SEND_PUBLIC_LIST 49 149 #define SEND_TALK_LIST 50 150 #define SERVER_NOTICE_LIST 51 151 #define SIGNOFF_LIST 52 152 #define TALK_LIST 53 153 #define TIMER_LIST 54 154 #define TOPIC_LIST 55 155 #define WALL_LIST 56 156 #define WALLOP_LIST 57 157 #define WHO_LIST 58 158 #define WIDELIST_LIST 59 159 #define WINDOW_LIST 60 160 #define WINDOW_KILL_LIST 61 161 #define WINDOW_SWAP_LIST 62 162 #define NUMBER_OF_LISTS 63 163 164 #ifdef HAVE_STDARG_H 165 int do_hook _((int, char *, ...)); 166 #else 167 int do_hook _(()); 168 #endif /* HAVE_STDARG_H */ 169 void on _((u_char *, u_char *, u_char *)); 170 void save_hooks _((FILE *, int)); 171 void remove_hook _((int, u_char *, int, int, int)); 172 void show_hook _((Hook *, char *)); 173 174 extern u_char *hook_info; 175 extern NumericList *numeric_list; 176 extern HookFunc hook_functions[]; 177 178 extern int in_on_who; 179 180 #endif /* __hook_h_ */ 181