[pacman-dev] CVS update of pacman-lib (66 files)

Aaron Griffin aaron at archlinux.org
Fri Jan 19 04:28:47 EST 2007


    Date: Friday, January 19, 2007 @ 04:28:47
  Author: aaron
    Path: /home/cvs-pacman/pacman-lib

   Added: lib/libalpm/alpm_list.c (1.1) lib/libalpm/alpm_list.h (1.1)
Modified: AUTHORS (1.5 -> 1.6) bindings/alpm.i (1.3 -> 1.4)
          lib/libalpm/Makefile.am (1.12 -> 1.13)
          lib/libalpm/add.c (1.101 -> 1.102) lib/libalpm/add.h (1.6 -> 1.7)
          lib/libalpm/alpm.c (1.103 -> 1.104)
          lib/libalpm/alpm.h (1.65 -> 1.66) lib/libalpm/backup.c (1.8 -> 1.9)
          lib/libalpm/backup.h (1.4 -> 1.5)
          lib/libalpm/be_files.c (1.19 -> 1.20)
          lib/libalpm/cache.c (1.24 -> 1.25) lib/libalpm/cache.h (1.8 -> 1.9)
          lib/libalpm/conflict.c (1.29 -> 1.30)
          lib/libalpm/conflict.h (1.9 -> 1.10)
          lib/libalpm/db.c (1.53 -> 1.54) lib/libalpm/db.h (1.21 -> 1.22)
          lib/libalpm/deps.c (1.56 -> 1.57) lib/libalpm/deps.h (1.15 -> 1.16)
          lib/libalpm/group.c (1.10 -> 1.11) lib/libalpm/group.h (1.8 -> 1.9)
          lib/libalpm/handle.c (1.26 -> 1.27)
          lib/libalpm/handle.h (1.12 -> 1.13)
          lib/libalpm/package.c (1.43 -> 1.44)
          lib/libalpm/package.h (1.22 -> 1.23)
          lib/libalpm/provide.c (1.7 -> 1.8)
          lib/libalpm/provide.h (1.4 -> 1.5)
          lib/libalpm/remove.c (1.55 -> 1.56)
          lib/libalpm/remove.h (1.6 -> 1.7)
          lib/libalpm/server.c (1.15 -> 1.16)
          lib/libalpm/server.h (1.8 -> 1.9) lib/libalpm/sync.c (1.90 -> 1.91)
          lib/libalpm/sync.h (1.15 -> 1.16)
          lib/libalpm/trans.c (1.29 -> 1.30)
          lib/libalpm/trans.h (1.20 -> 1.21)
          lib/libalpm/util.c (1.38 -> 1.39) lib/libalpm/util.h (1.17 -> 1.18)
          lib/libalpm/versioncmp.c (1.7 -> 1.8)
          src/pacman/Makefile.am (1.10 -> 1.11)
          src/pacman/add.c (1.22 -> 1.23) src/pacman/add.h (1.2 -> 1.3)
          src/pacman/conf.c (1.20 -> 1.21) src/pacman/conf.h (1.12 -> 1.13)
          src/pacman/deptest.c (1.9 -> 1.10)
          src/pacman/deptest.h (1.1 -> 1.2)
          src/pacman/downloadprog.c (1.5 -> 1.6)
          src/pacman/log.c (1.22 -> 1.23) src/pacman/package.c (1.20 -> 1.21)
          src/pacman/package.h (1.5 -> 1.6)
          src/pacman/pacman.c (1.81 -> 1.82)
          src/pacman/query.c (1.17 -> 1.18) src/pacman/query.h (1.2 -> 1.3)
          src/pacman/remove.c (1.23 -> 1.24) src/pacman/remove.h (1.2 -> 1.3)
          src/pacman/sync.c (1.94 -> 1.95) src/pacman/sync.h (1.4 -> 1.5)
          src/pacman/trans.c (1.26 -> 1.27) src/pacman/upgrade.c (1.5 -> 1.6)
          src/pacman/upgrade.h (1.2 -> 1.3) src/pacman/util.c (1.21 -> 1.22)
          src/pacman/util.h (1.12 -> 1.13)
 Removed: lib/libalpm/list.c (1.19) lib/libalpm/list.h (1.19)
          src/pacman/list.c (1.9) src/pacman/list.h (1.9)

Preliminary checkin for alpm_list conversion
* renamed pmlist_t -> alpm_list_t
* made alpm_list_t a public type (alpm_list.h header)
* removed additional storage for registered DBs in pacman source
* some code cleanup
* removed duplicate (pm)list_display functions from pacman source
* misc code cleanup


---------------------------+
 AUTHORS                   |    1 
 bindings/alpm.i           |    2 
 lib/libalpm/Makefile.am   |    4 
 lib/libalpm/add.c         |   44 ++--
 lib/libalpm/add.h         |    4 
 lib/libalpm/alpm.c        |  103 +---------
 lib/libalpm/alpm.h        |   73 +++----
 lib/libalpm/alpm_list.c   |  429 ++++++++++++++++++++++++++++++++++++++++++++
 lib/libalpm/alpm_list.h   |   71 +++++++
 lib/libalpm/backup.c      |    4 
 lib/libalpm/backup.h      |    4 
 lib/libalpm/be_files.c    |   26 +-
 lib/libalpm/cache.c       |   36 +--
 lib/libalpm/cache.h       |    6 
 lib/libalpm/conflict.c    |   62 +++---
 lib/libalpm/conflict.h    |    4 
 lib/libalpm/db.c          |   10 -
 lib/libalpm/db.h          |    8 
 lib/libalpm/deps.c        |   86 ++++----
 lib/libalpm/deps.h        |   12 -
 lib/libalpm/group.c       |    4 
 lib/libalpm/group.h       |    2 
 lib/libalpm/handle.c      |   36 +--
 lib/libalpm/handle.h      |   14 -
 lib/libalpm/list.c        |  361 -------------------------------------
 lib/libalpm/list.h        |   60 ------
 lib/libalpm/package.c     |   72 +++----
 lib/libalpm/package.h     |   24 +-
 lib/libalpm/provide.c     |   14 -
 lib/libalpm/provide.h     |    4 
 lib/libalpm/remove.c      |   36 +--
 lib/libalpm/remove.h      |    4 
 lib/libalpm/server.c      |   30 +--
 lib/libalpm/server.h      |    8 
 lib/libalpm/sync.c        |  128 ++++++-------
 lib/libalpm/sync.h        |    8 
 lib/libalpm/trans.c       |   16 -
 lib/libalpm/trans.h       |   10 -
 lib/libalpm/util.c        |   10 -
 lib/libalpm/util.h        |    2 
 lib/libalpm/versioncmp.c  |    4 
 src/pacman/Makefile.am    |    2 
 src/pacman/add.c          |   29 +-
 src/pacman/add.h          |    4 
 src/pacman/conf.c         |   14 -
 src/pacman/conf.h         |    5 
 src/pacman/deptest.c      |   41 ++--
 src/pacman/deptest.h      |    4 
 src/pacman/downloadprog.c |    1 
 src/pacman/list.c         |  197 --------------------
 src/pacman/list.h         |   53 -----
 src/pacman/log.c          |    1 
 src/pacman/package.c      |   34 +--
 src/pacman/package.h      |    2 
 src/pacman/pacman.c       |   27 --
 src/pacman/query.c        |  101 ++++------
 src/pacman/query.h        |    4 
 src/pacman/remove.c       |   57 ++---
 src/pacman/remove.h       |    4 
 src/pacman/sync.c         |  286 +++++++++++++----------------
 src/pacman/sync.h         |    8 
 src/pacman/trans.c        |    1 
 src/pacman/upgrade.c      |    4 
 src/pacman/upgrade.h      |    4 
 src/pacman/util.c         |   45 +++-
 src/pacman/util.h         |   10 -
 66 files changed, 1252 insertions(+), 1522 deletions(-)


Index: pacman-lib/AUTHORS
diff -u pacman-lib/AUTHORS:1.5 pacman-lib/AUTHORS:1.6
--- pacman-lib/AUTHORS:1.5	Thu Jan 11 15:30:58 2007
+++ pacman-lib/AUTHORS	Fri Jan 19 04:28:44 2007
@@ -10,3 +10,4 @@
 
 Dan McGee <dpmcgee at gmail.com>
 James Rosten <seinfeld90 at gmail.com>
+Roman Kyrylych <Roman.Kyrylych at gmail.com>
Index: pacman-lib/bindings/alpm.i
diff -u pacman-lib/bindings/alpm.i:1.3 pacman-lib/bindings/alpm.i:1.4
--- pacman-lib/bindings/alpm.i:1.3	Mon Nov 20 04:10:23 2006
+++ pacman-lib/bindings/alpm.i	Fri Jan 19 04:28:44 2007
@@ -13,7 +13,7 @@
 %pointer_cast(void *, long *, void_to_long);
 %pointer_cast(void *, char *, void_to_char);
 %pointer_cast(void *, unsigned long, void_to_unsigned_long);
-%pointer_cast(void *, pmlist_t *, void_to_pmlist);
+%pointer_cast(void *, alpm_list_t *, void_to_pmlist);
 %pointer_cast(void *, pmpkg_t *, void_to_pmpkg);
 %pointer_cast(void *, pmgrp_t *, void_to_pmgrp);
 %pointer_cast(void *, pmsyncpkg_t *, void_to_pmsyncpkg);
Index: pacman-lib/lib/libalpm/Makefile.am
diff -u pacman-lib/lib/libalpm/Makefile.am:1.12 pacman-lib/lib/libalpm/Makefile.am:1.13
--- pacman-lib/lib/libalpm/Makefile.am:1.12	Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/Makefile.am	Fri Jan 19 04:28:44 2007
@@ -12,7 +12,7 @@
 	md5.c \
 	sha1.c \
 	util.c \
-	list.c \
+	alpm_list.c \
 	log.c \
 	error.c \
 	package.c \
@@ -35,7 +35,7 @@
 
 lib_LTLIBRARIES = libalpm.la
 
-include_HEADERS = alpm.h
+include_HEADERS = alpm_list.h alpm.h
 
 libalpm_la_SOURCES = $(TARGETS)
 
Index: pacman-lib/lib/libalpm/add.c
diff -u pacman-lib/lib/libalpm/add.c:1.101 pacman-lib/lib/libalpm/add.c:1.102
--- pacman-lib/lib/libalpm/add.c:1.101	Thu Jan 18 11:09:34 2007
+++ pacman-lib/lib/libalpm/add.c	Fri Jan 19 04:28:44 2007
@@ -39,7 +39,7 @@
 #include <limits.h>
 #include <libintl.h>
 /* pacman */
-#include "list.h"
+#include "alpm_list.h"
 #include "trans.h"
 #include "util.h"
 #include "error.h"
@@ -88,7 +88,7 @@
 		} else if(strncmp("version", p, q-p) == 0) {
 			STRNCPY(dummy->version, q+1, PKG_VERSION_LEN);
 		} else if(strncmp("depend", p, q-p) == 0) {
-			dummy->depends = _alpm_list_add(dummy->depends, strdup(q+1));
+			dummy->depends = alpm_list_add(dummy->depends, strdup(q+1));
 		} else {
 			_alpm_log(PM_LOG_ERROR, _("could not parse token %s"), p);
 		}
@@ -100,7 +100,7 @@
 	}
 
 	/* add the package to the transaction */
-	trans->packages = _alpm_list_add(trans->packages, dummy);
+	trans->packages = alpm_list_add(trans->packages, dummy);
 
 	return(0);
 }
@@ -110,7 +110,7 @@
 	pmpkg_t *info = NULL;
 	pmpkg_t *dummy;
 	char pkgname[PKG_NAME_LEN], pkgver[PKG_VERSION_LEN];
-	pmlist_t *i;
+	alpm_list_t *i;
 	struct stat buf;
 
 	ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -201,7 +201,7 @@
 	}
 
 	/* add the package to the transaction */
-	trans->packages = _alpm_list_add(trans->packages, info);
+	trans->packages = alpm_list_add(trans->packages, info);
 
 	return(0);
 
@@ -216,10 +216,10 @@
 	return(strcmp(((pmpkg_t *)p1)->name, (const char *)p2));
 }
 
-int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, pmlist_t **data)
+int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
 {
-	pmlist_t *lp = NULL, *i = NULL;
-	pmlist_t *rmlist = NULL;
+	alpm_list_t *lp = NULL, *i = NULL;
+	alpm_list_t *rmlist = NULL;
 	char rm_fname[PATH_MAX];
 	pmpkg_t *info = NULL;
 
@@ -254,7 +254,7 @@
 			QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, miss->target, miss->depend.name, NULL, &skip_this);
 			if(skip_this) {
 				pmpkg_t **pkg = NULL;
-				lp = _alpm_list_remove(lp, (void *)miss->depend.name, name_cmp, (void **)pkg);
+				lp = alpm_list_remove(lp, (void *)miss->depend.name, name_cmp, (void **)pkg);
 				FREEPKG(*pkg);
 			}
 		}
@@ -293,7 +293,7 @@
 	/* Check for file conflicts
 	 */
 	if(!(trans->flags & PM_TRANS_FLAG_FORCE)) {
-		pmlist_t *skiplist = NULL;
+		alpm_list_t *skiplist = NULL;
 
 		EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL);
 
@@ -334,7 +334,7 @@
 	char expath[PATH_MAX], cwd[PATH_MAX] = "", *what;
 	unsigned char cb_state;
 	time_t t;
-	pmlist_t *targ, *lp;
+	alpm_list_t *targ, *lp;
 
 	ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
 	ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
@@ -375,7 +375,7 @@
 						_alpm_log(PM_LOG_DEBUG, _("loading FILES info for '%s'"), local->name);
 						_alpm_db_read(db, INFRQ_FILES, local);
 					}
-					oldpkg->backup = _alpm_list_strdup(local->backup);
+					oldpkg->backup = alpm_list_strdup(local->backup);
 					strncpy(oldpkg->name, local->name, PKG_NAME_LEN);
 					strncpy(oldpkg->version, local->version, PKG_VERSION_LEN);
 				}
@@ -408,7 +408,7 @@
 						RET_ERR(PM_ERR_TRANS_ABORT, -1);
 					}
 					/* copy the skiplist over */
