VSF Documented
Data Structures | Functions
argtable3.c File Reference
#include "argtable3.h"
#include "argtable3_private.h"
#include <getopt.h>
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>

Data Structures

struct  longoptions
 

Functions

int arg_parse (int argc, char **argv, void **argtable)
 
void arg_print_option_ds (arg_dstr_t ds, const char *shortopts, const char *longopts, const char *datatype, const char *suffix)
 
void arg_print_option (FILE *fp, const char *shortopts, const char *longopts, const char *datatype, const char *suffix)
 
void arg_print_syntax_ds (arg_dstr_t ds, void **argtable, const char *suffix)
 
void arg_print_syntax (FILE *fp, void **argtable, const char *suffix)
 
void arg_print_syntaxv_ds (arg_dstr_t ds, void **argtable, const char *suffix)
 
void arg_print_syntaxv (FILE *fp, void **argtable, const char *suffix)
 
void arg_print_glossary_ds (arg_dstr_t ds, void **argtable, const char *format)
 
void arg_print_glossary (FILE *fp, void **argtable, const char *format)
 
void arg_print_formatted (FILE *fp, const unsigned lmargin, const unsigned rmargin, const char *text)
 
void arg_print_glossary_gnu_ds (arg_dstr_t ds, void **argtable)
 
void arg_print_glossary_gnu (FILE *fp, void **argtable)
 
int arg_nullcheck (void **argtable)
 
void arg_free (void **argtable)
 
void arg_freetable (void **argtable, size_t n)
 

Function Documentation

◆ arg_parse()

int arg_parse ( int  argc,
char **  argv,
void **  argtable 
)

◆ arg_print_option_ds()

void arg_print_option_ds ( arg_dstr_t  ds,
const char *  shortopts,
const char *  longopts,
const char *  datatype,
const char *  suffix 
)

◆ arg_print_option()

void arg_print_option ( FILE fp,
const char *  shortopts,
const char *  longopts,
const char *  datatype,
const char *  suffix 
)

◆ arg_print_syntax_ds()

void arg_print_syntax_ds ( arg_dstr_t  ds,
void **  argtable,
const char *  suffix 
)

◆ arg_print_syntax()

void arg_print_syntax ( FILE fp,
void **  argtable,
const char *  suffix 
)

◆ arg_print_syntaxv_ds()

void arg_print_syntaxv_ds ( arg_dstr_t  ds,
void **  argtable,
const char *  suffix 
)

◆ arg_print_syntaxv()

void arg_print_syntaxv ( FILE fp,
void **  argtable,
const char *  suffix 
)

◆ arg_print_glossary_ds()

void arg_print_glossary_ds ( arg_dstr_t  ds,
void **  argtable,
const char *  format 
)

◆ arg_print_glossary()

void arg_print_glossary ( FILE fp,
void **  argtable,
const char *  format 
)

◆ arg_print_formatted()

void arg_print_formatted ( FILE fp,
const unsigned  lmargin,
const unsigned  rmargin,
const char *  text 
)

Print a piece of text formatted, which means in a column with a left and a right margin. The lines are wrapped at whitespaces next to right margin. The function does not indent the first line, but only the following ones.

Example: arg_print_formatted( fp, 0, 5, "Some text that doesn't fit." ) will result in the following output:

Some text that doesn' t fit.

Too long lines will be wrapped in the middle of a word.

arg_print_formatted( fp, 2, 7, "Some text that doesn't fit." ) will result in the following output:

Some text that doesn' t fit.

As you see, the first line is not indented. This enables output of lines, which start in a line where output already happened.

Author: Uli Fouquet

◆ arg_print_glossary_gnu_ds()

void arg_print_glossary_gnu_ds ( arg_dstr_t  ds,
void **  argtable 
)

Prints the glossary in strict GNU format. Differences to arg_print_glossary() are:

  • wraps lines after 80 chars
  • indents lines without shortops
  • does not accept formatstrings

Contributed by Uli Fouquet

◆ arg_print_glossary_gnu()

void arg_print_glossary_gnu ( FILE fp,
void **  argtable 
)

◆ arg_nullcheck()

int arg_nullcheck ( void **  argtable)

Checks the argtable[] array for NULL entries and returns 1 if any are found, zero otherwise.

◆ arg_free()

void arg_free ( void **  argtable)

◆ arg_freetable()

void arg_freetable ( void **  argtable,
size_t  n 
)
Generated from commit: vsfteam/vsf@c3767bf