Lines Matching defs:longopts

51  * Returns true if index @a i is the end of the longopts array.
52 * @param longopts The long options array.
57 bc_opt_longoptsEnd(const BcOptLong* longopts, size_t i)
59 return !longopts[i].name && !longopts[i].val;
64 * @param longopts The long options array.
69 bc_opt_longopt(const BcOptLong* longopts, int c)
73 for (i = 0; !bc_opt_longoptsEnd(longopts, i); ++i)
75 if (longopts[i].val == c) return longopts[i].name;
115 * @param longopts The long options array.
120 bc_opt_type(const BcOptLong* longopts, char c)
126 for (i = 0; !bc_opt_longoptsEnd(longopts, i) && longopts[i].val != c; ++i)
131 if (bc_opt_longoptsEnd(longopts, i)) return -1;
133 return (int) longopts[i].type;
139 * @param longopts The long options array.
143 bc_opt_parseShort(BcOpt* o, const BcOptLong* longopts)
159 type = bc_opt_type(longopts, option[0]);
206 bc_opt_longopt(longopts, option[0]), true);
232 bc_opt_longopt(longopts, option[0]), true);
290 bc_opt_parse(BcOpt* o, const BcOptLong* longopts)
315 else if (BC_OPT_ISSHORTOPT(option)) return bc_opt_parseShort(o, longopts);
328 for (i = 0; !bc_opt_longoptsEnd(longopts, i); i++)
330 const char* name = longopts[i].name;
338 o->optopt = longopts[i].val;
342 if ((longopts[i].type == BC_OPT_BC_ONLY && BC_IS_DC) ||
343 (longopts[i].type == BC_OPT_REQUIRED_BC_ONLY && BC_IS_DC) ||
344 (longopts[i].type == BC_OPT_DC_ONLY && BC_IS_BC))
350 if (longopts[i].type == BC_OPT_NONE && arg != NULL)
358 else if (longopts[i].type == BC_OPT_REQUIRED ||
359 longopts[i].type == BC_OPT_REQUIRED_BC_ONLY)