Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

string.h

Go to the documentation of this file.
00001 
00011 /*
00012  * Copyright (c) 2001 James Hess
00013  * All rights reserved.
00014  *
00015  * Redistribution and use in source and binary forms, with or without
00016  * modification, are permitted provided that the following conditions
00017  * are met:
00018  * 1. Redistributions of source code must retain the above copyright
00019  *    notice, this list of conditions and the following disclaimer.
00020  * 2. Redistributions in binary form must reproduce the above copyright
00021  *    notice, this list of conditions and the following disclaimer in the
00022  *    documentation and/or other materials provided with the distribution.
00023  * 3. Neither the name of the authors nor the names of its contributors
00024  *    may be used to endorse or promote products derived from this software
00025  *    without specific prior written permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
00028  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
00031  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00032  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00033  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00034  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00035  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00036  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00037  * SUCH DAMAGE.
00038  */
00039 
00040 #ifndef __string_h__
00041 #define __string_h__
00042 
00046 #define PutError(cs, ct, rn, n1, n2, n3) \
00047         reply(cs, ct, rn, n1, n2, n3)
00048 
00052 #define PutReply(cs, ct, rn, n1, n2, n3) \
00053         reply(cs, ct, rn, n1, n2, n3)
00054 
00059 #define PutHelpInfo(cs, ct, n1) \
00060         reply(cs, ct, RPL_MSGFORHELP, cs, n1, 0)
00061 
00062 struct _userlist;
00063 
00064 void reply(const char *cService, struct _userlist *cTo, int replyNum, ...);
00065 
00066 typedef enum
00067 {
00068    _dummy_item_hst_
00069 } help_show_type;
00070 
00074 typedef enum
00075 {
00076 /*00*/  ERR_NEEDREGNICK_1ARG,
00077     ERR_NICKNOTREG_1ARG,
00078     ERR_NICKBANISHED_1ARG,
00079     ERR_NOAHURTBYPASS,
00080     ERR_BADPW,
00081     ERR_NOACCESS,
00082     ERR_NOTIDENTIFIED,
00083     ERR_AKILLSYNTAX_1ARG,
00084     RPL_AKILLHELP_2ARG,
00085 
00086     RPL_SWITCHIS_ARG2,
00087     RPL_SWITCHNOW_ARG2,
00088     RPL_AHURTBYPASS,
00089     RPL_BYPASSISLOGGED,
00090     RPL_IDENTIFYOK_NOARG,
00091     RPL_IDENTIFYOK_NICKARG,
00092     RPL_CHKEY_DEAD,
00093     RPL_MSGFORHELP,
00094     RPL_MASKHELP,
00095 
00096     RPL_AUTH_TYPES,
00097     RPL_AUTH_SEED,
00098     RPL_AUTH_OK_0ARG,
00099     RPL_AUTH_OK_1ARG,
00100     RPL_AUTH_NORESPONSE,
00101     ERR_AUTH_CHAL,
00102     ERR_AUTH_NOTREGISTERED_2ARG,
00103     ERR_AUTH_BAD_1ARG,
00104     ERR_AUTH_NOTYPE,
00105 
00106     RPL_INFONLINE_ID,
00107     RPL_INFONLINE_NOID,
00108     RPL_NS_BANISH,
00109     RPL_NS_ENDINFO,
00110 
00111     RPL_IS_GREET_1ARG,
00112     RPL_IS_COPYRIGHT_1ARG,
00113     RPL_IS_NEWITEM,
00114     RPL_IS_NEWITEMS_1ARG,
00115     RPL_IS_HOWTOLIST,
00116     ERR_IS_UNKNOWNCMD_1ARG,
00117     ERR_IS_NEEDPARAM,
00118     ERR_IS_NEEDNUM,
00119     ERR_IS_NOARTICLE_ARG1,
00120     ERR_IS_NOARTICLES,
00121     RPL_IS_END_OF_LIST,
00122     RPL_IS_READ_HELP,
00123     ERR_IS_NEEDIMPORTANCE,
00124     ERR_IS_TOOLONG,
00125     RPL_IS_POSTED,
00126     RPL_IS_DELETED_1ARG,
00127     ERR_CS_INVALIDCHAN_1ARG,
00128     ERR_CHANNOTREG_1ARG,
00129     ERR_INVALID_TRIGVAR,
00130 
00131     ERR_SERVICE_NEEDREGNICK_1ARG,
00132     RPL_DBSAVE_1ARG,
00133     ERR_NEEDMEMONUM_1ARG,
00134     RPL_MEMO_HEADER1_3ARG,
00135     ERR_NOSUCH_MEMO_1ARG,
00136     RPL_MEMO_SAVED_1ARG,
00137     ERR_NOMEMOS,
00138     RPL_MS_LIST_HEAD1,
00139     RPL_MS_LIST_HEAD2,
00140     RPL_MS_LIST_FOOT,
00141     ERR_MS_NEEDNICKCHANMEMO,
00142     ERR_NOTREG_1ARG,
00143     ERR_MS_NOACCESS_1ARG,
00144     ERR_MS_TOOLONG_2ARG,
00145     RPL_MS_ALLDELETED_1ARG,
00146     RPL_MS_DELETED_1ARG,
00147     ERR_MS_DEL_SPECIFYMEMO,
00148     ERR_MS_BADINDEXNUMBER,
00149     RPL_MS_CLEAN_2ARG,
00150     ERR_MS_NOTFORWARD,
00151     RPL_MS_FORWARD_OFF,
00152     ERR_MS_FORWARD_SYNTAX_1ARG,
00153     ERR_BADPW_NICK_1ARG,
00154     RPL_MS_FORWARD_ON_1ARG,
00155     ERR_MS_NOMEMO_NEEDONOFF,
00156     RPL_MS_NOMEMO_ON,
00157     RPL_MS_NOMEMO_OFF,
00158     ERR_MS_NOMEMO_BADPARAM,
00159     RPL_MS_UNSEND_HEAD1,
00160     RPL_MS_UNSEND_HEAD2,
00161     RPL_MS_UNSENT_ALL,
00162     RPL_MS_UNSENT_1ARG,
00163     ERR_MS_UNSEND_NOSUCH_1ARG,
00164     RPL_MS_MEMOWAITING,
00165     RPL_MS_MEMOWAITING_1ARG,
00166     RPL_MS_MEMO2_2ARG,
00167     RPL_MS_MEMO3_2ARG,
00168     RPL_MS_MEMO4n_2ARG,
00169     ERR_MS_MBLOCK_NONE,
00170     RPL_MS_MBLOCK_HEAD,
00171     ERR_MS_MBLOCK_BADPARAM_1ARG,
00172     ERR_MS_MBLOCK_NOCHANGE,
00173     ERR_MS_MBLOCK_NOSUCH_1ARG,
00174     RPL_MS_MBLOCK_DELETED_1ARG,
00175     RPL_MS_MBLOCK_ADDED_1ARG,
00176     ERR_MS_MBLOCK_ALREADY_1ARG,
00177     ERR_MS_MBLOCK_TOOMANY,
00178 
00179     MAX_REPLY_STRING_NUM
00180 } reply_type;
00181 
00182 struct reply_string {
00183     char *string;
00184     int numargs;
00185     int show_help;
00186 };
00187 
00188 #ifdef __string_cc__
00189 
00192 struct reply_string reply_table[] =
00193 {
00194 /*00*/  {"The nickname you are using, %s, is not registered.",
00195          1, 0},
00196     {"The nickname %s is not registered.", 1},
00197     {"Sorry, but the nickname %s is currently banished.", 1},
00198     {"\2NOTE\2 The nickname you are identifying to does not have "
00199      "the select ban bypass permission needed to nullify your banned "
00200      "status.", 0},
00201     {"Incorrect password."},
00202     {"Access denied"},
00203     {"You must be identified with NickServ to use this command.", 0},
00204     {"Syntax: %s <time/-> <nick!user@host> <reason>", 1},
00205     {"Improper format.  Try /msg %s help %s", 2},
00206 
00207     {"Your \2%s\2 switch is currently \2%s\2", 2},
00208     {"Your \2%s\2 switch is now \2%s\2", 2},
00209     {"You are now identified to a registered nick and are thereby "
00210      " bypassing the select ban on your site.", 0},
00211     {"Note that this has been logged, and any abuse of the network from "
00212      "the nickname may result in removal of your bypass access.", 0},
00213 
00214     {"Password accepted -- you are now identified", 0},
00215     {"Password accepted for nick \2%s\2.", 1},
00216     {"Warning: SENDPASS had been used to mail you a password recovery "
00217      "key.  Since you have identified, that key is no longer valid.", 1},
00218     {"Try /msg %s %s for more information", 1},
00219     {"See '/msg %s HELP ACCESS' and '/msg %s HELP ADDMASK' for information on host-based recognition.", 2},
00220 
00221     {"200 MD5 PLAIN"},
00222     {"205 S/MD5 1.0 %x:%x"},
00223     {"210 - Authentication accepted -- you are now identified.", 0},
00224     {"210 - Authentication accepted for nick \2%s\2.", 1},
00225     {"215 - Missing response."},
00226     {"300 - You need to ask me for a challenge first."},
00227     {"500 - The %s %s is not registered.", 2},
00228     {"500 - Invalid authentication for nick %s.", 1},
00229     {"510 - That authentication type is not available."},
00230 
00231 
00232     {"%s is online and identified. (Acc %d)"},
00233     {"%s is online but not identified. (Acc %d)"},
00234     {"%s is banished and cannot be used."},
00235     {"End of Info"},
00236     {"%s"},
00237     {"Services version %s (c) Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, and Dafydd James 1996-2001"},
00238     {"A news item was posted since you last read the list, type "
00239      "\2/msg infoserv list\2 if you wish to examine the list of "
00240      "articles."},
00241     {"%d news items have been posted since you last read the list, "
00242      "type \2/msg infoserv list\2 if you wish to examine the list of"
00243      " articles."},
00244     {"\2/INFOSERV LIST\2 to see the list of news articles. "
00245      " Type \2/INFOSERV HELP\2 for more information."},
00246     {"Unknown command %s."},
00247     {"Not enough parameters."},
00248     {"Please specify an article *number*"},
00249     {"There is no article number %d."},
00250     {"There are no articles in the database right now."},
00251     {"End of list"},
00252     {"Type \2/msg infoserv read <number>\2 to view an article."},
00253     {"Please specify a numeric importance level (0-5)."},
00254     {"Posting too long:"},
00255     {"Article posted."},
00256     {"News article %d has been deleted."},
00257 
00258     {"Invalid channel name, %s."},
00259     {"%s is not registered."},
00260     {"Invalid trigger variable."},
00261 
00262     {"You nick must be registered to use %s."},
00263     {"Next database synch(save) in %ld minutes."},
00264     {"You must specify a memo to %s."},
00265     {"Memo (%3i) from: %s to: %s"},
00266     {"No such memo (%i)"},
00267     {"Memo %3i saved."},
00268     {"You have no memos."},
00269     {"Memos:"},
00270     {"  # Time Sent                  Flags From"},
00271     {"End of Memo List"},
00272     {"You must specify a nick/channel and memo to send."},
00273     {"%s is not registered."},
00274     {"You do not have access to send memos to %s"},
00275     {"Your memo (%d) was too long.  All memos must be %d characters or shorter."},
00276     {"All%s memos marked as deleted."},
00277     {"Memo %i marked as deleted."},
00278     {"You must specify a specific memo, or \"all\", \"read\""},
00279     {"Please use a proper index number"},
00280     {"%u of %u memos cleared from your MemoBox"},
00281     {"You're not currently auto-forwarding memos"},
00282     {"Your memos are no longer auto-forwarded"},
00283     {"Your ``%s'' request did not fit any valid syntax."},
00284     {"Incorrect password for nick %s"},
00285     {"Your memos are now forwarded to %s automatically."},
00286     {"You must specify either ON or OFF. See \"/msg %s help nomemo\" for details."},
00287     {"You will no longer receive memos."},
00288     {"You can now receive memos again."},
00289     {"Invalid parameter. /msg %s help nomemo for help"},
00290     {"Memos from you:"},
00291     {"  # Time Sent                  Flags To"},
00292     {"All sent memos deleted."},
00293     {"Removed memo %d."},
00294     {"Memo %d does not exist."},
00295     {"You have 1 memo waiting."},
00296     {"You have %u memos waiting."},
00297     {"%3u unread.   %3u saved."},
00298     {"%3u forward.  %3u replies."},
00299     {"%3u marked as deleted.  To clear these:  /msg %s purge"},
00300     {"You have no memo blocks."},
00301     {"Now listing blocked memo senders:"},
00302     {"Invalid parameter. /msg %s help mblock for help."},
00303     {"No changes made to memo sender block list."},
00304     {"You do not have a memo block in place for %s"},
00305     {"Memo block removed for %s. You may now receive memos from this user again."},
00306     {"New memo block in place for %s. You will no longer receive memos from this user."},
00307     {"You already have a memo block in place for %s"},
00308     {"Unable to comply. You have too many Memo Blocks in place already. Consider \"/msg MemoServ NOMEMO ON\""}
00309 };
00310 #else
00311 extern struct reply_string reply_table[];
00312 #endif
00313 
00314 const char* get_reply(reply_type reply);
00315 
00316 #endif /* __string_h__ */

Generated at Sat Oct 25 20:56:09 2003 for Services using Doxygen.
Services Copyr. 1996-2001 Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, Dafydd James. All rights reserved See LICENSE for licensing information.