File: CONVENTIONS

package info (click to toggle)
roy 1.0.8-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,316 kB
  • ctags: 1,564
  • sloc: ansic: 14,459; sh: 8,259; makefile: 322
file content (42 lines) | stat: -rw-r--r-- 1,587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

* Each filename starts with an 'r', eg rlist.h, rchunk.c.

* Each function and structure name should use the name of the
  file as the second part of their names. eg, rchunk.c, rchunk_*

* All functions start with 'r', with no _ after it, eg rchunk_free

* All structures start with 'R' and then a descriptive name
  using mixed case notation, eg RHashEntry.  These should also
  be named after the file.

* Any type should have a _new and _free method, where possible
  and applicable.

* Private functions that must be exposed to other parts of roy
  should have a suffix of __P attached to them, and these should 
  not be used by the end user.

* Not all macros are capitalized.  A lot of macros are used in 
  Roy, but only those that behave as macros (eg, do odd things
  with the flow of your program, or are classic 'macro'ish things)
  should be macros.  Any macro that behaves as a function would
  normally, can be lower case like a function.

* All indentation is done using a C tab indentation of 4.  No
  actual tab characters are put in the file.  See
  http://www.jwz.org/doc/tabs-vs-spaces.html for info on 
  how to set this up in your editor.

* astyle can indent very close to what the current entity2 coding
  style is.  ftp://astyle.sourceforge.net/pub/astyle/stable/src/.
  Options: astyle -s4 -c -l -p -E

* When naming functions/methods, always use 
  <classname>_<topic>_<action>.  Where topic is what the function
  is dealing with, and action is the type of activity, eg 'add',
  'new', 'free' etc.

  Examples:

  rhash_new, rhash_lookup, rmain_fd_add etc.