summaryrefslogtreecommitdiffstats
path: root/subopt-helper.c
diff options
context:
space:
mode:
authoral <al@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-02-19 20:14:00 +0000
committeral <al@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-02-19 20:14:00 +0000
commit546e6316acd2663c7a8bba621b152a0aaa183410 (patch)
tree7f1257ce876956400e46e59a7accba3993da1bf2 /subopt-helper.c
parentd25c17a05a94235891d02ae676bbced0b4398daf (diff)
downloadmpv-546e6316acd2663c7a8bba621b152a0aaa183410.tar.bz2
mpv-546e6316acd2663c7a8bba621b152a0aaa183410.tar.xz
Move generic tests to a common place.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14737 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subopt-helper.c')
-rw-r--r--subopt-helper.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/subopt-helper.c b/subopt-helper.c
index de103e1126..611af73e1f 100644
--- a/subopt-helper.c
+++ b/subopt-helper.c
@@ -263,3 +263,21 @@ static char const * parse_str( char const * const str, strarg_t * const valp )
return match;
}
+
+
+/*** common test functions ***/
+
+/** \brief Test if i is not negative */
+int int_non_neg( int * i )
+{
+ if ( *i < 0 ) { return 0; }
+
+ return 1;
+}
+/** \brief Test if i is positive. */
+int int_pos( int * i )
+{
+ if ( *i > 0 ) { return 1; }
+
+ return 0;
+}