diff options
author | Antony Kellermann | 2018-06-27 11:03:06 -0400 |
---|---|---|
committer | Antony Kellermann | 2018-06-27 11:03:06 -0400 |
commit | f7da647a9210ad48535b62528f308010841db0f5 (patch) | |
tree | 972b1cdafb760f85814053050ef316745e260c34 /string-tick.h | |
parent | 91076c0a4c3374d81ff38edf9e78d48a01ab601f (diff) | |
download | aur-f7da647a9210ad48535b62528f308010841db0f5.tar.gz |
Changed functions to file_get_string and string_write_file
Diffstat (limited to 'string-tick.h')
-rw-r--r-- | string-tick.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/string-tick.h b/string-tick.h index 93909c54fc73..f18347e53eec 100644 --- a/string-tick.h +++ b/string-tick.h @@ -25,6 +25,7 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> +#include <sys/stat.h> typedef struct string { char* data; @@ -34,7 +35,7 @@ typedef struct string { typedef struct json_object Json; /** - * Creates and returns a String object with len 1 and no data + * Creates and returns a String object with len 0 and data allocated 1 byte null terminated. * @return STRING object */ String* string_init(void); @@ -67,10 +68,17 @@ char* strip_char(char* string, char c); char* strip_tags(char* string); /** - * Overwrites the portfolio with the given pString + * Returns the contents of a file in a String + * @param file_name path to file + * @return String* + */ +String* file_get_string(char* file_name); + +/** + * Writes a String to a file * @param pString the String to overwrite with */ -void string_write_portfolio(String* pString); +void string_write_file(String* pString, char* file_name); /** * Destroys String object and frees memory. Points the String to NULL. |