commit fd8ded2974dda06dccb7d95ab4bc8d038a3aa6cd
parent a6da7c3090c59e28c4c32e7072d193111af0b05e
Author: Frederic Cambus <fred@statdns.com>
Date: Fri, 22 Jul 2016 12:46:45 +0200
Remove now unused file size function
Diffstat:
3 files changed, 0 insertions(+), 64 deletions(-)
diff --git a/src/ansilove.h b/src/ansilove.h
@@ -21,7 +21,6 @@
#include "strtolower.h"
#include "substr.h"
#include "explode.h"
-#include "filesize.h"
#include "sauce.h"
#ifndef HAVE_STRTONUM
diff --git a/src/filesize.c b/src/filesize.c
@@ -1,41 +0,0 @@
-//
-// filesize.c
-// AnsiLove/C
-//
-// Copyright (C) 2011-2016 Stefan Vogt, Brian Cassidy, Frederic Cambus.
-// All rights reserved.
-//
-// This source code is licensed under the BSD 2-Clause License.
-// See the file LICENSE for details.
-//
-
-#include "filesize.h"
-
-size_t filesize(char *filepath)
-{
- // pointer to file at path
- size_t size;
- FILE *file;
-
- // To properly determine the size, we open it in binary mode.
- file = fopen(filepath, "rb");
-
- if(file != NULL)
- {
- // Error while seeking to end of file?
- if(fseek(file, 0, SEEK_END)) {
- rewind(file);
- fclose(file);
- return -1;
- }
-
- size = ftell(file);
- // Close file and return the file size.
- rewind(file);
- fclose(file);
- return size;
- }
-
- // In case we encounter an error.
- return -1;
-}
diff --git a/src/filesize.h b/src/filesize.h
@@ -1,22 +0,0 @@
-//
-// filesize.h
-// AnsiLove/C
-//
-// Copyright (C) 2011-2016 Stefan Vogt, Brian Cassidy, Frederic Cambus.
-// All rights reserved.
-//
-// This source code is licensed under the BSD 2-Clause License.
-// See the file LICENSE for details.
-//
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef filesize_h
-#define filesize_h
-
-// Returns size of a file at a given path as integer.
-
-size_t filesize(char *filepath);
-
-#endif