blob: 7f7d0e90731c1877f59d23ee7bc843ff226067cb [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
35int slangCompile(SlangCompiler* compiler);
36
37int slangReflectToJava(SlangCompiler* compiler, const char* packageName);
Shih-wei Liao6de89272010-07-15 15:26:20 -070038int slangReflectToJavaPath(SlangCompiler* compiler, const char* pathName);
Shih-wei Liao462aefd2010-06-04 15:32:04 -070039
40const char* slangGetInfoLog(SlangCompiler* compiler);
41void slangGetPragmas(SlangCompiler* compiler, size_t* actualStringCount, size_t maxStringCount, char** strings);
42
43void slangReset(SlangCompiler* compiler);
44
45#ifdef __cplusplus
46}
47#endif
48
49
50#endif /* _ANDROID_SLANG_H_ */