rpm  5.4.15
rpmaug.h
Go to the documentation of this file.
1 #ifndef H_RPMAUG
2 #define H_RPMAUG
3 
8 #include <rpmiotypes.h>
9 #include <rpmio.h>
10 #include <popt.h>
11 
14 typedef /*@refcounted@*/ struct rpmaug_s * rpmaug;
15 
18 /*@unchecked@*/
19 extern int _rpmaug_debug;
20 
21 /*@unchecked@*/ /*@relnull@*/
22 extern rpmaug _rpmaugI;
23 
24 /*@unchecked@*/ /*@relnull@*/
25 extern const char *_rpmaugRoot;
26 /*@unchecked@*/ /*@relnull@*/
27 extern const char *_rpmaugLoadpath;
28 /*@unchecked@*/
29 extern unsigned int _rpmaugFlags;
30 
31 #if defined(_RPMAUG_INTERNAL)
32 
34 struct rpmaug_s {
35  struct rpmioItem_s _item;
36  const char * root;
37  const char * loadpath;
38  unsigned int flags;
39 /*@relnull@*/
40  void * I; /* XXX struct augeas * */
41  rpmiob iob;
42 #if defined(__LCLINT__)
43 /*@refs@*/
44  int nrefs;
45 #endif
46 };
47 
48 /*@unchecked@*/ /*@observer@*/
49 extern const struct poptOption _rpmaugCommandTable[];
50 
51 #endif /* _RPMAUG_INTERNAL */
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
60 /*@unchecked@*/ /*@observer@*/
61 extern struct poptOption rpmaugPoptTable[];
62 
68 /*@unused@*/ /*@null@*/
69 rpmaug rpmaugUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmaug aug)
70  /*@modifies aug @*/;
71 #define rpmaugUnlink(_aug) \
72  ((rpmaug)rpmioUnlinkPoolItem((rpmioItem)(_aug), __FUNCTION__, __FILE__, __LINE__))
73 
79 /*@unused@*/ /*@newref@*/ /*@null@*/
80 rpmaug rpmaugLink (/*@null@*/ rpmaug aug)
81  /*@modifies aug @*/;
82 #define rpmaugLink(_aug) \
83  ((rpmaug)rpmioLinkPoolItem((rpmioItem)(_aug), __FUNCTION__, __FILE__, __LINE__))
84 
90 /*@null@*/
91 rpmaug rpmaugFree(/*@killref@*/ /*@null@*/rpmaug aug)
92  /*@globals fileSystem @*/
93  /*@modifies aug, fileSystem @*/;
94 #define rpmaugFree(_aug) \
95  ((rpmaug)rpmioFreePoolItem((rpmioItem)(_aug), __FUNCTION__, __FILE__, __LINE__))
96 
105 /*@newref@*/ /*@null@*/
106 rpmaug rpmaugNew(/*@null@*/ const char * root, /*@null@*/ const char * loadpath,
107  unsigned int flags)
108  /*@globals fileSystem, internalState @*/
109  /*@modifies fileSystem, internalState @*/;
110 
118 int rpmaugDefvar(/*@null@*/ rpmaug aug, const char * name, const char * expr)
119  /*@modifies aug @*/;
120 
130 int rpmaugDefnode(/*@null@*/ rpmaug aug, const char * name, const char * expr,
131  const char * value, /*@out@*/ /*@null@*/ int * created)
132  /*@modifies aug, *created @*/;
133 
141 int rpmaugGet(/*@null@*/ rpmaug aug, const char * path,
142  /*@out@*/ /*@null@*/ const char ** value)
143  /*@modifies aug, *value @*/;
144 
152 int rpmaugSet(/*@null@*/ rpmaug aug, const char * path, const char * value)
153  /*@modifies aug @*/;
154 
163 int rpmaugInsert(/*@null@*/ rpmaug aug, const char * path, const char * label,
164  int before)
165  /*@modifies aug @*/;
166 
173 int rpmaugRm(/*@null@*/ rpmaug aug, const char * path)
174  /*@modifies aug @*/;
175 
183 int rpmaugMv(/*@null@*/ rpmaug aug, const char * src, const char * dst)
184  /*@modifies aug @*/;
185 
193 int rpmaugMatch(/*@null@*/ rpmaug aug, const char * path,
194  /*@out@*/ /*@null@*/ char *** matches)
195  /*@modifies aug, *matches @*/;
196 
202 int rpmaugSave(/*@null@*/ rpmaug aug)
203  /*@modifies aug @*/;
204 
210 int rpmaugLoad(/*@null@*/ rpmaug aug)
211  /*@modifies aug @*/;
212 
220 int rpmaugPrint(/*@null@*/ rpmaug aug, /*@null@*/ FILE * out, const char * path)
221  /*@modifies aug, *out @*/;
222 
228 void rpmaugFprintf(rpmaug aug, const char *fmt, ...)
229  /*@modifies aug @*/;
230 
238 rpmRC rpmaugRun(rpmaug aug, const char * str, const char ** resultp)
239  /*@modifies aug, *resultp @*/;
240 
241 #ifdef __cplusplus
242 }
243 #endif
244 
245 #endif /* H_RPMAUG */
struct poptOption rpmaugPoptTable[]
Popt option table for options to configure Augeas augtool.
Definition: rpmaug.c:109
rpmaug _rpmaugI
Definition: rpmaug.c:36
int rpmaugRm(rpmaug aug, const char *path)
Remove node and associated sub-tree.
Definition: rpmaug.c:236
const char * _rpmaugRoot
Definition: rpmaug.c:76
const char * str
Definition: bson.h:593
void rpmaugFprintf(rpmaug aug, const char *fmt,...)
Append augeas output to an iob.
Definition: rpmaug.c:322
rpmaug rpmaugNew(const char *root, const char *loadpath, unsigned int flags)
Create and load a augeas wrapper.
Definition: rpmaug.c:132
struct rpmaug_s * rpmaug
Definition: rpmaug.h:14
const char * _rpmaugLoadpath
Definition: rpmaug.c:79
#define rpmaugFree(_aug)
Definition: rpmaug.h:94
const struct poptOption _rpmaugCommandTable[]
Definition: rpmaug.c:683
#define rpmaugUnlink(_aug)
Definition: rpmaug.h:71
unsigned int _rpmaugFlags
Definition: rpmaug.c:80
#define rpmaugLink(_aug)
Definition: rpmaug.h:82
const char const bson int mongo_write_concern int flags
Definition: mongo.h:485
int rpmaugLoad(rpmaug aug)
Load files/lenses from disk.
Definition: rpmaug.c:292
int rpmaugInsert(rpmaug aug, const char *path, const char *label, int before)
Insert new sibling node before/after a given node.
Definition: rpmaug.c:222
enum rpmRC_e rpmRC
RPM return codes.
int rpmaugDefvar(rpmaug aug, const char *name, const char *expr)
Define an augeas variable.
Definition: rpmaug.c:165
const char const bson const bson bson * out
Definition: mongo.h:678
int _rpmaug_debug
Definition: rpmaug.c:33
struct rpmiob_s * rpmiob
Definition: rpmiotypes.h:60
int rpmaugPrint(rpmaug aug, FILE *out, const char *path)
Print node paths that match an expression.
Definition: rpmaug.c:306
int rpmaugMatch(rpmaug aug, const char *path, char ***matches)
Return path(s) in tree that match an expression.
Definition: rpmaug.c:264
static const char * name
int rpmaugMv(rpmaug aug, const char *src, const char *dst)
Move src node to dst node.
Definition: rpmaug.c:250
rpmRC rpmaugRun(rpmaug aug, const char *str, const char **resultp)
Run augeas commands from a buffer.
Definition: rpmaug.c:763
int rpmaugSet(rpmaug aug, const char *path, const char *value)
Set the value associated with a path.
Definition: rpmaug.c:208
int rpmaugDefnode(rpmaug aug, const char *name, const char *expr, const char *value, int *created)
Define an augeas node.
Definition: rpmaug.c:179
int rpmaugGet(rpmaug aug, const char *path, const char **value)
Get the value associated with a path.
Definition: rpmaug.c:194
int rpmaugSave(rpmaug aug)
Save changed files to disk, appending .augnew or .augsave as requested.
Definition: rpmaug.c:278