-					tr->skiplist = _alpm_list_strdup(trans->skiplist);
+					tr->skiplist = alpm_list_strdup(trans->skiplist);
 					if(_alpm_remove_commit(tr, db) == -1) {
 						FREETRANS(tr);
 						RET_ERR(PM_ERR_TRANS_ABORT, -1);
@@ -475,7 +475,7 @@
 				if (info->size != 0)
 		    			percent = (double)archive_position_uncompressed(archive) / info->size;
 				if (needdisp == 0) {
-					PROGRESS(trans, cb_state, what, (int)(percent * 100), _alpm_list_count(trans->packages), (_alpm_list_count(trans->packages) - _alpm_list_count(targ) +1));
+					PROGRESS(trans, cb_state, what, (int)(percent * 100), alpm_list_count(trans->packages), (alpm_list_count(trans->packages) - alpm_list_count(targ) +1));
 				}
 
 				if(!strcmp(pathname, ".PKGINFO") || !strcmp(pathname, ".FILELIST")) {
@@ -507,7 +507,7 @@
 				 * eg, /home/httpd/html/index.html may be removed so index.php
 				 * could be used.
 				 */
-				if(_alpm_list_is_strin(pathname, handle->noextract)) {
+				if(alpm_list_is_strin(pathname, handle->noextract)) {
 					alpm_logaction(_("notice: %s is in NoExtract -- skipping extraction"), pathname);
 					archive_read_data_skip (archive);
 					continue;
@@ -516,7 +516,7 @@
 				if(!stat(expath, &buf) && !S_ISDIR(buf.st_mode)) {
 					/* file already exists */
 					if(!pmo_upgrade || oldpkg == NULL) {
-						nb = _alpm_list_is_strin(pathname, info->backup);
+						nb = alpm_list_is_strin(pathname, info->backup);
 					} else {
 						/* op == PM_TRANS_TYPE_UPGRADE */
 						md5_orig = _alpm_needbackup(pathname, oldpkg->backup);
@@ -525,7 +525,7 @@
 							nb = 1;
 						}
 					}
-					if(_alpm_list_is_strin(pathname, handle->noupgrade)) {
+					if(alpm_list_is_strin(pathname, handle->noupgrade)) {
 						notouch = 1;
 						nb = 0;
 					}
@@ -753,7 +753,7 @@
 		 * looking for packages depending on the package to add */
 		for(lp = _alpm_db_get_pkgcache(db, INFRQ_DEPENDS); lp; lp = lp->next) {
 			pmpkg_t *tmpp = lp->data;
-			pmlist_t *tmppm = NULL;
+			alpm_list_t *tmppm = NULL;
 			if(tmpp == NULL) {
 				continue;
 			}
@@ -764,7 +764,7 @@
 				}
 				if(tmppm->data && !strcmp(depend.name, info->name)) {
 					_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s'"), tmpp->name, info->name);
-					info->requiredby = _alpm_list_add(info->requiredby, strdup(tmpp->name));
+					info->requiredby = alpm_list_add(info->requiredby, strdup(tmpp->name));
 				}
 			}
 		}
@@ -800,7 +800,7 @@
 			depinfo = _alpm_db_get_pkgfromcache(db, depend.name);
 			if(depinfo == NULL) {
 				/* look for a provides package */
-				pmlist_t *provides = _alpm_db_whatprovides(db, depend.name);
+				alpm_list_t *provides = _alpm_db_whatprovides(db, depend.name);
 				if(provides) {
 					/* TODO: should check _all_ packages listed in provides, not just
 					 *       the first one.
@@ -820,14 +820,14 @@
 			_alpm_db_read(db, INFRQ_DEPENDS, depinfo);
 
 			_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s'"), info->name, depinfo->name);
-			depinfo->requiredby = _alpm_list_add(depinfo->requiredby, strdup(info->name));
+			depinfo->requiredby = alpm_list_add(depinfo->requiredby, strdup(info->name));
 			if(_alpm_db_write(db, depinfo, INFRQ_DEPENDS)) {
 				_alpm_log(PM_LOG_ERROR, _("could not update 'requiredby' database entry %s-%s"),
 				          depinfo->name, depinfo->version);
 			}
 		}
 
-		PROGRESS(trans, cb_state, what, 100, _alpm_list_count(trans->packages), (_alpm_list_count(trans->packages) - _alpm_list_count(targ) +1));
+		PROGRESS(trans, cb_state, what, 100, alpm_list_count(trans->packages), (alpm_list_count(trans->packages) - alpm_list_count(targ) +1));
 		needdisp = 0;
 		EVENT(trans, PM_TRANS_EVT_EXTRACT_DONE, NULL, NULL);
 		FREE(what);
Index: pacman-lib/lib/libalpm/add.h
diff -u pacman-lib/lib/libalpm/add.h:1.6 pacman-lib/lib/libalpm/add.h:1.7
--- pacman-lib/lib/libalpm/add.h:1.6	Mon Nov 20 04:10:23 2006
+++ pacman-lib/lib/libalpm/add.h	Fri Jan 19 04:28:44 2007
@@ -22,11 +22,11 @@
 #define _ALPM_ADD_H
 
 #include "db.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "trans.h"
 
 int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name);
-int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, pmlist_t **data);
+int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data);
 int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db);
 
 #endif /* _ALPM_ADD_H */
Index: pacman-lib/lib/libalpm/alpm.c
diff -u pacman-lib/lib/libalpm/alpm.c:1.103 pacman-lib/lib/libalpm/alpm.c:1.104
--- pacman-lib/lib/libalpm/alpm.c:1.103	Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/alpm.c	Fri Jan 19 04:28:44 2007
@@ -42,7 +42,7 @@
 #include "versioncmp.h"
 #include "md5.h"
 #include "sha1.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "package.h"
 #include "group.h"
 #include "util.h"
@@ -169,7 +169,7 @@
 		found = 1;
 	} else {
 		void *data;
-		handle->dbs_sync = _alpm_list_remove(handle->dbs_sync, db, _alpm_db_cmp, &data);
+		handle->dbs_sync = alpm_list_remove(handle->dbs_sync, db, _alpm_db_cmp, &data);
 		if(data) {
 			found = 1;
 		}
@@ -209,7 +209,7 @@
 			found = 1;
 		}
 	} else {
-		pmlist_t *i;
+		alpm_list_t *i;
 		for(i = handle->dbs_sync; i && !found; i = i->next) {
 			pmdb_t *sdb = i->data;
 			if(strcmp(db->treename, sdb->treename) == 0) {
@@ -227,7 +227,7 @@
 			/* pm_errno is set by _alpm_server_new */
 			return(-1);
 		}
-		db->servers = _alpm_list_add(db->servers, server);
+		db->servers = alpm_list_add(db->servers, server);
 		_alpm_log(PM_LOG_FLOW2, _("adding new server to database '%s': protocol '%s', server '%s', path '%s'"),
 				db->treename, server->s_url->scheme, server->s_url->host, server->s_url->doc);
 	} else {
@@ -247,9 +247,9 @@
  */
 int alpm_db_update(int force, pmdb_t *db)
 {
-	pmlist_t *lp;
+	alpm_list_t *lp;
 	char path[PATH_MAX];
-	pmlist_t *files = NULL;
+	alpm_list_t *files = NULL;
 	char newmtime[16] = "";
 	char lastupdate[16] = "";
 	int ret;
@@ -265,7 +265,7 @@
 	ASSERT(handle->trans->state == STATE_INITIALIZED, RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1));
 	ASSERT(handle->trans->type == PM_TRANS_TYPE_SYNC, RET_ERR(PM_ERR_TRANS_TYPE, -1));
 
-	if(!_alpm_list_is_in(db, handle->dbs_sync)) {
+	if(!alpm_list_is_in(db, handle->dbs_sync)) {
 		RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
 	}
 
@@ -279,7 +279,7 @@
 
 	/* build a one-element list */
 	snprintf(path, PATH_MAX, "%s" PM_EXT_DB, db->treename);
-	files = _alpm_list_add(files, strdup(path));
+	files = alpm_list_add(files, strdup(path));
 
 	snprintf(path, PATH_MAX, "%s%s", handle->root, handle->dbpath);
 
@@ -344,7 +344,7 @@
  * @param db pointer to the package database to get the package from
  * @return the list of packages on success, NULL on error
  */
-pmlist_t *alpm_db_getpkgcache(pmdb_t *db)
+alpm_list_t *alpm_db_getpkgcache(pmdb_t *db)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -358,7 +358,7 @@
  * @param name name of the package
  * @return the list of packages on success, NULL on error
  */
-pmlist_t *alpm_db_whatprovides(pmdb_t *db, char *name)
+alpm_list_t *alpm_db_whatprovides(pmdb_t *db, char *name)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -387,7 +387,7 @@
  * @param db pointer to the package database to get the group from
  * @return the list of groups on success, NULL on error
  */
-pmlist_t *alpm_db_getgrpcache(pmdb_t *db)
+alpm_list_t *alpm_db_getgrpcache(pmdb_t *db)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -596,7 +596,7 @@
  * @param db pointer to the package database to search in
  * @return the list of packages on success, NULL on error
  */
-pmlist_t *alpm_db_search(pmdb_t *db)
+alpm_list_t *alpm_db_search(pmdb_t *db)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -687,7 +687,7 @@
  * of an error can be dumped (ie. list of conflicting files)
  * @return 0 on success, -1 on error (pm_errno is set accordingly)
  */
-int alpm_trans_prepare(pmlist_t **data)
+int alpm_trans_prepare(alpm_list_t **data)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@@ -704,7 +704,7 @@
  * of an error can be dumped (ie. list of conflicting files)
  * @return 0 on success, -1 on error (pm_errno is set accordingly)
  */
-int alpm_trans_commit(pmlist_t **data)
+int alpm_trans_commit(alpm_list_t **data)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@@ -801,81 +801,6 @@
 }
 /** @} */
 
-/** \addtogroup alpm_list List Functions
- * @brief Functions to manipulate libalpm linked lists
- * @{
- */
-
-/** Get the first element of a list.
- * @param list the list
- * @return the first element
- */
-pmlist_t *alpm_list_first(pmlist_t *list)
-{
-	return(list);
-}
-
-/** Get the next element of a list.
- * @param entry the list entry
- * @return the next element on success, NULL on error
- */
-pmlist_t *alpm_list_next(pmlist_t *entry)
-{
-	ASSERT(entry != NULL, return(NULL));
-
-	return(entry->next);
-}
-
-/** Get the data of a list entry.
- * @param entry the list entry
- * @return the data on success, NULL on error
- */
-void *alpm_list_getdata(const pmlist_t *entry)
-{
-	ASSERT(entry != NULL, return(NULL));
-
-	return(entry->data);
-}
-
-/** Free a list.
- * @param entry list to free
- * @return 0 on success, -1 on error
- */
-int alpm_list_free(pmlist_t *entry)
-{
-	ASSERT(entry != NULL, return(-1));
-
-	FREELIST(entry);
-
-	return(0);
-}
-
-/** Free the outer list, but not the contained data
- * @param entry list to free
- * @return 0 on success, -1 on error
- */
-int alpm_list_free_outer(pmlist_t *entry)
-{
-	ASSERT(entry != NULL, return(-1));
-
-	_FREELIST(entry, NULL);
-
-	return(0);
-}
-
-/** Count the entries in a list.
- * @param list the list to count
- * @return number of entries on success, NULL on error
- */
-int alpm_list_count(const pmlist_t *list)
-{
-	ASSERT(list != NULL, return(-1));
-
-	return(_alpm_list_count(list));
-}
-
-/** @} */
-
 /** \addtogroup alpm_misc Miscellaneous Functions
  * @brief Various libalpm functions
  * @{
Index: pacman-lib/lib/libalpm/alpm.h
diff -u pacman-lib/lib/libalpm/alpm.h:1.65 pacman-lib/lib/libalpm/alpm.h:1.66
--- pacman-lib/lib/libalpm/alpm.h:1.65	Fri Dec 22 14:38:55 2006
+++ pacman-lib/lib/libalpm/alpm.h	Fri Jan 19 04:28:44 2007
@@ -47,7 +47,8 @@
  * Structures
  */
 
-typedef struct __pmlist_t pmlist_t;
+typedef struct __alpm_list_t alpm_list_t;
+
 typedef struct __pmdb_t pmdb_t;
 typedef struct __pmpkg_t pmpkg_t;
 typedef struct __pmgrp_t pmgrp_t;
@@ -117,21 +118,21 @@
 unsigned char alpm_option_get_usesyslog();
 void alpm_option_set_usesyslog(unsigned char usesyslog);
 
-pmlist_t *alpm_option_get_noupgrades();
+alpm_list_t *alpm_option_get_noupgrades();
 void alpm_option_add_noupgrade(char *pkg);
-void alpm_option_set_noupgrades(pmlist_t *noupgrade);
+void alpm_option_set_noupgrades(alpm_list_t *noupgrade);
 
-pmlist_t *alpm_option_get_noextracts();
+alpm_list_t *alpm_option_get_noextracts();
 void alpm_option_add_noextract(char *pkg);
-void alpm_option_set_noextracts(pmlist_t *noextract);
+void alpm_option_set_noextracts(alpm_list_t *noextract);
 
-pmlist_t *alpm_option_get_ignorepkgs();
+alpm_list_t *alpm_option_get_ignorepkgs();
 void alpm_option_add_ignorepkg(char *pkg);
-void alpm_option_set_ignorepkgs(pmlist_t *ignorepkgs);
+void alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs);
 
-pmlist_t *alpm_option_get_holdpkgs();
+alpm_list_t *alpm_option_get_holdpkgs();
 void alpm_option_add_holdpkg(char *pkg);
-void alpm_option_set_holdpkgs(pmlist_t *holdpkgs);
+void alpm_option_set_holdpkgs(alpm_list_t *holdpkgs);
 
 time_t alpm_option_get_upgradedelay();
 void alpm_option_set_upgradedelay(time_t delay);
@@ -145,13 +146,16 @@
 unsigned short alpm_option_get_chomp();
 void alpm_option_set_chomp(unsigned short chomp);
 
-pmlist_t *alpm_option_get_needles();
+alpm_list_t *alpm_option_get_needles();
 void alpm_option_add_needle(char *needle);
-void alpm_option_set_needles(pmlist_t *needles);
+void alpm_option_set_needles(alpm_list_t *needles);
 
 unsigned short alpm_option_get_usecolor();
 void alpm_option_set_usecolor(unsigned short usecolor);
 
+pmdb_t *alpm_option_get_localdb();
+alpm_list_t *alpm_option_get_syncdbs();
+
 /*
  * Databases
  */
@@ -170,12 +174,12 @@
 int alpm_db_update(int level, pmdb_t *db);
 
 pmpkg_t *alpm_db_readpkg(pmdb_t *db, char *name);
-pmlist_t *alpm_db_getpkgcache(pmdb_t *db);
-pmlist_t *alpm_db_whatprovides(pmdb_t *db, char *name);
+alpm_list_t *alpm_db_getpkgcache(pmdb_t *db);
+alpm_list_t *alpm_db_whatprovides(pmdb_t *db, char *name);
 
 pmgrp_t *alpm_db_readgrp(pmdb_t *db, char *name);
-pmlist_t *alpm_db_getgrpcache(pmdb_t *db);
-pmlist_t *alpm_db_search(pmdb_t *db);
+alpm_list_t *alpm_db_getgrpcache(pmdb_t *db);
+alpm_list_t *alpm_db_search(pmdb_t *db);
 
 /*
  * Packages
@@ -215,23 +219,23 @@
 unsigned long alpm_pkg_get_size(pmpkg_t *pkg);
 unsigned long alpm_pkg_get_isize(pmpkg_t *pkg);
 unsigned char alpm_pkg_get_reason(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_licenses(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_groups(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_depends(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_removes(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_requiredby(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_conflicts(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_provides(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_replaces(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_files(pmpkg_t *pkg);
-pmlist_t *alpm_pkg_get_backup(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_removes(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_requiredby(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_conflicts(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_provides(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg);
+alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg);
 unsigned char alpm_pkg_has_scriptlet(pmpkg_t *pkg);
 
 /*
  * Groups
  */
 const char *alpm_grp_get_name(pmgrp_t *grp);
-pmlist_t *alpm_grp_get_packages(pmgrp_t *grp);
+alpm_list_t *alpm_grp_get_packages(pmgrp_t *grp);
 
 /*
  * Sync
@@ -334,13 +338,13 @@
 
 unsigned char alpm_trans_get_type();
 unsigned int alpm_trans_get_flags();
-pmlist_t * alpm_trans_get_targets();
-pmlist_t * alpm_trans_get_packages();
+alpm_list_t * alpm_trans_get_targets();
+alpm_list_t * alpm_trans_get_packages();
 int alpm_trans_init(unsigned char type, unsigned int flags, alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv, alpm_trans_cb_progress cb_progress);
 int alpm_trans_sysupgrade(void);
 int alpm_trans_addtarget(char *target);
-int alpm_trans_prepare(pmlist_t **data);
-int alpm_trans_commit(pmlist_t **data);
+int alpm_trans_prepare(alpm_list_t **data);
+int alpm_trans_commit(alpm_list_t **data);
 int alpm_trans_release(void);
 
 /*
@@ -382,15 +386,6 @@
 /*
  * Helpers
  */
- 
-/* pmlist_t */
-pmlist_t *alpm_list_first(pmlist_t *list);
-pmlist_t *alpm_list_next(pmlist_t *entry);
-#define alpm_list_data(type, list) (type)alpm_list_getdata((list))
-void *alpm_list_getdata(const pmlist_t *entry);
-int alpm_list_free(pmlist_t *entry);
-int alpm_list_free_outer(pmlist_t *entry);
-int alpm_list_count(const pmlist_t *list);
 
 /* md5sums */
 char *alpm_get_md5sum(char *name);
Index: pacman-lib/lib/libalpm/alpm_list.c
diff -u /dev/null pacman-lib/lib/libalpm/alpm_list.c:1.1
--- /dev/null	Fri Jan 19 04:28:47 2007
+++ pacman-lib/lib/libalpm/alpm_list.c	Fri Jan 19 04:28:44 2007
@@ -0,0 +1,429 @@
+/*
+ *  alpm_list.c
+ * 
+ *  Copyright (c) 2002-2006 by Judd Vinet <jvinet at zeroflux.org>
+ * 
+ *  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 2 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, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
+ *  USA.
+ */
+
+#include "config.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+
+#include "alpm_list.h"
+#include "util.h"
+
+/** \defgroup alpm_list functions */
+/*\@{*/
+
+/* Allocation */
+
+/** Allocate a new alpm_list_t
+ *  @return a new alpm_list_t item, or NULL on failure
+ */
+alpm_list_t *alpm_list_new()
+{
+	alpm_list_t *list = NULL;
+
+	list = (alpm_list_t *)malloc(sizeof(alpm_list_t));
+	if(list) {
+		list->data = NULL;
+		list->prev = NULL;
+		list->next = NULL;
+	}
+	return(list);
+}
+
+/** Free a list structure and possibly the internal data as well
+ *  @param list the list to free
+ *  @param fn a free function for the internal data, or NULL for none
+ */
+void alpm_list_free(alpm_list_t *list, alpm_list_fn_free fn)
+{
+	alpm_list_t *it = list;
+
+	while(it) {
+		alpm_list_t *ptr = it->next;
+		if(fn && it->data) {
+			fn(it->data);
+		}
+		FREE(it);
+		it = ptr;
+	}
+}
+
+/** Free the outer list, but not the contained data
+ *  A minor simplification of alpm_list_free
+ *  @param list the list to free
+ */
+void alpm_list_free_outer(alpm_list_t *list)
+{
+	alpm_list_free(list, NULL);
+}
+
+/* Mutators */
+
+/** Add a new item to the list
+ *  @param list the list to add to
+ *  @param data the new item to be added to the list
+ *  @return the resultant list, or NULL on failure
+ */
+alpm_list_t *alpm_list_add(alpm_list_t *list, void *data)
+{
+	alpm_list_t *ptr, *lp;
+
+	ptr = list;
+	if(ptr == NULL) {
+		ptr = alpm_list_new();
+		if(ptr == NULL) {
+			return(NULL);
+		}
+	}
+
+	lp = alpm_list_last(ptr);
+	if(lp == ptr && lp->data == NULL) {
+		/* nada */
+	} else {
+		lp->next = alpm_list_new();
+		if(lp->next == NULL) {
+			return(NULL);
+		}
+		lp->next->prev = lp;
+		lp = lp->next;
+	}
+
+	lp->data = data;
+
+	return(ptr);
+}
+
+/** Add items to a list in sorted order.
+ *  @param list the list to add to
+ *  @param data the new item to be added to the list
+ *  @param fn the comparison function to use to determine order
+ *  @return the resultant list, or NULL on failure
+ */
+alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn)
+{
+	if(!fn) {
+		return alpm_list_add(list, data);
+	} else {
+		alpm_list_t *add = NULL, *prev = NULL, *next = list;
+
+		add = alpm_list_new();
+		add->data = data;
+
+		/* Find insertion point. */
+		while(next) {
+			if(fn(add->data, next->data) <= 0) break;
+			prev = next;
+			next = next->next;
+		}
+
+		/*  Insert node before insertion point. */
+		add->prev = prev;
+		add->next = next;
+
+		if(next != NULL) {
+			next->prev = add;   /*  Not at end.  */
+		}
+
+		if(prev != NULL) {
+			prev->next = add;       /*  In middle.  */
+		}
+
+		return(list);
+	}
+}
+
+/** Merge the two sorted sublists into one sorted list
+ * @param left the first list
+ * @param right the second list
+ * @param fn comparison function for determining merge order
+ */
+alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn)
+{
+	alpm_list_t *newlist, *lp;
+
+	if (left == NULL) 
+		return right;
+	if (right == NULL)
+		return left;
+
+	if (fn(left->data, right->data) <= 0) {
+		newlist = left;
+		left = left->next;
+	}
+	else {
+		newlist = right;
+		right = right->next;
+	}
+	newlist->prev = NULL;
+	newlist->next = NULL;
+	lp = newlist;
+
+	while ((left != NULL) && (right != NULL)) {
+		if (fn(left->data, right->data) <= 0) {
+			lp->next = left;
+			left->prev = lp;
+			left = left->next;
+		} 
+		else {
+			lp->next = right;
+			right->prev = lp;
+			right = right->next;
+		}
+		lp = lp->next;
+		lp->next = NULL;
+	}
+	if (left != NULL) {
+		lp->next = left;
+		left->prev = lp;
+	}
+	else if (right != NULL) {
+		lp->next = right;
+		right->prev = lp;
+	}
+	return(newlist);
+}
+
+/** Sort a list of size `n` using mergesort algorithm
+ *  @param list the list to sort
+ *  @param n the size of the list
+ *  @param fn the comparison function for determining order
+ */
+alpm_list_t* alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn)
+{
+	if (n > 1) {
+		alpm_list_t *left = list;
+		alpm_list_t *lastleft = alpm_list_nth(list, n/2 - 1);
+		alpm_list_t *right = lastleft->next;
+		/* terminate first list */
+		lastleft->next = NULL;	
+
+		left = alpm_list_msort(left, n/2, fn);
+		right = alpm_list_msort(right, n - (n/2), fn);
+		list = alpm_list_mmerge(left, right, fn);
+	}
+	return(list);
+}
+
+/** Remove an item from the list
+ *  @param haystack the list to remove the item from
+ *  @param needle the data member of the item we're removing
+ *  @param fn the comparison function for searching
+ *  @param data output parameter containing the data member of the item removed
+ *  @return the resultant list, or NULL on failure
+ */
+alpm_list_t *alpm_list_remove(alpm_list_t *haystack, void *needle, alpm_list_fn_cmp fn, void **data)
+{ /* TODO I modified this to remove ALL matching items.  Do we need a remove_first? */
+	alpm_list_t *i = haystack, *tmp = NULL;
+
+	if(data) {
+		*data = NULL;
+	}
+
+	while(i) {
+		if(i->data == NULL) {
+			continue;
+		}
+		tmp = i->next;
+		if(fn(needle, i->data) == 0) {
+			/* we found a matching item */
+			if(i->next) {
+				i->next->prev = i->prev;
+			}
+			if(i->prev) {
+				i->prev->next = i->next;
+			}
+
+			if(i == haystack) {
+				/* The item found is the first in the chain */
+				haystack = haystack->next;
+			}
+
+			if(data) {
+				*data = i->data;
+			}
+			i->data = NULL;
+			free(i);
+		}
+		i = tmp;
+	}
+
+	return(haystack);
+}
+
+/** Create a new list without any duplicates
+ *  @note DOES NOT copy data members
+ *  @param list the list to copy
+ *  @return a NEW list containing non-duplicated items
+ */
+alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list)
+{ /* TODO does removing the strdup here cause invalid free's anywhere? */
+	alpm_list_t *lp = list, *newlist = NULL;
+	while(lp) {
+		if(!alpm_list_is_in(lp->data, newlist)) {
+			newlist = alpm_list_add(newlist, lp->data);
+		}
+		lp = lp->next;
+	}
+	return(newlist);
+}
+
+/** Copy a string list, including data
+ *  @note this is gross, assumes string data members
+ *  @param list the list to copy
+ *  @return a copy of the original list
+ */
+alpm_list_t *alpm_list_strdup(alpm_list_t *list)
+{
+	alpm_list_t *lp = list, *newlist = NULL;
+	while(lp) {
+		newlist = alpm_list_add(newlist, strdup(lp->data));
+		lp = lp->next;
+	}
+	return(newlist);
+}
+
+/** Create a new list in reverse order
+ *  @param list the list to copy
+ *  @return a NEW list in reverse order of the first
+ */
+alpm_list_t *alpm_list_reverse(alpm_list_t *list)
+{ /* TODO any invalid free's from NOT duplicating data here? */
+	alpm_list_t *lp, *newlist = NULL;
+
+	lp = alpm_list_last(list);
+	while(lp) {
+		newlist = alpm_list_add(newlist, lp->data);
+		lp = lp->prev;
+	}
+	return(newlist);
+}
+
+/* Accessors */
+
+/** Get the first element of a list.
+ * @param list the list
+ * @return the first element in the list
+ */
+alpm_list_t *alpm_list_first(alpm_list_t *list)
+{
+	return(list);
+}
+
+/** Return nth element from list (starting with 0)
+ *  @param list the list to access
+ *  @param n the index of the item to find
+ *  @return an alpm_list_t node for index `n`
+ */
+alpm_list_t *alpm_list_nth(alpm_list_t *list, int n)
+{
+	alpm_list_t *i = list;
+	while(n--) {
+		i = i->next;
+	}
+	return(i);
+}
+
+/** Get the next element of a list.
+ * @param entry the list entry
+ * @return the next element, or NULL when no more elements exist
+ */
+alpm_list_t *alpm_list_next(alpm_list_t *entry)
+{
+	return(entry->next);
+}
+/** Get the last item in the list.
+ *  @param list the list to operate on
+ *  @return the last element in the list
+ */
+alpm_list_t *alpm_list_last(alpm_list_t *list)
+{
+	alpm_list_t *i = list;
+	while(i && i->next) {
+		i = i->next;
+	}
+	return(i);
+}
+
+/** Get the data member of a list entry.
+ * @param entry the list entry
+ * @return the contained data, or NULL if none
+ */
+void *alpm_list_getdata(const alpm_list_t *entry)
+{
+	return(entry->data);
+}
+
+/* Misc */
+
+/** Count the list items
+ *  @param list the list to operate on
+ *  @return the number of list items
+ */
+int alpm_list_count(const alpm_list_t *list)
+{
+	unsigned int i = 0;
+	const alpm_list_t *lp = list;
+	while(lp) {
+		++i;
+		lp = lp->next;
+	}
+	return(i);
+}
+
+/** Is an item in the list
+ *  @param needle the data to compare to (== comparison)
+ *  @param haystack the list to search
+ *  @return 1 if `needle` is found, 0 otherwise
+ */
+int alpm_list_is_in(const void *needle, alpm_list_t *haystack)
+{
+	alpm_list_t *lp = haystack;
+	while(lp) {
+		if(lp->data == needle) {
+			return(1);
+		}
+		lp = lp->next;
+	}
+	return(0);
+}
+
+/* Test for existence of a string in a alpm_list_t
+*/
+/** Is a _string_ in the list (optimization of alpm_list_is_in for strings)
+ *  @param needle the string to compare
+ *  @param haystack the list to search
+ *  @return 1 if `needle` is found, 0 otherwise
+ */
+int alpm_list_is_strin(const char *needle, alpm_list_t *haystack)
+{
+	alpm_list_t *lp = haystack;
+	while(lp) {
+		if(lp->data && strcmp((const char *)lp->data, needle) == 0) {
+			return(1);
+		}
+	}
+	return(0);
+}
+
+/** @} */
+
+/* vim: set ts=2 sw=2 noet: */
Index: pacman-lib/lib/libalpm/alpm_list.h
diff -u /dev/null pacman-lib/lib/libalpm/alpm_list.h:1.1
--- /dev/null	Fri Jan 19 04:28:47 2007
+++ pacman-lib/lib/libalpm/alpm_list.h	Fri Jan 19 04:28:44 2007
@@ -0,0 +1,71 @@
+/*
+ *  alpm_alpm_list.h
+ * 
+ *  Copyright (c) 2002-2006 by Judd Vinet <jvinet at zeroflux.org>
+ * 
+ *  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 2 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, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
+ *  USA.
+ */
+#ifndef _ALPM_LIST_H
+#define _ALPM_LIST_H
+
+#include "alpm.h"
+
+/* Chained list struct */
+struct __alpm_list_t {
+	void *data;
+	struct __alpm_list_t *prev;
+	struct __alpm_list_t *next;
+};
+
+/* TODO we should do away with these... they're messy */
+#define _FREELIST(p, f) do { if(p) { alpm_list_free(p, f); p = NULL; } } while(0)
+#define FREELIST(p) _FREELIST(p, free)
+#define FREELISTPTR(p) _FREELIST(p, NULL)
+
+typedef void (*alpm_list_fn_free)(void *); /* item deallocation callback */
+typedef int (*alpm_list_fn_cmp)(const void *, const void *); /* item comparison callback */
+
+/* allocation */
+alpm_list_t *alpm_list_new(void);
+void alpm_list_free(alpm_list_t *list, alpm_list_fn_free fn);
+void alpm_list_free_outer(alpm_list_t *list);
+
+/* item mutators */
+alpm_list_t *alpm_list_add(alpm_list_t *list, void *data);
+alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn);
+alpm_list_t* alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn);
+alpm_list_t* alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn);
+alpm_list_t *alpm_list_remove(alpm_list_t *haystack, void *needle, alpm_list_fn_cmp fn, void **data);
+alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list);
+alpm_list_t *alpm_list_strdup(alpm_list_t *list);
+alpm_list_t *alpm_list_reverse(alpm_list_t *list);
+
+/* item accessors */
+alpm_list_t *alpm_list_first(alpm_list_t *list);
+alpm_list_t* alpm_list_nth(alpm_list_t *list, int n);
+alpm_list_t *alpm_list_next(alpm_list_t *list);
+alpm_list_t *alpm_list_last(alpm_list_t *list);
+void *alpm_list_getdata(const alpm_list_t *entry);
+#define alpm_list_data(type, list) (type)alpm_list_getdata((list))
+
+/* misc */
+int alpm_list_count(const alpm_list_t *list);
+int alpm_list_is_in(const void *needle, alpm_list_t *haystack);
+int alpm_list_is_strin(const char *needle, alpm_list_t *haystack);
+
+#endif /* _ALPM_LIST_H */
+
+/* vim: set ts=2 sw=2 noet: */
Index: pacman-lib/lib/libalpm/backup.c
diff -u pacman-lib/lib/libalpm/backup.c:1.8 pacman-lib/lib/libalpm/backup.c:1.9
--- pacman-lib/lib/libalpm/backup.c:1.8	Fri Dec 22 14:38:55 2006
+++ pacman-lib/lib/libalpm/backup.c	Fri Jan 19 04:28:44 2007
@@ -32,9 +32,9 @@
 /* Look for a filename in a pmpkg_t.backup list.  If we find it,
  * then we return the md5 or sha1 hash (parsed from the same line)
  */
