ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/pmodule.h
Revision: 1.1
Committed: Thu Jul 19 08:24:50 2007 UTC (16 years, 10 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Log Message:
initial import. the most important changes since Atheme are:
- fixed many memory leaks
- fixed many bugs
- converted to C++ and use more STL containers
- added a (not very enhanced yet) perl module
- greatly improved XML-RPC speed
- added a JSON-RPC module with code from json-cpp
- added a valgrind memcheck module to operserv
- added a more object oriented base64 implementation
- added a specialised unit test framework
- improved stability
- use gettimeofday() if available
- reworked adding/removing commands
- MemoServ IGNORE DEL can now remove indices

File Contents

# User Rev Content
1 pippijn 1.1 /*
2     * Copyright © 2005 William Pitcock, et al.
3     * Rights to this code are as documented in doc/LICENSE.
4     *
5     * Protocol module stuff.
6     * Modules usually do not need this.
7     *
8     * $Id: pmodule.h 8263 2007-05-17 22:31:56Z jilles $
9     */
10    
11     #ifndef PMODULE_H
12     #define PMODULE_H
13    
14     struct pcommand_t
15     {
16     char *token;
17     void (*handler) (sourceinfo_t *si, int parc, char *parv[]);
18     int minparc;
19     int sourcetype;
20     };
21    
22     /* values for sourcetype */
23     #define MSRC_UNREG 1 /* before SERVER is sent */
24     #define MSRC_USER 2 /* from users */
25     #define MSRC_SERVER 4 /* from servers */
26    
27     #define MAXPARC 35 /* max # params to protocol command */
28    
29     /* pmodule.c */
30     E BlockHeap *pcommand_heap;
31     E BlockHeap *messagetree_heap;
32     E dictionary_tree_t *pcommands;
33    
34     E bool pmodule_loaded;
35    
36     E void pcommand_init (void);
37     E void pcommand_add (char *token, void (*handler) (sourceinfo_t *si, int parc, char *parv[]), int minparc, int sourcetype);
38     E void pcommand_delete (char *token);
39     E pcommand_t *pcommand_find (char *token);
40    
41     /* ptasks.c */
42     E void handle_version (user_t *);
43     E void handle_admin (user_t *);
44     E void handle_info (user_t *);
45     E void handle_stats (user_t *, char);
46     E void handle_whois (user_t *, char *);
47     E void handle_trace (user_t *, char *, char *);
48     E void handle_motd (user_t *);
49     E void handle_away (user_t *, const char *);
50     E void handle_message (sourceinfo_t *, char *, bool, char *);
51     E void handle_topic_from (sourceinfo_t *, channel_t *, char *, time_t, char *);
52     E void handle_kill (sourceinfo_t *, char *, char const *);
53     E server_t *handle_server (sourceinfo_t *, const char *, const char *, int, const char *);
54     E void handle_eob (server_t *);
55     E bool should_reg_umode (user_t *);
56    
57     /* services.c */
58     E void services_init (void);
59     E void reintroduce_user (user_t *u);
60     E void handle_nickchange (user_t *u);
61     E void handle_burstlogin (user_t *u, char *login);
62    
63     #endif