Mixe for Privacy and Anonymity in the Internet
Macros | Functions
popt.cpp File Reference
#include "../StdAfx.h"
#include "poptint.h"
Include dependency graph for popt.cpp:

Go to the source code of this file.

Macros

#define POPT_ERROR_NOARG   -10
 
#define POPT_ERROR_BADOPT   -11
 
#define POPT_ERROR_OPTSTOODEEP   -13
 
#define POPT_ERROR_BADQUOTE   -15 /* only from poptParseArgString() */
 
#define POPT_ERROR_ERRNO   -16 /* only from poptParseArgString() */
 

Functions

void poptSetExecPath (poptContext con, const char *path, int allowAbsolute)
 
poptContext poptGetContext (const char *name, int argc, const char **argv, const struct poptOption *options, int flags)
 
void poptResetContext (poptContext con)
 
int poptGetNextOpt (poptContext con)
 
const char * poptGetOptArg (poptContext con)
 
const char * poptGetArg (poptContext con)
 
const char * poptPeekArg (poptContext con)
 
const char ** poptGetArgs (poptContext con)
 
void poptFreeContext (poptContext con)
 
int poptAddAlias (poptContext con, struct poptAlias newAlias, int flags)
 
const char * poptBadOption (poptContext con, int flags)
 
const char * poptStrerror (const int error)
 
int poptStuffArgs (poptContext con, const char **argv)
 
const char * poptGetInvocationName (poptContext con)
 
int poptStrippedArgv (poptContext con, int argc, char **argv)
 

Macro Definition Documentation

◆ POPT_ERROR_BADOPT

#define POPT_ERROR_BADOPT   -11

Definition at line 718 of file popt.cpp.

◆ POPT_ERROR_BADQUOTE

#define POPT_ERROR_BADQUOTE   -15 /* only from poptParseArgString() */

Definition at line 720 of file popt.cpp.

◆ POPT_ERROR_ERRNO

#define POPT_ERROR_ERRNO   -16 /* only from poptParseArgString() */

Definition at line 721 of file popt.cpp.

◆ POPT_ERROR_NOARG

#define POPT_ERROR_NOARG   -10

Definition at line 717 of file popt.cpp.

◆ POPT_ERROR_OPTSTOODEEP

#define POPT_ERROR_OPTSTOODEEP   -13

Definition at line 719 of file popt.cpp.

Function Documentation

◆ poptAddAlias()

int poptAddAlias ( poptContext  con,
struct poptAlias  newAlias,
int  flags 
)

Definition at line 682 of file popt.cpp.

684 {
685  int aliasNum = con->numAliases++;
686  struct poptAlias * alias;
687 
688  /* SunOS won't realloc(NULL, ...) */
689  if (!con->aliases)
690  con->aliases = (struct poptAlias*)malloc(sizeof(newAlias)* con->numAliases);
691  else
692  con->aliases = (struct poptAlias*)realloc(con->aliases,
693  sizeof(newAlias)* con->numAliases);
694  alias = con->aliases + aliasNum;
695 
696  alias->longName = (newAlias.longName)
697  ? strcpy((char*)malloc(strlen(newAlias.longName) + 1), newAlias.longName)
698  : NULL;
699  alias->shortName = newAlias.shortName;
700  alias->argc = newAlias.argc;
701  alias->argv = newAlias.argv;
702 
703  return 0;
704 }
Definition: popt.h:58
int argc
Definition: popt.h:61
const char ** argv
Definition: popt.h:62
const char * longName
Definition: popt.h:59
char shortName
Definition: popt.h:60
struct poptAlias * aliases
Definition: poptint.h:50
int numAliases
Definition: poptint.h:51

References poptContext_s::aliases, poptAlias::argc, poptAlias::argv, poptAlias::longName, poptContext_s::numAliases, and poptAlias::shortName.

◆ poptBadOption()

const char* poptBadOption ( poptContext  con,
int  flags 
)

Definition at line 706 of file popt.cpp.

706  {
707  struct optionStackEntry * os;
708 
710  os = con->optionStack;
711  else
712  os = con->os;
713 
714  return os->argv[os->next - 1];
715 }
#define POPT_BADOPTION_NOALIAS
Definition: popt.h:41
Definition: poptint.h:24
int next
Definition: poptint.h:28
const char ** argv
Definition: poptint.h:26
struct optionStackEntry * os
Definition: poptint.h:43
struct optionStackEntry optionStack[POPT_OPTION_DEPTH]
Definition: poptint.h:42
UINT16 flags
Definition: typedefs.hpp:1

