summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko2008-07-16 11:00:16 +0000
committerDenis Vlasenko2008-07-16 11:00:16 +0000
commit55f7912ddaea7c21068a48841a6eb933e5f286ee (patch)
tree8e048772811061a8db2429c3ef99e8205e1de1f6 /include
parent8ddb6410edb0c4e87b4c6b9d0887868977c8eff5 (diff)
downloadbusybox-55f7912ddaea7c21068a48841a6eb933e5f286ee.zip
busybox-55f7912ddaea7c21068a48841a6eb933e5f286ee.tar.gz
libbb: get rid of statics in dump.c; code shrinks a lot too
function old new delta alloc_dumper - 26 +26 hexdump_main 600 601 +1 static.done 1 - -1 static.ateof 1 - -1 bb_dump_vflag 1 - -1 static.savp 4 - -4 static.nextfs 4 - -4 static.curp 4 - -4 exitval 4 - -4 endfu 4 - -4 bb_dump_length 4 - -4 bb_dump_fshead 4 - -4 bb_dump_blocksize 4 - -4 _argv 4 - -4 bb_dump_add 365 358 -7 savaddress 8 - -8 eaddress 8 - -8 bb_dump_skip 8 - -8 address 8 - -8 bb_dump_dump 2748 2672 -76 next 538 445 -93 ------------------------------------------------------------------------------ (add/remove: 1/16 grow/shrink: 1/3 up/down: 27/-247) Total: -220 bytes text data bss dec hex filename 789458 607 6764 796829 c289d busybox_old 789309 601 6696 796606 c27be busybox_unstripped
Diffstat (limited to 'include')
-rw-r--r--include/dump.h35
1 files changed, 18 insertions, 17 deletions
diff --git a/include/dump.h b/include/dump.h
index da3e66d..44f2082 100644
--- a/include/dump.h
+++ b/include/dump.h
@@ -18,10 +18,10 @@
#define F_UINT 0x200 /* %[ouXx] */
#define F_TEXT 0x400 /* no conversions */
-enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */
+enum dump_vflag_t { ALL, DUP, FIRST, WAIT }; /* -v values */
-typedef struct _pr {
- struct _pr *nextpr; /* next print unit */
+typedef struct PR {
+ struct PR *nextpr; /* next print unit */
unsigned flags; /* flag values */
int bcnt; /* byte count */
char *cchar; /* conversion character */
@@ -29,30 +29,31 @@ typedef struct _pr {
char *nospace; /* no whitespace version */
} PR;
-typedef struct _fu {
- struct _fu *nextfu; /* next format unit */
- struct _pr *nextpr; /* next print unit */
+typedef struct FU {
+ struct FU *nextfu; /* next format unit */
+ struct PR *nextpr; /* next print unit */
unsigned flags; /* flag values */
int reps; /* repetition count */
int bcnt; /* byte count */
char *fmt; /* format string */
} FU;
-typedef struct _fs { /* format strings */
- struct _fs *nextfs; /* linked list of format strings */
- struct _fu *nextfu; /* linked list of format units */
+typedef struct FS { /* format strings */
+ struct FS *nextfs; /* linked list of format strings */
+ struct FU *nextfu; /* linked list of format units */
int bcnt;
} FS;
-extern void bb_dump_add(const char *fmt) FAST_FUNC;
-extern int bb_dump_dump(char **argv) FAST_FUNC;
-extern int bb_dump_size(FS * fs) FAST_FUNC;
+typedef struct dumper_t {
+ off_t dump_skip; /* bytes to skip */
+ int dump_length; /* max bytes to read */
+ smallint dump_vflag; /*enum dump_vflag_t*/
+ FS *fshead;
+} dumper_t;
-extern FS *bb_dump_fshead; /* head of format strings */
-extern int bb_dump_blocksize; /* data block size */
-extern int bb_dump_length; /* max bytes to read */
-extern smallint /*enum _vflag*/ bb_dump_vflag;
-extern off_t bb_dump_skip; /* bytes to skip */
+dumper_t* alloc_dumper(void) FAST_FUNC;
+extern void bb_dump_add(dumper_t *dumper, const char *fmt) FAST_FUNC;
+extern int bb_dump_dump(dumper_t *dumper, char **argv) FAST_FUNC;
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility pop