-rw-r--r-- | html.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -168 +168,15 @@ void html_filemode(unsigned short mode) | |||
168 | } | 168 | } |
169 | |||
170 | int html_include(const char *filename) | ||
171 | { | ||
172 | FILE *f; | ||
173 | char buf[4096]; | ||
174 | size_t len; | ||
175 | |||
176 | if (!(f = fopen(filename, "r"))) | ||
177 | return -1; | ||
178 | while((len = fread(buf, 1, 4096, f)) > 0) | ||
179 | write(htmlfd, buf, len); | ||
180 | fclose(f); | ||
181 | return 0; | ||
182 | } | ||