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.7 2001/05/30 17:03:12 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 *****************************************************************************/
30 #include <string.h> /* memcpy(), memset() */
40 /*****************************************************************************
41 * TestProgram: tests if the given string equals the program name
42 *****************************************************************************/
43 int TestProgram( char * psz_program )
45 return( !strcmp( psz_program, p_main->psz_arg0 ) );
48 /*****************************************************************************
49 * TestMethod: tests if the given method was requested
50 *****************************************************************************/
51 int TestMethod( char * psz_var, char * psz_method )
53 return( !strcmp( psz_method, main_GetPszVariable( psz_var, "" ) ) );
56 /*****************************************************************************
57 * TestCPU: tests if the processor has MMX support and other capabilities
58 *****************************************************************************/
59 int TestCPU( int i_capabilities )
61 return( (i_capabilities & p_main->i_cpu_capabilities) == i_capabilities );