Lines Matching defs:bsdtar

24 #include "bsdtar.h"
37 * defined in bsdtar.h. Also note that so far I've found no need
160 * has, of course, been shamelessly tailored for bsdtar. (If you're
178 * early bsdtar as a way to access long options on platforms that did
189 * bsdtar.c.
198 bsdtar_getopt(struct bsdtar *bsdtar)
215 bsdtar->argument = NULL;
218 if (bsdtar->getopt_state == state_start) {
220 ++bsdtar->argv;
221 --bsdtar->argc;
222 if (*bsdtar->argv == NULL)
225 if (bsdtar->argv[0][0] == '-') {
226 bsdtar->getopt_state = state_next_word;
228 bsdtar->getopt_state = state_old_tar;
229 bsdtar->getopt_word = *bsdtar->argv++;
230 --bsdtar->argc;
237 if (bsdtar->getopt_state == state_old_tar) {
239 opt = *bsdtar->getopt_word++;
242 bsdtar->getopt_state = state_next_word;
249 bsdtar->argument = *bsdtar->argv;
250 if (bsdtar->argument == NULL) {
256 ++bsdtar->argv;
257 --bsdtar->argc;
265 if (bsdtar->getopt_state == state_next_word) {
267 if (bsdtar->argv[0] == NULL)
270 if (bsdtar->argv[0][0] != '-')
273 if (strcmp(bsdtar->argv[0], "--") == 0) {
274 ++bsdtar->argv;
275 --bsdtar->argc;
279 bsdtar->getopt_word = *bsdtar->argv++;
280 --bsdtar->argc;
281 if (bsdtar->getopt_word[1] == '-') {
283 bsdtar->getopt_state = state_long;
284 bsdtar->getopt_word += 2; /* Skip leading '--' */
287 bsdtar->getopt_state = state_short;
288 ++bsdtar->getopt_word; /* Skip leading '-' */
295 if (bsdtar->getopt_state == state_short) {
297 opt = *bsdtar->getopt_word++;
300 bsdtar->getopt_state = state_next_word;
313 /* If arg is run-in, bsdtar->getopt_word already points to it. */
314 if (bsdtar->getopt_word[0] == '\0') {
316 bsdtar->getopt_word = *bsdtar->argv;
317 if (bsdtar->getopt_word == NULL) {
323 ++bsdtar->argv;
324 --bsdtar->argc;
327 bsdtar->getopt_state = state_long;
330 bsdtar->getopt_state = state_next_word;
331 bsdtar->argument = bsdtar->getopt_word;
337 if (bsdtar->getopt_state == state_long) {
339 bsdtar->getopt_state = state_next_word;
342 p = strchr(bsdtar->getopt_word, '=');
344 optlength = (size_t)(p - bsdtar->getopt_word);
345 bsdtar->argument = (char *)(uintptr_t)(p + 1);
347 optlength = strlen(bsdtar->getopt_word);
353 if (popt->name[0] != bsdtar->getopt_word[0])
356 if (strncmp(bsdtar->getopt_word, popt->name, optlength) == 0) {
371 long_prefix, bsdtar->getopt_word);
377 long_prefix, bsdtar->getopt_word, match->name, match2->name);
384 if (bsdtar->argument == NULL) {
385 bsdtar->argument = *bsdtar->argv;
386 if (bsdtar->argument == NULL) {
392 ++bsdtar->argv;
393 --bsdtar->argc;
397 if (bsdtar->argument != NULL) {