rpm
5.4.10
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
rpmio
rpmmacro.h
Go to the documentation of this file.
1
#ifndef _H_MACRO_
2
#define _H_MACRO_
3
7
typedef
/*@abstract@*/
struct
MacroEntry_s *
MacroEntry
;
8
typedef
/*@abstract@*/
struct
MacroContext_s *
MacroContext
;
9
10
#if defined(_MACRO_INTERNAL)
11
12
struct
MacroEntry_s {
13
struct
MacroEntry_s *prev;
14
const
char
*
name
;
15
const
char
*opts;
16
const
char
*body;
17
int
used;
18
short
level;
19
unsigned
short
flags;
20
};
21
23
struct
MacroContext_s {
24
/*@owned@*/
/*@null@*/
25
MacroEntry
*macroTable;
26
int
macrosAllocated;
27
int
firstFree;
28
};
29
#endif
30
31
/*@-redecl@*/
32
/*@checked@*/
33
extern
MacroContext
rpmGlobalMacroContext
;
34
35
/*@checked@*/
36
extern
MacroContext
rpmCLIMacroContext
;
37
43
/*@observer@*/
/*@checked@*/
44
extern
const
char
*
rpmMacrofiles
;
45
/*@=redecl@*/
46
50
#define RMIL_DEFAULT -15
51
#define RMIL_MACROFILES -13
52
#define RMIL_RPMRC -11
53
54
#define RMIL_CMDLINE -7
55
#define RMIL_TARBALL -5
56
#define RMIL_SPEC -3
57
#define RMIL_OLDSPEC -1
58
#define RMIL_GLOBAL 0
59
60
#ifdef __cplusplus
61
extern
"C"
{
62
#endif
63
69
void
rpmDumpMacroTable
(
/*@null@*/
MacroContext
mc,
/*@null@*/
FILE * fp)
70
/*@globals rpmGlobalMacroContext, fileSystem @*/
71
/*@modifies *fp, fileSystem @*/
;
72
81
int
82
rpmGetMacroEntries
(
/*@null@*/
MacroContext
mc,
/*@null@*/
void
* _mire,
83
int
used,
/*@null@*/
const
char
*** avp)
84
/*@globals rpmGlobalMacroContext @*/
85
/*@modifies _mire, *avp @*/
;
86
93
int
rpmSecuritySaneFile
(
const
char
*filename)
94
/*@globals internalState @*/
;
95
104
int
rpmGlob
(
const
char
*
patterns
,
/*@out@*/
int
* argcPtr,
105
/*@out@*/
const
char
*** argvPtr)
106
/*@globals fileSystem, internalState @*/
107
/*@modifies *argcPtr, *argvPtr, fileSystem, internalState @*/
;
108
119
int
expandMacros
(
/*@null@*/
void
* spec,
/*@null@*/
MacroContext
mc,
120
/*@in@*/
/*@out@*/
char
* sbuf,
size_t
slen)
121
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
122
/*@modifies *sbuf, rpmGlobalMacroContext, fileSystem, internalState @*/
;
123
133
void
addMacro
(
/*@null@*/
MacroContext
mc,
const
char
* n,
134
/*@null@*/
const
char
* o,
/*@null@*/
const
char
* b,
int
level)
135
/*@globals rpmGlobalMacroContext, internalState @*/
136
/*@modifies mc, rpmGlobalMacroContext, internalState @*/
;
137
143
void
delMacro
(
/*@null@*/
MacroContext
mc,
const
char
* n)
144
/*@globals rpmGlobalMacroContext @*/
145
/*@modifies mc, rpmGlobalMacroContext @*/
;
146
154
int
rpmDefineMacro
(
/*@null@*/
MacroContext
mc,
const
char
* macro,
int
level)
155
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
156
/*@modifies mc, rpmGlobalMacroContext, internalState @*/
;
157
164
int
rpmUndefineMacro
(
/*@null@*/
MacroContext
mc,
const
char
* macro)
165
/*@globals rpmGlobalMacroContext, internalState @*/
166
/*@modifies mc, rpmGlobalMacroContext, internalState @*/
;
167
173
void
rpmLoadMacros
(
/*@null@*/
MacroContext
mc,
int
level)
174
/*@globals rpmGlobalMacroContext, internalState @*/
175
/*@modifies rpmGlobalMacroContext, internalState @*/
;
176
183
int
rpmLoadMacroFile
(
/*@null@*/
MacroContext
mc,
const
char
* fn,
int
nesting)
184
/*@globals rpmGlobalMacroContext,
185
h_errno, fileSystem, internalState @*/
186
/*@modifies mc, rpmGlobalMacroContext, fileSystem, internalState @*/
;
187
193
void
rpmInitMacros
(
/*@null@*/
MacroContext
mc,
const
char
* macrofiles)
194
/*@globals rpmGlobalMacroContext, rpmCLIMacroContext,
195
h_errno, fileSystem, internalState @*/
196
/*@modifies mc, rpmGlobalMacroContext, fileSystem, internalState @*/
;
197
202
void
rpmFreeMacros
(
/*@null@*/
MacroContext
mc)
203
/*@globals rpmGlobalMacroContext @*/
204
/*@modifies mc, rpmGlobalMacroContext @*/
;
205
206
typedef
enum
rpmCompressedMagic_e
{
207
COMPRESSED_NOT
= 0,
208
COMPRESSED_OTHER
= 1,
209
COMPRESSED_BZIP2
= 2,
210
COMPRESSED_ZIP
= 3,
211
COMPRESSED_LZOP
= 4,
212
COMPRESSED_LZMA
= 5,
213
COMPRESSED_XZ
= 6,
214
COMPRESSED_LRZIP
= 7,
215
COMPRESSED_LZIP
= 8,
216
COMPRESSED_7ZIP
= 9
217
}
rpmCompressedMagic
;
218
225
int
isCompressed
(
const
char
*
file
,
/*@out@*/
rpmCompressedMagic
* compressed)
226
/*@globals h_errno, fileSystem, internalState @*/
227
/*@modifies *compressed, fileSystem, internalState @*/
;
228
234
char
*
rpmExpand
(
/*@null@*/
const
char
* arg, ...)
235
#if defined(__GNUC__) && __GNUC__ >= 4
236
/* issue a warning if the list is not NULL-terminated */
237
__attribute__((sentinel))
238
#endif
239
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
240
/*@modifies rpmGlobalMacroContext, internalState @*/
;
241
248
char
*
rpmMCExpand
(
/*@null@*/
MacroContext
mc,
/*@null@*/
const
char
* arg, ...)
249
#if defined(__GNUC__) && __GNUC__ >= 4
250
/* issue a warning if the list is not NULL-terminated */
251
__attribute__((sentinel))
252
#endif
253
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
254
/*@modifies rpmGlobalMacroContext, internalState @*/
;
255
262
/*@null@*/
263
char
*
rpmCleanPath
(
/*@returned@*/
/*@null@*/
char
* path)
264
/*@modifies *path @*/
;
265
272
/*@-redecl@*/
/* LCL: shrug */
273
char
*
rpmGetPath
(
/*@null@*/
const
char
* path, ...)
274
#if defined(__GNUC__) && __GNUC__ >= 4
275
/* issue a warning if the list is not NULL-terminated */
276
__attribute__((sentinel))
277
#endif
278
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
279
/*@modifies rpmGlobalMacroContext, internalState @*/
;
280
/*@=redecl@*/
281
292
/*@-redecl@*/
/* LCL: shrug */
293
const
char
*
rpmGenPath
(
/*@null@*/
const
char
* urlroot,
294
/*@null@*/
const
char
* urlmdir,
295
/*@null@*/
const
char
* urlfile)
296
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
297
/*@modifies rpmGlobalMacroContext, internalState @*/
;
298
/*@=redecl@*/
299
307
int
rpmExpandNumeric
(
const
char
* arg)
308
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
309
/*@modifies rpmGlobalMacroContext, internalState @*/
;
310
311
#ifdef __cplusplus
312
}
313
#endif
314
315
#endif
/* _H_ MACRO_ */
Generated on Mon Nov 5 2012 15:32:20 for rpm by
1.8.1.2