X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/27da8141d21cfbfc29675510737ee05bdfd4a2b1..5465192b9aeb1ccea778950ccf2d1b7b32f2cd91:/apt-pkg/edsp.h

diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h
index 12b06d143..4f5f500a1 100644
--- a/apt-pkg/edsp.h
+++ b/apt-pkg/edsp.h
@@ -2,15 +2,19 @@
 /** 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 <apt-pkg/pkgcache.h>
 #include <apt-pkg/cacheset.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/macros.h>
+
+#include <stdio.h>
 
 #include <list>
 #include <string>
@@ -23,26 +27,8 @@
 class pkgDepCache;
 class OpProgress;
 
-class EDSP								/*{{{*/
+namespace 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);
-
-	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,
-					    pkgCache::VerIterator const &Ver);
-	void static WriteScenarioLimitedDependency(pkgDepCache &Cache, FILE* output,
-						   pkgCache::PkgIterator const &Pkg,
-						   pkgCache::VerIterator const &Ver,
-						   APT::PackageSet const &pkgset);
-public:
 	/** \brief creates the EDSP request stanza
 	 *
 	 *  In the EDSP protocol the first thing send to the resolver is a stanza
@@ -59,7 +45,7 @@ public:
 	 *
 	 *  \return true if request was composed successfully, otherwise false
 	 */
-	bool static WriteRequest(pkgDepCache &Cache, FILE* output,
+	bool WriteRequest(pkgDepCache &Cache, FILE* output,
 				 bool const upgrade = false,
 				 bool const distUpgrade = false,
 				 bool const autoRemove = false,
@@ -82,7 +68,7 @@ public:
 	 *
 	 *  \return true if universe was composed successfully, otherwise false
 	 */
-	bool static WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL);
+	bool WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL);
 
 	/** \brief creates a limited scenario representing the package universe
 	 *
@@ -99,7 +85,7 @@ public:
 	 *
 	 *  \return true if universe was composed successfully, otherwise false
 	 */
-	bool static WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
+	bool WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
 					 APT::PackageSet const &pkgset,
 					 OpProgress *Progress = NULL);
 
@@ -116,7 +102,7 @@ public:
 	 *
 	 *  \return true if a solution is found and applied correctly, otherwise false
 	 */
-	bool static ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL);
+	bool ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL);
 
 	/** \brief search and read the request stanza for action later
 	 *
@@ -134,7 +120,7 @@ public:
 	 *
 	 *  \return true if the request could be found and worked on, otherwise false
 	 */
-	bool static ReadRequest(int const input, std::list<std::string> &install,
+	bool ReadRequest(int const input, std::list<std::string> &install,
 			std::list<std::string> &remove, bool &upgrade,
 			bool &distUpgrade, bool &autoRemove);
 
@@ -150,7 +136,7 @@ public:
 	 *
 	 *  \return false if the request couldn't be applied, true otherwise
 	 */
-	bool static ApplyRequest(std::list<std::string> const &install,
+	bool ApplyRequest(std::list<std::string> const &install,
 				 std::list<std::string> const &remove,
 				 pkgDepCache &Cache);
 
@@ -166,7 +152,7 @@ public:
 	 *
 	 *  \return true if solution could be written, otherwise false
 	 */
-	bool static WriteSolution(pkgDepCache &Cache, FILE* output);
+	bool WriteSolution(pkgDepCache &Cache, FILE* output);
 
 	/** \brief sends a progress report
 	 *
@@ -174,7 +160,7 @@ public:
 	 *  \param message the solver wants the user to see
 	 *  \param output the front-end listens for progress report
 	 */
-	bool static WriteProgress(unsigned short const percent, const char* const message, FILE* output);
+	bool WriteProgress(unsigned short const percent, const char* const message, FILE* output);
 
 	/** \brief sends an error report
 	 *
@@ -182,16 +168,16 @@ 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);
+	bool WriteError(char const * const uuid, std::string const &message, FILE* output);
 
 
 	/** \brief executes the given solver and returns the pipe ends
@@ -203,10 +189,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 ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool /*overload*/);
+	APT_DEPRECATED bool ExecuteSolver(const char* const solver, int *solver_in, int *solver_out);
 
 	/** \brief call an external resolver to handle the request
 	 *
@@ -222,9 +208,9 @@ public:
 	 *  \return true if the solver has successfully solved the problem,
 	 *  otherwise false
 	 */
-	bool static ResolveExternal(const char* const solver, pkgDepCache &Cache,
+	bool ResolveExternal(const char* const solver, pkgDepCache &Cache,
 				    bool const upgrade, bool const distUpgrade,
 				    bool const autoRemove, OpProgress *Progress = NULL);
-};
+}
 									/*}}}*/
 #endif