Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 1 | #ifndef _ANDROID_SLANG_H_ |
| 2 | # define _ANDROID_SLANG_H_ |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | |
| 6 | /* Hide the underlying C++ implementation of Slang */ |
| 7 | typedef int SlangCompiler; |
| 8 | |
| 9 | typedef 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 |
| 20 | extern "C" { |
| 21 | #endif |
| 22 | |
| 23 | SlangCompiler* slangCreateCompiler(const char* targetTriple, const char* targetCPU, const char** targetFeatures); |
| 24 | |
Kirk Stewart | 1fd8579 | 2010-07-07 09:51:23 -0700 | [diff] [blame] | 25 | void slangAllowRSPrefix(); |
| 26 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 27 | int slangSetSourceFromMemory(SlangCompiler* compiler, const char* text, size_t textLength); |
| 28 | int slangSetSourceFromFile(SlangCompiler* compiler, const char* fileName); |
| 29 | |
| 30 | void slangSetOutputType(SlangCompiler* compiler, SlangCompilerOutputTy outputType); |
| 31 | |
| 32 | int slangSetOutputToStream(SlangCompiler* compiler, FILE* stream); |
| 33 | int slangSetOutputToFile(SlangCompiler* compiler, const char* fileName); |
| 34 | |
| 35 | int slangCompile(SlangCompiler* compiler); |
| 36 | |
| 37 | int slangReflectToJava(SlangCompiler* compiler, const char* packageName); |
Shih-wei Liao | 6de8927 | 2010-07-15 15:26:20 -0700 | [diff] [blame] | 38 | int slangReflectToJavaPath(SlangCompiler* compiler, const char* pathName); |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 39 | |
| 40 | const char* slangGetInfoLog(SlangCompiler* compiler); |
| 41 | void slangGetPragmas(SlangCompiler* compiler, size_t* actualStringCount, size_t maxStringCount, char** strings); |
| 42 | |
| 43 | void slangReset(SlangCompiler* compiler); |
| 44 | |
| 45 | #ifdef __cplusplus |
| 46 | } |
| 47 | #endif |
| 48 | |
| 49 | |
| 50 | #endif /* _ANDROID_SLANG_H_ */ |