References optionStackEntry::argv, flags, optionStackEntry::next, poptContext_s::optionStack, poptContext_s::os, and POPT_BADOPTION_NOALIAS.

◆ poptFreeContext()

void poptFreeContext ( poptContext  con)

Definition at line 654 of file popt.cpp.

654  {
655  int i;
656 
657  poptResetContext(con);
658  if (con->os->argb) free(con->os->argb);
659 
660  for (i = 0; i < con->numAliases; i++) {
661  if (con->aliases[i].longName) xfree(con->aliases[i].longName);
662  free((void*)con->aliases[i].argv);
663  }
664 
665  for (i = 0; i < con->numExecs; i++) {
666  if (con->execs[i].longName) xfree(con->execs[i].longName);
667  xfree(con->execs[i].script);
668  }
669  if (con->execs) xfree(con->execs);
670 
671  free((void*)con->leftovers);
672  free((void*)con->finalArgv);
673  if (con->appName) xfree(con->appName);
674  if (con->aliases) free(con->aliases);
675  if (con->otherHelp) xfree(con->otherHelp);
676  if (con->execPath) xfree(con->execPath);
677  if (con->arg_strip) PBM_FREE(con->arg_strip);
678 
679  free(con);
680 }
void poptResetContext(poptContext con)
Definition: popt.cpp:104
#define xfree(_a)
Definition: poptint.h:65
#define PBM_FREE(s)
Definition: poptint.h:19
const char * script
Definition: poptint.h:38
const char * longName
Definition: poptint.h:36
pbm_set * argb
Definition: poptint.h:27
const char ** leftovers
Definition: poptint.h:44
const char * execPath
Definition: poptint.h:59
int numExecs
Definition: poptint.h:54
pbm_set * arg_strip
Definition: poptint.h:62
const char * otherHelp
Definition: poptint.h:61
const char * appName
Definition: poptint.h:49
struct execEntry * execs
Definition: poptint.h:53
const char ** finalArgv
Definition: poptint.h:55

References poptContext_s::aliases, poptContext_s::appName, poptContext_s::arg_strip, optionStackEntry::argb, poptAlias::argv, poptContext_s::execPath, poptContext_s::execs, poptContext_s::finalArgv, poptContext_s::leftovers, poptAlias::longName, execEntry::longName, poptContext_s::numAliases, poptContext_s::numExecs, poptContext_s::os, poptContext_s::otherHelp, PBM_FREE, poptResetContext(), execEntry::script, and xfree.

Referenced by CACmdLnOptions::parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poptGetArg()

const char* poptGetArg ( poptContext  con)

Definition at line 635 of file popt.cpp.

635  {
636  if (con->numLeftovers == con->nextLeftover) return NULL;
637  return con->leftovers[con->nextLeftover++];
638 }
int nextLeftover
Definition: poptint.h:46
int numLeftovers
Definition: poptint.h:45

References poptContext_s::leftovers, poptContext_s::nextLeftover, and poptContext_s::numLeftovers.

◆ poptGetArgs()

const char** poptGetArgs ( poptContext  con)

Definition at line 645 of file popt.cpp.

645  {
646  if (con->numLeftovers == con->nextLeftover) return NULL;
647 
648  /* some apps like [like RPM ;-) ] need this NULL terminated */
649  con->leftovers[con->numLeftovers] = NULL;
650 
651  return (con->leftovers + con->nextLeftover);
652 }

References poptContext_s::leftovers, poptContext_s::nextLeftover, and poptContext_s::numLeftovers.

◆ poptGetContext()

poptContext poptGetContext ( const char *  name,
int  argc,
const char **  argv,
const struct poptOption options,
int  flags 
)

Definition at line 51 of file popt.cpp.

