summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2010-04-13 17:37:29 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2010-04-13 17:43:26 -0400
commite014f667f7f535be64b6cc899d033f7ea62cf709 (patch)
tree1debfc8f08b38220ad5fb4c797b8b1c0d0b5eced /docs
parent15639bea2501bac9725b75258d9a5d17ee900e07 (diff)
downloadfarstream-e014f667f7f535be64b6cc899d033f7ea62cf709.tar.gz
docs: Add header order to the CodingStyle file
Diffstat (limited to 'docs')
-rw-r--r--docs/codingstyle.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/codingstyle.txt b/docs/codingstyle.txt
index 0236f170..5f26f82e 100644
--- a/docs/codingstyle.txt
+++ b/docs/codingstyle.txt
@@ -92,6 +92,18 @@ switch (var)
FarsightRTPStream *self = (FarsightRTPStream *) stream;
+==== #includes ====
+
+If you're going to #include "config.h", do that first, in case it defines things like "inline".
+
+Next, #include the header in which this .c file's API is declared. This guarantees that all public headers are self-contained.
+
+Next, #define any libc feature-test macros you need (_GNU_SOURCE etc.) and #include any C/POSIX standard library headers you need, in alphabetical order.
+
+Next, #include any headers you need from non-standard libraries (GLib, Gtk, GStreamer, ...) in alphabetical order.
+
+Finally, #include any private (non-installed) headers from the library or program you're writing.
+
==== Emacs mode ====
(defun farsight2-c-mode ()