partial fix of the NAT troubles
[oweals/gnunet.git] / HACKING
1 Naming conventions:
2
3 include files:
4 - _lib: library without need for a process
5 - _service: library that needs a service process
6 - _plugin: plugin definition
7 - _protocol: structs used in network protocol
8 - exceptions:
9   * gnunet_config.h      --- generated
10   * platform.h           --- first included
11   * plibc.h              --- external library
12   * gnunet_common.h      --- fundamental routines
13   * gnunet_directories.h --- generated
14   * gettext.h            --- external library
15
16
17 configuration:
18 - paths (that are substituted in all filenames) are in PATHS (have as few as possible)
19 - globals for the daemon are in [gnunetd] (for now, have as few as possible!)
20 - all options for a particular module (src/MODULE) are under [MODULE]
21 - options for a plugin of a module are under [MODULE-PLUGINNAME]
22 - options only for debugging / testing / profiling are under [TESTING],
23   together with the options for the testing module itself
24
25
26 exported symbols:
27 - must start with "GNUNET_modulename_" and be defined in "modulename.c"
28 - exceptions: those defined in gnunet_common.h
29
30
31 private (library-internal) symbols (including structs & macros):
32 - must NOT start with any prefix
33 - must not be exported in a way that linkers could use them or
34   other libraries might see them via headers; they must be either
35   declared/defined in C source files or in headers that are in 
36   the respective directory under src/modulename/ and NEVER be
37   declared in src/include/.
38
39 testcases:
40 - must be called "test_module-under-test_case-description.c"
41 - "case-description" maybe omitted if there is only one test
42
43
44 performance tests:
45 - must be called "perf_module-under-test_case-description.c"
46 - "case-description" maybe omitted if there is only one performance test
47 - Must only be run if HAVE_BENCHMARKS is satisfied
48
49
50 src/ directories:
51 - gnunet-NAME: end-user applications (i.e., gnunet-search, gnunet-arm)
52 - gnunet-service-NAME: service processes with accessor library (i.e., gnunet-service-arm)
53 - libgnunetNAME: accessor library (_service.h-header) or standalone library (_lib.h-header)
54 - gnunet-daemon-NAME: daemon process without accessor library (i.e., gnunet-daemon-hostlist) and no GNUnet management port
55 - libgnunet_plugin_DIR_NAME: loadable plugins (i.e., libgnunet_plugin_transport_tcp)
56
57
58 Coding style:
59 - GNU guidelines apply
60 - declare only one variable per line, so 
61
62   int i;
63   int j;
64
65   instead of
66
67   int i,j;
68
69
70 Build-system:
71
72 If you have code that is likely not to compile or build rules you might want to not
73 trigger for most developers, use "if HAVE_EXPERIMENTAL" in your Makefile.am.  Then
74 it is OK to (temporarily) add non-compiling (or known-to-not-port) code.
75
76 If you want to compile all testcases but NOT run them, run configure with the
77 --enable-test-suppression option.
78
79 If you want to run all testcases, including those that take a while, run configure with the
80 --enable-expensive-testcases option.
81
82 If you want to compile and run benchmarks, run configure with the
83 --enable-benchmarks option.
84
85 If you want to obtain code coverage results, run configure with the
86 --enable-coverage option and run the coverage.sh script in contrib/.
87
88
89 Minimum file-sharing system (in order of dependency):
90 gnunet-service-arm
91 gnunet-service-transport
92 gnunet-service-core
93 gnunet-daemon-hostlist
94 gnunet-daemon-topology
95 gnunet-service-statistics
96 gnunet-service-datastore
97 gnunet-service-datacache
98 gnunet-service-dht
99 gnunet-service-fs