--- ./slpd/Makefile.in Mon Mar 10 23:24:28 2003 +++ ../openslp-1.0.11/./slpd/Makefile.in Mon Jun 16 11:45:58 2003 @@ -94,8 +94,8 @@ #if you're building on Irix, exchange commented and uncommented lines -#slpd_LDADD = ../common/libcommonslpd.a ../libslpattr/libslpattr.a -slpd_LDADD = ../common/libcommonslpd.la ../libslpattr/libslpattr.la +slpd_LDADD = ../common/libcommonslpd.a ../libslpattr/libslpattr.a +#slpd_LDADD = ../common/libcommonslpd.la ../libslpattr/libslpattr.la mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = PROGRAMS = $(sbin_PROGRAMS) @@ -213,8 +213,8 @@ @ENABLE_PREDICATES_TRUE@@ENABLE_SLPv2_SECURITY_FALSE@@ENABLE_SLPv1_FALSE@slpd_knownda.o \ @ENABLE_PREDICATES_TRUE@@ENABLE_SLPv2_SECURITY_FALSE@@ENABLE_SLPv1_FALSE@slpd_incoming.o \ @ENABLE_PREDICATES_TRUE@@ENABLE_SLPv2_SECURITY_FALSE@@ENABLE_SLPv1_FALSE@slpd_outgoing.o -slpd_DEPENDENCIES = ../common/libcommonslpd.la \ -../libslpattr/libslpattr.la +#slpd_DEPENDENCIES = ../common/libcommonslpd.la ../libslpattr/libslpattr.la +slpd_DEPENDENCIES = ../common/libcommonslpd.a ../libslpattr/libslpattr.a slpd_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) --- ./slpd/slpd_socket.h Wed May 1 11:47:21 2002 +++ ../openslp-1.0.11/./slpd/slpd_socket.h Mon Jun 16 11:45:58 2003 @@ -82,11 +82,11 @@ #define STREAM_WRITE_FIRST 11 + SOCKET_PENDING_IO #define STREAM_WRITE_WAIT 12 + SOCKET_PENDING_IO -#ifdef WIN32 - #define CloseSocket(Arg) closesocket(Arg) -#else - #define CloseSocket(Arg) close(Arg) -#endif +#ifdef WIN32 + #define CloseSocket(Arg) closesocket(Arg) +#else + #define CloseSocket(Arg) close(Arg) +#endif /*=========================================================================*/ typedef struct _SLPDSocket --- ./test/Makefile.in Mon Mar 10 23:24:30 2003 +++ ../openslp-1.0.11/./test/Makefile.in Mon Jun 16 11:45:59 2003 @@ -85,12 +85,12 @@ #if you're building on Irix, exchange commented and uncommented lines -#LDADD = ../libslp/libslp.a ../libslpattr/libslpattr.a -LDADD = ../libslp/libslp.la ../libslpattr/libslpattr.la +LDADD = ../libslp/libslp.la ../libslpattr/libslpattr.a +#LDADD = ../libslp/libslp.la ../libslpattr/libslpattr.la #if you're building on Irix, exchange commented and uncommented lines -#slpd_predicate_test_LDADD = $(LDADD) ../slpd/slpd_predicate.o ../common/libcommonslpd.a -@ENABLE_PREDICATES_TRUE@slpd_predicate_test_LDADD = $(LDADD) ../slpd/slpd_predicate.o ../common/libcommonslpd.la +@ENABLE_PREDICATES_TRUE@slpd_predicate_test_LDADD = $(LDADD) ../slpd/slpd_predicate.o ../common/libcommonslpd.a +#@ENABLE_PREDICATES_TRUE@slpd_predicate_test_LDADD = $(LDADD) ../slpd/slpd_predicate.o ../common/libcommonslpd.la # Automake 1.4 doesn't allow subdirectory dependencies :-(, VPATH is a # kludge to get around that. It's either this or a makefile for each test. @@ -120,56 +120,56 @@ LIBS = @LIBS@ slpdereg_OBJECTS = SLPDereg.o slpdereg_LDADD = $(LDADD) -slpdereg_DEPENDENCIES = ../libslp/libslp.la ../libslpattr/libslpattr.la +slpdereg_DEPENDENCIES = ../libslp/libslp.la ../libslpattr/libslpattr.a slpdereg_LDFLAGS = slpescape_OBJECTS = SLPEscape.o slpescape_LDADD = $(LDADD) slpescape_DEPENDENCIES = ../libslp/libslp.la \ -../libslpattr/libslpattr.la +../libslpattr/libslpattr.a slpescape_LDFLAGS = slpfindattrs_OBJECTS = SLPFindAttrs.o slpfindattrs_LDADD = $(LDADD) slpfindattrs_DEPENDENCIES = ../libslp/libslp.la \ -../libslpattr/libslpattr.la +../libslpattr/libslpattr.a slpfindattrs_LDFLAGS = slpfindsrvtypes_OBJECTS = SLPFindSrvTypes.o slpfindsrvtypes_LDADD = $(LDADD) slpfindsrvtypes_DEPENDENCIES = ../libslp/libslp.la \ -../libslpattr/libslpattr.la +../libslpattr/libslpattr.a slpfindsrvtypes_LDFLAGS = slpfindsrvs_OBJECTS = SLPFindSrvs.o slpfindsrvs_LDADD = $(LDADD) slpfindsrvs_DEPENDENCIES = ../libslp/libslp.la \ -../libslpattr/libslpattr.la +../libslpattr/libslpattr.a slpfindsrvs_LDFLAGS = slpopen_OBJECTS = SLPOpen.o slpopen_LDADD = $(LDADD) -slpopen_DEPENDENCIES = ../libslp/libslp.la ../libslpattr/libslpattr.la +slpopen_DEPENDENCIES = ../libslp/libslp.la ../libslpattr/libslpattr.a slpopen_LDFLAGS = slpparsesrvurl_OBJECTS = SLPParseSrvURL.o slpparsesrvurl_LDADD = $(LDADD) slpparsesrvurl_DEPENDENCIES = ../libslp/libslp.la \ -../libslpattr/libslpattr.la +../libslpattr/libslpattr.a slpparsesrvurl_LDFLAGS = slpreg_OBJECTS = SLPReg.o slpreg_LDADD = $(LDADD) -slpreg_DEPENDENCIES = ../libslp/libslp.la ../libslpattr/libslpattr.la +slpreg_DEPENDENCIES = ../libslp/libslp.la ../libslpattr/libslpattr.a slpreg_LDFLAGS = slpunescape_OBJECTS = SLPUnescape.o slpunescape_LDADD = $(LDADD) slpunescape_DEPENDENCIES = ../libslp/libslp.la \ -../libslpattr/libslpattr.la +../libslpattr/libslpattr.a slpunescape_LDFLAGS = slp_attr_test_OBJECTS = slp_attr_test.o slp_attr_test_LDADD = $(LDADD) slp_attr_test_DEPENDENCIES = ../libslp/libslp.la \ -../libslpattr/libslpattr.la +../libslpattr/libslpattr.a slp_attr_test_LDFLAGS = slpd_predicate_test_OBJECTS = slpd_predicate_test.o @ENABLE_PREDICATES_TRUE@slpd_predicate_test_DEPENDENCIES = \ -@ENABLE_PREDICATES_TRUE@../libslp/libslp.la ../libslpattr/libslpattr.la \ +@ENABLE_PREDICATES_TRUE@../libslp/libslp.la ../libslpattr/libslpattr.a \ @ENABLE_PREDICATES_TRUE@../slpd/slpd_predicate.o \ -@ENABLE_PREDICATES_TRUE@../common/libcommonslpd.la +@ENABLE_PREDICATES_TRUE@../common/libcommonslpd.a slpd_predicate_test_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -333,26 +333,6 @@ fi; \ done $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook -SLPDereg.o: ./SLPDereg/SLPDereg.c ../libslp/slp.h slp_debug.h -SLPEscape.o: ./SLPEscape/SLPEscape.c ../libslp/slp.h slp_debug.h -SLPFindAttrs.o: ./SLPFindAttrs/SLPFindAttrs.c ../libslp/slp.h \ - slp_debug.h -SLPFindSrvTypes.o: ./SLPFindSrvTypes/SLPFindSrvTypes.c ../libslp/slp.h \ - slp_debug.h -SLPFindSrvs.o: ./SLPFindSrvs/SLPFindSrvs.c ../libslp/slp.h slp_debug.h -SLPOpen.o: ./SLPOpen/SLPOpen.c ../libslp/slp.h slp_debug.h -SLPParseSrvURL.o: ./SLPParseSrvURL/SLPParseSrvURL.c ../libslp/slp.h \ - slp_debug.h -SLPReg.o: ./SLPReg/SLPReg.c ../libslp/slp.h slp_debug.h -SLPUnescape.o: ./SLPUnescape/SLPUnescape.c ../libslp/slp.h slp_debug.h -slp_attr_test.o: ./SLP_attr_test/slp_attr_test.c ../libslp/slp.h \ - ../libslpattr/libslpattr.h \ - ../libslpattr/../common/slp_compare.h \ - ../libslpattr/../libslp/slp.h -slpd_predicate_test.o: ./SLPD_predicate_test/slpd_predicate_test.c \ - ../libslpattr/libslpattr.h \ - ../libslpattr/../common/slp_compare.h \ - ../libslpattr/../libslp/slp.h check-TESTS: $(TESTS) @failed=0; all=0; \ --- ./slptool/Makefile.in Mon Mar 10 23:24:29 2003 +++ ../openslp-1.0.11/./slptool/Makefile.in Mon Jun 16 11:45:59 2003 @@ -233,7 +233,6 @@ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done -slptool.o: slptool.c slptool.h ../libslp/slp.h info-am: info: info-am --- ./libslpattr/Makefile.in Mon Mar 10 23:24:27 2003 +++ ../openslp-1.0.11/./libslpattr/Makefile.in Mon Jun 16 11:45:59 2003 @@ -75,8 +75,8 @@ EXTRA_DIST = libslpattr.dsp libslpattr.dsw libslpattr.mak #if you're building on Irix, exchange commented and uncommented lines -#noinst_LTLIBRARIES = libslpattr.a -noinst_LTLIBRARIES = libslpattr.la +noinst_LTLIBRARIES = libslpattr.a +#noinst_LTLIBRARIES = libslpattr.la @ENABLE_PREDICATES_TRUE@PREDICATE_SRCS = libslpattr.c @ENABLE_PREDICATES_FALSE@PREDICATE_SRCS = libslpattr_tiny.c @@ -98,8 +98,9 @@ LIBS = @LIBS@ libslpattr_la_LDFLAGS = libslpattr_la_LIBADD = -@ENABLE_PREDICATES_TRUE@libslpattr_la_OBJECTS = libslpattr.lo -@ENABLE_PREDICATES_FALSE@libslpattr_la_OBJECTS = libslpattr_tiny.lo +@ENABLE_PREDICATES_TRUE@libslpattr_la_OBJECTS = libslpattr.o +@ENABLE_PREDICATES_FALSE@libslpattr_la_OBJECTS = libslpattr_tiny.o +AR = ar CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -166,7 +167,7 @@ $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: - -rm -f *.lo + -rm -f *.lo *.o clean-libtool: -rm -rf .libs _libs @@ -175,8 +176,10 @@ maintainer-clean-libtool: -libslpattr.la: $(libslpattr_la_OBJECTS) $(libslpattr_la_DEPENDENCIES) - $(LINK) $(libslpattr_la_LDFLAGS) $(libslpattr_la_OBJECTS) $(libslpattr_la_LIBADD) $(LIBS) +libslpattr.a: $(libslpattr_la_OBJECTS) $(libslpattr_la_DEPENDENCIES) + -rm -f libslpattr.a + $(AR) cru libslpattr.a $(libslpattr_la_OBJECTS) $(libslpattr_la_LIBADD) + $(RANLIB) libslpattr.a tags: TAGS @@ -222,8 +225,6 @@ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done -libslpattr.lo libslpattr.o : libslpattr.c libslpattr.h \ - ../common/slp_compare.h ../libslp/slp.h libslpattr_internal.h info-am: info: info-am --- ./libslp/Makefile.in Mon Mar 10 23:24:28 2003 +++ ../openslp-1.0.11/./libslp/Makefile.in Mon Jun 16 11:45:59 2003 @@ -88,8 +88,8 @@ #if you're building on Irix, exchange commented and uncommented lines -#libslp_la_LIBADD = -L../common/libcommonlibslp -libslp_la_LIBADD = ../common/libcommonlibslp.la +libslp_la_LIBADD = -L../common -lcommonlibslp +#libslp_la_LIBADD = ../common/libcommonlibslp.la libslp_la_LDFLAGS = -version-info 1:0:0 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -101,7 +101,7 @@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ -libslp_la_DEPENDENCIES = ../common/libcommonlibslp.la +#libslp_la_DEPENDENCIES = ../common/libcommonlibslp.la libslp_la_OBJECTS = libslp_dereg.lo libslp_findscopes.lo libslp_reg.lo \ libslp_findsrvs.lo libslp_parse.lo libslp_property.lo libslp_handle.lo \ libslp_thread.lo libslp_network.lo libslp_findattrs.lo \ @@ -259,84 +259,6 @@ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done -libslp_delattrs.lo libslp_delattrs.o : libslp_delattrs.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_dereg.lo libslp_dereg.o : libslp_dereg.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_findattrs.lo libslp_findattrs.o : libslp_findattrs.c slp.h \ - libslp.h ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_findscopes.lo libslp_findscopes.o : libslp_findscopes.c slp.h \ - libslp.h ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_findsrvs.lo libslp_findsrvs.o : libslp_findsrvs.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_findsrvtypes.lo libslp_findsrvtypes.o : libslp_findsrvtypes.c \ - slp.h libslp.h ../common/slp_buffer.h \ - ../common/slp_linkedlist.h ../common/slp_message.h \ - ../common/slp_property.h ../common/slp_xid.h \ - ../common/slp_network.h ../common/slp_database.h \ - ../common/slp_compare.h ../common/slp_xmalloc.h -libslp_handle.lo libslp_handle.o : libslp_handle.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_knownda.lo libslp_knownda.o : libslp_knownda.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_network.lo libslp_network.o : libslp_network.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_parse.lo libslp_parse.o : libslp_parse.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_property.lo libslp_property.o : libslp_property.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_reg.lo libslp_reg.o : libslp_reg.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h -libslp_thread.lo libslp_thread.o : libslp_thread.c slp.h libslp.h \ - ../common/slp_buffer.h ../common/slp_linkedlist.h \ - ../common/slp_message.h ../common/slp_property.h \ - ../common/slp_xid.h ../common/slp_network.h \ - ../common/slp_database.h ../common/slp_compare.h \ - ../common/slp_xmalloc.h info-am: info: info-am --- ./common/Makefile.in Mon Mar 10 23:24:26 2003 +++ ../openslp-1.0.11/./common/Makefile.in Mon Jun 16 11:45:59 2003 @@ -75,7 +75,7 @@ RANLIB = @RANLIB@ VERSION = @VERSION@ -noinst_LTLIBRARIES = libcommonslpd.la libcommonlibslp.la +noinst_LTLIBRARIES = libcommonslpd.a libcommonlibslp.a EXTRA_DIST = @@ -202,6 +202,7 @@ @ENABLE_SLPv2_SECURITY_TRUE@@ENABLE_SLPv1_TRUE@slp_v1message.lo \ @ENABLE_SLPv2_SECURITY_TRUE@@ENABLE_SLPv1_TRUE@slp_utf8.lo slp_auth.lo \ @ENABLE_SLPv2_SECURITY_TRUE@@ENABLE_SLPv1_TRUE@slp_crypto.lo slp_spi.lo +AR = ar CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -217,7 +218,7 @@ TAR = tar GZIP_ENV = --best SOURCES = $(libcommonslpd_la_SOURCES) $(libcommonlibslp_la_SOURCES) -OBJECTS = $(libcommonslpd_la_OBJECTS) $(libcommonlibslp_la_OBJECTS) +OBJECTS = $(libcommonslpd_la_OBJECTS:.lo=.o) $(libcommonlibslp_la_OBJECTS:.lo=.o) all: all-redirect .SUFFIXES: @@ -268,7 +269,7 @@ $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: - -rm -f *.lo + -rm -f *.lo *.o clean-libtool: -rm -rf .libs _libs @@ -277,11 +278,15 @@ maintainer-clean-libtool: -libcommonslpd.la: $(libcommonslpd_la_OBJECTS) $(libcommonslpd_la_DEPENDENCIES) - $(LINK) $(libcommonslpd_la_LDFLAGS) $(libcommonslpd_la_OBJECTS) $(libcommonslpd_la_LIBADD) $(LIBS) - -libcommonlibslp.la: $(libcommonlibslp_la_OBJECTS) $(libcommonlibslp_la_DEPENDENCIES) - $(LINK) $(libcommonlibslp_la_LDFLAGS) $(libcommonlibslp_la_OBJECTS) $(libcommonlibslp_la_LIBADD) $(LIBS) +libcommonslpd.a: $(libcommonslpd_la_OBJECTS) $(libcommonslpd_la_DEPENDENCIES) + -rm -f libcommonslpd.a + $(AR) cru libcommonslpd.a $(libcommonslpd_la_OBJECTS) $(libcommonslpd_la_LIBADD) + $(RANLIB) libcommonslpd.a + +libcommonlibslp.a: $(libcommonlibslp_la_OBJECTS) $(libcommonlibslp_la_DEPENDENCIES) + -rm -f libcommonlibslp.a + $(AR) cru libcommonlibslp.a $(libcommonlibslp_la_OBJECTS) $(libcommonlibslp_la_LIBADD) + $(RANLIB) libcommonlibslp.a tags: TAGS --- ./common/slp_linkedlist.c Fri Feb 9 18:14:35 2001 +++ ../openslp-1.0.11/./common/slp_linkedlist.c Mon Jun 16 11:45:59 2003 @@ -1,148 +1,148 @@ -/***************************************************************************/ -/* */ -/* Project: OpenSLP */ -/* */ -/* File: linkedlist.c */ -/* */ -/* Abstract: Functions to manipulate a simple linked list */ -/* */ -/*-------------------------------------------------------------------------*/ -/* */ -/* Please submit patches to http://www.openslp.org */ -/* */ -/*-------------------------------------------------------------------------*/ -/* */ -/* Copyright (C) 2000 Caldera Systems, Inc */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright */ -/* notice, this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in */ -/* the documentation and/or other materials provided with the */ -/* distribution. */ -/* */ -/* Neither the name of Caldera Systems nor the names of its */ -/* contributors may be used to endorse or promote products derived */ -/* from this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ -/* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ -/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/***************************************************************************/ - -#include "slp_linkedlist.h" - -/*=========================================================================*/ -SLPListItem* SLPListUnlink(SLPList* list, SLPListItem* item) -/* Unlinks the specified item from the specified list. */ -/* */ -/* list (IN) pointer to the list to unlink the item from */ -/* */ -/* item (IN) item to be removed from the list */ -/* */ -/* Returns pointer to the unlinked item */ -/*=========================================================================*/ -{ - if(item->previous) - { - item->previous->next = item->next; - } - - if(item->next) - { - item->next->previous = item->previous; - } - - if(item == list->head) - { - list->head = item->next; - } - - if(item == list->tail) - { - list->tail = item->previous; - } - - list->count = list->count - 1; - return item; -} - - -/*=========================================================================*/ -SLPListItem* SLPListLinkHead(SLPList* list, SLPListItem* item) -/* Links the specified item to the head of the specified list. */ -/* */ -/* list (IN) pointer to the list to link to */ -/* */ -/* item (IN) item to be linkedto the list */ -/* */ -/* Returns pointer to the linked item */ -/*=========================================================================*/ -{ - item->previous = 0; - item->next = list->head; - - if(list->head) - { - list->head->previous = item; - } - - list->head = item; - - if(list->tail == 0) - { - list->tail = item; - } - - list->count = list->count + 1; - - return item; -} - - -/*=========================================================================*/ -SLPListItem* SLPListLinkTail(SLPList* list, SLPListItem* item) -/* Links the specified item to the tail of the specified list. */ -/* */ -/* list (IN) pointer to the list to link to */ -/* */ -/* item (IN) item to be linkedto the list */ -/* */ -/* Returns pointer to the linked item */ -/*=========================================================================*/ -{ - item->previous = list->tail; - item->next = 0; - - if(list->tail) - { - list->tail->next = item; - } - - list->tail = item; - - if(list->head == 0) - { - list->head = item; - } - - list->count = list->count + 1; - - return item; -} - +/***************************************************************************/ +/* */ +/* Project: OpenSLP */ +/* */ +/* File: linkedlist.c */ +/* */ +/* Abstract: Functions to manipulate a simple linked list */ +/* */ +/*-------------------------------------------------------------------------*/ +/* */ +/* Please submit patches to http://www.openslp.org */ +/* */ +/*-------------------------------------------------------------------------*/ +/* */ +/* Copyright (C) 2000 Caldera Systems, Inc */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are */ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the */ +/* distribution. */ +/* */ +/* Neither the name of Caldera Systems nor the names of its */ +/* contributors may be used to endorse or promote products derived */ +/* from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ +/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ +/* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ +/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ +/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ +/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ +/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ +/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/***************************************************************************/ + +#include "slp_linkedlist.h" + +/*=========================================================================*/ +SLPListItem* SLPListUnlink(SLPList* list, SLPListItem* item) +/* Unlinks the specified item from the specified list. */ +/* */ +/* list (IN) pointer to the list to unlink the item from */ +/* */ +/* item (IN) item to be removed from the list */ +/* */ +/* Returns pointer to the unlinked item */ +/*=========================================================================*/ +{ + if(item->previous) + { + item->previous->next = item->next; + } + + if(item->next) + { + item->next->previous = item->previous; + } + + if(item == list->head) + { + list->head = item->next; + } + + if(item == list->tail) + { + list->tail = item->previous; + } + + list->count = list->count - 1; + return item; +} + + +/*=========================================================================*/ +SLPListItem* SLPListLinkHead(SLPList* list, SLPListItem* item) +/* Links the specified item to the head of the specified list. */ +/* */ +/* list (IN) pointer to the list to link to */ +/* */ +/* item (IN) item to be linkedto the list */ +/* */ +/* Returns pointer to the linked item */ +/*=========================================================================*/ +{ + item->previous = 0; + item->next = list->head; + + if(list->head) + { + list->head->previous = item; + } + + list->head = item; + + if(list->tail == 0) + { + list->tail = item; + } + + list->count = list->count + 1; + + return item; +} + + +/*=========================================================================*/ +SLPListItem* SLPListLinkTail(SLPList* list, SLPListItem* item) +/* Links the specified item to the tail of the specified list. */ +/* */ +/* list (IN) pointer to the list to link to */ +/* */ +/* item (IN) item to be linkedto the list */ +/* */ +/* Returns pointer to the linked item */ +/*=========================================================================*/ +{ + item->previous = list->tail; + item->next = 0; + + if(list->tail) + { + list->tail->next = item; + } + + list->tail = item; + + if(list->head == 0) + { + list->head = item; + } + + list->count = list->count + 1; + + return item; +} +