diff options
| author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-09-29 12:55:10 +0000 |
|---|---|---|
| committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-09-29 12:55:10 +0000 |
| commit | 100c95cece01804ce52bc15a6450c1a41765c059 (patch) | |
| tree | 013e17fde8c199768a4195d057371372a330e765 | |
| parent | e263de99f6eabc608e9f79181c8e146d8a951503 (diff) | |
| download | busybox-w32-100c95cece01804ce52bc15a6450c1a41765c059.tar.gz busybox-w32-100c95cece01804ce52bc15a6450c1a41765c059.tar.bz2 busybox-w32-100c95cece01804ce52bc15a6450c1a41765c059.zip | |
- rename llist_add_to.c to llist.c
- move llist_add_to_end() from ifupdown.c to libbb/llist.c
git-svn-id: svn://busybox.net/trunk/busybox@11691 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | libbb/Makefile.in | 12 | ||||
| -rw-r--r-- | libbb/llist.c | 43 | ||||
| -rw-r--r-- | libbb/llist_add_to.c | 15 | ||||
| -rw-r--r-- | networking/ifupdown.c | 23 |
4 files changed, 53 insertions, 40 deletions
diff --git a/libbb/Makefile.in b/libbb/Makefile.in index 0c761e2b3..92af30502 100644 --- a/libbb/Makefile.in +++ b/libbb/Makefile.in | |||
| @@ -19,7 +19,7 @@ LIBBB_SRC-y:= \ | |||
| 19 | full_write.c get_last_path_component.c get_line_from_file.c \ | 19 | full_write.c get_last_path_component.c get_line_from_file.c \ |
| 20 | hash_fd.c herror_msg.c herror_msg_and_die.c \ | 20 | hash_fd.c herror_msg.c herror_msg_and_die.c \ |
| 21 | human_readable.c inet_common.c inode_hash.c interface.c isdirectory.c \ | 21 | human_readable.c inet_common.c inode_hash.c interface.c isdirectory.c \ |
| 22 | kernel_version.c last_char_is.c llist_add_to.c login.c loop.c \ | 22 | kernel_version.c last_char_is.c login.c loop.c \ |
| 23 | make_directory.c mode_string.c mtab.c mtab_file.c \ | 23 | make_directory.c mode_string.c mtab.c mtab_file.c \ |
| 24 | obscure.c parse_mode.c parse_number.c perror_msg.c \ | 24 | obscure.c parse_mode.c parse_number.c perror_msg.c \ |
| 25 | perror_msg_and_die.c print_file.c get_console.c \ | 25 | perror_msg_and_die.c print_file.c get_console.c \ |
| @@ -68,17 +68,22 @@ LIBBB_MSRC5:=$(srcdir)/bb_pwd.c | |||
| 68 | LIBBB_MOBJ5:=bb_xgetpwnam.o bb_xgetgrnam.o bb_getgrgid.o bb_getpwuid.o \ | 68 | LIBBB_MOBJ5:=bb_xgetpwnam.o bb_xgetgrnam.o bb_getgrgid.o bb_getpwuid.o \ |
| 69 | bb_getug.o get_ug_id.o | 69 | bb_getug.o get_ug_id.o |
| 70 | 70 | ||
| 71 | LIBBB_MSRC6:=$(srcdir)/llist.c | ||
| 72 | LIBBB_MOBJ6:=llist_add_to.o llist_add_to_end.o | ||
| 73 | |||
| 71 | LIBBB_MOBJS0=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ0)) | 74 | LIBBB_MOBJS0=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ0)) |
| 72 | LIBBB_MOBJS1=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ1)) | 75 | LIBBB_MOBJS1=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ1)) |
| 73 | LIBBB_MOBJS2=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ2)) | 76 | LIBBB_MOBJS2=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ2)) |
| 74 | LIBBB_MOBJS3=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ3)) | 77 | LIBBB_MOBJS3=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ3)) |
| 75 | LIBBB_MOBJS4=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ4)) | 78 | LIBBB_MOBJS4=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ4)) |
| 76 | LIBBB_MOBJS5=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ5)) | 79 | LIBBB_MOBJS5=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ5)) |
| 80 | LIBBB_MOBJS6=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ6)) | ||
| 77 | 81 | ||
| 78 | libraries-y+=$(LIBBB_DIR)$(LIBBB_AR) | 82 | libraries-y+=$(LIBBB_DIR)$(LIBBB_AR) |
| 79 | 83 | ||
| 80 | $(LIBBB_DIR)$(LIBBB_AR): $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \ | 84 | $(LIBBB_DIR)$(LIBBB_AR): $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \ |
| 81 | $(LIBBB_MOBJS2) $(LIBBB_MOBJS3) $(LIBBB_MOBJS4) $(LIBBB_MOBJS5) | 85 | $(LIBBB_MOBJS2) $(LIBBB_MOBJS3) $(LIBBB_MOBJS4) $(LIBBB_MOBJS5) \ |
| 86 | $(LIBBB_MOBJS6) | ||
| 82 | $(AR) $(ARFLAGS) $(@) $(LIBBB_OBJS) $(^) | 87 | $(AR) $(ARFLAGS) $(@) $(LIBBB_OBJS) $(^) |
| 83 | 88 | ||
| 84 | $(LIBBB_DIR)%.o: $(srcdir)/%.c | 89 | $(LIBBB_DIR)%.o: $(srcdir)/%.c |
| @@ -102,3 +107,6 @@ $(LIBBB_MOBJS4): $(LIBBB_MSRC4) | |||
| 102 | $(LIBBB_MOBJS5): $(LIBBB_MSRC5) | 107 | $(LIBBB_MOBJS5): $(LIBBB_MSRC5) |
| 103 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@ | 108 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@ |
| 104 | 109 | ||
| 110 | $(LIBBB_MOBJS6): $(LIBBB_MSRC6) | ||
| 111 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@ | ||
| 112 | |||
diff --git a/libbb/llist.c b/libbb/llist.c new file mode 100644 index 000000000..cb87176c5 --- /dev/null +++ b/libbb/llist.c | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #include <stdlib.h> | ||
| 2 | #include <string.h> | ||
| 3 | #include "unarchive.h" | ||
| 4 | #include "libbb.h" | ||
| 5 | |||
| 6 | #ifdef L_llist_add_to | ||
| 7 | extern llist_t *llist_add_to(llist_t *old_head, char *new_item) | ||
| 8 | { | ||
| 9 | llist_t *new_head; | ||
| 10 | |||
| 11 | new_head = xmalloc(sizeof(llist_t)); | ||
| 12 | new_head->data = new_item; | ||
| 13 | new_head->link = old_head; | ||
| 14 | |||
| 15 | return (new_head); | ||
| 16 | } | ||
| 17 | #endif | ||
| 18 | |||
| 19 | #ifdef L_llist_add_to_end | ||
| 20 | extern llist_t *llist_add_to_end(llist_t *list_head, char *data) | ||
| 21 | { | ||
| 22 | llist_t *new_item, *tmp, *prev; | ||
| 23 | |||
| 24 | new_item = xmalloc(sizeof(llist_t)); | ||
| 25 | new_item->data = data; | ||
| 26 | new_item->link = NULL; | ||
| 27 | |||
| 28 | prev = NULL; | ||
| 29 | tmp = list_head; | ||
| 30 | while (tmp) { | ||
| 31 | prev = tmp; | ||
| 32 | tmp = tmp->link; | ||
| 33 | } | ||
| 34 | if (prev) { | ||
| 35 | prev->link = new_item; | ||
| 36 | } else { | ||
| 37 | list_head = new_item; | ||
| 38 | } | ||
| 39 | |||
| 40 | return (list_head); | ||
| 41 | } | ||
| 42 | #endif | ||
| 43 | |||
diff --git a/libbb/llist_add_to.c b/libbb/llist_add_to.c deleted file mode 100644 index 61e53f0c1..000000000 --- a/libbb/llist_add_to.c +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #include <stdlib.h> | ||
| 2 | #include <string.h> | ||
| 3 | #include "unarchive.h" | ||
| 4 | #include "libbb.h" | ||
| 5 | |||
| 6 | extern 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 | } | ||
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 68fdd37d4..c73529463 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
| @@ -67,29 +67,6 @@ struct interface_defn_t; | |||
| 67 | typedef int (execfn)(char *command); | 67 | typedef int (execfn)(char *command); |
| 68 | typedef int (command_set)(struct interface_defn_t *ifd, execfn *e); | 68 | typedef int (command_set)(struct interface_defn_t *ifd, execfn *e); |
| 69 | 69 | ||
| 70 | extern llist_t *llist_add_to_end(llist_t *list_head, char *data) | ||
| 71 | { | ||
| 72 | llist_t *new_item, *tmp, *prev; | ||
| 73 | |||
| 74 | new_item = xmalloc(sizeof(llist_t)); | ||
| 75 | new_item->data = data; | ||
| 76 | new_item->link = NULL; | ||
| 77 | |||
| 78 | prev = NULL; | ||
| 79 | tmp = list_head; | ||
| 80 | while(tmp) { | ||
| 81 | prev = tmp; | ||
| 82 | tmp = tmp->link; | ||
| 83 | } | ||
| 84 | if (prev) { | ||
| 85 | prev->link = new_item; | ||
| 86 | } else { | ||
| 87 | list_head = new_item; | ||
| 88 | } | ||
| 89 | |||
| 90 | return(list_head); | ||
| 91 | } | ||
| 92 | |||
| 93 | struct method_t | 70 | struct method_t |
| 94 | { | 71 | { |
| 95 | char *name; | 72 | char *name; |
