Mercurial > hg > toybox
annotate toys/toylist.h @ 229:87390c3700c1
Add chvt from David Anders.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 06 Jan 2008 16:01:11 -0600 |
parents | 98820d1eaa79 |
children | 31dc682c18ad |
rev | line source |
---|---|
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 /* vi: set ts=4 :*/ |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 /* Toybox infrastructure. |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 * |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 * Copyright 2006 Rob Landley <rob@landley.net> |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 */ |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 |
88
021fe1a818c3
Small cleanup to prepare for cross-compile friendly make install.
Rob Landley <rob@landley.net>
parents:
82
diff
changeset
|
8 // Provide function declarations and structs. Note that main.c #includes this |
021fe1a818c3
Small cleanup to prepare for cross-compile friendly make install.
Rob Landley <rob@landley.net>
parents:
82
diff
changeset
|
9 // file twice (with different macros) to populate toy_list[]. |
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 |
88
021fe1a818c3
Small cleanup to prepare for cross-compile friendly make install.
Rob Landley <rob@landley.net>
parents:
82
diff
changeset
|
11 #ifndef NEWTOY |
186
25447caf1b4b
Change command main() functions to return void, and exit(toys.exitval) from
Rob Landley <rob@landley.net>
parents:
179
diff
changeset
|
12 #define NEWTOY(name, opts, flags) void name##_main(void); |
25
eb46bb5626cb
New option parsing infrastructure (doesn't use getopt). Hook it up to
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
13 #define OLDTOY(name, oldname, opts, flags) |
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 struct df_data { |
33 | 16 struct arg_list *fstype; |
53
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
17 |
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 long units; |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 }; |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 |
146
99e651512aa4
Get toysh.c to start using the option parsing logic, and some minor cleanup.
Rob Landley <rob@landley.net>
parents:
139
diff
changeset
|
21 // Still to go: "E:jJ:L:m:O:" |
99e651512aa4
Get toysh.c to start using the option parsing logic, and some minor cleanup.
Rob Landley <rob@landley.net>
parents:
139
diff
changeset
|
22 #define MKE2FS_OPTSTRING "<1>2g:Fnqm#N#i#b#" |
99e651512aa4
Get toysh.c to start using the option parsing logic, and some minor cleanup.
Rob Landley <rob@landley.net>
parents:
139
diff
changeset
|
23 |
169 | 24 struct dmesg_data { |
25 long level; | |
26 long size; | |
27 }; | |
28 | |
53
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
29 struct mke2fs_data { |
113 | 30 // Command line arguments. |
53
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
31 long blocksize; |
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
32 long bytes_per_inode; |
113 | 33 long inodes; // Total inodes in filesystem. |
34 long reserved_percent; // Integer precent of space to reserve for root. | |
35 char *gendir; // Where to read dirtree from. | |
36 | |
37 // Internal data. | |
38 struct dirtree *dt; // Tree of files to copy into the new filesystem. | |
39 unsigned treeblocks; // Blocks used by dt | |
40 unsigned treeinodes; // Inodes used by dt | |
53
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
41 |
113 | 42 unsigned blocks; // Total blocks in the filesystem. |
43 unsigned freeblocks; // Free blocks in the filesystem. | |
44 unsigned inodespg; // Inodes per group | |
45 unsigned groups; // Total number of block groups. | |
46 unsigned blockbits; // Bits per block. (Also blocks per group.) | |
47 | |
48 // For gene2fs | |
49 unsigned nextblock; // Next data block to allocate | |
50 unsigned nextgroup; // Next group we'll be allocating from | |
51 int fsfd; // File descriptor of filesystem (to output to). | |
52 | |
82 | 53 struct ext2_superblock sb; |
53
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
54 }; |
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
55 |
189
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
56 struct netcat_data { |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
57 char *filename; // -f read from filename instead of network |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
58 long quit_delay; // -q Exit after EOF from stdin after # seconds. |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
59 char *source_address; // -s Bind to a specific source address. |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
60 long port; // -p Bind to a specific source port. |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
61 long listen; // -l Listen for connection instead of dialing out. |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
62 long wait; // -w Wait # seconds for a connection. |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
63 long delay; // -i delay between lines sent |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
64 }; |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
65 |
195
9dc48c97d6f9
Add -c option to oneit, to specify console other than /dev/tty0.
Rob Landley <rob@landley.net>
parents:
191
diff
changeset
|
66 struct oneit_data { |
9dc48c97d6f9
Add -c option to oneit, to specify console other than /dev/tty0.
Rob Landley <rob@landley.net>
parents:
191
diff
changeset
|
67 char *console; |
9dc48c97d6f9
Add -c option to oneit, to specify console other than /dev/tty0.
Rob Landley <rob@landley.net>
parents:
191
diff
changeset
|
68 }; |
9dc48c97d6f9
Add -c option to oneit, to specify console other than /dev/tty0.
Rob Landley <rob@landley.net>
parents:
191
diff
changeset
|
69 |
201
5d523752715a
Start of "patch" support. Writes to stdout at the moment.
Rob Landley <rob@landley.net>
parents:
195
diff
changeset
|
70 struct patch_data { |
5d523752715a
Start of "patch" support. Writes to stdout at the moment.
Rob Landley <rob@landley.net>
parents:
195
diff
changeset
|
71 char *infile; |
5d523752715a
Start of "patch" support. Writes to stdout at the moment.
Rob Landley <rob@landley.net>
parents:
195
diff
changeset
|
72 long prefix; |
5d523752715a
Start of "patch" support. Writes to stdout at the moment.
Rob Landley <rob@landley.net>
parents:
195
diff
changeset
|
73 |
5d523752715a
Start of "patch" support. Writes to stdout at the moment.
Rob Landley <rob@landley.net>
parents:
195
diff
changeset
|
74 struct double_list *plines, *flines; |
209 | 75 long oldline, oldlen, newline, newlen, linenum; |
76 int context, state, filein, fileout, filepatch; | |
214
98820d1eaa79
Upgrade patch to understand creating and deleting files.
Rob Landley <rob@landley.net>
parents:
209
diff
changeset
|
77 char *tempname, *oldname; |
201
5d523752715a
Start of "patch" support. Writes to stdout at the moment.
Rob Landley <rob@landley.net>
parents:
195
diff
changeset
|
78 }; |
5d523752715a
Start of "patch" support. Writes to stdout at the moment.
Rob Landley <rob@landley.net>
parents:
195
diff
changeset
|
79 |
118 | 80 struct sleep_data { |
81 long seconds; | |
82 }; | |
83 | |
100
c3d1d74d5d8f
MacOS X has a defective sed with no -r.
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
84 struct touch_data { |
c3d1d74d5d8f
MacOS X has a defective sed with no -r.
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
85 char *ref_file; |
c3d1d74d5d8f
MacOS X has a defective sed with no -r.
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
86 char *time; |
162
0864aec90026
Add an option to let touch extend or truncate a file and rename the err label to time_error to reduce confusion.
Charlie Shepherd <masterdriverz@gentoo.org>
parents:
157
diff
changeset
|
87 long length; |
100
c3d1d74d5d8f
MacOS X has a defective sed with no -r.
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
88 }; |
c3d1d74d5d8f
MacOS X has a defective sed with no -r.
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
89 |
146
99e651512aa4
Get toysh.c to start using the option parsing logic, and some minor cleanup.
Rob Landley <rob@landley.net>
parents:
139
diff
changeset
|
90 struct toysh_data { |
99e651512aa4
Get toysh.c to start using the option parsing logic, and some minor cleanup.
Rob Landley <rob@landley.net>
parents:
139
diff
changeset
|
91 char *command; |
99e651512aa4
Get toysh.c to start using the option parsing logic, and some minor cleanup.
Rob Landley <rob@landley.net>
parents:
139
diff
changeset
|
92 }; |
53
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
93 |
157
714f4c051594
Add initial mkfifo implementation
Charlie Shepherd <masterdriverz@gentoo.org>
parents:
147
diff
changeset
|
94 struct mkfifo_data { |
714f4c051594
Add initial mkfifo implementation
Charlie Shepherd <masterdriverz@gentoo.org>
parents:
147
diff
changeset
|
95 char *mode; |
714f4c051594
Add initial mkfifo implementation
Charlie Shepherd <masterdriverz@gentoo.org>
parents:
147
diff
changeset
|
96 }; |
714f4c051594
Add initial mkfifo implementation
Charlie Shepherd <masterdriverz@gentoo.org>
parents:
147
diff
changeset
|
97 |
93
cc0a6789f92a
Trim a redundant definition that confuses older compilers. (Regression testing
Rob Landley <rob@landley.net>
parents:
92
diff
changeset
|
98 extern union toy_union { |
169 | 99 struct dmesg_data dmesg; |
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
100 struct df_data df; |
53
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
101 struct mke2fs_data mke2fs; |
157
714f4c051594
Add initial mkfifo implementation
Charlie Shepherd <masterdriverz@gentoo.org>
parents:
147
diff
changeset
|
102 struct mkfifo_data mkfifo; |
189
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
103 struct netcat_data netcat; |
195
9dc48c97d6f9
Add -c option to oneit, to specify console other than /dev/tty0.
Rob Landley <rob@landley.net>
parents:
191
diff
changeset
|
104 struct oneit_data oneit; |
201
5d523752715a
Start of "patch" support. Writes to stdout at the moment.
Rob Landley <rob@landley.net>
parents:
195
diff
changeset
|
105 struct patch_data patch; |
146
99e651512aa4
Get toysh.c to start using the option parsing logic, and some minor cleanup.
Rob Landley <rob@landley.net>
parents:
139
diff
changeset
|
106 struct sleep_data sleep; |
99e651512aa4
Get toysh.c to start using the option parsing logic, and some minor cleanup.
Rob Landley <rob@landley.net>
parents:
139
diff
changeset
|
107 struct touch_data touch; |
99e651512aa4
Get toysh.c to start using the option parsing logic, and some minor cleanup.
Rob Landley <rob@landley.net>
parents:
139
diff
changeset
|
108 struct toysh_data toysh; |
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
109 } toy; |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
110 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
111 #define TOYFLAG_USR (1<<0) |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
112 #define TOYFLAG_BIN (1<<1) |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
113 #define TOYFLAG_SBIN (1<<2) |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
114 #define TOYMASK_LOCATION ((1<<4)-1) |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
115 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
116 #define TOYFLAG_NOFORK (1<<4) |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
117 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
118 extern struct toy_list { |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
119 char *name; |
186
25447caf1b4b
Change command main() functions to return void, and exit(toys.exitval) from
Rob Landley <rob@landley.net>
parents:
179
diff
changeset
|
120 void (*toy_main)(void); |
25
eb46bb5626cb
New option parsing infrastructure (doesn't use getopt). Hook it up to
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
121 char *options; |
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
122 int flags; |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
123 } toy_list[]; |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
124 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
125 #endif |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
126 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
127 // List of all the applets toybox can provide. |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
128 |
53
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
129 // This one is out of order on purpose: it's the first element in the array. |
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
130 |
25
eb46bb5626cb
New option parsing infrastructure (doesn't use getopt). Hook it up to
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
131 NEWTOY(toybox, NULL, 0) |
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
132 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
133 // The rest of these are alphabetical, for binary search. |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
134 |
176
07533cabeede
Patch from Charlie Shepherd to add basename and dirname. (Fixed up to apply.)
Rob Landley <rob@landley.net>
parents:
169
diff
changeset
|
135 USE_BASENAME(NEWTOY(basename, "<1>2", TOYFLAG_BIN)) |
195
9dc48c97d6f9
Add -c option to oneit, to specify console other than /dev/tty0.
Rob Landley <rob@landley.net>
parents:
191
diff
changeset
|
136 USE_BZCAT(NEWTOY(bzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN)) |
66 | 137 USE_CATV(NEWTOY(catv, "vte", TOYFLAG_USR|TOYFLAG_BIN)) |
191 | 138 USE_CHROOT(NEWTOY(chroot, "<1", TOYFLAG_USR|TOYFLAG_SBIN)) |
229 | 139 USE_CHVT(NEWTOY(chvt, "<1", TOYFLAG_USR|TOYFLAG_SBIN)) |
195
9dc48c97d6f9
Add -c option to oneit, to specify console other than /dev/tty0.
Rob Landley <rob@landley.net>
parents:
191
diff
changeset
|
140 USE_COUNT(NEWTOY(count, NULL, TOYFLAG_USR|TOYFLAG_BIN)) |
25
eb46bb5626cb
New option parsing infrastructure (doesn't use getopt). Hook it up to
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
141 USE_TOYSH(NEWTOY(cd, NULL, TOYFLAG_NOFORK)) |
32
993eab821bd5
More work on option parsing. "df -t tmpfs" actually seems to work now.
Rob Landley <rob@landley.net>
parents:
25
diff
changeset
|
142 USE_DF(NEWTOY(df, "Pkt*a", TOYFLAG_USR|TOYFLAG_SBIN)) |
176
07533cabeede
Patch from Charlie Shepherd to add basename and dirname. (Fixed up to apply.)
Rob Landley <rob@landley.net>
parents:
169
diff
changeset
|
143 USE_DIRNAME(NEWTOY(dirname, "<1>1", TOYFLAG_BIN)) |
169 | 144 USE_DMESG(NEWTOY(dmesg, "s#n#c", TOYFLAG_BIN)) |
92
154070b2b28d
Toybox option parsing must stop at the first non-option argument.
Rob Landley <rob@landley.net>
parents:
88
diff
changeset
|
145 USE_ECHO(NEWTOY(echo, "+en", TOYFLAG_BIN)) |
25
eb46bb5626cb
New option parsing infrastructure (doesn't use getopt). Hook it up to
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
146 USE_TOYSH(NEWTOY(exit, NULL, TOYFLAG_NOFORK)) |
116 | 147 USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN)) |
139
fb0745eec453
Add "help" command. (Building help/help.h requires python, but I'll ship
Rob Landley <rob@landley.net>
parents:
118
diff
changeset
|
148 USE_HELLO(NEWTOY(hello, NULL, TOYFLAG_USR|TOYFLAG_BIN)) |
fb0745eec453
Add "help" command. (Building help/help.h requires python, but I'll ship
Rob Landley <rob@landley.net>
parents:
118
diff
changeset
|
149 USE_HELP(NEWTOY(help, "<1", TOYFLAG_BIN)) |
53
41d55b5d49fd
Add start of mke2fs/gene2fs, and some other stuff I've been working on.
Rob Landley <rob@landley.net>
parents:
35
diff
changeset
|
150 USE_MKE2FS(NEWTOY(mke2fs, MKE2FS_OPTSTRING, TOYFLAG_SBIN)) |
157
714f4c051594
Add initial mkfifo implementation
Charlie Shepherd <masterdriverz@gentoo.org>
parents:
147
diff
changeset
|
151 USE_MKFIFO(NEWTOY(mkfifo, "<1m:", TOYFLAG_BIN)) |
189
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
152 USE_NETCAT(OLDTOY(nc, netcat, "i#w#l@p#s:q#f:e", TOYFLAG_BIN)) |
22d22427dec6
Add first pass at netcat. Base applet, -f, and -w implemented.
Rob Landley <rob@landley.net>
parents:
187
diff
changeset
|
153 USE_NETCAT(NEWTOY(netcat, "i#w#l@p#s:q#f:e", TOYFLAG_BIN)) |
195
9dc48c97d6f9
Add -c option to oneit, to specify console other than /dev/tty0.
Rob Landley <rob@landley.net>
parents:
191
diff
changeset
|
154 USE_ONEIT(NEWTOY(oneit, "+<1c:p", TOYFLAG_SBIN)) |
201
5d523752715a
Start of "patch" support. Writes to stdout at the moment.
Rob Landley <rob@landley.net>
parents:
195
diff
changeset
|
155 USE_PATCH(NEWTOY(patch, "up#i:R", TOYFLAG_USR|TOYFLAG_BIN)) |
25
eb46bb5626cb
New option parsing infrastructure (doesn't use getopt). Hook it up to
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
156 USE_PWD(NEWTOY(pwd, NULL, TOYFLAG_BIN)) |
115
19b5567f0a1b
Add readlink, xreadlink(), and change xrealloc() to not fight the stupid
Rob Landley <rob@landley.net>
parents:
114
diff
changeset
|
157 USE_READLINK(NEWTOY(readlink, "<1f", TOYFLAG_BIN)) |
25
eb46bb5626cb
New option parsing infrastructure (doesn't use getopt). Hook it up to
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
158 USE_TOYSH(OLDTOY(sh, toysh, "c:i", TOYFLAG_BIN)) |
187
c983a0af6d4e
Add sha1sum. (No -c mode yet.) Slight tweaks to loopfiles() too.
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
159 USE_SHA1SUM(NEWTOY(sha1sum, NULL, TOYFLAG_USR|TOYFLAG_BIN)) |
118 | 160 USE_SLEEP(NEWTOY(sleep, "<1", TOYFLAG_BIN)) |
114
ce6956dfc0cf
Add sync and an incomplete version of mdev.
Rob Landley <rob@landley.net>
parents:
113
diff
changeset
|
161 USE_SYNC(NEWTOY(sync, NULL, TOYFLAG_BIN)) |
162
0864aec90026
Add an option to let touch extend or truncate a file and rename the err label to time_error to reduce confusion.
Charlie Shepherd <masterdriverz@gentoo.org>
parents:
157
diff
changeset
|
162 USE_TOUCH(NEWTOY(touch, "l#t:r:mca", TOYFLAG_BIN)) |
25
eb46bb5626cb
New option parsing infrastructure (doesn't use getopt). Hook it up to
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
163 USE_TOYSH(NEWTOY(toysh, "c:i", TOYFLAG_BIN)) |
116 | 164 USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN)) |
179 | 165 USE_TTY(NEWTOY(tty, "s", TOYFLAG_BIN)) |
25
eb46bb5626cb
New option parsing infrastructure (doesn't use getopt). Hook it up to
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
166 USE_WHICH(NEWTOY(which, "a", TOYFLAG_USR|TOYFLAG_BIN)) |
195
9dc48c97d6f9
Add -c option to oneit, to specify console other than /dev/tty0.
Rob Landley <rob@landley.net>
parents:
191
diff
changeset
|
167 USE_YES(NEWTOY(yes, NULL, TOYFLAG_USR|TOYFLAG_BIN)) |