2016-08-02 17:00:08 +03:00
|
|
|
/*
|
2016-08-02 20:49:54 +03:00
|
|
|
* git-file.h - Open and read a file from git version control system
|
2016-08-02 17:00:08 +03:00
|
|
|
*
|
|
|
|
* Written 2016 by Werner Almesberger
|
|
|
|
* Copyright 2016 by Werner Almesberger
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GIT_FILE_H
|
|
|
|
#define GIT_FILE_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
2016-08-02 21:36:18 +03:00
|
|
|
/*
|
|
|
|
* future-proofing: if someone wants to add back-ends for other version control
|
|
|
|
* systems, the identifiers will already be there.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define vcs_open vcs_git_open
|
|
|
|
#define vcs_read vcs_git_read
|
|
|
|
#define vcs_close vcs_git_close
|
|
|
|
|
|
|
|
|
|
|
|
struct vcs_git;
|
|
|
|
struct file;
|
|
|
|
|
2016-08-06 07:15:49 +03:00
|
|
|
|
2016-08-05 01:40:29 +03:00
|
|
|
void vcs_git_init(void);
|
|
|
|
|
2016-08-03 01:13:28 +03:00
|
|
|
struct vcs_git *vcs_git_open(const char *revision, const char *name,
|
|
|
|
const struct vcs_git *related);
|
2016-08-06 02:42:42 +03:00
|
|
|
bool vcs_git_read(void *ctx, struct file *file,
|
2016-08-02 21:36:18 +03:00
|
|
|
bool (*parse)(const struct file *file, void *user, const char *line),
|
|
|
|
void *user);
|
|
|
|
void vcs_git_close(void *ctx);
|
2016-08-02 17:00:08 +03:00
|
|
|
|
|
|
|
#endif /* !GIT_FILE_H */
|