tor  0.4.2.0-alpha-dev
Macros | Functions
cstring.c File Reference
#include "lib/encoding/cstring.h"
#include "lib/log/log.h"
#include "lib/log/util_bug.h"
#include "lib/malloc/malloc.h"
#include "lib/string/compat_ctype.h"
#include <string.h>

Go to the source code of this file.

Macros

#define TOR_ISODIGIT(c)   ('0' <= (c) && (c) <= '7')
 

Functions

const char * unescape_string (const char *s, char **result, size_t *size_out)
 

Detailed Description

Decode data that has been written as a C literal.

Definition in file cstring.c.

Function Documentation

◆ unescape_string()

const char* unescape_string ( const char *  s,
char **  result,
size_t *  size_out 
)

Given a c-style double-quoted escaped string in s, extract and decode its contents into a newly allocated string. On success, assign this string to *result, assign its length to size_out (if provided), and return a pointer to the position in s immediately after the string. On failure, return NULL.

Definition at line 30 of file cstring.c.