Lines Matching refs:bsdtar

43 #include "bsdtar.h"
56 * defined in bsdtar.h. Also note that so far I've found no need
175 * has, of course, been shamelessly tailored for bsdtar. (If you're
193 * early bsdtar as a way to access long options on platforms that did
204 * bsdtar.c.
213 bsdtar_getopt(struct bsdtar *bsdtar)
224 bsdtar->argument = NULL;
227 if (bsdtar->getopt_state == state_start) {
229 ++bsdtar->argv;
230 --bsdtar->argc;
231 if (*bsdtar->argv == NULL)
234 if (bsdtar->argv[0][0] == '-') {
235 bsdtar->getopt_state = state_next_word;
237 bsdtar->getopt_state = state_old_tar;
238 bsdtar->getopt_word = *bsdtar->argv++;
239 --bsdtar->argc;
246 if (bsdtar->getopt_state == state_old_tar) {
248 opt = *bsdtar->getopt_word++;
251 bsdtar->getopt_state = state_next_word;
258 bsdtar->argument = *bsdtar->argv;
259 if (bsdtar->argument == NULL) {
265 ++bsdtar->argv;
266 --bsdtar->argc;
274 if (bsdtar->getopt_state == state_next_word) {
276 if (bsdtar->argv[0] == NULL)
279 if (bsdtar->argv[0][0] != '-')
282 if (strcmp(bsdtar->argv[0], "--") == 0) {
283 ++bsdtar->argv;
284 --bsdtar->argc;
288 bsdtar->getopt_word = *bsdtar->argv++;
289 --bsdtar->argc;
290 if (bsdtar->getopt_word[1] == '-') {
292 bsdtar->getopt_state = state_long;
293 bsdtar->getopt_word += 2; /* Skip leading '--' */
296 bsdtar->getopt_state = state_short;
297 ++bsdtar->getopt_word; /* Skip leading '-' */
304 if (bsdtar->getopt_state == state_short) {
306 opt = *bsdtar->getopt_word++;
309 bsdtar->getopt_state = state_next_word;
310 return bsdtar_getopt(bsdtar);
322 /* If arg is run-in, bsdtar->getopt_word already points to it. */
323 if (bsdtar->getopt_word[0] == '\0') {
325 bsdtar->getopt_word = *bsdtar->argv;
326 if (bsdtar->getopt_word == NULL) {
332 ++bsdtar->argv;
333 --bsdtar->argc;
336 bsdtar->getopt_state = state_long;
339 bsdtar->getopt_state = state_next_word;
340 bsdtar->argument = bsdtar->getopt_word;
346 if (bsdtar->getopt_state == state_long) {
348 bsdtar->getopt_state = state_next_word;
351 p = strchr(bsdtar->getopt_word, '=');
353 optlength = (size_t)(p - bsdtar->getopt_word);
354 bsdtar->argument = (char *)(uintptr_t)(p + 1);
356 optlength = strlen(bsdtar->getopt_word);
362 if (popt->name[0] != bsdtar->getopt_word[0])
365 if (strncmp(bsdtar->getopt_word, popt->name, optlength) == 0) {
380 long_prefix, bsdtar->getopt_word);
386 long_prefix, bsdtar->getopt_word, match->name, match2->name);
393 if (bsdtar->argument == NULL) {
394 bsdtar->argument = *bsdtar->argv;
395 if (bsdtar->argument == NULL) {
401 ++bsdtar->argv;
402 --bsdtar->argc;
406 if (bsdtar->argument != NULL) {