magic_func.h 660 B

1234567891011121314151617181920212223242526
  1. /*
  2. * 文件名: magic_func.h
  3. * 目标: 定义魔法函数的名字
  4. */
  5. #ifndef AFUN_MAGIC_FUNC_H
  6. #define AFUN_MAGIC_FUNC_H
  7. /* 魔法函数 */
  8. #define MAGIC_NAME_BASE(type) "magic-" #type ":"
  9. #define MAGIC_NAME(type, job) (MAGIC_NAME_BASE(type) #job)
  10. /* gc模块 */
  11. #define mg_gc_destruct MAGIC_NAME(gc, destruct)
  12. /* 内置环境变量 */
  13. #define SYS_NAME(job) "sys-" #job
  14. #define ev_sys_prefix SYS_NAME(prefix)
  15. #define ev_grt SYS_NAME(grt)
  16. #define ev_gcmax SYS_NAME(gc-max)
  17. #define ev_gccount SYS_NAME(gc-count)
  18. #define ev_exit_code SYS_NAME(exit-code)
  19. #define ev_argc SYS_NAME(argc)
  20. #define ev_argvx_prefix SYS_NAME(argv)
  21. #endif //AFUN_MAGIC_FUNC_H