52  {
53  poptContext con = (poptContext)malloc(sizeof(*con));
54 
55  memset(con, 0, sizeof(*con));
56 
57  con->os = con->optionStack;
58  con->os->argc = argc;
59  con->os->argv = argv;
60  con->os->argb = NULL;
61 
63  con->os->next = 1; /* skip argv[0] */
64 
65  con->leftovers = (const char**)calloc((argc + 1), sizeof(char *));
66  con->options = options;
67  con->aliases = NULL;
68  con->numAliases = 0;
69  con->flags = flags;
70  con->execs = NULL;
71  con->numExecs = 0;
72  con->finalArgvAlloced = argc * 2;
73  con->finalArgv = (const char**)calloc(con->finalArgvAlloced, sizeof(*con->finalArgv));
74  con->execAbsolute = 1;
75  con->arg_strip = NULL;
76 
77  if (getenv("POSIXLY_CORRECT") || getenv("POSIX_ME_HARDER"))
79 
80  if (name)
81  con->appName = strcpy((char*)malloc(strlen(name) + 1), name);
82 
83  invokeCallbacks(con, con->options, 0);
84 
85  return con;
86 }
#define POPT_CONTEXT_KEEP_FIRST
Definition: popt.h:45
struct poptContext_s * poptContext
Definition: popt.h:69
#define POPT_CONTEXT_POSIXMEHARDER
Definition: popt.h:46
int argc
Definition: poptint.h:25
int execAbsolute
Definition: poptint.h:60
int finalArgvAlloced
Definition: poptint.h:57
const struct poptOption * options
Definition: poptint.h:47

References poptContext_s::aliases, poptContext_s::appName, poptContext_s::arg_strip, optionStackEntry::argb, optionStackEntry::argc, optionStackEntry::argv, poptContext_s::execAbsolute, poptContext_s::execs, poptContext_s::finalArgv, poptContext_s::finalArgvAlloced, poptContext_s::flags, flags, poptContext_s::leftovers, optionStackEntry::next, poptContext_s::numAliases, poptContext_s::numExecs, poptContext_s::options, poptContext_s::optionStack, poptContext_s::os, POPT_CONTEXT_KEEP_FIRST, and POPT_CONTEXT_POSIXMEHARDER.

Referenced by CACmdLnOptions::parse().

Here is the caller graph for this function:

◆ poptGetInvocationName()

const char* poptGetInvocationName ( poptContext  con)

Definition at line 765 of file popt.cpp.

765  {
766  return con->os->argv[0];
767 }

References optionStackEntry::argv, and poptContext_s::os.

◆ poptGetNextOpt()

int poptGetNextOpt ( poptContext  con)

Definition at line 407 of file popt.cpp.

