rpm  5.4.15
rpmsm.h
Go to the documentation of this file.
1 #ifndef H_RPMSM
2 #define H_RPMSM
3 
8 #include <rpmiotypes.h>
9 #include <rpmio.h>
10 
11 typedef /*@refcounted@*/ struct rpmsm_s * rpmsm;
12 
13 /*@unchecked@*/
14 extern int _rpmsm_debug;
15 
16 /*@unchecked@*/ /*@relnull@*/
17 extern rpmsm _rpmsmI;
18 
24  RPMSM_FLAGS_BASE = (1 << 1), /* -b,--base ... */
25  RPMSM_FLAGS_INSTALL = (1 << 2), /* -i,--install ... */
26  RPMSM_FLAGS_LIST = (1 << 3), /* -l,--list-modules ... */
27  RPMSM_FLAGS_REMOVE = (1 << 4), /* -r,--remove ... */
28  RPMSM_FLAGS_UPGRADE = (1 << 5), /* -u,--upgrade ... */
29  RPMSM_FLAGS_RELOAD = (1 << 6), /* -R,--reload ... */
30  RPMSM_FLAGS_REBUILD = (1 << 7), /* -B,--build ... */
31  RPMSM_FLAGS_NOAUDIT = (1 << 8), /* -D,--disable_dontaudit ... */
32  RPMSM_FLAGS_COMMIT = (1 << 9),
33  RPMSM_FLAGS_CREATE = (1 << 10),
34  RPMSM_FLAGS_CONNECT = (1 << 11),
35  RPMSM_FLAGS_SELECT = (1 << 12),
36  RPMSM_FLAGS_ACCESS = (1 << 13),
37  RPMSM_FLAGS_BEGIN = (1 << 14),
38 };
39 
40 #if defined(_RPMSM_INTERNAL)
41 
43 struct rpmsm_s {
44  struct rpmioItem_s _item;
45  char * fn;
46  unsigned int flags;
47  unsigned int state;
48  unsigned int access;
49  const char ** av;
50  void * I;
51  rpmiob iob;
52 #if defined(__LCLINT__)
53 /*@refs@*/
54  int nrefs;
55 #endif
56 };
57 #endif /* _RPMSM_INTERNAL */
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
68 /*@unused@*/ /*@null@*/
69 rpmsm rpmsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmsm sm)
70  /*@modifies sm @*/;
71 #define rpmsmUnlink(_sm) \
72  ((rpmsm)rpmioUnlinkPoolItem((rpmioItem)(_sm), __FUNCTION__, __FILE__, __LINE__))
73 
79 /*@unused@*/ /*@newref@*/ /*@null@*/
80 rpmsm rpmsmLink (/*@null@*/ rpmsm sm)
81  /*@modifies sm @*/;
82 #define rpmsmLink(_sm) \
83  ((rpmsm)rpmioLinkPoolItem((rpmioItem)(_sm), __FUNCTION__, __FILE__, __LINE__))
84 
90 /*@null@*/
91 rpmsm rpmsmFree(/*@killref@*/ /*@null@*/rpmsm sm)
92  /*@globals fileSystem @*/
93  /*@modifies sm, fileSystem @*/;
94 #define rpmsmFree(_sm) \
95  ((rpmsm)rpmioFreePoolItem((rpmioItem)(_sm), __FUNCTION__, __FILE__, __LINE__))
96 
103 /*@newref@*/ /*@null@*/
104 rpmsm rpmsmNew(/*@null@*/ const char * fn, unsigned int flags)
105  /*@globals fileSystem, internalState @*/
106  /*@modifies fileSystem, internalState @*/;
107 
108 
119 rpmRC rpmsmRun(rpmsm sm, char ** av, /*@out@*/ const char ** resultp)
120  /*@globals fileSystem, internalState @*/
121  /*@modifies sm, *resultp, fileSystem, internalState @*/;
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif /* H_RPMSM */
#define rpmsmFree(_sm)
Definition: rpmsm.h:94
rpmsm _rpmsmI
Definition: rpmsm.c:24
int _rpmsm_debug
Definition: rpmsm.c:21
struct rpmsm_s * rpmsm
Definition: rpmsm.h:11
rpmsm rpmsmNew(const char *fn, unsigned int flags)
Create and load a semanage wrapper.
Definition: rpmsm.c:343
rpmsmFlags_e
Bit field enum for semamange/semodule flags.
Definition: rpmsm.h:22
const char const bson int mongo_write_concern int flags
Definition: mongo.h:485
#define rpmsmLink(_sm)
Definition: rpmsm.h:82
enum rpmRC_e rpmRC
RPM return codes.
struct rpmiob_s * rpmiob
Definition: rpmiotypes.h:60
rpmRC rpmsmRun(rpmsm sm, char **av, const char **resultp)
Run semanage commands.
Definition: rpmsm.c:400
#define rpmsmUnlink(_sm)
Definition: rpmsm.h:71