aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-04-19 03:59:10 +0000
committerErik Andersen <andersen@codepoet.org>2000-04-19 03:59:10 +0000
commit3fe7f9f20b6562e667ff3c9388a6ce00bd1ba19f (patch)
tree98c78a2d9487f52752ed3057d9dd233be6f65161
parenta3e57ca7008cbaf612675b9de3dd18109f8150de (diff)
downloadbusybox-w32-3fe7f9f20b6562e667ff3c9388a6ce00bd1ba19f.tar.gz
busybox-w32-3fe7f9f20b6562e667ff3c9388a6ce00bd1ba19f.tar.bz2
busybox-w32-3fe7f9f20b6562e667ff3c9388a6ce00bd1ba19f.zip
More minor updates to docs (and making apps behave as the docs
suggest they should) -Erik
-rw-r--r--Makefile2
-rw-r--r--console-tools/loadacm.c14
-rw-r--r--console-tools/loadfont.c4
-rw-r--r--console-tools/loadkmap.c23
-rw-r--r--docs/busybox.pod30
-rw-r--r--loadacm.c14
-rw-r--r--loadfont.c4
-rw-r--r--loadkmap.c23
8 files changed, 77 insertions, 37 deletions
diff --git a/Makefile b/Makefile
index 6a4b41b01..90a1a21fd 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ export VERSION
26# Set the following to `true' to make a debuggable build. 26# Set the following to `true' to make a debuggable build.
27# Leave this set to `false' for production use. 27# Leave this set to `false' for production use.
28# eg: `make DODEBUG=true tests' 28# eg: `make DODEBUG=true tests'
29DODEBUG = true 29DODEBUG = false
30 30
31# If you want a static binary, turn this on. 31# If you want a static binary, turn this on.
32DOSTATIC = false 32DOSTATIC = false
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c
index 66f79092c..8f6923478 100644
--- a/console-tools/loadacm.c
+++ b/console-tools/loadacm.c
@@ -7,6 +7,7 @@
7 * Peter Novodvorsky <petya@logic.ru> 7 * Peter Novodvorsky <petya@logic.ru>
8 */ 8 */
9 9
10#include "internal.h"
10#include <stdio.h> 11#include <stdio.h>
11#include <stdlib.h> 12#include <stdlib.h>
12#include <memory.h> 13#include <memory.h>
@@ -21,6 +22,9 @@
21#include <sys/ioctl.h> 22#include <sys/ioctl.h>
22#include <sys/kd.h> 23#include <sys/kd.h>
23 24
25static const char loadacm_usage[] = "loadacm\n\n"
26 "Loads an acm from standard input.\n";
27
24typedef unsigned short unicode; 28typedef unsigned short unicode;
25 29
26static long int ctoi(unsigned char *s, int *is_unicode); 30static long int ctoi(unsigned char *s, int *is_unicode);
@@ -33,20 +37,24 @@ int loadacm_main(int argc, char **argv)
33{ 37{
34 int fd; 38 int fd;
35 39
40 if (argc>=2 && *argv[1]=='-') {
41 usage(loadacm_usage);
42 }
43
36 fd = open("/dev/tty", O_RDWR); 44 fd = open("/dev/tty", O_RDWR);
37 if (fd < 0) { 45 if (fd < 0) {
38 fprintf(stderr, "Error opening /dev/tty1: %s\n", strerror(errno)); 46 fprintf(stderr, "Error opening /dev/tty1: %s\n", strerror(errno));
39 return 1; 47 return( FALSE);
40 } 48 }
41 49
42 if (screen_map_load(fd, stdin)) { 50 if (screen_map_load(fd, stdin)) {
43 fprintf(stderr, "Error loading acm: %s\n", strerror(errno)); 51 fprintf(stderr, "Error loading acm: %s\n", strerror(errno));
44 return 1; 52 return( FALSE);
45 } 53 }
46 54
47 write(fd, "\033(K", 3); 55 write(fd, "\033(K", 3);
48 56
49 return 0; 57 return( TRUE);
50} 58}
51 59
52int screen_map_load(int fd, FILE * fp) 60int screen_map_load(int fd, FILE * fp)
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 0f6afecd4..5e1f04d76 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -54,11 +54,11 @@ extern int loadfont_main(int argc, char **argv)
54 fd = open("/dev/tty0", O_RDWR); 54 fd = open("/dev/tty0", O_RDWR);
55 if (fd < 0) { 55 if (fd < 0) {
56 fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno)); 56 fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
57 return 1; 57 return( FALSE);
58 } 58 }
59 loadnewfont(fd); 59 loadnewfont(fd);
60 60
61 return 0; 61 return( TRUE);
62} 62}
63 63
64static void do_loadfont(int fd, char *inbuf, int unit, int fontsize) 64static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index fe533d522..75e52e148 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -29,11 +29,8 @@
29#include <sys/ioctl.h> 29#include <sys/ioctl.h>
30 30
31 31
32static const char loadkmap_usage[] = "loadkmap\n" 32static const char loadkmap_usage[] = "loadkmap\n\n"
33 "\n" 33 "Loads a binary keyboard translation table from standard input.\n";
34
35 "\tLoad a binary keyboard translation table from standard input.\n"
36 "\n";
37 34
38 35
39int loadkmap_main(int argc, char **argv) 36int loadkmap_main(int argc, char **argv)
@@ -43,28 +40,32 @@ int loadkmap_main(int argc, char **argv)
43 int i, j, fd, readsz, pos, ibuffsz = NR_KEYS * sizeof(u_short); 40 int i, j, fd, readsz, pos, ibuffsz = NR_KEYS * sizeof(u_short);
44 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap", buff[7]; 41 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap", buff[7];
45 42
43 if (argc>=2 && *argv[1]=='-') {
44 usage(loadkmap_usage);
45 }
46
46 fd = open("/dev/tty0", O_RDWR); 47 fd = open("/dev/tty0", O_RDWR);
47 if (fd < 0) { 48 if (fd < 0) {
48 fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno)); 49 fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
49 return 1; 50 exit(FALSE);
50 } 51 }
51 52
52 read(0, buff, 7); 53 read(0, buff, 7);
53 if (0 != strncmp(buff, magic, 7)) { 54 if (0 != strncmp(buff, magic, 7)) {
54 fprintf(stderr, "This is not a valid binary keymap.\n"); 55 fprintf(stderr, "This is not a valid binary keymap.\n");
55 return 1; 56 exit(FALSE);
56 } 57 }
57 58
58 if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) { 59 if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) {
59 fprintf(stderr, "Error reading keymap flags: %s\n", 60 fprintf(stderr, "Error reading keymap flags: %s\n",
60 strerror(errno)); 61 strerror(errno));
61 return 1; 62 exit(FALSE);
62 } 63 }
63 64
64 ibuff = (u_short *) malloc(ibuffsz); 65 ibuff = (u_short *) malloc(ibuffsz);
65 if (!ibuff) { 66 if (!ibuff) {
66 fprintf(stderr, "Out of memory.\n"); 67 fprintf(stderr, "Out of memory.\n");
67 return 1; 68 exit(FALSE);
68 } 69 }
69 70
70 for (i = 0; i < MAX_NR_KEYMAPS; i++) { 71 for (i = 0; i < MAX_NR_KEYMAPS; i++) {
@@ -75,7 +76,7 @@ int loadkmap_main(int argc, char **argv)
75 < 0) { 76 < 0) {
76 fprintf(stderr, "Error reading keymap: %s\n", 77 fprintf(stderr, "Error reading keymap: %s\n",
77 strerror(errno)); 78 strerror(errno));
78 return 1; 79 exit(FALSE);
79 } 80 }
80 pos += readsz; 81 pos += readsz;
81 } 82 }
@@ -90,5 +91,5 @@ int loadkmap_main(int argc, char **argv)
90 /* Don't bother to close files. Exit does that 91 /* Don't bother to close files. Exit does that
91 * automagically, so we can save a few bytes */ 92 * automagically, so we can save a few bytes */
92 /* close(fd); */ 93 /* close(fd); */
93 return 0; 94 exit(TRUE);
94} 95}
diff --git a/docs/busybox.pod b/docs/busybox.pod
index a946e2857..0a61839e4 100644
--- a/docs/busybox.pod
+++ b/docs/busybox.pod
@@ -807,7 +807,13 @@ Example:
807 807
808=item loadacm 808=item loadacm
809 809
810FIXME -- this command does not yet have proper documentation 810Usage: loadacm
811
812Loads an acm from standard input.
813
814Example:
815
816 $ loadacm < /etc/i18n/acmname
811 817
812------------------------------- 818-------------------------------
813 819
@@ -817,12 +823,21 @@ Usage: loadfont
817 823
818Loads a console font from standard input. 824Loads a console font from standard input.
819 825
826Example:
827
828 $ loadfont < /etc/i18n/fontname
820 829
821------------------------------- 830-------------------------------
822 831
823=item loadkmap 832=item loadkmap
824 833
825FIXME -- this command does not yet have proper documentation 834Usage: loadkmap
835
836Loads a binary keyboard translation table from standard input.
837
838Example:
839
840 $ loadkmap < /etc/i18n/lang-keymap
826 841
827------------------------------- 842-------------------------------
828 843
@@ -1297,7 +1312,14 @@ Usage: sh
1297 1312
1298lash -- the BusyBox LAme SHell (command interpreter) 1313lash -- the BusyBox LAme SHell (command interpreter)
1299 1314
1300FIXME -- this command does not yet have proper documentation 1315This command does not yet have proper documentation.
1316
1317Use lash just as you would use any other shell. It properly handles pipes,
1318redirects, job control, can be used as the shell for scripts (#!/bin/sh), and
1319has a sufficient set of builtins to do what is needed. It does not (yet)
1320support Bourne Shell syntax. If you need things like "if-then-else", "while",
1321and such, use ash or bash. If you just need a very simple and extremely small
1322shell, this will do the job.
1301 1323
1302------------------------------- 1324-------------------------------
1303 1325
@@ -1781,4 +1803,4 @@ Enrique Zanardi <ezanardi@ull.es>
1781 1803
1782=cut 1804=cut
1783 1805
1784# $Id: busybox.pod,v 1.16 2000/04/18 00:00:52 erik Exp $ 1806# $Id: busybox.pod,v 1.17 2000/04/19 03:59:10 erik Exp $
diff --git a/loadacm.c b/loadacm.c
index 66f79092c..8f6923478 100644
--- a/loadacm.c
+++ b/loadacm.c
@@ -7,6 +7,7 @@
7 * Peter Novodvorsky <petya@logic.ru> 7 * Peter Novodvorsky <petya@logic.ru>
8 */ 8 */
9 9
10#include "internal.h"
10#include <stdio.h> 11#include <stdio.h>
11#include <stdlib.h> 12#include <stdlib.h>
12#include <memory.h> 13#include <memory.h>
@@ -21,6 +22,9 @@
21#include <sys/ioctl.h> 22#include <sys/ioctl.h>
22#include <sys/kd.h> 23#include <sys/kd.h>
23 24
25static const char loadacm_usage[] = "loadacm\n\n"
26 "Loads an acm from standard input.\n";
27
24typedef unsigned short unicode; 28typedef unsigned short unicode;
25 29
26static long int ctoi(unsigned char *s, int *is_unicode); 30static long int ctoi(unsigned char *s, int *is_unicode);
@@ -33,20 +37,24 @@ int loadacm_main(int argc, char **argv)
33{ 37{
34 int fd; 38 int fd;
35 39
40 if (argc>=2 && *argv[1]=='-') {
41 usage(loadacm_usage);
42 }
43
36 fd = open("/dev/tty", O_RDWR); 44 fd = open("/dev/tty", O_RDWR);
37 if (fd < 0) { 45 if (fd < 0) {
38 fprintf(stderr, "Error opening /dev/tty1: %s\n", strerror(errno)); 46 fprintf(stderr, "Error opening /dev/tty1: %s\n", strerror(errno));
39 return 1; 47 return( FALSE);
40 } 48 }
41 49
42 if (screen_map_load(fd, stdin)) { 50 if (screen_map_load(fd, stdin)) {
43 fprintf(stderr, "Error loading acm: %s\n", strerror(errno)); 51 fprintf(stderr, "Error loading acm: %s\n", strerror(errno));
44 return 1; 52 return( FALSE);
45 } 53 }
46 54
47 write(fd, "\033(K", 3); 55 write(fd, "\033(K", 3);
48 56
49 return 0; 57 return( TRUE);
50} 58}
51 59
52int screen_map_load(int fd, FILE * fp) 60int screen_map_load(int fd, FILE * fp)
diff --git a/loadfont.c b/loadfont.c
index 0f6afecd4..5e1f04d76 100644
--- a/loadfont.c
+++ b/loadfont.c
@@ -54,11 +54,11 @@ extern int loadfont_main(int argc, char **argv)
54 fd = open("/dev/tty0", O_RDWR); 54 fd = open("/dev/tty0", O_RDWR);
55 if (fd < 0) { 55 if (fd < 0) {
56 fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno)); 56 fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
57 return 1; 57 return( FALSE);
58 } 58 }
59 loadnewfont(fd); 59 loadnewfont(fd);
60 60
61 return 0; 61 return( TRUE);
62} 62}
63 63
64static void do_loadfont(int fd, char *inbuf, int unit, int fontsize) 64static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
diff --git a/loadkmap.c b/loadkmap.c
index fe533d522..75e52e148 100644
--- a/loadkmap.c
+++ b/loadkmap.c
@@ -29,11 +29,8 @@
29#include <sys/ioctl.h> 29#include <sys/ioctl.h>
30 30
31 31
32static const char loadkmap_usage[] = "loadkmap\n" 32static const char loadkmap_usage[] = "loadkmap\n\n"
33 "\n" 33 "Loads a binary keyboard translation table from standard input.\n";
34
35 "\tLoad a binary keyboard translation table from standard input.\n"
36 "\n";
37 34
38 35
39int loadkmap_main(int argc, char **argv) 36int loadkmap_main(int argc, char **argv)
@@ -43,28 +40,32 @@ int loadkmap_main(int argc, char **argv)
43 int i, j, fd, readsz, pos, ibuffsz = NR_KEYS * sizeof(u_short); 40 int i, j, fd, readsz, pos, ibuffsz = NR_KEYS * sizeof(u_short);
44 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap", buff[7]; 41 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap", buff[7];
45 42
43 if (argc>=2 && *argv[1]=='-') {
44 usage(loadkmap_usage);
45 }
46
46 fd = open("/dev/tty0", O_RDWR); 47 fd = open("/dev/tty0", O_RDWR);
47 if (fd < 0) { 48 if (fd < 0) {
48 fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno)); 49 fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
49 return 1; 50 exit(FALSE);
50 } 51 }
51 52
52 read(0, buff, 7); 53 read(0, buff, 7);
53 if (0 != strncmp(buff, magic, 7)) { 54 if (0 != strncmp(buff, magic, 7)) {
54 fprintf(stderr, "This is not a valid binary keymap.\n"); 55 fprintf(stderr, "This is not a valid binary keymap.\n");
55 return 1; 56 exit(FALSE);
56 } 57 }
57 58
58 if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) { 59 if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) {
59 fprintf(stderr, "Error reading keymap flags: %s\n", 60 fprintf(stderr, "Error reading keymap flags: %s\n",
60 strerror(errno)); 61 strerror(errno));
61 return 1; 62 exit(FALSE);
62 } 63 }
63 64
64 ibuff = (u_short *) malloc(ibuffsz); 65 ibuff = (u_short *) malloc(ibuffsz);
65 if (!ibuff) { 66 if (!ibuff) {
66 fprintf(stderr, "Out of memory.\n"); 67 fprintf(stderr, "Out of memory.\n");
67 return 1; 68 exit(FALSE);
68 } 69 }
69 70
70 for (i = 0; i < MAX_NR_KEYMAPS; i++) { 71 for (i = 0; i < MAX_NR_KEYMAPS; i++) {
@@ -75,7 +76,7 @@ int loadkmap_main(int argc, char **argv)
75 < 0) { 76 < 0) {
76 fprintf(stderr, "Error reading keymap: %s\n", 77 fprintf(stderr, "Error reading keymap: %s\n",
77 strerror(errno)); 78 strerror(errno));
78 return 1; 79 exit(FALSE);
79 } 80 }
80 pos += readsz; 81 pos += readsz;
81 } 82 }
@@ -90,5 +91,5 @@ int loadkmap_main(int argc, char **argv)
90 /* Don't bother to close files. Exit does that 91 /* Don't bother to close files. Exit does that
91 * automagically, so we can save a few bytes */ 92 * automagically, so we can save a few bytes */
92 /* close(fd); */ 93 /* close(fd); */
93 return 0; 94 exit(TRUE);
94} 95}