zlib: Don't use PASTE for INTMAX error messages
[jimtcl.git] / STYLE
blob7a9b56cd0ddb6fbbd485caa7e661e97e98427eb8
1 This file summarizes the C style used for Jim.
2 Copyright (C) 2005 Salvatore Sanfilippo.
4 -----------
5 INDENTATION
6 -----------
8 Indentation is 4 spaces, no smart-tabs are used (i.e.
9 two indentation steps of 4 spaces will not be converted
10 into a real tab, but 8 spaces).
12 ---------------
13 FUNCTIONS NAMES
14 ---------------
16 Functions names of exported functions are in the form:
18 Jim_ExportedFunctionName()
20 The prefix is "Jim_", every word composing the function name
21 is capitalized.
23 Not exported functions that are of general interest for the Jim
24 core, like JimFreeInterp() are capitalized the same way, but the
25 prefix used for this functions is "Jim" instead of "Jim_".
26 Another example is:
28 JimNotExportedFunction()
30 Not exported functions that are not general, like functions
31 implementing hashtables or Jim objects methods can be named
32 in any prefix as long as capitalization rules are followed,
33 like in:
35 ListSetIndex()
37 ---------------
38 VARIABLES NAMES
39 ---------------
41 Global variables follow the same names convention of functions.
43 Local variables have usually short names. A counter is just 'i', or 'j',
44 or something like this. When a longer name is required, composed of
45 more words, capitalization is used, but the first word starts in
46 lowcase:
48 thisIsALogVarName
50 ----
51 GOTO
52 ----
54 Goto is allowed every time it makes the code cleaner, like in complex
55 functions that need to handle exceptions, there is often an "err" label
56 at the end of the function where allocated resources are freed before to exit
57 with an error. Goto is also used in order to escape multiple nested loops.
59 ----------
60 C FEATURES
61 ----------
63 Only C89 ANSI C is allowed. C99 features can't be used currently.
64 GCC extensions are not allowed.