aboutsummaryrefslogtreecommitdiff
path: root/coreutils/stty.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
commit6ca409e0e4c198fe3081346eebbae3f068fe605a (patch)
tree060cb05d99220a1eda399194d1209c269f0e8cd8 /coreutils/stty.c
parent4185548984357df91311f30c8e43d95f33922576 (diff)
downloadbusybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.bz2
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.zip
trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount of padding (unfortunately, needs hand editing ATM). *: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts size saving: 0.5k
Diffstat (limited to 'coreutils/stty.c')
-rw-r--r--coreutils/stty.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c
index fbb72baa9..863f28d92 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -127,28 +127,28 @@ enum {
127 control, input, output, local, combination 127 control, input, output, local, combination
128}; 128};
129 129
130static const char evenp [] = "evenp"; 130static const char evenp [] ALIGN1 = "evenp";
131static const char raw [] = "raw"; 131static const char raw [] ALIGN1 = "raw";
132static const char stty_min [] = "min"; 132static const char stty_min [] ALIGN1 = "min";
133static const char stty_time [] = "time"; 133static const char stty_time [] ALIGN1 = "time";
134static const char stty_swtch[] = "swtch"; 134static const char stty_swtch[] ALIGN1 = "swtch";
135static const char stty_eol [] = "eol"; 135static const char stty_eol [] ALIGN1 = "eol";
136static const char stty_eof [] = "eof"; 136static const char stty_eof [] ALIGN1 = "eof";
137static const char parity [] = "parity"; 137static const char parity [] ALIGN1 = "parity";
138static const char stty_oddp [] = "oddp"; 138static const char stty_oddp [] ALIGN1 = "oddp";
139static const char stty_nl [] = "nl"; 139static const char stty_nl [] ALIGN1 = "nl";
140static const char stty_ek [] = "ek"; 140static const char stty_ek [] ALIGN1 = "ek";
141static const char stty_sane [] = "sane"; 141static const char stty_sane [] ALIGN1 = "sane";
142static const char cbreak [] = "cbreak"; 142static const char cbreak [] ALIGN1 = "cbreak";
143static const char stty_pass8[] = "pass8"; 143static const char stty_pass8[] ALIGN1 = "pass8";
144static const char litout [] = "litout"; 144static const char litout [] ALIGN1 = "litout";
145static const char cooked [] = "cooked"; 145static const char cooked [] ALIGN1 = "cooked";
146static const char decctlq [] = "decctlq"; 146static const char decctlq [] ALIGN1 = "decctlq";
147static const char stty_tabs [] = "tabs"; 147static const char stty_tabs [] ALIGN1 = "tabs";
148static const char stty_lcase[] = "lcase"; 148static const char stty_lcase[] ALIGN1 = "lcase";
149static const char stty_LCASE[] = "LCASE"; 149static const char stty_LCASE[] ALIGN1 = "LCASE";
150static const char stty_crt [] = "crt"; 150static const char stty_crt [] ALIGN1 = "crt";
151static const char stty_dec [] = "dec"; 151static const char stty_dec [] ALIGN1 = "dec";
152 152
153/* Flags for 'struct mode_info' */ 153/* Flags for 'struct mode_info' */
154#define SANE_SET 1 /* Set in 'sane' mode */ 154#define SANE_SET 1 /* Set in 'sane' mode */
@@ -158,7 +158,7 @@ static const char stty_dec [] = "dec";
158 158
159/* Each mode */ 159/* Each mode */
160struct mode_info { 160struct mode_info {
161 const char * const name; /* Name given on command line */ 161 const char *const name; /* Name given on command line */
162 const unsigned char type; /* Which structure element to change */ 162 const unsigned char type; /* Which structure element to change */
163 const unsigned char flags; /* Setting and display options */ 163 const unsigned char flags; /* Setting and display options */
164 /* were using short here, but ppc32 was unhappy: */ 164 /* were using short here, but ppc32 was unhappy: */
@@ -324,7 +324,7 @@ enum {
324 324
325/* Control character settings */ 325/* Control character settings */
326struct control_info { 326struct control_info {
327 const char * const name; /* Name given on command line */ 327 const char *const name; /* Name given on command line */
328 const unsigned char saneval; /* Value to set for 'stty sane' */ 328 const unsigned char saneval; /* Value to set for 'stty sane' */
329 const unsigned char offset; /* Offset in c_cc */ 329 const unsigned char offset; /* Offset in c_cc */
330}; 330};
@@ -417,11 +417,11 @@ static const char *visible(unsigned ch)
417 417
418static tcflag_t *mode_type_flag(unsigned type, const struct termios *mode) 418static tcflag_t *mode_type_flag(unsigned type, const struct termios *mode)
419{ 419{
420 static const unsigned char tcflag_offsets[] = { 420 static const unsigned char tcflag_offsets[] ALIGN1 = {
421 offsetof(struct termios, c_cflag), /* control */ 421 offsetof(struct termios, c_cflag), /* control */
422 offsetof(struct termios, c_iflag), /* input */ 422 offsetof(struct termios, c_iflag), /* input */
423 offsetof(struct termios, c_oflag), /* output */ 423 offsetof(struct termios, c_oflag), /* output */
424 offsetof(struct termios, c_lflag), /* local */ 424 offsetof(struct termios, c_lflag) /* local */
425 }; 425 };
426 426
427 if (type <= local) { 427 if (type <= local) {
@@ -430,7 +430,7 @@ static tcflag_t *mode_type_flag(unsigned type, const struct termios *mode)
430 return NULL; 430 return NULL;
431} 431}
432 432
433static void set_speed_or_die(enum speed_setting type, const char * const arg, 433static void set_speed_or_die(enum speed_setting type, const char *const arg,
434 struct termios * const mode) 434 struct termios * const mode)
435{ 435{
436 speed_t baud; 436 speed_t baud;
@@ -560,9 +560,9 @@ enum {
560 param_ospeed = 8 | 0x80, 560 param_ospeed = 8 | 0x80,
561}; 561};
562 562
563static int find_param(const char * const name) 563static int find_param(const char *const name)
564{ 564{
565 static const char params[] = 565 static const char params[] ALIGN1 =
566 "line\0" /* 1 */ 566 "line\0" /* 1 */
567 "rows\0" /* 2 */ 567 "rows\0" /* 2 */
568 "cols\0" /* 3 */ 568 "cols\0" /* 3 */