![]() |
![]() |
![]() |
APT2 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <apt.h> #define APT_CACHE_ERROR enum AptCacheError; AptCache; AptCache * apt_cache_new (const gchar *filename
,GError **error
); gint32 apt_cache_get_format_version (AptCache *cache
); const gchar * apt_cache_get_system_name (AptCache *cache
); gboolean apt_cache_is_up_to_date (AptCache *cache
); AptCache * apt_cache_ref (AptCache *cache
); void apt_cache_unref (AptCache *cache
); gsize apt_cache_n_packages (AptCache *cache
); gsize apt_cache_n_indexes (AptCache *cache
); AptPackage * apt_cache_get_package (AptCache *cache
,gsize id
); AptIndex * apt_cache_get_index (AptCache *cache
,guint8 id
); AptPackageIter * apt_cache_iterator (AptCache *cache
); enum AptCacheFindFlags; AptPackageIter * apt_cache_find (AptCache *cache
,const gchar *name
,AptCacheFindFlags flags
); enum AptSelectionState; enum AptCurrentState; enum AptPackageFlags; enum AptMultiArch; const gchar * apt_multi_arch_to_string (AptMultiArch multi_arch
); enum AptPriority; const gchar * apt_priority_to_string (AptPriority priority
); AptPackage; void apt_package_unref (AptPackage *package
); AptPackage * apt_package_ref (AptPackage *package
); guint32 apt_package_get_id (AptPackage *package
); const gchar * apt_package_get_name (AptPackage *package
); const gchar * apt_package_get_version (AptPackage *package
); const gchar * apt_package_get_architecture (AptPackage *package
); AptMultiArch apt_package_get_multi_arch (AptPackage *package
); goffset apt_package_get_size (AptPackage *package
); goffset apt_package_get_installed_size (AptPackage *package
); const gchar * apt_package_get_checksum (AptPackage *package
); AptPriority apt_package_get_priority (AptPackage *package
); const gchar * apt_package_get_section (AptPackage *package
); AptDependency * apt_package_get_dependency (AptPackage *package
,gsize index
); gsize apt_package_n_dependencies (AptPackage *package
); AptProvides * apt_package_get_provides (AptPackage *package
,gsize index
); gsize apt_package_n_provides (AptPackage *package
); const gchar * apt_package_get_source_name (AptPackage *package
); const gchar * apt_package_get_source_version (AptPackage *package
); AptCurrentState apt_package_get_current_state (AptPackage *package
); AptSelectionState apt_package_get_selection_state (AptPackage *package
); AptPackageFlags apt_package_get_flags (AptPackage *package
); AptDescriptionIter * apt_package_get_descriptions (AptPackage *package
); AptPackageIter; AptPackage * apt_package_iter_next_value (AptPackageIter *iter
); void apt_package_iter_free (AptPackageIter *iter
); AptProvides; void apt_provides_unref (AptProvides *provides
); AptProvides * apt_provides_ref (AptProvides *provides
); const gchar * apt_provides_get_name (AptProvides *provides
); const gchar * apt_provides_get_version (AptProvides *provides
); AptDependency; void apt_dependency_unref (AptDependency *dependency
); AptDependency * apt_dependency_ref (AptDependency *dependency
); const gchar * apt_dependency_get_name (AptDependency *dependency
); const gchar * apt_dependency_get_version (AptDependency *dependency
); const gchar * apt_dependency_get_architecture (AptDependency *dependency
); AptComparisonType apt_dependency_get_comparison (AptDependency *dependency
); AptDependencyType apt_dependency_get_type (AptDependency *dependency
); gboolean apt_dependency_get_next_is_or (AptDependency *dependency
); enum AptComparisonType; const gchar * apt_comparison_type_to_string (AptComparisonType type
); enum AptDependencyType; const gchar * apt_dependency_type_to_string (AptDependencyType type
); gint apt_dependency_type_rate (AptDependencyType type
); AptIndex; enum AptIndexFlags; void apt_index_unref (AptIndex *index
); AptIndex * apt_index_ref (AptIndex *index
); const gchar * apt_index_get_archive (AptIndex *index
); const gchar * apt_index_get_base_uri (AptIndex *index
); const gchar * apt_index_get_codename (AptIndex *index
); const gchar * apt_index_get_component (AptIndex *index
); const gchar * apt_index_get_filename (AptIndex *index
); AptIndexFlags apt_index_get_flags (AptIndex *index
); const gchar * apt_index_get_label (AptIndex *index
); time_t apt_index_get_mtime (AptIndex *index
); const gchar * apt_index_get_origin (AptIndex *index
); const gchar * apt_index_get_site (AptIndex *index
); const gchar * apt_index_get_type (AptIndex *index
); const gchar * apt_index_get_version (AptIndex *index
); gboolean apt_index_is_up_to_date (AptIndex *index
); AptDescription; AptDescription * apt_description_ref (AptDescription *description
); void apt_description_unref (AptDescription *description
); const gchar * apt_description_get_filename (AptDescription *description
); const gchar * apt_description_get_language (AptDescription *description
); const gchar * apt_description_get_md5 (AptDescription *description
); goffset apt_description_get_offset (AptDescription *description
); guint8 apt_description_get_index_id (AptDescription *description
); AptDescriptionIter; void apt_description_iter_free (AptDescriptionIter *iter
); AptDescription * apt_description_iter_next_value (AptDescriptionIter *iter
);
typedef enum { APT_CACHE_ERROR_CORRUPT, APT_CACHE_ERROR_UNSUPPORTED } AptCacheError;
Possible errors.
typedef struct { } AptCache;
AptCache is an opaque data structure and can only be accessed using the following functions.
AptCache * apt_cache_new (const gchar *filename
,GError **error
);
Open the cache file at the given location.
Maps the file at the given location into memory and deserializes
it. If an error occured while mapping the file, the function returns
NULL
and sets error
. In such a case, errors are most likely
from the AptCacheError or GFileError domains.
|
The path to the file containing the cache. |
|
return location for a GError, or NULL
|
Returns : |
a newly allocated AptCache which must be unref'd with
apt_cache_unref() , or NULL if an error occured. |
gint32 apt_cache_get_format_version (AptCache *cache
);
Returns the format version of the cache.
This integer is increased every time the format changes in an incompatible way.
|
An AptCache instance |
Returns : |
The format version. |
const gchar * apt_cache_get_system_name (AptCache *cache
);
Gets the system name stored in the cache, such as 'deb'.
|
An AptCache instance. |
Returns : |
A pointer to the system name. TODO: No system name yet |
gboolean apt_cache_is_up_to_date (AptCache *cache
);
Checks whether cache
is up to date.
AptCache * apt_cache_ref (AptCache *cache
);
Increments the reference count of cache
by one. It is safe to call this
function from any thread.
void apt_cache_unref (AptCache *cache
);
Decrements the reference count of cache
by one. If the reference count
drops to 0, the object is freed.
|
An AptCache instance |
gsize apt_cache_n_packages (AptCache *cache
);
Returns the number of packages available in the cache.
|
An AptCache instance. |
Returns : |
The number of packages in cache . |
gsize apt_cache_n_indexes (AptCache *cache
);
Returns the number of indexes available in the cache.
|
An AptCache instance. |
Returns : |
The number of indexes in cache . |
AptPackage * apt_cache_get_package (AptCache *cache
,gsize id
);
Gets a package from the cache based on its ID.
|
An AptCache instance. |
|
The numeric identifier of the package. |
Returns : |
A reference to an AptPackage object. |
AptIndex * apt_cache_get_index (AptCache *cache
,guint8 id
);
Gets a package from the cache based on its ID.
|
An AptCache instance. |
|
The numeric identifier of the package. |
Returns : |
A reference to an AptPackage object. |
AptPackageIter * apt_cache_iterator (AptCache *cache
);
Provides an iterator over all packages in the cache.
|
An AptCache |
Returns : |
a newly allocated AptPackageIter. |
typedef enum { APT_CACHE_FIND_BY_BINARY = 1 << 0, APT_CACHE_FIND_BY_SOURCE = 1 << 1, APT_CACHE_FIND_BY_PROVIDES = 1 << 2, APT_CACHE_FIND_BY_DEPENDS = 1 << 3, APT_CACHE_FIND_INSTALLED_ONLY = 1 << 4 } AptCacheFindFlags;
Enum values that can be passed to apt_cache_find()
as its third
argument. You may freely combine those values using OR.
Find packages based on their name. | |
Find packages based on the name of their source. | |
Find packages based on what they provide. | |
Find packages based on what they depend on. | |
Only find installed packages. |
AptPackageIter * apt_cache_find (AptCache *cache
,const gchar *name
,AptCacheFindFlags flags
);
Finds all packages with the given name by looking them up in the internal hashtable and returns an AptPackageIter.
|
An AptCache instance |
|
The name of the package to be found. |
|
The AptCacheFindFlags determining what to query. |
Returns : |
An AptPackageIter of all matching packages or NULL if none. |
typedef enum { APT_SELECTION_STATE_UNKNOWN, APT_SELECTION_STATE_INSTALL, APT_SELECTION_STATE_HOLD, APT_SELECTION_STATE_DEINSTALL, APT_SELECTION_STATE_PURGE } AptSelectionState;
Enum values that describe the state the user wants the package to be in. They are taken directly from the manual page of dpkg. If the lower package manager has no notion of config files, it shall treat "purge" and "deinstall" identically.
The state is not set. | |
The package shall be installed. | |
The package shall not be modified. | |
The package shall be deinstalled, excluding its configuration files. | |
The package shall be deleted, including its configuration files. |
typedef enum { APT_CURRENT_STATE_NOT_INSTALLED, APT_CURRENT_STATE_CONFIG_FILES, APT_CURRENT_STATE_HALF_INSTALLED, APT_CURRENT_STATE_UNPACKED, APT_CURRENT_STATE_HALF_CONFIGURED, APT_CURRENT_STATE_TRIGGERS_AWAITED, APT_CURRENT_STATE_TRIGGERS_PENDING, APT_CURRENT_STATE_INSTALLED } AptCurrentState;
Enum values that describe the current state of the package. The values have been derived from the manual page of dpkg.
The package is not installed. | |
Only configuration files exist. | |
Installation has started. | |
The files of the package are unpacked. | |
Not totally configured. | |
The package awaits triggers. | |
The package has been triggered. | |
The package is completely installed. |
typedef enum { APT_PACKAGE_REINST_REQUIRED = 1 << 0, APT_PACKAGE_AUTO = 1 << 1 } AptPackageFlags;
Some flags which may be attached to a package.
typedef enum { APT_MULTI_ARCH_NONE, APT_MULTI_ARCH_SAME, APT_MULTI_ARCH_FOREIGN, APT_MULTI_ARCH_ALLOWED } AptMultiArch;
Enum values that determine how a package may engage in multi-architecture dependency situations.
The package may only be installed for one architecture and may only satisfy dependencies of packages of the same architecture. | |
Similar to APT_MULTI_ARCH_NONE , but it allows the
package to be installed for multiple architectures
at the same time.
|
|
The package is not co-installable with itself, but can satisfy the dependencies of packages from a different architecture. | |
Similar to APT_MULTI_ARCH_SAME , but it satisfies
dependencies of packages from any architecture, as
long as the dependency allows this (by setting the
architecture to "any").
|
const gchar * apt_multi_arch_to_string (AptMultiArch multi_arch
);
Converts the AptMultiArch value multi_arch
to a string as defined
in Debian's Multi-Arch field.
|
An AptMultiArch value |
Returns : |
A constant string describing multi_arch which consists
only of the lowercase letters a-z. |
typedef enum { APT_PRIORITY_UNKNOWN, APT_PRIORITY_REQUIRED, APT_PRIORITY_IMPORTANT, APT_PRIORITY_STANDARD, APT_PRIORITY_OPTIONAL, APT_PRIORITY_EXTRA } AptPriority;
Enum values that describe the priority of the package.
The priority of the package is unknown, such a value is normally invalid. | |
The package is required for a working base system. | |
The package should be installed on the system. | |
The package has standard priority. | |
The package is optional. | |
The package is extra; that is, users only want to install it in special circumstances. |
const gchar * apt_priority_to_string (AptPriority priority
);
Converts the AptPriority priority
to a string describing the
priority.
|
An AptPriority |
Returns : |
A constant string describing the priority which consists only of the lowercase letters a-z. |
typedef struct _AptPackage AptPackage;
An opaque data structure representing a package in the cache.
void apt_package_unref (AptPackage *package
);
Decreases the reference count of package
by one. If the reference count
reaches 0, free the memory used by package
.
|
An AptPackage |
AptPackage * apt_package_ref (AptPackage *package
);
Increases the reference count of package
by one.
|
An AptPackage |
guint32 apt_package_get_id (AptPackage *package
);
Gets the unique numeric identifier of the package in the cache.
|
An AptPackage |
Returns : |
An unsigned 32-bit identifier. |
const gchar * apt_package_get_name (AptPackage *package
);
Gets the name of the package.
|
An AptPackage |
Returns : |
An UTF-8 encoded string with the name of the package. |
const gchar * apt_package_get_version (AptPackage *package
);
Retrieve the version of this package as an UTF-8 encoded string.
|
An AptPackage |
Returns : |
A constant, utf-8 encoded string. |
const gchar * apt_package_get_architecture (AptPackage *package
);
Retrieve the name of the architecture this package is built for.
|
An AptPackage |
Returns : |
A constant, utf-8 encoded string. |
AptMultiArch apt_package_get_multi_arch (AptPackage *package
);
Gets information about how the package behaves in systems with packages from mixed architectures; that is, multi-arch environments.
|
An AptPackage |
Returns : |
An AptMultiArch value determining the multi-arch state of the package. |
goffset apt_package_get_size (AptPackage *package
);
Gets the size of the index in bytes.
|
An AptPackage |
Returns : |
The size of the file in bytes. |
goffset apt_package_get_installed_size (AptPackage *package
);
Gets the estimated size of the package when unpacked in bytes; since the value is internally stored as KiB, this value may differ from reality by up to 1023 byte.
|
An AptPackage |
Returns : |
The size of the unpacked package in bytes. |
const gchar * apt_package_get_checksum (AptPackage *package
);
Gets the checksum of the package, if one is stored in the cache, or NULL
if no checksum is stored. The checksum may either be MD5, SHA1, or SHA256;
the type of the checksum is determined by looking at the length of the
string.
|
An AptPackage |
Returns : |
A constant UTF-8 encoded string containing the checksum's
hexadecimal representation; or NULL if the checksum is
unknown. |
AptPriority apt_package_get_priority (AptPackage *package
);
Gets the priority of the package. If no correct package priority is set,
the return value will be APT_PRIORITY_UNKNOWN
. To convert the result to
a string, use the function apt_priority_to_string()
.
|
An AptPackage |
Returns : |
An AptPriority describing the package's priority. |
const gchar * apt_package_get_section (AptPackage *package
);
Gets the section of the package if one is stored in the cache, or NULL
if none is stored. Some package management solutions may have no notion
of sections and may thus always cause this function to return NULL
.
|
An AptPackage |
Returns : |
A constant UTF-8 encoded string containing the package's
section; or NULL if the package has no section. |
AptDependency * apt_package_get_dependency (AptPackage *package
,gsize index
);
Gets the requested dependency of the package. It is an error to call this
function with a value for index
that is larger than the number returned
by apt_package_n_dependencies()
.
|
An AptPackage |
|
The index of the dependency. |
Returns : |
An AptDependency. |
gsize apt_package_n_dependencies (AptPackage *package
);
Gets the number of dependencies this package has.
|
An AptPackage |
Returns : |
The number of dependencies package has. |
AptProvides * apt_package_get_provides (AptPackage *package
,gsize index
);
Gets the requested provides of the package. It is an error to call this
function with a value for index
that is larger than the number returned
by apt_package_n_provides()
.
|
An AptPackage |
|
The index of the provides. |
Returns : |
An AptProvides. |
gsize apt_package_n_provides (AptPackage *package
);
Gets the number of virtual packages provided by package
.
|
An AptPackage |
Returns : |
The number of virtual packages provided by package . |
const gchar * apt_package_get_source_name (AptPackage *package
);
Gets the name of the source package this package is built from.
|
An AptPackage |
Returns : |
The name of the source package. |
const gchar * apt_package_get_source_version (AptPackage *package
);
Gets the version of the source package this package is built from.
|
An AptPackage |
Returns : |
The version of the source package. |
AptCurrentState apt_package_get_current_state (AptPackage *package
);
Gets the package state.
|
An AptPackage |
AptSelectionState apt_package_get_selection_state (AptPackage *package
);
AptPackageFlags apt_package_get_flags (AptPackage *package
);
Gets the flags as stored in package
.
|
An AptPackage |
AptDescriptionIter * apt_package_get_descriptions (AptPackage *package
);
Finds the descriptions associated with the given package.
|
The package for which the descriptions should be looked up. |
Returns : |
An iterator over AptDescription objects. |
typedef struct _AptPackageIter AptPackageIter;
An opaque data structure representing an iterator over AptPackage instances.
AptPackage * apt_package_iter_next_value (AptPackageIter *iter
);
Gets the next package in the iterator or NULL
if there are no further
packages. The return value of this function must be unref'd by the user
when no longer needed.
|
An AptPackageIter |
Returns : |
The next package in the iterator or NULL if the end of the
iteration is reached. |
void apt_package_iter_free (AptPackageIter *iter
);
Free the package iterator iter
.
|
An AptPackageIter |
typedef struct _AptProvides AptProvides;
An opaque data structure representing a virtual package.
void apt_provides_unref (AptProvides *provides
);
Decreases the reference count of provides
by one. If the reference count
drops to 0, the memory allocated by provides
is freed.
|
An AptProvides |
AptProvides * apt_provides_ref (AptProvides *provides
);
Increases the reference count of provides
by one.
|
An AptProvides |
Returns : |
provides |
const gchar * apt_provides_get_name (AptProvides *provides
);
Gets the name of the virtual package provided by provides
.
|
An AptProvides |
Returns : |
A constant UTF-8 encoded string containing the name. |
const gchar * apt_provides_get_version (AptProvides *provides
);
Gets the version of the virtual package provided by provides
, if it
provides a version; or NULL
if the virtual package is not versioned.
|
An AptProvides |
Returns : |
A constant UTF-8 encoded string containing the version, or
NULL if the virtual package has no version. |
typedef struct _AptDependency AptDependency;
An opaque data structure representing a dependency in the cache.
void apt_dependency_unref (AptDependency *dependency
);
Decreases the reference count of dependency
by one.
|
An AptDependency. |
AptDependency * apt_dependency_ref (AptDependency *dependency
);
Increases the reference count of dependency
by one.
|
An AptDependency. |
Returns : |
A new reference to dependency . |
const gchar * apt_dependency_get_name (AptDependency *dependency
);
Gets the name of the dependency's target package.
|
An AptDependency |
Returns : |
A constant UTF-8 encoded string. |
const gchar * apt_dependency_get_version (AptDependency *dependency
);
Gets the version of the dependency's target if there is one. If the
dependency is not limited to a version, this function returns NULL
.
|
An AptDependency |
Returns : |
The target version or NULL if all versions are satisfying. |
const gchar * apt_dependency_get_architecture (AptDependency *dependency
);
Get the target architecture. If the return value is NULL
, it means
that the dependency can be satisfied only by architecture-independent
packages or by packages for the same architecture or by packages with
APT_MULTI_ARCH_FOREIGN
. If the return value is "any", the dependency
may be satisfied by packages with APT_MULTI_ARCH_ALLOWED
. In other
cases, the behavior is undefined; but should result in the dependency
not being resolved at all.
|
An AptDependency |
Returns : |
NULL or "any". |
AptComparisonType apt_dependency_get_comparison (AptDependency *dependency
);
Gets the type of comparison this dependency requires. For example, if the
dependency were "a (>= 1.0)", the return value would be the
AptComparisonType equivalent of >=; that is APT_COMPARISON_GE
.
|
An AptDependency. |
Returns : |
An AptComparisonType describing the comparison operator. |
AptDependencyType apt_dependency_get_type (AptDependency *dependency
);
Gets the type of dependency as an AptDependencyType value.
|
An AptDependency. |
Returns : |
An AptDependencyType describing the type of dependency. |
gboolean apt_dependency_get_next_is_or (AptDependency *dependency
);
Determines whether the next dependency is ORed to this one. For example,
in a dependency group 'a | b', this function returns TRUE
for the
AptDependency corresponding to 'a' and FALSE
for the AptDependency
corresponding to 'b'.
|
An AptDependency. |
Returns : |
TRUE if the next dependency is ORed to the current one,
FALSE otherwise. |
typedef enum AptComparisonType { APT_COMPARISON_NONE, APT_COMPARISON_LT, APT_COMPARISON_LE, APT_COMPARISON_EQ, APT_COMPARISON_NE, APT_COMPARISON_GE, APT_COMPARISON_GT } AptComparisonType;
Enum values to specify comparison operators. The names are derived from the comparison operators in Perl and are abbreviations.
const gchar * apt_comparison_type_to_string (AptComparisonType type
);
Converts the given comparison type to the operator used
in Debian indexes. If type
is APT_COMPARISON_NONE,
an empty string is returned.
|
The type that shall be converted to a string |
Returns : |
A pointer to a constant string of 0 - 2 characters. |
typedef enum AptDependencyType { APT_DEPENDENCY_INVALID, APT_DEPENDENCY_PREDEPENDS, APT_DEPENDENCY_DEPENDS, APT_DEPENDENCY_RECOMMENDS, APT_DEPENDENCY_SUGGESTS, APT_DEPENDENCY_ENHANCES, APT_DEPENDENCY_CONFLICTS, APT_DEPENDENCY_BREAKS, APT_DEPENDENCY_REPLACES } AptDependencyType;
Enumeration which defines all types of dependencies (positive and negative) understood by APT2. The names come from Debian package management, but the underlying concept is also understood by RPM systems.
The dependency is invalid. If you see this somewhere, it is a bug. | |
The dependency must be completely installed before the package can be installed | |
The dependency must be unpacked. | |
Like the previous one, but only installed if available (it should be installed). | |
The dependency may be useful for certain cases, but is normally not needed. | |
The dependency is enhanced by this package, think of it as a reverse suggestion. | |
The both packages may not be installed at the same time. | |
This package breaks the dependency; for example, by removing a file the dependency needs. | |
The package may replace files installed by the dependency. |
const gchar * apt_dependency_type_to_string (AptDependencyType type
);
Converts type
to a human-readable string that is the name of the
Debian dependency type which equals type
.
|
An AptDependencyType |
Returns : |
A constant string describing type . |
gint apt_dependency_type_rate (AptDependencyType type
);
Rates the given dependency type, determining whether the dependency will cause the installation of a package (positive) or whether it prevents a package from being installed.
|
An AptDependencyType |
Returns : |
<0 if the dependency is negative, 0 if the dependency does not have any effect in itself. >0 if the dependency is positive. |
typedef enum { APT_INDEX_NOT_SOURCE = 1 << 0, APT_INDEX_NOT_AUTOMATIC = 1 << 1, APT_INDEX_IS_TRUSTED = 1 << 2 } AptIndexFlags;
Various flags that can be set on an AptIndex.
Packages from this index can not be
retrieved. This mainly applies to package
manager databases, such as dpkg's
/var/lib/dpkg/status .
|
|
Packages from this file shall not be upgraded automatically. | |
The index is considered to be trusted. For Debian, this means that the Release file of the distribution this index belongs to is signed. |
void apt_index_unref (AptIndex *index
);
Decrease the reference count of index
by one. If the reference count
drops to zero, free the object.
|
An AptIndex |
AptIndex * apt_index_ref (AptIndex *index
);
Increase the reference count of index
by one.
|
An AptIndex |
Returns : |
index |
const gchar * apt_index_get_archive (AptIndex *index
);
Gets the archive of the index. For Debian-based systems, this
is equal to the "Suite" field stored in Release files. If no archive
is defined, the function returns NULL
.
const gchar * apt_index_get_base_uri (AptIndex *index
);
Gets the base URI of the archive. Appending the filename of a package from
this index to this URI will produce the URI at which the package is
located. If the index refers to a file which can not act as a source
for packages, such as dpkg's /var/lib/dpkg/status
, this
function returns NULL
.
const gchar * apt_index_get_codename (AptIndex *index
);
Gets the codename of the index. For Debian-based systems, this
is equal to the "Codename" field stored in Release files. If no codename
is defined, the function returns NULL
.
const gchar * apt_index_get_component (AptIndex *index
);
Gets the component of the index. The component can be used to
separate certain parts of an archive and equals the fourth field (and
following ones) in sources.list files. For Debian, this is mostly "main",
"contrib" or "non-free". Components are optional, and as such, the function
may return NULL
if no component is set.
const gchar * apt_index_get_filename (AptIndex *index
);
Gets the file name of the index; that is, the path to the local copy of the index file in the Dir::State::lists directory.
|
An AptIndex |
Returns : |
UTF-8 encoded string with the absolute path to the file. |
AptIndexFlags apt_index_get_flags (AptIndex *index
);
Gets the flags associated with this index as combination of AptIndexFlags values. See the description of AptIndexFlags for information on the meanings of the flags.
|
An AptIndex |
Returns : |
The flags associated with this file as AptIndexFlags. |
const gchar * apt_index_get_label (AptIndex *index
);
Gets the label of the index. The label should be a short string
describing the repository. It is optional and if not existent, the
function returns NULL
.
time_t apt_index_get_mtime (AptIndex *index
);
Gets the last time this index was modified before it was added to the cache. If this value is older than the modification time of the file in the file system, the cache should be considered outdated.
|
An AptIndex |
Returns : |
The last time of modification as time_t. |
const gchar * apt_index_get_origin (AptIndex *index
);
Gets the origin of the index. The origin is a short string
describing the origin of the packages in this repository. For
Debian-based systems, this is extracted from the "Origin" field in
the Release file. Examples here are "Debian" for official Debian
packages and "Ubuntu" for official Ubuntu packages. Specifying
an origin is not required, if there is no origin, the function
returns NULL
.
const gchar * apt_index_get_site (AptIndex *index
);
Gets the site associated with the index, if it was fetched via
network from a server, or NULL
if the index belongs to a local
repository.
const gchar * apt_index_get_type (AptIndex *index
);
Gets the type of the index. This should be a human-readable string describing the type of the index file. This function is considered unstable and may be changed to return a enumeration value in a future update. Do not use it.
|
An AptIndex |
Returns : |
UTF-8 encoded human-readable string. |
Stability Level: Unstable
const gchar * apt_index_get_version (AptIndex *index
);
Gets the version of the index. This should be the version of the
distribution this indexes belongs to. For Debian-based systems, this
field is retrieved from the 'Version' field in the Release file. This field
is optional, and the function may thus return NULL
if no version is set.
gboolean apt_index_is_up_to_date (AptIndex *index
);
Checks whether index
is up to date; that is, whether the
file on the disk has not been modified since it was cached.
typedef struct _AptDescription AptDescription;
An opaque data structure which may only be accessed using the following functions. Currently there is no way to create objects of this type, as this is still under heavy development.
AptDescription * apt_description_ref (AptDescription *description
);
Increments the reference count of description
.
|
An AptDescription |
Returns : |
description |
void apt_description_unref (AptDescription *description
);
Decrements the reference count of description
. If the reference count
drops to 0, the memory pointed to by description
is freed.
|
An AptDescription |
const gchar * apt_description_get_filename (AptDescription *description
);
Gets the name of the package archive (i.e. the deb/rpm/... file). In case
this object is not related to a complete package record, but only to a
translated description, the return value will be NULL
.
|
An AptDescription |
Returns : |
The filename of the package or NULL . |
const gchar * apt_description_get_language (AptDescription *description
);
Gets the language of the description if it is a translated description, as
an ISO 639 language code such as 'en' and optionally an ISO 3166 country
code such as 'US'. In this example, the resulting language code would be
'en_US'. If the description is not translated, the function shall return
NULL
.
|
An AptDescription |
Returns : |
The language code if translated or NULL if the description
is not a translation. |
const gchar * apt_description_get_md5 (AptDescription *description
);
Gets the hexadecimal representation of the untranslated description's MD5 checksum. This value is used to locate the translations of the description.
|
An AptDescription |
Returns : |
The hexadecimal representation of the MD5 checksum as a constant string. |
goffset apt_description_get_offset (AptDescription *description
);
Gets the offset of the package record in the index. While the return type of this value is a goffset, the offset is stored internally as an unsigned 32 bit integer; since it is not expected that package files reach sizes > 4 GB.
|
An AptDescription |
Returns : |
The offset as a goffset. |
guint8 apt_description_get_index_id (AptDescription *description
);
Gets the ID of the index associated with this AptDescription. The
return value may be passed to apt_cache_get_index()
in order to
receive a corresponding AptIndex.
|
An AptDescription |
typedef struct _AptDescriptionIter AptDescriptionIter;
An iterator over AptDescription objects. This is an opaque type.
void apt_description_iter_free (AptDescriptionIter *iter
);
Free iter
.
|
An AptDescriptionIter |
AptDescription * apt_description_iter_next_value (AptDescriptionIter *iter
);
Gets the next AptDescription in iter
or NULL
if there are no further
descriptions.
|
An AptDescriptionIter |
Returns : |
The next AptDescription or NULL if there are no more ones. |