diff options
| author | Jan Sucan <jan@jansucan.com> | 2021-05-02 10:19:23 +0200 |
|---|---|---|
| committer | Jan Sucan <jan@jansucan.com> | 2021-05-02 10:20:29 +0200 |
| commit | 02ffe0ed4113e7b479197d0ba1b160e6280b4099 (patch) | |
| tree | c7a3573039ba02983eec38267d61d86e1965bbab /file.c | |
| parent | 36a92af6ee3c20c93835a34ddeb148c34ccf023c (diff) | |
Move the source files to a src directory
Diffstat (limited to 'file.c')
| -rw-r--r-- | file.c | 23 |
1 files changed, 0 insertions, 23 deletions
@@ -1,23 +0,0 @@ -#include <errno.h> -#include <string.h> - -#include "file.h" -#include "print.h" - -long -file_size(FILE *const file) -{ - fpos_t p; - - if ((fgetpos(file, &p) != 0) || (fseek(file, 0L, SEEK_END) != 0)) { - return -1; - } - - const long size = ftell(file); - - if (fsetpos(file, &p) != 0) { - return -1; - } - - return size; -} |
