lib/psm.h

Go to the documentation of this file.
00001 #ifndef H_PSM
00002 #define H_PSM
00003 
00009 #include <rpmsq.h>
00010 
00011 /*@-exportlocal@*/
00012 /*@unchecked@*/
00013 extern int _psm_debug;
00014 /*@=exportlocal@*/
00015 
00018 #define PSM_VERBOSE     0x8000
00019 #define PSM_INTERNAL    0x4000
00020 #define PSM_SYSCALL     0x2000
00021 #define PSM_DEAD        0x1000
00022 #define _fv(_a)         ((_a) | PSM_VERBOSE)
00023 #define _fi(_a)         ((_a) | PSM_INTERNAL)
00024 #define _fs(_a)         ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
00025 #define _fd(_a)         ((_a) | (PSM_INTERNAL | PSM_DEAD))
00026 typedef enum pkgStage_e {
00027     PSM_UNKNOWN         =  0,
00028     PSM_INIT            =  1,
00029     PSM_PRE             =  2,
00030     PSM_PROCESS         =  3,
00031     PSM_POST            =  4,
00032     PSM_UNDO            =  5,
00033     PSM_FINI            =  6,
00034 
00035     PSM_PKGINSTALL      =  7,
00036     PSM_PKGERASE        =  8,
00037     PSM_PKGCOMMIT       = 10,
00038     PSM_PKGSAVE         = 12,
00039 
00040     PSM_CREATE          = 17,
00041     PSM_NOTIFY          = 22,
00042     PSM_DESTROY         = 23,
00043     PSM_COMMIT          = 25,
00044 
00045     PSM_CHROOT_IN       = 51,
00046     PSM_CHROOT_OUT      = 52,
00047     PSM_SCRIPT          = 53,
00048     PSM_TRIGGERS        = 54,
00049     PSM_IMMED_TRIGGERS  = 55,
00050     PSM_RPMIO_FLAGS     = 56,
00051 
00052     PSM_RPMDB_LOAD      = 97,
00053     PSM_RPMDB_ADD       = 98,
00054     PSM_RPMDB_REMOVE    = 99
00055 
00056 } pkgStage;
00057 #undef  _fv
00058 #undef  _fi
00059 #undef  _fs
00060 #undef  _fd
00061 
00064 struct rpmpsm_s {
00065     struct rpmsqElem sq;        
00067 /*@refcounted@*/
00068     rpmts ts;                   
00069 /*@dependent@*/ /*@null@*/
00070     rpmte te;                   
00071 /*@refcounted@*/ /*@relnull@*/
00072     rpmfi fi;                   
00073 /*@relnull@*/
00074     FD_t cfd;                   
00075 /*@relnull@*/
00076     FD_t fd;                    
00077     Header oh;                  
00078 /*@null@*/
00079     rpmdbMatchIterator mi;
00080 /*@observer@*/
00081     const char * stepName;
00082 /*@only@*/ /*@null@*/
00083     const char * rpmio_flags;
00084 /*@only@*/ /*@null@*/
00085     const char * failedFile;
00086 /*@only@*/ /*@null@*/
00087     const char * pkgURL;        
00088 /*@dependent@*/
00089     const char * pkgfn;         
00090     int scriptTag;              
00091     int progTag;                
00092     int npkgs_installed;        
00093     int scriptArg;              
00094     int sense;                  
00095     int countCorrection;        
00096     int chrootDone;             
00097     int unorderedSuccessor;     
00098     rpmCallbackType what;       
00099     unsigned long amount;       
00100     unsigned long total;        
00101     rpmRC rc;
00102     pkgStage goal;
00103 /*@unused@*/
00104     pkgStage stage;             
00105     pkgStage nstage;            
00107 /*@refs@*/
00108     int nrefs;                  
00109 };
00110 
00111 #ifdef __cplusplus
00112 extern "C" {
00113 #endif
00114 
00121 /*@unused@*/ /*@null@*/
00122 rpmpsm rpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
00123                 /*@null@*/ const char * msg)
00124         /*@modifies psm @*/;
00125 
00127 /*@-exportlocal@*/
00128 /*@null@*/
00129 rpmpsm XrpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
00130                 /*@null@*/ const char * msg, const char * fn, unsigned ln)
00131         /*@modifies psm @*/;
00132 /*@=exportlocal@*/
00133 #define rpmpsmUnlink(_psm, _msg)        XrpmpsmUnlink(_psm, _msg, __FILE__, __LINE__)
00134 
00141 /*@unused@*/ /*@newref@*/ /*@null@*/
00142 rpmpsm rpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg)
00143         /*@modifies psm @*/;
00144 
00146 /*@-exportlocal@*/
00147 /*@newref@*/ /*@null@*/
00148 rpmpsm XrpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg,
00149                 const char * fn, unsigned ln)
00150         /*@modifies psm @*/;
00151 /*@=exportlocal@*/
00152 #define rpmpsmLink(_psm, _msg)  XrpmpsmLink(_psm, _msg, __FILE__, __LINE__)
00153 
00159 /*@null@*/
00160 rpmpsm rpmpsmFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm)
00161         /*@globals fileSystem @*/
00162         /*@modifies psm, fileSystem @*/;
00163 
00171 /*@null@*/
00172 rpmpsm rpmpsmNew(rpmts ts, /*@null@*/ rpmte te, rpmfi fi)
00173         /*@modifies ts, fi @*/;
00174 
00181 rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
00182         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00183         /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/;
00184 #define rpmpsmUNSAFE    rpmpsmSTAGE
00185 
00186 #ifdef __cplusplus
00187 }
00188 #endif
00189 
00190 #endif  /* H_PSM */

Generated on Fri Oct 12 08:44:53 2007 for rpm by  doxygen 1.5.2