Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cut another bunch of include
[simgrid.git] / README.coding
1 **
2 ** Source tree organization
3 **
4 ******************************************************
5
6  examples/ -> Supposed to be copy/pastable by the user, so keep it clear and
7                 avoid any kind of trick. In particular, do only include the
8                 public headers here.
9
10  teshsuite/ -> The more test the better. Put in there any strange test
11                doing things that the users are not supposed to do,
12                just to see if our framework is robust to incorrect and
13                unusual behaviors. All tests written in this section
14                should leverage our tesh(1) utility.
15
16 **
17 ** NEW type naming standard in SimGrid4
18 **
19 *****************************************************
20
21 SimGrid4 will follow the these rules:
22
23   - filenames are unique in the whole project 
24     (because of a bug in Sonar coverage computation)
25   C++
26   - fields, methods and variables are in snake_case()
27   - Classes and Enum are in CamelCase
28   - filenames: Class.cpp and Class.hpp
29   C
30   - variables and functions are in snake_case()
31   - typedefs do not hide the pointers, ie * must be explicit
32     char * sg_host_get_name(sg_host_t * host);
33   
34
35 This is different from the old convention (described below), that
36 should not be used in S4U and its bindings, nor in the kernel.
37
38 **
39 ** OLD Type naming standard in SimGrid3
40 **
41 *****************************************************
42
43 SimGrid3 legacy interfaces (ie, MSG and SimDag) are following these rules:
44
45   - ???_t is a valid type (built with typedef)
46   - s_toto_t is a structure (access to fields with .)
47   - s_toto   is a structure needing 'struct' keyword to be used
48   - e_toto_t is an enum
49   - u_toto_t is an union
50   - u_toto   is an union needing 'union' keyword to be used
51   -   toto_t is an 'object' (struct*)
52
53 Please to not call toto_t something else than an 'object' (ie, something you
54 have to call _new and _free on it).
55
56 Example:
57   typedef struct s_toto {} s_toto_t, *toto_t;
58   typedef enum {} e_toto_t;
59
60 Moreover, only toto_t (and e_toto_t) are public. The rest (mainly s_toto_t)
61 is private.
62
63 If you see any part of the code not following this convention, this is a
64 bug. Please report it (or fix it yourself if you can).
65
66 **
67 ** Commenting the source: doxygen
68 **
69 ****************************************************
70
71 The global structure of the documentation is in doc/modules.doc
72
73 The structure of each module (xbt, msg, etc) is in doc/module-<module>.doc
74
75 The structure of a module is in its public header. This way, you're sure to
76 see all the public interface (and only it). The different parts of the
77 interface are grouped using the @name construct, even if it's buggy. Since
78 parts often get reordered, it's better to add numbers to the parts (so that
79 users can see the intended order).
80
81 The documentation of each type and macro are also in the public header since
82 this is were they live.
83
84 The documentation of each function must be in the C file were it lives.
85
86 Any public element (function, type and macro) must have a @brief part.
87
88
89 *
90 * SimGrid Hacker Survival Guide (FIXME: should be betterly placed)
91 ********************************
92 * When you add/remove files, and/or make changes in the lists of files to build,
93   please check that "make distcheck" still succeeds.  This is needed to ensure
94   that the generated archive is consistent.