-rw-r--r-- | html.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -161,8 +161,22 @@ void html_filemode(unsigned short mode) else if (S_ISDIRLNK(mode)) html("m"); else html("-"); html_fileperm(mode >> 6); html_fileperm(mode >> 3); html_fileperm(mode); } + +int html_include(const char *filename) +{ + FILE *f; + char buf[4096]; + size_t len; + + if (!(f = fopen(filename, "r"))) + return -1; + while((len = fread(buf, 1, 4096, f)) > 0) + write(htmlfd, buf, len); + fclose(f); + return 0; +} |