Mercurial > mplayer.hg
diff gui/interface.c @ 33737:71c29e8ec68f
Move string functions from interface.c to string.c.
Additionally, change char parameter of gstrchr() to const and
rename parameter size of gstrncmp() n.
The Win32 GUI now needs gstrdup() defined before its first usage.
| author | ib |
|---|---|
| date | Thu, 07 Jul 2011 08:32:10 +0000 |
| parents | 1fbe7adc4eaf |
| children | 9f6d46d325de |
line wrap: on
line diff
--- a/gui/interface.c Wed Jul 06 23:35:39 2011 +0000 +++ b/gui/interface.c Thu Jul 07 08:32:10 2011 +0000 @@ -24,6 +24,7 @@ #include "skin/skin.h" #include "ui/gmplayer.h" #include "ui/widgets.h" +#include "util/string.h" #include "wm/ws.h" #include "wm/wsxdnd.h" @@ -75,42 +76,6 @@ static int initialized; -int gstrcmp(const char *a, const char *b) -{ - if (!a && !b) - return 0; - if (!a || !b) - return -1; - - return strcmp(a, b); -} - -static int gstrncmp(const char *a, const char *b, int size) -{ - if (!a && !b) - return 0; - if (!a || !b) - return -1; - - return strncmp(a, b, size); -} - -char *gstrdup(const char *str) -{ - if (!str) - return NULL; - - return strdup(str); -} - -char *gstrchr(char *str, int c) -{ - if (!str) - return NULL; - - return strchr(str, c); -} - void gfree(void **p) { free(*p);
