#include <string.h>
#include <stdlib.h>
#include "ellipsis-entity.h"
#include "utils/ellipsis-error.h"
#include <stdio.h>
#include <stdint.h>
Macros | |
#define | ELLIPSIS_CONTRACT(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) |
#define | ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR, ...) |
#define | ELLIPSIS_CONTRACT_ICE_OR_TRUE(...) |
#define | ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) |
#define | ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR, ...) |
#define | ELLIPSIS_TEST_ICE(...) (false ? ELLIPSIS_TO_VOIDS(__VA_ARGS__) : (ellipsis‿contracts‿is_ice*)nullptr) |
#define | ELLIPSIS_TO_VOIDS(...) ((void*)((uintptr_t)((__VA_ARGS__)-(__VA_ARGS__)))) |
#define | STRINGIFY(...) STRINGIFY_(__VA_ARGS__) |
#define | STRINGIFY_(...) #__VA_ARGS__ |
Typedefs | |
typedef struct ellipsis‿contracts‿is_ice | ellipsis‿contracts‿is_ice |
Functions | |
size_t | ellipsis‿entity (char32_t pc32[static 1], char const s[restrict static 3]) |
Detect an html or xml entity in s and return the Unicode code point in pc32[0] . | |
Variables | |
thread_local bool volatile | ellipsis‿contracts‿ignore‿dynamic |
thread_local bool volatile | ellipsis‿contracts‿proceed‿dynamic |
thread_local bool volatile | ellipsis‿contracts‿verbose‿dynamic |
bool | ellipsis‿entity‿used = false |
True if the processed language excepts html entities as special encoding of characters. | |
#define ELLIPSIS_CONTRACT | ( | COUNT, | |
COND, | |||
ACTION, | |||
VERB, | |||
CSTR, | |||
CTYPE, | |||
... | |||
) |
#define ELLIPSIS_CONTRACT_CHECK_STATIC | ( | CTYPE, | |
COND, | |||
CSTR, | |||
... | |||
) |
#define ELLIPSIS_CONTRACT_ICE_OR_TRUE | ( | ... | ) |
#define ELLIPSIS_CONTRACT_IMPL | ( | COUNT, | |
COND, | |||
ACTION, | |||
VERB, | |||
CSTR, | |||
CTYPE, | |||
... | |||
) |
#define ELLIPSIS_CONTRACT_VIOLATION | ( | COUNT, | |
VERB, | |||
CTYPE, | |||
CSTR, | |||
... | |||
) |
#define ELLIPSIS_TEST_ICE | ( | ... | ) | (false ? ELLIPSIS_TO_VOIDS(__VA_ARGS__) : (ellipsis‿contracts‿is_ice*)nullptr) |
#define ELLIPSIS_TO_VOIDS | ( | ... | ) | ((void*)((uintptr_t)((__VA_ARGS__)-(__VA_ARGS__)))) |
#define STRINGIFY | ( | ... | ) | STRINGIFY_(__VA_ARGS__) |
#define STRINGIFY_ | ( | ... | ) | #__VA_ARGS__ |
typedef struct ellipsis‿contracts‿is_ice ellipsis‿contracts‿is_ice |
size_t ellipsis‿entity | ( | char32_t | pc32[static 1], |
char const | s[restrict static 3] | ||
) |
Detect an html or xml entity in s
and return the Unicode code point in pc32[0]
.
The return value is the number of characters in s
used to form a valid entity or 1
if the string starts with a &
character, but otherwise an entity can not be detected. In the latter case pc32[0]
holds the value ‘U’&'; otherwise if the string does not start with a
&character it holds
0`.
References ellipsis‿xml‿entity(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿lex‿nonspace‿_Inner(), and ellipsis‿lex‿space‿_Inner().
|
extern |
|
extern |
|
extern |
bool ellipsis‿entity‿used = false |
True if the processed language excepts html entities as special encoding of characters.
Referenced by ellipsis‿language‿html‿_Once‿init‿user(), ellipsis‿language‿lex‿_Once‿init‿user(), ellipsis‿language‿markdown‿_Once‿init‿user(), ellipsis‿lex‿nonspace‿_Inner(), and ellipsis‿lex‿space‿_Inner().