-char *_alpm_needbackup(char *file, pmlist_t *backup)
+char *_alpm_needbackup(char *file, alpm_list_t *backup)
 {
-	pmlist_t *lp;
+	alpm_list_t *lp;
 
 	if(file == NULL || backup == NULL) {
 		return(NULL);
Index: pacman-lib/lib/libalpm/backup.h
diff -u pacman-lib/lib/libalpm/backup.h:1.4 pacman-lib/lib/libalpm/backup.h:1.5
--- pacman-lib/lib/libalpm/backup.h:1.4	Fri Oct 20 02:26:55 2006
+++ pacman-lib/lib/libalpm/backup.h	Fri Jan 19 04:28:44 2007
@@ -21,9 +21,9 @@
 #ifndef _ALPM_BACKUP_H
 #define _ALPM_BACKUP_H
 
-#include "list.h"
+#include "alpm_list.h"
 
-char *_alpm_needbackup(char *file, pmlist_t *backup);
+char *_alpm_needbackup(char *file, alpm_list_t *backup);
 
 #endif /* _ALPM_BACKUP_H */
 
Index: pacman-lib/lib/libalpm/be_files.c
diff -u pacman-lib/lib/libalpm/be_files.c:1.19 pacman-lib/lib/libalpm/be_files.c:1.20
--- pacman-lib/lib/libalpm/be_files.c:1.19	Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/be_files.c	Fri Jan 19 04:28:44 2007
@@ -181,7 +181,7 @@
 	struct stat buf;
 	char path[PATH_MAX+1];
 	char line[513];
-	pmlist_t *tmplist;
+	alpm_list_t *tmplist;
 	char *locale;
 
 	if(db == NULL) {
@@ -238,7 +238,7 @@
 				_alpm_strtrim(info->filename);
 		  } else if(!strcmp(line, "%DESC%")) {
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->desc_localized = _alpm_list_add(info->desc_localized, strdup(line));
+					info->desc_localized = alpm_list_add(info->desc_localized, strdup(line));
 				}
 
 				if((locale = setlocale(LC_ALL, "")) == NULL) { /* To fix segfault when locale invalid */
@@ -263,7 +263,7 @@
 				_alpm_strtrim(info->desc);
 			} else if(!strcmp(line, "%GROUPS%")) {
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->groups = _alpm_list_add(info->groups, strdup(line));
+					info->groups = alpm_list_add(info->groups, strdup(line));
 				}
 			} else if(!strcmp(line, "%URL%")) {
 				if(fgets(info->url, sizeof(info->url), fp) == NULL) {
@@ -272,7 +272,7 @@
 				_alpm_strtrim(info->url);
 			} else if(!strcmp(line, "%LICENSE%")) {
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->license = _alpm_list_add(info->license, strdup(line));
+					info->license = alpm_list_add(info->license, strdup(line));
 				}
 			} else if(!strcmp(line, "%ARCH%")) {
 				if(fgets(info->arch, sizeof(info->arch), fp) == NULL) {
@@ -347,7 +347,7 @@
 				/* the REPLACES tag is special -- it only appears in sync repositories,
 				 * not the local one. */
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->replaces = _alpm_list_add(info->replaces, strdup(line));
+					info->replaces = alpm_list_add(info->replaces, strdup(line));
 				}
 			} else if(!strcmp(line, "%FORCE%")) {
 				/* FORCE tag only appears in sync repositories,
@@ -371,11 +371,11 @@
 			_alpm_strtrim(line);
 			if(!strcmp(line, "%FILES%")) {
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->files = _alpm_list_add(info->files, strdup(line));
+					info->files = alpm_list_add(info->files, strdup(line));
 				}
 			} else if(!strcmp(line, "%BACKUP%")) {
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->backup = _alpm_list_add(info->backup, strdup(line));
+					info->backup = alpm_list_add(info->backup, strdup(line));
 				}
 			}
 		}
@@ -396,25 +396,25 @@
 			_alpm_strtrim(line);
 			if(!strcmp(line, "%DEPENDS%")) {
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->depends = _alpm_list_add(info->depends, strdup(line));
+					info->depends = alpm_list_add(info->depends, strdup(line));
 				}
 			} else if(!strcmp(line, "%REQUIREDBY%")) {
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->requiredby = _alpm_list_add(info->requiredby, strdup(line));
+					info->requiredby = alpm_list_add(info->requiredby, strdup(line));
 				}
 			} else if(!strcmp(line, "%CONFLICTS%")) {
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->conflicts = _alpm_list_add(info->conflicts, strdup(line));
+					info->conflicts = alpm_list_add(info->conflicts, strdup(line));
 				}
 			} else if(!strcmp(line, "%PROVIDES%")) {
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->provides = _alpm_list_add(info->provides, strdup(line));
+					info->provides = alpm_list_add(info->provides, strdup(line));
 				}
 			} else if(!strcmp(line, "%REPLACES%")) {
 				/* the REPLACES tag is special -- it only appears in sync repositories,
 				 * not the local one. */
 				while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
-					info->replaces = _alpm_list_add(info->replaces, strdup(line));
+					info->replaces = alpm_list_add(info->replaces, strdup(line));
 				}
 			} else if(!strcmp(line, "%FORCE%")) {
 				/* FORCE tag only appears in sync repositories,
@@ -451,7 +451,7 @@
 	FILE *fp = NULL;
 	char path[PATH_MAX];
 	mode_t oldmask;
-	pmlist_t *lp = NULL;
+	alpm_list_t *lp = NULL;
 	int retval = 0;
 	int local = 0;
 
Index: pacman-lib/lib/libalpm/cache.c
diff -u pacman-lib/lib/libalpm/cache.c:1.24 pacman-lib/lib/libalpm/cache.c:1.25
--- pacman-lib/lib/libalpm/cache.c:1.24	Thu Jan 11 12:44:39 2007
+++ pacman-lib/lib/libalpm/cache.c	Fri Jan 19 04:28:44 2007
@@ -30,7 +30,7 @@
 /* pacman */
 #include "log.h"
 #include "alpm.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "util.h"
 #include "error.h"
 #include "package.h"
@@ -62,11 +62,11 @@
 		info->origin = PKG_FROM_CACHE;
 		info->data = db;
 		/* add to the collection */
-		db->pkgcache = _alpm_list_add(db->pkgcache, info);
+		db->pkgcache = alpm_list_add(db->pkgcache, info);
 		count++;
 	}
 
-	db->pkgcache = _alpm_list_msort(db->pkgcache, count, _alpm_pkg_cmp);
+	db->pkgcache = alpm_list_msort(db->pkgcache, count, _alpm_pkg_cmp);
 	return(0);
 }
 
@@ -86,7 +86,7 @@
 	}
 }
 
