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 
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 
#define IN_NOTNULL
annotate a parameter as not being null
#define STA_READS(size)
annotate a parameter as reading expr elements
#define CT_BEGIN_API
Definition: compiler.h:129
#define CT_END_API
Definition: compiler.h:130
CT_UTIL_API bool util_text_has_escapes(STA_READS(length) const char *text, size_t length)
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
an allocator object
Definition: arena.h:86
a logging sink
Definition: notify.c:14
a position in a source file
Definition: node.h:23
a range of text
Definition: text.h:14