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