2
0

aFunlang.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #ifndef AFUN_AFUNLANG_H
  2. #define AFUN_AFUNLANG_H
  3. #include "aFunlangExport.h"
  4. #include "aFunCore.h"
  5. #include "runtime.h"
  6. typedef struct aFunInitInfo aFunInitInfo;
  7. struct aFunInitInfo {
  8. char *base_dir;
  9. LogFactoryPrintConsole pc;
  10. jmp_buf *buf;
  11. LogLevel level;
  12. };
  13. AFUN_LANG_EXPORT bool aFunInit(aFunInitInfo *info);
  14. AFUN_LANG_EXPORT af_Environment *creatAFunEnvironment(int argc, char **argv);
  15. AFUN_LANG_EXPORT void destructAFunEnvironment(af_Environment *env);
  16. /* 源文件运行 */
  17. AFUN_LANG_EXPORT int runCodeFromString(char *code, char *string_name, int mode, af_Environment *env);
  18. AFUN_LANG_EXPORT int runCodeFromFileSource(FilePath file, bool save_afb, FilePath save_path, int mode, af_Environment *env);
  19. AFUN_LANG_EXPORT int runCodeFromStdin(char *name, af_Environment *env);
  20. AFUN_LANG_EXPORT int runCodeFromMemory(af_Code *code, int mode, af_Environment *env);
  21. AFUN_LANG_EXPORT int runCodeFromFileByte(FilePath file, int mode, af_Environment *env);
  22. AFUN_LANG_EXPORT int runCodeFromFile(FilePath file, bool save_afb, int mode, af_Environment *env);
  23. AFUN_LANG_EXPORT int buildFile(FilePath out, FilePath in);
  24. #endif //AFUN_AFUNLANG_H