Denis Vlasenko
084266ed52
fix several problems with config parser:
...
a bug where it underflows the string
a bug where it never frees parser_t struct
make read_config() return 0 if parser is NULL,
make config_close() accept and ignore NULL parser -
eliminates many if() blocks
reverse the sense of parser bit flags - negative flags
are harder to grok.
hexdump: revert the change to use config parser, it is BIGGER
and also requires additional quirks in parser
*: explicitly use PARSER_NORMAL instead of 0
function old new delta
login_main 1575 1596 +21
config_close 18 29 +11
bbunpack 383 391 +8
qgravechar 106 109 +3
rtnl_tab_initialize 121 117 -4
expand 1697 1693 -4
man_main 717 712 -5
nameif_main 674 668 -6
hexdump_main 597 591 -6
read_config 217 209 -8
dnsd_main 1478 1470 -8
sysctl_main 203 189 -14
config_open2 44 25 -19
make_device 1177 1141 -36
config_read 597 549 -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/11 up/down: 43/-158) Total: -115 bytes
2008-07-26 23:08:31 +00:00
Denis Vlasenko
0f99d49ae6
*: conversion to config parser
...
function old new delta
config_read 540 597 +57
config_open2 41 44 +3
rtnl_rtprot_initialize 70 66 -4
rtnl_rttable_initialize 78 73 -5
rtnl_rtscope_initialize 88 83 -5
rtnl_rtrealm_initialize 48 43 -5
rtnl_rtdsfield_initialize 48 43 -5
process_module 566 560 -6
bbunpack 391 383 -8
rtnl_tab_initialize 279 121 -158
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/8 up/down: 60/-196) Total: -136 bytes
2008-07-24 23:38:04 +00:00
Denis Vlasenko
5415c856ea
libbb: [x]fopen_for_{read,write} introduced and used.
...
(by Valdimir)
function old new delta
config_open2 - 41 +41
config_read 507 542 +35
find_pair 169 187 +18
fopen_for_write - 14 +14
fopen_for_read - 14 +14
find_main 406 418 +12
xfopen_for_write - 10 +10
xfopen_for_read - 10 +10
popstring 134 140 +6
parse_inittab 396 401 +5
next_token 923 928 +5
pack_gzip 1659 1661 +2
bb__parsespent 117 119 +2
fallbackSort 1719 1717 -2
evalvar 1376 1374 -2
qrealloc 36 33 -3
...
...
...
...
singlemount 4579 4569 -10
process_stdin 443 433 -10
patch_main 1111 1101 -10
ifupdown_main 2175 2165 -10
file_action_grep 90 80 -10
uuidcache_init 649 637 -12
hush_main 797 785 -12
read_config 230 217 -13
dpkg_main 3835 3820 -15
read_line_input 3134 3110 -24
sysctl_main 232 203 -29
config_open 40 10 -30
WARN_BAD_LINE 44 - -44
login_main 1714 1575 -139
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737) Total: -563 bytes
2008-07-21 23:05:26 +00:00
Denis Vlasenko
a60f84ebf0
*: rename ATTRIBUTE_XXX to just XXX.
2008-07-05 09:18:54 +00:00
Denis Vlasenko
7049ff8696
whitespace fixes. no code changes
2008-06-25 09:53:17 +00:00
Denis Vlasenko
1f228985b2
whitespace fixes. no code changes
2008-04-22 00:16:29 +00:00
Denis Vlasenko
7f8f0fafdb
fbsplash: more compact support for named pipes + EOF scenario
...
function old new delta
fbsplash_main 1121 1043 -78
2008-04-04 20:38:49 +00:00
Denis Vlasenko
a38ba59cc3
fbsplash: move to /sbin; small shrink
...
function old new delta
fb_drawprogressbar 413 423 +10
fbsplash_main 1146 1121 -25
2008-03-28 11:17:35 +00:00
Denis Vlasenko
72b3442aeb
fbsplash: support this usage:
...
mkfifo cmd_pipe
fbsplash -f cmd_pipe .... &
...
echo 33 >cmd_pipe
...
echo 66 >cmd_pipe
Code size: fbsplash_main +116 bytes :(
2008-03-27 13:14:29 +00:00
Denis Vlasenko
11b9f26610
fbsplash: fix broken handling of buffered case:
...
"{echo 45; echo 33; } | { sleep 1; fbsplash -f - ...; }"
function old new delta
fb_drawprogressbar - 413 +413
xmalloc_fgetline - 46 +46
xmalloc_reads 184 183 -1
xmalloc_getline 46 - -46
fbsplash_main 1472 1030 -442
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 0/2 up/down: 459/-489) Total: -30 bytes
text data bss dec hex filename
801181 641 7380 809202 c58f2 busybox_old
801151 641 7380 809172 c58d4 busybox_unstripped
2008-03-26 20:06:24 +00:00
Denis Vlasenko
25a9c17f55
fbsplash: cosmetic comment and Config text fixes; rename .ini -> .cfg
2008-03-26 15:12:11 +00:00
Denis Vlasenko
c6dbb85c9e
fbsplash: shrink, better help text; inifile cannot specify image now;
...
image can come from stdin
function old new delta
packed_usage 23872 23932 +60
static.param_names - 57 +57
fbsplash_main 1525 1472 -53
static.param_value 100 - -100
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/1 up/down: 117/-153) Total: -36 bytes
text data bss dec hex filename
801202 641 7380 809223 c5907 busybox_old
801181 641 7380 809202 c58f2 busybox_unstripped
2008-03-26 14:57:49 +00:00