MCPcopy Create free account
hub / github.com/creatale/node-dv / readProFile

Function readProFile

deps/tesseract/opencl/openclwrapper.cpp:286–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286static ds_status readProFile(const char *fileName, char **content,
287 size_t *contentSize) {
288 size_t size = 0;
289
290 *contentSize = 0;
291 *content = NULL;
292
293 FILE *input = fopen(fileName, "rb");
294 if (input == NULL) {
295 return DS_FILE_ERROR;
296 }
297
298 fseek(input, 0L, SEEK_END);
299 size = ftell(input);
300 rewind(input);
301 char *binary = (char *)malloc(size);
302 if (binary == NULL) {
303 fclose(input);
304 return DS_FILE_ERROR;
305 }
306 fread(binary, sizeof(char), size, input);
307 fclose(input);
308
309 *contentSize = size;
310 *content = binary;
311 return DS_SUCCESS;
312}
313
314typedef ds_status (*ds_score_deserializer)(ds_device *device,
315 const unsigned char *serializedScore,

Callers 1

readProfileFromFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected