]> git.cameronkatri.com Git - cgit.git/blobdiff - html.c
Makefile: add target "get-git"
[cgit.git] / html.c
diff --git a/html.c b/html.c
index 175b4b687efb75d443b847738775a1de92e97cf6..33a956fd5db8140eed9c1a237d3db31337d76918 100644 (file)
--- a/html.c
+++ b/html.c
@@ -166,3 +166,17 @@ void html_filemode(unsigned short mode)
        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;
+}