source: trunk/third/ORBit/docs/CONVENTIONS.txt @ 15271

Revision 15271, 1.2 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15270, which included commits to RCS files with non-trunk default branches.
Line 
1These are just some suggestions, not hard and fast rules. However,
2following them makes everyone's life easier (IMHO).
3-- Elliot
4
5---------------------------------------------------------
6
7Functions should return 0 upon success, and an error code upon failure
8
9Use the glib types whenever appropriate.
10
11Use the g_new/g_new0/g_malloc/g_strdup/g_free functions. Use
12GMemChunk's whenever possible, especially when allocating lots of
13fixed-size memory blocks (see allocators.h and allocator-defs.h for memory chunk stuff).
14
15If you have both a structure and a typedef mapping onto that structure, name the
16structure typename_struct, e.g.
17        struct MyType_struct { ... };
18        typedef struct MyType_struct MyType;
19<Aside: it's nice to do this if you can, but I'm not sure the CORBA spec
20allows us to do it for IDL structures translated into the C mapping...?
21Does the CORBA spec require
22
23typedef struct foo {
24} foo;
25
26?
27>
28
29Macros should be in uppercase as much as is sane, to distinguish them
30from regular functions.
31
32If you can, use the _ to separate parts of a function name
33(ORBit_typename_foo instead of ORBitTypenameFoo() ).
34
35If possible, name functions of the form:
36        namespace_typename_method()
37
Note: See TracBrowser for help on using the repository browser.