aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2002-12-08 00:54:33 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2002-12-08 00:54:33 +0000
commit66125c806518f74a54232206d02e30a39b621232 (patch)
treef7e34d157460ad689c350071a25d19cdd51e1ebb /libbb
parent346cdb1ddea7d825b29e9dcd73d6f7af8db8598f (diff)
downloadbusybox-w32-66125c806518f74a54232206d02e30a39b621232.tar.gz
busybox-w32-66125c806518f74a54232206d02e30a39b621232.tar.bz2
busybox-w32-66125c806518f74a54232206d02e30a39b621232.zip
Move add_to_list from libunarchive to libbb so it can be of more general use (eg ifupdown). Changed the name to llist_add_to as i plan on adding more llist_ functions as needed (e.g. llist_free).
Diffstat (limited to 'libbb')
-rw-r--r--libbb/Makefile.in2
-rw-r--r--libbb/llist_add_to.c15
2 files changed, 16 insertions, 1 deletions
diff --git a/libbb/Makefile.in b/libbb/Makefile.in
index 22fcd8306..3f4e77314 100644
--- a/libbb/Makefile.in
+++ b/libbb/Makefile.in
@@ -33,7 +33,7 @@ LIBBB_SRC:= \
33 get_last_path_component.c get_line_from_file.c herror_msg.c \ 33 get_last_path_component.c get_line_from_file.c herror_msg.c \
34 herror_msg_and_die.c human_readable.c inet_common.c inode_hash.c \ 34 herror_msg_and_die.c human_readable.c inet_common.c inode_hash.c \
35 interface.c isdirectory.c kernel_version.c last_char_is.c libc5.c \ 35 interface.c isdirectory.c kernel_version.c last_char_is.c libc5.c \
36 loop.c make_directory.c mode_string.c \ 36 llist_add_to.c loop.c make_directory.c mode_string.c \
37 module_syscalls.c mtab.c mtab_file.c my_getgrgid.c my_getgrnam.c \ 37 module_syscalls.c mtab.c mtab_file.c my_getgrgid.c my_getgrnam.c \
38 my_getpwnam.c my_getpwnamegid.c my_getpwuid.c obscure.c parse_mode.c \ 38 my_getpwnam.c my_getpwnamegid.c my_getpwuid.c obscure.c parse_mode.c \
39 parse_number.c perror_msg.c perror_msg_and_die.c print_file.c \ 39 parse_number.c perror_msg.c perror_msg_and_die.c print_file.c \
diff --git a/libbb/llist_add_to.c b/libbb/llist_add_to.c
new file mode 100644
index 000000000..61e53f0c1
--- /dev/null
+++ b/libbb/llist_add_to.c
@@ -0,0 +1,15 @@
1#include <stdlib.h>
2#include <string.h>
3#include "unarchive.h"
4#include "libbb.h"
5
6extern llist_t *llist_add_to(llist_t *old_head, char *new_item)
7{
8 llist_t *new_head;
9
10 new_head = xmalloc(sizeof(llist_t));
11 new_head->data = new_item;
12 new_head->link = old_head;
13
14 return(new_head);
15}