dhcpd-pools  2.28
ISC dhcpd lease usage analyser
Classes | Macros | Functions | Variables
quotearg.c File Reference
#include <config.h>
#include "quotearg.h"
#include "quote.h"
#include "xalloc.h"
#include "c-strcaseeq.h"
#include "localcharset.h"
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <wctype.h>
#include "gettext.h"
Include dependency graph for quotearg.c:

Classes

struct  quoting_options
 
struct  slotvec
 

Macros

#define _(msgid)   gettext (msgid)
 
#define N_(msgid)   msgid
 
#define SIZE_MAX   ((size_t) -1)
 
#define INT_BITS   (sizeof (int) * CHAR_BIT)
 
#define STORE(c)
 
#define START_ESC()
 
#define END_ESC()
 

Functions

struct quoting_optionsclone_quoting_options (struct quoting_options *o)
 
enum quoting_style get_quoting_style (struct quoting_options const *o)
 
void set_quoting_style (struct quoting_options *o, enum quoting_style s)
 
int set_char_quoting (struct quoting_options *o, char c, int i)
 
int set_quoting_flags (struct quoting_options *o, int i)
 
void set_custom_quoting (struct quoting_options *o, char const *left_quote, char const *right_quote)
 
static struct quoting_options quoting_options_from_style (enum quoting_style style)
 
static char const * gettext_quote (char const *msgid, enum quoting_style s)
 
static size_t quotearg_buffer_restyled (char *buffer, size_t buffersize, char const *arg, size_t argsize, enum quoting_style quoting_style, int flags, unsigned int const *quote_these_too, char const *left_quote, char const *right_quote)
 
size_t quotearg_buffer (char *buffer, size_t buffersize, char const *arg, size_t argsize, struct quoting_options const *o)
 
char * quotearg_alloc (char const *arg, size_t argsize, struct quoting_options const *o)
 
char * quotearg_alloc_mem (char const *arg, size_t argsize, size_t *size, struct quoting_options const *o)
 
void quotearg_free (void)
 
static char * quotearg_n_options (int n, char const *arg, size_t argsize, struct quoting_options const *options)
 
char * quotearg_n (int n, char const *arg)
 
char * quotearg_n_mem (int n, char const *arg, size_t argsize)
 
char * quotearg (char const *arg)
 
char * quotearg_mem (char const *arg, size_t argsize)
 
char * quotearg_n_style (int n, enum quoting_style s, char const *arg)
 
char * quotearg_n_style_mem (int n, enum quoting_style s, char const *arg, size_t argsize)
 
char * quotearg_style (enum quoting_style s, char const *arg)
 
char * quotearg_style_mem (enum quoting_style s, char const *arg, size_t argsize)
 
char * quotearg_char_mem (char const *arg, size_t argsize, char ch)
 
char * quotearg_char (char const *arg, char ch)
 
char * quotearg_colon (char const *arg)
 
char * quotearg_colon_mem (char const *arg, size_t argsize)
 
char * quotearg_n_style_colon (int n, enum quoting_style s, char const *arg)
 
char * quotearg_n_custom (int n, char const *left_quote, char const *right_quote, char const *arg)
 
char * quotearg_n_custom_mem (int n, char const *left_quote, char const *right_quote, char const *arg, size_t argsize)
 
char * quotearg_custom (char const *left_quote, char const *right_quote, char const *arg)
 
char * quotearg_custom_mem (char const *left_quote, char const *right_quote, char const *arg, size_t argsize)
 
char const * quote_n_mem (int n, char const *arg, size_t argsize)
 
char const * quote_mem (char const *arg, size_t argsize)
 
char const * quote_n (int n, char const *arg)
 
char const * quote (char const *arg)
 

Variables

char const *const quoting_style_args []
 
enum quoting_style const quoting_style_vals []
 
static struct quoting_options default_quoting_options
 
static char slot0 [256]
 
static unsigned int nslots = 1
 
static struct slotvec slotvec0 = {sizeof slot0, slot0}
 
static struct slotvecslotvec = &slotvec0
 
struct quoting_options quote_quoting_options
 

Macro Definition Documentation

#define _ (   msgid)    gettext (msgid)

Referenced by gettext_quote().

#define END_ESC ( )
Value:
do \
{ \
if (pending_shell_escape_end && ! escaping) \
{ \
STORE ('\''); \
STORE ('\''); \
pending_shell_escape_end = false; \
} \
} \
while (0)

Referenced by quotearg_buffer_restyled().

#define INT_BITS   (sizeof (int) * CHAR_BIT)
#define N_ (   msgid)    msgid
#define SIZE_MAX   ((size_t) -1)
#define START_ESC ( )
Value:
do \
{ \
if (elide_outer_quotes) \
goto force_outer_quoting_style; \
escaping = true; \
&& ! pending_shell_escape_end) \
{ \
STORE ('\''); \
STORE ('$'); \
STORE ('\''); \
pending_shell_escape_end = true; \
} \
STORE ('\\'); \
} \
while (0)
Definition: quotearg.h:74
quoting_style
Definition: quotearg.h:32

Referenced by quotearg_buffer_restyled().

#define STORE (   c)
Value:
do \
{ \
if (len < buffersize) \
buffer[len] = (c); \
len++; \
} \
while (0)

Referenced by quotearg_buffer_restyled().

Function Documentation

struct quoting_options* clone_quoting_options ( struct quoting_options o)

Here is the call graph for this function:

