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