Mercurial > dovecot > core-2.2
annotate src/lib/str-find.h @ 23017:c1d36f2575c7 default tip
lib-imap: Fix "Don't accept strings with NULs" cherry-pick
author | Timo Sirainen <timo.sirainen@open-xchange.com> |
---|---|
date | Thu, 29 Aug 2019 09:55:25 +0300 |
parents | c8ba50450f12 |
children |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
5520
diff
changeset
|
1 #ifndef STR_FIND_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
5520
diff
changeset
|
2 #define STR_FIND_H |
5520 | 3 |
4 struct str_find_context; | |
5 | |
6 struct str_find_context *str_find_init(pool_t pool, const char *key); | |
7 void str_find_deinit(struct str_find_context **ctx); | |
8 | |
9 /* Returns TRUE if key is found. It's possible to send the data in arbitrary | |
10 blocks and have the key still match. */ | |
11 bool str_find_more(struct str_find_context *ctx, | |
12 const unsigned char *data, size_t size); | |
8995
c8ba50450f12
Added str_find_get_match_end_pos(). Added unit testing.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
13 /* After str_find_more() has returned TRUE, this function returns the end |
c8ba50450f12
Added str_find_get_match_end_pos(). Added unit testing.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
14 position in the previous data block where the key had matched. */ |
c8ba50450f12
Added str_find_get_match_end_pos(). Added unit testing.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
15 size_t str_find_get_match_end_pos(struct str_find_context *ctx); |
5520 | 16 /* Reset input data. The next str_find_more() call won't try to match the key |
17 to earlier data. */ | |
18 void str_find_reset(struct str_find_context *ctx); | |
19 | |
20 #endif |