| 122 | } |
| 123 | |
| 124 | ModuleInfo ModuleFileAccess::getModuleInfo ( const string & req, const string & from ) const { |
| 125 | if (failed()) return FileAccess::getModuleInfo(req, from); |
| 126 | vec4f args[2]; |
| 127 | args[0] = cast<const char *>::from(req.c_str()); |
| 128 | args[1] = cast<const char *>::from(from.c_str()); |
| 129 | struct { |
| 130 | char * modName; |
| 131 | char * modFileName; |
| 132 | char * modImportName; |
| 133 | } res; |
| 134 | memset(&res, 0, sizeof(res)); |
| 135 | context->evalWithCatch(modGet, args, &res); |
| 136 | auto exc = context->getException(); exc; |
| 137 | DAS_ASSERTF(!exc, "exception failed in `module_get`: %s", exc); |
| 138 | ModuleInfo info; |
| 139 | info.moduleName = res.modName ? res.modName : ""; |
| 140 | info.fileName = res.modFileName ? res.modFileName : ""; |
| 141 | info.importName = res.modImportName ? res.modImportName : ""; |
| 142 | return info; |
| 143 | } |
| 144 | |
| 145 | string ModuleFileAccess::getDynModulesFolder() const { |
| 146 | if(failed() || !dynModulesFolderGet) return FileAccess::getDynModulesFolder(); |
nothing calls this directly
no test coverage detected