Lines Matching refs:bsdunzip

62 bsdunzip_getopt(struct bsdunzip *bsdunzip)  in bsdunzip_getopt()  argument
78 bsdunzip->argument = NULL; in bsdunzip_getopt()
81 if (bsdunzip->getopt_state == state_start) { in bsdunzip_getopt()
83 ++bsdunzip->argv; in bsdunzip_getopt()
84 --bsdunzip->argc; in bsdunzip_getopt()
85 if (*bsdunzip->argv == NULL) in bsdunzip_getopt()
87 bsdunzip->getopt_state = state_next_word; in bsdunzip_getopt()
93 if (bsdunzip->getopt_state == state_next_word) { in bsdunzip_getopt()
95 if (bsdunzip->argv[0] == NULL) in bsdunzip_getopt()
98 if (bsdunzip->argv[0][0] != '-') in bsdunzip_getopt()
101 if (strcmp(bsdunzip->argv[0], "--") == 0) { in bsdunzip_getopt()
102 ++bsdunzip->argv; in bsdunzip_getopt()
103 --bsdunzip->argc; in bsdunzip_getopt()
108 bsdunzip->getopt_word = *bsdunzip->argv++; in bsdunzip_getopt()
109 --bsdunzip->argc; in bsdunzip_getopt()
111 if (bsdunzip->getopt_word[1] == '-') { in bsdunzip_getopt()
113 bsdunzip->getopt_state = state_long; in bsdunzip_getopt()
114 bsdunzip->getopt_word += 2; /* Skip leading '--' */ in bsdunzip_getopt()
117 bsdunzip->getopt_state = state_short; in bsdunzip_getopt()
118 ++bsdunzip->getopt_word; /* Skip leading '-' */ in bsdunzip_getopt()
125 if (bsdunzip->getopt_state == state_short) { in bsdunzip_getopt()
127 opt = *bsdunzip->getopt_word++; in bsdunzip_getopt()
130 bsdunzip->getopt_state = state_next_word; in bsdunzip_getopt()
144 if (bsdunzip->getopt_word[0] == '\0') { in bsdunzip_getopt()
146 bsdunzip->getopt_word = *bsdunzip->argv; in bsdunzip_getopt()
147 if (bsdunzip->getopt_word == NULL) { in bsdunzip_getopt()
153 ++bsdunzip->argv; in bsdunzip_getopt()
154 --bsdunzip->argc; in bsdunzip_getopt()
157 bsdunzip->getopt_state = state_next_word; in bsdunzip_getopt()
158 bsdunzip->argument = bsdunzip->getopt_word; in bsdunzip_getopt()
163 if (bsdunzip->getopt_state == state_long) { in bsdunzip_getopt()
165 bsdunzip->getopt_state = state_next_word; in bsdunzip_getopt()
168 p = strchr(bsdunzip->getopt_word, '='); in bsdunzip_getopt()
170 optlength = (size_t)(p - bsdunzip->getopt_word); in bsdunzip_getopt()
171 bsdunzip->argument = (char *)(uintptr_t)(p + 1); in bsdunzip_getopt()
173 optlength = strlen(bsdunzip->getopt_word); in bsdunzip_getopt()
179 if (popt->name[0] != bsdunzip->getopt_word[0]) in bsdunzip_getopt()
182 if (strncmp(bsdunzip->getopt_word, popt->name, optlength) == 0) { in bsdunzip_getopt()
197 long_prefix, bsdunzip->getopt_word); in bsdunzip_getopt()
203 long_prefix, bsdunzip->getopt_word, match->name, match2->name); in bsdunzip_getopt()
210 if (bsdunzip->argument == NULL) { in bsdunzip_getopt()
211 bsdunzip->argument = *bsdunzip->argv; in bsdunzip_getopt()
212 if (bsdunzip->argument == NULL) { in bsdunzip_getopt()
218 ++bsdunzip->argv; in bsdunzip_getopt()
219 --bsdunzip->argc; in bsdunzip_getopt()
224 if (bsdunzip->argument != NULL) { in bsdunzip_getopt()