aboutsummaryrefslogtreecommitdiff
path: root/include/filehandler.h
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-06-10 22:39:25 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-06-10 22:39:25 +0530
commitefafc900db790cac808e0fc6722272bdec451e73 (patch)
tree6122d91ebe111ba8fd44f973a7429341e0116739 /include/filehandler.h
parent4765153a04cd4198df2ddfe8e9d7e4719d89794c (diff)
C++->C
beautiful.
Diffstat (limited to 'include/filehandler.h')
-rw-r--r--include/filehandler.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/include/filehandler.h b/include/filehandler.h
index ac8fa88..bf52e2c 100644
--- a/include/filehandler.h
+++ b/include/filehandler.h
@@ -2,23 +2,18 @@
#define __FILEHANDLER_H
#include <stdbool.h>
+#include <stddef.h>
#include <stdio.h>
-class Filehandler
-{
-private:
+typedef struct {
FILE *f;
char *path;
char *buffer;
+} filehandler_t;
-private:
- unsigned int size(void);
-
-public:
- Filehandler(char *path);
- bool open(void);
- char *read(void);
- void close(void);
-};
+void filehandler_init(filehandler_t *fh, char *path);
+bool filehandler_open(filehandler_t *fh);
+char *filehandler_read(filehandler_t *fh);
+void filehandler_close(filehandler_t *fh);
#endif