From 39b4a8695a0e357e3f4a65e290cf3a3c1ca39b82 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Sat, 28 Dec 2019 01:39:10 +1030 Subject: removed ugly createtmpfile() hack now instead use a struct that either has a filename or string to write into the file. do whichever is appropriate --- pages.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pages.h') diff --git a/pages.h b/pages.h index e141376..3c34d98 100644 --- a/pages.h +++ b/pages.h @@ -21,12 +21,18 @@ #include #include +struct fileorstring +{ + const char *file; + const char *str; +}; + /* helpers */ int createfile(const char *file); long findstring(const char *file, const char *str); int deletebytes(const char *file, long offset, size_t bytes); -int writefileatbyte(const char *dest, const char *source, long offset); -int replaceinpage(const char *outfile, const char *toreplace, const char *infile); +int writeatbyte(const char *dest, struct fileorstring *source, long offset); +int replaceinpage(const char *outfile, const char *toreplace, struct fileorstring *source); char *gettime(); int createtmpfile(const char *name, const char *content, size_t size); -- cgit v1.2.3