ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/sourceinfo.h
Revision: 1.4
Committed: Thu Aug 30 19:56:20 2007 UTC (16 years, 9 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.3: +2 -2 lines
Log Message:
- put faultcodes into their own namespace
- removed old files
- limited header garbage in atheme.h
- macros to inline bools for connection_t::is_*
- put some connection_t functions into the connection_t class

File Contents

# Content
1 /*
2 * Copyright © 2006 Atheme Development Group
3 * Rights to this code are as documented in doc/pod/license.pod.
4 *
5 * Data structures for sourceinfo
6 *
7 * $Id: sourceinfo.h,v 1.3 2007-08-28 17:08:07 pippijn Exp $
8 */
9
10 #ifndef SOURCEINFO_H
11 #define SOURCEINFO_H
12
13 struct sourceinfo_vtable
14 {
15 const char *description;
16 void (*cmd_fail) (sourceinfo_t *si, fault::code code, char const * const message);
17 void (*cmd_success_nodata) (sourceinfo_t *si, char const * const message);
18 void (*cmd_success_string) (sourceinfo_t *si, char const * const result, char const * const message);
19 };
20
21 /* structure describing data about a protocol message or service command */
22 struct sourceinfo_t
23 {
24 /* fields describing the source of the message */
25 /* for protocol modules, the following applies to su and s:
26 * at most one of these two can be non-NULL
27 * before server registration, both are NULL, otherwise exactly
28 * one is NULL.
29 * for services commands, s is always NULL and su is non-NULL if
30 * and only if the command was received via IRC.
31 */
32 user_t *su; /* source, if it's a user */
33 server_t *s; /* source, if it's a server */
34
35 connection_t *connection; /* physical connection cmd received from */
36 const char *sourcedesc; /* additional information (e.g. IP address) */
37 myuser_t *smu; /* login associated with source */
38
39 service_t *service; /* destination service */
40
41 channel_t *c; /* channel this command applies to (fantasy?) */
42
43 struct sourceinfo_vtable *v; /* function pointers, could be NULL */
44 void *callerdata; /* opaque data pointer for caller */
45 };
46
47 #endif