1 // toys/android/getprop.c
5 char **nv; // name/value pairs: even=name, odd=value
6 struct selabel_handle *handle;
9 // toys/example/hello.c
15 // toys/example/skeleton.c
17 struct skeleton_data {
22 struct arg_list *d_list;
42 // toys/lsb/hostname.c
44 struct hostname_data {
87 struct arg_list *optlist;
133 int ac, bat, therm, cool;
137 // toys/other/base64.c
145 // toys/other/blockdev.c
147 struct blockdev_data {
151 // toys/other/dos2unix.c
153 struct dos2unix_data {
157 // toys/other/fallocate.c
159 struct fallocate_data {
167 unsigned long long units;
171 // toys/other/hexedit.c
173 struct hexedit_data {
176 int numlen, undo, undolen;
180 // toys/other/hwclock.c
182 struct hwclock_data {
188 // toys/other/ifconfig.c
190 struct ifconfig_data {
194 // toys/other/ionice.c
202 // toys/other/login.c
208 int login_timeout, login_fail_timeout;
211 // toys/other/losetup.c
213 struct losetup_data {
223 // toys/other/lspci.c
232 // toys/other/makedevs.c
234 struct makedevs_data {
247 // toys/other/mkpasswd.c
249 struct mkpasswd_data {
255 // toys/other/mkswap.c
261 // toys/other/modinfo.c
263 struct modinfo_data {
271 // toys/other/netcat.c
274 char *filename; // -f read from filename instead of network
275 long quit_delay; // -q Exit after EOF from stdin after # seconds.
276 char *source_address; // -s Bind to a specific source address.
277 long port; // -p Bind to a specific source port.
278 long wait; // -w Wait # seconds for a connection.
281 // toys/other/nsenter.c
283 struct nsenter_data {
288 // toys/other/oneit.c
294 // toys/other/shred.c
313 struct passwd *user_name;
314 struct group *group_name;
318 // toys/other/swapon.c
324 // toys/other/switch_root.c
326 struct switch_root_data {
332 // toys/other/timeout.c
334 struct timeout_data {
341 struct itimerval itv;
344 // toys/other/truncate.c
346 struct truncate_data {
361 // toys/pending/arp.c
373 // toys/pending/arping.c
377 unsigned long time_out;
382 unsigned long start, end;
383 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
387 // toys/pending/bootchartd.c
389 struct bootchartd_data {
391 long smpl_period_usec;
398 // toys/pending/brctl.c
404 // toys/pending/compress.c
406 struct compress_data {
407 // Huffman codes: base offset and extra bits tables (length and distance)
408 char lenbits[29], distbits[30];
409 unsigned short lenbase[29], distbase[30];
410 void *fixdisthuff, *fixlithuff;
413 void (*crcfunc)(char *data, int len);
416 // Compressed data buffer
421 // Tables only used for deflation
422 unsigned short *hashhead, *hashchain;
425 // toys/pending/crond.c
433 time_t crontabs_dir_mtime;
437 // toys/pending/crontab.c
439 struct crontab_data {
450 // toys/pending/dhcp.c
459 struct arg_list *req_opt;
461 struct arg_list *pkt_opt;
467 // toys/pending/dhcp6.c
470 char *interface_name, *pidfile, *script;
471 long retry, timeout, errortimeout;
473 int length, state, request_length, sock, sock1, status, retval, retries;
475 uint8_t transction_id[3];
476 struct sockaddr_in6 input_socket6;
479 // toys/pending/dhcpd.c
486 // toys/pending/diff.c
491 struct arg_list *L_list;
493 int dir_num, size, is_binary, status, change, len[2];
497 // toys/pending/dumpleases.c
499 struct dumpleases_data {
503 // toys/pending/expr.c
506 char **tok; // current token, not on the stack since recursive calls mutate it
511 // toys/pending/fdisk.c
520 // toys/pending/file.c
526 // toys/pending/fold.c
532 // toys/pending/fsck.c
538 struct double_list *devices;
548 // toys/pending/ftpget.c
551 long port; // char *port;
558 char buf[sizeof(struct sockaddr_storage)];
561 // toys/pending/getty.c
573 struct termios termios;
577 // toys/pending/groupadd.c
579 struct groupadd_data {
583 // toys/pending/host.c
589 // toys/pending/iconv.c
601 char stats, singleline, flush, *filter_dev, gbuf[8192];
602 int sockfd, connected, from_ok, route_cmd;
603 int8_t addressfamily, is_addr;
606 // toys/pending/ipcrm.c
609 struct arg_list *qkey;
610 struct arg_list *qid;
611 struct arg_list *skey;
612 struct arg_list *sid;
613 struct arg_list *mkey;
614 struct arg_list *mid;
617 // toys/pending/ipcs.c
623 // toys/pending/klogd.c
631 // toys/pending/last.c
636 struct arg_list *list;
639 // toys/pending/logger.c
646 // toys/pending/lsof.c
651 struct stat *sought_files;
653 struct double_list *all_sockets;
654 struct double_list *files;
659 // toys/pending/mke2fs.c
662 // Command line arguments.
664 long bytes_per_inode;
665 long inodes; // Total inodes in filesystem.
666 long reserved_percent; // Integer precent of space to reserve for root.
667 char *gendir; // Where to read dirtree from.
670 struct dirtree *dt; // Tree of files to copy into the new filesystem.
671 unsigned treeblocks; // Blocks used by dt
672 unsigned treeinodes; // Inodes used by dt
674 unsigned blocks; // Total blocks in the filesystem.
675 unsigned freeblocks; // Free blocks in the filesystem.
676 unsigned inodespg; // Inodes per group
677 unsigned groups; // Total number of block groups.
678 unsigned blockbits; // Bits per block. (Also blocks per group.)
681 unsigned nextblock; // Next data block to allocate
682 unsigned nextgroup; // Next group we'll be allocating from
683 int fsfd; // File descriptor of filesystem (to output to).
685 struct ext2_superblock sb;
688 // toys/pending/modprobe.c
690 struct modprobe_data {
691 struct arg_list *probes;
692 struct arg_list *dbase[256];
696 void (*dbg)(char *format, ...);
699 // toys/pending/more.c
706 // toys/pending/netstat.c
708 struct netstat_data {
709 char current_name[21];
710 int some_process_unidentified;
713 // toys/pending/openvt.c
716 unsigned long vt_num;
719 // toys/pending/ping.c
732 // toys/pending/route.c
746 // toys/pending/sulogin.c
748 struct sulogin_data {
750 struct termios crntio;
753 // toys/pending/syslogd.c
755 struct syslogd_data {
766 struct unsocks *lsocks; // list of listen sockets
767 struct logfile *lfiles; // list of write logfiles
771 // toys/pending/tar.c
776 struct arg_list *inc_file;
777 struct arg_list *exc_file;
779 struct arg_list *exc;
781 struct arg_list *inc, *pass;
782 void *inodes, *handle;
785 // toys/pending/tcpsvd.c
799 // toys/pending/telnet.c
809 struct termios def_term;
810 struct termios raw_term;
818 // toys/pending/telnetd.c
820 struct telnetd_data {
831 // toys/pending/tftp.c
838 struct sockaddr_storage inaddr;
842 // toys/pending/tftpd.c
854 short map[256]; //map of chars
858 // toys/pending/traceroute.c
860 struct traceroute_data {
867 struct arg_list *loose_source;
881 // toys/pending/useradd.c
883 struct useradd_data {
896 struct linestack *ls;
900 // toys/pending/watch.c
906 // toys/pending/wget.c
912 // toys/posix/chgrp.c
917 char *owner_name, *group_name;
921 // toys/posix/chmod.c
927 // toys/posix/cksum.c
930 unsigned crc_table[256];
957 int (*callback)(struct dirtree *try);
981 void (*do_cut)(int fd);
998 struct arg_list *fstype;
1001 int column_widths[5];
1021 // toys/posix/expand.c
1023 struct expand_data {
1024 struct arg_list *tabs;
1026 unsigned tabcount, *tab;
1029 // toys/posix/find.c
1033 struct double_list *argdata;
1034 int topdir, xdev, depth;
1038 // toys/posix/grep.c
1048 char indelim, outdelim;
1051 // toys/posix/head.c
1064 // toys/posix/kill.c
1068 struct arg_list *olist;
1076 struct dirtree *files, *singledir;
1078 unsigned screen_width;
1080 char uid_buf[12], gid_buf[12], *escmore;
1083 // toys/posix/mkdir.c
1090 // toys/posix/mkfifo.c
1092 struct mkfifo_data {
1099 // toys/posix/nice.c
1115 // Count of consecutive blank lines for -l has to persist between files
1122 struct arg_list *output_base;
1129 unsigned types, leftover, star;
1130 char *buf; // Points to buffers[0] or buffers[1].
1131 char *bufs[2]; // Used to detect duplicate lines.
1135 // toys/posix/paste.c
1141 // toys/posix/patch.c
1147 struct double_list *current_hunk;
1148 long oldline, oldlen, newline, newlen;
1150 int context, state, filein, fileout, filepatch, hunknum;
1192 void *regexes, *snapshot;
1199 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1200 struct dirtree *threadparent;
1201 unsigned width, height;
1203 void *fields, *kfields;
1204 long long ticks, bits, time;
1205 int kcount, forcek, sortpos;
1206 int (*match_process)(long long *slot);
1207 void (*show_process)(void *tb);
1210 // toys/posix/renice.c
1212 struct renice_data {
1222 // processed pattern list
1223 struct double_list *pattern;
1225 char *nextline, *remember;
1226 void *restart, *lastregex;
1227 long nextlen, rememberlen, count;
1232 // toys/posix/sort.c
1235 char *key_separator;
1236 struct arg_list *raw_keys;
1238 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1245 // toys/posix/split.c
1255 // toys/posix/strings.c
1257 struct strings_data {
1261 // toys/posix/tail.c
1267 int file_no, ffd, *files;
1276 // toys/posix/touch.c
1284 // toys/posix/ulimit.c
1286 struct ulimit_data {
1290 // toys/posix/uniq.c
1299 // toys/posix/uudecode.c
1301 struct uudecode_data {
1308 unsigned long totals[3];
1311 // toys/posix/xargs.c
1320 long entries, bytes;
1324 extern union global_union {
1325 struct getprop_data getprop;
1326 struct hello_data hello;
1327 struct skeleton_data skeleton;
1328 struct dmesg_data dmesg;
1329 struct hostname_data hostname;
1330 struct killall_data killall;
1331 struct md5sum_data md5sum;
1332 struct mknod_data mknod;
1333 struct mktemp_data mktemp;
1334 struct mount_data mount;
1335 struct passwd_data passwd;
1336 struct pidof_data pidof;
1337 struct seq_data seq;
1339 struct umount_data umount;
1340 struct acpi_data acpi;
1341 struct base64_data base64;
1342 struct blockdev_data blockdev;
1343 struct dos2unix_data dos2unix;
1344 struct fallocate_data fallocate;
1345 struct free_data free;
1346 struct hexedit_data hexedit;
1347 struct hwclock_data hwclock;
1348 struct ifconfig_data ifconfig;
1349 struct ionice_data ionice;
1350 struct login_data login;
1351 struct losetup_data losetup;
1352 struct lspci_data lspci;
1353 struct makedevs_data makedevs;
1354 struct mix_data mix;
1355 struct mkpasswd_data mkpasswd;
1356 struct mkswap_data mkswap;
1357 struct modinfo_data modinfo;
1358 struct netcat_data netcat;
1359 struct nsenter_data nsenter;
1360 struct oneit_data oneit;
1361 struct shred_data shred;
1362 struct stat_data stat;
1363 struct swapon_data swapon;
1364 struct switch_root_data switch_root;
1365 struct timeout_data timeout;
1366 struct truncate_data truncate;
1367 struct xxd_data xxd;
1368 struct arp_data arp;
1369 struct arping_data arping;
1370 struct bootchartd_data bootchartd;
1371 struct brctl_data brctl;
1372 struct compress_data compress;
1373 struct crond_data crond;
1374 struct crontab_data crontab;
1376 struct dhcp_data dhcp;
1377 struct dhcp6_data dhcp6;
1378 struct dhcpd_data dhcpd;
1379 struct diff_data diff;
1380 struct dumpleases_data dumpleases;
1381 struct expr_data expr;
1382 struct fdisk_data fdisk;
1383 struct file_data file;
1384 struct fold_data fold;
1385 struct fsck_data fsck;
1386 struct ftpget_data ftpget;
1387 struct getty_data getty;
1388 struct groupadd_data groupadd;
1389 struct host_data host;
1390 struct iconv_data iconv;
1392 struct ipcrm_data ipcrm;
1393 struct ipcs_data ipcs;
1394 struct klogd_data klogd;
1395 struct last_data last;
1396 struct logger_data logger;
1397 struct lsof_data lsof;
1398 struct mke2fs_data mke2fs;
1399 struct modprobe_data modprobe;
1400 struct more_data more;
1401 struct netstat_data netstat;
1402 struct openvt_data openvt;
1403 struct ping_data ping;
1404 struct route_data route;
1406 struct sulogin_data sulogin;
1407 struct syslogd_data syslogd;
1408 struct tar_data tar;
1409 struct tcpsvd_data tcpsvd;
1410 struct telnet_data telnet;
1411 struct telnetd_data telnetd;
1412 struct tftp_data tftp;
1413 struct tftpd_data tftpd;
1415 struct traceroute_data traceroute;
1416 struct useradd_data useradd;
1418 struct watch_data watch;
1419 struct wget_data wget;
1420 struct chgrp_data chgrp;
1421 struct chmod_data chmod;
1422 struct cksum_data cksum;
1423 struct cmp_data cmp;
1425 struct cpio_data cpio;
1426 struct cut_data cut;
1427 struct date_data date;
1430 struct env_data env;
1431 struct expand_data expand;
1432 struct find_data find;
1433 struct grep_data grep;
1434 struct head_data head;
1436 struct kill_data kill;
1438 struct mkdir_data mkdir;
1439 struct mkfifo_data mkfifo;
1440 struct nice_data nice;
1443 struct paste_data paste;
1444 struct patch_data patch;
1446 struct renice_data renice;
1447 struct sed_data sed;
1448 struct sort_data sort;
1449 struct split_data split;
1450 struct strings_data strings;
1451 struct tail_data tail;
1452 struct tee_data tee;
1453 struct touch_data touch;
1454 struct ulimit_data ulimit;
1455 struct uniq_data uniq;
1456 struct uudecode_data uudecode;
1458 struct xargs_data xargs;