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

lib/hdrinline.h

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

Generated on Wed Mar 13 15:34:47 2002 for rpm by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002