From e16f1783346a090e4ea1194dcaae7f03e813f6a2 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Tue, 18 Aug 2009 17:17:41 +0200 Subject: Add and use a common readfile() function This function is used to read the full content of a textfile into a newly allocated buffer (with zerotermination). It replaces the earlier readfile() in scan-tree.c (which was rather error-prone[1]), and is reused by read_agefile() in ui-repolist.c. 1: No checks for EINTR and EAGAIN, fixed-size buffer Signed-off-by: Lars Hjemli --- cgit.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index d90ccdc..adb8da4 100644 --- a/cgit.h +++ b/cgit.h @@ -283,5 +283,6 @@ extern int cgit_parse_snapshots_mask(const char *str); extern int cgit_open_filter(struct cgit_filter *filter); extern int cgit_close_filter(struct cgit_filter *filter); +extern int readfile(const char *path, char **buf, size_t *size); #endif /* CGIT_H */ -- cgit v1.2.1