ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/src/global.C
Revision: 1.1
Committed: Thu Jul 19 08:24:57 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-2007 Atheme Development Group.
3     * Rights to this code are documented in doc/LICENSE.
4     *
5     * Global objects.
6     */
7    
8     static char const rcsid[] = "$Id";
9    
10     #include "atheme.h"
11     #include "uplink.h"
12     #include "pmodule.h" /* pcommand_init */
13     #include "internal.h"
14     #include "datastream.h"
15     #include "authcookie.h"
16    
17     chansvs_t chansvs;
18     globsvs_t globsvs;
19     opersvs_t opersvs;
20     memosvs_t memosvs;
21     nicksvs_t nicksvs;
22     saslsvs_t saslsvs;
23     gamesvs_t gamesvs;
24    
25     me_t me;
26     struct cnt cnt;
27    
28     /* XXX */
29     ConfOption config_options;
30     Database database_options;
31     claro_state_t claro_state;
32     int runflags;
33    
34     char *config_file;
35     char *log_path;
36     bool cold_start = false;
37    
38     extern char **environ;
39    
40     void (*db_save) (void *arg) = NULL;
41     void (*db_load) (void) = NULL;
42    
43     me_t &
44     me_t::operator = (const me_t &rhs)
45     {
46     recontime = rhs.recontime;
47     restarttime = rhs.restarttime;
48     netname = sstrdup (rhs.netname);
49     hidehostsuffix = sstrdup (rhs.hidehostsuffix);
50     adminname = sstrdup (rhs.adminname);
51     adminemail = sstrdup (rhs.adminemail);
52     mta = rhs.mta ? sstrdup (rhs.mta) : NULL;
53     maxlogins = rhs.maxlogins;
54     maxusers = rhs.maxusers;
55     maxnicks = rhs.maxnicks;
56     maxchans = rhs.maxchans;
57     emaillimit = rhs.emaillimit;
58     emailtime = rhs.emailtime;
59     auth = rhs.auth;
60    
61     return *this;
62     }
63    
64     me_t::~me_t ()
65     {
66     destroy ();
67     }
68    
69     void
70     me_t::destroy ()
71     {
72     free (netname);
73     free (hidehostsuffix);
74     free (adminname);
75     free (adminemail);
76     if (mta != NULL)
77     free (mta);
78     }