Lines Matching refs:bsdcat

43 #include "bsdcat.h"
55 * defined in bsdcat.h. Also note that so far I've found no need
75 * has, of course, been shamelessly tailored for bsdcat. (If you're
93 * early bsdcat as a way to access long options on platforms that did
104 * bsdcat.c.
113 bsdcat_getopt(struct bsdcat *bsdcat)
124 bsdcat->argument = NULL;
127 if (bsdcat->getopt_state == state_start) {
129 ++bsdcat->argv;
130 --bsdcat->argc;
131 if (*bsdcat->argv == NULL)
134 bsdcat->getopt_state = state_next_word;
140 if (bsdcat->getopt_state == state_next_word) {
142 if (bsdcat->argv[0] == NULL)
145 if (bsdcat->argv[0][0] != '-')
148 if (strcmp(bsdcat->argv[0], "--") == 0) {
149 ++bsdcat->argv;
150 --bsdcat->argc;
154 bsdcat->getopt_word = *bsdcat->argv++;
155 --bsdcat->argc;
156 if (bsdcat->getopt_word[1] == '-') {
158 bsdcat->getopt_state = state_long;
159 bsdcat->getopt_word += 2; /* Skip leading '--' */
162 bsdcat->getopt_state = state_short;
163 ++bsdcat->getopt_word; /* Skip leading '-' */
170 if (bsdcat->getopt_state == state_short) {
172 opt = *bsdcat->getopt_word++;
175 bsdcat->getopt_state = state_next_word;
176 return bsdcat_getopt(bsdcat);
188 /* If arg is run-in, bsdcat->getopt_word already points to it. */
189 if (bsdcat->getopt_word[0] == '\0') {
191 bsdcat->getopt_word = *bsdcat->argv;
192 if (bsdcat->getopt_word == NULL) {
198 ++bsdcat->argv;
199 --bsdcat->argc;
202 bsdcat->getopt_state = state_long;
205 bsdcat->getopt_state = state_next_word;
206 bsdcat->argument = bsdcat->getopt_word;
212 if (bsdcat->getopt_state == state_long) {
214 bsdcat->getopt_state = state_next_word;
217 p = strchr(bsdcat->getopt_word, '=');
219 optlength = (size_t)(p - bsdcat->getopt_word);
220 bsdcat->argument = (char *)(uintptr_t)(p + 1);
222 optlength = strlen(bsdcat->getopt_word);
228 if (popt->name[0] != bsdcat->getopt_word[0])
231 if (strncmp(bsdcat->getopt_word, popt->name, optlength) == 0) {
246 long_prefix, bsdcat->getopt_word);
252 long_prefix, bsdcat->getopt_word, match->name, match2->name);
259 if (bsdcat->argument == NULL) {
260 bsdcat->argument = *bsdcat->argv;
261 if (bsdcat->argument == NULL) {
267 ++bsdcat->argv;
268 --bsdcat->argc;
272 if (bsdcat->argument != NULL) {