-pmlist_t *_alpm_db_get_pkgcache(pmdb_t *db, unsigned char infolevel)
+alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, unsigned char infolevel)
 {
 	if(db == NULL) {
 		return(NULL);
@@ -108,7 +108,7 @@
 	 * info is not already cached
 	 */
 
-  pmlist_t *p;
+  alpm_list_t *p;
 	for(p = db->pkgcache; p; p = p->next) {
 		pmpkg_t *pkg = (pmpkg_t *)p->data;
 		if(infolevel != INFRQ_NONE && !(pkg->infolevel & infolevel)) {
@@ -136,7 +136,7 @@
 		return(-1);
 	}
 	_alpm_log(PM_LOG_DEBUG, _("adding entry '%s' in '%s' cache"), newpkg->name, db->treename);
-	db->pkgcache = _alpm_list_add_sorted(db->pkgcache, newpkg, _alpm_pkg_cmp);
+	db->pkgcache = alpm_list_add_sorted(db->pkgcache, newpkg, _alpm_pkg_cmp);
 
 	_alpm_db_free_grpcache(db);
 
@@ -152,7 +152,7 @@
 		return(-1);
 	}
 
-	db->pkgcache = _alpm_list_remove(db->pkgcache, pkg, _alpm_pkg_cmp, &vdata);
+	db->pkgcache = alpm_list_remove(db->pkgcache, pkg, _alpm_pkg_cmp, &vdata);
 	data = vdata;
 	if(data == NULL) {
 		/* package not found */
@@ -180,7 +180,7 @@
  */
 int _alpm_db_load_grpcache(pmdb_t *db)
 {
-	pmlist_t *lp;
+	alpm_list_t *lp;
 
 	if(db == NULL) {
 		return(-1);
@@ -193,25 +193,25 @@
 	_alpm_log(PM_LOG_DEBUG, _("loading group cache for repository '%s'"), db->treename);
 
 	for(lp = _alpm_db_get_pkgcache(db, INFRQ_DESC); lp; lp = lp->next) {
-		pmlist_t *i;
+		alpm_list_t *i;
 		pmpkg_t *pkg = lp->data;
 
 		for(i = pkg->groups; i; i = i->next) {
-			if(!_alpm_list_is_strin(i->data, db->grpcache)) {
+			if(!alpm_list_is_strin(i->data, db->grpcache)) {
 				pmgrp_t *grp = _alpm_grp_new();
 
 				STRNCPY(grp->name, (char *)i->data, GRP_NAME_LEN);
-				grp->packages = _alpm_list_add_sorted(grp->packages, pkg->name, _alpm_grp_cmp);
-				db->grpcache = _alpm_list_add_sorted(db->grpcache, grp, _alpm_grp_cmp);
+				grp->packages = alpm_list_add_sorted(grp->packages, pkg->name, _alpm_grp_cmp);
+				db->grpcache = alpm_list_add_sorted(db->grpcache, grp, _alpm_grp_cmp);
 			} else {
-				pmlist_t *j;
+				alpm_list_t *j;
 
 				for(j = db->grpcache; j; j = j->next) {
 					pmgrp_t *grp = j->data;
 
 					if(strcmp(grp->name, i->data) == 0) {
-						if(!_alpm_list_is_strin(pkg->name, grp->packages)) {
-							grp->packages = _alpm_list_add_sorted(grp->packages, (char *)pkg->name, _alpm_grp_cmp);
+						if(!alpm_list_is_strin(pkg->name, grp->packages)) {
+							grp->packages = alpm_list_add_sorted(grp->packages, (char *)pkg->name, _alpm_grp_cmp);
 						}
 					}
 				}
@@ -224,7 +224,7 @@
 
 void _alpm_db_free_grpcache(pmdb_t *db)
 {
-	pmlist_t *lg;
+	alpm_list_t *lg;
 
 	if(db == NULL || db->grpcache == NULL) {
 		return;
@@ -239,7 +239,7 @@
 	FREELIST(db->grpcache);
 }
 
-pmlist_t *_alpm_db_get_grpcache(pmdb_t *db)
+alpm_list_t *_alpm_db_get_grpcache(pmdb_t *db)
 {
 	if(db == NULL) {
 		return(NULL);
@@ -254,7 +254,7 @@
 
 pmgrp_t *_alpm_db_get_grpfromcache(pmdb_t *db, char *target)
 {
-	pmlist_t *i;
+	alpm_list_t *i;
 
 	if(db == NULL || target == NULL || strlen(target) == 0) {
 		return(NULL);
Index: pacman-lib/lib/libalpm/cache.h
diff -u pacman-lib/lib/libalpm/cache.h:1.8 pacman-lib/lib/libalpm/cache.h:1.9
--- pacman-lib/lib/libalpm/cache.h:1.8	Mon Nov 20 04:10:23 2006
+++ pacman-lib/lib/libalpm/cache.h	Fri Jan 19 04:28:44 2007
@@ -22,7 +22,7 @@
 #define _ALPM_CACHE_H
 
 #include "db.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "group.h"
 #include "package.h"
 
@@ -31,13 +31,13 @@
 void _alpm_db_free_pkgcache(pmdb_t *db);
 int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg);
 int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg);
-pmlist_t *_alpm_db_get_pkgcache(pmdb_t *db, unsigned char infolevel);
+alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db, unsigned char infolevel);
 int _alpm_db_ensure_pkgcache(pmdb_t *db, unsigned char infolevel);
 pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, char *target);
 /* groups */
 int _alpm_db_load_grpcache(pmdb_t *db);
 void _alpm_db_free_grpcache(pmdb_t *db);
-pmlist_t *_alpm_db_get_grpcache(pmdb_t *db);
+alpm_list_t *_alpm_db_get_grpcache(pmdb_t *db);
 pmgrp_t *_alpm_db_get_grpfromcache(pmdb_t *db, char *target);
 
 #endif /* _ALPM_CACHE_H */
Index: pacman-lib/lib/libalpm/conflict.c
diff -u pacman-lib/lib/libalpm/conflict.c:1.29 pacman-lib/lib/libalpm/conflict.c:1.30
--- pacman-lib/lib/libalpm/conflict.c:1.29	Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/conflict.c	Fri Jan 19 04:28:44 2007
@@ -37,7 +37,7 @@
 #include <libintl.h>
 /* pacman */
 #include "handle.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "trans.h"
 #include "util.h"
 #include "error.h"
@@ -46,15 +46,15 @@
 #include "deps.h"
 #include "conflict.h"
 
-/* Returns a pmlist_t* of pmdepmissing_t pointers.
+/* Returns a alpm_list_t* of pmdepmissing_t pointers.
  *
  * conflicts are always name only
  */
-pmlist_t *_alpm_checkconflicts(pmdb_t *db, pmlist_t *packages)
+alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages)
 {
 	pmpkg_t *info = NULL;
-	pmlist_t *i, *j, *k;
-	pmlist_t *baddeps = NULL;
+	alpm_list_t *i, *j, *k;
+	alpm_list_t *baddeps = NULL;
 	pmdepmissing_t *miss = NULL;
 
 	if(db == NULL) {
@@ -86,13 +86,13 @@
 					          dp->name, tp->name);
 					miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, dp->name, NULL);
 					if(!_alpm_depmiss_isin(miss, baddeps)) {
-						baddeps = _alpm_list_add(baddeps, miss);
+						baddeps = alpm_list_add(baddeps, miss);
 					} else {
 						FREE(miss);
 					}
 				} else {
 					/* see if dp provides something in tp's conflict list */
-					pmlist_t *m;
+					alpm_list_t *m;
 					for(m = dp->provides; m; m = m->next) {
 						if(!strcmp(m->data, j->data)) {
 							/* confict */
@@ -100,7 +100,7 @@
 							          dp->name, tp->name);
 							miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, dp->name, NULL);
 							if(!_alpm_depmiss_isin(miss, baddeps)) {
-								baddeps = _alpm_list_add(baddeps, miss);
+								baddeps = alpm_list_add(baddeps, miss);
 							} else {
 								FREE(miss);
 							}
@@ -122,20 +122,20 @@
 					          otp->name, tp->name);
 					miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, otp->name, NULL);
 					if(!_alpm_depmiss_isin(miss, baddeps)) {
-						baddeps = _alpm_list_add(baddeps, miss);
+						baddeps = alpm_list_add(baddeps, miss);
 					} else {
 						FREE(miss);
 					}
 				} else {
 					/* see if otp provides something in tp's conflict list */ 
-					pmlist_t *m;
+					alpm_list_t *m;
 					for(m = otp->provides; m; m = m->next) {
 						if(!strcmp(m->data, j->data)) {
 							_alpm_log(PM_LOG_DEBUG, _("targs vs targs: found %s as a conflict for %s"),
 							          otp->name, tp->name);
 							miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, otp->name, NULL);
 							if(!_alpm_depmiss_isin(miss, baddeps)) {
-								baddeps = _alpm_list_add(baddeps, miss);
+								baddeps = alpm_list_add(baddeps, miss);
 							} else {
 								FREE(miss);
 							}
@@ -147,7 +147,7 @@
 		/* CHECK 3: check database against targets */
 		_alpm_log(PM_LOG_DEBUG, _("checkconflicts: db vs targ '%s'"), tp->name);
 		for(k = _alpm_db_get_pkgcache(db, INFRQ_DEPENDS); k; k = k->next) {
-			pmlist_t *conflicts = NULL;
+			alpm_list_t *conflicts = NULL;
 			int usenewconflicts = 0;
 
 			info = k->data;
@@ -155,7 +155,7 @@
 				/* a package cannot conflict with itself -- that's just not nice */
 				continue;
 			}
-			/* If this package (*info) is also in our packages pmlist_t, use the
+			/* If this package (*info) is also in our packages alpm_list_t, use the
 			 * conflicts list from the new package, not the old one (*info)
 			 */
 			for(j = packages; j; j = j->next) {
@@ -176,22 +176,22 @@
 					          info->name, tp->name);
 					miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, info->name, NULL);
 					if(!_alpm_depmiss_isin(miss, baddeps)) {
-						baddeps = _alpm_list_add(baddeps, miss);
+						baddeps = alpm_list_add(baddeps, miss);
 					} else {
 						FREE(miss);
 					}
 				} else {
 					/* see if the db package conflicts with something we provide */
-					pmlist_t *m;
+					alpm_list_t *m;
 					for(m = conflicts; m; m = m->next) {
-						pmlist_t *n;
+						alpm_list_t *n;
 						for(n = tp->provides; n; n = n->next) {
 							if(!strcmp(m->data, n->data)) {
 								_alpm_log(PM_LOG_DEBUG, _("db vs targs: found %s as a conflict for %s"),
 								          info->name, tp->name);
 								miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_CONFLICT, PM_DEP_MOD_ANY, info->name, NULL);
 								if(!_alpm_depmiss_isin(miss, baddeps)) {
-									baddeps = _alpm_list_add(baddeps, miss);
+									baddeps = alpm_list_add(baddeps, miss);
 								} else {
 									FREE(miss);
 								}
@@ -206,18 +206,18 @@
 	return(baddeps);
 }
 
-/* Returns a pmlist_t* of file conflicts.
+/* Returns a alpm_list_t* of file conflicts.
  *
- * adds list of files to skip to pmlist_t** skip_list.
+ * adds list of files to skip to alpm_list_t** skip_list.
  */
-pmlist_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root, pmlist_t **skip_list)
+alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root, alpm_list_t **skip_list)
 {
-	pmlist_t *i, *j, *k;
+	alpm_list_t *i, *j, *k;
 	char *filestr = NULL;
 	char path[PATH_MAX+1];
 	struct stat buf, buf2;
-	pmlist_t *conflicts = NULL;
-	pmlist_t *targets = trans->packages;
+	alpm_list_t *conflicts = NULL;
+	alpm_list_t *targets = trans->packages;
 	double percent;
 
 	if(db == NULL || targets == NULL || root == NULL) {
@@ -226,8 +226,8 @@
 	/* CHECK 1: check every target against every target */
 	for(i = targets; i; i = i->next) {
 		pmpkg_t *p1 = (pmpkg_t*)i->data;
-		percent = (double)(_alpm_list_count(targets) - _alpm_list_count(i) + 1) / _alpm_list_count(targets);
-		PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", (percent * 100), _alpm_list_count(targets), (_alpm_list_count(targets) - _alpm_list_count(i) +1));
+		percent = (double)(alpm_list_count(targets) - alpm_list_count(i) + 1) / alpm_list_count(targets);
+		PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", (percent * 100), alpm_list_count(targets), (alpm_list_count(targets) - alpm_list_count(i) +1));
 		for(j = i; j; j = j->next) {
 			pmpkg_t *p2 = (pmpkg_t*)j->data;
 			if(strcmp(p1->name, p2->name)) {
@@ -240,7 +240,7 @@
 					if(strcmp(filestr, ".INSTALL") == 0) {
 						continue;
 					}
-					if(_alpm_list_is_strin(filestr, p2->files)) {
+					if(alpm_list_is_strin(filestr, p2->files)) {
 						pmconflict_t *conflict = malloc(sizeof(pmconflict_t));
 						if(conflict == NULL) {
 							_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"),
@@ -251,7 +251,7 @@
 						STRNCPY(conflict->target, p1->name, PKG_NAME_LEN);
 						STRNCPY(conflict->file, filestr, CONFLICT_FILE_LEN);
 						STRNCPY(conflict->ctarget, p2->name, PKG_NAME_LEN);
-						conflicts = _alpm_list_add(conflicts, conflict);
+						conflicts = alpm_list_add(conflicts, conflict);
 					}
 				}
 			}
@@ -284,7 +284,7 @@
 						_alpm_log(PM_LOG_DEBUG, _("loading FILES info for '%s'"), dbpkg->name);
 						_alpm_db_read(db, INFRQ_FILES, dbpkg);
 					}
-					if(dbpkg && _alpm_list_is_strin(j->data, dbpkg->files)) {
+					if(dbpkg && alpm_list_is_strin(j->data, dbpkg->files)) {
 						ok = 1;
 					}
 					/* Make sure that the supposedly-conflicting file is not actually just
@@ -315,7 +315,7 @@
 									_alpm_db_read(db, INFRQ_FILES, dbpkg2);
 								}
 								/* If it used to exist in there, but doesn't anymore */
-								if(dbpkg2 && !_alpm_list_is_strin(filestr, p1->files) && _alpm_list_is_strin(filestr, dbpkg2->files)) {
+								if(dbpkg2 && !alpm_list_is_strin(filestr, p1->files) && alpm_list_is_strin(filestr, dbpkg2->files)) {
 									ok = 1;
 									/* Add to the "skip list" of files that we shouldn't remove during an upgrade.
 									 *
@@ -333,7 +333,7 @@
 									 * Our workaround is to scan through all "old" packages and all "new"
 									 * ones, looking for files that jump to different packages.
 									 */
-									*skip_list = _alpm_list_add(*skip_list, strdup(filestr));
+									*skip_list = alpm_list_add(*skip_list, strdup(filestr));
 								}
 							}
 						}
@@ -350,7 +350,7 @@
 					STRNCPY(conflict->target, p->name, PKG_NAME_LEN);
 					STRNCPY(conflict->file, filestr, CONFLICT_FILE_LEN);
 					conflict->ctarget[0] = 0;
-					conflicts = _alpm_list_add(conflicts, conflict);
+					conflicts = alpm_list_add(conflicts, conflict);
 				}
 			}
 		}
Index: pacman-lib/lib/libalpm/conflict.h
diff -u pacman-lib/lib/libalpm/conflict.h:1.9 pacman-lib/lib/libalpm/conflict.h:1.10
--- pacman-lib/lib/libalpm/conflict.h:1.9	Mon Nov 20 04:10:23 2006
+++ pacman-lib/lib/libalpm/conflict.h	Fri Jan 19 04:28:44 2007
@@ -33,8 +33,8 @@
 	char ctarget[PKG_NAME_LEN];
 };
 
-pmlist_t *_alpm_checkconflicts(pmdb_t *db, pmlist_t *packages);
-pmlist_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root, pmlist_t **skip_list);
+alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages);
+alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root, alpm_list_t **skip_list);
 
 #endif /* _ALPM_CONFLICT_H */
 
Index: pacman-lib/lib/libalpm/db.c
diff -u pacman-lib/lib/libalpm/db.c:1.53 pacman-lib/lib/libalpm/db.c:1.54
--- pacman-lib/lib/libalpm/db.c:1.53	Tue Jan 16 22:57:53 2007
+++ pacman-lib/lib/libalpm/db.c	Fri Jan 19 04:28:44 2007
@@ -96,9 +96,9 @@
 	return(strcmp(((pmdb_t *)db1)->treename, ((pmdb_t *)db2)->treename));
 }
 
-pmlist_t *_alpm_db_search(pmdb_t *db, pmlist_t *needles)
+alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles)
 {
-	pmlist_t *i, *j, *k, *ret = NULL;
+	alpm_list_t *i, *j, *k, *ret = NULL;
 
 	for(i = needles; i; i = i->next) {
 		char *targ;
@@ -139,7 +139,7 @@
 
 			if(matched != NULL) {
 				_alpm_log(PM_LOG_DEBUG, "    search target '%s' matched '%s'", targ, matched);
-				ret = _alpm_list_add(ret, pkg);
+				ret = alpm_list_add(ret, pkg);
 			}
 		}
 	}
@@ -159,7 +159,7 @@
 			RET_ERR(PM_ERR_DB_NOT_NULL, NULL);
 		}
 	} else {
-		pmlist_t *i;
+		alpm_list_t *i;
 		for(i = handle->dbs_sync; i; i = i->next) {
 			pmdb_t *sdb = i->data;
 			if(strcmp(treename, sdb->treename) == 0) {
@@ -197,7 +197,7 @@
 	if(strcmp(treename, "local") == 0) {
 		handle->db_local = db;
 	} else {
-		handle->dbs_sync = _alpm_list_add(handle->dbs_sync, db);
+		handle->dbs_sync = alpm_list_add(handle->dbs_sync, db);
 	}
 
 	return(db);
Index: pacman-lib/lib/libalpm/db.h
diff -u pacman-lib/lib/libalpm/db.h:1.21 pacman-lib/lib/libalpm/db.h:1.22
--- pacman-lib/lib/libalpm/db.h:1.21	Fri Dec 22 14:38:55 2006
+++ pacman-lib/lib/libalpm/db.h	Fri Jan 19 04:28:44 2007
@@ -39,15 +39,15 @@
 	char *path;
 	char treename[PATH_MAX];
 	void *handle;
-	pmlist_t *pkgcache;
-	pmlist_t *grpcache;
-	pmlist_t *servers;
+	alpm_list_t *pkgcache;
+	alpm_list_t *grpcache;
+	alpm_list_t *servers;
 };
 /* db.c, database general calls */
 pmdb_t *_alpm_db_new(char *root, char *dbpath, char *treename);
 void _alpm_db_free(void *data);
 int _alpm_db_cmp(const void *db1, const void *db2);
-pmlist_t *_alpm_db_search(pmdb_t *db, pmlist_t *needles);
+alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles);
 pmdb_t *_alpm_db_register(char *treename, alpm_cb_db_register callback);
 
 /* be.c, backend specific calls */
Index: pacman-lib/lib/libalpm/deps.c
diff -u pacman-lib/lib/libalpm/deps.c:1.56 pacman-lib/lib/libalpm/deps.c:1.57
--- pacman-lib/lib/libalpm/deps.c:1.56	Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/deps.c	Fri Jan 19 04:28:44 2007
@@ -33,7 +33,7 @@
 #include "util.h"
 #include "log.h"
 #include "error.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "package.h"
 #include "db.h"
 #include "cache.h"
@@ -68,9 +68,9 @@
 	return(miss);
 }
 
