added writing capacilities to files and made the appropriate changes to the filedemo.c file
This commit is contained in:
+4
-5
@@ -4,9 +4,10 @@
|
||||
#include <odweta/vector.h>
|
||||
|
||||
typedef struct {
|
||||
char* path; // the file descriptor
|
||||
int length; // line count
|
||||
vector_t* lines; // 2d array of chars
|
||||
char* path; // the file descriptor
|
||||
int length; // line count
|
||||
vector_t* lines; // 2d array of chars
|
||||
int not_newline_terminated; // bool: 1 = true, 0 = false
|
||||
} file_t;
|
||||
|
||||
file_t* fileInit(char* path); // initialization function
|
||||
@@ -21,6 +22,4 @@ void fileWriteln(file_t* f, char* payload); // appends a given string to the fil
|
||||
|
||||
void fileWrite(file_t* f, char* payload); // appends a given string to the file (not on a newline!)
|
||||
|
||||
void fileClear(file_t* f); // wipes the file contents
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user