408 {
409  const struct poptOption * opt = NULL;
410  int done = 0;
411 
412  while (!done) {
413  const char * origOptString = NULL;
414  poptCallbackType cb = NULL;
415  const void * cbData = NULL;
416  const char * longArg = NULL;
417  int canstrip = 0;
418 
419  while (!con->os->nextCharArg && con->os->next == con->os->argc
420  && con->os > con->optionStack) {
421  cleanOSE(con->os--);
422  }
423  if (!con->os->nextCharArg && con->os->next == con->os->argc) {
424  invokeCallbacks(con, con->options, 1);
425  //if (con->doExec) execCommand(con);
426  return -1;
427  }
428 
429  /* Process next long option */
430  if (!con->os->nextCharArg) {
431  char * localOptString, *optString;
432  int thisopt;
433 
434  if (con->os->argb && PBM_ISSET(con->os->next, con->os->argb)) {
435  con->os->next++;
436  continue;
437  }
438  thisopt = con->os->next;
439  origOptString = con->os->argv[con->os->next++];
440 
441  if (con->restLeftover || *origOptString != '-') {
442  con->leftovers[con->numLeftovers++] = origOptString;
444  con->restLeftover = 1;
445  continue;
446  }
447 
448  /* Make a copy we can hack at */
449  localOptString = optString =
450  strcpy((char*)alloca(strlen(origOptString) + 1),
451  origOptString);
452 
453  if (!optString[0])
454  return POPT_ERROR_BADOPT;
455 
456  if (optString[1] == '-' && !optString[2]) {
457  con->restLeftover = 1;
458  continue;
459  }
460  else {
461  char *oe;
462  int singleDash;
463 
464  optString++;
465  if (*optString == '-')
466  singleDash = 0, optString++;
467  else
468  singleDash = 1;
469 
470  /* XXX aliases with arg substitution need "--alias=arg" */
471  if (handleAlias(con, optString, '\0', NULL))
472  continue;
473  if (handleExec(con, optString, '\0'))
474  continue;
475 
476  /* Check for "--long=arg" option. */
477  for (oe = optString; *oe && *oe != '='; oe++)
478  ;
479  if (*oe == '=') {
480  *oe++ = '\0';
481  /* XXX longArg is mapped back to persistent storage. */
482  longArg = origOptString + (oe - localOptString);
483  }
484 
485  opt = findOption(con->options, optString, '\0', &cb, &cbData,
486  singleDash);
487  if (!opt && !singleDash)
488  return POPT_ERROR_BADOPT;
489  }
490 
491  if (!opt) {
492  con->os->nextCharArg = origOptString + 1;
493  }
494  else {
495  if (con->os == con->optionStack &&
496  opt->argInfo & POPT_ARGFLAG_STRIP) {
497  canstrip = 1;
498  poptStripArg(con, thisopt);
499  }
500  }
501  }
502 
503  /* Process next short option */
504  if (con->os->nextCharArg) {
505  origOptString = con->os->nextCharArg;
506 
507  con->os->nextCharArg = NULL;
508 
509  if (handleAlias(con, NULL, *origOptString,
510  origOptString + 1)) {
511  origOptString++;
512  continue;
513  }
514  if (handleExec(con, NULL, *origOptString))
515  continue;
516 
517  opt = findOption(con->options, NULL, *origOptString, &cb,
518  &cbData, 0);
519  if (!opt)
520  return POPT_ERROR_BADOPT;
521 
522  origOptString++;
523  if (*origOptString)
524  con->os->nextCharArg = origOptString;
525  }
526 
527  if (opt->arg && (opt->argInfo & POPT_ARG_MASK) == POPT_ARG_NONE) {
528  *((int *)opt->arg) = 1;
529  }
530  else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_VAL) {
531  if (opt->arg)
532  *((int *)opt->arg) = opt->val;
533  }
534  else if ((opt->argInfo & POPT_ARG_MASK) != POPT_ARG_NONE) {
535  if (con->os->nextArg) {
536  xfree(con->os->nextArg);
537  con->os->nextArg = NULL;
538  }
539  if (longArg) {
540  con->os->nextArg = expandNextArg(con, longArg);
541  }
542  else if (con->os->nextCharArg) {
543  con->os->nextArg = expandNextArg(con, con->os->nextCharArg);
544  con->os->nextCharArg = NULL;
545  }
546  else {
547  while (con->os->next == con->os->argc &&
548  con->os > con->optionStack) {
549  cleanOSE(con->os--);
550  }
551  if (con->os->next == con->os->argc)
552  return POPT_ERROR_NOARG;
553 
554  /* make sure this isn't part of a short arg or the
555  result of an alias expansion */
556  if (con->os == con->optionStack &&
557  opt->argInfo & POPT_ARGFLAG_STRIP &&
558  canstrip) {
559  poptStripArg(con, con->os->next);
560  }
561 
562  con->os->nextArg = expandNextArg(con, con->os->argv[con->os->next++]);
563  }
564 
565  if (opt->arg) {
566  long aLong;
567  char *end;
568 
569  switch (opt->argInfo & POPT_ARG_MASK) {
570  case POPT_ARG_STRING:
571  /* XXX memory leak, hard to plug */
572  *((const char **)opt->arg) = xstrdup(con->os->nextArg);
573  break;
574 
575  case POPT_ARG_INT:
576  case POPT_ARG_LONG:
577  aLong = strtol(con->os->nextArg, &end, 0);
578  if (!(end && *end == '\0'))
579  return POPT_ERROR_BADNUMBER;
580 
581  if (aLong == LONG_MIN || aLong == LONG_MAX)
582  return POPT_ERROR_OVERFLOW;
583  if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_LONG) {
584  *((long *)opt->arg) = aLong;
585  }
586  else {
587  if (aLong > INT_MAX || aLong < INT_MIN)
588  return POPT_ERROR_OVERFLOW;
589  *((int *)opt->arg) = aLong;
590  }
591  break;
592 
593  default:
594  fprintf(stdout, POPT_("option type (%d) not implemented in popt\n"),
595  opt->argInfo & POPT_ARG_MASK);
596  exit(EXIT_FAILURE);
597  }
598  }
599  }
600 
601  if (cb)
602  cb(con, POPT_CALLBACK_REASON_OPTION, opt, con->os->nextArg, cbData);
603  else if (opt->val && ((opt->argInfo & POPT_ARG_MASK) != POPT_ARG_VAL))
604  done = 1;
605 
606  if ((con->finalArgvCount + 2) >= (con->finalArgvAlloced)) {
607  con->finalArgvAlloced += 10;
608  con->finalArgv = (const char**)realloc((void*)con->finalArgv,
609  sizeof(*con->finalArgv) * con->finalArgvAlloced);
610  }
611 
612  { char *s = (char*)malloc((opt->longName ? strlen(opt->longName) : 0) + 3);
613  if (opt->longName)
614  sprintf(s, "--%s", opt->longName);
615  else
616  sprintf(s, "-%c", opt->shortName);
617  con->finalArgv[con->finalArgvCount++] = s;
618  }
619 
620  if (opt->arg && (opt->argInfo & POPT_ARG_MASK) != POPT_ARG_NONE
621  && (opt->argInfo & POPT_ARG_MASK) != POPT_ARG_VAL) {
622  con->finalArgv[con->finalArgvCount++] = xstrdup(con->os->nextArg);
623  }
624  }
625 
626  return opt->val;
627 }
#define POPT_ERROR_BADOPT
Definition: popt.cpp:718
#define POPT_ERROR_NOARG
Definition: popt.cpp:717
#define POPT_ERROR_OVERFLOW
Definition: popt.h:38
#define POPT_ARG_MASK
Definition: popt.h:24
void(* poptCallbackType)(poptContext con, enum poptCallbackReason reason, const struct poptOption *opt, const char *arg, const void *data)
Definition: popt.h:77
#define POPT_ARG_VAL
Definition: popt.h:23
#define POPT_ARGFLAG_STRIP
Definition: popt.h:27
#define POPT_ARG_INT
Definition: popt.h:18
#define POPT_ARG_LONG
Definition: popt.h:19
#define POPT_ARG_NONE
Definition: popt.h:16
#define POPT_ARG_STRING
Definition: popt.h:17
#define POPT_ERROR_BADNUMBER
Definition: popt.h:37
@ POPT_CALLBACK_REASON_OPTION
Definition: popt.h:76
#define POPT_(foo)
Definition: poptint.h:81
#define PBM_ISSET(d, s)
Definition: poptint.h:22
const char * nextArg
Definition: poptint.h:29
const char * nextCharArg
Definition: poptint.h:30
int finalArgvCount
Definition: poptint.h:56
int restLeftover
Definition: poptint.h:48
int argInfo
Definition: popt.h:51
void * arg
Definition: popt.h:52
char shortName
Definition: popt.h:50
int val
Definition: popt.h:53
const char * longName
Definition: popt.h:49
char * xstrdup(const char *str)
char * alloca()

