2 * IRC - Internet Relay Chat, ircd/map.c
3 * Copyright (C) 1994 Carlo Wood ( Run @ undernet.org )
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 static void dump_map(aClient *cptr, aClient *server, char *mask,
38 static char prompt[64];
40 register char *p = &prompt[prompt_length];
44 if (prompt_length > 60)
45 sendto_one(cptr, rpl_str(RPL_MAPMORE), me.name, cptr->name,
46 prompt, server->name);
48 sendto_one(cptr, rpl_str(RPL_MAP), me.name, cptr->name,
49 prompt, server->name);
50 if (prompt_length > 0)
56 if (prompt_length > 60)
59 for (lp = server->serv->down; lp; lp = lp->next)
60 if (match(mask, lp->value.cptr->name))
61 lp->value.cptr->flags &= ~FLAGS_MAP;
64 lp->value.cptr->flags |= FLAGS_MAP;
67 for (lp = server->serv->down; lp; lp = lp->next)
69 if ((lp->value.cptr->flags & FLAGS_MAP) == 0)
73 dump_map(cptr, lp->value.cptr, mask, prompt_length + 2);
75 if (prompt_length > 0)
82 * parv[0] = sender prefix
83 * parv[1] = server mask
85 int m_map(aClient *UNUSED(cptr), aClient *sptr, int parc, char *parv[])
90 dump_map(sptr, &me, parv[1], 0);
91 sendto_one(sptr, rpl_str(RPL_MAPEND), me.name, parv[0]);