diff options
| author | Mark Whitley <markw@lineo.com> | 2000-12-07 19:56:48 +0000 |
|---|---|---|
| committer | Mark Whitley <markw@lineo.com> | 2000-12-07 19:56:48 +0000 |
| commit | f57c944e09417edcbcd69f2b01b937cadef39db2 (patch) | |
| tree | a55822621d54bd82c54e272fa986e45698fea0f1 /console-tools | |
| parent | 7b5c16ebe5f1b057603cf1c0b0187be418725c42 (diff) | |
| download | busybox-w32-f57c944e09417edcbcd69f2b01b937cadef39db2.tar.gz busybox-w32-f57c944e09417edcbcd69f2b01b937cadef39db2.tar.bz2 busybox-w32-f57c944e09417edcbcd69f2b01b937cadef39db2.zip | |
Changed names of functions in utility.c and all affected files, to make
compliant with the style guide. Everybody rebuild your tags file!
Diffstat (limited to 'console-tools')
| -rw-r--r-- | console-tools/deallocvt.c | 6 | ||||
| -rw-r--r-- | console-tools/dumpkmap.c | 4 | ||||
| -rw-r--r-- | console-tools/loadacm.c | 16 | ||||
| -rw-r--r-- | console-tools/loadfont.c | 28 | ||||
| -rw-r--r-- | console-tools/loadkmap.c | 8 | ||||
| -rw-r--r-- | console-tools/setkeycodes.c | 6 |
6 files changed, 34 insertions, 34 deletions
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c index 4600c0d05..ebdce7b24 100644 --- a/console-tools/deallocvt.c +++ b/console-tools/deallocvt.c | |||
| @@ -35,12 +35,12 @@ printf("erik: B\n"); | |||
| 35 | for (i = 1; i < argc; i++) { | 35 | for (i = 1; i < argc; i++) { |
| 36 | num = atoi(argv[i]); | 36 | num = atoi(argv[i]); |
| 37 | if (num == 0) | 37 | if (num == 0) |
| 38 | errorMsg("0: illegal VT number\n"); | 38 | error_msg("0: illegal VT number\n"); |
| 39 | else if (num == 1) | 39 | else if (num == 1) |
| 40 | errorMsg("VT 1 cannot be deallocated\n"); | 40 | error_msg("VT 1 cannot be deallocated\n"); |
| 41 | else if (ioctl(fd, VT_DISALLOCATE, num)) { | 41 | else if (ioctl(fd, VT_DISALLOCATE, num)) { |
| 42 | perror("VT_DISALLOCATE"); | 42 | perror("VT_DISALLOCATE"); |
| 43 | fatalError("could not deallocate console %d\n", num); | 43 | error_msg_and_die("could not deallocate console %d\n", num); |
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | printf("erik: C\n"); | 46 | printf("erik: C\n"); |
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c index 77689fc84..3ff5ef691 100644 --- a/console-tools/dumpkmap.c +++ b/console-tools/dumpkmap.c | |||
| @@ -50,7 +50,7 @@ int dumpkmap_main(int argc, char **argv) | |||
| 50 | 50 | ||
| 51 | fd = open("/dev/tty0", O_RDWR); | 51 | fd = open("/dev/tty0", O_RDWR); |
| 52 | if (fd < 0) { | 52 | if (fd < 0) { |
| 53 | errorMsg("Error opening /dev/tty0: %s\n", strerror(errno)); | 53 | error_msg("Error opening /dev/tty0: %s\n", strerror(errno)); |
| 54 | return EXIT_FAILURE; | 54 | return EXIT_FAILURE; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| @@ -78,7 +78,7 @@ int dumpkmap_main(int argc, char **argv) | |||
| 78 | ke.kb_table = i; | 78 | ke.kb_table = i; |
| 79 | if (ioctl(fd, KDGKBENT, &ke) < 0) { | 79 | if (ioctl(fd, KDGKBENT, &ke) < 0) { |
| 80 | 80 | ||
| 81 | errorMsg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value); | 81 | error_msg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value); |
| 82 | } | 82 | } |
| 83 | else { | 83 | else { |
| 84 | write(1,(void*)&ke.kb_value,2); | 84 | write(1,(void*)&ke.kb_value,2); |
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c index 156210890..a69664031 100644 --- a/console-tools/loadacm.c +++ b/console-tools/loadacm.c | |||
| @@ -39,12 +39,12 @@ int loadacm_main(int argc, char **argv) | |||
| 39 | 39 | ||
| 40 | fd = open("/dev/tty", O_RDWR); | 40 | fd = open("/dev/tty", O_RDWR); |
| 41 | if (fd < 0) { | 41 | if (fd < 0) { |
| 42 | errorMsg("Error opening /dev/tty1: %s\n", strerror(errno)); | 42 | error_msg("Error opening /dev/tty1: %s\n", strerror(errno)); |
| 43 | return EXIT_FAILURE; | 43 | return EXIT_FAILURE; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | if (screen_map_load(fd, stdin)) { | 46 | if (screen_map_load(fd, stdin)) { |
| 47 | errorMsg("Error loading acm: %s\n", strerror(errno)); | 47 | error_msg("Error loading acm: %s\n", strerror(errno)); |
| 48 | return EXIT_FAILURE; | 48 | return EXIT_FAILURE; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| @@ -72,7 +72,7 @@ int screen_map_load(int fd, FILE * fp) | |||
| 72 | if (parse_failed) { | 72 | if (parse_failed) { |
| 73 | if (-1 == fseek(fp, 0, SEEK_SET)) { | 73 | if (-1 == fseek(fp, 0, SEEK_SET)) { |
| 74 | if (errno == ESPIPE) | 74 | if (errno == ESPIPE) |
| 75 | errorMsg("16bit screen-map MUST be a regular file.\n"), | 75 | error_msg("16bit screen-map MUST be a regular file.\n"), |
| 76 | exit(1); | 76 | exit(1); |
| 77 | else | 77 | else |
| 78 | perror("fseek failed reading binary 16bit screen-map"), | 78 | perror("fseek failed reading binary 16bit screen-map"), |
| @@ -83,7 +83,7 @@ int screen_map_load(int fd, FILE * fp) | |||
| 83 | perror("Cannot read [new] map from file"), exit(1); | 83 | perror("Cannot read [new] map from file"), exit(1); |
| 84 | #if 0 | 84 | #if 0 |
| 85 | else | 85 | else |
| 86 | errorMsg("Input screen-map is binary.\n"); | 86 | error_msg("Input screen-map is binary.\n"); |
| 87 | #endif | 87 | #endif |
| 88 | } | 88 | } |
| 89 | 89 | ||
| @@ -100,7 +100,7 @@ int screen_map_load(int fd, FILE * fp) | |||
| 100 | /* rewind... */ | 100 | /* rewind... */ |
| 101 | if (-1 == fseek(fp, 0, SEEK_SET)) { | 101 | if (-1 == fseek(fp, 0, SEEK_SET)) { |
| 102 | if (errno == ESPIPE) | 102 | if (errno == ESPIPE) |
| 103 | errorMsg("Assuming 8bit screen-map - MUST be a regular file.\n"), | 103 | error_msg("Assuming 8bit screen-map - MUST be a regular file.\n"), |
| 104 | exit(1); | 104 | exit(1); |
| 105 | else | 105 | else |
| 106 | perror("fseek failed assuming 8bit screen-map"), exit(1); | 106 | perror("fseek failed assuming 8bit screen-map"), exit(1); |
| @@ -113,7 +113,7 @@ int screen_map_load(int fd, FILE * fp) | |||
| 113 | if (-1 == fseek(fp, 0, SEEK_SET)) { | 113 | if (-1 == fseek(fp, 0, SEEK_SET)) { |
| 114 | if (errno == ESPIPE) | 114 | if (errno == ESPIPE) |
| 115 | /* should not - it succedeed above */ | 115 | /* should not - it succedeed above */ |
| 116 | errorMsg("fseek() returned ESPIPE !\n"), | 116 | error_msg("fseek() returned ESPIPE !\n"), |
| 117 | exit(1); | 117 | exit(1); |
| 118 | else | 118 | else |
| 119 | perror("fseek for binary 8bit screen-map"), exit(1); | 119 | perror("fseek for binary 8bit screen-map"), exit(1); |
| @@ -123,7 +123,7 @@ int screen_map_load(int fd, FILE * fp) | |||
| 123 | perror("Cannot read [old] map from file"), exit(1); | 123 | perror("Cannot read [old] map from file"), exit(1); |
| 124 | #if 0 | 124 | #if 0 |
| 125 | else | 125 | else |
| 126 | errorMsg("Input screen-map is binary.\n"); | 126 | error_msg("Input screen-map is binary.\n"); |
| 127 | #endif | 127 | #endif |
| 128 | } | 128 | } |
| 129 | 129 | ||
| @@ -132,7 +132,7 @@ int screen_map_load(int fd, FILE * fp) | |||
| 132 | else | 132 | else |
| 133 | return 0; | 133 | return 0; |
| 134 | } | 134 | } |
| 135 | errorMsg("Error parsing symbolic map\n"); | 135 | error_msg("Error parsing symbolic map\n"); |
| 136 | return(1); | 136 | return(1); |
| 137 | } | 137 | } |
| 138 | 138 | ||
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index f69f52fd8..13a196fb0 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c | |||
| @@ -48,7 +48,7 @@ extern int loadfont_main(int argc, char **argv) | |||
| 48 | 48 | ||
| 49 | fd = open("/dev/tty0", O_RDWR); | 49 | fd = open("/dev/tty0", O_RDWR); |
| 50 | if (fd < 0) | 50 | if (fd < 0) |
| 51 | fatalPerror("Error opening /dev/tty0"); | 51 | perror_msg_and_die("Error opening /dev/tty0"); |
| 52 | loadnewfont(fd); | 52 | loadnewfont(fd); |
| 53 | 53 | ||
| 54 | return EXIT_SUCCESS; | 54 | return EXIT_SUCCESS; |
| @@ -62,7 +62,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize) | |||
| 62 | memset(buf, 0, sizeof(buf)); | 62 | memset(buf, 0, sizeof(buf)); |
| 63 | 63 | ||
| 64 | if (unit < 1 || unit > 32) | 64 | if (unit < 1 || unit > 32) |
| 65 | fatalError("Bad character size %d\n", unit); | 65 | error_msg_and_die("Bad character size %d\n", unit); |
| 66 | 66 | ||
| 67 | for (i = 0; i < fontsize; i++) | 67 | for (i = 0; i < fontsize; i++) |
| 68 | memcpy(buf + (32 * i), inbuf + (unit * i), unit); | 68 | memcpy(buf + (32 * i), inbuf + (unit * i), unit); |
| @@ -77,11 +77,11 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize) | |||
| 77 | 77 | ||
| 78 | if (ioctl(fd, PIO_FONTX, &cfd) == 0) | 78 | if (ioctl(fd, PIO_FONTX, &cfd) == 0) |
| 79 | return; /* success */ | 79 | return; /* success */ |
| 80 | perrorMsg("PIO_FONTX ioctl error (trying PIO_FONT)"); | 80 | perror_msg("PIO_FONTX ioctl error (trying PIO_FONT)"); |
| 81 | } | 81 | } |
| 82 | #endif | 82 | #endif |
| 83 | if (ioctl(fd, PIO_FONT, buf)) | 83 | if (ioctl(fd, PIO_FONT, buf)) |
| 84 | fatalPerror("PIO_FONT ioctl error"); | 84 | perror_msg_and_die("PIO_FONT ioctl error"); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | static void | 87 | static void |
| @@ -119,11 +119,11 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize) | |||
| 119 | if (ioctl(fd, PIO_UNIMAPCLR, &advice)) { | 119 | if (ioctl(fd, PIO_UNIMAPCLR, &advice)) { |
| 120 | #ifdef ENOIOCTLCMD | 120 | #ifdef ENOIOCTLCMD |
| 121 | if (errno == ENOIOCTLCMD) { | 121 | if (errno == ENOIOCTLCMD) { |
| 122 | errorMsg("It seems this kernel is older than 1.1.92\n"); | 122 | error_msg("It seems this kernel is older than 1.1.92\n"); |
| 123 | fatalError("No Unicode mapping table loaded.\n"); | 123 | error_msg_and_die("No Unicode mapping table loaded.\n"); |
| 124 | } else | 124 | } else |
| 125 | #endif | 125 | #endif |
| 126 | fatalPerror("PIO_UNIMAPCLR"); | 126 | perror_msg_and_die("PIO_UNIMAPCLR"); |
| 127 | } | 127 | } |
| 128 | ud.entry_ct = ct; | 128 | ud.entry_ct = ct; |
| 129 | ud.entries = up; | 129 | ud.entries = up; |
| @@ -133,7 +133,7 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize) | |||
| 133 | /* change advice parameters */ | 133 | /* change advice parameters */ |
| 134 | } | 134 | } |
| 135 | #endif | 135 | #endif |
| 136 | fatalPerror("PIO_UNIMAP"); | 136 | perror_msg_and_die("PIO_UNIMAP"); |
| 137 | } | 137 | } |
| 138 | } | 138 | } |
| 139 | 139 | ||
| @@ -150,13 +150,13 @@ static void loadnewfont(int fd) | |||
| 150 | */ | 150 | */ |
| 151 | inputlth = fread(inbuf, 1, sizeof(inbuf), stdin); | 151 | inputlth = fread(inbuf, 1, sizeof(inbuf), stdin); |
| 152 | if (ferror(stdin)) | 152 | if (ferror(stdin)) |
| 153 | fatalPerror("Error reading input font"); | 153 | perror_msg_and_die("Error reading input font"); |
| 154 | /* use malloc/realloc in case of giant files; | 154 | /* use malloc/realloc in case of giant files; |
| 155 | maybe these do not occur: 16kB for the font, | 155 | maybe these do not occur: 16kB for the font, |
| 156 | and 16kB for the map leaves 32 unicode values | 156 | and 16kB for the map leaves 32 unicode values |
| 157 | for each font position */ | 157 | for each font position */ |
| 158 | if (!feof(stdin)) | 158 | if (!feof(stdin)) |
| 159 | fatalPerror("Font too large"); | 159 | perror_msg_and_die("Font too large"); |
| 160 | 160 | ||
| 161 | /* test for psf first */ | 161 | /* test for psf first */ |
| 162 | { | 162 | { |
| @@ -174,11 +174,11 @@ static void loadnewfont(int fd) | |||
| 174 | goto no_psf; | 174 | goto no_psf; |
| 175 | 175 | ||
| 176 | if (psfhdr.mode > PSF_MAXMODE) | 176 | if (psfhdr.mode > PSF_MAXMODE) |
| 177 | fatalError("Unsupported psf file mode\n"); | 177 | error_msg_and_die("Unsupported psf file mode\n"); |
| 178 | fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256); | 178 | fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256); |
| 179 | #if !defined( PIO_FONTX ) || defined( __sparc__ ) | 179 | #if !defined( PIO_FONTX ) || defined( __sparc__ ) |
| 180 | if (fontsize != 256) | 180 | if (fontsize != 256) |
| 181 | fatalError("Only fontsize 256 supported\n"); | 181 | error_msg_and_die("Only fontsize 256 supported\n"); |
| 182 | #endif | 182 | #endif |
| 183 | hastable = (psfhdr.mode & PSF_MODEHASTAB); | 183 | hastable = (psfhdr.mode & PSF_MODEHASTAB); |
| 184 | unit = psfhdr.charsize; | 184 | unit = psfhdr.charsize; |
| @@ -186,7 +186,7 @@ static void loadnewfont(int fd) | |||
| 186 | 186 | ||
| 187 | head = head0 + fontsize * unit; | 187 | head = head0 + fontsize * unit; |
| 188 | if (head > inputlth || (!hastable && head != inputlth)) | 188 | if (head > inputlth || (!hastable && head != inputlth)) |
| 189 | fatalError("Input file: bad length\n"); | 189 | error_msg_and_die("Input file: bad length\n"); |
| 190 | do_loadfont(fd, inbuf + head0, unit, fontsize); | 190 | do_loadfont(fd, inbuf + head0, unit, fontsize); |
| 191 | if (hastable) | 191 | if (hastable) |
| 192 | do_loadtable(fd, inbuf + head, inputlth - head, fontsize); | 192 | do_loadtable(fd, inbuf + head, inputlth - head, fontsize); |
| @@ -201,7 +201,7 @@ static void loadnewfont(int fd) | |||
| 201 | } else { | 201 | } else { |
| 202 | /* bare font */ | 202 | /* bare font */ |
| 203 | if (inputlth & 0377) | 203 | if (inputlth & 0377) |
| 204 | fatalError("Bad input file size\n"); | 204 | error_msg_and_die("Bad input file size\n"); |
| 205 | offset = 0; | 205 | offset = 0; |
| 206 | unit = inputlth / 256; | 206 | unit = inputlth / 256; |
| 207 | } | 207 | } |
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c index 7dfa670f4..fc2439864 100644 --- a/console-tools/loadkmap.c +++ b/console-tools/loadkmap.c | |||
| @@ -52,14 +52,14 @@ int loadkmap_main(int argc, char **argv) | |||
| 52 | 52 | ||
| 53 | fd = open("/dev/tty0", O_RDWR); | 53 | fd = open("/dev/tty0", O_RDWR); |
| 54 | if (fd < 0) | 54 | if (fd < 0) |
| 55 | fatalPerror("Error opening /dev/tty0"); | 55 | perror_msg_and_die("Error opening /dev/tty0"); |
| 56 | 56 | ||
| 57 | read(0, buff, 7); | 57 | read(0, buff, 7); |
| 58 | if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7)) | 58 | if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7)) |
| 59 | fatalError("This is not a valid binary keymap.\n"); | 59 | error_msg_and_die("This is not a valid binary keymap.\n"); |
| 60 | 60 | ||
| 61 | if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) | 61 | if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) |
| 62 | fatalPerror("Error reading keymap flags"); | 62 | perror_msg_and_die("Error reading keymap flags"); |
| 63 | 63 | ||
| 64 | ibuff = (u_short *) xmalloc(ibuffsz); | 64 | ibuff = (u_short *) xmalloc(ibuffsz); |
| 65 | 65 | ||
| @@ -68,7 +68,7 @@ int loadkmap_main(int argc, char **argv) | |||
| 68 | pos = 0; | 68 | pos = 0; |
| 69 | while (pos < ibuffsz) { | 69 | while (pos < ibuffsz) { |
| 70 | if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos)) < 0) | 70 | if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos)) < 0) |
| 71 | fatalPerror("Error reading keymap"); | 71 | perror_msg_and_die("Error reading keymap"); |
| 72 | pos += readsz; | 72 | pos += readsz; |
| 73 | } | 73 | } |
| 74 | for (j = 0; j < NR_KEYS; j++) { | 74 | for (j = 0; j < NR_KEYS; j++) { |
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c index 6a31e042a..7db398d77 100644 --- a/console-tools/setkeycodes.c +++ b/console-tools/setkeycodes.c | |||
| @@ -52,18 +52,18 @@ setkeycodes_main(int argc, char** argv) | |||
| 52 | a.keycode = atoi(argv[2]); | 52 | a.keycode = atoi(argv[2]); |
| 53 | a.scancode = sc = strtol(argv[1], &ep, 16); | 53 | a.scancode = sc = strtol(argv[1], &ep, 16); |
| 54 | if (*ep) { | 54 | if (*ep) { |
| 55 | fatalError("error reading SCANCODE: '%s'\n", argv[1]); | 55 | error_msg_and_die("error reading SCANCODE: '%s'\n", argv[1]); |
| 56 | } | 56 | } |
| 57 | if (a.scancode > 127) { | 57 | if (a.scancode > 127) { |
| 58 | a.scancode -= 0xe000; | 58 | a.scancode -= 0xe000; |
| 59 | a.scancode += 128; | 59 | a.scancode += 128; |
| 60 | } | 60 | } |
| 61 | if (a.scancode > 255 || a.keycode > 127) { | 61 | if (a.scancode > 255 || a.keycode > 127) { |
| 62 | fatalError("SCANCODE or KEYCODE outside bounds\n"); | 62 | error_msg_and_die("SCANCODE or KEYCODE outside bounds\n"); |
| 63 | } | 63 | } |
| 64 | if (ioctl(fd,KDSETKEYCODE,&a)) { | 64 | if (ioctl(fd,KDSETKEYCODE,&a)) { |
| 65 | perror("KDSETKEYCODE"); | 65 | perror("KDSETKEYCODE"); |
| 66 | fatalError("failed to set SCANCODE %x to KEYCODE %d\n", sc, a.keycode); | 66 | error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d\n", sc, a.keycode); |
| 67 | } | 67 | } |
| 68 | argc -= 2; | 68 | argc -= 2; |
| 69 | argv += 2; | 69 | argv += 2; |
