MCPcopy Create free account
hub / github.com/WheretIB/nullc / BuildModule

Function BuildModule

Colorer.cpp:264–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262 char *moduleSource = NULL;
263 unsigned moduleSourceSize = 0;
264 ByteCode* BuildModule(const char* name)
265 {
266 FILE *data = fopen(name, "rb");
267 if(!data)
268 return NULL;
269 fseek(data, 0, SEEK_END);
270 unsigned int textSize = ftell(data);
271 if(!moduleSource || moduleSourceSize < textSize)
272 {
273 delete[] moduleSource;
274 moduleSource = new char[textSize + (textSize << 1) + 1];
275 moduleSourceSize = textSize + (textSize << 1) + 1;
276 }
277 fseek(data, 0, SEEK_SET);
278 fread(moduleSource, 1, textSize, data);
279 moduleSource[textSize] = 0;
280 fclose(data);
281
282 nullcLoadModuleBySource(importName.c_str(), moduleSource);
283 return (ByteCode*)nullcGetModule(name);
284 }
285 void ImportEnd(char const* s, char const* e)
286 {
287 (void)s; (void)e; // C4100

Callers 3

ImportEndFunction · 0.85
AddModuleFunctionMethod · 0.85
CompileMethod · 0.85

Calls 3

nullcLoadModuleBySourceFunction · 0.85
nullcGetModuleFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected