X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=HACKING;h=6e7a3e50edd85ef03c800bfb5fd6b4d52c06cca6;hb=ab1bea7ea82a2ca7c98093d8c09e41ba67204164;hp=c24e6cceec87d5dc2c58eccf7fd86da0d08bc078;hpb=85a049155d73ab1001f417b0786b8aefbdd01fd2;p=oweals%2Fgnunet.git diff --git a/HACKING b/HACKING index c24e6ccee..6e7a3e50e 100644 --- a/HACKING +++ b/HACKING @@ -13,6 +13,33 @@ include files: * gnunet_directories.h --- generated * gettext.h --- external library + +binaries: +- gnunet-service-xxx: service process (has listen socket) +- gnunet-daemon-xxx: daemon process (no listen socket) +- gnunet-helper-xxx[-yyy]: SUID helper for module xxx +- gnunet-yyy: command-line tool for end-users +- libgnunet_plugin_xxx_yyy.so: plugin for API xxx +- libgnunetxxx.so: library for API xxx + + +logging: +- services and daemons use their directory name in GNUNET_log_setup (i.e. 'core') + and log using plain 'GNUNET_log'. +- command-line tools use their full name in GNUNET_log_setup (i.e. 'gnunet-publish') + and log using plain 'GNUNET_log'. +- service access libraries log using 'GNUNET_log_from' and use + 'DIRNAME-api' for the component (i.e. 'core-api') +- pure libraries (without associated service) use 'GNUNET_log_from' with + the component set to their library name (without lib + or '.so'), which should also be their directory name (i.e. 'nat') +- plugins should use 'GNUNET_log_from' with the directory name + and the plugin name combined to produce the component name (i.e. 'transport-tcp'). +- logging should be unified per-file by defining a LOG macro with the + appropriate arguments, along these lines: + #define LOG(kind,...) GNUNET_log_from (kind, "example-api",__VA_ARGS__) + + configuration: - paths (that are substituted in all filenames) are in PATHS (have as few as possible) - globals for the daemon are in [gnunetd] (for now, have as few as possible!) @@ -22,11 +49,11 @@ configuration: together with the options for the testing module itself - exported symbols: - must start with "GNUNET_modulename_" and be defined in "modulename.c" - exceptions: those defined in gnunet_common.h + private (library-internal) symbols (including structs & macros): - must NOT start with any prefix - must not be exported in a way that linkers could use them or @@ -43,7 +70,7 @@ testcases: performance tests: - must be called "perf_module-under-test_case-description.c" - "case-description" maybe omitted if there is only one performance test - +- Must only be run if HAVE_BENCHMARKS is satisfied src/ directories: @@ -54,6 +81,39 @@ src/ directories: - libgnunet_plugin_DIR_NAME: loadable plugins (i.e., libgnunet_plugin_transport_tcp) +Coding style: +- GNU guidelines generally apply +- declare only one variable per line, so + + int i; + int j; + + instead of + + int i,j; +- Indentation should be done using the 'pre-commit' script in the top-level + directory using the patched (!) GNU indent. See also the posting at + https://gnunet.org/gnunetindentation + + +Build-system: + +If you have code that is likely not to compile or build rules you might want to not +trigger for most developers, use "if HAVE_EXPERIMENTAL" in your Makefile.am. Then +it is OK to (temporarily) add non-compiling (or known-to-not-port) code. + +If you want to compile all testcases but NOT run them, run configure with the +--enable-test-suppression option. + +If you want to run all testcases, including those that take a while, run configure with the +--enable-expensive-testcases option. + +If you want to compile and run benchmarks, run configure with the +--enable-benchmarks option. + +If you want to obtain code coverage results, run configure with the +--enable-coverage option and run the coverage.sh script in contrib/. + Minimum file-sharing system (in order of dependency): gnunet-service-arm @@ -65,18 +125,4 @@ gnunet-service-statistics gnunet-service-datastore gnunet-service-datacache gnunet-service-dht -gnunet-service-fs (or just lib?) - - - - -Coding style: -- GNU guidelines apply -- declare only one variable per line, so - - int i; - int j; - - instead of - - int i,j; +gnunet-service-fs