-int _alpm_depmiss_isin(pmdepmissing_t *needle, pmlist_t *haystack)
+int _alpm_depmiss_isin(pmdepmissing_t *needle, alpm_list_t *haystack)
 {
-	pmlist_t *i;
+	alpm_list_t *i;
 
 	for(i = haystack; i; i = i->next) {
 		pmdepmissing_t *miss = i->data;
@@ -95,13 +95,13 @@
  * mode should be either PM_TRANS_TYPE_ADD or PM_TRANS_TYPE_REMOVE.  This
  * affects the dependency order sortbydeps() will use.
  *
- * This function returns the new pmlist_t* target list.
+ * This function returns the new alpm_list_t* target list.
  *
  */ 
-pmlist_t *_alpm_sortbydeps(pmlist_t *targets, int mode)
+alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int mode)
 {
-	pmlist_t *newtargs = NULL;
-	pmlist_t *i, *j, *k, *l;
+	alpm_list_t *newtargs = NULL;
+	alpm_list_t *i, *j, *k, *l;
 	int change = 1;
 	int numscans = 0;
 	int numtargs = 0;
@@ -111,13 +111,13 @@
 	}
 
 	for(i = targets; i; i = i->next) {
-		newtargs = _alpm_list_add(newtargs, i->data);
+		newtargs = alpm_list_add(newtargs, i->data);
 		numtargs++;
 	}
 
 	_alpm_log(PM_LOG_DEBUG, _("started sorting dependencies"));
 	while(change) {
-		pmlist_t *tmptargs = NULL;
+		alpm_list_t *tmptargs = NULL;
 		change = 0;
 		/* TODO only use of a math.h function in entire libalpm,
 		 *      can we get rid of it? Former code line:
@@ -147,7 +147,7 @@
 					if(!strcmp(dep.name, q->name)) {
 						if(!_alpm_pkg_isin(q->name, tmptargs)) {
 							change = 1;
-							tmptargs = _alpm_list_add(tmptargs, q);
+							tmptargs = alpm_list_add(tmptargs, q);
 						}
 						break;
 					}
@@ -155,7 +155,7 @@
 						if(!strcmp(dep.name, (char*)l->data)) {
 							if(!_alpm_pkg_isin((char*)l->data, tmptargs)) {
 								change = 1;
-								tmptargs = _alpm_list_add(tmptargs, q);
+								tmptargs = alpm_list_add(tmptargs, q);
 							}
 							break;
 						}
@@ -163,7 +163,7 @@
 				}
 			}
 			if(!_alpm_pkg_isin(p->name, tmptargs)) {
-				tmptargs = _alpm_list_add(tmptargs, p);
+				tmptargs = alpm_list_add(tmptargs, p);
 			}
 		}
 		FREELISTPTR(newtargs);
@@ -173,7 +173,7 @@
 
 	if(mode == PM_TRANS_TYPE_REMOVE) {
 		/* we're removing packages, so reverse the order */
-		pmlist_t *tmptargs = _alpm_list_reverse(newtargs);
+		alpm_list_t *tmptargs = alpm_list_reverse(newtargs);
 		/* free the old one */
 		FREELISTPTR(newtargs);
 		newtargs = tmptargs;
@@ -182,17 +182,17 @@
 	return(newtargs);
 }
 
-/* Returns a pmlist_t* of missing_t pointers.
+/* Returns a alpm_list_t* of missing_t pointers.
  *
  * dependencies can include versions with depmod operators.
  *
  */
-pmlist_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, pmlist_t *packages)
+alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, alpm_list_t *packages)
 {
 	pmdepend_t depend;
-	pmlist_t *i, *j, *k;
+	alpm_list_t *i, *j, *k;
 	int found = 0;
-	pmlist_t *baddeps = NULL;
+	alpm_list_t *baddeps = NULL;
 	pmdepmissing_t *miss = NULL;
 
 	if(db == NULL) {
@@ -237,7 +237,7 @@
 				}
 				if(found == 0) {
 					/* look for packages that list depend.name as a "provide" */
-					pmlist_t *provides = _alpm_db_whatprovides(db, depend.name);
+					alpm_list_t *provides = _alpm_db_whatprovides(db, depend.name);
 					if(provides == NULL) {
 						/* not found */
 						continue;
@@ -249,7 +249,7 @@
 					_alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"), depend.name, p->name);
 					miss = _alpm_depmiss_new(p->name, PM_DEP_TYPE_REQUIRED, depend.mod, depend.name, depend.version);
 					if(!_alpm_depmiss_isin(miss, baddeps)) {
-						baddeps = _alpm_list_add(baddeps, miss);
+						baddeps = alpm_list_add(baddeps, miss);
 					} else {
 						FREE(miss);
 					}
@@ -284,7 +284,7 @@
 				}
  				/* check database for provides matches */
  				if(!found) {
- 					pmlist_t *m;
+ 					alpm_list_t *m;
  					k = _alpm_db_whatprovides(db, depend.name);
  					for(m = k; m && !found; m = m->next) {
  						/* look for a match that isn't one of the packages we're trying
@@ -292,7 +292,7 @@
  						 * package, we'll defer to the NEW one, not the one already
  						 * installed. */
  						pmpkg_t *p = m->data;
- 						pmlist_t *n;
+ 						alpm_list_t *n;
  						int skip = 0;
  						for(n = packages; n && !skip; n = n->next) {
  							pmpkg_t *ptp = n->data;
@@ -319,7 +319,7 @@
 					          depend.name, tp->name);
 					miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_DEPEND, depend.mod, depend.name, depend.version);
 					if(!_alpm_depmiss_isin(miss, baddeps)) {
-						baddeps = _alpm_list_add(baddeps, miss);
+						baddeps = alpm_list_add(baddeps, miss);
 					} else {
 						FREE(miss);
 					}
@@ -338,7 +338,7 @@
 			for(j = tp->requiredby; j; j = j->next) {
 				/* Search for 'reqname' in packages for removal */
 				char *reqname = j->data;
-				pmlist_t *x = NULL;
+				alpm_list_t *x = NULL;
 				for(x = packages; x; x = x->next) {
 					pmpkg_t *xp = x->data;
 					if(strcmp(reqname, xp->name) == 0) {
@@ -357,7 +357,7 @@
 							spkg = k->data;
 						}
 						if(spkg) {
-							if(_alpm_list_is_strin(tp->name, spkg->provides)) {
+							if(alpm_list_is_strin(tp->name, spkg->provides)) {
 								found = 1;
 							}
 						}
@@ -366,7 +366,7 @@
 						_alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"), reqname, tp->name);
 						miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_REQUIRED, PM_DEP_MOD_ANY, j->data, NULL);
 						if(!_alpm_depmiss_isin(miss, baddeps)) {
-							baddeps = _alpm_list_add(baddeps, miss);
+							baddeps = alpm_list_add(baddeps, miss);
 						} else {
 							FREE(miss);
 						}
@@ -422,15 +422,15 @@
 	return(0);
 }
 
-/* return a new pmlist_t target list containing all packages in the original
+/* return a new alpm_list_t target list containing all packages in the original
  * target list, as well as all their un-needed dependencies.  By un-needed,
  * I mean dependencies that are *only* required for packages in the target
  * list, so they can be safely removed.  This function is recursive.
  */
-pmlist_t *_alpm_removedeps(pmdb_t *db, pmlist_t *targs)
+alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs)
 {
-	pmlist_t *i, *j, *k;
-	pmlist_t *newtargs = targs;
+	alpm_list_t *i, *j, *k;
+	alpm_list_t *newtargs = targs;
 
 	if(db == NULL) {
 		return(newtargs);
@@ -497,7 +497,7 @@
 				/* add it to the target list */
 				_alpm_log(PM_LOG_DEBUG, _("loading ALL info for '%s'"), pkg->name);
 				_alpm_db_read(db, INFRQ_ALL, pkg);
-				newtargs = _alpm_list_add(newtargs, pkg);
+				newtargs = alpm_list_add(newtargs, pkg);
 				_alpm_log(PM_LOG_FLOW2, _("adding '%s' to the targets"), pkg->name);
 				newtargs = _alpm_removedeps(db, newtargs);
 			}
@@ -512,19 +512,19 @@
  *
  * make sure *list and *trail are already initialized
  */
-int _alpm_resolvedeps(pmdb_t *local, pmlist_t *dbs_sync, pmpkg_t *syncpkg, pmlist_t *list,
-                      pmlist_t *trail, pmtrans_t *trans, pmlist_t **data)
+int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, alpm_list_t *list,
+                      alpm_list_t *trail, pmtrans_t *trans, alpm_list_t **data)
 {
-	pmlist_t *i, *j;
-	pmlist_t *targ;
-	pmlist_t *deps = NULL;
+	alpm_list_t *i, *j;
+	alpm_list_t *targ;
+	alpm_list_t *deps = NULL;
 
 	if(local == NULL || dbs_sync == NULL || syncpkg == NULL) {
 		return(-1);
 	}
 
 	_alpm_log(PM_LOG_DEBUG, _("started resolving dependencies"));
-	targ = _alpm_list_add(NULL, syncpkg);
+	targ = alpm_list_add(NULL, syncpkg);
 	deps = _alpm_checkdeps(trans, local, PM_TRANS_TYPE_ADD, targ);
 	FREELISTPTR(targ);
 
@@ -540,7 +540,7 @@
 		/* check if one of the packages in *list already provides this dependency */
 		for(j = list; j && !found; j = j->next) {
 			pmpkg_t *sp = (pmpkg_t *)j->data;
-			if(_alpm_list_is_strin(miss->depend.name, sp->provides)) {
+			if(alpm_list_is_strin(miss->depend.name, sp->provides)) {
 				_alpm_log(PM_LOG_DEBUG, _("%s provides dependency %s -- skipping"),
 				          sp->name, miss->depend.name);
 				found = 1;
@@ -558,7 +558,7 @@
 		}
 		/* check provides */
 		for(j = dbs_sync; !sync && j; j = j->next) {
-			pmlist_t *provides;
+			alpm_list_t *provides;
 			provides = _alpm_db_whatprovides(j->data, miss->depend.name);
 			if(provides) {
 				sync = provides->data;
@@ -576,7 +576,7 @@
 					goto error;
 				}
 				*miss = *(pmdepmissing_t *)i->data;
-				*data = _alpm_list_add(*data, miss);
+				*data = alpm_list_add(*data, miss);
 			}
 			pm_errno = PM_ERR_UNSATISFIED_DEPS;
 			goto error;
@@ -593,19 +593,19 @@
 			 * something we're not supposed to.
 			 */
 			int usedep = 1;
-			if(_alpm_list_is_strin(sync->name, handle->ignorepkg)) {
+			if(alpm_list_is_strin(sync->name, handle->ignorepkg)) {
 				pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
 				QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &usedep);
 				FREEPKG(dummypkg);
 			}
 			if(usedep) {
-				trail = _alpm_list_add(trail, sync);
+				trail = alpm_list_add(trail, sync);
 				if(_alpm_resolvedeps(local, dbs_sync, sync, list, trail, trans, data)) {
 					goto error;
 				}
 				_alpm_log(PM_LOG_DEBUG, _("pulling dependency %s (needed by %s)"),
 				          sync->name, syncpkg->name);
-				list = _alpm_list_add(list, sync);
+				list = alpm_list_add(list, sync);
 			} else {
 				_alpm_log(PM_LOG_ERROR, _("cannot resolve dependencies for \"%s\""), miss->target);
 				if(data) {
@@ -616,7 +616,7 @@
 						goto error;
 					}
 					*miss = *(pmdepmissing_t *)i->data;
-					*data = _alpm_list_add(*data, miss);
+					*data = alpm_list_add(*data, miss);
 				}
 				pm_errno = PM_ERR_UNSATISFIED_DEPS;
 				goto error;
Index: pacman-lib/lib/libalpm/deps.h
diff -u pacman-lib/lib/libalpm/deps.h:1.15 pacman-lib/lib/libalpm/deps.h:1.16
--- pacman-lib/lib/libalpm/deps.h:1.15	Wed Nov 22 04:03:42 2006
+++ pacman-lib/lib/libalpm/deps.h	Fri Jan 19 04:28:45 2007
@@ -44,13 +44,13 @@
 
 pmdepmissing_t *_alpm_depmiss_new(const char *target, unsigned char type, unsigned char depmod,
                             const char *depname, const char *depversion);
-int _alpm_depmiss_isin(pmdepmissing_t *needle, pmlist_t *haystack);
-pmlist_t *_alpm_sortbydeps(pmlist_t *targets, int mode);
-pmlist_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, pmlist_t *packages);
+int _alpm_depmiss_isin(pmdepmissing_t *needle, alpm_list_t *haystack);
+alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int mode);
+alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, alpm_list_t *packages);
 int _alpm_splitdep(char *depstr, pmdepend_t *depend);
-pmlist_t *_alpm_removedeps(pmdb_t *db, pmlist_t *targs);
-int _alpm_resolvedeps(pmdb_t *local, pmlist_t *dbs_sync, pmpkg_t *syncpkg, pmlist_t *list,
-                pmlist_t *trail, pmtrans_t *trans, pmlist_t **data);
+alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs);
+int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, alpm_list_t *list,
+                alpm_list_t *trail, pmtrans_t *trans, alpm_list_t **data);
 
 #endif /* _ALPM_DEPS_H */
 
Index: pacman-lib/lib/libalpm/group.c
diff -u pacman-lib/lib/libalpm/group.c:1.10 pacman-lib/lib/libalpm/group.c:1.11
--- pacman-lib/lib/libalpm/group.c:1.10	Mon Nov 20 04:10:24 2006
+++ pacman-lib/lib/libalpm/group.c	Fri Jan 19 04:28:45 2007
@@ -29,7 +29,7 @@
 #include "error.h"
 #include "log.h"
 #include "group.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "alpm.h"
 
 pmgrp_t *_alpm_grp_new()
@@ -81,7 +81,7 @@
 	return grp->name;
 }
 
-pmlist_t *alpm_grp_get_packages(pmgrp_t *grp)
+alpm_list_t *alpm_grp_get_packages(pmgrp_t *grp)
 {
 	/* Sanity checks */
 	ASSERT(grp != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/group.h
diff -u pacman-lib/lib/libalpm/group.h:1.8 pacman-lib/lib/libalpm/group.h:1.9
--- pacman-lib/lib/libalpm/group.h:1.8	Mon Nov 20 04:10:24 2006
+++ pacman-lib/lib/libalpm/group.h	Fri Jan 19 04:28:45 2007
@@ -28,7 +28,7 @@
 
 struct __pmgrp_t {
 	char name[GRP_NAME_LEN];
-	pmlist_t *packages; /* List of strings */
+	alpm_list_t *packages; /* List of strings */
 };
 
 #define FREEGRP(p) do { if(p) { _alpm_grp_free(p); p = NULL; } } while(0)
Index: pacman-lib/lib/libalpm/handle.c
diff -u pacman-lib/lib/libalpm/handle.c:1.26 pacman-lib/lib/libalpm/handle.c:1.27
--- pacman-lib/lib/libalpm/handle.c:1.26	Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/handle.c	Fri Jan 19 04:28:45 2007
@@ -33,7 +33,7 @@
 /* pacman */
 #include "util.h"
 #include "log.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "error.h"
 #include "trans.h"
 #include "alpm.h"
@@ -123,19 +123,19 @@
 const char *alpm_option_get_cachedir() { return handle->cachedir; }
 const char *alpm_option_get_logfile() { return handle->logfile; }
 unsigned char alpm_option_get_usesyslog() { return handle->usesyslog; }
-pmlist_t *alpm_option_get_noupgrades() { return handle->noupgrade; }
-pmlist_t *alpm_option_get_noextracts() { return handle->noextract; }
-pmlist_t *alpm_option_get_ignorepkgs() { return handle->ignorepkg; }
-pmlist_t *alpm_option_get_holdpkgs() { return handle->holdpkg; }
+alpm_list_t *alpm_option_get_noupgrades() { return handle->noupgrade; }
+alpm_list_t *alpm_option_get_noextracts() { return handle->noextract; }
+alpm_list_t *alpm_option_get_ignorepkgs() { return handle->ignorepkg; }
+alpm_list_t *alpm_option_get_holdpkgs() { return handle->holdpkg; }
 time_t alpm_option_get_upgradedelay() { return handle->upgradedelay; }
 const char *alpm_option_get_xfercommand() { return handle->xfercommand; }
 unsigned short alpm_option_get_nopassiveftp() { return handle->nopassiveftp; }
 unsigned short alpm_option_get_chomp() { return handle->chomp; }
-pmlist_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; }
 
-pmdb_t *alpm_option_get_localdb(pmhandle_t *handle) { return handle->db_local; }
-pmlist_t *alpm_option_get_syncdbs(pmhandle_t *handle) { return handle->dbs_sync; }
+pmdb_t *alpm_option_get_localdb() { return handle->db_local; }
+alpm_list_t *alpm_option_get_syncdbs() { return handle->dbs_sync; }
 
 void alpm_option_set_logcb(alpm_cb_log cb) { handle->logcb = cb; }
 
@@ -180,9 +180,9 @@
 
 void alpm_option_add_noupgrade(char *pkg)
 {
-  handle->noupgrade = _alpm_list_add(handle->noupgrade, strdup(pkg));
+  handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(pkg));
 }
