Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

rpmdb/hdrinline.h

Go to the documentation of this file.
00001 /*@-type@*/ /* FIX: cast to HV_t bogus */
00002 #ifndef H_HDRINLINE
00003 #define H_HDRINLINE
00004 
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif
00012 /*@+voidabstract -nullpass -mustmod -compdef -shadow -predboolothers @*/
00013 
00017 /*@observer@*/ /*@unchecked@*/
00018 extern struct HV_s * hdrVec;
00019 
00022 /*@unused@*/ static inline HV_t h2hv(Header h)
00023         /*@*/
00024 {
00025     /*@-abstract -castexpose -refcounttrans@*/
00026     return ((HV_t)h);
00027     /*@=abstract =castexpose =refcounttrans@*/
00028 }
00029 
00034 /*@unused@*/ static inline
00035 Header headerNew(void)
00036         /*@*/
00037 {
00038     return hdrVec->hdrnew();
00039 }
00040 
00046 /*@unused@*/ static inline
00047 /*@null@*/ Header headerFree( /*@killref@*/ /*@null@*/ Header h)
00048         /*@modifies h @*/
00049 {
00050     /*@-abstract@*/
00051     if (h == NULL) return NULL;
00052     /*@=abstract@*/
00053     return (h2hv(h)->hdrfree) (h);
00054 }
00055 
00061 /*@unused@*/ static inline
00062 Header headerLink(Header h)
00063         /*@modifies h @*/
00064 {
00065     return (h2hv(h)->hdrlink) (h);
00066 }
00067 
00073 /*@unused@*/ static inline
00074 Header headerUnlink(/*@killref@*/ /*@null@*/ Header h)
00075         /*@modifies h @*/
00076 {
00077     /*@-abstract@*/
00078     if (h == NULL) return NULL;
00079     /*@=abstract@*/
00080     return (h2hv(h)->hdrunlink) (h);
00081 }
00082 
00083 /*@-exportlocal@*/
00088 /*@unused@*/ static inline
00089 void headerSort(Header h)
00090         /*@modifies h @*/
00091 {
00092 /*@-noeffectuncon@*/ /* FIX: add rc */
00093     (h2hv(h)->hdrsort) (h);
00094 /*@=noeffectuncon@*/
00095     return;
00096 }
00097 
00102 /*@unused@*/ static inline
00103 void headerUnsort(Header h)
00104         /*@modifies h @*/
00105 {
00106 /*@-noeffectuncon@*/ /* FIX: add rc */
00107     (h2hv(h)->hdrunsort) (h);
00108 /*@=noeffectuncon@*/
00109     return;
00110 }
00111 /*@=exportlocal@*/
00112 
00119 /*@unused@*/ static inline
00120 unsigned int headerSizeof(/*@null@*/ Header h, enum hMagic magicp)
00121         /*@modifies h @*/
00122 {
00123     /*@-abstract@*/
00124     if (h == NULL) return 0;
00125     /*@=abstract@*/
00126     return (h2hv(h)->hdrsizeof) (h, magicp);
00127 }
00128 
00134 /*@unused@*/ static inline
00135 /*@only@*/ /*@null@*/ void * headerUnload(Header h)
00136         /*@modifies h @*/
00137 {
00138     return (h2hv(h)->hdrunload) (h);
00139 }
00140 
00148 /*@unused@*/ static inline
00149 /*@null@*/ Header headerReload(/*@only@*/ Header h, int tag)
00150         /*@modifies h @*/
00151 {
00152     /*@-onlytrans@*/
00153     return (h2hv(h)->hdrreload) (h, tag);
00154     /*@=onlytrans@*/
00155 }
00156 
00162 /*@unused@*/ static inline
00163 /*@null@*/ Header headerCopy(Header h)
00164         /*@modifies h @*/
00165 {
00166     return (h2hv(h)->hdrcopy) (h);
00167 }
00168 
00174 /*@unused@*/ static inline
00175 /*@null@*/ Header headerLoad(/*@kept@*/ void * uh)
00176         /*@modifies uh @*/
00177 {
00178     return hdrVec->hdrload(uh);
00179 }
00180 
00186 /*@unused@*/ static inline
00187 /*@null@*/ Header headerCopyLoad(const void * uh)
00188         /*@*/
00189 {
00190     return hdrVec->hdrcopyload(uh);
00191 }
00192 
00199 /*@unused@*/ static inline
00200 /*@null@*/ Header headerRead(FD_t fd, enum hMagic magicp)
00201         /*@modifies fd @*/
00202 {
00203     return hdrVec->hdrread(fd, magicp);
00204 }
00205 
00213 /*@unused@*/ static inline
00214 int headerWrite(FD_t fd, /*@null@*/ Header h, enum hMagic magicp)
00215         /*@modifies fd, h @*/
00216 {
00217     /*@-abstract@*/
00218     if (h == NULL) return 0;
00219     /*@=abstract@*/
00220     return (h2hv(h)->hdrwrite) (fd, h, magicp);
00221 }
00222 
00229 /*@unused@*/ static inline
00230 int headerIsEntry(/*@null@*/ Header h, int_32 tag)
00231         /*@modifies h @*/
00232 {
00233     /*@-abstract@*/
00234     if (h == NULL) return 0;
00235     /*@=abstract@*/
00236     return (h2hv(h)->hdrisentry) (h, tag);
00237 }
00238 
00246 /*@unused@*/ static inline
00247 /*@null@*/ void * headerFreeTag(Header h,
00248                 /*@only@*/ /*@null@*/ const void * data, rpmTagType type)
00249         /*@modifies data @*/
00250 {
00251     if (h == NULL) return 0;
00252     return (h2hv(h)->hdrfreetag) (h, data, type);
00253 }
00254 
00268 /*@unused@*/ static inline
00269 int headerGetEntry(Header h, int_32 tag,
00270                         /*@null@*/ /*@out@*/ hTYP_t type,
00271                         /*@null@*/ /*@out@*/ void ** p,
00272                         /*@null@*/ /*@out@*/ hCNT_t c)
00273         /*@modifies *type, *p, *c @*/
00274 {
00275     if (h == NULL) return 0;
00276     return (h2hv(h)->hdrget) (h, tag, type, p, c);
00277 }
00278 
00291 /*@unused@*/ static inline
00292 int headerGetEntryMinMemory(Header h, int_32 tag,
00293                         /*@null@*/ /*@out@*/ hTYP_t type,
00294                         /*@null@*/ /*@out@*/ hPTR_t * p, 
00295                         /*@null@*/ /*@out@*/ hCNT_t c)
00296         /*@modifies *type, *p, *c @*/
00297 {
00298     if (h == NULL) return 0;
00299     return (h2hv(h)->hdrgetmin) (h, tag, type, p, c);
00300 }
00301 
00316 /*@mayexit@*/
00317 /*@unused@*/ static inline
00318 int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c)
00319         /*@modifies h @*/
00320 {
00321     return (h2hv(h)->hdradd) (h, tag, type, p, c);
00322 }
00323 
00338 /*@unused@*/ static inline
00339 int headerAppendEntry(Header h, int_32 tag, int_32 type,
00340                 const void * p, int_32 c)
00341         /*@modifies h @*/
00342 {
00343     return (h2hv(h)->hdrappend) (h, tag, type, p, c);
00344 }
00345 
00356 /*@unused@*/ static inline
00357 int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type,
00358                 const void * p, int_32 c)
00359         /*@modifies h @*/
00360 {
00361     return (h2hv(h)->hdraddorappend) (h, tag, type, p, c);
00362 }
00363 
00384 /*@unused@*/ static inline
00385 int headerAddI18NString(Header h, int_32 tag, const char * string,
00386                 const char * lang)
00387         /*@modifies h @*/
00388 {
00389     return (h2hv(h)->hdraddi18n) (h, tag, string, lang);
00390 }
00391 
00402 /*@unused@*/ static inline
00403 int headerModifyEntry(Header h, int_32 tag, int_32 type,
00404                         const void * p, int_32 c)
00405         /*@modifies h @*/
00406 {
00407     return (h2hv(h)->hdrmodify) (h, tag, type, p, c);
00408 }
00409 
00419 /*@unused@*/ static inline
00420 int headerRemoveEntry(Header h, int_32 tag)
00421         /*@modifies h @*/
00422 {
00423     return (h2hv(h)->hdrremove) (h, tag);
00424 }
00425 
00437 /*@unused@*/ static inline
00438 /*@only@*/ char * headerSprintf(Header h, const char * fmt,
00439                      const struct headerTagTableEntry_s * tbltags,
00440                      const struct headerSprintfExtension_s * extensions,
00441                      /*@null@*/ /*@out@*/ errmsg_t * errmsg)
00442         /*@modifies *errmsg @*/
00443 {
00444     return (h2hv(h)->hdrsprintf) (h, fmt, tbltags, extensions, errmsg);
00445 }
00446 
00453 /*@unused@*/ static inline
00454 void headerCopyTags(Header headerFrom, Header headerTo, hTAG_t tagstocopy)
00455         /*@modifies headerFrom, headerTo @*/
00456 {
00457 /*@-noeffectuncon@*/ /* FIX: add rc */
00458     hdrVec->hdrcopytags(headerFrom, headerTo, tagstocopy);
00459 /*@=noeffectuncon@*/
00460     return;
00461 }
00462 
00468 /*@unused@*/ static inline
00469 HeaderIterator headerFreeIterator(/*@only@*/ HeaderIterator hi)
00470         /*@modifies hi @*/
00471 {
00472     return hdrVec->hdrfreeiter(hi);
00473 }
00474 
00480 /*@unused@*/ static inline
00481 HeaderIterator headerInitIterator(Header h)
00482         /*@modifies h */
00483 {
00484     return hdrVec->hdrinititer(h);
00485 }
00486 
00496 /*@unused@*/ static inline
00497 int headerNextIterator(HeaderIterator hi,
00498                 /*@null@*/ /*@out@*/ hTAG_t tag,
00499                 /*@null@*/ /*@out@*/ hTYP_t type,
00500                 /*@null@*/ /*@out@*/ hPTR_t * p,
00501                 /*@null@*/ /*@out@*/ hCNT_t c)
00502         /*@modifies hi, *tag, *type, *p, *c @*/
00503 {
00504     return hdrVec->hdrnextiter(hi, tag, type, p, c);
00505 }
00506 
00512 /*@unused@*/ static inline
00513 /*@observer@*/ /*@null@*/ const char * headerGetOrigin(/*@null@*/ Header h)
00514         /*@*/
00515 {
00516     return hdrVec->hdrgetorigin(h);
00517 }
00518 
00525 /*@unused@*/ static inline
00526 int headerSetOrigin(/*@null@*/ Header h, const char * origin)
00527         /*@modifies h @*/
00528 {
00529     return hdrVec->hdrsetorigin(h, origin);
00530 }
00531 
00537 /*@unused@*/ static inline
00538 int headerGetInstance(/*@null@*/ Header h)
00539         /*@*/
00540 {
00541     return hdrVec->hdrgetinstance(h);
00542 }
00543 
00550 /*@unused@*/ static inline
00551 int headerSetInstance(/*@null@*/ Header h, int instance)
00552         /*@modifies h @*/
00553 {
00554     return hdrVec->hdrsetinstance(h, instance);
00555 }
00556 
00557 /*@=voidabstract =nullpass =mustmod =compdef =shadow =predboolothers @*/
00558 
00559 #ifdef __cplusplus
00560 }
00561 #endif
00562 
00563 #endif  /* H_HDRINLINE */
00564 /*@=type@*/

Generated on Wed Feb 6 22:30:19 2008 for rpm by  doxygen 1.4.4