![]() |
![]() |
![]() |
APT2 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <apt/cache-builder.h> AptCacheBuilder; AptCache * apt_cache_builder_end (AptCacheBuilder *builder
); AptCacheBuilder * apt_cache_builder_new (void
); AptCacheDependency * apt_cache_builder_new_dependency (AptCacheBuilder *builder
,cindex *index
); AptCacheDescription * apt_cache_builder_new_description (AptCacheBuilder *builder
,cindex *index
); AptCacheIndex * apt_cache_builder_new_file (AptCacheBuilder *builder
); AptCacheGroup * apt_cache_builder_new_group (AptCacheBuilder *builder
); AptCacheGroupMember * apt_cache_builder_new_group_member (AptCacheBuilder *builder
,cindex *index
); AptCachePackage * apt_cache_builder_new_package (AptCacheBuilder *builder
); AptCacheProvides * apt_cache_builder_new_provides (AptCacheBuilder *builder
,cindex *index
); coffset apt_cache_builder_new_string (AptCacheBuilder *builder
,const gchar *s
,gssize len
);
typedef struct _AptCacheBuilder AptCacheBuilder;
AptCacheBuilder is an opaque data type that may only be accessed using the following functions. It is responsible for creating APT2 caches.
AptCache * apt_cache_builder_end (AptCacheBuilder *builder
);
Finalizes builder
and returns the generated cache. After this
function returned, the object pointed to by builder
does not
exist anymore.
|
An AptCacheBuilder |
Returns : |
A pointer to a newly-allocated AptCache. Must
be freed by calling apt_cache_unref() . |
AptCacheBuilder * apt_cache_builder_new (void
);
Creates a new AptCacheBuilder.
Returns : |
A pointer to a newly-allocated AptCacheBuilder. Must be
freed with apt_cache_builder_end() . |
AptCacheDependency * apt_cache_builder_new_dependency (AptCacheBuilder *builder
,cindex *index
);
Creates a new dependency in the cache and returns a pointer to it
which can be used to set the data. The index stored in *index
can
be used; for example, to set AptCachePackage.begin_dependencies.
|
An AptCacheBuilder |
|
Return location for the dependencies index |
Returns : |
A pointer to an AptCacheDependency that stays valid
until the next call to apt_cache_builder_new_dependency() or
apt_cache_builder_end() . |
AptCacheDescription * apt_cache_builder_new_description (AptCacheBuilder *builder
,cindex *index
);
Creates a new description in the cache and returns a pointer to it
which can be used to set the data. The index stored in *index
can
be used; for example, to set AptCachePackage.begin_descriptions.
|
An AptCacheBuilder |
|
Return location for the description index |
Returns : |
A pointer to an AptCacheDescription that stays valid
until the next call to apt_cache_builder_new_description() or
apt_cache_builder_end() . |
AptCacheIndex * apt_cache_builder_new_file (AptCacheBuilder *builder
);
Creates a new file in the cache and returns a pointer to it which can be used to set the data.
|
An AptCacheBuilder |
Returns : |
A pointer to an AptCacheIndex that stays
valid until the next call to apt_cache_builder_new_file() or
apt_cache_builder_end() . |
AptCacheGroup * apt_cache_builder_new_group (AptCacheBuilder *builder
);
Creates a new group in the cache and returns a pointer to it which can be used to set the data. You normally do not need to call this function. If this function is not called at all, but group members have been added, the builder will automatically create the groups for the members.
|
An AptCacheBuilder |
Returns : |
A pointer to an AptCacheGroup that stays valid
until the next call to apt_cache_builder_new_group() or
apt_cache_builder_end() . |
AptCacheGroupMember * apt_cache_builder_new_group_member (AptCacheBuilder *builder
,cindex *index
);
Creates a new group member in the cache and returns a pointer to it
which can be used to set the data. The index stored in *index
can
be used; for example, to set AptCacheGroup.begin_members.
|
An AptCacheBuilder |
|
Return location for the group member index, or NULL if not needed |
Returns : |
A pointer to an AptCacheGroupMember that stays valid
until the next call to apt_cache_builder_new_group_member() or
apt_cache_builder_end() . |
AptCachePackage * apt_cache_builder_new_package (AptCacheBuilder *builder
);
Creates a new package in the cache and returns a pointer to it which can be used to set the data.
|
An AptCacheBuilder |
Returns : |
A pointer to an AptCachePackage that stays valid until the
next call to apt_cache_builder_new_package() or apt_cache_builder_end() . |
AptCacheProvides * apt_cache_builder_new_provides (AptCacheBuilder *builder
,cindex *index
);
Creates a new provides in the cache and returns a pointer to it
which can be used to set the data. The index stored in *index
can
be used; for example, to set AptCachePackage.begin_provides.
|
An AptCacheBuilder |
|
Return location for the provides index |
Returns : |
A pointer to an AptCacheProvides that stays valid
until the next call to apt_cache_builder_new_provides() or
apt_cache_builder_end() . |
coffset apt_cache_builder_new_string (AptCacheBuilder *builder
,const gchar *s
,gssize len
);
Inserts a string into the cache. Duplicate strings are only inserted once, to improve space utilization and lookups. Empty strings and NULL pointers are not inserted, for them, 0 is returned (and the 0-th string is an empty string).
|
An AptCacheBuilder |
|
The string that shall be inserted |
|
The length of s , or -1 if s is nul-terminated |
Returns : |
The offset of the string in the cache's string array. |