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

# lib/psm.h

Go to the documentation of this file.

    00001 #ifndef H_PSM
    00002 #define H_PSM
    00003
    00009 /*@-exportlocal@*/
    00010 /*@unchecked@*/
    00011 extern int _psm_debug;
    00012 /*@=exportlocal@*/
    00013
    00016 #define PSM_VERBOSE     0x8000
    00017 #define PSM_INTERNAL    0x4000
    00018 #define PSM_SYSCALL     0x2000
    00019 #define PSM_DEAD        0x1000
    00020 #define _fv(_a)         ((_a) | PSM_VERBOSE)
    00021 #define _fi(_a)         ((_a) | PSM_INTERNAL)
    00022 #define _fs(_a)         ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
    00023 #define _fd(_a)         ((_a) | (PSM_INTERNAL | PSM_DEAD))
    00024 typedef enum pkgStage_e {
    00025     PSM_UNKNOWN         =  0,
    00026     PSM_INIT            =  1,
    00027     PSM_PRE             =  2,
    00028     PSM_PROCESS         =  3,
    00029     PSM_POST            =  4,
    00030     PSM_UNDO            =  5,
    00031     PSM_FINI            =  6,
    00032
    00033     PSM_PKGINSTALL      =  7,
    00034     PSM_PKGERASE        =  8,
    00035     PSM_PKGCOMMIT       = 10,
    00036     PSM_PKGSAVE         = 12,
    00037
    00038     PSM_CREATE          = 17,
    00039     PSM_NOTIFY          = 22,
    00040     PSM_DESTROY         = 23,
    00041     PSM_COMMIT          = 25,
    00042
    00043     PSM_CHROOT_IN       = 51,
    00044     PSM_CHROOT_OUT      = 52,
    00045     PSM_SCRIPT          = 53,
    00046     PSM_TRIGGERS        = 54,
    00047     PSM_IMMED_TRIGGERS  = 55,
    00048     PSM_RPMIO_FLAGS     = 56,
    00049
    00050     PSM_RPMDB_LOAD      = 97,
    00051     PSM_RPMDB_ADD       = 98,
    00052     PSM_RPMDB_REMOVE    = 99
    00053
    00054 } pkgStage;
    00055 #undef  _fv
    00056 #undef  _fi
    00057 #undef  _fs
    00058 #undef  _fd
    00059
    00062 struct rpmpsm_s {
    00063 /*@refcounted@*/
    00064     rpmts ts;
    00065 /*@dependent@*/ /*@null@*/
    00066     rpmte te;
    00067 /*@refcounted@*/
    00068     rpmfi fi;
    00069     FD_t cfd;
    00070     FD_t fd;
    00071     Header oh;
    00072 /*@null@*/
    00073     rpmdbMatchIterator mi;
    00074 /*@observer@*/
    00075     const char * stepName;
    00076 /*@only@*/ /*@null@*/
    00077     const char * rpmio_flags;
    00078 /*@only@*/ /*@null@*/
    00079     const char * failedFile;
    00080 /*@only@*/ /*@null@*/
    00081     const char * pkgURL;
    00082 /*@dependent@*/
    00083     const char * pkgfn;
    00084     int scriptTag;
    00085     int progTag;
    00086     int npkgs_installed;
    00087     int scriptArg;
    00088     int sense;
    00089     int countCorrection;
    00090     int chrootDone;
    00091     int unorderedSuccessor;
    00092     int reaper;
    00093     pid_t reaped;
    00094     pid_t child;
    00095     int status;
    00096     rpmCallbackType what;
    00097     unsigned long amount;
    00098     unsigned long total;
    00099     rpmRC rc;
    00100     pkgStage goal;
    00101 /*@unused@*/
    00102     pkgStage stage;
    00103
    00104 /*@refs@*/
    00105     int nrefs;
    00106 };
    00107
    00108 #ifdef __cplusplus
    00109 extern "C" {
    00110 #endif
    00111
    00118 /*@unused@*/ /*@null@*/
    00119 rpmpsm rpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
    00120                 /*@null@*/ const char * msg)
    00121         /*@modifies psm @*/;
    00122
    00124 /*@-exportlocal@*/
    00125 /*@null@*/
    00126 rpmpsm XrpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
    00127                 /*@null@*/ const char * msg, const char * fn, unsigned ln)
    00128         /*@modifies psm @*/;
    00129 /*@=exportlocal@*/
    00130 #define rpmpsmUnlink(_psm, _msg)        XrpmpsmUnlink(_psm, _msg, __FILE__, __LINE__)
    00131
    00138 /*@unused@*/ /*@newref@*/
    00139 rpmpsm rpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg)
    00140         /*@modifies psm @*/;
    00141
    00143 /*@-exportlocal@*/
    00144 /*@newref@*/
    00145 rpmpsm XrpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg,
    00146                 const char * fn, unsigned ln)
    00147         /*@modifies psm @*/;
    00148 /*@=exportlocal@*/
    00149 #define rpmpsmLink(_psm, _msg)  XrpmpsmLink(_psm, _msg, __FILE__, __LINE__)
    00150
    00156 /*@null@*/
    00157 rpmpsm rpmpsmFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm)
    00158         /*@globals fileSystem @*/
    00159         /*@modifies psm, fileSystem @*/;
    00160
    00168 rpmpsm rpmpsmNew(rpmts ts, /*@null@*/ rpmte te, rpmfi fi)
    00169         /*@modifies ts, fi @*/;
    00170
    00177 rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
    00178         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00179         /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/;
    00180
    00181 #ifdef __cplusplus
    00182 }
    00183 #endif
    00184
    00185 #endif  /* H_PSM */