00001 #ifndef H_HDRINLINE
00002 #define H_HDRINLINE
00003
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011
00012
00016 extern struct HV_s * hdrVec;
00017
00020 static inline HV_t h2hv(Header h)
00021 {
00022
00023 return ((HV_t)h);
00024
00025 }
00026
00031 static inline
00032 Header headerNew(void)
00033
00034 {
00035 return hdrVec->hdrnew();
00036 }
00037
00043 static inline
00044 Header headerFree( Header h)
00045
00046 {
00047
00048 if (h == NULL) return NULL;
00049
00050 return (h2hv(h)->hdrfree) (h);
00051 }
00052
00058 static inline
00059 Header headerLink(Header h)
00060
00061 {
00062 return (h2hv(h)->hdrlink) (h);
00063 }
00064
00065
00070 static inline
00071 void headerSort(Header h)
00072
00073 {
00074 (h2hv(h)->hdrsort) (h);
00075 return;
00076 }
00077
00082 static inline
00083 void headerUnsort(Header h)
00084
00085 {
00086 (h2hv(h)->hdrunsort) (h);
00087 return;
00088 }
00089
00090
00097 static inline
00098 unsigned int headerSizeof( Header h, enum hMagic magicp)
00099
00100 {
00101
00102 if (h == NULL) return 0;
00103
00104 return (h2hv(h)->hdrsizeof) (h, magicp);
00105 }
00106
00112 static inline
00113 void * headerUnload(Header h)
00114
00115 {
00116 return (h2hv(h)->hdrunload) (h);
00117 }
00118
00126 static inline
00127 Header headerReload( Header h, int tag)
00128
00129 {
00130
00131 return (h2hv(h)->hdrreload) (h, tag);
00132
00133 }
00134
00140 static inline
00141 Header headerCopy(Header h)
00142
00143 {
00144 return (h2hv(h)->hdrcopy) (h);
00145 }
00146
00152 static inline
00153 Header headerLoad( void * uh)
00154
00155 {
00156 return hdrVec->hdrload(uh);
00157 }
00158
00164 static inline
00165 Header headerCopyLoad(const void * uh)
00166
00167 {
00168 return hdrVec->hdrcopyload(uh);
00169 }
00170
00177 static inline
00178 Header headerRead(FD_t fd, enum hMagic magicp)
00179
00180 {
00181 return hdrVec->hdrread(fd, magicp);
00182 }
00183
00191 static inline
00192 int headerWrite(FD_t fd, Header h, enum hMagic magicp)
00193
00194 {
00195
00196 if (h == NULL) return 0;
00197
00198 return (h2hv(h)->hdrwrite) (fd, h, magicp);
00199 }
00200
00207 static inline
00208 int headerIsEntry( Header h, int_32 tag)
00209
00210 {
00211
00212 if (h == NULL) return 0;
00213
00214 return (h2hv(h)->hdrisentry) (h, tag);
00215 }
00216
00224 static inline
00225 void * headerFreeTag(Header h,
00226 const void * data, rpmTagType type)
00227
00228 {
00229 return (h2hv(h)->hdrfreetag) (h, data, type);
00230 }
00231
00245 static inline
00246 int headerGetEntry(Header h, int_32 tag,
00247 hTYP_t type,
00248 void ** p,
00249 hCNT_t c)
00250
00251 {
00252 return (h2hv(h)->hdrget) (h, tag, type, p, c);
00253 }
00254
00267 static inline
00268 int headerGetEntryMinMemory(Header h, int_32 tag,
00269 hTYP_t type,
00270 hPTR_t * p,
00271 hCNT_t c)
00272
00273 {
00274 return (h2hv(h)->hdrgetmin) (h, tag, type, p, c);
00275 }
00276
00291
00292 static inline
00293 int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c)
00294
00295 {
00296 return (h2hv(h)->hdradd) (h, tag, type, p, c);
00297 }
00298
00313 static inline
00314 int headerAppendEntry(Header h, int_32 tag, int_32 type,
00315 const void * p, int_32 c)
00316
00317 {
00318 return (h2hv(h)->hdrappend) (h, tag, type, p, c);
00319 }
00320
00331 static inline
00332 int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type,
00333 const void * p, int_32 c)
00334
00335 {
00336 return (h2hv(h)->hdraddorappend) (h, tag, type, p, c);
00337 }
00338
00359 static inline
00360 int headerAddI18NString(Header h, int_32 tag, const char * string,
00361 const char * lang)
00362
00363 {
00364 return (h2hv(h)->hdraddi18n) (h, tag, string, lang);
00365 }
00366
00377 static inline
00378 int headerModifyEntry(Header h, int_32 tag, int_32 type,
00379 const void * p, int_32 c)
00380
00381 {
00382 return (h2hv(h)->hdrmodify) (h, tag, type, p, c);
00383 }
00384
00394 static inline
00395 int headerRemoveEntry(Header h, int_32 tag)
00396
00397 {
00398 return (h2hv(h)->hdrremove) (h, tag);
00399 }
00400
00412 static inline
00413 char * headerSprintf(Header h, const char * fmt,
00414 const struct headerTagTableEntry_s * tags,
00415 const struct headerSprintfExtension_s * extensions,
00416 errmsg_t * errmsg)
00417
00418 {
00419 return (h2hv(h)->hdrsprintf) (h, fmt, tags, extensions, errmsg);
00420 }
00421
00428 static inline
00429 void headerCopyTags(Header headerFrom, Header headerTo, hTAG_t tagstocopy)
00430
00431 {
00432 hdrVec->hdrcopytags(headerFrom, headerTo, tagstocopy);
00433 return;
00434 }
00435
00441 static inline
00442 HeaderIterator headerFreeIterator( HeaderIterator hi)
00443
00444 {
00445 return hdrVec->hdrfreeiter(hi);
00446 }
00447
00453 static inline
00454 HeaderIterator headerInitIterator(Header h)
00455
00456 {
00457 return hdrVec->hdrinititer(h);
00458 }
00459
00469 static inline
00470 int headerNextIterator(HeaderIterator hi,
00471 hTAG_t tag,
00472 hTYP_t type,
00473 hPTR_t * p,
00474 hCNT_t c)
00475
00476 {
00477 return hdrVec->hdrnextiter(hi, tag, type, p, c);
00478 }
00479
00480
00481
00482 #ifdef __cplusplus
00483 }
00484 #endif
00485
00486 #endif