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/mkswap.c
252 // toys/other/modinfo.c
254 struct modinfo_data {
262 // toys/other/netcat.c
265 char *filename; // -f read from filename instead of network
266 long quit_delay; // -q Exit after EOF from stdin after # seconds.
267 char *source_address; // -s Bind to a specific source address.
268 long port; // -p Bind to a specific source port.
269 long wait; // -w Wait # seconds for a connection.
272 // toys/other/nsenter.c
274 struct nsenter_data {
279 // toys/other/oneit.c
285 // toys/other/shred.c
304 struct passwd *user_name;
305 struct group *group_name;
308 // toys/other/swapon.c
314 // toys/other/switch_root.c
316 struct switch_root_data {
322 // toys/other/timeout.c
324 struct timeout_data {
331 struct itimerval itv;
334 // toys/other/truncate.c
336 struct truncate_data {
351 // toys/pending/arp.c
363 // toys/pending/arping.c
367 unsigned long time_out;
372 unsigned long start, end;
373 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv,
377 // toys/pending/bootchartd.c
379 struct bootchartd_data {
381 long smpl_period_usec;
388 // toys/pending/brctl.c
394 // toys/pending/compress.c
396 struct compress_data {
397 // Huffman codes: base offset and extra bits tables (length and distance)
398 char lenbits[29], distbits[30];
399 unsigned short lenbase[29], distbase[30];
400 void *fixdisthuff, *fixlithuff;
403 void (*crcfunc)(char *data, int len);
406 // Compressed data buffer
411 // Tables only used for deflation
412 unsigned short *hashhead, *hashchain;
415 // toys/pending/crond.c
423 time_t crontabs_dir_mtime;
427 // toys/pending/crontab.c
429 struct crontab_data {
440 // toys/pending/dhcp.c
449 struct arg_list *req_opt;
451 struct arg_list *pkt_opt;
457 // toys/pending/dhcp6.c
460 char *interface_name, *pidfile, *script;
461 long retry, timeout, errortimeout;
463 int length, state, request_length, sock, sock1, status, retval, retries;
465 uint8_t transction_id[3];
466 struct sockaddr_in6 input_socket6;
469 // toys/pending/dhcpd.c
476 // toys/pending/diff.c
481 struct arg_list *L_list;
483 int dir_num, size, is_binary, status, change, len[2];
487 // toys/pending/dumpleases.c
489 struct dumpleases_data {
493 // toys/pending/expr.c
499 // toys/pending/fdisk.c
508 // toys/pending/fold.c
514 // toys/pending/fsck.c
520 struct double_list *devices;
530 // toys/pending/ftpget.c
533 long port; // char *port;
540 char buf[sizeof(struct sockaddr_storage)];
543 // toys/pending/getty.c
555 struct termios termios;
559 // toys/pending/groupadd.c
561 struct groupadd_data {
565 // toys/pending/host.c
571 // toys/pending/iconv.c
583 char stats, singleline, flush, *filter_dev, gbuf[8192];
584 int sockfd, connected, from_ok, route_cmd;
585 int8_t addressfamily, is_addr;
588 // toys/pending/ipcrm.c
591 struct arg_list *qkey;
592 struct arg_list *qid;
593 struct arg_list *skey;
594 struct arg_list *sid;
595 struct arg_list *mkey;
596 struct arg_list *mid;
599 // toys/pending/ipcs.c
605 // toys/pending/klogd.c
613 // toys/pending/last.c
618 struct arg_list *list;
621 // toys/pending/logger.c
628 // toys/pending/lsof.c
633 struct stat *sought_files;
635 struct double_list *files;
640 // toys/pending/mke2fs.c
643 // Command line arguments.
645 long bytes_per_inode;
646 long inodes; // Total inodes in filesystem.
647 long reserved_percent; // Integer precent of space to reserve for root.
648 char *gendir; // Where to read dirtree from.
651 struct dirtree *dt; // Tree of files to copy into the new filesystem.
652 unsigned treeblocks; // Blocks used by dt
653 unsigned treeinodes; // Inodes used by dt
655 unsigned blocks; // Total blocks in the filesystem.
656 unsigned freeblocks; // Free blocks in the filesystem.
657 unsigned inodespg; // Inodes per group
658 unsigned groups; // Total number of block groups.
659 unsigned blockbits; // Bits per block. (Also blocks per group.)
662 unsigned nextblock; // Next data block to allocate
663 unsigned nextgroup; // Next group we'll be allocating from
664 int fsfd; // File descriptor of filesystem (to output to).
666 struct ext2_superblock sb;
669 // toys/pending/modprobe.c
671 struct modprobe_data {
672 struct arg_list *probes;
673 struct arg_list *dbase[256];
677 void (*dbg)(char *format, ...);
680 // toys/pending/more.c
687 // toys/pending/netstat.c
689 struct netstat_data {
690 char current_name[21];
691 int some_process_unidentified;
694 // toys/pending/openvt.c
697 unsigned long vt_num;
700 // toys/pending/ping.c
713 // toys/pending/route.c
725 // toys/pending/sulogin.c
727 struct sulogin_data {
729 struct termios crntio;
732 // toys/pending/syslogd.c
734 struct syslogd_data {
745 struct unsocks *lsocks; // list of listen sockets
746 struct logfile *lfiles; // list of write logfiles
750 // toys/pending/tar.c
755 struct arg_list *inc_file;
756 struct arg_list *exc_file;
758 struct arg_list *exc;
760 struct arg_list *inc, *pass;
761 void *inodes, *handle;
764 // toys/pending/tcpsvd.c
778 // toys/pending/telnet.c
788 struct termios def_term;
789 struct termios raw_term;
797 // toys/pending/telnetd.c
799 struct telnetd_data {
810 // toys/pending/tftp.c
817 struct sockaddr_storage inaddr;
821 // toys/pending/tftpd.c
833 short map[256]; //map of chars
837 // toys/pending/traceroute.c
839 struct traceroute_data {
846 struct arg_list *loose_source;
860 // toys/pending/useradd.c
862 struct useradd_data {
875 struct linestack *ls;
879 // toys/pending/watch.c
885 // toys/posix/chgrp.c
890 char *owner_name, *group_name;
894 // toys/posix/chmod.c
900 // toys/posix/cksum.c
903 unsigned crc_table[256];
930 int (*callback)(struct dirtree *try);
954 void (*do_cut)(int fd);
971 struct arg_list *fstype;
974 int column_widths[5];
988 // toys/posix/expand.c
991 struct arg_list *tabs;
993 unsigned tabcount, *tab;
1000 struct double_list *argdata;
1001 int topdir, xdev, depth;
1005 // toys/posix/grep.c
1013 // toys/posix/head.c
1026 // toys/posix/kill.c
1030 struct arg_list *olist;
1038 struct dirtree *files, *singledir;
1040 unsigned screen_width;
1042 char uid_buf[12], gid_buf[12];
1045 // toys/posix/mkdir.c
1052 // toys/posix/mkfifo.c
1054 struct mkfifo_data {
1061 // toys/posix/nice.c
1077 // Count of consecutive blank lines for -l has to persist between files
1084 struct arg_list *output_base;
1090 unsigned types, leftover, star;
1092 uint64_t bufs[4]; // force 64-bit alignment
1096 // toys/posix/paste.c
1102 // toys/posix/patch.c
1108 struct double_list *current_hunk;
1109 long oldline, oldlen, newline, newlen;
1111 int context, state, filein, fileout, filepatch, hunknum;
1155 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
1156 unsigned width, height;
1158 void *fields, *kfields;
1159 long long ticks, bits, ioread, iowrite, aioread, aiowrite;
1161 int kcount, forcek, sortpos;
1162 int (*match_process)(long long *slot);
1163 void (*show_process)(void *tb);
1166 // toys/posix/renice.c
1168 struct renice_data {
1178 // processed pattern list
1179 struct double_list *pattern;
1181 char *nextline, *remember;
1182 void *restart, *lastregex;
1183 long nextlen, rememberlen, count;
1188 // toys/posix/sort.c
1191 char *key_separator;
1192 struct arg_list *raw_keys;
1194 char *ignore1, ignore2; // GNU compatability NOPs for -S and -T.
1201 // toys/posix/split.c
1211 // toys/posix/strings.c
1213 struct strings_data {
1217 // toys/posix/tail.c
1223 int file_no, ffd, *files;
1232 // toys/posix/touch.c
1240 // toys/posix/uniq.c
1249 // toys/posix/uudecode.c
1251 struct uudecode_data {
1258 unsigned long totals[3];
1261 // toys/posix/xargs.c
1270 long entries, bytes;
1274 extern union global_union {
1275 struct getprop_data getprop;
1276 struct hello_data hello;
1277 struct skeleton_data skeleton;
1278 struct dmesg_data dmesg;
1279 struct killall_data killall;
1280 struct md5sum_data md5sum;
1281 struct mknod_data mknod;
1282 struct mktemp_data mktemp;
1283 struct mount_data mount;
1284 struct passwd_data passwd;
1285 struct pidof_data pidof;
1286 struct seq_data seq;
1288 struct umount_data umount;
1289 struct acpi_data acpi;
1290 struct base64_data base64;
1291 struct blockdev_data blockdev;
1292 struct dos2unix_data dos2unix;
1293 struct fallocate_data fallocate;
1294 struct free_data free;
1295 struct hexedit_data hexedit;
1296 struct hwclock_data hwclock;
1297 struct ifconfig_data ifconfig;
1298 struct ionice_data ionice;
1299 struct login_data login;
1300 struct losetup_data losetup;
1301 struct lspci_data lspci;
1302 struct makedevs_data makedevs;
1303 struct mix_data mix;
1304 struct mkpasswd_data mkpasswd;
1305 struct mkswap_data mkswap;
1306 struct modinfo_data modinfo;
1307 struct netcat_data netcat;
1308 struct nsenter_data nsenter;
1309 struct oneit_data oneit;
1310 struct shred_data shred;
1311 struct stat_data stat;
1312 struct swapon_data swapon;
1313 struct switch_root_data switch_root;
1314 struct timeout_data timeout;
1315 struct truncate_data truncate;
1316 struct xxd_data xxd;
1317 struct arp_data arp;
1318 struct arping_data arping;
1319 struct bootchartd_data bootchartd;
1320 struct brctl_data brctl;
1321 struct compress_data compress;
1322 struct crond_data crond;
1323 struct crontab_data crontab;
1325 struct dhcp_data dhcp;
1326 struct dhcp6_data dhcp6;
1327 struct dhcpd_data dhcpd;
1328 struct diff_data diff;
1329 struct dumpleases_data dumpleases;
1330 struct expr_data expr;
1331 struct fdisk_data fdisk;
1332 struct fold_data fold;
1333 struct fsck_data fsck;
1334 struct ftpget_data ftpget;
1335 struct getty_data getty;
1336 struct groupadd_data groupadd;
1337 struct host_data host;
1338 struct iconv_data iconv;
1340 struct ipcrm_data ipcrm;
1341 struct ipcs_data ipcs;
1342 struct klogd_data klogd;
1343 struct last_data last;
1344 struct logger_data logger;
1345 struct lsof_data lsof;
1346 struct mke2fs_data mke2fs;
1347 struct modprobe_data modprobe;
1348 struct more_data more;
1349 struct netstat_data netstat;
1350 struct openvt_data openvt;
1351 struct ping_data ping;
1352 struct route_data route;
1354 struct sulogin_data sulogin;
1355 struct syslogd_data syslogd;
1356 struct tar_data tar;
1357 struct tcpsvd_data tcpsvd;
1358 struct telnet_data telnet;
1359 struct telnetd_data telnetd;
1360 struct tftp_data tftp;
1361 struct tftpd_data tftpd;
1363 struct traceroute_data traceroute;
1364 struct useradd_data useradd;
1366 struct watch_data watch;
1367 struct chgrp_data chgrp;
1368 struct chmod_data chmod;
1369 struct cksum_data cksum;
1370 struct cmp_data cmp;
1372 struct cpio_data cpio;
1373 struct cut_data cut;
1374 struct date_data date;
1377 struct expand_data expand;
1378 struct find_data find;
1379 struct grep_data grep;
1380 struct head_data head;
1382 struct kill_data kill;
1384 struct mkdir_data mkdir;
1385 struct mkfifo_data mkfifo;
1386 struct nice_data nice;
1389 struct paste_data paste;
1390 struct patch_data patch;
1392 struct renice_data renice;
1393 struct sed_data sed;
1394 struct sort_data sort;
1395 struct split_data split;
1396 struct strings_data strings;
1397 struct tail_data tail;
1398 struct tee_data tee;
1399 struct touch_data touch;
1400 struct uniq_data uniq;
1401 struct uudecode_data uudecode;
1403 struct xargs_data xargs;