Root/eeshow/file/git-file.h

1/*
2 * file/git-file.h - Open and read a file from git version control system
3 *
4 * Written 2016 by Werner Almesberger
5 * Copyright 2016 by Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef FILE_GIT_FILE_H
14#define FILE_GIT_FILE_H
15
16#include <stdbool.h>
17
18
19/*
20 * future-proofing: if someone wants to add back-ends for other version control
21 * systems, the identifiers will already be there.
22 */
23
24#define vcs_open vcs_git_open
25#define vcs_read vcs_git_read
26#define vcs_close vcs_git_close
27
28
29struct vcs_git;
30struct file;
31
32
33void vcs_git_init(void);
34
35void *vcs_git_get_oid(const void *ctx); /* mallocs */
36bool vcs_git_oid_eq(const void *a, const void *b);
37
38struct vcs_git *vcs_git_open(const char *revision, const char *name,
39    const struct vcs_git *related);
40bool vcs_git_read(void *ctx, struct file *file,
41    bool (*parse)(const struct file *file, void *user, const char *line),
42    void *user);
43void vcs_git_close(void *ctx);
44
45#endif /* !FILE_GIT_FILE_H */
46

Archive Download this file

Branches:
master



interactive