Tor 0.4.9.8
Loading...
Searching...
No Matches
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.

Macros

#define DECLARE_CTYPE_FN(name)
 
#define TOR_TOLOWER(c)
 
#define TOR_TOUPPER(c)
 

Functions

static int hex_decode_digit (char c)
 

Variables

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

◆ DECLARE_CTYPE_FN

#define DECLARE_CTYPE_FN ( name)
Value:
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:2472

Definition at line 19 of file compat_ctype.h.

◆ TOR_TOLOWER

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

Definition at line 36 of file compat_ctype.h.

◆ TOR_TOUPPER

#define TOR_TOUPPER ( c)
Value:
(TOR_TOUPPER_TABLE[(uint8_t)c])
const uint8_t TOR_TOUPPER_TABLE[]

Definition at line 37 of file compat_ctype.h.

Function Documentation

◆ hex_decode_digit()

static int hex_decode_digit ( char c)
inlinestatic

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(), scan_unsigned(), tor_addr_parse_PTR_name(), and unescape_string().

Variable Documentation

◆ TOR_TOLOWER_TABLE

const uint8_t TOR_TOLOWER_TABLE[]
extern

Definition at line 55 of file compat_ctype.c.

◆ TOR_TOUPPER_TABLE

const uint8_t TOR_TOUPPER_TABLE[]
extern

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.