ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/include/svsconfig.h
Revision: 1.2
Committed: Tue Aug 28 17:08:07 2007 UTC (19 years, 2 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.1: +12 -0 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# User Rev Content
1 pippijn 1.2 /*
2     * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
3     * Rights to this code are documented in doc/pod/gplicense.pod.
4     *
5     * Compile-time configuration and some sysconf #defines.
6     * dbg, the ermyth debug output, also lives in this file.
7     *
8     * $Id: stdinc.h,v 1.2 2007-07-21 01:29:07 pippijn Exp $
9     */
10    
11 pippijn 1.1 #ifndef CONFIG_H
12     #define CONFIG_H
13    
14 pippijn 1.2 #include <sysconf.h>
15    
16 pippijn 1.1 /* Compile-time configuration */
17    
18     #define PURE_ISO 1
19     #define DEBUG 1
20    
21     /* End configuration */
22    
23     #define E extern
24    
25     #if __GNUC__ >= 3
26     # define expect(expr,value) __builtin_expect ((expr),(value))
27     # define is_const(expr) __builtin_constant_p ((expr))
28     #else
29     # define expect(expr,value) (expr)
30     # define is_const(expr) 0
31     #endif
32    
33     #define expect_false(expr) expect ((expr) != 0, 0)
34     #define expect_true(expr) expect ((expr) != 0, 1)
35    
36     #if SIZEOF_TIME_T == SIZEOF_LONG
37     #define TTP "%ld"
38     #elif SIZEOF_TIME_T == SIZEOF_INT
39     #define TTP "%d"
40     #else
41     #error Size of time_t not known
42     #endif
43    
44     #if SIZEOF_SIZE_T == SIZEOF_INT
45     #define STP "%u"
46     #elif SIZEOF_SIZE_T == SIZEOF_LONG
47     #define STP "%lu"
48     #else
49     #error Size of size_t not known
50     #endif
51    
52     /**
53     * Debug stuff...
54     */
55     #ifndef DEBUG
56     # define DEBUG 0
57     #else
58     # define DEBUG 1
59     #endif
60     #ifndef CALLBACK_DEBUG
61     # define CALLBACK_DEBUG 0
62     #else
63     # define CALLBACK_DEBUG 1
64     #endif
65    
66     #include <iostream> // even needed when DEBUG is 0
67    
68     #if DEBUG
69     #ifdef __GNUC__
70     # define dbg std::cerr << __PRETTY_FUNCTION__ << ": " << std::dec << "#" << __LINE__ << ": "
71     #else
72     # define dbg std::cerr << __FILE__ << ": " << std::dec << "#" << __LINE__ << ": "
73     #endif
74     #else
75     # define dbg if (0) std::cerr
76     #endif
77    
78     #if CALLBACK_DEBUG
79     # ifdef __GNUC__
80     # define dout std::cerr << __PRETTY_FUNCTION__ << ": " << std::dec << "#" << __LINE__ << ": "
81     # else
82     # define dout std::cerr << __LINE__ << ": " << std::dec << "#" << __LINE__ << ": "
83     # endif
84     #else
85     # define dout if (0) std::cerr
86     #endif
87    
88     #endif // CONFIG_H