1 // toys/android/getprop.c
5 char **nv; // name/value pairs: even=name, odd=value
6 struct selabel_handle *handle;
16 // toys/example/hello.c
22 // toys/example/skeleton.c
24 struct skeleton_data {
29 struct arg_list *d_list;
49 // toys/lsb/hostname.c
51 struct hostname_data {
73 // Crypto variables blanked after summing
99 struct arg_list *optlist;
142 // toys/net/ifconfig.c
144 struct ifconfig_data {
151 char *filename; // -f read from filename instead of network
152 long quit_delay; // -q Exit after EOF from stdin after # seconds.
153 char *source_address; // -s Bind to a specific source address.
154 long port; // -p Bind to a specific source port.
155 long wait; // -w Wait # seconds for a connection.
158 // toys/net/netstat.c
160 struct netstat_data {
161 struct num_cache *inodes;
174 int ac, bat, therm, cool;
178 // toys/other/base64.c
186 // toys/other/blockdev.c
188 struct blockdev_data {
192 // toys/other/dos2unix.c
194 struct dos2unix_data {
198 // toys/other/fallocate.c
200 struct fallocate_data {
208 unsigned long long units;
212 // toys/other/hexedit.c
214 struct hexedit_data {
217 int numlen, undo, undolen;
221 // toys/other/hwclock.c
223 struct hwclock_data {
229 // toys/other/ionice.c
237 // toys/other/login.c
243 int login_timeout, login_fail_timeout;
246 // toys/other/losetup.c
248 struct losetup_data {
258 // toys/other/lspci.c
267 // toys/other/makedevs.c
269 struct makedevs_data {
282 // toys/other/mkpasswd.c
284 struct mkpasswd_data {
290 // toys/other/mkswap.c
296 // toys/other/modinfo.c
298 struct modinfo_data {
306 // toys/other/nsenter.c
308 struct nsenter_data {
313 // toys/other/oneit.c
319 // toys/other/setfattr.c
321 struct setfattr_data {
325 // toys/other/shred.c
344 char *file, *pattern;
348 // toys/other/swapon.c
354 // toys/other/switch_root.c
356 struct switch_root_data {
362 // toys/other/timeout.c
364 struct timeout_data {
371 struct itimerval itv;
374 // toys/other/truncate.c
376 struct truncate_data {
392 // toys/pending/arp.c
404 // toys/pending/arping.c
408 unsigned long time_out;
413 unsigned long start, end;
414 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
418 // toys/pending/bootchartd.c
420 struct bootchartd_data {
422 long smpl_period_usec;
429 // toys/pending/brctl.c
435 // toys/pending/chrt.c
441 // toys/pending/compress.c
443 struct compress_data {
444 // Huffman codes: base offset and extra bits tables (length and distance)
445 char lenbits[29], distbits[30];
446 unsigned short lenbase[29], distbase[30];
447 void *fixdisthuff, *fixlithuff;
450 void (*crcfunc)(char *data, int len);
453 // Compressed data buffer
458 // Tables only used for deflation
459 unsigned short *hashhead, *hashchain;
462 // toys/pending/crond.c
470 time_t crontabs_dir_mtime;
474 // toys/pending/crontab.c
476 struct crontab_data {
486 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
487 struct timeval start;
491 unsigned char *buff, *bp;
493 unsigned long long offset;
497 // toys/pending/dhcp.c
506 struct arg_list *req_opt;
508 struct arg_list *pkt_opt;
514 // toys/pending/dhcp6.c
517 char *interface_name, *pidfile, *script;
518 long retry, timeout, errortimeout;
520 int length, state, request_length, sock, sock1, status, retval, retries;
522 uint8_t transction_id[3];
523 struct sockaddr_in6 input_socket6;
526 // toys/pending/dhcpd.c
533 // toys/pending/diff.c
538 struct arg_list *L_list;
540 int dir_num, size, is_binary, status, change, len[2];
544 // toys/pending/dumpleases.c
546 struct dumpleases_data {
550 // toys/pending/expr.c
553 char **tok; // current token, not on the stack since recursive calls mutate it
558 // toys/pending/fdisk.c
567 // toys/pending/fold.c
573 // toys/pending/fsck.c
579 struct double_list *devices;
589 // toys/pending/ftpget.c
592 long port; // char *port;
599 char buf[sizeof(struct sockaddr_storage)];
602 // toys/pending/getfattr.c
604 struct getfattr_data {
608 // toys/pending/getty.c
620 struct termios termios;
624 // toys/pending/groupadd.c
626 struct groupadd_data {
630 // toys/pending/host.c
636 // toys/pending/iconv.c
648 char stats, singleline, flush, *filter_dev, gbuf[8192];
649 int sockfd, connected, from_ok, route_cmd;
650 int8_t addressfamily, is_addr;
653 // toys/pending/ipcrm.c
656 struct arg_list *qkey;
657 struct arg_list *qid;
658 struct arg_list *skey;
659 struct arg_list *sid;
660 struct arg_list *mkey;
661 struct arg_list *mid;
664 // toys/pending/ipcs.c
670 // toys/pending/klogd.c
678 // toys/pending/last.c
683 struct arg_list *list;
686 // toys/pending/logger.c
693 // toys/pending/lsof.c
698 struct stat *sought_files;
700 struct double_list *all_sockets;
701 struct double_list *files;
706 // toys/pending/mke2fs.c
709 // Command line arguments.
711 long bytes_per_inode;
712 long inodes; // Total inodes in filesystem.
713 long reserved_percent; // Integer precent of space to reserve for root.
714 char *gendir; // Where to read dirtree from.
717 struct dirtree *dt; // Tree of files to copy into the new filesystem.
718 unsigned treeblocks; // Blocks used by dt
719 unsigned treeinodes; // Inodes used by dt
721 unsigned blocks; // Total blocks in the filesystem.
722 unsigned freeblocks; // Free blocks in the filesystem.
723 unsigned inodespg; // Inodes per group
724 unsigned groups; // Total number of block groups.
725 unsigned blockbits; // Bits per block. (Also blocks per group.)
728 unsigned nextblock; // Next data block to allocate
729 unsigned nextgroup; // Next group we'll be allocating from
730 int fsfd; // File descriptor of filesystem (to output to).
732 struct ext2_superblock sb;
735 // toys/pending/modprobe.c
737 struct modprobe_data {
738 struct arg_list *probes;
739 struct arg_list *dbase[256];
743 void (*dbg)(char *format, ...);
746 // toys/pending/more.c
753 // toys/pending/openvt.c
756 unsigned long vt_num;
759 // toys/pending/ping.c
772 // toys/pending/route.c
786 // toys/pending/sulogin.c
788 struct sulogin_data {
790 struct termios crntio;
793 // toys/pending/syslogd.c
795 struct syslogd_data {
806 struct unsocks *lsocks; // list of listen sockets
807 struct logfile *lfiles; // list of write logfiles
811 // toys/pending/tar.c
816 struct arg_list *inc_file;
817 struct arg_list *exc_file;
819 struct arg_list *exc;
821 struct arg_list *inc, *pass;
822 void *inodes, *handle;
825 // toys/pending/tcpsvd.c
839 // toys/pending/telnet.c
849 struct termios def_term;
850 struct termios raw_term;
858 // toys/pending/telnetd.c
860 struct telnetd_data {
871 // toys/pending/tftp.c
878 struct sockaddr_storage inaddr;
882 // toys/pending/tftpd.c
894 short map[256]; //map of chars
898 // toys/pending/traceroute.c
900 struct traceroute_data {
907 struct arg_list *loose_source;
921 // toys/pending/useradd.c
923 struct useradd_data {
936 struct linestack *ls;
940 // toys/pending/watch.c
946 // toys/pending/wget.c
952 // toys/posix/chgrp.c
957 char *owner_name, *group_name;
961 // toys/posix/chmod.c
967 // toys/posix/cksum.c
970 unsigned crc_table[256];
997 int (*callback)(struct dirtree *try);
1003 // toys/posix/cpio.c
1021 void (*do_cut)(int fd);
1024 // toys/posix/date.c
1038 struct arg_list *fstype;
1041 int column_widths[5];
1061 // toys/posix/expand.c
1063 struct expand_data {
1064 struct arg_list *tabs;
1066 unsigned tabcount, *tab;
1069 // toys/posix/file.c
1075 // toys/posix/find.c
1079 struct double_list *argdata;
1080 int topdir, xdev, depth;
1084 // toys/posix/grep.c
1094 char indelim, outdelim;
1097 // toys/posix/head.c
1110 // toys/posix/kill.c
1114 struct arg_list *olist;
1122 struct dirtree *files, *singledir;
1124 unsigned screen_width;
1129 // toys/posix/mkdir.c
1136 // toys/posix/mkfifo.c
1138 struct mkfifo_data {
1145 // toys/posix/nice.c
1161 // Count of consecutive blank lines for -l has to persist between files
1168 struct arg_list *output_base;
1175 unsigned types, leftover, star;
1176 char *buf; // Points to buffers[0] or buffers[1].
1177 char *bufs[2]; // Used to detect duplicate lines.
1181 // toys/posix/paste.c
1187 // toys/posix/patch.c
1194 struct double_list *current_hunk;
1195 long oldline, oldlen, newline, newlen;
1197 int context, state, filein, fileout, filepatch, hunknum;
1239 void *regexes, *snapshot;
1246 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1247 struct dirtree *threadparent;
1248 unsigned width, height;
1250 void *fields, *kfields;
1251 long long ticks, bits, time;
1252 int kcount, forcek, sortpos;
1253 int (*match_process)(long long *slot);
1254 void (*show_process)(void *tb);
1257 // toys/posix/renice.c
1259 struct renice_data {
1269 // processed pattern list
1270 struct double_list *pattern;
1272 char *nextline, *remember;
1273 void *restart, *lastregex;
1274 long nextlen, rememberlen, count;
1279 // toys/posix/sort.c
1282 char *key_separator;
1283 struct arg_list *raw_keys;
1285 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1292 // toys/posix/split.c
1302 // toys/posix/strings.c
1304 struct strings_data {
1308 // toys/posix/tail.c
1314 int file_no, ffd, *files;
1323 // toys/posix/touch.c
1331 // toys/posix/ulimit.c
1333 struct ulimit_data {
1337 // toys/posix/uniq.c
1346 // toys/posix/uudecode.c
1348 struct uudecode_data {
1355 unsigned long totals[4];
1358 // toys/posix/xargs.c
1367 long entries, bytes;
1371 extern union global_union {
1372 struct getprop_data getprop;
1373 struct log_data log;
1374 struct hello_data hello;
1375 struct skeleton_data skeleton;
1376 struct dmesg_data dmesg;
1377 struct hostname_data hostname;
1378 struct killall_data killall;
1379 struct md5sum_data md5sum;
1380 struct mknod_data mknod;
1381 struct mktemp_data mktemp;
1382 struct mount_data mount;
1383 struct passwd_data passwd;
1384 struct pidof_data pidof;
1385 struct seq_data seq;
1387 struct umount_data umount;
1388 struct ifconfig_data ifconfig;
1389 struct netcat_data netcat;
1390 struct netstat_data netstat;
1391 struct tunctl_data tunctl;
1392 struct acpi_data acpi;
1393 struct base64_data base64;
1394 struct blockdev_data blockdev;
1395 struct dos2unix_data dos2unix;
1396 struct fallocate_data fallocate;
1397 struct free_data free;
1398 struct hexedit_data hexedit;
1399 struct hwclock_data hwclock;
1400 struct ionice_data ionice;
1401 struct login_data login;
1402 struct losetup_data losetup;
1403 struct lspci_data lspci;
1404 struct makedevs_data makedevs;
1405 struct mix_data mix;
1406 struct mkpasswd_data mkpasswd;
1407 struct mkswap_data mkswap;
1408 struct modinfo_data modinfo;
1409 struct nsenter_data nsenter;
1410 struct oneit_data oneit;
1411 struct setfattr_data setfattr;
1412 struct shred_data shred;
1413 struct stat_data stat;
1414 struct swapon_data swapon;
1415 struct switch_root_data switch_root;
1416 struct timeout_data timeout;
1417 struct truncate_data truncate;
1418 struct xxd_data xxd;
1419 struct arp_data arp;
1420 struct arping_data arping;
1421 struct bootchartd_data bootchartd;
1422 struct brctl_data brctl;
1423 struct chrt_data chrt;
1424 struct compress_data compress;
1425 struct crond_data crond;
1426 struct crontab_data crontab;
1428 struct dhcp_data dhcp;
1429 struct dhcp6_data dhcp6;
1430 struct dhcpd_data dhcpd;
1431 struct diff_data diff;
1432 struct dumpleases_data dumpleases;
1433 struct expr_data expr;
1434 struct fdisk_data fdisk;
1435 struct fold_data fold;
1436 struct fsck_data fsck;
1437 struct ftpget_data ftpget;
1438 struct getfattr_data getfattr;
1439 struct getty_data getty;
1440 struct groupadd_data groupadd;
1441 struct host_data host;
1442 struct iconv_data iconv;
1444 struct ipcrm_data ipcrm;
1445 struct ipcs_data ipcs;
1446 struct klogd_data klogd;
1447 struct last_data last;
1448 struct logger_data logger;
1449 struct lsof_data lsof;
1450 struct mke2fs_data mke2fs;
1451 struct modprobe_data modprobe;
1452 struct more_data more;
1453 struct openvt_data openvt;
1454 struct ping_data ping;
1455 struct route_data route;
1457 struct sulogin_data sulogin;
1458 struct syslogd_data syslogd;
1459 struct tar_data tar;
1460 struct tcpsvd_data tcpsvd;
1461 struct telnet_data telnet;
1462 struct telnetd_data telnetd;
1463 struct tftp_data tftp;
1464 struct tftpd_data tftpd;
1466 struct traceroute_data traceroute;
1467 struct useradd_data useradd;
1469 struct watch_data watch;
1470 struct wget_data wget;
1471 struct chgrp_data chgrp;
1472 struct chmod_data chmod;
1473 struct cksum_data cksum;
1474 struct cmp_data cmp;
1476 struct cpio_data cpio;
1477 struct cut_data cut;
1478 struct date_data date;
1481 struct env_data env;
1482 struct expand_data expand;
1483 struct file_data file;
1484 struct find_data find;
1485 struct grep_data grep;
1486 struct head_data head;
1488 struct kill_data kill;
1490 struct mkdir_data mkdir;
1491 struct mkfifo_data mkfifo;
1492 struct nice_data nice;
1495 struct paste_data paste;
1496 struct patch_data patch;
1498 struct renice_data renice;
1499 struct sed_data sed;
1500 struct sort_data sort;
1501 struct split_data split;
1502 struct strings_data strings;
1503 struct tail_data tail;
1504 struct tee_data tee;
1505 struct touch_data touch;
1506 struct ulimit_data ulimit;
1507 struct uniq_data uniq;
1508 struct uudecode_data uudecode;
1510 struct xargs_data xargs;