summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/alpm_list.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-02-25 01:07:44 +0100
committerDan McGee <dan@archlinux.org>2008-02-25 01:07:44 +0100
commitca1a187131d95604ff2c33df3c1ec80ef4af789b (patch)
tree03b556759d1270a93d88d534a84595e1f6acfd3b /lib/libalpm/alpm_list.c
parent8cfccf68c1c7fdd45c172d49115e56e04dae2a2c (diff)
downloadpacman-ca1a187131d95604ff2c33df3c1ec80ef4af789b.tar.gz
pacman-ca1a187131d95604ff2c33df3c1ec80ef4af789b.tar.xz
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>
Diffstat (limited to 'lib/libalpm/alpm_list.c')
-rw-r--r--lib/libalpm/alpm_list.c27
1 files changed, 7 insertions, 20 deletions
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
@@ -40,20 +41,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.
*
* @param list the list to free
@@ -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);
}