]> git.notmuchmail.org Git - notmuch/blobdiff - util/string-util.h
util: make sanitize string available in string util for reuse
[notmuch] / util / string-util.h
index 0194607ee52877b9c1adcfc96933d84aab9658f1..8a3ad19eae6e9808a319aec043e78089b792d41e 100644 (file)
 
 char *strtok_len (char *s, const char *delim, size_t *len);
 
+/* Return a talloced string with str sanitized.
+ *
+ * Whitespace characters (tabs and newlines) are replaced with spaces,
+ * non-printable characters with question marks.
+ */
+char *sanitize_string (const void *ctx, const char *str);
+
 /* Construct a boolean term query with the specified prefix (e.g.,
  * "id") and search term, quoting term as necessary.  Specifically, if
  * term contains any non-printable ASCII characters, non-ASCII