[MPlayer-cvslog] r37083 - in trunk/gui/util: string.c string.h

ib subversion at mplayerhq.hu
Thu Mar 27 03:18:16 CET 2014


Author: ib
Date: Thu Mar 27 03:18:16 2014
New Revision: 37083

Log:
Add new string function strupper().

Modified:
   trunk/gui/util/string.c
   trunk/gui/util/string.h

Modified: trunk/gui/util/string.c
==============================================================================
--- trunk/gui/util/string.c	Thu Mar 27 03:15:29 2014	(r37082)
+++ trunk/gui/util/string.c	Thu Mar 27 03:18:16 2014	(r37083)
@@ -51,6 +51,29 @@ char *strlower(char *in)
 }
 
 /**
+ * @brief Convert a string to upper case.
+ *
+ * @param string to be converted
+ *
+ * @return converted string
+ *
+ * @note Only characters from a to z will be converted and this is an in-place conversion.
+ */
+char *strupper(char *in)
+{
+    char *p = in;
+
+    while (*p) {
+        if (*p >= 'a' && *p <= 'z')
+            *p -= 0x20;
+
+        p++;
+    }
+
+    return in;
+}
+
+/**
  * @brief Swap characters in a string.
  *
  * @param in string to be processed

Modified: trunk/gui/util/string.h
==============================================================================
--- trunk/gui/util/string.h	Thu Mar 27 03:15:29 2014	(r37082)
+++ trunk/gui/util/string.h	Thu Mar 27 03:18:16 2014	(r37083)
@@ -32,6 +32,7 @@ void setddup(char **old, const char *dir
 void setdup(char **old, const char *str);
 char *strlower(char *in);
 char *strswap(char *in, char from, char to);
+char *strupper(char *in);
 char *trim(char *in);
 
 #endif /* MPLAYER_GUI_STRING_H */


More information about the MPlayer-cvslog mailing list