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;
317 // toys/other/swapon.c
323 // toys/other/switch_root.c
325 struct switch_root_data {
331 // toys/other/timeout.c
333 struct timeout_data {
340 struct itimerval itv;
343 // toys/other/truncate.c
345 struct truncate_data {
360 // toys/pending/arp.c
372 // toys/pending/arping.c
376 unsigned long time_out;
381 unsigned long start, end;
382 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
386 // toys/pending/bootchartd.c
388 struct bootchartd_data {
390 long smpl_period_usec;
397 // toys/pending/brctl.c
403 // toys/pending/compress.c
405 struct compress_data {
406 // Huffman codes: base offset and extra bits tables (length and distance)
407 char lenbits[29], distbits[30];
408 unsigned short lenbase[29], distbase[30];
409 void *fixdisthuff, *fixlithuff;
412 void (*crcfunc)(char *data, int len);
415 // Compressed data buffer
420 // Tables only used for deflation
421 unsigned short *hashhead, *hashchain;
424 // toys/pending/crond.c
432 time_t crontabs_dir_mtime;
436 // toys/pending/crontab.c
438 struct crontab_data {
449 // toys/pending/dhcp.c
458 struct arg_list *req_opt;
460 struct arg_list *pkt_opt;
466 // toys/pending/dhcp6.c
469 char *interface_name, *pidfile, *script;
470 long retry, timeout, errortimeout;
472 int length, state, request_length, sock, sock1, status, retval, retries;
474 uint8_t transction_id[3];
475 struct sockaddr_in6 input_socket6;
478 // toys/pending/dhcpd.c
485 // toys/pending/diff.c
490 struct arg_list *L_list;
492 int dir_num, size, is_binary, status, change, len[2];
496 // toys/pending/dumpleases.c
498 struct dumpleases_data {
502 // toys/pending/expr.c
505 char **tok; // current token, not on the stack since recursive calls mutate it
510 // toys/pending/fdisk.c
519 // toys/pending/file.c
525 // toys/pending/fold.c
531 // toys/pending/fsck.c
537 struct double_list *devices;
547 // toys/pending/ftpget.c
550 long port; // char *port;
557 char buf[sizeof(struct sockaddr_storage)];
560 // toys/pending/getty.c
572 struct termios termios;
576 // toys/pending/groupadd.c
578 struct groupadd_data {
582 // toys/pending/host.c
588 // toys/pending/iconv.c
600 char stats, singleline, flush, *filter_dev, gbuf[8192];
601 int sockfd, connected, from_ok, route_cmd;
602 int8_t addressfamily, is_addr;
605 // toys/pending/ipcrm.c
608 struct arg_list *qkey;
609 struct arg_list *qid;
610 struct arg_list *skey;
611 struct arg_list *sid;
612 struct arg_list *mkey;
613 struct arg_list *mid;
616 // toys/pending/ipcs.c
622 // toys/pending/klogd.c
630 // toys/pending/last.c
635 struct arg_list *list;
638 // toys/pending/logger.c
645 // toys/pending/lsof.c
650 struct stat *sought_files;
652 struct double_list *all_sockets;
653 struct double_list *files;
658 // toys/pending/mke2fs.c
661 // Command line arguments.
663 long bytes_per_inode;
664 long inodes; // Total inodes in filesystem.
665 long reserved_percent; // Integer precent of space to reserve for root.
666 char *gendir; // Where to read dirtree from.
669 struct dirtree *dt; // Tree of files to copy into the new filesystem.
670 unsigned treeblocks; // Blocks used by dt
671 unsigned treeinodes; // Inodes used by dt
673 unsigned blocks; // Total blocks in the filesystem.
674 unsigned freeblocks; // Free blocks in the filesystem.
675 unsigned inodespg; // Inodes per group
676 unsigned groups; // Total number of block groups.
677 unsigned blockbits; // Bits per block. (Also blocks per group.)
680 unsigned nextblock; // Next data block to allocate
681 unsigned nextgroup; // Next group we'll be allocating from
682 int fsfd; // File descriptor of filesystem (to output to).
684 struct ext2_superblock sb;
687 // toys/pending/modprobe.c
689 struct modprobe_data {
690 struct arg_list *probes;
691 struct arg_list *dbase[256];
695 void (*dbg)(char *format, ...);
698 // toys/pending/more.c
705 // toys/pending/netstat.c
707 struct netstat_data {
708 char current_name[21];
709 int some_process_unidentified;
712 // toys/pending/openvt.c
715 unsigned long vt_num;
718 // toys/pending/ping.c
731 // toys/pending/route.c
745 // toys/pending/sulogin.c
747 struct sulogin_data {
749 struct termios crntio;
752 // toys/pending/syslogd.c
754 struct syslogd_data {
765 struct unsocks *lsocks; // list of listen sockets
766 struct logfile *lfiles; // list of write logfiles
770 // toys/pending/tar.c
775 struct arg_list *inc_file;
776 struct arg_list *exc_file;
778 struct arg_list *exc;
780 struct arg_list *inc, *pass;
781 void *inodes, *handle;
784 // toys/pending/tcpsvd.c
798 // toys/pending/telnet.c
808 struct termios def_term;
809 struct termios raw_term;
817 // toys/pending/telnetd.c
819 struct telnetd_data {
830 // toys/pending/tftp.c
837 struct sockaddr_storage inaddr;
841 // toys/pending/tftpd.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/pending/wget.c
911 // toys/posix/chgrp.c
916 char *owner_name, *group_name;
920 // toys/posix/chmod.c
926 // toys/posix/cksum.c
929 unsigned crc_table[256];
956 int (*callback)(struct dirtree *try);
980 void (*do_cut)(int fd);
997 struct arg_list *fstype;
1000 int column_widths[5];
1020 // toys/posix/expand.c
1022 struct expand_data {
1023 struct arg_list *tabs;
1025 unsigned tabcount, *tab;
1028 // toys/posix/find.c
1032 struct double_list *argdata;
1033 int topdir, xdev, depth;
1037 // toys/posix/grep.c
1047 char indelim, outdelim;
1050 // toys/posix/head.c
1063 // toys/posix/kill.c
1067 struct arg_list *olist;
1075 struct dirtree *files, *singledir;
1077 unsigned screen_width;
1079 char uid_buf[12], gid_buf[12], *escmore;
1082 // toys/posix/mkdir.c
1089 // toys/posix/mkfifo.c
1091 struct mkfifo_data {
1098 // toys/posix/nice.c
1114 // Count of consecutive blank lines for -l has to persist between files
1121 struct arg_list *output_base;
1128 unsigned types, leftover, star;
1129 char *buf; // Points to buffers[0] or buffers[1].
1130 char *bufs[2]; // Used to detect duplicate lines.
1134 // toys/posix/paste.c
1140 // toys/posix/patch.c
1146 struct double_list *current_hunk;
1147 long oldline, oldlen, newline, newlen;
1149 int context, state, filein, fileout, filepatch, hunknum;
1190 void *regexes, *snapshot;
1199 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1200 unsigned width, height;
1202 void *fields, *kfields;
1203 long long ticks, bits, time;
1204 int kcount, forcek, sortpos;
1205 int (*match_process)(long long *slot);
1206 void (*show_process)(void *tb);
1209 // toys/posix/renice.c
1211 struct renice_data {
1221 // processed pattern list
1222 struct double_list *pattern;
1224 char *nextline, *remember;
1225 void *restart, *lastregex;
1226 long nextlen, rememberlen, count;
1231 // toys/posix/sort.c
1234 char *key_separator;
1235 struct arg_list *raw_keys;
1237 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1244 // toys/posix/split.c
1254 // toys/posix/strings.c
1256 struct strings_data {
1260 // toys/posix/tail.c
1266 int file_no, ffd, *files;
1275 // toys/posix/touch.c
1283 // toys/posix/ulimit.c
1285 struct ulimit_data {
1289 // toys/posix/uniq.c
1298 // toys/posix/uudecode.c
1300 struct uudecode_data {
1307 unsigned long totals[3];
1310 // toys/posix/xargs.c
1319 long entries, bytes;
1323 extern union global_union {
1324 struct getprop_data getprop;
1325 struct hello_data hello;
1326 struct skeleton_data skeleton;
1327 struct dmesg_data dmesg;
1328 struct hostname_data hostname;
1329 struct killall_data killall;
1330 struct md5sum_data md5sum;
1331 struct mknod_data mknod;
1332 struct mktemp_data mktemp;
1333 struct mount_data mount;
1334 struct passwd_data passwd;
1335 struct pidof_data pidof;
1336 struct seq_data seq;
1338 struct umount_data umount;
1339 struct acpi_data acpi;
1340 struct base64_data base64;
1341 struct blockdev_data blockdev;
1342 struct dos2unix_data dos2unix;
1343 struct fallocate_data fallocate;
1344 struct free_data free;
1345 struct hexedit_data hexedit;
1346 struct hwclock_data hwclock;
1347 struct ifconfig_data ifconfig;
1348 struct ionice_data ionice;
1349 struct login_data login;
1350 struct losetup_data losetup;
1351 struct lspci_data lspci;
1352 struct makedevs_data makedevs;
1353 struct mix_data mix;
1354 struct mkpasswd_data mkpasswd;
1355 struct mkswap_data mkswap;
1356 struct modinfo_data modinfo;
1357 struct netcat_data netcat;
1358 struct nsenter_data nsenter;
1359 struct oneit_data oneit;
1360 struct shred_data shred;
1361 struct stat_data stat;
1362 struct swapon_data swapon;
1363 struct switch_root_data switch_root;
1364 struct timeout_data timeout;
1365 struct truncate_data truncate;
1366 struct xxd_data xxd;
1367 struct arp_data arp;
1368 struct arping_data arping;
1369 struct bootchartd_data bootchartd;
1370 struct brctl_data brctl;
1371 struct compress_data compress;
1372 struct crond_data crond;
1373 struct crontab_data crontab;
1375 struct dhcp_data dhcp;
1376 struct dhcp6_data dhcp6;
1377 struct dhcpd_data dhcpd;
1378 struct diff_data diff;
1379 struct dumpleases_data dumpleases;
1380 struct expr_data expr;
1381 struct fdisk_data fdisk;
1382 struct file_data file;
1383 struct fold_data fold;
1384 struct fsck_data fsck;
1385 struct ftpget_data ftpget;
1386 struct getty_data getty;
1387 struct groupadd_data groupadd;
1388 struct host_data host;
1389 struct iconv_data iconv;
1391 struct ipcrm_data ipcrm;
1392 struct ipcs_data ipcs;
1393 struct klogd_data klogd;
1394 struct last_data last;
1395 struct logger_data logger;
1396 struct lsof_data lsof;
1397 struct mke2fs_data mke2fs;
1398 struct modprobe_data modprobe;
1399 struct more_data more;
1400 struct netstat_data netstat;
1401 struct openvt_data openvt;
1402 struct ping_data ping;
1403 struct route_data route;
1405 struct sulogin_data sulogin;
1406 struct syslogd_data syslogd;
1407 struct tar_data tar;
1408 struct tcpsvd_data tcpsvd;
1409 struct telnet_data telnet;
1410 struct telnetd_data telnetd;
1411 struct tftp_data tftp;
1412 struct tftpd_data tftpd;
1414 struct traceroute_data traceroute;
1415 struct useradd_data useradd;
1417 struct watch_data watch;
1418 struct wget_data wget;
1419 struct chgrp_data chgrp;
1420 struct chmod_data chmod;
1421 struct cksum_data cksum;
1422 struct cmp_data cmp;
1424 struct cpio_data cpio;
1425 struct cut_data cut;
1426 struct date_data date;
1429 struct env_data env;
1430 struct expand_data expand;
1431 struct find_data find;
1432 struct grep_data grep;
1433 struct head_data head;
1435 struct kill_data kill;
1437 struct mkdir_data mkdir;
1438 struct mkfifo_data mkfifo;
1439 struct nice_data nice;
1442 struct paste_data paste;
1443 struct patch_data patch;
1445 struct renice_data renice;
1446 struct sed_data sed;
1447 struct sort_data sort;
1448 struct split_data split;
1449 struct strings_data strings;
1450 struct tail_data tail;
1451 struct tee_data tee;
1452 struct touch_data touch;
1453 struct ulimit_data ulimit;
1454 struct uniq_data uniq;
1455 struct uudecode_data uudecode;
1457 struct xargs_data xargs;