popt  1.18
Data Structures | Macros | Typedefs | Functions | Variables
poptint.h File Reference
#include <stdint.h>
Include dependency graph for poptint.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pbm_set
 
union  poptArg_u
 A union to simplify opt->arg access without casting. More...
 
struct  optionStackEntry
 
struct  poptContext_s
 

Macros

#define __PBM_NBITS   (8 * sizeof (__pbm_bits))
 
#define __PBM_IX(d)   ((d) / __PBM_NBITS)
 
#define __PBM_MASK(d)   ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS))
 
#define __PBM_BITS(set)   ((set)->bits)
 
#define PBM_ALLOC(d)   calloc(__PBM_IX (d) + 1, sizeof(__pbm_bits))
 
#define PBM_FREE(s)   _free(s);
 
#define PBM_SET(d, s)   (__PBM_BITS (s)[__PBM_IX (d)] |= __PBM_MASK (d))
 
#define PBM_CLR(d, s)   (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d))
 
#define PBM_ISSET(d, s)   ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0)
 
#define poptArgType(_opt)   ((_opt)->argInfo & _poptArgMask)
 
#define poptGroup(_opt)   ((_opt)->argInfo & _poptGroupMask)
 
#define F_ISSET(_opt, _FLAG)   ((_opt)->argInfo & POPT_ARGFLAG_##_FLAG)
 
#define LF_ISSET(_FLAG)   (argInfo & POPT_ARGFLAG_##_FLAG)
 
#define CBF_ISSET(_opt, _FLAG)   ((_opt)->argInfo & POPT_CBFLAG_##_FLAG)
 
#define poptSubstituteHelpI18N(opt)    { if ((opt) == poptHelpOptions) (opt) = poptHelpOptionsI18N; }
 
#define _(foo)   foo
 
#define D_(dom, str)   str
 
#define POPT_(foo)   foo
 
#define N_(foo)   foo
 

Typedefs

typedef unsigned int __pbm_bits
 
typedef const char * poptString
 Typedef's for string and array of strings. More...
 
typedef poptStringpoptArgv
 
typedef union poptArg_u poptArg
 A union to simplify opt->arg access without casting. More...
 

Functions

static void * _free (const void *p)
 Wrapper to free(3), hides const compilation noise, permit NULL, return NULL. More...
 
void poptJlu32lpair (const void *key, size_t size, uint32_t *pc, uint32_t *pb)
 
int POPT_fprintf (FILE *stream, const char *format,...)
 
const char * POPT_prev_char (const char *str)
 
const char * POPT_next_char (const char *str)
 

Variables

unsigned int _poptArgMask
 
unsigned int _poptGroupMask
 

Macro Definition Documentation

◆ _

#define _ (   foo)    foo

Definition at line 144 of file poptint.h.

◆ __PBM_BITS

#define __PBM_BITS (   set)    ((set)->bits)

Definition at line 34 of file poptint.h.

◆ __PBM_IX

#define __PBM_IX (   d)    ((d) / __PBM_NBITS)

Definition at line 29 of file poptint.h.

◆ __PBM_MASK

#define __PBM_MASK (   d)    ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS))

Definition at line 30 of file poptint.h.

◆ __PBM_NBITS

#define __PBM_NBITS   (8 * sizeof (__pbm_bits))

Definition at line 28 of file poptint.h.

◆ CBF_ISSET

#define CBF_ISSET (   _opt,
  _FLAG 
)    ((_opt)->argInfo & POPT_CBFLAG_##_FLAG)

Definition at line 75 of file poptint.h.

◆ D_

#define D_ (   dom,
  str 
)    str

Definition at line 151 of file poptint.h.

◆ F_ISSET

#define F_ISSET (   _opt,
  _FLAG 
)    ((_opt)->argInfo & POPT_ARGFLAG_##_FLAG)

Definition at line 73 of file poptint.h.

◆ LF_ISSET

#define LF_ISSET (   _FLAG)    (argInfo & POPT_ARGFLAG_##_FLAG)

Definition at line 74 of file poptint.h.

◆ N_

#define N_ (   foo)    foo

Definition at line 155 of file poptint.h.

◆ PBM_ALLOC

#define PBM_ALLOC (   d)    calloc(__PBM_IX (d) + 1, sizeof(__pbm_bits))

Definition at line 36 of file poptint.h.

◆ PBM_CLR

#define PBM_CLR (   d,
 
)    (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d))

Definition at line 39 of file poptint.h.

◆ PBM_FREE

#define PBM_FREE (   s)    _free(s);

Definition at line 37 of file poptint.h.

◆ PBM_ISSET

#define PBM_ISSET (   d,
 
)    ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0)

Definition at line 40 of file poptint.h.

◆ PBM_SET

#define PBM_SET (   d,
 
)    (__PBM_BITS (s)[__PBM_IX (d)] |= __PBM_MASK (d))

Definition at line 38 of file poptint.h.

◆ POPT_

#define POPT_ (   foo)    foo

Definition at line 152 of file poptint.h.

◆ poptArgType

#define poptArgType (   _opt)    ((_opt)->argInfo & _poptArgMask)

Definition at line 70 of file poptint.h.

◆ poptGroup

#define poptGroup (   _opt)    ((_opt)->argInfo & _poptGroupMask)

Definition at line 71 of file poptint.h.

◆ poptSubstituteHelpI18N

#define poptSubstituteHelpI18N (   opt)     { if ((opt) == poptHelpOptions) (opt) = poptHelpOptionsI18N; }

Definition at line 78 of file poptint.h.

Typedef Documentation

◆ __pbm_bits

typedef unsigned int __pbm_bits

Definition at line 27 of file poptint.h.

◆ poptArg

typedef union poptArg_u poptArg

A union to simplify opt->arg access without casting.

◆ poptArgv

typedef poptString* poptArgv

Definition at line 49 of file poptint.h.

◆ poptString

typedef const char* poptString

Typedef's for string and array of strings.

Definition at line 48 of file poptint.h.

Function Documentation

◆ _free()

static void* _free ( const void *  p)
inlinestatic

Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.

Parameters
pmemory to free
Return values
NULLalways

Definition at line 20 of file poptint.h.

Referenced by cleanOSE(), findProgramPath(), poptFreeContext(), poptFreeItems(), poptGetNextOpt(), poptResetContext(), poptSaveBits(), poptSetExecPath(), poptSetOtherOptionHelp(), singleOptionDefaultValue(), and singleOptionHelp().

◆ POPT_fprintf()

int POPT_fprintf ( FILE *  stream,
const char *  format,
  ... 
)

Definition at line 138 of file poptint.c.

Referenced by poptPrintHelp(), showHelpIntro(), singleOptionHelp(), and singleTableHelp().

◆ POPT_next_char()

const char* POPT_next_char ( const char *  str)

Definition at line 27 of file poptint.c.

Referenced by singleOptionHelp(), and stringDisplayWidth().

◆ POPT_prev_char()

const char* POPT_prev_char ( const char *  str)

Definition at line 15 of file poptint.c.

Referenced by singleOptionHelp().

◆ poptJlu32lpair()

void poptJlu32lpair ( const void *  key,
size_t  size,
uint32_t *  pc,
uint32_t *  pb 
)

Variable Documentation

◆ _poptArgMask

unsigned int _poptArgMask
extern

Definition at line 34 of file popt.c.

◆ _poptGroupMask

unsigned int _poptGroupMask
extern

Definition at line 35 of file popt.c.