diff options
author | Daniel Jones <admin@danieljon.es> | 2019-12-28 01:39:10 +1030 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2019-12-28 01:39:10 +1030 |
commit | 39b4a8695a0e357e3f4a65e290cf3a3c1ca39b82 (patch) | |
tree | 797a0b055633105eb275a89a859fc54397e78959 /pages.h | |
parent | 61cdc43efe23719c9713ee3ae87818d7b9f2699d (diff) | |
download | websitegenerator-39b4a8695a0e357e3f4a65e290cf3a3c1ca39b82.tar.gz websitegenerator-39b4a8695a0e357e3f4a65e290cf3a3c1ca39b82.zip |
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
Diffstat (limited to 'pages.h')
-rw-r--r-- | pages.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -21,12 +21,18 @@ #include <unistd.h> #include <sys/stat.h> +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); |