1 // toys/android/log.c 2 3 struct log_data { 4 char *t, *p; 5 }; 6 7 // toys/example/demo_number.c 8 9 struct demo_number_data { 10 long D; 11 }; 12 13 // toys/example/hello.c 14 15 struct hello_data { 16 int unused; 17 }; 18 19 // toys/example/skeleton.c 20 21 struct skeleton_data { 22 union { 23 struct { 24 char *b; 25 long c; 26 struct arg_list *d; 27 long e; 28 char *also, *blubber; 29 } s; 30 struct { 31 long b; 32 } a; 33 }; 34 35 int more_globals; 36 }; 37 38 // toys/lsb/dmesg.c 39 40 struct dmesg_data { 41 long n, s; 42 43 int use_color; 44 time_t tea; 45 }; 46 47 // toys/lsb/gzip.c 48 49 struct gzip_data { 50 int level; 51 }; 52 53 // toys/lsb/hostname.c 54 55 struct hostname_data { 56 char *F; 57 }; 58 59 // toys/lsb/killall.c 60 61 struct killall_data { 62 char *s; 63 64 int signum; 65 pid_t cur_pid; 66 char **names; 67 short *err; 68 struct int_list { struct int_list *next; int val; } *pids; 69 }; 70 71 // toys/lsb/md5sum.c 72 73 struct md5sum_data { 74 int sawline; 75 76 // Crypto variables blanked after summing 77 unsigned state[5]; 78 unsigned oldstate[5]; 79 uint64_t count; 80 union { 81 char c[64]; 82 unsigned i[16]; 83 } buffer; 84 }; 85 86 // toys/lsb/mknod.c 87 88 struct mknod_data { 89 char *Z, *m; 90 }; 91 92 // toys/lsb/mktemp.c 93 94 struct mktemp_data { 95 char *p, *tmpdir; 96 }; 97 98 // toys/lsb/mount.c 99 100 struct mount_data { 101 struct arg_list *optlist; 102 char *type; 103 char *bigO; 104 105 unsigned long flags; 106 char *opts; 107 int okuser; 108 }; 109 110 // toys/lsb/passwd.c 111 112 struct passwd_data { 113 char *a; 114 }; 115 116 // toys/lsb/pidof.c 117 118 struct pidof_data { 119 char *o; 120 }; 121 122 // toys/lsb/seq.c 123 124 struct seq_data { 125 char *s, *f; 126 127 int precision; 128 }; 129 130 // toys/lsb/su.c 131 #ifdef OHOS_LITE 132 struct su_data { 133 char *s; 134 char *c; 135 }; 136 #endif 137 138 // toys/lsb/umount.c 139 140 struct umount_data { 141 struct arg_list *t; 142 143 char *types; 144 }; 145 146 // toys/net/ftpget.c 147 148 struct ftpget_data { 149 char *u, *p, *P; 150 151 int fd; 152 }; 153 154 // toys/net/ifconfig.c 155 156 struct ifconfig_data { 157 int sockfd; 158 }; 159 160 // toys/net/microcom.c 161 162 struct microcom_data { 163 char *s; 164 165 int fd; 166 struct termios original_stdin_state, original_fd_state; 167 }; 168 169 // toys/net/netcat.c 170 171 struct netcat_data { 172 char *f, *s; 173 long q, p, W, w; 174 }; 175 176 // toys/net/netstat.c 177 178 struct netstat_data { 179 struct num_cache *inodes; 180 int wpad; 181 };; 182 183 // toys/net/ping.c 184 185 struct ping_data { 186 char *I; 187 long w, W, i, s, c, t, m; 188 189 struct sockaddr *sa; 190 int sock; 191 unsigned long sent, recv, fugit, min, max; 192 }; 193 194 // toys/net/sntp.c 195 196 struct sntp_data { 197 long r; 198 char *p, *m, *M; 199 }; 200 201 // toys/net/tunctl.c 202 203 struct tunctl_data { 204 char *u; 205 }; 206 207 // toys/other/acpi.c 208 209 struct acpi_data { 210 int ac, bat, therm, cool; 211 char *cpath; 212 }; 213 214 // toys/other/base64.c 215 216 struct base64_data { 217 long w; 218 unsigned total; 219 unsigned n; // number of bits used in encoding. 5 for base32, 6 for base64 220 unsigned align; // number of bits to align to 221 }; 222 223 // toys/other/blkid.c 224 225 struct blkid_data { 226 struct arg_list *s; 227 }; 228 229 // toys/other/blockdev.c 230 231 struct blockdev_data { 232 long setbsz, setra; 233 }; 234 235 // toys/other/chrt.c 236 237 struct chrt_data { 238 long p; 239 }; 240 241 // toys/other/dos2unix.c 242 243 struct dos2unix_data { 244 char *tempfile; 245 }; 246 247 // toys/other/fallocate.c 248 249 struct fallocate_data { 250 long o, l; 251 }; 252 253 // toys/other/fmt.c 254 255 struct fmt_data { 256 int width; 257 258 int level, pos; 259 }; 260 261 // toys/other/free.c 262 263 struct free_data { 264 unsigned bits; 265 unsigned long long units; 266 char *buf; 267 }; 268 269 // toys/other/hexedit.c 270 271 struct hexedit_data { 272 char *data; 273 long long len, base; 274 int numlen, undo, undolen; 275 unsigned height; 276 }; 277 278 // toys/other/hwclock.c 279 280 struct hwclock_data { 281 char *f; 282 283 int utc; 284 }; 285 286 // toys/other/ionice.c 287 288 struct ionice_data { 289 long p, n, c; 290 }; 291 292 // toys/other/login.c 293 294 struct login_data { 295 char *h, *f; 296 297 int login_timeout, login_fail_timeout; 298 }; 299 300 // toys/other/losetup.c 301 302 struct losetup_data { 303 char *j; 304 long o, S; 305 306 int openflags; 307 dev_t jdev; 308 ino_t jino; 309 char *dir; 310 }; 311 312 // toys/other/lspci.c 313 314 struct lspci_data { 315 char *i; 316 long n; 317 318 FILE *db; 319 }; 320 321 // toys/other/makedevs.c 322 323 struct makedevs_data { 324 char *d; 325 }; 326 327 // toys/other/mix.c 328 329 struct mix_data { 330 long r, l; 331 char *d, *c; 332 }; 333 334 // toys/other/mkpasswd.c 335 336 struct mkpasswd_data { 337 long P; 338 char *m, *S; 339 }; 340 341 // toys/other/mkswap.c 342 343 struct mkswap_data { 344 char *L; 345 }; 346 347 // toys/other/modinfo.c 348 349 struct modinfo_data { 350 char *F, *k, *b; 351 352 long mod; 353 int count; 354 }; 355 356 // toys/other/nsenter.c 357 358 struct nsenter_data { 359 char *Uupnmi[6]; 360 long t; 361 }; 362 363 // toys/other/oneit.c 364 365 struct oneit_data { 366 char *c; 367 }; 368 369 // toys/other/pwgen.c 370 371 struct pwgen_data { 372 char *r; 373 }; 374 375 // toys/other/reboot.c 376 377 struct reboot_data { 378 char *d; 379 }; 380 381 // toys/other/setfattr.c 382 383 struct setfattr_data { 384 char *x, *v, *n; 385 }; 386 387 // toys/other/sha3sum.c 388 389 struct sha3sum_data { 390 long a; 391 unsigned long long rc[24]; 392 }; 393 394 // toys/other/shred.c 395 396 struct shred_data { 397 long o, n, s; 398 }; 399 400 // toys/other/stat.c 401 402 struct stat_data { 403 char *c; 404 405 union { 406 struct stat st; 407 struct statfs sf; 408 } stat; 409 char *file, *pattern; 410 int patlen; 411 }; 412 413 // toys/other/swapon.c 414 415 struct swapon_data { 416 long p; 417 }; 418 419 // toys/other/switch_root.c 420 421 struct switch_root_data { 422 char *c; 423 424 dev_t rootdev; 425 }; 426 427 // toys/other/tac.c 428 429 struct tac_data { 430 struct double_list *dl; 431 }; 432 433 // toys/other/timeout.c 434 435 struct timeout_data { 436 char *s, *k; 437 438 int nextsig; 439 pid_t pid; 440 struct timeval ktv; 441 struct itimerval itv; 442 }; 443 444 // toys/other/truncate.c 445 446 struct truncate_data { 447 char *s; 448 449 long size; 450 int type; 451 }; 452 453 // toys/other/watch.c 454 455 struct watch_data { 456 int n; 457 458 pid_t pid, oldpid; 459 }; 460 461 // toys/other/xxd.c 462 463 struct xxd_data { 464 long s, g, o, l, c; 465 }; 466 467 // toys/pending/arp.c 468 469 struct arp_data { 470 char *hw_type; 471 char *af_type_A; 472 char *af_type_p; 473 char *interface; 474 475 int sockfd; 476 char *device; 477 }; 478 479 // toys/pending/arping.c 480 481 struct arping_data { 482 long count; 483 unsigned long time_out; 484 char *iface; 485 char *src_ip; 486 487 int sockfd; 488 unsigned long start, end; 489 unsigned sent_at, sent_nr, rcvd_nr, brd_sent, rcvd_req, brd_rcv, 490 unicast_flag; 491 }; 492 493 // toys/pending/bc.c 494 495 struct bc_data { 496 // This actually needs to be a BcVm*, but the toybox build 497 // system complains if I make it so. Instead, we'll just cast. 498 char *vm; 499 500 size_t nchars; 501 char *file, sig, max_ibase; 502 uint16_t line_len; 503 }; 504 505 // toys/pending/bootchartd.c 506 507 struct bootchartd_data { 508 char timestamp[32]; 509 long msec; 510 int proc_accounting; 511 512 pid_t pid; 513 }; 514 515 // toys/pending/brctl.c 516 517 struct brctl_data { 518 int sockfd; 519 }; 520 521 // toys/pending/chsh.c 522 523 struct chsh_data { 524 char *s; 525 }; 526 527 // toys/pending/crond.c 528 529 struct crond_data { 530 char *crontabs_dir; 531 char *logfile; 532 int loglevel_d; 533 int loglevel; 534 535 time_t crontabs_dir_mtime; 536 uint8_t flagd; 537 }; 538 539 // toys/pending/crontab.c 540 541 struct crontab_data { 542 char *user; 543 char *cdir; 544 }; 545 546 // toys/pending/dd.c 547 548 struct dd_data { 549 int show_xfer, show_records; 550 unsigned long long bytes, c_count, in_full, in_part, out_full, out_part; 551 struct timeval start; 552 struct { 553 char *name; 554 int fd; 555 unsigned char *buff, *bp; 556 long sz, count; 557 unsigned long long offset; 558 } in, out; 559 unsigned conv, iflag, oflag; 560 }; 561 562 // toys/pending/dhcp.c 563 564 struct dhcp_data { 565 char *iface; 566 char *pidfile; 567 char *script; 568 long retries; 569 long timeout; 570 long tryagain; 571 struct arg_list *req_opt; 572 char *req_ip; 573 struct arg_list *pkt_opt; 574 char *fdn_name; 575 char *hostname; 576 char *vendor_cls; 577 }; 578 579 // toys/pending/dhcp6.c 580 581 struct dhcp6_data { 582 char *interface_name, *pidfile, *script; 583 long retry, timeout, errortimeout; 584 char *req_ip; 585 int length, state, request_length, sock, sock1, status, retval, retries; 586 struct timeval tv; 587 uint8_t transction_id[3]; 588 struct sockaddr_in6 input_socket6; 589 }; 590 591 // toys/pending/dhcpd.c 592 593 struct dhcpd_data { 594 char *iface; 595 long port; 596 }; 597 598 // toys/pending/diff.c 599 600 struct diff_data { 601 long ct; 602 char *start; 603 struct arg_list *L_list; 604 605 int dir_num, size, is_binary, status, change, len[2]; 606 int *offset[2]; 607 struct stat st[2]; 608 }; 609 610 // toys/pending/dumpleases.c 611 612 struct dumpleases_data { 613 char *file; 614 }; 615 616 // toys/pending/expr.c 617 618 struct expr_data { 619 char **tok; // current token, not on the stack since recursive calls mutate it 620 621 char *refree; 622 }; 623 624 // toys/pending/fdisk.c 625 626 struct fdisk_data { 627 long sect_sz; 628 long sectors; 629 long heads; 630 long cylinders; 631 }; 632 633 // toys/pending/fold.c 634 635 struct fold_data { 636 int width; 637 }; 638 639 // toys/pending/fsck.c 640 641 struct fsck_data { 642 int fd_num; 643 char *t_list; 644 645 struct double_list *devices; 646 char *arr_flag; 647 char **arr_type; 648 int negate; 649 int sum_status; 650 int nr_run; 651 int sig_num; 652 long max_nr_run; 653 }; 654 655 // toys/pending/getfattr.c 656 657 struct getfattr_data { 658 char *n; 659 }; 660 661 // toys/pending/getopt.c 662 663 struct getopt_data { 664 struct arg_list *l; 665 char *o, *n; 666 }; 667 668 // toys/pending/getty.c 669 670 struct getty_data { 671 char *issue_str; 672 char *login_str; 673 char *init_str; 674 char *host_str; 675 long timeout; 676 677 char *tty_name; 678 int speeds[20]; 679 int sc; 680 struct termios termios; 681 char buff[128]; 682 }; 683 684 // toys/pending/groupadd.c 685 686 struct groupadd_data { 687 long gid; 688 }; 689 690 // toys/pending/hexdump.c 691 692 struct hexdump_data { 693 long s, n; 694 695 long long len, pos, ppos; 696 const char *fmt; 697 unsigned int fn, bc; // file number and byte count 698 char linebuf[16]; // line buffer - serves double duty for sqeezing repeat 699 // lines and for accumulating full lines accross file 700 // boundaries if necessesary. 701 }; 702 703 // toys/pending/host.c 704 705 struct host_data { 706 char *type_str; 707 }; 708 709 // toys/pending/ip.c 710 711 struct ip_data { 712 char stats, singleline, flush, *filter_dev, gbuf[8192]; 713 int sockfd, connected, from_ok, route_cmd; 714 int8_t addressfamily, is_addr; 715 }; 716 717 // toys/pending/ipcrm.c 718 719 struct ipcrm_data { 720 struct arg_list *qkey; 721 struct arg_list *qid; 722 struct arg_list *skey; 723 struct arg_list *sid; 724 struct arg_list *mkey; 725 struct arg_list *mid; 726 }; 727 728 // toys/pending/ipcs.c 729 730 struct ipcs_data { 731 int id; 732 }; 733 734 // toys/pending/klogd.c 735 736 struct klogd_data { 737 long level; 738 739 int fd; 740 }; 741 742 // toys/pending/last.c 743 744 struct last_data { 745 char *file; 746 747 struct arg_list *list; 748 }; 749 750 // toys/pending/lsof.c 751 752 struct lsof_data { 753 struct arg_list *p; 754 755 struct stat *sought_files; 756 struct double_list *all_sockets, *files; 757 int last_shown_pid, shown_header; 758 }; 759 760 // toys/pending/man.c 761 762 struct man_data { 763 char *M, *k; 764 765 char any, cell, ex, *f, k_done, *line, *m, **sct, **scts, **sufs; 766 regex_t reg; 767 }; 768 769 // toys/pending/mke2fs.c 770 771 struct mke2fs_data { 772 // Command line arguments. 773 long blocksize; 774 long bytes_per_inode; 775 long inodes; // Total inodes in filesystem. 776 long reserved_percent; // Integer precent of space to reserve for root. 777 char *gendir; // Where to read dirtree from. 778 779 // Internal data. 780 struct dirtree *dt; // Tree of files to copy into the new filesystem. 781 unsigned treeblocks; // Blocks used by dt 782 unsigned treeinodes; // Inodes used by dt 783 784 unsigned blocks; // Total blocks in the filesystem. 785 unsigned freeblocks; // Free blocks in the filesystem. 786 unsigned inodespg; // Inodes per group 787 unsigned groups; // Total number of block groups. 788 unsigned blockbits; // Bits per block. (Also blocks per group.) 789 790 // For gene2fs 791 unsigned nextblock; // Next data block to allocate 792 unsigned nextgroup; // Next group we'll be allocating from 793 int fsfd; // File descriptor of filesystem (to output to). 794 }; 795 796 // toys/pending/modprobe.c 797 798 struct modprobe_data { 799 struct arg_list *dirs; 800 801 struct arg_list *probes; 802 struct arg_list *dbase[256]; 803 char *cmdopts; 804 int nudeps; 805 uint8_t symreq; 806 }; 807 808 // toys/pending/more.c 809 810 struct more_data { 811 struct termios inf; 812 int cin_fd; 813 }; 814 815 // toys/pending/openvt.c 816 817 struct openvt_data { 818 long c; 819 }; 820 821 // toys/pending/route.c 822 823 struct route_data { 824 char *family; 825 }; 826 827 // toys/pending/sh.c 828 829 struct sh_data { 830 char *command; 831 832 long lineno; 833 834 struct double_list functions; 835 unsigned options; 836 837 // Running jobs. 838 struct sh_job { 839 struct sh_job *next, *prev; 840 unsigned jobno; 841 842 // Every pipeline has at least one set of arguments or it's Not A Thing 843 struct sh_arg { 844 char **v; 845 int c; 846 } pipeline; 847 848 // null terminated array of running processes in pipeline 849 struct sh_process { 850 struct string_list *delete; // expanded strings 851 int pid, exit; // status? Stopped? Exited? 852 struct sh_arg arg; 853 } *procs, *proc; 854 } *jobs, *job; 855 unsigned jobcnt; 856 }; 857 858 // toys/pending/strace.c 859 860 struct strace_data { 861 long s, p; 862 863 char ioctl[32], *fmt; 864 long regs[256/sizeof(long)], syscall; 865 pid_t pid; 866 int arg; 867 }; 868 869 // toys/pending/stty.c 870 871 struct stty_data { 872 char *device; 873 874 int fd, col; 875 unsigned output_cols; 876 }; 877 878 // toys/pending/sulogin.c 879 880 struct sulogin_data { 881 long timeout; 882 struct termios crntio; 883 }; 884 885 // toys/pending/syslogd.c 886 887 struct syslogd_data { 888 char *socket; 889 char *config_file; 890 char *unix_socket; 891 char *logfile; 892 long interval; 893 long rot_size; 894 long rot_count; 895 char *remote_log; 896 long log_prio; 897 898 struct unsocks *lsocks; // list of listen sockets 899 struct logfile *lfiles; // list of write logfiles 900 int sigfd[2]; 901 }; 902 903 // toys/pending/tcpsvd.c 904 905 struct tcpsvd_data { 906 char *name; 907 char *user; 908 long bn; 909 char *nmsg; 910 long cn; 911 912 int maxc; 913 int count_all; 914 int udp; 915 }; 916 917 // toys/pending/telnet.c 918 919 struct telnet_data { 920 int port; 921 int sfd; 922 char buff[128]; 923 int pbuff; 924 char iac[256]; 925 int piac; 926 char *ttype; 927 struct termios def_term; 928 struct termios raw_term; 929 uint8_t term_ok; 930 uint8_t term_mode; 931 uint8_t flags; 932 unsigned win_width; 933 unsigned win_height; 934 }; 935 936 // toys/pending/telnetd.c 937 938 struct telnetd_data { 939 char *login_path; 940 char *issue_path; 941 int port; 942 char *host_addr; 943 long w_sec; 944 945 int gmax_fd; 946 pid_t fork_pid; 947 }; 948 949 // toys/pending/tftp.c 950 951 struct tftp_data { 952 char *local_file; 953 char *remote_file; 954 long block_size; 955 956 struct sockaddr_storage inaddr; 957 int af; 958 }; 959 960 // toys/pending/tftpd.c 961 962 struct tftpd_data { 963 char *user; 964 965 long sfd; 966 struct passwd *pw; 967 }; 968 969 // toys/pending/tr.c 970 971 struct tr_data { 972 short map[256]; //map of chars 973 int len1, len2; 974 }; 975 976 // toys/pending/traceroute.c 977 978 struct traceroute_data { 979 long max_ttl; 980 long port; 981 long ttl_probes; 982 char *src_ip; 983 long tos; 984 long wait_time; 985 struct arg_list *loose_source; 986 long pause_time; 987 long first_ttl; 988 char *iface; 989 990 uint32_t gw_list[9]; 991 int recv_sock; 992 int snd_sock; 993 unsigned msg_len; 994 char *packet; 995 uint32_t ident; 996 int istraceroute6; 997 }; 998 999 // toys/pending/useradd.c 1000 1001 struct useradd_data { 1002 char *dir; 1003 char *gecos; 1004 char *shell; 1005 char *u_grp; 1006 long uid; 1007 1008 long gid; 1009 }; 1010 1011 // toys/pending/vi.c 1012 1013 struct vi_data { 1014 int cur_col; 1015 int cur_row; 1016 int scr_row; 1017 int drawn_row; 1018 int drawn_col; 1019 unsigned screen_height; 1020 unsigned screen_width; 1021 int vi_mode; 1022 int count0; 1023 int count1; 1024 int vi_mov_flag; 1025 int modified; 1026 char vi_reg; 1027 char *last_search; 1028 int tabstop; 1029 int list; 1030 }; 1031 1032 // toys/pending/wget.c 1033 1034 struct wget_data { 1035 char *filename; 1036 }; 1037 1038 // toys/posix/basename.c 1039 1040 struct basename_data { 1041 char *s; 1042 }; 1043 1044 // toys/posix/chgrp.c 1045 1046 struct chgrp_data { 1047 uid_t owner; 1048 gid_t group; 1049 char *owner_name, *group_name; 1050 int symfollow; 1051 }; 1052 1053 // toys/posix/chmod.c 1054 1055 struct chmod_data { 1056 char *mode; 1057 }; 1058 1059 // toys/posix/cksum.c 1060 1061 struct cksum_data { 1062 unsigned crc_table[256]; 1063 }; 1064 1065 // toys/posix/cmp.c 1066 1067 struct cmp_data { 1068 int fd; 1069 char *name; 1070 }; 1071 1072 // toys/posix/cp.c 1073 1074 struct cp_data { 1075 union { 1076 // install's options 1077 struct { 1078 char *g, *o, *m; 1079 } i; 1080 // cp's options 1081 struct { 1082 char *preserve; 1083 } c; 1084 }; 1085 1086 char *destname; 1087 struct stat top; 1088 int (*callback)(struct dirtree *try); 1089 uid_t uid; 1090 gid_t gid; 1091 int pflags; 1092 }; 1093 1094 // toys/posix/cpio.c 1095 1096 struct cpio_data { 1097 char *F, *p, *H; 1098 }; 1099 1100 // toys/posix/cut.c 1101 1102 struct cut_data { 1103 char *d, *O; 1104 struct arg_list *select[5]; // we treat them the same, so loop through 1105 1106 int pairs; 1107 regex_t reg; 1108 }; 1109 1110 // toys/posix/date.c 1111 1112 struct date_data { 1113 char *r, *D, *d; 1114 1115 unsigned nano; 1116 }; 1117 1118 // toys/posix/df.c 1119 1120 struct df_data { 1121 struct arg_list *t; 1122 1123 long units; 1124 int column_widths[5]; 1125 int header_shown; 1126 }; 1127 1128 // toys/posix/du.c 1129 1130 struct du_data { 1131 long d; 1132 1133 unsigned long depth, total; 1134 dev_t st_dev; 1135 void *inodes; 1136 }; 1137 1138 // toys/posix/env.c 1139 1140 struct env_data { 1141 struct arg_list *u; 1142 };; 1143 1144 // toys/posix/expand.c 1145 1146 struct expand_data { 1147 struct arg_list *t; 1148 1149 unsigned tabcount, *tab; 1150 }; 1151 1152 // toys/posix/file.c 1153 1154 struct file_data { 1155 int max_name_len; 1156 1157 off_t len; 1158 }; 1159 1160 // toys/posix/find.c 1161 1162 struct find_data { 1163 char **filter; 1164 struct double_list *argdata; 1165 int topdir, xdev, depth; 1166 time_t now; 1167 long max_bytes; 1168 char *start; 1169 }; 1170 1171 // toys/posix/grep.c 1172 1173 struct grep_data { 1174 long m, A, B, C; 1175 struct arg_list *f, *e, *M, *S, *exclude_dir; 1176 char *color; 1177 1178 char *purple, *cyan, *red, *green, *grey; 1179 struct double_list *reg; 1180 char indelim, outdelim; 1181 int found, tried; 1182 }; 1183 1184 // toys/posix/head.c 1185 1186 struct head_data { 1187 long c, n; 1188 1189 int file_no; 1190 }; 1191 1192 // toys/posix/iconv.c 1193 1194 struct iconv_data { 1195 char *f, *t; 1196 1197 void *ic; 1198 }; 1199 1200 // toys/posix/id.c 1201 1202 struct id_data { 1203 int is_groups; 1204 }; 1205 1206 // toys/posix/kill.c 1207 1208 struct kill_data { 1209 char *s; 1210 struct arg_list *o; 1211 }; 1212 1213 // toys/posix/ln.c 1214 1215 struct ln_data { 1216 char *t; 1217 }; 1218 1219 // toys/posix/logger.c 1220 1221 struct logger_data { 1222 char *p, *t; 1223 }; 1224 1225 // toys/posix/ls.c 1226 1227 struct ls_data { 1228 long l; 1229 char *color; 1230 1231 struct dirtree *files, *singledir; 1232 unsigned screen_width; 1233 int nl_title; 1234 char *escmore; 1235 }; 1236 1237 // toys/posix/mkdir.c 1238 1239 struct mkdir_data { 1240 char *m, *Z; 1241 }; 1242 1243 // toys/posix/mkfifo.c 1244 1245 struct mkfifo_data { 1246 char *m; 1247 char *Z; 1248 1249 mode_t mode; 1250 }; 1251 1252 // toys/posix/nice.c 1253 1254 struct nice_data { 1255 long n; 1256 }; 1257 1258 // toys/posix/nl.c 1259 1260 struct nl_data { 1261 char *s, *n, *b; 1262 long w, l, v; 1263 1264 // Count of consecutive blank lines for -l has to persist between files 1265 long lcount; 1266 long slen; 1267 }; 1268 1269 // toys/posix/od.c 1270 1271 struct od_data { 1272 struct arg_list *t; 1273 char *A; 1274 long N, w, j; 1275 1276 int address_idx; 1277 unsigned types, leftover, star; 1278 char *buf; // Points to buffers[0] or buffers[1]. 1279 char *bufs[2]; // Used to detect duplicate lines. 1280 off_t pos; 1281 }; 1282 1283 // toys/posix/paste.c 1284 1285 struct paste_data { 1286 char *d; 1287 1288 int files; 1289 }; 1290 1291 // toys/posix/patch.c 1292 1293 struct patch_data { 1294 char *i, *d; 1295 long p, g; 1296 1297 struct double_list *current_hunk; 1298 long oldline, oldlen, newline, newlen; 1299 long linenum; 1300 int context, state, filein, fileout, filepatch, hunknum; 1301 char *tempname; 1302 }; 1303 1304 // toys/posix/ps.c 1305 1306 struct ps_data { 1307 union { 1308 struct { 1309 struct arg_list *G, *g, *U, *u, *t, *s, *p, *O, *o, *P, *k; 1310 } ps; 1311 struct { 1312 long n, m, d, s; 1313 struct arg_list *u, *p, *o, *k, *O; 1314 } top; 1315 struct { 1316 char *L; 1317 struct arg_list *G, *g, *P, *s, *t, *U, *u; 1318 char *d; 1319 1320 void *regexes, *snapshot; 1321 int signal; 1322 pid_t self, match; 1323 } pgrep; 1324 }; 1325 1326 struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU; 1327 struct dirtree *threadparent; 1328 unsigned width, height; 1329 dev_t tty; 1330 void *fields, *kfields; 1331 long long ticks, bits, time; 1332 int kcount, forcek, sortpos; 1333 int (*match_process)(long long *slot); 1334 void (*show_process)(void *tb); 1335 }; 1336 1337 // toys/posix/renice.c 1338 1339 struct renice_data { 1340 long n; 1341 }; 1342 1343 // toys/posix/sed.c 1344 1345 struct sed_data { 1346 char *i; 1347 struct arg_list *f, *e; 1348 1349 // processed pattern list 1350 struct double_list *pattern; 1351 1352 char *nextline, *remember; 1353 void *restart, *lastregex; 1354 long nextlen, rememberlen, count; 1355 int fdout, noeol; 1356 unsigned xx; 1357 char delim; 1358 }; 1359 1360 // toys/posix/sort.c 1361 1362 struct sort_data { 1363 char *t; 1364 struct arg_list *k; 1365 char *o, *T, S; 1366 1367 void *key_list; 1368 int linecount; 1369 char **lines, *name; 1370 }; 1371 1372 // toys/posix/split.c 1373 1374 struct split_data { 1375 long n, l, b, a; 1376 1377 char *outfile; 1378 }; 1379 1380 // toys/posix/strings.c 1381 1382 struct strings_data { 1383 long n; 1384 char *t; 1385 }; 1386 1387 // toys/posix/tail.c 1388 1389 struct tail_data { 1390 long n, c; 1391 1392 int file_no, last_fd; 1393 struct xnotify *not; 1394 }; 1395 1396 // toys/posix/tar.c 1397 1398 struct tar_data { 1399 char *f, *C; 1400 struct arg_list *T, *X; 1401 char *to_command, *owner, *group, *mtime, *mode; 1402 struct arg_list *exclude; 1403 1404 struct double_list *incl, *excl, *seen; 1405 struct string_list *dirs; 1406 char *cwd; 1407 int fd, ouid, ggid, hlc, warn, adev, aino, sparselen; 1408 long long *sparse; 1409 time_t mtt; 1410 1411 // hardlinks seen so far (hlc many) 1412 struct { 1413 char *arg; 1414 ino_t ino; 1415 dev_t dev; 1416 } *hlx; 1417 1418 // Parsed information about a tar header. 1419 struct tar_header { 1420 char *name, *link_target, *uname, *gname; 1421 long long size, ssize; 1422 uid_t uid; 1423 gid_t gid; 1424 mode_t mode; 1425 time_t mtime; 1426 dev_t device; 1427 } hdr; 1428 }; 1429 1430 // toys/posix/tee.c 1431 1432 struct tee_data { 1433 void *outputs; 1434 int out; 1435 }; 1436 1437 // toys/posix/touch.c 1438 1439 struct touch_data { 1440 char *t, *r, *d; 1441 }; 1442 1443 // toys/posix/ulimit.c 1444 1445 struct ulimit_data { 1446 long P; 1447 }; 1448 1449 // toys/posix/uniq.c 1450 1451 struct uniq_data { 1452 long w, s, f; 1453 1454 long repeats; 1455 }; 1456 1457 // toys/posix/uudecode.c 1458 1459 struct uudecode_data { 1460 char *o; 1461 }; 1462 1463 // toys/posix/wc.c 1464 1465 struct wc_data { 1466 unsigned long totals[4]; 1467 }; 1468 1469 // toys/posix/xargs.c 1470 1471 struct xargs_data { 1472 long s, n, P; 1473 char *E; 1474 1475 long entries, bytes; 1476 char delim; 1477 FILE *tty; 1478 }; 1479 1480 extern union global_union { 1481 struct log_data log; 1482 struct demo_number_data demo_number; 1483 struct hello_data hello; 1484 struct skeleton_data skeleton; 1485 struct dmesg_data dmesg; 1486 struct gzip_data gzip; 1487 struct hostname_data hostname; 1488 struct killall_data killall; 1489 struct md5sum_data md5sum; 1490 struct mknod_data mknod; 1491 struct mktemp_data mktemp; 1492 struct mount_data mount; 1493 struct passwd_data passwd; 1494 struct pidof_data pidof; 1495 struct seq_data seq; 1496 #ifdef OHOS_LITE 1497 struct su_data su; 1498 #endif 1499 struct umount_data umount; 1500 struct ftpget_data ftpget; 1501 struct ifconfig_data ifconfig; 1502 struct microcom_data microcom; 1503 struct netcat_data netcat; 1504 struct netstat_data netstat; 1505 struct ping_data ping; 1506 struct sntp_data sntp; 1507 struct tunctl_data tunctl; 1508 struct acpi_data acpi; 1509 struct base64_data base64; 1510 struct blkid_data blkid; 1511 struct blockdev_data blockdev; 1512 struct chrt_data chrt; 1513 struct dos2unix_data dos2unix; 1514 struct fallocate_data fallocate; 1515 struct fmt_data fmt; 1516 struct free_data free; 1517 struct hexedit_data hexedit; 1518 struct hwclock_data hwclock; 1519 struct ionice_data ionice; 1520 struct login_data login; 1521 struct losetup_data losetup; 1522 struct lspci_data lspci; 1523 struct makedevs_data makedevs; 1524 struct mix_data mix; 1525 struct mkpasswd_data mkpasswd; 1526 struct mkswap_data mkswap; 1527 struct modinfo_data modinfo; 1528 struct nsenter_data nsenter; 1529 struct oneit_data oneit; 1530 struct pwgen_data pwgen; 1531 struct reboot_data reboot; 1532 struct setfattr_data setfattr; 1533 struct sha3sum_data sha3sum; 1534 struct shred_data shred; 1535 struct stat_data stat; 1536 struct swapon_data swapon; 1537 struct switch_root_data switch_root; 1538 struct tac_data tac; 1539 struct timeout_data timeout; 1540 struct truncate_data truncate; 1541 struct watch_data watch; 1542 struct xxd_data xxd; 1543 struct arp_data arp; 1544 struct arping_data arping; 1545 struct bc_data bc; 1546 struct bootchartd_data bootchartd; 1547 struct brctl_data brctl; 1548 struct chsh_data chsh; 1549 struct crond_data crond; 1550 struct crontab_data crontab; 1551 struct dd_data dd; 1552 struct dhcp_data dhcp; 1553 struct dhcp6_data dhcp6; 1554 struct dhcpd_data dhcpd; 1555 struct diff_data diff; 1556 struct dumpleases_data dumpleases; 1557 struct expr_data expr; 1558 struct fdisk_data fdisk; 1559 struct fold_data fold; 1560 struct fsck_data fsck; 1561 struct getfattr_data getfattr; 1562 struct getopt_data getopt; 1563 struct getty_data getty; 1564 struct groupadd_data groupadd; 1565 struct hexdump_data hexdump; 1566 struct host_data host; 1567 struct ip_data ip; 1568 struct ipcrm_data ipcrm; 1569 struct ipcs_data ipcs; 1570 struct klogd_data klogd; 1571 struct last_data last; 1572 struct lsof_data lsof; 1573 struct man_data man; 1574 struct mke2fs_data mke2fs; 1575 struct modprobe_data modprobe; 1576 struct more_data more; 1577 struct openvt_data openvt; 1578 struct route_data route; 1579 struct sh_data sh; 1580 struct strace_data strace; 1581 struct stty_data stty; 1582 struct sulogin_data sulogin; 1583 struct syslogd_data syslogd; 1584 struct tcpsvd_data tcpsvd; 1585 struct telnet_data telnet; 1586 struct telnetd_data telnetd; 1587 struct tftp_data tftp; 1588 struct tftpd_data tftpd; 1589 struct tr_data tr; 1590 struct traceroute_data traceroute; 1591 struct useradd_data useradd; 1592 struct vi_data vi; 1593 struct wget_data wget; 1594 struct basename_data basename; 1595 struct chgrp_data chgrp; 1596 struct chmod_data chmod; 1597 struct cksum_data cksum; 1598 struct cmp_data cmp; 1599 struct cp_data cp; 1600 struct cpio_data cpio; 1601 struct cut_data cut; 1602 struct date_data date; 1603 struct df_data df; 1604 struct du_data du; 1605 struct env_data env; 1606 struct expand_data expand; 1607 struct file_data file; 1608 struct find_data find; 1609 struct grep_data grep; 1610 struct head_data head; 1611 struct iconv_data iconv; 1612 struct id_data id; 1613 struct kill_data kill; 1614 struct ln_data ln; 1615 struct logger_data logger; 1616 struct ls_data ls; 1617 struct mkdir_data mkdir; 1618 struct mkfifo_data mkfifo; 1619 struct nice_data nice; 1620 struct nl_data nl; 1621 struct od_data od; 1622 struct paste_data paste; 1623 struct patch_data patch; 1624 struct ps_data ps; 1625 struct renice_data renice; 1626 struct sed_data sed; 1627 struct sort_data sort; 1628 struct split_data split; 1629 struct strings_data strings; 1630 struct tail_data tail; 1631 struct tar_data tar; 1632 struct tee_data tee; 1633 struct touch_data touch; 1634 struct ulimit_data ulimit; 1635 struct uniq_data uniq; 1636 struct uudecode_data uudecode; 1637 struct wc_data wc; 1638 struct xargs_data xargs; 1639 } this; 1640