Macros | Functions | Variables
compat_ctype.h File Reference

Locale-independent character-type inspection (header) More...

#include "orconfig.h"
#include "lib/cc/torint.h"

Go to the source code of this file.


#define DECLARE_CTYPE_FN(name)
#define TOR_TOLOWER(c)   (TOR_TOLOWER_TABLE[(uint8_t)c])
#define TOR_TOUPPER(c)   (TOR_TOUPPER_TABLE[(uint8_t)c])


static int hex_decode_digit (char c)


const uint8_t TOR_TOUPPER_TABLE []
const uint8_t TOR_TOLOWER_TABLE []

Detailed Description

Locale-independent character-type inspection (header)

Definition in file compat_ctype.h.

Macro Definition Documentation


#define DECLARE_CTYPE_FN (   name)
static int TOR_##name(char c); \
extern const uint32_t TOR_##name##_TABLE[]; \
static inline int TOR_##name(char c) { \
uint8_t u = c; \
return !!(TOR_##name##_TABLE[(u >> 5) & 7] & (1u << (u & 31))); \
const char * name
Definition: config.c:2462

Definition at line 19 of file compat_ctype.h.


#define TOR_TOLOWER (   c)    (TOR_TOLOWER_TABLE[(uint8_t)c])

Definition at line 36 of file compat_ctype.h.


#define TOR_TOUPPER (   c)    (TOR_TOUPPER_TABLE[(uint8_t)c])

Definition at line 37 of file compat_ctype.h.

Function Documentation

◆ hex_decode_digit()

static int hex_decode_digit ( char  c)

Helper: given a hex digit, return its value, or -1 if it isn't hex.

Definition at line 43 of file compat_ctype.h.

Referenced by base16_decode(), and tor_addr_parse_PTR_name().

Variable Documentation


const uint8_t TOR_TOLOWER_TABLE[]

Definition at line 55 of file compat_ctype.c.


const uint8_t TOR_TOUPPER_TABLE[]

Upper-casing and lowercasing tables to map characters to upper/lowercase equivalents. Used by tor_toupper() and tor_tolower().

Definition at line 37 of file compat_ctype.c.