1 // toys/android/getprop.c
5 char **nv; // name/value pairs: even=name, odd=value
8 // toys/example/hello.c
14 // toys/example/skeleton.c
16 struct skeleton_data {
21 struct arg_list *d_list;
80 struct arg_list *optlist;
126 int ac, bat, therm, cool;
130 // toys/other/base64.c
136 // toys/other/blockdev.c
138 struct blockdev_data {
142 // toys/other/dos2unix.c
144 struct dos2unix_data {
148 // toys/other/fallocate.c
150 struct fallocate_data {
158 unsigned long long units;
162 // toys/other/hexedit.c
164 struct hexedit_data {
167 int numlen, undo, undolen;
171 // toys/other/hwclock.c
173 struct hwclock_data {
179 // toys/other/ifconfig.c
181 struct ifconfig_data {
185 // toys/other/ionice.c
193 // toys/other/login.c
199 int login_timeout, login_fail_timeout;
202 // toys/other/losetup.c
204 struct losetup_data {
214 // toys/other/lspci.c
223 // toys/other/makedevs.c
225 struct makedevs_data {
238 // toys/other/mkpasswd.c
240 struct mkpasswd_data {
246 // toys/other/modinfo.c
248 struct modinfo_data {
256 // toys/other/netcat.c
259 char *filename; // -f read from filename instead of network
260 long quit_delay; // -q Exit after EOF from stdin after # seconds.
261 char *source_address; // -s Bind to a specific source address.
262 long port; // -p Bind to a specific source port.
263 long wait; // -w Wait # seconds for a connection.
266 // toys/other/nsenter.c
268 struct nsenter_data {
273 // toys/other/oneit.c
279 // toys/other/shred.c
298 struct passwd *user_name;
299 struct group *group_name;
302 // toys/other/swapon.c
308 // toys/other/switch_root.c
310 struct switch_root_data {
316 // toys/other/timeout.c
318 struct timeout_data {
325 struct itimerval itv;
328 // toys/other/truncate.c
330 struct truncate_data {
345 // toys/pending/arp.c
357 // toys/pending/arping.c
361 unsigned long time_out;
366 unsigned long start, end;
367 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
371 // toys/pending/bootchartd.c
373 struct bootchartd_data {
375 long smpl_period_usec;
382 // toys/pending/brctl.c
388 // toys/pending/compress.c
390 struct compress_data {
391 // Huffman codes: base offset and extra bits tables (length and distance)
392 char lenbits[29], distbits[30];
393 unsigned short lenbase[29], distbase[30];
394 void *fixdisthuff, *fixlithuff;
397 void (*crcfunc)(char *data, int len);
400 // Compressed data buffer
405 // Tables only used for deflation
406 unsigned short *hashhead, *hashchain;
409 // toys/pending/crond.c
417 time_t crontabs_dir_mtime;
421 // toys/pending/crontab.c
423 struct crontab_data {
434 // toys/pending/dhcp.c
443 struct arg_list *req_opt;
445 struct arg_list *pkt_opt;
451 // toys/pending/dhcp6.c
454 char *interface_name, *pidfile, *script;
455 long retry, timeout, errortimeout;
457 int length, state, request_length, sock, sock1, status, retval, retries;
459 uint8_t transction_id[3];
460 struct sockaddr_in6 input_socket6;
463 // toys/pending/dhcpd.c
470 // toys/pending/diff.c
475 struct arg_list *L_list;
477 int dir_num, size, is_binary, status, change, len[2];
481 // toys/pending/dumpleases.c
483 struct dumpleases_data {
487 // toys/pending/expr.c
493 // toys/pending/fdisk.c
502 // toys/pending/fold.c
508 // toys/pending/fsck.c
514 struct double_list *devices;
524 // toys/pending/ftpget.c
527 long port; // char *port;
534 char buf[sizeof(struct sockaddr_storage)];
537 // toys/pending/getty.c
549 struct termios termios;
553 // toys/pending/groupadd.c
555 struct groupadd_data {
559 // toys/pending/host.c
565 // toys/pending/iconv.c
577 char stats, singleline, flush, *filter_dev, gbuf[8192];
578 int sockfd, connected, from_ok, route_cmd;
579 int8_t addressfamily, is_addr;
582 // toys/pending/ipcrm.c
585 struct arg_list *qkey;
586 struct arg_list *qid;
587 struct arg_list *skey;
588 struct arg_list *sid;
589 struct arg_list *mkey;
590 struct arg_list *mid;
593 // toys/pending/ipcs.c
599 // toys/pending/klogd.c
607 // toys/pending/last.c
612 struct arg_list *list;
615 // toys/pending/logger.c
622 // toys/pending/lsof.c
627 struct stat *sought_files;
629 struct double_list *files;
634 // toys/pending/mke2fs.c
637 // Command line arguments.
639 long bytes_per_inode;
640 long inodes; // Total inodes in filesystem.
641 long reserved_percent; // Integer precent of space to reserve for root.
642 char *gendir; // Where to read dirtree from.
645 struct dirtree *dt; // Tree of files to copy into the new filesystem.
646 unsigned treeblocks; // Blocks used by dt
647 unsigned treeinodes; // Inodes used by dt
649 unsigned blocks; // Total blocks in the filesystem.
650 unsigned freeblocks; // Free blocks in the filesystem.
651 unsigned inodespg; // Inodes per group
652 unsigned groups; // Total number of block groups.
653 unsigned blockbits; // Bits per block. (Also blocks per group.)
656 unsigned nextblock; // Next data block to allocate
657 unsigned nextgroup; // Next group we'll be allocating from
658 int fsfd; // File descriptor of filesystem (to output to).
660 struct ext2_superblock sb;
663 // toys/pending/modprobe.c
665 struct modprobe_data {
666 struct arg_list *probes;
667 struct arg_list *dbase[256];
671 void (*dbg)(char *format, ...);
674 // toys/pending/more.c
681 // toys/pending/netstat.c
683 struct netstat_data {
684 char current_name[21];
685 int some_process_unidentified;
688 // toys/pending/openvt.c
691 unsigned long vt_num;
694 // toys/pending/pgrep.c
703 // toys/pending/ping.c
716 // toys/pending/route.c
728 // toys/pending/sulogin.c
730 struct sulogin_data {
732 struct termios crntio;
735 // toys/pending/syslogd.c
737 struct syslogd_data {
748 struct unsocks *lsocks; // list of listen sockets
749 struct logfile *lfiles; // list of write logfiles
753 // toys/pending/tar.c
758 struct arg_list *inc_file;
759 struct arg_list *exc_file;
761 struct arg_list *exc;
763 struct arg_list *inc, *pass;
764 void *inodes, *handle;
767 // toys/pending/tcpsvd.c
781 // toys/pending/telnet.c
791 struct termios def_term;
792 struct termios raw_term;
800 // toys/pending/telnetd.c
802 struct telnetd_data {
813 // toys/pending/tftp.c
820 struct sockaddr_storage inaddr;
824 // toys/pending/tftpd.c
833 // toys/pending/top.c
853 short map[256]; //map of chars
857 // toys/pending/traceroute.c
859 struct traceroute_data {
866 struct arg_list *loose_source;
880 // toys/pending/useradd.c
882 struct useradd_data {
895 struct linestack *ls;
899 // toys/pending/watch.c
905 // toys/posix/chgrp.c
910 char *owner_name, *group_name;
914 // toys/posix/chmod.c
920 // toys/posix/cksum.c
923 unsigned crc_table[256];
950 int (*callback)(struct dirtree *try);
974 void (*do_cut)(int fd);
991 struct arg_list *fstype;
994 int column_widths[5];
1008 // toys/posix/expand.c
1010 struct expand_data {
1011 struct arg_list *tabs;
1013 unsigned tabcount, *tab;
1016 // toys/posix/find.c
1020 struct double_list *argdata;
1021 int topdir, xdev, depth, envsize;
1025 // toys/posix/grep.c
1033 // toys/posix/head.c
1046 // toys/posix/kill.c
1050 struct arg_list *olist;
1058 struct dirtree *files, *singledir;
1060 unsigned screen_width;
1062 char uid_buf[12], gid_buf[12];
1065 // toys/posix/mkdir.c
1072 // toys/posix/mkfifo.c
1074 struct mkfifo_data {
1081 // toys/posix/nice.c
1097 // Count of consecutive blank lines for -l has to persist between files
1104 struct arg_list *output_base;
1110 unsigned types, leftover, star;
1112 uint64_t bufs[4]; // force 64-bit alignment
1116 // toys/posix/paste.c
1122 // toys/posix/patch.c
1128 struct double_list *current_hunk;
1129 long oldline, oldlen, newline, newlen;
1131 int context, state, filein, fileout, filepatch, hunknum;
1164 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1165 unsigned width, height;
1167 void *fields, *kfields;
1168 long long ticks, bits, ioread, iowrite, aioread, aiowrite;
1170 int kcount, ksave, forcek;
1171 int (*match_process)(long long *slot);
1174 // toys/posix/renice.c
1176 struct renice_data {
1186 // processed pattern list
1187 struct double_list *pattern;
1189 char *nextline, *remember;
1190 void *restart, *lastregex;
1191 long nextlen, rememberlen, count;
1196 // toys/posix/sort.c
1199 char *key_separator;
1200 struct arg_list *raw_keys;
1202 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1209 // toys/posix/split.c
1219 // toys/posix/strings.c
1221 struct strings_data {
1225 // toys/posix/tail.c
1231 int file_no, ffd, *files;
1240 // toys/posix/touch.c
1248 // toys/posix/uniq.c
1257 // toys/posix/uudecode.c
1259 struct uudecode_data {
1266 unsigned long totals[3];
1269 // toys/posix/xargs.c
1278 long entries, bytes;
1282 extern union global_union {
1283 struct getprop_data getprop;
1284 struct hello_data hello;
1285 struct skeleton_data skeleton;
1286 struct dmesg_data dmesg;
1287 struct killall_data killall;
1288 struct md5sum_data md5sum;
1289 struct mknod_data mknod;
1290 struct mktemp_data mktemp;
1291 struct mount_data mount;
1292 struct passwd_data passwd;
1293 struct pidof_data pidof;
1294 struct seq_data seq;
1296 struct umount_data umount;
1297 struct acpi_data acpi;
1298 struct base64_data base64;
1299 struct blockdev_data blockdev;
1300 struct dos2unix_data dos2unix;
1301 struct fallocate_data fallocate;
1302 struct free_data free;
1303 struct hexedit_data hexedit;
1304 struct hwclock_data hwclock;
1305 struct ifconfig_data ifconfig;
1306 struct ionice_data ionice;
1307 struct login_data login;
1308 struct losetup_data losetup;
1309 struct lspci_data lspci;
1310 struct makedevs_data makedevs;
1311 struct mix_data mix;
1312 struct mkpasswd_data mkpasswd;
1313 struct modinfo_data modinfo;
1314 struct netcat_data netcat;
1315 struct nsenter_data nsenter;
1316 struct oneit_data oneit;
1317 struct shred_data shred;
1318 struct stat_data stat;
1319 struct swapon_data swapon;
1320 struct switch_root_data switch_root;
1321 struct timeout_data timeout;
1322 struct truncate_data truncate;
1323 struct xxd_data xxd;
1324 struct arp_data arp;
1325 struct arping_data arping;
1326 struct bootchartd_data bootchartd;
1327 struct brctl_data brctl;
1328 struct compress_data compress;
1329 struct crond_data crond;
1330 struct crontab_data crontab;
1332 struct dhcp_data dhcp;
1333 struct dhcp6_data dhcp6;
1334 struct dhcpd_data dhcpd;
1335 struct diff_data diff;
1336 struct dumpleases_data dumpleases;
1337 struct expr_data expr;
1338 struct fdisk_data fdisk;
1339 struct fold_data fold;
1340 struct fsck_data fsck;
1341 struct ftpget_data ftpget;
1342 struct getty_data getty;
1343 struct groupadd_data groupadd;
1344 struct host_data host;
1345 struct iconv_data iconv;
1347 struct ipcrm_data ipcrm;
1348 struct ipcs_data ipcs;
1349 struct klogd_data klogd;
1350 struct last_data last;
1351 struct logger_data logger;
1352 struct lsof_data lsof;
1353 struct mke2fs_data mke2fs;
1354 struct modprobe_data modprobe;
1355 struct more_data more;
1356 struct netstat_data netstat;
1357 struct openvt_data openvt;
1358 struct pgrep_data pgrep;
1359 struct ping_data ping;
1360 struct route_data route;
1362 struct sulogin_data sulogin;
1363 struct syslogd_data syslogd;
1364 struct tar_data tar;
1365 struct tcpsvd_data tcpsvd;
1366 struct telnet_data telnet;
1367 struct telnetd_data telnetd;
1368 struct tftp_data tftp;
1369 struct tftpd_data tftpd;
1370 struct top_data top;
1372 struct traceroute_data traceroute;
1373 struct useradd_data useradd;
1375 struct watch_data watch;
1376 struct chgrp_data chgrp;
1377 struct chmod_data chmod;
1378 struct cksum_data cksum;
1379 struct cmp_data cmp;
1381 struct cpio_data cpio;
1382 struct cut_data cut;
1383 struct date_data date;
1386 struct expand_data expand;
1387 struct find_data find;
1388 struct grep_data grep;
1389 struct head_data head;
1391 struct kill_data kill;
1393 struct mkdir_data mkdir;
1394 struct mkfifo_data mkfifo;
1395 struct nice_data nice;
1398 struct paste_data paste;
1399 struct patch_data patch;
1401 struct renice_data renice;
1402 struct sed_data sed;
1403 struct sort_data sort;
1404 struct split_data split;
1405 struct strings_data strings;
1406 struct tail_data tail;
1407 struct tee_data tee;
1408 struct touch_data touch;
1409 struct uniq_data uniq;
1410 struct uudecode_data uudecode;
1412 struct xargs_data xargs;