xref: /aosp_15_r20/external/toybox/www/cleanup.html (revision cf5a6c84e2b8763fc1a7db14496fd4742913b199)
1*cf5a6c84SAndroid Build Coastguard Worker<html><head><title>toybox cleanup</title></head>
2*cf5a6c84SAndroid Build Coastguard Worker<!--#include file="header.html" -->
3*cf5a6c84SAndroid Build Coastguard Worker
4*cf5a6c84SAndroid Build Coastguard Worker<h1>Index</h1>
5*cf5a6c84SAndroid Build Coastguard Worker
6*cf5a6c84SAndroid Build Coastguard Worker<ul>
7*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#intro>Introduction</a></li>
8*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#advice>Advice</a></li>
9*cf5a6c84SAndroid Build Coastguard Worker<li>Commands:</li>
10*cf5a6c84SAndroid Build Coastguard Worker<ul>
11*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#uuencode>uuencode</a></li>
12*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#uudecode>uudecode</a></li>
13*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#ifconfig>ifconfig</a></li>
14*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#stat>stat</a></li>
15*cf5a6c84SAndroid Build Coastguard Worker</ul>
16*cf5a6c84SAndroid Build Coastguard Worker</ul>
17*cf5a6c84SAndroid Build Coastguard Worker
18*cf5a6c84SAndroid Build Coastguard Worker<hr>
19*cf5a6c84SAndroid Build Coastguard Worker
20*cf5a6c84SAndroid Build Coastguard Worker<a name=intro />
21*cf5a6c84SAndroid Build Coastguard Worker<h1>Cleaning up the toybox code.</h1>
22*cf5a6c84SAndroid Build Coastguard Worker
23*cf5a6c84SAndroid Build Coastguard Worker<p>Toybox <a href=http://landley.net/notes.html#31-03-2013>hasn't always</a>
24*cf5a6c84SAndroid Build Coastguard Workertaken proper advantage of external contributions</a>.
25*cf5a6c84SAndroid Build Coastguard WorkerLots of people want to help, but their contributions languish out of tree
26*cf5a6c84SAndroid Build Coastguard Workeror in the "pending" directory, awaiting cleanup.</p>
27*cf5a6c84SAndroid Build Coastguard Worker
28*cf5a6c84SAndroid Build Coastguard Worker<p>Toybox's design goals require simpler, tighter, and more explicit code
29*cf5a6c84SAndroid Build Coastguard Workerthan most other implementations, among other reasons to allow better security
30*cf5a6c84SAndroid Build Coastguard Workerauditing. Writing "another" implementation of standard command line tools
31*cf5a6c84SAndroid Build Coastguard Workerisn't very interesting, they should be _better_ implementations.
32*cf5a6c84SAndroid Build Coastguard WorkerUnfortunately, this means existing, working commands often take more effort to
33*cf5a6c84SAndroid Build Coastguard Workerclean up to Toybox's standards than writing a new one from scratch, not
34*cf5a6c84SAndroid Build Coastguard Workerbecause they don't work, but because we aim for an unusual level of polish.</p>
35*cf5a6c84SAndroid Build Coastguard Worker
36*cf5a6c84SAndroid Build Coastguard Worker<p>In hopes of teaching more people how to do this
37*cf5a6c84SAndroid Build Coastguard Workercleanup work, I've started breaking cleanup changes into smaller chunks and
38*cf5a6c84SAndroid Build Coastguard Workerposting explanations of each change to the mailing list.
39*cf5a6c84SAndroid Build Coastguard WorkerBelow are indexes of such cleanup series. Each commit and post are meant to
40*cf5a6c84SAndroid Build Coastguard Workerbe read together: each description explains what the corresponding patch
41*cf5a6c84SAndroid Build Coastguard Workerwas trying to accomplish.</p>
42*cf5a6c84SAndroid Build Coastguard Worker
43*cf5a6c84SAndroid Build Coastguard Worker<p>Line/byte totals of completed series are given for scale, but the point
44*cf5a6c84SAndroid Build Coastguard Workerof this work is simplicity and compactness, not size per se.</p>
45*cf5a6c84SAndroid Build Coastguard Worker
46*cf5a6c84SAndroid Build Coastguard Worker<p>(Note: mercurial's web viewer doesn't follow renames, so although each
47*cf5a6c84SAndroid Build Coastguard Workercommand name links to a commit list with the bulk of the changes, it may
48*cf5a6c84SAndroid Build Coastguard Workernot include the final version of each file moved from the "pending"
49*cf5a6c84SAndroid Build Coastguard Workerdirectory to its final location. The summaries link the initial and cleaned
50*cf5a6c84SAndroid Build Coastguard Workerversions of each file when giving line counts.)</p>
51*cf5a6c84SAndroid Build Coastguard Worker
52*cf5a6c84SAndroid Build Coastguard Worker<hr>
53*cf5a6c84SAndroid Build Coastguard Worker
54*cf5a6c84SAndroid Build Coastguard Worker<a name=advice />
55*cf5a6c84SAndroid Build Coastguard Worker<h1>General advice and/or policy.</h1>
56*cf5a6c84SAndroid Build Coastguard Worker
57*cf5a6c84SAndroid Build Coastguard Worker<p>The <a href=design.html>design of toybox</a> page and the coding
58*cf5a6c84SAndroid Build Coastguard Workerstyle section at the start of the <a href=code.html>source code walkthrough</a>
59*cf5a6c84SAndroid Build Coastguard Workerdon't cover everything. Here are some
60*cf5a6c84SAndroid Build Coastguard Workerlinks to mailing list messages that cover various programming topics
61*cf5a6c84SAndroid Build Coastguard Workernot directly related to a specific cleanup series:</p>
62*cf5a6c84SAndroid Build Coastguard Worker
63*cf5a6c84SAndroid Build Coastguard Worker<ul>
64*cf5a6c84SAndroid Build Coastguard Worker<li><a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000850.html>Error messages and internationalization.</a></li>
65*cf5a6c84SAndroid Build Coastguard Worker<li><a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000891.html>Why not "const"?</a> (Exception: global variables
66*cf5a6c84SAndroid Build Coastguard Workeroutside of GLOBALS can be static const, to go in rodata instead of data.
67*cf5a6c84SAndroid Build Coastguard WorkerThis means the pages can be shared between instances.)</li>
68*cf5a6c84SAndroid Build Coastguard Worker<li><a href=http://lkml.indiana.edu/hypermail/linux/kernel/1308.3/03890.html>Why not "bool"?</a> (explanation from Linus Torvalds)</li>
69*cf5a6c84SAndroid Build Coastguard Worker<li><a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000893.html>Why not to check in debug code.</a></li>
70*cf5a6c84SAndroid Build Coastguard Worker<li><a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-June/001044.html>Relationship between /proc and /sys</a> (/proc isn't obsolete and /sys is an ABI)</li>
71*cf5a6c84SAndroid Build Coastguard Worker<li>"Hiding numbers that are used just once into defines to put them out of
72*cf5a6c84SAndroid Build Coastguard Workersight does not really help readability."</a> -
73*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lkml.iu.edu/hypermail/linux/kernel/1407.1/00299.html>Pavel
74*cf5a6c84SAndroid Build Coastguard WorkerMachek</a></li>
75*cf5a6c84SAndroid Build Coastguard Worker<li>"Infrastructure in search of a user" is a bad thing, so don't put code
76*cf5a6c84SAndroid Build Coastguard Workerin lib/ that doesn't already have at least two users. Don't preemptively
77*cf5a6c84SAndroid Build Coastguard Workerfactor stuff out, it's easy enough to rewrite it uin future if it needs
78*cf5a6c84SAndroid Build Coastguard Workerto change. The "extreme programming" fad called this "You Ain't Gonna
79*cf5a6c84SAndroid Build Coastguard WorkerNeed It" (while inexplicably screaming at cans of Mountain Dew, back in the
80*cf5a6c84SAndroid Build Coastguard Worker90's). Here's <a href=https://lwn.net/Articles/683745/>Linus Torvalds' take</a>.</li>
81*cf5a6c84SAndroid Build Coastguard Worker</ul>
82*cf5a6c84SAndroid Build Coastguard Worker
83*cf5a6c84SAndroid Build Coastguard Worker<hr>
84*cf5a6c84SAndroid Build Coastguard Worker
85*cf5a6c84SAndroid Build Coastguard Worker<a name="uuencode"><h1><a href=/hg/toybox/log/900/toys/pending/uuencode.c>uuencode</a></h1>
86*cf5a6c84SAndroid Build Coastguard Worker
87*cf5a6c84SAndroid Build Coastguard Worker<p>This is an example of cleaning up something most projects would be quite
88*cf5a6c84SAndroid Build Coastguard Workerhappy with. The initial submission of uuencode and uudecode was high
89*cf5a6c84SAndroid Build Coastguard Workerquality code, written by a seasoned developer who did an excellent
90*cf5a6c84SAndroid Build Coastguard Workerjob, but it was still possible to shrink the result almost by half:</p>
91*cf5a6c84SAndroid Build Coastguard Worker
92*cf5a6c84SAndroid Build Coastguard Worker<ul>
93*cf5a6c84SAndroid Build Coastguard Worker<li>old total: <a href=/hg/toybox/file/828/toys/pending/uuencode.c>116 lines (2743
94*cf5a6c84SAndroid Build Coastguard Workerbytes) in 7 functions</a></li>
95*cf5a6c84SAndroid Build Coastguard Worker<li>new total: <a href=/hg/toybox/file/841/toys/posix/uuencode.c>67 lines (1440
96*cf5a6c84SAndroid Build Coastguard Workerbytes) in 1 function</a></li>
97*cf5a6c84SAndroid Build Coastguard Worker</ul>
98*cf5a6c84SAndroid Build Coastguard Worker
99*cf5a6c84SAndroid Build Coastguard Worker<ul>
100*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/830>830</a>: first pass, description: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000904.html>part 1</a>,
101*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000903.html>part 2</a></li>
102*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/831>831</a>,
103*cf5a6c84SAndroid Build Coastguard Workersecond pass, description: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000919.html>part 3</a></li>
104*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/837>837</a>,
105*cf5a6c84SAndroid Build Coastguard Workerdescription: fix test suite.</li>
106*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/853>853</a>, description: bugfix.</li>
107*cf5a6c84SAndroid Build Coastguard Worker</ul>
108*cf5a6c84SAndroid Build Coastguard Worker
109*cf5a6c84SAndroid Build Coastguard Worker<p>Status: COMPLETE</p>
110*cf5a6c84SAndroid Build Coastguard Worker
111*cf5a6c84SAndroid Build Coastguard Worker<a name="uudecode"><h1><a href=/hg/toybox/log/900/toys/pending/uudecode.c>uudecode</a></h1>
112*cf5a6c84SAndroid Build Coastguard Worker
113*cf5a6c84SAndroid Build Coastguard Worker<p>The uudecode cleanup was my second "explain as I go along" cleanup,
114*cf5a6c84SAndroid Build Coastguard Workerand I tried to do it in smaller stages so it was easier to see what
115*cf5a6c84SAndroid Build Coastguard Workerchanged from the diff:</p>
116*cf5a6c84SAndroid Build Coastguard Worker
117*cf5a6c84SAndroid Build Coastguard Worker<ul>
118*cf5a6c84SAndroid Build Coastguard Worker<li>old: <a href=/hg/toybox/file/828/toys/pending/uudecode.c>175
119*cf5a6c84SAndroid Build Coastguard Workerlines (4534 bytes) in 9 functions</a></li>
120*cf5a6c84SAndroid Build Coastguard Worker<li>new: <a href=/hg/toybox/file/840/toys/posix/uudecode.c>107 lines
121*cf5a6c84SAndroid Build Coastguard Worker(2300 bytes) in 1 function</a></li>
122*cf5a6c84SAndroid Build Coastguard Worker</ul>
123*cf5a6c84SAndroid Build Coastguard Worker
124*cf5a6c84SAndroid Build Coastguard Worker<ul>
125*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/833>833</a>,
126*cf5a6c84SAndroid Build Coastguard Workerdescription: preparatory adjustments to test suite.</li>
127*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/835>835</a>,
128*cf5a6c84SAndroid Build Coastguard Workerdescription: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2014-January/001532.html>Redo command line parsing, redo parsing loop.</a></li>
129*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/838>838</a>,
130*cf5a6c84SAndroid Build Coastguard Workerdescription: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2014-January/001533.html>Redo b64_1byte, b64_4bytes, and uu_line()</a></li>
131*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/839>839</a>,
132*cf5a6c84SAndroid Build Coastguard Workerdescription: todo</a></li>
133*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/840>840</a>,
134*cf5a6c84SAndroid Build Coastguard Workerdescription: todo (finish, move pending->posix, default y)</a></li>
135*cf5a6c84SAndroid Build Coastguard Worker</ul>
136*cf5a6c84SAndroid Build Coastguard Worker
137*cf5a6c84SAndroid Build Coastguard Worker<p>Status: COMPLETE</p>
138*cf5a6c84SAndroid Build Coastguard Worker
139*cf5a6c84SAndroid Build Coastguard Worker<a name=ifconfig>
140*cf5a6c84SAndroid Build Coastguard Worker<h1><a href=/hg/toybox/log/tip/toys/pending/ifconfig.c>ifconfig</a></h1>
141*cf5a6c84SAndroid Build Coastguard Worker
142*cf5a6c84SAndroid Build Coastguard Worker<p>This series describes a thorough cleanup that took a while to do.</p>
143*cf5a6c84SAndroid Build Coastguard Worker
144*cf5a6c84SAndroid Build Coastguard Worker<p>When ifconfig was submitted, it touched a half-dozen files. I glued it
145*cf5a6c84SAndroid Build Coastguard Workertogether into a single self-contained file, which needed a lot of
146*cf5a6c84SAndroid Build Coastguard Workercleanup. The final version is about 1/3 the size of the original.</p>
147*cf5a6c84SAndroid Build Coastguard Worker
148*cf5a6c84SAndroid Build Coastguard Worker<ul>
149*cf5a6c84SAndroid Build Coastguard Worker<li>old total: <a href=/hg/toybox/file/841/toys/pending/ifconfig.c>1504 lines (44268 bytes) in 38 functions</a></li>
150*cf5a6c84SAndroid Build Coastguard Worker<li>new total: <a href=/hg/toybox/file/1133/toys/other/ifconfig.c>521 lines (15963 bytes) in 4 functions</a></li>
151*cf5a6c84SAndroid Build Coastguard Worker</ul>
152*cf5a6c84SAndroid Build Coastguard Worker
153*cf5a6c84SAndroid Build Coastguard Worker<p>This was the first command I started cleaning up with the intent of
154*cf5a6c84SAndroid Build Coastguard Workerdescribing the process, and especially the first few entries in this
155*cf5a6c84SAndroid Build Coastguard Workerseries describe many of the low hanging fruit techniques used to clean
156*cf5a6c84SAndroid Build Coastguard Workerup a codebase.</p>
157*cf5a6c84SAndroid Build Coastguard Worker
158*cf5a6c84SAndroid Build Coastguard Worker<ul>
159*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/843>843</a>, description: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000882.html>Infrastructure in search of a user, code proximity,
160*cf5a6c84SAndroid Build Coastguard Workerunnecessary #defines, shorter code is easier to read.</a></li>
161*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/844>844</a>,
162*cf5a6c84SAndroid Build Coastguard Workerdescription: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000881.html>Headers, replacing repeated code with loops,
163*cf5a6c84SAndroid Build Coastguard Workerlogical operators guaranteed to return 0 or 1, math on string constants,
164*cf5a6c84SAndroid Build Coastguard Workerremoving unnecessary variables and tests.</a></li>
165*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/852>852</a>,
166*cf5a6c84SAndroid Build Coastguard Workerdescription: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000921.html>hg commit numbers, documenting the obvious, ordering
167*cf5a6c84SAndroid Build Coastguard Workerto avoid prototypes, returning void, collate local declarations,
168*cf5a6c84SAndroid Build Coastguard Workeruse error_exit(), unnecessary parentheses, inline to remove variables/functions
169*cf5a6c84SAndroid Build Coastguard Workerused only once, using *var instead of var[0], unnecessary typecasts,
170*cf5a6c84SAndroid Build Coastguard Workerxprintf("\n") vs xputc('\n')</a></li>
171*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/856>856</a>,
172*cf5a6c84SAndroid Build Coastguard Workerdescription: one line portability fix from Isaac Dunham</li>
173*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/861>861</a>
174*cf5a6c84SAndroid Build Coastguard Workerand <a href=/hg/toybox/rev/863>863</a>,
175*cf5a6c84SAndroid Build Coastguard Workerdescription:
176*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000910.html>Help
177*cf5a6c84SAndroid Build Coastguard Workerinfrastructure cleanup from Isaac Dunham</a>
178*cf5a6c84SAndroid Build Coastguard Worker(which I mis-applied and then <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000920.html>fixed plus some whitespace changes</a>)</li>
179*cf5a6c84SAndroid Build Coastguard Worker
180*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/862>862</a>, description:
181*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.landley.net/pipermail/toybox-landley.net/2014-January/001525.html>remove unused headers and function, replace local buffer with toybuf, perror_exit(), avoid unnecessary assignment.</a></li>
182*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/864>864</a>, description:
183*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.landley.net/pipermail/toybox-landley.net/2014-January/001526.html>use common linked list functions, inline set_data, add xioctl, clean up error messages, whitespace and comment tweaks, remove NOP return statements</a></li>
184*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/866>866</a>, description:
185*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.landley.net/pipermail/toybox-landley.net/2014-January/001528.html>move standalone globals into GLOBALS() block, collate structs into
186*cf5a6c84SAndroid Build Coastguard Workeriface_list. Inline/rewrite/remove field_format, iface_flags_str,
187*cf5a6c84SAndroid Build Coastguard Workeromit_whitespace(), print_iface_flags(), print_media(), get_ifconfig_info(),
188*cf5a6c84SAndroid Build Coastguard Workerand clear_list(). Merge duplicate function
189*cf5a6c84SAndroid Build Coastguard Workercalls. Show get_proc_info() version field can't matter in 2.6 or newer kernel,
190*cf5a6c84SAndroid Build Coastguard Workerand that SIOCGIFMAP has been there since 1994 so doesn't need an #ifdef.
191*cf5a6c84SAndroid Build Coastguard WorkerLoop simplification in readconf() and show_iface().</a></li>
192*cf5a6c84SAndroid Build Coastguard Worker
193*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/869>869</a> and <a href=/hg/toybox/rev/870>870</a>,
194*cf5a6c84SAndroid Build Coastguard Workerdescription: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000928.html>869:
195*cf5a6c84SAndroid Build Coastguard Workerreorder to eliminate prototypes, put command_main() at end of file,
196*cf5a6c84SAndroid Build Coastguard Worker870: long repeated variable prefixes, replacing struct+sscanf()+printf with a
197*cf5a6c84SAndroid Build Coastguard Workerloop and a table (from iface_list, get_proc_info(), display_ifconfig()),
198*cf5a6c84SAndroid Build Coastguard Workeruse lib/xwrap.c functions to return void, why xstrcpy() fails closed,
199*cf5a6c84SAndroid Build Coastguard Worker(functional comment: why multicast failed, CSLIP obsolecense), not being
200*cf5a6c84SAndroid Build Coastguard Worker_too_ clever.</a></li>
201*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/878>878</a> and <a href=/hg/toybox/rev/879>879</a>:
202*cf5a6c84SAndroid Build Coastguard Workerdescription: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000946.html>878: add xsocket(), free(NULL) is a safe NOP (posix!).
203*cf5a6c84SAndroid Build Coastguard Worker879: inline three functions and simplify, some simplifications only show up
204*cf5a6c84SAndroid Build Coastguard Workerafter repeated inlining</a></li>
205*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/883>883</a>,
206*cf5a6c84SAndroid Build Coastguard Workerdescription: move some common code to lib/ and posix headers to toys.h.</li>
207*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/898>898</a>,
208*cf5a6c84SAndroid Build Coastguard Workerdescription: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-May/000974.html>Argument parsing. (Replace ifconfig_main() if/else staircase with a loop over
209*cf5a6c84SAndroid Build Coastguard Workeran array, genericize minus prefix logic, inline a use of set_flags().)</a></li>
210*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/905>905</a>,
211*cf5a6c84SAndroid Build Coastguard Workerdescription: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-May/000992.html>remove unnecessary wrapper function, inlining more functions,
212*cf5a6c84SAndroid Build Coastguard Workerrelying on the values of constants that don't change across architectures
213*cf5a6c84SAndroid Build Coastguard Worker(binary backwards compatability), more ifconfig_main table work,
214*cf5a6c84SAndroid Build Coastguard Workerman ioctl_list.</a></li>
215*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/906>906</a>,
216*cf5a6c84SAndroid Build Coastguard Workerdescription: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-May/000994.html>More ifconfig_main() table work, remove vestigial arguments
217*cf5a6c84SAndroid Build Coastguard Workerto functions, "a frenzy of inlining", slightly better error reporting,
218*cf5a6c84SAndroid Build Coastguard Workerdon't reinvent libc functions.</a></li>
219*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/907>907</a>,
220*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-May/000995.html>inlining show_ip_addr() with a loop and a table, inlining hex_to_binary()
221*cf5a6c84SAndroid Build Coastguard Workerand set_hw_address(), stop validating data we supplied, remove a table
222*cf5a6c84SAndroid Build Coastguard Workerthat's overkill (two entries, we don't even loop over it), when you don't need a
223*cf5a6c84SAndroid Build Coastguard WorkerNULL terminator for array, remove unnecessary memcpy(offsetof()) with
224*cf5a6c84SAndroid Build Coastguard Workerassignment, trusting -funsigned-char.</a></li>
225*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/919>919</a>,
226*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-June/001027.html>todo whitespace damage, introduce IFREQ_OFFSZ() and poke() to
227*cf5a6c84SAndroid Build Coastguard Workerifconfig_main() table logic to fold more if/else parts into the table</a></li>
228*cf5a6c84SAndroid Build Coastguard Worker<li>Status update: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-June/001033.html>Entering the home stretch on ifconfig</a> (and a <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-June/001043.html>note about infiniband</a>)</li>
229*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/921>921</a>, description: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2014-June/003508.html>Inline a couple more functions and make sockfd a global.</li>
230*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/957>957</a>, description: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-July/001121.html>Remove unused socklen and addr_to_len(), cleanup so we can merge get_device_info()/display_ifconfig().</a></li>
231*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/958>958</a>, description: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-July/001131.html>This commit removes struct if_list by unifying get_device_info() and display_ifconfig().</a></li>
232*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/1104>1104</a>, description: Merge toynet into toys.h: musl supports it and micromanaging uClibc config options isn't very interesting anymore.</li>
233*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/1127>1127</a>, description: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-November/001464.html>Start tacling ipv6 issues, beginning with display_ifconfig().</a></li>
234*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/1128>1128</a>, description: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-November/001463.html>More ipv6, make struct sockaddr_with_len go away, merge more arguments into the table in main().</a></li>
235*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/1132>1132</a>, description: promotion from pending to other</li>
236*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/1133>1133</a>, description: <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-November/001462.html>cleanup help text, remove obsolete/NOP commands</a></li>
237*cf5a6c84SAndroid Build Coastguard Worker</ul>
238*cf5a6c84SAndroid Build Coastguard Worker
239*cf5a6c84SAndroid Build Coastguard Worker<p>Status: COMPLETE.</p>
240*cf5a6c84SAndroid Build Coastguard Worker
241*cf5a6c84SAndroid Build Coastguard Worker<p>Status: in progress.</p>
242*cf5a6c84SAndroid Build Coastguard Worker
243*cf5a6c84SAndroid Build Coastguard Worker<a name=stat>
244*cf5a6c84SAndroid Build Coastguard Worker<h1><a href=/hg/toybox/log/917/toys/pending/stat.c>stat</a></h1>
245*cf5a6c84SAndroid Build Coastguard Worker
246*cf5a6c84SAndroid Build Coastguard Worker<p>A lot of the stat cleanup was done by Felix Janda.</p>
247*cf5a6c84SAndroid Build Coastguard Worker
248*cf5a6c84SAndroid Build Coastguard Worker<ul>
249*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/747>747</a>: initial submission</a></li>
250*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/810>810</a>: whitespace</li>
251*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/811>811</a>: description in commit message.</li>
252*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/871>871</a>: whitespace (reindent from 4 spaces to 2)</li>
253*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/872>872</a>: Felix Janda - <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000923.html>cleanup</a> (with discussion thread)</li>
254*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/875>885</a>: Felix Janda - <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-April/000936.html>move permission formatting (777 -> -rwxrwxrwx) from ls to lib so stat can reuse it.</a></li>
255*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/885>886</a>: Felix Janda - remove unimplemented options and clean up help text</li>
256*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/910>910</a>: Felix Janda - <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-May/001013.html>Add support for stating multiple files</a>.</li>
257*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/911>911</a>: Felix Janda - Separate stat and statfs, give stat_main() a ds[2] array to distinguish FLAG_f vs not cases, and some whitespace changes.</li>
258*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/912>912</a>: description in commit message (also <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-May/001019.html>here</a>)</li>
259*cf5a6c84SAndroid Build Coastguard Worker<li><a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-May/001024.html>design pondering</a> (leading to peek() function in lib/)</li>
260*cf5a6c84SAndroid Build Coastguard Worker
261*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/914>914</a>: description in commit message.</li>
262*cf5a6c84SAndroid Build Coastguard Worker<li>commit <a href=/hg/toybox/rev/916>916</a>: description in commit message.</li>
263*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/917>917</a>: description in commit message.</li>
264*cf5a6c84SAndroid Build Coastguard Worker<li>commit: <a href=/hg/toybox/rev/918>918</a>,
265*cf5a6c84SAndroid Build Coastguard Workerdescription: done: move pending to posix, default y, no other changes</a>.</li>
266*cf5a6c84SAndroid Build Coastguard Worker<li><a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-June/001026.html>summary</a></li>
267*cf5a6c84SAndroid Build Coastguard Worker</ul>
268*cf5a6c84SAndroid Build Coastguard Worker
269*cf5a6c84SAndroid Build Coastguard Worker<p>Status: COMPLETE.</p>
270*cf5a6c84SAndroid Build Coastguard Worker
271*cf5a6c84SAndroid Build Coastguard Worker<!--#include file="footer.html" -->
272