summaryrefslogtreecommitdiff
path: root/src/list.c
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:10 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:10 +0000
commit431918ceacfd5a580d4f28a8ae6077c9bbc44b99 (patch)
tree27dcb4182ee1041f9160df28e3266165412285ae /src/list.c
parent2fd6bf39b1b018a7081fafd8350ea88f1b733ea5 (diff)
listnicks and listchans go away, as they aren't all that useful (and way too old.)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1201 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/list.c')
-rw-r--r--src/list.c196
1 files changed, 0 insertions, 196 deletions
diff --git a/src/list.c b/src/list.c
deleted file mode 100644
index c59bf9f5e..000000000
--- a/src/list.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/* Routines to handle `listnicks' and `listchans' invocations.
- *
- * (C) 2003-2008 Anope Team
- * Contact us at info@anope.org
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- * $Id$
- *
- */
-
-#include "services.h"
-
-/*************************************************************************/
-
-/**
- * List all register nicks
- * @param ac Number of Arguments
- * @param av Array if Arguments
- * @return void
- */
-void do_listnicks(int ac, char **av)
-{
- int count = 0; /* Count only rather than display? */
- int usage = 0; /* Display command usage? (>0 also indicates error) */
- int i;
-
- i = 1;
- while (i < ac) {
- if (av[i][0] == '-') {
- switch (av[i][1]) {
- case 'h':
- usage = -1;
- break;
- case 'c':
- if (i > 1)
- usage = 1;
- count = 1;
- break;
- case 'd':
- if (av[i][2]) {
- services_dir = av[i] + 2;
- } else {
- if (i >= ac - 1) {
- usage = 1;
- break;
- }
- ac--;
- memmove(av + i, av + i + 1, sizeof(char *) * ac - i);
- services_dir = av[i];
- }
- default:
- usage = 1;
- break;
- } /* switch */
- ac--;
- if (i < ac)
- memmove(av + i, av + i + 1, sizeof(char *) * ac - i);
- } else {
- if (count)
- usage = 1;
- i++;
- }
- }
- if (usage) {
- fprintf(stderr, "\
-\n\
-Usage: listnicks [-c] [-d data-dir] [nick [nick...]]\n\
- -c: display only count of registered nicks\n\
- (cannot be combined with nicks)\n\
- nick: nickname(s) to display information for\n\
-\n\
-If no nicks are given, the entire nickname database is printed out in\n\
-compact format followed by the number of registered nicks (with -c, the\n\
-list is suppressed and only the count is printed). If one or more nicks\n\
-are given, detailed information about those nicks is displayed.\n\
-\n");
- exit(usage > 0 ? 1 : 0);
- }
-
- if (chdir(services_dir) < 0) {
- fprintf(stderr, "chdir(%s): %s\n", services_dir, strerror(errno));
- ModuleRunTimeDirCleanUp();
- exit(1);
- }
- if (!read_config(0)) {
- ModuleRunTimeDirCleanUp();
- exit(1);
- }
- load_ns_dbase();
-
- lang_init();
-
- if (ac > 1) {
- for (i = 1; i < ac; i++)
- listnicks(0, av[i]);
- } else {
- listnicks(count, NULL);
- }
- exit(0);
-}
-
-/*************************************************************************/
-
-/**
- * List all register channels
- * @param ac Number of Arguments
- * @param av Array if Arguments
- * @return void
- */
-void do_listchans(int ac, char **av)
-{
- int count = 0; /* Count only rather than display? */
- int usage = 0; /* Display command usage? (>0 also indicates error) */
- int i;
-
- i = 1;
- while (i < ac) {
- if (av[i][0] == '-') {
- switch (av[i][1]) {
- case 'h':
- usage = -1;
- break;
- case 'c':
- if (i > 1)
- usage = 1;
- count = 1;
- break;
- case 'd':
- if (av[i][2]) {
- services_dir = av[i] + 2;
- } else {
- if (i >= ac - 1) {
- usage = 1;
- break;
- }
- ac--;
- memmove(av + i, av + i + 1, sizeof(char *) * ac - i);
- services_dir = av[i];
- }
- default:
- usage = 1;
- break;
- } /* switch */
- ac--;
- if (i < ac)
- memmove(av + i, av + i + 1, sizeof(char *) * ac - i);
- } else {
- if (count)
- usage = 1;
- i++;
- }
- }
- if (usage) {
- fprintf(stderr, "\
-\n\
-Usage: listchans [-c] [-d data-dir] [channel [channel...]]\n\
- -c: display only count of registered channels\n\
- (cannot be combined with channels)\n\
-channel: channel(s) to display information for\n\
-\n\
-If no channels are given, the entire channel database is printed out in\n\
-compact format followed by the number of registered channels (with -c, the\n\
-list is suppressed and only the count is printed). If one or more channels\n\
-are given, detailed information about those channels is displayed.\n\
-\n");
- exit(usage > 0 ? 1 : 0);
- }
-
- if (chdir(services_dir) < 0) {
- fprintf(stderr, "chdir(%s): %s\n", services_dir, strerror(errno));
- ModuleRunTimeDirCleanUp();
- exit(1);
- }
- if (!read_config(0)) {
- ModuleRunTimeDirCleanUp();
- exit(1);
- }
- load_ns_dbase();
- load_cs_dbase();
-
- lang_init();
-
- if (ac > 1) {
- for (i = 1; i < ac; i++)
- listchans(0, av[i]);
- } else {
- listchans(count, NULL);
- }
- exit(0);
-}
-
-/*************************************************************************/