Debian Codegraph @

include/sourceinfo.h

raw
1 /*
2 * Copyright (C) 2006 Atheme Development Group
3 * Rights to this code are as documented in doc/LICENSE.
4 *
5 * Data structures for sourceinfo
6 *
7 */
8
9 #ifndef SOURCEINFO_H
10 #define SOURCEINFO_H
11
12 struct sourceinfo_vtable
13 {
14 const char *description;
15 void (*cmd_fail)(sourceinfo_t *si, cmd_faultcode_t code, const char *message);
16 void (*cmd_success_nodata)(sourceinfo_t *si, const char *message);
17 void (*cmd_success_string)(sourceinfo_t *si, const char *result, const char *message);
18 void (*cmd_success_table)(sourceinfo_t *si, table_t *table);
19 const char *(*get_source_name)(sourceinfo_t *si);
20 const char *(*get_source_mask)(sourceinfo_t *si);
21 const char *(*get_oper_name)(sourceinfo_t *si);
22 const char *(*get_storage_oper_name)(sourceinfo_t *si);
23 };
24
25 /* structure describing data about a protocol message or service command */
26 struct sourceinfo_
27 {
28 object_t parent;
29
30 /* fields describing the source of the message */
31 /* for protocol modules, the following applies to su and s:
32 * at most one of these two can be non-NULL
33 * before server registration, both are NULL, otherwise exactly
34 * one is NULL.
35 * for services commands, s is always NULL and su is non-NULL if
36 * and only if the command was received via IRC.
37 */
38 user_t *su; /* source, if it's a user */
39 server_t *s; /* source, if it's a server */
40
41 connection_t *connection; /* physical connection cmd received from */
42 const char *sourcedesc; /* additional information (e.g. IP address) */
43 myuser_t *smu; /* login associated with source */
44
45 /* the service the original command was sent to, which may differ
46 * from the service the current command is in
47 */
48 service_t *service;
49
50 channel_t *c; /* channel this command applies to (fantasy?) */
51
52 struct sourceinfo_vtable *v; /* function pointers, could be NULL */
53 void *callerdata; /* opaque data pointer for caller */
54
55 unsigned int output_limit; /* if not 0, limit lines of output */
56 unsigned int output_count; /* lines of output upto now */
57
58 language_t *force_language; /* locale to force replies to be in, could be NULL */
59
60 command_t *command; /* The command being executed. Needed when one function handles
61 more than one command. */
62 };
63
64 #endif
65
66 /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
67 * vim:ts=8
68 * vim:sw=8
69 * vim:noexpandtab
70 */