6 /* like strtok(3), but without state, and doesn't modify s. Return
7 * value is indicated by pointer and length, not null terminator.
11 * const char *tok = input;
12 * const char *delim = " \t";
15 * while ((tok = strtok_len (tok + tok_len, delim, &tok_len)) != NULL) {
16 * // do stuff with string tok of length tok_len
20 char *strtok_len (char *s, const char *delim, size_t *len);
22 /* Construct a boolean term query with the specified prefix (e.g.,
23 * "id") and search term, quoting term as necessary. Specifically, if
24 * term contains any non-printable ASCII characters, non-ASCII
25 * characters, close parenthesis or double quotes, it will be enclosed
26 * in double quotes and any internal double quotes will be doubled
27 * (e.g. a"b -> "a""b"). The result will be a valid notmuch query and
28 * can be parsed by parse_boolean_term.
30 * Output is into buf; it may be talloc_realloced.
31 * Return: 0 on success, -1 on error. errno will be set to ENOMEM if
32 * there is an allocation failure.
34 int make_boolean_term (void *talloc_ctx, const char *prefix, const char *term,
35 char **buf, size_t *len);