5 * \file rpmio/rpmiotypes.h
11 typedef enum rpmRC_e
{
12 RPMRC_OK
= 0, /*!< Generic success code */
13 RPMRC_NOTFOUND
= 1, /*!< Generic not found code. */
14 RPMRC_FAIL
= 2, /*!< Generic failure code. */
15 RPMRC_NOTTRUSTED
= 3, /*!< Signature is OK, but key is not trusted. */
16 RPMRC_NOKEY
= 4 /*!< Public key is unavailable. */
20 * Private int typedefs to avoid C99 portability issues.
22 typedef /*@unsignedintegraltype@*/ unsigned char rpmuint8_t
;
23 typedef /*@unsignedintegraltype@*/ unsigned short rpmuint16_t
;
24 typedef /*@unsignedintegraltype@*/ unsigned int rpmuint32_t
;
25 typedef /*@unsignedintegraltype@*/ unsigned long long rpmuint64_t
;
29 typedef /*@signedintegraltype@*/ int rpmint32_t
;
33 typedef /*@refcounted@*/ struct rpmioItem_s
* rpmioItem
;
36 void *use
; /*!< use count -- return to pool when zero */
38 void *pool
; /*!< pool (or NULL if malloc'd) */
39 #if defined(__LCLINT__)
41 int nrefs
; /*!< (unused) keep splint happy */
47 typedef struct rpmioPool_s
* rpmioPool
;
51 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmiob_s
* rpmiob
;
56 extern size_t _rpmiob_chunk
;
60 typedef struct rpmioP_s
{
69 typedef /*@abstract@*/ struct DIGEST_CTX_s
* DIGEST_CTX
;
73 typedef /*@abstract@*/ struct pgpPkt_s
* pgpPkt
;
77 typedef /*@abstract@*/ /*@refcounted@*/ struct pgpDig_s
* pgpDig
;
81 typedef /*@abstract@*/ struct pgpDigParams_s
* pgpDigParams
;
85 typedef rpmuint8_t pgpKeyID_t
[8];
89 typedef rpmuint8_t pgpTime_t
[4];
92 * Bit(s) to control digest and signature verification.
94 typedef enum pgpVSFlags_e
{
96 RPMVSF_NOHDRCHK
= (1 << 0),
97 RPMVSF_NEEDPAYLOAD
= (1 << 1),
98 /* bit(s) 2-7 unused */
99 RPMVSF_NOSHA1HEADER
= (1 << 8),
100 RPMVSF_NOMD5HEADER
= (1 << 9), /* unimplemented */
101 RPMVSF_NODSAHEADER
= (1 << 10),
102 RPMVSF_NORSAHEADER
= (1 << 11),
103 /* bit(s) 12-15 unused */
104 RPMVSF_NOSHA1
= (1 << 16), /* unimplemented */
105 RPMVSF_NOMD5
= (1 << 17),
106 RPMVSF_NODSA
= (1 << 18),
107 RPMVSF_NORSA
= (1 << 19)
108 /* bit(s) 20-31 unused */
111 #define _RPMVSF_NODIGESTS \
112 ( RPMVSF_NOSHA1HEADER | \
113 RPMVSF_NOMD5HEADER | \
117 #define _RPMVSF_NOSIGNATURES \
118 ( RPMVSF_NODSAHEADER | \
119 RPMVSF_NORSAHEADER | \
123 #define _RPMVSF_NOHEADER \
124 ( RPMVSF_NOSHA1HEADER | \
125 RPMVSF_NOMD5HEADER | \
126 RPMVSF_NODSAHEADER | \
129 #define _RPMVSF_NOPAYLOAD \
135 /*@-redef@*/ /* LCL: ??? */
136 typedef /*@abstract@*/ const void * fnpyKey
;
140 * Bit(s) to identify progress callbacks.
142 typedef enum rpmCallbackType_e
{
143 RPMCALLBACK_UNKNOWN
= 0,
144 RPMCALLBACK_INST_PROGRESS
= (1 << 0),
145 RPMCALLBACK_INST_START
= (1 << 1),
146 RPMCALLBACK_INST_OPEN_FILE
= (1 << 2),
147 RPMCALLBACK_INST_CLOSE_FILE
= (1 << 3),
148 RPMCALLBACK_TRANS_PROGRESS
= (1 << 4),
149 RPMCALLBACK_TRANS_START
= (1 << 5),
150 RPMCALLBACK_TRANS_STOP
= (1 << 6),
151 RPMCALLBACK_UNINST_PROGRESS
= (1 << 7),
152 RPMCALLBACK_UNINST_START
= (1 << 8),
153 RPMCALLBACK_UNINST_STOP
= (1 << 9),
154 RPMCALLBACK_REPACKAGE_PROGRESS
= (1 << 10),
155 RPMCALLBACK_REPACKAGE_START
= (1 << 11),
156 RPMCALLBACK_REPACKAGE_STOP
= (1 << 12),
157 RPMCALLBACK_UNPACK_ERROR
= (1 << 13),
158 RPMCALLBACK_CPIO_ERROR
= (1 << 14),
159 RPMCALLBACK_SCRIPT_ERROR
= (1 << 15)
164 typedef void * rpmCallbackData
;
167 * 9.4. Hash Algorithms
170 ID Algorithm Text Name
171 -- --------- ---- ----
174 3 - RIPE-MD/160 "RIPEMD160"
175 4 - Reserved for double-width SHA (experimental)
177 6 - Reserved for TIGER/192 "TIGER192"
178 7 - Reserved for HAVAL (5 pass, 160-bit) "HAVAL-5-160"
179 100 to 110 - Private/Experimental algorithm.
182 * Implementations MUST implement SHA-1. Implementations SHOULD
186 typedef enum pgpHashAlgo_e
{
187 PGPHASHALGO_ERROR
= -1,
188 PGPHASHALGO_NONE
= 0,
189 PGPHASHALGO_MD5
= 1, /*!< MD5 */
190 PGPHASHALGO_SHA1
= 2, /*!< SHA-1 */
191 PGPHASHALGO_RIPEMD160
= 3, /*!< RIPEMD-160 */
192 PGPHASHALGO_MD2
= 5, /*!< MD2 */
193 PGPHASHALGO_TIGER192
= 6, /*!< TIGER-192 */
194 PGPHASHALGO_HAVAL_5_160
= 7, /*!< HAVAL-5-160 */
195 PGPHASHALGO_SHA256
= 8, /*!< SHA-256 */
196 PGPHASHALGO_SHA384
= 9, /*!< SHA-384 */
197 PGPHASHALGO_SHA512
= 10, /*!< SHA-512 */
198 PGPHASHALGO_SHA224
= 11, /*!< SHA-224 */
200 PGPHASHALGO_MD4
= 104, /*!< (private) MD4 */
201 PGPHASHALGO_RIPEMD128
= 105, /*!< (private) RIPEMD-128 */
202 PGPHASHALGO_CRC32
= 106, /*!< (private) CRC-32 */
203 PGPHASHALGO_ADLER32
= 107, /*!< (private) ADLER-32 */
204 PGPHASHALGO_CRC64
= 108, /*!< (private) CRC-64 */
205 PGPHASHALGO_JLU32
= 109, /*!< (private) Jenkins lookup3.c */
207 PGPHASHALGO_RIPEMD256
= 111, /*!< (private) RIPEMD-256 */
208 PGPHASHALGO_RIPEMD320
= 112, /*!< (private) RIPEMD-320 */
209 PGPHASHALGO_SALSA10
= 113, /*!< (private) SALSA-10 */
210 PGPHASHALGO_SALSA20
= 114, /*!< (private) SALSA-20 */
212 PGPHASHALGO_MD6_224
= 128+0,/*!< (private) MD6-224 */
213 PGPHASHALGO_MD6_256
= 128+1,/*!< (private) MD6-256 */
214 PGPHASHALGO_MD6_384
= 128+2,/*!< (private) MD6-384 */
215 PGPHASHALGO_MD6_512
= 128+3,/*!< (private) MD6-512 */
217 PGPHASHALGO_CUBEHASH_224
= 136+0,/*!< (private) CUBEHASH-224 */
218 PGPHASHALGO_CUBEHASH_256
= 136+1,/*!< (private) CUBEHASH-256 */
219 PGPHASHALGO_CUBEHASH_384
= 136+2,/*!< (private) CUBEHASH-384 */
220 PGPHASHALGO_CUBEHASH_512
= 136+3,/*!< (private) CUBEHASH-512 */
222 PGPHASHALGO_KECCAK_224
= 144+0,/*!< (private) KECCAK-224 */
223 PGPHASHALGO_KECCAK_256
= 144+1,/*!< (private) KECCAK-256 */
224 PGPHASHALGO_KECCAK_384
= 144+2,/*!< (private) KECCAK-384 */
225 PGPHASHALGO_KECCAK_512
= 144+3,/*!< (private) KECCAK-384 */
227 PGPHASHALGO_ECHO_224
= 148+0,/*!< (private) ECHO-224 */
228 PGPHASHALGO_ECHO_256
= 148+1,/*!< (private) ECHO-256 */
229 PGPHASHALGO_ECHO_384
= 148+2,/*!< (private) ECHO-384 */
230 PGPHASHALGO_ECHO_512
= 148+3,/*!< (private) ECHO-384 */
232 PGPHASHALGO_EDONR_224
= 152+0,/*!< (private) EDON-R-224 */
233 PGPHASHALGO_EDONR_256
= 152+1,/*!< (private) EDON-R-256 */
234 PGPHASHALGO_EDONR_384
= 152+2,/*!< (private) EDON-R-384 */
235 PGPHASHALGO_EDONR_512
= 152+3,/*!< (private) EDON-R-512 */
237 PGPHASHALGO_FUGUE_224
= 156+0,/*!< (private) FUGUE-224 */
238 PGPHASHALGO_FUGUE_256
= 156+1,/*!< (private) FUGUE-256 */
239 PGPHASHALGO_FUGUE_384
= 156+2,/*!< (private) FUGUE-384 */
240 PGPHASHALGO_FUGUE_512
= 156+3,/*!< (private) FUGUE-512 */
242 PGPHASHALGO_SKEIN_224
= 160+0,/*!< (private) SKEIN-224 */
243 PGPHASHALGO_SKEIN_256
= 160+1,/*!< (private) SKEIN-256 */
244 PGPHASHALGO_SKEIN_384
= 160+2,/*!< (private) SKEIN-384 */
245 PGPHASHALGO_SKEIN_512
= 160+3,/*!< (private) SKEIN-512 */
246 PGPHASHALGO_SKEIN_1024
= 160+4,/*!< (private) SKEIN-1024 */
248 PGPHASHALGO_BMW_224
= 168+0,/*!< (private) BMW-224 */
249 PGPHASHALGO_BMW_256
= 168+1,/*!< (private) BMW-256 */
250 PGPHASHALGO_BMW_384
= 168+2,/*!< (private) BMW-384 */
251 PGPHASHALGO_BMW_512
= 168+3,/*!< (private) BMW-512 */
253 PGPHASHALGO_SHABAL_224
= 176+0,/*!< (private) SHABAL-224 */
254 PGPHASHALGO_SHABAL_256
= 176+1,/*!< (private) SHABAL-256 */
255 PGPHASHALGO_SHABAL_384
= 176+2,/*!< (private) SHABAL-384 */
256 PGPHASHALGO_SHABAL_512
= 176+3,/*!< (private) SHABAL-512 */
258 PGPHASHALGO_SHAVITE3_224
= 180+0,/*!< (private) SHAVITE3-224 */
259 PGPHASHALGO_SHAVITE3_256
= 180+1,/*!< (private) SHAVITE3-256 */
260 PGPHASHALGO_SHAVITE3_384
= 180+2,/*!< (private) SHAVITE3-384 */
261 PGPHASHALGO_SHAVITE3_512
= 180+3,/*!< (private) SHAVITE3-512 */
263 PGPHASHALGO_BLAKE_224
= 184+0,/*!< (private) BLAKE-224 */
264 PGPHASHALGO_BLAKE_256
= 184+1,/*!< (private) BLAKE-256 */
265 PGPHASHALGO_BLAKE_384
= 184+2,/*!< (private) BLAKE-384 */
266 PGPHASHALGO_BLAKE_512
= 184+3,/*!< (private) BLAKE-512 */
268 PGPHASHALGO_TIB3_224
= 192+0,/*!< (private) TIB3-224 */
269 PGPHASHALGO_TIB3_256
= 192+1,/*!< (private) TIB3-256 */
270 PGPHASHALGO_TIB3_384
= 192+2,/*!< (private) TIB3-384 */
271 PGPHASHALGO_TIB3_512
= 192+3,/*!< (private) TIB3-512 */
273 PGPHASHALGO_SIMD_224
= 200+0,/*!< (private) SIMD-224 */
274 PGPHASHALGO_SIMD_256
= 200+1,/*!< (private) SIMD-256 */
275 PGPHASHALGO_SIMD_384
= 200+2,/*!< (private) SIMD-384 */
276 PGPHASHALGO_SIMD_512
= 200+3,/*!< (private) SIMD-512 */
278 PGPHASHALGO_ARIRANG_224
= 208+0,/*!< (private) ARIRANG-224 */
279 PGPHASHALGO_ARIRANG_256
= 208+1,/*!< (private) ARIRANG-256 */
280 PGPHASHALGO_ARIRANG_384
= 208+2,/*!< (private) ARIRANG-384 */
281 PGPHASHALGO_ARIRANG_512
= 208+3,/*!< (private) ARIRANG-512 */
283 PGPHASHALGO_LANE_224
= 212+0,/*!< (private) LANE-224 */
284 PGPHASHALGO_LANE_256
= 212+1,/*!< (private) LANE-256 */
285 PGPHASHALGO_LANE_384
= 212+2,/*!< (private) LANE-384 */
286 PGPHASHALGO_LANE_512
= 212+3,/*!< (private) LANE-512 */
288 PGPHASHALGO_LUFFA_224
= 216+0,/*!< (private) LUFFA-224 */
289 PGPHASHALGO_LUFFA_256
= 216+1,/*!< (private) LUFFA-256 */
290 PGPHASHALGO_LUFFA_384
= 216+2,/*!< (private) LUFFA-384 */
291 PGPHASHALGO_LUFFA_512
= 216+3,/*!< (private) LUFFA-512 */
293 PGPHASHALGO_CHI_224
= 224+0,/*!< (private) CHI-224 */
294 PGPHASHALGO_CHI_256
= 224+1,/*!< (private) CHI-256 */
295 PGPHASHALGO_CHI_384
= 224+2,/*!< (private) CHI-384 */
296 PGPHASHALGO_CHI_512
= 224+3,/*!< (private) CHI-512 */
298 PGPHASHALGO_JH_224
= 232+0,/*!< (private) JH-224 */
299 PGPHASHALGO_JH_256
= 232+1,/*!< (private) JH-256 */
300 PGPHASHALGO_JH_384
= 232+2,/*!< (private) JH-384 */
301 PGPHASHALGO_JH_512
= 232+3,/*!< (private) JH-512 */
303 PGPHASHALGO_GROESTL_224
= 240+0,/*!< (private) GROESTL-224 */
304 PGPHASHALGO_GROESTL_256
= 240+1,/*!< (private) GROESTL-256 */
305 PGPHASHALGO_GROESTL_384
= 240+2,/*!< (private) GROESTL-384 */
306 PGPHASHALGO_GROESTL_512
= 240+3,/*!< (private) GROESTL-512 */
308 PGPHASHALGO_HAMSI_224
= 248+0,/*!< (private) HAMSI-224 */
309 PGPHASHALGO_HAMSI_256
= 248+1,/*!< (private) HAMSI-256 */
310 PGPHASHALGO_HAMSI_384
= 248+2,/*!< (private) HAMSI-384 */
311 PGPHASHALGO_HAMSI_512
= 248+3,/*!< (private) HAMSI-512 */
316 * Bit(s) to control digest operation.
318 typedef enum rpmDigestFlags_e
{
322 #if defined(_RPMIOB_INTERNAL)
326 struct rpmioItem_s _item
; /*!< usage mutex and pool identifier. */
327 rpmuint8_t
* b
; /*!< data octects. */
328 size_t blen
; /*!< no. of octets used. */
329 size_t allocated
; /*!< no. of octets allocated. */
330 #if defined(__LCLINT__)
332 int nrefs
; /*!< (unused) keep splint happy */
342 * Return digest algorithm identifier.
343 * @param ctx digest context
344 * @return digest hash algorithm identifier
346 pgpHashAlgo
rpmDigestAlgo(DIGEST_CTX ctx
)
350 * Return digest flags.
351 * @param ctx digest context
352 * @return digest flags
354 rpmDigestFlags
rpmDigestF(DIGEST_CTX ctx
)
358 * Return digest name.
359 * @param ctx digest context
360 * @return digest name
363 const char * rpmDigestName(DIGEST_CTX ctx
)
367 * Return digest ASN1 oid string.
368 * Values from PKCS#1 v2.1 (aka RFC-3447).
369 * @param ctx digest context
370 * @return digest ASN1 oid string
372 /*@observer@*/ /*@null@*/
373 const char * rpmDigestASN1(DIGEST_CTX ctx
)
377 * Duplicate a digest context.
378 * @param octx existing digest context
379 * @return duplicated digest context
382 DIGEST_CTX
rpmDigestDup(DIGEST_CTX octx
)
387 * Set bit count to 0 and buffer to mysterious initialization constants.
388 * @param hashalgo type of digest
389 * @param flags bit(s) to control digest operation
390 * @return digest context
392 /*@only@*/ /*@null@*/
393 DIGEST_CTX
rpmDigestInit(pgpHashAlgo hashalgo
, rpmDigestFlags flags
)
397 * Update context with next plain text buffer.
398 * @param ctx digest context
399 * @param data next data buffer
400 * @param len no. bytes of data
401 * @return 0 on success
403 int rpmDigestUpdate(/*@null@*/ DIGEST_CTX ctx
, const void * data
, size_t len
)
407 * Return digest and destroy context.
409 * @param ctx digest context
410 * @retval *datap digest
411 * @retval *lenp no. bytes of digest
412 * @param asAscii return digest as ascii string?
413 * @return 0 on success
415 int rpmDigestFinal(/*@only@*/ /*@null@*/ DIGEST_CTX ctx
,
416 /*@null@*/ /*@out@*/ void * datap
,
417 /*@null@*/ /*@out@*/ size_t * lenp
, int asAscii
)
418 /*@modifies *datap, *lenp @*/;
422 * Compute key material and add to digest context.
423 * @param ctx digest context
424 * @param key HMAC key (NULL does digest instead)
425 * @param keylen HMAC key length(bytes) (0 uses strlen(key))
426 * @return 0 on success
428 int rpmHmacInit(DIGEST_CTX ctx
, const void * key
, size_t keylen
)
433 typedef void * (*rpmCallbackFunction
)
434 (/*@null@*/ const void * h
,
435 const rpmCallbackType what
,
436 const rpmuint64_t amount
,
437 const rpmuint64_t total
,
438 /*@null@*/ fnpyKey key
,
439 /*@null@*/ rpmCallbackData data
)
440 /*@globals internalState@*/
441 /*@modifies internalState@*/;
445 * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
446 * @param p memory to free
447 * @return NULL always
449 #if defined(WITH_DMALLOC)
450 #define _free(p) ((p) != NULL ? free((void *)(p)) : (void)0, NULL)
452 /*@unused@*/ static inline /*@null@*/
453 void * _free(/*@only@*/ /*@null@*/ /*@out@*/ const void * p
)
456 if (p
!= NULL
) free((void *)p
);
462 /*@unused@*/ static inline int xislower(int c
) /*@*/ {
463 return (c
>= (int)'a' && c
<= (int)'z');
465 /*@unused@*/ static inline int xisupper(int c
) /*@*/ {
466 return (c
>= (int)'A' && c
<= (int)'Z');
468 /*@unused@*/ static inline int xisalpha(int c
) /*@*/ {
469 return (xislower(c
) || xisupper(c
));
471 /*@unused@*/ static inline int xisdigit(int c
) /*@*/ {
472 return (c
>= (int)'0' && c
<= (int)'9');
474 /*@unused@*/ static inline int xisalnum(int c
) /*@*/ {
475 return (xisalpha(c
) || xisdigit(c
));
477 /*@unused@*/ static inline int xisblank(int c
) /*@*/ {
478 return (c
== (int)' ' || c
== (int)'\t');
480 /*@unused@*/ static inline int xisspace(int c
) /*@*/ {
481 return (xisblank(c
) || c
== (int)'\n' || c
== (int)'\r' || c
== (int)'\f' || c
== (int)'\v');
483 /*@unused@*/ static inline int xiscntrl(int c
) /*@*/ {
484 return (c
< (int)' ');
486 /*@unused@*/ static inline int xisascii(int c
) /*@*/ {
487 return ((c
& 0x80) != 0x80);
489 /*@unused@*/ static inline int xisprint(int c
) /*@*/ {
490 return (c
>= (int)' ' && xisascii(c
));
492 /*@unused@*/ static inline int xisgraph(int c
) /*@*/ {
493 return (c
> (int)' ' && xisascii(c
));
495 /*@unused@*/ static inline int xispunct(int c
) /*@*/ {
496 return (xisgraph(c
) && !xisalnum(c
));
499 /*@unused@*/ static inline int xtolower(int c
) /*@*/ {
500 return ((xisupper(c
)) ? (c
| ('a' - 'A')) : c
);
502 /*@unused@*/ static inline int xtoupper(int c
) /*@*/ {
503 return ((xislower(c
)) ? (c
& ~('a' - 'A')) : c
);
507 * Locale insensitive strcasecmp(3).
509 int xstrcasecmp(const char * s1
, const char * s2
) /*@*/;
512 * Locale insensitive strncasecmp(3).
514 int xstrncasecmp(const char *s1
, const char * s2
, size_t n
) /*@*/;
517 * Force encoding of string.
519 /*@only@*/ /*@null@*/
520 const char * xstrtolocale(/*@only@*/ const char *str
)
521 /*@modifies *str @*/;
524 * Unreference a I/O buffer instance.
525 * @param iob hash table
526 * @return NULL if free'd
528 /*@unused@*/ /*@null@*/
529 rpmiob
rpmiobUnlink (/*@killref@*/ /*@null@*/ rpmiob iob
)
530 /*@globals fileSystem @*/
531 /*@modifies iob, fileSystem @*/;
532 #define rpmiobUnlink(_iob) \
533 ((rpmiob)rpmioUnlinkPoolItem((rpmioItem)(_iob), __FUNCTION__, __FILE__, __LINE__))
536 * Reference a I/O buffer instance.
537 * @param iob I/O buffer
538 * @return new I/O buffer reference
540 /*@unused@*/ /*@newref@*/ /*@null@*/
541 rpmiob
rpmiobLink (/*@null@*/ rpmiob iob
)
542 /*@globals fileSystem @*/
543 /*@modifies iob, fileSystem @*/;
544 #define rpmiobLink(_iob) \
545 ((rpmiob)rpmioLinkPoolItem((rpmioItem)(_iob), __FUNCTION__, __FILE__, __LINE__))
548 * Destroy a I/O buffer instance.
549 * @param iob I/O buffer
550 * @return NULL on last dereference
553 rpmiob
rpmiobFree( /*@killref@*/ rpmiob iob
)
554 /*@globals fileSystem @*/
555 /*@modifies iob, fileSystem @*/;
556 #define rpmiobFree(_iob) \
557 ((rpmiob)rpmioFreePoolItem((rpmioItem)(_iob), __FUNCTION__, __FILE__, __LINE__))
560 * Create an I/O buffer.
561 * @param len no. of octets to allocate
562 * @return new I/O buffer
564 /*@newref@*/ /*@null@*/
565 rpmiob
rpmiobNew(size_t len
)
566 /*@globals fileSystem @*/
567 /*@modifies fileSystem @*/;
570 * Empty an I/O buffer.
571 * @param iob I/O buffer
574 rpmiob
rpmiobEmpty(/*@returned@*/ rpmiob iob
)
578 * Trim trailing white space.
579 * @param iob I/O buffer
582 rpmiob
rpmiobRTrim(/*@returned@*/ rpmiob iob
)
586 * Append string to I/O buffer.
587 * @param iob I/O buffer
589 * @param nl append NL?
592 rpmiob
rpmiobAppend(/*@returned@*/ rpmiob iob
, const char * s
, size_t nl
)
597 * @param iob I/O buffer
598 * @return I/O buffer (as octets)
600 rpmuint8_t
* rpmiobBuf(rpmiob iob
)
604 * Return I/O buffer (as string).
605 * @param iob I/O buffer
606 * @return I/O buffer (as string)
608 char * rpmiobStr(rpmiob iob
)
612 * Return I/O buffer len.
613 * @param iob I/O buffer
614 * @return I/O buffer length
616 size_t rpmiobLen(rpmiob iob
)
619 #if defined(_RPMIOB_INTERNAL)
621 * Read an entire file into a buffer.
622 * @param fn file name to read
623 * @retval *iobp I/O buffer
624 * @return 0 on success
626 int rpmiobSlurp(const char * fn
, rpmiob
* iobp
)
627 /*@globals h_errno, fileSystem, internalState @*/
628 /*@modifies *iobp, fileSystem, internalState @*/;
632 * Destroy a rpmioP object.
633 * @param P parser state
637 rpmioP
rpmioPFree(/*@only@*/ /*@null@*/ rpmioP P
)
641 * Parse next command out of a string incrementally.
642 * @param *Pptr parser state
643 * @param str string to parse
644 * @return RPMRC_OK on success
646 rpmRC
rpmioParse(rpmioP
*Pptr
, const char * str
)
647 /*@modifies *Pptr @*/;
653 #endif /* _H_RPMIOTYPES_ */