diff options
| author | Lars Hjemli <hjemli@gmail.com> | 2007-05-20 14:33:59 +0200 | 
|---|---|---|
| committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-20 14:33:59 +0200 | 
| commit | 977a0b173df6fe1a4d362fe4c70f9badff1fd46c (patch) | |
| tree | 8bd383fff396bb1790c03ab5b461d899af997568 /html.c | |
| parent | Use git-1.5.2 (diff) | |
| parent | Teach cgit howto include an external file on index page. (diff) | |
| download | cgit-977a0b173df6fe1a4d362fe4c70f9badff1fd46c.tar.gz cgit-977a0b173df6fe1a4d362fe4c70f9badff1fd46c.tar.bz2 cgit-977a0b173df6fe1a4d362fe4c70f9badff1fd46c.zip | |
Merge branch 'index-header'
* index-header:
  Teach cgit howto include an external file on index page.
  Add html_include()
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 14 | 
1 files changed, 14 insertions, 0 deletions
| @@ -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; +} | 
