Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#3898) Clarify include order
Home

[Freeciv-Dev] (PR#3898) Clarify include order

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#3898) Clarify include order
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Sat, 29 Mar 2003 11:14:59 -0800
Reply-to: rt@xxxxxxxxxxxxxx


This patch is in addition to the two order patches I posted. It
changes CodingStyle to document better the include order.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "#!/usr/bin/perl -w
  if ( `date +%w` != 1 ) {
    die "This script only works on Mondays." ;
  }"
    -- from chkars.pl by Cornelius Krasel in de.comp.os.linux.misc

Index: doc/CodingStyle
===================================================================
RCS file: /home/freeciv/CVS/freeciv/doc/CodingStyle,v
retrieving revision 1.7
diff -u -u -r1.7 CodingStyle
--- doc/CodingStyle     2003/01/24 22:51:49     1.7
+++ doc/CodingStyle     2003/03/29 19:11:33
@@ -168,11 +168,26 @@
 - Use the postfix operator instead of the prefix operator when either will
   work.  That is, write "a++" instead of "++a".
 
-- Order include files consistently:  First include config.h (see below),
-  then state all system include files with <> in alphabetic order, then all
-  Freeciv include files with "", sorted by directory (common, server, ...)
-  and then by alphabetic order, with a blank line between the sections.  This
-  helps to avoid adding unnecessary or duplicated include files.
+- Order include files consistently: All includes are grouped
+  together. These groups are divided by an empty line. The order of
+  these groups are as follow:
+
+    1) config.h (see below)
+    2) system include files which are OS-independent (part of
+       C-standard or POSIX)
+    3) system include files which are OS-dependent or conditional
+       includes
+    4) freeciv include files from common/
+    5) freeciv include files from common/aicore/
+    6) freeciv include files from client/
+    7) freeciv include files from client/agents/
+    8) freeciv include files from client/gui-*/
+    9) freeciv include files from client/include/
+   10) freeciv include files from server/
+   11) freeciv include files from ai/
+
+  Each group is sorted in alphabetic order. This helps to avoid adding
+  unnecessary or duplicated include files.
 
   It is very important that '#include <config.h>' be included at the top of
   every .c file (it need not be included from .h files).  Some definitions in

[Prev in Thread] Current Thread [Next in Thread]