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/ping.c
707 // toys/pending/route.c
719 // toys/pending/sulogin.c
721 struct sulogin_data {
723 struct termios crntio;
726 // toys/pending/syslogd.c
728 struct syslogd_data {
739 struct unsocks *lsocks; // list of listen sockets
740 struct logfile *lfiles; // list of write logfiles
744 // toys/pending/tar.c
749 struct arg_list *inc_file;
750 struct arg_list *exc_file;
752 struct arg_list *exc;
754 struct arg_list *inc, *pass;
755 void *inodes, *handle;
758 // toys/pending/tcpsvd.c
772 // toys/pending/telnet.c
782 struct termios def_term;
783 struct termios raw_term;
791 // toys/pending/telnetd.c
793 struct telnetd_data {
804 // toys/pending/tftp.c
811 struct sockaddr_storage inaddr;
815 // toys/pending/tftpd.c
824 // toys/pending/top.c
844 short map[256]; //map of chars
848 // toys/pending/traceroute.c
850 struct traceroute_data {
857 struct arg_list *loose_source;
871 // toys/pending/useradd.c
873 struct useradd_data {
886 struct linestack *ls;
890 // toys/pending/watch.c
896 // toys/posix/chgrp.c
901 char *owner_name, *group_name;
905 // toys/posix/chmod.c
911 // toys/posix/cksum.c
914 unsigned crc_table[256];
941 int (*callback)(struct dirtree *try);
965 void (*do_cut)(int fd);
982 struct arg_list *fstype;
985 int column_widths[5];
999 // toys/posix/expand.c
1001 struct expand_data {
1002 struct arg_list *tabs;
1004 unsigned tabcount, *tab;
1007 // toys/posix/find.c
1011 struct double_list *argdata;
1012 int topdir, xdev, depth;
1016 // toys/posix/grep.c
1024 // toys/posix/head.c
1037 // toys/posix/kill.c
1041 struct arg_list *olist;
1049 struct dirtree *files, *singledir;
1051 unsigned screen_width;
1053 char uid_buf[12], gid_buf[12];
1056 // toys/posix/mkdir.c
1063 // toys/posix/mkfifo.c
1065 struct mkfifo_data {
1072 // toys/posix/nice.c
1088 // Count of consecutive blank lines for -l has to persist between files
1095 struct arg_list *output_base;
1101 unsigned types, leftover, star;
1103 uint64_t bufs[4]; // force 64-bit alignment
1107 // toys/posix/paste.c
1113 // toys/posix/patch.c
1119 struct double_list *current_hunk;
1120 long oldline, oldlen, newline, newlen;
1122 int context, state, filein, fileout, filepatch, hunknum;
1169 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1170 unsigned width, height;
1172 void *fields, *kfields;
1173 long long ticks, bits, ioread, iowrite, aioread, aiowrite;
1175 int kcount, forcek, sortpos;
1176 int (*match_process)(long long *slot);
1177 void (*show_process)(void *tb);
1180 // toys/posix/renice.c
1182 struct renice_data {
1192 // processed pattern list
1193 struct double_list *pattern;
1195 char *nextline, *remember;
1196 void *restart, *lastregex;
1197 long nextlen, rememberlen, count;
1202 // toys/posix/sort.c
1205 char *key_separator;
1206 struct arg_list *raw_keys;
1208 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1215 // toys/posix/split.c
1225 // toys/posix/strings.c
1227 struct strings_data {
1231 // toys/posix/tail.c
1237 int file_no, ffd, *files;
1246 // toys/posix/touch.c
1254 // toys/posix/uniq.c
1263 // toys/posix/uudecode.c
1265 struct uudecode_data {
1272 unsigned long totals[3];
1275 // toys/posix/xargs.c
1284 long entries, bytes;
1288 extern union global_union {
1289 struct getprop_data getprop;
1290 struct hello_data hello;
1291 struct skeleton_data skeleton;
1292 struct dmesg_data dmesg;
1293 struct killall_data killall;
1294 struct md5sum_data md5sum;
1295 struct mknod_data mknod;
1296 struct mktemp_data mktemp;
1297 struct mount_data mount;
1298 struct passwd_data passwd;
1299 struct pidof_data pidof;
1300 struct seq_data seq;
1302 struct umount_data umount;
1303 struct acpi_data acpi;
1304 struct base64_data base64;
1305 struct blockdev_data blockdev;
1306 struct dos2unix_data dos2unix;
1307 struct fallocate_data fallocate;
1308 struct free_data free;
1309 struct hexedit_data hexedit;
1310 struct hwclock_data hwclock;
1311 struct ifconfig_data ifconfig;
1312 struct ionice_data ionice;
1313 struct login_data login;
1314 struct losetup_data losetup;
1315 struct lspci_data lspci;
1316 struct makedevs_data makedevs;
1317 struct mix_data mix;
1318 struct mkpasswd_data mkpasswd;
1319 struct modinfo_data modinfo;
1320 struct netcat_data netcat;
1321 struct nsenter_data nsenter;
1322 struct oneit_data oneit;
1323 struct shred_data shred;
1324 struct stat_data stat;
1325 struct swapon_data swapon;
1326 struct switch_root_data switch_root;
1327 struct timeout_data timeout;
1328 struct truncate_data truncate;
1329 struct xxd_data xxd;
1330 struct arp_data arp;
1331 struct arping_data arping;
1332 struct bootchartd_data bootchartd;
1333 struct brctl_data brctl;
1334 struct compress_data compress;
1335 struct crond_data crond;
1336 struct crontab_data crontab;
1338 struct dhcp_data dhcp;
1339 struct dhcp6_data dhcp6;
1340 struct dhcpd_data dhcpd;
1341 struct diff_data diff;
1342 struct dumpleases_data dumpleases;
1343 struct expr_data expr;
1344 struct fdisk_data fdisk;
1345 struct fold_data fold;
1346 struct fsck_data fsck;
1347 struct ftpget_data ftpget;
1348 struct getty_data getty;
1349 struct groupadd_data groupadd;
1350 struct host_data host;
1351 struct iconv_data iconv;
1353 struct ipcrm_data ipcrm;
1354 struct ipcs_data ipcs;
1355 struct klogd_data klogd;
1356 struct last_data last;
1357 struct logger_data logger;
1358 struct lsof_data lsof;
1359 struct mke2fs_data mke2fs;
1360 struct modprobe_data modprobe;
1361 struct more_data more;
1362 struct netstat_data netstat;
1363 struct openvt_data openvt;
1364 struct ping_data ping;
1365 struct route_data route;
1367 struct sulogin_data sulogin;
1368 struct syslogd_data syslogd;
1369 struct tar_data tar;
1370 struct tcpsvd_data tcpsvd;
1371 struct telnet_data telnet;
1372 struct telnetd_data telnetd;
1373 struct tftp_data tftp;
1374 struct tftpd_data tftpd;
1375 struct top_data top;
1377 struct traceroute_data traceroute;
1378 struct useradd_data useradd;
1380 struct watch_data watch;
1381 struct chgrp_data chgrp;
1382 struct chmod_data chmod;
1383 struct cksum_data cksum;
1384 struct cmp_data cmp;
1386 struct cpio_data cpio;
1387 struct cut_data cut;
1388 struct date_data date;
1391 struct expand_data expand;
1392 struct find_data find;
1393 struct grep_data grep;
1394 struct head_data head;
1396 struct kill_data kill;
1398 struct mkdir_data mkdir;
1399 struct mkfifo_data mkfifo;
1400 struct nice_data nice;
1403 struct paste_data paste;
1404 struct patch_data patch;
1406 struct renice_data renice;
1407 struct sed_data sed;
1408 struct sort_data sort;
1409 struct split_data split;
1410 struct strings_data strings;
1411 struct tail_data tail;
1412 struct tee_data tee;
1413 struct touch_data touch;
1414 struct uniq_data uniq;
1415 struct uudecode_data uudecode;
1417 struct xargs_data xargs;