• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2009 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ANDROID_ACC_ACC_H
18 #define ANDROID_ACC_ACC_H
19 
20 #include <stdint.h>
21 #include <sys/types.h>
22 
23 typedef char                        ACCchar;
24 typedef int32_t                     ACCint;
25 typedef uint32_t                    ACCuint;
26 typedef ssize_t                     ACCsizei;
27 typedef unsigned int                ACCenum;
28 typedef void                        ACCvoid;
29 typedef struct ACCscript            ACCscript;
30 
31 #define ACC_NO_ERROR                0x0000
32 #define ACC_INVALID_ENUM            0x0500
33 #define ACC_INVALID_OPERATION       0x0502
34 #define ACC_INVALID_VALUE           0x0501
35 #define ACC_OUT_OF_MEMORY           0x0505
36 
37 #define ACC_COMPILE_STATUS          0x8B81
38 #define ACC_INFO_LOG_LENGTH         0x8B84
39 
40 
41 // ----------------------------------------------------------------------------
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 ACCscript* accCreateScript();
48 
49 void accDeleteScript(ACCscript* script);
50 
51 typedef ACCvoid* (*ACCSymbolLookupFn)(ACCvoid* pContext, const ACCchar * name);
52 
53 void accRegisterSymbolCallback(ACCscript* script, ACCSymbolLookupFn pFn,
54                                ACCvoid* pContext);
55 
56 ACCenum accGetError( ACCscript* script );
57 
58 void accScriptSource(ACCscript* script,
59     ACCsizei count,
60     const ACCchar** string,
61     const ACCint* length);
62 
63 void accCompileScript(ACCscript* script);
64 
65 void accGetScriptiv(ACCscript* script,
66     ACCenum pname,
67     ACCint* params);
68 
69 void accGetScriptInfoLog(ACCscript* script,
70     ACCsizei maxLength,
71     ACCsizei* length,
72     ACCchar* infoLog);
73 
74 void accGetScriptLabel(ACCscript* script, const ACCchar * name,
75                        ACCvoid** address);
76 
77 void accGetPragmas(ACCscript* script, ACCsizei* actualStringCount,
78                    ACCsizei maxStringCount, ACCchar** strings);
79 
80 /* Used to implement disassembly */
81 
82 void accGetProgramBinary(ACCscript* script,
83     ACCvoid** base,
84     ACCsizei* length);
85 
86 #ifdef __cplusplus
87 };
88 #endif
89 
90 // ----------------------------------------------------------------------------
91 
92 #endif
93