aFunlang.h 1.3 KB

12345678910111213141516171819202122232425262728293031
  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. jmp_buf *buf;
  10. LogLevel level;
  11. };
  12. AFUN_LANG_EXPORT bool aFunInit(aFunInitInfo *info);
  13. AFUN_LANG_EXPORT void defineRunEnv(aFunRunInfo *run_env);
  14. AFUN_LANG_EXPORT void redefRunEnvSignal(void);
  15. AFUN_LANG_EXPORT void undefRunEnv(aFunRunInfo *run_env);
  16. AFUN_LANG_EXPORT af_Environment *creatAFunEnvironment(int argc, char **argv);
  17. AFUN_LANG_EXPORT void destructAFunEnvironment(af_Environment *env);
  18. /* 源文件运行 */
  19. AFUN_LANG_EXPORT int runCodeFromString(char *code, char *string_name, int mode, af_Environment *env);
  20. AFUN_LANG_EXPORT int runCodeFromFileSource(FilePath file, bool save_afb, FilePath save_path, int mode, af_Environment *env);
  21. AFUN_LANG_EXPORT int runCodeFromStdin(char *name, af_Environment *env);
  22. AFUN_LANG_EXPORT int runCodeFromMemory(af_Code *code, int mode, af_Environment *env);
  23. AFUN_LANG_EXPORT int runCodeFromFileByte(FilePath file, int mode, af_Environment *env);
  24. AFUN_LANG_EXPORT int runCodeFromFile(FilePath file, bool save_afb, int mode, af_Environment *env);
  25. AFUN_LANG_EXPORT int buildFile(FilePath out, FilePath in);
  26. #endif //AFUN_AFUNLANG_H