svn commit: trunk/busybox: libbb networking

aldot at busybox.net aldot at busybox.net
Thu Sep 29 12:55:12 UTC 2005


Author: aldot
Date: 2005-09-29 05:55:10 -0700 (Thu, 29 Sep 2005)
New Revision: 11691

Log:
- rename llist_add_to.c to llist.c
- move llist_add_to_end() from ifupdown.c to libbb/llist.c


Added:
   trunk/busybox/libbb/llist.c

Removed:
   trunk/busybox/libbb/llist_add_to.c

Modified:
   trunk/busybox/libbb/Makefile.in
   trunk/busybox/networking/ifupdown.c


Changeset:
Modified: trunk/busybox/libbb/Makefile.in
===================================================================
--- trunk/busybox/libbb/Makefile.in	2005-09-29 11:31:26 UTC (rev 11690)
+++ trunk/busybox/libbb/Makefile.in	2005-09-29 12:55:10 UTC (rev 11691)
@@ -19,7 +19,7 @@
 	full_write.c get_last_path_component.c get_line_from_file.c \
 	hash_fd.c herror_msg.c herror_msg_and_die.c \
 	human_readable.c inet_common.c inode_hash.c interface.c isdirectory.c \
-	kernel_version.c last_char_is.c llist_add_to.c login.c loop.c \
+	kernel_version.c last_char_is.c login.c loop.c \
 	make_directory.c mode_string.c mtab.c mtab_file.c \
 	obscure.c parse_mode.c parse_number.c perror_msg.c \
 	perror_msg_and_die.c print_file.c get_console.c \
@@ -68,17 +68,22 @@
 LIBBB_MOBJ5:=bb_xgetpwnam.o bb_xgetgrnam.o bb_getgrgid.o bb_getpwuid.o \
 	bb_getug.o get_ug_id.o
 
+LIBBB_MSRC6:=$(srcdir)/llist.c
+LIBBB_MOBJ6:=llist_add_to.o llist_add_to_end.o
+
 LIBBB_MOBJS0=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ0))
 LIBBB_MOBJS1=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ1))
 LIBBB_MOBJS2=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ2))
 LIBBB_MOBJS3=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ3))
 LIBBB_MOBJS4=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ4))
 LIBBB_MOBJS5=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ5))
+LIBBB_MOBJS6=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ6))
 
 libraries-y+=$(LIBBB_DIR)$(LIBBB_AR)
 
 $(LIBBB_DIR)$(LIBBB_AR): $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \
-	$(LIBBB_MOBJS2) $(LIBBB_MOBJS3) $(LIBBB_MOBJS4) $(LIBBB_MOBJS5)
+	$(LIBBB_MOBJS2) $(LIBBB_MOBJS3) $(LIBBB_MOBJS4) $(LIBBB_MOBJS5) \
+	$(LIBBB_MOBJS6)
 	$(AR) $(ARFLAGS) $(@) $(LIBBB_OBJS) $(^)
 
 $(LIBBB_DIR)%.o: $(srcdir)/%.c
@@ -102,3 +107,6 @@
 $(LIBBB_MOBJS5): $(LIBBB_MSRC5)
 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@
 
+$(LIBBB_MOBJS6): $(LIBBB_MSRC6)
+	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@
+

Copied: trunk/busybox/libbb/llist.c (from rev 11690, trunk/busybox/libbb/llist_add_to.c)
===================================================================
--- trunk/busybox/libbb/llist_add_to.c	2005-09-29 11:31:26 UTC (rev 11690)
+++ trunk/busybox/libbb/llist.c	2005-09-29 12:55:10 UTC (rev 11691)
@@ -0,0 +1,43 @@
+#include <stdlib.h>
+#include <string.h>
+#include "unarchive.h"
+#include "libbb.h"
+
+#ifdef L_llist_add_to
+extern llist_t *llist_add_to(llist_t *old_head, char *new_item)
+{
+	llist_t *new_head;
+
+	new_head = xmalloc(sizeof(llist_t));
+	new_head->data = new_item;
+	new_head->link = old_head;
+
+	return (new_head);
+}
+#endif
+
+#ifdef L_llist_add_to_end
+extern llist_t *llist_add_to_end(llist_t *list_head, char *data)
+{
+	llist_t *new_item, *tmp, *prev;
+
+	new_item = xmalloc(sizeof(llist_t));
+	new_item->data = data;
+	new_item->link = NULL;
+
+	prev = NULL;
+	tmp = list_head;
+	while (tmp) {
+		prev = tmp;
+		tmp = tmp->link;
+	}
+	if (prev) {
+		prev->link = new_item;
+	} else {
+		list_head = new_item;
+	}
+
+	return (list_head);
+}
+#endif
+

Deleted: trunk/busybox/libbb/llist_add_to.c
===================================================================
--- trunk/busybox/libbb/llist_add_to.c	2005-09-29 11:31:26 UTC (rev 11690)
+++ trunk/busybox/libbb/llist_add_to.c	2005-09-29 12:55:10 UTC (rev 11691)
@@ -1,15 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include "unarchive.h"
-#include "libbb.h"
-
-extern llist_t *llist_add_to(llist_t *old_head, char *new_item)
-{
-	llist_t *new_head;
-
-	new_head = xmalloc(sizeof(llist_t));
-	new_head->data = new_item;
-	new_head->link = old_head;
-
-	return(new_head);
-}

Modified: trunk/busybox/networking/ifupdown.c
===================================================================
--- trunk/busybox/networking/ifupdown.c	2005-09-29 11:31:26 UTC (rev 11690)
+++ trunk/busybox/networking/ifupdown.c	2005-09-29 12:55:10 UTC (rev 11691)
@@ -67,29 +67,6 @@
 typedef int (execfn)(char *command);
 typedef int (command_set)(struct interface_defn_t *ifd, execfn *e);
 
-extern llist_t *llist_add_to_end(llist_t *list_head, char *data)
-{
-	llist_t *new_item, *tmp, *prev;
-
-	new_item = xmalloc(sizeof(llist_t));
-	new_item->data = data;
-	new_item->link = NULL;
-
-	prev = NULL;
-	tmp = list_head;
-	while(tmp) {
-		prev = tmp;
-		tmp = tmp->link;
-	}
-	if (prev) {
-		prev->link = new_item;
-	} else {
-		list_head = new_item;
-	}
-
-	return(list_head);
-}
-
 struct method_t
 {
 	char *name;




More information about the busybox-cvs mailing list