blob: c3779424f9e3f9708e42236d5a9c8a35944c9257 [file] [log] [blame]
Shih-wei Liao462aefd2010-06-04 15:32:04 -07001#ifndef _ANDROID_SLANG_H_
2# define _ANDROID_SLANG_H_
3
4#include <stdio.h>
5
6/* Hide the underlying C++ implementation of Slang */
7typedef int SlangCompiler;
8
9typedef enum {
10 SlangCompilerOutput_Assembly,
11 SlangCompilerOutput_LL,
12 SlangCompilerOutput_Bitcode,
13 SlangCompilerOutput_Nothing,
14 SlangCompilerOutput_Obj,
15
16 SlangCompilerOutput_Default = SlangCompilerOutput_Bitcode
17} SlangCompilerOutputTy;
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23SlangCompiler* slangCreateCompiler(const char* targetTriple, const char* targetCPU, const char** targetFeatures);
24
Kirk Stewart1fd85792010-07-07 09:51:23 -070025void slangAllowRSPrefix();
26
Shih-wei Liao462aefd2010-06-04 15:32:04 -070027int slangSetSourceFromMemory(SlangCompiler* compiler, const char* text, size_t textLength);
28int slangSetSourceFromFile(SlangCompiler* compiler, const char* fileName);
29
30void slangSetOutputType(SlangCompiler* compiler, SlangCompilerOutputTy outputType);
31
32int slangSetOutputToStream(SlangCompiler* compiler, FILE* stream);
33int slangSetOutputToFile(SlangCompiler* compiler, const char* fileName);
34
Ying Wange2e522f2010-09-01 13:24:01 -070035void slangAddIncludePath(SlangCompiler* compiler, const char* path);
36
Shih-wei Liao462aefd2010-06-04 15:32:04 -070037int slangCompile(SlangCompiler* compiler);
38
39int slangReflectToJava(SlangCompiler* compiler, const char* packageName);
Shih-wei Liao6de89272010-07-15 15:26:20 -070040int slangReflectToJavaPath(SlangCompiler* compiler, const char* pathName);
Shih-wei Liao462aefd2010-06-04 15:32:04 -070041
42const char* slangGetInfoLog(SlangCompiler* compiler);
43void slangGetPragmas(SlangCompiler* compiler, size_t* actualStringCount, size_t maxStringCount, char** strings);
44
Shih-wei Liao4c9f7422010-08-05 04:30:02 -070045const char* slangExportFuncs(SlangCompiler* compiler);
46
Shih-wei Liao462aefd2010-06-04 15:32:04 -070047void slangReset(SlangCompiler* compiler);
48
49#ifdef __cplusplus
50}
51#endif
52
53
54#endif /* _ANDROID_SLANG_H_ */