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

Go to the source code of this file.

Functions

void poptPrintHelp (poptContext con, FILE *f, int)
 
void poptPrintUsage (poptContext con, FILE *f, int)
 
void poptSetOtherOptionHelp (poptContext con, const char *text)
 

Variables

struct poptOption poptHelpOptions []
 

Function Documentation

◆ poptPrintHelp()

void poptPrintHelp ( poptContext  con,
FILE *  f,
int  flags 
)

Definition at line 186 of file popthelp.cpp.

186  {
187  int leftColWidth;
188 
189  showHelpIntro(con, f);
190  if (con->otherHelp)
191  fprintf(f, " %s\n", con->otherHelp);
192  else
193  fprintf(f, " %s\n", POPT_("[OPTION...]"));
194 
195  leftColWidth = maxArgWidth(con->options, NULL);
196  singleTableHelp(f, con->options, leftColWidth, NULL);
197 }
#define POPT_(foo)
Definition: poptint.h:81
const struct poptOption * options
Definition: poptint.h:47
const char * otherHelp
Definition: poptint.h:61

◆ poptPrintUsage()

void poptPrintUsage ( poptContext  con,
FILE *  f,
int  flags 
)

Definition at line 283 of file popthelp.cpp.

283  {
284  int cursor;
285 
286  cursor = showHelpIntro(con, f);
287  cursor += showShortOptions(con->options, f, NULL);
288  singleTableUsage(f, cursor, con->options, NULL);
289 
290  if (con->otherHelp) {
291  cursor += strlen(con->otherHelp) + 1;
292  if (cursor > 79) fprintf(f, "\n ");
293  fprintf(f, " %s", con->otherHelp);
294  }
295 
296  fprintf(f, "\n");
297 }

◆ poptSetOtherOptionHelp()

void poptSetOtherOptionHelp ( poptContext  con,
const char *  text 
)

Definition at line 299 of file popthelp.cpp.

299  {
300  if (con->otherHelp) xfree(con->otherHelp);
301  con->otherHelp = xstrdup(text);
302 }
#define xfree(_a)
Definition: poptint.h:65
char * xstrdup(const char *str)

References poptContext_s::otherHelp, xfree, and xstrdup().

Here is the call graph for this function:

Variable Documentation

◆ poptHelpOptions

struct poptOption poptHelpOptions[]
Initial value:
= {
{ NULL, '\0', POPT_ARG_CALLBACK, (void *)&displayArgs, '\0', NULL, NULL },
{ "help", '?', 0, NULL, '?', N_("Show this help message"), NULL },
{ "usage", 'u', 0, NULL, 'u', N_("Display brief usage message"), NULL },
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
}
#define POPT_ARG_CALLBACK
Definition: popt.h:21
#define N_(foo)
Definition: poptint.h:85

Definition at line 10 of file popthelp.cpp.