-void alpm_option_set_noupgrades(pmlist_t *noupgrade)
+void alpm_option_set_noupgrades(alpm_list_t *noupgrade)
 {
 	if(handle->noupgrade) FREELIST(handle->noupgrade);
 	if(noupgrade) handle->noupgrade = noupgrade;
@@ -190,9 +190,9 @@
 
 void alpm_option_add_noextract(char *pkg)
 {
-  handle->noextract = _alpm_list_add(handle->noextract, strdup(pkg));
+  handle->noextract = alpm_list_add(handle->noextract, strdup(pkg));
 }
-void alpm_option_set_noextracts(pmlist_t *noextract)
+void alpm_option_set_noextracts(alpm_list_t *noextract)
 {
 	if(handle->noextract) FREELIST(handle->noextract);
 	if(noextract) handle->noextract = noextract;
@@ -200,9 +200,9 @@
 
 void alpm_option_add_ignorepkg(char *pkg)
 {
-  handle->ignorepkg = _alpm_list_add(handle->ignorepkg, strdup(pkg));
+  handle->ignorepkg = alpm_list_add(handle->ignorepkg, strdup(pkg));
 }
-void alpm_option_set_ignorepkgs(pmlist_t *ignorepkgs)
+void alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs)
 {
 	if(handle->ignorepkg) FREELIST(handle->ignorepkg);
 	if(ignorepkgs) handle->ignorepkg = ignorepkgs;
@@ -210,9 +210,9 @@
 
 void alpm_option_add_holdpkg(char *pkg)
 {
-  handle->holdpkg = _alpm_list_add(handle->holdpkg, strdup(pkg));
+  handle->holdpkg = alpm_list_add(handle->holdpkg, strdup(pkg));
 }
-void alpm_option_set_holdpkgs(pmlist_t *holdpkgs)
+void alpm_option_set_holdpkgs(alpm_list_t *holdpkgs)
 {
 	if(handle->holdpkg) FREELIST(handle->holdpkg);
 	if(holdpkgs) handle->holdpkg = holdpkgs;
@@ -232,9 +232,9 @@
 
 void alpm_option_add_needle(char *needle)
 {
-  handle->needles = _alpm_list_add(handle->needles, strdup(needle));
+  handle->needles = alpm_list_add(handle->needles, strdup(needle));
 }
-void alpm_option_set_needles(pmlist_t *needles)
+void alpm_option_set_needles(alpm_list_t *needles)
 {
 	if(handle->needles) FREELIST(handle->needles);
 	if(needles) handle->needles = needles;
Index: pacman-lib/lib/libalpm/handle.h
diff -u pacman-lib/lib/libalpm/handle.h:1.12 pacman-lib/lib/libalpm/handle.h:1.13
--- pacman-lib/lib/libalpm/handle.h:1.12	Mon Nov 20 04:10:24 2006
+++ pacman-lib/lib/libalpm/handle.h	Fri Jan 19 04:28:45 2007
@@ -23,7 +23,7 @@
 
 #include "db.h"
 #include "log.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "alpm.h"
 #include "trans.h"
 
@@ -37,7 +37,7 @@
 	pmaccess_t access;
 	uid_t uid;
 	pmdb_t *db_local;
-	pmlist_t *dbs_sync; /* List of (pmdb_t *) */
+	alpm_list_t *dbs_sync; /* List of (pmdb_t *) */
 	FILE *logfd;
 	int lckfd;
 	pmtrans_t *trans;
@@ -52,17 +52,17 @@
 	char *logfile;						/* Name of the file to log to */ /*TODO is this used?*/
 	unsigned char usesyslog;	/* Use syslog instead of logfile? */
 	
-	pmlist_t *noupgrade;			/* List of packages NOT to be upgraded */
-	pmlist_t *noextract;			/* List of packages NOT to extrace */ /*TODO is this used?*/
-	pmlist_t *ignorepkg;			/* List of packages to ignore */
-	pmlist_t *holdpkg;				/* List of packages which 'hold' pacman */
+	alpm_list_t *noupgrade;			/* List of packages NOT to be upgraded */
+	alpm_list_t *noextract;			/* List of packages NOT to extrace */ /*TODO is this used?*/
+	alpm_list_t *ignorepkg;			/* List of packages to ignore */
+	alpm_list_t *holdpkg;				/* List of packages which 'hold' pacman */
 
 	time_t upgradedelay;			/* Amount of time to wait before upgrading a package*/
 	/* servers */
 	char *xfercommand;				/* External download command */
 	unsigned short nopassiveftp; /* Don't use PASV ftp connections */
 	unsigned short chomp;			/* I Love Candy! */
-	pmlist_t *needles;				/* needles for searching */ /* TODO why is this here? */
+	alpm_list_t *needles;				/* needles for searching */ /* TODO why is this here? */
 	unsigned short use_color; /* enable colorful output */
 } pmhandle_t;
 
Index: pacman-lib/lib/libalpm/list.c
diff -u pacman-lib/lib/libalpm/list.c:1.19 pacman-lib/lib/libalpm/list.c:removed
--- pacman-lib/lib/libalpm/list.c:1.19	Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/list.c	Fri Jan 19 04:28:47 2007
@@ -1,361 +0,0 @@
-/*
- *  list.c
- * 
- *  Copyright (c) 2002-2006 by Judd Vinet <jvinet at zeroflux.org>
- * 
- *  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 2 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, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
- *  USA.
- */
-
-#include "config.h"
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-/* pacman */
-#include "list.h"
-#include "util.h"
-
-pmlist_t *_alpm_list_new()
-{
-	pmlist_t *list = NULL;
-
-	list = (pmlist_t *)malloc(sizeof(pmlist_t));
-	if(list == NULL) {
-		return(NULL);
-	}
-	list->data = NULL;
-	list->prev = NULL;
-	list->next = NULL;
-	list->last = list;
-	return(list);
-}
-
-void _alpm_list_free(pmlist_t *list, _alpm_fn_free fn)
-{
-	pmlist_t *ptr, *it = list;
-
-	while(it) {
-		ptr = it->next;
-		if(fn && it->data) {
-			fn(it->data);
-		}
-		FREE(it);
-		it = ptr;
-	}
-}
-
-pmlist_t *_alpm_list_add(pmlist_t *list, void *data)
-{
-	pmlist_t *ptr, *lp;
-
-	ptr = list;
-	if(ptr == NULL) {
-		ptr = _alpm_list_new();
-		if(ptr == NULL) {
-			return(NULL);
-		}
-	}
-
-	lp = _alpm_list_last(ptr);
-	if(lp == ptr && lp->data == NULL) {
-		/* nada */
-	} else {
-		lp->next = _alpm_list_new();
-		if(lp->next == NULL) {
-			return(NULL);
-		}
-		lp->next->prev = lp;
-		lp->last = NULL;
-		lp = lp->next;
-	}
-
-	lp->data = data;
-	ptr->last = lp;
-
-	return(ptr);
-}
-
-/* Add items to a list in sorted order. Use the given comparision func to 
- * determine order.
- */
-pmlist_t *_alpm_list_add_sorted(pmlist_t *list, void *data, _alpm_fn_cmp fn)
-{
-	pmlist_t *add;
-	pmlist_t *prev = NULL;
-	pmlist_t *iter = list;
-
-	add = _alpm_list_new();
-	add->data = data;
-
-	/* Find insertion point. */
-	while(iter) {
-		if(fn(add->data, iter->data) <= 0) break;
-		prev = iter;
-		iter = iter->next;
-	}
-
-	/*  Insert node before insertion point. */
-	add->prev = prev;
-	add->next = iter;
-
-	if(iter != NULL) {
-		iter->prev = add;   /*  Not at end.  */
-	} else {
-		if (list != NULL) {
-			list->last = add;   /* Added new to end, so update the link to last. */
-		}
-	}
-
-	if(prev != NULL) {
-		prev->next = add;       /*  In middle.  */
-	} else {
-		if(list == NULL) {
-			add->last = add;
-		} else {
-			add->last = list->last;
-			list->last = NULL;
-		}
-		list = add;           /*  Start or empty, new list head.  */
-	}
-
-	return(list);
-}
-
-/*  return nth element from list (starting with 0) */
-pmlist_t* _alpm_list_nth(pmlist_t *list, int n) {
-	while (n--)
-		list = list->next;
-	return list;
-}
-
-/* merge the two sorted sublists into one sorted list */
-pmlist_t*  _alpm_list_mmerge(pmlist_t *left, pmlist_t *right, _alpm_fn_cmp fn) {
-	pmlist_t *newlist;
-	pmlist_t *lp;
-
-	if (left == NULL) 
-		return right;
-	if (right == NULL)
-		return left;
-
-	if (fn(left->data, right->data) <= 0) {
-		newlist  = left;
-		left = left->next;
-	} 
-	else {
-		newlist = right;
-		right = right->next;
-	}
-	newlist->prev = NULL;
-	newlist->next = NULL;
-	newlist->last = NULL;
-	lp = newlist;
-
-	while ((left != NULL) && (right != NULL)) {
-		if (fn(left->data, right->data) <= 0) {
-			lp->next = left;
-			left->prev = lp;
-			left = left->next;
-		} 
-		else {
-			lp->next = right;
-			right->prev = lp;
-			right = right->next;
-		}
-		lp = lp->next;
-		lp->next = NULL;
-		newlist->last = lp;      
-	}
-	if (left != NULL) {
-		lp->next = left;
-		left->prev = lp;
-		newlist->last = left->last;
-	}
-	else if (right != NULL) {
-		lp->next = right;
-		right->prev = lp;
-		newlist->last = right->last;
-	}
-	return newlist;
-}
-
-/*  sort an list of size n using mergesort algorithm  */
-pmlist_t* _alpm_list_msort(pmlist_t *list, int len, _alpm_fn_cmp fn) {
-	if (len > 1 ) {
-		pmlist_t *left = list;
-		pmlist_t *lastleft = _alpm_list_nth(list, len/2 - 1);
-		pmlist_t *right = lastleft->next;
-		/* update rights last element, to previous last element*/
-		right->last =  left->last;	
-		/* update lefts last element */
-		left->last = lastleft;	
-		/* terminate first list */
-		lastleft->next = NULL;	
-
-		left = _alpm_list_msort(left, len/2, fn);
-		right = _alpm_list_msort(right, len - (len/2), fn);
-		list = _alpm_list_mmerge(left, right, fn);
-	}
-	return list;
-}
-
-/* Remove an item in a list. Use the given comparaison function to find the
- * item.
- * If the item is found, 'data' is pointing to the removed element.
- * Otherwise, it is set to NULL.
- * Return the new list (without the removed element).
- */
-pmlist_t *_alpm_list_remove(pmlist_t *haystack, void *needle, _alpm_fn_cmp fn, void **data)
-{
-	pmlist_t *i = haystack;
-
-	if(data) {
-		*data = NULL;
-	}
-
-	while(i) {
-		if(i->data == NULL) {
-			continue;
-		}
-		if(fn(needle, i->data) == 0) {
-			break;
-		}
-		i = i->next;
-	}
-
-	if(i) {
-		/* we found a matching item */
-		if(i->next) {
-			i->next->prev = i->prev;
-		}
-		if(i->prev) {
-			i->prev->next = i->next;
-		}
-		if(i == haystack) {
-			/* The item found is the first in the chain */
-			if(haystack->next) {
-				haystack->next->last = haystack->last;
-			}
-			haystack = haystack->next;
-		} else if(i == haystack->last) {
-			/* The item found is the last in the chain */
-			haystack->last = i->prev;
-		}
-
-		if(data) {
-			*data = i->data;
-		}
-		i->data = NULL;
-		FREE(i);
-	}
-
-	return(haystack);
-}
-
-int _alpm_list_count(const pmlist_t *list)
-{
-	int i;
-	const pmlist_t *lp;
-
-	for(lp = list, i = 0; lp; lp = lp->next, i++);
-
-	return(i);
-}
-
-int _alpm_list_is_in(void *needle, pmlist_t *haystack)
-{
-	pmlist_t *lp;
-
-	for(lp = haystack; lp; lp = lp->next) {
-		if(lp->data == needle) {
-			return(1);
-		}
-	}
-	return(0);
-}
-
-/* Test for existence of a string in a pmlist_t
-*/
-int _alpm_list_is_strin(char *needle, pmlist_t *haystack)
-{
-	pmlist_t *lp;
-
-	for(lp = haystack; lp; lp = lp->next) {
-		if(lp->data && !strcmp(lp->data, needle)) {
-			return(1);
-		}
-	}
-	return(0);
-}
-
-pmlist_t *_alpm_list_last(pmlist_t *list)
-{
-	if(list == NULL) {
-		return(NULL);
-	}
-
-	return(list->last);
-}
-
-/* Filter out any duplicate strings in a list.
- *
- * Not the most efficient way, but simple to implement -- we assemble
- * a new list, using is_in() to check for dupes at each iteration.
- *
- */
-pmlist_t *_alpm_list_remove_dupes(pmlist_t *list)
-{
-	pmlist_t *i, *newlist = NULL;
-
-	for(i = list; i; i = i->next) {
-		if(!_alpm_list_is_strin(i->data, newlist)) {
-			newlist = _alpm_list_add(newlist, strdup(i->data));
-		}
-	}
-	return newlist;
-}
-
-/* Reverse the order of a list
- *
- * The caller is responsible for freeing the old list
- */
-pmlist_t *_alpm_list_reverse(pmlist_t *list)
-{ 
-	/* simple but functional -- we just build a new list, starting
-	 * with the old list's tail
-	 */
-	pmlist_t *newlist = NULL;
-	pmlist_t *lp;
-
-	for(lp = list->last; lp; lp = lp->prev) {
-		newlist = _alpm_list_add(newlist, lp->data);
-	}
-
-	return(newlist);
-}
-
-pmlist_t *_alpm_list_strdup(pmlist_t *list)
-{
-	pmlist_t *newlist = NULL;
-	pmlist_t *lp;
-
-	for(lp = list; lp; lp = lp->next) {
-		newlist = _alpm_list_add(newlist, strdup(lp->data));
-	}
-
-	return(newlist);
-}
-
-/* vim: set ts=2 sw=2 noet: */
Index: pacman-lib/lib/libalpm/list.h
diff -u pacman-lib/lib/libalpm/list.h:1.19 pacman-lib/lib/libalpm/list.h:removed
--- pacman-lib/lib/libalpm/list.h:1.19	Thu Jan 11 12:44:39 2007
+++ pacman-lib/lib/libalpm/list.h	Fri Jan 19 04:28:47 2007
@@ -1,60 +0,0 @@
-/*
- *  list.h
- * 
- *  Copyright (c) 2002-2006 by Judd Vinet <jvinet at zeroflux.org>
- * 
- *  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 2 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, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
- *  USA.
- */
-#ifndef _ALPM_LIST_H
-#define _ALPM_LIST_H
-
-#include "alpm.h"
-
-/* Chained list struct */
-struct __pmlist_t {
-	void *data;
-	struct __pmlist_t *prev;
-	struct __pmlist_t *next;
-	struct __pmlist_t *last; /* Quick access to last item in list */
-};
-
-#define _FREELIST(p, f) do { if(p) { _alpm_list_free(p, f); p = NULL; } } while(0)
-#define FREELIST(p) _FREELIST(p, free)
-#define FREELISTPTR(p) _FREELIST(p, NULL)
-
-typedef void (*_alpm_fn_free)(void *);
-/* Sort comparison callback function declaration */
-typedef int (*_alpm_fn_cmp)(const void *, const void *);
-
-pmlist_t *_alpm_list_new(void);
-void _alpm_list_free(pmlist_t *list, _alpm_fn_free fn);
-pmlist_t *_alpm_list_add(pmlist_t *list, void *data);
-pmlist_t *_alpm_list_add_sorted(pmlist_t *list, void *data, _alpm_fn_cmp fn);
-pmlist_t* _alpm_list_mmerge(pmlist_t *left, pmlist_t *right, _alpm_fn_cmp fn);
-pmlist_t* _alpm_list_msort(pmlist_t *list, int len, _alpm_fn_cmp fn);
-pmlist_t* _alpm_list_nth(pmlist_t *list, int n);
-pmlist_t *_alpm_list_remove(pmlist_t *haystack, void *needle, _alpm_fn_cmp fn, void **data);
-int _alpm_list_count(const pmlist_t *list);
-int _alpm_list_is_in(void *needle, pmlist_t *haystack);
-int _alpm_list_is_strin(char *needle, pmlist_t *haystack);
-pmlist_t *_alpm_list_last(pmlist_t *list);
-pmlist_t *_alpm_list_remove_dupes(pmlist_t *list);
-pmlist_t *_alpm_list_reverse(pmlist_t *list);
-pmlist_t *_alpm_list_strdup(pmlist_t *list);
-
-#endif /* _ALPM_LIST_H */
-
-/* vim: set ts=2 sw=2 noet: */
Index: pacman-lib/lib/libalpm/package.c
diff -u pacman-lib/lib/libalpm/package.c:1.43 pacman-lib/lib/libalpm/package.c:1.44
--- pacman-lib/lib/libalpm/package.c:1.43	Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/package.c	Fri Jan 19 04:28:45 2007
@@ -33,7 +33,7 @@
 #include "log.h"
 #include "util.h"
 #include "error.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "package.h"
 #include "db.h"
 #include "handle.h"
@@ -118,17 +118,17 @@
 	newpkg->force      = pkg->force;
 	newpkg->scriptlet  = pkg->scriptlet;
 	newpkg->reason     = pkg->reason;
-	newpkg->license    = _alpm_list_strdup(pkg->license);
-	newpkg->desc_localized = _alpm_list_strdup(pkg->desc_localized);
-	newpkg->requiredby = _alpm_list_strdup(pkg->requiredby);
-	newpkg->conflicts  = _alpm_list_strdup(pkg->conflicts);
-	newpkg->files      = _alpm_list_strdup(pkg->files);
-	newpkg->backup     = _alpm_list_strdup(pkg->backup);
-	newpkg->depends    = _alpm_list_strdup(pkg->depends);
-	newpkg->removes    = _alpm_list_strdup(pkg->removes);
-	newpkg->groups     = _alpm_list_strdup(pkg->groups);
-	newpkg->provides   = _alpm_list_strdup(pkg->provides);
-	newpkg->replaces   = _alpm_list_strdup(pkg->replaces);
+	newpkg->license    = alpm_list_strdup(pkg->license);
+	newpkg->desc_localized = alpm_list_strdup(pkg->desc_localized);
+	newpkg->requiredby = alpm_list_strdup(pkg->requiredby);
+	newpkg->conflicts  = alpm_list_strdup(pkg->conflicts);
+	newpkg->files      = alpm_list_strdup(pkg->files);
+	newpkg->backup     = alpm_list_strdup(pkg->backup);
+	newpkg->depends    = alpm_list_strdup(pkg->depends);
+	newpkg->removes    = alpm_list_strdup(pkg->removes);
+	newpkg->groups     = alpm_list_strdup(pkg->groups);
+	newpkg->provides   = alpm_list_strdup(pkg->provides);
+	newpkg->replaces   = alpm_list_strdup(pkg->replaces);
 	/* internal */
 	newpkg->origin     = pkg->origin;
 	newpkg->data = (newpkg->origin == PKG_FROM_FILE) ? strdup(pkg->data) : pkg->data;
@@ -214,7 +214,7 @@
 				STRNCPY(info->version, ptr, sizeof(info->version));
 			} else if(!strcmp(key, "PKGDESC")) {
 				char *lang_tmp;
-				info->desc_localized = _alpm_list_add(info->desc_localized, strdup(ptr));
+				info->desc_localized = alpm_list_add(info->desc_localized, strdup(ptr));
 				if((lang_tmp = (char *)malloc(strlen(setlocale(LC_ALL, "")))) == NULL) {
 					RET_ERR(PM_ERR_MEMORY, -1);
 				}
@@ -226,11 +226,11 @@
 				}
 				FREE(lang_tmp);
 			} else if(!strcmp(key, "GROUP")) {
-				info->groups = _alpm_list_add(info->groups, strdup(ptr));
+				info->groups = alpm_list_add(info->groups, strdup(ptr));
 			} else if(!strcmp(key, "URL")) {
 				STRNCPY(info->url, ptr, sizeof(info->url));
 			} else if(!strcmp(key, "LICENSE")) {
-				info->license = _alpm_list_add(info->license, strdup(ptr));
+				info->license = alpm_list_add(info->license, strdup(ptr));
 			} else if(!strcmp(key, "BUILDDATE")) {
 				STRNCPY(info->builddate, ptr, sizeof(info->builddate));
 			} else if(!strcmp(key, "BUILDTYPE")) {
@@ -250,17 +250,17 @@
 				STRNCPY(tmp, ptr, sizeof(tmp));
 				info->isize = atol(ptr);
 			} else if(!strcmp(key, "DEPEND")) {
-				info->depends = _alpm_list_add(info->depends, strdup(ptr));
+				info->depends = alpm_list_add(info->depends, strdup(ptr));
 			} else if(!strcmp(key, "REMOVE")) {
-				info->removes = _alpm_list_add(info->removes, strdup(ptr));
+				info->removes = alpm_list_add(info->removes, strdup(ptr));
 			} else if(!strcmp(key, "CONFLICT")) {
-				info->conflicts = _alpm_list_add(info->conflicts, strdup(ptr));
+				info->conflicts = alpm_list_add(info->conflicts, strdup(ptr));
 			} else if(!strcmp(key, "REPLACES")) {
-				info->replaces = _alpm_list_add(info->replaces, strdup(ptr));
+				info->replaces = alpm_list_add(info->replaces, strdup(ptr));
 			} else if(!strcmp(key, "PROVIDES")) {
-				info->provides = _alpm_list_add(info->provides, strdup(ptr));
+				info->provides = alpm_list_add(info->provides, strdup(ptr));
 			} else if(!strcmp(key, "BACKUP")) {
-				info->backup = _alpm_list_add(info->backup, strdup(ptr));
+				info->backup = alpm_list_add(info->backup, strdup(ptr));
 			} else {
 				_alpm_log(PM_LOG_DEBUG, _("%s: syntax error in description file line %d"),
 					info->name[0] != '\0' ? info->name : "error", linenum);
@@ -369,7 +369,7 @@
 					continue;
 				}
 				_alpm_strtrim(str);
-				info->files = _alpm_list_add(info->files, strdup(str));
+				info->files = alpm_list_add(info->files, strdup(str));
 			}
 			FREE(str);
 			fclose(fp);
