K. Piche <kpiche@rogers.com>

* gcc visiblity changes

Also modified _alpm_versioncmp -> alpm_versioncmp (public function) as per K.
Piche's suggestions
This commit is contained in:
Aaron Griffin 2007-01-30 07:47:19 +00:00
parent 2efeab1529
commit 195e30e8aa
19 changed files with 258 additions and 246 deletions

View file

@ -5,7 +5,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: pacman\n" "Project-Id-Version: pacman\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-12-23 1:35-0600\n" "POT-Creation-Date: 2007-01-30 13:43-0600\n"
"PO-Revision-Date: 2006-08-26 14:53+0200\n" "PO-Revision-Date: 2006-08-26 14:53+0200\n"
"Last-Translator: Hungarian <frugalware-devel@frugalware.org>\n" "Last-Translator: Hungarian <frugalware-devel@frugalware.org>\n"
"Language-Team: Hungarian <frugalware-devel@frugalware.org>\n" "Language-Team: Hungarian <frugalware-devel@frugalware.org>\n"
@ -872,7 +872,7 @@ msgid "CONFIG: REPOSITORIES"
msgstr "" msgstr ""
# type: Plain text # type: Plain text
#: pacman.8:308 #: pacman.8:311
msgid "" msgid ""
"Each repository section defines a section name and at least one location " "Each repository section defines a section name and at least one location "
"where the packages can be found. The section name is defined by the string " "where the packages can be found. The section name is defined by the string "
@ -880,17 +880,20 @@ msgid ""
"Locations are defined with the I<Server> directive and follow a URL naming " "Locations are defined with the I<Server> directive and follow a URL naming "
"structure. Currently only ftp is supported for remote servers. If you want " "structure. Currently only ftp is supported for remote servers. If you want "
"to use a local directory, you can specify the full path with a 'file://' " "to use a local directory, you can specify the full path with a 'file://' "
"prefix, as shown above." "prefix, as shown above. The order of repositories in the file matters; "
"repositories listed first will take precidence over those listed later in "
"the file when packages in two repositories have identical names, regardless "
"of version number."
msgstr "" msgstr ""
# type: SH # type: SH
#: pacman.8:308 #: pacman.8:311
#, no-wrap #, no-wrap
msgid "USING YOUR OWN REPOSITORY" msgid "USING YOUR OWN REPOSITORY"
msgstr "" msgstr ""
# type: Plain text # type: Plain text
#: pacman.8:312 #: pacman.8:315
msgid "" msgid ""
"Let's say you have a bunch of custom packages in I</home/pkgs> and their " "Let's say you have a bunch of custom packages in I</home/pkgs> and their "
"respective PKGBUILD files are all in I</var/abs/local>. All you need to do " "respective PKGBUILD files are all in I</var/abs/local>. All you need to do "
@ -899,13 +902,13 @@ msgid ""
msgstr "" msgstr ""
# type: Plain text # type: Plain text
#: pacman.8:316 #: pacman.8:319
#, no-wrap #, no-wrap
msgid "# gensync /var/abs/local /home/pkgs/custom.db.tar.gz\n" msgid "# gensync /var/abs/local /home/pkgs/custom.db.tar.gz\n"
msgstr "" msgstr ""
# type: Plain text # type: Plain text
#: pacman.8:326 #: pacman.8:329
msgid "" msgid ""
"The above command will read all PKGBUILD files in /var/abs/local and " "The above command will read all PKGBUILD files in /var/abs/local and "
"generate a compressed database called /home/pkgs/custom.db.tar.gz. Note " "generate a compressed database called /home/pkgs/custom.db.tar.gz. Note "
@ -918,24 +921,24 @@ msgid ""
msgstr "" msgstr ""
# type: SH # type: SH
#: pacman.8:326 makepkg.8:447 PKGBUILD.8:453 #: pacman.8:329 makepkg.8:447 PKGBUILD.8:453
#, no-wrap #, no-wrap
msgid "SEE ALSO" msgid "SEE ALSO"
msgstr "LÁSD MÉG" msgstr "LÁSD MÉG"
# type: Plain text # type: Plain text
#: pacman.8:328 #: pacman.8:331
msgid "B<makepkg> is the package-building tool that comes with pacman." msgid "B<makepkg> is the package-building tool that comes with pacman."
msgstr "" msgstr ""
# type: SH # type: SH
#: pacman.8:328 makepkg.8:452 PKGBUILD.8:456 #: pacman.8:331 makepkg.8:452 PKGBUILD.8:456
#, no-wrap #, no-wrap
msgid "AUTHOR" msgid "AUTHOR"
msgstr "SZERZÕ" msgstr "SZERZÕ"
# type: Plain text # type: Plain text
#: pacman.8:331 makepkg.8:455 #: pacman.8:334 makepkg.8:455
#, no-wrap #, no-wrap
msgid "Judd Vinet E<lt>jvinet@zeroflux.orgE<gt>\n" msgid "Judd Vinet E<lt>jvinet@zeroflux.orgE<gt>\n"
msgstr "" msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -105,7 +105,7 @@ static int add_faketarget(pmtrans_t *trans, char *name)
return(0); return(0);
} }
int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) int SYMHIDDEN _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
{ {
pmpkg_t *info = NULL; pmpkg_t *info = NULL;
pmpkg_t *dummy; pmpkg_t *dummy;
@ -154,7 +154,7 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
if(trans->flags & PM_TRANS_FLAG_FRESHEN) { if(trans->flags & PM_TRANS_FLAG_FRESHEN) {
/* only upgrade/install this package if it is already installed and at a lesser version */ /* only upgrade/install this package if it is already installed and at a lesser version */
dummy = _alpm_db_get_pkgfromcache(db, pkgname); dummy = _alpm_db_get_pkgfromcache(db, pkgname);
if(dummy == NULL || _alpm_versioncmp(dummy->version, pkgver) >= 0) { if(dummy == NULL || alpm_versioncmp(dummy->version, pkgver) >= 0) {
pm_errno = PM_ERR_PKG_CANT_FRESH; pm_errno = PM_ERR_PKG_CANT_FRESH;
goto error; goto error;
} }
@ -166,7 +166,7 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
for(i = trans->packages; i; i = i->next) { for(i = trans->packages; i; i = i->next) {
pmpkg_t *pkg = i->data; pmpkg_t *pkg = i->data;
if(strcmp(pkg->name, pkgname) == 0) { if(strcmp(pkg->name, pkgname) == 0) {
if(_alpm_versioncmp(pkg->version, pkgver) < 0) { if(alpm_versioncmp(pkg->version, pkgver) < 0) {
pmpkg_t *newpkg; pmpkg_t *newpkg;
_alpm_log(PM_LOG_WARNING, _("replacing older version %s-%s by %s in target list"), _alpm_log(PM_LOG_WARNING, _("replacing older version %s-%s by %s in target list"),
pkg->name, pkg->version, pkgver); pkg->name, pkg->version, pkgver);

View file

@ -63,7 +63,7 @@
/* Globals */ /* Globals */
pmhandle_t *handle = NULL; pmhandle_t *handle = NULL;
enum _pmerrno_t pm_errno; enum _pmerrno_t pm_errno SYMEXPORT;
/** \addtogroup alpm_interface Interface Functions /** \addtogroup alpm_interface Interface Functions
* @brief Functions to initialize and release libalpm * @brief Functions to initialize and release libalpm
@ -75,7 +75,7 @@ enum _pmerrno_t pm_errno;
* @param root the full path of the root we'll be installing to (usually /) * @param root the full path of the root we'll be installing to (usually /)
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_initialize(const char *root) int SYMEXPORT alpm_initialize(const char *root)
{ {
char str[PATH_MAX]; char str[PATH_MAX];
@ -99,7 +99,7 @@ int alpm_initialize(const char *root)
/** Release the library. This should be the last alpm call you make. /** Release the library. This should be the last alpm call you make.
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_release() int SYMEXPORT alpm_release()
{ {
int dbs_left = 0; int dbs_left = 0;
@ -139,7 +139,7 @@ int alpm_release()
* @param treename the name of the repository * @param treename the name of the repository
* @return a pmdb_t* on success (the value), NULL on error * @return a pmdb_t* on success (the value), NULL on error
*/ */
pmdb_t *alpm_db_register(char *treename) pmdb_t SYMEXPORT *alpm_db_register(char *treename)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, NULL)); ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, NULL));
@ -245,7 +245,7 @@ int alpm_db_setserver(pmdb_t *db, const char *url)
* @return 0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up * @return 0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up
* to date * to date
*/ */
int alpm_db_update(int force, pmdb_t *db) int SYMEXPORT alpm_db_update(int force, pmdb_t *db)
{ {
alpm_list_t *lp; alpm_list_t *lp;
char path[PATH_MAX]; char path[PATH_MAX];
@ -330,7 +330,7 @@ int alpm_db_update(int force, pmdb_t *db)
* @param name of the package * @param name of the package
* @return the package entry on success, NULL on error * @return the package entry on success, NULL on error
*/ */
pmpkg_t *alpm_db_readpkg(pmdb_t *db, char *name) pmpkg_t SYMEXPORT *alpm_db_readpkg(pmdb_t *db, char *name)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -344,7 +344,7 @@ pmpkg_t *alpm_db_readpkg(pmdb_t *db, char *name)
* @param db pointer to the package database to get the package from * @param db pointer to the package database to get the package from
* @return the list of packages on success, NULL on error * @return the list of packages on success, NULL on error
*/ */
alpm_list_t *alpm_db_getpkgcache(pmdb_t *db) alpm_list_t SYMEXPORT *alpm_db_getpkgcache(pmdb_t *db)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -358,7 +358,7 @@ alpm_list_t *alpm_db_getpkgcache(pmdb_t *db)
* @param name name of the package * @param name name of the package
* @return the list of packages on success, NULL on error * @return the list of packages on success, NULL on error
*/ */
alpm_list_t *alpm_db_whatprovides(pmdb_t *db, char *name) alpm_list_t SYMEXPORT *alpm_db_whatprovides(pmdb_t *db, char *name)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -373,7 +373,7 @@ alpm_list_t *alpm_db_whatprovides(pmdb_t *db, char *name)
* @param name of the group * @param name of the group
* @return the groups entry on success, NULL on error * @return the groups entry on success, NULL on error
*/ */
pmgrp_t *alpm_db_readgrp(pmdb_t *db, char *name) pmgrp_t SYMEXPORT *alpm_db_readgrp(pmdb_t *db, char *name)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -387,7 +387,7 @@ pmgrp_t *alpm_db_readgrp(pmdb_t *db, char *name)
* @param db pointer to the package database to get the group from * @param db pointer to the package database to get the group from
* @return the list of groups on success, NULL on error * @return the list of groups on success, NULL on error
*/ */
alpm_list_t *alpm_db_getgrpcache(pmdb_t *db) alpm_list_t SYMEXPORT *alpm_db_getgrpcache(pmdb_t *db)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -408,7 +408,7 @@ alpm_list_t *alpm_db_getgrpcache(pmdb_t *db)
* @param pkg address of the package pointer * @param pkg address of the package pointer
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_pkg_load(char *filename, pmpkg_t **pkg) int SYMEXPORT alpm_pkg_load(char *filename, pmpkg_t **pkg)
{ {
_alpm_log(PM_LOG_FUNCTION, "enter alpm_pkg_load"); _alpm_log(PM_LOG_FUNCTION, "enter alpm_pkg_load");
@ -429,7 +429,7 @@ int alpm_pkg_load(char *filename, pmpkg_t **pkg)
* @param pkg package pointer to free * @param pkg package pointer to free
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_pkg_free(pmpkg_t *pkg) int SYMEXPORT alpm_pkg_free(pmpkg_t *pkg)
{ {
_alpm_log(PM_LOG_FUNCTION, "enter alpm_pkg_free"); _alpm_log(PM_LOG_FUNCTION, "enter alpm_pkg_free");
@ -543,9 +543,9 @@ int alpm_pkg_checkmd5sum(pmpkg_t *pkg)
* @return postive, 0 or negative if ver1 is less, equal or more * @return postive, 0 or negative if ver1 is less, equal or more
* than ver2, respectively. * than ver2, respectively.
*/ */
int alpm_pkg_vercmp(const char *ver1, const char *ver2) int SYMEXPORT alpm_pkg_vercmp(const char *ver1, const char *ver2)
{ {
return(_alpm_versioncmp(ver1, ver2)); return(alpm_versioncmp(ver1, ver2));
} }
/* internal */ /* internal */
@ -556,7 +556,7 @@ static char *_supported_archs[] = {
"x86_64", "x86_64",
}; };
char *alpm_pkg_name_hasarch(char *pkgname) char SYMEXPORT *alpm_pkg_name_hasarch(char *pkgname)
{ {
/* TODO remove this when we transfer everything over to -ARCH /* TODO remove this when we transfer everything over to -ARCH
* *
@ -596,7 +596,7 @@ char *alpm_pkg_name_hasarch(char *pkgname)
* @param db pointer to the package database to search in * @param db pointer to the package database to search in
* @return the list of packages on success, NULL on error * @return the list of packages on success, NULL on error
*/ */
alpm_list_t *alpm_db_search(pmdb_t *db) alpm_list_t SYMEXPORT *alpm_db_search(pmdb_t *db)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -622,7 +622,7 @@ alpm_list_t *alpm_db_search(pmdb_t *db)
* @param progress progress callback function pointer * @param progress progress callback function pointer
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_trans_init(pmtranstype_t type, unsigned int flags, int SYMEXPORT alpm_trans_init(pmtranstype_t type, unsigned int flags,
alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress) alpm_trans_cb_progress progress)
{ {
@ -651,7 +651,7 @@ int alpm_trans_init(pmtranstype_t type, unsigned int flags,
/** Search for packages to upgrade and add them to the transaction. /** Search for packages to upgrade and add them to the transaction.
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_trans_sysupgrade() int SYMEXPORT alpm_trans_sysupgrade()
{ {
pmtrans_t *trans; pmtrans_t *trans;
@ -669,7 +669,7 @@ int alpm_trans_sysupgrade()
* @param target the name of the target to add * @param target the name of the target to add
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_trans_addtarget(char *target) int SYMEXPORT alpm_trans_addtarget(char *target)
{ {
pmtrans_t *trans; pmtrans_t *trans;
@ -689,7 +689,7 @@ int alpm_trans_addtarget(char *target)
* of an error can be dumped (ie. list of conflicting files) * of an error can be dumped (ie. list of conflicting files)
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_trans_prepare(alpm_list_t **data) int SYMEXPORT alpm_trans_prepare(alpm_list_t **data)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@ -706,7 +706,7 @@ int alpm_trans_prepare(alpm_list_t **data)
* of an error can be dumped (ie. list of conflicting files) * of an error can be dumped (ie. list of conflicting files)
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_trans_commit(alpm_list_t **data) int SYMEXPORT alpm_trans_commit(alpm_list_t **data)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@ -726,7 +726,7 @@ int alpm_trans_commit(alpm_list_t **data)
/** Release a transaction. /** Release a transaction.
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_trans_release() int SYMEXPORT alpm_trans_release()
{ {
pmtrans_t *trans; pmtrans_t *trans;
char path[PATH_MAX]; char path[PATH_MAX];
@ -774,7 +774,7 @@ int alpm_trans_release()
* @param fmt output format * @param fmt output format
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_logaction(char *fmt, ...) int SYMEXPORT alpm_logaction(char *fmt, ...)
{ {
char str[LOG_STR_LEN]; char str[LOG_STR_LEN];
va_list args; va_list args;
@ -812,7 +812,7 @@ int alpm_logaction(char *fmt, ...)
* @param name name of the file * @param name name of the file
* @return the checksum on success, NULL on error * @return the checksum on success, NULL on error
*/ */
char *alpm_get_md5sum(char *name) char SYMEXPORT *alpm_get_md5sum(char *name)
{ {
ASSERT(name != NULL, return(NULL)); ASSERT(name != NULL, return(NULL));
@ -823,7 +823,7 @@ char *alpm_get_md5sum(char *name)
* @param name name of the file * @param name name of the file
* @return the checksum on success, NULL on error * @return the checksum on success, NULL on error
*/ */
char *alpm_get_sha1sum(char *name) char SYMEXPORT *alpm_get_sha1sum(char *name)
{ {
ASSERT(name != NULL, return(NULL)); ASSERT(name != NULL, return(NULL));
@ -834,7 +834,7 @@ char *alpm_get_sha1sum(char *name)
* @param url * @param url
* @return the downloaded filename on success, NULL on error * @return the downloaded filename on success, NULL on error
*/ */
char *alpm_fetch_pkgurl(char *url) char SYMEXPORT *alpm_fetch_pkgurl(char *url)
{ {
ASSERT(strstr(url, "://"), return(NULL)); ASSERT(strstr(url, "://"), return(NULL));
@ -847,7 +847,7 @@ char *alpm_fetch_pkgurl(char *url)
* @param this_section the config current section being parsed * @param this_section the config current section being parsed
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
*/ */
int alpm_parse_config(char *file, alpm_cb_db_register callback, const char *this_section) int SYMEXPORT alpm_parse_config(char *file, alpm_cb_db_register callback, const char *this_section)
{ {
FILE *fp = NULL; FILE *fp = NULL;
char line[PATH_MAX+1]; char line[PATH_MAX+1];

View file

@ -486,6 +486,9 @@ extern enum _pmerrno_t pm_errno;
char *alpm_strerror(int err); char *alpm_strerror(int err);
/* Version Compare */
int alpm_versioncmp(const char *a, const char *b);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View file

@ -52,7 +52,7 @@ alpm_list_t *alpm_list_new()
/** Free a list, but not the contained data /** Free a list, but not the contained data
* @param list the list to free * @param list the list to free
*/ */
void alpm_list_free(alpm_list_t *list) void SYMEXPORT alpm_list_free(alpm_list_t *list)
{ {
alpm_list_t *it = list; alpm_list_t *it = list;
@ -67,7 +67,7 @@ void alpm_list_free(alpm_list_t *list)
* @param list the list to free * @param list the list to free
* @param fn a free function for the internal data * @param fn a free function for the internal data
*/ */
void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn) void SYMEXPORT alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
{ {
alpm_list_t *it = list; alpm_list_t *it = list;
@ -87,7 +87,7 @@ void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
* @param data the new item to be added to the list * @param data the new item to be added to the list
* @return the resultant list, or NULL on failure * @return the resultant list, or NULL on failure
*/ */
alpm_list_t *alpm_list_add(alpm_list_t *list, void *data) alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
{ {
alpm_list_t *ptr, *lp; alpm_list_t *ptr, *lp;
@ -305,7 +305,7 @@ alpm_list_t *alpm_list_remove_node(alpm_list_t *node)
* @param list the list to copy * @param list the list to copy
* @return a NEW list containing non-duplicated items * @return a NEW list containing non-duplicated items
*/ */
alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list) alpm_list_t SYMEXPORT *alpm_list_remove_dupes(alpm_list_t *list)
{ /* TODO does removing the strdup here cause invalid free's anywhere? */ { /* TODO does removing the strdup here cause invalid free's anywhere? */
alpm_list_t *lp = list, *newlist = NULL; alpm_list_t *lp = list, *newlist = NULL;
while(lp) { while(lp) {
@ -354,7 +354,7 @@ alpm_list_t *alpm_list_reverse(alpm_list_t *list)
* @param list the list * @param list the list
* @return the first element in the list * @return the first element in the list
*/ */
alpm_list_t *alpm_list_first(alpm_list_t *list) alpm_list_t SYMEXPORT *alpm_list_first(alpm_list_t *list)
{ {
return(list); return(list);
} }
@ -377,7 +377,7 @@ alpm_list_t *alpm_list_nth(alpm_list_t *list, int n)
* @param entry the list entry * @param entry the list entry
* @return the next element, or NULL when no more elements exist * @return the next element, or NULL when no more elements exist
*/ */
alpm_list_t *alpm_list_next(alpm_list_t *entry) alpm_list_t SYMEXPORT *alpm_list_next(alpm_list_t *entry)
{ {
return(entry->next); return(entry->next);
} }
@ -398,7 +398,7 @@ alpm_list_t *alpm_list_last(alpm_list_t *list)
* @param entry the list entry * @param entry the list entry
* @return the contained data, or NULL if none * @return the contained data, or NULL if none
*/ */
void *alpm_list_getdata(const alpm_list_t *entry) void SYMEXPORT *alpm_list_getdata(const alpm_list_t *entry)
{ {
if(entry == NULL) return(NULL); if(entry == NULL) return(NULL);
return(entry->data); return(entry->data);
@ -410,7 +410,7 @@ void *alpm_list_getdata(const alpm_list_t *entry)
* @param list the list to operate on * @param list the list to operate on
* @return the number of list items * @return the number of list items
*/ */
int alpm_list_count(const alpm_list_t *list) int SYMEXPORT alpm_list_count(const alpm_list_t *list)
{ {
unsigned int i = 0; unsigned int i = 0;
const alpm_list_t *lp = list; const alpm_list_t *lp = list;

View file

@ -360,7 +360,7 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root, a
return(conflicts); return(conflicts);
} }
const char *alpm_conflict_get_target(pmconflict_t *conflict) const char SYMEXPORT *alpm_conflict_get_target(pmconflict_t *conflict)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -369,7 +369,7 @@ const char *alpm_conflict_get_target(pmconflict_t *conflict)
return conflict->target; return conflict->target;
} }
pmconflicttype_t alpm_conflict_get_type(pmconflict_t *conflict) pmconflicttype_t SYMEXPORT alpm_conflict_get_type(pmconflict_t *conflict)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(-1)); ASSERT(handle != NULL, return(-1));
@ -378,7 +378,7 @@ pmconflicttype_t alpm_conflict_get_type(pmconflict_t *conflict)
return conflict->type; return conflict->type;
} }
const char *alpm_conflict_get_file(pmconflict_t *conflict) const char SYMEXPORT *alpm_conflict_get_file(pmconflict_t *conflict)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -387,7 +387,7 @@ const char *alpm_conflict_get_file(pmconflict_t *conflict)
return conflict->file; return conflict->file;
} }
const char *alpm_conflict_get_ctarget(pmconflict_t *conflict) const char SYMEXPORT *alpm_conflict_get_ctarget(pmconflict_t *conflict)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));

View file

@ -199,7 +199,7 @@ pmdb_t *_alpm_db_register(char *treename, alpm_cb_db_register callback)
return(db); return(db);
} }
const char *alpm_db_get_name(pmdb_t *db) const char SYMEXPORT *alpm_db_get_name(pmdb_t *db)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));

View file

@ -646,7 +646,7 @@ error:
return(-1); return(-1);
} }
const char *alpm_dep_get_target(pmdepmissing_t *miss) const char SYMEXPORT *alpm_dep_get_target(pmdepmissing_t *miss)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -655,7 +655,7 @@ const char *alpm_dep_get_target(pmdepmissing_t *miss)
return miss->target; return miss->target;
} }
pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss) pmdeptype_t SYMEXPORT alpm_dep_get_type(pmdepmissing_t *miss)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(-1)); ASSERT(handle != NULL, return(-1));
@ -664,7 +664,7 @@ pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss)
return miss->type; return miss->type;
} }
pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss) pmdepmod_t SYMEXPORT alpm_dep_get_mod(pmdepmissing_t *miss)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(-1)); ASSERT(handle != NULL, return(-1));
@ -673,7 +673,7 @@ pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss)
return miss->depend.mod; return miss->depend.mod;
} }
const char *alpm_dep_get_name(pmdepmissing_t *miss) const char SYMEXPORT *alpm_dep_get_name(pmdepmissing_t *miss)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -682,7 +682,7 @@ const char *alpm_dep_get_name(pmdepmissing_t *miss)
return miss->depend.name; return miss->depend.name;
} }
const char *alpm_dep_get_version(pmdepmissing_t *miss) const char SYMEXPORT *alpm_dep_get_version(pmdepmissing_t *miss)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));

View file

@ -26,7 +26,7 @@
#include "util.h" #include "util.h"
#include "alpm.h" #include "alpm.h"
char *alpm_strerror(int err) char SYMEXPORT *alpm_strerror(int err)
{ {
switch(err) { switch(err) {
/* System */ /* System */

View file

@ -70,7 +70,7 @@ int _alpm_grp_cmp(const void *g1, const void *g2)
return(strcmp(grp1->name, grp2->name)); return(strcmp(grp1->name, grp2->name));
} }
const char *alpm_grp_get_name(pmgrp_t *grp) const char SYMEXPORT *alpm_grp_get_name(pmgrp_t *grp)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(grp != NULL, return(NULL)); ASSERT(grp != NULL, return(NULL));
@ -78,7 +78,7 @@ const char *alpm_grp_get_name(pmgrp_t *grp)
return grp->name; return grp->name;
} }
alpm_list_t *alpm_grp_get_packages(pmgrp_t *grp) alpm_list_t SYMEXPORT *alpm_grp_get_packages(pmgrp_t *grp)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(grp != NULL, return(NULL)); ASSERT(grp != NULL, return(NULL));

View file

@ -118,9 +118,9 @@ int _alpm_handle_free(pmhandle_t *handle)
alpm_cb_log alpm_option_get_logcb() { return handle->logcb; } alpm_cb_log alpm_option_get_logcb() { return handle->logcb; }
alpm_cb_download alpm_option_get_dlcb() { return handle->dlcb; } alpm_cb_download alpm_option_get_dlcb() { return handle->dlcb; }
unsigned short alpm_option_get_logmask() { return handle->logmask; } unsigned short alpm_option_get_logmask() { return handle->logmask; }
const char *alpm_option_get_root() { return handle->root; } const char SYMEXPORT *alpm_option_get_root() { return handle->root; }
const char *alpm_option_get_dbpath() { return handle->dbpath; } const char SYMEXPORT *alpm_option_get_dbpath() { return handle->dbpath; }
const char *alpm_option_get_cachedir() { return handle->cachedir; } const char SYMEXPORT *alpm_option_get_cachedir() { return handle->cachedir; }
const char *alpm_option_get_logfile() { return handle->logfile; } const char *alpm_option_get_logfile() { return handle->logfile; }
unsigned short alpm_option_get_usesyslog() { return handle->usesyslog; } unsigned short alpm_option_get_usesyslog() { return handle->usesyslog; }
alpm_list_t *alpm_option_get_noupgrades() { return handle->noupgrade; } alpm_list_t *alpm_option_get_noupgrades() { return handle->noupgrade; }
@ -130,21 +130,21 @@ alpm_list_t *alpm_option_get_holdpkgs() { return handle->holdpkg; }
time_t alpm_option_get_upgradedelay() { return handle->upgradedelay; } time_t alpm_option_get_upgradedelay() { return handle->upgradedelay; }
const char *alpm_option_get_xfercommand() { return handle->xfercommand; } const char *alpm_option_get_xfercommand() { return handle->xfercommand; }
unsigned short alpm_option_get_nopassiveftp() { return handle->nopassiveftp; } unsigned short alpm_option_get_nopassiveftp() { return handle->nopassiveftp; }
unsigned short alpm_option_get_chomp() { return handle->chomp; } unsigned short SYMEXPORT alpm_option_get_chomp() { return handle->chomp; }
alpm_list_t *alpm_option_get_needles() { return handle->needles; } alpm_list_t *alpm_option_get_needles() { return handle->needles; }
unsigned short alpm_option_get_usecolor() { return handle->use_color; } unsigned short alpm_option_get_usecolor() { return handle->use_color; }
pmdb_t *alpm_option_get_localdb() { return handle->db_local; } pmdb_t *alpm_option_get_localdb() { return handle->db_local; }
alpm_list_t *alpm_option_get_syncdbs() alpm_list_t SYMEXPORT *alpm_option_get_syncdbs()
{ {
return handle->dbs_sync; return handle->dbs_sync;
} }
void alpm_option_set_logcb(alpm_cb_log cb) { handle->logcb = cb; } void SYMEXPORT alpm_option_set_logcb(alpm_cb_log cb) { handle->logcb = cb; }
void alpm_option_set_dlcb(alpm_cb_download cb) { handle->dlcb = cb; } void SYMEXPORT alpm_option_set_dlcb(alpm_cb_download cb) { handle->dlcb = cb; }
void alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; } void SYMEXPORT alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; }
void alpm_option_set_root(const char *root) void alpm_option_set_root(const char *root)
{ {
@ -152,7 +152,7 @@ void alpm_option_set_root(const char *root)
if(root) handle->root = strdup(root); if(root) handle->root = strdup(root);
} }
void alpm_option_set_dbpath(const char *dbpath) void SYMEXPORT alpm_option_set_dbpath(const char *dbpath)
{ {
if(handle->dbpath) FREE(handle->dbpath); if(handle->dbpath) FREE(handle->dbpath);
if(dbpath) handle->dbpath = strdup(dbpath); if(dbpath) handle->dbpath = strdup(dbpath);
@ -205,7 +205,7 @@ void alpm_option_set_noextracts(alpm_list_t *noextract)
if(noextract) handle->noextract = noextract; if(noextract) handle->noextract = noextract;
} }
void alpm_option_add_ignorepkg(char *pkg) void SYMEXPORT alpm_option_add_ignorepkg(char *pkg)
{ {
handle->ignorepkg = alpm_list_add(handle->ignorepkg, strdup(pkg)); handle->ignorepkg = alpm_list_add(handle->ignorepkg, strdup(pkg));
} }
@ -243,7 +243,7 @@ void alpm_option_set_nopassiveftp(unsigned short nopasv)
void alpm_option_set_chomp(unsigned short chomp) { handle->chomp = chomp; } void alpm_option_set_chomp(unsigned short chomp) { handle->chomp = chomp; }
void alpm_option_add_needle(char *needle) void SYMEXPORT alpm_option_add_needle(char *needle)
{ {
handle->needles = alpm_list_add(handle->needles, strdup(needle)); handle->needles = alpm_list_add(handle->needles, strdup(needle));
} }

View file

@ -457,7 +457,7 @@ const char *alpm_pkg_get_filename(pmpkg_t *pkg)
return pkg->filename; return pkg->filename;
} }
const char *alpm_pkg_get_name(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_name(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -466,7 +466,7 @@ const char *alpm_pkg_get_name(pmpkg_t *pkg)
return pkg->name; return pkg->name;
} }
const char *alpm_pkg_get_version(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_version(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -475,7 +475,7 @@ const char *alpm_pkg_get_version(pmpkg_t *pkg)
return pkg->version; return pkg->version;
} }
const char *alpm_pkg_get_desc(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_desc(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -487,7 +487,7 @@ const char *alpm_pkg_get_desc(pmpkg_t *pkg)
return pkg->desc; return pkg->desc;
} }
const char *alpm_pkg_get_url(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_url(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -499,7 +499,7 @@ const char *alpm_pkg_get_url(pmpkg_t *pkg)
return pkg->url; return pkg->url;
} }
const char *alpm_pkg_get_builddate(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_builddate(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -511,7 +511,7 @@ const char *alpm_pkg_get_builddate(pmpkg_t *pkg)
return pkg->builddate; return pkg->builddate;
} }
const char *alpm_pkg_get_buildtype(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_buildtype(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -523,7 +523,7 @@ const char *alpm_pkg_get_buildtype(pmpkg_t *pkg)
return pkg->buildtype; return pkg->buildtype;
} }
const char *alpm_pkg_get_installdate(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_installdate(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -535,7 +535,7 @@ const char *alpm_pkg_get_installdate(pmpkg_t *pkg)
return pkg->installdate; return pkg->installdate;
} }
const char *alpm_pkg_get_packager(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_packager(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -547,7 +547,7 @@ const char *alpm_pkg_get_packager(pmpkg_t *pkg)
return pkg->packager; return pkg->packager;
} }
const char *alpm_pkg_get_md5sum(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_md5sum(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -559,7 +559,7 @@ const char *alpm_pkg_get_md5sum(pmpkg_t *pkg)
return pkg->md5sum; return pkg->md5sum;
} }
const char *alpm_pkg_get_sha1sum(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_sha1sum(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -571,7 +571,7 @@ const char *alpm_pkg_get_sha1sum(pmpkg_t *pkg)
return pkg->sha1sum; return pkg->sha1sum;
} }
const char *alpm_pkg_get_arch(pmpkg_t *pkg) const char SYMEXPORT *alpm_pkg_get_arch(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -583,7 +583,7 @@ const char *alpm_pkg_get_arch(pmpkg_t *pkg)
return pkg->arch; return pkg->arch;
} }
unsigned long alpm_pkg_get_size(pmpkg_t *pkg) unsigned long SYMEXPORT alpm_pkg_get_size(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(-1)); ASSERT(handle != NULL, return(-1));
@ -595,7 +595,7 @@ unsigned long alpm_pkg_get_size(pmpkg_t *pkg)
return pkg->size; return pkg->size;
} }
unsigned long alpm_pkg_get_isize(pmpkg_t *pkg) unsigned long SYMEXPORT alpm_pkg_get_isize(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(-1)); ASSERT(handle != NULL, return(-1));
@ -607,7 +607,7 @@ unsigned long alpm_pkg_get_isize(pmpkg_t *pkg)
return pkg->isize; return pkg->isize;
} }
pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg) pmpkgreason_t SYMEXPORT alpm_pkg_get_reason(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(-1)); ASSERT(handle != NULL, return(-1));
@ -619,7 +619,7 @@ pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg)
return pkg->reason; return pkg->reason;
} }
alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_licenses(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -631,7 +631,7 @@ alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg)
return pkg->license; return pkg->license;
} }
alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_groups(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -644,7 +644,7 @@ alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg)
} }
/* depends */ /* depends */
alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_depends(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -656,7 +656,7 @@ alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg)
return pkg->depends; return pkg->depends;
} }
alpm_list_t *alpm_pkg_get_removes(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_removes(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -668,7 +668,7 @@ alpm_list_t *alpm_pkg_get_removes(pmpkg_t *pkg)
return pkg->removes; return pkg->removes;
} }
alpm_list_t *alpm_pkg_get_requiredby(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_requiredby(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -680,7 +680,7 @@ alpm_list_t *alpm_pkg_get_requiredby(pmpkg_t *pkg)
return pkg->requiredby; return pkg->requiredby;
} }
alpm_list_t *alpm_pkg_get_conflicts(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_conflicts(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -692,7 +692,7 @@ alpm_list_t *alpm_pkg_get_conflicts(pmpkg_t *pkg)
return pkg->conflicts; return pkg->conflicts;
} }
alpm_list_t *alpm_pkg_get_provides(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_provides(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -704,7 +704,7 @@ alpm_list_t *alpm_pkg_get_provides(pmpkg_t *pkg)
return pkg->provides; return pkg->provides;
} }
alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_replaces(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -716,7 +716,7 @@ alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg)
return pkg->replaces; return pkg->replaces;
} }
alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_files(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -729,7 +729,7 @@ alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg)
return pkg->files; return pkg->files;
} }
alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg) alpm_list_t SYMEXPORT *alpm_pkg_get_backup(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));
@ -742,7 +742,7 @@ alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg)
return pkg->backup; return pkg->backup;
} }
unsigned short alpm_pkg_has_scriptlet(pmpkg_t *pkg) unsigned short SYMEXPORT alpm_pkg_has_scriptlet(pmpkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(-1)); ASSERT(handle != NULL, return(-1));

