blob: 1182355281c35c89925f8695c38d90f11465510b [file] [log] [blame]
Jack Palevich1cdef202009-05-22 12:06:27 -07001/*
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
23typedef char ACCchar;
24typedef int32_t ACCint;
25typedef uint32_t ACCuint;
26typedef ssize_t ACCsizei;
27typedef unsigned int ACCenum;
28typedef void ACCvoid;
29typedef 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
44extern "C" {
45#endif
46
47ACCscript* accCreateScript();
48
49void accDeleteScript(ACCscript* script);
50
Jack Palevich8c246a92009-07-14 21:14:10 -070051typedef ACCvoid* (*ACCSymbolLookupFn)(ACCvoid* pContext, const ACCchar * name);
52
53void accRegisterSymbolCallback(ACCscript* script, ACCSymbolLookupFn pFn,
54 ACCvoid* pContext);
55
Jack Palevich1cdef202009-05-22 12:06:27 -070056ACCenum accGetError( ACCscript* script );
57
58void accScriptSource(ACCscript* script,
59 ACCsizei count,
60 const ACCchar** string,
61 const ACCint* length);
62
63void accCompileScript(ACCscript* script);
64
65void accGetScriptiv(ACCscript* script,
66 ACCenum pname,
67 ACCint* params);
68
69void accGetScriptInfoLog(ACCscript* script,
70 ACCsizei maxLength,
71 ACCsizei* length,
72 ACCchar* infoLog);
73
74void accGetScriptLabel(ACCscript* script, const ACCchar * name,
75 ACCvoid** address);
76
Jack Palevicheedf9d22009-06-04 16:23:40 -070077void accGetPragmas(ACCscript* script, ACCsizei* actualStringCount,
78 ACCsizei maxStringCount, ACCchar** strings);
79
Jack Palevichd5315572009-09-09 13:19:34 -070080/* Used to implement disassembly */
81
82void accGetProgramBinary(ACCscript* script,
83 ACCvoid** base,
84 ACCsizei* length);
85
Jack Palevich1cdef202009-05-22 12:06:27 -070086#ifdef __cplusplus
87};
88#endif
89
90// ----------------------------------------------------------------------------
91
92#endif