enum quoting_style get_quoting_style ( struct quoting_options const *  o)
static char const* gettext_quote ( char const *  msgid,
enum quoting_style  s 
)
static

Referenced by quotearg_buffer_restyled().

Here is the call graph for this function:

char const* quote ( char const *  arg)

Referenced by field_selector(), main(), parse_config(), return_limit(), and strtod_or_err().

Here is the call graph for this function:

char const* quote_mem ( char const *  arg,
size_t  argsize 
)

Here is the call graph for this function:

char const* quote_n ( int  n,
char const *  arg 
)

Referenced by quote().

Here is the call graph for this function:

char const* quote_n_mem ( int  n,
char const *  arg,
size_t  argsize 
)

Referenced by quote_mem(), and quote_n().

Here is the call graph for this function:

char* quotearg ( char const *  arg)

Here is the call graph for this function:

char* quotearg_alloc ( char const *  arg,
size_t  argsize,
struct quoting_options const *  o 
)

Here is the call graph for this function:

char* quotearg_alloc_mem ( char const *  arg,
size_t  argsize,
size_t *  size,
struct quoting_options const *  o 
)

Referenced by quotearg_alloc().

Here is the call graph for this function:

size_t quotearg_buffer ( char *  buffer,
size_t  buffersize,
char const *  arg,
size_t  argsize,
struct quoting_options const *  o 
)

Here is the call graph for this function:

static size_t quotearg_buffer_restyled ( char *  buffer,
size_t  buffersize,
char const *  arg,
size_t  argsize,
enum quoting_style  quoting_style,
int  flags,
unsigned int const *  quote_these_too,
char const *  left_quote,
char const *  right_quote 
)
static

Referenced by quotearg_alloc_mem(), quotearg_buffer(), and quotearg_n_options().

Here is the call graph for this function:

char* quotearg_char ( char const *  arg,
char  ch 
)

Referenced by quotearg_colon().

Here is the call graph for this function:

char* quotearg_char_mem ( char const *  arg,
size_t  argsize,
char  ch 
)

Referenced by quotearg_char(), and quotearg_colon_mem().

Here is the call graph for this function:

char* quotearg_colon ( char const *  arg)

Referenced by close_stdout().

Here is the call graph for this function:

char* quotearg_colon_mem ( char const *  arg,
size_t  argsize 
)

Here is the call graph for this function:

char* quotearg_custom ( char const *  left_quote,
char const *  right_quote,
char const *  arg 
)

Here is the call graph for this function:

char* quotearg_custom_mem ( char const *  left_quote,
char const *  right_quote,
char const *  arg,
size_t  argsize 
)

Here is the call graph for this function:

void quotearg_free ( void  )
char* quotearg_mem ( char const *  arg,
size_t  argsize 
)

Here is the call graph for this function:

char* quotearg_n ( int  n,
char const *  arg 
)

Referenced by quotearg().

Here is the call graph for this function:

char* quotearg_n_custom ( int  n,
char const *  left_quote,
char const *  right_quote,
char const *  arg 
)

Referenced by quotearg_custom().

Here is the call graph for this function:

char* quotearg_n_custom_mem ( int  n,
char const *  left_quote,
char const *  right_quote,
char const *  arg,
size_t  argsize 
)

Referenced by quotearg_custom_mem(), and quotearg_n_custom().

Here is the call graph for this function:

char* quotearg_n_mem ( int  n,
char const *  arg,
size_t  argsize 
)

Referenced by quotearg_mem().

Here is the call graph for this function:

static char* quotearg_n_options ( int  n,
char const *  arg,
size_t  argsize,
struct quoting_options const *  options 
)
static
char* quotearg_n_style ( int  n,
enum quoting_style  s,
char const *  arg 
)

Referenced by quotearg_style().

Here is the call graph for this function:

char* quotearg_n_style_colon ( int  n,
enum quoting_style  s,
char const *  arg 
)

Here is the call graph for this function:

char* quotearg_n_style_mem ( int  n,
enum quoting_style  s,
char const *  arg,
size_t  argsize 
)

Referenced by quotearg_style_mem().

Here is the call graph for this function:

char* quotearg_style ( enum quoting_style  s,
char const *  arg 
)

Here is the call graph for this function:

char* quotearg_style_mem ( enum quoting_style  s,
char const *  arg,
size_t  argsize 
)

Here is the call graph for this function:

static struct quoting_options quoting_options_from_style ( enum quoting_style  style)
static
int set_char_quoting ( struct quoting_options o,
char  c,
int  i 
)
void set_custom_quoting ( struct quoting_options o,
char const *  left_quote,
char const *  right_quote 
)

Referenced by quotearg_n_custom_mem().

int set_quoting_flags ( struct quoting_options o,
int  i 
)
void set_quoting_style ( struct quoting_options o,
enum quoting_style  s 
)

Variable Documentation

struct quoting_options default_quoting_options
static
unsigned int nslots = 1
static
struct quoting_options quote_quoting_options
Initial value:
=
{
0,
{ 0 },
}
Definition: quotearg.h:170
#define NULL
Definition: getopt1.c:36
char const* const quoting_style_args[]
Initial value:
=
{
"literal",
"shell",
"shell-always",
"shell-escape",
"shell-escape-always",
"c",
"c-maybe",
"escape",
"locale",
"clocale",
0
}
enum quoting_style const quoting_style_vals[]
Initial value:
char slot0[256]
static
struct slotvec* slotvec = &slotvec0
static
struct slotvec slotvec0 = {sizeof slot0, slot0}
static