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

Function fnbytesInFile

deps/leptonica/src/utils2.c:1432–1447  ·  view source on GitHub ↗

! * \brief fnbytesInFile() * * \param[in] fp file stream * \return nbytes in file; 0 on error */

Source from the content-addressed store, hash-verified

1430 * \return nbytes in file; 0 on error
1431 */
1432size_t
1433fnbytesInFile(FILE *fp)
1434{
1435l_int64 pos, nbytes;
1436
1437 PROCNAME("fnbytesInFile");
1438
1439 if (!fp)
1440 return ERROR_INT("stream not open", procName, 0);
1441
1442 pos = ftell(fp); /* initial position */
1443 fseek(fp, 0, SEEK_END); /* EOF */
1444 nbytes = ftell(fp);
1445 fseek(fp, pos, SEEK_SET); /* back to initial position */
1446 return nbytes;
1447}
1448
1449
1450/*--------------------------------------------------------------------*

Callers 4

findFileFormatStreamFunction · 0.85
freadHeaderSpixFunction · 0.85
freadHeaderPngFunction · 0.85
nbytesInFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected