From 4440a86cfa359b8e40a484a2cd46d33db5455d8a Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Mon, 25 May 2020 20:09:04 +0200 Subject: Initial --- irc/help.c | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 irc/help.c (limited to 'irc/help.c') diff --git a/irc/help.c b/irc/help.c new file mode 100644 index 0000000..71d3dfe --- /dev/null +++ b/irc/help.c @@ -0,0 +1,228 @@ +/************************************************************************ + * IRC - Internet Relay Chat, irc/help.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * + * 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef lint +static char rcsid[] = "@(#)$Id: help.c,v 1.2 1997/09/03 17:45:38 kalt Exp $"; +#endif + +#include "os.h" +#include "c_defines.h" +#define HELP_C +#include "c_externs.h" +#undef HELP_C + +struct Help helplist[] = { + { "ADMIN", "/ADMIN ", + { "Prints administrative information about an IRC server.", + " defaults to your own IRC server.", "", "", "" } }, + { "AWAY", "/AWAY ", + { " is a message that will be", + "automatically sent to anyone who tries sending you a private message.", + "If you are already marked as being away, /AWAY will change your status", + "back to \"here.\"", "" } }, + { "BYE", "/BYE", + { "Exit from IRC. /BYE, /EXIT, /QUIT and /SIGNOFF are identical.", + "", "", "", "" } }, + { "CHANNEL", "/CHANNEL ", + { "Leave the current channel and join a new one. Channel is any number", + "or a string beginning with a plus (+) sign. Numbered channels above 999", + "are private channels, you cannot see them by /LIST. Negative channels", + "are secret; they do not appear in /WHO at all. String channels are open", + "first, but the channel operators can change the mode with /MODE" } }, + { "CLEAR", "/CLEAR", + { "Clear your screen.", "", "", "", "" } }, + { "CMDCH", "/CMDCH ", + { "Changes your command prefix character to . This is useful if you", + "often start lines with slashes. For example, after typing \"/cmdch #\"", + "your commands would look like #who or #links.", "", "" } }, + { "DATE", "/DATE ", + { "Prints the date and time local to a specific server. defaults", + "to your own IRC server. /DATE and /TIME are identical.", "", "", "" } }, + { "EXIT", "/EXIT", + { "Exit from IRC. /BYE, /EXIT, /QUIT and /SIGNOFF are identical.", + "", "", "", "" } }, +#ifdef VMSP + { "EXEC", "/EXEC ", + { "Executes a CP/CMS command. If the command spends some time, you may", + "be signed off by the server. See UNKILL.", + "Warning: Screen is cleared after execcuting a command.", + "", "" } }, +#endif + { "HELP", "/HELP ", + { "/HELP without parameters lists all IRC commands.", + "/HELP followed by a command name prints a description of that command.", + "", "", "" } }, + { "IGNORE", "/IGNORE <+|->", + { "Allows you to automatically ignore messages from certain users. If", + "+ is specified before , only public messages are ignored.", + "Similarly, - ignores only private messages. If neither symbol is given", + "all messages are ignored. /IGNORE without parameters prints the current", + "list of ignored users." } }, + { "INFO", "/INFO", + { "Prints some information about IRC.", "", "", "", "" } }, + { "INVITE", "/INVITE ", + { "Invites a user to join your channel. The user must be currently using", + "IRC.", "", "", "" } }, + { "JOIN", "/JOIN {,} [{,}]", + { "Leave the current channel and join a new one. Channels above 999", + "are private channels; their numbers are not listed by /WHO. Negative", + "numbered channels are secret; they do not appear in /WHO at all.", + "/JOIN and /CHANNEL are identical.", "" } }, + { "KICK", "/KICK []", + { "Kicks specified user off given channel", + "Only channel operators are privileged to use this command", + "Channel operator privileges can be given to other users of channel", + "by command '/MODE +o ' and taken away by command", + "'/MODE -o '" } }, + { "LINKS", "/LINKS [ []]", + { "Lists all active IRC servers.", + "If is given, list all active irc links matching ", + "For example, /links *.fi lists all links in Finland", "", "" } }, + { "LIST", "/LIST", + { "Lists all active channels and, if set, their topics.", "", "", "", "" } }, + { "LUSERS", "/LUSERS", + { "Show the number of people and servers connected to the IRC network.", + "", "", "", "" } }, + { "LOG", "/LOG ", + { "Sends a copy of your IRC session to a file.", + "/LOG followed by a filename begins logging in the given file.", + "/LOG with no parameters turns logging off.", "", "" } }, + { "MSG", "/MSG ", + { "Send a private message. should be one or more nicknames or", + "channel numbers separated by commas (no spaces). If is \",\"", + "your message is sent to the last person who sent you a private message.", + "If is \".\" it's sent to the last personyou sent one to.", + "Messages sent to , or . can (currently) contain no other recipients." } }, + { "MODE", "/MODE [+|-] ", + { "Mode command is quite complicated and it allows channel operators to", + "change channel mode. is one of m (moderated), s (secret),", + "p (private), l (limited), t (topiclimited), a (anonymous), o (oper)", + "i (inviteonly). + or - sign whether the specifies mode should be added", + "or deleted. Parameter for l is the maximum users allowed" } }, + { "MOTD", "/MOTD ", + { "Query for message-of-today in given server. If parameter is", + "left out, query local server", "", "", "" } }, + { "NAMES", "/NAMES {,}", + { "/NAMES without a parameter lists the nicknames of users on all channels.", + "/NAMES followed by a channel number lists the names on that channel.", + "", "", "" } }, + { "NICK", "/NICK ", + { "Change your nickname. You cannot choose a nickname that is already in", + "use. Additionally, some characters cannot be used in nicknames.", + "", "", "" } }, + { "QUERY", "/QUERY ", + { "Begin private chat with . All subsequent messages you type", + "will be automatically sent only to . /QUERY without", + "parameters ends any current chat. You can send a normal message to your", + "channel by prefixing it with a slash and a space, like \"/ hi\".", "" } }, + { "QUIT", "/QUIT []", + { "Exit from IRC. /BYE, /EXIT, /QUIT and /SIGNOFF are identical.", + "", "", "", "" } }, + { "SERVER", "/SERVER ", + { "Disconnects from currect server and connects your client into a new", + "server specified in command line", "", "", "" } }, + { "SIGNOFF", "/SIGNOFF", + { "Exit from IRC. /BYE, /EXIT, /QUIT and /SIGNOFF are identical.", + "", "", "", "" } }, + { "STATS", "/STATS []", + { "Shows various IRC server statistics. This command is rather boring", + "", "", "", "" } }, + { "SUMMON", "/SUMMON []", + { "Ask a user to enter IRC. is of the form guest@tolsun.oulu.fi.", + "You can only summon users on machines where an IRC server is running.", + "Some servers may have disabled the /SUMMON command.", "", "" } }, + { "TIME", "/TIME ", + { "Prints the date and time local to a specific server. defaults", + "to your own IRC server. /DATE and /TIME are identical.", "", "", "" } }, + { "TOPIC", "/TOPIC []", + { "Sets the topic for the channel you're on.", "", "", "", "" } }, + { "UNKILL", "/UNKILL", + { "Orders to irc reconnect to server if you happen to become killed", + "accidentally or in purpose", "", "", "" } }, + { "USERS", "/USERS ", + { "List all users logged in to a host. The host must be running an IRC", + "server. Finger(1) usually works better.", "", "", "" } }, + { "VERSION", "/VERSION ", + { "Prints the version number of an IRC server. defaults to your", + "own IRC server.", "", "", "" } }, + { "WHO", "/WHO []", + { "/WHO without parameters lists users on all channels.", + "/WHO followed by a channel number lists users on that channel.", + "/WHO * lists users that are on the same channel as you.", + "You cannot see users that are on negative-numbered channels.", "" } }, + { "WHOIS", "/WHOIS {,}", + { "/WHOIS prints information about a particular user, including his or", + "her name, host name and IRC server. should be one of more", + "nicknames separated by commas.", "", "" } }, + { "WHOWAS", "/WHOWAS {,} [ []]", + { "/WHOWAS returns nickname history information for each of the given", + "nicknames.", "", "", "" } }, + { NULL, NULL, + { NULL, NULL, NULL, NULL, NULL } } +}; + +char helpbuf[80]; + +void do_help(ptr, temp) +char *ptr, *temp; +{ + struct Help *hptr; + int count; + + if (BadPtr(ptr)) { + sprintf(helpbuf, "*** Help: Internet Relay Chat v%s Commands:", version); + putline(helpbuf); + count = 0; + for (hptr = helplist; hptr->command; hptr++) { + sprintf(&helpbuf[count*10], "%10s", hptr->command); + if (++count >= 6) { + count = 0; + putline(helpbuf); + } + } + if (count) + putline(helpbuf); + putline("Type /HELP to get help about a particular command."); + putline("For example \"/HELP signoff\" gives you help about the"); + putline("/SIGNOFF command. To use a command you must prefix it with a"); + putline("slash or whatever your current command character is (see"); + putline("\"/HELP cmdch\""); + putline("*** End Help"); + } else { + for (hptr = helplist; hptr->command; hptr++) + if (mycncmp(ptr, hptr->command)) + break; + + if (hptr->command == (char *) 0) { + putline("*** There is no help information for that command."); + putline("*** Type \"/HELP\" to get a list of commands."); + return; + } + sprintf(helpbuf, "*** Help: %s", hptr->syntax); + putline(helpbuf); + for (count = 0; count < 5; count++) + if (hptr->explanation[count] && *(hptr->explanation[count])) { + sprintf(helpbuf, " %s", hptr->explanation[count]); + putline(helpbuf); + } + putline("*** End Help"); + } +} + -- cgit v1.2.3