1 /*****************************************************************************
2 * tests.c: several test functions needed by the plugins
3 * Functions are prototyped in tests.h.
4 *****************************************************************************
5 * Copyright (C) 2000 VideoLAN
6 * $Id: tests.c,v 1.5 2001/03/21 13:42:34 sam Exp $
8 * Authors: Samuel Hocevar <sam@via.ecp.fr>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
38 /*****************************************************************************
39 * TestVersion: tests if the given string equals the current version
40 *****************************************************************************/
41 int TestVersion( char * psz_version )
43 return( !strcmp( psz_version, VERSION ) );
46 /*****************************************************************************
47 * TestProgram: tests if the given string equals the program name
48 *****************************************************************************/
49 int TestProgram( char * psz_program )
51 return( !strcmp( psz_program, p_main->psz_arg0 ) );
54 /*****************************************************************************
55 * TestMethod: tests if the given method was requested
56 *****************************************************************************/
57 int TestMethod( char * psz_var, char * psz_method )
59 return( !strcmp( psz_method, main_GetPszVariable( psz_var, "" ) ) );
62 /*****************************************************************************
63 * TestCPU: tests if the processor has MMX support and other capabilities
64 *****************************************************************************/
65 int TestCPU( int i_capabilities )
67 return( (i_capabilities & p_main->i_cpu_capabilities) == i_capabilities );