From ca1a187131d95604ff2c33df3c1ec80ef4af789b Mon Sep 17 00:00:00 2001
From: Dan McGee <dan@archlinux.org>
Date: Sun, 24 Feb 2008 18:07:44 -0600
Subject: More cleanup to alpm_list

* Remove some #include statements that are not strictly necessary
* Remove node_new function that is really just a one-liner

Signed-off-by: Dan McGee <dan@archlinux.org>
---
 lib/libalpm/alpm_list.c | 27 +++++++--------------------
 1 file changed, 7 insertions(+), 20 deletions(-)

(limited to 'lib')

diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c
index bdf9b5f5..ae54e190 100644
--- a/lib/libalpm/alpm_list.c
+++ b/lib/libalpm/alpm_list.c
@@ -1,7 +1,7 @@
 /*
  *  alpm_list.c
  *
- *  Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
+ *  Copyright (c) 2002-2008 by Judd Vinet <jvinet@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
@@ -17,15 +17,16 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "config.h"
-
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 
 /* libalpm */
 #include "alpm_list.h"
-#include "util.h"
+
+/* check exported library symbols with: nm -C -D <lib> */
+#define SYMEXPORT __attribute__((visibility("default")))
+#define SYMHIDDEN __attribute__((visibility("internal")))
 
 /**
  * @addtogroup alpm_list List Functions
@@ -39,20 +40,6 @@
 
 /* Allocation */
 
-/**
- * @brief Allocate a new node for alpm_list_t (with empty ->data)
- *
- * @return a new node item, or NULL on failure
- */
-static alpm_list_t *node_new()
-{
-	alpm_list_t *list = NULL;
-
-	list = calloc(1, sizeof(alpm_list_t));
-
-	return(list);
-}
-
 /**
  * @brief Free a list, but not the contained data.
  *
@@ -102,7 +89,7 @@ alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
 {
 	alpm_list_t *ptr, *lp;
 
-	ptr = node_new();
+	ptr = calloc(1, sizeof(alpm_list_t));
 	if(ptr == NULL) {
 		return(list);
 	}
@@ -140,7 +127,7 @@ alpm_list_t SYMEXPORT *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_
 	} else {
 		alpm_list_t *add = NULL, *prev = NULL, *next = list;
 
-		add = node_new();
+		add = calloc(1, sizeof(alpm_list_t));
 		if(add == NULL) {
 			return(list);
 		}
-- 
cgit v1.2.3-70-g09d2