Cthulhu
0.2.10
Cthulhu compiler collection
text.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: LGPL-3.0-only
2
3
#pragma once
4
5
#include <ctu_util_api.h>
6
7
#include "
core/compiler.h
"
8
#include "
core/analyze.h
"
9
#include "
core/text.h
"
10
11
#include <stddef.h>
12
#include <stdbool.h>
13
14
typedef
struct
logger_t
logger_t
;
15
typedef
struct
node_t
node_t
;
16
typedef
struct
arena_t
arena_t
;
17
18
CT_BEGIN_API
19
22
32
CT_UTIL_API
text_t
util_text_escape
(
IN_NOTNULL
logger_t
*reports,
IN_NOTNULL
const
node_t
*node,
STA_READS
(length)
const
char
*text,
size_t
length,
IN_NOTNULL
arena_t
*arena);
33
34
CT_UTIL_API
bool
util_text_has_escapes
(
STA_READS
(length)
const
char
*text,
size_t
length);
35
37
38
CT_END_API
analyze.h
text.h
compiler.h
IN_NOTNULL
#define IN_NOTNULL
annotate a parameter as not being null
STA_READS
#define STA_READS(size)
annotate a parameter as reading expr elements
CT_BEGIN_API
#define CT_BEGIN_API
Definition:
compiler.h:129
CT_END_API
#define CT_END_API
Definition:
compiler.h:130
util_text_has_escapes
CT_UTIL_API bool util_text_has_escapes(STA_READS(length) const char *text, size_t length)
util_text_escape
CT_BEGIN_API CT_UTIL_API text_t util_text_escape(logger_t *reports, const node_t *node, STA_READS(length) const char *text, size_t length, arena_t *arena)
escape a string literal into a string
arena_t
an allocator object
Definition:
arena.h:86
logger_t
a logging sink
Definition:
notify.c:14
node_t
a position in a source file
Definition:
node.h:23
text_t
a range of text
Definition:
text.h:14
cthulhu
util
include
cthulhu
util
text.h
Generated by
1.9.1