OpenVPN
Functions
argv.c File Reference
#include "syshead.h"
#include "argv.h"
#include "integer.h"
#include "env_set.h"
#include "options.h"
Include dependency graph for argv.c:

Go to the source code of this file.

Functions

static void argv_init (struct argv *a)
 
struct argv argv_new (void)
 
void argv_reset (struct argv *a)
 
static void argv_extend (struct argv *a, const size_t newcap)
 
static void argv_grow (struct argv *a, const size_t add)
 
static void argv_append (struct argv *a, char *str)
 
static struct argv argv_clone (const struct argv *a, const size_t headroom)
 
struct argv argv_insert_head (const struct argv *a, const char *head)
 
static char * argv_term (const char **f)
 
const char * argv_str (const struct argv *a, struct gc_arena *gc, const unsigned int flags)
 
void argv_msg (const int msglev, const struct argv *a)
 
void argv_msg_prefix (const int msglev, const struct argv *a, const char *prefix)
 
static void argv_printf_arglist (struct argv *a, const char *format, va_list arglist)
 
void argv_printf (struct argv *a, const char *format,...)
 
void argv_printf_cat (struct argv *a, const char *format,...)
 
void argv_parse_cmd (struct argv *a, const char *s)
 

Function Documentation

◆ argv_append()

static void argv_append ( struct argv a,
char *  str 
)
static

Definition at line 98 of file argv.c.

References argv::argc, argv::argv, and argv_grow().

Referenced by argv_clone(), argv_parse_cmd(), and argv_printf_arglist().

◆ argv_clone()

static struct argv argv_clone ( const struct argv a,
const size_t  headroom 
)
static

Definition at line 105 of file argv.c.

References argv::argc, argv::argv, argv_append(), argv_init(), and string_alloc().

Referenced by argv_insert_head().

◆ argv_extend()

static void argv_extend ( struct argv a,
const size_t  newcap 
)
static

Definition at line 72 of file argv.c.

References ALLOC_ARRAY_CLEAR, argv::argc, argv::argv, argv::capacity, and free.

Referenced by argv_grow(), argv_parse_cmd(), and argv_printf_arglist().

◆ argv_grow()

static void argv_grow ( struct argv a,
const size_t  add 
)
static

Definition at line 90 of file argv.c.

References adjust_power_of_2(), argv::argc, argv_extend(), and ASSERT.

Referenced by argv_append().

◆ argv_init()

static void argv_init ( struct argv a)
static

Definition at line 44 of file argv.c.

References argv::argc, argv::argv, and argv::capacity.

Referenced by argv_clone(), argv_new(), and argv_reset().

◆ argv_insert_head()

struct argv argv_insert_head ( const struct argv a,
const char *  head 
)

◆ argv_msg()

void argv_msg ( const int  msglev,
const struct argv a 
)

◆ argv_msg_prefix()

void argv_msg_prefix ( const int  msglev,
const struct argv a,
const char *  prefix 
)

Definition at line 214 of file argv.c.

References argv_str(), gc_free(), gc_new(), and msg.

Referenced by netsh_command(), tls_crypt_v2_verify_metadata(), and verify_cert_call_command().

◆ argv_new()

struct argv argv_new ( void  )

◆ argv_parse_cmd()

void argv_parse_cmd ( struct argv a,
const char *  s 
)

◆ argv_printf()

void argv_printf ( struct argv a,
const char *  format,
  ... 
)

◆ argv_printf_arglist()

static void argv_printf_arglist ( struct argv a,
const char *  format,
va_list  arglist 
)
static

◆ argv_printf_cat()

void argv_printf_cat ( struct argv a,
const char *  format,
  ... 
)

◆ argv_reset()

void argv_reset ( struct argv a)

◆ argv_str()

const char* argv_str ( const struct argv a,
struct gc_arena gc,
const unsigned int  flags 
)

Definition at line 193 of file argv.c.

References argv::argv, and print_argv().

Referenced by argv_msg(), argv_msg_prefix(), and argv_str__multiple_argv__correct_output().

◆ argv_term()

static char* argv_term ( const char **  f)
static

Definition at line 135 of file argv.c.

References ASSERT, check_malloc_return(), http-client::f, and malloc.

Referenced by argv_printf_arglist().