X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/ebfeeaedf5bc357170cae971c0f6a1458ff65f65..dce45dbe97531de6806707445da97d3f22285db8:/apt-pkg/edsp.h diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index 210188d03..9e833556a 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -2,35 +2,46 @@ /** Description \file edsp.h {{{ ###################################################################### Set of methods to help writing and reading everything needed for EDSP - with the noteable exception of reading a scenario for conversion into + with the notable exception of reading a scenario for conversion into a Cache as this is handled by edsp interface for listparser and friends ##################################################################### */ /*}}}*/ #ifndef PKGLIB_EDSP_H #define PKGLIB_EDSP_H -#include #include +#include +#include +#include + +#include +#include #include +#ifndef APT_8_CLEANER_HEADERS +#include +#include +#endif + +class pkgDepCache; +class OpProgress; + class EDSP /*{{{*/ { // we could use pkgCache::DepType and ::Priority, but these would be localized strings… static const char * const PrioMap[]; static const char * const DepMap[]; - bool static ReadLine(int const input, std::string &line); - bool static StringToBool(char const *answer, bool const defValue); + APT_HIDDEN bool static ReadLine(int const input, std::string &line); + APT_HIDDEN bool static StringToBool(char const *answer, bool const defValue); - void static WriteScenarioVersion(pkgDepCache &Cache, FILE* output, + APT_HIDDEN void static WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const &Ver); - void static WriteScenarioDependency(pkgDepCache &Cache, FILE* output, - pkgCache::PkgIterator const &Pkg, + APT_HIDDEN void static WriteScenarioDependency(FILE* output, pkgCache::VerIterator const &Ver); - void static WriteScenarioLimitedDependency(pkgDepCache &Cache, FILE* output, - pkgCache::PkgIterator const &Pkg, + APT_HIDDEN void static WriteScenarioLimitedDependency(FILE* output, pkgCache::VerIterator const &Ver, APT::PackageSet const &pkgset); public: @@ -46,13 +57,15 @@ public: * \param upgrade is true if it is an request like apt-get upgrade * \param distUpgrade is true if it is a request like apt-get dist-upgrade * \param autoRemove is true if removal of unneeded packages should be performed + * \param Progress is an instance to report progress to * * \return true if request was composed successfully, otherwise false */ bool static WriteRequest(pkgDepCache &Cache, FILE* output, bool const upgrade = false, bool const distUpgrade = false, - bool const autoRemove = false); + bool const autoRemove = false, + OpProgress *Progress = NULL); /** \brief creates the scenario representing the package universe * @@ -67,10 +80,11 @@ public: * * \param Cache is the known package universe * \param output is written to this "file" + * \param Progress is an instance to report progress to * * \return true if universe was composed successfully, otherwise false */ - bool static WriteScenario(pkgDepCache &Cache, FILE* output); + bool static WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL); /** \brief creates a limited scenario representing the package universe * @@ -83,11 +97,13 @@ public: * \param Cache is the known package universe * \param output is written to this "file" * \param pkgset is a set of packages the universe should be limited to + * \param Progress is an instance to report progress to * * \return true if universe was composed successfully, otherwise false */ bool static WriteLimitedScenario(pkgDepCache &Cache, FILE* output, - APT::PackageSet const &pkgset); + APT::PackageSet const &pkgset, + OpProgress *Progress = NULL); /** \brief waits and acts on the information returned from the solver * @@ -98,10 +114,11 @@ public: * * \param input file descriptor with the response from the solver * \param Cache the solution should be applied on if any + * \param Progress is an instance to report progress to * * \return true if a solution is found and applied correctly, otherwise false */ - bool static ReadResponse(int const input, pkgDepCache &Cache); + bool static ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL); /** \brief search and read the request stanza for action later * @@ -167,13 +184,13 @@ public: * they were unable to calculate a solution for a given task. * Obviously they can't send a solution through, so this * methods deals with formatting an error message correctly - * so that the front-ends can recieve and display it. + * so that the front-ends can receive and display it. * * The first line of the message should be a short description * of the error so it can be used for dialog titles or alike * * \param uuid of this error message - * \param message is free form text to discribe the error + * \param message is free form text to describe the error * \param output the front-end listens for error messages */ bool static WriteError(char const * const uuid, std::string const &message, FILE* output); @@ -188,10 +205,10 @@ public: * \param[out] solver_in will be the stdin of the solver * \param[out] solver_out will be the stdout of the solver * - * \return true if the solver could be started and the pipes - * are set up correctly, otherwise false and the pipes are invalid + * \return PID of the started solver or 0 if failure occurred */ - bool static ExecuteSolver(const char* const solver, int *solver_in, int *solver_out); + pid_t static ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool /*overload*/); + APT_DEPRECATED bool static ExecuteSolver(const char* const solver, int *solver_in, int *solver_out); /** \brief call an external resolver to handle the request * @@ -202,13 +219,14 @@ public: * \param upgrade is true if it is a request like apt-get upgrade * \param distUpgrade is true if it is a request like apt-get dist-upgrade * \param autoRemove is true if unneeded packages should be removed + * \param Progress is an instance to report progress to * * \return true if the solver has successfully solved the problem, * otherwise false */ bool static ResolveExternal(const char* const solver, pkgDepCache &Cache, bool const upgrade, bool const distUpgrade, - bool const autoRemove); + bool const autoRemove, OpProgress *Progress = NULL); }; /*}}}*/ #endif