Type identifiers consist of a lower-case "t" and meaningful, mixed-case notions. Variable identifiers are normally written in lower-case letters, their parts (if any) are separated by underscore ("_") characters. Constant identifiers often consist of a lower-case prefix formed by upper-case letters from the corresponding type identifier (if that's non-trivial), followed by a mixed-case, meaningful notion; a few constant identifiers are instead implemented using preprocessor defines, especially concerning "hard limits" for variables and some constants the values of which have to be accessible by the preprocessor for build-time error checking. Function identifiers are written like variable identifiers; additionally, their first part often refers to the source code file (or conceptual project part) they belong to.
If a type is needed in several parts of the program, we define a new type identifier using "typedef". This way, we only have to change one place when we see that the original choice for that type wasn't "optimal".
Enumeration types are not defined with "typedef enum"; variables of such a type would waste much memory because they're "int"s. Instead, we define the constants using "enum" and define the type itself using "typedef unsigned char ..." or whatever might be appropriate. Additionally, we don't rely on the compiler assigning certain numbers to enumeration identifiers, instead we assign the numbers ourselves.
We don't rely on the "fact" that e.g. a char declaration is always interpreted as signed char by the compiler. Instead, we explicitly say signed char resp. unsigned char (unless we're actually using the char type for characters, and of course except for cases where e.g. a curses library header file simply says "short"...).
The source code contains lots of comments. Some of them are tagged with special "marks", so that their purpose becomes obvious at first glance and they can easily be recovered with "search" or "grep" commands. The following marks are used:
Now if you still don't understand the source code, I give up... :-)
This documentation file is part of version 0.1.4 of retawq, a network client created by Arne Thomaßen. retawq is basically released under certain versions of the GNU General Public License and WITHOUT ANY WARRANTY. Copyright (C) 2001-2002 Arne Thomaßen.