References optionStackEntry::argc, optionStackEntry::next, optionStackEntry::nextCharArg, poptContext_s::optionStack, and poptContext_s::os.

Referenced by CACmdLnOptions::parse().

Here is the caller graph for this function:

◆ poptGetOptArg()

const char* poptGetOptArg ( poptContext  con)

Definition at line 629 of file popt.cpp.

629  {
630  const char * ret = con->os->nextArg;
631  con->os->nextArg = NULL;
632  return ret;
633 }

References optionStackEntry::nextArg, and poptContext_s::os.

◆ poptPeekArg()

const char* poptPeekArg ( poptContext  con)

Definition at line 640 of file popt.cpp.

640  {
641  if (con->numLeftovers == con->nextLeftover) return NULL;
642  return con->leftovers[con->nextLeftover];
643 }

References poptContext_s::leftovers, poptContext_s::nextLeftover, and poptContext_s::numLeftovers.

◆ poptResetContext()

void poptResetContext ( poptContext  con)

Definition at line 104 of file popt.cpp.

104  {
105  int i;
106 
107  while (con->os > con->optionStack) {
108  cleanOSE(con->os--);
109  }
110  if (con->os->argb) {
111  PBM_FREE(con->os->argb);
112  con->os->argb = NULL;
113  }
114  con->os->currAlias = NULL;
115  con->os->nextCharArg = NULL;
116  con->os->nextArg = NULL;
117  con->os->next = 1; /* skip argv[0] */
118 
119  con->numLeftovers = 0;
120  con->nextLeftover = 0;
121  con->restLeftover = 0;
122  con->doExec = NULL;
123 
124  for (i = 0; i < con->finalArgvCount; i++) {
125  if (con->finalArgv[i]) {
126  xfree(con->finalArgv[i]);
127  con->finalArgv[i] = NULL;
128  }
129  }
130 
131  con->finalArgvCount = 0;
132 
133  if (con->arg_strip) {
134  PBM_FREE(con->arg_strip);
135  con->arg_strip = NULL;
136  }
137 }
struct poptAlias * currAlias
Definition: poptint.h:31
struct execEntry * doExec
Definition: poptint.h:58

