edsp.h
Go to the documentation of this file.
// -*- mode: cpp; mode: fold -*-
/*}}}*/
#ifndef PKGLIB_EDSP_H
#define PKGLIB_EDSP_H
#include <apt-pkg/cacheset.h>
#include <apt-pkg/macros.h>
#include <apt-pkg/pkgcache.h>
#include <cstdio>
#include <list>
#include <string>
#include <vector>
class pkgDepCache;
class OpProgress;
namespace EDSP /*{{{*/
{
namespace Request
{
enum Flags
{
AUTOREMOVE = (1 << 0),
UPGRADE_ALL = (1 << 1),
FORBID_NEW_INSTALL = (1 << 2),
FORBID_REMOVE = (1 << 3),
};
}
APT_PUBLIC bool WriteRequest(pkgDepCache &Cache, FileFd &output,
unsigned int const flags = 0,
OpProgress *Progress = NULL);
APT_PUBLIC bool WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progress = NULL);
APT_PUBLIC bool WriteLimitedScenario(pkgDepCache &Cache, FileFd &output,
std::vector<bool> const &pkgset,
OpProgress *Progress = NULL);
APT_PUBLIC bool WriteLimitedScenario(pkgDepCache &Cache, FileFd &output,
OpProgress *Progress = NULL);
APT_PUBLIC bool ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL);
APT_PUBLIC bool ReadRequest(int const input, std::list<std::string> &install,
std::list<std::string> &remove, unsigned int &flags);
APT_PUBLIC bool ApplyRequest(std::list<std::string> const &install,
std::list<std::string> const &remove,
pkgDepCache &Cache);
APT_PUBLIC bool WriteSolutionStanza(FileFd &output, char const * const Type, pkgCache::VerIterator const &Ver);
APT_PUBLIC bool WriteProgress(unsigned short const percent, const char* const message, FileFd &output);
APT_PUBLIC bool WriteError(char const * const uuid, std::string const &message, FileFd &output);
APT_PUBLIC pid_t ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool /*overload*/);
APT_PUBLIC bool ResolveExternal(const char* const solver, pkgDepCache &Cache,
unsigned int const flags = 0,
OpProgress *Progress = NULL);
}
/*}}}*/
class pkgPackageManager;
namespace EIPP /*{{{*/
{
namespace Request
{
enum Flags
{
IMMEDIATE_CONFIGURATION_ALL = (1 << 0),
NO_IMMEDIATE_CONFIGURATION = (1 << 1),
ALLOW_TEMPORARY_REMOVE_OF_ESSENTIALS = (1 << 2),
};
}
APT_HIDDEN bool WriteRequest(pkgDepCache &Cache, FileFd &output,
unsigned int const flags, OpProgress * const Progress);
APT_HIDDEN bool WriteScenario(pkgDepCache &Cache, FileFd &output,
OpProgress * const Progress);
APT_HIDDEN bool OrderInstall(char const * const planner, pkgPackageManager * const PM,
unsigned int const version, OpProgress * const Progress);
APT_HIDDEN bool ReadResponse(int const input, pkgPackageManager * const PM,
OpProgress * const Progress);
enum class PKG_ACTION
{
NOOP,
INSTALL,
REINSTALL,
REMOVE
};
APT_PUBLIC bool ReadRequest(int const input,
std::list<std::pair<std::string,PKG_ACTION>> &actions,
unsigned int &flags);
APT_PUBLIC bool ApplyRequest(std::list<std::pair<std::string,PKG_ACTION>> &actions,
pkgDepCache &Cache);
}
/*}}}*/
#endif
cacheset.h
FileFd
Definition fileutl.h:43
OpProgress
Definition progress.h:30
pkgCache::VerIterator
Definition cacheiterators.h:218
pkgDepCache
Definition depcache.h:63
pkgPackageManager
Definition packagemanager.h:49
EDSP::Request::Flags
Flags
Definition edsp.h:31
EDSP::Request::AUTOREMOVE
@ AUTOREMOVE
Definition edsp.h:32
EDSP::Request::FORBID_REMOVE
@ FORBID_REMOVE
Definition edsp.h:35
EIPP::Request::NO_IMMEDIATE_CONFIGURATION
@ NO_IMMEDIATE_CONFIGURATION
Definition edsp.h:239
EIPP::Request::ALLOW_TEMPORARY_REMOVE_OF_ESSENTIALS
@ ALLOW_TEMPORARY_REMOVE_OF_ESSENTIALS
Definition edsp.h:240
EDSP::Request::FORBID_NEW_INSTALL
@ FORBID_NEW_INSTALL
Definition edsp.h:34
EDSP::Request::UPGRADE_ALL
@ UPGRADE_ALL
Definition edsp.h:33
EIPP::Request::IMMEDIATE_CONFIGURATION_ALL
@ IMMEDIATE_CONFIGURATION_ALL
Definition edsp.h:238
pkgcache.h
pkgCache - Structure definitions for the cache file