Mercurial > trustbridge
comparison common/strhelp.h @ 131:9104b1b2e4da
Added string comparison functions.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Mon, 24 Mar 2014 13:32:12 +0100 |
parents | 702033705bb8 |
children | c719d3fdbc15 |
comparison
equal
deleted
inserted
replaced
122:65941f3d5db8 | 131:9104b1b2e4da |
---|---|
1 #ifndef STRHELP_H | 1 #ifndef STRHELP_H |
2 #define STRHELP_H | 2 #define STRHELP_H |
3 | |
4 #include <stdbool.h> | |
3 | 5 |
4 /** | 6 /** |
5 * @file strhelp.h | 7 * @file strhelp.h |
6 * @brief Helper functions for c strings and memory management | 8 * @brief Helper functions for c strings and memory management |
7 * @details strhelp contains terminating memory allocation functions and | 9 * @details strhelp contains terminating memory allocation functions and |
45 /** | 47 /** |
46 * @brief Frees the given %NULL-terminated string array. | 48 * @brief Frees the given %NULL-terminated string array. |
47 * @param[inout] str_array a %NULL-terminated array of strings | 49 * @param[inout] str_array a %NULL-terminated array of strings |
48 */ | 50 */ |
49 void strv_free (char **str_array); | 51 void strv_free (char **str_array); |
52 | |
53 /** | |
54 * @brief Checks whether two strings exactly match | |
55 * @param[in] s1 the first string | |
56 * @param[in] s2 the second string | |
57 * @returns true if s1 and s2 are equal | |
58 */ | |
59 bool str_equal (char *s1, char *s2); | |
60 | |
61 /** | |
62 * @brief Checks whether s2 exactly matches the beginning of s1. | |
63 * @param[in] s1 the string who's beginning is searched | |
64 * @param[in] s2 the string which is searched for | |
65 * @returns true if s1 starts with s2, false otherwise | |
66 */ | |
67 bool str_starts_with (char *s1, char *s2); | |
68 | |
50 #endif | 69 #endif |