ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/privs.h
(Generate patch)

Comparing ermyth/include/privs.h (file contents):
Revision 1.4 by pippijn, Sun Sep 16 18:54:42 2007 UTC vs.
Revision 1.5 by pippijn, Sat Sep 22 14:27:26 2007 UTC

7 * 7 *
8 * Portions of this file were derived from sources bearing the following license: 8 * Portions of this file were derived from sources bearing the following license:
9 * Copyright © 2005 Jilles Tjoelker, et al. 9 * Copyright © 2005 Jilles Tjoelker, et al.
10 * Rights to this code are as documented in doc/pod/license.pod. 10 * Rights to this code are as documented in doc/pod/license.pod.
11 * 11 *
12 * $Id: privs.h,v 1.4 2007/09/16 18:54:42 pippijn Exp $ 12 * $Id: privs.h,v 1.5 2007/09/22 14:27:26 pippijn Exp $
13 */ 13 */
14 14
15#ifndef PRIVS_H 15#ifndef PRIVS_H
16#define PRIVS_H 16#define PRIVS_H
17
18#include <util/containers.h>
17 19
18#define PRIV_NONE NULL 20#define PRIV_NONE NULL
19 21
20/* nickserv/userserv */ 22/* nickserv/userserv */
21#define PRIV_USER_AUSPEX "user:auspex" 23#define PRIV_USER_AUSPEX "user:auspex"
54#define AC_IRCOP "special:ircop" 56#define AC_IRCOP "special:ircop"
55#define AC_SRA "general:admin" 57#define AC_SRA "general:admin"
56 58
57struct operclass_t : zero_initialised 59struct operclass_t : zero_initialised
58{ 60{
61 unsigned index;
62 typedef indexing_vector<operclass_t> list_type;
63 /* privs.c */
64 static list_type list;
65
59 char *name; 66 char *name;
60 char *privs; /* priv1 priv2 priv3... */ 67 char *privs; /* priv1 priv2 priv3... */
61 int flags; 68 int flags;
62}; 69};
63 70
64#define OPERCLASS_NEEDOPER 0x1 /* only give privs to IRCops */ 71#define OPERCLASS_NEEDOPER 0x1 /* only give privs to IRCops */
65 72
66/* soper list struct */ 73/* soper list struct */
67struct soper_t : zero_initialised 74struct soper_t : zero_initialised
68{ 75{
76 unsigned index;
77 typedef indexing_vector<soper_t> list_type;
78 /* privs.c */
79 static list_type list;
80
69 myuser_t *myuser; 81 myuser_t *myuser;
70 char *name; 82 char *name;
71 operclass_t *operclass; 83 operclass_t *operclass;
72 char *classname; 84 char *classname;
73 int flags; 85 int flags;
74}; 86};
75 87
76#define SOPER_CONF 0x1 /* oper is listed in atheme.conf */ 88#define SOPER_CONF 0x1 /* oper is listed in atheme.conf */
77 89
78/* privs.c */
79E list_t operclasslist;
80E list_t soperlist;
81
82E void init_privs (void); 90E void init_privs (void);
83 91
84E operclass_t *operclass_add (char *name, char const *privs); 92E operclass_t *operclass_add (char *name, char const *privs);
85E void operclass_delete (operclass_t *operclass); 93E void operclass_delete (operclass_t *operclass);
86E operclass_t *operclass_find (char const * const name); 94E operclass_t *operclass_find (char const * const name);
95E void operclass_cleanup ();
87 96
88E soper_t *soper_add (char *name, char *classname, int flags); 97E soper_t *soper_add (char *name, char *classname, int flags);
89E void soper_delete (soper_t *soper); 98E void soper_delete (soper_t *soper);
90E soper_t *soper_find (myuser_t *myuser); 99E soper_t *soper_find (myuser_t *myuser);
91E soper_t *soper_find_named (char *name); 100E soper_t *soper_find_named (char *name);
101E void soper_cleanup ();
92 102
93E bool is_soper (myuser_t *myuser); 103E bool is_soper (myuser_t *myuser);
94E bool is_conf_soper (myuser_t *myuser); 104E bool is_conf_soper (myuser_t *myuser);
95 105
96/* has_any_privs(): used to determine whether we should give detailed 106/* has_any_privs(): used to determine whether we should give detailed

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines