summaryrefslogtreecommitdiff
path: root/util/string-util.h
AgeCommit message (Collapse)Author
2021-02-06util: add strsplit_len: simplified strtok with delimiter escapingDavid Bremner
This will be used to make iterators for configuration values.
2019-06-14util: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h in the util directory
2018-09-06util/string-util: export skip_spaceDavid Bremner
It's only few lines, but we already define the function, so make it usable elsewhere
2017-08-22database: move striping of trailing '/' into helper functionYuri Volchkov
Stripping trailing character is not that uncommon operation. Particularly, the next patch has to perform it as well. Lets move it to the separate function to avoid code duplication. Also the new function has a little improvement: if the character to strip is repeated several times in the end of a string, function strips them all. Signed-off-by: Yuri Volchkov <yuri.volchkov@gmail.com>
2015-09-26util: add strcmp_null, a strcmp that handles NULL parametersJani Nikula
Add strcmp_null, a strcmp that handles NULL strings; in strcmp terms a NULL string is considered to be less than a non-NULL string.
2015-09-07util: move strcase_equal and strcase_hash to utilJani Nikula
For future use in both cli and lib.
2014-08-06util: Const version of strtok_lenAustin Clements
Because of limitations in the C type system, we can't a strtok_len that can work on both const string and non-const strings. The C library solves this by taking a const char* and returning a char* in functions like this (e.g., strchr), but that's not const-safe. Solve it by introducing strtok_len_c, a version of strtok_len for const strings.
2014-07-31util: Make string-util.h C++-compatibleAustin Clements
2014-03-09util: make sanitize string available in string util for reuseJani Nikula
No functional changes.
2013-01-06util: Function to parse boolean term queriesAustin Clements
This parses the subset of Xapian's boolean term quoting rules that are used by make_boolean_term. This is provided as a generic string utility, but will be used shortly in notmuch restore to parse and optimize for ID queries.
2013-01-06util: Factor out boolean term quoting routineAustin Clements
This is now a generic boolean term quoting function. It performs minimal quoting to produce user-friendly queries. This could live in tag-util as well, but it is really nothing specific to tags (although the conventions are specific to Xapian). The API is changed from "caller-allocates" to "readline-like". The scan for max tag length is pushed down into the quoting routine. Furthermore, this now combines the term prefix with the quoted term; arguably this is just as easy to do in the caller, but this will nicely parallel the boolean term parsing function to be introduced shortly. This is an amalgamation of code written by David Bremner and myself.
2012-12-08util: add string-util.[ch]David Bremner
This is to give a home to strtok_len. It's a bit silly to add a header for one routine, but it needs to be shared between several compilation units (or at least that's the most natural design).