rpm  5.4.15
rpmgit.h
Go to the documentation of this file.
1 #ifndef H_RPMGIT
2 #define H_RPMGIT
3 
10 typedef /*@refcounted@*/ struct rpmgit_s * rpmgit;
11 
14 /*@unchecked@*/
15 extern int _rpmgit_debug;
16 
17 /*@unchecked@*/ /*@relnull@*/
18 extern rpmgit _rpmgitI;
19 
20 /*@unchecked@*/
21 extern const char * _rpmgit_dir; /* XXX GIT_DIR */
22 
23 /*@unchecked@*/
24 extern const char * _rpmgit_tree; /* XXX GIT_WORK_TREE */
25 
26 #if defined(_RPMGIT_INTERNAL)
27 
28 #include <popt.h>
29 #include <argv.h>
30 
31 #if defined(HAVE_GIT2_H)
32 #include <git2.h>
33 #include <git2/branch.h>
34 #include <git2/config.h>
35 #include <git2/errors.h>
36 #endif
37 
40 struct rpmgit_s {
41  struct rpmioItem_s _item;
43  const char * fn;
44  uint32_t flags;
45 
46  poptContext con;
47  ARGV_t av;
48  int ac;
49 
50  const char * repodir;
51  const char * workdir; /* XXX needed? */
52 
53  int is_bare;
54  int core_bare;
55 
56  int core_repositoryformatversion;
57  const char * user_name;
58  const char * user_email;
59 
60  int major;
61  int minor;
62  int rev;
63 
64  uint32_t shared_umask;
66  int state;
67  int hide;
68  int sorting;
70  void * R;
71  void * I;
72  void * T;
73  void * C;
74  void * H;
75  void * S;
77  void * cfg;
78  void * odb;
79  void * walk;
81  void * data;
82  FILE * fp;
83 
84 #ifdef NOTYET
85  const void * Cauthor;
86  const void * Ccmtter;
87  const char * msg;
88  const char * msgenc;
89  time_t tstamp;
90 #endif
91 
92 #define RPMGIT_OID_RAWSZ 20
93 #define RPMGIT_OID_HEXSZ (RPMGIT_OID_RAWSZ * 2)
94 #define RPMGIT_OID_MINPREFIXLEN 4
95  unsigned char oid[RPMGIT_OID_RAWSZ];
96  char str[RPMGIT_OID_HEXSZ + 1];
97 
98 #if defined(__LCLINT__)
99 /*@refs@*/
100  int nrefs;
101 #endif
102 };
103 #endif /* _RPMGIT_INTERNAL */
104 
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108 
114 /*@unused@*/ /*@null@*/
115 rpmgit rpmgitUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgit git)
116  /*@modifies git @*/;
117 #define rpmgitUnlink(_git) \
118  ((rpmgit)rpmioUnlinkPoolItem((rpmioItem)(_git), __FUNCTION__, __FILE__, __LINE__))
119 
125 /*@unused@*/ /*@newref@*/ /*@null@*/
126 rpmgit rpmgitLink (/*@null@*/ rpmgit git)
127  /*@modifies git @*/;
128 #define rpmgitLink(_git) \
129  ((rpmgit)rpmioLinkPoolItem((rpmioItem)(_git), __FUNCTION__, __FILE__, __LINE__))
130 
136 /*@null@*/
137 rpmgit rpmgitFree(/*@killref@*/ /*@null@*/rpmgit git)
138  /*@globals fileSystem @*/
139  /*@modifies git, fileSystem @*/;
140 #define rpmgitFree(_git) \
141  ((rpmgit)rpmioFreePoolItem((rpmioItem)(_git), __FUNCTION__, __FILE__, __LINE__))
142 
150 /*@newref@*/ /*@null@*/
151 rpmgit rpmgitNew(/*@null@*/ char ** argv, uint32_t flags, void * _opts)
152  /*@globals fileSystem, internalState @*/
153  /*@modifies fileSystem, internalState @*/;
154 
162 rpmRC rpmgitRun(rpmgit git, /*@null@*/ const char * str,
163  /*@null@*/ const char ** resultp)
164  /*@globals fileSystem, internalState @*/
165  /*@modifies git, *resultp, fileSystem, internalState @*/;
166 
167 rpmRC rpmgitCmdAdd(int argc, char *argv[])
168  /*@*/;
169 rpmRC rpmgitCmdCommit(int argc, char *argv[])
170  /*@*/;
171 rpmRC rpmgitCmdDiff(int argc, char *argv[])
172  /*@*/;
173 rpmRC rpmgitCmdInit(int argc, char *argv[])
174  /*@*/;
175 rpmRC rpmgitCmdStatus(int argc, char *argv[])
176  /*@*/;
177 
178 
179 void rpmgitPrintOid(const char * msg, const void * _oidp, void * _fp)
180  /*@*/;
181 
182 void rpmgitPrintTime(const char * msg, time_t _Ctime, void * _fp)
183  /*@*/;
184 
185 void rpmgitPrintSig(const char * msg, const void * ___S, void * _fp)
186  /*@*/;
187 
188 void rpmgitPrintIndex(void * ___I, void * _fp)
189  /*@*/;
190 
191 void rpmgitPrintTree(void * ___T, void * _fp)
192  /*@*/;
193 
194 void rpmgitPrintCommit(rpmgit git, void * ___C, void * _fp)
195  /*@*/;
196 
197 void rpmgitPrintTag(rpmgit git, void * _tag, void * _fp)
198  /*@*/;
199 
200 void rpmgitPrintHead(rpmgit git, void * ___H, void * _fp)
201  /*@*/;
202 
203 void rpmgitPrintRepo(rpmgit git, void * ___R, void * _fp)
204  /*@*/;
205 
206 int rpmgitInit(rpmgit git, void * initopts)
207  /*@*/;
208 
209 int rpmgitAddFile(rpmgit git, const char * fn)
210  /*@*/;
211 
212 int rpmgitCommit(rpmgit git, const char * msg)
213  /*@*/;
214 
215 int rpmgitConfig(rpmgit git)
216  /*@*/;
217 
218 const char * rpmgitOid(rpmgit git, const void * _oid)
219  /*@*/;
220 
221 int rpmgitClose(rpmgit git)
222  /*@*/;
223 
224 int rpmgitOpen(rpmgit git, const char * repodir)
225  /*@*/;
226 
227 int rpmgitInfo(rpmgit git);
228 int rpmgitTree(rpmgit git);
229 int rpmgitWalk(rpmgit git);
230 int rpmgitRead(rpmgit git);
231 int rpmgitWrite(rpmgit git);
232 
233 #ifdef __cplusplus
234 }
235 #endif
236 
237 #endif /* H_RPMGIT */
int rpmgitTree(rpmgit git)
Definition: rpmgit.c:730
rpmRC rpmgitRun(rpmgit git, const char *str, const char **resultp)
Execute git string.
Definition: rpmgit.c:2825
void rpmgitPrintOid(const char *msg, const void *_oidp, void *_fp)
struct rpmgit_s * rpmgit
Definition: rpmgit.h:10
int rpmgitClose(rpmgit git)
Definition: rpmgit.c:688
#define rpmgitLink(_git)
Definition: rpmgit.h:128
int rpmgitAddFile(rpmgit git, const char *fn)
Definition: rpmgit.c:505
#define rpmgitFree(_git)
Definition: rpmgit.h:140
int rpmgitWrite(rpmgit git)
Definition: rpmgit.c:877
void rpmgitPrintSig(const char *msg, const void *___S, void *_fp)
int _rpmgit_debug
Definition: rpmgit.c:21
void rpmgitPrintCommit(rpmgit git, void *___C, void *_fp)
void rpmgitPrintTag(rpmgit git, void *_tag, void *_fp)
int rpmgitInit(rpmgit git, void *initopts)
Definition: rpmgit.c:473
void rpmgitPrintRepo(rpmgit git, void *___R, void *_fp)
const char * str
Definition: bson.h:593
void rpmgitPrintTree(void *___T, void *_fp)
rpmRC rpmgitCmdInit(int argc, char *argv[])
Definition: rpmgit.c:1045
rpmgit rpmgitNew(char **argv, uint32_t flags, void *_opts)
Create and load a git wrapper.
Definition: rpmgit.c:2750
rpmRC rpmgitCmdStatus(int argc, char *argv[])
Definition: rpmgit.c:2214
int rpmgitOpen(rpmgit git, const char *repodir)
Definition: rpmgit.c:705
const char const bson_oid_t * oid
Definition: bson.h:757
const char const bson * data
Definition: mongo.h:463
int rpmgitCommit(rpmgit git, const char *msg)
Definition: rpmgit.c:535
#define rpmgitUnlink(_git)
Definition: rpmgit.h:117
void rpmgitPrintIndex(void *___I, void *_fp)
const char * _rpmgit_dir
Definition: rpmgit.c:23
const char * rpmgitOid(rpmgit git, const void *_oid)
Definition: rpmgit.c:675
rpmRC rpmgitCmdAdd(int argc, char *argv[])
Definition: rpmgit.c:1300
int rpmgitInfo(rpmgit git)
Definition: rpmgit.c:789
const char const bson int mongo_write_concern int flags
Definition: mongo.h:485
const char * _rpmgit_tree
Definition: rpmgit.c:25
int rpmgitWalk(rpmgit git)
Definition: rpmgit.c:744
enum rpmRC_e rpmRC
RPM return codes.
int rpmgitRead(rpmgit git)
Definition: rpmgit.c:850
rpmRC rpmgitCmdDiff(int argc, char *argv[])
Definition: rpmgit.c:1653
#define minor(dev)
Definition: system.h:141
rpmgit _rpmgitI
Definition: rpmgit.c:2717
int rpmgitConfig(rpmgit git)
Definition: rpmgit.c:653
ARGstr_t * ARGV_t
Definition: argv.h:12
rpmRC rpmgitCmdCommit(int argc, char *argv[])
Definition: rpmgit.c:1391
void rpmgitPrintHead(rpmgit git, void *___H, void *_fp)
#define major(dev)
Definition: system.h:140
void rpmgitPrintTime(const char *msg, time_t _Ctime, void *_fp)