References poptContext_s::optionStack, and poptContext_s::os.

Referenced by poptFreeContext().

Here is the caller graph for this function:

◆ poptSetExecPath()

void poptSetExecPath ( poptContext  con,
const char *  path,
int  allowAbsolute 
)

Definition at line 25 of file popt.cpp.

25  {
26  if (con->execPath) xfree(con->execPath);
27  con->execPath = xstrdup(path);
28  con->execAbsolute = allowAbsolute;
29 }

References poptContext_s::execAbsolute, poptContext_s::execPath, xfree, and xstrdup().

Here is the call graph for this function:

◆ poptStrerror()

const char* poptStrerror ( const int  error)

Definition at line 723 of file popt.cpp.

723  {
724  switch (error) {
725  case POPT_ERROR_NOARG:
726  return POPT_("missing argument");
727  case POPT_ERROR_BADOPT:
728  return POPT_("unknown option");
730  return POPT_("aliases nested too deeply");
731  case POPT_ERROR_BADQUOTE:
732  return POPT_("error in paramter quoting");
734  return POPT_("invalid numeric value");
735  case POPT_ERROR_OVERFLOW:
736  return POPT_("number too large or too small");
737  case POPT_ERROR_ERRNO:
738  return strerror(errno);
739  default:
740  return POPT_("unknown error");
741  }
742 }
#define POPT_ERROR_OPTSTOODEEP
Definition: popt.cpp:719
#define POPT_ERROR_BADQUOTE
Definition: popt.cpp:720
#define POPT_ERROR_ERRNO
Definition: popt.cpp:721

References POPT_, POPT_ERROR_BADNUMBER, POPT_ERROR_BADOPT, POPT_ERROR_BADQUOTE, POPT_ERROR_ERRNO, POPT_ERROR_NOARG, POPT_ERROR_OPTSTOODEEP, and POPT_ERROR_OVERFLOW.

◆ poptStrippedArgv()

int poptStrippedArgv ( poptContext  con,
int  argc,
char **  argv 
)

Definition at line 769 of file popt.cpp.

770 {
771  int i, j = 1, numargs = argc;
772 
773  for (i = 1; i < argc; i++) {
774  if (PBM_ISSET(i, con->arg_strip)) {
775  numargs--;
776  }
777  }
778 
779  for (i = 1; i < argc; i++) {
780  if (PBM_ISSET(i, con->arg_strip)) {
781  continue;
782  }
783  else {
784  if (j < numargs) {
785  argv[j++] = argv[i];
786  }
787  else {
788  argv[j++] = NULL;
789  }
790  }
791  }
792 
793  return(numargs);
794 }

References poptContext_s::arg_strip, optionStackEntry::argc, optionStackEntry::argv, and PBM_ISSET.

◆ poptStuffArgs()

int poptStuffArgs ( poptContext  con,
const char **  argv 
)

Definition at line 744 of file popt.cpp.

744  {
745  int argc;
746 
747  if ((con->os - con->optionStack) == POPT_OPTION_DEPTH)
748  return POPT_ERROR_OPTSTOODEEP;
749 
750  for (argc = 0; argv[argc]; argc++)
751  ;
752 
753  con->os++;
754  con->os->next = 0;
755  con->os->nextArg = NULL;
756  con->os->nextCharArg = NULL;
757  con->os->currAlias = NULL;
758  poptDupArgv(argc, argv, &con->os->argc, &con->os->argv);
759  con->os->argb = NULL;
760  con->os->stuffed = 1;
761 
762  return 0;
763 }
int poptDupArgv(int argc, const char **argv, int *argcPtr, const char ***argvPtr)
Definition: poptparse.cpp:10
#define POPT_OPTION_DEPTH
Definition: popt.h:14
int stuffed
Definition: poptint.h:32

References optionStackEntry::argb, optionStackEntry::argc, optionStackEntry::argv, optionStackEntry::currAlias, optionStackEntry::next, optionStackEntry::nextArg, optionStackEntry::nextCharArg, poptContext_s::optionStack, poptContext_s::os, POPT_ERROR_OPTSTOODEEP, POPT_OPTION_DEPTH, poptDupArgv(), and optionStackEntry::stuffed.

Here is the call graph for this function: