MySQL  8.0.17
Source Code Documentation
config_parser.c File Reference
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <memcached/config_parser.h>
#include <memcached/util.h>

Macros

#define bool   char
 
#define false   0
 
#define true   1
 

Functions

static int read_config_file (const char *fname, struct config_item items[], FILE *error)
 
static int trim_copy (char *dest, size_t size, const char *src, const char **end, char stop)
 Copy a string and trim of leading and trailing white space characters. More...
 
int parse_config (const char *str, struct config_item *items, FILE *error)
 

Macro Definition Documentation

◆ bool

#define bool   char

◆ false

#define false   0

◆ true

#define true   1

Function Documentation

◆ parse_config()

int parse_config ( const char *  str,
struct config_item *  items,
FILE *  error 
)

◆ read_config_file()

static int read_config_file ( const char *  fname,
struct config_item  items[],
FILE *  error 
)
static

◆ trim_copy()

static int trim_copy ( char *  dest,
size_t  size,
const char *  src,
const char **  end,
char  stop 
)
static

Copy a string and trim of leading and trailing white space characters.

Allow the user to escape out the stop character by putting a backslash before the character.

Parameters
destwhere to store the result
sizesize of the result buffer
srcwhere to copy data from
endthe last character parsed is returned here
stopthe character to stop copying.
Returns
0 if success, -1 otherwise