Initial commit

filemanager
This commit is contained in:
Michael Tryby
2019-03-28 17:28:02 -04:00
parent 1b167b5caf
commit 727ede3aba
2 changed files with 133 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
#ifndef FILEMANAGER_H_
#define FILEMANAGER_H_
#include <stdio.h>
#define FILE_MAXNAME 259
#define FILE_MAXMODE 3
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct file_s {
char filename[FILE_MAXNAME + 1],
FILE *file;
char mode[FILE_MAXMODE + 1];
} file_handle_t;
file_handle_t *create_file_manager(const char *filename, const char *file_mode);
int delete_file_manager(file_handle_t *file_handle);
int open_file(file_handle_t *file_handle);
FILE *get_file(file_handle_t *file_handle);
int close_file(file_handle_t *file_handle);
#if defined(__cplusplus)
}
#endif
#endif /* FILEMANAGER_H_ */