aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-09-01 12:01:17 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-09-01 12:01:17 +0200
commit0004e994934374b5695e004bbcb7b1fd67a170f2 (patch)
tree6cbf7c0042fbd265b34f28111726b0f04c536818 /include
parent9dc04124d5a3f0c9be249287817a964691e187b0 (diff)
downloadbusybox-w32-0004e994934374b5695e004bbcb7b1fd67a170f2.tar.gz
busybox-w32-0004e994934374b5695e004bbcb7b1fd67a170f2.tar.bz2
busybox-w32-0004e994934374b5695e004bbcb7b1fd67a170f2.zip
better shared strings trick
text data bss dec hex filename 861980 441 7540 869961 d4649 busybox_old 861914 441 7540 869895 d4607 busybox_unstripped Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h35
1 files changed, 25 insertions, 10 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 6fb0438f5..4b69c855f 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1573,12 +1573,22 @@ void bb_progress_update(bb_progress_t *p, const char *curfile,
1573 off_t totalsize) FAST_FUNC; 1573 off_t totalsize) FAST_FUNC;
1574 1574
1575extern const char *applet_name; 1575extern const char *applet_name;
1576
1577/* Some older linkers don't perform string merging, we used to have common strings
1578 * as global arrays to do it by hand. But:
1579 * (1) newer linkers do it themselves,
1580 * (2) however, they DONT merge string constants with global arrays,
1581 * even if the value is the same (!). Thus global arrays actually
1582 * increased size a bit: for example, "/etc/passwd" string from libc
1583 * wasn't merged with bb_path_passwd_file[] array!
1584 * Therefore now we use #defines.
1585 */
1576/* "BusyBox vN.N.N (timestamp or extra_version)" */ 1586/* "BusyBox vN.N.N (timestamp or extra_version)" */
1577extern const char bb_banner[]; 1587extern const char bb_banner[];
1578extern const char bb_msg_memory_exhausted[]; 1588extern const char bb_msg_memory_exhausted[];
1579extern const char bb_msg_invalid_date[]; 1589extern const char bb_msg_invalid_date[];
1580extern const char bb_msg_read_error[]; 1590#define bb_msg_read_error "read error"
1581extern const char bb_msg_write_error[]; 1591#define bb_msg_write_error "write error"
1582extern const char bb_msg_unknown[]; 1592extern const char bb_msg_unknown[];
1583extern const char bb_msg_can_not_create_raw_socket[]; 1593extern const char bb_msg_can_not_create_raw_socket[];
1584extern const char bb_msg_perm_denied_are_you_root[]; 1594extern const char bb_msg_perm_denied_are_you_root[];
@@ -1588,18 +1598,23 @@ extern const char bb_msg_invalid_arg[];
1588extern const char bb_msg_standard_input[]; 1598extern const char bb_msg_standard_input[];
1589extern const char bb_msg_standard_output[]; 1599extern const char bb_msg_standard_output[];
1590 1600
1591extern const char bb_str_default[];
1592/* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */ 1601/* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */
1593extern const char bb_hexdigits_upcase[]; 1602extern const char bb_hexdigits_upcase[];
1594 1603
1595extern const char bb_path_mtab_file[];
1596extern const char bb_path_passwd_file[];
1597extern const char bb_path_shadow_file[];
1598extern const char bb_path_gshadow_file[];
1599extern const char bb_path_group_file[];
1600extern const char bb_path_motd_file[];
1601extern const char bb_path_wtmp_file[]; 1604extern const char bb_path_wtmp_file[];
1602extern const char bb_dev_null[]; 1605
1606/* Busybox mount uses either /proc/mounts or /etc/mtab to
1607 * get the list of currently mounted filesystems */
1608#define bb_path_mtab_file IF_FEATURE_MTAB_SUPPORT("/etc/mtab")IF_NOT_FEATURE_MTAB_SUPPORT("/proc/mounts")
1609
1610#define bb_path_passwd_file "/etc/passwd"
1611#define bb_path_shadow_file "/etc/shadow"
1612#define bb_path_gshadow_file "/etc/gshadow"
1613#define bb_path_group_file "/etc/group"
1614
1615#define bb_path_motd_file "/etc/motd"
1616
1617#define bb_dev_null "/dev/null"
1603extern const char bb_busybox_exec_path[]; 1618extern const char bb_busybox_exec_path[];
1604/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, 1619/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
1605 * but I want to save a few bytes here */ 1620 * but I want to save a few bytes here */