Move generic tests to a common place.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14737 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
al 2005-02-19 20:14:00 +00:00
parent d25c17a05a
commit 546e6316ac
4 changed files with 22 additions and 17 deletions

View File

@ -472,13 +472,6 @@ uninit(void)
vo_x11_uninit();
}
static int int_non_neg(int *sh)
{
if ( *sh < 0 )
return 0;
return 1;
}
static opt_t subopts[] = {
{"manyfmts", OPT_ARG_BOOL, &many_fmts, NULL},
{"osd", OPT_ARG_BOOL, &use_osd, NULL},

View File

@ -103,16 +103,6 @@ void pnm_write_error(void) {
/* ------------------------------------------------------------------------- */
/** \brief Validation function for maxfiles
*/
static int int_pos(int *mf)
{
if ( *mf > 0 )
return 1;
return 0;
}
/** \brief Pre-initialisation.
*
* This function is called before initialising the video output driver. It

View File

@ -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;
}

View File

@ -39,4 +39,8 @@ typedef struct strarg_s
char const * str; ///< pointer to position inside the parse string
} strarg_t;
int int_non_neg( int * i );
int int_pos( int * i );
#endif