Lines Matching refs:t
41 miniopt_init(miniopt_t *t, const char* name, const char* flags, bool longflags) in miniopt_init() argument
45 memset(t, 0, sizeof(miniopt_t)); in miniopt_init()
46 t->name = name; in miniopt_init()
48 t->flags = null_flags; in miniopt_init()
50 t->flags = flags; in miniopt_init()
51 t->longflags = longflags; in miniopt_init()
57 miniopt(miniopt_t *t, char **argv) in miniopt() argument
63 t->consumed = 0; in miniopt()
64 t->positional = FALSE; in miniopt()
65 memset(t->key, 0, MINIOPT_MAXKEY); in miniopt()
66 t->opt = '\0'; in miniopt()
67 t->valstr = NULL; in miniopt()
68 t->good_int = FALSE; in miniopt()
77 t->consumed++; in miniopt()
79 if (!t->opt_end && !strcmp(p, "--")) { in miniopt()
80 t->opt_end = TRUE; in miniopt()
86 t->consumed++; in miniopt()
89 if (t->opt_end) { in miniopt()
90 t->positional = TRUE; in miniopt()
95 if (eq == NULL && !t->longflags) { in miniopt()
97 "%s: missing \" = \" in long param \"%s\"\n", t->name, p); in miniopt()
103 memcpy(t->key, p + 2, keylen); in miniopt()
110 t->name, p); in miniopt()
117 t->opt = p[1]; in miniopt()
121 t->name, p); in miniopt()
125 if (strchr(t->flags, t->opt)) { in miniopt()
131 "%s: missing value parameter after \"%s\"\n", t->name, p); in miniopt()
137 t->consumed++; in miniopt()
140 t->positional = TRUE; in miniopt()
146 t->uval = (uint)strtoul(valstr, &endptr, 0); in miniopt()
147 t->val = (int)t->uval; in miniopt()
148 t->good_int = (*endptr == '\0'); in miniopt()
151 t->valstr = valstr; in miniopt()
155 t->opt = '?'; in miniopt()