|author||Christian Grothoff <firstname.lastname@example.org>||2015-03-24 13:19:38 +0100|
|committer||Christian Grothoff <email@example.com>||2015-03-24 13:19:38 +0100|
formulating coding style
Diffstat (limited to 'doc')
1 files changed, 54 insertions, 0 deletions
diff --git a/doc/coding-style.txt b/doc/coding-style.txt
new file mode 100644
@@ -0,0 +1,54 @@
+These are the general coding style rules for Taler.
+* Baseline rules are to follow GNU guidelines, modified or extended
+ by the GNUnet style: https://gnunet.org/style
+* include files (very similar to GNUnet):
+ + if installed, must start with "taler_" (exception: platform.h),
+ and MUST live in src/include/
+ + if NOT installed, must NOT start with "taler_" and
+ MUST NOT live in src/include/ and
+ SHOULD NOT be included from outside of their own directory
+ + end in "_lib" for "simple" libraries
+ + end in "_plugin" for plugins
+ + end in "_service" for libraries accessing a service, i.e. the mint
+ + taler-mint-xxx: mint programs
+ + taler-merchant-xxx: merchant programs (demos)
+ + taler-wallet-xxx: wallet programs
+ + plugins should be libtaler_plugin_xxx_yyy.so: plugin yyy for API xxx
+ + libtalerxxx: library for API xxx
+ + tools use their full name in GNUNET_log_setup
+ (i.e. 'taler-mint-keyup') and log using plain 'GNUNET_log'.
+ + 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. 'util')
+ + plugin libraries (without associated service) use 'GNUNET_log_from'
+ with the component set to their type and plugin name (without lib or '.so'),
+ which should also be their directory name (i.e. 'mintdb-postgres')
+ + libraries with associated service) use 'GNUNET_log_from'
+ with the name of the service, which should also be their
+ directory name (i.e. 'mint')
+ + same rules as for GNUnet
+* exported symbols
+ + must start with TALER_[SUBSYSTEMNAME]_ where SUBSYSTEMNAME
+ MUST match the subdirectory of src/ in which the symbol is defined
+ + from libtalerutil start just with TALER_, without subsystemname
+* private (library-internal) symbols (including structs and macros)
+ + must not start with TALER_ or any other prefix
+ + must be called "test_module-under-test_case-description.c"
+* performance tests
+ + must be called "perf_module-under-test_case-description.c"