aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/lists.h
blob: d53d7e0d273d7014f17a234b9efeee26e940ccca (plain)
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
/* lists.h */

#include <stdio.h>

#ifndef _LISTS_H
#define _LISTS_H

/* yes, it's all cheesy..  there is no significance to the order, but make
   sure it matches the order in lists.c */

enum ListWhich {L_ADMIN = 0, L_REMOVEDCOM, L_FILTER, L_BAN, L_ABUSER,
L_MUZZLE, L_CMUZZLE, L_FM, L_IM, L_GM, L_BLIND, L_TEAMS, L_COMPUTER,
L_TD, L_CENSOR, L_GNOTIFY, L_NOPLAY, L_NOTIFY, L_CHANNEL};

enum ListPerm {P_HEAD = 0, P_GOD, P_ADMIN, P_PUBLIC, P_PERSONAL};

typedef struct {enum ListPerm rights; char *name;} ListTable;

/* max. names in one list: 200 */
#define MAX_GLOBAL_LIST_SIZE 200

typedef struct _List List;

struct _List {
	enum ListWhich	 which;
	int		 numMembers;
	char		*member[MAX_GLOBAL_LIST_SIZE];
	struct _List	*next;
};

extern int	com_addlist();
extern int	com_showlist();
extern int	com_sublist();

extern int	in_list(int, enum ListWhich, char *);
extern int	list_add(int, enum ListWhich, char *);
extern int	list_addsub(int, char *, char *, int);
extern int	list_channels(int, int);
extern int	list_size(int, enum ListWhich);
extern int	list_sub(int, enum ListWhich, char *);
extern int	titled_player(int, char *);
extern void	list_free(List *);
extern void	list_print(FILE *, int, enum ListWhich);

#endif    /* _LISTS_H */