blob: 2c10c553a68f54bc75490c862f06194d717b5519 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * The blob page, which reads a blob out of the object database and writes it
 * to the client. A caller either hands the whole response over to the blob's
 * own bytes and headers, or drops a file's contents into a page cgit is already
 * building, as the summary page does for a readme.
 */

#ifndef CGIT_UI_BLOB_H
#define CGIT_UI_BLOB_H

extern int cgit_ref_path_exists(const char *path, const char *ref, int file_only);

/*
 * Write the file at path in head, escaped when html_escape is set. The return
 * is 0 once it is written, -2 when it is past max-blob-size, and -1 when it
 * cannot be found or read.
 */
extern int cgit_print_file(char *path, const char *head, int file_only, int html_escape);

extern void cgit_print_blob(const char *hex, char *path, const char *head, int file_only);

#endif // CGIT_UI_BLOB_H