From d88f94a5df3a2edb8ba56fab5c13674b452f87ab Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 5 Apr 2017 18:17:17 +0200 Subject: nl: new applet; also implement cat -nb (similar functionality to nl) function old new delta nl_main - 201 +201 print_numbered_lines - 115 +115 cat_main 36 149 +113 static.nl_longopts - 106 +106 packed_usage 31081 31182 +101 applet_main 1488 1492 +4 applet_names 2575 2578 +3 applet_suid 93 94 +1 applet_install_loc 186 187 +1 ------------------------------------------------------------------------------ (add/remove: 4/0 grow/shrink: 6/0 up/down: 645/0) Total: 645 bytes Signed-off-by: Denys Vlasenko --- include/libbb.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/libbb.h') diff --git a/include/libbb.h b/include/libbb.h index e97efcb6e..a2c699b54 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1271,6 +1271,16 @@ int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; void bb_displayroutes(int noresolve, int netstatfmt) FAST_FUNC; #endif +struct number_state { + unsigned width; + unsigned start; + unsigned inc; + const char *sep; + const char *empty_str; + smallint all, nonempty; +}; +void print_numbered_lines(struct number_state *ns, const char *filename) FAST_FUNC; + /* Networking */ /* This structure defines protocol families and their handlers. */ -- cgit v1.2.3