From c9012bf2f2b35ee990839a73e6411233562d9464 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 31 Mar 2011 22:32:37 +0200 Subject: Update docs --- README | 10 +++ doc/reference/CrystFEL-docs.sgml | 6 ++ doc/reference/xml/coding-standards.xml | 109 +++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 doc/reference/xml/coding-standards.xml diff --git a/README b/README index e98bcd9b..afea1cb5 100644 --- a/README +++ b/README @@ -98,6 +98,16 @@ $ ./configure --with-libtiff=/some/strange/location $ ./configure --with-gsl=/some/strange/location $ ./configure --disable-gtk +At a minimum, you will need the HDF5 library (version 1.8.0 or later) and the +GNU Scientific Library (GSL). For a full installation, you will also need +libTIFF, libPNG, Cairo and GTK. + +You must use an installation of the HDF5 library which is thread safe. That +means it must have been configured with the "--enable-threadsafe" option. Most +binary distributions appear NOT to be like this. If you don't have a thread +safe HDF5 library, just be sure not to use the "-j" option for any of the +CrystFEL programs. + If you're compiling on Mac OS X, where GTK, libPNG and libTIFF seem to be much harder to come by, disable lots of things: diff --git a/doc/reference/CrystFEL-docs.sgml b/doc/reference/CrystFEL-docs.sgml index fa973b86..ac32b14b 100644 --- a/doc/reference/CrystFEL-docs.sgml +++ b/doc/reference/CrystFEL-docs.sgml @@ -47,4 +47,10 @@ API Index + + + Information for developers + + + diff --git a/doc/reference/xml/coding-standards.xml b/doc/reference/xml/coding-standards.xml new file mode 100644 index 00000000..e3d549f4 --- /dev/null +++ b/doc/reference/xml/coding-standards.xml @@ -0,0 +1,109 @@ + + +]> + + +CrystFEL coding standards +3 + + Coding standards + + + + + + +Summary + +This page documents the coding conventions used within the CrystFEL source code. Read these to help when reading the code or before making modifications destined to be sent upstream. + + + + + +Licensing and copyright + +CrystFEL is distributed under the terms of the GNU General Public License version 3 or higher. Contributions are very welcome provided they also use this license. + + +Whenever you edit a source file, don't forget to update the copyright dates at the top. Add your name and email address if they're not there already. Be sure to add your name to the 'AUTHORS' file in the top level folder, as well. + + + + + +Formatting + +Indentation is done with tabs and +alignment is done with spaces. This way, the code looks +neat whatever width you configure your editor to display tabs as. + + +However, code must be strictly wrapped at 80 columns, or +what would be 80 columns if the tabs were displayed as 8 spaces. +If you think you need more width, you're at too many levels of indentation and +need to break things down a bit. + + + + + +Brackets and so on + +Brackets and so on should go like this: + + + +/* Multiple line comments have stars + * down one side */ +void somefunction(int someparam) +{ + /* Single line comments use this style (not //) */ + if ( a < b ) { + /* 'if' statements usually have the opening brace on the same + * line as the condition. */ + } else { + /* 'else's are 'cuddled' */ + } + + if ( some && very && long && condition && that && spans + && two && lines ) + { + /* Opening brace is on a line by itself in the case of a very + * long condition */ + } +} + +/* Comments use proper capitalisation to make things look neat */ + + + +'struct' blocks can have the braces like functions or 'if' statements. Usually +the former looks nicer if the struct is large. + + + + + +Cleverness + +Yes, we all know you can insert a new node into an RB-tree while simultaneously +calculating Pi to 150 decimal places in one line of code. You don't need to +prove it here. As a general rule, if you think you're about to do something clever, don't do it at all. + + + + + +Evil dictator + +Despite your following all of the above, I will probably still touch up your +code in some places while (or shortly after) integrating it into mainline +CrystFEL. Please try not to take it personally. + + + + -- cgit v1.2.3