From: Enlightenment S. <no-...@en...> - 2010-07-25 02:03:18
|
Log: +eina_str_toupper for completion Author: discomfitor Date: 2010-07-24 19:03:10 -0700 (Sat, 24 Jul 2010) New Revision: 50483 Modified: trunk/eina/src/include/eina_str.h trunk/eina/src/lib/eina_str.c Modified: trunk/eina/src/include/eina_str.h =================================================================== --- trunk/eina/src/include/eina_str.h 2010-07-24 21:20:39 UTC (rev 50482) +++ trunk/eina/src/include/eina_str.h 2010-07-25 02:03:10 UTC (rev 50483) @@ -36,6 +36,7 @@ EAPI char *eina_str_escape(const char *str) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_ARG_NONNULL(1); EAPI void eina_str_tolower(char **str); +EAPI void eina_str_toupper(char **str); static inline size_t eina_str_join(char *dst, size_t size, char sep, const char *a, const char *b) EINA_ARG_NONNULL(1, 4, 5); Modified: trunk/eina/src/lib/eina_str.c =================================================================== --- trunk/eina/src/lib/eina_str.c 2010-07-24 21:20:39 UTC (rev 50482) +++ trunk/eina/src/lib/eina_str.c 2010-07-25 02:03:10 UTC (rev 50483) @@ -579,7 +579,24 @@ *p = tolower(*p); } +/** + * @brief Uppercase all the characters in range [a-z] in the given string. + * + * @param str the string to uppercase + * + * This modifies the original string, changing all characters in [a-z] to uppercase. + */ +EAPI void +eina_str_toupper(char **str) +{ + char *p; + if ((!str) || (!(*str))) return; + for (p = *str; (*p); p++) + *p = toupper(*p); +} + + /** * @} */ |