summaryrefslogtreecommitdiff
path: root/str/str.h
diff options
context:
space:
mode:
Diffstat (limited to 'str/str.h')
-rwxr-xr-xstr/str.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/str/str.h b/str/str.h
index 9c68595..7a386c4 100755
--- a/str/str.h
+++ b/str/str.h
@@ -112,8 +112,12 @@ str fp_to_str(FILE *fp);
str fp_to_nstr(FILE *fp, u32 len);
str file_to_str(char *filename);
str file_to_nstr(char *filename, u32 len);
+#define str_to_fd(s, fd) write(fd, s.ptr, s.len)
+#define str_to_fp(s, fp) fwrite(s.ptr, sizeof(str.ptr[0]), s.len, fp)
+void str_to_file(str s, char *filename);
+
str map_file(char *filename);
-// consider adding 'at' to other file-to-str functions
+// TODO: consider adding 'at' to other file-to-str functions
str map_file_at(char *filename, int len, int at);
void unmap_file(str *s);