Coverage Report

Created: 2026-05-30 06:26

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/dovecot/src/lib/strescape.h
Line
Count
Source
1
#ifndef STRESCAPE_H
2
#define STRESCAPE_H
3
4
0
#define IS_ESCAPED_CHAR(c) ((c) == '"' || (c) == '\\' || (c) == '\'')
5
6
/* escape all '\', '"' and "'" characters,
7
   this is nul safe */
8
const char *str_nescape(const void *str, size_t len);
9
10
/* escape string */
11
static inline const char *str_escape(const char *str)
12
0
{
13
0
  return str_nescape(str, strlen(str));
14
0
}
Unexecuted instantiation: rfc822-parser.c:str_escape
Unexecuted instantiation: lib-event.c:str_escape
Unexecuted instantiation: strescape.c:str_escape
Unexecuted instantiation: event-filter.c:str_escape
Unexecuted instantiation: event-filter-parser.c:str_escape
15
16
void str_append_escaped(string_t *dest, const void *src, size_t src_size);
17
/* remove all '\' characters, append to given string */
18
void str_append_unescaped(string_t *dest, const void *src, size_t src_size);
19
20
/* remove all '\' characters */
21
char *str_unescape(char *str);
22
23
/* Remove all '\' chars from str until '"' is reached and return the unescaped
24
   string. *str is updated to point to the character after the '"'. Returns 0
25
   if ok, -1 if '"' wasn't found. */
26
int str_unescape_next(const char **str, const char **unescaped_r);
27
28
/* For Dovecot's internal protocols: Escape \001, \t, \r and \n characters
29
   using \001. */
30
const char *str_tabescape(const char *str);
31
void str_append_tabescaped(string_t *dest, const char *src);
32
void str_append_tabescaped_n(string_t *dest, const unsigned char *src, size_t src_size);
33
void str_append_tabunescaped(string_t *dest, const void *src, size_t src_size);
34
char *str_tabunescape(char *str);
35
const char *t_str_tabunescape(const char *str);
36
37
char **p_strsplit_tabescaped(pool_t pool, const char *str);
38
const char *const *t_strsplit_tabescaped(const char *str);
39
/* Same as t_strsplit_tabescaped(), but the input string is modified and the
40
   returned pointers inside the array point to the original string. */
41
const char *const *t_strsplit_tabescaped_inplace(char *str);
42
43
#endif