comparison www/code.html @ 694:786841fdb1e0

Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style. The actual code should be the same afterward, this is just cosmetic refactoring.
author Rob Landley <rob@landley.net>
date Tue, 13 Nov 2012 17:14:08 -0600
parents 43c4f709b9ff
children 27275d0d97e9
comparison
equal deleted inserted replaced
693:4a5a250e0633 694:786841fdb1e0
11 see more of it on the screen and thus keep more if in their head at once. 11 see more of it on the screen and thus keep more if in their head at once.
12 This helps code auditing and thus reduces bugs. That said, sometimes being 12 This helps code auditing and thus reduces bugs. That said, sometimes being
13 more explicit is preferable to being clever enough to outsmart yourself: 13 more explicit is preferable to being clever enough to outsmart yourself:
14 don't be so terse your code is unreadable.</p> 14 don't be so terse your code is unreadable.</p>
15 15
16 <p>Toybox source is formatted to be read with 4-space tab stops. Each file 16 <p>Toybox source uses two spaces per indentation level, and wraps at 80
17 starts with a special comment telling vi to set the tab stop to 4. Note that 17 columns.</p>
18 one of the bugs in Ubuntu 7.10 broke vi's ability to parse these comments; you
19 must either rebuild vim from source, or go ":ts=4" yourself each time you load
20 the file.</p>
21 18
22 <p>Gotos are allowed for error handling, and for breaking out of 19 <p>Gotos are allowed for error handling, and for breaking out of
23 nested loops. In general, a goto should only jump forward (not back), and 20 nested loops. In general, a goto should only jump forward (not back), and
24 should either jump to the end of an outer loop, or to error handling code 21 should either jump to the end of an outer loop, or to error handling code
25 at the end of the function. Goto labels are never indented: they override the 22 at the end of the function. Goto labels are never indented: they override the
29 <p><h1>Building Toybox:</h1></p> 26 <p><h1>Building Toybox:</h1></p>
30 27
31 <p>Toybox is configured using the Kconfig language pioneered by the Linux 28 <p>Toybox is configured using the Kconfig language pioneered by the Linux
32 kernel, and adopted by many other projects (uClibc, OpenEmbedded, etc). 29 kernel, and adopted by many other projects (uClibc, OpenEmbedded, etc).
33 This generates a ".config" file containing the selected options, which 30 This generates a ".config" file containing the selected options, which
34 controls which features to enable when building toybox.</p> 31 controls which features are included when compiling toybox.</p>
35 32
36 <p>Each configuration option has a default value. The defaults indicate the 33 <p>Each configuration option has a default value. The defaults indicate the
37 "maximum sane configuration", I.E. if the feature defaults to "n" then it 34 "maximum sane configuration", I.E. if the feature defaults to "n" then it
38 either isn't complete or is a special-purpose option (such as debugging 35 either isn't complete or is a special-purpose option (such as debugging
39 code) that isn't intended for general purpose use.</p> 36 code) that isn't intended for general purpose use.</p>