magic_func.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #define mg_sys_cycle MAGIC_NAME(sys, cycle)
  13. /* 内置环境变量 */
  14. #define SYS_NAME(job) "sys-" #job
  15. #define ev_sys_prefix SYS_NAME(prefix)
  16. #define ev_grt SYS_NAME(grt)
  17. #define ev_gcmax SYS_NAME(gc-max)
  18. #define ev_gccount SYS_NAME(gc-count)
  19. #define ev_exit_code SYS_NAME(exit-code)
  20. #define ev_argc SYS_NAME(argc)
  21. #define ev_argvx_prefix SYS_NAME(argv)
  22. #define ev_error_std SYS_NAME(error-std)
  23. #define ev_sigint SYS_NAME(SIGINT)
  24. #define ev_sigterm SYS_NAME(SIGTERM)
  25. #define ev_sigu1 SYS_NAME(SIGU1)
  26. #define ev_sigu2 SYS_NAME(SIGU2)
  27. #define ev_sigint_cfg ev_sigint "-config"
  28. #define ev_sigterm_cfg ev_sigterm "-config"
  29. #define ev_sigu1_cfg ev_sigu1 "-config"
  30. #define ev_sigu2_cfg ev_sigu2 "-config"
  31. #endif //AFUN_MAGIC_FUNC_H