Lines Matching refs:con
62 poptContext con = (poptContext) calloc(1, sizeof(struct _poptContext)); in poptGetContext() local
63 con->argc = argc; in poptGetContext()
64 con->argv = argv; in poptGetContext()
65 con->options = options; in poptGetContext()
66 con->long_options = long_options; in poptGetContext()
67 return con; in poptGetContext()
70 poptContext poptFreeContext(poptContext con) { in poptFreeContext() argument
71 free(con->long_options); in poptFreeContext()
72 free(con); in poptFreeContext()
76 void poptResetContext(poptContext con) { in poptResetContext() argument
80 void poptSetOtherOptionHelp(poptContext con, const char *text) { in poptSetOtherOptionHelp() argument
81 con->otherHelp = text; in poptSetOtherOptionHelp()
84 void poptPrintUsage(poptContext con, FILE *fp, int flags) { in poptPrintUsage() argument
85 fprintf(fp, "USAGE: %s %s\n", con->argv[0], con->otherHelp); in poptPrintUsage()
87 for (; con->options[i].longName; i++) { in poptPrintUsage()
88 fprintf(fp, "\t--%s\t%s\n", con->options[i].longName, in poptPrintUsage()
89 con->options[i].descrip); in poptPrintUsage()
94 int poptGetNextOpt(poptContext con) { in poptGetNextOpt() argument
96 int res = getopt_long(con->argc, (char *const *) con->argv, "", in poptGetNextOpt()
97 con->long_options, &i); in poptGetNextOpt()
106 switch (con->options[i].argInfo) { in poptGetNextOpt()
108 *((char**) con->options[i].arg) = strdup(optarg); in poptGetNextOpt()
111 *((int*) con->options[i].arg) = atoi(optarg); in poptGetNextOpt()
118 const char *poptGetArg(poptContext con) { in poptGetArg() argument
119 const char *res = con->argv[optind++]; in poptGetArg()