View file

@ -227,7 +227,7 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s
} }
/* compare versions and see if we need to upgrade */ /* compare versions and see if we need to upgrade */
cmp = _alpm_versioncmp(local->version, spkg->version); cmp = alpm_versioncmp(local->version, spkg->version);
if(cmp > 0 && !spkg->force) { if(cmp > 0 && !spkg->force) {
/* local version is newer */ /* local version is newer */
pmdb_t *db = spkg->data; pmdb_t *db = spkg->data;
@ -340,7 +340,7 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy
local = _alpm_db_get_pkgfromcache(db_local, spkg->name); local = _alpm_db_get_pkgfromcache(db_local, spkg->name);
if(local) { if(local) {
cmp = _alpm_versioncmp(local->version, spkg->version); cmp = alpm_versioncmp(local->version, spkg->version);
if(cmp > 0 && !spkg->force) { if(cmp > 0 && !spkg->force) {
/* local version is newer -- get confirmation before adding */ /* local version is newer -- get confirmation before adding */
int resp = 0; int resp = 0;
@ -1069,7 +1069,7 @@ error:
return(-1); return(-1);
} }
pmsynctype_t alpm_sync_get_type(pmsyncpkg_t *sync) pmsynctype_t SYMEXPORT alpm_sync_get_type(pmsyncpkg_t *sync)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(sync != NULL, return(-1)); ASSERT(sync != NULL, return(-1));
@ -1077,7 +1077,7 @@ pmsynctype_t alpm_sync_get_type(pmsyncpkg_t *sync)
return sync->type; return sync->type;
} }
pmpkg_t *alpm_sync_get_package(pmsyncpkg_t *sync) pmpkg_t SYMEXPORT *alpm_sync_get_package(pmsyncpkg_t *sync)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(sync != NULL, return(NULL)); ASSERT(sync != NULL, return(NULL));
@ -1085,7 +1085,7 @@ pmpkg_t *alpm_sync_get_package(pmsyncpkg_t *sync)
return sync->pkg; return sync->pkg;
} }
void *alpm_sync_get_data(pmsyncpkg_t *sync) void SYMEXPORT *alpm_sync_get_data(pmsyncpkg_t *sync)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(sync != NULL, return(NULL)); ASSERT(sync != NULL, return(NULL));

View file

@ -237,7 +237,7 @@ pmtranstype_t alpm_trans_get_type()
return handle->trans->type; return handle->trans->type;
} }
unsigned int alpm_trans_get_flags() unsigned int SYMEXPORT alpm_trans_get_flags()
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(-1)); ASSERT(handle != NULL, return(-1));
@ -255,7 +255,7 @@ alpm_list_t * alpm_trans_get_targets()
return handle->trans->targets; return handle->trans->targets;
} }
alpm_list_t * alpm_trans_get_packages() alpm_list_t SYMEXPORT * alpm_trans_get_packages()
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(handle != NULL, return(NULL)); ASSERT(handle != NULL, return(NULL));

View file

@ -76,6 +76,10 @@ char* strsep(char** str, const char* delims);
char* mkdtemp(char *template); char* mkdtemp(char *template);
#endif #endif
/* check exported library symbols with: nm -C -D <lib> */
#define SYMEXPORT __attribute__((visibility("default")))
#define SYMHIDDEN __attribute__((visibility("hidden")))
#endif /* _ALPM_UTIL_H */ #endif /* _ALPM_UTIL_H */
/* vim: set ts=2 sw=2 noet: */ /* vim: set ts=2 sw=2 noet: */

View file

@ -148,7 +148,7 @@ static int strverscmp (s1, s2)
#endif #endif
/* this function was taken from rpm 4.0.4 and rewritten */ /* this function was taken from rpm 4.0.4 and rewritten */
int _alpm_versioncmp(const char *a, const char *b) int SYMEXPORT alpm_versioncmp(const char *a, const char *b)
{ {
char str1[64], str2[64]; char str1[64], str2[64];
char *ptr1, *ptr2; char *ptr1, *ptr2;
@ -236,7 +236,7 @@ int _alpm_versioncmp(const char *a, const char *b)
if((!*one) && (!*two)) { if((!*one) && (!*two)) {
/* compare release numbers */ /* compare release numbers */
if(rel1 && rel2) return(_alpm_versioncmp(rel1, rel2)); if(rel1 && rel2) return(alpm_versioncmp(rel1, rel2));
return(0); return(0);
} }
@ -252,7 +252,7 @@ int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
if(dep->mod == PM_DEP_MOD_ANY) { if(dep->mod == PM_DEP_MOD_ANY) {
equal = 1; equal = 1;
} else { } else {
int cmp = _alpm_versioncmp(pkg->version, dep->version); int cmp = alpm_versioncmp(pkg->version, dep->version);
switch(dep->mod) { switch(dep->mod) {
case PM_DEP_MOD_EQ: equal = (cmp == 0); break; case PM_DEP_MOD_EQ: equal = (cmp == 0); break;
case PM_DEP_MOD_GE: equal = (cmp >= 0); break; case PM_DEP_MOD_GE: equal = (cmp >= 0); break;

View file

@ -26,7 +26,6 @@
#include "deps.h" #include "deps.h"
#include "package.h" #include "package.h"
int _alpm_versioncmp(const char *a, const char *b);
int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep); int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
#endif #endif

View file

@ -27,7 +27,7 @@
#ifndef PATH_MAX #ifndef PATH_MAX
#define PATH_MAX 1024 #define PATH_MAX 1024
#endif #endif
#include "versioncmp.h" #include <alpm.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -45,7 +45,7 @@ int main(int argc, char *argv[])
return(0); return(0);
} }
ret = _alpm_versioncmp(s1, s2); ret = alpm_versioncmp(s1, s2);
printf("%d\n", ret); printf("%d\n", ret);
return(ret); return(ret);
} }