1.1 --- a/ucx/string.h Wed Aug 14 16:07:49 2013 +0200 1.2 +++ b/ucx/string.h Fri Aug 16 13:40:10 2013 +0200 1.3 @@ -54,6 +54,7 @@ 1.4 1.5 /** Shortcut for a <code>sstr_t struct</code> literal. */ 1.6 #define ST(s) { (char*)s, sizeof(s)-1 } 1.7 + 1.8 /** Shortcut for the conversion of a C string to a <code>sstr_t</code>. */ 1.9 #define S(s) sstrn((char*)s, sizeof(s)-1) 1.10 1.11 @@ -338,6 +339,22 @@ 1.12 */ 1.13 sstr_t sstrtrim(sstr_t string); 1.14 1.15 +/** 1.16 + * Checks, if a string has a specific prefix. 1.17 + * @param string the string to check 1.18 + * @param prefix the prefix the string should have 1.19 + * @return 1, if and only if the string has the specified prefix, 0 otherwise 1.20 + */ 1.21 +int sstrprefix(sstr_t string, sstr_t prefix); 1.22 + 1.23 +/** 1.24 + * Checks, if a string has a specific suffix. 1.25 + * @param string the string to check 1.26 + * @param suffix the suffix the string should have 1.27 + * @return 1, if and only if the string has the specified suffix, 0 otherwise 1.28 + */ 1.29 +int sstrsuffix(sstr_t string, sstr_t suffix); 1.30 + 1.31 #ifdef __cplusplus 1.32 } 1.33 #endif