Home | History | Annotate | Download | only in lib

Lines Matching refs:toys

12 #include "toys.h"
34 * Calling get_optflags() when toys.which->options="ab:c:d" and
37 * Changes to struct toys:
38 * toys.optflags = 5 (I.E. 0101 so -b = 4 | -d = 1)
39 * toys.optargs[0] = "walrus" (leftover argument)
40 * toys.optargs[1] = NULL (end of list)
41 * toys.optc = 1 (there was 1 leftover argument)
101 unsigned long long dex[3]; // bits to disable/enable/exclude in toys.optflags
143 if (toys.optflags & opt->dex[0]) {
149 if (clr->arg && (i & toys.optflags & opt->dex[0])) *clr->arg = 0;
150 toys.optflags &= ~opt->dex[0];
154 toys.optflags |= opt->dex[1];
158 if (toys.optflags & gof->excludes) {
163 if (opt == bad || !(i & toys.optflags)) continue;
164 if (toys.optflags & bad->dex[2]) break;
185 arg = toys.argv[++gof->argc];
231 char *options = toys.which->options;
375 // Fill out toys.optflags, toys.optargs, and this[] from toys.argv
389 while (toys.argv[saveflags++]);
390 toys.optargs = xzalloc(sizeof(char *)*saveflags);
395 for (gof.argc=1; toys.argv[gof.argc]; gof.argc++) {
396 gof.arg = toys.argv[gof.argc];
452 saveflags = toys.optflags;
462 toys.optflags = saveflags;
463 gof.arg = toys.argv[gof.argc];
469 // Not a flag, save value in toys.optargs[]
472 toys.optargs[toys.optc++] = toys.argv[gof.argc];
476 if (toys.optc<gof.minargs)
479 if (toys.optc>gof.maxargs)
481 if (gof.requires && !(gof.requires & toys.optflags)) {