[MPlayer-cvslog] CVS: main subopt-helper.c, 1.6, 1.7 subopt-helper.h, 1.4, 1.5

Reimar Döffinger CVS syncmail at mplayerhq.hu
Thu Jun 16 11:08:09 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv4341

Modified Files:
	subopt-helper.c subopt-helper.h 
Log Message:
helper functions for comparing strarg_t "strings".


Index: subopt-helper.c
===================================================================
RCS file: /cvsroot/mplayer/main/subopt-helper.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- subopt-helper.c	16 Jun 2005 09:03:11 -0000	1.6
+++ subopt-helper.c	16 Jun 2005 09:08:07 -0000	1.7
@@ -292,3 +292,22 @@
 
   return 0;
 }
+
+/*** little helpers */
+
+/** \brief compare the stings just as strcmp does */
+int strargcmp(strarg_t *arg, char *str) {
+  int res = strncmp(arg->str, str, arg->len);
+  if (!res && arg->len != strlen(str))
+    res = arg->len - strlen(str);
+  return res;
+}
+
+/** \brief compare the stings just as strcasecmp does */
+int strargcasecmp(strarg_t *arg, char *str) {
+  int res = strncasecmp(arg->str, str, arg->len);
+  if (!res && arg->len != strlen(str))
+    res = arg->len - strlen(str);
+  return res;
+}
+

Index: subopt-helper.h
===================================================================
RCS file: /cvsroot/mplayer/main/subopt-helper.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- subopt-helper.h	19 Feb 2005 20:14:00 -0000	1.4
+++ subopt-helper.h	16 Jun 2005 09:08:07 -0000	1.5
@@ -43,4 +43,7 @@
 int int_non_neg( int * i );
 int int_pos( int * i );
 
+int strargcmp(strarg_t *arg, char *str);
+int strargcasecmp(strarg_t *arg, char *str);
+
 #endif




More information about the MPlayer-cvslog mailing list