Compare commits

..

28 Commits

Author SHA1 Message Date
Marcelo Roberto Jimenez
18ff422de9 Forgot to tag the last release.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/tags/release-1.4.2@144 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-03-06 10:20:56 +00:00
Marcelo Roberto Jimenez
aec58e6c9e Merge of trunk.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@133 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-13 13:53:24 +00:00
Marcelo Roberto Jimenez
4bcb9dd5e1 Merge of trunk into branch-1.4.x.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@130 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-13 01:40:10 +00:00
Marcelo Roberto Jimenez
8cfa0e488c Merge of trunk into branch-1.4.x.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@127 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-03 19:30:31 +00:00
Marcelo Roberto Jimenez
9e775e662e Changelog update and webpage update.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@111 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 23:32:05 +00:00
Marcelo Roberto Jimenez
03400550cd Merge of rev. 109.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@110 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 22:44:01 +00:00
Marcelo Roberto Jimenez
62a5d7c5ef Changelog update.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@108 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 21:37:20 +00:00
Marcelo Roberto Jimenez
df80fbae36 Merge of rev.105.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@106 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 21:31:17 +00:00
Marcelo Roberto Jimenez
9c6ea48583 Merge of rev.103.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@104 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 21:06:48 +00:00
Marcelo Roberto Jimenez
8da593fae3 Changelog update.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@102 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 20:38:00 +00:00
Marcelo Roberto Jimenez
b4816a33a9 Merge of rev.99.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@100 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 20:07:06 +00:00
Marcelo Roberto Jimenez
1b029e80af Merge of rev.97.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@98 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 19:57:16 +00:00
Oxy
907b103439 workaround for Linux-applications that do not catch SIGPIPE backported
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@76 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-07 05:49:19 +00:00
Oxy
ecd755d3f8 workaround added for applications that don't catch SIGEPIPE
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@75 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-04 05:46:06 +00:00
Marcelo Roberto Jimenez
b8cac59dd9 Merge of r61, r62, r63, r64.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@65 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-20 11:51:17 +00:00
Marcelo Roberto Jimenez
591e0d3e25 Merge of r58.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@59 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-20 02:48:14 +00:00
Oxy
bd3bf7ad0a email addresses modified to hide them from spambots (in SVNWeb)
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@57 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-18 06:39:45 +00:00
Marcelo Roberto Jimenez
374ff706fd Merge of r54.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@55 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-11 00:53:31 +00:00
Marcelo Roberto Jimenez
44564d16f8 Merge of r52.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@53 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-09 20:03:54 +00:00
Marcelo Roberto Jimenez
c0a5ccc174 Merge of r50.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@51 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-08 13:22:19 +00:00
Marcelo Roberto Jimenez
522dee807f Merging trunk to branch 1.4.x
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@49 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-08 12:38:45 +00:00
Marcelo Roberto Jimenez
062d62bbc4 Merge of r33.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@34 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 12:29:33 +00:00
Marcelo Roberto Jimenez
ca1d800b96 Applying current development branch to 1.4.x stable branch.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@32 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 02:52:46 +00:00
Marcelo Roberto Jimenez
bd8ea3ac77 Applying current development branch to 1.4.x stable branch.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@31 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 02:50:21 +00:00
Marcelo Roberto Jimenez
191814ec13 Applying current development branch to 1.4.x stable branch.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@30 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 02:49:47 +00:00
Marcelo Roberto Jimenez
854cc93854 Better naming for stable branch.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@11 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-06 16:43:09 +00:00
Marcelo Roberto Jimenez
6a0f25b290 Merge of 6.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/release-1.4.0@7 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-06 16:37:29 +00:00
Marcelo Roberto Jimenez
ed0a4d2222 Stable branch for release 1.4.0.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/release-1.4.0@5 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-06 16:30:33 +00:00
172 changed files with 30236 additions and 44857 deletions

1272
ChangeLog

File diff suppressed because it is too large Load Diff

1257
Doxyfile

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,4 @@
# $Id: Makefile.am,v 1.5 2006/04/29 20:12:50 r3mi Exp $
# #
# Top-level "Makefile.am" for libupnp # Top-level "Makefile.am" for libupnp
# #
@@ -8,15 +9,10 @@ ACLOCAL_AMFLAGS = -I m4
DISTCHECK_CONFIGURE_FLAGS = --enable-debug --enable-samples DISTCHECK_CONFIGURE_FLAGS = --enable-debug --enable-samples
SUBDIRS = \ SUBDIRS = ixml threadutil upnp docs/dist
ixml \
threadutil \
upnp \
docs/dist
EXTRA_DIST = \ EXTRA_DIST = \
Doxyfile \
libupnp.pc.in \ libupnp.pc.in \
LICENSE \ LICENSE \
THANKS \ THANKS \
@@ -27,23 +23,7 @@ EXTRA_DIST = \
build/libupnp.dsw \ build/libupnp.dsw \
build/inc/autoconfig.h \ build/inc/autoconfig.h \
build/inc/config.h \ build/inc/config.h \
build/inc/upnpconfig.h \ build/inc/upnpconfig.h
build/msvc/inttypes.h \
build/msvc/stdint.h \
build/vc8/ixml.vcproj \
build/vc8/libupnp.sln \
build/vc8/libupnp.vcproj \
build/vc8/threadutil.vcproj \
build/vc8/tvcombo.vcproj \
build/vc8/tvctrlpt.vcproj \
build/vc8/tvdevice.vcproj \
build/vc9/ixml.vcproj \
build/vc9/libupnp.sln \
build/vc9/libupnp.vcproj \
build/vc9/threadutil.vcproj \
build/vc9/tvcombo.vcproj \
build/vc9/tvctrlpt.vcproj \
build/vc9/tvdevice.vcproj
# This variable must have 'exec' in its name, in order to be installed # This variable must have 'exec' in its name, in order to be installed
@@ -51,12 +31,11 @@ EXTRA_DIST = \
pkgconfigexecdir = $(libdir)/pkgconfig pkgconfigexecdir = $(libdir)/pkgconfig
pkgconfigexec_DATA = libupnp.pc pkgconfigexec_DATA = libupnp.pc
$(pkgconfigexec_DATA): config.status $(pkgconfigexec_DATA): config.status
if WITH_DOCUMENTATION if WITH_DOCUMENTATION
doc_DATA = LICENSE README NEWS TODO THANKS doc_DATA = LICENSE README NEWS TODO THANKS
endif endif

38
THANKS
View File

@@ -6,53 +6,23 @@ suggesting various improvements or submitting actual code.
Here is a list of these people. Help us keep it complete and Here is a list of these people. Help us keep it complete and
exempt of errors. exempt of errors.
- Alex (afaucher)
- Andre Sodermans (wienerschnitzel)
- Anthony Viallard (homer242)
- Apostolos Syropoulos
- Arno Willig - Arno Willig
- Bob Ciora
- Carlo Parata
- Chaos - Chaos
- Charles Nepveu (cnepveu)
- Chris Pickel
- Chuck Thomason (cyt4)
- Craig Nelson
- David Blanchet
- David Maass - David Maass
- Emil Ljungdahl
- Erik Johansson - Erik Johansson
- Eric Tanguy - Eric Tanguy
- Erwan Velu - Erwan Velu
- Eugene Christensen
- Fabrice Fontaine
- Fredrik Svensson - Fredrik Svensson
- Glen Masgai
- Hartmut Holzgraefe - hholzgra
- Ingo Hofmann
- Jiri Zouhar - Jiri Zouhar
- John Dennis - John Dennis
- Jonathan Casiot (no_dice) - Jonathan (no_dice)
- Josh Carroll
- Keith Brindley
- Leuk_He - Leuk_He
- Loigu - Loigu
- Luke Kim (nereusuj) - Marcelo Roberto Jimenez
- Marcelo Roberto Jimenez (mroberto)
- Markus Strobl - Markus Strobl
- Nektarios K. Papadopoulos (npapadop) - Nektarios K. Papadopoulos
- Nicholas Kraft
- Nick Leverton (leveret)
- Oskar Liljeblad - Oskar Liljeblad
- Michael (oxygenic) - Michael (Oxy)
- Paul Vixie - Paul Vixie
- Peter Hartley
- Rene Hexel
- Robert Gingher (robsbox)
- Ronan Menard
- Siva Chandran - Siva Chandran
- Stéphane Corthésy
- Steve Bresson
- Timothy Redaelli
- Titus Winters

11
TODO
View File

@@ -18,13 +18,12 @@ http://sourceforge.net/tracker/?group_id=7189&atid=307189
- make API clean for large files and 64 bits - make API clean for large files and 64 bits
- Why is NUM_HANDLE defined to 200 when we can register only:
A) One client(1)
B) An IPv4 and IPv6 device (2)
NUM_HANDLE should be 3
- A sane way to implement the virtual directory callback initialization and checking To Be Decided
against NULL pointers. =============
- IPV6 support ?

View File

@@ -13,3 +13,7 @@ autoreconf --force --install -Wall -Wno-obsolete $* || exit 1
echo "Now run ./configure and then make." echo "Now run ./configure and then make."
exit 0 exit 0

View File

@@ -1,4 +1,4 @@
/* autoconfig.h. Generated from autoconfig.h.in by configure. */ /* autoconfig.h. Generated by configure. */
/* autoconfig.h.in. Generated from configure.ac by autoheader. */ /* autoconfig.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 to compile debug code */ /* Define to 1 to compile debug code */
@@ -19,18 +19,15 @@
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1 #define HAVE_FSEEKO 1
/* Define to 1 if you have the `ftime' function. */
#define HAVE_FTIME 1
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `compat' library (-lcompat). */
/* #undef HAVE_LIBCOMPAT */
/* Define to 1 if you have the <limits.h> header file. */ /* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1 #define HAVE_LIMITS_H 1
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1 #define HAVE_MEMORY_H 1
@@ -82,14 +79,11 @@
/* Define to 1 if you have the `vprintf' function. */ /* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1 #define HAVE_VPRINTF 1
/* Define to 1 if you have the <ws2tcpip.h> header file. */
/* #undef HAVE_WS2TCPIP_H */
/* Define to 1 to prevent compilation of assert() */ /* Define to 1 to prevent compilation of assert() */
/* #undef NDEBUG */ #define NDEBUG 1
/* Define to 1 to prevent some debug code */ /* Define to 1 to prevent some debug code */
/* #undef NO_DEBUG */ #define NO_DEBUG 1
/* Define to 1 if your C compiler doesn't accept -c and -o together. */ /* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */ /* #undef NO_MINUS_C_MINUS_O */
@@ -98,19 +92,19 @@
#define PACKAGE "libupnp" #define PACKAGE "libupnp"
/* Define to the address where bug reports for this package should be sent. */ /* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "mroberto@users.sourceforge.net" #define PACKAGE_BUGREPORT "virtual_worlds@gmx.de"
/* Define to the full name of this package. */ /* Define to the full name of this package. */
#define PACKAGE_NAME "libupnp" #define PACKAGE_NAME "libupnp"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "libupnp 1.8.0" #define PACKAGE_STRING "libupnp 1.4.0"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libupnp" #define PACKAGE_TARNAME "libupnp"
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "1.8.0" #define PACKAGE_VERSION "1.4.0"
/* Define to necessary symbol if this constant uses a non-standard name on /* Define to necessary symbol if this constant uses a non-standard name on
your system. */ your system. */
@@ -123,7 +117,7 @@
#define UPNP_HAVE_CLIENT 1 #define UPNP_HAVE_CLIENT 1
/* see upnpconfig.h */ /* see upnpconfig.h */
#define UPNP_HAVE_DEBUG 1 /* #undef UPNP_HAVE_DEBUG */
/* see upnpconfig.h */ /* see upnpconfig.h */
#define UPNP_HAVE_DEVICE 1 #define UPNP_HAVE_DEVICE 1
@@ -134,41 +128,35 @@
/* see upnpconfig.h */ /* see upnpconfig.h */
#define UPNP_HAVE_WEBSERVER 1 #define UPNP_HAVE_WEBSERVER 1
/* Do not use pthread_rwlock_t */
#define UPNP_USE_RWLOCK 1
/* see upnpconfig.h */ /* see upnpconfig.h */
#define UPNP_VERSION_MAJOR 1 #define UPNP_VERSION_MAJOR 1
/* see upnpconfig.h */ /* see upnpconfig.h */
#define UPNP_VERSION_MINOR 8 #define UPNP_VERSION_MINOR 4
/* see upnpconfig.h */ /* see upnpconfig.h */
#define UPNP_VERSION_PATCH 0 #define UPNP_VERSION_PATCH 0
/* see upnpconfig.h */ /* see upnpconfig.h */
#define UPNP_VERSION_STRING "1.8.0" #define UPNP_VERSION_STRING "1.4.0"
/* Version number of package */ /* Version number of package */
#define VERSION "1.8.0" #define VERSION "1.4.0"
/* File Offset size */ /* Number of bits in a file offset, on hosts where this is settable. */
#define _FILE_OFFSET_BITS 64 #define _FILE_OFFSET_BITS 64
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
/* #undef _LARGEFILE_SOURCE */ /* #undef _LARGEFILE_SOURCE */
/* Large files support */ /* Define for large files, on AIX-style hosts. */
#define _LARGE_FILE_SOURCE /* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */ /* #undef const */
/* Define to `long int' if <sys/types.h> does not define. */ /* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */ /* #undef size_t */
/* Type for storing the length of struct sockaddr */ /* Substitute for socklen_t */
/* #undef socklen_t */ /* #undef socklen_t */

View File

@@ -1,183 +1,138 @@
/************************************************************************** ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
**************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef INTERNAL_CONFIG_H #ifndef INTERNAL_CONFIG_H
#define INTERNAL_CONFIG_H #define INTERNAL_CONFIG_H
#include "autoconfig.h" #include "autoconfig.h"
#define MAX_JOBS_TOTAL 10
/*! /** @name Compile time configuration options
* \name Compile time configuration options
*
* The Linux SDK for UPnP Devices contains some compile-time parameters * The Linux SDK for UPnP Devices contains some compile-time parameters
* that effect the behavior of the SDK. All configuration options are * that effect the behavior of the SDK. All configuration options are
* located in {\tt src/inc/config.h}. * located in {\tt src/inc/config.h}.
*
* @{
*/ */
//@{
/** @name THREAD_IDLE_TIME
/*!
* \name THREAD_IDLE_TIME
*
* The {\tt THREAD_IDLE_TIME} constant determines when a thread will be * The {\tt THREAD_IDLE_TIME} constant determines when a thread will be
* removed from the thread pool and returned to the operating system. When * removed from the thread pool and returned to the operating system. When
* a thread in the thread pool has been idle for this number of milliseconds * a thread in the thread pool has been idle for this number of milliseconds
* the thread will be released from the thread pool. The default value is * the thread will be released from the thread pool. The default value is
* 5000 milliseconds (5 seconds). * 5000 milliseconds (5 seconds).
*
* @{
*/ */
//@{
#define THREAD_IDLE_TIME 5000 #define THREAD_IDLE_TIME 5000
/* @} */ //@}
/** @name JOBS_PER_THREAD
/*! * The {\tt JOBS_PER_THREAD} constant determines when a new thread will be
* \name JOBS_PER_THREAD * allocated to the thread pool inside the SDK. The thread pool will
* * try and maintain this jobs/thread ratio. When the jobs/thread ratio
* The {\tt JOBS_PER_THREAD} constant determines when a new thread will be * becomes greater than this, then a new thread (up to the max) will be
* allocated to the thread pool inside the SDK. The thread pool will * allocated to the thread pool. The default ratio is 10 jobs/thread.
* try and maintain this jobs/thread ratio. When the jobs/thread ratio
* becomes greater than this, then a new thread (up to the max) will be
* allocated to the thread pool. The default ratio is 10 jobs/thread.
*
* @{
*/ */
//@{
#define JOBS_PER_THREAD 10 #define JOBS_PER_THREAD 10
/* @} */ //@}
/** @name MIN_THREADS
/*! * The {\tt MIN_THREADS} constant defines the minimum number of threads the
* \name MIN_THREADS * thread pool inside the SDK will create. The thread pool will
* * always have this number of threads. These threads are used
* The {\tt MIN_THREADS} constant defines the minimum number of threads the * for both callbacks into applications built on top of the SDK and also
* thread pool inside the SDK will create. The thread pool will * for making connections to other control points and devices. This number
* always have this number of threads. These threads are used * includes persistent threads. The default value is two threads.
* for both callbacks into applications built on top of the SDK and also
* for making connections to other control points and devices. This number
* includes persistent threads. The default value is two threads.
*
* @{
*/ */
//@{
#define MIN_THREADS 2 #define MIN_THREADS 2
/* @} */ //@}
/** @name MAX_THREADS
/*! * The {\tt MAX_THREADS} constant defines the maximum number of threads the
* \name MAX_THREADS * thread pool inside the SDK will create. These threads are used
* * for both callbacks into applications built on top of the library and also
* The {\tt MAX_THREADS} constant defines the maximum number of threads the * for making connections to other control points and devices. It is not
* thread pool inside the SDK will create. These threads are used * recommended that this value be below 10, since the threads are
* for both callbacks into applications built on top of the library and also * necessary for correct operation. This value can be increased for greater
* for making connections to other control points and devices. It is not * performance in operation at the expense of greater memory overhead. The
* recommended that this value be below 10, since the threads are * default value is 12.
* necessary for correct operation. This value can be increased for greater
* performance in operation at the expense of greater memory overhead. The
* default value is 12.
*
* @{
*/ */
//@{
#define MAX_THREADS 12 #define MAX_THREADS 12
/* @} */ //@}
/** @name DEFAULT_SOAP_CONTENT_LENGTH
/*! \name MAX_JOBS_TOTAL
*
* The {\tt MAX_JOBS_TOTAL} constant determines the maximum number of jobs
* that can be queued. If this limit is reached further jobs will be thrown
* to avoid memory exhaustion. The default value 100.
* (Added by Axis.)
*
* @{
*/
#define MAX_JOBS_TOTAL 100
/* @} */
/*!
* \name DEFAULT_SOAP_CONTENT_LENGTH
*
* SOAP messages will read at most {\tt DEFAULT_SOAP_CONTENT_LENGTH} bytes. * SOAP messages will read at most {\tt DEFAULT_SOAP_CONTENT_LENGTH} bytes.
* This prevents devices that have a misbehaving web server to send * This prevents devices that have a misbehaving web server to send
* a large amount of data to the control point causing it to crash. * a large amount of data to the control point causing it to crash.
* This can be adjusted dynamically with {\tt UpnpSetMaxContentLength}. * This can be adjusted dynamically with {\tt UpnpSetMaxContentLength}.
*
* @{
*/ */
//@{
#define DEFAULT_SOAP_CONTENT_LENGTH 16000 #define DEFAULT_SOAP_CONTENT_LENGTH 16000
/* @} */ //@}
/** @name NUM_SSDP_COPY
/*!
* \name NUM_SSDP_COPY
*
* This configuration parameter determines how many copies of each SSDP * This configuration parameter determines how many copies of each SSDP
* advertisement and search packets will be sent. By default it will send two * advertisement and search packets will be sent. By default it will send two
* copies of every packet. * copies of every packet.
*
* @{
*/ */
//@{
#define NUM_SSDP_COPY 2 #define NUM_SSDP_COPY 2
/* @} */ //@}
/** @name SSDP_PAUSE
/*!
* \name SSDP_PAUSE
*
* This configuration parameter determines the pause between identical SSDP * This configuration parameter determines the pause between identical SSDP
* advertisement and search packets. The pause is measured in milliseconds * advertisement and search packets. The pause is measured in milliseconds
* and defaults to 100. * and defaults to 100.
*
* @{
*/ */
//@{
#define SSDP_PAUSE 100 #define SSDP_PAUSE 100
/* @} */ //@}
/*! /** @name WEB_SERVER_BUF_SIZE
* \name WEB_SERVER_BUF_SIZE
*
* This configuration parameter sets the maximum buffer size for the * This configuration parameter sets the maximum buffer size for the
* webserver. The default value is 1MB. * webserver. The default value is 1MB.
*
* @{
*/ */
//@{
#define WEB_SERVER_BUF_SIZE (1024*1024) #define WEB_SERVER_BUF_SIZE (1024*1024)
/* @} */ //@}
/*! /** @name AUTO_RENEW_TIME
* \name AUTO_RENEW_TIME
*
* The {\tt AUTO_RENEW_TIME} is the time, in seconds, before a subscription * The {\tt AUTO_RENEW_TIME} is the time, in seconds, before a subscription
* expires that the SDK automatically resubscribes. The default * expires that the SDK automatically resubscribes. The default
* value is 10 seconds. Setting this value too low can result in the * value is 10 seconds. Setting this value too low can result in the
@@ -185,104 +140,89 @@
* subscription to timeout. In order to avoid continually resubscribing * subscription to timeout. In order to avoid continually resubscribing
* the minimum subscription time is five seconds more than the auto renew * the minimum subscription time is five seconds more than the auto renew
* time. * time.
*
* @{
*/ */
#define AUTO_RENEW_TIME 10
/* @} */
/*! //@{
* \name CP_MINIMUM_SUBSCRIPTION_TIME #define AUTO_RENEW_TIME 10
* //@}
/** @name CP_MINIMUM_SUBSCRIPTION_TIME
* The {\tt CP_MINIMUM_SUBSCRIPTION_TIME} is the minimum subscription time * The {\tt CP_MINIMUM_SUBSCRIPTION_TIME} is the minimum subscription time
* allowed for a control point using the SDK. Subscribing for less than * allowed for a control point using the SDK. Subscribing for less than
* this time automatically results in a subscription for this amount. The * this time automatically results in a subscription for this amount. The
* default value is 5 seconds more than the {\tt AUTO_RENEW_TIME}, or 15 * default value is 5 seconds more than the {\tt AUTO_RENEW_TIME}, or 15
* seconds. * seconds.
*
* @{
*/ */
//@{
#define CP_MINIMUM_SUBSCRIPTION_TIME (AUTO_RENEW_TIME + 5) #define CP_MINIMUM_SUBSCRIPTION_TIME (AUTO_RENEW_TIME + 5)
/* @} */ //@}
/** @name MAX_SEARCH_TIME
/*!
* \name MAX_SEARCH_TIME
*
* The {\tt MAX_SEARCH_TIME} is the maximum time * The {\tt MAX_SEARCH_TIME} is the maximum time
* allowed for an SSDP search by a control point. Searching for greater than * allowed for an SSDP search by a control point. Searching for greater than
* this time automatically results in a search for this amount. The default * this time automatically results in a search for this amount. The default
* value is 80 seconds. * value is 80 seconds.
*
* @{
*/ */
//@{
#define MAX_SEARCH_TIME 80 #define MAX_SEARCH_TIME 80
/* @} */ //@}
/** @name MIN_SEARCH_TIME
/*!
* \name MIN_SEARCH_TIME
*
* The {\tt MIN_SEARCH_TIME} is the minimumm time * The {\tt MIN_SEARCH_TIME} is the minimumm time
* allowed for an SSDP search by a control point. Searching for less than * allowed for an SSDP search by a control point. Searching for less than
* this time automatically results in a search for this amount. The default * this time automatically results in a search for this amount. The default
* value is 2 seconds. * value is 2 seconds.
*
* @{
*/ */
//@{
#define MIN_SEARCH_TIME 2 #define MIN_SEARCH_TIME 2
/* @} */ //@}
/*! /** @name AUTO_ADVERTISEMENT_TIME
* \name AUTO_ADVERTISEMENT_TIME * The {\tt AUTO_ADVERTISEMENT_TIME} is the time, in seconds, before an
* * device advertisements expires before a renewed advertisement is sent.
* The {\tt AUTO_ADVERTISEMENT_TIME} is the time, in seconds, before an * The default time is 30 seconds.
* device advertisements expires before a renewed advertisement is sent.
* The default time is 30 seconds.
*
* @{
*/ */
//@{
#define AUTO_ADVERTISEMENT_TIME 30 #define AUTO_ADVERTISEMENT_TIME 30
/* @} */ //@}
/** @name SSDP_PACKET_DISTRIBUTE
/*! * The {\tt SSDP_PACKET_DISTRIBUTE} enables the SSDP packets to be sent
* \name SSDP_PACKET_DISTRIBUTE * at an interval equal to half of the expiration time of SSDP packets
* * minus the AUTO_ADVERTISEMENT_TIME. This is used to increase
* The {\tt SSDP_PACKET_DISTRIBUTE} enables the SSDP packets to be sent * the probability of SSDP packets reaching to control points.
* at an interval equal to half of the expiration time of SSDP packets * It is recommended that this flag be turned on for embedded wireless
* minus the AUTO_ADVERTISEMENT_TIME. This is used to increase * devices.
* the probability of SSDP packets reaching to control points.
* It is recommended that this flag be turned on for embedded wireless
* devices.
*
* @{
*/ */
//@{
#define SSDP_PACKET_DISTRIBUTE 1 #define SSDP_PACKET_DISTRIBUTE 1
/* @} */ //@}
/** @name Module Exclusion
/*! * Depending on the requirements, the user can selectively discard any of
* \name Module Exclusion * the major modules like SOAP, GENA, SSDP or the Internal web server. By
* default everything is included inside the SDK. By setting any of
* the values below to 0, that component will not be included in the final
* SDK.
* \begin{itemize}
* \item {\tt EXCLUDE_SOAP[0,1]}
* \item {\tt EXCLUDE_GENA[0,1]}
* \item {\tt EXCLUDE_SSDP[0,1]}
* \item {\tt EXCLUDE_DOM [0,1]}
* \item {\tt EXCLUDE_MINISERVER[0,1]}
* \item {\tt EXCLUDE_WEB_SERVER[0,1]}
* \item {\tt EXCLUDE_JNI[0,1]}
* \end{itemize}
* *
* Depending on the requirements, the user can selectively discard any of
* the major modules like SOAP, GENA, SSDP or the Internal web server. By
* default everything is included inside the SDK. By setting any of
* the values below to 0, that component will not be included in the final
* SDK.
* \begin{itemize}
* \item {\tt EXCLUDE_SOAP[0,1]}
* \item {\tt EXCLUDE_GENA[0,1]}
* \item {\tt EXCLUDE_SSDP[0,1]}
* \item {\tt EXCLUDE_DOM [0,1]}
* \item {\tt EXCLUDE_MINISERVER[0,1]}
* \item {\tt EXCLUDE_WEB_SERVER[0,1]}
* \item {\tt EXCLUDE_JNI[0,1]}
* \end{itemize}
*
* @{
*/ */
//@{
#define EXCLUDE_SSDP 0 #define EXCLUDE_SSDP 0
#define EXCLUDE_SOAP 0 #define EXCLUDE_SOAP 0
#define EXCLUDE_GENA 0 #define EXCLUDE_GENA 0
@@ -294,118 +234,128 @@
#else #else
# define EXCLUDE_JNI 1 # define EXCLUDE_JNI 1
#endif #endif
/* @} */ //@}
/*! /** @name DEBUG_TARGET
* \name DEBUG_TARGET * The user has the option to redirect the library output debug messages
* * to either the screen or to a log file. All the output messages with
* The user has the option to redirect the library output debug messages * debug level 0 will go to {\tt upnp.err} and messages with debug level
* to either the screen or to a log file. All the output messages with * greater than zero will be redirected to {\tt upnp.out}.
* debug level 0 will go to {\tt upnp.err} and messages with debug level
* greater than zero will be redirected to {\tt upnp.out}.
*
* @{
*/ */
//@{
#define DEBUG_TARGET 1 #define DEBUG_TARGET 1
/* @} */ //@}
/*! /** @name Other debugging features
* \name Other debugging features The UPnP SDK contains other features to aid in debugging:
* see <upnp/upnpdebug.h>
* The UPnP SDK contains other features to aid in debugging:
* see <upnp/inc/upnpdebug.h>
*/ */
#define DEBUG_ALL 1 #define DEBUG_ALL 1
#define DEBUG_SSDP 0 #define DEBUG_SSDP 0
#define DEBUG_SOAP 0 #define DEBUG_SOAP 0
#define DEBUG_GENA 0 #define DEBUG_GENA 0
#define DEBUG_TPOOL 0 #define DEBUG_TPOOL 0
#define DEBUG_MSERV 0 #define DEBUG_MSERV 0
#define DEBUG_DOM 0 #define DEBUG_DOM 0
#define DEBUG_HTTP 0 #define DEBUG_HTTP 0
#define DEBUG_API 0 #define DEBUG_API 0
//@} // Compile time configuration options
/*
* @} Compile time configuration options
*/
/*************************************************************************** /***************************************************************************
* Do not change, Internal purpose only!!! * Do not change, Internal purpose only!!!
***************************************************************************/ ***************************************************************************/
/*! //@{
* @{
*/
/* /*
* Set additional defines based on requested configuration * Set additional defines based on requested configuration
*/ */
// configure --enable-client
/* configure --enable-client */
#if UPNP_HAVE_CLIENT #if UPNP_HAVE_CLIENT
# define INCLUDE_CLIENT_APIS 1 # define INCLUDE_CLIENT_APIS 1
#endif #endif
// configure --enable-device
/* configure --enable-device */
#if UPNP_HAVE_DEVICE #if UPNP_HAVE_DEVICE
# define INCLUDE_DEVICE_APIS 1 # define INCLUDE_DEVICE_APIS 1
#endif #endif
// configure --enable-webserver --enable-device
/* configure --enable-webserver --enable-device */
#if UPNP_HAVE_WEBSERVER #if UPNP_HAVE_WEBSERVER
# define INTERNAL_WEB_SERVER 1 # define INTERNAL_WEB_SERVER 1
#endif #endif
/** @name DBGONLY
The {\bf DBGONLY} macro allows code to be marked so that it
is only included in the DEBUG build and not the release. To
use this macro, put the code inside of the parentheses:
{\tt DBGONLY(int i;)}
This will cause a declaration of the integer {\tt i} only
in the debug build.
*/
//@{
#ifdef DEBUG
#define DBGONLY(x) x
#else
#define DBGONLY(x)
#endif
//@}
#undef EXCLUDE_WEB_SERVER #undef EXCLUDE_WEB_SERVER
#undef EXCLUDE_MINISERVER #undef EXCLUDE_MINISERVER
#ifdef INTERNAL_WEB_SERVER #ifdef INTERNAL_WEB_SERVER
# define EXCLUDE_WEB_SERVER 0 #define EXCLUDE_WEB_SERVER 0
# define EXCLUDE_MINISERVER 0 #define EXCLUDE_MINISERVER 0
#else #else
# define EXCLUDE_WEB_SERVER 1 #define EXCLUDE_WEB_SERVER 1
# define EXCLUDE_MINISERVER 1 #define EXCLUDE_MINISERVER 1
#endif #endif
#if EXCLUDE_GENA == 1 && EXCLUDE_SOAP == 1 && EXCLUDE_WEB_SERVER == 1 #if EXCLUDE_GENA == 1 && EXCLUDE_SOAP == 1 && EXCLUDE_WEB_SERVER == 1
# undef EXCLUDE_MINISERVER #undef EXCLUDE_MINISERVER
# define EXCLUDE_MINISERVER 1 #define EXCLUDE_MINISERVER 1
# if INTERNAL_WEB_SERVER #if INTERNAL_WEB_SERVER
# error "conflicting settings: use configure --disable-webserver" # error "conflicting settings: use configure --disable-webserver"
# endif #endif
#endif #endif
#if EXCLUDE_GENA == 0 || EXCLUDE_SOAP == 0 || EXCLUDE_WEB_SERVER == 0 #if EXCLUDE_GENA == 0 || EXCLUDE_SOAP == 0 || EXCLUDE_WEB_SERVER == 0
# undef EXCLUDE_MINISERVER #undef EXCLUDE_MINISERVER
# define EXCLUDE_MINISERVER 0 #define EXCLUDE_MINISERVER 0
# if EXCLUDE_WEB_SERVER == 0 && !defined INTERNAL_WEB_SERVER #if EXCLUDE_WEB_SERVER == 0 && !defined INTERNAL_WEB_SERVER
# error "conflicting settings : use configure --enable-webserver" #error "conflicting settings : use configure --enable-webserver"
# endif #endif
#endif #endif
#ifdef INCLUDE_CLIENT_APIS #ifdef INCLUDE_CLIENT_APIS
# define CLIENTONLY(x) x #define CLIENTONLY(x) x
#else /* INCLUDE_CLIENT_APIS */ #else
# define CLIENTONLY(x) #define CLIENTONLY(x)
#endif /* INCLUDE_CLIENT_APIS */ #endif
#ifdef INCLUDE_DEVICE_APIS
#define DEVICEONLY(x) x
#else
#define DEVICEONLY(x)
#endif
//@}
#endif
/*
* @}
*/
#endif /* INTERNAL_CONFIG_H */

View File

@@ -1,52 +1,52 @@
/* upnp/inc/upnpconfig.h. Generated from upnpconfig.h.in by configure. */ /* upnp/inc/upnpconfig.h. Generated by configure. */
/* -*- C -*- */ // -*- C -*-
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net> // Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* * Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef UPNP_CONFIG_H #ifndef UPNP_CONFIG_H
#define UPNP_CONFIG_H #define UPNP_CONFIG_H
/*************************************************************************** /***************************************************************************
* Library version * Library version
***************************************************************************/ ***************************************************************************/
/** The library version (string) e.g. "1.3.0" */ /** The library version (string) e.g. "1.3.0" */
#define UPNP_VERSION_STRING "1.8.0" #define UPNP_VERSION_STRING "1.4.0"
/** Major version of the library */ /** Major version of the library */
#define UPNP_VERSION_MAJOR 1 #define UPNP_VERSION_MAJOR 1
/** Minor version of the library */ /** Minor version of the library */
#define UPNP_VERSION_MINOR 8 #define UPNP_VERSION_MINOR 4
/** Patch version of the library */ /** Patch version of the library */
#define UPNP_VERSION_PATCH 0 #define UPNP_VERSION_PATCH 0
@@ -59,25 +59,25 @@
/*************************************************************************** /***************************************************************************
* Library optional features * Library optional features
***************************************************************************/ ***************************************************************************/
/* /*
* The following defines can be tested in order to know which * The following defines can be tested in order to know which
* optional features have been included in the installed library. * optional features have been included in the installed library.
*/ */
/** Defined to 1 if the library has been compiled with DEBUG enabled /** Defined to 1 if the library has been compiled with DEBUG enabled
* (i.e. configure --enable-debug) : <upnp/upnpdebug.h> file is available */ * (i.e. configure --enable-debug) : <upnp/upnpdebug.h> file is available */
#define UPNP_HAVE_DEBUG 1 #undef UPNP_HAVE_DEBUG
/** Defined to 1 if the library has been compiled with client API enabled /** Defined to 1 if the library has been compiled with client API enabled
* (i.e. configure --enable-client) */ * (i.e. configure --enable-client) */
#define UPNP_HAVE_CLIENT 1 #define UPNP_HAVE_CLIENT 1
/** Defined to 1 if the library has been compiled with device API enabled /** Defined to 1 if the library has been compiled with device API enabled
* (i.e. configure --enable-device) */ * (i.e. configure --enable-device) */
#define UPNP_HAVE_DEVICE 1 #define UPNP_HAVE_DEVICE 1
@@ -92,5 +92,6 @@
#define UPNP_HAVE_TOOLS 1 #define UPNP_HAVE_TOOLS 1
#endif /* UPNP_CONFIG_H */ #endif // UPNP_CONFIG_H

View File

@@ -45,7 +45,7 @@
<DEBUGLIBPATH value="$(BCB)\lib\debug"/> <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/> <RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="tlink32"/> <LINKER value="tlink32"/>
<USERDEFINES value="WIN32;LIBUPNP_EXPORTS;UPNP_USE_BCBPP"/> <USERDEFINES value="WIN32;LIBUPNP_EXPORTS"/>
<SYSDEFINES value="NO_STRICT;_NO_VCL"/> <SYSDEFINES value="NO_STRICT;_NO_VCL"/>
<MAINSOURCE value="libupnp.bpf"/> <MAINSOURCE value="libupnp.bpf"/>
<INCLUDEPATH value="..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc;..\..\pthreads-w32-1-10-0-release"/> <INCLUDEPATH value="..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc;..\..\pthreads-w32-1-10-0-release"/>
@@ -100,21 +100,19 @@ Item1=..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig
Item2=..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc Item2=..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc
[HistoryLists\hlLibraryPath] [HistoryLists\hlLibraryPath]
Count=3 Count=2
Item0=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib;..\..\pthreads-w32-1-10-0-release Item0=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib;D:\DEVELOP\pthreads-w32-1-10-0-release
Item1=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib;D:\DEVELOP\pthreads-w32-1-10-0-release Item1=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib
Item2=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath] [HistoryLists\hlDebugSourcePath]
Count=1 Count=1
Item0=$(BCB)\source\vcl Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals] [HistoryLists\hlConditionals]
Count=4 Count=3
Item0=WIN32;LIBUPNP_EXPORTS;UPNP_USE_BCBPP Item0=WIN32;LIBUPNP_EXPORTS
Item1=WIN32;LIBUPNP_EXPORTS Item1=WIN32;EXPORT_SPEC
Item2=WIN32;EXPORT_SPEC Item2=WIN32
Item3=WIN32
[Debugging] [Debugging]
DebugSourceDirs=$(BCB)\source\vcl DebugSourceDirs=$(BCB)\source\vcl

View File

@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /c # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /D "PTW32_STATIC_LIB" /D "UPNP_STATIC_LIB" /D "UPNP_USE_MSVCPP" /FR /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I ".\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /D "PTW32_STATIC_LIB" /D "UPNP_STATIC_LIB" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /machine:I386
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "libupnp - Win32 Debug" !ELSEIF "$(CFG)" == "libupnp - Win32 Debug"
@@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /GZ /c # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I "..\build\inc" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /D "UPNP_USE_MSVCPP" /FR /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I "..\build\inc" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD BASE RSC /l 0x407 /d "_DEBUG"
@@ -80,7 +80,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
!ENDIF !ENDIF

View File

@@ -1,301 +0,0 @@
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. 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.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_INTTYPES_H_ // [
#define _MSC_INTTYPES_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include <stdint.h>
// 7.8 Format conversion of integer types
typedef struct {
intmax_t quot;
intmax_t rem;
} imaxdiv_t;
// 7.8.1 Macros for format specifiers
// The fprintf macros for signed integers are:
#define PRId8 "d"
#define PRIi8 "i"
#define PRIdLEAST8 "d"
#define PRIiLEAST8 "i"
#define PRIdFAST8 "d"
#define PRIiFAST8 "i"
#define PRId16 "hd"
#define PRIi16 "hi"
#define PRIdLEAST16 "hd"
#define PRIiLEAST16 "hi"
#define PRIdFAST16 "hd"
#define PRIiFAST16 "hi"
#define PRId32 "I32d"
#define PRIi32 "I32i"
#define PRIdLEAST32 "I32d"
#define PRIiLEAST32 "I32i"
#define PRIdFAST32 "I32d"
#define PRIiFAST32 "I32i"
#define PRId64 "I64d"
#define PRIi64 "I64i"
#define PRIdLEAST64 "I64d"
#define PRIiLEAST64 "I64i"
#define PRIdFAST64 "I64d"
#define PRIiFAST64 "I64i"
#define PRIdMAX "I64d"
#define PRIiMAX "I64i"
#define PRIdPTR "Id"
#define PRIiPTR "Ii"
// The fprintf macros for unsigned integers are:
#define PRIo8 "o"
#define PRIu8 "u"
#define PRIx8 "x"
#define PRIX8 "X"
#define PRIoLEAST8 "o"
#define PRIuLEAST8 "u"
#define PRIxLEAST8 "x"
#define PRIXLEAST8 "X"
#define PRIoFAST8 "o"
#define PRIuFAST8 "u"
#define PRIxFAST8 "x"
#define PRIXFAST8 "X"
#define PRIo16 "ho"
#define PRIu16 "hu"
#define PRIx16 "hx"
#define PRIX16 "hX"
#define PRIoLEAST16 "ho"
#define PRIuLEAST16 "hu"
#define PRIxLEAST16 "hx"
#define PRIXLEAST16 "hX"
#define PRIoFAST16 "ho"
#define PRIuFAST16 "hu"
#define PRIxFAST16 "hx"
#define PRIXFAST16 "hX"
#define PRIo32 "I32o"
#define PRIu32 "I32u"
#define PRIx32 "I32x"
#define PRIX32 "I32X"
#define PRIoLEAST32 "I32o"
#define PRIuLEAST32 "I32u"
#define PRIxLEAST32 "I32x"
#define PRIXLEAST32 "I32X"
#define PRIoFAST32 "I32o"
#define PRIuFAST32 "I32u"
#define PRIxFAST32 "I32x"
#define PRIXFAST32 "I32X"
#define PRIo64 "I64o"
#define PRIu64 "I64u"
#define PRIx64 "I64x"
#define PRIX64 "I64X"
#define PRIoLEAST64 "I64o"
#define PRIuLEAST64 "I64u"
#define PRIxLEAST64 "I64x"
#define PRIXLEAST64 "I64X"
#define PRIoFAST64 "I64o"
#define PRIuFAST64 "I64u"
#define PRIxFAST64 "I64x"
#define PRIXFAST64 "I64X"
#define PRIoMAX "I64o"
#define PRIuMAX "I64u"
#define PRIxMAX "I64x"
#define PRIXMAX "I64X"
#define PRIoPTR "Io"
#define PRIuPTR "Iu"
#define PRIxPTR "Ix"
#define PRIXPTR "IX"
// The fscanf macros for signed integers are:
#define SCNd8 "d"
#define SCNi8 "i"
#define SCNdLEAST8 "d"
#define SCNiLEAST8 "i"
#define SCNdFAST8 "d"
#define SCNiFAST8 "i"
#define SCNd16 "hd"
#define SCNi16 "hi"
#define SCNdLEAST16 "hd"
#define SCNiLEAST16 "hi"
#define SCNdFAST16 "hd"
#define SCNiFAST16 "hi"
#define SCNd32 "ld"
#define SCNi32 "li"
#define SCNdLEAST32 "ld"
#define SCNiLEAST32 "li"
#define SCNdFAST32 "ld"
#define SCNiFAST32 "li"
#define SCNd64 "I64d"
#define SCNi64 "I64i"
#define SCNdLEAST64 "I64d"
#define SCNiLEAST64 "I64i"
#define SCNdFAST64 "I64d"
#define SCNiFAST64 "I64i"
#define SCNdMAX "I64d"
#define SCNiMAX "I64i"
#ifdef _WIN64 // [
# define SCNdPTR "I64d"
# define SCNiPTR "I64i"
#else // _WIN64 ][
# define SCNdPTR "ld"
# define SCNiPTR "li"
#endif // _WIN64 ]
// The fscanf macros for unsigned integers are:
#define SCNo8 "o"
#define SCNu8 "u"
#define SCNx8 "x"
#define SCNX8 "X"
#define SCNoLEAST8 "o"
#define SCNuLEAST8 "u"
#define SCNxLEAST8 "x"
#define SCNXLEAST8 "X"
#define SCNoFAST8 "o"
#define SCNuFAST8 "u"
#define SCNxFAST8 "x"
#define SCNXFAST8 "X"
#define SCNo16 "ho"
#define SCNu16 "hu"
#define SCNx16 "hx"
#define SCNX16 "hX"
#define SCNoLEAST16 "ho"
#define SCNuLEAST16 "hu"
#define SCNxLEAST16 "hx"
#define SCNXLEAST16 "hX"
#define SCNoFAST16 "ho"
#define SCNuFAST16 "hu"
#define SCNxFAST16 "hx"
#define SCNXFAST16 "hX"
#define SCNo32 "lo"
#define SCNu32 "lu"
#define SCNx32 "lx"
#define SCNX32 "lX"
#define SCNoLEAST32 "lo"
#define SCNuLEAST32 "lu"
#define SCNxLEAST32 "lx"
#define SCNXLEAST32 "lX"
#define SCNoFAST32 "lo"
#define SCNuFAST32 "lu"
#define SCNxFAST32 "lx"
#define SCNXFAST32 "lX"
#define SCNo64 "I64o"
#define SCNu64 "I64u"
#define SCNx64 "I64x"
#define SCNX64 "I64X"
#define SCNoLEAST64 "I64o"
#define SCNuLEAST64 "I64u"
#define SCNxLEAST64 "I64x"
#define SCNXLEAST64 "I64X"
#define SCNoFAST64 "I64o"
#define SCNuFAST64 "I64u"
#define SCNxFAST64 "I64x"
#define SCNXFAST64 "I64X"
#define SCNoMAX "I64o"
#define SCNuMAX "I64u"
#define SCNxMAX "I64x"
#define SCNXMAX "I64X"
#ifdef _WIN64 // [
# define SCNoPTR "I64o"
# define SCNuPTR "I64u"
# define SCNxPTR "I64x"
# define SCNXPTR "I64X"
#else // _WIN64 ][
# define SCNoPTR "lo"
# define SCNuPTR "lu"
# define SCNxPTR "lx"
# define SCNXPTR "lX"
#endif // _WIN64 ]
// 7.8.2 Functions for greatest-width integer types
// 7.8.2.1 The imaxabs function
#define imaxabs _abs64
// 7.8.2.2 The imaxdiv function
// This is modified version of div() function from Microsoft's div.c found
// in %MSVC.NET%\crt\src\div.c
#ifdef STATIC_IMAXDIV // [
static
#else // STATIC_IMAXDIV ][
_inline
#endif // STATIC_IMAXDIV ]
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
{
imaxdiv_t result;
result.quot = numer / denom;
result.rem = numer % denom;
if (numer < 0 && result.rem > 0) {
// did division wrong; must fix up
++result.quot;
result.rem -= denom;
}
return result;
}
// 7.8.2.3 The strtoimax and strtoumax functions
#define strtoimax _strtoi64
#define strtoumax _strtoui64
// 7.8.2.4 The wcstoimax and wcstoumax functions
#define wcstoimax _wcstoi64
#define wcstoumax _wcstoui64
#endif // _MSC_INTTYPES_H_ ]

View File

@@ -1,222 +0,0 @@
// ISO C9x compliant stdint.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. 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.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_STDINT_H_ // [
#define _MSC_STDINT_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include <limits.h>
// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'
// or compiler give many errors like this:
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
#if (_MSC_VER < 1300) && defined(__cplusplus)
extern "C++" {
#endif
# include <wchar.h>
#if (_MSC_VER < 1300) && defined(__cplusplus)
}
#endif
// 7.18.1 Integer types
// 7.18.1.1 Exact-width integer types
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
// 7.18.1.2 Minimum-width integer types
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
// 7.18.1.3 Fastest minimum-width integer types
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [
typedef __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][
typedef int intptr_t;
typedef unsigned int uintptr_t;
#endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
// 7.18.2 Limits of specified-width integer types
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
// 7.18.2.1 Limits of exact-width integer types
#define INT8_MIN ((int8_t)_I8_MIN)
#define INT8_MAX _I8_MAX
#define INT16_MIN ((int16_t)_I16_MIN)
#define INT16_MAX _I16_MAX
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
#define UINT8_MAX _UI8_MAX
#define UINT16_MAX _UI16_MAX
#define UINT32_MAX _UI32_MAX
#define UINT64_MAX _UI64_MAX
// 7.18.2.2 Limits of minimum-width integer types
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
// 7.18.2.3 Limits of fastest minimum-width integer types
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
// 7.18.2.4 Limits of integer types capable of holding object pointers
#ifdef _WIN64 // [
# define INTPTR_MIN INT64_MIN
# define INTPTR_MAX INT64_MAX
# define UINTPTR_MAX UINT64_MAX
#else // _WIN64 ][
# define INTPTR_MIN INT32_MIN
# define INTPTR_MAX INT32_MAX
# define UINTPTR_MAX UINT32_MAX
#endif // _WIN64 ]
// 7.18.2.5 Limits of greatest-width integer types
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
// 7.18.3 Limits of other integer types
#ifdef _WIN64 // [
# define PTRDIFF_MIN _I64_MIN
# define PTRDIFF_MAX _I64_MAX
#else // _WIN64 ][
# define PTRDIFF_MIN _I32_MIN
# define PTRDIFF_MAX _I32_MAX
#endif // _WIN64 ]
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
#ifndef SIZE_MAX // [
# ifdef _WIN64 // [
# define SIZE_MAX _UI64_MAX
# else // _WIN64 ][
# define SIZE_MAX _UI32_MAX
# endif // _WIN64 ]
#endif // SIZE_MAX ]
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
#ifndef WCHAR_MIN // [
# define WCHAR_MIN 0
#endif // WCHAR_MIN ]
#ifndef WCHAR_MAX // [
# define WCHAR_MAX _UI16_MAX
#endif // WCHAR_MAX ]
#define WINT_MIN 0
#define WINT_MAX _UI16_MAX
#endif // __STDC_LIMIT_MACROS ]
// 7.18.4 Limits of other integer types
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
// 7.18.4.1 Macros for minimum-width integer constants
#define INT8_C(val) val##i8
#define INT16_C(val) val##i16
#define INT32_C(val) val##i32
#define INT64_C(val) val##i64
#define UINT8_C(val) val##ui8
#define UINT16_C(val) val##ui16
#define UINT32_C(val) val##ui32
#define UINT64_C(val) val##ui64
// 7.18.4.2 Macros for greatest-width integer constants
#define INTMAX_C INT64_C
#define UINTMAX_C UINT64_C
#endif // __STDC_CONSTANT_MACROS ]
#endif // _MSC_STDINT_H_ ]

View File

@@ -1,217 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="ixml"
ProjectGUID="{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}"
RootNamespace="ixml"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
UseOfMFC="0"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\ixml\inc;..\..\ixml\src\inc;..\inc"
PreprocessorDefinitions="WIN32;IXML_INLINE="
RuntimeLibrary="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\ixml\src\attr.c"
>
</File>
<File
RelativePath="..\..\ixml\src\document.c"
>
</File>
<File
RelativePath="..\..\ixml\src\element.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixml.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmldebug.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlmembuf.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlparser.c"
>
</File>
<File
RelativePath="..\..\ixml\src\namedNodeMap.c"
>
</File>
<File
RelativePath="..\..\ixml\src\node.c"
>
</File>
<File
RelativePath="..\..\ixml\src\nodeList.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\ixml\inc\ixml.h"
>
</File>
<File
RelativePath="..\..\ixml\inc\ixmldebug.h"
>
</File>
<File
RelativePath="..\..\ixml\src\inc\ixmlmembuf.h"
>
</File>
<File
RelativePath="..\..\ixml\src\inc\ixmlparser.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,65 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libupnp", "libupnp.vcproj", "{6227F51A-1498-4C4A-B213-F6FDED605125}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadutil", "threadutil.vcproj", "{24884928-0501-4CF2-BC8A-180AFC23B2AF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ixml", "ixml.vcproj", "{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvdevice", "tvdevice.vcproj", "{F592B023-E1F3-4A1E-841E-662DEE497435}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
{24884928-0501-4CF2-BC8A-180AFC23B2AF} = {24884928-0501-4CF2-BC8A-180AFC23B2AF}
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} = {AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvctrlpt", "tvctrlpt.vcproj", "{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}"
ProjectSection(ProjectDependencies) = postProject
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} = {AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}
{24884928-0501-4CF2-BC8A-180AFC23B2AF} = {24884928-0501-4CF2-BC8A-180AFC23B2AF}
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvcombo", "tvcombo.vcproj", "{B5D74697-F615-4DCB-AA8B-935F6372F01C}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
{24884928-0501-4CF2-BC8A-180AFC23B2AF} = {24884928-0501-4CF2-BC8A-180AFC23B2AF}
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} = {AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.ActiveCfg = Debug|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.Build.0 = Debug|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.ActiveCfg = Release|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.Build.0 = Release|Win32
{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Debug|Win32.ActiveCfg = Debug|Win32
{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Debug|Win32.Build.0 = Debug|Win32
{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Release|Win32.ActiveCfg = Release|Win32
{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Release|Win32.Build.0 = Release|Win32
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Debug|Win32.ActiveCfg = Debug|Win32
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Debug|Win32.Build.0 = Debug|Win32
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Release|Win32.ActiveCfg = Release|Win32
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Release|Win32.Build.0 = Release|Win32
{F592B023-E1F3-4A1E-841E-662DEE497435}.Debug|Win32.ActiveCfg = Debug|Win32
{F592B023-E1F3-4A1E-841E-662DEE497435}.Debug|Win32.Build.0 = Debug|Win32
{F592B023-E1F3-4A1E-841E-662DEE497435}.Release|Win32.ActiveCfg = Release|Win32
{F592B023-E1F3-4A1E-841E-662DEE497435}.Release|Win32.Build.0 = Release|Win32
{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Debug|Win32.ActiveCfg = Debug|Win32
{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Debug|Win32.Build.0 = Debug|Win32
{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Release|Win32.ActiveCfg = Release|Win32
{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Release|Win32.Build.0 = Release|Win32
{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Debug|Win32.ActiveCfg = Debug|Win32
{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Debug|Win32.Build.0 = Debug|Win32
{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Release|Win32.ActiveCfg = Release|Win32
{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,654 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="libupnp"
ProjectGUID="{6227F51A-1498-4C4A-B213-F6FDED605125}"
RootNamespace="libupnp"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/libupnp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\pthreads\include;..\..\ixml\src\inc;..\..\ixml\inc;..\..\threadutil\inc;..\..\upnp\inc;..\..\upnp\src\inc;..\inc;..\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_SECURE_NO_WARNINGS"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/libupnp.pch"
AssemblerListingLocation="$(OutDir)\"
ObjectFile="$(OutDir)\"
ProgramDataBaseFileName="$(OutDir)\"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib iphlpapi.lib"
OutputFile="$(OutDir)\libupnp.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/libupnp.pdb"
ImportLibrary=".\Release/libupnp.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Release/libupnp.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/libupnp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\pthreads\include;..\..\ixml\src\inc;..\..\ixml\inc;..\..\threadutil\inc;..\..\upnp\inc;..\..\upnp\src\inc;..\inc;..\msvc"
PreprocessorDefinitions="DEBUG;WIN32;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
PrecompiledHeaderFile="$(OutDir)\libupnp.pch"
AssemblerListingLocation="$(OutDir)\"
ObjectFile="$(OutDir)\"
ProgramDataBaseFileName="$(OutDir)\"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib iphlpapi.lib ixml.lib"
OutputFile="$(OutDir)\libupnp.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(OutDir)\..\ixml"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\libupnp.pdb"
ImportLibrary="$(OutDir)\libupnp.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(OutDir)\libupnp.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="sources"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\upnp\src\api\ActionComplete.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\ActionRequest.c"
>
</File>
<File
RelativePath="..\..\ixml\src\attr.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\client_table\client_table.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\Discovery.c"
>
</File>
<File
RelativePath="..\..\ixml\src\document.c"
>
</File>
<File
RelativePath="..\..\ixml\src\element.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\Event.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\EventSubscribe.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\FileInfo.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\FreeList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_callback2.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\httpparser.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\httpreadwrite.c"
>
</File>
<File
RelativePath="..\..\upnp\src\inet_pton.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixml.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlmembuf.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlparser.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\LinkedList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\md5.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\membuffer.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\miniserver\miniserver.c"
>
</File>
<File
RelativePath="..\..\ixml\src\namedNodeMap.c"
>
</File>
<File
RelativePath="..\..\ixml\src\node.c"
>
</File>
<File
RelativePath="..\..\ixml\src\nodeList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\parsetools.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\service_table\service_table.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_common.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\sock.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_ResultData.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_server.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\statcodes.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\StateVarComplete.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\StateVarRequest.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\strintmap.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\SubscriptionRequest.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\sysdep.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\ThreadPool.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\TimerThread.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\upnp_timeout.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnpapi.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnpdebug.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\UpnpString.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnptools.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\uri\uri.c"
>
</File>
<File
RelativePath="..\..\upnp\src\urlconfig\urlconfig.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\util.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\uuid.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\webserver.c"
>
</File>
<File
RelativePath="..\..\upnp\src\win_dll.c"
>
</File>
</Filter>
<Filter
Name="headers"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\upnp\inc\ActionComplete.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\actionrequest.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\client_table.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\config.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\discovery.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\Event.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\EventSubscribe.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\FileInfo.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena_ctrlpt.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena_device.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\global.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gmtdate.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\http_client.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\httpparser.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\httpreadwrite.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\inet_pton.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\md5.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\membuffer.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\miniserver.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\netall.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\parsetools.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\server.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\service_table.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\soaplib.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\sock.h"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_ResultData.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\ssdplib.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\statcodes.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\StateVarComplete.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\statevarrequest.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\statuscodes.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\strintmap.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\SubscriptionRequest.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\sysdep.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\unixutil.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\upnp.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnp_timeout.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnpapi.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnpclosesocket.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\upnpdebug.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\UpnpString.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\upnptools.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\uri.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\urlconfig.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\util.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\utilall.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\uuid.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\webserver.h"
>
</File>
</Filter>
<File
RelativePath="..\..\..\..\libupnp_win32.patch"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,213 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="threadutil"
ProjectGUID="{24884928-0501-4CF2-BC8A-180AFC23B2AF}"
RootNamespace="threadutil"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\threadutil\inc;..\..\upnp\inc;..\..\ixml\inc;..\..\pthreads\include"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="pthreadVC2.lib"
AdditionalLibraryDirectories="..\..\pthreads\lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\threadutil\src\FreeList.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\LinkedList.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\ThreadPool.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\TimerThread.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\threadutil\inc\FreeList.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\ithread.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\LinkedList.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\ThreadPool.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\TimerThread.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,216 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="tvcombo"
ProjectGUID="{B5D74697-F615-4DCB-AA8B-935F6372F01C}"
RootNamespace="tvcombo"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvcombo;..\..\upnp\sample\tvcombo\linux"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;out.vc8.$(ConfigurationName)\ixml&quot;;&quot;out.vc8.$(ConfigurationName)\threadutil&quot;;&quot;out.vc8.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\linux\upnp_tv_combo_main.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,208 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="tvctrlpt"
ProjectGUID="{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}"
RootNamespace="tvctrlpt"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvctrlpt;..\..\upnp\sample\tvctrlpt\linux"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;out.vc8.$(ConfigurationName)\ixml&quot;;&quot;out.vc8.$(ConfigurationName)\threadutil&quot;;&quot;out.vc8.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\linux\upnp_tv_ctrlpt_main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,208 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="tvdevice"
ProjectGUID="{F592B023-E1F3-4A1E-841E-662DEE497435}"
RootNamespace="tvdevice"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvdevice;..\..\upnp\sample\tvdevice\linux"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;out.vc8.$(ConfigurationName)\ixml&quot;;&quot;out.vc8.$(ConfigurationName)\threadutil&quot;;&quot;out.vc8.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\linux\upnp_tv_device_main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,216 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ixml"
ProjectGUID="{9C2C266D-35A3-465F-A297-0E21D54E5C89}"
RootNamespace="ixml"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc"
PreprocessorDefinitions="DEBUG;WIN32;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\..\ixml\inc;..\..\ixml\src\inc;..\inc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\ixml\src\attr.c"
>
</File>
<File
RelativePath="..\..\ixml\src\document.c"
>
</File>
<File
RelativePath="..\..\ixml\src\element.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixml.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmldebug.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlmembuf.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlparser.c"
>
</File>
<File
RelativePath="..\..\ixml\src\namedNodeMap.c"
>
</File>
<File
RelativePath="..\..\ixml\src\node.c"
>
</File>
<File
RelativePath="..\..\ixml\src\nodeList.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\ixml\inc\ixml.h"
>
</File>
<File
RelativePath="..\..\ixml\inc\ixmldebug.h"
>
</File>
<File
RelativePath="..\..\ixml\src\inc\ixmlmembuf.h"
>
</File>
<File
RelativePath="..\..\ixml\src\inc\ixmlparser.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,63 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libupnp", "libupnp.vcproj", "{6227F51A-1498-4C4A-B213-F6FDED605125}"
ProjectSection(ProjectDependencies) = postProject
{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89}
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} = {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ixml", "ixml.vcproj", "{9C2C266D-35A3-465F-A297-0E21D54E5C89}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadutil", "threadutil.vcproj", "{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvctrlpt", "tvctrlpt.vcproj", "{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvdevice", "tvdevice.vcproj", "{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvcombo", "tvcombo.vcproj", "{6365804B-22C6-4D5E-91F3-0C052EB55B4F}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.ActiveCfg = Debug|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.Build.0 = Debug|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.ActiveCfg = Release|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.Build.0 = Release|Win32
{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.ActiveCfg = Debug|Win32
{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.Build.0 = Debug|Win32
{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.ActiveCfg = Release|Win32
{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.Build.0 = Release|Win32
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|Win32.ActiveCfg = Debug|Win32
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|Win32.Build.0 = Debug|Win32
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|Win32.ActiveCfg = Release|Win32
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|Win32.Build.0 = Release|Win32
{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Debug|Win32.ActiveCfg = Debug|Win32
{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Debug|Win32.Build.0 = Debug|Win32
{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Release|Win32.ActiveCfg = Release|Win32
{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Release|Win32.Build.0 = Release|Win32
{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Debug|Win32.ActiveCfg = Debug|Win32
{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Debug|Win32.Build.0 = Debug|Win32
{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Release|Win32.ActiveCfg = Release|Win32
{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Release|Win32.Build.0 = Release|Win32
{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Debug|Win32.ActiveCfg = Debug|Win32
{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Debug|Win32.Build.0 = Debug|Win32
{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Release|Win32.ActiveCfg = Release|Win32
{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,650 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="libupnp"
ProjectGUID="{6227F51A-1498-4C4A-B213-F6FDED605125}"
RootNamespace="libupnp"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/libupnp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\pthreads\include,..\ixml\src\inc,..\ixml\inc,..\threadutil\inc,..\upnp\inc,..\upnp\src\inc,.\inc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_SECURE_NO_WARNINGS"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/libupnp.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib iphlpapi.lib"
OutputFile=".\Release/libupnp.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/libupnp.pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=".\Release/libupnp.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Release/libupnp.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/libupnp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\pthreads\include;..\..\ixml\src\inc;..\..\ixml\inc;..\..\threadutil\inc;..\..\upnp\inc;..\..\upnp\src\inc;..\inc;..\msvc"
PreprocessorDefinitions="DEBUG;WIN32;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile="$(OutDir)\libupnp.pch"
AssemblerListingLocation="$(OutDir)\"
ObjectFile="$(OutDir)\"
ProgramDataBaseFileName="$(OutDir)\"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib iphlpapi.lib $(TargetDir)..\ixml\ixml.lib"
OutputFile="$(OutDir)\libupnp.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\libupnp.pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)\libupnp.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(OutDir)\libupnp.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="sources"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\upnp\src\api\ActionComplete.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\ActionRequest.c"
>
</File>
<File
RelativePath="..\..\ixml\src\attr.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\client_table\client_table.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\Discovery.c"
>
</File>
<File
RelativePath="..\..\ixml\src\document.c"
>
</File>
<File
RelativePath="..\..\ixml\src\element.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\Event.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\EventSubscribe.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\FileInfo.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\FreeList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_callback2.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\httpparser.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\httpreadwrite.c"
>
</File>
<File
RelativePath="..\..\upnp\src\inet_pton.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixml.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlmembuf.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlparser.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\LinkedList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\md5.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\membuffer.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\miniserver\miniserver.c"
>
</File>
<File
RelativePath="..\..\ixml\src\namedNodeMap.c"
>
</File>
<File
RelativePath="..\..\ixml\src\node.c"
>
</File>
<File
RelativePath="..\..\ixml\src\nodeList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\parsetools.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\service_table\service_table.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_common.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\sock.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_ResultData.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_server.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\statcodes.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\StateVarComplete.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\StateVarRequest.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\strintmap.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\SubscriptionRequest.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\sysdep.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\ThreadPool.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\TimerThread.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\upnp_timeout.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnpapi.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnpdebug.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\UpnpString.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnptools.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\uri\uri.c"
>
</File>
<File
RelativePath="..\..\upnp\src\urlconfig\urlconfig.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\util.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\uuid.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\webserver.c"
>
</File>
<File
RelativePath="..\..\upnp\src\win_dll.c"
>
</File>
</Filter>
<Filter
Name="headers"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\upnp\inc\ActionComplete.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\ActionRequest.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\client_table.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\config.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\Discovery.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\Event.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\EventSubscribe.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\FileInfo.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena_ctrlpt.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena_device.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\global.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gmtdate.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\http_client.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\httpparser.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\httpreadwrite.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\inet_pton.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\md5.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\membuffer.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\miniserver.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\netall.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\parsetools.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\server.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\service_table.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\soaplib.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\sock.h"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_ResultData.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\ssdplib.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\statcodes.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\StateVarComplete.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\StateVarRequest.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\statuscodes.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\strintmap.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\SubscriptionRequest.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\sysdep.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\unixutil.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\upnp.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnp_timeout.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnpapi.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnpclosesocket.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\upnpdebug.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\UpnpString.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\upnptools.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\uri.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\urlconfig.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\util.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\utilall.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\uuid.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\webserver.h"
>
</File>
</Filter>
<File
RelativePath="..\..\..\..\libupnp_win32.patch"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,216 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="threadutil"
ProjectGUID="{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}"
RootNamespace="threadutil"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\threadutil\inc;..\..\upnp\inc;..\..\ixml\inc;..\..\pthreads\include"
PreprocessorDefinitions="DEBUG;WIN32;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="pthreadVC2.lib"
AdditionalLibraryDirectories="..\..\pthreads\lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\..\threadutil\inc;..\..\upnp\inc;..\..\ixml\inc;..\..\pthreads\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\threadutil\src\FreeList.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\LinkedList.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\ThreadPool.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\TimerThread.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\threadutil\inc\FreeList.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\ithread.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\LinkedList.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\threadpool.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\TimerThread.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,214 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="tvcombo"
ProjectGUID="{6365804B-22C6-4D5E-91F3-0C052EB55B4F}"
RootNamespace="tvcombo"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\upnp\sample\common;..\..\upnp\sample;..\..\ixml\inc;..\..\pthreads\include;..\inc;..\..\threadutil\inc;..\..\upnp\sample\tvcombo"
PreprocessorDefinitions="DEBUG;WIN32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib $(TargetDir)..\libupnp\libupnp.lib"
AdditionalLibraryDirectories="&quot;$(TargetDir)..\ixml&quot;;&quot;$(TargetDir)..\threadutil&quot;;&quot;$(TargetDir)..\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\linux\upnp_tv_combo_main.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.c"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,204 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="tvctrlpt"
ProjectGUID="{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}"
RootNamespace="sample"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\upnp\sample\common;..\..\ixml\inc;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvctrlpt\linux;..\..\upnp\sample\tvctrlpt"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;.\out.vc9.$(ConfigurationName)\ixml&quot;;&quot;.\out.vc9.$(ConfigurationName)\threadutil&quot;;&quot;.\out.vc9.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\linux\upnp_tv_ctrlpt_main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,204 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="tvdevice"
ProjectGUID="{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}"
RootNamespace="tvdevice"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvdevice;..\..\upnp\sample\tvdevice\linux"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;.\out.vc9.$(ConfigurationName)\ixml&quot;;&quot;.\out.vc9.$(ConfigurationName)\threadutil&quot;;&quot;.\out.vc9.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\linux\upnp_tv_device_main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,196 +1,53 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# $Id: configure.ac,v 1.11 2006/04/09 13:59:44 r3mi Exp $
# #
# Top-level configure.ac file for libupnp # Top-level configure.ac file for libupnp
# #
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
# #
# (C) Copyright 2005-2007 Rémi Turboult <r3mi@users.sourceforge.net> # (C) Copyright 2005-2006 R<EFBFBD>mi Turboult <r3mi@users.sourceforge.net>
# #
AC_PREREQ(2.60) AC_PREREQ(2.60)
AC_INIT([libupnp], [1.8.0], [mroberto@users.sourceforge.net]) AC_INIT([libupnp], [1.4.2], [mroberto@users.sourceforge.net])
dnl ############################################################################ # *Independently* of the above libupnp package version, the libtool version
dnl # *Independently* of the above libupnp package version, the libtool version # of the 3 libraries need to be updated whenever there is a change released :
dnl # of the 3 libraries need to be updated whenever there is a change released: # "current:revision:age" (this is NOT the same as the package version), where:
dnl # "current:revision:age" (this is NOT the same as the package version), # - library code modified: revision++
dnl # where: # - interfaces changed/added/removed: current++ and revision=0
dnl # - library code modified: revision++ # - interfaces added: age++
dnl # - interfaces changed/added/removed: current++ and revision=0 # - interfaces removed: age=0
dnl # - interfaces added: age++ # *please update only once, before a formal release, not for each change*
dnl # - interfaces removed: age=0 #
dnl # *please update only once, before a formal release, not for each change* # For release 1.4.1, we had:
dnl # #AC_SUBST([LT_VERSION_IXML], [2:2:0])
dnl ############################################################################ #AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
dnl # Release 1.4.1: #AC_SUBST([LT_VERSION_UPNP], [2:2:0])
dnl #AC_SUBST([LT_VERSION_IXML], [2:2:0]) #
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0]) # "current:revision:age"
dnl #AC_SUBST([LT_VERSION_UPNP], [2:2:0]) #
dnl # # - Code has changed in ixml
dnl ############################################################################ # revision: 2 -> 3
dnl # Release 1.4.6: # - Code has changed in threadutil
dnl # "current:revision:age" # revision: 2 -> 3
dnl # # - Interface added in threadutil
dnl # - Code has changed in ixml # current: 2 -> 3
dnl # revision: 2 -> 3 # revisiion: 3 -> 0
dnl # - Code has changed in threadutil # age: 0 -> 1
dnl # revision: 2 -> 3 # - Code has changed in upnp (revision 2 -> 3)
dnl # - Interface added in threadutil # revision: 2 -> 3
dnl # current: 2 -> 3 AC_SUBST([LT_VERSION_IXML], [2:3:0])
dnl # revisiion: 3 -> 0 AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
dnl # age: 0 -> 1 AC_SUBST([LT_VERSION_UPNP], [2:3:0])
dnl # - Code has changed in upnp
dnl # revision: 2 -> 3
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:3:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
dnl #AC_SUBST([LT_VERSION_UPNP], [2:3:0])
dnl #
dnl ############################################################################
dnl # Release 1.6.0:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in ixml
dnl # revision: 3 -> 4
dnl # - Code has changed in threadutil
dnl # revision: 0 -> 1
dnl # - Code has changed in upnp
dnl # revision: 3 -> 4
dnl # - Interface changed in upnp
dnl # current: 2 -> 3
dnl # revision: 4 -> 0
dnl # - Interface removed in upnp
dnl # age: 0 -> 0
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [3:1:1])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:0:0])
dnl #
dnl ############################################################################
dnl # Release 1.6.1:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in threadutil
dnl # revision: 1 -> 2
dnl # - Interface added in threadutil
dnl # current: 3 -> 4
dnl # revision: 2 -> 0
dnl # - Interface added in threadutil
dnl # age: 1 -> 2
dnl # - Code has changed in upnp
dnl # revision: 0 -> 1
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:1:0])
dnl #
dnl ############################################################################
dnl # Release 1.6.2:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in upnp
dnl # revision: 1 -> 2
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:2:0])
dnl #
dnl ############################################################################
dnl # Release 1.6.3:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in threadutil
dnl # revision: 0 -> 1
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:1:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:2:0])
dnl #
dnl ############################################################################
dnl # Release 1.6.4:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in threadutil
dnl # revision: 1 -> 2
dnl # - Code has changed in upnp
dnl # revision: 2 -> 3
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:3:0])
dnl #
dnl ############################################################################
dnl # Release 1.6.5:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in upnp
dnl # revision: 3 -> 4
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:4:0])
dnl #
dnl ############################################################################
dnl # Release 1.6.6:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in threadutil
dnl # revision: 2 -> 3
dnl # - Code has changed in upnp
dnl # revision: 4 -> 5
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:3:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:5:0])
dnl #
dnl ############################################################################
dnl # Release 1.8.0:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in upnp
dnl # revision: 5 -> 6
dnl # - Interfaces have been changed, added and removed in upnp
dnl # current: 3 -> 4
dnl # revision: 6 -> 0
dnl # - Interface has been removed in upnp
dnl # age = 0
dnl # - Code has changed in threadutil
dnl # revision: 3 -> 4
dnl # - Interfaces have been changed, added and removed in upnp
dnl # current: 4 -> 5
dnl # revision: 4 -> 0
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [5:0:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [4:0:0])
dnl #
dnl ############################################################################
AC_SUBST([LT_VERSION_IXML], [2:4:0])
AC_SUBST([LT_VERSION_THREADUTIL], [5:0:2])
AC_SUBST([LT_VERSION_UPNP], [4:0:0])
dnl ############################################################################
dnl # Repeating the algorithm to place it closer to the modificatin place:
dnl # - library code modified: revision++
dnl # - interfaces changed/added/removed: current++ and revision=0
dnl # - interfaces added: age++
dnl # - interfaces removed: age=0
dnl # *please update only once, before a formal release, not for each change*
dnl ############################################################################
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR(config.aux)
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR(m4)
AC_CONFIG_SRCDIR([upnp/inc/upnp.h]) AC_CONFIG_SRCDIR(upnp/inc/upnp.h)
AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2]) AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2])
#
# Get canonical host names in host and host_os
#
AC_CANONICAL_HOST
# #
# There are 3 configuration files : # There are 3 configuration files :
# 1) "./autoconfig.h" is auto-generated and used only internally during build # 1) "./autoconfig.h" is auto-generated and used only internally during build
@@ -210,7 +67,8 @@ AC_REVISION([$Revision: 1.11 $])
upnpmaj=`echo "$PACKAGE_VERSION" | sed 's/\..*//' ` upnpmaj=`echo "$PACKAGE_VERSION" | sed 's/\..*//' `
upnpmin=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.// ; s/[^0-9].*$//' `] upnpmin=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.// ; s/[^0-9].*$//' `]
upnppatch=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.[^.]\.// ; s/[^0-9].*$//' `] upnppatch=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.[^.]\.// ; s/[^0-9].*$//' `]
AC_DEFINE_UNQUOTED([UPNP_VERSION_STRING], "$PACKAGE_VERSION", [see upnpconfig.h]) AC_DEFINE_UNQUOTED([UPNP_VERSION_STRING], "$PACKAGE_VERSION",
[see upnpconfig.h])
AC_DEFINE_UNQUOTED([UPNP_VERSION_MAJOR], $upnpmaj, [see upnpconfig.h]) AC_DEFINE_UNQUOTED([UPNP_VERSION_MAJOR], $upnpmaj, [see upnpconfig.h])
AC_DEFINE_UNQUOTED([UPNP_VERSION_MINOR], $upnpmin, [see upnpconfig.h]) AC_DEFINE_UNQUOTED([UPNP_VERSION_MINOR], $upnpmin, [see upnpconfig.h])
AC_DEFINE_UNQUOTED([UPNP_VERSION_PATCH], $upnppatch, [see upnpconfig.h]) AC_DEFINE_UNQUOTED([UPNP_VERSION_PATCH], $upnppatch, [see upnpconfig.h])
@@ -232,6 +90,7 @@ fi
# #
# Check for libupnp subsets # Check for libupnp subsets
# #
RT_BOOL_ARG_ENABLE([client], [yes], [control point code (client)]) RT_BOOL_ARG_ENABLE([client], [yes], [control point code (client)])
if test "x$enable_client" = xyes ; then if test "x$enable_client" = xyes ; then
AC_DEFINE(UPNP_HAVE_CLIENT, 1, [see upnpconfig.h]) AC_DEFINE(UPNP_HAVE_CLIENT, 1, [see upnpconfig.h])
@@ -265,30 +124,23 @@ fi
RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code]) RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code])
#
# doc installation # doc installation
# autoconf >= 2.60 already defines ${docdir}, but we will not use its # autoconf >= 2.60 already defines ${docdir}, but we will not use its
# default value, which is ${datarootdir}/doc/${PACKAGE_TARNAME}. # default value, which is ${datarootdir}/doc/${PACKAGE_TARNAME}.
# That would give us ${datarootdir}/doc/libupnp, and we want the package # That would give us ${datarootdir}/doc/libupnp, and we want the package
# version on that. # version on that.
#
docdir="${datadir}/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}" docdir="${datadir}/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}"
AC_MSG_CHECKING([for documentation directory]) AC_MSG_CHECKING([for documentation directory])
AC_ARG_WITH( AC_ARG_WITH([documentation],
[documentation], AS_HELP_STRING([--with-documentation=directory_name],
AS_HELP_STRING(
[--with-documentation=directory_name],
[where documentation is installed [where documentation is installed
@<:@[DATADIR/doc/]AC_PACKAGE_NAME[-]AC_PACKAGE_VERSION@:>@]) @<:@[DATADIR/doc/]AC_PACKAGE_NAME[-]AC_PACKAGE_VERSION@:>@])
AS_HELP_STRING( AS_HELP_STRING([--without-documentation],
[--without-documentation],
[do not install the documentation]), [do not install the documentation]),
[], [],
[with_documentation=no]) [with_documentation=no])
#
# If something has been entered after an equal sign, assume it is the directory # If something has been entered after an equal sign, assume it is the directory
#
if test x"$with_documentation" != xyes -a x"$with_documentation" != xno; then if test x"$with_documentation" != xyes -a x"$with_documentation" != xno; then
docdir="$with_documentation" docdir="$with_documentation"
fi fi
@@ -307,117 +159,42 @@ AC_PROG_INSTALL
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_PROG_EGREP AC_PROG_EGREP
# #
# Default compilation flags # Default compilation flags
# #
echo "--------------------- Default compilation flags -------------------------------" if test x"$enable_debug" = xyes; then
echo host is $host # AC_PROG_CC already sets CFLAGS to "-g -O2" by default
echo host_os is $host_os :
case $host_os in else
freebsd*) # add optimise for size
echo "Using FreeBSD specific compiler settings" AX_CFLAGS_GCC_OPTION([-Os])
# Put FreeBSD specific compiler flags here fi
;;
*)
echo "Using non-specific system compiler settings"
if test x"$enable_debug" = xyes; then
# AC_PROG_CC already sets CFLAGS to "-g -O2" by default
#:
# Use -O0 in debug so that variables do not get optimized out
AX_CFLAGS_GCC_OPTION([-O0])
else
# add optimise for size
AX_CFLAGS_GCC_OPTION([-Os])
fi
;;
esac
AX_CFLAGS_WARN_ALL AX_CFLAGS_WARN_ALL
echo "-------------------------------------------------------------------------------"
# #
# Lot's of stuff to ensure large file support # Lot's of stuff to ensure large file support
# #
AC_TYPE_SIZE_T
AC_TYPE_OFF_T AC_TYPE_OFF_T
AC_DEFINE([_LARGE_FILE_SOURCE], [], [Large files support]) AC_DEFINE(_LARGE_FILE_SOURCE, [], [Large files support])
AC_DEFINE([_FILE_OFFSET_BITS], [64], [File Offset size]) AC_DEFINE(_FILE_OFFSET_BITS, [64], [File Offset size])
# #
# Are we targetting Win32? # Checks for header files
#
AC_MSG_CHECKING([for Win32])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#ifdef WIN32
#error Yup
#endif
],[])], [ac_cv_win32="no"], [ac_cv_win32="yes"])
if test "$ac_cv_win32" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#
# Checks for header files (which aren't needed on Win32)
# #
AC_HEADER_STDC AC_HEADER_STDC
if test "$ac_cv_win32" = "no"; then
# libupnp code doesn't use autoconf variables yet, # libupnp code doesn't use autoconf variables yet,
# so just abort if a header file is not found. # so just abort if a header file is not found.
AC_CHECK_HEADERS( AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h],[],[AC_MSG_ERROR([required header file missing])])
[ \
arpa/inet.h \
fcntl.h \
inttypes.h \
limits.h \
netdb.h \
netinet/in.h \
stdlib.h \
string.h \
sys/ioctl.h \
sys/socket.h \
sys/time.h \
syslog.h \
unistd.h \
],
[],
[AC_MSG_ERROR([required header file missing])])
fi
# #
# Checks for typedefs, structures, and compiler characteristics # Checks for typedefs, structures, and compiler characteristics
# #
AC_C_CONST AC_C_CONST
AC_TYPE_SIZE_T
# The test for socklen_t was getting it wrong when it exists but is in ws2tcpip.h, TYPE_SOCKLEN_T
# so we use a new test.
#TYPE_SOCKLEN_T
AC_CHECK_HEADERS([sys/types.h sys/socket.h ws2tcpip.h])
AC_MSG_CHECKING(for socklen_t)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
],[ socklen_t t = 0; return t; ])
],[ac_cv_socklen_t="yes"],[ac_cv_socklen_t="no"])
if test "$ac_cv_socklen_t" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, using int])
AC_DEFINE(socklen_t, int, [Type for storing the length of struct sockaddr])
fi
# #
@@ -425,65 +202,25 @@ fi
# #
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_FUNC_FSEEKO AC_FUNC_FSEEKO
AC_CHECK_FUNCS(ftime,, [AC_CHECK_LIB(compat, ftime)])
#
# Solaris needs -lsocket -lnsl -lrt
AC_SEARCH_LIBS([bind], [socket])
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([sched_getparam], [rt])
# #
# Checks for POSIX Threads # Checks for POSIX Threads
# #
echo "--------------------------- pthread stuff -------------------------------------" ACX_PTHREAD([],[AC_MSG_ERROR([POSIX threads are required to build this program])])
ACX_PTHREAD(
[],
[AC_MSG_ERROR([POSIX threads are required to build this program])])
#
# Update environment variables for pthreads
#
CC="$PTHREAD_CC"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
#
# Determine if pthread_rwlock_t is available
#
echo "----------------------- pthread_rwlock_t stuff --------------------------------"
AC_MSG_CHECKING([if pthread_rwlock_t is available])
AC_LANG([C])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <pthread.h>],
[pthread_rwlock_t *x;])],
[AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
AC_MSG_RESULT([yes, supported without any options])],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#define _GNU_SOURCE
#include <pthread.h>],
[pthread_rwlock_t *x;])],
[AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
AC_MSG_RESULT([yes, definition of _GNU_SOURCE required])],
[AC_DEFINE([UPNP_USE_RWLOCK], [0], [Do not use pthread_rwlock_t])
AC_MSG_RESULT([no, needs to fallback to pthread_mutex])
AC_MSG_ERROR([pthread_rwlock_t not available])])])
echo "-------------------------------------------------------------------------------"
AC_CONFIG_FILES([
Makefile
ixml/Makefile
ixml/doc/Makefile
threadutil/Makefile
upnp/Makefile
upnp/doc/Makefile
upnp/sample/Makefile
docs/dist/Makefile
libupnp.pc
])
AC_CONFIG_FILES([Makefile
ixml/Makefile
ixml/doc/Makefile
threadutil/Makefile
upnp/Makefile
upnp/doc/Makefile
docs/dist/Makefile
libupnp.pc
])
AC_OUTPUT AC_OUTPUT

View File

@@ -39,7 +39,7 @@ EXTRA_DIST = \
./html/upnp/UPNP_E_SOCKET_ERROR-208.html \ ./html/upnp/UPNP_E_SOCKET_ERROR-208.html \
./html/upnp/UPNP_E_CANCELED-210.html \ ./html/upnp/UPNP_E_CANCELED-210.html \
./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.html \ ./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.html \
./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCEPTED-302.html \ ./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCAPTED-302.html \
./html/upnp/UPNP_E_NOTIFY_UNACCEPTED-303.html \ ./html/upnp/UPNP_E_NOTIFY_UNACCEPTED-303.html \
./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \ ./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \
./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \ ./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \
@@ -295,7 +295,7 @@ if WITH_DOCUMENTATION
./html/upnp/UPNP_E_SOCKET_ERROR-208.html \ ./html/upnp/UPNP_E_SOCKET_ERROR-208.html \
./html/upnp/UPNP_E_CANCELED-210.html \ ./html/upnp/UPNP_E_CANCELED-210.html \
./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.html \ ./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.html \
./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCEPTED-302.html \ ./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCAPTED-302.html \
./html/upnp/UPNP_E_NOTIFY_UNACCEPTED-303.html \ ./html/upnp/UPNP_E_NOTIFY_UNACCEPTED-303.html \
./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \ ./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \
./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \ ./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \

View File

@@ -24,23 +24,15 @@ libixml_la_LDFLAGS = -version-info $(LT_VERSION_IXML) \
-export-symbols-regex '^ixml.*' -export-symbols-regex '^ixml.*'
libixml_la_SOURCES = \ libixml_la_SOURCES = \
src/attr.c \ src/ixml.c src/node.c src/ixmlparser.c \
src/document.c \ src/ixmlmembuf.c src/nodeList.c \
src/element.c \ src/element.c src/attr.c src/document.c \
src/inc/ixmlmembuf.h \
src/inc/ixmlparser.h \
src/ixml.c \
src/ixmldebug.c \
src/ixmlparser.c \
src/ixmlmembuf.c \
src/namedNodeMap.c \ src/namedNodeMap.c \
src/node.c \ src/inc/ixmlmembuf.h src/inc/ixmlparser.h
src/nodeList.c
upnpincludedir = $(includedir)/upnp upnpincludedir = $(includedir)/upnp
upnpinclude_HEADERS = \ upnpinclude_HEADERS = inc/ixml.h
inc/ixml.h \
inc/ixmldebug.h
check_PROGRAMS = test_document check_PROGRAMS = test_document
TESTS = test/test_document.sh TESTS = test/test_document.sh
@@ -55,3 +47,4 @@ dist-hook:
clean-local: clean-local:
@if [ -d bin ] ; then rm -rf bin ; fi @if [ -d bin ] ; then rm -rf bin ; fi

File diff suppressed because it is too large Load Diff

View File

@@ -1,67 +0,0 @@
#ifndef IXMLDEBUG_H
#define IXMLDEBUG_H
#include "UpnpGlobal.h"
#include "ixml.h"
/*!
* \file
*
* \brief Auxiliar routines to aid debugging.
*/
/*!
* \brief Prints the debug statement either on the standard output or log file
* along with the information from where this debug statement is coming.
*/
#ifdef DEBUG
void IxmlPrintf(
/*! [in] The file name, usually __FILE__. */
const char *DbgFileName,
/*! [in] The line number, usually __LINE__ or a variable that got the
* __LINE__ at the appropriate place. */
int DbgLineNo,
/*! [in] The function name. */
const char *FunctionName,
/*! [in] Printf like format specification. */
const char* FmtStr,
/*! [in] Printf like Variable number of arguments that will go in the debug
* statement. */
...)
#if (__GNUC__ >= 3)
/* This enables printf like format checking by the compiler */
__attribute__((format (__printf__, 4, 5)))
#endif
;
#else /* DEBUG */
static UPNP_INLINE void IxmlPrintf(
const char* FmtStr,
...) {}
#endif /* DEBUG */
/*!
* \brief Print the node names and values of a XML tree.
*/
#ifdef DEBUG
void printNodes(
/*! [in] The root of the tree to print. */
IXML_Node *tmpRoot,
/*! [in] The depth to print. */
int depth);
#else
static UPNP_INLINE void printNodes(
IXML_Node *tmpRoot,
int depth)
{
}
#endif
#endif /* IXMLDEBUG_H */

View File

@@ -1,53 +1,60 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#include "ixmlparser.h" #include "ixmlparser.h"
/*================================================================
#include <string.h> * Function: Attr_init
* Initializes an attribute node
* External function.
void ixmlAttr_init(IN IXML_Attr *attr) *
*=================================================================*/
void
ixmlAttr_init( IN IXML_Attr * attr )
{ {
if (attr != NULL) { if( attr != NULL ) {
memset(attr, 0, sizeof (IXML_Attr)); memset( attr, 0, sizeof( IXML_Attr ) );
} }
} }
/*================================================================
void ixmlAttr_free(IN IXML_Attr *attr) * Function: Attr_free
* Frees an attribute node.
* external function.
*
*=================================================================*/
void
ixmlAttr_free( IN IXML_Attr * attr )
{ {
if (attr != NULL) { if( attr != NULL ) {
ixmlNode_free((IXML_Node *)attr); ixmlNode_free( ( IXML_Node * ) attr );
} }
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,173 +1,77 @@
/************************************************************************** ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
**************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef IXML_MEMBUF_H
#define IXML_MEMBUF_H
/*!
* \file
*/
#ifndef _IXML_MEMBUF_H
#define _IXML_MEMBUF_H
#include <stdlib.h>
#include "ixml.h" #include "ixml.h"
#define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) )
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
#include <stdlib.h> /* for size_t */ #ifndef WIN32
#define XINLINE inline
#endif
#define MEMBUF_DEF_SIZE_INC 20
#define MINVAL(a, b) ( (a) < (b) ? (a) : (b) ) typedef struct // ixml_membuf
#define MAXVAL(a, b) ( (a) > (b) ? (a) : (b) )
#define MEMBUF_DEF_SIZE_INC 20
/*!
* \brief The ixml_membuf type.
*/
typedef struct
{ {
char *buf; char *buf;
size_t length;
size_t capacity; size_t length;
size_t size_inc; size_t capacity;
size_t size_inc;
} ixml_membuf; } ixml_membuf;
//--------------------------------------------------
//////////////// functions /////////////////////////
//--------------------------------------------------
/*
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
*/
/*! void ixml_membuf_init(INOUT ixml_membuf *m);
* \brief ixml_membuf initialization routine. void ixml_membuf_destroy(INOUT ixml_membuf *m);
*/ int ixml_membuf_assign(INOUT ixml_membuf *m, IN const void *buf,
void ixml_membuf_init( IN size_t buf_len );
/*! [in,out] The memory buffer to initializa. */ int ixml_membuf_assign_str(INOUT ixml_membuf *m, IN const char *c_str );
ixml_membuf *m); int ixml_membuf_append(INOUT ixml_membuf *m, IN const void *buf);
int ixml_membuf_append_str(INOUT ixml_membuf *m, IN const char *c_str);
int ixml_membuf_insert(INOUT ixml_membuf *m, IN const void* buf,
/*! IN size_t buf_len, int index );
* \brief ixml_membuf clearing routine.
*
* The internal buffer is deleted and ixml_membuf_init() is called in the end
* to reinitialize the buffer.
*/
void ixml_membuf_destroy(
/*! [in,out] The memory buffer to clear. */
ixml_membuf *m);
/*!
* \brief Copies the contents o a buffer to the designated ixml_membuf.
*
* The previous contents of the ixml_membuf are destroyed.
*
* \return IXML_SUCCESS if successfull, or the error code returned
* by ixml_membuf_set_size().
*
* \sa ixml_membuf_assign_str().
*/
int ixml_membuf_assign(
/*! [in,out] The memory buffer on which to operate. */
ixml_membuf *m,
/*! [in] The input buffer to copy from. */
const void *buf,
/*! [in] The number of bytes to copy from the input buffer. */
size_t buf_len);
/*!
* \brief Copies a \b NULL terminated string to the ixml_buffer.
*
* This is a convenience function that internally uses ixml_membuf_assign().
*
* \return The return value of ixml_membuf_assign().
*
* \sa ixml_membuf_assign().
*/
int ixml_membuf_assign_str(
/*! [in,out] The memory buffer on which to operate. */
ixml_membuf *m,
/*! [in] The input string to copy from. */
const char *c_str);
/*!
* \brief Appends one byte to the designated ixml_membuffer.
*
* This is a convenience function that internally uses ixml_membuf_insert().
*
* \return The return value of ixml_membuf_insert().
*
* \sa ixml_membuf_insert()
*/
int ixml_membuf_append(
/*! [in,out] The memory buffer on which to operate. */
ixml_membuf *m,
/*! [in] The pointer to the byte to append. */
const void *buf);
/*!
* \brief Appends the contents of a \b NULL terminated string to the designated
* ixml_membuf.
*
* This is a convenience function that internally uses ixml_membuf_insert().
*
* \return The return value of ixml_membuf_insert().
*
* \sa ixml_membuf_insert().
*/
int ixml_membuf_append_str(
/*! [in,out] The memory buffer on which to operate. */
ixml_membuf *m,
/*! [in] The input string to copy from. */
const char *c_str);
/*!
* \brief
*
* \return
* \li 0 if successfull.
* \li IXML_INDEX_SIZE_ERR if the index parameter is out of range.
* \li Or the return code of ixml_membuf_set_size()
*
* \sa ixml_membuf_set_size()
*/
int ixml_membuf_insert(
/*! [in,out] The memory buffer on which to operate. */
ixml_membuf *m,
/*! [in] The pointer to the input buffer. */
const void *buf,
/*! [in] The buffer length. */
size_t buf_len,
/*! [in] The point of insertion relative to the beggining of the
* ixml_membuf internal buffer. */
int index);
#endif /* IXML_MEMBUF_H */
#endif // _IXML_MEMBUF_H

View File

@@ -1,49 +1,41 @@
/************************************************************************** ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
**************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef _IXMLPARSER_H
#ifndef IXMLPARSER_H #define _IXMLPARSER_H
#define IXMLPARSER_H
/*!
* \file
*/
#include "ixml.h" #include "ixml.h"
#include "ixmlmembuf.h" #include "ixmlmembuf.h"
// Parser definitions
/* Parser definitions */
#define QUOT "&quot;" #define QUOT "&quot;"
#define LT "&lt;" #define LT "&lt;"
#define GT "&gt;" #define GT "&gt;"
@@ -52,218 +44,77 @@
#define ESC_HEX "&#x" #define ESC_HEX "&#x"
#define ESC_DEC "&#" #define ESC_DEC "&#"
typedef struct _IXML_NamespaceURI typedef struct _IXML_NamespaceURI
{ {
char *nsURI; char *nsURI;
char *prefix; char *prefix;
struct _IXML_NamespaceURI *nextNsURI; struct _IXML_NamespaceURI *nextNsURI;
} IXML_NamespaceURI; } IXML_NamespaceURI;
typedef struct _IXML_ElementStack typedef struct _IXML_ElementStack
{ {
char *element; char *element;
char *prefix; char *prefix;
char *namespaceUri; char *namespaceUri;
IXML_NamespaceURI *pNsURI; IXML_NamespaceURI *pNsURI;
struct _IXML_ElementStack *nextElement; struct _IXML_ElementStack *nextElement;
} IXML_ElementStack; } IXML_ElementStack;
typedef enum typedef enum
{ {
eELEMENT, eELEMENT,
eATTRIBUTE, eATTRIBUTE,
eCONTENT, eCONTENT,
} PARSER_STATE; } PARSER_STATE;
typedef struct _Parser typedef struct _Parser
{ {
/*! Data buffer. */ char *dataBuffer; //data buffer
char *dataBuffer; char *curPtr; //ptr to the token parsed
/*! Pointer to the token parsed. */ char *savePtr; //Saves for backup
char *curPtr; ixml_membuf lastElem;
/*! Saves for backup. */ ixml_membuf tokenBuf;
char *savePtr;
ixml_membuf lastElem; IXML_Node *pNeedPrefixNode;
ixml_membuf tokenBuf; IXML_ElementStack *pCurElement;
IXML_Node *pNeedPrefixNode; IXML_Node *currentNodePtr;
IXML_ElementStack *pCurElement; PARSER_STATE state;
IXML_Node *currentNodePtr;
PARSER_STATE state; BOOL bHasTopLevel;
BOOL bHasTopLevel;
} Parser; } Parser;
/*!
* \brief Check to see whether name is a valid xml name.
*/
BOOL Parser_isValidXmlName(
/*! [in] The string to be checked. */
const DOMString name);
int Parser_LoadDocument( IXML_Document **retDoc, const char * xmlFile, BOOL file);
BOOL Parser_isValidXmlName( const DOMString name);
int Parser_setNodePrefixAndLocalName(IXML_Node *newIXML_NodeIXML_Attr);
void Parser_freeNodeContent( IXML_Node *IXML_Nodeptr);
/*! void Parser_setErrorChar( char c );
* \brief Sets the error character.
*
* If 'c' is 0 (default), the parser is strict about XML encoding:
* invalid UTF-8 sequences or "&" entities are rejected, and the parsing
* aborts.
*
* If 'c' is not 0, the parser is relaxed: invalid UTF-8 characters
* are replaced by this character, and invalid "&" entities are left
* untranslated. The parsing is then allowed to continue.
*/
void Parser_setErrorChar(
/*! [in] The character to become the error character. */
char c);
void ixmlAttr_free(IXML_Attr *attrNode);
void ixmlAttr_init(IXML_Attr *attrNode);
/*! int ixmlElement_setTagName(IXML_Element *element, const char *tagName);
* \brief Fees a node contents.
*/
void Parser_freeNodeContent(
/*! [in] The Node to process. */
IXML_Node *IXML_Nodeptr);
int Parser_LoadDocument(IXML_Document **retDoc, const char * xmlFile, BOOL file); void ixmlNamedNodeMap_init(IXML_NamedNodeMap *nnMap);
int ixmlNamedNodeMap_addToNamedNodeMap(IXML_NamedNodeMap **nnMap, IXML_Node *add);
int Parser_setNodePrefixAndLocalName(IXML_Node *newIXML_NodeIXML_Attr); void ixmlNode_init(IXML_Node *IXML_Nodeptr);
BOOL ixmlNode_compare(IXML_Node *srcIXML_Node, IXML_Node *destIXML_Node);
void ixmlNode_getElementsByTagName( IXML_Node *n, const char *tagname, IXML_NodeList **list);
void ixmlNode_getElementsByTagNameNS( IXML_Node *IXML_Node, const char *namespaceURI,
const char *localName, IXML_NodeList **list);
void ixmlAttr_init(IXML_Attr *attrNode); int ixmlNode_setNodeProperties(IXML_Node* node, IXML_Node *src);
int ixmlNode_setNodeName( IXML_Node* node, const DOMString qualifiedName);
/*! void ixmlNodeList_init(IXML_NodeList *nList);
* \brief Set the given element's tagName. int ixmlNodeList_addToNodeList(IXML_NodeList **nList, IXML_Node *add);
*
* \return One of the following:
* \li \b IXML_SUCCESS, if successfull.
* \li \b IXML_FAILED, if element of tagname is \b NULL.
* \li \b IXML_INSUFFICIENT_MEMORY, if there is no memory to allocate the
* buffer for the element's tagname.
*/
int ixmlElement_setTagName(
/*! [in] The element to change the tagname. */
IXML_Element *element,
/*! [in] The new tagName for the element. */
const char *tagName);
#endif // _IXMLPARSER_H
/*!
* \brief Initializes a NamedNodeMap object.
*/
void ixmlNamedNodeMap_init(
/*! [in] The named node map to process. */
IXML_NamedNodeMap *nnMap);
/*!
* \brief Add a node to a NamedNodeMap.
*
* \return IXML_SUCCESS or failure.
*/
int ixmlNamedNodeMap_addToNamedNodeMap(
/* [in] The named node map. */
IXML_NamedNodeMap **nnMap,
/* [in] The node to add. */
IXML_Node *add);
/*!
* \brief Add a node to nodelist.
*/
int ixmlNodeList_addToNodeList(
/*! [in] The pointer to the nodelist. */
IXML_NodeList **nList,
/*! [in] The node to add. */
IXML_Node *add);
/*!
* \brief Intializes a node.
*/
void ixmlNode_init(
/*! [in] The \b Node to iniatialize. */
IN IXML_Node *nodeptr);
/*!
* \brief Compare two nodes to see whether they are the same node.
* Parent, sibling and children node are ignored.
*
* \return
* \li TRUE, the two nodes are the same.
* \li FALSE, the two nodes are not the same.
*/
BOOL ixmlNode_compare(
/*! [in] The first \b Node. */
IXML_Node *srcNode,
/*! [in] The second \b Node. */
IXML_Node *destNode);
/*!
* \brief Returns a nodeList of all descendant Elements with a given tagName,
* in the order in which they are encountered in a traversal of this element
* tree.
*/
void ixmlNode_getElementsByTagName(
/*! [in] The \b Node tree. */
IXML_Node *n,
/*! [in] The tag name to match. */
const char *tagname,
/*! [out] The output \b NodeList. */
IXML_NodeList **list);
/*!
* \brief Returns a nodeList of all the descendant Elements with a given local
* name and namespace URI in the order in which they are encountered in a
* preorder traversal of this Elememt tree.
*/
void ixmlNode_getElementsByTagNameNS(
/*! [in] The \b Element tree. */
IXML_Node *n,
/*! [in] The name space to match. */
const char *namespaceURI,
/*! [in] The local name to match. */
const char *localName,
/*! [out] The output \b NodeList. */
IXML_NodeList **list);
/*!
* \brief
*
* \return
*/
int ixmlNode_setNodeName(
/*! [in] The \b Node. */
IXML_Node *node,
/*! [in] . */
const DOMString qualifiedName);
/*!
* \brief
*
* \return
*/
int ixmlNode_setNodeProperties(
/*! [in] . */
IXML_Node *destNode,
/*! [in] . */
IXML_Node *src);
/*!
* \brief Initializes a nodelist
*/
void ixmlNodeList_init(
/*! [in,out] The \b NodeList to initialize. */
IXML_NodeList *nList);
#endif /* IXMLPARSER_H */

View File

@@ -1,469 +1,531 @@
/************************************************************************** ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
**************************************************************************/ ///////////////////////////////////////////////////////////////////////////
/*!
* \file
*/
#include "ixmldebug.h"
#include "ixmlmembuf.h" #include "ixmlmembuf.h"
#include "ixmlparser.h" #include "ixmlparser.h"
/*================================================================
#include <stdlib.h> /* for free() */ * copy_with_escape
#include <string.h> *
*
*=================================================================*/
/*! static void
* \brief Appends a string to a buffer, substituting some characters by escape copy_with_escape( INOUT ixml_membuf * buf,
* sequences. IN const char *p )
*/
static void copy_with_escape(
/*! [in,out] The input/output buffer. */
ixml_membuf *buf,
/*! [in] The string to copy from. */
const char *p)
{ {
int i; int i;
int plen; int plen;
if (p == NULL) { if( p == NULL )
return; return;
}
plen = strlen( p ); plen = strlen( p );
for (i = 0; i < plen; i++) { for( i = 0; i < plen; i++ ) {
switch (p[i]) { switch ( p[i] ) {
case '<': case '<':
ixml_membuf_append_str(buf, "&lt;"); ixml_membuf_append_str( buf, "&lt;" );
break; break;
case '>': case '>':
ixml_membuf_append_str(buf, "&gt;"); ixml_membuf_append_str( buf, "&gt;" );
break; break;
case '&': case '&':
ixml_membuf_append_str(buf, "&amp;"); ixml_membuf_append_str( buf, "&amp;" );
break; break;
case '\'': case '\'':
ixml_membuf_append_str(buf, "&apos;"); ixml_membuf_append_str( buf, "&apos;" );
break; break;
case '\"': case '\"':
ixml_membuf_append_str(buf, "&quot;"); ixml_membuf_append_str( buf, "&quot;" );
break; break;
default: default:
ixml_membuf_append(buf, &p[i]); ixml_membuf_append( buf, &p[i] );
break; }
} }
} }
/*================================================================
* ixmlPrintDomTreeRecursive
* It is a recursive function to print all the node in a tree.
* Internal to parser only.
*
*=================================================================*/
void
ixmlPrintDomTreeRecursive( IN IXML_Node * nodeptr,
IN ixml_membuf * buf )
{
const char *nodeName = NULL;
const char *nodeValue = NULL;
IXML_Node *child = NULL,
*sibling = NULL;
if( nodeptr != NULL ) {
nodeName = ( const char * )ixmlNode_getNodeName( nodeptr );
nodeValue = ixmlNode_getNodeValue( nodeptr );
switch ( ixmlNode_getNodeType( nodeptr ) ) {
case eTEXT_NODE:
copy_with_escape( buf, nodeValue );
break;
case eCDATA_SECTION_NODE:
ixml_membuf_append_str( buf, "<![CDATA[" );
ixml_membuf_append_str( buf, nodeValue );
ixml_membuf_append_str( buf, "]]>" );
break;
case ePROCESSING_INSTRUCTION_NODE:
ixml_membuf_append_str( buf, "<?" );
ixml_membuf_append_str( buf, nodeName );
ixml_membuf_append_str( buf, " " );
copy_with_escape( buf, nodeValue );
ixml_membuf_append_str( buf, "?>\n" );
break;
case eDOCUMENT_NODE:
ixmlPrintDomTreeRecursive( ixmlNode_getFirstChild
( nodeptr ), buf );
break;
case eATTRIBUTE_NODE:
ixml_membuf_append_str( buf, nodeName );
ixml_membuf_append_str( buf, "=\"" );
copy_with_escape( buf, nodeValue );
ixml_membuf_append_str( buf, "\"" );
if( nodeptr->nextSibling != NULL ) {
ixml_membuf_append_str( buf, " " );
ixmlPrintDomTreeRecursive( nodeptr->nextSibling, buf );
}
break;
case eELEMENT_NODE:
ixml_membuf_append_str( buf, "<" );
ixml_membuf_append_str( buf, nodeName );
if( nodeptr->firstAttr != NULL ) {
ixml_membuf_append_str( buf, " " );
ixmlPrintDomTreeRecursive( nodeptr->firstAttr, buf );
}
child = ixmlNode_getFirstChild( nodeptr );
if( ( child != NULL )
&& ( ixmlNode_getNodeType( child ) ==
eELEMENT_NODE ) ) {
ixml_membuf_append_str( buf, ">\r\n" );
} else {
ixml_membuf_append_str( buf, ">" );
}
// output the children
ixmlPrintDomTreeRecursive( ixmlNode_getFirstChild
( nodeptr ), buf );
// Done with children. Output the end tag.
ixml_membuf_append_str( buf, "</" );
ixml_membuf_append_str( buf, nodeName );
sibling = ixmlNode_getNextSibling( nodeptr );
if( sibling != NULL
&& ixmlNode_getNodeType( sibling ) == eTEXT_NODE ) {
ixml_membuf_append_str( buf, ">" );
} else {
ixml_membuf_append_str( buf, ">\r\n" );
}
ixmlPrintDomTreeRecursive( ixmlNode_getNextSibling
( nodeptr ), buf );
break;
default:
break;
}
}
}
/*================================================================
* ixmlPrintDomTree
* Print a DOM tree.
* Element, and Attribute nodes are handled differently.
* We don't want to print the Element and Attribute nodes' sibling.
* External function.
*
*=================================================================*/
void
ixmlPrintDomTree( IN IXML_Node * nodeptr,
IN ixml_membuf * buf )
{
const char *nodeName = NULL;
const char *nodeValue = NULL;
IXML_Node *child = NULL;
if( ( nodeptr == NULL ) || ( buf == NULL ) ) {
return;
}
nodeName = ( const char * )ixmlNode_getNodeName( nodeptr );
nodeValue = ixmlNode_getNodeValue( nodeptr );
switch ( ixmlNode_getNodeType( nodeptr ) ) {
case eTEXT_NODE:
case eCDATA_SECTION_NODE:
case ePROCESSING_INSTRUCTION_NODE:
case eDOCUMENT_NODE:
ixmlPrintDomTreeRecursive( nodeptr, buf );
break;
case eATTRIBUTE_NODE:
ixml_membuf_append_str( buf, nodeName );
ixml_membuf_append_str( buf, "=\"" );
copy_with_escape( buf, nodeValue );
ixml_membuf_append_str( buf, "\"" );
break;
case eELEMENT_NODE:
ixml_membuf_append_str( buf, "<" );
ixml_membuf_append_str( buf, nodeName );
if( nodeptr->firstAttr != NULL ) {
ixml_membuf_append_str( buf, " " );
ixmlPrintDomTreeRecursive( nodeptr->firstAttr, buf );
}
child = ixmlNode_getFirstChild( nodeptr );
if( ( child != NULL )
&& ( ixmlNode_getNodeType( child ) == eELEMENT_NODE ) ) {
ixml_membuf_append_str( buf, ">\r\n" );
} else {
ixml_membuf_append_str( buf, ">" );
}
// output the children
ixmlPrintDomTreeRecursive( ixmlNode_getFirstChild( nodeptr ),
buf );
// Done with children. Output the end tag.
ixml_membuf_append_str( buf, "</" );
ixml_membuf_append_str( buf, nodeName );
ixml_membuf_append_str( buf, ">\r\n" );
break;
default:
break;
}
}
/*================================================================
* ixmlDomTreetoString
* Converts a DOM tree into a text string
* Element, and Attribute nodes are handled differently.
* We don't want to print the Element and Attribute nodes' sibling.
* External function.
*
*=================================================================*/
void
ixmlDomTreetoString( IN IXML_Node * nodeptr,
IN ixml_membuf * buf )
{
const char *nodeName = NULL;
const char *nodeValue = NULL;
IXML_Node *child = NULL;
if( ( nodeptr == NULL ) || ( buf == NULL ) ) {
return;
}
nodeName = ( const char * )ixmlNode_getNodeName( nodeptr );
nodeValue = ixmlNode_getNodeValue( nodeptr );
switch ( ixmlNode_getNodeType( nodeptr ) ) {
case eTEXT_NODE:
case eCDATA_SECTION_NODE:
case ePROCESSING_INSTRUCTION_NODE:
case eDOCUMENT_NODE:
ixmlPrintDomTreeRecursive( nodeptr, buf );
break;
case eATTRIBUTE_NODE:
ixml_membuf_append_str( buf, nodeName );
ixml_membuf_append_str( buf, "=\"" );
copy_with_escape( buf, nodeValue );
ixml_membuf_append_str( buf, "\"" );
break;
case eELEMENT_NODE:
ixml_membuf_append_str( buf, "<" );
ixml_membuf_append_str( buf, nodeName );
if( nodeptr->firstAttr != NULL ) {
ixml_membuf_append_str( buf, " " );
ixmlPrintDomTreeRecursive( nodeptr->firstAttr, buf );
}
child = ixmlNode_getFirstChild( nodeptr );
if( ( child != NULL )
&& ( ixmlNode_getNodeType( child ) == eELEMENT_NODE ) ) {
ixml_membuf_append_str( buf, ">" );
} else {
ixml_membuf_append_str( buf, ">" );
}
// output the children
ixmlPrintDomTreeRecursive( ixmlNode_getFirstChild( nodeptr ),
buf );
// Done with children. Output the end tag.
ixml_membuf_append_str( buf, "</" );
ixml_membuf_append_str( buf, nodeName );
ixml_membuf_append_str( buf, ">" );
break;
default:
break;
}
}
/*================================================================
* ixmlLoadDocumentEx
* Parses the given file, and returns the DOM tree from it.
* External function.
*
*=================================================================*/
int
ixmlLoadDocumentEx( IN const char *xmlFile,
IXML_Document ** doc )
{
if( ( xmlFile == NULL ) || ( doc == NULL ) ) {
return IXML_INVALID_PARAMETER;
}
return Parser_LoadDocument( doc, xmlFile, TRUE );
}
/*================================================================
* ixmlLoadDocument
* Parses the given file, and returns the DOM tree from it.
* External function.
*
*=================================================================*/
IXML_Document *
ixmlLoadDocument( IN const char *xmlFile )
{
IXML_Document *doc = NULL;
ixmlLoadDocumentEx( xmlFile, &doc );
return doc;
}
/*================================================================
* ixmlPrintDocument
* Prints entire document, prepending XML prolog first.
* Puts lots of white spaces.
* External function.
*
*=================================================================*/
DOMString
ixmlPrintDocument(IXML_Document *doc)
{
IXML_Node* rootNode = ( IXML_Node * )doc;
ixml_membuf memBuf;
ixml_membuf *buf = &memBuf;
if( rootNode == NULL ) {
return NULL;
}
ixml_membuf_init( buf );
ixml_membuf_append_str( buf, "<?xml version=\"1.0\"?>\r\n" );
ixmlPrintDomTree( rootNode, buf );
return buf->buf;
}
/*================================================================
* ixmlPrintNode
* Print DOM tree under node. Puts lots of white spaces
* External function.
*
*=================================================================*/
DOMString
ixmlPrintNode( IN IXML_Node * node )
{
ixml_membuf memBuf;
ixml_membuf *buf = &memBuf;
if( node == NULL ) {
return NULL;
}
ixml_membuf_init( buf );
ixmlPrintDomTree( node, buf );
return buf->buf;
}
/*================================================================
* ixmlDocumenttoString
* converts DOM tree under node to text string,
* prepending XML prolog first.
* External function.
*
*=================================================================*/
DOMString
ixmlDocumenttoString(IXML_Document *doc)
{
IXML_Node* rootNode = ( IXML_Node * )doc;
ixml_membuf memBuf;
ixml_membuf *buf = &memBuf;
if( rootNode == NULL ) {
return NULL;
}
ixml_membuf_init( buf );
ixml_membuf_append_str( buf, "<?xml version=\"1.0\"?>\r\n" );
ixmlDomTreetoString( rootNode, buf );
return buf->buf;
}
/*================================================================
* ixmlNodetoString
* converts DOM tree under node to text string
* External function.
*
*=================================================================*/
DOMString
ixmlNodetoString( IN IXML_Node * node )
{
ixml_membuf memBuf;
ixml_membuf *buf = &memBuf;
if( node == NULL ) {
return NULL;
}
ixml_membuf_init( buf );
ixmlDomTreetoString( node, buf );
return buf->buf;
}
/*================================================================
* ixmlRelaxParser
* Makes the XML parser more tolerant to malformed text.
* External function.
*
*=================================================================*/
void
ixmlRelaxParser(char errorChar)
{
Parser_setErrorChar( errorChar );
} }
/*! /*================================================================
* \brief Recursive function to print all the node in a tree. * ixmlParseBufferEx
* Internal to parser only. * Parse xml file stored in buffer.
*/ * External function.
static void ixmlPrintDomTreeRecursive( *
/*! [in] \todo documentation. */ *=================================================================*/
IXML_Node *nodeptr, int
/*! [in] \todo documentation. */ ixmlParseBufferEx( IN const char *buffer,
ixml_membuf *buf) IXML_Document ** retDoc )
{ {
const char *nodeName = NULL;
const char *nodeValue = NULL;
IXML_Node *child = NULL,
*sibling = NULL;
if (nodeptr != NULL) { if( ( buffer == NULL ) || ( retDoc == NULL ) ) {
nodeName = (const char *)ixmlNode_getNodeName(nodeptr); return IXML_INVALID_PARAMETER;
nodeValue = ixmlNode_getNodeValue(nodeptr); }
switch (ixmlNode_getNodeType(nodeptr)) {
case eTEXT_NODE:
copy_with_escape(buf, nodeValue);
break;
case eCDATA_SECTION_NODE: if( buffer[0] == '\0' ) {
ixml_membuf_append_str(buf, "<![CDATA["); return IXML_INVALID_PARAMETER;
ixml_membuf_append_str(buf, nodeValue); }
ixml_membuf_append_str(buf, "]]>");
break;
case ePROCESSING_INSTRUCTION_NODE: return Parser_LoadDocument( retDoc, buffer, FALSE );
ixml_membuf_append_str(buf, "<?");
ixml_membuf_append_str(buf, nodeName);
ixml_membuf_append_str(buf, " ");
copy_with_escape(buf, nodeValue);
ixml_membuf_append_str(buf, "?>\n");
break;
case eDOCUMENT_NODE:
ixmlPrintDomTreeRecursive(
ixmlNode_getFirstChild(nodeptr), buf);
break;
case eATTRIBUTE_NODE:
ixml_membuf_append_str(buf, nodeName);
ixml_membuf_append_str(buf, "=\"");
copy_with_escape(buf, nodeValue);
ixml_membuf_append_str(buf, "\"");
if (nodeptr->nextSibling != NULL) {
ixml_membuf_append_str(buf, " ");
ixmlPrintDomTreeRecursive(nodeptr->nextSibling, buf);
}
break;
case eELEMENT_NODE:
ixml_membuf_append_str(buf, "<");
ixml_membuf_append_str(buf, nodeName);
if (nodeptr->firstAttr != NULL) {
ixml_membuf_append_str(buf, " ");
ixmlPrintDomTreeRecursive(nodeptr->firstAttr, buf);
}
child = ixmlNode_getFirstChild(nodeptr);
if (child != NULL &&
ixmlNode_getNodeType(child) == eELEMENT_NODE) {
ixml_membuf_append_str(buf, ">\r\n");
} else {
ixml_membuf_append_str(buf, ">");
}
// output the children
ixmlPrintDomTreeRecursive(
ixmlNode_getFirstChild(nodeptr), buf);
// Done with children. Output the end tag.
ixml_membuf_append_str(buf, "</");
ixml_membuf_append_str(buf, nodeName);
sibling = ixmlNode_getNextSibling(nodeptr);
if (sibling != NULL &&
ixmlNode_getNodeType(sibling) == eTEXT_NODE) {
ixml_membuf_append_str( buf, ">" );
} else {
ixml_membuf_append_str( buf, ">\r\n" );
}
ixmlPrintDomTreeRecursive(
ixmlNode_getNextSibling(nodeptr), buf);
break;
default:
IxmlPrintf(__FILE__, __LINE__, "ixmlPrintDomTreeRecursive",
"Warning, unknown node type %d\n",
ixmlNode_getNodeType(nodeptr));
break;
}
}
} }
/*================================================================
/*! * ixmlParseBuffer
* \brief Print a DOM tree. * Parse xml file stored in buffer.
* * External function.
* Element, and Attribute nodes are handled differently. We don't want to print *
* the Element and Attribute nodes' sibling. *=================================================================*/
*/ IXML_Document *
static void ixmlPrintDomTree( ixmlParseBuffer( IN const char *buffer )
/*! [in] \todo documentation. */
IXML_Node *nodeptr,
/*! [in] \todo documentation. */
ixml_membuf *buf)
{ {
const char *nodeName = NULL; IXML_Document *doc = NULL;
const char *nodeValue = NULL;
IXML_Node *child = NULL;
if (nodeptr == NULL || buf == NULL) { ixmlParseBufferEx( buffer, &doc );
return; return doc;
}
nodeName = (const char *)ixmlNode_getNodeName(nodeptr);
nodeValue = ixmlNode_getNodeValue(nodeptr);
switch (ixmlNode_getNodeType(nodeptr)) {
case eTEXT_NODE:
case eCDATA_SECTION_NODE:
case ePROCESSING_INSTRUCTION_NODE:
case eDOCUMENT_NODE:
ixmlPrintDomTreeRecursive(nodeptr, buf);
break;
case eATTRIBUTE_NODE:
ixml_membuf_append_str(buf, nodeName);
ixml_membuf_append_str(buf, "=\"");
copy_with_escape(buf, nodeValue);
ixml_membuf_append_str(buf, "\"");
break;
case eELEMENT_NODE:
ixml_membuf_append_str(buf, "<");
ixml_membuf_append_str(buf, nodeName);
if (nodeptr->firstAttr != NULL) {
ixml_membuf_append_str(buf, " ");
ixmlPrintDomTreeRecursive(nodeptr->firstAttr, buf);
}
child = ixmlNode_getFirstChild(nodeptr);
if (child != NULL &&
ixmlNode_getNodeType(child) == eELEMENT_NODE) {
ixml_membuf_append_str(buf, ">\r\n");
} else {
ixml_membuf_append_str(buf, ">");
}
// output the children
ixmlPrintDomTreeRecursive(
ixmlNode_getFirstChild(nodeptr), buf);
// Done with children. Output the end tag.
ixml_membuf_append_str(buf, "</");
ixml_membuf_append_str(buf, nodeName);
ixml_membuf_append_str(buf, ">\r\n");
break;
default:
IxmlPrintf(__FILE__, __LINE__, "ixmlPrintDomTree",
"Warning, unknown node type %d\n",
ixmlNode_getNodeType(nodeptr));
break;
}
} }
/*================================================================
/*! * ixmlCloneDOMString
* \brief Converts a DOM tree into a text string. * Clones a DOM String.
* * External function.
* Element, and Attribute nodes are handled differently. We don't want to print *
* the Element and Attribute nodes' sibling. *=================================================================*/
*/ DOMString
static void ixmlDomTreetoString( ixmlCloneDOMString( IN const DOMString src )
/*! [in] \todo documentation. */
IXML_Node *nodeptr,
/*! [in] \todo documentation. */
ixml_membuf *buf)
{ {
const char *nodeName = NULL; if( src == NULL ) {
const char *nodeValue = NULL; return NULL;
IXML_Node *child = NULL; }
if (nodeptr == NULL || buf == NULL) { return ( strdup( src ) );
return;
}
nodeName = (const char *)ixmlNode_getNodeName(nodeptr);
nodeValue = ixmlNode_getNodeValue(nodeptr);
switch (ixmlNode_getNodeType(nodeptr)) {
case eTEXT_NODE:
case eCDATA_SECTION_NODE:
case ePROCESSING_INSTRUCTION_NODE:
case eDOCUMENT_NODE:
ixmlPrintDomTreeRecursive(nodeptr, buf);
break;
case eATTRIBUTE_NODE:
ixml_membuf_append_str(buf, nodeName);
ixml_membuf_append_str(buf, "=\"");
copy_with_escape(buf, nodeValue );
ixml_membuf_append_str(buf, "\"");
break;
case eELEMENT_NODE:
ixml_membuf_append_str(buf, "<");
ixml_membuf_append_str(buf, nodeName);
if (nodeptr->firstAttr != NULL) {
ixml_membuf_append_str(buf, " ");
ixmlPrintDomTreeRecursive(nodeptr->firstAttr, buf);
}
child = ixmlNode_getFirstChild(nodeptr);
if (child != NULL &&
ixmlNode_getNodeType(child) == eELEMENT_NODE) {
ixml_membuf_append_str(buf, ">");
} else {
ixml_membuf_append_str(buf, ">");
}
// output the children
ixmlPrintDomTreeRecursive(ixmlNode_getFirstChild(nodeptr), buf);
// Done with children. Output the end tag.
ixml_membuf_append_str(buf, "</");
ixml_membuf_append_str(buf, nodeName);
ixml_membuf_append_str(buf, ">");
break;
default:
IxmlPrintf(__FILE__, __LINE__, "ixmlPrintDomTreeRecursive",
"Warning, unknown node type %d\n",
ixmlNode_getNodeType(nodeptr));
break;
}
} }
/*================================================================
int ixmlLoadDocumentEx(const char *xmlFile, IXML_Document **doc) * ixmlFreeDOMString
* Frees a DOM String.
* External function.
*
*=================================================================*/
void
ixmlFreeDOMString( IN DOMString buf )
{ {
if (xmlFile == NULL || doc == NULL) { if( buf != NULL ) {
return IXML_INVALID_PARAMETER; free( buf );
} }
return Parser_LoadDocument(doc, xmlFile, TRUE);
} }
IXML_Document *ixmlLoadDocument(const char *xmlFile)
{
IXML_Document *doc = NULL;
ixmlLoadDocumentEx(xmlFile, &doc);
return doc;
}
DOMString ixmlPrintDocument(IXML_Document *doc)
{
IXML_Node* rootNode = (IXML_Node *)doc;
ixml_membuf memBuf;
ixml_membuf *buf = &memBuf;
if(rootNode == NULL) {
return NULL;
}
ixml_membuf_init(buf);
ixml_membuf_append_str(buf, "<?xml version=\"1.0\"?>\r\n");
ixmlPrintDomTree(rootNode, buf);
return buf->buf;
}
DOMString ixmlPrintNode(IXML_Node *node)
{
ixml_membuf memBuf;
ixml_membuf *buf = &memBuf;
if (node == NULL) {
return NULL;
}
ixml_membuf_init(buf);
ixmlPrintDomTree(node, buf);
return buf->buf;
}
DOMString ixmlDocumenttoString(IXML_Document *doc)
{
IXML_Node* rootNode = (IXML_Node *)doc;
ixml_membuf memBuf;
ixml_membuf *buf = &memBuf;
if(rootNode == NULL) {
return NULL;
}
ixml_membuf_init(buf);
ixml_membuf_append_str(buf, "<?xml version=\"1.0\"?>\r\n");
ixmlDomTreetoString(rootNode, buf);
return buf->buf;
}
DOMString ixmlNodetoString(IXML_Node *node)
{
ixml_membuf memBuf;
ixml_membuf *buf = &memBuf;
if (node == NULL) {
return NULL;
}
ixml_membuf_init(buf);
ixmlDomTreetoString(node, buf);
return buf->buf;
}
void ixmlRelaxParser(char errorChar)
{
Parser_setErrorChar(errorChar);
}
int ixmlParseBufferEx(const char *buffer, IXML_Document **retDoc)
{
if (buffer == NULL || retDoc == NULL) {
return IXML_INVALID_PARAMETER;
}
if (buffer[0] == '\0') {
return IXML_INVALID_PARAMETER;
}
return Parser_LoadDocument(retDoc, buffer, FALSE);
}
IXML_Document *ixmlParseBuffer(const char *buffer)
{
IXML_Document *doc = NULL;
ixmlParseBufferEx(buffer, &doc);
return doc;
}
DOMString ixmlCloneDOMString(const DOMString src)
{
if (src == NULL) {
return NULL;
}
return strdup(src);
}
void ixmlFreeDOMString(DOMString buf)
{
if (buf != NULL) {
free(buf);
}
}

View File

@@ -1,70 +0,0 @@
/*!
* \file
*/
#include "autoconfig.h"
#include "ixmldebug.h"
#include <stdarg.h>
#include <stdio.h>
#ifdef DEBUG
void IxmlPrintf(
const char *DbgFileName,
int DbgLineNo,
const char *FunctionName,
const char *FmtStr,
...)
{
va_list ArgList;
FILE *fp = stdout;
fprintf(fp, "(%s::%s), line %d", DbgFileName, FunctionName, DbgLineNo);
if (FmtStr) {
fprintf(fp, ": ");
va_start(ArgList, FmtStr);
vfprintf(fp, FmtStr, ArgList);
fflush(fp);
va_end(ArgList);
} else {
fprintf(fp, "\n");
}
}
void printNodes(IXML_Node *tmpRoot, int depth)
{
int i;
IXML_NodeList *NodeList1;
IXML_Node *ChildNode1;
unsigned short NodeType;
const DOMString NodeValue;
const DOMString NodeName;
NodeList1 = ixmlNode_getChildNodes(tmpRoot);
for (i = 0; i < 100; ++i) {
ChildNode1 = ixmlNodeList_item(NodeList1, i);
if (ChildNode1 == NULL) {
break;
}
printNodes(ChildNode1, depth+1);
NodeType = ixmlNode_getNodeType(ChildNode1);
NodeValue = ixmlNode_getNodeValue(ChildNode1);
NodeName = ixmlNode_getNodeName(ChildNode1);
IxmlPrintf(__FILE__, __LINE__, "printNodes",
"DEPTH-%2d-IXML_Node Type %d, "
"IXML_Node Name: %s, IXML_Node Value: %s\n",
depth, NodeType, NodeName, NodeValue);
}
}
#endif

View File

@@ -1,218 +1,236 @@
/************************************************************************** ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
**************************************************************************/ ///////////////////////////////////////////////////////////////////////////
/*!
* \file
*/
#include "ixmlmembuf.h"
#include "ixml.h"
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "ixmlmembuf.h"
#include "ixml.h"
/*================================================================
/*! * ixml_membuf_set_size
* \brief Increases or decreases buffer capacity so that at least 'new_length' *
* bytes can be stored. * Increases or decreases buffer cap so that at least
* * 'new_length' bytes can be stored
* On error, m's fields do not change. *
* * On error, m's fields do not change.
* \return *
* \li UPNP_E_SUCCESS * returns:
* \li UPNP_E_OUTOF_MEMORY * UPNP_E_SUCCESS
*/ * UPNP_E_OUTOF_MEMORY
static int ixml_membuf_set_size( *
/*! [in,out] The memory buffer. */ *=================================================================*/
INOUT ixml_membuf *m, static int
/*! [in] The new lenght. */ ixml_membuf_set_size( INOUT ixml_membuf * m,
IN size_t new_length) IN size_t new_length )
{ {
size_t diff; size_t diff;
size_t alloc_len; size_t alloc_len;
char *temp_buf; char *temp_buf;
if (new_length >= m->length) { if( new_length >= m->length ) // increase length
/* increase length */ {
/* need more mem? */ // need more mem?
if (new_length <= m->capacity) { if( new_length <= m->capacity ) {
/* have enough mem; done */ return 0; // have enough mem; done
return 0; }
}
diff = new_length - m->length; diff = new_length - m->length;
alloc_len = MAXVAL(m->size_inc, diff) + m->capacity; alloc_len = MAXVAL( m->size_inc, diff ) + m->capacity;
} else { } else // decrease length
// decrease length {
assert(new_length <= m->length); assert( new_length <= m->length );
// if diff is 0..m->size_inc, don't free // if diff is 0..m->size_inc, don't free
if ((m->capacity - new_length) <= m->size_inc) { if( ( m->capacity - new_length ) <= m->size_inc ) {
return 0; return 0;
} }
alloc_len = new_length + m->size_inc;
}
assert(alloc_len >= new_length); alloc_len = new_length + m->size_inc;
}
temp_buf = realloc(m->buf, alloc_len + 1); assert( alloc_len >= new_length );
if (temp_buf == NULL) {
/* try smaller size */
alloc_len = new_length;
temp_buf = realloc(m->buf, alloc_len + 1);
if (temp_buf == NULL) {
return IXML_INSUFFICIENT_MEMORY;
}
}
/* save */
m->buf = temp_buf;
m->capacity = alloc_len;
return 0; temp_buf = realloc( m->buf, alloc_len + 1 );
if( temp_buf == NULL ) {
// try smaller size
alloc_len = new_length;
temp_buf = realloc( m->buf, alloc_len + 1 );
if( temp_buf == NULL ) {
return IXML_INSUFFICIENT_MEMORY;
}
}
// save
m->buf = temp_buf;
m->capacity = alloc_len;
return 0;
} }
/*================================================================
void ixml_membuf_init(ixml_membuf *m) * membuffer_init
*
*
*=================================================================*/
void
ixml_membuf_init( INOUT ixml_membuf * m )
{ {
assert(m != NULL); assert( m != NULL );
m->size_inc = MEMBUF_DEF_SIZE_INC; m->size_inc = MEMBUF_DEF_SIZE_INC;
m->buf = NULL; m->buf = NULL;
m->length = 0; m->length = 0;
m->capacity = 0; m->capacity = 0;
} }
/*================================================================
void ixml_membuf_destroy(ixml_membuf *m) * membuffer_destroy
*
*
*=================================================================*/
void
ixml_membuf_destroy( INOUT ixml_membuf * m )
{ {
if (m == NULL) { if( m == NULL ) {
return; return;
} }
free(m->buf); free( m->buf );
ixml_membuf_init(m); ixml_membuf_init( m );
} }
/*================================================================
int ixml_membuf_assign( * ixml_membuf_assign
ixml_membuf *m, *
const void *buf, *
size_t buf_len) *=================================================================*/
int
ixml_membuf_assign( INOUT ixml_membuf * m,
IN const void *buf,
IN size_t buf_len )
{ {
int return_code; int return_code;
assert(m != NULL); assert( m != NULL );
// set value to null // set value to null
if (buf == NULL) { if( buf == NULL ) {
ixml_membuf_destroy(m); ixml_membuf_destroy( m );
return IXML_SUCCESS; return IXML_SUCCESS;
} }
// alloc mem // alloc mem
return_code = ixml_membuf_set_size(m, buf_len); return_code = ixml_membuf_set_size( m, buf_len );
if (return_code != 0) { if( return_code != 0 ) {
return return_code; return return_code;
} }
// copy
memcpy( m->buf, buf, buf_len );
m->buf[buf_len] = 0; // null-terminate
// copy m->length = buf_len;
memcpy(m->buf, buf, buf_len);
// null-terminate return IXML_SUCCESS;
m->buf[buf_len] = 0;
m->length = buf_len;
return IXML_SUCCESS;
} }
/*================================================================
int ixml_membuf_assign_str( * ixml_membuf_assign_str
ixml_membuf *m, *
const char *c_str) *
*=================================================================*/
int
ixml_membuf_assign_str( INOUT ixml_membuf * m,
IN const char *c_str )
{ {
return ixml_membuf_assign(m, c_str, strlen(c_str)); return ixml_membuf_assign( m, c_str, strlen( c_str ) );
} }
/*================================================================
int ixml_membuf_append( * ixml_membuf_append
INOUT ixml_membuf *m, *
IN const void *buf) *
*=================================================================*/
int
ixml_membuf_append( INOUT ixml_membuf * m,
IN const void *buf )
{ {
assert(m != NULL); assert( m != NULL );
return ixml_membuf_insert(m, buf, 1, m->length); return ixml_membuf_insert( m, buf, 1, m->length );
} }
/*================================================================
int ixml_membuf_append_str( * ixml_membuf_append_str
INOUT ixml_membuf *m, *
IN const char *c_str) *
*=================================================================*/
int
ixml_membuf_append_str( INOUT ixml_membuf * m,
IN const char *c_str )
{ {
return ixml_membuf_insert(m, c_str, strlen(c_str), m->length); return ixml_membuf_insert( m, c_str, strlen( c_str ), m->length );
} }
/*================================================================
int ixml_membuf_insert( * ixml_membuf_insert
INOUT ixml_membuf *m, *
IN const void *buf, *
IN size_t buf_len, *=================================================================*/
int index) int
ixml_membuf_insert( INOUT ixml_membuf * m,
IN const void *buf,
IN size_t buf_len,
int index )
{ {
int return_code = 0; int return_code;
assert(m != NULL); assert( m != NULL );
if (index < 0 || index > (int)m->length) { if( index < 0 || index > ( int )m->length )
return IXML_INDEX_SIZE_ERR; return IXML_INDEX_SIZE_ERR;
}
if (buf == NULL || buf_len == 0) { if( buf == NULL || buf_len == 0 ) {
return 0; return 0;
} }
/* alloc mem */ // alloc mem
return_code = ixml_membuf_set_size(m, m->length + buf_len); return_code = ixml_membuf_set_size( m, m->length + buf_len );
if (return_code != 0) { if( return_code != 0 ) {
return return_code; return return_code;
} }
/* insert data */ // insert data
/* move data to right of insertion point */ // move data to right of insertion point
memmove(m->buf + index + buf_len, m->buf + index, m->length - index); memmove( m->buf + index + buf_len, m->buf + index, m->length - index );
memcpy(m->buf + index, buf, buf_len); memcpy( m->buf + index, buf, buf_len );
m->length += buf_len; m->length += buf_len;
/* Null terminate */ m->buf[m->length] = 0; // null-terminate
m->buf[m->length] = 0;
return 0; return 0;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,195 +1,242 @@
/************************************************************************** ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
**************************************************************************/ ///////////////////////////////////////////////////////////////////////////
/*!
* \file
*/
#include "ixmlparser.h" #include "ixmlparser.h"
/*================================================================
#include <assert.h> * NamedNodeMap_getItemNumber
#include <stdlib.h> /* for free(), malloc() */ * return the item number of a item in NamedNodeMap.
#include <string.h> * Internal to parser only.
* Parameters:
* name: the name of the item to find
/*! *
* \brief Return the item number of a item in NamedNodeMap. *=================================================================*/
*/ unsigned long
static unsigned long ixmlNamedNodeMap_getItemNumber( ixmlNamedNodeMap_getItemNumber( IN IXML_NamedNodeMap * nnMap,
/*! [in] The named node map to process. */ IN const char *name )
IN IXML_NamedNodeMap *nnMap,
/*! [in] The name of the item to find. */
IN const char *name)
{ {
IXML_Node *tempNode; IXML_Node *tempNode;
unsigned long returnItemNo = 0; unsigned long returnItemNo = 0;
assert(nnMap != NULL && name != NULL); assert( nnMap != NULL && name != NULL );
if (nnMap == NULL || name == NULL) { if( ( nnMap == NULL ) || ( name == NULL ) ) {
return IXML_INVALID_ITEM_NUMBER; return IXML_INVALID_ITEM_NUMBER;
} }
tempNode = nnMap->nodeItem; tempNode = nnMap->nodeItem;
while (tempNode != NULL) { while( tempNode != NULL ) {
if (strcmp(name, tempNode->nodeName) == 0) { if( strcmp( name, tempNode->nodeName ) == 0 ) {
return returnItemNo; return returnItemNo;
} }
tempNode = tempNode->nextSibling;
returnItemNo++;
}
return IXML_INVALID_ITEM_NUMBER; tempNode = tempNode->nextSibling;
returnItemNo++;
}
return IXML_INVALID_ITEM_NUMBER;
} }
/*================================================================
void ixmlNamedNodeMap_init(IXML_NamedNodeMap *nnMap) * NamedNodeMap_init
* Initializes a NamedNodeMap object.
* External function.
*
*=================================================================*/
void
ixmlNamedNodeMap_init( IN IXML_NamedNodeMap * nnMap )
{ {
assert(nnMap != NULL); assert( nnMap != NULL );
memset( nnMap, 0, sizeof( IXML_NamedNodeMap ) );
memset(nnMap, 0, sizeof (IXML_NamedNodeMap));
} }
/*================================================================
IXML_Node *ixmlNamedNodeMap_getNamedItem( * NamedNodeMap_getNamedItem
IXML_NamedNodeMap *nnMap, * Retrieves a node specified by name.
const DOMString name) * External function.
*
* Parameter:
* name: type nodeName of a node to retrieve.
*
* Return Value:
* A Node with the specified nodeName, or null if it
* does not identify any node in this map.
*
*=================================================================*/
IXML_Node *
ixmlNamedNodeMap_getNamedItem( IN IXML_NamedNodeMap * nnMap,
IN const char *name )
{ {
long index; long index;
if (nnMap == NULL || name == NULL) { if( ( nnMap == NULL ) || ( name == NULL ) ) {
return NULL; return NULL;
} }
index = ixmlNamedNodeMap_getItemNumber(nnMap, name); index = ixmlNamedNodeMap_getItemNumber( nnMap, name );
if (index == IXML_INVALID_ITEM_NUMBER) { if( index == IXML_INVALID_ITEM_NUMBER ) {
return NULL; return NULL;
} else { } else {
return ixmlNamedNodeMap_item(nnMap, (unsigned long)index); return ( ixmlNamedNodeMap_item( nnMap, ( unsigned long )index ) );
} }
} }
/*================================================================
IXML_Node *ixmlNamedNodeMap_item( * NamedNodeMap_item
IN IXML_NamedNodeMap *nnMap, * Returns the indexth item in the map. If index is greater than or
IN unsigned long index ) * equal to the number of nodes in this map, this returns null.
* External function.
*
* Parameter:
* index: index into this map.
*
* Return Value:
* The node at the indexth position in the map, or null if that is
* not a valid index.
*
*=================================================================*/
IXML_Node *
ixmlNamedNodeMap_item( IN IXML_NamedNodeMap * nnMap,
IN unsigned long index )
{ {
IXML_Node *tempNode; IXML_Node *tempNode;
unsigned int i; unsigned int i;
if (nnMap == NULL) { if( nnMap == NULL ) {
return NULL; return NULL;
} }
if (index > ixmlNamedNodeMap_getLength(nnMap) - 1) { if( index > ixmlNamedNodeMap_getLength( nnMap ) - 1 ) {
return NULL; return NULL;
} }
tempNode = nnMap->nodeItem; tempNode = nnMap->nodeItem;
for (i = 0; i < index && tempNode != NULL; ++i) { for( i = 0; i < index && tempNode != NULL; ++i ) {
tempNode = tempNode->nextSibling; tempNode = tempNode->nextSibling;
} }
return tempNode; return tempNode;
} }
/*================================================================
unsigned long ixmlNamedNodeMap_getLength(IXML_NamedNodeMap *nnMap) * NamedNodeMap_getLength
* Return the number of Nodes in this map.
* External function.
*
* Parameters:
*
*=================================================================*/
unsigned long
ixmlNamedNodeMap_getLength( IN IXML_NamedNodeMap * nnMap )
{ {
IXML_Node *tempNode; IXML_Node *tempNode;
unsigned long length = 0; unsigned long length = 0;
if (nnMap != NULL) { if( nnMap != NULL ) {
tempNode = nnMap->nodeItem; tempNode = nnMap->nodeItem;
for (length = 0; tempNode != NULL; ++length) { for( length = 0; tempNode != NULL; ++length ) {
tempNode = tempNode->nextSibling; tempNode = tempNode->nextSibling;
} }
} }
return length;
return length;
} }
/*================================================================
void ixmlNamedNodeMap_free(IXML_NamedNodeMap *nnMap) * ixmlNamedNodeMap_free
* frees a NamedNodeMap.
* External function.
*
*=================================================================*/
void
ixmlNamedNodeMap_free( IXML_NamedNodeMap * nnMap )
{ {
IXML_NamedNodeMap *pNext; IXML_NamedNodeMap *pNext;
while (nnMap != NULL) { while( nnMap != NULL ) {
pNext = nnMap->next; pNext = nnMap->next;
free(nnMap); free( nnMap );
nnMap = pNext; nnMap = pNext;
} }
} }
/*================================================================
int ixmlNamedNodeMap_addToNamedNodeMap( * NamedNodeMap_addToNamedNodeMap
IXML_NamedNodeMap **nnMap, * add a node to a NamedNodeMap.
IXML_Node *add) * Internal to parser only.
* Parameters:
* add: the node to add into NamedNodeMap.
* Return:
* IXML_SUCCESS or failure.
*
*=================================================================*/
int
ixmlNamedNodeMap_addToNamedNodeMap( IN IXML_NamedNodeMap ** nnMap,
IN IXML_Node * add )
{ {
IXML_NamedNodeMap *traverse = NULL; IXML_NamedNodeMap *traverse = NULL,
IXML_NamedNodeMap *p = NULL; *p = NULL;
IXML_NamedNodeMap *newItem = NULL; IXML_NamedNodeMap *newItem = NULL;
if(add == NULL) { if( add == NULL ) {
return IXML_SUCCESS; return IXML_SUCCESS;
} }
if (*nnMap == NULL) { if( *nnMap == NULL ) // nodelist is empty
// nodelist is empty {
*nnMap = (IXML_NamedNodeMap *)malloc(sizeof (IXML_NamedNodeMap)); *nnMap =
if (*nnMap == NULL) { ( IXML_NamedNodeMap * ) malloc( sizeof( IXML_NamedNodeMap ) );
return IXML_INSUFFICIENT_MEMORY; if( *nnMap == NULL ) {
} return IXML_INSUFFICIENT_MEMORY;
ixmlNamedNodeMap_init(*nnMap); }
} ixmlNamedNodeMap_init( *nnMap );
if ((*nnMap)->nodeItem == NULL) { }
(*nnMap)->nodeItem = add;
} else {
traverse = *nnMap;
p = traverse;
while (traverse != NULL) {
p = traverse;
traverse = traverse->next;
}
newItem = (IXML_NamedNodeMap *)malloc(sizeof (IXML_NamedNodeMap));
if (newItem == NULL) {
return IXML_INSUFFICIENT_MEMORY;
}
p->next = newItem;
newItem->nodeItem = add;
newItem->next = NULL;
}
return IXML_SUCCESS; if( ( *nnMap )->nodeItem == NULL ) {
( *nnMap )->nodeItem = add;
} else {
traverse = *nnMap;
p = traverse;
while( traverse != NULL ) {
p = traverse;
traverse = traverse->next;
}
newItem =
( IXML_NamedNodeMap * ) malloc( sizeof( IXML_NamedNodeMap ) );
if( newItem == NULL ) {
return IXML_INSUFFICIENT_MEMORY;
}
p->next = newItem;
newItem->nodeItem = add;
newItem->next = NULL;
}
return IXML_SUCCESS;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,152 +1,176 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
/*!
* \file
*/
#include "ixmlparser.h" #include "ixmlparser.h"
/*================================================================
#include <assert.h> * ixmlNodeList_init
#include <string.h> * initializes a nodelist
* External function.
*
void ixmlNodeList_init(IXML_NodeList *nList) *=================================================================*/
void
ixmlNodeList_init( IXML_NodeList * nList )
{ {
assert(nList != NULL); assert( nList != NULL );
memset( nList, 0, sizeof( IXML_NodeList ) );
memset(nList, 0, sizeof (IXML_NodeList));
} }
/*================================================================
IXML_Node *ixmlNodeList_item( * ixmlNodeList_item
IXML_NodeList *nList, * Returns the indexth item in the collection. If index is greater
unsigned long index) * than or equal to the number of nodes in the list, this returns
* null.
* External function.
*
*=================================================================*/
IXML_Node *
ixmlNodeList_item( IXML_NodeList * nList,
unsigned long index )
{ {
IXML_NodeList *next; IXML_NodeList *next;
unsigned int i; unsigned int i;
// if the list ptr is NULL // if the list ptr is NULL
if (nList == NULL) { if( nList == NULL ) {
return NULL; return NULL;
} }
// if index is more than list length // if index is more than list length
if (index > ixmlNodeList_length(nList) - 1) { if( index > ixmlNodeList_length( nList ) - 1 ) {
return NULL; return NULL;
} }
next = nList; next = nList;
for (i = 0; i < index && next != NULL; ++i) { for( i = 0; i < index && next != NULL; ++i ) {
next = next->next; next = next->next;
} }
if (next == NULL) { if( next == NULL ) return NULL;
return NULL;
} return next->nodeItem;
return next->nodeItem;
} }
int ixmlNodeList_addToNodeList( /*================================================================
IXML_NodeList **nList, * ixmlNodeList_addToNodeList
IXML_Node *add) * Add a node to nodelist
* Internal to parser only.
*
*=================================================================*/
int
ixmlNodeList_addToNodeList( IN IXML_NodeList ** nList,
IN IXML_Node * add )
{ {
IXML_NodeList *traverse = NULL; IXML_NodeList *traverse,
IXML_NodeList *p = NULL; *p = NULL;
IXML_NodeList *newListItem; IXML_NodeList *newListItem;
assert(add != NULL); assert( add != NULL );
if (add == NULL) { if( add == NULL ) {
return IXML_FAILED; return IXML_FAILED;
} }
if (*nList == NULL) { if( *nList == NULL ) // nodelist is empty
// nodelist is empty {
*nList = (IXML_NodeList *)malloc(sizeof (IXML_NodeList)); *nList = ( IXML_NodeList * ) malloc( sizeof( IXML_NodeList ) );
if (*nList == NULL) { if( *nList == NULL ) {
return IXML_INSUFFICIENT_MEMORY; return IXML_INSUFFICIENT_MEMORY;
} }
ixmlNodeList_init(*nList); ixmlNodeList_init( *nList );
} }
if ((*nList)->nodeItem == NULL) { if( ( *nList )->nodeItem == NULL ) {
(*nList)->nodeItem = add; ( *nList )->nodeItem = add;
} else { } else {
traverse = *nList; traverse = *nList;
while (traverse != NULL) { while( traverse != NULL ) {
p = traverse; p = traverse;
traverse = traverse->next; traverse = traverse->next;
} }
newListItem = (IXML_NodeList *)malloc(sizeof (IXML_NodeList)); newListItem =
if (newListItem == NULL) { ( IXML_NodeList * ) malloc( sizeof( IXML_NodeList ) );
return IXML_INSUFFICIENT_MEMORY; if( newListItem == NULL ) {
} return IXML_INSUFFICIENT_MEMORY;
p->next = newListItem; }
newListItem->nodeItem = add; p->next = newListItem;
newListItem->next = NULL; newListItem->nodeItem = add;
} newListItem->next = NULL;
}
return IXML_SUCCESS; return IXML_SUCCESS;
} }
/*================================================================
unsigned long ixmlNodeList_length(IXML_NodeList *nList) * ixmlNodeList_length
* Returns the number of nodes in the list. The range of valid
* child node indices is 0 to length-1 inclusive.
* External function.
*
*=================================================================*/
unsigned long
ixmlNodeList_length( IN IXML_NodeList * nList )
{ {
IXML_NodeList *list; IXML_NodeList *list;
unsigned long length = 0; unsigned long length = 0;
list = nList; list = nList;
while (list != NULL) { while( list != NULL ) {
++length; ++length;
list = list->next; list = list->next;
} }
return length; return length;
} }
/*================================================================
void ixmlNodeList_free(IXML_NodeList *nList) * ixmlNodeList_free
* frees a nodeList
* External function
*
*=================================================================*/
void
ixmlNodeList_free( IN IXML_NodeList * nList )
{ {
IXML_NodeList *next; IXML_NodeList *next;
while( nList != NULL ) {
next = nList->next;
free( nList );
nList = next;
}
while (nList != NULL) {
next = nList->next;
free(nList);
nList = next;
}
} }

0
ixml/test/test_document.sh Executable file → Normal file
View File

View File

@@ -6,6 +6,7 @@ includedir=@includedir@
Name: libupnp Name: libupnp
Description: Linux SDK for UPnP Devices Description: Linux SDK for UPnP Devices
Version: @VERSION@ Version: @VERSION@
Libs: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml Libs: @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml
Cflags: @PTHREAD_CFLAGS@ -I${includedir}/upnp Cflags: @PTHREAD_CFLAGS@ -I${includedir}

View File

@@ -1,4 +1,4 @@
Version: 1.6.6 Version: 1.4.2
Summary: Universal Plug and Play (UPnP) SDK Summary: Universal Plug and Play (UPnP) SDK
Name: libupnp Name: libupnp
Release: 1%{?dist} Release: 1%{?dist}
@@ -77,12 +77,6 @@ make install DESTDIR=$RPM_BUILD_ROOT
rm -rf %{buildroot} rm -rf %{buildroot}
%changelog %changelog
* Mon Nov 19 2007 Marcelo Jimenez <mroberto@users.sourceforge.net> - 1.6.2-1
- Update to version 1.6.2
* Mon Nov 19 2007 Marcelo Jimenez <mroberto@users.sourceforge.net> - 1.4.7-1
- Update to version 1.4.7
* Fri Feb 02 2007 Eric Tanguy <eric.tanguy@univ-nantes.fr> - 1.4.2-1 * Fri Feb 02 2007 Eric Tanguy <eric.tanguy@univ-nantes.fr> - 1.4.2-1
- Update to version 1.4.2 - Update to version 1.4.2

View File

@@ -1,88 +1,50 @@
##### http://autoconf-archive.cryp.to/acx_pthread.html dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
# dnl
# SYNOPSIS dnl @summary figure out how to build C programs using POSIX threads
# dnl
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl This macro figures out how to build C programs using POSIX threads.
# dnl It sets the PTHREAD_LIBS output variable to the threads library and
# DESCRIPTION dnl linker flags, and the PTHREAD_CFLAGS output variable to any special
# dnl C compiler flags that are needed. (The user can also force certain
# This macro figures out how to build C programs using POSIX threads. dnl compiler flags/libs to be tested by setting these environment
# It sets the PTHREAD_LIBS output variable to the threads library and dnl variables.)
# linker flags, and the PTHREAD_CFLAGS output variable to any special dnl
# C compiler flags that are needed. (The user can also force certain dnl Also sets PTHREAD_CC to any special C compiler that is needed for
# compiler flags/libs to be tested by setting these environment dnl multi-threaded programs (defaults to the value of CC otherwise).
# variables.) dnl (This is necessary on AIX to use the special cc_r compiler alias.)
# dnl
# Also sets PTHREAD_CC to any special C compiler that is needed for dnl NOTE: You are assumed to not only compile your program with these
# multi-threaded programs (defaults to the value of CC otherwise). dnl flags, but also link it with them as well. e.g. you should link
# (This is necessary on AIX to use the special cc_r compiler alias.) dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
# dnl $LIBS
# NOTE: You are assumed to not only compile your program with these dnl
# flags, but also link it with them as well. e.g. you should link dnl If you are only building threads programs, you may wish to use
# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS dnl these variables in your default LIBS, CFLAGS, and CC:
# $LIBS dnl
# dnl LIBS="$PTHREAD_LIBS $LIBS"
# If you are only building threads programs, you may wish to use dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# these variables in your default LIBS, CFLAGS, and CC: dnl CC="$PTHREAD_CC"
# dnl
# LIBS="$PTHREAD_LIBS $LIBS" dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
# CC="$PTHREAD_CC" dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
# dnl
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
# dnl default action will define HAVE_PTHREAD.
# ACTION-IF-FOUND is a list of shell commands to run if a threads dnl
# library is found, and ACTION-IF-NOT-FOUND is a list of commands to dnl Please let the authors know if this macro fails on any platform, or
# run it if it is not found. If ACTION-IF-FOUND is not specified, the dnl if you have any other suggestions or comments. This macro was based
# default action will define HAVE_PTHREAD. dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
# dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
# Please let the authors know if this macro fails on any platform, or dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
# if you have any other suggestions or comments. This macro was based dnl We are also grateful for the helpful feedback of numerous users.
# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) dnl
# (with help from M. Frigo), as well as ac_pthread and hb_pthread dnl @category InstalledPackages
# macros posted by Alejandro Forero Cuervo to the autoconf macro dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
# repository. We are also grateful for the helpful feedback of dnl @version 2005-06-15
# numerous users. dnl @license GPLWithACException
#
# LAST MODIFICATION
#
# 2006-05-29
#
# COPYLEFT
#
# Copyright (c) 2006 Steven G. Johnson <stevenj@alum.mit.edu>
#
# 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 the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# As a special exception, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([ACX_PTHREAD], [ AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
@@ -254,12 +216,8 @@ if test "x$acx_pthread_ok" = xyes; then
LIBS="$save_LIBS" LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS" CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with xlc_r or cc_r # More AIX lossage: must compile with cc_r
if test x"$GCC" != xyes; then AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
else
PTHREAD_CC=$CC
fi
else else
PTHREAD_CC="$CC" PTHREAD_CC="$CC"
fi fi

View File

@@ -1,87 +1,48 @@
##### http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html dnl @synopsis AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
# dnl
# SYNOPSIS dnl AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like
# dnl "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the
# AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]]) dnl optionflag to CFLAGS if it is understood. You can override the
# dnl shellvar-default of CFLAGS of course. The order of arguments stems
# DESCRIPTION dnl from the explicit macros like AX_CFLAGS_WARN_ALL.
# dnl
# AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like dnl The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add
# "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the dnl to CXXFLAGS - and it uses the autoconf setup for C++ instead of C
# optionflag to CFLAGS if it is understood. You can override the dnl (since it is possible to use different compilers for C and C++).
# shellvar-default of CFLAGS of course. The order of arguments stems dnl
# from the explicit macros like AX_CFLAGS_WARN_ALL. dnl The macro is a lot simpler than any special AX_CFLAGS_* macro (or
# dnl ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
# The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add dnl However, if you use this macro in a few places, it would be great
# to CXXFLAGS - and it uses the autoconf setup for C++ instead of C dnl if you would make up a new function-macro and submit it to the
# (since it is possible to use different compilers for C and C++). dnl ac-archive.
# dnl
# The macro is a lot simpler than any special AX_CFLAGS_* macro (or dnl - $1 option-to-check-for : required ("-option" as non-value)
# ac_cxx_rtti.m4 macro) but allows to check for arbitrary options. dnl - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
# However, if you use this macro in a few places, it would be great dnl - $3 action-if-found : add value to shellvariable
# if you would make up a new function-macro and submit it to the dnl - $4 action-if-not-found : nothing
# ac-archive. dnl
# dnl note: in earlier versions, $1-$2 were swapped. We try to detect the
# - $1 option-to-check-for : required ("-option" as non-value) dnl situation and accept a $2=~/-/ as being the old
# - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case) dnl option-to-check-for.
# - $3 action-if-found : add value to shellvariable dnl
# - $4 action-if-not-found : nothing dnl also: there are other variants that emerged from the original macro
# dnl variant which did just test an option to be possibly added.
# note: in earlier versions, $1-$2 were swapped. We try to detect the dnl However, some compilers accept an option silently, or possibly for
# situation and accept a $2=~/-/ as being the old dnl just another option that was not intended. Therefore, we have to do
# option-to-check-for. dnl a generic test for a compiler family. For gcc we check "-pedantic"
# dnl being accepted which is also understood by compilers who just want
# also: there are other variants that emerged from the original macro dnl to be compatible with gcc even when not being made from gcc
# variant which did just test an option to be possibly added. dnl sources.
# However, some compilers accept an option silently, or possibly for dnl
# just another option that was not intended. Therefore, we have to do dnl see also:
# a generic test for a compiler family. For gcc we check "-pedantic" dnl
# being accepted which is also understood by compilers who just want dnl AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION
# to be compatible with gcc even when not being made from gcc dnl AX_CFLAGS_AIX_OPTION AX_CFLAGS_IRIX_OPTION
# sources. dnl
# dnl @category C
# see also: dnl @author Guido Draheim <guidod@gmx.de>
# dnl @version 2003-11-04
# AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION dnl @license GPLWithACException
# AX_CFLAGS_AIX_OPTION AX_CFLAGS_IRIX_OPTION
#
# LAST MODIFICATION
#
# 2006-12-12
#
# COPYLEFT
#
# Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
#
# 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 the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# As a special exception, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
@@ -92,8 +53,7 @@ VAR,[VAR="no, unknown"
AC_LANG_C AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS" ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl for ac_arg dnl
in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
"-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
# #
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;], AC_TRY_COMPILE([],[return 0;],
@@ -125,11 +85,10 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)], AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown" VAR,[VAR="no, unknown"
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS" ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl for ac_arg dnl
in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
"-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
# #
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;], AC_TRY_COMPILE([],[return 0;],
@@ -163,8 +122,7 @@ VAR,[VAR="no, unknown"
AC_LANG_C AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS" ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl for ac_arg dnl
in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
"-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
# #
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;], AC_TRY_COMPILE([],[return 0;],
@@ -196,11 +154,10 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)], AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown" VAR,[VAR="no, unknown"
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS" ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl for ac_arg dnl
in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
"-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
# #
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;], AC_TRY_COMPILE([],[return 0;],

View File

@@ -1,66 +1,27 @@
##### http://autoconf-archive.cryp.to/ax_cflags_warn_all.html dnl @synopsis AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
# dnl
# SYNOPSIS dnl Try to find a compiler option that enables most reasonable
# dnl warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] dnl which is split up into two AX_CFLAGS_WARN_ALL and
# dnl AX_CFLAGS_WARN_ALL_ANSI
# DESCRIPTION dnl
# dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
# Try to find a compiler option that enables most reasonable dnl result is added to the shellvar being CFLAGS by default.
# warnings. This macro is directly derived from VL_PROG_CC_WARNINGS dnl
# which is split up into two AX_CFLAGS_WARN_ALL and dnl Currently this macro knows about GCC, Solaris C compiler, Digital
# AX_CFLAGS_WARN_ALL_ANSI dnl Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
# dnl compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The dnl 10.0.0.8) C compiler.
# result is added to the shellvar being CFLAGS by default. dnl
# dnl - $1 shell-variable-to-add-to : CFLAGS
# Currently this macro knows about GCC, Solaris C compiler, Digital dnl - $2 add-value-if-not-found : nothing
# Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C dnl - $3 action-if-found : add value to shellvariable
# compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos dnl - $4 action-if-not-found : nothing
# 10.0.0.8) C compiler. dnl
# dnl @category C
# - $1 shell-variable-to-add-to : CFLAGS dnl @author Guido Draheim <guidod@gmx.de>
# - $2 add-value-if-not-found : nothing dnl @version 2003-01-06
# - $3 action-if-found : add value to shellvariable dnl @license GPLWithACException
# - $4 action-if-not-found : nothing
#
# LAST MODIFICATION
#
# 2006-12-12
#
# COPYLEFT
#
# Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
#
# 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 the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# As a special exception, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
@@ -111,7 +72,7 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
VAR,[VAR="no, unknown" VAR,[VAR="no, unknown"
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS" ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl for ac_arg dnl
in "-pedantic % -Wall" dnl GCC in "-pedantic % -Wall" dnl GCC
@@ -154,5 +115,4 @@ dnl compilers will fail about it. That was needed since a lot of
dnl compilers will give false positives for some option-syntax dnl compilers will give false positives for some option-syntax
dnl like -Woption or -Xoption as they think of it is a pass-through dnl like -Woption or -Xoption as they think of it is a pass-through
dnl to later compile stages or something. The "%" is used as a dnl to later compile stages or something. The "%" is used as a
dnl delimimiter. A non-option comment can be given after "%%" marks dnl delimimiter. A non-option comment can be given after "%%" marks.
dnl which will be shown but not added to the respective C/CXXFLAGS.

View File

@@ -1,66 +1,27 @@
##### http://autoconf-archive.cryp.to/ax_cflags_warn_all_ansi.html dnl @synopsis AX_CFLAGS_WARN_ALL_ANSI [(shellvar [,default, [A/NA]])]
# dnl
# SYNOPSIS dnl Try to find a compiler option that enables most reasonable
# dnl warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
# AX_CFLAGS_WARN_ALL_ANSI [(shellvar [,default, [A/NA]])] dnl which is split up into two AX_CFLAGS_WARN_ALL and
# dnl AX_CFLAGS_WARN_ALL_ANSI
# DESCRIPTION dnl
# dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
# Try to find a compiler option that enables most reasonable dnl result is added to the shellvar being CFLAGS by default.
# warnings. This macro is directly derived from VL_PROG_CC_WARNINGS dnl
# which is split up into two AX_CFLAGS_WARN_ALL and dnl Currently this macro knows about GCC, Solaris C compiler, Digital
# AX_CFLAGS_WARN_ALL_ANSI dnl Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
# dnl compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The dnl 10.0.0.8) C compiler.
# result is added to the shellvar being CFLAGS by default. dnl
# dnl - $1 shell-variable-to-add-to : CFLAGS
# Currently this macro knows about GCC, Solaris C compiler, Digital dnl - $2 add-value-if-not-found : nothing
# Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C dnl - $3 action-if-found : add value to shellvariable
# compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos dnl - $4 action-if-not-found : nothing
# 10.0.0.8) C compiler. dnl
# dnl @category C
# - $1 shell-variable-to-add-to : CFLAGS dnl @author Guido Draheim <guidod@gmx.de>
# - $2 add-value-if-not-found : nothing dnl @version 2003-01-06
# - $3 action-if-found : add value to shellvariable dnl @license GPLWithACException
# - $4 action-if-not-found : nothing
#
# LAST MODIFICATION
#
# 2006-12-12
#
# COPYLEFT
#
# Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
#
# 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 the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# As a special exception, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([AX_CFLAGS_WARN_ALL_ANSI],[dnl AC_DEFUN([AX_CFLAGS_WARN_ALL_ANSI],[dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
@@ -116,7 +77,7 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all_ansi])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings], AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
VAR,[VAR="no, unknown" VAR,[VAR="no, unknown"
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS" ac_save_[]FLAGS="$[]FLAGS"
# IRIX C compiler: # IRIX C compiler:
# -use_readonly_const is the default for IRIX C, # -use_readonly_const is the default for IRIX C,

View File

@@ -41,7 +41,7 @@ AC_DEFUN([RT_BOOL_ARG_ENABLE],[
)]) )])
test "x$enable_[$1]" != [x]m4_if([$2],[yes],[no],[yes]) dnl test "x$enable_[$1]" != [x]m4_if([$2],[yes],[no],[yes]) dnl
&& enable_[]Name=[$2] && enable_[]Name=[$2]
AC_MSG_RESULT($enable_[]Name) AC_MSG_RESULT($enable_[]Name)dnl
AM_CONDITIONAL([ENABLE_]NAME, test x"$enable_[]Name" = xyes) AM_CONDITIONAL([ENABLE_]NAME, test x"$enable_[]Name" = xyes)
dnl dnl
m4_popdef([NAME])dnl m4_popdef([NAME])dnl

View File

@@ -1,52 +1,13 @@
##### http://autoconf-archive.cryp.to/type_socklen_t.html dnl @synopsis TYPE_SOCKLEN_T
# dnl
# SYNOPSIS dnl Check whether sys/socket.h defines type socklen_t. Please note that
# dnl some systems require sys/types.h to be included before sys/socket.h
# TYPE_SOCKLEN_T dnl can be compiled.
# dnl
# DESCRIPTION dnl @category Misc
# dnl @author Lars Brinkhoff <lars@nocrew.org>
# Check whether sys/socket.h defines type socklen_t. Please note that dnl @version 2005-01-11
# some systems require sys/types.h to be included before sys/socket.h dnl @license GPLWithACException
# can be compiled.
#
# LAST MODIFICATION
#
# 2005-01-11
#
# COPYLEFT
#
# Copyright (c) 2005 Lars Brinkhoff <lars@nocrew.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 the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# As a special exception, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([TYPE_SOCKLEN_T], AC_DEFUN([TYPE_SOCKLEN_T],
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, [AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,

View File

@@ -1,14 +0,0 @@
.deps
.dirstamp
.libs
.*.swp
*~
Makefile
Makefile.in
aclocal.m4
autoconfig.h*
autom4te.cache
config*
libtool
libupnp.pc
stamp-h*

View File

@@ -6,6 +6,7 @@
# #
AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc
AM_CFLAGS = $(PTHREAD_CFLAGS)
if ENABLE_DEBUG if ENABLE_DEBUG
AM_CPPFLAGS += -DDEBUG -DSTATS AM_CPPFLAGS += -DDEBUG -DSTATS
@@ -20,11 +21,12 @@ libthreadutil_la_LDFLAGS = -version-info $(LT_VERSION_THREADUTIL)
libthreadutil_la_SOURCES = \ libthreadutil_la_SOURCES = \
src/FreeList.c src/LinkedList.c \ src/FreeList.c src/LinkedList.c \
src/ThreadPool.c src/TimerThread.c src/ThreadPool.c src/TimerThread.c \
src/iasnprintf.c
upnpincludedir = $(includedir)/upnp upnpincludedir = $(includedir)/upnp
upnpinclude_HEADERS = \ upnpinclude_HEADERS = \
inc/FreeList.h inc/LinkedList.h \ inc/FreeList.h inc/LinkedList.h \
inc/ThreadPool.h inc/TimerThread.h \ inc/ThreadPool.h inc/TimerThread.h \
inc/ithread.h inc/iasnprintf.h inc/ithread.h

View File

@@ -1,52 +1,45 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* * Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef FREE_LIST_H #ifndef FREE_LIST_H
#define FREE_LIST_H #define FREE_LIST_H
/*!
* \file
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
//#include <malloc.h>
#include "ithread.h" #include "ithread.h"
#include <errno.h> #include <errno.h>
/**************************************************************************** /****************************************************************************
@@ -59,7 +52,7 @@ extern "C" {
*****************************************************************************/ *****************************************************************************/
typedef struct FREELISTNODE typedef struct FREELISTNODE
{ {
struct FREELISTNODE *next; struct FREELISTNODE*next; //pointer to next free node
} FreeListNode; } FreeListNode;
@@ -72,10 +65,12 @@ typedef struct FREELISTNODE
*****************************************************************************/ *****************************************************************************/
typedef struct FREELIST typedef struct FREELIST
{ {
FreeListNode *head; FreeListNode *head; //head of free list
size_t element_size; size_t element_size; //size of elements in free
int maxFreeListLength; //list
int freeListLength; int maxFreeListLength; //max size of free structures
//to keep
int freeListLength; //current size of free list
}FreeList; }FreeList;
@@ -146,5 +141,4 @@ int FreeListDestroy (FreeList *free_list);
} }
#endif #endif
#endif /* FREE_LIST_H */ #endif // FREE_LIST_H

View File

@@ -1,60 +1,49 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* * Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef LINKED_LIST_H #ifndef LINKED_LIST_H
#define LINKED_LIST_H #define LINKED_LIST_H
/*!
* \file
*/
#include "FreeList.h" #include "FreeList.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define EOUTOFMEM (-7 & 1<<29) #define EOUTOFMEM (-7 & 1<<29)
#define FREELISTSIZE 100 #define FREELISTSIZE 100
#define LIST_SUCCESS 1 #define LIST_SUCCESS 1
#define LIST_FAIL 0 #define LIST_FAIL 0
/**************************************************************************** /****************************************************************************
* Name: free_routine * Name: free_routine
* *
@@ -63,7 +52,6 @@ extern "C" {
*****************************************************************************/ *****************************************************************************/
typedef void (*free_function)(void *arg); typedef void (*free_function)(void *arg);
/**************************************************************************** /****************************************************************************
* Name: cmp_routine * Name: cmp_routine
* *
@@ -73,7 +61,6 @@ typedef void (*free_function)(void *arg);
*****************************************************************************/ *****************************************************************************/
typedef int (*cmp_routine)(void *itemA,void *itemB); typedef int (*cmp_routine)(void *itemA,void *itemB);
/**************************************************************************** /****************************************************************************
* Name: ListNode * Name: ListNode
* *
@@ -83,12 +70,11 @@ typedef int (*cmp_routine)(void *itemA,void *itemB);
*****************************************************************************/ *****************************************************************************/
typedef struct LISTNODE typedef struct LISTNODE
{ {
struct LISTNODE *prev; struct LISTNODE *prev; //previous node
struct LISTNODE *next; struct LISTNODE *next; //next node
void *item; void *item; //item
} ListNode; } ListNode;
/**************************************************************************** /****************************************************************************
* Name: LinkedList * Name: LinkedList
* *
@@ -110,15 +96,14 @@ typedef struct LISTNODE
*****************************************************************************/ *****************************************************************************/
typedef struct LINKEDLIST typedef struct LINKEDLIST
{ {
ListNode head; /* head, first item is stored at: head->next */ ListNode head; //head, first item is stored at: head->next
ListNode tail; /* tail, last item is stored at: tail->prev */ ListNode tail; //tail, last item is stored at: tail->prev
long size; /* size of list */ long size; //size of list
FreeList freeNodeList; /* free list to use */ FreeList freeNodeList; //free list to use
free_function free_func; /* free function to use */ free_function free_func; //free function to use
cmp_routine cmp_func; /* compare function to use */ cmp_routine cmp_func; //compare function to use
} LinkedList; } LinkedList;
/**************************************************************************** /****************************************************************************
* Function: ListInit * Function: ListInit
* *
@@ -134,7 +119,6 @@ typedef struct LINKEDLIST
*****************************************************************************/ *****************************************************************************/
int ListInit(LinkedList *list,cmp_routine cmp_func, free_function free_func); int ListInit(LinkedList *list,cmp_routine cmp_func, free_function free_func);
/**************************************************************************** /****************************************************************************
* Function: ListAddHead * Function: ListAddHead
* *
@@ -151,7 +135,6 @@ int ListInit(LinkedList *list,cmp_routine cmp_func, free_function free_func);
*****************************************************************************/ *****************************************************************************/
ListNode *ListAddHead(LinkedList *list, void *item); ListNode *ListAddHead(LinkedList *list, void *item);
/**************************************************************************** /****************************************************************************
* Function: ListAddTail * Function: ListAddTail
* *
@@ -168,7 +151,6 @@ ListNode *ListAddHead(LinkedList *list, void *item);
*****************************************************************************/ *****************************************************************************/
ListNode *ListAddTail(LinkedList *list, void *item); ListNode *ListAddTail(LinkedList *list, void *item);
/**************************************************************************** /****************************************************************************
* Function: ListAddAfter * Function: ListAddAfter
* *
@@ -223,7 +205,6 @@ ListNode *ListAddBefore(LinkedList *list,void *item, ListNode *anode);
*****************************************************************************/ *****************************************************************************/
void *ListDelNode(LinkedList *list,ListNode *dnode, int freeItem); void *ListDelNode(LinkedList *list,ListNode *dnode, int freeItem);
/**************************************************************************** /****************************************************************************
* Function: ListDestroy * Function: ListDestroy
* *
@@ -259,7 +240,6 @@ int ListDestroy(LinkedList *list, int freeItem);
*****************************************************************************/ *****************************************************************************/
ListNode* ListHead(LinkedList *list); ListNode* ListHead(LinkedList *list);
/**************************************************************************** /****************************************************************************
* Function: ListTail * Function: ListTail
* *
@@ -276,7 +256,6 @@ ListNode* ListHead(LinkedList *list);
*****************************************************************************/ *****************************************************************************/
ListNode* ListTail(LinkedList *list); ListNode* ListTail(LinkedList *list);
/**************************************************************************** /****************************************************************************
* Function: ListNext * Function: ListNext
* *
@@ -293,7 +272,6 @@ ListNode* ListTail(LinkedList *list);
*****************************************************************************/ *****************************************************************************/
ListNode* ListNext(LinkedList *list, ListNode * node); ListNode* ListNext(LinkedList *list, ListNode * node);
/**************************************************************************** /****************************************************************************
* Function: ListPrev * Function: ListPrev
* *
@@ -310,7 +288,6 @@ ListNode* ListNext(LinkedList *list, ListNode * node);
*****************************************************************************/ *****************************************************************************/
ListNode* ListPrev(LinkedList *list, ListNode * node); ListNode* ListPrev(LinkedList *list, ListNode * node);
/**************************************************************************** /****************************************************************************
* Function: ListFind * Function: ListFind
* *
@@ -330,7 +307,6 @@ ListNode* ListPrev(LinkedList *list, ListNode * node);
*****************************************************************************/ *****************************************************************************/
ListNode* ListFind(LinkedList *list, ListNode *start, void * item); ListNode* ListFind(LinkedList *list, ListNode *start, void * item);
/**************************************************************************** /****************************************************************************
* Function: ListSize * Function: ListSize
* *
@@ -351,5 +327,4 @@ int ListSize(LinkedList* list);
} }
#endif #endif
#endif /* LINKED_LIST_H */ #endif //LINKED_LIST_H

View File

@@ -1,162 +1,107 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* * Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef THREADPOOL_H #ifndef THREADPOOL_H
#define THREADPOOL_H #define THREADPOOL_H
/*!
* \file
*/
#include "FreeList.h"
#include "ithread.h"
#include "LinkedList.h"
#include "UpnpInet.h"
#include "UpnpGlobal.h" /* for UPNP_INLINE, EXPORT_SPEC */
#include <errno.h>
#ifdef WIN32
#include <time.h>
struct timezone
{
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};
int gettimeofday(struct timeval *tv, struct timezone *tz);
#else /* WIN32 */
#include <sys/param.h>
#include <sys/time.h> /* for gettimeofday() */
#if defined(__OSX__) || defined(__APPLE__) || defined(__NetBSD__)
#include <sys/resource.h> /* for setpriority() */
#endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
//Size of job free list
/*! Size of job free list */
#define JOBFREELISTSIZE 100 #define JOBFREELISTSIZE 100
#define INFINITE_THREADS -1 #define INFINITE_THREADS -1
#define EMAXTHREADS (-8 & 1<<29) #define EMAXTHREADS (-8 & 1<<29)
//Invalid Policy
/*! Invalid Policy */
#define INVALID_POLICY (-9 & 1<<29) #define INVALID_POLICY (-9 & 1<<29)
//Invalid JOB Id
/*! Invalid JOB Id */
#define INVALID_JOB_ID (-2 & 1<<29) #define INVALID_JOB_ID (-2 & 1<<29)
typedef enum duration {SHORT_TERM,PERSISTENT} Duration;
typedef enum duration { typedef enum priority {LOW_PRIORITY,
SHORT_TERM, MED_PRIORITY,
PERSISTENT HIGH_PRIORITY} ThreadPriority;
} Duration;
#define DEFAULT_PRIORITY MED_PRIORITY //default priority used by TPJobInit
#define DEFAULT_MIN_THREADS 1 //default minimum used by TPAttrInit
#define DEFAULT_MAX_THREADS 10 //default max used by TPAttrInit
#define DEFAULT_JOBS_PER_THREAD 10 //default jobs per thread used by TPAttrInit
#define DEFAULT_STARVATION_TIME 500 //default starvation time used by TPAttrInit
#define DEFAULT_IDLE_TIME 10 * 1000 //default idle time used by TPAttrInit
#define DEFAULT_FREE_ROUTINE NULL //default free routine used TPJobInit
#define DEFAULT_MAX_JOBS_TOTAL 100 //default max jobs used TPAttrInit
#define STATS 1 //always include stats because code change is minimal
typedef enum priority { //Statistics
LOW_PRIORITY, #ifdef WIN32 // todo: check why STATSONLY fails during compilation
MED_PRIORITY, #undef STATS
HIGH_PRIORITY
} ThreadPriority;
/*! default priority used by TPJobInit */
#define DEFAULT_PRIORITY MED_PRIORITY
/*! default minimum used by TPAttrInit */
#define DEFAULT_MIN_THREADS 1
/*! default max used by TPAttrInit */
#define DEFAULT_MAX_THREADS 10
/*! default jobs per thread used by TPAttrInit */
#define DEFAULT_JOBS_PER_THREAD 10
/*! default starvation time used by TPAttrInit */
#define DEFAULT_STARVATION_TIME 500
/*! default idle time used by TPAttrInit */
#define DEFAULT_IDLE_TIME 10 * 1000
/*! default free routine used TPJobInit */
#define DEFAULT_FREE_ROUTINE NULL
/*! default max jobs used TPAttrInit */
#define DEFAULT_MAX_JOBS_TOTAL 100
/*!
* \brief Statistics.
*
* Always include stats because code change is minimal.
*/
#define STATS 1
#ifdef _DEBUG
#define DEBUG 1
#endif #endif
#ifdef STATS
#define STATSONLY(x) x
#else
#define STATSONLY(x)
#endif
#ifdef _DEBUG
#define DEBUG 1
#endif
//DEBUGGING
#ifndef WIN32
#ifdef DEBUG
#define DBGONLY(x) x
#else
#define DBGONLY(x)
#endif
#endif
#include "LinkedList.h"
#include <sys/timeb.h>
#include "FreeList.h"
#include "ithread.h"
#include <errno.h>
#include <sys/timeb.h>
#define EXPORT
typedef int PolicyType; typedef int PolicyType;
#define DEFAULT_POLICY SCHED_OTHER #define DEFAULT_POLICY SCHED_OTHER
#define DEFAULT_SCHED_PARAM 0 //default priority
/*! Default priority */
#define DEFAULT_SCHED_PARAM 0
/**************************************************************************** /****************************************************************************
* Name: free_routine * Name: free_routine
@@ -166,7 +111,6 @@ typedef int PolicyType;
*****************************************************************************/ *****************************************************************************/
typedef void (*free_routine)(void *arg); typedef void (*free_routine)(void *arg);
/**************************************************************************** /****************************************************************************
* Name: ThreadPoolAttr * Name: ThreadPoolAttr
* *
@@ -176,31 +120,28 @@ typedef void (*free_routine)(void *arg);
*****************************************************************************/ *****************************************************************************/
typedef struct THREADPOOLATTR typedef struct THREADPOOLATTR
{ {
/* minThreads, ThreadPool will always maintain at least this many threads */ int minThreads; // minThreads, ThreadPool will always maintain at least
int minThreads; // this many threads
/* maxThreads, ThreadPool will never have more than this number of threads */ int maxThreads; // maxThreads, ThreadPool will never have more than this
int maxThreads; // number of threads
/* maxIdleTime (in milliseconds) this is the maximum time a thread will int maxIdleTime; // maxIdleTime (in milliseconds)
* remain idle before dying */ // this is the maximum time a thread will remain idle
int maxIdleTime; // before dying
/* jobs per thread to maintain */ int jobsPerThread; // jobs per thread to maintain
int jobsPerThread;
/* maximum number of jobs that can be queued totally. */ int maxJobsTotal; // maximum number of jobs that can be queued totally.
int maxJobsTotal;
/* the time a low priority or med priority job waits before getting bumped int starvationTime; // the time a low priority or med priority
* up a priority (in milliseconds) */ // job waits before getting bumped
int starvationTime; // up a priority (in milliseconds)
PolicyType schedPolicy; // scheduling policy to use
/* scheduling policy to use */
PolicyType schedPolicy;
} ThreadPoolAttr; } ThreadPoolAttr;
/**************************************************************************** /****************************************************************************
* Name: ThreadPool * Name: ThreadPool
* *
@@ -209,82 +150,94 @@ typedef struct THREADPOOLATTR
*****************************************************************************/ *****************************************************************************/
typedef struct THREADPOOLJOB typedef struct THREADPOOLJOB
{ {
start_routine func; start_routine func; //function
void *arg; void *arg; //arg
free_routine free_func; free_routine free_func; //free function
struct timeval requestTime; struct timeb requestTime; //time of request
int priority; int priority; //priority of request
int jobId; int jobId; //id
} ThreadPoolJob; } ThreadPoolJob;
/**************************************************************************** /****************************************************************************
* Name: ThreadPoolStats * Name: ThreadPoolStats
* *
* Description: * Description:
* Structure to hold statistics * Structure to hold statistics
*****************************************************************************/ *****************************************************************************/
STATSONLY(
typedef struct TPOOLSTATS typedef struct TPOOLSTATS
{ {
double totalTimeHQ; double totalTimeHQ; //total time spent by all jobs in high priority Q
int totalJobsHQ; int totalJobsHQ; //total jobs in HQ run so far
double avgWaitHQ; double avgWaitHQ; //average wait in HQ
double totalTimeMQ; double totalTimeMQ; //total time spent by all jobs in med priority Q
int totalJobsMQ; int totalJobsMQ; //total jobs in MQ run so far
double avgWaitMQ; double avgWaitMQ; //average wait in MQ
double totalTimeLQ; double totalTimeLQ; //total time spent by all jobs in low priority Q
int totalJobsLQ; int totalJobsLQ; //total jobs in LQ run so far
double avgWaitLQ; double avgWaitLQ; //average wait in LQ
double totalWorkTime; double totalWorkTime; //total time spent working for all threads
double totalIdleTime; double totalIdleTime; //total time spent idle for all threads
int workerThreads; int workerThreads; //number of current workerThreads
int idleThreads; int idleThreads; //number of current idle threads
int persistentThreads; int persistentThreads; //number of persistent threads
int totalThreads; int totalThreads; //total number of current threads
int maxThreads; int maxThreads; //max threads so far
int currentJobsHQ; int currentJobsHQ; // current jobs in Q
int currentJobsLQ; int currentJobsLQ; //current jobs in Q
int currentJobsMQ; int currentJobsMQ; //current jobs in Q
} ThreadPoolStats; }ThreadPoolStats;
)
/*! /****************************************************************************
* \brief A thread pool similar to the thread pool in the UPnP SDK. * Name: ThreadPool
* *
* Allows jobs to be scheduled for running by threads in a * Description:
* thread pool. The thread pool is initialized with a * A thread pool similar to the thread pool in the UPnP SDK.
* minimum and maximum thread number as well as a max idle time * Allows jobs to be scheduled for running by threads in a
* and a jobs per thread ratio. If a worker thread waits the whole * thread pool. The thread pool is initialized with a
* max idle time without receiving a job and the thread pool * minimum and maximum thread number as well as a
* currently has more threads running than the minimum * max idle time
* then the worker thread will exit. If when * and a jobs per thread ratio. If a worker thread waits the whole
* scheduling a job the current job to thread ratio * max idle time without receiving a job and the thread pool
* becomes greater than the set ratio and the thread pool currently has * currently has more threads running than the minimum
* less than the maximum threads then a new thread will * then the worker thread will exit. If when
* be created. * scheduling a job the current job to thread ratio
*/ * becomes greater than the set ratio and the thread pool currently has
* less than the maximum threads then a new thread will
* be created.
*
*****************************************************************************/
typedef struct THREADPOOL typedef struct THREADPOOL
{ {
ithread_mutex_t mutex; /* mutex to protect job qs */ ithread_mutex_t mutex; //mutex to protect job qs
ithread_cond_t condition; /* condition variable to signal Q */ ithread_cond_t condition; //condition variable to signal Q
ithread_cond_t start_and_shutdown; /* condition variable for start and stop */ ithread_cond_t start_and_shutdown; //condition variable for start
int lastJobId; /* ids for jobs */ //and stop
int shutdown; /* whether or not we are shutting down */ int lastJobId; //ids for jobs
int totalThreads; /* total number of threads */ int shutdown; //whether or not we are shutting down
int busyThreads; /* number of threads that are currently executing jobs */ int totalThreads; //total number of threads
int persistentThreads; /* number of persistent threads */ int persistentThreads; //number of persistent threads
FreeList jobFreeList; /* free list of jobs */ FreeList jobFreeList; //free list of jobs
LinkedList lowJobQ; /* low priority job Q */ LinkedList lowJobQ; //low priority job Q
LinkedList medJobQ; /* med priority job Q */ LinkedList medJobQ; //med priority job Q
LinkedList highJobQ; /* high priority job Q */ LinkedList highJobQ; //high priority job Q
ThreadPoolJob *persistentJob; /* persistent job */ ThreadPoolJob *persistentJob; //persistent job
ThreadPoolAttr attr; /* thread pool attributes */
ThreadPoolAttr attr; //thread pool attributes
/* statistics */
ThreadPoolStats stats; //statistics
STATSONLY(ThreadPoolStats stats;)
} ThreadPool; } ThreadPool;
/**************************************************************************** /****************************************************************************
* Function: ThreadPoolInit * Function: ThreadPoolInit
* *
@@ -321,8 +274,8 @@ typedef struct THREADPOOL
* INVALID_POLICY if schedPolicy can't be set * INVALID_POLICY if schedPolicy can't be set
* EMAXTHREADS if minimum threads is greater than maximum threads * EMAXTHREADS if minimum threads is greater than maximum threads
*****************************************************************************/ *****************************************************************************/
int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr); int ThreadPoolInit(ThreadPool *tp,
ThreadPoolAttr *attr);
/**************************************************************************** /****************************************************************************
* Function: ThreadPoolAddPersistent * Function: ThreadPoolAddPersistent
@@ -344,8 +297,9 @@ int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr);
* EOUTOFMEM not enough memory to add job. * EOUTOFMEM not enough memory to add job.
* EMAXTHREADS not enough threads to add persistent job. * EMAXTHREADS not enough threads to add persistent job.
*****************************************************************************/ *****************************************************************************/
int ThreadPoolAddPersistent(ThreadPool*tp, ThreadPoolJob *job, int *jobId); int ThreadPoolAddPersistent (ThreadPool*tp,
ThreadPoolJob *job,
int *jobId);
/**************************************************************************** /****************************************************************************
* Function: ThreadPoolGetAttr * Function: ThreadPoolGetAttr
@@ -360,9 +314,8 @@ int ThreadPoolAddPersistent(ThreadPool*tp, ThreadPoolJob *job, int *jobId);
* 0 on success, nonzero on failure * 0 on success, nonzero on failure
* Always returns 0. * Always returns 0.
*****************************************************************************/ *****************************************************************************/
int ThreadPoolGetAttr(ThreadPool *tp, ThreadPoolAttr *out); int ThreadPoolGetAttr(ThreadPool *tp,
ThreadPoolAttr *out);
/**************************************************************************** /****************************************************************************
* Function: ThreadPoolSetAttr * Function: ThreadPoolSetAttr
* *
@@ -376,8 +329,8 @@ int ThreadPoolGetAttr(ThreadPool *tp, ThreadPoolAttr *out);
* 0 on success, nonzero on failure * 0 on success, nonzero on failure
* Returns INVALID_POLICY if policy can not be set. * Returns INVALID_POLICY if policy can not be set.
*****************************************************************************/ *****************************************************************************/
int ThreadPoolSetAttr(ThreadPool *tp, ThreadPoolAttr *attr); int ThreadPoolSetAttr(ThreadPool *tp,
ThreadPoolAttr *attr);
/**************************************************************************** /****************************************************************************
* Function: ThreadPoolAdd * Function: ThreadPoolAdd
@@ -396,8 +349,9 @@ int ThreadPoolSetAttr(ThreadPool *tp, ThreadPoolAttr *attr);
* 0 on success, nonzero on failure * 0 on success, nonzero on failure
* EOUTOFMEM if not enough memory to add job. * EOUTOFMEM if not enough memory to add job.
*****************************************************************************/ *****************************************************************************/
int ThreadPoolAdd (ThreadPool*tp, ThreadPoolJob *job, int *jobId); int ThreadPoolAdd (ThreadPool*tp,
ThreadPoolJob *job,
int *jobId);
/**************************************************************************** /****************************************************************************
* Function: ThreadPoolRemove * Function: ThreadPoolRemove
@@ -414,7 +368,8 @@ int ThreadPoolAdd (ThreadPool*tp, ThreadPoolJob *job, int *jobId);
* 0 on success, nonzero on failure. * 0 on success, nonzero on failure.
* INVALID_JOB_ID if job not found. * INVALID_JOB_ID if job not found.
*****************************************************************************/ *****************************************************************************/
int ThreadPoolRemove(ThreadPool *tp, int jobId, ThreadPoolJob *out); int ThreadPoolRemove(ThreadPool *tp,
int jobId, ThreadPoolJob *out);
@@ -451,7 +406,6 @@ int ThreadPoolShutdown(ThreadPool *tp);
*****************************************************************************/ *****************************************************************************/
int TPJobInit(ThreadPoolJob *job, start_routine func, void *arg); int TPJobInit(ThreadPoolJob *job, start_routine func, void *arg);
/**************************************************************************** /****************************************************************************
* Function: TPJobSetPriority * Function: TPJobSetPriority
* *
@@ -465,7 +419,6 @@ int TPJobInit(ThreadPoolJob *job, start_routine func, void *arg);
*****************************************************************************/ *****************************************************************************/
int TPJobSetPriority(ThreadPoolJob *job, ThreadPriority priority); int TPJobSetPriority(ThreadPoolJob *job, ThreadPriority priority);
/**************************************************************************** /****************************************************************************
* Function: TPJobSetFreeFunction * Function: TPJobSetFreeFunction
* *
@@ -493,7 +446,6 @@ int TPJobSetFreeFunction(ThreadPoolJob *job, free_routine func);
*****************************************************************************/ *****************************************************************************/
int TPAttrInit(ThreadPoolAttr *attr); int TPAttrInit(ThreadPoolAttr *attr);
/**************************************************************************** /****************************************************************************
* Function: TPAttrSetMaxThreads * Function: TPAttrSetMaxThreads
* *
@@ -507,7 +459,6 @@ int TPAttrInit(ThreadPoolAttr *attr);
*****************************************************************************/ *****************************************************************************/
int TPAttrSetMaxThreads(ThreadPoolAttr *attr, int maxThreads); int TPAttrSetMaxThreads(ThreadPoolAttr *attr, int maxThreads);
/**************************************************************************** /****************************************************************************
* Function: TPAttrSetMinThreads * Function: TPAttrSetMinThreads
* *
@@ -521,7 +472,6 @@ int TPAttrSetMaxThreads(ThreadPoolAttr *attr, int maxThreads);
*****************************************************************************/ *****************************************************************************/
int TPAttrSetMinThreads(ThreadPoolAttr *attr, int minThreads); int TPAttrSetMinThreads(ThreadPoolAttr *attr, int minThreads);
/**************************************************************************** /****************************************************************************
* Function: TPAttrSetIdleTime * Function: TPAttrSetIdleTime
* *
@@ -534,7 +484,6 @@ int TPAttrSetMinThreads(ThreadPoolAttr *attr, int minThreads);
*****************************************************************************/ *****************************************************************************/
int TPAttrSetIdleTime(ThreadPoolAttr *attr, int idleTime); int TPAttrSetIdleTime(ThreadPoolAttr *attr, int idleTime);
/**************************************************************************** /****************************************************************************
* Function: TPAttrSetJobsPerThread * Function: TPAttrSetJobsPerThread
* *
@@ -548,7 +497,6 @@ int TPAttrSetIdleTime(ThreadPoolAttr *attr, int idleTime);
*****************************************************************************/ *****************************************************************************/
int TPAttrSetJobsPerThread(ThreadPoolAttr *attr, int jobsPerThread); int TPAttrSetJobsPerThread(ThreadPoolAttr *attr, int jobsPerThread);
/**************************************************************************** /****************************************************************************
* Function: TPAttrSetStarvationTime * Function: TPAttrSetStarvationTime
* *
@@ -562,7 +510,6 @@ int TPAttrSetJobsPerThread(ThreadPoolAttr *attr, int jobsPerThread);
*****************************************************************************/ *****************************************************************************/
int TPAttrSetStarvationTime(ThreadPoolAttr *attr, int starvationTime); int TPAttrSetStarvationTime(ThreadPoolAttr *attr, int starvationTime);
/**************************************************************************** /****************************************************************************
* Function: TPAttrSetSchedPolicy * Function: TPAttrSetSchedPolicy
* *
@@ -590,7 +537,6 @@ int TPAttrSetSchedPolicy(ThreadPoolAttr *attr, PolicyType schedPolicy);
*****************************************************************************/ *****************************************************************************/
int TPAttrSetMaxJobsTotal(ThreadPoolAttr *attr, int maxJobsTotal); int TPAttrSetMaxJobsTotal(ThreadPoolAttr *attr, int maxJobsTotal);
/**************************************************************************** /****************************************************************************
* Function: ThreadPoolGetStats * Function: ThreadPoolGetStats
* *
@@ -604,21 +550,12 @@ int TPAttrSetMaxJobsTotal(ThreadPoolAttr *attr, int maxJobsTotal);
* Returns: * Returns:
* Always returns 0. * Always returns 0.
*****************************************************************************/ *****************************************************************************/
#ifdef STATS STATSONLY( EXPORT int ThreadPoolGetStats(ThreadPool *tp, ThreadPoolStats *stats););
EXPORT_SPEC int ThreadPoolGetStats(ThreadPool *tp, ThreadPoolStats *stats);
EXPORT_SPEC void ThreadPoolPrintStats(ThreadPoolStats *stats);
#else
static UPNP_INLINE int ThreadPoolGetStats(ThreadPool *tp, ThreadPoolStats *stats) {}
static UPNP_INLINE void ThreadPoolPrintStats(ThreadPoolStats *stats) {}
#endif
STATSONLY(EXPORT void ThreadPoolPrintStats(ThreadPoolStats *stats););
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif //ThreadPool
#endif /* THREADPOOL_H */

View File

@@ -1,171 +1,191 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* * Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef TIMERTHREAD_H #ifndef TIMERTHREAD_H
#define TIMERTHREAD_H #define TIMERTHREAD_H
/*!
* \file
*/
#include "FreeList.h"
#include "ithread.h" #include "ithread.h"
#include "LinkedList.h" #include "LinkedList.h"
#include "FreeList.h"
#include "ThreadPool.h" #include "ThreadPool.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define INVALID_EVENT_ID (-10 & 1<<29) #define INVALID_EVENT_ID (-10 & 1<<29)
//Timeout Types
/* Timeout Types */ //absolute means in seconds from Jan 1, 1970
/* absolute means in seconds from Jan 1, 1970 */ //relative means in seconds from current time
/* relative means in seconds from current time */
typedef enum timeoutType {ABS_SEC,REL_SEC} TimeoutType; typedef enum timeoutType {ABS_SEC,REL_SEC} TimeoutType;
/*! /****************************************************************************
* A timer thread similar to the one in the Upnp SDK that allows * Name: TimerThread
* the scheduling of a job to run at a specified time in the future. *
* * Description:
* Because the timer thread uses the thread pool there is no * A timer thread similar to the one in the Upnp SDK that allows
* gurantee of timing, only approximate timing. * the scheduling of a job to run at a specified time in the future
* * Because the timer thread uses the thread pool there is no
* Uses ThreadPool, Mutex, Condition, Thread. * gurantee of timing, only approximate timing.
*/ * Uses ThreadPool, Mutex, Condition, Thread
*
*
*****************************************************************************/
typedef struct TIMERTHREAD typedef struct TIMERTHREAD
{ {
ithread_mutex_t mutex; ithread_mutex_t mutex; //mutex to protect eventQ
ithread_cond_t condition; ithread_cond_t condition; //condition variable
int lastEventId; int lastEventId; //last event id
LinkedList eventQ; LinkedList eventQ; //event q
int shutdown; int shutdown; //whether or not we are shutdown
FreeList freeEvents; FreeList freeEvents; //FreeList for events
ThreadPool *tp; ThreadPool *tp; //ThreadPool to use
} TimerThread; } TimerThread;
/*! /****************************************************************************
* Struct to contain information for a timer event. * Name: TimerEvent
* *
* Internal to the TimerThread. * Description:
*/ *
* Struct to contain information for a timer event.
* Internal to the TimerThread
*
*****************************************************************************/
typedef struct TIMEREVENT typedef struct TIMEREVENT
{ {
ThreadPoolJob job; ThreadPoolJob job;
/*! [in] Absolute time for event in seconds since Jan 1, 1970. */ time_t eventTime; //absolute time for event in seconds since Jan 1, 1970
time_t eventTime; Duration persistent; //long term or short term job
/*! [in] Long term or short term job. */ int id; //id of job
Duration persistent;
int id;
} TimerEvent; } TimerEvent;
/*!
* \brief Initializes and starts timer thread.
*
* \return 0 on success, nonzero on failure. Returns error from
* ThreadPoolAddPersistent on failure.
*/
int TimerThreadInit(
/*! [in] Valid timer thread pointer. */
TimerThread *timer,
/*! [in] Valid thread pool to use. Must be started. Must be valid for
* lifetime of timer. Timer must be shutdown BEFORE thread pool. */
ThreadPool *tp);
/*! /************************************************************************
* \brief Schedules an event to run at a specified time. * Function: TimerThreadInit
*
* Description:
* Initializes and starts timer thread.
* *
* \return 0 on success, nonzero on failure, EOUTOFMEM if not enough memory * Parameters:
* to schedule job. * timer - valid timer thread pointer.
*/ * tp - valid thread pool to use. Must be
int TimerThreadSchedule( * started. Must be valid for lifetime
/*! [in] Valid timer thread pointer. */ * of timer. Timer must be shutdown
TimerThread* timer, * BEFORE thread pool.
/*! [in] time of event. Either in absolute seconds, or relative * Return:
* seconds in the future. */ * 0 on success, nonzero on failure
time_t time, * Returns error from ThreadPoolAddPersistent on failure.
/*! [in] either ABS_SEC, or REL_SEC. If REL_SEC, then the event *
* will be scheduled at the current time + REL_SEC. */ ************************************************************************/
TimeoutType type, int TimerThreadInit(TimerThread *timer,
/*! [in] Valid Thread pool job with following fields. */ ThreadPool *tp);
ThreadPoolJob *job,
/*! [in] . */
Duration duration,
/*! [in] Id of timer event. (out, can be null). */
int *id);
/*! /************************************************************************
* \brief Removes an event from the timer Q. * Function: TimerThreadSchedule
*
* Description:
* Schedules an event to run at a specified time.
* *
* Events can only be removed before they have been placed in the thread pool. * Parameters:
* timer - valid timer thread pointer.
* time_t - time of event.
* either in absolute seconds,
* or relative seconds in the future.
* timeoutType - either ABS_SEC, or REL_SEC.
* if REL_SEC, then the event
* will be scheduled at the
* current time + REL_SEC.
* job-> valid Thread pool job with following fields
* func - function to schedule
* arg - argument to function
* priority - priority of job.
*
* id - id of timer event. (out, can be null)
* Return:
* 0 on success, nonzero on failure
* EOUTOFMEM if not enough memory to schedule job.
* *
* \return 0 on success, INVALID_EVENT_ID on failure. ************************************************************************/
*/ int TimerThreadSchedule(TimerThread* timer,
int TimerThreadRemove( time_t time,
/*! [in] Valid timer thread pointer. */ TimeoutType type,
TimerThread *timer, ThreadPoolJob *job,
/*! [in] Id of event to remove. */ Duration duration,
int id, int *id);
/*! [in] Space for thread pool job. */
ThreadPoolJob *out);
/************************************************************************
* Function: TimerThreadRemove
*
* Description:
* Removes an event from the timer Q.
* Events can only be removed
* before they have been placed in the
* thread pool.
*
* Parameters:
* timer - valid timer thread pointer.
* id - id of event to remove.
* ThreadPoolJob *out - space for thread pool job.
* Return:
* 0 on success,
* INVALID_EVENT_ID on failure
*
************************************************************************/
int TimerThreadRemove(TimerThread *timer,
int id,
ThreadPoolJob *out);
/*! /************************************************************************
* \brief Shutdown the timer thread. * Function: TimerThreadShutdown
* *
* Events scheduled in the future will NOT be run. * Description:
* * Shutdown the timer thread
* Timer thread should be shutdown BEFORE it's associated thread pool. * Events scheduled in the future will NOT be run.
* * Timer thread should be shutdown BEFORE it's associated
* \return 0 if succesfull, nonzero otherwise. Always returns 0. * thread pool.
*/ * Returns:
int TimerThreadShutdown( * returns 0 if succesfull,
/*! [in] Valid timer thread pointer. */ * nonzero otherwise.
TimerThread *timer); * Always returns 0.
***********************************************************************/
int TimerThreadShutdown(TimerThread *timer);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* TIMER_THREAD_H */ #endif //TIMER_THREAD_H

View File

@@ -0,0 +1,66 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2003 Intel Corporation
// 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 name of Intel Corporation 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 INTEL 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 <stdarg.h>
#define EXPORT
#ifdef __cplusplus
extern "C" {
#endif
/**
* Allocates enough memory for the
* Formatted string, up to max
* specified.
* With max set to -1, allocates
* as much size as needed.
* Memory must be freed using free.
*/
EXPORT int iasnprintf(char **ret,
int incr,
int max,
const char * fmt, ...)
#ifndef SPARC_SOLARIS
#if (__GNUC__ >= 3)
__attribute__((format (__printf__, 4, 5)));
#else
;
#endif
EXPORT void iasnprintfFree(char *);
#else
;
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -1,309 +1,164 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* * Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef ITHREAD_H
#define ITHREAD_H
/*!
* \file
*/
#if !defined(WIN32)
#include <sys/param.h>
#endif
#include "UpnpGlobal.h" /* For UPNP_INLINE, EXPORT_SPEC */
#ifndef ITHREADH
#define ITHREADH
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <pthread.h> #ifdef DEBUG
#ifdef WIN32 #define DEBUG_ONLY(x) x
/* Do not #include <unistd.h> */
#else #else
#include <unistd.h> #define DEBUG_ONLY(x)
#endif #endif
#include <pthread.h>
#if defined(BSD) #ifndef WIN32
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE #include <unistd.h>
#endif #endif
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
#ifdef PTHREAD_MUTEX_RECURSIVE #define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
/* This system has SuS2-compliant mutex attributes. #define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
* E.g. on Cygwin, where we don't have the old nonportable (NP) symbols
*/
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_NORMAL
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
#else /* PTHREAD_MUTEX_RECURSIVE */
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
#endif /* PTHREAD_MUTEX_RECURSIVE */
#define ITHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE
#define ITHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED
#define ITHREAD_CANCELED PTHREAD_CANCELED #define ITHREAD_CANCELED PTHREAD_CANCELED
/***************************************************************************
* Name: ithread_t
*
* Description:
* Thread handle.
* typedef to pthread_t.
* Internal Use Only.
***************************************************************************/
typedef pthread_t ithread_t;
/****************************************************************************
* Name: ithread_attr_t
*
* Description:
* Thread attribute.
* typedef to pthread_attr_t
* Internal Use Only
***************************************************************************/
typedef pthread_attr_t ithread_attr_t;
/****************************************************************************
* Name: start_routine
*
* Description:
* Thread start routine
* Internal Use Only.
***************************************************************************/
typedef void * (*start_routine) (void *arg);
/*************************************************************************** /****************************************************************************
* Name: ithread_t * Name: ithread_cond_t
* *
* Description: * Description:
* Thread handle. * condition variable.
* typedef to pthread_t. * typedef to pthread_cond_t
* Internal Use Only. * Internal Use Only.
***************************************************************************/ ***************************************************************************/
typedef pthread_t ithread_t; typedef pthread_cond_t ithread_cond_t;
/****************************************************************************
* Name: ithread_mutexattr_t
*
* Description:
* Mutex attribute.
* typedef to pthread_mutexattr_t
* Internal Use Only
***************************************************************************/
typedef pthread_mutexattr_t ithread_mutexattr_t;
/****************************************************************************
* Name: ithread_mutex_t
*
* Description:
* Mutex.
* typedef to pthread_mutex_t
* Internal Use Only.
***************************************************************************/
typedef pthread_mutex_t ithread_mutex_t;
/****************************************************************************
* Name: ithread_condattr_t
*
* Description:
* Condition attribute.
* typedef to pthread_condattr_t
* NOT USED
* Internal Use Only
***************************************************************************/
typedef pthread_condattr_t ithread_condattr_t;
/****************************************************************************
* Function: ithread_mutexattr_init
*
* Description:
* Initializes a mutex attribute variable.
* Used to set the type of the mutex.
* Parameters:
* ithread_mutexattr_init * attr (must be valid non NULL pointer to
* pthread_mutexattr_t)
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_mutexattr_init
***************************************************************************/
/****************************************************************************
* Name: ithread_attr_t
*
* Description:
* Thread attribute.
* typedef to pthread_attr_t
* Internal Use Only
***************************************************************************/
typedef pthread_attr_t ithread_attr_t;
/****************************************************************************
* Name: start_routine
*
* Description:
* Thread start routine
* Internal Use Only.
***************************************************************************/
typedef void *(*start_routine)(void *arg);
/****************************************************************************
* Name: ithread_cond_t
*
* Description:
* condition variable.
* typedef to pthread_cond_t
* Internal Use Only.
***************************************************************************/
typedef pthread_cond_t ithread_cond_t;
/****************************************************************************
* Name: ithread_mutexattr_t
*
* Description:
* Mutex attribute.
* typedef to pthread_mutexattr_t
* Internal Use Only
***************************************************************************/
typedef pthread_mutexattr_t ithread_mutexattr_t;
/****************************************************************************
* Name: ithread_mutex_t
*
* Description:
* Mutex.
* typedef to pthread_mutex_t
* Internal Use Only.
***************************************************************************/
typedef pthread_mutex_t ithread_mutex_t;
/****************************************************************************
* Name: ithread_condattr_t
*
* Description:
* Condition attribute.
* typedef to pthread_condattr_t
* NOT USED
* Internal Use Only
***************************************************************************/
typedef pthread_condattr_t ithread_condattr_t;
/****************************************************************************
* Name: ithread_rwlockattr_t
*
* Description:
* Mutex attribute.
* typedef to pthread_rwlockattr_t
* Internal Use Only
***************************************************************************/
typedef pthread_rwlockattr_t ithread_rwlockattr_t;
/****************************************************************************
* Name: ithread_rwlock_t
*
* Description:
* Condition attribute.
* typedef to pthread_rwlock_t
* Internal Use Only
***************************************************************************/
typedef pthread_rwlock_t ithread_rwlock_t;
/****************************************************************************
* Function: ithread_initialize_library
*
* Description:
* Initializes the library. Does nothing in all implementations, except
* when statically linked for WIN32.
* Parameters:
* none.
* Returns:
* 0 on success, Nonzero on failure.
***************************************************************************/
static UPNP_INLINE int ithread_initialize_library(void) {
int ret = 0;
#if defined(WIN32) && defined(PTW32_STATIC_LIB)
ret = !pthread_win32_process_attach_np();
#endif
return ret;
}
/****************************************************************************
* Function: ithread_cleanup_library
*
* Description:
* Clean up library resources. Does nothing in all implementations, except
* when statically linked for WIN32.
* Parameters:
* none.
* Returns:
* 0 on success, Nonzero on failure.
***************************************************************************/
static UPNP_INLINE int ithread_cleanup_library(void) {
int ret = 0;
#if defined(WIN32) && defined(PTW32_STATIC_LIB)
ret = !pthread_win32_process_detach_np();
#endif
return ret;
}
/****************************************************************************
* Function: ithread_initialize_thread
*
* Description:
* Initializes the thread. Does nothing in all implementations, except
* when statically linked for WIN32.
* Parameters:
* none.
* Returns:
* 0 on success, Nonzero on failure.
***************************************************************************/
static UPNP_INLINE int ithread_initialize_thread(void) {
int ret = 0;
#if defined(WIN32) && defined(PTW32_STATIC_LIB)
ret = !pthread_win32_thread_attach_np();
#endif
return ret;
}
/****************************************************************************
* Function: ithread_cleanup_thread
*
* Description:
* Clean up thread resources. Does nothing in all implementations, except
* when statically linked for WIN32.
* Parameters:
* none.
* Returns:
* 0 on success, Nonzero on failure.
***************************************************************************/
static UPNP_INLINE int ithread_cleanup_thread(void) {
int ret = 0;
#if defined(WIN32) && defined(PTW32_STATIC_LIB)
ret = !pthread_win32_thread_detach_np();
#endif
return ret;
}
/****************************************************************************
* Function: ithread_mutexattr_init
*
* Description:
* Initializes a mutex attribute variable.
* Used to set the type of the mutex.
* Parameters:
* ithread_mutexattr_init * attr (must be valid non NULL pointer to
* pthread_mutexattr_t)
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_mutexattr_init
***************************************************************************/
#define ithread_mutexattr_init pthread_mutexattr_init #define ithread_mutexattr_init pthread_mutexattr_init
/****************************************************************************
/**************************************************************************** * Function: ithread_mutexattr_destroy
* Function: ithread_mutexattr_destroy *
* * Description:
* Description: * Releases any resources held by the mutex attribute.
* Releases any resources held by the mutex attribute. * Currently there are no resources associated with the attribute
* Currently there are no resources associated with the attribute * Parameters:
* Parameters: * ithread_mutexattr_t * attr (must be valid non NULL pointer to
* ithread_mutexattr_t * attr (must be valid non NULL pointer to * pthread_mutexattr_t)
* pthread_mutexattr_t) * Returns:
* Returns: * 0 on success, Nonzero on failure.
* 0 on success, Nonzero on failure. * Always returns 0.
* Always returns 0. * See man page for pthread_mutexattr_destroy
* See man page for pthread_mutexattr_destroy ***************************************************************************/
***************************************************************************/
#define ithread_mutexattr_destroy pthread_mutexattr_destroy #define ithread_mutexattr_destroy pthread_mutexattr_destroy
@@ -317,7 +172,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* ITHREAD_MUTEX_ERRORCHECK_NP * ITHREAD_MUTEX_ERRORCHECK_NP
* *
* Parameters: * Parameters:
* ithread_mutexattr_t * attr (must be valid non NULL pointer to * ithread_mutexattr_t * mutex (must be valid non NULL pointer to
* ithread_mutexattr_t) * ithread_mutexattr_t)
* int kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP * int kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP
* or ITHREAD_MUTEX_ERRORCHECK_NP) * or ITHREAD_MUTEX_ERRORCHECK_NP)
@@ -326,11 +181,8 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* Returns EINVAL if the kind is not supported. * Returns EINVAL if the kind is not supported.
* See man page for pthread_mutexattr_setkind_np * See man page for pthread_mutexattr_setkind_np
*****************************************************************************/ *****************************************************************************/
#ifdef PTHREAD_MUTEX_RECURSIVE #define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
#else
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
#endif
/**************************************************************************** /****************************************************************************
* Function: ithread_mutexattr_getkind_np * Function: ithread_mutexattr_getkind_np
@@ -342,7 +194,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* ITHREAD_MUTEX_ERRORCHECK_NP * ITHREAD_MUTEX_ERRORCHECK_NP
* *
* Parameters: * Parameters:
* ithread_mutexattr_t * attr (must be valid non NULL pointer to * ithread_mutexattr_t * mutex (must be valid non NULL pointer to
* pthread_mutexattr_t) * pthread_mutexattr_t)
* int *kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP * int *kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP
* or ITHREAD_MUTEX_ERRORCHECK_NP) * or ITHREAD_MUTEX_ERRORCHECK_NP)
@@ -351,11 +203,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* Always returns 0. * Always returns 0.
* See man page for pthread_mutexattr_getkind_np * See man page for pthread_mutexattr_getkind_np
*****************************************************************************/ *****************************************************************************/
#ifdef PTHREAD_MUTEX_RECURSIVE #define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
#else
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
#endif
/**************************************************************************** /****************************************************************************
@@ -374,8 +222,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* See man page for pthread_mutex_init * See man page for pthread_mutex_init
*****************************************************************************/ *****************************************************************************/
#define ithread_mutex_init pthread_mutex_init #define ithread_mutex_init pthread_mutex_init
/**************************************************************************** /****************************************************************************
* Function: ithread_mutex_lock * Function: ithread_mutex_lock
* *
@@ -429,170 +276,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
*****************************************************************************/ *****************************************************************************/
#define ithread_mutex_destroy pthread_mutex_destroy #define ithread_mutex_destroy pthread_mutex_destroy
/****************************************************************************
* Function: ithread_rwlockattr_init
*
* Description:
* Initializes a rwlock attribute variable to default values.
* Parameters:
* const ithread_rwlockattr_init *attr (must be valid non NULL pointer to
* pthread_rwlockattr_t)
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_rwlockattr_init
***************************************************************************/
#define ithread_rwlockattr_init pthread_rwlockattr_init
/****************************************************************************
* Function: ithread_rwlockattr_destroy
*
* Description:
* Releases any resources held by the rwlock attribute.
* Parameters:
* ithread_rwlockattr_t *attr (must be valid non NULL pointer to
* pthread_rwlockattr_t)
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_rwlockattr_destroy
***************************************************************************/
#define ithread_rwlockattr_destroy pthread_rwlockattr_destroy
/****************************************************************************
* Function: ithread_rwlockatttr_setpshared
*
* Description:
* Sets the rwlock type in the attribute.
* Valid types are: ITHREAD_PROCESS_PRIVATE
* ITHREAD_PROCESS_SHARED
*
* Parameters:
* ithread_rwlockattr_t * attr (must be valid non NULL pointer to
* ithread_rwlockattr_t)
* int kind (one of ITHREAD_PROCESS_PRIVATE or ITHREAD_PROCESS_SHARED)
*
* Returns:
* 0 on success. Nonzero on failure.
* Returns EINVAL if the kind is not supported.
* See man page for pthread_rwlockattr_setkind_np
*****************************************************************************/
#define ithread_rwlockatttr_setpshared pthread_rwlockatttr_setpshared
/****************************************************************************
* Function: ithread_rwlockatttr_getpshared
*
* Description:
* Gets the rwlock type in the attribute.
* Valid types are: ITHREAD_PROCESS_PRIVATE
* ITHREAD_PROCESS_SHARED
*
* Parameters:
* ithread_rwlockattr_t * attr (must be valid non NULL pointer to
* pthread_rwlockattr_t)
* int *kind (one of ITHREAD_PROCESS_PRIVATE or ITHREAD_PROCESS_SHARED)
*
* Returns:
* 0 on success. Nonzero on failure.
* Always returns 0.
* See man page for pthread_rwlockatttr_getpshared
*****************************************************************************/
#define ithread_rwlockatttr_getpshared pthread_rwlockatttr_getpshared
/****************************************************************************
* Function: ithread_rwlock_init
*
* Description:
* Initializes rwlock.
* Must be called before use.
*
* Parameters:
* ithread_rwlock_t *rwlock (must be valid non NULL pointer to pthread_rwlock_t)
* const ithread_rwlockattr_t *rwlock_attr
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_rwlock_init
*****************************************************************************/
#define ithread_rwlock_init pthread_rwlock_init
/****************************************************************************
* Function: ithread_rwlock_rdlock
*
* Description:
* Locks rwlock for reading.
* Parameters:
* ithread_rwlock_t *rwlock (must be valid non NULL pointer to pthread_rwlock_t)
* rwlock must be initialized.
*
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_rwlock_rdlock
*****************************************************************************/
#define ithread_rwlock_rdlock pthread_rwlock_rdlock
/****************************************************************************
* Function: ithread_rwlock_wrlock
*
* Description:
* Locks rwlock for writting.
* Parameters:
* ithread_rwlock_t *rwlock (must be valid non NULL pointer to pthread_rwlock_t)
* rwlock must be initialized.
*
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_rwlock_wrlock
*****************************************************************************/
#define ithread_rwlock_wrlock pthread_rwlock_wrlock
/****************************************************************************
* Function: ithread_rwlock_unlock
*
* Description:
* Unlocks rwlock.
*
* Parameters:
* ithread_rwlock_t *rwlock (must be valid non NULL pointer to pthread_rwlock_t)
* rwlock must be initialized.
*
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_rwlock_unlock
*****************************************************************************/
#define ithread_rwlock_unlock pthread_rwlock_unlock
/****************************************************************************
* Function: ithread_rwlock_destroy
*
* Description:
* Releases any resources held by the rwlock.
* rwlock can no longer be used after this call.
* rwlock is only destroyed when there are no longer any threads waiting on it.
* rwlock cannot be destroyed if it is locked.
* Parameters:
* ithread_rwlock_t *rwlock (must be valid non NULL pointer to pthread_rwlock_t)
* rwlock must be initialized.
* Returns:
* 0 on success. Nonzero on failure.
* Always returns 0.
* See man page for pthread_rwlock_destroy
*****************************************************************************/
#define ithread_rwlock_destroy pthread_rwlock_destroy
/**************************************************************************** /****************************************************************************
* Function: ithread_cond_init * Function: ithread_cond_init
* *
@@ -600,8 +284,8 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* Initializes condition variable. * Initializes condition variable.
* Must be called before use. * Must be called before use.
* Parameters: * Parameters:
* ithread_cond_t *cond (must be valid non NULL pointer to pthread_cond_t) * ithread_cond_t * cond (must be valid non NULL pointer to pthread_cond_t)
* const ithread_condattr_t *cond_attr (ignored) * const ithread_condattr_t * cond_attr (ignored)
* Returns: * Returns:
* 0 on success, Nonzero on failure. * 0 on success, Nonzero on failure.
* See man page for pthread_cond_init * See man page for pthread_cond_init
@@ -609,6 +293,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
#define ithread_cond_init pthread_cond_init #define ithread_cond_init pthread_cond_init
/**************************************************************************** /****************************************************************************
* Function: ithread_cond_signal * Function: ithread_cond_signal
* *
@@ -616,7 +301,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* Wakes up exactly one thread waiting on condition. * Wakes up exactly one thread waiting on condition.
* Associated mutex MUST be locked by thread before entering this call. * Associated mutex MUST be locked by thread before entering this call.
* Parameters: * Parameters:
* ithread_cond_t *cond (must be valid non NULL pointer to * ithread_cond_t * cond (must be valid non NULL pointer to
* ithread_cond_t) * ithread_cond_t)
* cond must be initialized * cond must be initialized
* Returns: * Returns:
@@ -633,7 +318,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* Wakes up all threads waiting on condition. * Wakes up all threads waiting on condition.
* Associated mutex MUST be locked by thread before entering this call. * Associated mutex MUST be locked by thread before entering this call.
* Parameters: * Parameters:
* ithread_cond_t *cond (must be valid non NULL pointer to * ithread_cond_t * cond (must be valid non NULL pointer to
* ithread_cond_t) * ithread_cond_t)
* cond must be initialized * cond must be initialized
* Returns: * Returns:
@@ -651,7 +336,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* Associated mutex MUST be locked by thread before entering this call. * Associated mutex MUST be locked by thread before entering this call.
* Mutex is reacquired when call returns. * Mutex is reacquired when call returns.
* Parameters: * Parameters:
* ithread_cond_t *cond (must be valid non NULL pointer to * ithread_cond_t * cond (must be valid non NULL pointer to
* ithread_cond_t) * ithread_cond_t)
* cond must be initialized * cond must be initialized
* ithread_mutex_t *mutex (must be valid non NULL pointer to * ithread_mutex_t *mutex (must be valid non NULL pointer to
@@ -667,19 +352,23 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
/**************************************************************************** /****************************************************************************
* Function: pthread_cond_timedwait * Function: pthread_cond_timedwait
* *
* Description: * Description:
* Atomically releases the associated mutex and waits on the * Atomically releases the associated mutex and waits on the condition.
* condition. * If the condition is not signaled in the specified time
* If the condition is not signaled in the specified time than the * than the
* call times out and returns. * call times out and returns.
* Associated mutex MUST be locked by thread before entering this call. * Associated mutex MUST be locked by thread before entering
* Mutex is reacquired when call returns. * this call.
* Mutex is reacquired when call returns.
* Parameters: * Parameters:
* ithread_cond_t *cond (must be valid non NULL pointer to ithread_cond_t) * ithread_cond_t * cond (must be valid non NULL pointer to
* cond must be initialized * ithread_cond_t)
* ithread_mutex_t *mutex (must be valid non NULL pointer to ithread_mutex_t) * cond must be initialized
* Mutex must be locked. * ithread_mutex_t *mutex (must be valid non NULL pointer to
* const struct timespec *abstime (absolute time, measured from Jan 1, 1970) * ithread_mutex_t)
* Mutex must be locked.
* const struct timespec *abstime (absolute time, measured
* from Jan 1, 1970)
* Returns: * Returns:
* 0 on success. ETIMEDOUT on timeout. Nonzero on failure. * 0 on success. ETIMEDOUT on timeout. Nonzero on failure.
* See man page for pthread_cond_timedwait * See man page for pthread_cond_timedwait
@@ -695,7 +384,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* Releases any resources held by the condition variable. * Releases any resources held by the condition variable.
* Condition variable can no longer be used after this call. * Condition variable can no longer be used after this call.
* Parameters: * Parameters:
* ithread_cond_t *cond (must be valid non NULL pointer to * ithread_cond_t * cond (must be valid non NULL pointer to
* ithread_cond_t) * ithread_cond_t)
* cond must be initialized. * cond must be initialized.
* Returns: * Returns:
@@ -751,7 +440,6 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
***************************************************************************/ ***************************************************************************/
#define ithread_exit pthread_exit #define ithread_exit pthread_exit
/**************************************************************************** /****************************************************************************
* Function: ithread_get_current_thread_id * Function: ithread_get_current_thread_id
* *
@@ -775,7 +463,6 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
***************************************************************************/ ***************************************************************************/
#define ithread_self pthread_self #define ithread_self pthread_self
/**************************************************************************** /****************************************************************************
* Function: ithread_detach * Function: ithread_detach
* *
@@ -789,7 +476,6 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
***************************************************************************/ ***************************************************************************/
#define ithread_detach pthread_detach #define ithread_detach pthread_detach
/**************************************************************************** /****************************************************************************
* Function: ithread_join * Function: ithread_join
* *
@@ -809,6 +495,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
#define ithread_join pthread_join #define ithread_join pthread_join
/**************************************************************************** /****************************************************************************
* Function: isleep * Function: isleep
* *
@@ -822,12 +509,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* 0 on success, Nonzero on failure. * 0 on success, Nonzero on failure.
* See man page for sleep (man 3 sleep) * See man page for sleep (man 3 sleep)
*****************************************************************************/ *****************************************************************************/
#ifdef WIN32 #define isleep sleep
#define isleep(x) Sleep((x)*1000)
#else
#define isleep sleep
#endif
/**************************************************************************** /****************************************************************************
* Function: isleep * Function: isleep
@@ -842,23 +524,29 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* 0 on success, Nonzero on failure. * 0 on success, Nonzero on failure.
* See man page for sleep (man 3 sleep) * See man page for sleep (man 3 sleep)
*****************************************************************************/ *****************************************************************************/
#define imillisleep(x) usleep(1000*x)
#ifdef WIN32 #ifdef WIN32
#define imillisleep Sleep #ifndef UPNP_STATIC_LIB
#ifdef LIBUPNP_EXPORTS
// set up declspec for dll export to make functions visible to library users
#define EXPORT_SPEC __declspec(dllexport)
#else
#define EXPORT_SPEC __declspec(dllimport)
#endif
#else
#define EXPORT_SPEC
#endif
#else #else
#define imillisleep(x) usleep(1000*x) #define EXPORT_SPEC
#endif #endif
#ifndef PTHREAD_MUTEX_RECURSIVE //NK: Added for satisfying the gcc compiler
/* NK: Added for satisfying the gcc compiler */
EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind); EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif //ITHREADH
#endif /* ITHREAD_H */

View File

@@ -1,55 +1,42 @@
/************************************************************************** ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
**************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#include "LinkedList.h" #include "LinkedList.h"
#ifdef __FreeBSD__
#include <stdlib.h>
#ifdef WIN32
/* Do not #include <sys/param.h> */
#else #else
#include <sys/param.h> #include <malloc.h>
#endif #endif
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__) || defined(__APPLE__)
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include <assert.h> #include <assert.h>
static int static int
freeListNode( ListNode * node, freeListNode( ListNode * node,
LinkedList * list ) LinkedList * list )
@@ -544,4 +531,3 @@ ListSize( LinkedList * list )
return list->size; return list->size;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,69 +1,68 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
/*!
* \file
*/
#include "TimerThread.h" #include "TimerThread.h"
#include <assert.h> #include <assert.h>
/****************************************************************************
/*! * Function: FreeTimerEvent
* \brief Deallocates a dynamically allocated TimerEvent. *
*/ * Description:
static void FreeTimerEvent( * Deallocates a dynamically allocated TimerEvent.
/*! [in] Valid timer thread pointer. */ * Parameters:
TimerThread *timer, * TimerEvent *event - must be allocated with CreateTimerEvent
/*! [in] Must be allocated with CreateTimerEvent*/ *****************************************************************************/
TimerEvent *event) static void
FreeTimerEvent( TimerThread * timer,
TimerEvent * event )
{ {
assert(timer != NULL);
FreeListFree(&timer->freeEvents, event); assert( timer != NULL );
FreeListFree( &timer->freeEvents, event );
} }
/****************************************************************************
/*! * Function: TimerThreadWorker
* \brief Implements timer thread.
* *
* Waits for next event to occur and schedules associated job into threadpool. * Description:
*/ * Implements timer thread.
static void *TimerThreadWorker( * Waits for next event to occur and schedules
/*! [in] arg is cast to (TimerThread *). */ * associated job into threadpool.
void *arg) * Internal Only.
* Parameters:
* void * arg -> is cast to TimerThread *
*****************************************************************************/
static void *
TimerThreadWorker( void *arg )
{ {
TimerThread *timer = ( TimerThread * ) arg; TimerThread *timer = ( TimerThread * ) arg;
ListNode *head = NULL; ListNode *head = NULL;
@@ -82,14 +81,19 @@ static void *TimerThreadWorker(
while( 1 ) while( 1 )
{ {
//mutex should always be locked at top of loop //mutex should always be locked at top of loop
//Check for shutdown //Check for shutdown
if( timer->shutdown ) if( timer->shutdown )
{ {
timer->shutdown = 0; timer->shutdown = 0;
ithread_cond_signal( &timer->condition ); ithread_cond_signal( &timer->condition );
ithread_mutex_unlock( &timer->mutex ); ithread_mutex_unlock( &timer->mutex );
return NULL; return NULL;
} }
nextEvent = NULL; nextEvent = NULL;
@@ -98,6 +102,7 @@ static void *TimerThreadWorker(
if( timer->eventQ.size > 0 ) if( timer->eventQ.size > 0 )
{ {
head = ListHead( &timer->eventQ ); head = ListHead( &timer->eventQ );
nextEvent = ( TimerEvent * ) head->item; nextEvent = ( TimerEvent * ) head->item;
nextEventTime = nextEvent->eventTime; nextEventTime = nextEvent->eventTime;
} }
@@ -105,42 +110,54 @@ static void *TimerThreadWorker(
currentTime = time( NULL ); currentTime = time( NULL );
//If time has elapsed, schedule job //If time has elapsed, schedule job
if( ( nextEvent != NULL ) && ( currentTime >= nextEventTime ) ) if( ( nextEvent != NULL ) && ( currentTime >= nextEventTime ) )
{ {
if( nextEvent->persistent ) { if( nextEvent->persistent ) {
ThreadPoolAddPersistent( timer->tp, &nextEvent->job, ThreadPoolAddPersistent( timer->tp, &nextEvent->job,
&tempId ); &tempId );
} else { } else {
ThreadPoolAdd( timer->tp, &nextEvent->job, &tempId ); ThreadPoolAdd( timer->tp, &nextEvent->job, &tempId );
} }
ListDelNode( &timer->eventQ, head, 0 ); ListDelNode( &timer->eventQ, head, 0 );
FreeTimerEvent( timer, nextEvent ); FreeTimerEvent( timer, nextEvent );
continue; continue;
} }
if( nextEvent != NULL ) { if( nextEvent != NULL ) {
timeToWait.tv_nsec = 0; timeToWait.tv_nsec = 0;
timeToWait.tv_sec = nextEvent->eventTime; timeToWait.tv_sec = nextEvent->eventTime;
ithread_cond_timedwait( &timer->condition, &timer->mutex, ithread_cond_timedwait( &timer->condition, &timer->mutex,
&timeToWait ); &timeToWait );
} else { } else {
ithread_cond_wait( &timer->condition, &timer->mutex ); ithread_cond_wait( &timer->condition, &timer->mutex );
} }
} }
} }
/****************************************************************************
/*! * Function: CalculateEventTime
* \brief Calculates the appropriate timeout in absolute seconds
* since Jan 1, 1970.
* *
* \return * Description:
*/ * Calculates the appropriate timeout in absolute seconds since
static int CalculateEventTime( * Jan 1, 1970
/*! [in] Timeout. */ * Internal Only.
time_t *timeout, * Parameters:
/*! [in] Timeout type. */ * time_t *timeout - timeout
TimeoutType type) *
*****************************************************************************/
static int
CalculateEventTime( time_t * timeout,
TimeoutType type )
{ {
time_t now; time_t now;
@@ -158,22 +175,29 @@ static int CalculateEventTime(
} }
/*! /****************************************************************************
* \brief Creates a Timer Event. (Dynamically allocated). * Function: CreateTimerEvent
* *
* \return (TimerEvent *) on success, NULL on failure. * Description:
*/ * Creates a Timer Event. (Dynamically allocated)
static TimerEvent *CreateTimerEvent( * Internal to timer thread.
/*! [in] Valid timer thread pointer. */ * Parameters:
TimerThread *timer, * func - thread function to run.
/*! [in] . */ * arg - argument to function.
ThreadPoolJob *job, * priority - priority of job.
/*! [in] . */ * eventTime - the absoule time of the event
Duration persistent, * in seconds from Jan, 1970
/*! [in] The absoule time of the event in seconds from Jan, 1970. */ * id - id of job
time_t eventTime, *
/*! [in] Id of job. */ * Returns:
int id) * TimerEvent * on success, NULL on failure.
****************************************************************************/
static TimerEvent *
CreateTimerEvent( TimerThread * timer,
ThreadPoolJob * job,
Duration persistent,
time_t eventTime,
int id )
{ {
TimerEvent *temp = NULL; TimerEvent *temp = NULL;
@@ -191,8 +215,25 @@ static TimerEvent *CreateTimerEvent(
return temp; return temp;
} }
/************************************************************************
int TimerThreadInit(TimerThread *timer, ThreadPool *tp) * Function: TimerThreadInit
*
* Description:
* Initializes and starts timer thread.
*
* Parameters:
* timer - valid timer thread pointer.
* tp - valid thread pool to use. Must be
* started. Must be valid for lifetime
* of timer. Timer must be shutdown
* BEFORE thread pool.
* Return:
* 0 on success, nonzero on failure
* Returns error from ThreadPoolAddPersistent if failure.
************************************************************************/
int
TimerThreadInit( TimerThread * timer,
ThreadPool * tp )
{ {
int rc = 0; int rc = 0;
@@ -249,14 +290,37 @@ int TimerThreadInit(TimerThread *timer, ThreadPool *tp)
} }
/************************************************************************
int TimerThreadSchedule( * Function: TimerThreadSchedule
TimerThread *timer, *
time_t timeout, * Description:
TimeoutType type, * Schedules an event to run at a specified time.
ThreadPoolJob *job, *
Duration duration, * Parameters:
int *id) * timer - valid timer thread pointer.
* time_t - time of event.
* either in absolute seconds,
* or relative seconds in the future.
* timeoutType - either ABS_SEC, or REL_SEC.
* if REL_SEC, then the event
* will be scheduled at the
* current time + REL_SEC.
*
* func - function to schedule
* arg - argument to function
* priority - priority of job.
* id - id of timer event. (out)
* Return:
* 0 on success, nonzero on failure
* EOUTOFMEM if not enough memory to schedule job
************************************************************************/
int
TimerThreadSchedule( TimerThread * timer,
time_t timeout,
TimeoutType type,
ThreadPoolJob * job,
Duration duration,
int *id )
{ {
int rc = EOUTOFMEM; int rc = EOUTOFMEM;
@@ -330,11 +394,28 @@ int TimerThreadSchedule(
return rc; return rc;
} }
/************************************************************************
int TimerThreadRemove( * Function: TimerThreadRemove
TimerThread *timer, *
int id, * Description:
ThreadPoolJob *out) * Removes an event from the timer Q.
* Events can only be removed
* before they have been placed in the
* thread pool.
*
* Parameters:
* timer - valid timer thread pointer.
* id - id of event to remove.
* out - space for returned job (Can be NULL)
* Return:
* 0 on success.
* INVALID_EVENT_ID on error.
*
************************************************************************/
int
TimerThreadRemove( TimerThread * timer,
int id,
ThreadPoolJob * out )
{ {
int rc = INVALID_EVENT_ID; int rc = INVALID_EVENT_ID;
ListNode *tempNode = NULL; ListNode *tempNode = NULL;
@@ -369,8 +450,21 @@ int TimerThreadRemove(
return rc; return rc;
} }
/************************************************************************
int TimerThreadShutdown(TimerThread *timer) * Function: TimerThreadShutdown
*
* Description:
* Shutdown the timer thread
* Events scheduled in the future will NOT be run.
* Timer thread should be shutdown BEFORE it's associated
* thread pool.
* Returns:
* returns 0 if succesfull,
* nonzero otherwise.
* Always returns 0.
***********************************************************************/
int
TimerThreadShutdown( TimerThread * timer )
{ {
ListNode *tempNode2 = NULL; ListNode *tempNode2 = NULL;
ListNode *tempNode = NULL; ListNode *tempNode = NULL;
@@ -423,4 +517,3 @@ int TimerThreadShutdown(TimerThread *timer)
return 0; return 0;
} }

152
threadutil/src/iasnprintf.c Normal file
View File

@@ -0,0 +1,152 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2003 Intel Corporation
// 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 name of Intel Corporation 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 INTEL 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 <stdarg.h>
#include <assert.h>
#ifdef __FreeBSD__
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include <stdio.h>
#include "iasnprintf.h"
#ifndef NULL
#define NULL 0
#endif
#ifdef WIN32
#define vsnprintf _vsnprintf
#endif
/**
* Allocates enough memory for the
* Formatted string, up to max
* specified.
* With max set to -1, it allocates as
* much size as needed.
* Memory must be freed using free.
*/
int
iasnprintf( char **ret,
int incr,
int max,
const char *fmt,
... )
{
int size = incr;
int retc = 0;
va_list ap;
char *temp = NULL;
assert( ret );
assert( fmt );
( *ret ) = ( char * )malloc( incr );
if( ( *ret ) == NULL ) return -1;
while( 1 ) {
va_start( ap, fmt );
retc = vsnprintf( ( *ret ), size, fmt, ap );
va_end( ap );
if( retc < 0 ) {
//size not big enough
//and vsnprintf does NOT return the
//necessary number of bytes
if( ( max != -1 ) && ( size == max ) ) //max reached
{
break;
}
incr *= 2; //increase increment
//increase size and try again
if( ( max != -1 ) && ( ( size + incr ) > max ) ) {
incr = ( max - size );
}
temp = ( char * )realloc( ( *ret ), size + incr );
if( temp == NULL ) {
break;
}
size += incr;
( *ret ) = temp;
} else {
if( ( retc + 1 ) > size ) {
//size not big enough
//and vsnprintf
//returns the necessary
//number of bytes
if( ( max != -1 ) && ( retc + 1 > max ) ) {
retc = -1;
break;
}
temp = ( char * )realloc( ( *ret ), retc + 1 );
if( temp == NULL ) {
retc = -1;
break;
}
size = retc + 1;
( *ret ) = temp; //size increased try again
} else if( ( retc + 1 ) < size ) {
//size is bigger than needed
//try and reallocate smaller
temp = ( char * )realloc( ( *ret ), retc + 1 );
if( temp != NULL ) {
( *ret ) = temp;
}
break;
} else //size is just right, exit
{
break;
}
}
}
if( retc < 0 ) {
free( ( *ret ) );
( *ret ) = NULL;
}
return retc;
}
void
iasnprintfFree( char *fChar )
{
free( fChar );
fChar = NULL;
}

View File

@@ -1,183 +1,163 @@
# $Id: Makefile.am,v 1.10 2006/04/08 15:22:22 r3mi Exp $
# #
# "Makefile.am" for "libupnp/upnp" # "Makefile.am" for "libupnp/upnp"
# #
# Copyright (C) 2005 Rémi Turboult <r3mi@users.sourceforge.net> # Copyright (C) 2005 R<EFBFBD>mi Turboult <r3mi@users.sourceforge.net>
# #
SUBDIRS = doc . sample SUBDIRS = doc
AM_CPPFLAGS = \ AM_CPPFLAGS = -I$(srcdir)/inc \
-I$(srcdir)/inc \ -I$(top_srcdir)/threadutil/inc \
-I$(top_srcdir)/threadutil/inc \ -I$(top_srcdir)/ixml/inc
-I$(top_srcdir)/ixml/inc
LDADD = \ AM_CFLAGS = $(PTHREAD_CFLAGS)
libupnp.la \
$(top_builddir)/threadutil/libthreadutil.la \ AM_LDFLAGS = $(PTHREAD_LIBS)
$(top_builddir)/ixml/libixml.la
LDADD = libupnp.la \
$(top_builddir)/threadutil/libthreadutil.la \
$(top_builddir)/ixml/libixml.la
upnpincludedir = $(includedir)/upnp upnpincludedir = $(includedir)/upnp
upnpinclude_HEADERS = \ upnpinclude_HEADERS = inc/upnp.h
inc/ActionComplete.h \
inc/ActionRequest.h \
inc/Discovery.h \
inc/Event.h \
inc/EventSubscribe.h \
inc/FileInfo.h \
inc/StateVarComplete.h \
inc/StateVarRequest.h \
inc/SubscriptionRequest.h \
inc/UpnpString.h \
inc/upnp.h \
inc/upnpdebug.h \
inc/UpnpGlobal.h \
inc/UpnpInet.h
nodist_upnpinclude_HEADERS = inc/upnpconfig.h nodist_upnpinclude_HEADERS = inc/upnpconfig.h
if ENABLE_TOOLS if ENABLE_TOOLS
upnpinclude_HEADERS += inc/upnptools.h upnpinclude_HEADERS += inc/upnptools.h
endif
if ENABLE_DEBUG
upnpinclude_HEADERS += inc/upnpdebug.h
endif endif
lib_LTLIBRARIES = libupnp.la
lib_LTLIBRARIES = libupnp.la libupnp_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/src/inc
libupnp_la_LDFLAGS = -version-info $(LT_VERSION_UPNP) \
-export-symbols-regex '^Upnp.*' \
$(top_builddir)/threadutil/libthreadutil.la \
$(top_builddir)/ixml/libixml.la
libupnp_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/src/inc libupnp_la_SOURCES = \
src/inc/config.h \
libupnp_la_LDFLAGS = \ src/inc/client_table.h src/inc/global.h \
-version-info $(LT_VERSION_UPNP) \ src/inc/md5.h src/inc/ssdplib.h \
-export-symbols-regex '^Upnp.*' \ src/inc/unixutil.h src/inc/urlconfig.h \
$(top_builddir)/threadutil/libthreadutil.la \ src/inc/gmtdate.h src/inc/membuffer.h \
$(top_builddir)/ixml/libixml.la src/inc/server.h src/inc/statcodes.h \
src/inc/upnpapi.h src/inc/utilall.h \
libupnp_la_SOURCES = \ src/inc/gena_ctrlpt.h src/inc/http_client.h \
src/inc/config.h \ src/inc/miniserver.h src/inc/service_table.h \
src/inc/client_table.h \ src/inc/statuscodes.h src/inc/upnpclosesocket.h \
src/inc/ClientSubscription.h \ src/inc/util.h src/inc/gena_device.h \
src/inc/gena.h \ src/inc/httpparser.h src/inc/netall.h \
src/inc/gena_ctrlpt.h \ src/inc/soaplib.h src/inc/strintmap.h \
src/inc/gena_device.h \ src/inc/upnp_timeout.h src/inc/uuid.h \
src/inc/global.h \ src/inc/gena.h src/inc/httpreadwrite.h \
src/inc/gmtdate.h \ src/inc/parsetools.h src/inc/sock.h \
src/inc/httpparser.h \ src/inc/sysdep.h src/inc/uri.h \
src/inc/httpreadwrite.h \ src/inc/webserver.h
src/inc/md5.h \
src/inc/membuffer.h \
src/inc/miniserver.h \
src/inc/netall.h \
src/inc/parsetools.h \
src/inc/server.h \
src/inc/service_table.h \
src/inc/soaplib.h \
src/inc/sock.h \
src/inc/statcodes.h \
src/inc/statuscodes.h \
src/inc/strintmap.h \
src/inc/ssdplib.h \
src/inc/sysdep.h \
src/inc/unixutil.h \
src/inc/upnpapi.h \
src/inc/upnpclosesocket.h \
src/inc/upnp_timeout.h \
src/inc/uri.h \
src/inc/urlconfig.h \
src/inc/util.h \
src/inc/utilall.h \
src/inc/uuid.h \
src/inc/VirtualDir.h \
src/inc/webserver.h
# ssdp # ssdp
libupnp_la_SOURCES += \ libupnp_la_SOURCES += src/ssdp/ssdp_device.c src/ssdp/ssdp_ctrlpt.c \
src/ssdp/ssdp_ResultData.c \ src/ssdp/ssdp_server.c
src/ssdp/ssdp_ResultData.h \
src/ssdp/ssdp_device.c \
src/ssdp/ssdp_ctrlpt.c \
src/ssdp/ssdp_server.c
# soap # soap
libupnp_la_SOURCES += \ libupnp_la_SOURCES += src/soap/soap_device.c src/soap/soap_ctrlpt.c \
src/soap/soap_device.c \ src/soap/soap_common.c
src/soap/soap_ctrlpt.c \
src/soap/soap_common.c
# genlib # genlib
libupnp_la_SOURCES += \ libupnp_la_SOURCES += \
src/genlib/miniserver/miniserver.c \ src/genlib/miniserver/miniserver.c \
src/genlib/client_table/client_table.c \ src/genlib/service_table/service_table.c \
src/genlib/client_table/ClientSubscription.c \ src/genlib/util/membuffer.c \
src/genlib/service_table/service_table.c \ src/genlib/util/strintmap.c \
src/genlib/util/membuffer.c \ src/genlib/util/upnp_timeout.c \
src/genlib/util/strintmap.c \ src/genlib/util/util.c \
src/genlib/util/upnp_timeout.c \ src/genlib/client_table/client_table.c \
src/genlib/util/util.c \ src/genlib/net/sock.c \
src/genlib/net/sock.c \ src/genlib/net/http/httpparser.c \
src/genlib/net/http/httpparser.c \ src/genlib/net/http/httpreadwrite.c \
src/genlib/net/http/httpreadwrite.c \ src/genlib/net/http/statcodes.c \
src/genlib/net/http/statcodes.c \ src/genlib/net/http/webserver.c \
src/genlib/net/http/webserver.c \ src/genlib/net/http/parsetools.c \
src/genlib/net/http/parsetools.c \ src/genlib/net/uri/uri.c
src/genlib/net/uri/uri.c
# gena # gena
libupnp_la_SOURCES += \ libupnp_la_SOURCES += src/gena/gena_device.c src/gena/gena_ctrlpt.c \
src/gena/gena_device.c \ src/gena/gena_callback2.c
src/gena/gena_ctrlpt.c \
src/gena/gena_callback2.c
# api # api
libupnp_la_SOURCES += \ libupnp_la_SOURCES += src/api/upnpapi.c
src/api/ActionComplete.c \
src/api/ActionRequest.c \
src/api/Discovery.c \
src/api/Event.c \
src/api/EventSubscribe.c \
src/api/FileInfo.c \
src/api/StateVarComplete.c \
src/api/StateVarRequest.c \
src/api/SubscriptionRequest.c \
src/api/UpnpString.c \
src/api/upnpapi.c
if ENABLE_TOOLS if ENABLE_TOOLS
libupnp_la_SOURCES += src/api/upnptools.c libupnp_la_SOURCES += src/api/upnptools.c
endif endif
if ENABLE_DEBUG if ENABLE_DEBUG
libupnp_la_SOURCES += src/api/upnpdebug.c libupnp_la_SOURCES += src/api/upnpdebug.c
endif endif
# uuid # uuid
libupnp_la_SOURCES += \ libupnp_la_SOURCES += src/uuid/md5.c src/uuid/sysdep.c src/uuid/uuid.c
src/uuid/md5.c \
src/uuid/sysdep.c \
src/uuid/uuid.c
# urlconfig # urlconfig
libupnp_la_SOURCES += src/urlconfig/urlconfig.c libupnp_la_SOURCES += src/urlconfig/urlconfig.c
# inet_pton (needed on Win32, compiles to nothing elsewhere) # samples
libupnp_la_SOURCES += \ noinst_PROGRAMS =
src/inet_pton.c \ if ENABLE_SAMPLES
src/inc/inet_pton.h if ENABLE_CLIENT
noinst_PROGRAMS += upnp_tv_ctrlpt
upnp_tv_ctrlpt_CPPFLAGS = $(AM_CPPFLAGS) \
-I$(srcdir)/sample/common/ \
-I$(srcdir)/sample/tvctrlpt
endif
if ENABLE_DEVICE
noinst_PROGRAMS += upnp_tv_device
upnp_tv_device_CPPFLAGS = $(AM_CPPFLAGS) \
-I$(srcdir)/sample/common/ \
-I$(srcdir)/sample/tvdevice
endif
endif
upnp_tv_device_SOURCES = \
sample/common/sample_util.c \
sample/common/sample_util.h \
sample/tvdevice/upnp_tv_device.c \
sample/tvdevice/upnp_tv_device.h \
sample/tvdevice/linux/upnp_tv_device_main.c
upnp_tv_ctrlpt_SOURCES = \
sample/common/sample_util.c \
sample/common/sample_util.h \
sample/tvctrlpt/upnp_tv_ctrlpt.c \
sample/tvctrlpt/upnp_tv_ctrlpt.h \
sample/tvctrlpt/linux/upnp_tv_ctrlpt_main.c
if WITH_DOCUMENTATION
examplesdir = $(docdir)/examples
examples_DATA = $(upnp_tv_ctrlpt_SOURCES) $(upnp_tv_device_SOURCES)
endif
# check / distcheck tests # check / distcheck tests
check_PROGRAMS = test_init check_PROGRAMS = test_init
TESTS = test_init TESTS = test_init
test_init_SOURCES = test/test_init.c
test_init_SOURCES = test/test_init.c
EXTRA_DIST = \ EXTRA_DIST = LICENSE \
LICENSE \ sample/tvdevice/web/tvcontrolSCPD.xml \
m4/libupnp.m4 \ sample/tvdevice/web/tvdevicedesc.xml \
src/win_dll.c sample/tvdevice/web/tvdevicepres.html \
sample/tvdevice/web/tvpictureSCPD.xml \
src/inc/inet_pton.h \
src/inet_pton.c \
src/win_dll.c
CLEANFILES = IUpnpErrFile.txt IUpnpInfoFile.txt
CLEANFILES = \
IUpnpErrFile.txt \
IUpnpInfoFile.txt

View File

@@ -1,173 +0,0 @@
#ifndef ACTIONCOMPLETE_H
#define ACTIONCOMPLETE_H
/*!
* \file
*
* \brief UpnpActionComplete object declararion.
*
* \author Marcelo Roberto Jimenez
*/
/*!
* \brief The type of an UpnpActionComplete object.
*/
typedef struct s_UpnpActionComplete UpnpActionComplete;
#include "ixml.h" /* for IXML_Document */
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include "UpnpString.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*!
* \brief Constructor.
*
* \return Pointer to the newly created object.
*/
EXPORT_SPEC UpnpActionComplete *UpnpActionComplete_new();
/*!
* \brief Destructor.
*/
EXPORT_SPEC void UpnpActionComplete_delete(
/*! [in] \b this pointer. */
UpnpActionComplete *p);
/*!
* \brief Copy Constructor.
*/
EXPORT_SPEC UpnpActionComplete *UpnpActionComplete_dup(
/*! [in] \b this pointer. */
const UpnpActionComplete *p);
/*!
* \brief Assignment operator.
*/
EXPORT_SPEC void UpnpActionComplete_assign(
/*! [in] \b this pointer. */
UpnpActionComplete *p,
/*! [in] \b that pointer. */
const UpnpActionComplete *q);
/*!
* \brief Error code getter.
*/
EXPORT_SPEC int UpnpActionComplete_get_ErrCode(
/*! [in] \b this pointer. */
const UpnpActionComplete *p);
/*!
* \brief Error code setter.
*/
EXPORT_SPEC void UpnpActionComplete_set_ErrCode(
/*! [in] \b this pointer. */
UpnpActionComplete *p,
/*! [in] The error code to set. */
int n);
/*!
* \brief Control URL getter.
*
* \return The control URL string.
*/
EXPORT_SPEC const UpnpString *UpnpActionComplete_get_CtrlUrl(
/*! [in] \b this pointer. */
const UpnpActionComplete *p);
/*!
* \brief Control URL getter as a C string
*
* \return The control URL string.
*/
EXPORT_SPEC const char *UpnpActionComplete_get_CtrlUrl_cstr(
/*! [in] \b this pointer. */
const UpnpActionComplete *p);
/*!
* \brief Control URL setter.
*/
EXPORT_SPEC void UpnpActionComplete_set_CtrlUrl(
/*! [in] \b this pointer. */
UpnpActionComplete *p,
/*! [in] The control URL string to copy. */
const UpnpString *s);
/*!
* \brief Set the control URL from a null terminated C string.
*/
EXPORT_SPEC void UpnpActionComplete_strcpy_CtrlUrl(
/*! [in] \b this pointer. */
UpnpActionComplete *p,
/*! [in] The null terminated control URL C string to copy. */
const char *s);
/*!
* \brief ActionRequest document getter.
*
* \return A pointer to the document object.
*/
EXPORT_SPEC IXML_Document *UpnpActionComplete_get_ActionRequest(
/*! [in] \b this pointer. */
const UpnpActionComplete *p);
/*!
* \brief ActionRequest document setter.
*
* \note The ActionComplete object takes ownership of the document parameter,
* i.e. it is responsible for deleting it upon destruction.
*/
EXPORT_SPEC void UpnpActionComplete_set_ActionRequest(
/*! [in] \b this pointer. */
UpnpActionComplete *p,
/*! [in] Document to copy. */
IXML_Document *d);
/*!
* \brief ActionResult document getter.
*/
EXPORT_SPEC IXML_Document *UpnpActionComplete_get_ActionResult(
/*! [in] \b this pointer. */
const UpnpActionComplete *p);
/*!
* \brief ActionResult document setter.
*
* \note The ActionComplete object takes ownership of the document parameter,
* i.e. it is responsible for deleting it upon destruction.
*/
EXPORT_SPEC void UpnpActionComplete_set_ActionResult(
/*! [in] \b this pointer. */
UpnpActionComplete *p,
/*! [in] Document to copy. */
IXML_Document *d);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ACTIONCOMPLETE_H */

View File

@@ -1,96 +0,0 @@
#ifndef ACTIONREQUEST_H
#define ACTIONREQUEST_H
/*!
* \file
*
* \brief UpnpActionRequest object declaration.
*
* \author Marcelo Roberto Jimenez
*/
/*! Returned as part of a \b UPNP_CONTROL_ACTION_COMPLETE callback. */
typedef struct s_UpnpActionRequest UpnpActionRequest;
#include "ixml.h" /* for IXML_Document */
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include "UpnpInet.h" /* for sockaddr, sockaddr_storage */
#include "UpnpString.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*! Constructor */
EXPORT_SPEC UpnpActionRequest *UpnpActionRequest_new();
/*! Destructor */
EXPORT_SPEC void UpnpActionRequest_delete(UpnpActionRequest *p);
/*! Copy Constructor */
EXPORT_SPEC UpnpActionRequest *UpnpActionRequest_dup(const UpnpActionRequest *p);
/*! Assignment operator */
EXPORT_SPEC void UpnpActionRequest_assign(UpnpActionRequest *p, const UpnpActionRequest *q);
/*! The result of the operation */
EXPORT_SPEC int UpnpActionRequest_get_ErrCode(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_ErrCode(UpnpActionRequest *p, int n);
/*! The socket number of the connection to the requestor */
EXPORT_SPEC int UpnpActionRequest_get_Socket(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_Socket(UpnpActionRequest *p, int n);
/*! The error string in case of error */
EXPORT_SPEC const UpnpString *UpnpActionRequest_get_ErrStr(const UpnpActionRequest *p);
EXPORT_SPEC const char *UpnpActionRequest_get_ErrStr_cstr(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_ErrStr(UpnpActionRequest *p, const UpnpString *s);
EXPORT_SPEC void UpnpActionRequest_strcpy_ErrStr(UpnpActionRequest *p, const char *s);
/*! The Action Name */
EXPORT_SPEC const UpnpString *UpnpActionRequest_get_ActionName(const UpnpActionRequest *p);
EXPORT_SPEC const char *UpnpActionRequest_get_ActionName_cstr(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_ActionName(UpnpActionRequest *p, const UpnpString *s);
EXPORT_SPEC void UpnpActionRequest_strcpy_ActionName(UpnpActionRequest *p, const char *s);
/*! The unique device ID */
EXPORT_SPEC const UpnpString *UpnpActionRequest_get_DevUDN(const UpnpActionRequest *p);
EXPORT_SPEC const char *UpnpActionRequest_get_DevUDN_cstr(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_DevUDN(UpnpActionRequest *p, const UpnpString *s);
/*! The service ID */
EXPORT_SPEC const UpnpString *UpnpActionRequest_get_ServiceID(const UpnpActionRequest *p);
EXPORT_SPEC const char *UpnpActionRequest_get_ServiceID_cstr(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_ServiceID(UpnpActionRequest *p, const UpnpString *s);
/*! The DOM document describing the action */
EXPORT_SPEC IXML_Document *UpnpActionRequest_get_ActionRequest(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_ActionRequest(UpnpActionRequest *p, IXML_Document *d);
/*! The DOM document describing the result of the action */
EXPORT_SPEC IXML_Document *UpnpActionRequest_get_ActionResult(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_ActionResult(UpnpActionRequest *p, IXML_Document *d);
/*! The DOM document containing the information from the SOAP header */
EXPORT_SPEC IXML_Document *UpnpActionRequest_get_SoapHeader(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_SoapHeader(UpnpActionRequest *p, IXML_Document *d);
/*! IP address of the control point requesting this action */
EXPORT_SPEC const struct sockaddr *UpnpActionRequest_get_CtrlPtIPAddr(const UpnpActionRequest *p);
EXPORT_SPEC void UpnpActionRequest_set_CtrlPtIPAddr(UpnpActionRequest *p, const struct sockaddr *sa);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ACTIONREQUEST_H */

View File

@@ -1,112 +0,0 @@
#ifndef DISCOVERY_H
#define DISCOVERY_H
/*!
* \file
*
* \brief UpnpDiscovery object declararion.
*
* \author Marcelo Roberto Jimenez
*/
/*! Returned in a \b UPNP_DISCOVERY_RESULT callback. */
typedef struct s_UpnpDiscovery UpnpDiscovery;
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include "UpnpInet.h" /* for sockaddr, sockaddr_storage */
#include "UpnpString.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*! Constructor */
EXPORT_SPEC UpnpDiscovery *UpnpDiscovery_new();
/*! Destructor */
EXPORT_SPEC void UpnpDiscovery_delete(UpnpDiscovery *p);
/*! Copy Constructor */
EXPORT_SPEC UpnpDiscovery *UpnpDiscovery_dup(const UpnpDiscovery *p);
/*! Assignment operator */
EXPORT_SPEC void UpnpDiscovery_assign(UpnpDiscovery *p, const UpnpDiscovery *q);
/*! The result code of the \b UpnpSearchAsync call. */
EXPORT_SPEC int UpnpDiscovery_get_ErrCode(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_ErrCode(UpnpDiscovery *p, int n);
/*! The expiration time of the advertisement. */
EXPORT_SPEC int UpnpDiscovery_get_Expires(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_Expires(UpnpDiscovery *p, int n);
/*! The unique device identifier. */
EXPORT_SPEC const UpnpString *UpnpDiscovery_get_DeviceID(const UpnpDiscovery *p);
EXPORT_SPEC const char *UpnpDiscovery_get_DeviceID_cstr(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_DeviceID(UpnpDiscovery *p, const UpnpString *s);
EXPORT_SPEC void UpnpDiscovery_strcpy_DeviceID(UpnpDiscovery *p, const char *s);
/*! The device type. */
EXPORT_SPEC const UpnpString *UpnpDiscovery_get_DeviceType(const UpnpDiscovery *p);
EXPORT_SPEC const char *UpnpDiscovery_get_DeviceType_cstr(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_DeviceType(UpnpDiscovery *p, const UpnpString *s);
EXPORT_SPEC void UpnpDiscovery_strcpy_DeviceType(UpnpDiscovery *p, const char *s);
/*! The ServiceType. */
EXPORT_SPEC const UpnpString *UpnpDiscovery_get_ServiceType(const UpnpDiscovery *p);
EXPORT_SPEC const char *UpnpDiscovery_get_ServiceType_cstr(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_ServiceType(UpnpDiscovery *p, const UpnpString *s);
EXPORT_SPEC void UpnpDiscovery_strcpy_ServiceType(UpnpDiscovery *p, const char *s);
/*! The service version. */
EXPORT_SPEC const UpnpString *UpnpDiscovery_get_ServiceVer(const UpnpDiscovery *p);
EXPORT_SPEC const char *UpnpDiscovery_get_ServiceVer_cstr(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_ServiceVer(UpnpDiscovery *p, const UpnpString *s);
EXPORT_SPEC void UpnpDiscovery_strcpy_ServiceVer(UpnpDiscovery *p, const char *s);
/*! The URL to the UPnP description document for the device. */
EXPORT_SPEC const UpnpString *UpnpDiscovery_get_Location(const UpnpDiscovery *p);
EXPORT_SPEC const char *UpnpDiscovery_get_Location_cstr(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_Location(UpnpDiscovery *p, const UpnpString *s);
EXPORT_SPEC void UpnpDiscovery_strcpy_Location(UpnpDiscovery *p, const char *s);
EXPORT_SPEC void UpnpDiscovery_strncpy_Location(UpnpDiscovery *p, const char *s, int n);
/*! The operating system the device is running. */
EXPORT_SPEC const UpnpString *UpnpDiscovery_get_Os(const UpnpDiscovery *p);
EXPORT_SPEC const char *UpnpDiscovery_get_Os_cstr(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_Os(UpnpDiscovery *p, const UpnpString *s);
EXPORT_SPEC void UpnpDiscovery_strcpy_Os(UpnpDiscovery *p, const char *s);
EXPORT_SPEC void UpnpDiscovery_strncpy_Os(UpnpDiscovery *p, const char *s, int n);
/*! Date when the response was generated. */
EXPORT_SPEC const UpnpString *UpnpDiscovery_get_Date(const UpnpDiscovery *p);
EXPORT_SPEC const char *UpnpDiscovery_get_Date_cstr(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_Date(UpnpDiscovery *p, const UpnpString *s);
EXPORT_SPEC void UpnpDiscovery_strcpy_Date(UpnpDiscovery *p, const char *s);
/*! Confirmation that the MAN header was understood by the device. */
EXPORT_SPEC const UpnpString *UpnpDiscovery_get_Ext(const UpnpDiscovery *p);
EXPORT_SPEC const char *UpnpDiscovery_get_Ext_cstr(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_Ext(UpnpDiscovery *p, const UpnpString *s);
EXPORT_SPEC void UpnpDiscovery_strcpy_Ext(UpnpDiscovery *p, const char *s);
EXPORT_SPEC void UpnpDiscovery_strncpy_Ext(UpnpDiscovery *p, const char *s, int n);
/*! The host address of the device responding to the search. */
EXPORT_SPEC const struct sockaddr *UpnpDiscovery_get_DestAddr(const UpnpDiscovery *p);
EXPORT_SPEC void UpnpDiscovery_set_DestAddr(UpnpDiscovery *p, const struct sockaddr *sa);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* DISCOVERY_H */

View File

@@ -1,62 +0,0 @@
#ifndef EVENT_H
#define EVENT_H
/*!
* \file
*
* \brief UpnpEvent object declararion.
*
* \author Marcelo Roberto Jimenez
*/
/*! Returned along with a \b UPNP_EVENT_RECEIVED callback. */
typedef struct s_UpnpEvent UpnpEvent;
#include "ixml.h" /* for IXML_Document */
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include "UpnpString.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*! Constructor */
EXPORT_SPEC UpnpEvent *UpnpEvent_new();
/*! Destructor */
EXPORT_SPEC void UpnpEvent_delete(UpnpEvent *p);
/*! Copy Constructor */
EXPORT_SPEC UpnpEvent *UpnpEvent_dup(const UpnpEvent *p);
/*! Assignment operator */
EXPORT_SPEC void UpnpEvent_assign(UpnpEvent *p, const UpnpEvent *q);
/*! The event sequence number. */
EXPORT_SPEC int UpnpEvent_get_EventKey(const UpnpEvent *p);
EXPORT_SPEC void UpnpEvent_set_EventKey(UpnpEvent *p, int n);
/*! The DOM tree representing the changes generating the event. */
EXPORT_SPEC IXML_Document *UpnpEvent_get_ChangedVariables(const UpnpEvent *p);
EXPORT_SPEC void UpnpEvent_set_ChangedVariables(UpnpEvent *p, IXML_Document *d);
/*! The subscription ID for this subscription. */
EXPORT_SPEC const UpnpString *UpnpEvent_get_SID(const UpnpEvent *p);
EXPORT_SPEC const char *UpnpEvent_get_SID_cstr(const UpnpEvent *p);
EXPORT_SPEC void UpnpEvent_set_SID(UpnpEvent *p, const UpnpString *s);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* EVENT_H */

View File

@@ -1,74 +0,0 @@
#ifndef EVENTSUBSCRIBE_H
#define EVENTSUBSCRIBE_H
/*!
* \file
*
* \brief UpnpEventSubscribe object declararion.
*
* \author Marcelo Roberto Jimenez
*/
/*! Returned along with a \b UPNP_EVENT_SUBSCRIBE_COMPLETE or
* \b UPNP_EVENT_UNSUBSCRIBE_COMPLETE callback. */
typedef struct s_UpnpEventSubscribe UpnpEventSubscribe;
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include "UpnpString.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*! Constructor */
EXPORT_SPEC UpnpEventSubscribe *UpnpEventSubscribe_new();
/*! Destructor */
EXPORT_SPEC void UpnpEventSubscribe_delete(UpnpEventSubscribe *p);
/*! Copy Constructor */
EXPORT_SPEC UpnpEventSubscribe *UpnpEventSubscribe_dup(const UpnpEventSubscribe *p);
/*! Assignment operator */
EXPORT_SPEC void UpnpEventSubscribe_assign(UpnpEventSubscribe *p, const UpnpEventSubscribe *q);
/*! The result of the operation. */
EXPORT_SPEC int UpnpEventSubscribe_get_ErrCode(const UpnpEventSubscribe *p);
EXPORT_SPEC void UpnpEventSubscribe_set_ErrCode(UpnpEventSubscribe *p, int n);
/*! The actual subscription time (for subscriptions only). */
EXPORT_SPEC int UpnpEventSubscribe_get_TimeOut(const UpnpEventSubscribe *p);
EXPORT_SPEC void UpnpEventSubscribe_set_TimeOut(UpnpEventSubscribe *p, int n);
/*! The SID for this subscription. For subscriptions, this only
* contains a valid SID if the \b Upnp_EventSubscribe.result field
* contains a \b UPNP_E_SUCCESS result code. For unsubscriptions,
* this contains the SID from which the subscription is being
* unsubscribed. */
EXPORT_SPEC const UpnpString *UpnpEventSubscribe_get_SID(const UpnpEventSubscribe *p);
EXPORT_SPEC const char *UpnpEventSubscribe_get_SID_cstr(const UpnpEventSubscribe *p);
EXPORT_SPEC void UpnpEventSubscribe_set_SID(UpnpEventSubscribe *p, const UpnpString *s);
EXPORT_SPEC void UpnpEventSubscribe_strcpy_SID(UpnpEventSubscribe *p, const char *s);
/*! The event URL being subscribed to or removed from. */
EXPORT_SPEC const UpnpString *UpnpEventSubscribe_get_PublisherUrl(const UpnpEventSubscribe *p);
EXPORT_SPEC const char *UpnpEventSubscribe_get_PublisherUrl_cstr(const UpnpEventSubscribe *p);
EXPORT_SPEC void UpnpEventSubscribe_set_PublisherUrl(UpnpEventSubscribe *p, const UpnpString *s);
EXPORT_SPEC void UpnpEventSubscribe_strcpy_PublisherUrl(UpnpEventSubscribe *p, const char *s);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* EVENTSUBSCRIBE_H */

View File

@@ -1,84 +0,0 @@
#ifndef FILEINFO_H
#define FILEINFO_H
/*!
* \file
*
* \brief UpnpFileInfo object declararion.
*
* \author Marcelo Roberto Jimenez
*/
/*! Detailed description of this class should go here */
typedef struct s_UpnpFileInfo UpnpFileInfo;
#include "ixml.h" /* for DOMString */
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include <sys/types.h> /* for off_t */
#include <time.h> /* for time_t */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*! Constructor */
EXPORT_SPEC UpnpFileInfo *UpnpFileInfo_new();
/*! Destructor */
EXPORT_SPEC void UpnpFileInfo_delete(UpnpFileInfo *p);
/*! Copy Constructor */
EXPORT_SPEC UpnpFileInfo *UpnpFileInfo_dup(const UpnpFileInfo *p);
/*! Assignment operator */
EXPORT_SPEC void UpnpFileInfo_assign(UpnpFileInfo *p, const UpnpFileInfo *q);
/*! The length of the file. A length less than 0 indicates the size
* is unknown, and data will be sent until 0 bytes are returned from
* a read call. */
EXPORT_SPEC off_t UpnpFileInfo_get_FileLength(const UpnpFileInfo *p);
EXPORT_SPEC void UpnpFileInfo_set_FileLength(UpnpFileInfo *p, off_t l);
/*! The time at which the contents of the file was modified;
* The time system is always local (not GMT). */
EXPORT_SPEC const time_t *UpnpFileInfo_get_LastModified(const UpnpFileInfo *p);
EXPORT_SPEC void UpnpFileInfo_set_LastModified(UpnpFileInfo *p, const time_t *t);
/*! If the file is a directory, \b is_directory contains
* a non-zero value. For a regular file, it should be 0. */
EXPORT_SPEC int UpnpFileInfo_get_IsDirectory(const UpnpFileInfo *p);
EXPORT_SPEC void UpnpFileInfo_set_IsDirectory(UpnpFileInfo *p, int b);
/*! If the file or directory is readable, this contains
* a non-zero value. If unreadable, it should be set to 0. */
EXPORT_SPEC int UpnpFileInfo_get_IsReadable(const UpnpFileInfo *p);
EXPORT_SPEC void UpnpFileInfo_set_IsReadable(UpnpFileInfo *p, int b);
/*! The content type of the file. */
EXPORT_SPEC const DOMString UpnpFileInfo_get_ContentType(const UpnpFileInfo *p);
EXPORT_SPEC const char *UpnpFileInfo_get_ContentType_cstr(const UpnpFileInfo *p);
EXPORT_SPEC void UpnpFileInfo_set_ContentType(UpnpFileInfo *p, const DOMString s);
/*! Additional HTTP headers to return. Each header line should be
* followed by "\r\n". */
EXPORT_SPEC const DOMString UpnpFileInfo_get_ExtraHeaders(const UpnpFileInfo *p);
EXPORT_SPEC const char *UpnpFileInfo_get_ExtraHeaders_cstr(const UpnpFileInfo *p);
EXPORT_SPEC void UpnpFileInfo_set_ExtraHeaders(UpnpFileInfo *p, const DOMString s);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* FILEINFO_H */

View File

@@ -1,72 +0,0 @@
#ifndef STATEVARCOMPLETE_H
#define STATEVARCOMPLETE_H
/*!
* \file
*
* \brief UpnpStateVarComplete object declararion.
*
* \author Marcelo Roberto Jimenez
*/
/*! Represents the reply for the current value of a state variable in an
* asynchronous call. */
typedef struct s_UpnpStateVarComplete UpnpStateVarComplete;
#include "ixml.h" /* for DOMString */
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include "UpnpString.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*! Constructor */
EXPORT_SPEC UpnpStateVarComplete *UpnpStateVarComplete_new();
/*! Destructor */
EXPORT_SPEC void UpnpStateVarComplete_delete(UpnpStateVarComplete *p);
/*! Copy Constructor */
EXPORT_SPEC UpnpStateVarComplete *UpnpStateVarComplete_dup(const UpnpStateVarComplete *p);
/*! Assignment operator */
EXPORT_SPEC void UpnpStateVarComplete_assign(UpnpStateVarComplete *p, const UpnpStateVarComplete *q);
/*! The result of the operation */
EXPORT_SPEC int UpnpStateVarComplete_get_ErrCode(const UpnpStateVarComplete *p);
EXPORT_SPEC void UpnpStateVarComplete_set_ErrCode(UpnpStateVarComplete *p, int n);
/*! The control URL for the service. */
EXPORT_SPEC const UpnpString *UpnpStateVarComplete_get_CtrlUrl(const UpnpStateVarComplete *p);
EXPORT_SPEC const char *UpnpStateVarComplete_get_CtrlUrl_cstr(const UpnpStateVarComplete *p);
EXPORT_SPEC void UpnpStateVarComplete_set_CtrlUrl(UpnpStateVarComplete *p, const UpnpString *s);
EXPORT_SPEC void UpnpStateVarComplete_strcpy_CtrlUrl(UpnpStateVarComplete *p, const char *s);
/*! The name of the variable. */
EXPORT_SPEC const UpnpString *UpnpStateVarComplete_get_StateVarName(const UpnpStateVarComplete *p);
EXPORT_SPEC const char *UpnpStateVarComplete_get_StateVarName_cstr(const UpnpStateVarComplete *p);
EXPORT_SPEC void UpnpStateVarComplete_set_StateVarName(UpnpStateVarComplete *p, const UpnpString *s);
EXPORT_SPEC void UpnpStateVarComplete_strcpy_StateVarName(UpnpStateVarComplete *p, const char *s);
/*! The current value of the variable. This needs to be allocated by
* the caller. When finished with it, the SDK frees this \b DOMString. */
EXPORT_SPEC const DOMString UpnpStateVarComplete_get_CurrentVal(const UpnpStateVarComplete *p);
EXPORT_SPEC const char *UpnpStateVarComplete_get_CurrentVal_cstr(const UpnpStateVarComplete *p);
EXPORT_SPEC void UpnpStateVarComplete_set_CurrentVal(UpnpStateVarComplete *p, const DOMString s);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* STATEVARCOMPLETE_H */

View File

@@ -1,91 +0,0 @@
#ifndef STATEVARREQUEST_H
#define STATEVARREQUEST_H
/*!
* \file
*
* \brief UpnpStateVarRequest object declararion.
*
* \author Marcelo Roberto Jimenez
*/
/*! Represents the request for current value of a state variable in a service
* state table. */
typedef struct s_UpnpStateVarRequest UpnpStateVarRequest;
#include "ixml.h" /* for DOMString */
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include "UpnpInet.h" /* for sockaddr, sockaddr_storage */
#include "UpnpString.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*! Constructor */
EXPORT_SPEC UpnpStateVarRequest *UpnpStateVarRequest_new();
/*! Destructor */
EXPORT_SPEC void UpnpStateVarRequest_delete(UpnpStateVarRequest *p);
/*! Copy Constructor */
EXPORT_SPEC UpnpStateVarRequest *UpnpStateVarRequest_dup(const UpnpStateVarRequest *p);
/*! Assignment operator */
EXPORT_SPEC void UpnpStateVarRequest_assign(UpnpStateVarRequest *p, const UpnpStateVarRequest *q);
/*! The result of the operation */
EXPORT_SPEC int UpnpStateVarRequest_get_ErrCode(const UpnpStateVarRequest *p);
EXPORT_SPEC void UpnpStateVarRequest_set_ErrCode(UpnpStateVarRequest *p, int n);
/*! The socket number of the connection to the requestor */
EXPORT_SPEC int UpnpStateVarRequest_get_Socket(const UpnpStateVarRequest *p);
EXPORT_SPEC void UpnpStateVarRequest_set_Socket(UpnpStateVarRequest *p, int n);
/*! The error string in case of error */
EXPORT_SPEC const UpnpString *UpnpStateVarRequest_get_ErrStr(const UpnpStateVarRequest *p);
EXPORT_SPEC const char *UpnpStateVarRequest_get_ErrStr_cstr(const UpnpStateVarRequest *p);
EXPORT_SPEC void UpnpStateVarRequest_set_ErrStr(UpnpStateVarRequest *p, const UpnpString *s);
EXPORT_SPEC void UpnpStateVarRequest_strcpy_ErrStr(UpnpStateVarRequest *p, const char *s);
/*! The unique device ID */
EXPORT_SPEC const UpnpString *UpnpStateVarRequest_get_DevUDN(const UpnpStateVarRequest *p);
EXPORT_SPEC const char *UpnpStateVarRequest_get_DevUDN_cstr(const UpnpStateVarRequest *p);
EXPORT_SPEC void UpnpStateVarRequest_set_DevUDN(UpnpStateVarRequest *p, const UpnpString *s);
/*! The service ID */
EXPORT_SPEC const UpnpString *UpnpStateVarRequest_get_ServiceID(const UpnpStateVarRequest *p);
EXPORT_SPEC const char *UpnpStateVarRequest_get_ServiceID_cstr(const UpnpStateVarRequest *p);
EXPORT_SPEC void UpnpStateVarRequest_set_ServiceID(UpnpStateVarRequest *p, const UpnpString *s);
/*! The name of the variable. */
EXPORT_SPEC const UpnpString *UpnpStateVarRequest_get_StateVarName(const UpnpStateVarRequest *p);
EXPORT_SPEC const char *UpnpStateVarRequest_get_StateVarName_cstr(const UpnpStateVarRequest *p);
EXPORT_SPEC void UpnpStateVarRequest_set_StateVarName(UpnpStateVarRequest *p, const UpnpString *s);
EXPORT_SPEC void UpnpStateVarRequest_strcpy_StateVarName(UpnpStateVarRequest *p, const char *s);
/*! IP address of sender requesting the state variable. */
EXPORT_SPEC const struct sockaddr *UpnpStateVarRequest_get_CtrlPtIPAddr(const UpnpStateVarRequest *p);
EXPORT_SPEC void UpnpStateVarRequest_set_CtrlPtIPAddr(UpnpStateVarRequest *p, const struct sockaddr *sa);
/*! The current value of the variable. This needs to be allocated by
* the caller. When finished with it, the SDK frees this \b DOMString. */
EXPORT_SPEC const DOMString UpnpStateVarRequest_get_CurrentVal(const UpnpStateVarRequest *p);
EXPORT_SPEC const char *UpnpStateVarRequest_get_CurrentVal_cstr(const UpnpStateVarRequest *p);
EXPORT_SPEC void UpnpStateVarRequest_set_CurrentVal(UpnpStateVarRequest *p, const DOMString s);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* STATEVARREQUEST_H */

View File

@@ -1,66 +0,0 @@
#ifndef SUBSCRIPTIONREQUEST_H
#define SUBSCRIPTIONREQUEST_H
/*!
* \file
*
* \brief UpnpSubscriptionRequest object declararion.
*
* \author Marcelo Roberto Jimenez
*/
/*! Returned along with a \b UPNP_EVENT_SUBSCRIPTION_REQUEST callback. */
typedef struct s_UpnpSubscriptionRequest UpnpSubscriptionRequest;
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include "UpnpString.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*! Constructor */
EXPORT_SPEC UpnpSubscriptionRequest *UpnpSubscriptionRequest_new();
/*! Destructor */
EXPORT_SPEC void UpnpSubscriptionRequest_delete(UpnpSubscriptionRequest *p);
/*! Copy Constructor */
EXPORT_SPEC UpnpSubscriptionRequest *UpnpSubscriptionRequest_dup(const UpnpSubscriptionRequest *p);
/*! Assignment operator */
EXPORT_SPEC void UpnpSubscriptionRequest_assign(UpnpSubscriptionRequest *p, const UpnpSubscriptionRequest *q);
/*! The identifier for the service being subscribed to. */
EXPORT_SPEC const UpnpString *UpnpSubscriptionRequest_get_ServiceId(const UpnpSubscriptionRequest *p);
EXPORT_SPEC const char *UpnpSubscriptionRequest_get_ServiceId_cstr(const UpnpSubscriptionRequest *p);
EXPORT_SPEC void UpnpSubscriptionRequest_set_ServiceId(UpnpSubscriptionRequest *p, const UpnpString *s);
EXPORT_SPEC void UpnpSubscriptionRequest_strcpy_ServiceId(UpnpSubscriptionRequest *p, const char *s);
/*! Universal device name. */
EXPORT_SPEC const UpnpString *UpnpSubscriptionRequest_get_UDN(const UpnpSubscriptionRequest *p);
EXPORT_SPEC const char *UpnpSubscriptionRequest_get_UDN_cstr(const UpnpSubscriptionRequest *p);
EXPORT_SPEC void UpnpSubscriptionRequest_set_UDN(UpnpSubscriptionRequest *p, const UpnpString *s);
EXPORT_SPEC void UpnpSubscriptionRequest_strcpy_UDN(UpnpSubscriptionRequest *p, const char *s);
/*! The assigned subscription ID for this subscription. */
EXPORT_SPEC const UpnpString *UpnpSubscriptionRequest_get_SID(const UpnpSubscriptionRequest *p);
EXPORT_SPEC const char *UpnpSubscriptionRequest_get_SID_cstr(const UpnpSubscriptionRequest *p);
EXPORT_SPEC void UpnpSubscriptionRequest_set_SID(UpnpSubscriptionRequest *p, const UpnpString *s);
EXPORT_SPEC void UpnpSubscriptionRequest_strcpy_SID(UpnpSubscriptionRequest *p, const char *s);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SUBSCRIPTIONREQUEST_H */

View File

@@ -1,120 +0,0 @@
#ifndef UPNPGLOBAL_H
#define UPNPGLOBAL_H
/*!
* \file
*
* \brief Defines constants that for some reason are not defined on some systems.
*/
#if defined MYLIB_LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 != 64
#if defined __GNUC__
#warning libupnp requires largefile mode - use AC_SYS_LARGEFILE
#else
#error libupnp requires largefile mode - use AC_SYS_LARGEFILE
#endif
#endif
#ifdef WIN32
/*
* EXPORT_SPEC
*/
#ifdef UPNP_STATIC_LIB
#define EXPORT_SPEC
#else /* UPNP_STATIC_LIB */
#ifdef LIBUPNP_EXPORTS
/*! set up declspec for dll export to make functions
* visible to library users */
#define EXPORT_SPEC __declspec(dllexport)
#else /* LIBUPNP_EXPORTS */
#define EXPORT_SPEC __declspec(dllimport)
#endif /* LIBUPNP_EXPORTS */
#endif /* UPNP_STATIC_LIB */
/*
* UPNP_INLINE
* PRId64
* PRIzu
*/
#ifdef UPNP_USE_MSVCPP
/* define some things the M$ VC++ doesn't know */
#define UPNP_INLINE
typedef __int64 int64_t;
#define PRId64 "I64d"
#define PRIzu "lu"
#endif /* UPNP_USE_MSVCPP */
#ifdef UPNP_USE_BCBPP
/* define some things Borland Builder doesn't know */
#define UPNP_INLINE inline
typedef __int64 int64_t;
#warning The Borland C compiler is probably broken on PRId64,
#warning please someone provide a proper fix here
#define PRId64 "I64d"
#define PRIzu "zu"
#endif /* UPNP_USE_BCBPP */
#ifdef __GNUC__
#define UPNP_INLINE inline
/* Note with PRIzu that in the case of Mingw32, it's the MS C
* runtime printf which ends up getting called, not the glibc
* printf, so it genuinely doesn't have "zu"
*/
#define PRIzu "lu"
#endif /* __GNUC__ */
#else
/*!
* \brief Export functions on WIN32 DLLs.
*
* Every funtion that belongs to the library API must use this
* definition upon declaration or it will not be exported on WIN32
* DLLs.
*/
#define EXPORT_SPEC
/*!
* \brief Declares an inline function.
*
* Surprisingly, there are some compilers that do not understand the
* inline keyword. This definition makes the use of this keyword
* portable to these systems.
*/
#define UPNP_INLINE inline
/*!
* \brief Supply the PRId64 printf() macro.
*
* MSVC still does not know about this.
*/
/* #define PRId64 PRId64 */
/*!
* \brief Supply the PRIzu printf() macro.
*
* This macro was invented so that we can live a little longer with
* MSVC lack of C99. "z" is the correct printf() size specifier for
* the size_t type.
*/
#define PRIzu "zu"
#endif
/*
* Defining this macro here gives some interesting information about unused
* functions in the code. Of course, this should never go uncommented on a
* release.
*/
/*#define inline*/
#endif /* UPNPGLOBAL_H */

View File

@@ -1,30 +0,0 @@
#ifndef UPNPINET_H
#define UPNPINET_H
/*!
* \file
*
* \brief Provides a platform independent way to include TCP/IP types and functions.
*/
#ifdef WIN32
#include <winsock2.h>
#include <Ws2tcpip.h>
#else
#include <sys/param.h>
#if (defined(BSD) && BSD >= 199306) || defined (__FreeBSD_kernel__)
#include <ifaddrs.h>
/* Do not move or remove the include below for "sys/socket"!
* Will break FreeBSD builds. */
#include <sys/socket.h>
#endif
#include <netinet/in.h>
#endif
#endif /* UPNPINET_H */

View File

@@ -1,133 +0,0 @@
#ifndef STRING_H
#define STRING_H
/*!
* \defgroup UpnpString The UpnpString Class
*
* \brief Implements string operations in the UPnP library.
*
* \author Marcelo Roberto Jimenez
*
* \version 1.0
*
* @{
*
* \file
*
* \brief UpnpString object declarartion.
*/
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*!
* \brief Type of the string objects inside libupnp.
*/
typedef struct s_UpnpString UpnpString;
/*!
* \brief Constructor.
*
* \return A pointer to a new allocated object.
*/
EXPORT_SPEC UpnpString *UpnpString_new();
/*!
* \brief Destructor.
*/
EXPORT_SPEC void UpnpString_delete(
/*! [in] The \em \b this pointer. */
UpnpString *p);
/*!
* \brief Copy Constructor.
*
* \return A pointer to a new allocated copy of the original object.
*/
EXPORT_SPEC UpnpString *UpnpString_dup(
/*! [in] The \em \b this pointer. */
const UpnpString *p);
/*!
* \brief Assignment operator.
*/
EXPORT_SPEC void UpnpString_assign(
/*! [in] The \em \b this pointer. */
UpnpString *p,
/*! [in] The \em \b that pointer. */
const UpnpString *q);
/*!
* \brief Returns the length of the string.
*
* \return The length of the string.
* */
EXPORT_SPEC int UpnpString_get_Length(
/*! [in] The \em \b this pointer. */
const UpnpString *p);
/*!
* \brief Returns the pointer to char.
*
* \return The pointer to char.
*/
EXPORT_SPEC const char *UpnpString_get_String(
/*! [in] The \em \b this pointer. */
const UpnpString *p);
/*!
* \brief Sets the string from a pointer to char.
*/
EXPORT_SPEC void UpnpString_set_String(
/*! [in] The \em \b this pointer. */
UpnpString *p,
/*! [in] (char *) to copy from. */
const char *s);
/*!
* \brief Sets the string from a pointer to char using a maximum of N chars.
*/
EXPORT_SPEC void UpnpString_set_StringN(
/*! [in] The \em \b this pointer. */
UpnpString *p,
/*! [in] (char *) to copy from. */
const char *s,
/*! Maximum number of chars to copy.*/
int n);
/*!
* \brief Clears the string, sets its size to zero.
*/
EXPORT_SPEC void UpnpString_clear(
/*! [in] The \em \b this pointer. */
UpnpString *p);
#ifdef __cplusplus
}
#endif /* __cplusplus */
/* @} UpnpString The UpnpString API */
#endif /* STRING_H */

File diff suppressed because it is too large Load Diff

View File

@@ -1,34 +1,34 @@
/* -*- C -*- */ // -*- C -*-
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net> // Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* * Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef UPNP_CONFIG_H #ifndef UPNP_CONFIG_H
#define UPNP_CONFIG_H #define UPNP_CONFIG_H
@@ -91,5 +91,6 @@
#undef UPNP_HAVE_TOOLS #undef UPNP_HAVE_TOOLS
#endif /* UPNP_CONFIG_H */ #endif // UPNP_CONFIG_H

View File

@@ -1,66 +1,59 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net> // Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef UPNP_DEBUG_H #ifndef UPNP_DEBUG_H
#define UPNP_DEBUG_H #define UPNP_DEBUG_H
/*!
* \file
*/
#include "ThreadPool.h"
#include "upnpconfig.h" #include "upnpconfig.h"
#include "UpnpGlobal.h" /* for UPNP_INLINE */
// Function declarations only if debug compiled into the library
#if UPNP_HAVE_DEBUG
#include <stdio.h> #include <stdio.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \name Other debugging features /** @name Other debugging features
* The UPnP SDK contains other features to aid in debugging.
* The UPnP SDK contains other features to aid in debugging.
*/ */
/*@{*/
/** \name Upnp_LogLevel //@{
/** @name Upnp_LogLevel
* The user has the option to select 4 different types of debugging levels, * The user has the option to select 4 different types of debugging levels,
* see \c UpnpSetLogLevel. * see {\tt UpnpSetLogLevel}.
* The critical level will show only those messages * The critical level will show only those messages
* which can halt the normal processing of the library, like memory * which can halt the normal processing of the library, like memory
* allocation errors. The remaining three levels are just for debugging * allocation errors. The remaining three levels are just for debugging
@@ -69,246 +62,197 @@ extern "C" {
* Info Level displays the other important operational information * Info Level displays the other important operational information
* regarding the working of the library. If the user selects All, * regarding the working of the library. If the user selects All,
* then the library displays all the debugging information that it has. * then the library displays all the debugging information that it has.
* \li \c UPNP_CRITICAL [0] * \begin{itemize}
* \li \c UPNP_PACKET [1] * \item {\tt UPNP_CRITICAL [0]}
* \li \c UPNP_INFO [2] * \item {\tt UPNP_PACKET [1]}
* \li \c UPNP_ALL [3] * \item {\tt UPNP_INFO [2]}
* \item {\tt UPNP_ALL [3]}
* \end{itemize}
*/ */
typedef enum Upnp_Module {
SSDP,
SOAP,
GENA,
TPOOL,
MSERV,
DOM,
API,
HTTP
} Dbg_Module;
typedef enum Upnp_Module {SSDP,SOAP,GENA,TPOOL,MSERV,DOM,API, HTTP} Dbg_Module;
/*@{*/ //@{
typedef enum Upnp_LogLevel_e { typedef enum Upnp_LogLevel_e {
UPNP_CRITICAL, UPNP_CRITICAL,
UPNP_PACKET, UPNP_PACKET,
UPNP_INFO, UPNP_INFO,
UPNP_ALL UPNP_ALL
} Upnp_LogLevel; } Upnp_LogLevel;
/*@}*/ //@}
// for backward compatibility
#define Dbg_Level Upnp_LogLevel
/** /**
* Default log level : see \c Upnp_LogLevel * Default log level : see {\tt Upnp_LogLevel}
*/ */
#define UPNP_DEFAULT_LOG_LEVEL UPNP_ALL #define UPNP_DEFAULT_LOG_LEVEL UPNP_ALL
/*! /***************************************************************************
* \brief Initialize the log files. * Function : UpnpInitLog
*
* Parameters: void
*
* Description:
* This functions initializes the log files
* Returns: int
* -1 : If fails
* UPNP_E_SUCCESS : if success
***************************************************************************/
int UpnpInitLog();
// for backward compatibility
#define InitLog UpnpInitLog
/***************************************************************************
* Function : UpnpSetLogLevel
*
* Parameters: void
* *
* \return -1 if fails or UPNP_E_SUCCESS if succeeds. * Description:
*/ * This functions set the log level (see {\tt Upnp_LogLevel}
#ifdef DEBUG * Returns: void
int UpnpInitLog(void); ***************************************************************************/
#else void UpnpSetLogLevel (Upnp_LogLevel);
static UPNP_INLINE int UpnpInitLog(void)
{
return UPNP_E_SUCCESS;
}
#endif
/*! /***************************************************************************
* \brief Set the log level (see \c Upnp_LogLevel). * Function : UpnpCloseLog
*/ *
#ifdef DEBUG * Parameters: void
void UpnpSetLogLevel( *
/*! [in] Log level. */ * Description:
Upnp_LogLevel log_level); * This functions closes the log files
#else * Returns: void
static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {} ***************************************************************************/
#endif void UpnpCloseLog();
// for backward compatibility
#define CloseLog UpnpCloseLog
/*! /***************************************************************************
* \brief Closes the log files. * Function : UpnpSetLogFileNames
*/ *
#ifdef DEBUG * Parameters:
void UpnpCloseLog(void); * IN const char* ErrFileName: name of the error file
#else * IN const char *InfoFileName: name of the information file
static UPNP_INLINE void UpnpCloseLog(void) {} * IN int size: Size of the buffer
#endif * IN int starLength: This parameter provides the width of the banner
*
* Description:
* This functions takes the buffer and writes the buffer in the file as
* per the requested banner
* Returns: void
***************************************************************************/
void UpnpSetLogFileNames (const char* ErrFileName, const char* InfoFileName);
// for backward compatibility
#define SetLogFileNames UpnpSetLogFileNames
/*! /***************************************************************************
* \brief Set the name for error and information files, respectively. * Function : UpnpGetDebugFile
*/ *
#ifdef DEBUG * Parameters:
void UpnpSetLogFileNames( * IN Dbg_Level DLevel: The level of the debug logging. It will decide
/*! [in] Name of the error file. */ * whether debug statement will go to standard output,
const char *ErrFileName, * or any of the log files.
/*! [in] Name of the information file. */ * IN Dbg_Module Module: debug will go in the name of this module
const char *InfoFileName); *
#else * Description:
static UPNP_INLINE void UpnpSetLogFileNames( * This function checks if the module is turned on for debug
const char *ErrFileName, * and returns the file descriptor corresponding to the debug level
const char *InfoFileName) {} * Returns: FILE *
#endif * NULL : if the module is turn off for debug
* else returns the right file descriptor
***************************************************************************/
FILE* UpnpGetDebugFile (Upnp_LogLevel level, Dbg_Module module);
// for backward compatibility
#define GetDebugFile UpnpGetDebugFile
/*! /***************************************************************************
* \brief Check if the module is turned on for debug and returns the file * Function : UpnpPrintf
* descriptor corresponding to the debug level *
* * Parameters:
* \return NULL if the module is turn off for debug otheriwse returns the * IN Dbg_Level DLevel: The level of the debug logging. It will decide
* right file descriptor. * whether debug statement will go to standard output,
*/ * or any of the log files.
#ifdef DEBUG * IN Dbg_Module Module: debug will go in the name of this module
FILE *UpnpGetDebugFile( * IN char *DbgFileName: Name of the file from where debug statement is
/*! [in] The level of the debug logging. It will decide whether debug * coming
* statement will go to standard output, or any of the log files. */ * IN int DbgLineNo : Line number of the file from where debug statement
Upnp_LogLevel level, * is coming
/*! [in] debug will go in the name of this module. */ * IN char * FmtStr, ...: Variable number of arguments that will go
Dbg_Module module); * in the debug statement
#else *
static UPNP_INLINE FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module) * Description:
{ * This functions prints the debug statement either on the startdard
return NULL; * output or log file along with the information from where this
} * debug statement is coming
#endif * Returns: void
***************************************************************************/
void UpnpPrintf (Upnp_LogLevel DLevel, Dbg_Module Module,
/*! const char* DbgFileName, int DbgLineNo,
* \brief Returns true if debug output should be done in this module. const char* FmtStr,
* ...)
* \return Nonzero value if true, zero if false.
*/
#ifdef DEBUG
int DebugAtThisLevel(
/*! [in] The level of the debug logging. It will decide whether debug
* statement will go to standard output, or any of the log files. */
Upnp_LogLevel DLevel,
/*! [in] Debug will go in the name of this module. */
Dbg_Module Module);
#else
static UPNP_INLINE int DebugAtThisLevel(
Upnp_LogLevel DLevel,
Dbg_Module Module)
{
return 0;
}
#endif
/*!
* \brief Prints the debug statement either on the standard output or log file
* along with the information from where this debug statement is coming.
*/
#ifdef DEBUG
void UpnpPrintf(
/*! [in] The level of the debug logging. It will decide whether debug
* statement will go to standard output, or any of the log files. */
Upnp_LogLevel DLevel,
/*! [in] debug will go in the name of this module. */
Dbg_Module Module,
/*! [in] Name of the file from where debug statement is coming. */
const char* DbgFileName,
/*! [in] Line number of the file from where debug statement is coming. */
int DbgLineNo,
/*! [in] Printf like format specification. */
const char* FmtStr,
/*! [in] Printf like Variable number of arguments that will go in the debug
* statement. */
...)
#if (__GNUC__ >= 3) #if (__GNUC__ >= 3)
/* This enables printf like format checking by the compiler */
__attribute__((format (__printf__, 5, 6))) __attribute__((format (__printf__, 5, 6)))
#endif #endif
; ;
#else /* DEBUG */
static UPNP_INLINE void UpnpPrintf(
Upnp_LogLevel DLevel,
Dbg_Module Module,
const char* DbgFileName,
int DbgLineNo,
const char* FmtStr,
...)
{
}
#endif /* DEBUG */
/*! /***************************************************************************
* \brief Writes the file name and file number from where debug statement is * Function : UpnpDisplayBanner
* coming to the log file. *
*/ * Parameters:
#ifdef DEBUG * IN FILE *fd: file descriptor where the banner will be written
void UpnpDisplayFileAndLine( * IN char **lines: The buffer that will be written
/*! [in] File descriptor where line number and file name will be written. */ * IN int size: Size of the buffer
FILE *fd, * IN int starLength: This parameter provides the width of the banner
/*! [in] Name of the file. */ *
const char *DbgFileName, * Description:
/*! [in] Line number of the file. */ * This functions takes the buffer and writes the buffer in the file as
int DbgLineNo); * per the requested banner
#else * Returns: void
static UPNP_INLINE void UpnpDisplayFileAndLine( ***************************************************************************/
FILE *fd, void UpnpDisplayBanner (FILE *fd,
const char *DbgFileName, const char** lines, size_t size, int starlength);
int DbgLineNo) {}
#endif
/*! /***************************************************************************
* \brief Writes the buffer in the file as per the requested banner * Function : UpnpDisplayFileAndLine
*/ *
#ifdef DEBUG * Parameters:
void UpnpDisplayBanner( * IN FILE *fd: File descriptor where line number and file name will be
/*! [in] file descriptor where the banner will be written. */ * written
FILE *fd, * IN char *DbgFileName: Name of the file
/*! [in] The buffer that will be written. */ * IN int DbgLineNo : Line number of the file
const char **lines, *
/*! [in] Size of the buffer. */ * Description:
size_t size, * This function writes the file name and file number from where
/*! [in] This parameter provides the width of the banner. */ * debug statement is coming to the log file
int starlength); * Returns: void
#else ***************************************************************************/
static UPNP_INLINE void UpnpDisplayBanner( void UpnpDisplayFileAndLine (FILE *fd, const char *DbgFileName, int DbgLineNo);
FILE *fd,
const char **lines,
size_t size,
int starlength) {}
#endif
/*! //@}
* \brief Prints thread pool statistics.
*/
#ifdef DEBUG
void PrintThreadPoolStats(
/*! [in] The thread pool. */
ThreadPool *tp,
/*! [in] The file name that called this function, use the macro __FILE__. */
const char *DbgFileName,
/*! [in] The line number that the function was called, use the macro __LINE__. */
int DbgLineNo,
/*! [in] The message. */
const char *msg);
#else
static UPNP_INLINE void PrintThreadPoolStats(
ThreadPool *tp,
const char *DbgFileName,
int DbgLineNo,
const char *msg)
{
}
#endif
/*@}*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* UPNP_DEBUG_H */ #endif // UPNP_HAVE_DEBUG
#endif // UPNP_DEBUG_H

View File

@@ -1,265 +1,230 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* * Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
/** @name Optional Tool APIs
* The Linux SDK for UPnP Devices contains some additional, optional
* utility APIs that can be helpful in writing applications using the
* SDK. These additional APIs can be compiled out in order to save code
* size in the SDK. Refer to the README for details.
*/
//@{
#ifndef UPNP_TOOLS_H #ifndef UPNP_TOOLS_H
#define UPNP_TOOLS_H #define UPNP_TOOLS_H
#include "upnp.h"
/*! // Function declarations only if tools compiled into the library
* \file
*
* \defgroup UPnPTools Optional Tool API
*
* \brief Additional, optional utility API that can be helpful in writing
* applications.
*
* This additional API can be compiled out in order to save code size in the
* library. Refer to the file README for details.
*
* @{
*/
#include "ixml.h" /* for IXML_Document */
/* Function declarations only if tools compiled into the library */
#if UPNP_HAVE_TOOLS #if UPNP_HAVE_TOOLS
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** {\bf UpnpResolveURL} combines a base URL and a relative URL into
/*! * a single absolute URL. The memory for {\bf AbsURL} needs to be
* \brief Converts an SDK error code into a string error message suitable for * allocated by the caller and must be large enough to hold the
* display. The memory returned from this function should NOT be freed. * {\bf BaseURL} and {\bf RelURL} combined.
* *
* \return An ASCII text string representation of the error message associated * @return [int] An integer representing one of the following:
* with the error code or the string "Unknown error code" * \begin{itemize}
*/ * \item {\tt UPNP_E_SUCCESS}: The operation completed successfully.
EXPORT_SPEC const char *UpnpGetErrorMessage( * \item {\tt UPNP_E_INVALID_PARAM}: {\bf RelURL} is {\tt NULL}.
/*! [in] The SDK error code to convert. */ * \item {\tt UPNP_E_INVALID_URL}: The {\bf BaseURL} / {\bf RelURL}
int errorcode);
/*!
* \brief Combines a base URL and a relative URL into a single absolute URL.
*
* The memory for \b AbsURL needs to be allocated by the caller and must
* be large enough to hold the \b BaseURL and \b RelURL combined.
*
* \return An integer representing one of the following:
* \li <tt>UPNP_E_SUCCESS</tt>: The operation completed successfully.
* \li <tt>UPNP_E_INVALID_PARAM</tt>: \b RelURL is <tt>NULL</tt>.
* \li <tt>UPNP_E_INVALID_URL</tt>: The \b BaseURL / \b RelURL
* combination does not form a valid URL. * combination does not form a valid URL.
* \li <tt>UPNP_E_OUTOF_MEMORY</tt>: Insufficient resources exist to * \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
* complete this operation. * complete this operation.
* \end{itemize}
*/ */
EXPORT_SPEC int UpnpResolveURL( EXPORT_SPEC int UpnpResolveURL(
/*! [in] The base URL to combine. */ IN const char * BaseURL, /** The base URL to combine. */
const char *BaseURL, IN const char * RelURL, /** The relative URL to {\bf BaseURL}. */
/*! [in] The relative URL to \b BaseURL. */ OUT char * AbsURL /** A pointer to a buffer to store the
const char *RelURL, absolute URL. */
/*! [out] A pointer to a buffer to store the absolute URL. */ );
char *AbsURL);
/** {\bf UpnpMakeAction} creates an action request packet based on its input
/*! * parameters (status variable name and value pair). Any number of input
* \brief Creates an action request packet based on its input parameters * parameters can be passed to this function but every input variable name
* (status variable name and value pair). * should have a matching value argument.
*
* Any number of input parameters can be passed to this function but every
* input variable name should have a matching value argument.
*
* It is a wrapper function that calls makeAction() function to create the
* action request.
*
* \return The action node of \b Upnp_Document type or <tt>NULL</tt> if the
* operation failed.
*/
EXPORT_SPEC IXML_Document *UpnpMakeAction(
/*! [in] Name of the action request or response. */
const char *ActionName,
/*! [in] The service type. */
const char *ServType,
/*! [in] Number of argument pairs to be passed. */
int NumArg,
/*! [in] pointer to the first argument. */
const char *Arg,
/*! [in] Argument list. */
...);
/*!
* \brief Ceates an action response packet based on its output parameters
* (status variable name and value pair).
*
* Any number of input parameters can be passed to this function but every
* output variable name should have a matching value argument.
* *
* It is a wrapper function that calls makeAction() function to create the * @return [IXML_Document*] The action node of {\bf Upnp_Document} type or
* action request. * {\tt NULL} if the operation failed.
*
* \return The action node of \b Upnp_Document type or <tt>NULL</tt> if the
* operation failed.
*/ */
EXPORT_SPEC IXML_Document *UpnpMakeActionResponse(
/*! [in] The action name. */
const char *ActionName,
/*! [in] The service type.. */
const char *ServType,
/*! [in] The number of argument pairs passed. */
int NumArg,
/*! [in] The status variable name and value pair. */
const char *Arg,
/*! [in] Other status variable name and value pairs. */
...);
EXPORT_SPEC IXML_Document* UpnpMakeAction(
IN const char * ActionName, /** The action name. */
IN const char * ServType, /** The service type. */
IN int NumArg, /** Number of argument pairs to be passed. */
IN const char * Arg, /** Status variable name and value pair. */
IN ... /* Other status variable name and value pairs. */
);
/*! /** {\bf UpnpAddToAction} creates an action request packet based on its input
* \brief Adds the argument in the action request. * parameters (status variable name and value pair). This API is specially
* * suitable inside a loop to add any number input parameters into an existing
* This API is specially suitable inside a loop to add any number input * action. If no action document exists in the beginning then a
* parameters into an existing action. If no action document exists in the * {\bf Upnp_Document} variable initialized with {\tt NULL} should be passed
* beginning then a <b>Upnp_Document variable initialized with <tt>NULL</tt></b> * as a parameter.
* should be passed as a parameter.
* *
* It is a wrapper function that calls addToAction() function to add the * @return [int] An integer representing one of the following:
* argument in the action request. * \begin{itemize}
* * \item {\tt UPNP_E_SUCCESS}: The operation completed successfully.
* \return An integer representing one of the following: * \item {\tt UPNP_E_INVALID_PARAM}: One or more of the parameters
* \li <tt>UPNP_E_SUCCESS</tt>: The operation completed successfully. * are invalid.
* \li <tt>UPNP_E_INVALID_PARAM</tt>: One or more of the parameters are invalid. * \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
* \li <tt>UPNP_E_OUTOF_MEMORY</tt>: Insufficient resources exist to * complete this operation.
* complete this operation. * \end{itemize}
*/ */
EXPORT_SPEC int UpnpAddToAction( EXPORT_SPEC int UpnpAddToAction(
/*! [in,out] A pointer to store the action document node. */ IN OUT IXML_Document ** ActionDoc,
IXML_Document **ActionDoc, /** A pointer to store the action
/*! [in] The action name. */ document node. */
const char *ActionName, IN const char * ActionName, /** The action name. */
/*! [in] The service type. */ IN const char * ServType, /** The service type. */
const char *ServType, IN const char * ArgName, /** The status variable name. */
/*! [in] The status variable name. */ IN const char * ArgVal /** The status variable value. */
const char *ArgName, );
/*! [in] The status variable value. */
const char *ArgVal);
/** {\bf UpnpMakeActionResponse} creates an action response packet based
/*! * on its output parameters (status variable name and value pair). Any
* \brief Creates an action response packet based on its output parameters * number of input parameters can be passed to this function but every output
* (status variable name and value pair). * variable name should have a matching value argument.
* *
* This API is especially suitable inside a loop to add any number of input * @return [IXML_Document*] The action node of {\bf Upnp_Document} type or
* parameters into an existing action response. If no action document exists * {\tt NULL} if the operation failed.
* in the beginning, a \b Upnp_Document variable initialized with <tt>NULL</tt>
* should be passed as a parameter.
*
* It is a wrapper function that calls addToAction() function to add the
* argument in the action request.
*
* \return An integer representing one of the following:
* \li <tt>UPNP_E_SUCCESS</tt>: The operation completed successfully.
* \li <tt>UPNP_E_INVALID_PARAM</tt>: One or more of the parameters are invalid.
* \li <tt>UPNP_E_OUTOF_MEMORY</tt>: Insufficient resources exist to
* complete this operation.
*/ */
EXPORT_SPEC IXML_Document* UpnpMakeActionResponse(
IN const char * ActionName, /** The action name. */
IN const char * ServType, /** The service type. */
IN int NumArg, /** The number of argument pairs passed. */
IN const char * Arg, /** The status variable name and value pair. */
IN ... /* Other status variable name and value pairs. */
);
/** {\bf UpnpAddToActionResponse} creates an action response
* packet based on its output parameters (status variable name
* and value pair). This API is especially suitable inside
* a loop to add any number of input parameters into an existing action
* response. If no action document exists in the beginning, a
* {\bf Upnp_Document} variable initialized with {\tt NULL} should be passed
* as a parameter.
*
* @return [int] An integer representing one of the following:
* \begin{itemize}
* \item {\tt UPNP_E_SUCCESS}: The operation completed successfully.
* \item {\tt UPNP_E_INVALID_PARAM}: One or more of the parameters
* are invalid.
* \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
* complete this operation.
* \end{itemize}
*/
EXPORT_SPEC int UpnpAddToActionResponse( EXPORT_SPEC int UpnpAddToActionResponse(
/*! [in,out] Pointer to a document to store the action document node. */ IN OUT IXML_Document ** ActionResponse,
IXML_Document **ActionResponse, /** Pointer to a document to
/*! [in] The action name. */ store the action document
const char *ActionName, node. */
/*! [in] The service type. */ IN const char * ActionName, /** The action name. */
const char *ServType, IN const char * ServType, /** The service type. */
/*! [in] The status variable name. */ IN const char * ArgName, /** The status variable name. */
const char *ArgName, IN const char * ArgVal /** The status variable value. */
/*! [in] The status variable value. */ );
const char *ArgVal);
/** {\bf UpnpAddToPropertySet} can be used when an application needs to
/*! * transfer the status of many variables at once. It can be used
* \brief Creates a property set message packet. * (inside a loop) to add some extra status variables into an existing
* * property set. If the application does not already have a property
* Any number of input parameters can be passed to this function but every * set document, the application should create a variable initialized
* input variable name should have a matching value input argument. * with {\tt NULL} and pass that as the first parameter.
* *
* \return <tt>NULL</tt> on failure, or the property-set document node. * @return [int] An integer representing one of the following:
*/ * \begin{itemize}
EXPORT_SPEC IXML_Document *UpnpCreatePropertySet( * \item {\tt UPNP_E_SUCCESS}: The operation completed successfully.
/*! [in] The number of argument pairs passed. */ * \item {\tt UPNP_E_INVALID_PARAM}: One or more of the parameters
int NumArg, * are invalid.
/*! [in] The status variable name and value pair. */ * \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
const char *Arg, * complete this operation.
/*! [in] Variable sized list with the rest of the parameters. */ * \end{itemize}
...);
/*!
* \brief Can be used when an application needs to transfer the status of many
* variables at once.
* *
* It can be used (inside a loop) to add some extra status variables into an
* existing property set. If the application does not already have a property
* set document, the application should create a variable initialized with
* <tt>NULL</tt> and pass that as the first parameter.
*
* \return An integer representing one of the following:
* \li <tt>UPNP_E_SUCCESS</tt>: The operation completed successfully.
* \li <tt>UPNP_E_INVALID_PARAM</tt>: One or more of the parameters are invalid.
* \li <tt>UPNP_E_OUTOF_MEMORY</tt>: Insufficient resources exist to
* complete this operation.
*/ */
EXPORT_SPEC int UpnpAddToPropertySet( EXPORT_SPEC int UpnpAddToPropertySet(
/*! [in,out] A pointer to the document containing the property set document node. */ IN OUT IXML_Document **PropSet,
IXML_Document **PropSet, /** A pointer to the document containing
/*! [in] The status variable name. */ the property set document node. */
const char *ArgName, IN const char * ArgName, /** The status variable name. */
/*! [in] The status variable value. */ IN const char * ArgVal /** The status variable value. */
const char *ArgVal); );
/** {\bf UpnpCreatePropertySet} creates a property set
* message packet. Any number of input parameters can be passed
* to this function but every input variable name should have
* a matching value input argument.
*
* @return [IXML_Document*] {\tt NULL} on failure, or the property-set
* document node.
*
*/
EXPORT_SPEC IXML_Document* UpnpCreatePropertySet(
IN int NumArg, /** The number of argument pairs passed. */
IN const char* Arg, /** The status variable name and value pair. */
IN ...
);
/** {\bf UpnpGetErrorMessage} converts an SDK error code into a
* string error message suitable for display. The memory returned
* from this function should NOT be freed.
*
* @return [char*] An ASCII text string representation of the error message
* associated with the error code.
*/
EXPORT_SPEC const char * UpnpGetErrorMessage(
int errorcode /** The SDK error code to convert. */
);
//@}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // UPNP_HAVE_TOOLS
/*! @} */ #endif // UPNP_TOOLS_H
#endif /* UPNP_HAVE_TOOLS */
#endif /* UPNP_TOOLS_H */

View File

@@ -1,97 +0,0 @@
# -*- Autoconf -*-
# This file is part of the aMule project.
# This file is part of the libupnp library project.
#
# Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#
dnl --------------------------------------------------------------------------
dnl LIBUPNP_CHECK([VERSION = 1.6.6], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl
dnl Check for the libupnp library
dnl --------------------------------------------------------------------------
dnl
dnl This macro sets these variables:
dnl - LIBUPNP_VERSION
dnl Something like "1.6.7"
dnl - LIBUPNP_CPPFLAGS
dnl Flags to be added to CPPFLAGS
dnl - LIBUPNP_CFLAGS
dnl Flags to be added to CFLAGS
dnl - LIBUPNP_LDFLAGS
dnl Flags to be added to LDFLAGS
dnl - LIBUPNP_LIBS
dnl Library to be added to LIBS
dnl
dnl The LIBUPNP_CPPFLAGS, LIBUPNP_CFLAGS, LIBUPNP_LDFLAGS and LIBUPNP_LIBS variables are also substituted.
dnl
AC_DEFUN([LIBUPNP_CHECK],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
m4_define([MIN_LIBUPNP_VERSION], [m4_ifval([$1], [$1], [1.6.6])])dnl
dnl Test for --with-libupnp-prefix
AC_ARG_WITH(
[libupnp-prefix],
[AS_HELP_STRING(
[--with-libupnp-prefix=PREFIX],
[UPnP library location])],
[export PKG_CONFIG_PATH=$withval/lib/pkgconfig])
dnl Check for libupnp >= MIN_LIBUPNP_VERSION
AS_IF([test $cross_compiling = no], [
AC_MSG_CHECKING([for libupnp version >= MIN_LIBUPNP_VERSION])
AS_IF([test -n "$PKG_CONFIG"], [
AS_IF([$PKG_CONFIG libupnp --exists], [
LIBUPNP_VERSION=`$PKG_CONFIG libupnp --modversion`
AS_IF([$PKG_CONFIG libupnp --atleast-version=MIN_LIBUPNP_VERSION], [
result=yes
resultstr=" (version $LIBUPNP_VERSION)"
LIBUPNP_CPPFLAGS=`$PKG_CONFIG libupnp --cflags-only-I`
LIBUPNP_CFLAGS=`$PKG_CONFIG libupnp --cflags-only-other`
LIBUPNP_LDFLAGS=`$PKG_CONFIG libupnp --libs-only-L`
LIBUPNP_LIBS=`$PKG_CONFIG libupnp --libs-only-other`
LIBUPNP_LIBS="$LIBUPNP_LIBS `$PKG_CONFIG libupnp --libs-only-l`"
], [
result=no
resultstr=" (version $LIBUPNP_VERSION is not new enough)"
])
], [
result=no
resultstr=" (try to use --with-libupnp-prefix=PREFIX)"
])
], [
result=no
resultstr=" (pkg-config not found)"
])
AC_MSG_RESULT([$result$resultstr])
libupnp_error="libupnp >= MIN_LIBUPNP_VERSION not found$resultstr"
], [
dnl Currently cross-compilation with libupnp is not supported.
result=no
libupnp_error="cross compiling"
])
dnl Execute the right action.
AS_IF([test ${result:-no} = yes], [$2], [$3])
dnl Exported symbols
AC_SUBST([LIBUPNP_CPPFLAGS])dnl
AC_SUBST([LIBUPNP_CFLAGS])dnl
AC_SUBST([LIBUPNP_LDFLAGS])dnl
AC_SUBST([LIBUPNP_LIBS])dnl
m4_undefine([MIN_LIBUPNP_VERSION])dnl
])

View File

@@ -1,84 +0,0 @@
#
# "Makefile.am" for "libupnp/upnp/sample"
#
# Copyright (C) 2007 Marcelo Roberto Jimenez <mroberto@users.sourceforge.net>
#
AM_CPPFLAGS = \
-I$(top_srcdir)/upnp/inc \
-I$(top_srcdir)/threadutil/inc \
-I$(top_srcdir)/ixml/inc
LDADD = \
$(top_builddir)/upnp/libupnp.la \
$(top_builddir)/threadutil/libthreadutil.la \
$(top_builddir)/ixml/libixml.la
# samples
noinst_PROGRAMS =
if ENABLE_SAMPLES
if ENABLE_CLIENT
noinst_PROGRAMS += upnp_tv_ctrlpt
upnp_tv_ctrlpt_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(srcdir)/common/ \
-I$(srcdir)/tvctrlpt
if ENABLE_DEVICE
noinst_PROGRAMS += upnp_tv_combo
upnp_tv_combo_CPPFLAGS = $(AM_CPPFLAGS) \
-I$(srcdir)/common/ \
-I$(srcdir)/tvcombo
endif
endif
if ENABLE_DEVICE
noinst_PROGRAMS += upnp_tv_device
upnp_tv_device_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(srcdir)/common/ \
-I$(srcdir)/tvdevice
endif
endif
upnp_tv_device_SOURCES = \
common/sample_util.c \
common/sample_util.h \
tvdevice/upnp_tv_device.c \
tvdevice/upnp_tv_device.h \
tvdevice/linux/upnp_tv_device_main.c
upnp_tv_ctrlpt_SOURCES = \
common/sample_util.c \
common/sample_util.h \
tvctrlpt/upnp_tv_ctrlpt.c \
tvctrlpt/upnp_tv_ctrlpt.h \
tvctrlpt/linux/upnp_tv_ctrlpt_main.c
upnp_tv_combo_SOURCES = \
common/sample_util.c \
common/sample_util.h \
tvcombo/upnp_tv_ctrlpt.c \
tvcombo/upnp_tv_ctrlpt.h \
tvcombo/upnp_tv_device.c \
tvcombo/upnp_tv_device.h \
tvcombo/linux/upnp_tv_combo_main.c
if WITH_DOCUMENTATION
examplesdir = $(docdir)/examples
examples_DATA = \
$(sort \
$(upnp_tv_ctrlpt_SOURCES) \
$(upnp_tv_device_SOURCES))
endif
EXTRA_DIST = \
web/tvcombodesc.xml \
web/tvcontrolSCPD.xml \
web/tvdevicedesc.xml \
web/tvdevicepres.html \
web/tvpictureSCPD.xml

File diff suppressed because it is too large Load Diff

View File

@@ -1,63 +1,57 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef SAMPLE_UTIL_H #ifndef SAMPLE_UTIL_H
#define SAMPLE_UTIL_H #define SAMPLE_UTIL_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif
#include "ithread.h"
#include "ixml.h" /* for IXML_Document, IXML_Element */
#include "upnp.h" /* for Upnp_EventType */
#include "upnptools.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "upnptools.h"
#include "ithread.h"
#include "ixml.h"
/* mutex to control displaying of events */ //mutex to control displaying of events
extern ithread_mutex_t display_mutex; extern ithread_mutex_t display_mutex ;
typedef enum { typedef enum {
STATE_UPDATE = 0, STATE_UPDATE = 0,
DEVICE_ADDED = 1, DEVICE_ADDED =1,
DEVICE_REMOVED = 2, DEVICE_REMOVED=2,
GET_VAR_COMPLETE = 3 GET_VAR_COMPLETE=3
} eventType; } eventType;
@@ -74,7 +68,7 @@ typedef enum {
* node -- The DOM node from which to extract the value * node -- The DOM node from which to extract the value
* *
********************************************************************************/ ********************************************************************************/
char *SampleUtil_GetElementValue(IN IXML_Element *element); char * SampleUtil_GetElementValue(IN IXML_Element *element);
/******************************************************************************** /********************************************************************************
* SampleUtil_GetFirstServiceList * SampleUtil_GetFirstServiceList
@@ -91,7 +85,7 @@ char *SampleUtil_GetElementValue(IN IXML_Element *element);
* *
********************************************************************************/ ********************************************************************************/
IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document *doc); IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document * doc);
/******************************************************************************** /********************************************************************************
@@ -106,7 +100,7 @@ IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document *doc);
* item -- The item to search for * item -- The item to search for
* *
********************************************************************************/ ********************************************************************************/
char *SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *item); char * SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *item);
@@ -122,7 +116,7 @@ char *SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *item
* item -- The item to search for * item -- The item to search for
* *
********************************************************************************/ ********************************************************************************/
char *SampleUtil_GetFirstElementItem(IN IXML_Element *element, IN const char *item); char * SampleUtil_GetFirstElementItem(IN IXML_Element *element, IN const char *item);
/******************************************************************************** /********************************************************************************
* SampleUtil_PrintEventType * SampleUtil_PrintEventType
@@ -168,13 +162,9 @@ int SampleUtil_PrintEvent(IN Upnp_EventType EventType,
* controlURL -- OUT -- The control URL for the service * controlURL -- OUT -- The control URL for the service
* *
********************************************************************************/ ********************************************************************************/
int SampleUtil_FindAndParseService ( int SampleUtil_FindAndParseService (IN IXML_Document *DescDoc, IN char* location,
IN IXML_Document *DescDoc, IN char *serviceType, OUT char **serviceId,
IN const char* location, OUT char **eventURL, OUT char **controlURL);
IN char *serviceType,
OUT char **serviceId,
OUT char **eventURL,
OUT char **controlURL);
/******************************************************************************** /********************************************************************************
@@ -206,11 +196,8 @@ extern print_string gPrintFun;
* const char * UDN * const char * UDN
* int newDevice * int newDevice
********************************************************************************/ ********************************************************************************/
typedef void (*state_update)( typedef void (*state_update)( const char *varName, const char *varValue, const char *UDN,
const char *varName, eventType type);
const char *varValue,
const char *UDN,
eventType type);
//global state update function used by smaple util //global state update function used by smaple util
extern state_update gStateUpdateFun; extern state_update gStateUpdateFun;
@@ -237,7 +224,7 @@ int SampleUtil_Initialize(print_string print_function);
* Parameters: * Parameters:
* *
********************************************************************************/ ********************************************************************************/
int SampleUtil_Finish(); int SampleUtil_Finish(void);
/******************************************************************************** /********************************************************************************
* SampleUtil_Print * SampleUtil_Print
@@ -251,7 +238,7 @@ int SampleUtil_Finish();
* . . . - variable number of args. (see printf) * . . . - variable number of args. (see printf)
* *
********************************************************************************/ ********************************************************************************/
int SampleUtil_Print(char *fmt, ...); int SampleUtil_Print( char *fmt, ... );
/******************************************************************************** /********************************************************************************
* SampleUtil_RegisterUpdateFunction * SampleUtil_RegisterUpdateFunction
@@ -261,7 +248,7 @@ int SampleUtil_Print(char *fmt, ...);
* Parameters: * Parameters:
* *
********************************************************************************/ ********************************************************************************/
int SampleUtil_RegisterUpdateFunction(state_update update_function); int SampleUtil_RegisterUpdateFunction( state_update update_function );
/******************************************************************************** /********************************************************************************
* SampleUtil_StateUpdate * SampleUtil_StateUpdate
@@ -271,22 +258,11 @@ int SampleUtil_RegisterUpdateFunction(state_update update_function);
* Parameters: * Parameters:
* *
********************************************************************************/ ********************************************************************************/
void SampleUtil_StateUpdate( void SampleUtil_StateUpdate( const char *varName, const char *varValue, const char *UDN,
const char *varName, eventType type);
const char *varValue,
const char *UDN,
eventType type);
#ifdef __cplusplus #ifdef __cplusplus
}; };
#endif /* __cplusplus */
#ifdef WIN32
#define snprintf _snprintf
#define strcasecmp stricmp
#endif #endif
#endif /* UPNPSDK_UTIL_H */
#endif /* SAMPLE_UTIL_H */

View File

@@ -1,491 +0,0 @@
/*******************************************************************************
*
* Copyright (c) 2000-2003 Intel Corporation
* 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 name of Intel Corporation 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 INTEL 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 "sample_util.h"
#include "upnp_tv_ctrlpt.h"
#include "upnp_tv_device.h"
#include <stdio.h>
#include <string.h>
/*
Tags for valid commands issued at the command prompt
*/
enum cmdloop_tvcmds {
PRTHELP = 0, PRTFULLHELP, POWON, POWOFF,
SETCHAN, SETVOL, SETCOL, SETTINT, SETCONT, SETBRT,
CTRLACTION, PICTACTION, CTRLGETVAR, PICTGETVAR,
PRTDEV, LSTDEV, REFRESH, EXITCMD
};
/*
Data structure for parsing commands from the command line
*/
struct cmdloop_commands {
char *str; // the string
int cmdnum; // the command
int numargs; // the number of arguments
char *args; // the args
} cmdloop_commands;
/*
Mappings between command text names, command tag,
and required command arguments for command line
commands
*/
static struct cmdloop_commands cmdloop_cmdlist[] = {
{"Help", PRTHELP, 1, ""},
{"HelpFull", PRTFULLHELP, 1, ""},
{"ListDev", LSTDEV, 1, ""},
{"Refresh", REFRESH, 1, ""},
{"PrintDev", PRTDEV, 2, "<devnum>"},
{"PowerOn", POWON, 2, "<devnum>"},
{"PowerOff", POWOFF, 2, "<devnum>"},
{"SetChannel", SETCHAN, 3, "<devnum> <channel (int)>"},
{"SetVolume", SETVOL, 3, "<devnum> <volume (int)>"},
{"SetColor", SETCOL, 3, "<devnum> <color (int)>"},
{"SetTint", SETTINT, 3, "<devnum> <tint (int)>"},
{"SetContrast", SETCONT, 3, "<devnum> <contrast (int)>"},
{"SetBrightness", SETBRT, 3, "<devnum> <brightness (int)>"},
{"CtrlAction", CTRLACTION, 2, "<devnum> <action (string)>"},
{"PictAction", PICTACTION, 2, "<devnum> <action (string)>"},
{"CtrlGetVar", CTRLGETVAR, 2, "<devnum> <varname (string)>"},
{"PictGetVar", PICTGETVAR, 2, "<devnum> <varname (string)>"},
{"Exit", EXITCMD, 1, ""}
};
void
linux_print( const char *string )
{
puts( string );
}
/********************************************************************************
* TvCtrlPointPrintHelp
*
* Description:
* Print help info for this application.
********************************************************************************/
void
TvCtrlPointPrintShortHelp( void )
{
SampleUtil_Print( "Commands:" );
SampleUtil_Print( " Help" );
SampleUtil_Print( " HelpFull" );
SampleUtil_Print( " ListDev" );
SampleUtil_Print( " Refresh" );
SampleUtil_Print( " PrintDev <devnum>" );
SampleUtil_Print( " PowerOn <devnum>" );
SampleUtil_Print( " PowerOff <devnum>" );
SampleUtil_Print( " SetChannel <devnum> <channel>" );
SampleUtil_Print( " SetVolume <devnum> <volume>" );
SampleUtil_Print( " SetColor <devnum> <color>" );
SampleUtil_Print( " SetTint <devnum> <tint>" );
SampleUtil_Print( " SetContrast <devnum> <contrast>" );
SampleUtil_Print( " SetBrightness <devnum> <brightness>" );
SampleUtil_Print( " CtrlAction <devnum> <action>" );
SampleUtil_Print( " PictAction <devnum> <action>" );
SampleUtil_Print( " CtrlGetVar <devnum> <varname>" );
SampleUtil_Print( " PictGetVar <devnum> <action>" );
SampleUtil_Print( " Exit" );
}
void
TvCtrlPointPrintLongHelp( void )
{
SampleUtil_Print( "" );
SampleUtil_Print( "******************************" );
SampleUtil_Print( "* TV Control Point Help Info *" );
SampleUtil_Print( "******************************" );
SampleUtil_Print( "" );
SampleUtil_Print( "This sample control point application automatically searches" );
SampleUtil_Print( "for and subscribes to the services of television device emulator" );
SampleUtil_Print( "devices, described in the tvdevicedesc.xml description document." );
SampleUtil_Print( "It also registers itself as a tv device." );
SampleUtil_Print( "" );
SampleUtil_Print( "Commands:" );
SampleUtil_Print( " Help" );
SampleUtil_Print( " Print this help info." );
SampleUtil_Print( " ListDev" );
SampleUtil_Print( " Print the current list of TV Device Emulators that this" );
SampleUtil_Print( " control point is aware of. Each device is preceded by a" );
SampleUtil_Print( " device number which corresponds to the devnum argument of" );
SampleUtil_Print( " commands listed below." );
SampleUtil_Print( " Refresh" );
SampleUtil_Print( " Delete all of the devices from the device list and issue new" );
SampleUtil_Print( " search request to rebuild the list from scratch." );
SampleUtil_Print( " PrintDev <devnum>" );
SampleUtil_Print( " Print the state table for the device <devnum>." );
SampleUtil_Print( " e.g., 'PrintDev 1' prints the state table for the first" );
SampleUtil_Print( " device in the device list." );
SampleUtil_Print( " PowerOn <devnum>" );
SampleUtil_Print( " Sends the PowerOn action to the Control Service of" );
SampleUtil_Print( " device <devnum>." );
SampleUtil_Print( " PowerOff <devnum>" );
SampleUtil_Print( " Sends the PowerOff action to the Control Service of" );
SampleUtil_Print( " device <devnum>." );
SampleUtil_Print( " SetChannel <devnum> <channel>" );
SampleUtil_Print( " Sends the SetChannel action to the Control Service of" );
SampleUtil_Print( " device <devnum>, requesting the channel to be changed" );
SampleUtil_Print( " to <channel>." );
SampleUtil_Print( " SetVolume <devnum> <volume>" );
SampleUtil_Print( " Sends the SetVolume action to the Control Service of" );
SampleUtil_Print( " device <devnum>, requesting the volume to be changed" );
SampleUtil_Print( " to <volume>." );
SampleUtil_Print( " SetColor <devnum> <color>" );
SampleUtil_Print( " Sends the SetColor action to the Control Service of" );
SampleUtil_Print( " device <devnum>, requesting the color to be changed" );
SampleUtil_Print( " to <color>." );
SampleUtil_Print( " SetTint <devnum> <tint>" );
SampleUtil_Print( " Sends the SetTint action to the Control Service of" );
SampleUtil_Print( " device <devnum>, requesting the tint to be changed" );
SampleUtil_Print( " to <tint>." );
SampleUtil_Print( " SetContrast <devnum> <contrast>" );
SampleUtil_Print( " Sends the SetContrast action to the Control Service of" );
SampleUtil_Print( " device <devnum>, requesting the contrast to be changed" );
SampleUtil_Print( " to <contrast>." );
SampleUtil_Print( " SetBrightness <devnum> <brightness>" );
SampleUtil_Print( " Sends the SetBrightness action to the Control Service of" );
SampleUtil_Print( " device <devnum>, requesting the brightness to be changed" );
SampleUtil_Print( " to <brightness>." );
SampleUtil_Print( " CtrlAction <devnum> <action>" );
SampleUtil_Print( " Sends an action request specified by the string <action>" );
SampleUtil_Print( " to the Control Service of device <devnum>. This command" );
SampleUtil_Print( " only works for actions that have no arguments." );
SampleUtil_Print( " (e.g., \"CtrlAction 1 IncreaseChannel\")" );
SampleUtil_Print( " PictAction <devnum> <action>" );
SampleUtil_Print( " Sends an action request specified by the string <action>" );
SampleUtil_Print( " to the Picture Service of device <devnum>. This command" );
SampleUtil_Print( " only works for actions that have no arguments." );
SampleUtil_Print( " (e.g., \"PictAction 1 DecreaseContrast\")" );
SampleUtil_Print( " CtrlGetVar <devnum> <varname>" );
SampleUtil_Print( " Requests the value of a variable specified by the string <varname>" );
SampleUtil_Print( " from the Control Service of device <devnum>." );
SampleUtil_Print( " (e.g., \"CtrlGetVar 1 Volume\")" );
SampleUtil_Print( " PictGetVar <devnum> <action>" );
SampleUtil_Print( " Requests the value of a variable specified by the string <varname>" );
SampleUtil_Print( " from the Picture Service of device <devnum>." );
SampleUtil_Print( " (e.g., \"PictGetVar 1 Tint\")" );
SampleUtil_Print( " Exit" );
SampleUtil_Print( " Exits the control point application." );
}
/********************************************************************************
* TvCtrlPointPrintCommands
*
* Description:
* Print the list of valid command line commands to the user
*
* Parameters:
* None
*
********************************************************************************/
void
TvCtrlPointPrintCommands()
{
int i;
int numofcmds = sizeof( cmdloop_cmdlist ) / sizeof( cmdloop_commands );
SampleUtil_Print( "Valid Commands:" );
for( i = 0; i < numofcmds; i++ ) {
SampleUtil_Print( " %-14s %s", cmdloop_cmdlist[i].str,
cmdloop_cmdlist[i].args );
}
SampleUtil_Print( "" );
}
/********************************************************************************
* TvCtrlPointCommandLoop
*
* Description:
* Function that receives commands from the user at the command prompt
* during the lifetime of the control point, and calls the appropriate
* functions for those commands.
*
* Parameters:
* None
*
********************************************************************************/
void *
TvCtrlPointCommandLoop( void *args )
{
char cmdline[100];
while( 1 ) {
SampleUtil_Print( "\n>> " );
fgets( cmdline, 100, stdin );
TvCtrlPointProcessCommand( cmdline );
}
return NULL;
}
int
TvCtrlPointProcessCommand( char *cmdline )
{
char cmd[100];
char strarg[100];
int arg_val_err = -99999;
int arg1 = arg_val_err;
int arg2 = arg_val_err;
int cmdnum = -1;
int numofcmds = sizeof( cmdloop_cmdlist ) / sizeof( cmdloop_commands );
int cmdfound = 0;
int i,
rc;
int invalidargs = 0;
int validargs;
validargs = sscanf( cmdline, "%s %d %d", cmd, &arg1, &arg2 );
for( i = 0; i < numofcmds; i++ ) {
if( strcasecmp( cmd, cmdloop_cmdlist[i].str ) == 0 ) {
cmdnum = cmdloop_cmdlist[i].cmdnum;
cmdfound++;
if( validargs != cmdloop_cmdlist[i].numargs )
invalidargs++;
break;
}
}
if( !cmdfound ) {
SampleUtil_Print( "Command not found; try 'Help'" );
return TV_SUCCESS;
}
if( invalidargs ) {
SampleUtil_Print( "Invalid arguments; try 'Help'" );
return TV_SUCCESS;
}
switch ( cmdnum ) {
case PRTHELP:
TvCtrlPointPrintShortHelp();
break;
case PRTFULLHELP:
TvCtrlPointPrintLongHelp();
break;
case POWON:
TvCtrlPointSendPowerOn( arg1 );
break;
case POWOFF:
TvCtrlPointSendPowerOff( arg1 );
break;
case SETCHAN:
TvCtrlPointSendSetChannel( arg1, arg2 );
break;
case SETVOL:
TvCtrlPointSendSetVolume( arg1, arg2 );
break;
case SETCOL:
TvCtrlPointSendSetColor( arg1, arg2 );
break;
case SETTINT:
TvCtrlPointSendSetTint( arg1, arg2 );
break;
case SETCONT:
TvCtrlPointSendSetContrast( arg1, arg2 );
break;
case SETBRT:
TvCtrlPointSendSetBrightness( arg1, arg2 );
break;
case CTRLACTION:
/*
re-parse commandline since second arg is string
*/
validargs = sscanf( cmdline, "%s %d %s", cmd, &arg1, strarg );
if( 3 == validargs )
TvCtrlPointSendAction( TV_SERVICE_CONTROL, arg1, strarg,
NULL, NULL, 0 );
else
invalidargs++;
break;
case PICTACTION:
/*
re-parse commandline since second arg is string
*/
validargs = sscanf( cmdline, "%s %d %s", cmd, &arg1, strarg );
if( 3 == validargs )
TvCtrlPointSendAction( TV_SERVICE_PICTURE, arg1, strarg,
NULL, NULL, 0 );
else
invalidargs++;
break;
case CTRLGETVAR:
/*
re-parse commandline since second arg is string
*/
validargs = sscanf( cmdline, "%s %d %s", cmd, &arg1, strarg );
if( 3 == validargs )
TvCtrlPointGetVar( TV_SERVICE_CONTROL, arg1, strarg );
else
invalidargs++;
break;
case PICTGETVAR:
/*
re-parse commandline since second arg is string
*/
validargs = sscanf( cmdline, "%s %d %s", cmd, &arg1, strarg );
if( 3 == validargs )
TvCtrlPointGetVar( TV_SERVICE_PICTURE, arg1, strarg );
else
invalidargs++;
break;
case PRTDEV:
TvCtrlPointPrintDevice( arg1 );
break;
case LSTDEV:
TvCtrlPointPrintList();
break;
case REFRESH:
TvCtrlPointRefresh();
break;
case EXITCMD:
rc = TvCtrlPointStop();
exit( rc );
break;
default:
SampleUtil_Print( "Command not implemented; see 'Help'" );
break;
}
if( invalidargs )
SampleUtil_Print( "Invalid args in command; see 'Help'" );
return TV_SUCCESS;
}
int
device_main( int argc, char **argv )
{
unsigned int portTemp = 0;
char *ip_address = NULL,
*desc_doc_name = NULL,
*web_dir_path = NULL;
unsigned int port = 0;
int i = 0;
SampleUtil_Initialize( linux_print );
// Parse options
for( i = 1; i < argc; i++ ) {
if( strcmp( argv[i], "-ip" ) == 0 ) {
ip_address = argv[++i];
} else if( strcmp( argv[i], "-port" ) == 0 ) {
sscanf( argv[++i], "%u", &portTemp );
} else if( strcmp( argv[i], "-desc" ) == 0 ) {
desc_doc_name = argv[++i];
} else if( strcmp( argv[i], "-webdir" ) == 0 ) {
web_dir_path = argv[++i];
} else if( strcmp( argv[i], "-help" ) == 0 ) {
SampleUtil_Print( "Usage: %s -ip ipaddress -port port"
" -desc desc_doc_name -webdir web_dir_path"
" -help (this message)\n", argv[0] );
SampleUtil_Print( "\tipaddress: IP address of the device"
" (must match desc. doc)\n" );
SampleUtil_Print( "\t\te.g.: 192.168.0.4\n" );
SampleUtil_Print( "\tport: Port number to use for "
"receiving UPnP messages (must match desc. doc)\n" );
SampleUtil_Print( "\t\te.g.: 5431\n" );
SampleUtil_Print
( "\tdesc_doc_name: name of device description document\n" );
SampleUtil_Print( "\t\te.g.: tvcombodesc.xml\n" );
SampleUtil_Print
( "\tweb_dir_path: Filesystem path where web files "
"related to the device are stored\n" );
SampleUtil_Print( "\t\te.g.: /upnp/sample/web\n" );
return 1;
}
}
port = ( unsigned short )portTemp;
return TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path, linux_print );
}
int main( int argc, char **argv )
{
int rc;
ithread_t cmdloop_thread;
#ifdef WIN32
#else
int sig;
sigset_t sigs_to_catch;
#endif
int code;
device_main(argc, argv);
rc = TvCtrlPointStart( linux_print, NULL );
if( rc != TV_SUCCESS ) {
SampleUtil_Print( "Error starting UPnP TV Control Point" );
return rc;
}
/* start a command loop thread */
code = ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop, NULL );
#ifdef WIN32
ithread_join(cmdloop_thread, NULL);
#else
/*
Catch Ctrl-C and properly shutdown
*/
sigemptyset( &sigs_to_catch );
sigaddset( &sigs_to_catch, SIGINT );
sigwait( &sigs_to_catch, &sig );
SampleUtil_Print( "Shutting down on signal %d...\n", sig );
#endif
TvDeviceStop();
rc = TvCtrlPointStop();
return rc;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,170 +0,0 @@
/**************************************************************************
*
* Copyright (c) 2000-2003 Intel Corporation
* 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 name of Intel Corporation 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 INTEL 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.
*
**************************************************************************/
#ifndef UPNP_TV_CTRLPT_H
#define UPNP_TV_CTRLPT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "sample_util.h"
#include "ithread.h"
#include "upnp.h"
#include "upnptools.h"
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
/* Do not #include <unistd.h> */
#else
#include <unistd.h>
#endif
#define TV_SERVICE_SERVCOUNT 2
#define TV_SERVICE_CONTROL 0
#define TV_SERVICE_PICTURE 1
#define TV_CONTROL_VARCOUNT 3
#define TV_CONTROL_POWER 0
#define TV_CONTROL_CHANNEL 1
#define TV_CONTROL_VOLUME 2
#define TV_PICTURE_VARCOUNT 4
#define TV_PICTURE_COLOR 0
#define TV_PICTURE_TINT 1
#define TV_PICTURE_CONTRAST 2
#define TV_PICTURE_BRIGHTNESS 3
#define TV_MAX_VAL_LEN 5
#define TV_SUCCESS 0
#define TV_ERROR (-1)
#define TV_WARNING 1
/* This should be the maximum VARCOUNT from above */
#define TV_MAXVARS TV_PICTURE_VARCOUNT
extern char TvDeviceType[];
extern char *TvServiceType[];
extern char *TvServiceName[];
extern char *TvVarName[TV_SERVICE_SERVCOUNT][TV_MAXVARS];
extern char TvVarCount[];
struct tv_service {
char ServiceId[NAME_SIZE];
char ServiceType[NAME_SIZE];
char *VariableStrVal[TV_MAXVARS];
char EventURL[NAME_SIZE];
char ControlURL[NAME_SIZE];
char SID[NAME_SIZE];
};
extern struct TvDeviceNode *GlobalDeviceList;
struct TvDevice {
char UDN[250];
char DescDocURL[250];
char FriendlyName[250];
char PresURL[250];
int AdvrTimeOut;
struct tv_service TvService[TV_SERVICE_SERVCOUNT];
};
struct TvDeviceNode {
struct TvDevice device;
struct TvDeviceNode *next;
};
extern ithread_mutex_t DeviceListMutex;
extern UpnpClient_Handle ctrlpt_handle;
void TvCtrlPointPrintHelp();
int TvCtrlPointDeleteNode(struct TvDeviceNode*);
int TvCtrlPointRemoveDevice(const char *);
int TvCtrlPointRemoveAll();
int TvCtrlPointRefresh();
int TvCtrlPointSendAction(int, int, char *, char **, char **, int);
int TvCtrlPointSendActionNumericArg(int devnum, int service, char *actionName, char *paramName, int paramValue);
int TvCtrlPointSendPowerOn(int devnum);
int TvCtrlPointSendPowerOff(int devnum);
int TvCtrlPointSendSetChannel(int, int);
int TvCtrlPointSendSetVolume(int, int);
int TvCtrlPointSendSetColor(int, int);
int TvCtrlPointSendSetTint(int, int);
int TvCtrlPointSendSetContrast(int, int);
int TvCtrlPointSendSetBrightness(int, int);
int TvCtrlPointGetVar(int, int, char*);
int TvCtrlPointGetPower(int devnum);
int TvCtrlPointGetChannel(int);
int TvCtrlPointGetVolume(int);
int TvCtrlPointGetColor(int);
int TvCtrlPointGetTint(int);
int TvCtrlPointGetContrast(int);
int TvCtrlPointGetBrightness(int);
int TvCtrlPointGetDevice(int, struct TvDeviceNode **);
int TvCtrlPointPrintList( void );
int TvCtrlPointPrintDevice(int);
void TvCtrlPointAddDevice(IXML_Document *, const char *, int);
void TvCtrlPointHandleGetVar(const char *, const char *, const DOMString);
void TvStateUpdate(char*,int, IXML_Document * , char **);
void TvCtrlPointHandleEvent(const UpnpString *, int, IXML_Document *);
void TvCtrlPointHandleSubscribeUpdate(const char *, const Upnp_SID, int);
int TvCtrlPointCallbackEventHandler(Upnp_EventType, void *, void *);
void TvCtrlPointVerifyTimeouts(int);
void TvCtrlPointPrintCommands( void );
void* TvCtrlPointCommandLoop( void* );
int TvCtrlPointStart( print_string printFunctionPtr, state_update updateFunctionPtr );
int TvCtrlPointStop( void );
int TvCtrlPointProcessCommand( char *cmdline );
#ifdef __cplusplus
};
#endif
#endif //UPNP_TV_CTRLPT_H

File diff suppressed because it is too large Load Diff

View File

@@ -1,632 +0,0 @@
/**************************************************************************
*
* Copyright (c) 2000-2003 Intel Corporation
* 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 name of Intel Corporation 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 INTEL 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.
*
**************************************************************************/
#ifndef UPNP_TV_DEVICE_H
#define UPNP_TV_DEVICE_H
#include <stdio.h>
#include <signal.h>
#ifdef __cplusplus
extern "C" {
#endif
#include "sample_util.h"
#include "ithread.h"
#include "upnp.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
/* Do not #include <unistd.h> */
#else
#include <unistd.h>
#endif
//Color constants
#define MAX_COLOR 10
#define MIN_COLOR 1
//Brightness constants
#define MAX_BRIGHTNESS 10
#define MIN_BRIGHTNESS 1
//Power constants
#define POWER_ON 1
#define POWER_OFF 0
//Tint constants
#define MAX_TINT 10
#define MIN_TINT 1
//Volume constants
#define MAX_VOLUME 10
#define MIN_VOLUME 1
//Contrast constants
#define MAX_CONTRAST 10
#define MIN_CONTRAST 1
//Channel constants
#define MAX_CHANNEL 100
#define MIN_CHANNEL 1
//Number of services.
#define TV_SERVICE_SERVCOUNT 2
//Index of control service
#define TV_SERVICE_CONTROL 0
//Index of picture service
#define TV_SERVICE_PICTURE 1
//Number of control variables
#define TV_CONTROL_VARCOUNT 3
//Index of power variable
#define TV_CONTROL_POWER 0
//Index of channel variable
#define TV_CONTROL_CHANNEL 1
//Index of volume variable
#define TV_CONTROL_VOLUME 2
//Number of picture variables
#define TV_PICTURE_VARCOUNT 4
//Index of color variable
#define TV_PICTURE_COLOR 0
//Index of tint variable
#define TV_PICTURE_TINT 1
//Index of contrast variable
#define TV_PICTURE_CONTRAST 2
//Index of brightness variable
#define TV_PICTURE_BRIGHTNESS 3
//Max value length
#define TV_MAX_VAL_LEN 5
//Max actions
#define TV_MAXACTIONS 12
/* This should be the maximum VARCOUNT from above */
#define TV_MAXVARS TV_PICTURE_VARCOUNT
extern char TvDeviceType[];
extern char *TvServiceType[];
/******************************************************************************
* upnp_action
*
* Description:
* Prototype for all actions. For each action that a service
* implements, there is a corresponding function with this prototype.
* Pointers to these functions, along with action names, are stored
* in the service table. When an action request comes in the action
* name is matched, and the appropriate function is called.
* Each function returns UPNP_E_SUCCESS, on success, and a nonzero
* error code on failure.
*
* Parameters:
*
* IXML_Document * request - document of action request
* IXML_Document **out - action result
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
typedef int (*upnp_action) (IXML_Document *request, IXML_Document **out, char **errorString);
/* Structure for storing Tv Service
identifiers and state table */
struct TvService {
char UDN[NAME_SIZE]; /* Universally Unique Device Name */
char ServiceId[NAME_SIZE];
char ServiceType[NAME_SIZE];
char *VariableName[TV_MAXVARS];
char *VariableStrVal[TV_MAXVARS];
char *ActionNames[TV_MAXACTIONS];
upnp_action actions[TV_MAXACTIONS];
unsigned int VariableCount;
};
//Array of service structures
extern struct TvService tv_service_table[];
//Device handle returned from sdk
extern UpnpDevice_Handle device_handle;
/* Mutex for protecting the global state table data
in a multi-threaded, asynchronous environment.
All functions should lock this mutex before reading
or writing the state table data. */
extern ithread_mutex_t TVDevMutex;
/******************************************************************************
* SetActionTable
*
* Description:
* Initializes the action table for the specified service.
* Note that
* knowledge of the service description is
* assumed. Action names are hardcoded.
* Parameters:
* int serviceType - one of TV_SERVICE_CONTROL or, TV_SERVICE_PICTURE
* struct TvService *out - service containing action table to set.
*
*****************************************************************************/
int SetActionTable(int serviceType, struct TvService *out);
/******************************************************************************
* TvDeviceStateTableInit
*
* Description:
* Initialize the device state table for
* this TvDevice, pulling identifier info
* from the description Document. Note that
* knowledge of the service description is
* assumed. State table variables and default
* values are currently hardcoded in this file
* rather than being read from service description
* documents.
*
* Parameters:
* DescDocURL -- The description document URL
*
*****************************************************************************/
int TvDeviceStateTableInit(char*);
/******************************************************************************
* TvDeviceHandleSubscriptionRequest
*
* Description:
* Called during a subscription request callback. If the
* subscription request is for this device and either its
* control service or picture service, then accept it.
*
* Parameters:
* sr_event -- The subscription request event structure
*
*****************************************************************************/
int TvDeviceHandleSubscriptionRequest(const UpnpSubscriptionRequest *);
/******************************************************************************
* TvDeviceHandleGetVarRequest
*
* Description:
* Called during a get variable request callback. If the
* request is for this device and either its control service
* or picture service, then respond with the variable value.
*
* Parameters:
* cgv_event -- The control get variable request event structure
*
*****************************************************************************/
int TvDeviceHandleGetVarRequest(UpnpStateVarRequest *);
/******************************************************************************
* TvDeviceHandleActionRequest
*
* Description:
* Called during an action request callback. If the
* request is for this device and either its control service
* or picture service, then perform the action and respond.
*
* Parameters:
* ca_event -- The control action request event structure
*
*****************************************************************************/
int TvDeviceHandleActionRequest(UpnpActionRequest *);
/******************************************************************************
* TvDeviceCallbackEventHandler
*
* Description:
* The callback handler registered with the SDK while registering
* root device. Dispatches the request to the appropriate procedure
* based on the value of EventType. The four requests handled by the
* device are:
* 1) Event Subscription requests.
* 2) Get Variable requests.
* 3) Action requests.
*
* Parameters:
*
* EventType -- The type of callback event
* Event -- Data structure containing event data
* Cookie -- Optional data specified during callback registration
*
*****************************************************************************/
int TvDeviceCallbackEventHandler(Upnp_EventType, void*, void*);
/******************************************************************************
* TvDeviceSetServiceTableVar
*
* Description:
* Update the TvDevice service state table, and notify all subscribed
* control points of the updated state. Note that since this function
* blocks on the mutex TVDevMutex, to avoid a hang this function should
* not be called within any other function that currently has this mutex
* locked.
*
* Parameters:
* service -- The service number (TV_SERVICE_CONTROL or TV_SERVICE_PICTURE)
* variable -- The variable number (TV_CONTROL_POWER, TV_CONTROL_CHANNEL,
* TV_CONTROL_VOLUME, TV_PICTURE_COLOR, TV_PICTURE_TINT,
* TV_PICTURE_CONTRAST, or TV_PICTURE_BRIGHTNESS)
* value -- The string representation of the new value
*
*****************************************************************************/
int TvDeviceSetServiceTableVar(unsigned int, unsigned int, char*);
//Control Service Actions
/******************************************************************************
* TvDevicePowerOn
*
* Description:
* Turn the power on.
*
* Parameters:
*
* IXML_Document * in - document of action request
* IXML_Document **out - action result
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDevicePowerOff
*
* Description:
* Turn the power off.
*
* Parameters:
*
* IXML_Document * in - document of action request
* IXML_Document **out - action result
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceSetChannel
*
* Description:
* Change the channel, update the TvDevice control service
* state table, and notify all subscribed control points of the
* updated state.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceIncreaseChannel
*
* Description:
* Increase the channel.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceDecreaseChannel
*
* Description:
* Decrease the channel.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceSetVolume
*
* Description:
* Change the volume, update the TvDevice control service
* state table, and notify all subscribed control points of the
* updated state.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceIncreaseVolume
*
* Description:
* Increase the volume.
*
* Parameters:
*
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*****************************************************************************/
int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceDecreaseVolume
*
* Description:
* Decrease the volume.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
//Picture Service Actions
/******************************************************************************
* TvDeviceSetColor
*
* Description:
* Change the color, update the TvDevice picture service
* state table, and notify all subscribed control points of the
* updated state.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceIncreaseColor
*
* Description:
* Increase the color.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*****************************************************************************/
int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceDecreaseColor
*
* Description:
* Decrease the color.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*****************************************************************************/
int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceSetTint
*
* Description:
* Change the tint, update the TvDevice picture service
* state table, and notify all subscribed control points of the
* updated state.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceIncreaseTint
*
* Description:
* Increase tint.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceDecreaseTint
*
* Description:
* Decrease tint.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/*****************************************************************************
* TvDeviceSetContrast
*
* Description:
* Change the contrast, update the TvDevice picture service
* state table, and notify all subscribed control points of the
* updated state.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
****************************************************************************/
int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceIncreaseContrast
*
* Description:
*
* Increase the contrast.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceDecreaseContrast
*
* Description:
* Decrease the contrast.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceSetBrightness
*
* Description:
* Change the brightness, update the TvDevice picture service
* state table, and notify all subscribed control points of the
* updated state.
*
* Parameters:
* brightness -- The brightness value to change to.
*
*****************************************************************************/
int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceIncreaseBrightness
*
* Description:
* Increase brightness.
*
* Parameters:
*
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
/******************************************************************************
* TvDeviceDecreaseBrightness
*
* Description:
* Decrease brightnesss.
*
* Parameters:
* IXML_Document * in - action request document
* IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful)
*
*****************************************************************************/
int TvDeviceDecreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
int TvDeviceStart(char * ip_address, unsigned short port,char * desc_doc_name,
char *web_dir_path, print_string pfun);
int TvDeviceStop();
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,40 +1,37 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#include "sample_util.h"
#include "upnp_tv_ctrlpt.h"
#include <stdio.h> #include <stdio.h>
#include "sample_util.h"
#include "upnp_tv_ctrlpt.h"
#include <string.h> #include <string.h>
/* /*
@@ -127,72 +124,108 @@ TvCtrlPointPrintLongHelp( void )
SampleUtil_Print( "* TV Control Point Help Info *" ); SampleUtil_Print( "* TV Control Point Help Info *" );
SampleUtil_Print( "******************************" ); SampleUtil_Print( "******************************" );
SampleUtil_Print( "" ); SampleUtil_Print( "" );
SampleUtil_Print( "This sample control point application automatically searches" ); SampleUtil_Print
SampleUtil_Print( "for and subscribes to the services of television device emulator" ); ( "This sample control point application automatically searches" );
SampleUtil_Print( "devices, described in the tvdevicedesc.xml description document." ); SampleUtil_Print
( "for and subscribes to the services of television device emulator" );
SampleUtil_Print
( "devices, described in the tvdevicedesc.xml description document." );
SampleUtil_Print( "" ); SampleUtil_Print( "" );
SampleUtil_Print( "Commands:" ); SampleUtil_Print( "Commands:" );
SampleUtil_Print( " Help" ); SampleUtil_Print( " Help" );
SampleUtil_Print( " Print this help info." ); SampleUtil_Print( " Print this help info." );
SampleUtil_Print( " ListDev" ); SampleUtil_Print( " ListDev" );
SampleUtil_Print( " Print the current list of TV Device Emulators that this" ); SampleUtil_Print
SampleUtil_Print( " control point is aware of. Each device is preceded by a" ); ( " Print the current list of TV Device Emulators that this" );
SampleUtil_Print( " device number which corresponds to the devnum argument of" ); SampleUtil_Print
( " control point is aware of. Each device is preceded by a" );
SampleUtil_Print
( " device number which corresponds to the devnum argument of" );
SampleUtil_Print( " commands listed below." ); SampleUtil_Print( " commands listed below." );
SampleUtil_Print( " Refresh" ); SampleUtil_Print( " Refresh" );
SampleUtil_Print( " Delete all of the devices from the device list and issue new" ); SampleUtil_Print
SampleUtil_Print( " search request to rebuild the list from scratch." ); ( " Delete all of the devices from the device list and issue new" );
SampleUtil_Print
( " search request to rebuild the list from scratch." );
SampleUtil_Print( " PrintDev <devnum>" ); SampleUtil_Print( " PrintDev <devnum>" );
SampleUtil_Print( " Print the state table for the device <devnum>." ); SampleUtil_Print
SampleUtil_Print( " e.g., 'PrintDev 1' prints the state table for the first" ); ( " Print the state table for the device <devnum>." );
SampleUtil_Print
( " e.g., 'PrintDev 1' prints the state table for the first" );
SampleUtil_Print( " device in the device list." ); SampleUtil_Print( " device in the device list." );
SampleUtil_Print( " PowerOn <devnum>" ); SampleUtil_Print( " PowerOn <devnum>" );
SampleUtil_Print( " Sends the PowerOn action to the Control Service of" ); SampleUtil_Print
( " Sends the PowerOn action to the Control Service of" );
SampleUtil_Print( " device <devnum>." ); SampleUtil_Print( " device <devnum>." );
SampleUtil_Print( " PowerOff <devnum>" ); SampleUtil_Print( " PowerOff <devnum>" );
SampleUtil_Print( " Sends the PowerOff action to the Control Service of" ); SampleUtil_Print
( " Sends the PowerOff action to the Control Service of" );
SampleUtil_Print( " device <devnum>." ); SampleUtil_Print( " device <devnum>." );
SampleUtil_Print( " SetChannel <devnum> <channel>" ); SampleUtil_Print( " SetChannel <devnum> <channel>" );
SampleUtil_Print( " Sends the SetChannel action to the Control Service of" ); SampleUtil_Print
SampleUtil_Print( " device <devnum>, requesting the channel to be changed" ); ( " Sends the SetChannel action to the Control Service of" );
SampleUtil_Print
( " device <devnum>, requesting the channel to be changed" );
SampleUtil_Print( " to <channel>." ); SampleUtil_Print( " to <channel>." );
SampleUtil_Print( " SetVolume <devnum> <volume>" ); SampleUtil_Print( " SetVolume <devnum> <volume>" );
SampleUtil_Print( " Sends the SetVolume action to the Control Service of" ); SampleUtil_Print
SampleUtil_Print( " device <devnum>, requesting the volume to be changed" ); ( " Sends the SetVolume action to the Control Service of" );
SampleUtil_Print
( " device <devnum>, requesting the volume to be changed" );
SampleUtil_Print( " to <volume>." ); SampleUtil_Print( " to <volume>." );
SampleUtil_Print( " SetColor <devnum> <color>" ); SampleUtil_Print( " SetColor <devnum> <color>" );
SampleUtil_Print( " Sends the SetColor action to the Control Service of" ); SampleUtil_Print
SampleUtil_Print( " device <devnum>, requesting the color to be changed" ); ( " Sends the SetColor action to the Control Service of" );
SampleUtil_Print
( " device <devnum>, requesting the color to be changed" );
SampleUtil_Print( " to <color>." ); SampleUtil_Print( " to <color>." );
SampleUtil_Print( " SetTint <devnum> <tint>" ); SampleUtil_Print( " SetTint <devnum> <tint>" );
SampleUtil_Print( " Sends the SetTint action to the Control Service of" ); SampleUtil_Print
SampleUtil_Print( " device <devnum>, requesting the tint to be changed" ); ( " Sends the SetTint action to the Control Service of" );
SampleUtil_Print
( " device <devnum>, requesting the tint to be changed" );
SampleUtil_Print( " to <tint>." ); SampleUtil_Print( " to <tint>." );
SampleUtil_Print( " SetContrast <devnum> <contrast>" ); SampleUtil_Print( " SetContrast <devnum> <contrast>" );
SampleUtil_Print( " Sends the SetContrast action to the Control Service of" ); SampleUtil_Print
SampleUtil_Print( " device <devnum>, requesting the contrast to be changed" ); ( " Sends the SetContrast action to the Control Service of" );
SampleUtil_Print
( " device <devnum>, requesting the contrast to be changed" );
SampleUtil_Print( " to <contrast>." ); SampleUtil_Print( " to <contrast>." );
SampleUtil_Print( " SetBrightness <devnum> <brightness>" ); SampleUtil_Print( " SetBrightness <devnum> <brightness>" );
SampleUtil_Print( " Sends the SetBrightness action to the Control Service of" ); SampleUtil_Print
SampleUtil_Print( " device <devnum>, requesting the brightness to be changed" ); ( " Sends the SetBrightness action to the Control Service of" );
SampleUtil_Print
( " device <devnum>, requesting the brightness to be changed" );
SampleUtil_Print( " to <brightness>." ); SampleUtil_Print( " to <brightness>." );
SampleUtil_Print( " CtrlAction <devnum> <action>" ); SampleUtil_Print( " CtrlAction <devnum> <action>" );
SampleUtil_Print( " Sends an action request specified by the string <action>" ); SampleUtil_Print
SampleUtil_Print( " to the Control Service of device <devnum>. This command" ); ( " Sends an action request specified by the string <action>" );
SampleUtil_Print( " only works for actions that have no arguments." ); SampleUtil_Print
SampleUtil_Print( " (e.g., \"CtrlAction 1 IncreaseChannel\")" ); ( " to the Control Service of device <devnum>. This command" );
SampleUtil_Print
( " only works for actions that have no arguments." );
SampleUtil_Print
( " (e.g., \"CtrlAction 1 IncreaseChannel\")" );
SampleUtil_Print( " PictAction <devnum> <action>" ); SampleUtil_Print( " PictAction <devnum> <action>" );
SampleUtil_Print( " Sends an action request specified by the string <action>" ); SampleUtil_Print
SampleUtil_Print( " to the Picture Service of device <devnum>. This command" ); ( " Sends an action request specified by the string <action>" );
SampleUtil_Print( " only works for actions that have no arguments." ); SampleUtil_Print
SampleUtil_Print( " (e.g., \"PictAction 1 DecreaseContrast\")" ); ( " to the Picture Service of device <devnum>. This command" );
SampleUtil_Print
( " only works for actions that have no arguments." );
SampleUtil_Print
( " (e.g., \"PictAction 1 DecreaseContrast\")" );
SampleUtil_Print( " CtrlGetVar <devnum> <varname>" ); SampleUtil_Print( " CtrlGetVar <devnum> <varname>" );
SampleUtil_Print( " Requests the value of a variable specified by the string <varname>" ); SampleUtil_Print
SampleUtil_Print( " from the Control Service of device <devnum>." ); ( " Requests the value of a variable specified by the string <varname>" );
SampleUtil_Print
( " from the Control Service of device <devnum>." );
SampleUtil_Print( " (e.g., \"CtrlGetVar 1 Volume\")" ); SampleUtil_Print( " (e.g., \"CtrlGetVar 1 Volume\")" );
SampleUtil_Print( " PictGetVar <devnum> <action>" ); SampleUtil_Print( " PictGetVar <devnum> <action>" );
SampleUtil_Print( " Requests the value of a variable specified by the string <varname>" ); SampleUtil_Print
SampleUtil_Print( " from the Picture Service of device <devnum>." ); ( " Requests the value of a variable specified by the string <varname>" );
SampleUtil_Print
( " from the Picture Service of device <devnum>." );
SampleUtil_Print( " (e.g., \"PictGetVar 1 Tint\")" ); SampleUtil_Print( " (e.g., \"PictGetVar 1 Tint\")" );
SampleUtil_Print( " Exit" ); SampleUtil_Print( " Exit" );
SampleUtil_Print( " Exits the control point application." ); SampleUtil_Print( " Exits the control point application." );
@@ -209,7 +242,7 @@ TvCtrlPointPrintLongHelp( void )
* *
********************************************************************************/ ********************************************************************************/
void void
TvCtrlPointPrintCommands() TvCtrlPointPrintCommands( )
{ {
int i; int i;
int numofcmds = sizeof( cmdloop_cmdlist ) / sizeof( cmdloop_commands ); int numofcmds = sizeof( cmdloop_cmdlist ) / sizeof( cmdloop_commands );
@@ -288,11 +321,11 @@ TvCtrlPointProcessCommand( char *cmdline )
switch ( cmdnum ) { switch ( cmdnum ) {
case PRTHELP: case PRTHELP:
TvCtrlPointPrintShortHelp(); TvCtrlPointPrintShortHelp( );
break; break;
case PRTFULLHELP: case PRTFULLHELP:
TvCtrlPointPrintLongHelp(); TvCtrlPointPrintLongHelp( );
break; break;
case POWON: case POWON:
@@ -378,15 +411,15 @@ TvCtrlPointProcessCommand( char *cmdline )
break; break;
case LSTDEV: case LSTDEV:
TvCtrlPointPrintList(); TvCtrlPointPrintList( );
break; break;
case REFRESH: case REFRESH:
TvCtrlPointRefresh(); TvCtrlPointRefresh( );
break; break;
case EXITCMD: case EXITCMD:
rc = TvCtrlPointStop(); rc = TvCtrlPointStop( );
exit( rc ); exit( rc );
break; break;
@@ -401,29 +434,26 @@ TvCtrlPointProcessCommand( char *cmdline )
return TV_SUCCESS; return TV_SUCCESS;
} }
int main( int argc, char **argv ) int
main( int argc,
char **argv )
{ {
int rc; int rc;
ithread_t cmdloop_thread; ithread_t cmdloop_thread;
#ifdef WIN32
#else
int sig; int sig;
sigset_t sigs_to_catch; sigset_t sigs_to_catch;
#endif
int code; int code;
rc = TvCtrlPointStart( linux_print, NULL ); rc = TvCtrlPointStart( linux_print, NULL );
if( rc != TV_SUCCESS ) { if( rc != TV_SUCCESS ) {
SampleUtil_Print( "Error starting UPnP TV Control Point" ); SampleUtil_Print( "Error starting UPnP TV Control Point" );
return rc; exit( rc );
} }
/* start a command loop thread */ // start a command loop thread
code = ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop, NULL ); code =
ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop,
NULL );
#ifdef WIN32
ithread_join(cmdloop_thread, NULL);
#else
/* /*
Catch Ctrl-C and properly shutdown Catch Ctrl-C and properly shutdown
*/ */
@@ -431,11 +461,7 @@ int main( int argc, char **argv )
sigaddset( &sigs_to_catch, SIGINT ); sigaddset( &sigs_to_catch, SIGINT );
sigwait( &sigs_to_catch, &sig ); sigwait( &sigs_to_catch, &sig );
SampleUtil_Print( "Shutting down on signal %d...\n", sig ); SampleUtil_Print( "Shutting down on signal %d...", sig );
#endif rc = TvCtrlPointStop( );
exit( rc );
rc = TvCtrlPointStop();
return rc;
} }

View File

@@ -1,42 +1,37 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#include "upnp_tv_ctrlpt.h" #include "upnp_tv_ctrlpt.h"
/*
#include "upnp.h"
/*!
Mutex for protecting the global device list Mutex for protecting the global device list
in a multi-threaded, asynchronous environment. in a multi-threaded, asynchronous environment.
All functions should lock this mutex before reading All functions should lock this mutex before reading
@@ -53,7 +48,7 @@ char *TvServiceType[] = {
}; };
char *TvServiceName[] = { "Control", "Picture" }; char *TvServiceName[] = { "Control", "Picture" };
/*! /*
Global arrays for storing variable names and counts for Global arrays for storing variable names and counts for
TvControl and TvPicture services TvControl and TvPicture services
*/ */
@@ -64,12 +59,12 @@ char *TvVarName[TV_SERVICE_SERVCOUNT][TV_MAXVARS] = {
char TvVarCount[TV_SERVICE_SERVCOUNT] = char TvVarCount[TV_SERVICE_SERVCOUNT] =
{ TV_CONTROL_VARCOUNT, TV_PICTURE_VARCOUNT }; { TV_CONTROL_VARCOUNT, TV_PICTURE_VARCOUNT };
/*! /*
Timeout to request during subscriptions Timeout to request during subscriptions
*/ */
int default_timeout = 1801; int default_timeout = 1801;
/*! /*
The first node in the global device list, or NULL if empty The first node in the global device list, or NULL if empty
*/ */
struct TvDeviceNode *GlobalDeviceList = NULL; struct TvDeviceNode *GlobalDeviceList = NULL;
@@ -144,10 +139,10 @@ TvCtrlPointDeleteNode( struct TvDeviceNode *node )
* *
********************************************************************************/ ********************************************************************************/
int int
TvCtrlPointRemoveDevice(const char *UDN) TvCtrlPointRemoveDevice( char *UDN )
{ {
struct TvDeviceNode *curdevnode; struct TvDeviceNode *curdevnode,
struct TvDeviceNode *prevdevnode; *prevdevnode;
ithread_mutex_lock( &DeviceListMutex ); ithread_mutex_lock( &DeviceListMutex );
@@ -229,7 +224,7 @@ TvCtrlPointRefresh( void )
{ {
int rc; int rc;
TvCtrlPointRemoveAll(); TvCtrlPointRemoveAll( );
/* /*
Search for all devices of type tvdevice version 1, Search for all devices of type tvdevice version 1,
@@ -544,7 +539,7 @@ TvCtrlPointGetDevice( int devnum,
* *
********************************************************************************/ ********************************************************************************/
int int
TvCtrlPointPrintList() TvCtrlPointPrintList( )
{ {
struct TvDeviceNode *tmpdevnode; struct TvDeviceNode *tmpdevnode;
int i = 0; int i = 0;
@@ -673,8 +668,8 @@ TvCtrlPointPrintDevice( int devnum )
* *
********************************************************************************/ ********************************************************************************/
void void
TvCtrlPointAddDevice( IXML_Document *DescDoc, TvCtrlPointAddDevice( IXML_Document * DescDoc,
const char *location, char *location,
int expires ) int expires )
{ {
char *deviceType = NULL; char *deviceType = NULL;
@@ -687,19 +682,20 @@ TvCtrlPointAddDevice( IXML_Document *DescDoc,
char *eventURL[TV_SERVICE_SERVCOUNT] = { NULL, NULL }; char *eventURL[TV_SERVICE_SERVCOUNT] = { NULL, NULL };
char *controlURL[TV_SERVICE_SERVCOUNT] = { NULL, NULL }; char *controlURL[TV_SERVICE_SERVCOUNT] = { NULL, NULL };
Upnp_SID eventSID[TV_SERVICE_SERVCOUNT]; Upnp_SID eventSID[TV_SERVICE_SERVCOUNT];
int TimeOut[TV_SERVICE_SERVCOUNT] = { int TimeOut[TV_SERVICE_SERVCOUNT] =
default_timeout, { default_timeout, default_timeout };
default_timeout };
struct TvDeviceNode *deviceNode; struct TvDeviceNode *deviceNode;
struct TvDeviceNode *tmpdevnode; struct TvDeviceNode *tmpdevnode;
int ret = 1; int ret = 1;
int found = 0; int found = 0;
int service; int service,
int var; var;
ithread_mutex_lock( &DeviceListMutex ); ithread_mutex_lock( &DeviceListMutex );
/* Read key elements from description document */ /*
Read key elements from description document
*/
UDN = SampleUtil_GetFirstDocumentItem( DescDoc, "UDN" ); UDN = SampleUtil_GetFirstDocumentItem( DescDoc, "UDN" );
deviceType = SampleUtil_GetFirstDocumentItem( DescDoc, "deviceType" ); deviceType = SampleUtil_GetFirstDocumentItem( DescDoc, "deviceType" );
friendlyName = friendlyName =
@@ -707,8 +703,9 @@ TvCtrlPointAddDevice( IXML_Document *DescDoc,
baseURL = SampleUtil_GetFirstDocumentItem( DescDoc, "URLBase" ); baseURL = SampleUtil_GetFirstDocumentItem( DescDoc, "URLBase" );
relURL = SampleUtil_GetFirstDocumentItem( DescDoc, "presentationURL" ); relURL = SampleUtil_GetFirstDocumentItem( DescDoc, "presentationURL" );
ret = UpnpResolveURL( ret =
( baseURL ? baseURL : location ), relURL, presURL); UpnpResolveURL( ( baseURL ? baseURL : location ), relURL,
presURL );
if( UPNP_E_SUCCESS != ret ) if( UPNP_E_SUCCESS != ret )
SampleUtil_Print( "Error generating presURL from %s + %s", baseURL, SampleUtil_Print( "Error generating presURL from %s + %s", baseURL,
@@ -942,38 +939,34 @@ TvStateUpdate( char *UDN,
* changes -- The DOM document representing the changes * changes -- The DOM document representing the changes
* *
********************************************************************************/ ********************************************************************************/
void TvCtrlPointHandleEvent( void
const UpnpString *sid, TvCtrlPointHandleEvent( Upnp_SID sid,
int evntkey, int evntkey,
IXML_Document *changes) IXML_Document * changes )
{ {
struct TvDeviceNode *tmpdevnode; struct TvDeviceNode *tmpdevnode;
int service; int service;
const char *aux_sid = NULL;
ithread_mutex_lock(&DeviceListMutex); ithread_mutex_lock( &DeviceListMutex );
tmpdevnode = GlobalDeviceList; tmpdevnode = GlobalDeviceList;
while (tmpdevnode) { while( tmpdevnode ) {
for (service = 0; service < TV_SERVICE_SERVCOUNT; ++service) { for( service = 0; service < TV_SERVICE_SERVCOUNT; service++ ) {
aux_sid = UpnpString_get_String(sid); if( strcmp( tmpdevnode->device.TvService[service].SID, sid ) ==
if (strcmp(tmpdevnode->device.TvService[service].SID, aux_sid) == 0) { 0 ) {
SampleUtil_Print("Received Tv %s Event: %d for SID %s", SampleUtil_Print( "Received Tv %s Event: %d for SID %s",
TvServiceName[service], TvServiceName[service], evntkey, sid );
evntkey,
aux_sid);
TvStateUpdate(
tmpdevnode->device.UDN,
service,
changes,
(char **)&tmpdevnode->device.TvService[service].VariableStrVal);
break;
}
}
tmpdevnode = tmpdevnode->next;
}
ithread_mutex_unlock(&DeviceListMutex); TvStateUpdate( tmpdevnode->device.UDN, service, changes,
( char ** )&tmpdevnode->device.
TvService[service].VariableStrVal );
break;
}
}
tmpdevnode = tmpdevnode->next;
}
ithread_mutex_unlock( &DeviceListMutex );
} }
/******************************************************************************** /********************************************************************************
@@ -990,10 +983,10 @@ void TvCtrlPointHandleEvent(
* timeout -- The new timeout for the subscription * timeout -- The new timeout for the subscription
* *
********************************************************************************/ ********************************************************************************/
void TvCtrlPointHandleSubscribeUpdate( void
const char *eventURL, TvCtrlPointHandleSubscribeUpdate( char *eventURL,
const Upnp_SID sid, Upnp_SID sid,
int timeout) int timeout )
{ {
struct TvDeviceNode *tmpdevnode; struct TvDeviceNode *tmpdevnode;
int service; int service;
@@ -1022,9 +1015,9 @@ void TvCtrlPointHandleSubscribeUpdate(
} }
void void
TvCtrlPointHandleGetVar( const char *controlURL, TvCtrlPointHandleGetVar( char *controlURL,
const char *varName, char *varName,
const DOMString varValue ) DOMString varValue )
{ {
struct TvDeviceNode *tmpdevnode; struct TvDeviceNode *tmpdevnode;
@@ -1033,11 +1026,14 @@ TvCtrlPointHandleGetVar( const char *controlURL,
ithread_mutex_lock( &DeviceListMutex ); ithread_mutex_lock( &DeviceListMutex );
tmpdevnode = GlobalDeviceList; tmpdevnode = GlobalDeviceList;
while (tmpdevnode) { while( tmpdevnode ) {
for (service = 0; service < TV_SERVICE_SERVCOUNT; service++) { for( service = 0; service < TV_SERVICE_SERVCOUNT; service++ ) {
if (strcmp(tmpdevnode->device.TvService[service].ControlURL, controlURL ) == 0 ) { if( strcmp
SampleUtil_StateUpdate( ( tmpdevnode->device.TvService[service].ControlURL,
varName, varValue, tmpdevnode->device.UDN, GET_VAR_COMPLETE ); controlURL ) == 0 ) {
SampleUtil_StateUpdate( varName, varValue,
tmpdevnode->device.UDN,
GET_VAR_COMPLETE );
break; break;
} }
} }
@@ -1061,160 +1057,186 @@ TvCtrlPointHandleGetVar( const char *controlURL,
* Cookie -- Optional data specified during callback registration * Cookie -- Optional data specified during callback registration
* *
********************************************************************************/ ********************************************************************************/
int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void *Cookie) int
TvCtrlPointCallbackEventHandler( Upnp_EventType EventType,
void *Event,
void *Cookie )
{ {
int errCode = 0; SampleUtil_PrintEvent( EventType, Event );
SampleUtil_PrintEvent(EventType, Event); switch ( EventType ) {
switch ( EventType ) { /*
/* SSDP Stuff */ SSDP Stuff
case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE: */
case UPNP_DISCOVERY_SEARCH_RESULT: { case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
UpnpDiscovery *d_event = (UpnpDiscovery *)Event; case UPNP_DISCOVERY_SEARCH_RESULT:
IXML_Document *DescDoc = NULL; {
const char *location = NULL; struct Upnp_Discovery *d_event =
int errCode = UpnpDiscovery_get_ErrCode(d_event); ( struct Upnp_Discovery * )Event;
if (errCode != UPNP_E_SUCCESS) { IXML_Document *DescDoc = NULL;
SampleUtil_Print( int ret;
"Error in Discovery Callback -- %d", errCode);
}
location = UpnpString_get_String(UpnpDiscovery_get_Location(d_event)); if( d_event->ErrCode != UPNP_E_SUCCESS ) {
errCode = UpnpDownloadXmlDoc(location, &DescDoc); SampleUtil_Print( "Error in Discovery Callback -- %d",
if (errCode != UPNP_E_SUCCESS) { d_event->ErrCode );
SampleUtil_Print( }
"Error obtaining device description from %s -- error = %d",
location, errCode);
} else {
TvCtrlPointAddDevice(
DescDoc, location, UpnpDiscovery_get_Expires(d_event));
}
if( DescDoc ) { if( ( ret =
ixmlDocument_free(DescDoc); UpnpDownloadXmlDoc( d_event->Location,
} &DescDoc ) ) !=
UPNP_E_SUCCESS ) {
SampleUtil_Print
( "Error obtaining device description from %s -- error = %d",
d_event->Location, ret );
} else {
TvCtrlPointAddDevice( DescDoc, d_event->Location,
d_event->Expires );
}
TvCtrlPointPrintList(); if( DescDoc )
break; ixmlDocument_free( DescDoc );
}
case UPNP_DISCOVERY_SEARCH_TIMEOUT: TvCtrlPointPrintList( );
/* Nothing to do here... */ break;
break; }
case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: { case UPNP_DISCOVERY_SEARCH_TIMEOUT:
UpnpDiscovery *d_event = (UpnpDiscovery *)Event; /*
int errCode = UpnpDiscovery_get_ErrCode(d_event); Nothing to do here...
const char *deviceId = UpnpString_get_String( */
UpnpDiscovery_get_DeviceID(d_event)); break;
if (errCode != UPNP_E_SUCCESS) { case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE:
SampleUtil_Print( {
"Error in Discovery ByeBye Callback -- %d", errCode); struct Upnp_Discovery *d_event =
} ( struct Upnp_Discovery * )Event;
SampleUtil_Print("Received ByeBye for Device: %s", deviceId); if( d_event->ErrCode != UPNP_E_SUCCESS ) {
TvCtrlPointRemoveDevice(deviceId); SampleUtil_Print
( "Error in Discovery ByeBye Callback -- %d",
d_event->ErrCode );
}
SampleUtil_Print("After byebye:"); SampleUtil_Print( "Received ByeBye for Device: %s",
TvCtrlPointPrintList(); d_event->DeviceId );
TvCtrlPointRemoveDevice( d_event->DeviceId );
break; SampleUtil_Print( "After byebye:" );
} TvCtrlPointPrintList( );
/* SOAP Stuff */ break;
case UPNP_CONTROL_ACTION_COMPLETE: { }
UpnpActionComplete *a_event = (UpnpActionComplete *)Event;
int errCode = UpnpActionComplete_get_ErrCode(a_event);
if (errCode != UPNP_E_SUCCESS) {
SampleUtil_Print(
"Error in Action Complete Callback -- %d",
errCode);
}
/* No need for any processing here, just print out results. /*
* Service state table updates are handled by events. */ SOAP Stuff
*/
case UPNP_CONTROL_ACTION_COMPLETE:
{
struct Upnp_Action_Complete *a_event =
( struct Upnp_Action_Complete * )Event;
break; if( a_event->ErrCode != UPNP_E_SUCCESS ) {
} SampleUtil_Print
( "Error in Action Complete Callback -- %d",
a_event->ErrCode );
}
case UPNP_CONTROL_GET_VAR_COMPLETE: { /*
UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)Event; No need for any processing here, just print out results. Service state
int errCode = UpnpStateVarComplete_get_ErrCode(sv_event); table updates are handled by events.
if (errCode != UPNP_E_SUCCESS) { */
SampleUtil_Print(
"Error in Get Var Complete Callback -- %d",
errCode );
} else {
TvCtrlPointHandleGetVar(
UpnpString_get_String(UpnpStateVarComplete_get_CtrlUrl(sv_event)),
UpnpString_get_String(UpnpStateVarComplete_get_StateVarName(sv_event)),
UpnpStateVarComplete_get_CurrentVal(sv_event) );
}
break;
}
/* GENA Stuff */ break;
case UPNP_EVENT_RECEIVED: { }
UpnpEvent *e_event = (UpnpEvent *)Event;
TvCtrlPointHandleEvent(
UpnpEvent_get_SID(e_event),
UpnpEvent_get_EventKey(e_event),
UpnpEvent_get_ChangedVariables(e_event));
break;
}
case UPNP_EVENT_SUBSCRIBE_COMPLETE: case UPNP_CONTROL_GET_VAR_COMPLETE:
case UPNP_EVENT_UNSUBSCRIBE_COMPLETE: {
case UPNP_EVENT_RENEWAL_COMPLETE: { struct Upnp_State_Var_Complete *sv_event =
UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event; ( struct Upnp_State_Var_Complete * )Event;
errCode = UpnpEventSubscribe_get_ErrCode(es_event);
if (errCode != UPNP_E_SUCCESS) {
SampleUtil_Print(
"Error in Event Subscribe Callback -- %d",
errCode);
} else {
TvCtrlPointHandleSubscribeUpdate(
UpnpString_get_String(UpnpEventSubscribe_get_PublisherUrl(es_event)),
UpnpString_get_String(UpnpEventSubscribe_get_SID(es_event)),
UpnpEventSubscribe_get_TimeOut(es_event));
}
break; if( sv_event->ErrCode != UPNP_E_SUCCESS ) {
} SampleUtil_Print
( "Error in Get Var Complete Callback -- %d",
sv_event->ErrCode );
} else {
TvCtrlPointHandleGetVar( sv_event->CtrlUrl,
sv_event->StateVarName,
sv_event->CurrentVal );
}
case UPNP_EVENT_AUTORENEWAL_FAILED: break;
case UPNP_EVENT_SUBSCRIPTION_EXPIRED: { }
UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
int TimeOut = default_timeout;
Upnp_SID newSID;
errCode = UpnpSubscribe( /*
ctrlpt_handle, GENA Stuff
UpnpString_get_String(UpnpEventSubscribe_get_PublisherUrl(es_event)), */
&TimeOut, case UPNP_EVENT_RECEIVED:
newSID); {
struct Upnp_Event *e_event = ( struct Upnp_Event * )Event;
if (errCode == UPNP_E_SUCCESS) { TvCtrlPointHandleEvent( e_event->Sid, e_event->EventKey,
SampleUtil_Print("Subscribed to EventURL with SID=%s", newSID); e_event->ChangedVariables );
TvCtrlPointHandleSubscribeUpdate( break;
UpnpString_get_String(UpnpEventSubscribe_get_PublisherUrl(es_event)), }
newSID,
TimeOut);
} else {
SampleUtil_Print("Error Subscribing to EventURL -- %d", errCode);
}
break;
}
/* ignore these cases, since this is not a device */ case UPNP_EVENT_SUBSCRIBE_COMPLETE:
case UPNP_EVENT_SUBSCRIPTION_REQUEST: case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
case UPNP_CONTROL_GET_VAR_REQUEST: case UPNP_EVENT_RENEWAL_COMPLETE:
case UPNP_CONTROL_ACTION_REQUEST: {
break; struct Upnp_Event_Subscribe *es_event =
} ( struct Upnp_Event_Subscribe * )Event;
return 0; if( es_event->ErrCode != UPNP_E_SUCCESS ) {
SampleUtil_Print
( "Error in Event Subscribe Callback -- %d",
es_event->ErrCode );
} else {
TvCtrlPointHandleSubscribeUpdate( es_event->
PublisherUrl,
es_event->Sid,
es_event->TimeOut );
}
break;
}
case UPNP_EVENT_AUTORENEWAL_FAILED:
case UPNP_EVENT_SUBSCRIPTION_EXPIRED:
{
int TimeOut = default_timeout;
Upnp_SID newSID;
int ret;
struct Upnp_Event_Subscribe *es_event =
( struct Upnp_Event_Subscribe * )Event;
ret =
UpnpSubscribe( ctrlpt_handle, es_event->PublisherUrl,
&TimeOut, newSID );
if( ret == UPNP_E_SUCCESS ) {
SampleUtil_Print( "Subscribed to EventURL with SID=%s",
newSID );
TvCtrlPointHandleSubscribeUpdate( es_event->
PublisherUrl, newSID,
TimeOut );
} else {
SampleUtil_Print
( "Error Subscribing to EventURL -- %d", ret );
}
break;
}
/*
ignore these cases, since this is not a device
*/
case UPNP_EVENT_SUBSCRIPTION_REQUEST:
case UPNP_CONTROL_GET_VAR_REQUEST:
case UPNP_CONTROL_ACTION_REQUEST:
break;
}
return 0;
} }
/******************************************************************************** /********************************************************************************
@@ -1298,12 +1320,12 @@ TvCtrlPointVerifyTimeouts( int incr )
* None * None
* *
********************************************************************************/ ********************************************************************************/
static int TvCtrlPointTimerLoopRun = 1; void *
void *TvCtrlPointTimerLoop(void *args) TvCtrlPointTimerLoop( void *args )
{ {
int incr = 30; // how often to verify the timeouts, in seconds int incr = 30; // how often to verify the timeouts, in seconds
while (TvCtrlPointTimerLoopRun) { while( 1 ) {
isleep( incr ); isleep( incr );
TvCtrlPointVerifyTimeouts( incr ); TvCtrlPointVerifyTimeouts( incr );
} }
@@ -1326,70 +1348,62 @@ void *TvCtrlPointTimerLoop(void *args)
* TV_SUCCESS if everything went well, else TV_ERROR * TV_SUCCESS if everything went well, else TV_ERROR
* *
********************************************************************************/ ********************************************************************************/
int TvCtrlPointStart(print_string printFunctionPtr, state_update updateFunctionPtr) int
TvCtrlPointStart( print_string printFunctionPtr,
state_update updateFunctionPtr )
{ {
ithread_t timer_thread; ithread_t timer_thread;
int rc; int rc;
unsigned short port = 0; short int port = 0;
char *ip_address = NULL; char *ip_address = NULL;
SampleUtil_Initialize(printFunctionPtr); SampleUtil_Initialize( printFunctionPtr );
SampleUtil_RegisterUpdateFunction(updateFunctionPtr); SampleUtil_RegisterUpdateFunction( updateFunctionPtr );
ithread_mutex_init(&DeviceListMutex, 0); ithread_mutex_init( &DeviceListMutex, 0 );
SampleUtil_Print( SampleUtil_Print( "Intializing UPnP with ipaddress=%s port=%d",
"Initializing UPnP Sdk with\n" ip_address, port );
"\tipaddress = %s port = %u\n", rc = UpnpInit( ip_address, port );
ip_address, port); if( UPNP_E_SUCCESS != rc ) {
SampleUtil_Print( "WinCEStart: UpnpInit() Error: %d", rc );
UpnpFinish( );
return TV_ERROR;
}
rc = UpnpInit(ip_address, port); if( NULL == ip_address )
if (rc != UPNP_E_SUCCESS) { ip_address = UpnpGetServerIpAddress( );
SampleUtil_Print("WinCEStart: UpnpInit() Error: %d", rc); if( 0 == port )
UpnpFinish(); port = UpnpGetServerPort( );
return TV_ERROR;
}
if (!ip_address) {
ip_address = UpnpGetServerIpAddress();
}
if (!port) {
port = UpnpGetServerPort();
}
SampleUtil_Print( SampleUtil_Print( "UPnP Initialized (%s:%d)", ip_address, port );
"UPnP Initialized\n"
"\tipaddress= %s port = %u\n",
ip_address, port);
SampleUtil_Print("Registering Control Point"); SampleUtil_Print( "Registering Control Point" );
rc = UpnpRegisterClient(TvCtrlPointCallbackEventHandler, rc = UpnpRegisterClient( TvCtrlPointCallbackEventHandler,
&ctrlpt_handle, &ctrlpt_handle); &ctrlpt_handle, &ctrlpt_handle );
if (rc != UPNP_E_SUCCESS) { if( UPNP_E_SUCCESS != rc ) {
SampleUtil_Print( "Error registering CP: %d", rc ); SampleUtil_Print( "Error registering CP: %d", rc );
UpnpFinish(); UpnpFinish( );
return TV_ERROR;
}
return TV_ERROR; SampleUtil_Print( "Control Point Registered" );
}
SampleUtil_Print("Control Point Registered"); TvCtrlPointRefresh( );
TvCtrlPointRefresh(); // start a timer thread
ithread_create( &timer_thread, NULL, TvCtrlPointTimerLoop, NULL );
/* start a timer thread */ return TV_SUCCESS;
ithread_create(&timer_thread, NULL, TvCtrlPointTimerLoop, NULL);
ithread_detach(timer_thread);
return TV_SUCCESS;
} }
int TvCtrlPointStop(void) int
TvCtrlPointStop( void )
{ {
TvCtrlPointTimerLoopRun = 0; TvCtrlPointRemoveAll( );
TvCtrlPointRemoveAll(); UpnpUnRegisterClient( ctrlpt_handle );
UpnpUnRegisterClient( ctrlpt_handle ); UpnpFinish( );
UpnpFinish(); SampleUtil_Finish( );
SampleUtil_Finish();
return TV_SUCCESS; return TV_SUCCESS;
} }

View File

@@ -1,65 +1,53 @@
/************************************************************************** ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
**************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef UPNP_TV_CTRLPT_H #ifndef UPNP_TV_CTRLPT_H
#define UPNP_TV_CTRLPT_H #define UPNP_TV_CTRLPT_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdio.h>
#include "sample_util.h"
#include "ithread.h" #include "ithread.h"
#include "upnp.h" #include <unistd.h>
#include "upnptools.h"
#include <signal.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h>
#include <string.h> #include <string.h>
#include "upnp.h"
#ifdef WIN32 #include "upnptools.h"
/* Do not #include <unistd.h> */ #include "sample_util.h"
#else
#include <unistd.h>
#endif
#define TV_SERVICE_SERVCOUNT 2 #define TV_SERVICE_SERVCOUNT 2
#define TV_SERVICE_CONTROL 0 #define TV_SERVICE_CONTROL 0
@@ -78,12 +66,12 @@ extern "C" {
#define TV_MAX_VAL_LEN 5 #define TV_MAX_VAL_LEN 5
#define TV_SUCCESS 0 #define TV_SUCCESS 0
#define TV_ERROR (-1) #define TV_ERROR (-1)
#define TV_WARNING 1 #define TV_WARNING 1
/* This should be the maximum VARCOUNT from above */ /* This should be the maximum VARCOUNT from above */
#define TV_MAXVARS TV_PICTURE_VARCOUNT #define TV_MAXVARS TV_PICTURE_VARCOUNT
extern char TvDeviceType[]; extern char TvDeviceType[];
extern char *TvServiceType[]; extern char *TvServiceType[];
@@ -120,11 +108,11 @@ extern ithread_mutex_t DeviceListMutex;
extern UpnpClient_Handle ctrlpt_handle; extern UpnpClient_Handle ctrlpt_handle;
void TvCtrlPointPrintHelp(); void TvCtrlPointPrintHelp( void );
int TvCtrlPointDeleteNode(struct TvDeviceNode*); int TvCtrlPointDeleteNode(struct TvDeviceNode*);
int TvCtrlPointRemoveDevice(const char *); int TvCtrlPointRemoveDevice(char*);
int TvCtrlPointRemoveAll(); int TvCtrlPointRemoveAll( void );
int TvCtrlPointRefresh(); int TvCtrlPointRefresh( void );
int TvCtrlPointSendAction(int, int, char *, char **, char **, int); int TvCtrlPointSendAction(int, int, char *, char **, char **, int);
@@ -150,11 +138,11 @@ int TvCtrlPointGetBrightness(int);
int TvCtrlPointGetDevice(int, struct TvDeviceNode **); int TvCtrlPointGetDevice(int, struct TvDeviceNode **);
int TvCtrlPointPrintList( void ); int TvCtrlPointPrintList( void );
int TvCtrlPointPrintDevice(int); int TvCtrlPointPrintDevice(int);
void TvCtrlPointAddDevice(IXML_Document *, const char *, int); void TvCtrlPointAddDevice (IXML_Document *, char *, int);
void TvCtrlPointHandleGetVar(const char *, const char *, const DOMString); void TvCtrlPointHandleGetVar(char *,char *,DOMString);
void TvStateUpdate(char*,int, IXML_Document * , char **); void TvStateUpdate(char*,int, IXML_Document * , char **);
void TvCtrlPointHandleEvent(const UpnpString *, int, IXML_Document *); void TvCtrlPointHandleEvent(Upnp_SID, int, IXML_Document *);
void TvCtrlPointHandleSubscribeUpdate(const char *, const Upnp_SID, int); void TvCtrlPointHandleSubscribeUpdate(char *, Upnp_SID, int);
int TvCtrlPointCallbackEventHandler(Upnp_EventType, void *, void *); int TvCtrlPointCallbackEventHandler(Upnp_EventType, void *, void *);
void TvCtrlPointVerifyTimeouts(int); void TvCtrlPointVerifyTimeouts(int);
void TvCtrlPointPrintCommands( void ); void TvCtrlPointPrintCommands( void );

View File

@@ -1,41 +1,37 @@
/******************************************************************************* ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
******************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#include "sample_util.h"
#include "upnp_tv_device.h"
#include <stdio.h> #include <stdio.h>
#include "sample_util.h"
#include "upnp_tv_device.h"
/****************************************************************************** /******************************************************************************
* linux_print * linux_print
@@ -86,7 +82,7 @@ TvDeviceCommandLoop( void *args )
if( strcasecmp( cmd, "exit" ) == 0 ) { if( strcasecmp( cmd, "exit" ) == 0 ) {
SampleUtil_Print( "Shutting down...\n" ); SampleUtil_Print( "Shutting down...\n" );
TvDeviceStop(); TvDeviceStop( );
exit( 0 ); exit( 0 );
} else { } else {
SampleUtil_Print( "\n Unknown command: %s\n\n", cmd ); SampleUtil_Print( "\n Unknown command: %s\n\n", cmd );
@@ -121,27 +117,26 @@ TvDeviceCommandLoop( void *args )
* *
* *
*****************************************************************************/ *****************************************************************************/
int main( IN int argc, IN char **argv ) int
main( IN int argc,
IN char **argv )
{ {
unsigned int portTemp = 0; unsigned int portTemp = 0;
char *ip_address = NULL, char *ip_address = NULL,
*desc_doc_name = NULL, *desc_doc_name = NULL,
*web_dir_path = NULL; *web_dir_path = NULL;
int rc;
ithread_t cmdloop_thread; ithread_t cmdloop_thread;
#ifdef WIN32
#else
int sig;
sigset_t sigs_to_catch;
#endif
int code; int code;
unsigned int port = 0; unsigned int port = 0;
int sig;
sigset_t sigs_to_catch;
int i = 0; int i = 0;
SampleUtil_Initialize( linux_print ); SampleUtil_Initialize( linux_print );
// Parse options //Parse options
for( i = 1; i < argc; i++ ) { for( i = 1; i < argc; i++ ) {
if( strcmp( argv[i], "-ip" ) == 0 ) { if( strcmp( argv[i], "-ip" ) == 0 ) {
ip_address = argv[++i]; ip_address = argv[++i];
@@ -168,20 +163,21 @@ int main( IN int argc, IN char **argv )
( "\tweb_dir_path: Filesystem path where web files " ( "\tweb_dir_path: Filesystem path where web files "
"related to the device are stored\n" ); "related to the device are stored\n" );
SampleUtil_Print( "\t\te.g.: /upnp/sample/tvdevice/web\n" ); SampleUtil_Print( "\t\te.g.: /upnp/sample/tvdevice/web\n" );
return 1; exit( 1 );
} }
} }
port = ( unsigned short )portTemp; port = ( unsigned short )portTemp;
TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path, linux_print ); TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path,
linux_print );
/* start a command loop thread */ /*
code = ithread_create( &cmdloop_thread, NULL, TvDeviceCommandLoop, NULL ); start a command loop thread
*/
code = ithread_create( &cmdloop_thread, NULL, TvDeviceCommandLoop,
NULL );
#ifdef WIN32
ithread_join(cmdloop_thread, NULL);
#else
/* /*
Catch Ctrl-C and properly shutdown Catch Ctrl-C and properly shutdown
*/ */
@@ -190,9 +186,6 @@ int main( IN int argc, IN char **argv )
sigwait( &sigs_to_catch, &sig ); sigwait( &sigs_to_catch, &sig );
SampleUtil_Print( "Shutting down on signal %d...\n", sig ); SampleUtil_Print( "Shutting down on signal %d...\n", sig );
#endif TvDeviceStop( );
rc = TvDeviceStop(); exit( 0 );
return rc;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,65 +1,50 @@
/************************************************************************** ///////////////////////////////////////////////////////////////////////////
* //
* Copyright (c) 2000-2003 Intel Corporation // Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. // All rights reserved.
* //
* Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
* //
* - Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, // * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation // this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. // and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors // * Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software // may be used to endorse or promote products derived from this software
* without specific prior written permission. // without specific prior written permission.
* //
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* //
**************************************************************************/ ///////////////////////////////////////////////////////////////////////////
#ifndef UPNP_TV_DEVICE_H #ifndef UPNP_TV_DEVICE_H
#define UPNP_TV_DEVICE_H #define UPNP_TV_DEVICE_H
#include <stdio.h> #include <stdio.h>
#include <signal.h> #include <signal.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "sample_util.h"
#include "ithread.h" #include "ithread.h"
#include "upnp.h"
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <string.h> #include <string.h>
#include "upnp.h"
#include "sample_util.h"
#ifdef WIN32
/* Do not #include <unistd.h> */
#else
#include <unistd.h>
#endif
//Color constants //Color constants
#define MAX_COLOR 10 #define MAX_COLOR 10
@@ -161,7 +146,8 @@ extern char *TvServiceType[];
* *
*****************************************************************************/ *****************************************************************************/
typedef int (*upnp_action) (IXML_Document *request, IXML_Document **out, char **errorString); typedef int (*upnp_action) (IXML_Document *request, IXML_Document **out,
char **errorString);
/* Structure for storing Tv Service /* Structure for storing Tv Service
identifiers and state table */ identifiers and state table */
@@ -205,7 +191,7 @@ extern ithread_mutex_t TVDevMutex;
* struct TvService *out - service containing action table to set. * struct TvService *out - service containing action table to set.
* *
*****************************************************************************/ *****************************************************************************/
int SetActionTable(int serviceType, struct TvService *out); int SetActionTable(int serviceType, struct TvService * out);
/****************************************************************************** /******************************************************************************
* TvDeviceStateTableInit * TvDeviceStateTableInit
@@ -239,7 +225,7 @@ int TvDeviceStateTableInit(char*);
* sr_event -- The subscription request event structure * sr_event -- The subscription request event structure
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceHandleSubscriptionRequest(const UpnpSubscriptionRequest *); int TvDeviceHandleSubscriptionRequest(struct Upnp_Subscription_Request *);
/****************************************************************************** /******************************************************************************
* TvDeviceHandleGetVarRequest * TvDeviceHandleGetVarRequest
@@ -253,7 +239,7 @@ int TvDeviceHandleSubscriptionRequest(const UpnpSubscriptionRequest *);
* cgv_event -- The control get variable request event structure * cgv_event -- The control get variable request event structure
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceHandleGetVarRequest(UpnpStateVarRequest *); int TvDeviceHandleGetVarRequest(struct Upnp_State_Var_Request *);
/****************************************************************************** /******************************************************************************
* TvDeviceHandleActionRequest * TvDeviceHandleActionRequest
@@ -267,7 +253,7 @@ int TvDeviceHandleGetVarRequest(UpnpStateVarRequest *);
* ca_event -- The control action request event structure * ca_event -- The control action request event structure
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceHandleActionRequest(UpnpActionRequest *); int TvDeviceHandleActionRequest(struct Upnp_Action_Request *);
/****************************************************************************** /******************************************************************************
* TvDeviceCallbackEventHandler * TvDeviceCallbackEventHandler
@@ -325,7 +311,8 @@ int TvDeviceSetServiceTableVar(unsigned int, unsigned int, char*);
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString); int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDevicePowerOff * TvDevicePowerOff
@@ -340,7 +327,8 @@ int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out, OUT char **e
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceSetChannel * TvDeviceSetChannel
@@ -357,7 +345,8 @@ int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out, OUT char **e
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceIncreaseChannel * TvDeviceIncreaseChannel
@@ -372,7 +361,8 @@ int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char *
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceDecreaseChannel * TvDeviceDecreaseChannel
* *
@@ -386,7 +376,8 @@ int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT c
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceSetVolume * TvDeviceSetVolume
* *
@@ -402,7 +393,8 @@ int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT c
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceIncreaseVolume * TvDeviceIncreaseVolume
@@ -417,7 +409,8 @@ int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **
* IXML_Document **out - action result document * IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
*****************************************************************************/ *****************************************************************************/
int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
@@ -433,7 +426,8 @@ int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT ch
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
OUT char **errorString);
//Picture Service Actions //Picture Service Actions
@@ -453,7 +447,8 @@ int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT ch
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
@@ -468,7 +463,8 @@ int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out, OUT char **e
* IXML_Document **out - action result document * IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
*****************************************************************************/ *****************************************************************************/
int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceDecreaseColor * TvDeviceDecreaseColor
@@ -482,7 +478,8 @@ int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT ch
* IXML_Document **out - action result document * IXML_Document **out - action result document
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
*****************************************************************************/ *****************************************************************************/
int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceSetTint * TvDeviceSetTint
@@ -499,7 +496,8 @@ int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT ch
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceIncreaseTint * TvDeviceIncreaseTint
@@ -514,7 +512,8 @@ int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **er
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceDecreaseTint * TvDeviceDecreaseTint
@@ -529,7 +528,8 @@ int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/***************************************************************************** /*****************************************************************************
* TvDeviceSetContrast * TvDeviceSetContrast
@@ -546,7 +546,8 @@ int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
****************************************************************************/ ****************************************************************************/
int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceIncreaseContrast * TvDeviceIncreaseContrast
@@ -562,7 +563,8 @@ int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceDecreaseContrast * TvDeviceDecreaseContrast
* *
@@ -576,7 +578,8 @@ int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceSetBrightness * TvDeviceSetBrightness
@@ -590,7 +593,8 @@ int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT
* brightness -- The brightness value to change to. * brightness -- The brightness value to change to.
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceIncreaseBrightness * TvDeviceIncreaseBrightness
@@ -605,7 +609,8 @@ int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT cha
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
/****************************************************************************** /******************************************************************************
* TvDeviceDecreaseBrightness * TvDeviceDecreaseBrightness
@@ -619,11 +624,12 @@ int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OU
* char **errorString - errorString (in case action was unsuccessful) * char **errorString - errorString (in case action was unsuccessful)
* *
*****************************************************************************/ *****************************************************************************/
int TvDeviceDecreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString); int TvDeviceDecreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out,
OUT char **errorString);
int TvDeviceStart(char * ip_address, unsigned short port,char * desc_doc_name, int TvDeviceStart(char * ip_address, unsigned short port,char * desc_doc_name,
char *web_dir_path, print_string pfun); char *web_dir_path, print_string pfun);
int TvDeviceStop(void); int TvDeviceStop();
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -7,6 +7,7 @@
</specVersion> </specVersion>
<actionList> <actionList>
<action> <action>
@@ -37,12 +38,6 @@
<name>SetChannel</name> <name>SetChannel</name>
<argumentList> <argumentList>
<argument>
<name>Channel</name>
<relatedStateVariable>Channel</relatedStateVariable>
<direction>in</direction>
</argument>
<argument> <argument>
<name>NewChannel</name> <name>NewChannel</name>
<retval /> <retval />
@@ -50,6 +45,11 @@
<direction>out</direction> <direction>out</direction>
</argument> </argument>
<argument>
<name>Channel</name>
<relatedStateVariable>Channel</relatedStateVariable>
<direction>in</direction>
</argument>
</argumentList> </argumentList>
</action> </action>
@@ -80,11 +80,6 @@
<action> <action>
<name>SetVolume</name> <name>SetVolume</name>
<argumentList> <argumentList>
<argument>
<name>Volume</name>
<relatedStateVariable>Volume</relatedStateVariable>
<direction>in</direction>
</argument>
<argument> <argument>
<name>NewVolume</name> <name>NewVolume</name>
@@ -92,6 +87,11 @@
<relatedStateVariable>Volume</relatedStateVariable> <relatedStateVariable>Volume</relatedStateVariable>
<direction>out</direction> <direction>out</direction>
</argument> </argument>
<argument>
<name>Volume</name>
<relatedStateVariable>Volume</relatedStateVariable>
<direction>in</direction>
</argument>
</argumentList> </argumentList>
</action> </action>
@@ -124,6 +124,9 @@
</actionList> </actionList>
<serviceStateTable> <serviceStateTable>
<stateVariable sendEvents="yes"> <stateVariable sendEvents="yes">

Some files were not shown because too many files have changed in this diff Show More