@@ -386,7 +386,7 @@
 				/* no .FILELIST present in this package..  build the filelist the */
 				/* old-fashioned way, one at a time */
 				expath = strdup(archive_entry_pathname (entry));
-				info->files = _alpm_list_add(info->files, expath);
+				info->files = alpm_list_add(info->files, expath);
 			}
 		}
 
@@ -417,12 +417,12 @@
 	return(NULL);
 }
 
-/* Test for existence of a package in a pmlist_t*
+/* Test for existence of a package in a alpm_list_t*
  * of pmpkg_t*
  */
-pmpkg_t *_alpm_pkg_isin(char *needle, pmlist_t *haystack)
+pmpkg_t *_alpm_pkg_isin(char *needle, alpm_list_t *haystack)
 {
-	pmlist_t *lp;
+	alpm_list_t *lp;
 
 	if(needle == NULL || haystack == NULL) {
 		return(NULL);
@@ -668,7 +668,7 @@
 	return pkg->reason;
 }
 
-pmlist_t *alpm_pkg_get_licenses(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -680,7 +680,7 @@
 	return pkg->license;
 }
 
-pmlist_t *alpm_pkg_get_groups(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -693,7 +693,7 @@
 }
 
 /* depends */
-pmlist_t *alpm_pkg_get_depends(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -705,7 +705,7 @@
 	return pkg->depends;
 }
 
-pmlist_t *alpm_pkg_get_removes(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_removes(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -717,7 +717,7 @@
 	return pkg->removes;
 }
 
-pmlist_t *alpm_pkg_get_requiredby(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_requiredby(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -729,7 +729,7 @@
 	return pkg->requiredby;
 }
 
-pmlist_t *alpm_pkg_get_conflicts(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_conflicts(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -741,7 +741,7 @@
 	return pkg->conflicts;
 }
 
-pmlist_t *alpm_pkg_get_provides(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_provides(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -753,7 +753,7 @@
 	return pkg->provides;
 }
 
-pmlist_t *alpm_pkg_get_replaces(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -765,7 +765,7 @@
 	return pkg->replaces;
 }
 
-pmlist_t *alpm_pkg_get_files(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
@@ -778,7 +778,7 @@
 	return pkg->files;
 }
 
-pmlist_t *alpm_pkg_get_backup(pmpkg_t *pkg)
+alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg)
 {
 	/* Sanity checks */
 	ASSERT(handle != NULL, return(NULL));
Index: pacman-lib/lib/libalpm/package.h
diff -u pacman-lib/lib/libalpm/package.h:1.22 pacman-lib/lib/libalpm/package.h:1.23
--- pacman-lib/lib/libalpm/package.h:1.22	Wed Nov 22 04:03:42 2006
+++ pacman-lib/lib/libalpm/package.h	Fri Jan 19 04:28:45 2007
@@ -69,17 +69,17 @@
 	unsigned char force;
 	time_t date;
 	unsigned char reason;
-	pmlist_t *desc_localized;
-	pmlist_t *license;
-	pmlist_t *replaces;
-	pmlist_t *groups;
-	pmlist_t *files;
-	pmlist_t *backup;
-	pmlist_t *depends;
-	pmlist_t *removes;
-	pmlist_t *requiredby;
-	pmlist_t *conflicts;
-	pmlist_t *provides;
+	alpm_list_t *desc_localized;
+	alpm_list_t *license;
+	alpm_list_t *replaces;
+	alpm_list_t *groups;
+	alpm_list_t *files;
+	alpm_list_t *backup;
+	alpm_list_t *depends;
+	alpm_list_t *removes;
+	alpm_list_t *requiredby;
+	alpm_list_t *conflicts;
+	alpm_list_t *provides;
 	/* internal */
 	unsigned char origin;
 	void *data;
@@ -94,7 +94,7 @@
 void _alpm_pkg_free(void *data);
 int _alpm_pkg_cmp(const void *p1, const void *p2);
 pmpkg_t *_alpm_pkg_load(char *pkgfile);
-pmpkg_t *_alpm_pkg_isin(char *needle, pmlist_t *haystack);
+pmpkg_t *_alpm_pkg_isin(char *needle, alpm_list_t *haystack);
 int _alpm_pkg_splitname(char *target, char *name, char *version, int witharch);
 
 
Index: pacman-lib/lib/libalpm/provide.c
diff -u pacman-lib/lib/libalpm/provide.c:1.7 pacman-lib/lib/libalpm/provide.c:1.8
--- pacman-lib/lib/libalpm/provide.c:1.7	Tue Oct 31 01:39:59 2006
+++ pacman-lib/lib/libalpm/provide.c	Fri Jan 19 04:28:45 2007
@@ -24,16 +24,16 @@
 #include <string.h>
 /* pacman */
 #include "cache.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "db.h"
 #include "provide.h"
 
-/* return a pmlist_t of packages in "db" that provide "package"
+/* return a alpm_list_t of packages in "db" that provide "package"
  */
-pmlist_t *_alpm_db_whatprovides(pmdb_t *db, char *package)
+alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, char *package)
 {
-	pmlist_t *pkgs = NULL;
-	pmlist_t *lp;
+	alpm_list_t *pkgs = NULL;
+	alpm_list_t *lp;
 
 	if(db == NULL || package == NULL || strlen(package) == 0) {
 		return(NULL);
@@ -42,8 +42,8 @@
 	for(lp = _alpm_db_get_pkgcache(db, INFRQ_DEPENDS); lp; lp = lp->next) {
 		pmpkg_t *info = lp->data;
 
-		if(_alpm_list_is_strin(package, info->provides)) {
-			pkgs = _alpm_list_add(pkgs, info);
+		if(alpm_list_is_strin(package, info->provides)) {
+			pkgs = alpm_list_add(pkgs, info);
 		}
 	}
 
Index: pacman-lib/lib/libalpm/provide.h
diff -u pacman-lib/lib/libalpm/provide.h:1.4 pacman-lib/lib/libalpm/provide.h:1.5
--- pacman-lib/lib/libalpm/provide.h:1.4	Mon Nov 20 04:10:24 2006
+++ pacman-lib/lib/libalpm/provide.h	Fri Jan 19 04:28:45 2007
@@ -22,10 +22,10 @@
 #define _ALPM_PROVIDE_H
 
 #include "db.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "config.h"
 
-pmlist_t *_alpm_db_whatprovides(pmdb_t *db, char *package);
+alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, char *package);
 
 #endif /* _ALPM_PROVIDE_H */
 
Index: pacman-lib/lib/libalpm/remove.c
diff -u pacman-lib/lib/libalpm/remove.c:1.55 pacman-lib/lib/libalpm/remove.c:1.56
--- pacman-lib/lib/libalpm/remove.c:1.55	Thu Jan 18 12:04:25 2007
+++ pacman-lib/lib/libalpm/remove.c	Fri Jan 19 04:28:45 2007
@@ -41,7 +41,7 @@
 #include <errno.h>
 #include <libintl.h>
 /* pacman */
-#include "list.h"
+#include "alpm_list.h"
 #include "trans.h"
 #include "util.h"
 #include "error.h"
@@ -78,7 +78,7 @@
 	}
 
 	/* ignore holdpkgs on upgrade */
-	if((trans == handle->trans) && _alpm_list_is_strin(info->name, handle->holdpkg)) {
+	if((trans == handle->trans) && alpm_list_is_strin(info->name, handle->holdpkg)) {
 		int resp = 0;
 		QUESTION(trans, PM_TRANS_CONV_REMOVE_HOLDPKG, info, NULL, NULL, &resp);
 		if(!resp) {
@@ -87,14 +87,14 @@
 	}
 
 	_alpm_log(PM_LOG_FLOW2, _("adding %s in the targets list"), info->name);
-	trans->packages = _alpm_list_add(trans->packages, info);
+	trans->packages = alpm_list_add(trans->packages, info);
 
 	return(0);
 }
 
-int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, pmlist_t **data)
+int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
 {
-	pmlist_t *lp;
+	alpm_list_t *lp;
 
 	ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
 	ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -107,13 +107,13 @@
 		if(lp != NULL) {
 			if(trans->flags & PM_TRANS_FLAG_CASCADE) {
 				while(lp) {
-					pmlist_t *i;
+					alpm_list_t *i;
 					for(i = lp; i; i = i->next) {
 						pmdepmissing_t *miss = (pmdepmissing_t *)i->data;
 						pmpkg_t *info = _alpm_db_scan(db, miss->depend.name, INFRQ_ALL);
 						if(info) {
 							_alpm_log(PM_LOG_FLOW2, _("pulling %s in the targets list"), info->name);
-							trans->packages = _alpm_list_add(trans->packages, info);
+							trans->packages = alpm_list_add(trans->packages, info);
 						} else {
 							_alpm_log(PM_LOG_ERROR, _("could not find %s in database -- skipping"),
 							          miss->depend.name);
@@ -160,7 +160,7 @@
 /* Helper function for iterating through a package's file and deleting them
  * Used by _alpm_remove_commit
 */
-static void unlink_file(pmpkg_t *info, pmlist_t *lp, pmlist_t *targ,
+static void unlink_file(pmpkg_t *info, alpm_list_t *lp, alpm_list_t *targ,
 												pmtrans_t *trans, int filenum, int *position)
 {
 	struct stat buf;
@@ -177,7 +177,7 @@
 		FREE(checksum);
 	} if ( !nb && trans->type == PM_TRANS_TYPE_UPGRADE ) {
 		/* check noupgrade */
-		if ( _alpm_list_is_strin(file, handle->noupgrade) ) {
+		if ( alpm_list_is_strin(file, handle->noupgrade) ) {
 			nb = 1;
 		}
 	}
@@ -198,7 +198,7 @@
 		 * see the big comment block in db_find_conflicts() for an
 		 * explanation. */
 		int skipit = 0;
-		pmlist_t *j;
+		alpm_list_t *j;
 		for ( j = trans->skiplist; j; j = j->next ) {
 			if ( !strcmp(file, (char*)j->data) ) {
 				skipit = 1;
@@ -222,8 +222,8 @@
 				}
 			} else {
 				_alpm_log(PM_LOG_FLOW2, _("unlinking %s"), line);
-				int list_count = _alpm_list_count(trans->packages); /* this way we don't have to call _alpm_list_count twice during PROGRESS */
-				PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, (double)(percent * 100), list_count, (list_count - _alpm_list_count(targ) + 1));
+				int list_count = alpm_list_count(trans->packages); /* this way we don't have to call alpm_list_count twice during PROGRESS */
+				PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, (double)(percent * 100), list_count, (list_count - alpm_list_count(targ) + 1));
 				++(*position);
 			}
 			if (unlink(line) == -1) {
@@ -236,7 +236,7 @@
 int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
 {
 	pmpkg_t *info;
-	pmlist_t *targ, *lp;
+	alpm_list_t *targ, *lp;
 
 	ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
 	ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
@@ -262,11 +262,11 @@
 		}
 
 		if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) {
-			int filenum = _alpm_list_count(info->files);
+			int filenum = alpm_list_count(info->files);
 			_alpm_log(PM_LOG_FLOW1, _("removing files"));
 
 			/* iterate through the list backwards, unlinking files */
-			for(lp = _alpm_list_last(info->files); lp; lp = lp->prev) {
+			for(lp = alpm_list_last(info->files); lp; lp = lp->prev) {
 				unlink_file(info, lp, targ, trans, filenum, &position);
 			}
 		}
@@ -309,7 +309,7 @@
 			depinfo = _alpm_db_get_pkgfromcache(db, depend.name);
 			if(depinfo == NULL) {
 				/* look for a provides package */
-				pmlist_t *provides = _alpm_db_whatprovides(db, depend.name);
+				alpm_list_t *provides = _alpm_db_whatprovides(db, depend.name);
 				if(provides) {
 					/* TODO: should check _all_ packages listed in provides, not just
 					 *       the first one.
@@ -327,7 +327,7 @@
 			/* Ensure package has the appropriate data */
 			_alpm_db_read(db, INFRQ_DEPENDS, depinfo);
 			/* splice out this entry from requiredby */
-			depinfo->requiredby = _alpm_list_remove(depinfo->requiredby, info->name, str_cmp, &vdata);
+			depinfo->requiredby = alpm_list_remove(depinfo->requiredby, info->name, str_cmp, &vdata);
 			data = vdata;
 			FREE(data);
 			_alpm_log(PM_LOG_DEBUG, _("updating 'requiredby' field for package '%s'"), depinfo->name);
@@ -337,7 +337,7 @@
 			}
 		}
 
-	    PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, 100, _alpm_list_count(trans->packages), (_alpm_list_count(trans->packages) - _alpm_list_count(targ) +1));
+	    PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, 100, alpm_list_count(trans->packages), (alpm_list_count(trans->packages) - alpm_list_count(targ) +1));
 		if(trans->type != PM_TRANS_TYPE_UPGRADE) {
 			EVENT(trans, PM_TRANS_EVT_REMOVE_DONE, info, NULL);
 		}
Index: pacman-lib/lib/libalpm/remove.h
diff -u pacman-lib/lib/libalpm/remove.h:1.6 pacman-lib/lib/libalpm/remove.h:1.7
--- pacman-lib/lib/libalpm/remove.h:1.6	Mon Nov 20 04:10:24 2006
+++ pacman-lib/lib/libalpm/remove.h	Fri Jan 19 04:28:45 2007
@@ -22,11 +22,11 @@
 #define _ALPM_REMOVE_H
 
 #include "db.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "trans.h"
 
 int _alpm_remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name);
-int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, pmlist_t **data);
+int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data);
 int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db);
 
 #endif /* _ALPM_REMOVE_H */
Index: pacman-lib/lib/libalpm/server.c
diff -u pacman-lib/lib/libalpm/server.c:1.15 pacman-lib/lib/libalpm/server.c:1.16
--- pacman-lib/lib/libalpm/server.c:1.15	Thu Jan 18 11:53:00 2007
+++ pacman-lib/lib/libalpm/server.c	Fri Jan 19 04:28:45 2007
@@ -94,7 +94,7 @@
  *
  * RETURN:  0 for successful download, 1 on error
  */
-int _alpm_downloadfiles(pmlist_t *servers, const char *localpath, pmlist_t *files)
+int _alpm_downloadfiles(alpm_list_t *servers, const char *localpath, alpm_list_t *files)
 {
 	return(_alpm_downloadfiles_forreal(servers, localpath, files, NULL, NULL));
 }
@@ -112,14 +112,14 @@
  *          1 if the mtimes are identical
  *         -1 on error
  */
-int _alpm_downloadfiles_forreal(pmlist_t *servers, const char *localpath,
-	pmlist_t *files, const char *mtime1, char *mtime2)
+int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath,
+	alpm_list_t *files, const char *mtime1, char *mtime2)
 {
 	int dltotal_bytes = 0;
-	pmlist_t *lp;
+	alpm_list_t *lp;
 	int done = 0;
-	pmlist_t *complete = NULL;
-	pmlist_t *i;
+	alpm_list_t *complete = NULL;
+	alpm_list_t *i;
 
 	if(files == NULL) {
 		return(0);
@@ -137,7 +137,7 @@
 			snprintf(realfile, PATH_MAX, "%s/%s", localpath, fn);
 			snprintf(output, PATH_MAX, "%s/%s.part", localpath, fn);
 
-			if(_alpm_list_is_strin(fn, complete)) {
+			if(alpm_list_is_strin(fn, complete)) {
 				continue;
 			}
 
@@ -196,7 +196,7 @@
 					_alpm_time2string(ust.mtime, strtime);
 					if(strcmp(mtime1, strtime) == 0) {
 						_alpm_log(PM_LOG_DEBUG, _("mtimes are identical, skipping %s"), fn);
-						complete = _alpm_list_add(complete, fn);
+						complete = alpm_list_add(complete, fn);
 						if(localf != NULL) {
 							fclose(localf);
 						}
@@ -246,7 +246,7 @@
 				fclose(localf);
 				fclose(dlf);
 				rename(output, realfile);
-				complete = _alpm_list_add(complete, fn);
+				complete = alpm_list_add(complete, fn);
 			} else {
 				int ret;
 				int usepart = 0;
@@ -298,7 +298,7 @@
 					_alpm_log(PM_LOG_DEBUG, _("XferCommand command returned non-zero status code (%d)"), ret);
 				} else {
 					/* download was successful */
-					complete = _alpm_list_add(complete, fn);
+					complete = alpm_list_add(complete, fn);
 					if(usepart) {
 						char fnpart[PATH_MAX];
 						/* rename "output.part" file to "output" file */
@@ -310,7 +310,7 @@
 			}
 		}
 
-		if(_alpm_list_count(complete) == _alpm_list_count(files)) {
+		if(alpm_list_count(complete) == alpm_list_count(files)) {
 			done = 1;
 		}
 	}
@@ -344,8 +344,8 @@
 		_alpm_log(PM_LOG_DEBUG, _(" %s is already in the current directory"), s_url->doc);
 	} else {
 		pmserver_t *server;
-		pmlist_t *servers = NULL;
-		pmlist_t *files;
+		alpm_list_t *servers = NULL;
+		alpm_list_t *files;
 
 		if((server = (pmserver_t *)malloc(sizeof(pmserver_t))) == NULL) {
 			_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmserver_t));
@@ -357,9 +357,9 @@
 
 			server->s_url = s_url;
 			server->path = strdup(s_url->doc);
-			servers = _alpm_list_add(servers, server);
+			servers = alpm_list_add(servers, server);
 
-			files = _alpm_list_add(NULL, strdup(p));
+			files = alpm_list_add(NULL, strdup(p));
 			if(_alpm_downloadfiles(servers, ".", files)) {
 				_alpm_log(PM_LOG_WARNING, _("failed to download %s"), target);
 				return(NULL);
Index: pacman-lib/lib/libalpm/server.h
diff -u pacman-lib/lib/libalpm/server.h:1.8 pacman-lib/lib/libalpm/server.h:1.9
--- pacman-lib/lib/libalpm/server.h:1.8	Mon Nov 20 04:10:24 2006
+++ pacman-lib/lib/libalpm/server.h	Fri Jan 19 04:28:45 2007
@@ -21,7 +21,7 @@
 #ifndef _ALPM_SERVER_H
 #define _ALPM_SERVER_H
 
-#include "list.h"
+#include "alpm_list.h"
 #include "alpm.h"
 
 #include <time.h>
@@ -40,9 +40,9 @@
 
 pmserver_t *_alpm_server_new(const char *url);
 void _alpm_server_free(void *data);
-int _alpm_downloadfiles(pmlist_t *servers, const char *localpath, pmlist_t *files);
-int _alpm_downloadfiles_forreal(pmlist_t *servers, const char *localpath,
-	pmlist_t *files, const char *mtime1, char *mtime2);
+int _alpm_downloadfiles(alpm_list_t *servers, const char *localpath, alpm_list_t *files);
+int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath,
+	alpm_list_t *files, const char *mtime1, char *mtime2);
 
 char *_alpm_fetch_pkgurl(char *target);
 
Index: pacman-lib/lib/libalpm/sync.c
diff -u pacman-lib/lib/libalpm/sync.c:1.90 pacman-lib/lib/libalpm/sync.c:1.91
--- pacman-lib/lib/libalpm/sync.c:1.90	Thu Jan 18 11:53:01 2007
+++ pacman-lib/lib/libalpm/sync.c	Fri Jan 19 04:28:45 2007
@@ -36,7 +36,7 @@
 /* pacman */
 #include "log.h"
 #include "error.h"
-#include "list.h"
+#include "alpm_list.h"
 #include "package.h"
 #include "db.h"
 #include "cache.h"
@@ -87,12 +87,12 @@
 	FREE(sync);
 }
 
-/* Test for existence of a package in a pmlist_t* of pmsyncpkg_t*
+/* Test for existence of a package in a alpm_list_t* of pmsyncpkg_t*
  * If found, return a pointer to the respective pmsyncpkg_t*
  */
-static pmsyncpkg_t *find_pkginsync(char *needle, pmlist_t *haystack)
+static pmsyncpkg_t *find_pkginsync(char *needle, alpm_list_t *haystack)
 {
-	pmlist_t *i;
+	alpm_list_t *i;
 	pmsyncpkg_t *sync = NULL;
 	int found = 0;
 
@@ -122,9 +122,9 @@
  * (refactored from _alpm_sync_prepare)
  */
 static int find_replacements(pmtrans_t *trans, pmdb_t *db_local,
-														 pmlist_t *dbs_sync)
+														 alpm_list_t *dbs_sync)
 {
-	pmlist_t *i, *j, *k;
+	alpm_list_t *i, *j, *k;
 
 	/* check for "recommended" package replacements */
 	_alpm_log(PM_LOG_FLOW1, _("checking for package replacements"));
@@ -132,12 +132,12 @@
 		for(j = _alpm_db_get_pkgcache(i->data, INFRQ_DESC); j; j = j->next) {
 			pmpkg_t *spkg = j->data;
 			for(k = spkg->replaces; k; k = k->next) {
-				pmlist_t *m;
+				alpm_list_t *m;
 				for(m = _alpm_db_get_pkgcache(db_local, INFRQ_NONE); m; m = m->next) {
 					pmpkg_t *lpkg = m->data;
 					if(strcmp(k->data, lpkg->name) == 0) {
 						_alpm_log(PM_LOG_DEBUG, _("checking replacement '%s' for package '%s'"), k->data, spkg->name);
-						if(_alpm_list_is_strin(lpkg->name, handle->ignorepkg)) {
+						if(alpm_list_is_strin(lpkg->name, handle->ignorepkg)) {
 							_alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (to be replaced by %s-%s)"),
 								lpkg->name, lpkg->version, spkg->name, spkg->version);
 						} else {
@@ -155,12 +155,12 @@
 									pm_errno = PM_ERR_MEMORY;
 									goto error;
 								}
-								dummy->requiredby = _alpm_list_strdup(lpkg->requiredby);
+								dummy->requiredby = alpm_list_strdup(lpkg->requiredby);
 								/* check if spkg->name is already in the packages list. */
 								sync = find_pkginsync(spkg->name, trans->packages);
 								if(sync) {
 									/* found it -- just append to the replaces list */
-									sync->data = _alpm_list_add(sync->data, dummy);
+									sync->data = alpm_list_add(sync->data, dummy);
 								} else {
 									/* none found -- enter pkg into the final sync list */
 									sync = _alpm_sync_new(PM_SYNC_TYPE_REPLACE, spkg, NULL);
@@ -169,8 +169,8 @@
 										pm_errno = PM_ERR_MEMORY;
 										goto error;
 									}
-									sync->data = _alpm_list_add(NULL, dummy);
-									trans->packages = _alpm_list_add(trans->packages, sync);
+									sync->data = alpm_list_add(NULL, dummy);
+									trans->packages = alpm_list_add(trans->packages, sync);
 								}
 								_alpm_log(PM_LOG_FLOW2, _("%s-%s elected for upgrade (to be replaced by %s-%s)"),
 								          lpkg->name, lpkg->version, spkg->name, spkg->version);
@@ -187,9 +187,9 @@
 	return(-1);
 }
 
-int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, pmlist_t *dbs_sync)
+int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync)
 {
-	pmlist_t *i, *j;
+	alpm_list_t *i, *j;
 
 	/* check for "recommended" package replacements */
 	_alpm_log(PM_LOG_FLOW1, _("checking for package replacements"));
@@ -235,7 +235,7 @@
 									local->name, local->version, db->treename, spkg->version);
 			} else if(cmp == 0) {
 				/* versions are identical */
-			} else if(_alpm_list_is_strin(spkg->name, handle->ignorepkg)) {
+			} else if(alpm_list_is_strin(spkg->name, handle->ignorepkg)) {
 				/* package should be ignored (IgnorePkg) */
 				_alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (%s)"),
 									local->name, local->version, spkg->version);
@@ -257,7 +257,7 @@
 						FREEPKG(dummy);
 						goto error;
 					}
-					trans->packages = _alpm_list_add(trans->packages, sync);
+					trans->packages = alpm_list_add(trans->packages, sync);
 				} else {
 					/* spkg->name is already in the packages list -- just ignore it */
 				}
@@ -271,11 +271,11 @@
 	return(-1);
 }
 
-int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, pmlist_t *dbs_sync, char *name)
+int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync, char *name)
 {
 	char targline[PKG_FULLNAME_LEN];
 	char *targ;
-	pmlist_t *j;
+	alpm_list_t *j;
 	pmpkg_t *local;
 	pmpkg_t *spkg = NULL;
 	pmsyncpkg_t *sync;
@@ -298,7 +298,7 @@
 				spkg = _alpm_db_get_pkgfromcache(dbs, targ);
 				if(spkg == NULL) {
 					/* Search provides */
-					pmlist_t *p;
+					alpm_list_t *p;
 					_alpm_log(PM_LOG_FLOW2, _("target '%s' not found -- looking for provisions"), targ);
 					p = _alpm_db_whatprovides(dbs, targ);
 					if(p == NULL) {
@@ -325,7 +325,7 @@
 			_alpm_log(PM_LOG_FLOW2, _("target '%s' not found -- looking for provisions"), targ);
 			for(j = dbs_sync; j && !spkg; j = j->next) {
 				pmdb_t *dbs = j->data;
-				pmlist_t *p = _alpm_db_whatprovides(dbs, targ);
+				alpm_list_t *p = _alpm_db_whatprovides(dbs, targ);
 				if(p) {
 					_alpm_log(PM_LOG_DEBUG, _("found '%s' as a provision for '%s'"), p->data, targ);
 					spkg = _alpm_db_get_pkgfromcache(dbs, p->data);
@@ -375,13 +375,13 @@
 			RET_ERR(PM_ERR_MEMORY, -1);
 		}
 		_alpm_log(PM_LOG_FLOW2, _("adding target '%s' to the transaction set"), spkg->name);
-		trans->packages = _alpm_list_add(trans->packages, sync);
+		trans->packages = alpm_list_add(trans->packages, sync);
 	}
 
 	return(0);
 }
 
-/* Helper functions for _alpm_list_remove
+/* Helper functions for alpm_list_remove
  */
 /* removed - use pkg_cmp all of the time
 static int ptr_cmp(const void *s1, const void *s2)
@@ -394,13 +394,13 @@
 	return(strcmp(((pmpkg_t *)p1)->name, ((pmsyncpkg_t *)p2)->pkg->name));
 }
 
-int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, pmlist_t *dbs_sync, pmlist_t **data)
+int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync, alpm_list_t **data)
 {
-	pmlist_t *deps = NULL;
-	pmlist_t *list = NULL; /* list allowing checkdeps usage with data from trans->packages */
-	pmlist_t *trail = NULL; /* breadcrumb list to avoid running into circles */
-	pmlist_t *asked = NULL; 
-	pmlist_t *i, *j, *k, *l;
+	alpm_list_t *deps = NULL;
+	alpm_list_t *list = NULL; /* list allowing checkdeps usage with data from trans->packages */
+	alpm_list_t *trail = NULL; /* breadcrumb list to avoid running into circles */
+	alpm_list_t *asked = NULL; 
+	alpm_list_t *i, *j, *k, *l;
 	int ret = 0;
 
 	ASSERT(db_local != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
@@ -412,11 +412,11 @@
 
 	for(i = trans->packages; i; i = i->next) {
 		pmsyncpkg_t *sync = i->data;
-		list = _alpm_list_add(list, sync->pkg);
+		list = alpm_list_add(list, sync->pkg);
 	}
 
 	if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
-		trail = _alpm_list_new();
+		trail = alpm_list_new();
 
 		/* Resolve targets dependencies */
 		EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_START, NULL, NULL);
@@ -439,7 +439,7 @@
 					ret = -1;
 					goto cleanup;
 				}
-				trans->packages = _alpm_list_add(trans->packages, sync);
+				trans->packages = alpm_list_add(trans->packages, sync);
 				_alpm_log(PM_LOG_FLOW2, _("adding package %s-%s to the transaction targets"),
 						spkg->name, spkg->version);
 			} else {
@@ -447,7 +447,7 @@
 				if((trans->flags & PM_TRANS_FLAG_DEPENDSONLY)) {
 					void *vp;
 					pmpkg_t *p;
-					trans->packages = _alpm_list_remove(trans->packages, spkg, pkg_cmp, &vp);
+					trans->packages = alpm_list_remove(trans->packages, spkg, pkg_cmp, &vp);
 					p = vp;
 					FREEPKG(p);
 				}
@@ -458,14 +458,14 @@
 		k = l = NULL;
 		for(i=trans->packages; i; i=i->next) {
 			pmsyncpkg_t *s = (pmsyncpkg_t*)i->data;
-			k = _alpm_list_add(k, s->pkg);
+			k = alpm_list_add(k, s->pkg);
 		}
 		k = _alpm_sortbydeps(k, PM_TRANS_TYPE_ADD);
 		for(i=k; i; i=i->next) {
 			for(j=trans->packages; j; j=j->next) {
 				pmsyncpkg_t *s = (pmsyncpkg_t*)j->data;
 				if(s->pkg==i->data) {
-					l = _alpm_list_add(l, s);
+					l = alpm_list_add(l, s);
 				}
 			}
 		}
@@ -535,7 +535,7 @@
 				local = _alpm_db_get_pkgfromcache(db_local, miss->depend.name);
 				/* check if this package also "provides" the package it's conflicting with
 				 */
-				if(_alpm_list_is_strin(miss->depend.name, sync->pkg->provides)) {
+				if(alpm_list_is_strin(miss->depend.name, sync->pkg->provides)) {
 					/* so just treat it like a "replaces" item so the REQUIREDBY
 					 * fields are inherited properly.
 					 */
@@ -559,8 +559,8 @@
 
 						/* figure out which one was requested in targets.  If they both were,
 						 * then it's still an unresolvable conflict. */
-						target = _alpm_list_is_strin(miss->target, trans->targets);
-						depend = _alpm_list_is_strin(miss->depend.name, trans->targets);
+						target = alpm_list_is_strin(miss->target, trans->targets);
+						depend = alpm_list_is_strin(miss->depend.name, trans->targets);
 						if(depend && !target) {
 							_alpm_log(PM_LOG_DEBUG, _("'%s' is in the target list -- keeping it"),
 								miss->depend.name);
@@ -580,7 +580,7 @@
 							pmsyncpkg_t *rsync = find_pkginsync(rmpkg, trans->packages);
 							void *vpkg;
 							_alpm_log(PM_LOG_FLOW2, _("removing '%s' from target list"), rmpkg);
-							trans->packages = _alpm_list_remove(trans->packages, rsync, pkg_cmp, &vpkg);
+							trans->packages = alpm_list_remove(trans->packages, rsync, pkg_cmp, &vpkg);
 							FREESYNC(vpkg);
 							continue;
 						}
@@ -591,9 +591,9 @@
 				_alpm_log(PM_LOG_DEBUG, _("resolving package '%s' conflict"), miss->target);
 				if(local) {
 					int doremove = 0;
-					if(!_alpm_list_is_strin(miss->depend.name, asked)) {
+					if(!alpm_list_is_strin(miss->depend.name, asked)) {
 						QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, miss->target, miss->depend.name, NULL, &doremove);
-						asked = _alpm_list_add(asked, strdup(miss->depend.name));
+						asked = alpm_list_add(asked, strdup(miss->depend.name));
 						if(doremove) {
 							pmsyncpkg_t *rsync = find_pkginsync(miss->depend.name, trans->packages);
 							pmpkg_t *q = _alpm_pkg_new(miss->depend.name, NULL);
@@ -604,7 +604,7 @@
 								ret = -1;
 								goto cleanup;
 							}
-							q->requiredby = _alpm_list_strdup(local->requiredby);
+							q->requiredby = alpm_list_strdup(local->requiredby);
 							if(sync->type != PM_SYNC_TYPE_REPLACE) {
 								/* switch this sync type to REPLACE */
 								sync->type = PM_SYNC_TYPE_REPLACE;
@@ -612,12 +612,12 @@
 							}
 							/* append to the replaces list */
 							_alpm_log(PM_LOG_FLOW2, _("electing '%s' for removal"), miss->depend.name);
-							sync->data = _alpm_list_add(sync->data, q);
+							sync->data = alpm_list_add(sync->data, q);
 							if(rsync) {
 								/* remove it from the target list */
 								void *vpkg;
 								_alpm_log(PM_LOG_FLOW2, _("removing '%s' from target list"), miss->depend.name);
-								trans->packages = _alpm_list_remove(trans->packages, rsync, pkg_cmp, &vpkg);
+								trans->packages = alpm_list_remove(trans->packages, rsync, pkg_cmp, &vpkg);
 								FREESYNC(vpkg);
 							}
 						} else {
@@ -633,7 +633,7 @@
 									goto cleanup;
 								}
 								*miss = *(pmdepmissing_t *)i->data;
-								*data = _alpm_list_add(*data, miss);
+								*data = alpm_list_add(*data, miss);
 							}
 						}
 					}
@@ -649,7 +649,7 @@
 							goto cleanup;
 						}
 						*miss = *(pmdepmissing_t *)i->data;
-						*data = _alpm_list_add(*data, miss);
+						*data = alpm_list_add(*data, miss);
 					}
 				}
 			}
@@ -685,7 +685,7 @@
 			pmsyncpkg_t *sync = i->data;
 			if(sync->type == PM_SYNC_TYPE_REPLACE) {
 				for(j = sync->data; j; j = j->next) {
-					list = _alpm_list_add(list, j->data);
+					list = alpm_list_add(list, j->data);
 				}
 			}
 		}
@@ -698,7 +698,7 @@
 					pmdepmissing_t *miss = i->data;
 					if(!find_pkginsync(miss->depend.name, trans->packages)) {
 						int pfound = 0;
-						pmlist_t *k;
+						alpm_list_t *k;
 						/* If miss->depend.name depends on something that miss->target and a
 						 * package in final both provide, then it's okay...  */
 						pmpkg_t *leavingp  = _alpm_db_get_pkgfromcache(db_local, miss->target);
@@ -711,13 +711,13 @@
 						/* Look through the upset package's dependencies and try to match one up
 						 * to a provisio from the