-I $(top_srcdir)/include \
$(OUR_CPPFLAGS)
-AM_CFLAGS = $(OUR_CFLAGS)
-AM_LDFLAGS = $(OUR_LDFLAGS)
+AM_CFLAGS = $(OUR_CFLAGS) \
+ -ffunction-sections \
+ -fdata-sections
+
+AM_LDFLAGS = $(OUR_LDFLAGS) \
+ -Wl,--gc-sections \
+ -Wl,--as-needed
PAKFIRE_CPPFLAGS = -I$(top_srcdir)/src/libpakfire/include
PAKFIRE_LIBS = libpakfire.la
src/libpakfire/include/pakfire/packagelist.h \
src/libpakfire/include/pakfire/pakfire.h \
src/libpakfire/include/pakfire/pool.h \
+ src/libpakfire/include/pakfire/private.h \
src/libpakfire/include/pakfire/problem.h \
src/libpakfire/include/pakfire/relation.h \
src/libpakfire/include/pakfire/relationlist.h \
libpakfire_la_CFLAGS = \
$(AM_CFLAGS) \
+ -fvisibility=hidden \
$(LIBGCRYPT_CFLAGS)
libpakfire_la_CPPFLAGS = \
#include <pakfire/key.h>
#include <pakfire/logging.h>
#include <pakfire/pakfire.h>
+#include <pakfire/private.h>
#include <pakfire/util.h>
static void configure_archive(struct archive* a) {
pakfire_free(signature);
}
-PakfireArchiveSignature pakfire_archive_signature_ref(PakfireArchiveSignature signature) {
+PAKFIRE_EXPORT PakfireArchiveSignature pakfire_archive_signature_ref(PakfireArchiveSignature signature) {
++signature->nrefs;
return signature;
}
-void pakfire_archive_signature_unref(PakfireArchiveSignature signature) {
+PAKFIRE_EXPORT void pakfire_archive_signature_unref(PakfireArchiveSignature signature) {
if (--signature->nrefs > 0)
return;
pakfire_archive_signature_free(signature);
}
-size_t _pakfire_archive_count_signatures(const PakfireArchiveSignature* signatures) {
+static size_t _pakfire_archive_count_signatures(const PakfireArchiveSignature* signatures) {
size_t i = 0;
while (signatures && *signatures++) {
return i;
}
-size_t pakfire_archive_count_signatures(PakfireArchive archive) {
+PAKFIRE_EXPORT size_t pakfire_archive_count_signatures(PakfireArchive archive) {
PakfireArchiveSignature* signatures = pakfire_archive_get_signatures(archive);
return _pakfire_archive_count_signatures(signatures);
}
-PakfireArchive pakfire_archive_create(Pakfire pakfire) {
+PAKFIRE_EXPORT PakfireArchive pakfire_archive_create(Pakfire pakfire) {
PakfireArchive archive = pakfire_calloc(1, sizeof(*archive));
if (archive) {
DEBUG("Allocated new archive at %p\n", archive);
return archive;
}
-PakfireArchive pakfire_archive_ref(PakfireArchive archive) {
+PAKFIRE_EXPORT PakfireArchive pakfire_archive_ref(PakfireArchive archive) {
++archive->nrefs;
return archive;
pakfire_free(archive);
}
-void pakfire_archive_unref(PakfireArchive archive) {
+PAKFIRE_EXPORT void pakfire_archive_unref(PakfireArchive archive) {
if (--archive->nrefs > 0)
return;
return r;
}
-
-PakfireArchive pakfire_archive_open(Pakfire pakfire, const char* path) {
+PAKFIRE_EXPORT PakfireArchive pakfire_archive_open(Pakfire pakfire, const char* path) {
PakfireArchive archive = pakfire_archive_create(pakfire);
archive->path = pakfire_strdup(path);
return payload_archive;
}
-int pakfire_archive_read(PakfireArchive archive, const char* filename,
+PAKFIRE_EXPORT int pakfire_archive_read(PakfireArchive archive, const char* filename,
void** data, size_t* data_size, int flags) {
struct archive* a;
struct archive* pa = NULL;
return r;
}
-int pakfire_archive_extract(PakfireArchive archive, const char* prefix, int flags) {
+PAKFIRE_EXPORT int pakfire_archive_extract(PakfireArchive archive, const char* prefix, int flags) {
struct archive* a;
struct archive* pa = NULL;
return r;
}
-const char* pakfire_archive_get_path(PakfireArchive archive) {
+PAKFIRE_EXPORT const char* pakfire_archive_get_path(PakfireArchive archive) {
return archive->path;
}
-unsigned int pakfire_archive_get_format(PakfireArchive archive) {
+PAKFIRE_EXPORT unsigned int pakfire_archive_get_format(PakfireArchive archive) {
return archive->format;
}
-PakfireFile pakfire_archive_get_filelist(PakfireArchive archive) {
+PAKFIRE_EXPORT PakfireFile pakfire_archive_get_filelist(PakfireArchive archive) {
return archive->filelist;
}
-const char* pakfire_archive_signature_get_data(PakfireArchiveSignature signature) {
+PAKFIRE_EXPORT const char* pakfire_archive_signature_get_data(PakfireArchiveSignature signature) {
return signature->sigdata;
}
return pakfire_archive_walk(archive, pakfire_archive_read_signature_entry);
}
-PakfireArchiveSignature* pakfire_archive_get_signatures(PakfireArchive archive) {
+PAKFIRE_EXPORT PakfireArchiveSignature* pakfire_archive_get_signatures(PakfireArchive archive) {
if (!archive->signatures_loaded++)
pakfire_archive_load_signatures(archive);
return status;
}
-pakfire_archive_verify_status_t pakfire_archive_verify(PakfireArchive archive) {
+PAKFIRE_EXPORT pakfire_archive_verify_status_t pakfire_archive_verify(PakfireArchive archive) {
// Verify that checksums file is signed with a valid key
pakfire_archive_verify_status_t status = pakfire_archive_verify_checksums(archive);
if (status)
return status;
}
-const char* pakfire_archive_verify_strerror(pakfire_archive_verify_status_t status) {
+PAKFIRE_EXPORT const char* pakfire_archive_verify_strerror(pakfire_archive_verify_status_t status) {
switch (status) {
case PAKFIRE_ARCHIVE_VERIFY_OK:
return _("Verify OK");
#include <pakfire/cache.h>
#include <pakfire/constants.h>
#include <pakfire/package.h>
+#include <pakfire/private.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-PakfireCache pakfire_cache_create(PakfirePool pool, const char* path) {
+PAKFIRE_EXPORT PakfireCache pakfire_cache_create(PakfirePool pool, const char* path) {
PakfireCache cache = pakfire_calloc(1, sizeof(*cache));
cache->pool = pool;
return cache;
}
-void pakfire_cache_free(PakfireCache cache) {
+PAKFIRE_EXPORT void pakfire_cache_free(PakfireCache cache) {
pakfire_free(cache->path);
pakfire_free(cache);
}
-const char* pakfire_cache_get_path(PakfireCache cache) {
+PAKFIRE_EXPORT const char* pakfire_cache_get_path(PakfireCache cache) {
return cache->path;
}
-char* pakfire_cache_get_full_path(PakfireCache cache, const char* path) {
+PAKFIRE_EXPORT char* pakfire_cache_get_full_path(PakfireCache cache, const char* path) {
const char* cache_path = pakfire_cache_get_path(cache);
return pakfire_path_join(cache_path, path);
return r;
}
-int pakfire_cache_has_file(PakfireCache cache, const char* filename) {
+PAKFIRE_EXPORT int pakfire_cache_has_file(PakfireCache cache, const char* filename) {
struct stat buf;
int r = pakfire_cache_stat(cache, filename, &buf);
return (r == 0);
}
-char* pakfire_cache_get_package_path(PakfireCache cache, PakfirePackage pkg) {
+PAKFIRE_EXPORT char* pakfire_cache_get_package_path(PakfireCache cache, PakfirePackage pkg) {
char buffer[STRING_SIZE] = "";
const char* filename = pakfire_package_get_filename(pkg);
return pakfire_strdup(buffer);
}
-int pakfire_cache_has_package(PakfireCache cache, PakfirePackage pkg) {
+PAKFIRE_EXPORT int pakfire_cache_has_package(PakfireCache cache, PakfirePackage pkg) {
char* filename = pakfire_cache_get_package_path(cache, pkg);
int r = pakfire_cache_has_file(cache, filename);
return r;
}
-int pakfire_cache_age(PakfireCache cache, const char* filename) {
+PAKFIRE_EXPORT int pakfire_cache_age(PakfireCache cache, const char* filename) {
struct stat buf;
int r = pakfire_cache_stat(cache, filename, &buf);
return r;
}
-FILE* pakfire_cache_open(PakfireCache cache, const char* filename, const char* flags) {
+PAKFIRE_EXPORT FILE* pakfire_cache_open(PakfireCache cache, const char* filename, const char* flags) {
assert(filename);
char* cache_filename = pakfire_cache_get_full_path(cache, filename);
#include "errno.h"
+#include <pakfire/private.h>
+
__thread int pakfire_errno = 0;
-int pakfire_get_errno(void) {
+PAKFIRE_EXPORT int pakfire_get_errno(void) {
return pakfire_errno;
}
#include <pakfire/constants.h>
#include <pakfire/file.h>
+#include <pakfire/private.h>
#include <pakfire/util.h>
-PakfireFile pakfire_file_create() {
+PAKFIRE_EXPORT PakfireFile pakfire_file_create() {
PakfireFile file = pakfire_calloc(1, sizeof(*file));
if (file) {
file->name = NULL;
return file;
}
-void pakfire_file_free(PakfireFile file) {
+PAKFIRE_EXPORT void pakfire_file_free(PakfireFile file) {
if (file->name)
pakfire_free(file->name);
pakfire_free(file);
}
-void pakfire_file_free_all(PakfireFile file) {
+PAKFIRE_EXPORT void pakfire_file_free_all(PakfireFile file) {
file = pakfire_file_get_first(file);
while (file) {
}
}
-int pakfire_file_cmp(PakfireFile file1, PakfireFile file2) {
+PAKFIRE_EXPORT int pakfire_file_cmp(PakfireFile file1, PakfireFile file2) {
const char* name1 = pakfire_file_get_name(file1);
const char* name2 = pakfire_file_get_name(file2);
return strcmp(name1, name2);
}
-void pakfire_file_swap(PakfireFile file1, PakfireFile file2) {
+PAKFIRE_EXPORT void pakfire_file_swap(PakfireFile file1, PakfireFile file2) {
PakfireFile file_prev = file1->prev;
PakfireFile file_next = file2->next;
file1->prev = file2;
}
-PakfireFile pakfire_file_sort(PakfireFile head) {
+PAKFIRE_EXPORT PakfireFile pakfire_file_sort(PakfireFile head) {
unsigned int count = pakfire_file_count(head);
for (unsigned int i = 0; i < count; i++) {
return head;
}
-PakfireFile pakfire_file_get_prev(PakfireFile file) {
+PAKFIRE_EXPORT PakfireFile pakfire_file_get_prev(PakfireFile file) {
return file->prev;
}
-PakfireFile pakfire_file_get_next(PakfireFile file) {
+PAKFIRE_EXPORT PakfireFile pakfire_file_get_next(PakfireFile file) {
return file->next;
}
-PakfireFile pakfire_file_get_first(PakfireFile file) {
+PAKFIRE_EXPORT PakfireFile pakfire_file_get_first(PakfireFile file) {
if (file->prev)
return pakfire_file_get_first(file->prev);
return file;
}
-PakfireFile pakfire_file_get_last(PakfireFile file) {
+PAKFIRE_EXPORT PakfireFile pakfire_file_get_last(PakfireFile file) {
if (file->next)
return pakfire_file_get_last(file->next);
return appended_file;
}
-PakfireFile pakfire_file_append(PakfireFile file) {
+PAKFIRE_EXPORT PakfireFile pakfire_file_append(PakfireFile file) {
// Create a new file object.
PakfireFile appended_file = pakfire_file_create();
return __pakfire_file_append(file, appended_file);
}
-unsigned int pakfire_file_count(PakfireFile file) {
+PAKFIRE_EXPORT unsigned int pakfire_file_count(PakfireFile file) {
unsigned int counter = 0;
while (file) {
return pakfire_strdup(buffer);
}
-void pakfire_file_sprintf(PakfireFile file, char* str, size_t len) {
+PAKFIRE_EXPORT void pakfire_file_sprintf(PakfireFile file, char* str, size_t len) {
const char* name = pakfire_file_get_name(file);
ssize_t size = pakfire_file_get_size(file);
pakfire_free(mtime);
}
-const char* pakfire_file_get_name(PakfireFile file) {
+PAKFIRE_EXPORT const char* pakfire_file_get_name(PakfireFile file) {
return file->name;
}
-void pakfire_file_set_name(PakfireFile file, const char* name) {
+PAKFIRE_EXPORT void pakfire_file_set_name(PakfireFile file, const char* name) {
if (file->name)
pakfire_free(file->name);
}
}
-char pakfire_file_get_type(PakfireFile file) {
+PAKFIRE_EXPORT char pakfire_file_get_type(PakfireFile file) {
return file->type;
}
-void pakfire_file_set_type(PakfireFile file, char type) {
+PAKFIRE_EXPORT void pakfire_file_set_type(PakfireFile file, char type) {
file->type = type;
}
-int pakfire_file_is_file(PakfireFile file) {
+PAKFIRE_EXPORT int pakfire_file_is_file(PakfireFile file) {
return (file->type == REGTYPE) || (file->type == AREGTYPE);
}
-int pakfire_file_is_link(PakfireFile file) {
+PAKFIRE_EXPORT int pakfire_file_is_link(PakfireFile file) {
return (file->type == LNKTYPE);
}
-int pakfire_file_is_symlink(PakfireFile file) {
+PAKFIRE_EXPORT int pakfire_file_is_symlink(PakfireFile file) {
return (file->type == SYMTYPE);
}
-int pakfire_file_is_char(PakfireFile file) {
+PAKFIRE_EXPORT int pakfire_file_is_char(PakfireFile file) {
return (file->type == CHRTYPE);
}
-int pakfire_file_is_block(PakfireFile file) {
+PAKFIRE_EXPORT int pakfire_file_is_block(PakfireFile file) {
return (file->type == BLKTYPE);
}
-int pakfire_file_is_dir(PakfireFile file) {
+PAKFIRE_EXPORT int pakfire_file_is_dir(PakfireFile file) {
return (file->type == DIRTYPE);
}
-ssize_t pakfire_file_get_size(PakfireFile file) {
+PAKFIRE_EXPORT ssize_t pakfire_file_get_size(PakfireFile file) {
return file->size;
}
-void pakfire_file_set_size(PakfireFile file, ssize_t size) {
+PAKFIRE_EXPORT void pakfire_file_set_size(PakfireFile file, ssize_t size) {
file->size = size;
}
-const char* pakfire_file_get_user(PakfireFile file) {
+PAKFIRE_EXPORT const char* pakfire_file_get_user(PakfireFile file) {
return file->user;
}
-void pakfire_file_set_user(PakfireFile file, const char* user) {
+PAKFIRE_EXPORT void pakfire_file_set_user(PakfireFile file, const char* user) {
file->user = pakfire_strdup(user);
}
-const char* pakfire_file_get_group(PakfireFile file) {
+PAKFIRE_EXPORT const char* pakfire_file_get_group(PakfireFile file) {
return file->group;
}
-void pakfire_file_set_group(PakfireFile file, const char* group) {
+PAKFIRE_EXPORT void pakfire_file_set_group(PakfireFile file, const char* group) {
file->group = pakfire_strdup(group);
}
-mode_t pakfire_file_get_mode(PakfireFile file) {
+PAKFIRE_EXPORT mode_t pakfire_file_get_mode(PakfireFile file) {
return file->mode;
}
-void pakfire_file_set_mode(PakfireFile file, mode_t mode) {
+PAKFIRE_EXPORT void pakfire_file_set_mode(PakfireFile file, mode_t mode) {
file->mode = mode;
}
-time_t pakfire_file_get_time(PakfireFile file) {
+PAKFIRE_EXPORT time_t pakfire_file_get_time(PakfireFile file) {
return file->time;
}
-void pakfire_file_set_time(PakfireFile file, time_t time) {
+PAKFIRE_EXPORT void pakfire_file_set_time(PakfireFile file, time_t time) {
file->time = time;
}
-const char* pakfire_file_get_chksum(PakfireFile file) {
+PAKFIRE_EXPORT const char* pakfire_file_get_chksum(PakfireFile file) {
return file->chksum;
}
-void pakfire_file_set_chksum(PakfireFile file, const char* chksum) {
+PAKFIRE_EXPORT void pakfire_file_set_chksum(PakfireFile file, const char* chksum) {
file->chksum = pakfire_strdup(chksum);
}
return file;
}
-PakfireFile pakfire_file_parse_from_file(const char* list, unsigned int format) {
+PAKFIRE_EXPORT PakfireFile pakfire_file_parse_from_file(const char* list, unsigned int format) {
PakfireFile head = NULL;
char* plist = (char *)list;
#include <pakfire/file.h>
#include <pakfire/filelist.h>
+#include <pakfire/private.h>
#include <pakfire/util.h>
-PakfireFilelist pakfire_filelist_create(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireFilelist pakfire_filelist_create(PakfirePackage pkg) {
PakfireFilelist list = pakfire_calloc(1, sizeof(*list));
if (list) {
list->pkg = pkg;
return list;
}
-void pakfire_filelist_free(PakfireFilelist list) {
+PAKFIRE_EXPORT void pakfire_filelist_free(PakfireFilelist list) {
pakfire_filelist_remove_all();
pakfire_free(list);
}
pakfire_file_free(file);
}
-void pakfire_filelist_remove_all(PakfireFilelist list) {
+PAKFIRE_EXPORT void pakfire_filelist_remove_all(PakfireFilelist list) {
while (list->first) {
pakfire_filelist_remove_first(list);
}
}
-void pakfire_filelist_append(PakfireFilelist list, PakfireFile file) {
+PAKFIRE_EXPORT void pakfire_filelist_append(PakfireFilelist list, PakfireFile file) {
if (list->first && list->last) {
list->last->next = file;
list->last = file;
#############################################################################*/
#include <pakfire/filter.h>
+#include <pakfire/private.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-PakfireFilter pakfire_filter_create(void) {
+PAKFIRE_EXPORT PakfireFilter pakfire_filter_create(void) {
PakfireFilter filter = pakfire_calloc(1, sizeof(*filter));
return filter;
}
-void pakfire_filter_free(PakfireFilter filter) {
+PAKFIRE_EXPORT void pakfire_filter_free(PakfireFilter filter) {
pakfire_free(filter->match);
pakfire_free(filter);
}
--- /dev/null
+/*#############################################################################
+# #
+# Pakfire - The IPFire package management system #
+# Copyright (C) 2013 Pakfire development team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#ifndef PAKFIRE_PRIVATE_H
+#define PAKFIRE_PRIVATE_H
+
+#ifdef PAKFIRE_PRIVATE
+#define PAKFIRE_EXPORT __attribute__ ((visibility("default")))
+#endif
+
+#endif /* PAKFIRE_PRIVATE_H */
#include <pakfire/key.h>
#include <pakfire/logging.h>
#include <pakfire/pakfire.h>
+#include <pakfire/private.h>
#include <pakfire/util.h>
#define DEFAULT_KEY_SIZE "rsa4096"
return count;
}
-PakfireKey* pakfire_key_list(Pakfire pakfire) {
+PAKFIRE_EXPORT PakfireKey* pakfire_key_list(Pakfire pakfire) {
size_t count = pakfire_count_keys(pakfire);
if (count == 0)
return NULL;
return first;
}
-PakfireKey pakfire_key_create(Pakfire pakfire, gpgme_key_t gpgkey) {
+PAKFIRE_EXPORT PakfireKey pakfire_key_create(Pakfire pakfire, gpgme_key_t gpgkey) {
PakfireKey key = pakfire_calloc(1, sizeof(*key));
if (key) {
pakfire_free(key);
}
-PakfireKey pakfire_key_ref(PakfireKey key) {
+PAKFIRE_EXPORT PakfireKey pakfire_key_ref(PakfireKey key) {
++key->nrefs;
return key;
}
-void pakfire_key_unref(PakfireKey key) {
+PAKFIRE_EXPORT void pakfire_key_unref(PakfireKey key) {
if (--key->nrefs > 0)
return;
return key;
}
-PakfireKey pakfire_key_get(Pakfire pakfire, const char* fingerprint) {
+PAKFIRE_EXPORT PakfireKey pakfire_key_get(Pakfire pakfire, const char* fingerprint) {
gpgme_ctx_t gpgctx = pakfire_get_gpgctx(pakfire);
PakfireKey key = __pakfire_get_key(pakfire, gpgctx, fingerprint);
return key;
}
-int pakfire_key_delete(PakfireKey key) {
+PAKFIRE_EXPORT int pakfire_key_delete(PakfireKey key) {
gpgme_ctx_t gpgctx = pakfire_get_gpgctx(key->pakfire);
int r = 0;
return r;
}
-const char* pakfire_key_get_fingerprint(PakfireKey key) {
+PAKFIRE_EXPORT const char* pakfire_key_get_fingerprint(PakfireKey key) {
return key->gpgkey->fpr;
}
-const char* pakfire_key_get_uid(PakfireKey key) {
+PAKFIRE_EXPORT const char* pakfire_key_get_uid(PakfireKey key) {
return key->gpgkey->uids->uid;
}
-const char* pakfire_key_get_name(PakfireKey key) {
+PAKFIRE_EXPORT const char* pakfire_key_get_name(PakfireKey key) {
return key->gpgkey->uids->name;
}
-const char* pakfire_key_get_email(PakfireKey key) {
+PAKFIRE_EXPORT const char* pakfire_key_get_email(PakfireKey key) {
return key->gpgkey->uids->email;
}
-const char* pakfire_key_get_pubkey_algo(PakfireKey key) {
+PAKFIRE_EXPORT const char* pakfire_key_get_pubkey_algo(PakfireKey key) {
switch (key->gpgkey->subkeys->pubkey_algo) {
case GPGME_PK_RSA:
case GPGME_PK_RSA_E:
return NULL;
}
-size_t pakfire_key_get_pubkey_length(PakfireKey key) {
+PAKFIRE_EXPORT size_t pakfire_key_get_pubkey_length(PakfireKey key) {
return key->gpgkey->subkeys->length;
}
-time_t pakfire_key_get_created(PakfireKey key) {
+PAKFIRE_EXPORT time_t pakfire_key_get_created(PakfireKey key) {
return key->gpgkey->subkeys->timestamp;
}
-time_t pakfire_key_get_expires(PakfireKey key) {
+PAKFIRE_EXPORT time_t pakfire_key_get_expires(PakfireKey key) {
return key->gpgkey->subkeys->expires;
}
-int pakfire_key_is_revoked(PakfireKey key) {
+PAKFIRE_EXPORT int pakfire_key_is_revoked(PakfireKey key) {
return key->gpgkey->subkeys->revoked;
}
-PakfireKey pakfire_key_generate(Pakfire pakfire, const char* userid) {
+PAKFIRE_EXPORT PakfireKey pakfire_key_generate(Pakfire pakfire, const char* userid) {
gpgme_ctx_t gpgctx = pakfire_get_gpgctx(pakfire);
unsigned int flags = 0;
return pakfire_key_get(pakfire, result->fpr);
}
-char* pakfire_key_export(PakfireKey key, pakfire_key_export_mode_t mode) {
+PAKFIRE_EXPORT char* pakfire_key_export(PakfireKey key, pakfire_key_export_mode_t mode) {
gpgme_ctx_t gpgctx = pakfire_get_gpgctx(key->pakfire);
gpgme_export_mode_t gpgmode = 0;
return NULL;
}
-PakfireKey* pakfire_key_import(Pakfire pakfire, const char* data) {
+PAKFIRE_EXPORT PakfireKey* pakfire_key_import(Pakfire pakfire, const char* data) {
gpgme_error_t error;
gpgme_data_t keydata;
return NULL;
}
-char* pakfire_key_dump(PakfireKey key) {
+PAKFIRE_EXPORT char* pakfire_key_dump(PakfireKey key) {
char* s = "";
time_t created = pakfire_key_get_created(key);
#include <pakfire/logging.h>
#include <pakfire/pakfire.h>
+#include <pakfire/private.h>
static pakfire_logging_config_t conf = {
.function = pakfire_log_syslog,
pakfire_log_set_priority(log_priority(priority));
}
-pakfire_log_function_t pakfire_log_get_function() {
+PAKFIRE_EXPORT pakfire_log_function_t pakfire_log_get_function() {
return conf.function;
}
-void pakfire_log_set_function(pakfire_log_function_t func) {
+PAKFIRE_EXPORT void pakfire_log_set_function(pakfire_log_function_t func) {
conf.function = func;
}
-int pakfire_log_get_priority() {
+PAKFIRE_EXPORT int pakfire_log_get_priority() {
return conf.priority;
}
-void pakfire_log_set_priority(int priority) {
+PAKFIRE_EXPORT void pakfire_log_set_priority(int priority) {
conf.priority = priority;
}
-void pakfire_log(int priority, const char* file, int line,
+PAKFIRE_EXPORT void pakfire_log(int priority, const char* file, int line,
const char* fn, const char* format, ...) {
va_list args;
errno = saved_errno;
}
-void pakfire_log_stderr(int priority, const char* file,
+PAKFIRE_EXPORT void pakfire_log_stderr(int priority, const char* file,
int line, const char* fn, const char* format, va_list args) {
fprintf(stderr, "pakfire: %s: ", fn);
vfprintf(stderr, format, args);
}
-void pakfire_log_syslog(int priority, const char* file,
+PAKFIRE_EXPORT void pakfire_log_syslog(int priority, const char* file,
int line, const char* fn, const char* format, va_list args) {
openlog("pakfire", LOG_PID, LOG_DAEMON);
vsyslog(priority | LOG_DAEMON, format, args);
#include <pakfire/package.h>
#include <pakfire/packagecache.h>
#include <pakfire/pool.h>
+#include <pakfire/private.h>
#include <pakfire/relation.h>
#include <pakfire/relationlist.h>
#include <pakfire/repo.h>
#endif
}
-PakfirePackage pakfire_package_create(PakfirePool pool, Id id) {
+PAKFIRE_EXPORT PakfirePackage pakfire_package_create(PakfirePool pool, Id id) {
PakfirePackage pkg = pakfire_calloc(1, sizeof(*pkg));
if (pkg) {
return pkg;
}
-PakfirePackage pakfire_package_create2(PakfirePool pool, PakfireRepo repo, const char* name, const char* evr, const char* arch) {
+PAKFIRE_EXPORT PakfirePackage pakfire_package_create2(PakfirePool pool, PakfireRepo repo, const char* name, const char* evr, const char* arch) {
PakfirePackage pkg = pakfire_repo_add_package(repo);
pakfire_package_set_name(pkg, name);
return pkg;
}
-void pakfire_package_free(PakfirePackage pkg) {
+PAKFIRE_EXPORT void pakfire_package_free(PakfirePackage pkg) {
if (--pkg->nrefs > 0)
return;
return s - pool->solvables;
}
-int pakfire_package_identical(PakfirePackage pkg1, PakfirePackage pkg2) {
+PAKFIRE_EXPORT int pakfire_package_identical(PakfirePackage pkg1, PakfirePackage pkg2) {
return pkg1->id == pkg2->id;
}
-int pakfire_package_cmp(PakfirePackage pkg1, PakfirePackage pkg2) {
+PAKFIRE_EXPORT int pakfire_package_cmp(PakfirePackage pkg1, PakfirePackage pkg2) {
Pool* pool = pakfire_package_solv_pool(pkg1);
Solvable* s1 = get_solvable(pkg1);
return strcmp(str1, str2);
}
-int pakfire_package_evr_cmp(PakfirePackage pkg1, PakfirePackage pkg2) {
+PAKFIRE_EXPORT int pakfire_package_evr_cmp(PakfirePackage pkg1, PakfirePackage pkg2) {
Pool* pool = pakfire_package_solv_pool(pkg1);
Solvable* s1 = get_solvable(pkg1);
return pool_evrcmp(pool, s1->evr, s2->evr, EVRCMP_COMPARE);
}
-Id pakfire_package_id(PakfirePackage pkg) {
+PAKFIRE_EXPORT Id pakfire_package_id(PakfirePackage pkg) {
return pkg->id;
}
-char* pakfire_package_get_nevra(PakfirePackage pkg) {
+PAKFIRE_EXPORT char* pakfire_package_get_nevra(PakfirePackage pkg) {
Pool* pool = pakfire_package_solv_pool(pkg);
Solvable* s = get_solvable(pkg);
return pakfire_strdup(nevra);
}
-const char* pakfire_package_get_name(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_name(PakfirePackage pkg) {
Pool* pool = pakfire_package_solv_pool(pkg);
Solvable* s = get_solvable(pkg);
return pool_id2str(pool, s->name);
}
-void pakfire_package_set_name(PakfirePackage pkg, const char* name) {
+PAKFIRE_EXPORT void pakfire_package_set_name(PakfirePackage pkg, const char* name) {
Pool* pool = pakfire_package_solv_pool(pkg);
Solvable* s = get_solvable(pkg);
s->name = pool_str2id(pool, name, 1);
}
-const char* pakfire_package_get_evr(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_evr(PakfirePackage pkg) {
Pool* pool = pakfire_package_solv_pool(pkg);
Solvable* s = get_solvable(pkg);
return pool_id2str(pool, s->evr);
}
-void pakfire_package_set_evr(PakfirePackage pkg, const char* evr) {
+PAKFIRE_EXPORT void pakfire_package_set_evr(PakfirePackage pkg, const char* evr) {
Pool* pool = pakfire_package_solv_pool(pkg);
Solvable* s = get_solvable(pkg);
*release = r;
}
-unsigned long pakfire_package_get_epoch(PakfirePackage pkg) {
+PAKFIRE_EXPORT unsigned long pakfire_package_get_epoch(PakfirePackage pkg) {
Pool* pool = pakfire_package_solv_pool(pkg);
char *e, *v, *r, *endptr;
return epoch;
}
-const char* pakfire_package_get_version(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_version(PakfirePackage pkg) {
Pool* pool = pakfire_package_solv_pool(pkg);
char *e, *v, *r;
return pakfire_strdup(v);
}
-const char* pakfire_package_get_release(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_release(PakfirePackage pkg) {
Pool* pool = pakfire_package_solv_pool(pkg);
char *e, *v, *r;
return pakfire_strdup(r);
}
-const char* pakfire_package_get_arch(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_arch(PakfirePackage pkg) {
Pool* pool = pakfire_package_solv_pool(pkg);
Solvable* s = get_solvable(pkg);
return pool_id2str(pool, s->arch);
}
-void pakfire_package_set_arch(PakfirePackage pkg, const char* arch) {
+PAKFIRE_EXPORT void pakfire_package_set_arch(PakfirePackage pkg, const char* arch) {
Pool* pool = pakfire_package_solv_pool(pkg);
Solvable* s = get_solvable(pkg);
solvable_set_str(s, key, value);
}
-const char* pakfire_package_get_uuid(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_uuid(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_PKGID);
}
-void pakfire_package_set_uuid(PakfirePackage pkg, const char* uuid) {
+PAKFIRE_EXPORT void pakfire_package_set_uuid(PakfirePackage pkg, const char* uuid) {
pakfire_package_set_string(pkg, SOLVABLE_PKGID, uuid);
}
-const char* pakfire_package_get_checksum(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_checksum(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_CHECKSUM);
}
-void pakfire_package_set_checksum(PakfirePackage pkg, const char* checksum) {
+PAKFIRE_EXPORT void pakfire_package_set_checksum(PakfirePackage pkg, const char* checksum) {
pakfire_package_set_string(pkg, SOLVABLE_CHECKSUM, checksum);
}
-const char* pakfire_package_get_summary(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_summary(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_SUMMARY);
}
-void pakfire_package_set_summary(PakfirePackage pkg, const char* summary) {
+PAKFIRE_EXPORT void pakfire_package_set_summary(PakfirePackage pkg, const char* summary) {
pakfire_package_set_string(pkg, SOLVABLE_SUMMARY, summary);
}
-const char* pakfire_package_get_description(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_description(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_DESCRIPTION);
}
-void pakfire_package_set_description(PakfirePackage pkg, const char* description) {
+PAKFIRE_EXPORT void pakfire_package_set_description(PakfirePackage pkg, const char* description) {
pakfire_package_set_string(pkg, SOLVABLE_DESCRIPTION, description);
}
-const char* pakfire_package_get_license(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_license(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_LICENSE);
}
-void pakfire_package_set_license(PakfirePackage pkg, const char* license) {
+PAKFIRE_EXPORT void pakfire_package_set_license(PakfirePackage pkg, const char* license) {
pakfire_package_set_string(pkg, SOLVABLE_LICENSE, license);
}
-const char* pakfire_package_get_url(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_url(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_URL);
}
-void pakfire_package_set_url(PakfirePackage pkg, const char* url) {
+PAKFIRE_EXPORT void pakfire_package_set_url(PakfirePackage pkg, const char* url) {
pakfire_package_set_string(pkg, SOLVABLE_URL, url);
}
#warning the groups functions need to be refactored
-const char** pakfire_package_get_groups(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char** pakfire_package_get_groups(PakfirePackage pkg) {
const char* groups = pakfire_package_get_string(pkg, SOLVABLE_GROUP);
const char** grouplist = NULL;
return grouplist;
}
-void pakfire_package_set_groups(PakfirePackage pkg, const char** grouplist) {
+PAKFIRE_EXPORT void pakfire_package_set_groups(PakfirePackage pkg, const char** grouplist) {
char groups[2048] = "";
if (grouplist) {
pakfire_package_set_string(pkg, SOLVABLE_GROUP, (const char *)&groups);
}
-const char* pakfire_package_get_vendor(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_vendor(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_VENDOR);
}
-void pakfire_package_set_vendor(PakfirePackage pkg, const char* vendor) {
+PAKFIRE_EXPORT void pakfire_package_set_vendor(PakfirePackage pkg, const char* vendor) {
pakfire_package_set_string(pkg, SOLVABLE_VENDOR, vendor);
}
-const char* pakfire_package_get_maintainer(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_maintainer(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_PACKAGER);
}
-void pakfire_package_set_maintainer(PakfirePackage pkg, const char* maintainer) {
+PAKFIRE_EXPORT void pakfire_package_set_maintainer(PakfirePackage pkg, const char* maintainer) {
pakfire_package_set_string(pkg, SOLVABLE_PACKAGER, maintainer);
}
-const char* pakfire_package_get_filename(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_filename(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_MEDIAFILE);
}
-void pakfire_package_set_filename(PakfirePackage pkg, const char* filename) {
+PAKFIRE_EXPORT void pakfire_package_set_filename(PakfirePackage pkg, const char* filename) {
pakfire_package_set_string(pkg, SOLVABLE_MEDIAFILE, filename);
}
-int pakfire_package_is_installed(PakfirePackage pkg) {
+PAKFIRE_EXPORT int pakfire_package_is_installed(PakfirePackage pkg) {
Pool* pool = pakfire_package_solv_pool(pkg);
Solvable* s = get_solvable(pkg);
solvable_set_num(s, type, value);
}
-unsigned long long pakfire_package_get_downloadsize(PakfirePackage pkg) {
+PAKFIRE_EXPORT unsigned long long pakfire_package_get_downloadsize(PakfirePackage pkg) {
return pakfire_package_get_num(pkg, SOLVABLE_DOWNLOADSIZE);
}
-void pakfire_package_set_downloadsize(PakfirePackage pkg, unsigned long long downloadsize) {
+PAKFIRE_EXPORT void pakfire_package_set_downloadsize(PakfirePackage pkg, unsigned long long downloadsize) {
return pakfire_package_set_num(pkg, SOLVABLE_DOWNLOADSIZE, downloadsize);
}
-unsigned long long pakfire_package_get_installsize(PakfirePackage pkg) {
+PAKFIRE_EXPORT unsigned long long pakfire_package_get_installsize(PakfirePackage pkg) {
return pakfire_package_get_num(pkg, SOLVABLE_INSTALLSIZE);
}
-void pakfire_package_set_installsize(PakfirePackage pkg, unsigned long long installsize) {
+PAKFIRE_EXPORT void pakfire_package_set_installsize(PakfirePackage pkg, unsigned long long installsize) {
return pakfire_package_set_num(pkg, SOLVABLE_INSTALLSIZE, installsize);
}
-unsigned long long pakfire_package_get_size(PakfirePackage pkg) {
+PAKFIRE_EXPORT unsigned long long pakfire_package_get_size(PakfirePackage pkg) {
if (pakfire_package_is_installed(pkg))
return pakfire_package_get_installsize(pkg);
return pakfire_package_get_downloadsize(pkg);
}
-const char* pakfire_package_get_buildhost(PakfirePackage pkg) {
+PAKFIRE_EXPORT const char* pakfire_package_get_buildhost(PakfirePackage pkg) {
return pakfire_package_get_string(pkg, SOLVABLE_BUILDHOST);
}
-void pakfire_package_set_buildhost(PakfirePackage pkg, const char* buildhost) {
+PAKFIRE_EXPORT void pakfire_package_set_buildhost(PakfirePackage pkg, const char* buildhost) {
pakfire_package_set_string(pkg, SOLVABLE_BUILDHOST, buildhost);
}
-unsigned long long pakfire_package_get_buildtime(PakfirePackage pkg) {
+PAKFIRE_EXPORT unsigned long long pakfire_package_get_buildtime(PakfirePackage pkg) {
return pakfire_package_get_num(pkg, SOLVABLE_BUILDTIME);
}
-void pakfire_package_set_buildtime(PakfirePackage pkg, unsigned long long buildtime) {
+PAKFIRE_EXPORT void pakfire_package_set_buildtime(PakfirePackage pkg, unsigned long long buildtime) {
pakfire_package_set_num(pkg, SOLVABLE_BUILDTIME, buildtime);
}
-unsigned long long pakfire_package_get_installtime(PakfirePackage pkg) {
+PAKFIRE_EXPORT unsigned long long pakfire_package_get_installtime(PakfirePackage pkg) {
return pakfire_package_get_num(pkg, SOLVABLE_INSTALLTIME);
}
solvable_add_idarray(s, type, relation->id);
}
-PakfireRelationList pakfire_package_get_provides(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireRelationList pakfire_package_get_provides(PakfirePackage pkg) {
return pakfire_package_get_relationlist(pkg, SOLVABLE_PROVIDES);
}
-void pakfire_package_set_provides(PakfirePackage pkg, PakfireRelationList relationlist) {
+PAKFIRE_EXPORT void pakfire_package_set_provides(PakfirePackage pkg, PakfireRelationList relationlist) {
pakfire_package_set_relationlist(pkg, SOLVABLE_PROVIDES, relationlist);
}
-void pakfire_package_add_provides(PakfirePackage pkg, PakfireRelation relation) {
+PAKFIRE_EXPORT void pakfire_package_add_provides(PakfirePackage pkg, PakfireRelation relation) {
pakfire_package_add_relation(pkg, SOLVABLE_PROVIDES, relation);
}
-PakfireRelationList pakfire_package_get_prerequires(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireRelationList pakfire_package_get_prerequires(PakfirePackage pkg) {
#warning TODO
return NULL;
}
-PakfireRelationList pakfire_package_get_requires(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireRelationList pakfire_package_get_requires(PakfirePackage pkg) {
return pakfire_package_get_relationlist(pkg, SOLVABLE_REQUIRES);
}
-void pakfire_package_set_requires(PakfirePackage pkg, PakfireRelationList relationlist) {
+PAKFIRE_EXPORT void pakfire_package_set_requires(PakfirePackage pkg, PakfireRelationList relationlist) {
pakfire_package_set_relationlist(pkg, SOLVABLE_REQUIRES, relationlist);
}
-void pakfire_package_add_requires(PakfirePackage pkg, PakfireRelation relation) {
+PAKFIRE_EXPORT void pakfire_package_add_requires(PakfirePackage pkg, PakfireRelation relation) {
pakfire_package_add_relation(pkg, SOLVABLE_REQUIRES, relation);
}
-PakfireRelationList pakfire_package_get_conflicts(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireRelationList pakfire_package_get_conflicts(PakfirePackage pkg) {
return pakfire_package_get_relationlist(pkg, SOLVABLE_CONFLICTS);
}
-void pakfire_package_set_conflicts(PakfirePackage pkg, PakfireRelationList relationlist) {
+PAKFIRE_EXPORT void pakfire_package_set_conflicts(PakfirePackage pkg, PakfireRelationList relationlist) {
pakfire_package_set_relationlist(pkg, SOLVABLE_CONFLICTS, relationlist);
}
-void pakfire_package_add_conflicts(PakfirePackage pkg, PakfireRelation relation) {
+PAKFIRE_EXPORT void pakfire_package_add_conflicts(PakfirePackage pkg, PakfireRelation relation) {
pakfire_package_add_relation(pkg, SOLVABLE_CONFLICTS, relation);
}
-PakfireRelationList pakfire_package_get_obsoletes(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireRelationList pakfire_package_get_obsoletes(PakfirePackage pkg) {
return pakfire_package_get_relationlist(pkg, SOLVABLE_OBSOLETES);
}
-void pakfire_package_set_obsoletes(PakfirePackage pkg, PakfireRelationList relationlist) {
+PAKFIRE_EXPORT void pakfire_package_set_obsoletes(PakfirePackage pkg, PakfireRelationList relationlist) {
pakfire_package_set_relationlist(pkg, SOLVABLE_OBSOLETES, relationlist);
}
-void pakfire_package_add_obsoletes(PakfirePackage pkg, PakfireRelation relation) {
+PAKFIRE_EXPORT void pakfire_package_add_obsoletes(PakfirePackage pkg, PakfireRelation relation) {
pakfire_package_add_relation(pkg, SOLVABLE_OBSOLETES, relation);
}
-PakfireRelationList pakfire_package_get_recommends(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireRelationList pakfire_package_get_recommends(PakfirePackage pkg) {
return pakfire_package_get_relationlist(pkg, SOLVABLE_RECOMMENDS);
}
-void pakfire_package_set_recommends(PakfirePackage pkg, PakfireRelationList relationlist) {
+PAKFIRE_EXPORT void pakfire_package_set_recommends(PakfirePackage pkg, PakfireRelationList relationlist) {
pakfire_package_set_relationlist(pkg, SOLVABLE_RECOMMENDS, relationlist);
}
-void pakfire_package_add_recommends(PakfirePackage pkg, PakfireRelation relation) {
+PAKFIRE_EXPORT void pakfire_package_add_recommends(PakfirePackage pkg, PakfireRelation relation) {
pakfire_package_add_relation(pkg, SOLVABLE_RECOMMENDS, relation);
}
-PakfireRelationList pakfire_package_get_suggests(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireRelationList pakfire_package_get_suggests(PakfirePackage pkg) {
return pakfire_package_get_relationlist(pkg, SOLVABLE_SUGGESTS);
}
-void pakfire_package_set_suggests(PakfirePackage pkg, PakfireRelationList relationlist) {
+PAKFIRE_EXPORT void pakfire_package_set_suggests(PakfirePackage pkg, PakfireRelationList relationlist) {
pakfire_package_set_relationlist(pkg, SOLVABLE_SUGGESTS, relationlist);
}
-void pakfire_package_add_suggests(PakfirePackage pkg, PakfireRelation relation) {
+PAKFIRE_EXPORT void pakfire_package_add_suggests(PakfirePackage pkg, PakfireRelation relation) {
pakfire_package_add_relation(pkg, SOLVABLE_SUGGESTS, relation);
}
-PakfireRepo pakfire_package_get_repo(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireRepo pakfire_package_get_repo(PakfirePackage pkg) {
Solvable* s = get_solvable(pkg);
return pakfire_repo_create_from_repo(pkg->pool, s->repo);
}
-void pakfire_package_set_repo(PakfirePackage pkg, PakfireRepo repo) {
+PAKFIRE_EXPORT void pakfire_package_set_repo(PakfirePackage pkg, PakfireRepo repo) {
Solvable* s = get_solvable(pkg);
s->repo = pakfire_repo_get_solv_repo(repo);
}
-char* pakfire_package_get_location(PakfirePackage pkg) {
+PAKFIRE_EXPORT char* pakfire_package_get_location(PakfirePackage pkg) {
pakfire_package_internalize_repo(pkg);
Solvable* s = get_solvable(pkg);
}
}
-char* pakfire_package_dump(PakfirePackage pkg, int flags) {
+PAKFIRE_EXPORT char* pakfire_package_dump(PakfirePackage pkg, int flags) {
char* string = "";
// Name
return string;
}
-int pakfire_package_is_cached(PakfirePackage pkg) {
+PAKFIRE_EXPORT int pakfire_package_is_cached(PakfirePackage pkg) {
PakfireCache cache = pakfire_pool_get_cache(pkg->pool);
if (!cache)
return 1;
return pakfire_cache_has_package(cache, pkg);
}
-char* pakfire_package_get_cache_path(PakfirePackage pkg) {
+PAKFIRE_EXPORT char* pakfire_package_get_cache_path(PakfirePackage pkg) {
PakfireCache cache = pakfire_pool_get_cache(pkg->pool);
if (!cache)
return NULL;
return pakfire_cache_get_package_path(cache, pkg);
}
-char* pakfire_package_get_cache_full_path(PakfirePackage pkg) {
+PAKFIRE_EXPORT char* pakfire_package_get_cache_full_path(PakfirePackage pkg) {
char* cache_path = NULL;
char* pkg_cache_path = pakfire_package_get_cache_path(pkg);
return file;
}
-PakfireFile pakfire_package_get_filelist(PakfirePackage pkg) {
+PAKFIRE_EXPORT PakfireFile pakfire_package_get_filelist(PakfirePackage pkg) {
if (!pkg->filelist) {
pkg->filelist = pakfire_package_fetch_filelist(pkg);
}
return pkg->filelist;
}
-PakfireFile pakfire_package_filelist_append(PakfirePackage pkg, const char* filename) {
+PAKFIRE_EXPORT PakfireFile pakfire_package_filelist_append(PakfirePackage pkg, const char* filename) {
PakfireRepo repo = pakfire_package_get_repo(pkg);
Id handle = pakfire_package_get_handle(pkg);
}
#endif
-void pakfire_package_filelist_remove(PakfirePackage pkg) {
+PAKFIRE_EXPORT void pakfire_package_filelist_remove(PakfirePackage pkg) {
if (pkg->filelist)
pakfire_file_free_all(pkg->filelist);
}
#include <pakfire/constants.h>
#include <pakfire/package.h>
#include <pakfire/packagecache.h>
+#include <pakfire/private.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-PakfirePackageCache pakfire_packagecache_create(PakfirePool pool, const char* path) {
+PAKFIRE_EXPORT PakfirePackageCache pakfire_packagecache_create(PakfirePool pool, const char* path) {
PakfirePackageCache cache = pakfire_calloc(1, sizeof(*cache));
cache->pool = pool;
return cache;
}
-void pakfire_packagecache_free(PakfirePackageCache cache) {
+PAKFIRE_EXPORT void pakfire_packagecache_free(PakfirePackageCache cache) {
pakfire_free(cache->path);
pakfire_free(cache);
}
-const char* pakfire_packagecache_get_path(PakfirePackageCache cache) {
+PAKFIRE_EXPORT const char* pakfire_packagecache_get_path(PakfirePackageCache cache) {
return cache->path;
}
-char* pakfire_packagecache_get_package_path(PakfirePackageCache cache, PakfirePackage pkg) {
+PAKFIRE_EXPORT char* pakfire_packagecache_get_package_path(PakfirePackageCache cache, PakfirePackage pkg) {
char buffer[STRING_SIZE] = "";
const char* filename = pakfire_package_get_filename(pkg);
return pakfire_strdup(buffer);
}
-int pakfire_packagecache_has_package(PakfirePackageCache cache, PakfirePackage pkg) {
+PAKFIRE_EXPORT int pakfire_packagecache_has_package(PakfirePackageCache cache, PakfirePackage pkg) {
char* filename = pakfire_packagecache_get_package_path(cache, pkg);
// Check if stat() is successful.
#include <pakfire/package.h>
#include <pakfire/packagelist.h>
+#include <pakfire/private.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
#define BLOCK_SIZE 31
-PakfirePackageList pakfire_packagelist_create(void) {
+PAKFIRE_EXPORT PakfirePackageList pakfire_packagelist_create(void) {
PakfirePackageList list = pakfire_calloc(1, sizeof(*list));
return list;
}
-void pakfire_packagelist_free(PakfirePackageList list) {
+PAKFIRE_EXPORT void pakfire_packagelist_free(PakfirePackageList list) {
for (int i = 0; i < list->count; i++) {
PakfirePackage pkg = list->elements[i];
pakfire_package_free(pkg);
pakfire_free(list);
}
-int pakfire_packagelist_count(PakfirePackageList list) {
+PAKFIRE_EXPORT int pakfire_packagelist_count(PakfirePackageList list) {
return list->count;
}
-int _packagelist_cmp(const void* pkg1, const void* pkg2) {
+PAKFIRE_EXPORT int _packagelist_cmp(const void* pkg1, const void* pkg2) {
return pakfire_package_cmp(*(PakfirePackage*)pkg1, *(PakfirePackage*)pkg2);
}
-void pakfire_packagelist_sort(PakfirePackageList list) {
+PAKFIRE_EXPORT void pakfire_packagelist_sort(PakfirePackageList list) {
qsort(list->elements, list->count, sizeof(*list->elements), _packagelist_cmp);
}
-PakfirePackage pakfire_packagelist_get(PakfirePackageList list, int index) {
+PAKFIRE_EXPORT PakfirePackage pakfire_packagelist_get(PakfirePackageList list, int index) {
if (index < list->count)
return list->elements[index];
return NULL;
}
-int pakfire_packagelist_has(PakfirePackageList list, PakfirePackage pkg) {
+PAKFIRE_EXPORT int pakfire_packagelist_has(PakfirePackageList list, PakfirePackage pkg) {
for (int i = 0; i < list->count; i++) {
PakfirePackage _pkg = list->elements[i];
return 0;
}
-void pakfire_packagelist_push(PakfirePackageList list, PakfirePackage pkg) {
+PAKFIRE_EXPORT void pakfire_packagelist_push(PakfirePackageList list, PakfirePackage pkg) {
list->elements = solv_extend(list->elements, list->count, 1, sizeof(pkg), BLOCK_SIZE);
list->elements[list->count++] = pkg;
}
-void pakfire_packagelist_push_if_not_exists(PakfirePackageList list, PakfirePackage pkg) {
+PAKFIRE_EXPORT void pakfire_packagelist_push_if_not_exists(PakfirePackageList list, PakfirePackage pkg) {
if (pakfire_packagelist_has(list, pkg))
return;
pakfire_packagelist_push(list, pkg);
}
-PakfirePackageList pakfire_packagelist_from_queue(PakfirePool _pool, Queue* q) {
+PAKFIRE_EXPORT PakfirePackageList pakfire_packagelist_from_queue(PakfirePool _pool, Queue* q) {
PakfirePackageList list = pakfire_packagelist_create();
Pool* pool = _pool->pool;
#include <pakfire/pakfire.h>
#include <pakfire/pool.h>
+#include <pakfire/private.h>
#include <pakfire/system.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-int pakfire_init() {
+PAKFIRE_EXPORT int pakfire_init() {
// Setup logging
pakfire_setup_logging();
return 0;
}
-Pakfire pakfire_create(const char* path, const char* arch) {
+PAKFIRE_EXPORT Pakfire pakfire_create(const char* path, const char* arch) {
Pakfire pakfire = pakfire_calloc(1, sizeof(*pakfire));
if (pakfire) {
pakfire->nrefs = 1;
return pakfire;
}
-Pakfire pakfire_ref(Pakfire pakfire) {
+PAKFIRE_EXPORT Pakfire pakfire_ref(Pakfire pakfire) {
++pakfire->nrefs;
return pakfire;
}
-void pakfire_unref(Pakfire pakfire) {
+PAKFIRE_EXPORT void pakfire_unref(Pakfire pakfire) {
if (--pakfire->nrefs > 0)
return;
pakfire_free(pakfire);
}
-const char* pakfire_get_path(Pakfire pakfire) {
+PAKFIRE_EXPORT const char* pakfire_get_path(Pakfire pakfire) {
return pakfire->path;
}
-const char* pakfire_get_arch(Pakfire pakfire) {
+PAKFIRE_EXPORT const char* pakfire_get_arch(Pakfire pakfire) {
return pakfire->arch;
}
-PakfirePool pakfire_get_pool(Pakfire pakfire) {
+PAKFIRE_EXPORT PakfirePool pakfire_get_pool(Pakfire pakfire) {
return pakfire_pool_ref(pakfire->pool);
}
#include <pakfire/packagelist.h>
#include <pakfire/pakfire.h>
#include <pakfire/pool.h>
+#include <pakfire/private.h>
#include <pakfire/repo.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-PakfirePool pakfire_pool_create(Pakfire pakfire) {
+PAKFIRE_EXPORT PakfirePool pakfire_pool_create(Pakfire pakfire) {
PakfirePool pool = pakfire_calloc(1, sizeof(*pool));
if (pool) {
pool->nrefs = 1;
pakfire_free(pool);
}
-PakfirePool pakfire_pool_ref(PakfirePool pool) {
+PAKFIRE_EXPORT PakfirePool pakfire_pool_ref(PakfirePool pool) {
++pool->nrefs;
return pool;
}
-void pakfire_pool_unref(PakfirePool pool) {
+PAKFIRE_EXPORT void pakfire_pool_unref(PakfirePool pool) {
if (--pool->nrefs > 0)
return;
pakfire_pool_free(pool);
}
-int pakfire_pool_version_compare(PakfirePool pool, const char* evr1, const char* evr2) {
+PAKFIRE_EXPORT int pakfire_pool_version_compare(PakfirePool pool, const char* evr1, const char* evr2) {
return pool_evrcmp_str(pool->pool, evr1, evr2, EVRCMP_COMPARE);
}
-int pakfire_pool_count(PakfirePool pool) {
+PAKFIRE_EXPORT int pakfire_pool_count(PakfirePool pool) {
int cnt = 0;
for (int i = 2; i < pool->pool->nsolvables; i++) {
return cnt;
}
-void pakfire_pool_make_provides_ready(PakfirePool pool) {
+PAKFIRE_EXPORT void pakfire_pool_make_provides_ready(PakfirePool pool) {
if (!pool->provides_ready) {
pool_addfileprovides(pool->pool);
pool_createwhatprovides(pool->pool);
}
}
-PakfireRepo pakfire_pool_get_installed_repo(PakfirePool pool) {
+PAKFIRE_EXPORT PakfireRepo pakfire_pool_get_installed_repo(PakfirePool pool) {
Pool* p = pool->pool;
if (!p->installed)
return pakfire_repo_create_from_repo(pool, p->installed);
}
-void pakfire_pool_set_installed_repo(PakfirePool pool, PakfireRepo repo) {
+PAKFIRE_EXPORT void pakfire_pool_set_installed_repo(PakfirePool pool, PakfireRepo repo) {
if (!repo) {
pool_set_installed(pool->pool, NULL);
return;
pool_set_installed(pool->pool, repo->repo);
}
-const char** pakfire_pool_get_installonly(PakfirePool pool) {
+PAKFIRE_EXPORT const char** pakfire_pool_get_installonly(PakfirePool pool) {
Queue q;
queue_init_clone(&q, &pool->installonly);
return installonly;
}
-void pakfire_pool_set_installonly(PakfirePool pool, const char** installonly) {
+PAKFIRE_EXPORT void pakfire_pool_set_installonly(PakfirePool pool, const char** installonly) {
queue_empty(&pool->installonly);
if (installonly == NULL)
queue_pushunique(&pool->installonly, pool_str2id(pool->pool, name, 1));
}
-const char* pakfire_pool_get_cache_path(PakfirePool pool) {
+PAKFIRE_EXPORT const char* pakfire_pool_get_cache_path(PakfirePool pool) {
if (!pool->cache)
return NULL;
return pakfire_cache_get_path(pool->cache);
}
-void pakfire_pool_set_cache_path(PakfirePool pool, const char* path) {
+PAKFIRE_EXPORT void pakfire_pool_set_cache_path(PakfirePool pool, const char* path) {
if (pool->cache)
pakfire_cache_free(pool->cache);
pool->cache = pakfire_cache_create(pool, path);
}
-PakfireCache pakfire_pool_get_cache(PakfirePool pool) {
+PAKFIRE_EXPORT PakfireCache pakfire_pool_get_cache(PakfirePool pool) {
if (pool->cache)
return pool->cache;
return pakfire_pool_dataiterator(_pool, provides, SOLVABLE_PROVIDES, flags);
}
-PakfirePackageList pakfire_pool_whatprovides(PakfirePool pool, const char* what, int flags) {
+PAKFIRE_EXPORT PakfirePackageList pakfire_pool_whatprovides(PakfirePool pool, const char* what, int flags) {
assert((flags & ~(PAKFIRE_ICASE|PAKFIRE_NAME_ONLY|PAKFIRE_GLOB)) == 0);
if (flags & PAKFIRE_NAME_ONLY) {
}
}
-PakfirePackageList pakfire_pool_search(PakfirePool pool, const char* what, int flags) {
+PAKFIRE_EXPORT PakfirePackageList pakfire_pool_search(PakfirePool pool, const char* what, int flags) {
return pakfire_pool_dataiterator(pool, what, 0, PAKFIRE_SUBSTRING);
}
-char* pakfire_pool_tmpdup(Pool* pool, const char* s) {
+PAKFIRE_EXPORT char* pakfire_pool_tmpdup(Pool* pool, const char* s) {
char* dup = pool_alloctmpspace(pool, strlen(s) + 1);
return strcpy(dup, s);
#include <pakfire/constants.h>
#include <pakfire/i18n.h>
+#include <pakfire/private.h>
#include <pakfire/problem.h>
#include <pakfire/request.h>
#include <pakfire/solution.h>
return pakfire_strdup(s);
}
-PakfireProblem pakfire_problem_create(PakfireRequest request, Id id) {
+PAKFIRE_EXPORT PakfireProblem pakfire_problem_create(PakfireRequest request, Id id) {
PakfireProblem problem = pakfire_calloc(1, sizeof(*problem));
problem->request = pakfire_request_ref(request);
return problem;
}
-PakfireProblem pakfire_problem_ref(PakfireProblem problem) {
+PAKFIRE_EXPORT PakfireProblem pakfire_problem_ref(PakfireProblem problem) {
problem->nrefs++;
return problem;
}
-void pakfire_problem_free(PakfireProblem problem) {
+PAKFIRE_EXPORT void pakfire_problem_free(PakfireProblem problem) {
if (--problem->nrefs > 0)
return;
pakfire_free(problem);
}
-PakfireProblem pakfire_problem_next(PakfireProblem problem) {
+PAKFIRE_EXPORT PakfireProblem pakfire_problem_next(PakfireProblem problem) {
return problem->next;
}
-void pakfire_problem_append(PakfireProblem problem, PakfireProblem new_problem) {
+PAKFIRE_EXPORT void pakfire_problem_append(PakfireProblem problem, PakfireProblem new_problem) {
PakfireProblem next;
// Go to last problem in list
problem->next = pakfire_problem_ref(new_problem);
}
-const char* pakfire_problem_to_string(PakfireProblem problem) {
+PAKFIRE_EXPORT const char* pakfire_problem_to_string(PakfireProblem problem) {
return problem->string;
}
-PakfireSolution pakfire_problem_get_solutions(PakfireProblem problem) {
+PAKFIRE_EXPORT PakfireSolution pakfire_problem_get_solutions(PakfireProblem problem) {
PakfireSolution ret = NULL;
Id solution = 0;
#include <pakfire/packagelist.h>
#include <pakfire/pool.h>
+#include <pakfire/private.h>
#include <pakfire/relation.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
return flags;
}
-PakfireRelation pakfire_relation_create(PakfirePool pool, const char* name, int cmp_type, const char* evr) {
+PAKFIRE_EXPORT PakfireRelation pakfire_relation_create(PakfirePool pool, const char* name, int cmp_type, const char* evr) {
Pool* p = pool->pool;
Id id = pool_str2id(p, name, 1);
return pakfire_relation_create_from_id(pool, id);
}
-PakfireRelation pakfire_relation_create_from_id(PakfirePool pool, Id id) {
+PAKFIRE_EXPORT PakfireRelation pakfire_relation_create_from_id(PakfirePool pool, Id id) {
PakfireRelation relation = pakfire_calloc(1, sizeof(*relation));
relation->pool = pool;
return relation;
}
-void pakfire_relation_free(PakfireRelation relation) {
+PAKFIRE_EXPORT void pakfire_relation_free(PakfireRelation relation) {
pakfire_free(relation);
}
-Id pakfire_relation_id(PakfireRelation relation) {
+PAKFIRE_EXPORT Id pakfire_relation_id(PakfireRelation relation) {
return relation->id;
}
-char* pakfire_relation_str(PakfireRelation relation) {
+PAKFIRE_EXPORT char* pakfire_relation_str(PakfireRelation relation) {
Pool* pool = pakfire_relation_solv_pool(relation);
const char* str = pool_dep2str(pool, relation->id);
return pakfire_strdup(str);
}
-int pakfire_relation2queue(const PakfireRelation relation, Queue* queue, int solver_action) {
+PAKFIRE_EXPORT int pakfire_relation2queue(const PakfireRelation relation, Queue* queue, int solver_action) {
queue_push2(queue, SOLVER_SOLVABLE_PROVIDES|solver_action, relation->id);
return 0;
}
-PakfirePackageList pakfire_relation_providers(PakfireRelation relation) {
+PAKFIRE_EXPORT PakfirePackageList pakfire_relation_providers(PakfireRelation relation) {
Queue q;
queue_init(&q);
#include <solv/queue.h>
#include <pakfire/pool.h>
+#include <pakfire/private.h>
#include <pakfire/relation.h>
#include <pakfire/relationlist.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-PakfireRelationList pakfire_relationlist_create(PakfirePool pool) {
+PAKFIRE_EXPORT PakfireRelationList pakfire_relationlist_create(PakfirePool pool) {
PakfireRelationList relationlist = pakfire_calloc(1, sizeof(*relationlist));
if (relationlist) {
relationlist->pool = pool;
return relationlist;
}
-void pakfire_relationlist_free(PakfireRelationList relationlist) {
+PAKFIRE_EXPORT void pakfire_relationlist_free(PakfireRelationList relationlist) {
queue_free(&relationlist->queue);
pakfire_free(relationlist);
}
-void pakfire_relationlist_add(PakfireRelationList relationlist, PakfireRelation relation) {
+PAKFIRE_EXPORT void pakfire_relationlist_add(PakfireRelationList relationlist, PakfireRelation relation) {
queue_push(&relationlist->queue, relation->id);
}
-int pakfire_relationlist_count(PakfireRelationList relationlist) {
+PAKFIRE_EXPORT int pakfire_relationlist_count(PakfireRelationList relationlist) {
return relationlist->queue.count;
}
-PakfireRelationList pakfire_relationlist_from_queue(PakfirePool pool, Queue q) {
+PAKFIRE_EXPORT PakfireRelationList pakfire_relationlist_from_queue(PakfirePool pool, Queue q) {
PakfireRelationList relationlist = pakfire_calloc(1, sizeof(*relationlist));
if (relationlist) {
relationlist->pool = pool;
return relationlist;
}
-PakfireRelation pakfire_relationlist_get_clone(PakfireRelationList relationlist, int index) {
+PAKFIRE_EXPORT PakfireRelation pakfire_relationlist_get_clone(PakfireRelationList relationlist, int index) {
Id id = relationlist->queue.elements[index];
return pakfire_relation_create_from_id(relationlist->pool, id);
}
-void pakfire_relationlist_clone_to_queue(PakfireRelationList relationlist, Queue* q) {
+PAKFIRE_EXPORT void pakfire_relationlist_clone_to_queue(PakfireRelationList relationlist, Queue* q) {
queue_init_clone(q, &relationlist->queue);
}
#include <pakfire/errno.h>
#include <pakfire/package.h>
#include <pakfire/pool.h>
+#include <pakfire/private.h>
#include <pakfire/repo.h>
#include <pakfire/repocache.h>
#include <pakfire/types.h>
return NULL;
}
-PakfireRepo pakfire_repo_create(PakfirePool pool, const char* name) {
+PAKFIRE_EXPORT PakfireRepo pakfire_repo_create(PakfirePool pool, const char* name) {
PakfireRepo repo = get_pakfire_repo_by_name(pool, name);
if (repo) {
repo->nrefs++;
return pakfire_repo_create_from_repo(pool, r);
}
-PakfireRepo pakfire_repo_create_from_repo(PakfirePool pool, Repo* r) {
+PAKFIRE_EXPORT PakfireRepo pakfire_repo_create_from_repo(PakfirePool pool, Repo* r) {
PakfireRepo repo;
if (r->appdata) {
return repo;
}
-void pakfire_repo_free(PakfireRepo repo) {
+PAKFIRE_EXPORT void pakfire_repo_free(PakfireRepo repo) {
if (--repo->nrefs > 0)
return;
pakfire_free(repo);
}
-PakfirePool pakfire_repo_pool(PakfireRepo repo) {
+PAKFIRE_EXPORT PakfirePool pakfire_repo_pool(PakfireRepo repo) {
return repo->pool;
}
-int pakfire_repo_identical(PakfireRepo repo1, PakfireRepo repo2) {
+PAKFIRE_EXPORT int pakfire_repo_identical(PakfireRepo repo1, PakfireRepo repo2) {
Repo* r1 = repo1->repo;
Repo* r2 = repo2->repo;
return strcmp(r1->name, r2->name);
}
-int pakfire_repo_cmp(PakfireRepo repo1, PakfireRepo repo2) {
+PAKFIRE_EXPORT int pakfire_repo_cmp(PakfireRepo repo1, PakfireRepo repo2) {
Repo* r1 = repo1->repo;
Repo* r2 = repo2->repo;
return strcmp(r1->name, r2->name);
}
-int pakfire_repo_count(PakfireRepo repo) {
+PAKFIRE_EXPORT int pakfire_repo_count(PakfireRepo repo) {
Pool* pool = pakfire_repo_solv_pool(repo);
int cnt = 0;
return cnt;
}
-void pakfire_repo_internalize(PakfireRepo repo) {
+PAKFIRE_EXPORT void pakfire_repo_internalize(PakfireRepo repo) {
repo_internalize(repo->repo);
}
-const char* pakfire_repo_get_name(PakfireRepo repo) {
+PAKFIRE_EXPORT const char* pakfire_repo_get_name(PakfireRepo repo) {
return repo->repo->name;
}
-void pakfire_repo_set_name(PakfireRepo repo, const char* name) {
+PAKFIRE_EXPORT void pakfire_repo_set_name(PakfireRepo repo, const char* name) {
repo->repo->name = pakfire_strdup(name);
}
-int pakfire_repo_get_enabled(PakfireRepo repo) {
+PAKFIRE_EXPORT int pakfire_repo_get_enabled(PakfireRepo repo) {
return !repo->repo->disabled;
}
-void pakfire_repo_set_enabled(PakfireRepo repo, int enabled) {
+PAKFIRE_EXPORT void pakfire_repo_set_enabled(PakfireRepo repo, int enabled) {
repo->repo->disabled = !enabled;
PakfirePool pool = pakfire_repo_pool(repo);
pool->provides_ready = 0;
}
-int pakfire_repo_get_priority(PakfireRepo repo) {
+PAKFIRE_EXPORT int pakfire_repo_get_priority(PakfireRepo repo) {
return repo->repo->priority;
}
-void pakfire_repo_set_priority(PakfireRepo repo, int priority) {
+PAKFIRE_EXPORT void pakfire_repo_set_priority(PakfireRepo repo, int priority) {
repo->repo->priority = priority;
}
-int pakfire_repo_is_installed_repo(PakfireRepo repo) {
+PAKFIRE_EXPORT int pakfire_repo_is_installed_repo(PakfireRepo repo) {
PakfirePool pool = pakfire_repo_pool(repo);
PakfireRepo installed_repo = pakfire_pool_get_installed_repo(pool);
return pakfire_repo_identical(repo, installed_repo);
}
-int pakfire_repo_read_solv(PakfireRepo repo, const char* filename, int flags) {
+PAKFIRE_EXPORT int pakfire_repo_read_solv(PakfireRepo repo, const char* filename, int flags) {
FILE* f = fopen(filename, "rb");
if (!f) {
return PAKFIRE_E_IO;
return f;
}
-int pakfire_repo_read_solv_fp(PakfireRepo repo, FILE *f, int flags) {
+PAKFIRE_EXPORT int pakfire_repo_read_solv_fp(PakfireRepo repo, FILE *f, int flags) {
f = decompression_proxy(f);
int ret = repo_add_solv(repo->repo, f, flags);
return ret;
}
-int pakfire_repo_write_solv(PakfireRepo repo, const char* filename, int flags) {
+PAKFIRE_EXPORT int pakfire_repo_write_solv(PakfireRepo repo, const char* filename, int flags) {
FILE* f = fopen(filename, "wb");
if (!f) {
return PAKFIRE_E_IO;
return ret;
}
-int pakfire_repo_write_solv_fp(PakfireRepo repo, FILE *f, int flags) {
+PAKFIRE_EXPORT int pakfire_repo_write_solv_fp(PakfireRepo repo, FILE *f, int flags) {
pakfire_repo_internalize(repo);
return repo_write(repo->repo, f);
}
-PakfirePackage pakfire_repo_add_package(PakfireRepo repo) {
+PAKFIRE_EXPORT PakfirePackage pakfire_repo_add_package(PakfireRepo repo) {
Id id = repo_add_solvable(repo->repo);
return pakfire_package_create(repo->pool, id);
}
-PakfireRepoCache pakfire_repo_get_cache(PakfireRepo repo) {
+PAKFIRE_EXPORT PakfireRepoCache pakfire_repo_get_cache(PakfireRepo repo) {
assert(repo);
return repo->cache;
}
-int pakfire_repo_clean(PakfireRepo repo) {
+PAKFIRE_EXPORT int pakfire_repo_clean(PakfireRepo repo) {
PakfireRepoCache cache = pakfire_repo_get_cache(repo);
if (cache)
#include <pakfire/cache.h>
#include <pakfire/constants.h>
#include <pakfire/package.h>
+#include <pakfire/private.h>
#include <pakfire/repo.h>
#include <pakfire/repocache.h>
#include <pakfire/types.h>
return pakfire_strdup(buffer);
}
-PakfireRepoCache pakfire_repocache_create(PakfireRepo repo) {
+PAKFIRE_EXPORT PakfireRepoCache pakfire_repocache_create(PakfireRepo repo) {
PakfireRepoCache repo_cache = pakfire_calloc(1, sizeof(*repo_cache));
repo_cache->repo = repo;
return repo_cache;
}
-void pakfire_repocache_free(PakfireRepoCache repo_cache) {
+PAKFIRE_EXPORT void pakfire_repocache_free(PakfireRepoCache repo_cache) {
pakfire_free(repo_cache->prefix);
pakfire_free(repo_cache);
}
-char* pakfire_repocache_get_cache_path(PakfireRepoCache repo_cache, const char* path) {
+PAKFIRE_EXPORT char* pakfire_repocache_get_cache_path(PakfireRepoCache repo_cache, const char* path) {
return pakfire_path_join(repo_cache->prefix, path);
}
-char* pakfire_repocache_get_full_path(PakfireRepoCache repo_cache, const char* path) {
+PAKFIRE_EXPORT char* pakfire_repocache_get_full_path(PakfireRepoCache repo_cache, const char* path) {
char* cache_path = pakfire_repocache_get_cache_path(repo_cache, path);
PakfireCache cache = pakfire_repocache_cache(repo_cache);
return full_path;
}
-int pakfire_repocache_has_file(PakfireRepoCache repo_cache, const char* filename) {
+PAKFIRE_EXPORT int pakfire_repocache_has_file(PakfireRepoCache repo_cache, const char* filename) {
char* cache_filename = pakfire_repocache_get_cache_path(repo_cache, filename);
PakfireCache cache = pakfire_repocache_cache(repo_cache);
return r;
}
-int pakfire_repocache_age(PakfireRepoCache repo_cache, const char* filename) {
+PAKFIRE_EXPORT int pakfire_repocache_age(PakfireRepoCache repo_cache, const char* filename) {
char* cache_filename = pakfire_repocache_get_cache_path(repo_cache, filename);
PakfireCache cache = pakfire_repocache_cache(repo_cache);
return age;
}
-FILE* pakfire_repocache_open(PakfireRepoCache repo_cache, const char* filename, const char* flags) {
+PAKFIRE_EXPORT FILE* pakfire_repocache_open(PakfireRepoCache repo_cache, const char* filename, const char* flags) {
char* cache_filename = pakfire_repocache_get_cache_path(repo_cache, filename);
PakfireCache cache = pakfire_repocache_cache(repo_cache);
return remove(path);
}
-int pakfire_repocache_destroy(PakfireRepoCache repo_cache) {
+PAKFIRE_EXPORT int pakfire_repocache_destroy(PakfireRepoCache repo_cache) {
// Completely delete the tree of files
return nftw(repo_cache->prefix, _unlink, 64, FTW_DEPTH|FTW_PHYS);
}
#endif
#include <pakfire/package.h>
+#include <pakfire/private.h>
#include <pakfire/problem.h>
#include <pakfire/request.h>
#include <pakfire/selector.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-PakfireRequest pakfire_request_create(PakfirePool pool) {
+PAKFIRE_EXPORT PakfireRequest pakfire_request_create(PakfirePool pool) {
PakfireRequest request = pakfire_calloc(1, sizeof(*request));
request->pool = pool;
return request;
}
-PakfireRequest pakfire_request_ref(PakfireRequest request) {
+PAKFIRE_EXPORT PakfireRequest pakfire_request_ref(PakfireRequest request) {
request->nrefs++;
return request;
}
-void pakfire_request_free(PakfireRequest request) {
+PAKFIRE_EXPORT void pakfire_request_free(PakfireRequest request) {
if (--request->nrefs > 0)
return;
pakfire_free(request);
}
-PakfirePool pakfire_request_pool(PakfireRequest request) {
+PAKFIRE_EXPORT PakfirePool pakfire_request_pool(PakfireRequest request) {
return request->pool;
}
return 0;
}
-int pakfire_request_solve(PakfireRequest request, int flags) {
+PAKFIRE_EXPORT int pakfire_request_solve(PakfireRequest request, int flags) {
init_solver(request, flags);
Queue queue;
return ret;
}
-PakfireProblem pakfire_request_get_problems(PakfireRequest request) {
+PAKFIRE_EXPORT PakfireProblem pakfire_request_get_problems(PakfireRequest request) {
Id problem = 0;
PakfireProblem ret = NULL;
return ret;
}
-PakfireTransaction pakfire_request_get_transaction(PakfireRequest request) {
+PAKFIRE_EXPORT PakfireTransaction pakfire_request_get_transaction(PakfireRequest request) {
if (!request->transaction)
return NULL;
return pakfire_transaction_create(request->pool, request->transaction);
}
-int pakfire_request_install(PakfireRequest request, PakfirePackage package) {
+PAKFIRE_EXPORT int pakfire_request_install(PakfireRequest request, PakfirePackage package) {
queue_push2(&request->queue, SOLVER_SOLVABLE|SOLVER_INSTALL, pakfire_package_id(package));
return 0;
}
-int pakfire_request_install_relation(PakfireRequest request, PakfireRelation relation) {
+PAKFIRE_EXPORT int pakfire_request_install_relation(PakfireRequest request, PakfireRelation relation) {
return pakfire_relation2queue(relation, &request->queue, SOLVER_INSTALL);
}
-int pakfire_request_install_selector(PakfireRequest request, PakfireSelector selector) {
+PAKFIRE_EXPORT int pakfire_request_install_selector(PakfireRequest request, PakfireSelector selector) {
return pakfire_selector2queue(selector, &request->queue, SOLVER_INSTALL);
}
return additional;
}
-int pakfire_request_erase(PakfireRequest request, PakfirePackage package, int flags) {
+PAKFIRE_EXPORT int pakfire_request_erase(PakfireRequest request, PakfirePackage package, int flags) {
int additional = erase_flags(flags);
queue_push2(&request->queue, SOLVER_SOLVABLE|SOLVER_ERASE|additional, pakfire_package_id(package));
return 0;
}
-int pakfire_request_erase_relation(PakfireRequest request, PakfireRelation relation, int flags) {
+PAKFIRE_EXPORT int pakfire_request_erase_relation(PakfireRequest request, PakfireRelation relation, int flags) {
int additional = erase_flags(flags);
return pakfire_relation2queue(relation, &request->queue, SOLVER_ERASE|additional);
}
-int pakfire_request_erase_selector(PakfireRequest request, PakfireSelector selector, int flags) {
+PAKFIRE_EXPORT int pakfire_request_erase_selector(PakfireRequest request, PakfireSelector selector, int flags) {
int additional = erase_flags(flags);
return pakfire_selector2queue(selector, &request->queue, SOLVER_ERASE|additional);
}
-int pakfire_request_upgrade(PakfireRequest request, PakfirePackage package) {
+PAKFIRE_EXPORT int pakfire_request_upgrade(PakfireRequest request, PakfirePackage package) {
return pakfire_request_install(request, package);
}
-int pakfire_request_upgrade_relation(PakfireRequest request, PakfireRelation relation) {
+PAKFIRE_EXPORT int pakfire_request_upgrade_relation(PakfireRequest request, PakfireRelation relation) {
return pakfire_relation2queue(relation, &request->queue, SOLVER_UPDATE);
}
-int pakfire_request_upgrade_selector(PakfireRequest request, PakfireSelector selector) {
+PAKFIRE_EXPORT int pakfire_request_upgrade_selector(PakfireRequest request, PakfireSelector selector) {
return pakfire_selector2queue(selector, &request->queue, SOLVER_UPDATE);
}
-int pakfire_request_upgrade_all(PakfireRequest request) {
+PAKFIRE_EXPORT int pakfire_request_upgrade_all(PakfireRequest request) {
queue_push2(&request->queue, SOLVER_UPDATE|SOLVER_SOLVABLE_ALL, 0);
return 0;
}
-int pakfire_request_distupgrade(PakfireRequest request) {
+PAKFIRE_EXPORT int pakfire_request_distupgrade(PakfireRequest request) {
queue_push2(&request->queue, SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL, 0);
return 0;
}
-int pakfire_request_lock(PakfireRequest request, PakfirePackage package) {
+PAKFIRE_EXPORT int pakfire_request_lock(PakfireRequest request, PakfirePackage package) {
queue_push2(&request->queue, SOLVER_SOLVABLE|SOLVER_LOCK, pakfire_package_id(package));
return 0;
}
-int pakfire_request_lock_relation(PakfireRequest request, PakfireRelation relation) {
+PAKFIRE_EXPORT int pakfire_request_lock_relation(PakfireRequest request, PakfireRelation relation) {
return pakfire_relation2queue(relation, &request->queue, SOLVER_LOCK);
}
-int pakfire_request_lock_selector(PakfireRequest request, PakfireSelector selector) {
+PAKFIRE_EXPORT int pakfire_request_lock_selector(PakfireRequest request, PakfireSelector selector) {
return pakfire_selector2queue(selector, &request->queue, SOLVER_LOCK);
}
-int pakfire_request_verify(PakfireRequest request) {
+PAKFIRE_EXPORT int pakfire_request_verify(PakfireRequest request) {
queue_push2(&request->queue, SOLVER_VERIFY|SOLVER_SOLVABLE_ALL, 0);
return 0;
#include <pakfire/package.h>
#include <pakfire/packagelist.h>
#include <pakfire/pool.h>
+#include <pakfire/private.h>
#include <pakfire/selector.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-PakfireSelector pakfire_selector_create(PakfirePool pool) {
+PAKFIRE_EXPORT PakfireSelector pakfire_selector_create(PakfirePool pool) {
PakfireSelector selector = pakfire_calloc(1, sizeof(*selector));
selector->pool = pool;
return selector;
}
-void pakfire_selector_free(PakfireSelector selector) {
+PAKFIRE_EXPORT void pakfire_selector_free(PakfireSelector selector) {
pakfire_free(selector);
}
*filter = f;
}
-int pakfire_selector_set(PakfireSelector selector, int keyname, int cmp_type, const char* match) {
+PAKFIRE_EXPORT int pakfire_selector_set(PakfireSelector selector, int keyname, int cmp_type, const char* match) {
if (!pakfire_selector_valid_setting(keyname, cmp_type))
return PAKFIRE_E_SELECTOR;
return 0;
}
-PakfirePackageList pakfire_selector_providers(PakfireSelector selector) {
+PAKFIRE_EXPORT PakfirePackageList pakfire_selector_providers(PakfireSelector selector) {
Queue q;
queue_init(&q);
return 0;
}
-int pakfire_selector2queue(const PakfireSelector selector, Queue* queue, int solver_action) {
+PAKFIRE_EXPORT int pakfire_selector2queue(const PakfireSelector selector, Queue* queue, int solver_action) {
PakfirePool pool = selector->pool;
int ret = 0;
#include <pakfire/constants.h>
#include <pakfire/i18n.h>
+#include <pakfire/private.h>
#include <pakfire/problem.h>
#include <pakfire/solution.h>
#include <pakfire/util.h>
*elements = NULL;
}
-PakfireSolution pakfire_solution_create(PakfireProblem problem, Id id) {
+PAKFIRE_EXPORT PakfireSolution pakfire_solution_create(PakfireProblem problem, Id id) {
PakfireSolution solution = pakfire_calloc(1, sizeof(*solution));
solution->problem = pakfire_problem_ref(problem);
return solution;
}
-PakfireSolution pakfire_solution_ref(PakfireSolution solution) {
+PAKFIRE_EXPORT PakfireSolution pakfire_solution_ref(PakfireSolution solution) {
solution->nrefs++;
return solution;
}
-void pakfire_solution_free(PakfireSolution solution) {
+PAKFIRE_EXPORT void pakfire_solution_free(PakfireSolution solution) {
if (--solution->nrefs > 0)
return;
pakfire_free(solution);
}
-PakfireSolution pakfire_solution_next(PakfireSolution solution) {
+PAKFIRE_EXPORT PakfireSolution pakfire_solution_next(PakfireSolution solution) {
return solution->next;
}
-void pakfire_solution_append(PakfireSolution solution, PakfireSolution new_solution) {
+PAKFIRE_EXPORT void pakfire_solution_append(PakfireSolution solution, PakfireSolution new_solution) {
PakfireSolution next;
// Go to last problem in list
return length;
}
-char* pakfire_solution_to_string(PakfireSolution solution) {
+PAKFIRE_EXPORT char* pakfire_solution_to_string(PakfireSolution solution) {
// Determine length of output string
size_t length = count_elements_length(solution);
#include <pakfire/cache.h>
#include <pakfire/constants.h>
#include <pakfire/package.h>
+#include <pakfire/private.h>
#include <pakfire/repo.h>
#include <pakfire/step.h>
#include <pakfire/transaction.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-PakfireStep pakfire_step_create(PakfireTransaction transaction, Id id) {
+PAKFIRE_EXPORT PakfireStep pakfire_step_create(PakfireTransaction transaction, Id id) {
PakfireStep step = pakfire_calloc(1, sizeof(*step));
step->pool = pakfire_transaction_pool(transaction);
return step;
}
-void pakfire_step_free(PakfireStep step) {
+PAKFIRE_EXPORT void pakfire_step_free(PakfireStep step) {
pakfire_free(step);
}
-PakfirePackage pakfire_step_get_package(PakfireStep step) {
+PAKFIRE_EXPORT PakfirePackage pakfire_step_get_package(PakfireStep step) {
return pakfire_package_create(step->pool, step->id);
}
-pakfire_step_type pakfire_step_get_type(PakfireStep step) {
+PAKFIRE_EXPORT pakfire_step_type pakfire_step_get_type(PakfireStep step) {
Transaction* trans = step->transaction->transaction;
int type = transaction_type(trans, step->id,
}
}
-const char* pakfire_step_get_type_string(PakfireStep step) {
+PAKFIRE_EXPORT const char* pakfire_step_get_type_string(PakfireStep step) {
pakfire_step_type type = pakfire_step_get_type(step);
switch(type) {
return 0;
}
-unsigned long long pakfire_step_get_downloadsize(PakfireStep step) {
+PAKFIRE_EXPORT unsigned long long pakfire_step_get_downloadsize(PakfireStep step) {
PakfirePackage pkg = NULL;
int downloadsize = 0;
return downloadsize;
}
-long pakfire_step_get_installsizechange(PakfireStep step) {
+PAKFIRE_EXPORT long pakfire_step_get_installsizechange(PakfireStep step) {
PakfirePackage pkg = pakfire_step_get_package(step);
int installsize = pakfire_package_get_installsize(pkg);
return installsize;
}
-int pakfire_step_needs_download(PakfireStep step) {
+PAKFIRE_EXPORT int pakfire_step_needs_download(PakfireStep step) {
PakfirePackage pkg = NULL;
int ret = true;
return 0; // TODO
}
-int pakfire_step_run(PakfireStep step, const pakfire_action_type action) {
+PAKFIRE_EXPORT int pakfire_step_run(PakfireStep step, const pakfire_action_type action) {
pakfire_step_type type = pakfire_step_get_type(step);
// Get the package
#include <pakfire/i18n.h>
#include <pakfire/package.h>
#include <pakfire/packagelist.h>
+#include <pakfire/private.h>
#include <pakfire/repo.h>
#include <pakfire/step.h>
#include <pakfire/transaction.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
-PakfireTransaction pakfire_transaction_create(PakfirePool pool, Transaction* trans) {
+PAKFIRE_EXPORT PakfireTransaction pakfire_transaction_create(PakfirePool pool, Transaction* trans) {
PakfireTransaction transaction = pakfire_calloc(1, sizeof(*transaction));
transaction->pool = pool;
return transaction;
}
-void pakfire_transaction_free(PakfireTransaction transaction) {
+PAKFIRE_EXPORT void pakfire_transaction_free(PakfireTransaction transaction) {
transaction_free(transaction->transaction);
pakfire_free(transaction);
}
-size_t pakfire_transaction_count(PakfireTransaction transaction) {
+PAKFIRE_EXPORT size_t pakfire_transaction_count(PakfireTransaction transaction) {
return transaction->transaction->steps.count;
}
-ssize_t pakfire_transaction_installsizechange(PakfireTransaction transaction) {
+PAKFIRE_EXPORT ssize_t pakfire_transaction_installsizechange(PakfireTransaction transaction) {
ssize_t sizechange = transaction_calc_installsizechange(transaction->transaction);
// Convert from kbytes to bytes
return sizechange * 1024;
}
-ssize_t pakfire_transaction_downloadsize(PakfireTransaction transaction) {
+PAKFIRE_EXPORT ssize_t pakfire_transaction_downloadsize(PakfireTransaction transaction) {
PakfirePool pool = pakfire_transaction_pool(transaction);
ssize_t size = 0;
return size;
}
-PakfireStep pakfire_transaction_get_step(PakfireTransaction transaction, int index) {
+PAKFIRE_EXPORT PakfireStep pakfire_transaction_get_step(PakfireTransaction transaction, int index) {
Transaction* trans = transaction->transaction;
if (index >= trans->steps.count)
return pakfire_step_create(transaction, trans->steps.elements[index]);
}
-PakfirePackageList pakfire_transaction_get_packages(PakfireTransaction transaction, int type) {
+PAKFIRE_EXPORT PakfirePackageList pakfire_transaction_get_packages(PakfireTransaction transaction, int type) {
PakfirePool pool = pakfire_transaction_pool(transaction);
PakfirePackageList packagelist = pakfire_packagelist_create();
pakfire_free(s);
}
-char* pakfire_transaction_dump(PakfireTransaction transaction, size_t width) {
+PAKFIRE_EXPORT char* pakfire_transaction_dump(PakfireTransaction transaction, size_t width) {
char* string = "";
// Header
return r;
}
-int pakfire_transaction_run(PakfireTransaction transaction) {
+PAKFIRE_EXPORT int pakfire_transaction_run(PakfireTransaction transaction) {
int r = 0;
// Verify steps
#include <pakfire/constants.h>
#include <pakfire/logging.h>
+#include <pakfire/private.h>
void pakfire_oom(size_t num, size_t len) {
if (num)
return ptr;
}
-void* pakfire_free(void* mem) {
+PAKFIRE_EXPORT void* pakfire_free(void* mem) {
if (mem)
free(mem);
return pakfire_strftime("%Y-%m-%d", t);
}
-char* pakfire_path_join(const char* first, const char* second) {
+PAKFIRE_EXPORT char* pakfire_path_join(const char* first, const char* second) {
char* buffer;
if (!second)
return dirname(parent);
}
-int pakfire_access(const char* dir, const char* file, int mode) {
+PAKFIRE_EXPORT int pakfire_access(const char* dir, const char* file, int mode) {
char* path = pakfire_path_join(dir, file);
int r = access(path, mode);