src/ucx/string.h

changeset 364
5577d6c27a33
parent 363
8175ba2b3bcb
child 378
952c2df7e7ac
     1.1 --- a/src/ucx/string.h	Sun Nov 03 16:22:46 2019 +0100
     1.2 +++ b/src/ucx/string.h	Sun Nov 03 16:34:29 2019 +0100
     1.3 @@ -938,6 +938,44 @@
     1.4  #define sstrsuffix(string, suffix) scstrsuffix(SCSTR(string), SCSTR(suffix))
     1.5  
     1.6  /**
     1.7 + * Checks, if a string has a specific prefix, ignoring the case.
     1.8 + * 
     1.9 + * @param string the string to check
    1.10 + * @param prefix the prefix the string should have
    1.11 + * @return 1, if and only if the string has the specified prefix, 0 otherwise
    1.12 + */
    1.13 +int scstrcaseprefix(scstr_t string, scstr_t prefix);
    1.14 +
    1.15 +/**
    1.16 + * Checks, if a string has a specific prefix, ignoring the case.
    1.17 + * 
    1.18 + * @param string the string to check
    1.19 + * @param prefix the prefix the string should have
    1.20 + * @return 1, if and only if the string has the specified prefix, 0 otherwise
    1.21 + */
    1.22 +#define sstrcaseprefix(string, prefix) \
    1.23 +  scstrcaseprefix(SCSTR(string), SCSTR(prefix))
    1.24 +
    1.25 +/**
    1.26 + * Checks, if a string has a specific suffix, ignoring the case.
    1.27 + * 
    1.28 + * @param string the string to check
    1.29 + * @param suffix the suffix the string should have
    1.30 + * @return 1, if and only if the string has the specified suffix, 0 otherwise
    1.31 + */
    1.32 +int scstrcasesuffix(scstr_t string, scstr_t suffix);
    1.33 +
    1.34 +/**
    1.35 + * Checks, if a string has a specific suffix, ignoring the case.
    1.36 + *
    1.37 + * @param string the string to check
    1.38 + * @param suffix the suffix the string should have
    1.39 + * @return 1, if and only if the string has the specified suffix, 0 otherwise
    1.40 + */
    1.41 +#define sstrcasesuffix(string, suffix) \
    1.42 +  scstrcasesuffix(SCSTR(string), SCSTR(suffix))
    1.43 +
    1.44 +/**
    1.45   * Returns a lower case version of a string.
    1.46   * 
    1.47   * This function creates a duplicate of the input string, first

mercurial