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 | |
Ying Wang | e2e522f | 2010-09-01 13:24:01 -0700 | [diff] [blame^] | 35 | void slangAddIncludePath(SlangCompiler* compiler, const char* path); |
| 36 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 37 | int slangCompile(SlangCompiler* compiler); |
| 38 | |
| 39 | int slangReflectToJava(SlangCompiler* compiler, const char* packageName); |
Shih-wei Liao | 6de8927 | 2010-07-15 15:26:20 -0700 | [diff] [blame] | 40 | int slangReflectToJavaPath(SlangCompiler* compiler, const char* pathName); |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 41 | |
| 42 | const char* slangGetInfoLog(SlangCompiler* compiler); |
| 43 | void slangGetPragmas(SlangCompiler* compiler, size_t* actualStringCount, size_t maxStringCount, char** strings); |
| 44 | |
Shih-wei Liao | 4c9f742 | 2010-08-05 04:30:02 -0700 | [diff] [blame] | 45 | const char* slangExportFuncs(SlangCompiler* compiler); |
| 46 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 47 | void slangReset(SlangCompiler* compiler); |
| 48 | |
| 49 | #ifdef __cplusplus |
| 50 | } |
| 51 | #endif |
| 52 | |
| 53 | |
| 54 | #endif /* _ANDROID_SLANG_H_ */ |