gout

A static git page generator
git clone https://git.bracken.jp/gout.git
Log | Files | Refs | README | LICENSE

git.h (1312B)


      1 #ifndef GOUT_GIT_GIT_H_
      2 #define GOUT_GIT_GIT_H_
      3 
      4 #include <stddef.h>
      5 
      6 #include "git/commit.h"
      7 #include "git/file.h"
      8 #include "git/reference.h"
      9 #include "git/repo.h"
     10 #include "utils.h"
     11 
     12 typedef struct Git Git;
     13 
     14 typedef void (*RepoCallback)(Git* git, void* user_data);
     15 typedef void (*CommitCallback)(const GitCommit* ci, void* user_data);
     16 typedef void (*ReferenceCallback)(const GitReference* ref, void* user_data);
     17 typedef void (*FileCallback)(const GitFile* file, void* user_data);
     18 
     19 struct Git {
     20   void* impl;
     21   GitRepo* repo;
     22   const FileSystem* fs;
     23 
     24   void (*initialize)(Git* git);
     25   void (*shutdown)(Git* git);
     26 
     27   void (*for_repo)(Git* git,
     28                    const char* path,
     29                    RepoCallback cb,
     30                    void* user_data);
     31   void (*for_each_commit)(const Git* git, CommitCallback cb, void* user_data);
     32   void (*for_commit)(const Git* git,
     33                      const char* spec,
     34                      CommitCallback cb,
     35                      void* user_data);
     36   void (*for_each_reference)(const Git* git,
     37                              ReferenceCallback cb,
     38                              void* user_data);
     39   void (*for_each_file)(const Git* git, FileCallback cb, void* user_data);
     40 };
     41 
     42 Git* gout_git_create(const FileSystem* fs);
     43 void gout_git_free(Git* git);
     44 
     45 #endif  // GOUT_GIT_GIT_H_