Mercurial > dovecot > core-2.2
annotate src/lib/strescape.h @ 9232:2dcf2f313329 HEAD
Added str_tabescape*() to write escaped strings to Dovecot's IPC protocols.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 05 May 2009 20:25:13 -0400 |
parents | e4eb71ae8e96 |
children | 5a6fe52a0cfc |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
1329
diff
changeset
|
1 #ifndef STRESCAPE_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
1329
diff
changeset
|
2 #define STRESCAPE_H |
896
21ffcce83c70
Rewrote rfc822-tokenize.c to work one token at a time so it won't uselessly
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
3 |
1329
ae229b7acb4c
Mailbox names are now sent through imap-quoter instead of just escaping it.
Timo Sirainen <tss@iki.fi>
parents:
1216
diff
changeset
|
4 #define IS_ESCAPED_CHAR(c) ((c) == '"' || (c) == '\\' || (c) == '\'') |
896
21ffcce83c70
Rewrote rfc822-tokenize.c to work one token at a time so it won't uselessly
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
5 |
1329
ae229b7acb4c
Mailbox names are now sent through imap-quoter instead of just escaping it.
Timo Sirainen <tss@iki.fi>
parents:
1216
diff
changeset
|
6 /* escape all '\', '"' and "'" characters */ |
896
21ffcce83c70
Rewrote rfc822-tokenize.c to work one token at a time so it won't uselessly
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
7 const char *str_escape(const char *str); |
21ffcce83c70
Rewrote rfc822-tokenize.c to work one token at a time so it won't uselessly
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
8 |
21ffcce83c70
Rewrote rfc822-tokenize.c to work one token at a time so it won't uselessly
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
9 /* remove all '\' characters, append to given string */ |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
898
diff
changeset
|
10 void str_append_unescaped(string_t *dest, const void *src, size_t src_size); |
896
21ffcce83c70
Rewrote rfc822-tokenize.c to work one token at a time so it won't uselessly
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
11 |
21ffcce83c70
Rewrote rfc822-tokenize.c to work one token at a time so it won't uselessly
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
12 /* remove all '\' characters */ |
1216 | 13 char *str_unescape(char *str); |
896
21ffcce83c70
Rewrote rfc822-tokenize.c to work one token at a time so it won't uselessly
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
14 |
9232
2dcf2f313329
Added str_tabescape*() to write escaped strings to Dovecot's IPC protocols.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
15 /* For Dovecot's internal protocols: Escape \001, \t and \n characters |
2dcf2f313329
Added str_tabescape*() to write escaped strings to Dovecot's IPC protocols.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
16 using \001. */ |
2dcf2f313329
Added str_tabescape*() to write escaped strings to Dovecot's IPC protocols.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
17 const char *str_tabescape(const char *str); |
2dcf2f313329
Added str_tabescape*() to write escaped strings to Dovecot's IPC protocols.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
18 void str_tabescape_write(string_t *dest, const char *src); |
2dcf2f313329
Added str_tabescape*() to write escaped strings to Dovecot's IPC protocols.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
19 |
896
21ffcce83c70
Rewrote rfc822-tokenize.c to work one token at a time so it won't uselessly
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
20 #endif |