00001 /* 00002 * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). 00003 * handlers.h: A header for some built in command handlers. 00004 * 00005 * Copyright (C) 2002 by the past and present ircd coders, and others. 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 * USA 00021 * 00022 * $Id: handlers.h 33 2005-10-02 20:50:00Z knight $ 00023 */ 00024 00025 #ifndef INCLUDED_handlers_h 00026 #define INCLUDED_handlers_h 00027 00028 /* 00029 * m_functions execute protocol messages on this server: 00030 * int m_func(struct Client* client_p, struct Client* source_p, int parc, char* parv[]); 00031 * 00032 * client_p is always NON-NULL, pointing to a *LOCAL* client 00033 * structure (with an open socket connected!). This 00034 * identifies the physical socket where the message 00035 * originated (or which caused the m_function to be 00036 * executed--some m_functions may call others...). 00037 * 00038 * source_p is the source of the message, defined by the 00039 * prefix part of the message if present. If not 00040 * or prefix not found, then source_p==client_p. 00041 * 00042 * (!IsServer(client_p)) => (client_p == source_p), because 00043 * prefixes are taken *only* from servers... 00044 * 00045 * (IsServer(client_p)) 00046 * (source_p == client_p) => the message didn't 00047 * have the prefix. 00048 * 00049 * (source_p != client_p && IsServer(source_p) means 00050 * the prefix specified servername. (?) 00051 * 00052 * (source_p != client_p && !IsServer(source_p) means 00053 * that message originated from a remote 00054 * user (not local). 00055 * 00056 * 00057 * combining 00058 * 00059 * (!IsServer(source_p)) means that, source_p can safely 00060 * taken as defining the target structure of the 00061 * message in this server. 00062 * 00063 * *Always* true (if 'parse' and others are working correct): 00064 * 00065 * 1) source_p->from == client_p (note: client_p->from == client_p) 00066 * 00067 * 2) MyConnect(source_p) <=> source_p == client_p (e.g. source_p 00068 * *cannot* be a local connection, unless it's 00069 * actually client_p!). [MyConnect(x) should probably 00070 * be defined as (x == x->from) --msa ] 00071 * 00072 * parc number of variable parameter strings (if zero, 00073 * parv is allowed to be NULL) 00074 * 00075 * parv a NULL terminated list of parameter pointers, 00076 * 00077 * parv[0], sender (prefix string), if not present 00078 * this points to an empty string. 00079 * parv[1]...parv[parc-1] 00080 * pointers to additional parameters 00081 * parv[parc] == NULL, *always* 00082 * 00083 * note: it is guaranteed that parv[0]..parv[parc-1] are all 00084 * non-NULL pointers. 00085 */ 00086 00087 struct Client; 00088 00089 /* generic handlers */ 00090 extern void ms_error(struct Client *, struct Client *, int, char *[]); 00091 extern void m_error(struct Client *, struct Client *,int, char *[]); 00092 extern void m_ignore(struct Client *, struct Client *, int, char *[]); 00093 extern void m_not_oper(struct Client *, struct Client *, int, char *[]); 00094 extern void m_registered(struct Client *, struct Client *, int, char *[]); 00095 extern void m_unregistered(struct Client *, struct Client *, int, char *[]); 00096 00097 #endif /* INCLUDED_handlers_h */ 00098