Work in progress

Added test for temp files, getter for filename, and wrappers for fwrite, fprintf, and fgets
This commit is contained in:
Michael Tryby
2019-04-01 18:05:02 -04:00
parent a0b08921fc
commit 2c6d4ca74d
4 changed files with 75 additions and 8 deletions
+14
View File
@@ -16,6 +16,7 @@
#include <stdio.h>
#include <stdarg.h>
// F_OFF Must be a 8 byte / 64 bit integer for large file support
@@ -41,14 +42,27 @@ file_handle_t *create_file_manager();
void delete_file_manager(file_handle_t *file_handle);
void get_filename(file_handle_t *file_handle, char **filename);
int open_file(file_handle_t *file_handle, const char *filename, const char *file_mode);
int seek_file(file_handle_t *file_handle, F_OFF offset, int whence);
F_OFF tell_file(file_handle_t *file_handle);
// Functions for working with binary files
size_t read_file(void *ptr, size_t size, size_t nmemb, file_handle_t *file_handle);
size_t write_file(const void *ptr, size_t size, size_t count, file_handle_t *file_handle);
// Functions for working with text files
int printf_file(file_handle_t *file_handle, const char *format, ... );
int gets_file(char *str, int num, file_handle_t *file_handle);
int close_file(file_handle_t *file_handle);