Encapsulate fseek+ftell idiom in seekSize

This allows a single check for the return value of `seekSize`
to verify all three `fseek`+`ftell`+`fseek` calls.
This commit is contained in:
Rangi
2026-07-14 01:32:18 -04:00
parent e7855ea1b8
commit 7e2a3491a5
5 changed files with 34 additions and 23 deletions
+3
View File
@@ -26,6 +26,9 @@ enum NumberBase {
int xfclose(FILE *file);
int xclose(int fd);
// Measure file size with `fseek` and `ftell` idiom
long seekSize(FILE *file);
// Locale-independent character class functions
bool isNewline(int c);
bool isBlankSpace(int c);