-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.h
45 lines (37 loc) · 1.58 KB
/
commands.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Declarations for command data.
*
* Services is copyright (c) 1996-1999 Andy Church.
* E-mail: <[email protected]>
* This program is free but copyrighted software; see the file COPYING for
* details.
*/
/*************************************************************************/
/* Structure for information about a *Serv command. */
typedef struct {
const char *name;
void (*routine)(User *u);
int (*has_priv)(User *u); /* Returns 1 if user may use command, else 0 */
/* Regrettably, these are hard-coded to correspond to current privilege
* levels (v4.0). Suggestions for better ways to do this are
* appreciated.
*/
int helpmsg_all; /* Displayed to all users; -1 = no message */
int helpmsg_reg; /* Displayed to regular users only */
int helpmsg_oper; /* Displayed to Services operators only */
int helpmsg_admin; /* Displayed to Services admins only */
int helpmsg_root; /* Displayed to Services root only */
const char *help_param1;
const char *help_param2;
const char *help_param3;
const char *help_param4;
} Command;
/*************************************************************************/
/* Routines for looking up commands. Command lists are arrays that must be
* terminated with a NULL name.
*/
extern Command *lookup_cmd(Command *list, const char *name);
extern void run_cmd(const char *service, User *u, Command *list,
const char *name);
extern void help_cmd(const char *service, User *u, Command *list,
const char *name);
/*************************************************************************/