filter: implement loading of filter presets from git repositories

This is mostly copy and paste of other git loading code. Sadly,
it adds a lot of state to the parser-state. I wish we could pass
different parser states to the parser_* functions.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-06-20 18:15:50 +02:00 committed by Dirk Hohndel
parent 3bfd448b59
commit 1fcf4f891d
4 changed files with 150 additions and 4 deletions

View file

@ -3,6 +3,7 @@
#define GITACCESS_H
#include "git2.h"
#include "filterpreset.h"
#ifdef __cplusplus
extern "C" {
@ -19,7 +20,8 @@ extern struct git_repository *is_git_repository(const char *filename, const char
extern int check_git_sha(const char *filename, git_repository **git_p, const char **branch_p);
extern int sync_with_remote(struct git_repository *repo, const char *remote, const char *branch, enum remote_transport rt);
extern int git_save_dives(struct git_repository *, const char *, const char *remote, bool select_only);
extern int git_load_dives(struct git_repository *repo, const char *branch, struct dive_table *table, struct trip_table *trips, struct dive_site_table *sites);
extern int git_load_dives(struct git_repository *repo, const char *branch, struct dive_table *table, struct trip_table *trips,
struct dive_site_table *sites, filter_preset_table_t *filter_presets);
extern const char *get_sha(git_repository *repo, const char *branch);
extern int do_git_save(git_repository *repo, const char *branch, const char *remote, bool select_only, bool create_empty);
extern const char *saved_git_id;