PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/visualizations/Milkdrop/vis_milkdrop/evallib/Compiler.h

http://github.com/xbmc/xbmc
C++ Header | 74 lines | 34 code | 11 blank | 29 comment | 0 complexity | 426a3cfaadd645da17330a1369803088 MD5 | raw file
 1/*
 2  LICENSE
 3  -------
 4Copyright 2005 Nullsoft, Inc.
 5All rights reserved.
 6
 7Redistribution and use in source and binary forms, with or without modification, 
 8are permitted provided that the following conditions are met:
 9
10  * Redistributions of source code must retain the above copyright notice,
11    this list of conditions and the following disclaimer. 
12
13  * Redistributions in binary form must reproduce the above copyright notice,
14    this list of conditions and the following disclaimer in the documentation
15    and/or other materials provided with the distribution. 
16
17  * Neither the name of Nullsoft nor the names of its contributors may be used to 
18    endorse or promote products derived from this software without specific prior written permission. 
19 
20THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
21IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
22FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
23CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
26IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
27OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28.
29*/
30#ifndef __COMPILER_H
31#define __COMPILER_H
32
33#define FN_ASSIGN   0
34#define FN_MULTIPLY 1
35#define FN_DIVIDE   2
36#define FN_MODULO   3
37#define FN_ADD      4
38#define FN_SUB      5
39#define FN_AND      6
40#define FN_OR       7
41#define FN_UMINUS   8
42#define FN_UPLUS    9
43
44#define MATH_SIMPLE 0
45#define MATH_FN     1
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50 
51
52int compileCode(char *exp);
53void executeCode(int handle);
54void freeCode(int handle);
55
56
57
58typedef struct {
59      char *name;
60      void *afunc;
61      int nParams;
62      } functionType;
63extern functionType fnTable[27];
64
65int createCompiledValue(double value, double *addrValue);
66int createCompiledFunction1(int fntype, int fn, int code);
67int createCompiledFunction2(int fntype, int fn, int code1, int code2);
68int createCompiledFunction3(int fntype, int fn, int code1, int code2, int code3);
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif