On Mon, Aug 27, 2007 at 09:55:02AM -0400, Dan McGee wrote:
Can't this be static, and thus not have the _alpm prefix? (static = only use is in this file, _alpm = only use is internal to the library).
Ah right, I wasn't 100% sure about that :)
-/* TODO reimplement this in terms of alpm_get_upgrades */ -int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync) +/** Get a list of upgradable packages on the current system + * @return a pmsyncpkg_t list of packages that are out of date + */ +alpm_list_t SYMEXPORT *alpm_sync_sysupgrade(pmtrans_t *trans, + pmdb_t *db_local, alpm_list_t *dbs_sync) I don't know why, but I seem reluctant to change the return type here, unless we can no longer really error in this function.
Should I add an extra argument for the return list then, to both sysupgrade and find_replacements ? An alpm_list_t **list ?
+ syncpkgs = _alpm_find_replacements(trans, db_local, dbs_sync); Same here- can _alpm_find_replacements never fail anymore?
Indeed, I thought about this problem. See my question above :)
diff --git a/lib/libalpm/sync.h b/lib/libalpm/sync.h index ef094b5..0d91d25 100644 --- a/lib/libalpm/sync.h +++ b/lib/libalpm/sync.h @@ -35,7 +35,6 @@ struct __pmsyncpkg_t { pmsyncpkg_t *_alpm_sync_new(int type, pmpkg_t *spkg, void *data); void _alpm_sync_free(pmsyncpkg_t *data);
-int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync); Not sure why we should move something that is sync specific out of the sync header.
I thought public functions should be in alpm.h , and private functions in other headers. Maybe I should keep _alpm_sync_sysupgrade private then, and add a public wrapper as alpm_sync_sysupgrade ?