manager.c 655 B

1234567891011121314151617181920212223
  1. #include "__virtualmath.h"
  2. #include "lib.h"
  3. static struct InFo{
  4. char *name;
  5. Registered reg;
  6. } ManagerInFo[] = {{"sys", registeredSysLib},
  7. {"time", registeredTimeLib},
  8. {NULL, NULL}};
  9. bool checkCLib(char *file) {
  10. for (struct InFo *info = ManagerInFo; info->name != NULL; info++)
  11. if (eqString(file, info->name))
  12. return true;
  13. return false;
  14. }
  15. void importClibCore(char *file, struct LinkValue *belong, FUNC_CORE){
  16. for (struct InFo *info = ManagerInFo; info->name != NULL; info++) {
  17. if (eqString(file, info->name))
  18. info->reg(CR_FUNC(belong, var_list));
  19. }
  20. }