gitout

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

atom.h (1113B)


      1 #ifndef GITOUT_WRITER_ATOM_ATOM_H_
      2 #define GITOUT_WRITER_ATOM_ATOM_H_
      3 
      4 #include "git/commit.h"
      5 #include "git/repo.h"
      6 
      7 /* Atom RSS output file. */
      8 typedef struct Atom Atom;
      9 
     10 /* Atom RSS feed type. */
     11 typedef enum {
     12   /* Atom RSS feed containing all commits. */
     13   kAtomTypeAll,
     14   /* Atom RSS feed containing only tags. */
     15   kAtomTypeTags,
     16 } AtomType;
     17 
     18 /* Allocate a new Atom RSS output file. */
     19 Atom* atom_create(const GitRepo* repo, AtomType type);
     20 
     21 /* Frees the specified Atom RSS output file. */
     22 void atom_free(Atom* atom);
     23 
     24 /* Sets the base URL for the RSS feed. Example: "https://example.com/git/". */
     25 void atom_set_baseurl(Atom* atom, const char* baseurl);
     26 
     27 /* Writes the Atom RSS header including <feed>, <title>, <subtitle>. */
     28 void atom_begin(Atom* atom);
     29 
     30 /* Writes an RSS <entry> for the commit. */
     31 void atom_add_commit(Atom* atom,
     32                      const GitCommit* commit,
     33                      const char* path,
     34                      const char* content_type,
     35                      const char* tag);
     36 
     37 /* Closes out the Atom <feed>. */
     38 void atom_end(Atom* atom);
     39 
     40 #endif  // GITOUT_WRITER_ATOM_ATOM_H_