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