1 struct gzip_data { 2 int level; 3 }; 4 5 struct hostname_data { 6 char *F; 7 }; 8 9 struct md5sum_data { 10 int sawline; 11 }; 12 13 struct mktemp_data { 14 char *p, *tmpdir; 15 }; 16 17 struct mount_data { 18 struct arg_list *o; 19 char *t, *O; 20 21 unsigned long flags; 22 char *opts; 23 int okuser; 24 }; 25 26 struct seq_data { 27 char *s, *f; 28 29 int precision, buflen; 30 }; 31 32 struct umount_data { 33 struct arg_list *t; 34 35 char *types; 36 }; 37 38 struct microcom_data { 39 long s; 40 41 int fd, stok; 42 struct termios old_stdin, old_fd; 43 }; 44 45 struct dos2unix_data { 46 char *tempfile; 47 }; 48 49 struct getopt_data { 50 struct arg_list *l; 51 char *o, *n; 52 }; 53 54 struct nsenter_data { 55 char *UupnmiC[7]; 56 long t; 57 }; 58 59 struct realpath_data { 60 char *R, *relative_base; 61 }; 62 63 struct setsid_data { 64 long c; 65 }; 66 67 struct stat_data { 68 char *c; 69 70 union { 71 struct stat st; 72 struct statfs sf; 73 } stat; 74 char *file, *pattern; 75 int patlen; 76 }; 77 78 struct timeout_data { 79 char *s, *k; 80 81 struct pollfd pfd; 82 sigjmp_buf sj; 83 int fds[2], pid, rc; 84 }; 85 86 struct truncate_data { 87 char *s; 88 89 long long size; 90 int type; 91 }; 92 93 struct xxd_data { 94 long s, g, o, l, c; 95 }; 96 97 struct diff_data { 98 long U; 99 struct arg_list *L; 100 char *F, *S, *new_line_format, *old_line_format, *unchanged_line_format; 101 102 int dir_num, size, is_binary, differ, change, len[2], *offset[2]; 103 struct stat st[2]; 104 struct { 105 char **list; 106 int nr_elm; 107 } dir[2]; 108 struct { 109 FILE *fp; 110 int len; 111 } file[2]; 112 }; 113 114 struct expr_data { 115 char **tok, *delete; 116 }; 117 118 struct tr_data { 119 short *map; 120 int len1, len2; 121 }; 122 123 struct basename_data { 124 char *s; 125 }; 126 127 struct chmod_data { 128 char *mode; 129 }; 130 131 struct cmp_data { 132 long n; 133 134 int fd; 135 char *name; 136 }; 137 138 struct cp_data { 139 union { 140 // install's options 141 struct { 142 char *g, *o, *m, *t; 143 } i; 144 // cp's options 145 struct { 146 char *t, *preserve; 147 } c; 148 }; 149 150 char *destname; 151 struct stat top; 152 int (*callback)(struct dirtree *try); 153 uid_t uid; 154 gid_t gid; 155 int pflags; 156 }; 157 158 struct cpio_data { 159 char *F, *H, *R; 160 }; 161 162 struct cut_data { 163 char *d, *O; 164 struct arg_list *select[5]; // we treat them the same, so loop through 165 166 unsigned line; 167 int pairs; 168 regex_t reg; 169 }; 170 171 struct date_data { 172 char *s, *r, *I, *D, *d; 173 174 unsigned nano; 175 }; 176 177 struct dd_data { 178 // Display fields 179 int show_xfer, show_records; 180 unsigned long long bytes, in_full, in_part, out_full, out_part, start; 181 }; 182 183 struct du_data { 184 long d; 185 186 unsigned long depth, total; 187 dev_t st_dev; 188 void *inodes; 189 }; 190 191 struct env_data { 192 struct arg_list *u; 193 char *e; 194 }; 195 196 struct file_data { 197 int max_name_len; 198 off_t len; 199 }; 200 201 struct find_data { 202 char **filter; 203 struct double_list *argdata; 204 int topdir, xdev, depth; 205 time_t now; 206 long max_bytes; 207 char *start; 208 }; 209 210 struct grep_data { 211 long m, A, B, C; 212 struct arg_list *f, *e, *M, *S, *exclude_dir; 213 char *color; 214 215 char *purple, *cyan, *red, *green, *grey; 216 struct double_list *reg; 217 int found, tried, delim; 218 struct arg_list **fixed; 219 }; 220 221 struct head_data { 222 long c, n; 223 224 int file_no; 225 }; 226 227 struct id_data { 228 int is_groups; 229 }; 230 231 struct ln_data { 232 char *t; 233 }; 234 235 struct ls_data { 236 long w, l, block_size; 237 char *color, *sort; 238 239 struct dirtree *files, *singledir; 240 unsigned screen_width; 241 int nl_title; 242 char *escmore; 243 }; 244 245 struct mkdir_data { 246 char *m, *Z; 247 }; 248 249 struct nl_data { 250 char *s, *n, *b; 251 long w, l, v; 252 253 // Count of consecutive blank lines for -l has to persist between files 254 long lcount, slen; 255 }; 256 257 struct od_data { 258 struct arg_list *t; 259 char *A; 260 long N, w, j; 261 262 int address_idx; 263 unsigned types, leftover, star; 264 char *buf; // Points to buffers[0] or buffers[1]. 265 char *bufs[2]; // Used to detect duplicate lines. 266 off_t pos; 267 }; 268 269 struct paste_data { 270 char *d; 271 272 int files; 273 }; 274 275 struct patch_data { 276 char *i, *d; 277 long v, p, g, F; 278 279 void *current_hunk; 280 long oldline, oldlen, newline, newlen, linenum, outnum; 281 int context, state, filein, fileout, filepatch, hunknum; 282 char *tempname; 283 }; 284 285 struct ps_data { 286 union { 287 struct { 288 struct arg_list *G, *g, *U, *u, *t, *s, *p, *O, *o, *P, *k; 289 } ps; 290 struct { 291 long n, m, d, s; 292 struct arg_list *u, *p, *o, *k, *O; 293 } top; 294 struct { 295 char *L; 296 struct arg_list *G, *g, *P, *s, *t, *U, *u; 297 char *d; 298 299 void *regexes, *snapshot; 300 int signal; 301 pid_t self, match; 302 } pgrep; 303 }; 304 305 struct ps_ptr_len { 306 void *ptr; 307 long len; 308 } gg, GG, pp, PP, ss, tt, uu, UU; 309 struct dirtree *threadparent; 310 unsigned width, height, scroll; 311 dev_t tty; 312 void *fields, *kfields; 313 long long ticks, bits, time; 314 int kcount, forcek, sortpos, pidlen; 315 int (*match_process)(long long *slot); 316 void (*show_process)(void *tb); 317 }; 318 319 struct sed_data { 320 char *i; 321 struct arg_list *f, *e; 322 323 // processed pattern list 324 struct double_list *pattern; 325 326 char *nextline, *remember, *tarxform; 327 void *restart, *lastregex; 328 long nextlen, rememberlen, count; 329 int fdout, noeol; 330 unsigned xx, tarxlen, xflags; 331 char delim, xftype; 332 }; 333 334 struct sort_data { 335 char *t; 336 struct arg_list *k; 337 char *o, *T, S; 338 339 void *key_list; 340 unsigned linecount; 341 char **lines, *name; 342 }; 343 344 struct tail_data { 345 long n, c; 346 char *s; 347 348 int file_no, last_fd, ss; 349 struct xnotify *not; 350 struct { 351 char *path; 352 int fd; 353 struct dev_ino di; 354 } *F; 355 }; 356 357 struct tar_data { 358 char *f, *C, *I; 359 struct arg_list *T, *X, *xform; 360 long strip; 361 char *to_command, *owner, *group, *mtime, *mode, *sort; 362 struct arg_list *exclude; 363 364 struct double_list *incl, *excl, *seen; 365 struct string_list *dirs; 366 char *cwd, **xfsed; 367 int fd, ouid, ggid, hlc, warn, sparselen, pid, xfpipe[2]; 368 struct dev_ino archive_di; 369 long long *sparse; 370 time_t mtt; 371 372 // hardlinks seen so far (hlc many) 373 struct { 374 char *arg; 375 struct dev_ino di; 376 } *hlx; 377 378 // Parsed information about a tar header. 379 struct tar_header { 380 char *name, *link_target, *uname, *gname; 381 long long size, ssize; 382 uid_t uid; 383 gid_t gid; 384 mode_t mode; 385 time_t mtime; 386 dev_t device; 387 } hdr; 388 }; 389 390 struct tee_data { 391 void *outputs; 392 int out; 393 }; 394 395 struct touch_data { 396 char *t, *r, *d; 397 }; 398 399 struct uniq_data { 400 long w, s, f; 401 402 long repeats; 403 }; 404 405 struct wc_data { 406 unsigned long totals[5]; 407 }; 408 409 struct xargs_data { 410 long s, n, P; 411 char *E; 412 413 long entries, bytes, np; 414 char delim; 415 FILE *tty; 416 }; 417 extern union global_union { 418 struct gzip_data gzip; 419 struct hostname_data hostname; 420 struct md5sum_data md5sum; 421 struct mktemp_data mktemp; 422 struct mount_data mount; 423 struct seq_data seq; 424 struct umount_data umount; 425 struct microcom_data microcom; 426 struct dos2unix_data dos2unix; 427 struct getopt_data getopt; 428 struct nsenter_data nsenter; 429 struct realpath_data realpath; 430 struct setsid_data setsid; 431 struct stat_data stat; 432 struct timeout_data timeout; 433 struct truncate_data truncate; 434 struct xxd_data xxd; 435 struct diff_data diff; 436 struct expr_data expr; 437 struct tr_data tr; 438 struct basename_data basename; 439 struct chmod_data chmod; 440 struct cmp_data cmp; 441 struct cp_data cp; 442 struct cpio_data cpio; 443 struct cut_data cut; 444 struct date_data date; 445 struct dd_data dd; 446 struct du_data du; 447 struct env_data env; 448 struct file_data file; 449 struct find_data find; 450 struct grep_data grep; 451 struct head_data head; 452 struct id_data id; 453 struct ln_data ln; 454 struct ls_data ls; 455 struct mkdir_data mkdir; 456 struct nl_data nl; 457 struct od_data od; 458 struct paste_data paste; 459 struct patch_data patch; 460 struct ps_data ps; 461 struct sed_data sed; 462 struct sort_data sort; 463 struct tail_data tail; 464 struct tar_data tar; 465 struct tee_data tee; 466 struct touch_data touch; 467 struct uniq_data uniq; 468 struct wc_data wc; 469 struct xargs_data xargs; 470 } this; 471