diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-06-16 09:08:07 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-06-16 09:08:07 +0000 |
commit | 679f307f013740c1bdc42859ea9a206508f6b811 (patch) | |
tree | c48396455feed5cfb493dd8f9e44000f32f13be7 /subopt-helper.c | |
parent | 1d0e6ef7cc82ec7933447c02aef16d652e202b55 (diff) | |
download | mpv-679f307f013740c1bdc42859ea9a206508f6b811.tar.bz2 mpv-679f307f013740c1bdc42859ea9a206508f6b811.tar.xz |
helper functions for comparing strarg_t "strings".
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15735 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subopt-helper.c')
-rw-r--r-- | subopt-helper.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/subopt-helper.c b/subopt-helper.c index 0356e036c4..9ae6669a05 100644 --- a/subopt-helper.c +++ b/subopt-helper.c @@ -292,3 +292,22 @@ int int_pos( int * i ) 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; +} + |