00001
00002 #ifndef H_HDRINLINE
00003 #define H_HDRINLINE
00004
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif
00012
00013
00017
00018 extern struct HV_s * hdrVec;
00019
00022 static inline HV_t h2hv(Header h)
00023
00024 {
00025
00026 return ((HV_t)h);
00027
00028 }
00029
00034 static inline
00035 Header headerNew(void)
00036
00037 {
00038 return hdrVec->hdrnew();
00039 }
00040
00046 static inline
00047 Header headerFree( Header h)
00048
00049 {
00050
00051 if (h == NULL) return NULL;
00052
00053 return (h2hv(h)->hdrfree) (h);
00054 }
00055
00061 static inline
00062 Header headerLink(Header h)
00063
00064 {
00065 return (h2hv(h)->hdrlink) (h);
00066 }
00067
00073 static inline
00074 Header headerUnlink( Header h)
00075
00076 {
00077
00078 if (h == NULL) return NULL;
00079
00080 return (h2hv(h)->hdrunlink) (h);
00081 }
00082
00083
00088 static inline
00089 void headerSort(Header h)
00090
00091 {
00092
00093 (h2hv(h)->hdrsort) (h);
00094
00095 return;
00096 }
00097
00102 static inline
00103 void headerUnsort(Header h)
00104
00105 {
00106
00107 (h2hv(h)->hdrunsort) (h);
00108
00109 return;
00110 }
00111
00112
00119 static inline
00120 unsigned int headerSizeof( Header h, enum hMagic magicp)
00121
00122 {
00123
00124 if (h == NULL) return 0;
00125
00126 return (h2hv(h)->hdrsizeof) (h, magicp);
00127 }
00128
00134 static inline
00135 void * headerUnload(Header h)
00136
00137 {
00138 return (h2hv(h)->hdrunload) (h);
00139 }
00140
00148 static inline
00149 Header headerReload( Header h, int tag)
00150
00151 {
00152
00153 return (h2hv(h)->hdrreload) (h, tag);
00154
00155 }
00156
00162 static inline
00163 Header headerCopy(Header h)
00164
00165 {
00166 return (h2hv(h)->hdrcopy) (h);
00167 }
00168
00174 static inline
00175 Header headerLoad( void * uh)
00176
00177 {
00178 return hdrVec->hdrload(uh);
00179 }
00180
00186 static inline
00187 Header headerCopyLoad(const void * uh)
00188
00189 {
00190 return hdrVec->hdrcopyload(uh);
00191 }
00192
00199 static inline
00200 Header headerRead(void * _fd, enum hMagic magicp)
00201
00202 {
00203 return hdrVec->hdrread(_fd, magicp);
00204 }
00205
00213 static inline
00214 int headerWrite(void * _fd, Header h, enum hMagic magicp)
00215
00216 {
00217
00218 if (h == NULL) return 0;
00219
00220 return (h2hv(h)->hdrwrite) (_fd, h, magicp);
00221 }
00222
00229 static inline
00230 int headerIsEntry( Header h, int_32 tag)
00231
00232 {
00233
00234 if (h == NULL) return 0;
00235
00236 return (h2hv(h)->hdrisentry) (h, tag);
00237 }
00238
00246 static inline
00247 void * headerFreeTag(Header h,
00248 const void * data, rpmTagType type)
00249
00250 {
00251 if (h == NULL) return 0;
00252 return (h2hv(h)->hdrfreetag) (h, data, type);
00253 }
00254
00268 static inline
00269 int headerGetEntry(Header h, int_32 tag,
00270 hTYP_t type,
00271 void * p,
00272 hCNT_t c)
00273
00274 {
00275 if (h == NULL) return 0;
00276 return (h2hv(h)->hdrget) (h, tag, type, p, c);
00277 }
00278
00291 static inline
00292 int headerGetEntryMinMemory(Header h, int_32 tag,
00293 hTYP_t type,
00294 void * p,
00295 hCNT_t c)
00296
00297 {
00298 if (h == NULL) return 0;
00299 return (h2hv(h)->hdrgetmin) (h, tag, type, p, c);
00300 }
00301
00316
00317 static inline
00318 int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c)
00319
00320 {
00321 return (h2hv(h)->hdradd) (h, tag, type, p, c);
00322 }
00323
00338 static inline
00339 int headerAppendEntry(Header h, int_32 tag, int_32 type,
00340 const void * p, int_32 c)
00341
00342 {
00343 return (h2hv(h)->hdrappend) (h, tag, type, p, c);
00344 }
00345
00356 static inline
00357 int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type,
00358 const void * p, int_32 c)
00359
00360 {
00361 return (h2hv(h)->hdraddorappend) (h, tag, type, p, c);
00362 }
00363
00384 static inline
00385 int headerAddI18NString(Header h, int_32 tag, const char * string,
00386 const char * lang)
00387
00388 {
00389 return (h2hv(h)->hdraddi18n) (h, tag, string, lang);
00390 }
00391
00402 static inline
00403 int headerModifyEntry(Header h, int_32 tag, int_32 type,
00404 const void * p, int_32 c)
00405
00406 {
00407 return (h2hv(h)->hdrmodify) (h, tag, type, p, c);
00408 }
00409
00419 static inline
00420 int headerRemoveEntry(Header h, int_32 tag)
00421
00422 {
00423 return (h2hv(h)->hdrremove) (h, tag);
00424 }
00425
00437 static inline
00438 char * headerSprintf(Header h, const char * fmt,
00439 const struct headerTagTableEntry_s * tags,
00440 const struct headerSprintfExtension_s * exts,
00441 errmsg_t * errmsg)
00442
00443 {
00444 return (h2hv(h)->hdrsprintf) (h, fmt, tags, exts, errmsg);
00445 }
00446
00453 static inline
00454 void headerCopyTags(Header headerFrom, Header headerTo, hTAG_t tagstocopy)
00455
00456 {
00457
00458 hdrVec->hdrcopytags(headerFrom, headerTo, tagstocopy);
00459
00460 return;
00461 }
00462
00468 static inline
00469 HeaderIterator headerFreeIterator( HeaderIterator hi)
00470
00471 {
00472 return hdrVec->hdrfreeiter(hi);
00473 }
00474
00480 static inline
00481 HeaderIterator headerInitIterator(Header h)
00482
00483 {
00484 return hdrVec->hdrinititer(h);
00485 }
00486
00496 static inline
00497 int headerNextIterator(HeaderIterator hi,
00498 hTAG_t tag,
00499 hTYP_t type,
00500 hPTR_t * p,
00501 hCNT_t c)
00502
00503 {
00504 return hdrVec->hdrnextiter(hi, tag, type, p, c);
00505 }
00506
00512 static inline
00513 const char * headerGetOrigin( Header h)
00514
00515 {
00516 return hdrVec->hdrgetorigin(h);
00517 }
00518
00525 static inline
00526 int headerSetOrigin( Header h, const char * origin)
00527
00528 {
00529 return hdrVec->hdrsetorigin(h, origin);
00530 }
00531
00537
00538 const char * headerGetBaseURL( Header h)
00539 ;
00540
00547 int headerSetBaseURL( Header h, const char * baseurl)
00548 ;
00549
00555 struct stat * headerGetStatbuf( Header h)
00556 ;
00557
00564 int headerSetStatbuf( Header h, struct stat * st)
00565 ;
00566
00572
00573 const char * headerGetDigest( Header h)
00574 ;
00575
00582 int headerSetDigest( Header h, const char * digest)
00583 ;
00584
00590 static inline
00591 int headerGetInstance( Header h)
00592
00593 {
00594 return hdrVec->hdrgetinstance(h);
00595 }
00596
00603 static inline
00604 int headerSetInstance( Header h, int instance)
00605
00606 {
00607 return hdrVec->hdrsetinstance(h, instance);
00608 }
00609
00615 uint32_t headerGetStartOff( Header h)
00616 ;
00617
00624 uint32_t headerSetStartOff( Header h, uint32_t startoff)
00625 ;
00626
00632 uint32_t headerGetEndOff( Header h)
00633 ;
00634
00641 uint32_t headerSetEndOff( Header h, uint32_t endoff)
00642 ;
00643
00651 char * intFormat(HE_t he, const char ** av, const char * fmt)
00652 ;
00653
00654
00655
00656 #ifdef __cplusplus
00657 }
00658 #endif
00659
00660 #endif
00661