Compare commits
160 Commits
release-1.
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce5ccd8edc | ||
|
|
f0161c7274 | ||
|
|
4b40e94b03 | ||
|
|
1c9632dcc3 | ||
|
|
cc0c2ffc50 | ||
|
|
f812b124d7 | ||
|
|
a785465222 | ||
|
|
078f3f8faf | ||
|
|
1eeaf99b83 | ||
|
|
f6dd5062fe | ||
|
|
7d4a610b93 | ||
|
|
0a074d1989 | ||
|
|
0475a46680 | ||
|
|
2a76749682 | ||
|
|
e4bcf18599 | ||
|
|
c856356414 | ||
|
|
6acffb7ede | ||
|
|
837f31bacd | ||
|
|
5151d45203 | ||
|
|
114389589d | ||
|
|
b817ec5152 | ||
|
|
d9de9a486c | ||
|
|
13ebb40e08 | ||
|
|
b614c81e94 | ||
|
|
53766465a9 | ||
|
|
9bc187d4c6 | ||
|
|
80517f26a6 | ||
|
|
468cb2a908 | ||
|
|
d71db4c57c | ||
|
|
947dfd9a85 | ||
|
|
8f7fd0fc6d | ||
|
|
81635d74c1 | ||
|
|
d8ba182d85 | ||
|
|
0a41ee988b | ||
|
|
907eb0636a | ||
|
|
80fc7c3bb0 | ||
|
|
83fb96fbe2 | ||
|
|
4e1240a0a8 | ||
|
|
2c1dba2942 | ||
|
|
4ceb6c67d1 | ||
|
|
3fa207984a | ||
|
|
b82c9c6009 | ||
|
|
b1f6e83380 | ||
|
|
00a33f5788 | ||
|
|
dfec187e88 | ||
|
|
dee3e96a63 | ||
|
|
23e8160417 | ||
|
|
99e11d4fd5 | ||
|
|
fb4e7f659d | ||
|
|
28799f26c9 | ||
|
|
c1e5e4d6a4 | ||
|
|
c0d9908afe | ||
|
|
e80cc3ac64 | ||
|
|
e04192e1d0 | ||
|
|
bbe85ef599 | ||
|
|
5c0893928c | ||
|
|
948c959be5 | ||
|
|
f8c4d81ee5 | ||
|
|
286a45d4ad | ||
|
|
59e0e015be | ||
|
|
bdda54a66b | ||
|
|
41cb45146c | ||
|
|
2c2a5f7c18 | ||
|
|
047b9534bb | ||
|
|
88076a3c4b | ||
|
|
c3060e0d0b | ||
|
|
2ac3819f8c | ||
|
|
0d451c9c8e | ||
|
|
bbd16d75ed | ||
|
|
a225d3b54e | ||
|
|
08834bf0f0 | ||
|
|
e31fcce11d | ||
|
|
dce8f71256 | ||
|
|
7a359f29e3 | ||
|
|
ed9a594e73 | ||
|
|
039b5fdae6 | ||
|
|
f07bcb749f | ||
|
|
f64c539395 | ||
|
|
cab8e4f799 | ||
|
|
2331839f69 | ||
|
|
363ac6e007 | ||
|
|
5c4e45fb4d | ||
|
|
436bc8fc6d | ||
|
|
c6d3d63223 | ||
|
|
ae7ca6a2cf | ||
|
|
9595ddcf3a | ||
|
|
fd19d54144 | ||
|
|
17db87ab96 | ||
|
|
3b12ced1f8 | ||
|
|
4abbd5a8a4 | ||
|
|
836069f43b | ||
|
|
353a876a54 | ||
|
|
2bc6a1f8dd | ||
|
|
1d9e8712b7 | ||
|
|
819ad1f365 | ||
|
|
e9e8ea5636 | ||
|
|
14f72e1442 | ||
|
|
ae13c481a7 | ||
|
|
38a91fdaec | ||
|
|
87f336c940 | ||
|
|
74d2b0049b | ||
|
|
635d6ffa93 | ||
|
|
8c56f16607 | ||
|
|
5d3ef166c1 | ||
|
|
a4072c19b1 | ||
|
|
1716c7a10d | ||
|
|
83782e8ae2 | ||
|
|
f1cc7db79d | ||
|
|
e69d5a8609 | ||
|
|
16637892e3 | ||
|
|
d19a57c866 | ||
|
|
8c21b2c4d9 | ||
|
|
736efca5dd | ||
|
|
d5449dc948 | ||
|
|
7c49b3b8a4 | ||
|
|
5c03ebe6e1 | ||
|
|
d17eb5fcfc | ||
|
|
8625298899 | ||
|
|
864d3db0ad | ||
|
|
1d4d1ff87e | ||
|
|
a26769b27b | ||
|
|
fbbec55457 | ||
|
|
8245b0d808 | ||
|
|
815d08420a | ||
|
|
1d0ce01f31 | ||
|
|
947896bcee | ||
|
|
7ed934d858 | ||
|
|
4a7708331c | ||
|
|
ab66940a89 | ||
|
|
ebac5fe596 | ||
|
|
11de68d0e3 | ||
|
|
dfe3071af4 | ||
|
|
cd50cb678f | ||
|
|
f13fd3d522 | ||
|
|
927b86545f | ||
|
|
a155612cba | ||
|
|
df3df9eaed | ||
|
|
eefeb86a96 | ||
|
|
0452011b99 | ||
|
|
a20707485d | ||
|
|
ec86a6f92b | ||
|
|
89e7a40fcc | ||
|
|
90c3db2a96 | ||
|
|
cf9ae4f6e5 | ||
|
|
f28f81f820 | ||
|
|
bcaba51f57 | ||
|
|
4c5b61dc55 | ||
|
|
9147c3517e | ||
|
|
cbefc2ff49 | ||
|
|
863e743c41 | ||
|
|
26bde09028 | ||
|
|
bc2941c2a7 | ||
|
|
40186d3e9c | ||
|
|
01d26f8f74 | ||
|
|
b2cb458ee3 | ||
|
|
16da6980d1 | ||
|
|
211973749c | ||
|
|
a22ba2f159 | ||
|
|
142929623d | ||
|
|
3170fbd730 |
428
ChangeLog
428
ChangeLog
@@ -1,6 +1,408 @@
|
|||||||
*************************************************************************
|
*******************************************************************************
|
||||||
|
Version 1.6.6
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2008-04-24 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Added thread id's to the UpnpPrintf debug messages. Thanks to
|
||||||
|
Charles Nepveu for the idea.
|
||||||
|
|
||||||
|
2008-04-24 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* SF Bug Tracker [ 1948586 ]
|
||||||
|
Uppercase U in in "xmlns:U" in Invoke Action causes seg. f.
|
||||||
|
Submitted By: Thomas Norheim - kjakan_no
|
||||||
|
Device no longer segfaults with the following malformed xml action:
|
||||||
|
<u:SetColor xmlns:U="urn:schemas-upnp-org:service:tvpicture:1">
|
||||||
|
<Color>2</Color>
|
||||||
|
</u:SetColor>
|
||||||
|
|
||||||
|
2008-04-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Use -O0 in debug builds so that variables do not get optimized out.
|
||||||
|
|
||||||
|
2008-04-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Apostolos Syropoulos changes for OpenSolaris x86.
|
||||||
|
|
||||||
|
2008-03-20 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Andre Sodermans (wienerschnitzel) patch for building libupnp under
|
||||||
|
windows systems with VC9.
|
||||||
|
|
||||||
|
2008-03-20 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Andre Sodermans (wienerschnitzel) patch for building libupnp under
|
||||||
|
windows systems with VC8.
|
||||||
|
|
||||||
|
2008-03-08 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fixed a printf format problem on the upnp_tv_device.c from both
|
||||||
|
upnp/sample/tvdevie and upnp/sample/tvcombo directories. The variable
|
||||||
|
port was a short int instead of an unsigned short and it was beeing
|
||||||
|
print as a negative value.
|
||||||
|
|
||||||
|
2008-03-08 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* SF Bug Tracker [ 1902668 ] Cannot compile on MSVC
|
||||||
|
Submitted By Luke Kim - nereusuj
|
||||||
|
Version 1.6.5 cannot be compiled because of some changes in 1.6.3.
|
||||||
|
MSVC does not support stdint.h, gettimeofday(), sys/param.h, const int
|
||||||
|
variables in array size and Windows does not define _WINDOWS_ but define
|
||||||
|
_WINDOWS.
|
||||||
|
* MSVC does not understand "const int"'s as declarators of array
|
||||||
|
dimensions, we must use #define'd constants.
|
||||||
|
* Use WIN32 instead of _WINDOWS_ or _WINDOWS.
|
||||||
|
|
||||||
|
2008-02-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* No longer ignore "upnp:rootdevice" advertisement. Thanks to Bob Ciora.
|
||||||
|
|
||||||
|
2008-02-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Changed "sys_errlist[errno]", which is deprecated, by
|
||||||
|
"strerror_r()", which is thread safe.
|
||||||
|
|
||||||
|
2008-02-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Slightly improved error report by showing the sys_errlist string
|
||||||
|
corresponding to errno.
|
||||||
|
|
||||||
|
2008-02-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Got rid of two useless constants: UPNP_SOCKETERROR and
|
||||||
|
UPNP_INVALID_SOCKET. They both mean the same, that a network API
|
||||||
|
function has failed. -1 is the value to check, not an invented constant.
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
Version 1.6.5
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2008-02-02 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Peter Hartley's fix for wrong sized variable beeing passed to
|
||||||
|
http_MakeMessage() on 64 bit architectures.
|
||||||
|
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
Version 1.6.4
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2008-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Workaround for a problem with the new automake AM_CONDITIONAL macro
|
||||||
|
from autotools-1.10. Thanks to Ingo Hofmann for helping with debugging
|
||||||
|
this one.
|
||||||
|
|
||||||
|
2008-01-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Added quoting to macros AC_CONFIG_AUX_DIR, AC_CONFIG_MACRO_DIR and
|
||||||
|
AC_CONFIG_SRCDIR in configure.ac. Also changed the name of the
|
||||||
|
auxiliary directory in AC_CONFIG_AUX_DIR to build-aux.
|
||||||
|
|
||||||
|
2008-01-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fix for setsockopt() in Threadpool.c to allow more than one process
|
||||||
|
to join the multicast-group on OSX. Thanks to Ingo Hofmann.
|
||||||
|
|
||||||
|
2008-01-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Using defined(__OSX__) || defined(__APPLE__) instead of just
|
||||||
|
defined(__OSX__) in the code. Thanks to Ingo Hofmann and Chris
|
||||||
|
Pickel.
|
||||||
|
|
||||||
|
2008-01-21 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fix for isFileInVirtualDir. Thanks to Peter Hartley for the patch.
|
||||||
|
|
||||||
|
2008-01-07 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Putting back a "defined(__OSX__)" that has been removed in the
|
||||||
|
previous *BSD patch. Thanks to Chris Pickel for pointing it out.
|
||||||
|
|
||||||
|
2008-01-07 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* SF Patches Tracker [ 1865812 ] typo in docs comment
|
||||||
|
Submitted By: Hartmut Holzgraefe - hholzgra
|
||||||
|
typo in docs comment ACCAPTED instead of ACCEPTED in
|
||||||
|
@name UPNP_E_UNSUBSCRIBE_UNACCAPTED [-302]
|
||||||
|
Also, the documentation file name was mispelled and was corrected in
|
||||||
|
the Makefile.am.
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
Version 1.6.3
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2007-12-25 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Using pthread flags for the whole project, not just at the places
|
||||||
|
individually indicated by several Makefile.am files spread all over
|
||||||
|
the directories. That was too much error prone.
|
||||||
|
|
||||||
|
2007-12-24 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Added a configure test to check if pthread_rwlock_t is available.
|
||||||
|
Define _GNU_SOURCE if needed. The fallback behaviou will only be
|
||||||
|
implemented if _GNU_SOURCE prooves to be insufficient on some
|
||||||
|
platforms. Thanks to Jonathan Casiot (no_dice) and Robert Gingher
|
||||||
|
(robsbox).
|
||||||
|
|
||||||
|
2007-12-17 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Removed unused iasnprintf.{c,h} files.
|
||||||
|
|
||||||
|
2007-12-17 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Removed STATSONLY() macro from ThreadPool.{c,h}.
|
||||||
|
* Removed time() usage from ThreadPool.c.
|
||||||
|
* Fixed STATS = 0 compilation.
|
||||||
|
|
||||||
|
2007-12-16 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Library was not compiling on FreeBSD 7. Code now no longer uses
|
||||||
|
ftime(), using gettimeofday() instead. Thanks to Josh Carroll.
|
||||||
|
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
Version 1.6.2
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2007-12-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fixed a compilation error due to a missing #ifdef in
|
||||||
|
upnp/src/genlib/miniserver/miniserver.c. Thanks to Eugene Christensen.
|
||||||
|
|
||||||
|
2007-11-12 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* "make check" was failing because ixml/test/test_document.sh did not
|
||||||
|
have the executable flag set. Thanks to Steve Bresson.
|
||||||
|
|
||||||
|
2007-11-12 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fixed a memory leak in upnpapi.c to delete gMiniServerThreadPool in
|
||||||
|
the call to UpnpFinish(). Thanks to Fabrice Fontaine.
|
||||||
|
|
||||||
|
2007-11-09 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Added a isleep() call to the error handler of select() in
|
||||||
|
RunMiniServer(), so that it does not take 100% cpu in case select()
|
||||||
|
fails repeatedly.
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
Version 1.6.1
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2007-11-07 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* SF Bug Tracker [ 1825278 ] AdvertiseAndReply sleeps with handle lock out
|
||||||
|
Applied patch from Alex (afaucher) to change some write locks to read
|
||||||
|
locks.
|
||||||
|
|
||||||
|
2007-11-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Adjusting libtool library numbers to reflect the last changes.
|
||||||
|
|
||||||
|
2007-11-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* SF Bug Tracker [ 1825278 ] AdvertiseAndReply sleeps with handle lock out
|
||||||
|
GlobalHndMutex, which was a mutex is now GlobalHndRWLock, which is a
|
||||||
|
rwlock. HandleLock() is mapped to HandleWriteLock() while all other
|
||||||
|
instances have not been checked. One instance in AdvertiseAndReply()
|
||||||
|
has been changed to HandleReadLock(). Thanks to Alex (afaucher) for the
|
||||||
|
bug report and suggestions.
|
||||||
|
|
||||||
|
2007-11-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Added support for rwlocks.
|
||||||
|
|
||||||
|
2007-11-05 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* SF Bug Tracker [ 1825929 ] woker thread still alive after UpnpFinish()
|
||||||
|
Submitted By: Luke Kim - nereusuj
|
||||||
|
Worker thread still alive after calling UpnpFinish() because
|
||||||
|
ThreadPoolShutdown() is in the #ifdef DEBUG block.
|
||||||
|
421
|
||||||
|
422 #ifdef DEBUG
|
||||||
|
423 ThreadPoolShutdown( &gSendThreadPool );
|
||||||
|
424 ThreadPoolShutdown( &gRecvThreadPool );
|
||||||
|
|
||||||
|
2007-08-28 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Changed the calls to virtualDirCallback.open(filename, UPNP_WRITE)
|
||||||
|
to (virtualDirCallback.open)(filename, UPNP_WRITE) (notice the
|
||||||
|
parenthesis) due to a change in glibc that produces compilation
|
||||||
|
errors.
|
||||||
|
|
||||||
|
2007-08-28 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Initialization of the "randomness" struct so that valgrind does not
|
||||||
|
complain.
|
||||||
|
|
||||||
|
2007-08-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Merge of patch submitted By Keith Brindley - brindlk
|
||||||
|
SF Bug Tracker [ 1762758 ] Seek not working for large files
|
||||||
|
Problem:
|
||||||
|
Requests from the uPnP client to seek to a position beyond 2GB in a large
|
||||||
|
file are handled as a request to see from the 2GB point.
|
||||||
|
|
||||||
|
Impact:
|
||||||
|
Varies depending on client. The Xbox 360 kills the connection when it
|
||||||
|
realises.
|
||||||
|
|
||||||
|
Solution:
|
||||||
|
GetNextRange function (webserver.c) is updated to handle large file sizes.
|
||||||
|
Fix should also recognise when built on a 32bit platform rather than 64 and
|
||||||
|
handle accordingly.
|
||||||
|
|
||||||
|
2007-08-05 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Merge of Mac OS X patch from St<53>phane Corth<74>sy (davelopper),
|
||||||
|
SF Bug Tracker [ 1686420 ] Modifications for MacOSX.
|
||||||
|
Some of the proposed changes were already done by Rene Hexel's patch.
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
Version 1.6.0
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2007-06-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* More fixes to Mac OS X and NetBSD from Rene Hexel:
|
||||||
|
[pupnp-devel] NetBSD & Mac OS X packages and patches
|
||||||
|
|
||||||
|
Okay, I found a couple more things. I have attached a patch file
|
||||||
|
against the trunk (version 206) that make the repository code compile
|
||||||
|
and run on both Mac OS X and NetBSD.
|
||||||
|
|
||||||
|
This fixes the following issues:
|
||||||
|
|
||||||
|
upnp/src/api/upnpapi.c: SIOCGIFCONF didn't work properly, use
|
||||||
|
getifaddrs() instead (on BSD systems).
|
||||||
|
|
||||||
|
threadutil/src/ThreadPool.c: priorities only work if
|
||||||
|
_POSIX_PRIORITY_SCHEDULING is defined (and greater than 0).
|
||||||
|
|
||||||
|
threadutil/src/LinkedList.c and threadutil/src/iasnprintf.c: use
|
||||||
|
stdlib.h instead of malloc.h on all BSD systems (not just FreeBSD).
|
||||||
|
This is important, because malloc.h does not exist on Darwin/Mac OS X.
|
||||||
|
|
||||||
|
Cheers
|
||||||
|
,
|
||||||
|
Rene
|
||||||
|
|
||||||
|
2007-06-09 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* [pupnp-devel] NetBSD & Mac OS X packages and patches.
|
||||||
|
Rene Hexel's <rh@netbsd.org> patch to compile in NetBSD and Mac OS X.
|
||||||
|
|
||||||
|
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Updated the macro files acx_pthread.m4, ax_cflags_gcc_option.m4,
|
||||||
|
ax_cflags_warn_all.m4, m4/ax_cflags_warn_all_ansi.m4,
|
||||||
|
m4/type_socklen_t.m4.
|
||||||
|
|
||||||
|
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fixed an issue with the instalation of the file upnpdebug.h. Since
|
||||||
|
the last modifications that removed the macro DEBUV_ONLY, this file
|
||||||
|
must be installed even on a non-debug build.
|
||||||
|
|
||||||
|
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* SF Bug Tracker [ 1711325 ] Bad DestAddr in Upnp_Discovery structure
|
||||||
|
Submitted By: Bob Ciora
|
||||||
|
The field DestAddr of the structure Upnp_Discovery is now a full
|
||||||
|
SOCKADDRIN instead of a pointer to SOCKADDRIN. Commented code sugests
|
||||||
|
that in a previous moment, the function ssdp_handle_ctrlpt_msg() did
|
||||||
|
not use a postponed thread to call ctrlpt_callback(). Now the code
|
||||||
|
uses a thread, and most probably the original data would get lost and
|
||||||
|
the pointer would point to an invalid memory region. This fix caused
|
||||||
|
an interface change in the library and the minor library version was
|
||||||
|
bumped. Also, the libtool library numbers were changed accordingly.
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
Version 1.4.7
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Added support for the Basic Device
|
||||||
|
(http://www.upnp.org/standardizeddcps/basic.asp) as suggested by
|
||||||
|
Titus Winters.
|
||||||
|
|
||||||
|
2007-05-25 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fixed the file libupnp.pc.in to generate a correct path for the
|
||||||
|
include files.
|
||||||
|
|
||||||
|
2007-05-25 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Removing the Dbg_Level, InitLog, SetLogFileNames and CloseLog
|
||||||
|
defines. These were just aliases, no reason to keep them.
|
||||||
|
|
||||||
|
2007-05-25 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Changed the comments of the include files that expose the UPnP API
|
||||||
|
to use only C89 comments and no C99 comments.
|
||||||
|
|
||||||
|
2007-05-24 Nektarios K. Papadopoulos <npapadop(at)inaccessnetworks.com>
|
||||||
|
* Added tvcombo sample that demonstrates coexistence of a device and a
|
||||||
|
control point in the same application.
|
||||||
|
|
||||||
|
2007-05-24 Nektarios K. Papadopoulos <npapadop(at)inaccessnetworks.com>
|
||||||
|
* SF Tracker FR [ 1570020 ].
|
||||||
|
* Enable both device and control point in the same application. Resolve
|
||||||
|
deadlock in the SSDP processing threads.
|
||||||
|
* Fix Threadpool expansion condition.
|
||||||
|
Thanks to Siva Chandran P. for the original patch.
|
||||||
|
|
||||||
|
2007-05-24 Nektarios K. Papadopoulos <npapadop(at)inaccessnetworks.com>
|
||||||
|
* Modified tvdevice (control and picture) service descriptions to make
|
||||||
|
compatible with WinXP/IE control point. 'in' arguments must appear before
|
||||||
|
'out' arguments in argument list.
|
||||||
|
Thanks to Martin Tremblay for pointing out the solution originally provided
|
||||||
|
by MORIOKA Yasuhiro.
|
||||||
|
|
||||||
|
2007-05-21 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* More MSVC fixes, using XINLINE instead of inline, MSVC has troubles
|
||||||
|
with inline. Thanks to David Maass for reporting.
|
||||||
|
* Changed XINLINE to UPNP_INLINE.
|
||||||
|
|
||||||
|
2007-05-21 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Added the file build/inc/msvc/inttypes.h. This file is for use with
|
||||||
|
MSVC only, because it does not provide C99 compatibility.
|
||||||
|
|
||||||
|
2007-05-18 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Removed all uses of the DEVICEONLY(x) macro.
|
||||||
|
|
||||||
|
2007-05-17 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Removed all uses of the DBGONLY(x) macro. A static inline empty
|
||||||
|
function now is used and the compiler takes care of optimizing it out.
|
||||||
|
|
||||||
|
2007-05-17 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fixed a bug in UpnpPrintf, function could call va_start() and return
|
||||||
|
befor calling va_end().
|
||||||
|
|
||||||
|
2007-05-15 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* EXPORT_SPEC missing on some declarations in ixml/inc/ixml.h.
|
||||||
|
Thanks to David Maass.
|
||||||
|
|
||||||
|
2007-05-15 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* sizeof is unsigned, so %zu is more adequate than %zd.
|
||||||
|
|
||||||
|
2007-05-15 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Using an invented printf directive PRIzu that on MSVC
|
||||||
|
expands to "lu", and on normal C99 compilers expands to "zu".
|
||||||
|
|
||||||
|
2007-05-15 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Rewrote raw_find_str. Now it no longer uses strcasestr(), but it
|
||||||
|
transforms the first input buffer into lowercase.
|
||||||
|
|
||||||
|
2007-05-08 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fix for debug printf format strings. size_t are not expected
|
||||||
|
in a string format like "%.*s".
|
||||||
|
|
||||||
|
2007-05-08 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Added inttypes.h as a header requirement in configure.ac.
|
||||||
|
|
||||||
|
2007-05-11 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Moved upnp_tv_ctrlpt and upnp_tv_device executables from folder
|
||||||
|
upnp to folder upnp/sample. Moved folder upnp/sample/tvdevice/web
|
||||||
|
to folder upnp/sample/web. This way, if someone compiles the
|
||||||
|
tarball and executes upnp_tv_device from its creation directory,
|
||||||
|
there will be no error -108 for not finding directory web.
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
Version 1.4.6
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2007-04-19 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Fix for freebsd host_os in configure.ac.
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
Version 1.4.5
|
||||||
|
*******************************************************************************
|
||||||
|
|
||||||
|
2007-04-19 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* Case insensitive comparison in raw_find_str() (httpparser.c) as
|
||||||
|
suggested by Craig Nelson in SF Tracker [ 1689382 ] DLINK DIR-625
|
||||||
|
patch.
|
||||||
|
|
||||||
|
2007-04-07 Nektarios K. Papadopoulos <npapadop(at)inaccessnetworks.com>
|
||||||
|
* Fix for a bug in makeAction where va_arg was beeing called one
|
||||||
|
extra time.
|
||||||
|
|
||||||
|
2007-04-28 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* SF Tracker [ 1703533 ] Patch to make it compile under FreeBSD
|
||||||
|
Submitted By: Timothy Redaelli - drittz
|
||||||
|
I made some patches to make it compile under FreeBSD using
|
||||||
|
gethostbyaddr_r when supported.
|
||||||
|
|
||||||
|
2007-04-28 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
* [pupnp-devel] Type mixup on x86_64 causes UPNP_E_OUTOF_MEMORY
|
||||||
|
Submitted By: Glen Masgai
|
||||||
|
after an UpnpSendActionAsync() for example, i get UPNP_E_OUTOF_MEMORY
|
||||||
|
in the callback using 1.4.4 on a x86_64 system. This happens in
|
||||||
|
http_MakeMessage(), which in some cases get called with wrong types
|
||||||
|
(int instead of size_t) in combination with format "b" and "Q".
|
||||||
|
The attached patch should fix this.
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
Version 1.4.4
|
Version 1.4.4
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
2007-04-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
2007-04-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
* SF Tracker [ 1695399 ] Typo in util.h
|
* SF Tracker [ 1695399 ] Typo in util.h
|
||||||
@@ -35,9 +437,9 @@ Version 1.4.4
|
|||||||
Please note, that I enabled some extra debugging lines that were commented,
|
Please note, that I enabled some extra debugging lines that were commented,
|
||||||
in order to get more information. See attached files.
|
in order to get more information. See attached files.
|
||||||
|
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
Version 1.4.3
|
Version 1.4.3
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
2007-03-13 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
2007-03-13 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
* SF Tracker [ 1663004 ] Compile on Cygwin
|
* SF Tracker [ 1663004 ] Compile on Cygwin
|
||||||
@@ -72,9 +474,9 @@ Version 1.4.3
|
|||||||
|
|
||||||
* Fixed nasty segmentation fault bug on membuffer.c.
|
* Fixed nasty segmentation fault bug on membuffer.c.
|
||||||
|
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
Version 1.4.2
|
Version 1.4.2
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
2007-02-09 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
2007-02-09 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
|
||||||
@@ -96,7 +498,7 @@ Version 1.4.2
|
|||||||
2007-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
2007-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
|
||||||
* SF Tracker [ 1634922 ] Support for large files (>= 2 GiB), part 2
|
* SF Tracker [ 1634922 ] Support for large files (>= 2 GiB), part 2
|
||||||
Submitted By: Jonathan - no_dice
|
Submitted By: Jonathan Casiot - no_dice
|
||||||
Summary: This patch hopefully fixes the remaining types and related
|
Summary: This patch hopefully fixes the remaining types and related
|
||||||
code to enable files >= 2 GiB to be streamed. Jonathan claims to have
|
code to enable files >= 2 GiB to be streamed. Jonathan claims to have
|
||||||
tested this with a patched version of ushare-0.9.8 and a D-Link DSM-520.
|
tested this with a patched version of ushare-0.9.8 and a D-Link DSM-520.
|
||||||
@@ -176,9 +578,9 @@ Version 1.4.2
|
|||||||
* support for large files (>2 GBytes) added
|
* support for large files (>2 GBytes) added
|
||||||
|
|
||||||
|
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
Version 1.4.1
|
Version 1.4.1
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
2006-07-07 Oxy <virtual_worlds(at)gmx.de>
|
2006-07-07 Oxy <virtual_worlds(at)gmx.de>
|
||||||
|
|
||||||
@@ -209,9 +611,9 @@ Version 1.4.1
|
|||||||
* Patch to fix memory leaks and reasons for crashes added (thanks
|
* Patch to fix memory leaks and reasons for crashes added (thanks
|
||||||
to loigu)
|
to loigu)
|
||||||
|
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
Version 1.4.0
|
Version 1.4.0
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
2006-05-26 Oxy <virtual_worlds(at)gmx.de>
|
2006-05-26 Oxy <virtual_worlds(at)gmx.de>
|
||||||
|
|
||||||
@@ -237,9 +639,9 @@ Version 1.4.0
|
|||||||
|
|
||||||
* Bugfix for M-Search packet
|
* Bugfix for M-Search packet
|
||||||
|
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
FORK FROM DEAD libupnp
|
FORK FROM DEAD libupnp
|
||||||
*************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
2006-04-29 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-04-29 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
|
|||||||
11
Makefile.am
11
Makefile.am
@@ -1,4 +1,3 @@
|
|||||||
# $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
|
||||||
#
|
#
|
||||||
@@ -9,7 +8,11 @@ ACLOCAL_AMFLAGS = -I m4
|
|||||||
|
|
||||||
DISTCHECK_CONFIGURE_FLAGS = --enable-debug --enable-samples
|
DISTCHECK_CONFIGURE_FLAGS = --enable-debug --enable-samples
|
||||||
|
|
||||||
SUBDIRS = ixml threadutil upnp docs/dist
|
SUBDIRS = \
|
||||||
|
ixml \
|
||||||
|
threadutil \
|
||||||
|
upnp \
|
||||||
|
docs/dist
|
||||||
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
@@ -23,7 +26,8 @@ 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
|
||||||
|
|
||||||
|
|
||||||
# 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
|
||||||
@@ -31,6 +35,7 @@ EXTRA_DIST = \
|
|||||||
pkgconfigexecdir = $(libdir)/pkgconfig
|
pkgconfigexecdir = $(libdir)/pkgconfig
|
||||||
pkgconfigexec_DATA = libupnp.pc
|
pkgconfigexec_DATA = libupnp.pc
|
||||||
|
|
||||||
|
|
||||||
$(pkgconfigexec_DATA): config.status
|
$(pkgconfigexec_DATA): config.status
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
31
THANKS
31
THANKS
@@ -6,25 +6,46 @@ 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)
|
||||||
|
- Apostolos Syropoulos
|
||||||
- Arno Willig
|
- Arno Willig
|
||||||
|
- Bob Ciora
|
||||||
- Chaos
|
- Chaos
|
||||||
|
- Charles Nepveu (cnepveu)
|
||||||
|
- Chris Pickel
|
||||||
|
- Craig Nelson
|
||||||
- David Maass
|
- David Maass
|
||||||
- Emil Ljungdahl
|
- 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 (no_dice)
|
- Jonathan Casiot (no_dice)
|
||||||
|
- Josh Carroll
|
||||||
|
- Keith Brindley
|
||||||
- Leuk_He
|
- Leuk_He
|
||||||
- Loigu
|
- Loigu
|
||||||
- Luke Kim
|
- Luke Kim (nereusuj)
|
||||||
- Marcelo Roberto Jimenez
|
- Marcelo Roberto Jimenez (mroberto)
|
||||||
- Markus Strobl
|
- Markus Strobl
|
||||||
- Nektarios K. Papadopoulos
|
- Nektarios K. Papadopoulos (npapadop)
|
||||||
- Oskar Liljeblad
|
- Oskar Liljeblad
|
||||||
- Michael (Oxy)
|
- Michael (oxygenic)
|
||||||
- Paul Vixie
|
- Paul Vixie
|
||||||
|
- Peter Hartley
|
||||||
|
- Rene Hexel
|
||||||
|
- Robert Gingher (robsbox)
|
||||||
- Siva Chandran
|
- Siva Chandran
|
||||||
|
- Stéphane Corthésy
|
||||||
|
- Steve Bresson
|
||||||
|
- Timothy Redaelli
|
||||||
|
- Titus Winters
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,3 @@ 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* autoconfig.h. Generated by configure. */
|
/* autoconfig.h. Generated from autoconfig.h.in 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,15 +19,18 @@
|
|||||||
/* 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
|
||||||
|
|
||||||
@@ -92,19 +95,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 "virtual_worlds@gmx.de"
|
#define PACKAGE_BUGREPORT "mroberto@users.sourceforge.net"
|
||||||
|
|
||||||
/* 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.4.0"
|
#define PACKAGE_STRING "libupnp 1.4.7"
|
||||||
|
|
||||||
/* 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.4.0"
|
#define PACKAGE_VERSION "1.4.7"
|
||||||
|
|
||||||
/* 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. */
|
||||||
@@ -135,27 +138,30 @@
|
|||||||
#define UPNP_VERSION_MINOR 4
|
#define UPNP_VERSION_MINOR 4
|
||||||
|
|
||||||
/* see upnpconfig.h */
|
/* see upnpconfig.h */
|
||||||
#define UPNP_VERSION_PATCH 0
|
#define UPNP_VERSION_PATCH 7
|
||||||
|
|
||||||
/* see upnpconfig.h */
|
/* see upnpconfig.h */
|
||||||
#define UPNP_VERSION_STRING "1.4.0"
|
#define UPNP_VERSION_STRING "1.4.7"
|
||||||
|
|
||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#define VERSION "1.4.0"
|
#define VERSION "1.4.7"
|
||||||
|
|
||||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
/* File Offset size */
|
||||||
#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 */
|
||||||
|
|
||||||
/* Define for large files, on AIX-style hosts. */
|
/* Large files support */
|
||||||
/* #undef _LARGE_FILES */
|
#define _LARGE_FILE_SOURCE
|
||||||
|
|
||||||
/* 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 `unsigned' if <sys/types.h> does not define. */
|
/* Define to `long int' 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 */
|
||||||
|
|
||||||
/* Substitute for socklen_t */
|
/* Substitute for socklen_t */
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#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
|
||||||
@@ -96,6 +95,17 @@
|
|||||||
#define MAX_THREADS 12
|
#define MAX_THREADS 12
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
/** @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
|
/** @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
|
||||||
@@ -251,7 +261,7 @@
|
|||||||
|
|
||||||
/** @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:
|
||||||
see <upnp/upnpdebug.h>
|
see <upnp/inc/upnpdebug.h>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DEBUG_ALL 1
|
#define DEBUG_ALL 1
|
||||||
@@ -294,68 +304,40 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** @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
|
#else
|
||||||
#define CLIENTONLY(x)
|
# define CLIENTONLY(x)
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef INCLUDE_DEVICE_APIS
|
|
||||||
#define DEVICEONLY(x) x
|
|
||||||
#else
|
|
||||||
#define DEVICEONLY(x)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* upnp/inc/upnpconfig.h. Generated by configure. */
|
/* upnp/inc/upnpconfig.h. Generated from upnpconfig.h.in by configure. */
|
||||||
// -*- C -*-
|
// -*- C -*-
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/** The library version (string) e.g. "1.3.0" */
|
/** The library version (string) e.g. "1.3.0" */
|
||||||
#define UPNP_VERSION_STRING "1.4.0"
|
#define UPNP_VERSION_STRING "1.4.7"
|
||||||
|
|
||||||
/** Major version of the library */
|
/** Major version of the library */
|
||||||
#define UPNP_VERSION_MAJOR 1
|
#define UPNP_VERSION_MAJOR 1
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
#define UPNP_VERSION_MINOR 4
|
#define UPNP_VERSION_MINOR 4
|
||||||
|
|
||||||
/** Patch version of the library */
|
/** Patch version of the library */
|
||||||
#define UPNP_VERSION_PATCH 0
|
#define UPNP_VERSION_PATCH 7
|
||||||
|
|
||||||
/** The library version (numeric) e.g. 10300 means version 1.3.0 */
|
/** The library version (numeric) e.g. 10300 means version 1.3.0 */
|
||||||
#define UPNP_VERSION \
|
#define UPNP_VERSION \
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
/** 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 */
|
||||||
#undef UPNP_HAVE_DEBUG
|
/* #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
|
||||||
|
|||||||
301
build/msvc/inttypes.h
Normal file
301
build/msvc/inttypes.h
Normal file
@@ -0,0 +1,301 @@
|
|||||||
|
// 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_ ]
|
||||||
222
build/msvc/stdint.h
Normal file
222
build/msvc/stdint.h
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
// 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_ ]
|
||||||
223
build/vc8/ixml.vcproj
Normal file
223
build/vc8/ixml.vcproj
Normal file
@@ -0,0 +1,223 @@
|
|||||||
|
<?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"
|
||||||
|
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"
|
||||||
|
/>
|
||||||
|
<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="..\..\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\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\src\inc\ixmlmembuf.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\ixml\src\inc\ixmlparser.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>
|
||||||
65
build/vc8/libupnp.sln
Normal file
65
build/vc8/libupnp.sln
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
|
||||||
|
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
|
||||||
559
build/vc8/libupnp.vcproj
Normal file
559
build/vc8/libupnp.vcproj
Normal file
@@ -0,0 +1,559 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="libupnp"
|
||||||
|
ProjectGUID="{6227F51A-1498-4C4A-B213-F6FDED605125}"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
OutputDirectory=".\Release"
|
||||||
|
IntermediateDirectory=".\Release"
|
||||||
|
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"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP"
|
||||||
|
StringPooling="true"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
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="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib"
|
||||||
|
OutputFile=".\Release/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"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
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="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib"
|
||||||
|
OutputFile="$(OutDir)\libupnp.dll"
|
||||||
|
LinkIncremental="2"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
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="..\..\ixml\src\attr.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\genlib\client_table\client_table.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\ixml\src\document.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\ixml\src\element.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_server.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\genlib\net\http\statcodes.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\genlib\util\strintmap.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\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\src\inc\client_table.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\config.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\inc\ssdplib.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\statcodes.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\statuscodes.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\strintmap.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\sysdep.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\unixutil.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\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>
|
||||||
|
<Filter
|
||||||
|
Name="resources"
|
||||||
|
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||||
|
>
|
||||||
|
</Filter>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\..\libupnp_win32.patch"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
213
build/vc8/threadutil.vcproj
Normal file
213
build/vc8/threadutil.vcproj
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
<?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>
|
||||||
216
build/vc8/tvcombo.vcproj
Normal file
216
build/vc8/tvcombo.vcproj
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
<?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=""$(OutDir)";"out.vc8.$(ConfigurationName)\ixml";"out.vc8.$(ConfigurationName)\threadutil";"out.vc8.$(ConfigurationName)\libupnp""
|
||||||
|
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>
|
||||||
208
build/vc8/tvctrlpt.vcproj
Normal file
208
build/vc8/tvctrlpt.vcproj
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
<?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=""$(OutDir)";"out.vc8.$(ConfigurationName)\ixml";"out.vc8.$(ConfigurationName)\threadutil";"out.vc8.$(ConfigurationName)\libupnp""
|
||||||
|
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>
|
||||||
208
build/vc8/tvdevice.vcproj
Normal file
208
build/vc8/tvdevice.vcproj
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
<?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=""$(OutDir)";"out.vc8.$(ConfigurationName)\ixml";"out.vc8.$(ConfigurationName)\threadutil";"out.vc8.$(ConfigurationName)\libupnp""
|
||||||
|
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>
|
||||||
222
build/vc9/ixml.vcproj
Normal file
222
build/vc9/ixml.vcproj
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
<?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="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"
|
||||||
|
PreprocessorDefinitions="DEBUG;WIN32"
|
||||||
|
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="$(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="..\..\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\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\src\inc\ixmlmembuf.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\ixml\src\inc\ixmlparser.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>
|
||||||
69
build/vc9/libupnp.sln
Normal file
69
build/vc9/libupnp.sln
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||||
|
# Visual C++ Express 2008
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libupnp", "libupnp.vcproj", "{6227F51A-1498-4C4A-B213-F6FDED605125}"
|
||||||
|
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}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
|
||||||
|
{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89}
|
||||||
|
EndProjectSection
|
||||||
|
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}
|
||||||
|
{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}") = "tvdevice", "tvdevice.vcproj", "{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
|
||||||
|
{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}") = "tvcombo", "tvcombo.vcproj", "{6365804B-22C6-4D5E-91F3-0C052EB55B4F}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
|
||||||
|
{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89}
|
||||||
|
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} = {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}
|
||||||
|
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
|
||||||
558
build/vc9/libupnp.vcproj
Normal file
558
build/vc9/libupnp.vcproj
Normal file
@@ -0,0 +1,558 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="9.00"
|
||||||
|
Name="libupnp"
|
||||||
|
ProjectGUID="{6227F51A-1498-4C4A-B213-F6FDED605125}"
|
||||||
|
TargetFrameworkVersion="131072"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
OutputDirectory=".\Release"
|
||||||
|
IntermediateDirectory=".\Release"
|
||||||
|
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"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP"
|
||||||
|
StringPooling="true"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
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="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.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="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;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
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="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.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="..\..\ixml\src\attr.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\genlib\client_table\client_table.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\ixml\src\document.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\ixml\src\element.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_server.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\genlib\net\http\statcodes.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\genlib\util\strintmap.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\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\src\inc\client_table.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\config.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\inc\ssdplib.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\statcodes.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\statuscodes.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\strintmap.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\sysdep.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\upnp\src\inc\unixutil.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\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>
|
||||||
|
<Filter
|
||||||
|
Name="resources"
|
||||||
|
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||||
|
>
|
||||||
|
</Filter>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\..\libupnp_win32.patch"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
212
build/vc9/threadutil.vcproj
Normal file
212
build/vc9/threadutil.vcproj
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
<?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="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"
|
||||||
|
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"
|
||||||
|
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="..\..\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>
|
||||||
212
build/vc9/tvcombo.vcproj
Normal file
212
build/vc9/tvcombo.vcproj
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
<?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"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
|
||||||
|
AdditionalLibraryDirectories=""$(OutDir)";".\out.vc9.$(ConfigurationName)\ixml";".\out.vc9.$(ConfigurationName)\threadutil";".\out.vc9.$(ConfigurationName)\libupnp""
|
||||||
|
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\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>
|
||||||
204
build/vc9/tvctrlpt.vcproj
Normal file
204
build/vc9/tvctrlpt.vcproj
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
<?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=""$(OutDir)";".\out.vc9.$(ConfigurationName)\ixml";".\out.vc9.$(ConfigurationName)\threadutil";".\out.vc9.$(ConfigurationName)\libupnp""
|
||||||
|
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>
|
||||||
204
build/vc9/tvdevice.vcproj
Normal file
204
build/vc9/tvdevice.vcproj
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
<?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=""$(OutDir)";".\out.vc9.$(ConfigurationName)\ixml";".\out.vc9.$(ConfigurationName)\threadutil";".\out.vc9.$(ConfigurationName)\libupnp""
|
||||||
|
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>
|
||||||
304
configure.ac
304
configure.ac
@@ -1,53 +1,175 @@
|
|||||||
# -*- 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-2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
# (C) Copyright 2005-2007 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
|
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ(2.60)
|
||||||
|
|
||||||
AC_INIT([libupnp], [1.4.4], [mroberto@users.sourceforge.net])
|
AC_INIT([libupnp], [1.6.6], [mroberto@users.sourceforge.net])
|
||||||
# *Independently* of the above libupnp package version, the libtool version
|
dnl ############################################################################
|
||||||
# of the 3 libraries need to be updated whenever there is a change released :
|
dnl # *Independently* of the above libupnp package version, the libtool version
|
||||||
# "current:revision:age" (this is NOT the same as the package version), where:
|
dnl # of the 3 libraries need to be updated whenever there is a change released:
|
||||||
# - library code modified: revision++
|
dnl # "current:revision:age" (this is NOT the same as the package version),
|
||||||
# - interfaces changed/added/removed: current++ and revision=0
|
dnl # where:
|
||||||
# - interfaces added: age++
|
dnl # - library code modified: revision++
|
||||||
# - interfaces removed: age=0
|
dnl # - interfaces changed/added/removed: current++ and revision=0
|
||||||
# *please update only once, before a formal release, not for each change*
|
dnl # - interfaces added: age++
|
||||||
#
|
dnl # - interfaces removed: age=0
|
||||||
# For release 1.4.1, we had:
|
dnl # *please update only once, before a formal release, not for each change*
|
||||||
#AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
dnl #
|
||||||
#AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
dnl ############################################################################
|
||||||
#AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
dnl # Release 1.4.1:
|
||||||
#
|
dnl #AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
||||||
# "current:revision:age"
|
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
||||||
#
|
dnl #AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
||||||
# - Code has changed in ixml
|
dnl #
|
||||||
# revision: 2 -> 3
|
dnl ############################################################################
|
||||||
# - Code has changed in threadutil
|
dnl # Release 1.4.6:
|
||||||
# revision: 2 -> 3
|
dnl # "current:revision:age"
|
||||||
# - Interface added in threadutil
|
dnl #
|
||||||
# current: 2 -> 3
|
dnl # - Code has changed in ixml
|
||||||
# revisiion: 3 -> 0
|
dnl # revision: 2 -> 3
|
||||||
# age: 0 -> 1
|
dnl # - Code has changed in threadutil
|
||||||
# - Code has changed in upnp (revision 2 -> 3)
|
dnl # revision: 2 -> 3
|
||||||
# revision: 2 -> 3
|
dnl # - Interface added in threadutil
|
||||||
AC_SUBST([LT_VERSION_IXML], [2:3:0])
|
dnl # current: 2 -> 3
|
||||||
AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
|
dnl # revisiion: 3 -> 0
|
||||||
AC_SUBST([LT_VERSION_UPNP], [2:3:0])
|
dnl # age: 0 -> 1
|
||||||
|
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 ############################################################################
|
||||||
|
AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||||
|
AC_SUBST([LT_VERSION_THREADUTIL], [4:3:2])
|
||||||
|
AC_SUBST([LT_VERSION_UPNP], [3:5: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(config.aux)
|
AC_CONFIG_AUX_DIR([build-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
|
||||||
@@ -67,8 +189,7 @@ 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",
|
AC_DEFINE_UNQUOTED([UPNP_VERSION_STRING], "$PACKAGE_VERSION", [see upnpconfig.h])
|
||||||
[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])
|
||||||
@@ -90,7 +211,6 @@ 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])
|
||||||
@@ -124,23 +244,30 @@ 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([documentation],
|
AC_ARG_WITH(
|
||||||
AS_HELP_STRING([--with-documentation=directory_name],
|
[documentation],
|
||||||
|
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([--without-documentation],
|
AS_HELP_STRING(
|
||||||
|
[--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
|
||||||
@@ -159,25 +286,42 @@ AC_PROG_INSTALL
|
|||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
AC_PROG_EGREP
|
AC_PROG_EGREP
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Default compilation flags
|
# Default compilation flags
|
||||||
#
|
#
|
||||||
if test x"$enable_debug" = xyes; then
|
echo "--------------------- Default compilation flags -------------------------------"
|
||||||
|
echo host is $host
|
||||||
|
echo host_os is $host_os
|
||||||
|
case $host_os in
|
||||||
|
freebsd*)
|
||||||
|
echo "Using FreeBSD specific compiler settings"
|
||||||
|
# Put FreeBSD specific compiler flags here
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
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
|
# AC_PROG_CC already sets CFLAGS to "-g -O2" by default
|
||||||
:
|
#:
|
||||||
else
|
# Use -O0 in debug so that variables do not get optimized out
|
||||||
|
AX_CFLAGS_GCC_OPTION([-O0])
|
||||||
|
else
|
||||||
# add optimise for size
|
# add optimise for size
|
||||||
AX_CFLAGS_GCC_OPTION([-Os])
|
AX_CFLAGS_GCC_OPTION([-Os])
|
||||||
fi
|
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])
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -186,14 +330,31 @@ AC_DEFINE(_FILE_OFFSET_BITS, [64], [File Offset size])
|
|||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
# 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([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])])
|
AC_CHECK_HEADERS(
|
||||||
|
[ \
|
||||||
|
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 \
|
||||||
|
sys/timeb.h \
|
||||||
|
syslog.h \
|
||||||
|
unistd.h \
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
[AC_MSG_ERROR([required header file missing])])
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Checks for typedefs, structures, and compiler characteristics
|
# Checks for typedefs, structures, and compiler characteristics
|
||||||
#
|
#
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
AC_TYPE_SIZE_T
|
|
||||||
TYPE_SOCKLEN_T
|
TYPE_SOCKLEN_T
|
||||||
|
|
||||||
|
|
||||||
@@ -202,25 +363,60 @@ TYPE_SOCKLEN_T
|
|||||||
#
|
#
|
||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
AC_FUNC_FSEEKO
|
AC_FUNC_FSEEKO
|
||||||
|
AC_CHECK_FUNCS(ftime,, [AC_CHECK_LIB(compat, ftime)])
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Checks for POSIX Threads
|
# Checks for POSIX Threads
|
||||||
#
|
#
|
||||||
ACX_PTHREAD([],[AC_MSG_ERROR([POSIX threads are required to build this program])])
|
echo "--------------------------- pthread stuff -------------------------------------"
|
||||||
|
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
|
||||||
AC_CONFIG_FILES([Makefile
|
|
||||||
ixml/Makefile
|
ixml/Makefile
|
||||||
ixml/doc/Makefile
|
ixml/doc/Makefile
|
||||||
threadutil/Makefile
|
threadutil/Makefile
|
||||||
upnp/Makefile
|
upnp/Makefile
|
||||||
upnp/doc/Makefile
|
upnp/doc/Makefile
|
||||||
|
upnp/sample/Makefile
|
||||||
docs/dist/Makefile
|
docs/dist/Makefile
|
||||||
libupnp.pc
|
libupnp.pc
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
|||||||
4
docs/dist/Makefile.am
vendored
4
docs/dist/Makefile.am
vendored
@@ -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_UNACCAPTED-302.html \
|
./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCEPTED-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_UNACCAPTED-302.html \
|
./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCEPTED-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 \
|
||||||
|
|||||||
125
ixml/inc/ixml.h
125
ixml/inc/ixml.h
@@ -1,46 +1,47 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/*******************************************************************************
|
||||||
//
|
*
|
||||||
// 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_H_
|
#ifndef _IXML_H_
|
||||||
#define _IXML_H_
|
#define _IXML_H_
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
//#include <malloc.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifndef UPNP_STATIC_LIB
|
#ifndef UPNP_STATIC_LIB
|
||||||
#ifdef LIBUPNP_EXPORTS
|
#ifdef LIBUPNP_EXPORTS
|
||||||
// set up declspec for dll export to make functions visible to library users
|
/* set up declspec for dll export to make functions visible to library users */
|
||||||
#define EXPORT_SPEC __declspec(dllexport)
|
#define EXPORT_SPEC __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define EXPORT_SPEC __declspec(dllimport)
|
#define EXPORT_SPEC __declspec(dllimport)
|
||||||
@@ -54,6 +55,7 @@
|
|||||||
|
|
||||||
typedef int BOOL;
|
typedef int BOOL;
|
||||||
|
|
||||||
|
|
||||||
#define DOMString char *
|
#define DOMString char *
|
||||||
|
|
||||||
|
|
||||||
@@ -88,7 +90,7 @@ typedef int BOOL;
|
|||||||
* etc., refer to section 1.1 of the DOM2-Core recommendation.
|
* etc., refer to section 1.1 of the DOM2-Core recommendation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
*
|
*
|
||||||
@@ -121,7 +123,7 @@ typedef enum
|
|||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{ // see DOM spec
|
{ /* see DOM spec */
|
||||||
IXML_INDEX_SIZE_ERR = 1,
|
IXML_INDEX_SIZE_ERR = 1,
|
||||||
IXML_DOMSTRING_SIZE_ERR = 2,
|
IXML_DOMSTRING_SIZE_ERR = 2,
|
||||||
IXML_HIERARCHY_REQUEST_ERR = 3,
|
IXML_HIERARCHY_REQUEST_ERR = 3,
|
||||||
@@ -240,7 +242,7 @@ extern "C" {
|
|||||||
* its functionality. For more information, refer to DOM2-Core page 34.
|
* its functionality. For more information, refer to DOM2-Core page 34.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** Returns the name of the {\bf Node}, depending on what type of
|
/** Returns the name of the {\bf Node}, depending on what type of
|
||||||
* {\bf Node} it is, in a read-only string. Refer to the table in the
|
* {\bf Node} it is, in a read-only string. Refer to the table in the
|
||||||
@@ -620,7 +622,7 @@ ixmlNode_cloneNode(IXML_Node *nodeptr,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
EXPORT_SPEC BOOL
|
EXPORT_SPEC BOOL
|
||||||
ixmlNode_hasAttributes(IXML_Node *node
|
ixmlNode_hasAttributes(IXML_Node *nodeptr
|
||||||
/** The {\bf Node} to query for attributes. */
|
/** The {\bf Node} to query for attributes. */
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -630,11 +632,11 @@ ixmlNode_hasAttributes(IXML_Node *node
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
EXPORT_SPEC void
|
EXPORT_SPEC void
|
||||||
ixmlNode_free(IXML_Node *IXML_Node
|
ixmlNode_free(IXML_Node *nodeptr
|
||||||
/** The {\bf Node} to free. */
|
/** The {\bf Node} to free. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
*
|
*
|
||||||
@@ -649,7 +651,7 @@ ixmlNode_free(IXML_Node *IXML_Node
|
|||||||
* allowable attributes and values for a particular element. For more
|
* allowable attributes and values for a particular element. For more
|
||||||
* information, refer to the {\it Interface Attr} section in the DOM2-Core.
|
* information, refer to the {\it Interface Attr} section in the DOM2-Core.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
|
|
||||||
/** Frees an {\bf Attr} node.
|
/** Frees an {\bf Attr} node.
|
||||||
@@ -662,7 +664,7 @@ ixmlAttr_free(IXML_Attr *attrNode
|
|||||||
/** The {\bf Attr} node to free. */
|
/** The {\bf Attr} node to free. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
@@ -680,7 +682,7 @@ ixmlAttr_free(IXML_Attr *attrNode
|
|||||||
* information, refer to the {\it Interface CDATASection} section in the
|
* information, refer to the {\it Interface CDATASection} section in the
|
||||||
* DOM2-Core.
|
* DOM2-Core.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
|
|
||||||
/** Initializes a {\bf CDATASection} node.
|
/** Initializes a {\bf CDATASection} node.
|
||||||
@@ -704,7 +706,7 @@ ixmlCDATASection_free(IXML_CDATASection *nodeptr
|
|||||||
/** The {\bf CDATASection} node to free. */
|
/** The {\bf CDATASection} node to free. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
*
|
*
|
||||||
@@ -719,7 +721,7 @@ ixmlCDATASection_free(IXML_CDATASection *nodeptr
|
|||||||
* primary interface to the elements of the document. For more information,
|
* primary interface to the elements of the document. For more information,
|
||||||
* refer to the {\it Interface Document} section in the DOM2Core.
|
* refer to the {\it Interface Document} section in the DOM2Core.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** Initializes a {\bf Document} node.
|
/** Initializes a {\bf Document} node.
|
||||||
*
|
*
|
||||||
@@ -947,7 +949,7 @@ ixmlDocument_getElementsByTagName(IXML_Document *doc,
|
|||||||
/** The tag name to find. */
|
/** The tag name to find. */
|
||||||
);
|
);
|
||||||
|
|
||||||
// introduced in DOM level 2
|
/* introduced in DOM level 2 */
|
||||||
|
|
||||||
/** Creates a new {\bf Element} node in the given qualified name and
|
/** Creates a new {\bf Element} node in the given qualified name and
|
||||||
* namespace URI.
|
* namespace URI.
|
||||||
@@ -1128,7 +1130,7 @@ ixmlDocument_importNode(IXML_Document* doc,
|
|||||||
/** A pointer to a new {\bf Node} owned by {\bf
|
/** A pointer to a new {\bf Node} owned by {\bf
|
||||||
doc}. */
|
doc}. */
|
||||||
);
|
);
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
*
|
*
|
||||||
@@ -1144,7 +1146,7 @@ ixmlDocument_importNode(IXML_Document* doc,
|
|||||||
* extends the {\bf Node} interface and adds more operations to manipulate
|
* extends the {\bf Node} interface and adds more operations to manipulate
|
||||||
* attributes.
|
* attributes.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** Initializes a {\bf IXML_Element} node.
|
/** Initializes a {\bf IXML_Element} node.
|
||||||
*
|
*
|
||||||
@@ -1314,7 +1316,7 @@ ixmlElement_getElementsByTagName(IXML_Element* element,
|
|||||||
search. */
|
search. */
|
||||||
);
|
);
|
||||||
|
|
||||||
// introduced in DOM 2
|
/* introduced in DOM 2 */
|
||||||
|
|
||||||
/** Retrieves an attribute value using the local name and namespace URI.
|
/** Retrieves an attribute value using the local name and namespace URI.
|
||||||
*
|
*
|
||||||
@@ -1493,7 +1495,7 @@ ixmlElement_free(IXML_Element* element
|
|||||||
/** The {\bf Element} to free. */
|
/** The {\bf Element} to free. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
*
|
*
|
||||||
@@ -1508,7 +1510,7 @@ ixmlElement_free(IXML_Element* element
|
|||||||
* no particular order. The {\bf Node} interface uses a {\bf NamedNodeMap}
|
* no particular order. The {\bf Node} interface uses a {\bf NamedNodeMap}
|
||||||
* to maintain the attributes of a node.
|
* to maintain the attributes of a node.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** Returns the number of items contained in this {\bf NamedNodeMap}.
|
/** Returns the number of items contained in this {\bf NamedNodeMap}.
|
||||||
*
|
*
|
||||||
@@ -1579,7 +1581,7 @@ ixmlNamedNodeMap_item(IXML_NamedNodeMap *nnMap,
|
|||||||
/** The index into the map to remove. */
|
/** The index into the map to remove. */
|
||||||
);
|
);
|
||||||
|
|
||||||
// introduced in DOM level 2
|
/* introduced in DOM level 2 */
|
||||||
|
|
||||||
/** Retrieves a {\bf Node} from a {\bf NamedNodeMap} specified by
|
/** Retrieves a {\bf Node} from a {\bf NamedNodeMap} specified by
|
||||||
* namespace URI and local name.
|
* namespace URI and local name.
|
||||||
@@ -1646,7 +1648,7 @@ ixmlNamedNodeMap_free(IXML_NamedNodeMap *nnMap
|
|||||||
/** The {\bf NamedNodeMap to free}. */
|
/** The {\bf NamedNodeMap to free}. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
*
|
*
|
||||||
@@ -1661,7 +1663,7 @@ ixmlNamedNodeMap_free(IXML_NamedNodeMap *nnMap
|
|||||||
* the nodes contained in a {\bf NodeList}. The DOM2-Core refers to
|
* the nodes contained in a {\bf NodeList}. The DOM2-Core refers to
|
||||||
* this as being {\it live}.
|
* this as being {\it live}.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** Retrieves a {\bf Node} from a {\bf NodeList} specified by a
|
/** Retrieves a {\bf Node} from a {\bf NodeList} specified by a
|
||||||
* numerical index.
|
* numerical index.
|
||||||
@@ -1701,8 +1703,8 @@ ixmlNodeList_free(IXML_NodeList *nList
|
|||||||
/** The {\bf NodeList} to free. */
|
/** The {\bf NodeList} to free. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@} Interface NodeList
|
/*! @} */ /* Interface NodeList */
|
||||||
//@} DOM Interfaces
|
/*! @} */ /* DOM Interfaces */
|
||||||
|
|
||||||
/**@name IXML API
|
/**@name IXML API
|
||||||
* The IXML API contains utility functions that are not part of the standard
|
* The IXML API contains utility functions that are not part of the standard
|
||||||
@@ -1710,7 +1712,7 @@ ixmlNodeList_free(IXML_NodeList *nList
|
|||||||
* file or buffer, create an XML file from a DOM structure, and manipulate
|
* file or buffer, create an XML file from a DOM structure, and manipulate
|
||||||
* DOMString objects.
|
* DOMString objects.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
*
|
*
|
||||||
@@ -1738,7 +1740,7 @@ ixmlNodeList_free(IXML_NodeList *nList
|
|||||||
* of the DOM tree or {\tt NULL} on an error.
|
* of the DOM tree or {\tt NULL} on an error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DOMString
|
EXPORT_SPEC DOMString
|
||||||
ixmlPrintDocument(IXML_Document *doc);
|
ixmlPrintDocument(IXML_Document *doc);
|
||||||
|
|
||||||
/** Renders a {\bf Node} and all sub-elements into an XML text
|
/** Renders a {\bf Node} and all sub-elements into an XML text
|
||||||
@@ -1756,7 +1758,7 @@ ixmlPrintDocument(IXML_Document *doc);
|
|||||||
* of the DOM tree or {\tt NULL} on an error.
|
* of the DOM tree or {\tt NULL} on an error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DOMString
|
EXPORT_SPEC DOMString
|
||||||
ixmlPrintNode(IXML_Node *doc
|
ixmlPrintNode(IXML_Node *doc
|
||||||
/** The root of the {\bf Node} tree to render to XML text. */
|
/** The root of the {\bf Node} tree to render to XML text. */
|
||||||
);
|
);
|
||||||
@@ -1777,7 +1779,7 @@ ixmlPrintNode(IXML_Node *doc
|
|||||||
* of the DOM tree or {\tt NULL} on an error.
|
* of the DOM tree or {\tt NULL} on an error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DOMString
|
EXPORT_SPEC DOMString
|
||||||
ixmlDocumenttoString(IXML_Document *doc);
|
ixmlDocumenttoString(IXML_Document *doc);
|
||||||
|
|
||||||
/** Renders a {\bf Node} and all sub-elements into an XML text
|
/** Renders a {\bf Node} and all sub-elements into an XML text
|
||||||
@@ -1809,7 +1811,7 @@ ixmlNodetoString(IXML_Node *doc
|
|||||||
* characters are replaced by the {\bf errorChar}, and invalid "&" entities
|
* characters are replaced by the {\bf errorChar}, and invalid "&" entities
|
||||||
* are left untranslated. The parsing is then allowed to continue.
|
* are left untranslated. The parsing is then allowed to continue.
|
||||||
*/
|
*/
|
||||||
void
|
EXPORT_SPEC void
|
||||||
ixmlRelaxParser(char errorChar);
|
ixmlRelaxParser(char errorChar);
|
||||||
|
|
||||||
|
|
||||||
@@ -1913,6 +1915,7 @@ ixmlFreeDOMString(DOMString buf
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//@} IXML API
|
/*! @} */ /* IXML API */
|
||||||
|
|
||||||
|
#endif /* _IXML_H_ */
|
||||||
|
|
||||||
#endif // _IXML_H_
|
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ ixmlDocument_createDocumentEx( OUT IXML_Document ** rtDoc )
|
|||||||
*
|
*
|
||||||
*=================================================================*/
|
*=================================================================*/
|
||||||
IXML_Document *
|
IXML_Document *
|
||||||
ixmlDocument_createDocument( )
|
ixmlDocument_createDocument()
|
||||||
{
|
{
|
||||||
IXML_Document *doc = NULL;
|
IXML_Document *doc = NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,6 @@
|
|||||||
#define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) )
|
#define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) )
|
||||||
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
|
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#define XINLINE inline
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MEMBUF_DEF_SIZE_INC 20
|
#define MEMBUF_DEF_SIZE_INC 20
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ Parser_UTF8ToInt( IN const char *ss,
|
|||||||
*
|
*
|
||||||
*===============================================================================*/
|
*===============================================================================*/
|
||||||
static Parser *
|
static Parser *
|
||||||
Parser_init( )
|
Parser_init()
|
||||||
{
|
{
|
||||||
Parser *newParser = NULL;
|
Parser *newParser = NULL;
|
||||||
|
|
||||||
@@ -501,17 +501,22 @@ Parser_init( )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
* Parser_isValidEndElement
|
* Parser_isValidEndElement
|
||||||
* check if a new node->nodeName matches top of element stack.
|
* check if a new node->nodeName matches top of element stack.
|
||||||
* Internal to parser only.
|
* Internal to parser only.
|
||||||
*
|
*=================================================================*/
|
||||||
*=================================================================*/
|
|
||||||
static int
|
static int
|
||||||
Parser_isValidEndElement( IN Parser * xmlParser,
|
Parser_isValidEndElement(
|
||||||
|
IN Parser * xmlParser,
|
||||||
IN IXML_Node * newNode )
|
IN IXML_Node * newNode )
|
||||||
{
|
{
|
||||||
return ( strcmp( xmlParser->pCurElement->element, newNode->nodeName )
|
assert( xmlParser );
|
||||||
== 0 );
|
assert( xmlParser->pCurElement );
|
||||||
|
assert( xmlParser->pCurElement->element );
|
||||||
|
assert( newNode );
|
||||||
|
assert( newNode->nodeName );
|
||||||
|
|
||||||
|
return strcmp( xmlParser->pCurElement->element, newNode->nodeName ) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===============================================================
|
/*===============================================================
|
||||||
@@ -672,7 +677,7 @@ Parser_LoadDocument( OUT IXML_Document ** retDoc,
|
|||||||
int rc = IXML_SUCCESS;
|
int rc = IXML_SUCCESS;
|
||||||
Parser *xmlParser = NULL;
|
Parser *xmlParser = NULL;
|
||||||
|
|
||||||
xmlParser = Parser_init( );
|
xmlParser = Parser_init();
|
||||||
if( xmlParser == NULL ) {
|
if( xmlParser == NULL ) {
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -921,6 +926,8 @@ Parser_parseDocument( OUT IXML_Document ** retDoc,
|
|||||||
int rc = IXML_SUCCESS;
|
int rc = IXML_SUCCESS;
|
||||||
IXML_CDATASection *cdataSecNode = NULL;
|
IXML_CDATASection *cdataSecNode = NULL;
|
||||||
|
|
||||||
|
// It is important that the node gets initialized here, otherwise things
|
||||||
|
// can go wrong on the error handler.
|
||||||
ixmlNode_init( &newNode );
|
ixmlNode_init( &newNode );
|
||||||
|
|
||||||
rc = ixmlDocument_createDocumentEx( &gRootDoc );
|
rc = ixmlDocument_createDocumentEx( &gRootDoc );
|
||||||
@@ -936,7 +943,9 @@ Parser_parseDocument( OUT IXML_Document ** retDoc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
while( bETag == FALSE ) {
|
while( bETag == FALSE ) {
|
||||||
// clear the newNode contents
|
// clear the newNode contents. Redundant on the first iteration,
|
||||||
|
// but nonetheless, necessary due to the possible calls to
|
||||||
|
// ErrorHandler above. Currently, this is just a memset to zero.
|
||||||
ixmlNode_init( &newNode );
|
ixmlNode_init( &newNode );
|
||||||
|
|
||||||
if( Parser_getNextNode( xmlParser, &newNode, &bETag ) ==
|
if( Parser_getNextNode( xmlParser, &newNode, &bETag ) ==
|
||||||
@@ -1030,7 +1039,7 @@ Parser_parseDocument( OUT IXML_Document ** retDoc,
|
|||||||
Parser_free( xmlParser );
|
Parser_free( xmlParser );
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
ErrorHandler:
|
ErrorHandler:
|
||||||
Parser_freeNodeContent( &newNode );
|
Parser_freeNodeContent( &newNode );
|
||||||
ixmlDocument_free( gRootDoc );
|
ixmlDocument_free( gRootDoc );
|
||||||
Parser_free( xmlParser );
|
Parser_free( xmlParser );
|
||||||
@@ -2497,3 +2506,4 @@ Parser_getNextNode( IN Parser * xmlParser,
|
|||||||
return IXML_SYNTAX_ERR;
|
return IXML_SYNTAX_ERR;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ ixmlNode_setLocalName( IN IXML_Node * nodeptr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
* ixmlNode_getNodeNamespaceURI
|
* ixmlNode_getNamespaceURI
|
||||||
* Returns the node namespaceURI
|
* Returns the node namespaceURI
|
||||||
* External function.
|
* External function.
|
||||||
* Returns:
|
* Returns:
|
||||||
|
|||||||
0
ixml/test/test_document.sh
Normal file → Executable file
0
ixml/test/test_document.sh
Normal file → Executable file
@@ -7,6 +7,5 @@ Name: libupnp
|
|||||||
Description: Linux SDK for UPnP Devices
|
Description: Linux SDK for UPnP Devices
|
||||||
Version: @VERSION@
|
Version: @VERSION@
|
||||||
Libs: @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml
|
Libs: @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml
|
||||||
Cflags: @PTHREAD_CFLAGS@ -I${includedir}
|
Cflags: @PTHREAD_CFLAGS@ -I${includedir}/upnp
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Version: 1.4.2
|
Version: 1.6.6
|
||||||
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,6 +77,12 @@ 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
|
||||||
|
|
||||||
|
|||||||
@@ -1,50 +1,88 @@
|
|||||||
dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
##### http://autoconf-archive.cryp.to/acx_pthread.html
|
||||||
dnl
|
#
|
||||||
dnl @summary figure out how to build C programs using POSIX threads
|
# SYNOPSIS
|
||||||
dnl
|
#
|
||||||
dnl This macro figures out how to build C programs using POSIX threads.
|
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||||
dnl It sets the PTHREAD_LIBS output variable to the threads library and
|
#
|
||||||
dnl linker flags, and the PTHREAD_CFLAGS output variable to any special
|
# DESCRIPTION
|
||||||
dnl C compiler flags that are needed. (The user can also force certain
|
#
|
||||||
dnl compiler flags/libs to be tested by setting these environment
|
# This macro figures out how to build C programs using POSIX threads.
|
||||||
dnl variables.)
|
# It sets the PTHREAD_LIBS output variable to the threads library and
|
||||||
dnl
|
# linker flags, and the PTHREAD_CFLAGS output variable to any special
|
||||||
dnl Also sets PTHREAD_CC to any special C compiler that is needed for
|
# C compiler flags that are needed. (The user can also force certain
|
||||||
dnl multi-threaded programs (defaults to the value of CC otherwise).
|
# compiler flags/libs to be tested by setting these environment
|
||||||
dnl (This is necessary on AIX to use the special cc_r compiler alias.)
|
# variables.)
|
||||||
dnl
|
#
|
||||||
dnl NOTE: You are assumed to not only compile your program with these
|
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||||
dnl flags, but also link it with them as well. e.g. you should link
|
# multi-threaded programs (defaults to the value of CC otherwise).
|
||||||
dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
# (This is necessary on AIX to use the special cc_r compiler alias.)
|
||||||
dnl $LIBS
|
#
|
||||||
dnl
|
# NOTE: You are assumed to not only compile your program with these
|
||||||
dnl If you are only building threads programs, you may wish to use
|
# flags, but also link it with them as well. e.g. you should link
|
||||||
dnl these variables in your default LIBS, CFLAGS, and CC:
|
# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
||||||
dnl
|
# $LIBS
|
||||||
dnl LIBS="$PTHREAD_LIBS $LIBS"
|
#
|
||||||
dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
# If you are only building threads programs, you may wish to use
|
||||||
dnl CC="$PTHREAD_CC"
|
# these variables in your default LIBS, CFLAGS, and CC:
|
||||||
dnl
|
#
|
||||||
dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
# CC="$PTHREAD_CC"
|
||||||
dnl
|
#
|
||||||
dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
|
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
||||||
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
||||||
dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||||
dnl default action will define HAVE_PTHREAD.
|
#
|
||||||
dnl
|
# ACTION-IF-FOUND is a list of shell commands to run if a threads
|
||||||
dnl Please let the authors know if this macro fails on any platform, or
|
# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
||||||
dnl if you have any other suggestions or comments. This macro was based
|
# run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
||||||
dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
|
# default action will define HAVE_PTHREAD.
|
||||||
dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
|
#
|
||||||
dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
|
# Please let the authors know if this macro fails on any platform, or
|
||||||
dnl We are also grateful for the helpful feedback of numerous users.
|
# if you have any other suggestions or comments. This macro was based
|
||||||
dnl
|
# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
|
||||||
dnl @category InstalledPackages
|
# (with help from M. Frigo), as well as ac_pthread and hb_pthread
|
||||||
dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
|
# macros posted by Alejandro Forero Cuervo to the autoconf macro
|
||||||
dnl @version 2005-06-15
|
# repository. We are also grateful for the helpful feedback of
|
||||||
dnl @license GPLWithACException
|
# numerous users.
|
||||||
|
#
|
||||||
|
# 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])
|
||||||
@@ -216,8 +254,12 @@ 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 cc_r
|
# More AIX lossage: must compile with xlc_r or cc_r
|
||||||
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
|
if test x"$GCC" != xyes; then
|
||||||
|
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
|
||||||
|
|||||||
@@ -1,48 +1,87 @@
|
|||||||
dnl @synopsis AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
|
##### http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
|
||||||
dnl
|
#
|
||||||
dnl AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like
|
# SYNOPSIS
|
||||||
dnl "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the
|
#
|
||||||
dnl optionflag to CFLAGS if it is understood. You can override the
|
# AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
|
||||||
dnl shellvar-default of CFLAGS of course. The order of arguments stems
|
#
|
||||||
dnl from the explicit macros like AX_CFLAGS_WARN_ALL.
|
# DESCRIPTION
|
||||||
dnl
|
#
|
||||||
dnl The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add
|
# AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like
|
||||||
dnl to CXXFLAGS - and it uses the autoconf setup for C++ instead of C
|
# "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the
|
||||||
dnl (since it is possible to use different compilers for C and C++).
|
# optionflag to CFLAGS if it is understood. You can override the
|
||||||
dnl
|
# shellvar-default of CFLAGS of course. The order of arguments stems
|
||||||
dnl The macro is a lot simpler than any special AX_CFLAGS_* macro (or
|
# from the explicit macros like AX_CFLAGS_WARN_ALL.
|
||||||
dnl ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
|
#
|
||||||
dnl However, if you use this macro in a few places, it would be great
|
# The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add
|
||||||
dnl if you would make up a new function-macro and submit it to the
|
# to CXXFLAGS - and it uses the autoconf setup for C++ instead of C
|
||||||
dnl ac-archive.
|
# (since it is possible to use different compilers for C and C++).
|
||||||
dnl
|
#
|
||||||
dnl - $1 option-to-check-for : required ("-option" as non-value)
|
# The macro is a lot simpler than any special AX_CFLAGS_* macro (or
|
||||||
dnl - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
|
# ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
|
||||||
dnl - $3 action-if-found : add value to shellvariable
|
# However, if you use this macro in a few places, it would be great
|
||||||
dnl - $4 action-if-not-found : nothing
|
# if you would make up a new function-macro and submit it to the
|
||||||
dnl
|
# ac-archive.
|
||||||
dnl note: in earlier versions, $1-$2 were swapped. We try to detect the
|
#
|
||||||
dnl situation and accept a $2=~/-/ as being the old
|
# - $1 option-to-check-for : required ("-option" as non-value)
|
||||||
dnl option-to-check-for.
|
# - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
|
||||||
dnl
|
# - $3 action-if-found : add value to shellvariable
|
||||||
dnl also: there are other variants that emerged from the original macro
|
# - $4 action-if-not-found : nothing
|
||||||
dnl variant which did just test an option to be possibly added.
|
#
|
||||||
dnl However, some compilers accept an option silently, or possibly for
|
# note: in earlier versions, $1-$2 were swapped. We try to detect the
|
||||||
dnl just another option that was not intended. Therefore, we have to do
|
# situation and accept a $2=~/-/ as being the old
|
||||||
dnl a generic test for a compiler family. For gcc we check "-pedantic"
|
# option-to-check-for.
|
||||||
dnl being accepted which is also understood by compilers who just want
|
#
|
||||||
dnl to be compatible with gcc even when not being made from gcc
|
# also: there are other variants that emerged from the original macro
|
||||||
dnl sources.
|
# variant which did just test an option to be possibly added.
|
||||||
dnl
|
# However, some compilers accept an option silently, or possibly for
|
||||||
dnl see also:
|
# just another option that was not intended. Therefore, we have to do
|
||||||
dnl
|
# a generic test for a compiler family. For gcc we check "-pedantic"
|
||||||
dnl AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION
|
# being accepted which is also understood by compilers who just want
|
||||||
dnl AX_CFLAGS_AIX_OPTION AX_CFLAGS_IRIX_OPTION
|
# to be compatible with gcc even when not being made from gcc
|
||||||
dnl
|
# sources.
|
||||||
dnl @category C
|
#
|
||||||
dnl @author Guido Draheim <guidod@gmx.de>
|
# see also:
|
||||||
dnl @version 2003-11-04
|
#
|
||||||
dnl @license GPLWithACException
|
# AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION
|
||||||
|
# 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
|
||||||
@@ -53,7 +92,8 @@ 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 % m4_ifval($2,$2,-option)" dnl GCC
|
in "-pedantic -Werror % 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;],
|
||||||
@@ -85,10 +125,11 @@ 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_CXX
|
AC_LANG_CPLUSPLUS
|
||||||
ac_save_[]FLAGS="$[]FLAGS"
|
ac_save_[]FLAGS="$[]FLAGS"
|
||||||
for ac_arg dnl
|
for ac_arg dnl
|
||||||
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
|
in "-pedantic -Werror % 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;],
|
||||||
@@ -122,7 +163,8 @@ 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 % m4_ifval($1,$1,-option)" dnl GCC
|
in "-pedantic -Werror % 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;],
|
||||||
@@ -154,10 +196,11 @@ 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_CXX
|
AC_LANG_CPLUSPLUS
|
||||||
ac_save_[]FLAGS="$[]FLAGS"
|
ac_save_[]FLAGS="$[]FLAGS"
|
||||||
for ac_arg dnl
|
for ac_arg dnl
|
||||||
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
|
in "-pedantic -Werror % 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;],
|
||||||
|
|||||||
@@ -1,27 +1,66 @@
|
|||||||
dnl @synopsis AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
|
##### http://autoconf-archive.cryp.to/ax_cflags_warn_all.html
|
||||||
dnl
|
#
|
||||||
dnl Try to find a compiler option that enables most reasonable
|
# SYNOPSIS
|
||||||
dnl warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
|
#
|
||||||
dnl which is split up into two AX_CFLAGS_WARN_ALL and
|
# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
|
||||||
dnl AX_CFLAGS_WARN_ALL_ANSI
|
#
|
||||||
dnl
|
# DESCRIPTION
|
||||||
dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
|
#
|
||||||
dnl result is added to the shellvar being CFLAGS by default.
|
# Try to find a compiler option that enables most reasonable
|
||||||
dnl
|
# warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
|
||||||
dnl Currently this macro knows about GCC, Solaris C compiler, Digital
|
# which is split up into two AX_CFLAGS_WARN_ALL and
|
||||||
dnl Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
|
# AX_CFLAGS_WARN_ALL_ANSI
|
||||||
dnl compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
|
#
|
||||||
dnl 10.0.0.8) C compiler.
|
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
|
||||||
dnl
|
# result is added to the shellvar being CFLAGS by default.
|
||||||
dnl - $1 shell-variable-to-add-to : CFLAGS
|
#
|
||||||
dnl - $2 add-value-if-not-found : nothing
|
# Currently this macro knows about GCC, Solaris C compiler, Digital
|
||||||
dnl - $3 action-if-found : add value to shellvariable
|
# Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
|
||||||
dnl - $4 action-if-not-found : nothing
|
# compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
|
||||||
dnl
|
# 10.0.0.8) C compiler.
|
||||||
dnl @category C
|
#
|
||||||
dnl @author Guido Draheim <guidod@gmx.de>
|
# - $1 shell-variable-to-add-to : CFLAGS
|
||||||
dnl @version 2003-01-06
|
# - $2 add-value-if-not-found : nothing
|
||||||
dnl @license GPLWithACException
|
# - $3 action-if-found : add value to shellvariable
|
||||||
|
# - $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
|
||||||
@@ -72,7 +111,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_CXX
|
AC_LANG_CPLUSPLUS
|
||||||
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
|
||||||
@@ -115,4 +154,5 @@ 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.
|
||||||
|
|||||||
@@ -1,27 +1,66 @@
|
|||||||
dnl @synopsis AX_CFLAGS_WARN_ALL_ANSI [(shellvar [,default, [A/NA]])]
|
##### http://autoconf-archive.cryp.to/ax_cflags_warn_all_ansi.html
|
||||||
dnl
|
#
|
||||||
dnl Try to find a compiler option that enables most reasonable
|
# SYNOPSIS
|
||||||
dnl warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
|
#
|
||||||
dnl which is split up into two AX_CFLAGS_WARN_ALL and
|
# AX_CFLAGS_WARN_ALL_ANSI [(shellvar [,default, [A/NA]])]
|
||||||
dnl AX_CFLAGS_WARN_ALL_ANSI
|
#
|
||||||
dnl
|
# DESCRIPTION
|
||||||
dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
|
#
|
||||||
dnl result is added to the shellvar being CFLAGS by default.
|
# Try to find a compiler option that enables most reasonable
|
||||||
dnl
|
# warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
|
||||||
dnl Currently this macro knows about GCC, Solaris C compiler, Digital
|
# which is split up into two AX_CFLAGS_WARN_ALL and
|
||||||
dnl Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
|
# AX_CFLAGS_WARN_ALL_ANSI
|
||||||
dnl compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
|
#
|
||||||
dnl 10.0.0.8) C compiler.
|
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
|
||||||
dnl
|
# result is added to the shellvar being CFLAGS by default.
|
||||||
dnl - $1 shell-variable-to-add-to : CFLAGS
|
#
|
||||||
dnl - $2 add-value-if-not-found : nothing
|
# Currently this macro knows about GCC, Solaris C compiler, Digital
|
||||||
dnl - $3 action-if-found : add value to shellvariable
|
# Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
|
||||||
dnl - $4 action-if-not-found : nothing
|
# compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
|
||||||
dnl
|
# 10.0.0.8) C compiler.
|
||||||
dnl @category C
|
#
|
||||||
dnl @author Guido Draheim <guidod@gmx.de>
|
# - $1 shell-variable-to-add-to : CFLAGS
|
||||||
dnl @version 2003-01-06
|
# - $2 add-value-if-not-found : nothing
|
||||||
dnl @license GPLWithACException
|
# - $3 action-if-found : add value to shellvariable
|
||||||
|
# - $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
|
||||||
@@ -77,7 +116,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_CXX
|
AC_LANG_CPLUSPLUS
|
||||||
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,
|
||||||
|
|||||||
@@ -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)dnl
|
AC_MSG_RESULT($enable_[]Name)
|
||||||
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
|
||||||
|
|||||||
@@ -1,13 +1,52 @@
|
|||||||
dnl @synopsis TYPE_SOCKLEN_T
|
##### http://autoconf-archive.cryp.to/type_socklen_t.html
|
||||||
dnl
|
#
|
||||||
dnl Check whether sys/socket.h defines type socklen_t. Please note that
|
# SYNOPSIS
|
||||||
dnl some systems require sys/types.h to be included before sys/socket.h
|
#
|
||||||
dnl can be compiled.
|
# TYPE_SOCKLEN_T
|
||||||
dnl
|
#
|
||||||
dnl @category Misc
|
# DESCRIPTION
|
||||||
dnl @author Lars Brinkhoff <lars@nocrew.org>
|
#
|
||||||
dnl @version 2005-01-11
|
# Check whether sys/socket.h defines type socklen_t. Please note that
|
||||||
dnl @license GPLWithACException
|
# some systems require sys/types.h to be included before sys/socket.h
|
||||||
|
# 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,
|
||||||
|
|||||||
14
svnignore
Normal file
14
svnignore
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.deps
|
||||||
|
.dirstamp
|
||||||
|
.libs
|
||||||
|
.*.swp
|
||||||
|
*~
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
aclocal.m4
|
||||||
|
autoconfig.h*
|
||||||
|
autom4te.cache
|
||||||
|
config*
|
||||||
|
libtool
|
||||||
|
libupnp.pc
|
||||||
|
stamp-h*
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
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
|
||||||
@@ -21,12 +20,11 @@ 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/iasnprintf.h inc/ithread.h
|
inc/ithread.h
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/*******************************************************************************
|
||||||
//
|
*
|
||||||
// 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
|
||||||
@@ -36,9 +36,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#include <malloc.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@@ -52,7 +49,7 @@ extern "C" {
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
typedef struct FREELISTNODE
|
typedef struct FREELISTNODE
|
||||||
{
|
{
|
||||||
struct FREELISTNODE*next; //pointer to next free node
|
struct FREELISTNODE *next;
|
||||||
} FreeListNode;
|
} FreeListNode;
|
||||||
|
|
||||||
|
|
||||||
@@ -65,12 +62,10 @@ typedef struct FREELISTNODE
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
typedef struct FREELIST
|
typedef struct FREELIST
|
||||||
{
|
{
|
||||||
FreeListNode *head; //head of free list
|
FreeListNode *head;
|
||||||
size_t element_size; //size of elements in free
|
size_t element_size;
|
||||||
//list
|
int maxFreeListLength;
|
||||||
int maxFreeListLength; //max size of free structures
|
int freeListLength;
|
||||||
//to keep
|
|
||||||
int freeListLength; //current size of free list
|
|
||||||
|
|
||||||
}FreeList;
|
}FreeList;
|
||||||
|
|
||||||
@@ -141,4 +136,5 @@ int FreeListDestroy (FreeList *free_list);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // FREE_LIST_H
|
#endif /* FREE_LIST_H */
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/*******************************************************************************
|
||||||
//
|
*
|
||||||
// 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
|
||||||
@@ -70,9 +70,9 @@ typedef int (*cmp_routine)(void *itemA,void *itemB);
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
typedef struct LISTNODE
|
typedef struct LISTNODE
|
||||||
{
|
{
|
||||||
struct LISTNODE *prev; //previous node
|
struct LISTNODE *prev;
|
||||||
struct LISTNODE *next; //next node
|
struct LISTNODE *next;
|
||||||
void *item; //item
|
void *item;
|
||||||
} ListNode;
|
} ListNode;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -96,12 +96,12 @@ 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;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -327,4 +327,5 @@ int ListSize(LinkedList* list);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //LINKED_LIST_H
|
#endif /* LINKED_LIST_H */
|
||||||
|
|
||||||
|
|||||||
@@ -1,52 +1,58 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/*******************************************************************************
|
||||||
//
|
*
|
||||||
// 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
|
||||||
|
|
||||||
|
#ifdef UPNP_USE_MSVCPP
|
||||||
|
#define UPNP_INLINE
|
||||||
|
#else
|
||||||
|
#define UPNP_INLINE inline
|
||||||
|
#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 {SHORT_TERM,PERSISTENT} Duration;
|
||||||
@@ -55,53 +61,48 @@ typedef enum priority {LOW_PRIORITY,
|
|||||||
MED_PRIORITY,
|
MED_PRIORITY,
|
||||||
HIGH_PRIORITY} ThreadPriority;
|
HIGH_PRIORITY} ThreadPriority;
|
||||||
|
|
||||||
#define DEFAULT_PRIORITY MED_PRIORITY //default priority used by TPJobInit
|
#define DEFAULT_PRIORITY MED_PRIORITY /* default priority used by TPJobInit */
|
||||||
#define DEFAULT_MIN_THREADS 1 //default minimum used by TPAttrInit
|
#define DEFAULT_MIN_THREADS 1 /* default minimum used by TPAttrInit */
|
||||||
#define DEFAULT_MAX_THREADS 10 //default max 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_JOBS_PER_THREAD 10 /* default jobs per thread used by TPAttrInit */
|
||||||
#define DEFAULT_STARVATION_TIME 500 //default starvation time 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_IDLE_TIME 10 * 1000 /* default idle time used by TPAttrInit */
|
||||||
#define DEFAULT_FREE_ROUTINE NULL //default free routine used TPJobInit
|
#define DEFAULT_FREE_ROUTINE NULL /* default free routine used TPJobInit */
|
||||||
#define DEFAULT_MAX_JOBS_TOTAL 100 //default max jobs used TPAttrInit
|
#define DEFAULT_MAX_JOBS_TOTAL 100 /* default max jobs used TPAttrInit */
|
||||||
|
|
||||||
#define STATS 1 //always include stats because code change is minimal
|
/* Statistics */
|
||||||
|
/* always include stats because code change is minimal */
|
||||||
|
#define STATS 1
|
||||||
//Statistics
|
|
||||||
#ifdef WIN32 // todo: check why STATSONLY fails during compilation
|
|
||||||
#undef STATS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef STATS
|
|
||||||
#define STATSONLY(x) x
|
|
||||||
#else
|
|
||||||
#define STATSONLY(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//DEBUGGING
|
#include "LinkedList.h"
|
||||||
#ifndef WIN32
|
|
||||||
#ifdef DEBUG
|
#ifdef WIN32
|
||||||
#define DBGONLY(x) x
|
#include <time.h>
|
||||||
#else
|
#include <winsock2.h>
|
||||||
#define DBGONLY(x)
|
struct timezone
|
||||||
#endif
|
{
|
||||||
|
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/time.h> /* for gettimeofday() */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "LinkedList.h"
|
|
||||||
#include <sys/timeb.h>
|
|
||||||
#include "FreeList.h"
|
#include "FreeList.h"
|
||||||
|
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/timeb.h>
|
|
||||||
#define EXPORT
|
#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
|
#define DEFAULT_SCHED_PARAM 0 /* default priority */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: free_routine
|
* Name: free_routine
|
||||||
@@ -120,26 +121,28 @@ typedef void (*free_routine)(void *arg);
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
typedef struct THREADPOOLATTR
|
typedef struct THREADPOOLATTR
|
||||||
{
|
{
|
||||||
int minThreads; // minThreads, ThreadPool will always maintain at least
|
/* minThreads, ThreadPool will always maintain at least this many threads */
|
||||||
// this many threads
|
int minThreads;
|
||||||
|
|
||||||
int maxThreads; // maxThreads, ThreadPool will never have more than this
|
/* maxThreads, ThreadPool will never have more than this number of threads */
|
||||||
// number of threads
|
int maxThreads;
|
||||||
|
|
||||||
int maxIdleTime; // maxIdleTime (in milliseconds)
|
/* maxIdleTime (in milliseconds) this is the maximum time a thread will
|
||||||
// this is the maximum time a thread will remain idle
|
* remain idle before dying */
|
||||||
// before dying
|
int maxIdleTime;
|
||||||
|
|
||||||
int jobsPerThread; // jobs per thread to maintain
|
/* jobs per thread to maintain */
|
||||||
|
int jobsPerThread;
|
||||||
|
|
||||||
int maxJobsTotal; // maximum number of jobs that can be queued totally.
|
/* maximum number of jobs that can be queued totally. */
|
||||||
|
int maxJobsTotal;
|
||||||
|
|
||||||
int starvationTime; // the time a low priority or med priority
|
/* the time a low priority or med priority job waits before getting bumped
|
||||||
// job waits before getting bumped
|
* up a priority (in milliseconds) */
|
||||||
// up a priority (in milliseconds)
|
int starvationTime;
|
||||||
|
|
||||||
PolicyType schedPolicy; // scheduling policy to use
|
|
||||||
|
|
||||||
|
/* scheduling policy to use */
|
||||||
|
PolicyType schedPolicy;
|
||||||
} ThreadPoolAttr;
|
} ThreadPoolAttr;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -150,12 +153,12 @@ typedef struct THREADPOOLATTR
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
typedef struct THREADPOOLJOB
|
typedef struct THREADPOOLJOB
|
||||||
{
|
{
|
||||||
start_routine func; //function
|
start_routine func;
|
||||||
void *arg; //arg
|
void *arg;
|
||||||
free_routine free_func; //free function
|
free_routine free_func;
|
||||||
struct timeb requestTime; //time of request
|
struct timeval requestTime;
|
||||||
int priority; //priority of request
|
int priority;
|
||||||
int jobId; //id
|
int jobId;
|
||||||
} ThreadPoolJob;
|
} ThreadPoolJob;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -165,32 +168,28 @@ typedef struct THREADPOOLJOB
|
|||||||
* Structure to hold statistics
|
* Structure to hold statistics
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
STATSONLY(
|
|
||||||
|
|
||||||
typedef struct TPOOLSTATS
|
typedef struct TPOOLSTATS
|
||||||
{
|
{
|
||||||
double totalTimeHQ; //total time spent by all jobs in high priority Q
|
double totalTimeHQ;
|
||||||
int totalJobsHQ; //total jobs in HQ run so far
|
int totalJobsHQ;
|
||||||
double avgWaitHQ; //average wait in HQ
|
double avgWaitHQ;
|
||||||
double totalTimeMQ; //total time spent by all jobs in med priority Q
|
double totalTimeMQ;
|
||||||
int totalJobsMQ; //total jobs in MQ run so far
|
int totalJobsMQ;
|
||||||
double avgWaitMQ; //average wait in MQ
|
double avgWaitMQ;
|
||||||
double totalTimeLQ; //total time spent by all jobs in low priority Q
|
double totalTimeLQ;
|
||||||
int totalJobsLQ; //total jobs in LQ run so far
|
int totalJobsLQ;
|
||||||
double avgWaitLQ; //average wait in LQ
|
double avgWaitLQ;
|
||||||
double totalWorkTime; //total time spent working for all threads
|
double totalWorkTime;
|
||||||
double totalIdleTime; //total time spent idle for all threads
|
double totalIdleTime;
|
||||||
int workerThreads; //number of current workerThreads
|
int workerThreads;
|
||||||
int idleThreads; //number of current idle threads
|
int idleThreads;
|
||||||
int persistentThreads; //number of persistent threads
|
int persistentThreads;
|
||||||
int totalThreads; //total number of current threads
|
int totalThreads;
|
||||||
int maxThreads; //max threads so far
|
int maxThreads;
|
||||||
int currentJobsHQ; // current jobs in Q
|
int currentJobsHQ;
|
||||||
int currentJobsLQ; //current jobs in Q
|
int currentJobsLQ;
|
||||||
int currentJobsMQ; //current jobs in Q
|
int currentJobsMQ;
|
||||||
}ThreadPoolStats;
|
} ThreadPoolStats;
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -215,25 +214,24 @@ typedef struct TPOOLSTATS
|
|||||||
|
|
||||||
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
|
ithread_cond_t start_and_shutdown; /* condition variable for start
|
||||||
//and stop
|
and stop */
|
||||||
int lastJobId; //ids for jobs
|
int lastJobId; /* ids for jobs */
|
||||||
int shutdown; //whether or not we are shutting down
|
int shutdown; /* whether or not we are shutting down */
|
||||||
int totalThreads; //total number of threads
|
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
|
|
||||||
STATSONLY(ThreadPoolStats stats;)
|
|
||||||
|
|
||||||
|
/* statistics */
|
||||||
|
ThreadPoolStats stats;
|
||||||
} ThreadPool;
|
} ThreadPool;
|
||||||
|
|
||||||
|
|
||||||
@@ -274,8 +272,7 @@ 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,
|
int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr);
|
||||||
ThreadPoolAttr *attr);
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolAddPersistent
|
* Function: ThreadPoolAddPersistent
|
||||||
@@ -297,9 +294,7 @@ int ThreadPoolInit(ThreadPool *tp,
|
|||||||
* 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,
|
int ThreadPoolAddPersistent(ThreadPool*tp, ThreadPoolJob *job, int *jobId);
|
||||||
ThreadPoolJob *job,
|
|
||||||
int *jobId);
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolGetAttr
|
* Function: ThreadPoolGetAttr
|
||||||
@@ -314,8 +309,7 @@ int ThreadPoolAddPersistent (ThreadPool*tp,
|
|||||||
* 0 on success, nonzero on failure
|
* 0 on success, nonzero on failure
|
||||||
* Always returns 0.
|
* Always returns 0.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
int ThreadPoolGetAttr(ThreadPool *tp,
|
int ThreadPoolGetAttr(ThreadPool *tp, ThreadPoolAttr *out);
|
||||||
ThreadPoolAttr *out);
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolSetAttr
|
* Function: ThreadPoolSetAttr
|
||||||
*
|
*
|
||||||
@@ -329,8 +323,7 @@ int ThreadPoolGetAttr(ThreadPool *tp,
|
|||||||
* 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,
|
int ThreadPoolSetAttr(ThreadPool *tp, ThreadPoolAttr *attr);
|
||||||
ThreadPoolAttr *attr);
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolAdd
|
* Function: ThreadPoolAdd
|
||||||
@@ -349,9 +342,7 @@ int ThreadPoolSetAttr(ThreadPool *tp,
|
|||||||
* 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,
|
int ThreadPoolAdd (ThreadPool*tp, ThreadPoolJob *job, int *jobId);
|
||||||
ThreadPoolJob *job,
|
|
||||||
int *jobId);
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolRemove
|
* Function: ThreadPoolRemove
|
||||||
@@ -368,8 +359,7 @@ int ThreadPoolAdd (ThreadPool*tp,
|
|||||||
* 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 ThreadPoolRemove(ThreadPool *tp, int jobId, ThreadPoolJob *out);
|
||||||
int jobId, ThreadPoolJob *out);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -432,7 +422,6 @@ int TPJobSetPriority(ThreadPoolJob *job, ThreadPriority priority);
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
int TPJobSetFreeFunction(ThreadPoolJob *job, free_routine func);
|
int TPJobSetFreeFunction(ThreadPoolJob *job, free_routine func);
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: TPAttrInit
|
* Function: TPAttrInit
|
||||||
*
|
*
|
||||||
@@ -550,12 +539,19 @@ int TPAttrSetMaxJobsTotal(ThreadPoolAttr *attr, int maxJobsTotal);
|
|||||||
* Returns:
|
* Returns:
|
||||||
* Always returns 0.
|
* Always returns 0.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
STATSONLY( EXPORT int ThreadPoolGetStats(ThreadPool *tp, ThreadPoolStats *stats););
|
#ifdef STATS
|
||||||
|
EXPORT int ThreadPoolGetStats(ThreadPool *tp, ThreadPoolStats *stats);
|
||||||
|
|
||||||
STATSONLY(EXPORT void ThreadPoolPrintStats(ThreadPoolStats *stats););
|
EXPORT void ThreadPoolPrintStats(ThreadPoolStats *stats);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE int ThreadPoolGetStats(ThreadPool *tp, ThreadPoolStats *stats) {}
|
||||||
|
|
||||||
|
static UPNP_INLINE void ThreadPoolPrintStats(ThreadPoolStats *stats) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //ThreadPool
|
#endif /* ThreadPool */
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/*******************************************************************************
|
||||||
//
|
*
|
||||||
// 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
|
||||||
@@ -43,9 +43,9 @@ extern "C" {
|
|||||||
|
|
||||||
#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;
|
||||||
|
|
||||||
|
|
||||||
@@ -63,13 +63,13 @@ typedef enum timeoutType {ABS_SEC,REL_SEC} TimeoutType;
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
typedef struct TIMERTHREAD
|
typedef struct TIMERTHREAD
|
||||||
{
|
{
|
||||||
ithread_mutex_t mutex; //mutex to protect eventQ
|
ithread_mutex_t mutex;
|
||||||
ithread_cond_t condition; //condition variable
|
ithread_cond_t condition;
|
||||||
int lastEventId; //last event id
|
int lastEventId;
|
||||||
LinkedList eventQ; //event q
|
LinkedList eventQ;
|
||||||
int shutdown; //whether or not we are shutdown
|
int shutdown;
|
||||||
FreeList freeEvents; //FreeList for events
|
FreeList freeEvents;
|
||||||
ThreadPool *tp; //ThreadPool to use
|
ThreadPool *tp;
|
||||||
} TimerThread;
|
} TimerThread;
|
||||||
|
|
||||||
|
|
||||||
@@ -85,9 +85,9 @@ typedef struct TIMERTHREAD
|
|||||||
typedef struct TIMEREVENT
|
typedef struct TIMEREVENT
|
||||||
{
|
{
|
||||||
ThreadPoolJob job;
|
ThreadPoolJob job;
|
||||||
time_t eventTime; //absolute time for event in seconds since Jan 1, 1970
|
time_t eventTime; /* absolute time for event in seconds since Jan 1, 1970 */
|
||||||
Duration persistent; //long term or short term job
|
Duration persistent; /* long term or short term job */
|
||||||
int id; //id of job
|
int id;
|
||||||
} TimerEvent;
|
} TimerEvent;
|
||||||
|
|
||||||
|
|
||||||
@@ -188,4 +188,5 @@ int TimerThreadShutdown(TimerThread *timer);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //TIMER_THREAD_H
|
#endif /* TIMER_THREAD_H */
|
||||||
|
|
||||||
|
|||||||
@@ -1,66 +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 <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
|
|
||||||
@@ -1,33 +1,33 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/*******************************************************************************
|
||||||
//
|
*
|
||||||
// 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 ITHREADH
|
#ifndef ITHREADH
|
||||||
#define ITHREADH
|
#define ITHREADH
|
||||||
@@ -36,34 +36,37 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
#define DEBUG_ONLY(x) x
|
|
||||||
#else
|
|
||||||
#define DEBUG_ONLY(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PTHREAD_MUTEX_RECURSIVE
|
#ifdef PTHREAD_MUTEX_RECURSIVE
|
||||||
/* This system has SuS2-compliant mutex attributes.
|
/* This system has SuS2-compliant mutex attributes.
|
||||||
* E.g. on Cygwin, where we don't have the old nonportable (NP) symbols
|
* 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_FAST_NP PTHREAD_MUTEX_NORMAL
|
||||||
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
||||||
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
|
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
|
||||||
#else
|
#else /* PTHREAD_MUTEX_RECURSIVE */
|
||||||
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
|
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
|
||||||
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
|
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
|
||||||
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
|
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
|
||||||
#endif
|
#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
|
* Name: ithread_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -71,9 +74,9 @@ extern "C" {
|
|||||||
* typedef to pthread_t.
|
* typedef to pthread_t.
|
||||||
* Internal Use Only.
|
* Internal Use Only.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_t ithread_t;
|
typedef pthread_t ithread_t;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_attr_t
|
* Name: ithread_attr_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -81,20 +84,20 @@ extern "C" {
|
|||||||
* typedef to pthread_attr_t
|
* typedef to pthread_attr_t
|
||||||
* Internal Use Only
|
* Internal Use Only
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_attr_t ithread_attr_t;
|
typedef pthread_attr_t ithread_attr_t;
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: start_routine
|
* Name: start_routine
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Thread start routine
|
* Thread start routine
|
||||||
* Internal Use Only.
|
* Internal Use Only.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef void * (*start_routine) (void *arg);
|
typedef void * (*start_routine) (void *arg);
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_cond_t
|
* Name: ithread_cond_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -102,10 +105,10 @@ extern "C" {
|
|||||||
* typedef to pthread_cond_t
|
* typedef to pthread_cond_t
|
||||||
* Internal Use Only.
|
* Internal Use Only.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_cond_t ithread_cond_t;
|
typedef pthread_cond_t ithread_cond_t;
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_mutexattr_t
|
* Name: ithread_mutexattr_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -113,10 +116,10 @@ extern "C" {
|
|||||||
* typedef to pthread_mutexattr_t
|
* typedef to pthread_mutexattr_t
|
||||||
* Internal Use Only
|
* Internal Use Only
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_mutexattr_t ithread_mutexattr_t;
|
typedef pthread_mutexattr_t ithread_mutexattr_t;
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_mutex_t
|
* Name: ithread_mutex_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -124,10 +127,10 @@ extern "C" {
|
|||||||
* typedef to pthread_mutex_t
|
* typedef to pthread_mutex_t
|
||||||
* Internal Use Only.
|
* Internal Use Only.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_mutex_t ithread_mutex_t;
|
typedef pthread_mutex_t ithread_mutex_t;
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_condattr_t
|
* Name: ithread_condattr_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -136,9 +139,31 @@ extern "C" {
|
|||||||
* NOT USED
|
* NOT USED
|
||||||
* Internal Use Only
|
* Internal Use Only
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_condattr_t ithread_condattr_t;
|
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_mutexattr_init
|
* Function: ithread_mutexattr_init
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -152,10 +177,10 @@ extern "C" {
|
|||||||
* Always returns 0.
|
* Always returns 0.
|
||||||
* See man page for pthread_mutexattr_init
|
* 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:
|
||||||
@@ -182,7 +207,7 @@ extern "C" {
|
|||||||
* ITHREAD_MUTEX_ERRORCHECK_NP
|
* ITHREAD_MUTEX_ERRORCHECK_NP
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* ithread_mutexattr_t * mutex (must be valid non NULL pointer to
|
* ithread_mutexattr_t * attr (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)
|
||||||
@@ -192,9 +217,9 @@ extern "C" {
|
|||||||
* See man page for pthread_mutexattr_setkind_np
|
* See man page for pthread_mutexattr_setkind_np
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#ifdef PTHREAD_MUTEX_RECURSIVE
|
#ifdef PTHREAD_MUTEX_RECURSIVE
|
||||||
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
|
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
|
||||||
#else
|
#else
|
||||||
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
|
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -207,7 +232,7 @@ extern "C" {
|
|||||||
* ITHREAD_MUTEX_ERRORCHECK_NP
|
* ITHREAD_MUTEX_ERRORCHECK_NP
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* ithread_mutexattr_t * mutex (must be valid non NULL pointer to
|
* ithread_mutexattr_t * attr (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)
|
||||||
@@ -217,9 +242,9 @@ extern "C" {
|
|||||||
* See man page for pthread_mutexattr_getkind_np
|
* See man page for pthread_mutexattr_getkind_np
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#ifdef PTHREAD_MUTEX_RECURSIVE
|
#ifdef PTHREAD_MUTEX_RECURSIVE
|
||||||
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
|
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
|
||||||
#else
|
#else
|
||||||
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
|
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -240,6 +265,7 @@ extern "C" {
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#define ithread_mutex_init pthread_mutex_init
|
#define ithread_mutex_init pthread_mutex_init
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ithread_mutex_lock
|
* Function: ithread_mutex_lock
|
||||||
*
|
*
|
||||||
@@ -294,6 +320,169 @@ extern "C" {
|
|||||||
#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
|
||||||
*
|
*
|
||||||
@@ -526,7 +715,11 @@ extern "C" {
|
|||||||
* 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)
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
#ifndef WIN32
|
||||||
#define isleep sleep
|
#define isleep sleep
|
||||||
|
#else
|
||||||
|
#define isleep(x) Sleep((x)*1000)
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: isleep
|
* Function: isleep
|
||||||
@@ -541,12 +734,16 @@ extern "C" {
|
|||||||
* 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)
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
#ifndef WIN32
|
||||||
#define imillisleep(x) usleep(1000*x)
|
#define imillisleep(x) usleep(1000*x)
|
||||||
|
#else
|
||||||
|
#define imillisleep Sleep
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifndef UPNP_STATIC_LIB
|
#ifndef UPNP_STATIC_LIB
|
||||||
#ifdef LIBUPNP_EXPORTS
|
#ifdef LIBUPNP_EXPORTS
|
||||||
// set up declspec for dll export to make functions visible to library users
|
/* set up declspec for dll export to make functions visible to library users */
|
||||||
#define EXPORT_SPEC __declspec(dllexport)
|
#define EXPORT_SPEC __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define EXPORT_SPEC __declspec(dllimport)
|
#define EXPORT_SPEC __declspec(dllimport)
|
||||||
@@ -560,7 +757,7 @@ extern "C" {
|
|||||||
|
|
||||||
|
|
||||||
#ifndef PTHREAD_MUTEX_RECURSIVE
|
#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
|
#endif
|
||||||
|
|
||||||
@@ -568,4 +765,5 @@ EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //ITHREADH
|
#endif /* ITHREADH */
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,13 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "LinkedList.h"
|
#include "LinkedList.h"
|
||||||
#ifdef __FreeBSD__
|
#ifndef WIN32
|
||||||
#include <stdlib.h>
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__) || defined(__APPLE__)
|
||||||
|
#include <stdlib.h>
|
||||||
#else
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
@@ -531,3 +534,4 @@ ListSize( LinkedList * list )
|
|||||||
|
|
||||||
return list->size;
|
return list->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,152 +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 <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;
|
|
||||||
}
|
|
||||||
148
upnp/Makefile.am
148
upnp/Makefile.am
@@ -1,69 +1,89 @@
|
|||||||
# $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<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
|
|
||||||
SUBDIRS = doc
|
SUBDIRS = doc . sample
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(srcdir)/inc \
|
AM_CPPFLAGS = \
|
||||||
|
-I$(srcdir)/inc \
|
||||||
-I$(top_srcdir)/threadutil/inc \
|
-I$(top_srcdir)/threadutil/inc \
|
||||||
-I$(top_srcdir)/ixml/inc
|
-I$(top_srcdir)/ixml/inc
|
||||||
|
|
||||||
AM_CFLAGS = $(PTHREAD_CFLAGS)
|
LDADD = \
|
||||||
|
libupnp.la \
|
||||||
AM_LDFLAGS = $(PTHREAD_LIBS)
|
|
||||||
|
|
||||||
LDADD = libupnp.la \
|
|
||||||
$(top_builddir)/threadutil/libthreadutil.la \
|
$(top_builddir)/threadutil/libthreadutil.la \
|
||||||
$(top_builddir)/ixml/libixml.la
|
$(top_builddir)/ixml/libixml.la
|
||||||
|
|
||||||
|
|
||||||
upnpincludedir = $(includedir)/upnp
|
upnpincludedir = $(includedir)/upnp
|
||||||
upnpinclude_HEADERS = inc/upnp.h
|
upnpinclude_HEADERS = \
|
||||||
|
inc/upnp.h \
|
||||||
|
inc/upnpdebug.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
|
endif
|
||||||
if ENABLE_DEBUG
|
|
||||||
upnpinclude_HEADERS += inc/upnpdebug.h
|
|
||||||
endif
|
|
||||||
|
|
||||||
lib_LTLIBRARIES = libupnp.la
|
lib_LTLIBRARIES = libupnp.la
|
||||||
|
|
||||||
libupnp_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/src/inc
|
libupnp_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/src/inc
|
||||||
libupnp_la_LDFLAGS = -version-info $(LT_VERSION_UPNP) \
|
|
||||||
|
libupnp_la_LDFLAGS = \
|
||||||
|
-version-info $(LT_VERSION_UPNP) \
|
||||||
-export-symbols-regex '^Upnp.*' \
|
-export-symbols-regex '^Upnp.*' \
|
||||||
$(top_builddir)/threadutil/libthreadutil.la \
|
$(top_builddir)/threadutil/libthreadutil.la \
|
||||||
$(top_builddir)/ixml/libixml.la
|
$(top_builddir)/ixml/libixml.la
|
||||||
|
|
||||||
libupnp_la_SOURCES = \
|
libupnp_la_SOURCES = \
|
||||||
src/inc/config.h \
|
src/inc/config.h \
|
||||||
src/inc/client_table.h src/inc/global.h \
|
src/inc/client_table.h \
|
||||||
src/inc/md5.h src/inc/ssdplib.h \
|
src/inc/gena.h \
|
||||||
src/inc/unixutil.h src/inc/urlconfig.h \
|
src/inc/gena_ctrlpt.h \
|
||||||
src/inc/gmtdate.h src/inc/membuffer.h \
|
src/inc/gena_device.h \
|
||||||
src/inc/server.h src/inc/statcodes.h \
|
src/inc/global.h \
|
||||||
src/inc/upnpapi.h src/inc/utilall.h \
|
src/inc/gmtdate.h \
|
||||||
src/inc/gena_ctrlpt.h src/inc/http_client.h \
|
src/inc/http_client.h \
|
||||||
src/inc/miniserver.h src/inc/service_table.h \
|
src/inc/httpparser.h \
|
||||||
src/inc/statuscodes.h src/inc/upnpclosesocket.h \
|
src/inc/httpreadwrite.h \
|
||||||
src/inc/util.h src/inc/gena_device.h \
|
src/inc/md5.h \
|
||||||
src/inc/httpparser.h src/inc/netall.h \
|
src/inc/membuffer.h \
|
||||||
src/inc/soaplib.h src/inc/strintmap.h \
|
src/inc/miniserver.h \
|
||||||
src/inc/upnp_timeout.h src/inc/uuid.h \
|
src/inc/netall.h \
|
||||||
src/inc/gena.h src/inc/httpreadwrite.h \
|
src/inc/parsetools.h \
|
||||||
src/inc/parsetools.h src/inc/sock.h \
|
src/inc/server.h \
|
||||||
src/inc/sysdep.h src/inc/uri.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/webserver.h
|
src/inc/webserver.h
|
||||||
|
|
||||||
# ssdp
|
# ssdp
|
||||||
libupnp_la_SOURCES += src/ssdp/ssdp_device.c src/ssdp/ssdp_ctrlpt.c \
|
libupnp_la_SOURCES += \
|
||||||
|
src/ssdp/ssdp_device.c \
|
||||||
|
src/ssdp/ssdp_ctrlpt.c \
|
||||||
src/ssdp/ssdp_server.c
|
src/ssdp/ssdp_server.c
|
||||||
|
|
||||||
# soap
|
# soap
|
||||||
libupnp_la_SOURCES += src/soap/soap_device.c src/soap/soap_ctrlpt.c \
|
libupnp_la_SOURCES += \
|
||||||
|
src/soap/soap_device.c \
|
||||||
|
src/soap/soap_ctrlpt.c \
|
||||||
src/soap/soap_common.c
|
src/soap/soap_common.c
|
||||||
|
|
||||||
# genlib
|
# genlib
|
||||||
@@ -84,80 +104,46 @@ libupnp_la_SOURCES += \
|
|||||||
src/genlib/net/uri/uri.c
|
src/genlib/net/uri/uri.c
|
||||||
|
|
||||||
# gena
|
# gena
|
||||||
libupnp_la_SOURCES += src/gena/gena_device.c src/gena/gena_ctrlpt.c \
|
libupnp_la_SOURCES += \
|
||||||
|
src/gena/gena_device.c \
|
||||||
|
src/gena/gena_ctrlpt.c \
|
||||||
src/gena/gena_callback2.c
|
src/gena/gena_callback2.c
|
||||||
|
|
||||||
# api
|
# api
|
||||||
libupnp_la_SOURCES += src/api/upnpapi.c
|
libupnp_la_SOURCES += 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 += src/uuid/md5.c src/uuid/sysdep.c src/uuid/uuid.c
|
libupnp_la_SOURCES += \
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
# samples
|
|
||||||
noinst_PROGRAMS =
|
|
||||||
if ENABLE_SAMPLES
|
|
||||||
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 = LICENSE \
|
EXTRA_DIST = \
|
||||||
sample/tvdevice/web/tvcontrolSCPD.xml \
|
LICENSE \
|
||||||
sample/tvdevice/web/tvdevicedesc.xml \
|
|
||||||
sample/tvdevice/web/tvdevicepres.html \
|
|
||||||
sample/tvdevice/web/tvpictureSCPD.xml \
|
|
||||||
src/inc/inet_pton.h \
|
src/inc/inet_pton.h \
|
||||||
src/inet_pton.c \
|
src/inet_pton.c \
|
||||||
src/win_dll.c
|
src/win_dll.c
|
||||||
|
|
||||||
|
|
||||||
|
CLEANFILES = \
|
||||||
CLEANFILES = IUpnpErrFile.txt IUpnpInfoFile.txt
|
IUpnpErrFile.txt \
|
||||||
|
IUpnpInfoFile.txt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
404
upnp/inc/upnp.h
404
upnp/inc/upnp.h
@@ -1,40 +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 UPNP_H
|
#ifndef UPNP_H
|
||||||
#define UPNP_H
|
#define UPNP_H
|
||||||
|
|
||||||
/** @name The API */
|
/** @name The API */
|
||||||
|
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
|
|
||||||
#if defined MYLIB_LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 != 64
|
#if defined MYLIB_LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 != 64
|
||||||
#if defined __GNUC__
|
#if defined __GNUC__
|
||||||
@@ -44,20 +45,22 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef __FreeBSD__
|
#ifndef WIN32
|
||||||
#include <time.h>
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
#if (defined(BSD) && BSD >= 199306)
|
||||||
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
#include "ixml.h"
|
#include "ixml.h"
|
||||||
#include "upnpconfig.h"
|
#include "upnpconfig.h"
|
||||||
#if UPNP_HAVE_DEBUG
|
|
||||||
# include "upnpdebug.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifndef UPNP_STATIC_LIB
|
#ifndef UPNP_STATIC_LIB
|
||||||
#ifdef LIBUPNP_EXPORTS
|
#ifdef LIBUPNP_EXPORTS
|
||||||
// set up declspec for dll export to make functions visible to library users
|
/* set up declspec for dll export to make functions visible to library users */
|
||||||
#define EXPORT_SPEC __declspec(dllexport)
|
#define EXPORT_SPEC __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define EXPORT_SPEC __declspec(dllimport)
|
#define EXPORT_SPEC __declspec(dllimport)
|
||||||
@@ -65,28 +68,47 @@
|
|||||||
#else
|
#else
|
||||||
#define EXPORT_SPEC
|
#define EXPORT_SPEC
|
||||||
#endif
|
#endif
|
||||||
#ifdef UPNP_USE_MSVCPP // define some things the M$ VC++ doesn't knows
|
#ifdef UPNP_USE_MSVCPP
|
||||||
|
/* define some things the M$ VC++ doesn't know */
|
||||||
|
#define UPNP_INLINE
|
||||||
typedef __int64 int64_t;
|
typedef __int64 int64_t;
|
||||||
|
#define PRId64 "I64d"
|
||||||
|
#define PRIzu "lu"
|
||||||
#endif
|
#endif
|
||||||
#ifdef UPNP_USE_BCBPP // define some things Borland Builder doesn't knows
|
#ifdef UPNP_USE_BCBPP
|
||||||
|
/* define some things Borland Builder doesn't know */
|
||||||
|
#define UPNP_INLINE inline
|
||||||
typedef __int64 int64_t;
|
typedef __int64 int64_t;
|
||||||
|
#warning The Borland C compiler is probably broken on PRId64, please someone provide a proper fix here
|
||||||
|
#define PRId64 "I64d"
|
||||||
|
#define PRIzu "zu"
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#define EXPORT_SPEC
|
#define EXPORT_SPEC
|
||||||
|
#define UPNP_INLINE inline
|
||||||
|
/* Invented this macro so that we can live a little longer with MSVC lack of C99. */
|
||||||
|
#define PRIzu "zu"
|
||||||
#endif
|
#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*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#define UpnpCloseSocket close
|
#define UpnpCloseSocket close
|
||||||
#else
|
#else
|
||||||
#define UpnpCloseSocket closesocket
|
#define UpnpCloseSocket closesocket
|
||||||
#define fseeko fseek
|
#define fseeko fseek
|
||||||
#endif
|
#endif
|
||||||
#define UPNP_SOCKETERROR -1
|
|
||||||
#define UPNP_INVALID_SOCKET -1
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#define SOCKET int
|
#define SOCKET int
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#else
|
#else
|
||||||
@@ -94,8 +116,10 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
||||||
#define NUM_HANDLE 200
|
#define NUM_HANDLE 200
|
||||||
#define LINE_SIZE 180
|
#define LINE_SIZE 180
|
||||||
#define NAME_SIZE 256
|
#define NAME_SIZE 256
|
||||||
@@ -104,7 +128,6 @@
|
|||||||
#define SERL_NUMR_SIZE 64
|
#define SERL_NUMR_SIZE 64
|
||||||
#define MODL_DESC_SIZE 64
|
#define MODL_DESC_SIZE 64
|
||||||
#define UPNP_INFINITE -1
|
#define UPNP_INFINITE -1
|
||||||
|
|
||||||
#define UPNP_USING_CHUNKED -3
|
#define UPNP_USING_CHUNKED -3
|
||||||
#define UPNP_UNTIL_CLOSE -4
|
#define UPNP_UNTIL_CLOSE -4
|
||||||
|
|
||||||
@@ -116,7 +139,7 @@
|
|||||||
* code means. Refer to the documentation for each function for a
|
* code means. Refer to the documentation for each function for a
|
||||||
* description of what an error code means in that context.
|
* description of what an error code means in that context.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** @name UPNP_E_SUCCESS [0]
|
/** @name UPNP_E_SUCCESS [0]
|
||||||
* {\tt UPNP_E_SUCCESS} signifies that the operation completed successfully.
|
* {\tt UPNP_E_SUCCESS} signifies that the operation completed successfully.
|
||||||
@@ -124,35 +147,35 @@
|
|||||||
* the operation was successfully transmitted on the network. The result of
|
* the operation was successfully transmitted on the network. The result of
|
||||||
* the entire operation comes as part of the callback for that operation.
|
* the entire operation comes as part of the callback for that operation.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_SUCCESS 0
|
#define UPNP_E_SUCCESS 0
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_INVALID_HANDLE [-100]
|
/** @name UPNP_E_INVALID_HANDLE [-100]
|
||||||
* {\tt UPNP_E_INVALID_HANDLE} signifies that the handle passed to a
|
* {\tt UPNP_E_INVALID_HANDLE} signifies that the handle passed to a
|
||||||
* function is not a recognized as a valid handle.
|
* function is not a recognized as a valid handle.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INVALID_HANDLE -100
|
#define UPNP_E_INVALID_HANDLE -100
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_INVALID_PARAM [-101]
|
/** @name UPNP_E_INVALID_PARAM [-101]
|
||||||
* {\tt UPNP_E_INVALID_PARAM} signifies that one or more of the parameters
|
* {\tt UPNP_E_INVALID_PARAM} signifies that one or more of the parameters
|
||||||
* passed to the function is not valid. Refer to the documentation for each
|
* passed to the function is not valid. Refer to the documentation for each
|
||||||
* function for more information on the valid ranges of the parameters.
|
* function for more information on the valid ranges of the parameters.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INVALID_PARAM -101
|
#define UPNP_E_INVALID_PARAM -101
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_OUTOF_HANDLE [-102]
|
/** @name UPNP_E_OUTOF_HANDLE [-102]
|
||||||
* {\tt UPNP_E_OUTOF_HANDLE} signifies that the SDK does not have any
|
* {\tt UPNP_E_OUTOF_HANDLE} signifies that the SDK does not have any
|
||||||
* more space for additional handles. The SDK allocates space for only
|
* more space for additional handles. The SDK allocates space for only
|
||||||
* a few handles in order to conserve memory.
|
* a few handles in order to conserve memory.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_OUTOF_HANDLE -102
|
#define UPNP_E_OUTOF_HANDLE -102
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
#define UPNP_E_OUTOF_CONTEXT -103
|
#define UPNP_E_OUTOF_CONTEXT -103
|
||||||
|
|
||||||
@@ -161,9 +184,9 @@
|
|||||||
* currently available to complete the operation. Most operations require
|
* currently available to complete the operation. Most operations require
|
||||||
* some free memory in order to complete their work.
|
* some free memory in order to complete their work.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_OUTOF_MEMORY -104
|
#define UPNP_E_OUTOF_MEMORY -104
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_INIT [-105]
|
/** @name UPNP_E_INIT [-105]
|
||||||
* {\tt UPNP_E_INIT} signifies that the SDK has already been
|
* {\tt UPNP_E_INIT} signifies that the SDK has already been
|
||||||
@@ -171,9 +194,9 @@
|
|||||||
* Any additional initialization attempts simply return this error with
|
* Any additional initialization attempts simply return this error with
|
||||||
* no other ill effects.
|
* no other ill effects.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INIT -105
|
#define UPNP_E_INIT -105
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
#define UPNP_E_BUFFER_TOO_SMALL -106
|
#define UPNP_E_BUFFER_TOO_SMALL -106
|
||||||
|
|
||||||
@@ -182,9 +205,9 @@
|
|||||||
* to {\bf UpnpRegisterRootDevice} or {\bf UpnpRegisterRootDevice2} is an
|
* to {\bf UpnpRegisterRootDevice} or {\bf UpnpRegisterRootDevice2} is an
|
||||||
* invalid description document.
|
* invalid description document.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INVALID_DESC -107
|
#define UPNP_E_INVALID_DESC -107
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_INVALID_URL [-108]
|
/** @name UPNP_E_INVALID_URL [-108]
|
||||||
* {\tt UPNP_E_INVALID_URL} signifies that a URL passed into the function
|
* {\tt UPNP_E_INVALID_URL} signifies that a URL passed into the function
|
||||||
@@ -192,9 +215,9 @@
|
|||||||
* URL itself might be malformed (e.g. have invalid characters in it) or
|
* URL itself might be malformed (e.g. have invalid characters in it) or
|
||||||
* the host might be unreachable.
|
* the host might be unreachable.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INVALID_URL -108
|
#define UPNP_E_INVALID_URL -108
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
#define UPNP_E_INVALID_SID -109
|
#define UPNP_E_INVALID_SID -109
|
||||||
#define UPNP_E_INVALID_DEVICE -110
|
#define UPNP_E_INVALID_DEVICE -110
|
||||||
@@ -205,18 +228,18 @@
|
|||||||
* {\bf UpnpAcceptSubscriptionExt} to signify that the device ID/service
|
* {\bf UpnpAcceptSubscriptionExt} to signify that the device ID/service
|
||||||
* ID pair does not refer to a valid service.
|
* ID pair does not refer to a valid service.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INVALID_SERVICE -111
|
#define UPNP_E_INVALID_SERVICE -111
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_BAD_RESPONSE [-113]
|
/** @name UPNP_E_BAD_RESPONSE [-113]
|
||||||
* {\tt UPNP_E_BAD_RESPONSE} signifies that the response received from the
|
* {\tt UPNP_E_BAD_RESPONSE} signifies that the response received from the
|
||||||
* remote side of a connection is not correct for the protocol. This applies
|
* remote side of a connection is not correct for the protocol. This applies
|
||||||
* to the GENA, SOAP, and HTTP protocols.
|
* to the GENA, SOAP, and HTTP protocols.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_BAD_RESPONSE -113
|
#define UPNP_E_BAD_RESPONSE -113
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
#define UPNP_E_BAD_REQUEST -114
|
#define UPNP_E_BAD_REQUEST -114
|
||||||
|
|
||||||
@@ -225,26 +248,26 @@
|
|||||||
* invalid. This can be because the DOM document passed to the function was
|
* invalid. This can be because the DOM document passed to the function was
|
||||||
* malformed or the action message is not correct for the given action.
|
* malformed or the action message is not correct for the given action.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INVALID_ACTION -115
|
#define UPNP_E_INVALID_ACTION -115
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_FINISH [-116]
|
/** @name UPNP_E_FINISH [-116]
|
||||||
* {\tt UPNP_E_FINISH} signifies that {\bf UpnpInit} has not been called, or
|
* {\tt UPNP_E_FINISH} signifies that {\bf UpnpInit} has not been called, or
|
||||||
* that {\bf UpnpFinish} has already been called. None of the API functions
|
* that {\bf UpnpFinish} has already been called. None of the API functions
|
||||||
* operate until {\bf UpnpInit} successfully completes.
|
* operate until {\bf UpnpInit} successfully completes.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_FINISH -116
|
#define UPNP_E_FINISH -116
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_INIT_FAILED [-117]
|
/** @name UPNP_E_INIT_FAILED [-117]
|
||||||
* {\tt UPNP_E_INIT_FAILED} signifies that {\bf UpnpInit} cannot complete.
|
* {\tt UPNP_E_INIT_FAILED} signifies that {\bf UpnpInit} cannot complete.
|
||||||
* The typical reason is failure to allocate sufficient resources.
|
* The typical reason is failure to allocate sufficient resources.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INIT_FAILED -117
|
#define UPNP_E_INIT_FAILED -117
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_URL_TOO_BIG [-118]
|
/** @name UPNP_E_URL_TOO_BIG [-118]
|
||||||
* {\tt UPNP_E_URL_TOO_BIG} signifies that the URL passed into a function
|
* {\tt UPNP_E_URL_TOO_BIG} signifies that the URL passed into a function
|
||||||
@@ -260,18 +283,18 @@
|
|||||||
* message (e.g. {\bf UpnpSubscribe}), GENA event notifications (e.g. {\bf
|
* message (e.g. {\bf UpnpSubscribe}), GENA event notifications (e.g. {\bf
|
||||||
* UpnpNotify}), and HTTP transfers (e.g. {\bf UpnpDownloadXmlDoc}).
|
* UpnpNotify}), and HTTP transfers (e.g. {\bf UpnpDownloadXmlDoc}).
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_BAD_HTTPMSG -119
|
#define UPNP_E_BAD_HTTPMSG -119
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_ALREADY_REGISTERED [-120]
|
/** @name UPNP_E_ALREADY_REGISTERED [-120]
|
||||||
* {\tt UPNP_E_ALREADY_REGISTERED} signifies that a client or a device is
|
* {\tt UPNP_E_ALREADY_REGISTERED} signifies that a client or a device is
|
||||||
* already registered. The SDK currently has a limit of one registered
|
* already registered. The SDK currently has a limit of one registered
|
||||||
* client and one registered device per process.
|
* client and one registered device per process.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_ALREADY_REGISTERED -120
|
#define UPNP_E_ALREADY_REGISTERED -120
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_NETWORK_ERROR [-200]
|
/** @name UPNP_E_NETWORK_ERROR [-200]
|
||||||
* {\tt UPNP_E_NETWORK_ERROR} signifies that a network error occurred. It
|
* {\tt UPNP_E_NETWORK_ERROR} signifies that a network error occurred. It
|
||||||
@@ -280,9 +303,9 @@
|
|||||||
* failed to read the local IP address or had problems configuring one of
|
* failed to read the local IP address or had problems configuring one of
|
||||||
* the sockets.
|
* the sockets.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_NETWORK_ERROR -200
|
#define UPNP_E_NETWORK_ERROR -200
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_SOCKET_WRITE [-201]
|
/** @name UPNP_E_SOCKET_WRITE [-201]
|
||||||
* {\tt UPNP_E_SOCKET_WRITE} signifies an error writing to a socket. This
|
* {\tt UPNP_E_SOCKET_WRITE} signifies an error writing to a socket. This
|
||||||
@@ -291,9 +314,9 @@
|
|||||||
* control (e.g. {\bf UpnpSendAction}), eventing (e.g. {\bf UpnpNotify}),
|
* control (e.g. {\bf UpnpSendAction}), eventing (e.g. {\bf UpnpNotify}),
|
||||||
* and HTTP functions (e.g. {\bf UpnpDownloadXmlDoc}).
|
* and HTTP functions (e.g. {\bf UpnpDownloadXmlDoc}).
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_SOCKET_WRITE -201
|
#define UPNP_E_SOCKET_WRITE -201
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_SOCKET_READ [-202]
|
/** @name UPNP_E_SOCKET_READ [-202]
|
||||||
* {\tt UPNP_E_SOCKET_READ} signifies an error reading from a socket. This
|
* {\tt UPNP_E_SOCKET_READ} signifies an error reading from a socket. This
|
||||||
@@ -302,9 +325,9 @@
|
|||||||
* control (e.g. {\bf UpnpSendAction}), eventing (e.g. {\bf UpnpNotify}),
|
* control (e.g. {\bf UpnpSendAction}), eventing (e.g. {\bf UpnpNotify}),
|
||||||
* and HTTP functions (e.g. {\bf UpnpDownloadXmlDoc}).
|
* and HTTP functions (e.g. {\bf UpnpDownloadXmlDoc}).
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_SOCKET_READ -202
|
#define UPNP_E_SOCKET_READ -202
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_SOCKET_BIND [-203]
|
/** @name UPNP_E_SOCKET_BIND [-203]
|
||||||
* {\tt UPNP_E_SOCKET_BIND} signifies that the SDK had a problem binding
|
* {\tt UPNP_E_SOCKET_BIND} signifies that the SDK had a problem binding
|
||||||
@@ -314,9 +337,9 @@
|
|||||||
* (e.g. {\bf UpnpNotify}), and HTTP functions (e.g.
|
* (e.g. {\bf UpnpNotify}), and HTTP functions (e.g.
|
||||||
* {\bf UpnpDownloadXmlDoc}).
|
* {\bf UpnpDownloadXmlDoc}).
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_SOCKET_BIND -203
|
#define UPNP_E_SOCKET_BIND -203
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_SOCKET_CONNECT [-204]
|
/** @name UPNP_E_SOCKET_CONNECT [-204]
|
||||||
* {\tt UPNP_E_SOCKET_CONNECT} signifies that the SDK had a problem
|
* {\tt UPNP_E_SOCKET_CONNECT} signifies that the SDK had a problem
|
||||||
@@ -326,9 +349,9 @@
|
|||||||
* (e.g. {\bf UpnpNotify}), and HTTP functions (e.g.
|
* (e.g. {\bf UpnpNotify}), and HTTP functions (e.g.
|
||||||
* {\bf UpnpDownloadXmlDoc}).
|
* {\bf UpnpDownloadXmlDoc}).
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_SOCKET_CONNECT -204
|
#define UPNP_E_SOCKET_CONNECT -204
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_OUTOF_SOCKET [-205]
|
/** @name UPNP_E_OUTOF_SOCKET [-205]
|
||||||
* {\tt UPNP_E_OUTOF_SOCKET} signifies that the SDK cannot create any
|
* {\tt UPNP_E_OUTOF_SOCKET} signifies that the SDK cannot create any
|
||||||
@@ -338,36 +361,36 @@
|
|||||||
* (e.g. {\bf UpnpNotify}), and HTTP functions (e.g.
|
* (e.g. {\bf UpnpNotify}), and HTTP functions (e.g.
|
||||||
* {\bf UpnpDownloadXmlDoc}).
|
* {\bf UpnpDownloadXmlDoc}).
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_OUTOF_SOCKET -205
|
#define UPNP_E_OUTOF_SOCKET -205
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_LISTEN [-206]
|
/** @name UPNP_E_LISTEN [-206]
|
||||||
* {\tt UPNP_E_LISTEN} signifies that the SDK had a problem setting the
|
* {\tt UPNP_E_LISTEN} signifies that the SDK had a problem setting the
|
||||||
* socket to listen for incoming connections. This error only happens during
|
* socket to listen for incoming connections. This error only happens during
|
||||||
* initialization (i.e. {\bf UpnpInit}).
|
* initialization (i.e. {\bf UpnpInit}).
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_LISTEN -206
|
#define UPNP_E_LISTEN -206
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_TIMEDOUT [-207]
|
/** @name UPNP_E_TIMEDOUT [-207]
|
||||||
* {\tt UPNP_E_TIMEDOUT} signifies that too much time elapsed before the
|
* {\tt UPNP_E_TIMEDOUT} signifies that too much time elapsed before the
|
||||||
* required number of bytes were sent or received over a socket. This error
|
* required number of bytes were sent or received over a socket. This error
|
||||||
* can be returned by any function that performs network operations.
|
* can be returned by any function that performs network operations.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_TIMEDOUT -207
|
#define UPNP_E_TIMEDOUT -207
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_SOCKET_ERROR [-208]
|
/** @name UPNP_E_SOCKET_ERROR [-208]
|
||||||
* {\tt UPNP_E_SOCKET_ERROR} is the generic socket error code for
|
* {\tt UPNP_E_SOCKET_ERROR} is the generic socket error code for
|
||||||
* conditions not covered by other error codes. This error can be returned
|
* conditions not covered by other error codes. This error can be returned
|
||||||
* by any function that performs network operations.
|
* by any function that performs network operations.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_SOCKET_ERROR -208
|
#define UPNP_E_SOCKET_ERROR -208
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
#define UPNP_E_FILE_WRITE_ERROR -209
|
#define UPNP_E_FILE_WRITE_ERROR -209
|
||||||
|
|
||||||
@@ -376,9 +399,9 @@
|
|||||||
* error can be returned by any function that allows for external
|
* error can be returned by any function that allows for external
|
||||||
* cancelation.
|
* cancelation.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_CANCELED -210
|
#define UPNP_E_CANCELED -210
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
#define UPNP_E_EVENT_PROTOCOL -300
|
#define UPNP_E_EVENT_PROTOCOL -300
|
||||||
|
|
||||||
@@ -386,58 +409,58 @@
|
|||||||
* {\tt UPNP_E_SUBSCRIBE_UNACCEPTED} signifies that a subscription
|
* {\tt UPNP_E_SUBSCRIBE_UNACCEPTED} signifies that a subscription
|
||||||
* request was rejected from the remote side.
|
* request was rejected from the remote side.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_SUBSCRIBE_UNACCEPTED -301
|
#define UPNP_E_SUBSCRIBE_UNACCEPTED -301
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_UNSUBSCRIBE_UNACCAPTED [-302]
|
/** @name UPNP_E_UNSUBSCRIBE_UNACCEPTED [-302]
|
||||||
* {\tt UPNP_E_UNSUBSCRIBE_UNACCEPTED} signifies that an unsubscribe
|
* {\tt UPNP_E_UNSUBSCRIBE_UNACCEPTED} signifies that an unsubscribe
|
||||||
* request was rejected from the remote side.
|
* request was rejected from the remote side.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_UNSUBSCRIBE_UNACCEPTED -302
|
#define UPNP_E_UNSUBSCRIBE_UNACCEPTED -302
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_NOTIFY_UNACCEPTED [-303]
|
/** @name UPNP_E_NOTIFY_UNACCEPTED [-303]
|
||||||
* {\tt UPNP_E_NOTIFY_UNACCEPTED} signifies that the remote host did not
|
* {\tt UPNP_E_NOTIFY_UNACCEPTED} signifies that the remote host did not
|
||||||
* accept the notify sent from the local device.
|
* accept the notify sent from the local device.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_NOTIFY_UNACCEPTED -303
|
#define UPNP_E_NOTIFY_UNACCEPTED -303
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_INVALID_ARGUMENT [-501]
|
/** @name UPNP_E_INVALID_ARGUMENT [-501]
|
||||||
* {\tt UPNP_E_INVALID_ARGUMENT} signifies that one or more of the parameters
|
* {\tt UPNP_E_INVALID_ARGUMENT} signifies that one or more of the parameters
|
||||||
* passed to a function is invalid. Refer to the individual function
|
* passed to a function is invalid. Refer to the individual function
|
||||||
* descriptions for the acceptable ranges for parameters.
|
* descriptions for the acceptable ranges for parameters.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INVALID_ARGUMENT -501
|
#define UPNP_E_INVALID_ARGUMENT -501
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_FILE_NOT_FOUND [-502]
|
/** @name UPNP_E_FILE_NOT_FOUND [-502]
|
||||||
* {\tt UPNP_E_FILE_NOT_FOUND} signifies that the filename passed
|
* {\tt UPNP_E_FILE_NOT_FOUND} signifies that the filename passed
|
||||||
* to one of the device registration functions was not found or was not
|
* to one of the device registration functions was not found or was not
|
||||||
* accessible.
|
* accessible.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_FILE_NOT_FOUND -502
|
#define UPNP_E_FILE_NOT_FOUND -502
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_FILE_READ_ERROR [-503]
|
/** @name UPNP_E_FILE_READ_ERROR [-503]
|
||||||
* {\tt UPNP_E_FILE_READ_ERROR} signifies an error when reading a file.
|
* {\tt UPNP_E_FILE_READ_ERROR} signifies an error when reading a file.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_FILE_READ_ERROR -503
|
#define UPNP_E_FILE_READ_ERROR -503
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_EXT_NOT_XML [-504]
|
/** @name UPNP_E_EXT_NOT_XML [-504]
|
||||||
* {\tt UPNP_E_EXT_NOT_XML} signifies that the file name of the description
|
* {\tt UPNP_E_EXT_NOT_XML} signifies that the file name of the description
|
||||||
* document passed to {\bf UpnpRegisterRootDevice2} does not end in ".xml".
|
* document passed to {\bf UpnpRegisterRootDevice2} does not end in ".xml".
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_EXT_NOT_XML -504
|
#define UPNP_E_EXT_NOT_XML -504
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
#define UPNP_E_NO_WEB_SERVER -505
|
#define UPNP_E_NO_WEB_SERVER -505
|
||||||
#define UPNP_E_OUTOF_BOUNDS -506
|
#define UPNP_E_OUTOF_BOUNDS -506
|
||||||
@@ -446,26 +469,26 @@
|
|||||||
* {\tt UPNP_E_NOT_FOUND} signifies that the response to a SOAP request
|
* {\tt UPNP_E_NOT_FOUND} signifies that the response to a SOAP request
|
||||||
* did not contain the required XML constructs.
|
* did not contain the required XML constructs.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_NOT_FOUND -507
|
#define UPNP_E_NOT_FOUND -507
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
/** @name UPNP_E_INTERNAL_ERROR [-911]
|
/** @name UPNP_E_INTERNAL_ERROR [-911]
|
||||||
* {\tt UPNP_E_INTERNAL_ERROR} is the generic error code for internal
|
* {\tt UPNP_E_INTERNAL_ERROR} is the generic error code for internal
|
||||||
* conditions not covered by other error codes.
|
* conditions not covered by other error codes.
|
||||||
*/
|
*/
|
||||||
//@{
|
/*! @{ */
|
||||||
#define UPNP_E_INTERNAL_ERROR -911
|
#define UPNP_E_INTERNAL_ERROR -911
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
// SOAP-related error codes
|
/* SOAP-related error codes */
|
||||||
#define UPNP_SOAP_E_INVALID_ACTION 401
|
#define UPNP_SOAP_E_INVALID_ACTION 401
|
||||||
#define UPNP_SOAP_E_INVALID_ARGS 402
|
#define UPNP_SOAP_E_INVALID_ARGS 402
|
||||||
#define UPNP_SOAP_E_OUT_OF_SYNC 403
|
#define UPNP_SOAP_E_OUT_OF_SYNC 403
|
||||||
#define UPNP_SOAP_E_INVALID_VAR 404
|
#define UPNP_SOAP_E_INVALID_VAR 404
|
||||||
#define UPNP_SOAP_E_ACTION_FAILED 501
|
#define UPNP_SOAP_E_ACTION_FAILED 501
|
||||||
|
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
#ifndef OUT
|
#ifndef OUT
|
||||||
#define OUT
|
#define OUT
|
||||||
@@ -479,10 +502,12 @@
|
|||||||
#define INOUT
|
#define INOUT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "upnpdebug.h"
|
||||||
|
|
||||||
enum UpnpOpenFileMode{UPNP_READ, UPNP_WRITE};
|
enum UpnpOpenFileMode{UPNP_READ, UPNP_WRITE};
|
||||||
|
|
||||||
/// @name Constants, Structures, and Types
|
/*! @name Constants, Structures, and Types */
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** Returned when a control point application registers with {\bf
|
/** Returned when a control point application registers with {\bf
|
||||||
* UpnpRegisterClient}. Client handles can only be used with
|
* UpnpRegisterClient}. Client handles can only be used with
|
||||||
@@ -505,9 +530,9 @@ typedef int UpnpDevice_Handle;
|
|||||||
|
|
||||||
enum Upnp_EventType_e {
|
enum Upnp_EventType_e {
|
||||||
|
|
||||||
//
|
/*
|
||||||
// Control callbacks
|
* Control callbacks
|
||||||
//
|
*/
|
||||||
|
|
||||||
/** Received by a device when a control point issues a control
|
/** Received by a device when a control point issues a control
|
||||||
* request. The {\bf Event} parameter contains a pointer to a {\bf
|
* request. The {\bf Event} parameter contains a pointer to a {\bf
|
||||||
@@ -535,9 +560,9 @@ enum Upnp_EventType_e {
|
|||||||
|
|
||||||
UPNP_CONTROL_GET_VAR_COMPLETE,
|
UPNP_CONTROL_GET_VAR_COMPLETE,
|
||||||
|
|
||||||
//
|
/*
|
||||||
// Discovery callbacks
|
* Discovery callbacks
|
||||||
//
|
*/
|
||||||
|
|
||||||
/** Received by a control point when a new device or service is available.
|
/** Received by a control point when a new device or service is available.
|
||||||
* The {\bf Event} parameter contains a pointer to a {\bf
|
* The {\bf Event} parameter contains a pointer to a {\bf
|
||||||
@@ -566,9 +591,9 @@ enum Upnp_EventType_e {
|
|||||||
|
|
||||||
UPNP_DISCOVERY_SEARCH_TIMEOUT,
|
UPNP_DISCOVERY_SEARCH_TIMEOUT,
|
||||||
|
|
||||||
//
|
/*
|
||||||
// Eventing callbacks
|
* Eventing callbacks
|
||||||
//
|
*/
|
||||||
|
|
||||||
/** Received by a device when a subscription arrives.
|
/** Received by a device when a subscription arrives.
|
||||||
* The {\bf Event} parameter contains a pointer to a {\bf
|
* The {\bf Event} parameter contains a pointer to a {\bf
|
||||||
@@ -799,18 +824,15 @@ struct Upnp_Event
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
/*
|
||||||
// This typedef is required by Doc++ to parse the last entry of the
|
* This typedef is required by Doc++ to parse the last entry of the
|
||||||
// Upnp_Discovery structure correctly.
|
* Upnp_Discovery structure correctly.
|
||||||
//
|
*/
|
||||||
|
|
||||||
typedef struct sockaddr_in SOCKADDRIN;
|
|
||||||
|
|
||||||
/** Returned in a {\bf UPNP_DISCOVERY_RESULT} callback. */
|
/** Returned in a {\bf UPNP_DISCOVERY_RESULT} callback. */
|
||||||
|
|
||||||
struct Upnp_Discovery
|
struct Upnp_Discovery
|
||||||
{
|
{
|
||||||
|
|
||||||
/** The result code of the {\bf UpnpSearchAsync} call. */
|
/** The result code of the {\bf UpnpSearchAsync} call. */
|
||||||
int ErrCode;
|
int ErrCode;
|
||||||
|
|
||||||
@@ -842,8 +864,7 @@ struct Upnp_Discovery
|
|||||||
char Ext[LINE_SIZE];
|
char Ext[LINE_SIZE];
|
||||||
|
|
||||||
/** The host address of the device responding to the search. */
|
/** The host address of the device responding to the search. */
|
||||||
SOCKADDRIN * DestAddr;
|
struct sockaddr_in DestAddr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Returned along with a {\bf UPNP_EVENT_SUBSCRIBE_COMPLETE} or {\bf
|
/** Returned along with a {\bf UPNP_EVENT_SUBSCRIBE_COMPLETE} or {\bf
|
||||||
@@ -1047,14 +1068,14 @@ typedef int (*Upnp_FunPtr) (
|
|||||||
IN void *Cookie
|
IN void *Cookie
|
||||||
);
|
);
|
||||||
|
|
||||||
//@} // Constants, Structures, and Types
|
/*! @} */ /* Constants, Structures, and Types */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif // __cplusplus
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
///@name Initialization and Registration
|
/*! @name Initialization and Registration */
|
||||||
//@{
|
/*! @{ */
|
||||||
/** Initializes the Linux SDK for UPnP Devices. This function must be called
|
/** Initializes the Linux SDK for UPnP Devices. This function must be called
|
||||||
* before any other API function can be called. It should be called
|
* before any other API function can be called. It should be called
|
||||||
* only once. Subsequent calls to this API return a {\tt UPNP_E_INIT}
|
* only once. Subsequent calls to this API return a {\tt UPNP_E_INIT}
|
||||||
@@ -1365,18 +1386,18 @@ EXPORT_SPEC int UpnpSetMaxContentLength(
|
|||||||
for incoming SOAP actions, in bytes. */
|
for incoming SOAP actions, in bytes. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@} // Initialization and Registration
|
/*! @} */ /* Initialization and Registration */
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
/******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
// //
|
* *
|
||||||
// D I S C O V E R Y //
|
* D I S C O V E R Y *
|
||||||
// //
|
* *
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************/
|
||||||
|
|
||||||
///@name Discovery
|
/*! @name Discovery */
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** {\bf UpnpSearchAsync} searches for devices matching the given
|
/** {\bf UpnpSearchAsync} searches for devices matching the given
|
||||||
* search target. The function returns immediately and the SDK
|
* search target. The function returns immediately and the SDK
|
||||||
@@ -1435,18 +1456,18 @@ EXPORT_SPEC int UpnpSendAdvertisement(
|
|||||||
the announcements. */
|
the announcements. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@} // Discovery
|
/*! @} */ /* Discovery */
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
/******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
// //
|
* *
|
||||||
// C O N T R O L //
|
* C O N T R O L *
|
||||||
// //
|
* *
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************/
|
||||||
|
|
||||||
///@name Control
|
/*! @name Control */
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** {\bf UpnpGetServiceVarStatus} queries the state of a state
|
/** {\bf UpnpGetServiceVarStatus} queries the state of a state
|
||||||
* variable of a service on another device. This is a synchronous call.
|
* variable of a service on another device. This is a synchronous call.
|
||||||
@@ -1669,18 +1690,18 @@ EXPORT_SPEC int UpnpSendActionExAsync(
|
|||||||
passed to the callback when invoked. */
|
passed to the callback when invoked. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@} // Control
|
/*! @} */ /* Control */
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
/******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
// //
|
* *
|
||||||
// E V E N T I N G //
|
* E V E N T I N G *
|
||||||
// //
|
* *
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************/
|
||||||
|
|
||||||
///@name Eventing
|
/*! @name Eventing */
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** {\bf UpnpAcceptSubscription} accepts a subscription request and sends
|
/** {\bf UpnpAcceptSubscription} accepts a subscription request and sends
|
||||||
* out the current state of the eventable variables for a service.
|
* out the current state of the eventable variables for a service.
|
||||||
@@ -2183,19 +2204,19 @@ EXPORT_SPEC int UpnpUnSubscribeAsync(
|
|||||||
callback function when invoked. */
|
callback function when invoked. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@} // Eventing
|
/*! @} */ /* Eventing */
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
/******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
// //
|
* *
|
||||||
// C L I E N T - A P I //
|
* C L I E N T - A P I *
|
||||||
// //
|
* *
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************/
|
||||||
|
|
||||||
///@name Control Point HTTP API
|
/*! @name Control Point HTTP API */
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** {\bf UpnpDownloadUrlItem} downloads a file specified in a URL.
|
/** {\bf UpnpDownloadUrlItem} downloads a file specified in a URL.
|
||||||
* The SDK allocates the memory for {\bf outBuf} and the
|
* The SDK allocates the memory for {\bf outBuf} and the
|
||||||
@@ -2588,18 +2609,18 @@ EXPORT_SPEC int UpnpDownloadXmlDoc(
|
|||||||
XML document. */
|
XML document. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@} // Control Point HTTP API
|
/*! @} */ /* Control Point HTTP API */
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
/******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
// //
|
* *
|
||||||
// W E B S E R V E R A P I //
|
* W E B S E R V E R A P I *
|
||||||
// //
|
* *
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************
|
||||||
////////////////////////////////////////////////////////////////////////
|
******************************************************************************/
|
||||||
|
|
||||||
///@name Web Server API
|
/*! @name Web Server API */
|
||||||
//@{
|
/*! @{ */
|
||||||
|
|
||||||
/** {\bf UpnpSetWebServerRootDir} sets the document root directory for
|
/** {\bf UpnpSetWebServerRootDir} sets the document root directory for
|
||||||
* the internal web server. This directory is considered the
|
* the internal web server. This directory is considered the
|
||||||
@@ -2715,12 +2736,13 @@ EXPORT_SPEC void UpnpFree(
|
|||||||
IN void *item /* The item to free. */
|
IN void *item /* The item to free. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@} // Web Server API
|
/*! @} */ /* Web Server API */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif // __cplusplus
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
//@} The API
|
/*! @} */ /* The API */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -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,6 +91,5 @@
|
|||||||
#undef UPNP_HAVE_TOOLS
|
#undef UPNP_HAVE_TOOLS
|
||||||
|
|
||||||
|
|
||||||
#endif // UPNP_CONFIG_H
|
#endif /* UPNP_CONFIG_H */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +1,41 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/*******************************************************************************
|
||||||
//
|
*
|
||||||
// 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
|
||||||
|
|
||||||
|
#include "upnp.h"
|
||||||
#include "upnpconfig.h"
|
#include "upnpconfig.h"
|
||||||
|
|
||||||
// Function declarations only if debug compiled into the library
|
|
||||||
#if UPNP_HAVE_DEBUG
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -49,7 +47,7 @@ extern "C" {
|
|||||||
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,
|
||||||
@@ -70,18 +68,25 @@ extern "C" {
|
|||||||
* \end{itemize}
|
* \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
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,26 +103,32 @@ typedef enum Upnp_LogLevel_e {
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This functions initializes the log files
|
* This functions initializes the log files
|
||||||
|
*
|
||||||
* Returns: int
|
* Returns: int
|
||||||
* -1 : If fails
|
* -1 : If fails
|
||||||
* UPNP_E_SUCCESS : if success
|
* UPNP_E_SUCCESS : if success
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
#ifdef DEBUG
|
||||||
int UpnpInitLog();
|
int UpnpInitLog();
|
||||||
|
#else
|
||||||
// for backward compatibility
|
static UPNP_INLINE int UpnpInitLog() { return UPNP_E_SUCCESS; }
|
||||||
#define InitLog UpnpInitLog
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Function : UpnpSetLogLevel
|
* Function : UpnpSetLogLevel
|
||||||
*
|
*
|
||||||
* Parameters: void
|
* Parameters: Upnp_LogLevel log_level
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This functions set the log level (see {\tt Upnp_LogLevel}
|
* This functions set the log level (see {\tt Upnp_LogLevel}
|
||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void UpnpSetLogLevel (Upnp_LogLevel);
|
#ifdef DEBUG
|
||||||
|
void UpnpSetLogLevel(Upnp_LogLevel log_level);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@@ -129,10 +140,11 @@ void UpnpSetLogLevel (Upnp_LogLevel);
|
|||||||
* This functions closes the log files
|
* This functions closes the log files
|
||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
#ifdef DEBUG
|
||||||
void UpnpCloseLog();
|
void UpnpCloseLog();
|
||||||
|
#else
|
||||||
// for backward compatibility
|
static UPNP_INLINE void UpnpCloseLog() {}
|
||||||
#define CloseLog UpnpCloseLog
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@@ -149,17 +161,22 @@ void UpnpCloseLog();
|
|||||||
* per the requested banner
|
* per the requested banner
|
||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void UpnpSetLogFileNames (const char* ErrFileName, const char* InfoFileName);
|
#ifdef DEBUG
|
||||||
|
void UpnpSetLogFileNames(
|
||||||
// for backward compatibility
|
const char *ErrFileName,
|
||||||
#define SetLogFileNames UpnpSetLogFileNames
|
const char *InfoFileName);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE void UpnpSetLogFileNames(
|
||||||
|
const char *ErrFileName,
|
||||||
|
const char *InfoFileName) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Function : UpnpGetDebugFile
|
* Function : UpnpGetDebugFile
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN Dbg_Level DLevel: The level of the debug logging. It will decide
|
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide
|
||||||
* whether debug statement will go to standard output,
|
* whether debug statement will go to standard output,
|
||||||
* or any of the log files.
|
* or any of the log files.
|
||||||
* IN Dbg_Module Module: debug will go in the name of this module
|
* IN Dbg_Module Module: debug will go in the name of this module
|
||||||
@@ -171,17 +188,47 @@ void UpnpSetLogFileNames (const char* ErrFileName, const char* InfoFileName);
|
|||||||
* NULL : if the module is turn off for debug
|
* NULL : if the module is turn off for debug
|
||||||
* else returns the right file descriptor
|
* else returns the right file descriptor
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
FILE* UpnpGetDebugFile (Upnp_LogLevel level, Dbg_Module module);
|
#ifdef DEBUG
|
||||||
|
FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// for backward compatibility
|
|
||||||
#define GetDebugFile UpnpGetDebugFile
|
/***************************************************************************
|
||||||
|
* Function : DebugAtThisLevel
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide
|
||||||
|
* whether debug statement will go to standard output,
|
||||||
|
* or any of the log files.
|
||||||
|
* IN Dbg_Module Module: debug will go in the name of this module
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* This functions returns true if debug output should be done in this
|
||||||
|
* module.
|
||||||
|
*
|
||||||
|
* Returns: int
|
||||||
|
***************************************************************************/
|
||||||
|
#ifdef DEBUG
|
||||||
|
int DebugAtThisLevel(
|
||||||
|
IN Upnp_LogLevel DLevel,
|
||||||
|
IN Dbg_Module Module);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE int DebugAtThisLevel(
|
||||||
|
IN Upnp_LogLevel DLevel,
|
||||||
|
IN Dbg_Module Module) { return 0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Function : UpnpPrintf
|
* Function : UpnpPrintf
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN Dbg_Level DLevel: The level of the debug logging. It will decide
|
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide
|
||||||
* whether debug statement will go to standard output,
|
* whether debug statement will go to standard output,
|
||||||
* or any of the log files.
|
* or any of the log files.
|
||||||
* IN Dbg_Module Module: debug will go in the name of this module
|
* IN Dbg_Module Module: debug will go in the name of this module
|
||||||
@@ -198,14 +245,28 @@ FILE* UpnpGetDebugFile (Upnp_LogLevel level, Dbg_Module module);
|
|||||||
* debug statement is coming
|
* debug statement is coming
|
||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void UpnpPrintf (Upnp_LogLevel DLevel, Dbg_Module Module,
|
#ifdef DEBUG
|
||||||
const char* DbgFileName, int DbgLineNo,
|
void UpnpPrintf(
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
const char* DbgFileName,
|
||||||
|
int DbgLineNo,
|
||||||
const char* FmtStr,
|
const char* FmtStr,
|
||||||
...)
|
...)
|
||||||
#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 */
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@@ -222,8 +283,19 @@ void UpnpPrintf (Upnp_LogLevel DLevel, Dbg_Module Module,
|
|||||||
* per the requested banner
|
* per the requested banner
|
||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void UpnpDisplayBanner (FILE *fd,
|
#ifdef DEBUG
|
||||||
const char** lines, size_t size, int starlength);
|
void UpnpDisplayBanner(
|
||||||
|
FILE *fd,
|
||||||
|
const char **lines,
|
||||||
|
size_t size,
|
||||||
|
int starlength);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE void UpnpDisplayBanner(
|
||||||
|
FILE *fd,
|
||||||
|
const char **lines,
|
||||||
|
size_t size,
|
||||||
|
int starlength) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@@ -240,19 +312,23 @@ void UpnpDisplayBanner (FILE *fd,
|
|||||||
* debug statement is coming to the log file
|
* debug statement is coming to the log file
|
||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void UpnpDisplayFileAndLine (FILE *fd, const char *DbgFileName, int DbgLineNo);
|
#ifdef DEBUG
|
||||||
|
void UpnpDisplayFileAndLine(
|
||||||
|
FILE *fd,
|
||||||
//@}
|
const char *DbgFileName,
|
||||||
|
int DbgLineNo);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE void UpnpDisplayFileAndLine(
|
||||||
|
FILE *fd,
|
||||||
|
const char *DbgFileName,
|
||||||
|
int DbgLineNo) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*! @} */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // UPNP_HAVE_DEBUG
|
#endif /* UPNP_DEBUG_H */
|
||||||
|
|
||||||
#endif // UPNP_DEBUG_H
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/*******************************************************************************
|
||||||
//
|
*
|
||||||
// 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
|
/** @name Optional Tool APIs
|
||||||
* The Linux SDK for UPnP Devices contains some additional, optional
|
* The Linux SDK for UPnP Devices contains some additional, optional
|
||||||
@@ -36,14 +36,14 @@
|
|||||||
* size in the SDK. Refer to the README for details.
|
* 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"
|
#include "upnp.h"
|
||||||
|
|
||||||
// Function declarations only if tools compiled into the library
|
/* Function declarations only if tools compiled into the library */
|
||||||
#if UPNP_HAVE_TOOLS
|
#if UPNP_HAVE_TOOLS
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -217,14 +217,13 @@ EXPORT_SPEC const char * UpnpGetErrorMessage(
|
|||||||
int errorcode /** The SDK error code to convert. */
|
int errorcode /** The SDK error code to convert. */
|
||||||
);
|
);
|
||||||
|
|
||||||
//@}
|
/*! @} */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // UPNP_HAVE_TOOLS
|
#endif /* UPNP_HAVE_TOOLS */
|
||||||
|
|
||||||
#endif // UPNP_TOOLS_H
|
|
||||||
|
|
||||||
|
#endif /* UPNP_TOOLS_H */
|
||||||
|
|
||||||
|
|||||||
83
upnp/sample/Makefile.am
Normal file
83
upnp/sample/Makefile.am
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
#
|
||||||
|
# "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 = \
|
||||||
|
$(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
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ SampleUtil_RegisterUpdateFunction( state_update update_function )
|
|||||||
*
|
*
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
int
|
int
|
||||||
SampleUtil_Finish( )
|
SampleUtil_Finish()
|
||||||
{
|
{
|
||||||
ithread_mutex_destroy( &display_mutex );
|
ithread_mutex_destroy( &display_mutex );
|
||||||
gPrintFun = NULL;
|
gPrintFun = NULL;
|
||||||
|
|||||||
@@ -34,24 +34,26 @@
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "upnptools.h"
|
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
#include "ixml.h"
|
#include "ixml.h"
|
||||||
|
#include "upnptools.h"
|
||||||
|
|
||||||
|
|
||||||
|
// mutex to control displaying of events
|
||||||
|
extern ithread_mutex_t display_mutex;
|
||||||
|
|
||||||
//mutex to control displaying of events
|
|
||||||
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;
|
||||||
|
|
||||||
|
|
||||||
@@ -68,7 +70,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
|
||||||
@@ -85,7 +87,7 @@ char * SampleUtil_GetElementValue(IN IXML_Element *element);
|
|||||||
*
|
*
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document * doc);
|
IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document *doc);
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
@@ -100,7 +102,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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -116,7 +118,7 @@ char * SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *ite
|
|||||||
* 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
|
||||||
@@ -162,9 +164,13 @@ 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 (IN IXML_Document *DescDoc, IN char* location,
|
int SampleUtil_FindAndParseService (
|
||||||
IN char *serviceType, OUT char **serviceId,
|
IN IXML_Document *DescDoc,
|
||||||
OUT char **eventURL, OUT char **controlURL);
|
IN char* location,
|
||||||
|
IN char *serviceType,
|
||||||
|
OUT char **serviceId,
|
||||||
|
OUT char **eventURL,
|
||||||
|
OUT char **controlURL);
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
@@ -196,7 +202,10 @@ extern print_string gPrintFun;
|
|||||||
* const char * UDN
|
* const char * UDN
|
||||||
* int newDevice
|
* int newDevice
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
typedef void (*state_update)( const char *varName, const char *varValue, const char *UDN,
|
typedef void (*state_update)(
|
||||||
|
const char *varName,
|
||||||
|
const char *varValue,
|
||||||
|
const char *UDN,
|
||||||
eventType type);
|
eventType type);
|
||||||
|
|
||||||
//global state update function used by smaple util
|
//global state update function used by smaple util
|
||||||
@@ -224,7 +233,7 @@ int SampleUtil_Initialize(print_string print_function);
|
|||||||
* Parameters:
|
* Parameters:
|
||||||
*
|
*
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
int SampleUtil_Finish(void);
|
int SampleUtil_Finish();
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* SampleUtil_Print
|
* SampleUtil_Print
|
||||||
@@ -238,7 +247,7 @@ int SampleUtil_Finish(void);
|
|||||||
* . . . - 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
|
||||||
@@ -248,7 +257,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
|
||||||
@@ -258,11 +267,22 @@ int SampleUtil_RegisterUpdateFunction( state_update update_function );
|
|||||||
* Parameters:
|
* Parameters:
|
||||||
*
|
*
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
void SampleUtil_StateUpdate( const char *varName, const char *varValue, const char *UDN,
|
void SampleUtil_StateUpdate(
|
||||||
|
const char *varName,
|
||||||
|
const char *varValue,
|
||||||
|
const char *UDN,
|
||||||
eventType type);
|
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 */
|
||||||
|
|
||||||
|
|||||||
491
upnp/sample/tvcombo/linux/upnp_tv_combo_main.c
Normal file
491
upnp/sample/tvcombo/linux/upnp_tv_combo_main.c
Normal file
@@ -0,0 +1,491 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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. While registers a tv device itself." );
|
||||||
|
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;
|
||||||
|
#ifndef WIN32
|
||||||
|
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 );
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
/*
|
||||||
|
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 );
|
||||||
|
#else
|
||||||
|
ithread_join(cmdloop_thread, NULL);
|
||||||
|
#endif
|
||||||
|
TvDeviceStop();
|
||||||
|
rc = TvCtrlPointStop();
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
1417
upnp/sample/tvcombo/upnp_tv_ctrlpt.c
Normal file
1417
upnp/sample/tvcombo/upnp_tv_ctrlpt.c
Normal file
File diff suppressed because it is too large
Load Diff
160
upnp/sample/tvcombo/upnp_tv_ctrlpt.h
Normal file
160
upnp/sample/tvcombo/upnp_tv_ctrlpt.h
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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 <stdio.h>
|
||||||
|
|
||||||
|
#include "ithread.h"
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "upnp.h"
|
||||||
|
#include "upnptools.h"
|
||||||
|
#include "sample_util.h"
|
||||||
|
|
||||||
|
#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( void );
|
||||||
|
int TvCtrlPointDeleteNode(struct TvDeviceNode*);
|
||||||
|
int TvCtrlPointRemoveDevice(char*);
|
||||||
|
int TvCtrlPointRemoveAll( void );
|
||||||
|
int TvCtrlPointRefresh( void );
|
||||||
|
|
||||||
|
|
||||||
|
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 *, char *, int);
|
||||||
|
void TvCtrlPointHandleGetVar(char *,char *,DOMString);
|
||||||
|
void TvStateUpdate(char*,int, IXML_Document * , char **);
|
||||||
|
void TvCtrlPointHandleEvent(Upnp_SID, int, IXML_Document *);
|
||||||
|
void TvCtrlPointHandleSubscribeUpdate(char *, 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
|
||||||
2038
upnp/sample/tvcombo/upnp_tv_device.c
Normal file
2038
upnp/sample/tvcombo/upnp_tv_device.c
Normal file
File diff suppressed because it is too large
Load Diff
640
upnp/sample/tvcombo/upnp_tv_device.h
Normal file
640
upnp/sample/tvcombo/upnp_tv_device.h
Normal file
@@ -0,0 +1,640 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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 "ithread.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#include <string.h>
|
||||||
|
#include "upnp.h"
|
||||||
|
#include "sample_util.h"
|
||||||
|
|
||||||
|
//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(struct Upnp_Subscription_Request *);
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* 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(struct Upnp_State_Var_Request *);
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* 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(struct Upnp_Action_Request *);
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* 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
|
||||||
@@ -29,9 +29,12 @@
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "sample_util.h"
|
#include "sample_util.h"
|
||||||
#include "upnp_tv_ctrlpt.h"
|
#include "upnp_tv_ctrlpt.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -124,108 +127,72 @@ 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
|
SampleUtil_Print( "This sample control point application automatically searches" );
|
||||||
( "This sample control point application automatically searches" );
|
SampleUtil_Print( "for and subscribes to the services of television device emulator" );
|
||||||
SampleUtil_Print
|
SampleUtil_Print( "devices, described in the tvdevicedesc.xml description document." );
|
||||||
( "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
|
SampleUtil_Print( " Print the current list of TV Device Emulators that this" );
|
||||||
( " 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
|
SampleUtil_Print( " device number which corresponds to the devnum argument of" );
|
||||||
( " 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
|
SampleUtil_Print( " Delete all of the devices from the device list and issue new" );
|
||||||
( " Delete all of the devices from the device list and issue new" );
|
SampleUtil_Print( " search request to rebuild the list from scratch." );
|
||||||
SampleUtil_Print
|
|
||||||
( " search request to rebuild the list from scratch." );
|
|
||||||
SampleUtil_Print( " PrintDev <devnum>" );
|
SampleUtil_Print( " PrintDev <devnum>" );
|
||||||
SampleUtil_Print
|
SampleUtil_Print( " Print the state table for the device <devnum>." );
|
||||||
( " Print the state table for the device <devnum>." );
|
SampleUtil_Print( " e.g., 'PrintDev 1' prints the state table for the first" );
|
||||||
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
|
SampleUtil_Print( " Sends the PowerOn action to the Control Service of" );
|
||||||
( " 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
|
SampleUtil_Print( " Sends the PowerOff action to the Control Service of" );
|
||||||
( " 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
|
SampleUtil_Print( " Sends the SetChannel action to the Control Service of" );
|
||||||
( " Sends the SetChannel action to the Control Service of" );
|
SampleUtil_Print( " device <devnum>, requesting the channel to be changed" );
|
||||||
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
|
SampleUtil_Print( " Sends the SetVolume action to the Control Service of" );
|
||||||
( " Sends the SetVolume action to the Control Service of" );
|
SampleUtil_Print( " device <devnum>, requesting the volume to be changed" );
|
||||||
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
|
SampleUtil_Print( " Sends the SetColor action to the Control Service of" );
|
||||||
( " Sends the SetColor action to the Control Service of" );
|
SampleUtil_Print( " device <devnum>, requesting the color to be changed" );
|
||||||
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
|
SampleUtil_Print( " Sends the SetTint action to the Control Service of" );
|
||||||
( " Sends the SetTint action to the Control Service of" );
|
SampleUtil_Print( " device <devnum>, requesting the tint to be changed" );
|
||||||
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
|
SampleUtil_Print( " Sends the SetContrast action to the Control Service of" );
|
||||||
( " Sends the SetContrast action to the Control Service of" );
|
SampleUtil_Print( " device <devnum>, requesting the contrast to be changed" );
|
||||||
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
|
SampleUtil_Print( " Sends the SetBrightness action to the Control Service of" );
|
||||||
( " Sends the SetBrightness action to the Control Service of" );
|
SampleUtil_Print( " device <devnum>, requesting the brightness to be changed" );
|
||||||
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
|
SampleUtil_Print( " Sends an action request specified by the string <action>" );
|
||||||
( " Sends an action request specified by the string <action>" );
|
SampleUtil_Print( " to the Control Service of device <devnum>. This command" );
|
||||||
SampleUtil_Print
|
SampleUtil_Print( " only works for actions that have no arguments." );
|
||||||
( " to the Control Service of device <devnum>. This command" );
|
SampleUtil_Print( " (e.g., \"CtrlAction 1 IncreaseChannel\")" );
|
||||||
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
|
SampleUtil_Print( " Sends an action request specified by the string <action>" );
|
||||||
( " Sends an action request specified by the string <action>" );
|
SampleUtil_Print( " to the Picture Service of device <devnum>. This command" );
|
||||||
SampleUtil_Print
|
SampleUtil_Print( " only works for actions that have no arguments." );
|
||||||
( " to the Picture Service of device <devnum>. This command" );
|
SampleUtil_Print( " (e.g., \"PictAction 1 DecreaseContrast\")" );
|
||||||
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
|
SampleUtil_Print( " Requests the value of a variable specified by the string <varname>" );
|
||||||
( " Requests the value of a variable specified by the string <varname>" );
|
SampleUtil_Print( " from the Control Service of device <devnum>." );
|
||||||
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
|
SampleUtil_Print( " Requests the value of a variable specified by the string <varname>" );
|
||||||
( " Requests the value of a variable specified by the string <varname>" );
|
SampleUtil_Print( " from the Picture Service of device <devnum>." );
|
||||||
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." );
|
||||||
@@ -242,7 +209,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 );
|
||||||
@@ -321,11 +288,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:
|
||||||
@@ -411,15 +378,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;
|
||||||
|
|
||||||
@@ -440,20 +407,23 @@ main( int argc,
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
ithread_t cmdloop_thread;
|
ithread_t cmdloop_thread;
|
||||||
|
#ifndef WIN32
|
||||||
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" );
|
||||||
exit( rc );
|
return rc;
|
||||||
}
|
}
|
||||||
// start a command loop thread
|
// start a command loop thread
|
||||||
code =
|
code =
|
||||||
ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop,
|
ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop,
|
||||||
NULL );
|
NULL );
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
/*
|
/*
|
||||||
Catch Ctrl-C and properly shutdown
|
Catch Ctrl-C and properly shutdown
|
||||||
*/
|
*/
|
||||||
@@ -462,6 +432,10 @@ main( int argc,
|
|||||||
sigwait( &sigs_to_catch, &sig );
|
sigwait( &sigs_to_catch, &sig );
|
||||||
|
|
||||||
SampleUtil_Print( "Shutting down on signal %d...", sig );
|
SampleUtil_Print( "Shutting down on signal %d...", sig );
|
||||||
rc = TvCtrlPointStop( );
|
#else
|
||||||
exit( rc );
|
ithread_join(cmdloop_thread, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
rc = TvCtrlPointStop();
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,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,
|
||||||
@@ -539,7 +539,7 @@ TvCtrlPointGetDevice( int devnum,
|
|||||||
*
|
*
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
int
|
int
|
||||||
TvCtrlPointPrintList( )
|
TvCtrlPointPrintList()
|
||||||
{
|
{
|
||||||
struct TvDeviceNode *tmpdevnode;
|
struct TvDeviceNode *tmpdevnode;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -1096,7 +1096,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType,
|
|||||||
if( DescDoc )
|
if( DescDoc )
|
||||||
ixmlDocument_free( DescDoc );
|
ixmlDocument_free( DescDoc );
|
||||||
|
|
||||||
TvCtrlPointPrintList( );
|
TvCtrlPointPrintList();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1122,7 +1122,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType,
|
|||||||
TvCtrlPointRemoveDevice( d_event->DeviceId );
|
TvCtrlPointRemoveDevice( d_event->DeviceId );
|
||||||
|
|
||||||
SampleUtil_Print( "After byebye:" );
|
SampleUtil_Print( "After byebye:" );
|
||||||
TvCtrlPointPrintList( );
|
TvCtrlPointPrintList();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1354,7 +1354,7 @@ TvCtrlPointStart( print_string printFunctionPtr,
|
|||||||
{
|
{
|
||||||
ithread_t timer_thread;
|
ithread_t timer_thread;
|
||||||
int rc;
|
int rc;
|
||||||
short int port = 0;
|
unsigned short port = 0;
|
||||||
char *ip_address = NULL;
|
char *ip_address = NULL;
|
||||||
|
|
||||||
SampleUtil_Initialize( printFunctionPtr );
|
SampleUtil_Initialize( printFunctionPtr );
|
||||||
@@ -1362,34 +1362,42 @@ TvCtrlPointStart( print_string printFunctionPtr,
|
|||||||
|
|
||||||
ithread_mutex_init( &DeviceListMutex, 0 );
|
ithread_mutex_init( &DeviceListMutex, 0 );
|
||||||
|
|
||||||
SampleUtil_Print( "Intializing UPnP with ipaddress=%s port=%d",
|
SampleUtil_Print(
|
||||||
|
"Initializing UPnP Sdk with\n"
|
||||||
|
"\tipaddress = %s port = %u\n",
|
||||||
ip_address, port );
|
ip_address, port );
|
||||||
|
|
||||||
rc = UpnpInit( ip_address, port );
|
rc = UpnpInit( ip_address, port );
|
||||||
if( UPNP_E_SUCCESS != rc ) {
|
if( UPNP_E_SUCCESS != rc ) {
|
||||||
SampleUtil_Print( "WinCEStart: UpnpInit() Error: %d", rc );
|
SampleUtil_Print( "WinCEStart: UpnpInit() Error: %d", rc );
|
||||||
UpnpFinish( );
|
UpnpFinish();
|
||||||
return TV_ERROR;
|
return TV_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( NULL == ip_address )
|
if( NULL == ip_address ) {
|
||||||
ip_address = UpnpGetServerIpAddress( );
|
ip_address = UpnpGetServerIpAddress();
|
||||||
if( 0 == port )
|
}
|
||||||
port = UpnpGetServerPort( );
|
if( 0 == port ) {
|
||||||
|
port = UpnpGetServerPort();
|
||||||
|
}
|
||||||
|
|
||||||
SampleUtil_Print( "UPnP Initialized (%s:%d)", ip_address, port );
|
SampleUtil_Print(
|
||||||
|
"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( UPNP_E_SUCCESS != rc ) {
|
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
|
// start a timer thread
|
||||||
ithread_create( &timer_thread, NULL, TvCtrlPointTimerLoop, NULL );
|
ithread_create( &timer_thread, NULL, TvCtrlPointTimerLoop, NULL );
|
||||||
@@ -1400,10 +1408,10 @@ TvCtrlPointStart( print_string printFunctionPtr,
|
|||||||
int
|
int
|
||||||
TvCtrlPointStop( void )
|
TvCtrlPointStop( void )
|
||||||
{
|
{
|
||||||
TvCtrlPointRemoveAll( );
|
TvCtrlPointRemoveAll();
|
||||||
UpnpUnRegisterClient( ctrlpt_handle );
|
UpnpUnRegisterClient( ctrlpt_handle );
|
||||||
UpnpFinish( );
|
UpnpFinish();
|
||||||
SampleUtil_Finish( );
|
SampleUtil_Finish();
|
||||||
|
|
||||||
return TV_SUCCESS;
|
return TV_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ extern "C" {
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|||||||
@@ -29,10 +29,14 @@
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "sample_util.h"
|
#include "sample_util.h"
|
||||||
#include "upnp_tv_device.h"
|
#include "upnp_tv_device.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* linux_print
|
* linux_print
|
||||||
*
|
*
|
||||||
@@ -82,7 +86,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 );
|
||||||
@@ -117,26 +121,26 @@ TvDeviceCommandLoop( void *args )
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
int
|
int main( IN int argc, IN char **argv )
|
||||||
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;
|
||||||
int code;
|
#ifndef WIN32
|
||||||
unsigned int port = 0;
|
|
||||||
int sig;
|
int sig;
|
||||||
sigset_t sigs_to_catch;
|
sigset_t sigs_to_catch;
|
||||||
|
#endif
|
||||||
|
int code;
|
||||||
|
unsigned int port = 0;
|
||||||
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];
|
||||||
@@ -163,21 +167,18 @@ main( IN int argc,
|
|||||||
( "\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" );
|
||||||
exit( 1 );
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
port = ( unsigned short )portTemp;
|
port = ( unsigned short )portTemp;
|
||||||
|
|
||||||
TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path,
|
TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path, linux_print );
|
||||||
linux_print );
|
|
||||||
|
|
||||||
/*
|
/* start a command loop thread */
|
||||||
start a command loop thread
|
code = ithread_create( &cmdloop_thread, NULL, TvDeviceCommandLoop, NULL );
|
||||||
*/
|
|
||||||
code = ithread_create( &cmdloop_thread, NULL, TvDeviceCommandLoop,
|
|
||||||
NULL );
|
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
/*
|
/*
|
||||||
Catch Ctrl-C and properly shutdown
|
Catch Ctrl-C and properly shutdown
|
||||||
*/
|
*/
|
||||||
@@ -186,6 +187,11 @@ main( IN int argc,
|
|||||||
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 );
|
||||||
TvDeviceStop( );
|
#else
|
||||||
exit( 0 );
|
ithread_join(cmdloop_thread, NULL);
|
||||||
|
#endif
|
||||||
|
rc = TvDeviceStop();
|
||||||
|
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1915,11 +1915,11 @@ TvDeviceCallbackEventHandler( Upnp_EventType EventType,
|
|||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
int
|
int
|
||||||
TvDeviceStop( )
|
TvDeviceStop()
|
||||||
{
|
{
|
||||||
UpnpUnRegisterRootDevice( device_handle );
|
UpnpUnRegisterRootDevice( device_handle );
|
||||||
UpnpFinish( );
|
UpnpFinish();
|
||||||
SampleUtil_Finish( );
|
SampleUtil_Finish();
|
||||||
ithread_mutex_destroy( &TVDevMutex );
|
ithread_mutex_destroy( &TVDevMutex );
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1960,30 +1960,35 @@ TvDeviceStart( char *ip_address,
|
|||||||
|
|
||||||
SampleUtil_Initialize( pfun );
|
SampleUtil_Initialize( pfun );
|
||||||
|
|
||||||
SampleUtil_Print
|
SampleUtil_Print(
|
||||||
( "Initializing UPnP Sdk with \n \t ipaddress = %s port = %d\n",
|
"Initializing UPnP Sdk with\n"
|
||||||
|
"\tipaddress = %s port = %u\n",
|
||||||
ip_address, port );
|
ip_address, port );
|
||||||
|
|
||||||
if( ( ret = UpnpInit( ip_address, port ) ) != UPNP_E_SUCCESS ) {
|
if( ( ret = UpnpInit( ip_address, port ) ) != UPNP_E_SUCCESS ) {
|
||||||
SampleUtil_Print( "Error with UpnpInit -- %d\n", ret );
|
SampleUtil_Print( "Error with UpnpInit -- %d\n", ret );
|
||||||
UpnpFinish( );
|
UpnpFinish();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ip_address == NULL ) {
|
if( ip_address == NULL ) {
|
||||||
ip_address = UpnpGetServerIpAddress( );
|
ip_address = UpnpGetServerIpAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
port = UpnpGetServerPort( );
|
port = UpnpGetServerPort();
|
||||||
|
|
||||||
SampleUtil_Print( "UPnP Initialized\n \t ipaddress= %s port = %d\n",
|
SampleUtil_Print(
|
||||||
|
"UPnP Initialized\n"
|
||||||
|
"\tipaddress= %s port = %u\n",
|
||||||
ip_address, port );
|
ip_address, port );
|
||||||
|
|
||||||
if( desc_doc_name == NULL )
|
if( desc_doc_name == NULL ) {
|
||||||
desc_doc_name = "tvdevicedesc.xml";
|
desc_doc_name = "tvdevicedesc.xml";
|
||||||
|
}
|
||||||
|
|
||||||
if( web_dir_path == NULL )
|
if( web_dir_path == NULL ) {
|
||||||
web_dir_path = DEFAULT_WEB_DIR;
|
web_dir_path = DEFAULT_WEB_DIR;
|
||||||
|
}
|
||||||
|
|
||||||
snprintf( desc_doc_url, DESC_URL_SIZE, "http://%s:%d/%s", ip_address,
|
snprintf( desc_doc_url, DESC_URL_SIZE, "http://%s:%d/%s", ip_address,
|
||||||
port, desc_doc_name );
|
port, desc_doc_name );
|
||||||
@@ -1995,12 +2000,13 @@ TvDeviceStart( char *ip_address,
|
|||||||
SampleUtil_Print
|
SampleUtil_Print
|
||||||
( "Error specifying webserver root directory -- %s: %d\n",
|
( "Error specifying webserver root directory -- %s: %d\n",
|
||||||
web_dir_path, ret );
|
web_dir_path, ret );
|
||||||
UpnpFinish( );
|
UpnpFinish();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleUtil_Print
|
SampleUtil_Print(
|
||||||
( "Registering the RootDevice\n\t with desc_doc_url: %s\n",
|
"Registering the RootDevice\n"
|
||||||
|
"\t with desc_doc_url: %s\n",
|
||||||
desc_doc_url );
|
desc_doc_url );
|
||||||
|
|
||||||
if( ( ret = UpnpRegisterRootDevice( desc_doc_url,
|
if( ( ret = UpnpRegisterRootDevice( desc_doc_url,
|
||||||
@@ -2008,24 +2014,25 @@ TvDeviceStart( char *ip_address,
|
|||||||
&device_handle, &device_handle ) )
|
&device_handle, &device_handle ) )
|
||||||
!= UPNP_E_SUCCESS ) {
|
!= UPNP_E_SUCCESS ) {
|
||||||
SampleUtil_Print( "Error registering the rootdevice : %d\n", ret );
|
SampleUtil_Print( "Error registering the rootdevice : %d\n", ret );
|
||||||
UpnpFinish( );
|
UpnpFinish();
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
SampleUtil_Print( "RootDevice Registered\n" );
|
SampleUtil_Print(
|
||||||
|
"RootDevice Registered\n"
|
||||||
SampleUtil_Print( "Initializing State Table\n" );
|
"Initializing State Table\n");
|
||||||
TvDeviceStateTableInit( desc_doc_url );
|
TvDeviceStateTableInit( desc_doc_url );
|
||||||
SampleUtil_Print( "State Table Initialized\n" );
|
SampleUtil_Print("State Table Initialized\n");
|
||||||
|
|
||||||
if( ( ret =
|
if( ( ret =
|
||||||
UpnpSendAdvertisement( device_handle, default_advr_expire ) )
|
UpnpSendAdvertisement( device_handle, default_advr_expire ) )
|
||||||
!= UPNP_E_SUCCESS ) {
|
!= UPNP_E_SUCCESS ) {
|
||||||
SampleUtil_Print( "Error sending advertisements : %d\n", ret );
|
SampleUtil_Print( "Error sending advertisements : %d\n", ret );
|
||||||
UpnpFinish( );
|
UpnpFinish();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleUtil_Print( "Advertisements Sent\n" );
|
SampleUtil_Print("Advertisements Sent\n");
|
||||||
}
|
}
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ extern "C" {
|
|||||||
|
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "upnp.h"
|
#include "upnp.h"
|
||||||
#include "sample_util.h"
|
#include "sample_util.h"
|
||||||
|
|||||||
37
upnp/sample/web/tvcombodesc.xml
Normal file
37
upnp/sample/web/tvcombodesc.xml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<root xmlns="urn:schemas-upnp-org:device-1-0">
|
||||||
|
<specVersion>
|
||||||
|
<major>1</major>
|
||||||
|
<minor>0</minor>
|
||||||
|
</specVersion>
|
||||||
|
<device>
|
||||||
|
<deviceType>urn:schemas-upnp-org:device:tvdevice:1</deviceType>
|
||||||
|
<friendlyName>UPnP Television Emulator</friendlyName>
|
||||||
|
<manufacturer>TV Manufacturer Name</manufacturer>
|
||||||
|
<manufacturerURL>http://www.manufacturer.com</manufacturerURL>
|
||||||
|
<modelDescription>UPnP Television Device Emulator 1.0</modelDescription>
|
||||||
|
<modelName>TVEmulator</modelName>
|
||||||
|
<modelNumber>1.0</modelNumber>
|
||||||
|
<modelURL>http://www.manufacturer.com/TVEmulator/</modelURL>
|
||||||
|
<serialNumber>123456789001</serialNumber>
|
||||||
|
<UDN>uuid:Upnp-TVEmulator-1_0-1234567890002</UDN>
|
||||||
|
<UPC>123456789</UPC>
|
||||||
|
<serviceList>
|
||||||
|
<service>
|
||||||
|
<serviceType>urn:schemas-upnp-org:service:tvcontrol:1</serviceType>
|
||||||
|
<serviceId>urn:upnp-org:serviceId:tvcontrol1</serviceId>
|
||||||
|
<controlURL>/upnp/control/tvcontrol1</controlURL>
|
||||||
|
<eventSubURL>/upnp/event/tvcontrol1</eventSubURL>
|
||||||
|
<SCPDURL>/tvcontrolSCPD.xml</SCPDURL>
|
||||||
|
</service>
|
||||||
|
<service>
|
||||||
|
<serviceType>urn:schemas-upnp-org:service:tvpicture:1</serviceType>
|
||||||
|
<serviceId>urn:upnp-org:serviceId:tvpicture1</serviceId>
|
||||||
|
<controlURL>/upnp/control/tvpicture1</controlURL>
|
||||||
|
<eventSubURL>/upnp/event/tvpicture1</eventSubURL>
|
||||||
|
<SCPDURL>/tvpictureSCPD.xml</SCPDURL>
|
||||||
|
</service>
|
||||||
|
</serviceList>
|
||||||
|
<presentationURL>/tvdevicepres.html</presentationURL>
|
||||||
|
</device>
|
||||||
|
</root>
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
</specVersion>
|
</specVersion>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<actionList>
|
<actionList>
|
||||||
|
|
||||||
<action>
|
<action>
|
||||||
@@ -38,6 +37,12 @@
|
|||||||
<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 />
|
||||||
@@ -45,11 +50,6 @@
|
|||||||
<direction>out</direction>
|
<direction>out</direction>
|
||||||
</argument>
|
</argument>
|
||||||
|
|
||||||
<argument>
|
|
||||||
<name>Channel</name>
|
|
||||||
<relatedStateVariable>Channel</relatedStateVariable>
|
|
||||||
<direction>in</direction>
|
|
||||||
</argument>
|
|
||||||
</argumentList>
|
</argumentList>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
@@ -80,6 +80,11 @@
|
|||||||
<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>
|
||||||
@@ -87,11 +92,6 @@
|
|||||||
<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,9 +124,6 @@
|
|||||||
|
|
||||||
</actionList>
|
</actionList>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<serviceStateTable>
|
<serviceStateTable>
|
||||||
|
|
||||||
<stateVariable sendEvents="yes">
|
<stateVariable sendEvents="yes">
|
||||||
@@ -12,6 +12,12 @@
|
|||||||
<action>
|
<action>
|
||||||
<name>SetColor</name>
|
<name>SetColor</name>
|
||||||
<argumentList>
|
<argumentList>
|
||||||
|
<argument>
|
||||||
|
<name>Color</name>
|
||||||
|
<relatedStateVariable>Color</relatedStateVariable>
|
||||||
|
<direction>in</direction>
|
||||||
|
</argument>
|
||||||
|
|
||||||
<argument>
|
<argument>
|
||||||
<name>NewColor</name>
|
<name>NewColor</name>
|
||||||
<retval />
|
<retval />
|
||||||
@@ -19,11 +25,6 @@
|
|||||||
<direction>out</direction>
|
<direction>out</direction>
|
||||||
</argument>
|
</argument>
|
||||||
|
|
||||||
<argument>
|
|
||||||
<name>Color</name>
|
|
||||||
<relatedStateVariable>Color</relatedStateVariable>
|
|
||||||
<direction>in</direction>
|
|
||||||
</argument>
|
|
||||||
</argumentList>
|
</argumentList>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
@@ -54,6 +55,11 @@
|
|||||||
<action>
|
<action>
|
||||||
<name>SetTint</name>
|
<name>SetTint</name>
|
||||||
<argumentList>
|
<argumentList>
|
||||||
|
<argument>
|
||||||
|
<name>Tint</name>
|
||||||
|
<relatedStateVariable>Tint</relatedStateVariable>
|
||||||
|
<direction>in</direction>
|
||||||
|
</argument>
|
||||||
<argument>
|
<argument>
|
||||||
<name>NewTint</name>
|
<name>NewTint</name>
|
||||||
<retval />
|
<retval />
|
||||||
@@ -61,11 +67,6 @@
|
|||||||
<direction>out</direction>
|
<direction>out</direction>
|
||||||
</argument>
|
</argument>
|
||||||
|
|
||||||
<argument>
|
|
||||||
<name>Tint</name>
|
|
||||||
<relatedStateVariable>Tint</relatedStateVariable>
|
|
||||||
<direction>in</direction>
|
|
||||||
</argument>
|
|
||||||
</argumentList>
|
</argumentList>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
@@ -96,17 +97,17 @@
|
|||||||
<action>
|
<action>
|
||||||
<name>SetContrast</name>
|
<name>SetContrast</name>
|
||||||
<argumentList>
|
<argumentList>
|
||||||
|
<argument>
|
||||||
|
<name>Contrast</name>
|
||||||
|
<relatedStateVariable>Contrast</relatedStateVariable>
|
||||||
|
<direction>in</direction>
|
||||||
|
</argument>
|
||||||
<argument>
|
<argument>
|
||||||
<name>NewContrast</name>
|
<name>NewContrast</name>
|
||||||
<retval />
|
<retval />
|
||||||
<relatedStateVariable>Contrast</relatedStateVariable>
|
<relatedStateVariable>Contrast</relatedStateVariable>
|
||||||
<direction>out</direction>
|
<direction>out</direction>
|
||||||
</argument>
|
</argument>
|
||||||
<argument>
|
|
||||||
<name>Contrast</name>
|
|
||||||
<relatedStateVariable>Contrast</relatedStateVariable>
|
|
||||||
<direction>in</direction>
|
|
||||||
</argument>
|
|
||||||
</argumentList>
|
</argumentList>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
@@ -137,19 +138,17 @@
|
|||||||
<action>
|
<action>
|
||||||
<name>SetBrightness</name>
|
<name>SetBrightness</name>
|
||||||
<argumentList>
|
<argumentList>
|
||||||
|
<argument>
|
||||||
|
<name>Brightness</name>
|
||||||
|
<relatedStateVariable>Brightness</relatedStateVariable>
|
||||||
|
<direction>in</direction>
|
||||||
|
</argument>
|
||||||
<argument>
|
<argument>
|
||||||
<name>NewBrightness</name>
|
<name>NewBrightness</name>
|
||||||
<retval />
|
<retval />
|
||||||
<relatedStateVariable>Brightness</relatedStateVariable>
|
<relatedStateVariable>Brightness</relatedStateVariable>
|
||||||
<direction>out</direction>
|
<direction>out</direction>
|
||||||
</argument>
|
</argument>
|
||||||
|
|
||||||
<argument>
|
|
||||||
<name>Brightness</name>
|
|
||||||
<relatedStateVariable>Brightness</relatedStateVariable>
|
|
||||||
<direction>in</direction>
|
|
||||||
</argument>
|
|
||||||
</argumentList>
|
</argumentList>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
@@ -182,7 +181,6 @@
|
|||||||
</actionList>
|
</actionList>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<serviceStateTable>
|
<serviceStateTable>
|
||||||
|
|
||||||
<stateVariable sendEvents="yes">
|
<stateVariable sendEvents="yes">
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -94,12 +94,13 @@ UpnpSetLogFileNames ( IN const char *ErrFileName,
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This functions initializes the log files
|
* This functions initializes the log files
|
||||||
|
*
|
||||||
* Returns: int
|
* Returns: int
|
||||||
* -1 : If fails
|
* -1 : If fails
|
||||||
* UPNP_E_SUCCESS : if success
|
* UPNP_E_SUCCESS : if success
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int
|
int
|
||||||
UpnpInitLog( )
|
UpnpInitLog()
|
||||||
{
|
{
|
||||||
ithread_mutex_init( &GlobalDebugMutex, NULL );
|
ithread_mutex_init( &GlobalDebugMutex, NULL );
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ UpnpInitLog( )
|
|||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Function : UpnpSetLogLevel
|
* Function : UpnpSetLogLevel
|
||||||
*
|
*
|
||||||
* Parameters: void
|
* Parameters: Upnp_LogLevel log_level
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This functions set the log level (see {\tt Upnp_LogLevel}
|
* This functions set the log level (see {\tt Upnp_LogLevel}
|
||||||
@@ -139,7 +140,7 @@ UpnpSetLogLevel (Upnp_LogLevel log_level)
|
|||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void
|
void
|
||||||
UpnpCloseLog( )
|
UpnpCloseLog()
|
||||||
{
|
{
|
||||||
if( DEBUG_TARGET == 1 ) {
|
if( DEBUG_TARGET == 1 ) {
|
||||||
fflush( ErrFileHnd );
|
fflush( ErrFileHnd );
|
||||||
@@ -152,11 +153,47 @@ UpnpCloseLog( )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Function : DebugAtThisLevel
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide
|
||||||
|
* whether debug statement will go to standard output,
|
||||||
|
* or any of the log files.
|
||||||
|
* IN Dbg_Module Module: debug will go in the name of this module
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* This functions returns true if debug output should be done in this
|
||||||
|
* module.
|
||||||
|
*
|
||||||
|
* Returns: int
|
||||||
|
***************************************************************************/
|
||||||
|
#ifdef DEBUG
|
||||||
|
int DebugAtThisLevel(
|
||||||
|
IN Upnp_LogLevel DLevel,
|
||||||
|
IN Dbg_Module Module)
|
||||||
|
{
|
||||||
|
int ret = DLevel <= g_log_level;
|
||||||
|
ret &=
|
||||||
|
DEBUG_ALL ||
|
||||||
|
(Module == SSDP && DEBUG_SSDP ) ||
|
||||||
|
(Module == SOAP && DEBUG_SOAP ) ||
|
||||||
|
(Module == GENA && DEBUG_GENA ) ||
|
||||||
|
(Module == TPOOL && DEBUG_TPOOL) ||
|
||||||
|
(Module == MSERV && DEBUG_MSERV) ||
|
||||||
|
(Module == DOM && DEBUG_DOM ) ||
|
||||||
|
(Module == HTTP && DEBUG_HTTP );
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Function : UpnpPrintf
|
* Function : UpnpPrintf
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN Dbg_Level DLevel: The level of the debug logging. It will decide
|
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide
|
||||||
* whether debug statement will go to standard output,
|
* whether debug statement will go to standard output,
|
||||||
* or any of the log files.
|
* or any of the log files.
|
||||||
* IN Dbg_Module Module: debug will go in the name of this module
|
* IN Dbg_Module Module: debug will go in the name of this module
|
||||||
@@ -173,71 +210,53 @@ UpnpCloseLog( )
|
|||||||
* statement is coming
|
* statement is coming
|
||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
DBGONLY( void UpnpPrintf( IN Upnp_LogLevel DLevel,
|
#ifdef DEBUG
|
||||||
|
void UpnpPrintf(
|
||||||
|
IN Upnp_LogLevel DLevel,
|
||||||
IN Dbg_Module Module,
|
IN Dbg_Module Module,
|
||||||
IN const char *DbgFileName,
|
IN const char *DbgFileName,
|
||||||
IN int DbgLineNo,
|
IN int DbgLineNo,
|
||||||
IN const char *FmtStr,
|
IN const char *FmtStr,
|
||||||
... ) {
|
... )
|
||||||
|
{
|
||||||
va_list ArgList;
|
va_list ArgList;
|
||||||
va_start( ArgList, FmtStr );
|
|
||||||
if( g_log_level < DLevel ) return; if( DEBUG_ALL == 0 ) {
|
if (!DebugAtThisLevel(DLevel, Module)) {
|
||||||
switch ( Module ) {
|
return;
|
||||||
case SSDP:
|
|
||||||
if( DEBUG_SSDP == 1 ) break;
|
|
||||||
else
|
|
||||||
return; case SOAP:
|
|
||||||
if( DEBUG_SOAP == 1 ) break;
|
|
||||||
else
|
|
||||||
return; case GENA:
|
|
||||||
if( DEBUG_GENA == 1 ) break;
|
|
||||||
else
|
|
||||||
return; case TPOOL:
|
|
||||||
if( DEBUG_TPOOL == 1 ) break;
|
|
||||||
else
|
|
||||||
return; case MSERV:
|
|
||||||
if( DEBUG_MSERV == 1 ) break;
|
|
||||||
else
|
|
||||||
return; case DOM:
|
|
||||||
if( DEBUG_DOM == 1 ) break;
|
|
||||||
else
|
|
||||||
return; case HTTP:
|
|
||||||
if( DEBUG_HTTP == 1 ) break;
|
|
||||||
else
|
|
||||||
return; case API:
|
|
||||||
if( DEBUG_API == 1 ) break;
|
|
||||||
else
|
|
||||||
return; default:
|
|
||||||
return;}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ithread_mutex_lock( &GlobalDebugMutex ); if( DEBUG_TARGET == 0 ) {
|
ithread_mutex_lock(&GlobalDebugMutex);
|
||||||
|
va_start(ArgList, FmtStr);
|
||||||
|
if (!DEBUG_TARGET) {
|
||||||
if( DbgFileName ) {
|
if( DbgFileName ) {
|
||||||
UpnpDisplayFileAndLine( stdout, DbgFileName, DbgLineNo );}
|
UpnpDisplayFileAndLine(stdout, DbgFileName, DbgLineNo);
|
||||||
vfprintf( stdout, FmtStr, ArgList ); fflush( stdout );}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( DLevel == 0 ) {
|
|
||||||
if( DbgFileName ) {
|
|
||||||
UpnpDisplayFileAndLine( ErrFileHnd, DbgFileName, DbgLineNo );}
|
|
||||||
vfprintf( ErrFileHnd, FmtStr, ArgList ); fflush( ErrFileHnd );}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( DbgFileName ) {
|
|
||||||
UpnpDisplayFileAndLine( InfoFileHnd, DbgFileName, DbgLineNo );}
|
|
||||||
vfprintf( InfoFileHnd, FmtStr, ArgList ); fflush( InfoFileHnd );}
|
|
||||||
}
|
}
|
||||||
va_end( ArgList ); ithread_mutex_unlock( &GlobalDebugMutex );}
|
vfprintf(stdout, FmtStr, ArgList);
|
||||||
|
fflush(stdout);
|
||||||
)
|
} else if (DLevel == 0) {
|
||||||
|
if (DbgFileName) {
|
||||||
|
UpnpDisplayFileAndLine(ErrFileHnd, DbgFileName, DbgLineNo);
|
||||||
|
}
|
||||||
|
vfprintf(ErrFileHnd, FmtStr, ArgList);
|
||||||
|
fflush(ErrFileHnd);
|
||||||
|
} else {
|
||||||
|
if (DbgFileName) {
|
||||||
|
UpnpDisplayFileAndLine(InfoFileHnd, DbgFileName, DbgLineNo);
|
||||||
|
}
|
||||||
|
vfprintf(InfoFileHnd, FmtStr, ArgList);
|
||||||
|
fflush(InfoFileHnd);
|
||||||
|
}
|
||||||
|
va_end(ArgList);
|
||||||
|
ithread_mutex_unlock(&GlobalDebugMutex);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Function : UpnpGetDebugFile
|
* Function : UpnpGetDebugFile
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN Dbg_Level DLevel: The level of the debug logging. It will decide
|
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide
|
||||||
* whether debug statement will go to standard output,
|
* whether debug statement will go to standard output,
|
||||||
* or any of the log files.
|
* or any of the log files.
|
||||||
* IN Dbg_Module Module: debug will go in the name of this module
|
* IN Dbg_Module Module: debug will go in the name of this module
|
||||||
@@ -249,46 +268,26 @@ return; default:
|
|||||||
* NULL : if the module is turn off for debug
|
* NULL : if the module is turn off for debug
|
||||||
* else returns the right file descriptor
|
* else returns the right file descriptor
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
DBGONLY( FILE * GetDebugFile( Upnp_LogLevel DLevel, Dbg_Module Module ) {
|
#ifdef DEBUG
|
||||||
if( g_log_level < DLevel ) return NULL; if( DEBUG_ALL == 0 ) {
|
FILE *GetDebugFile( Upnp_LogLevel DLevel, Dbg_Module Module )
|
||||||
switch ( Module ) {
|
{
|
||||||
case SSDP:
|
FILE *ret;
|
||||||
if( DEBUG_SSDP == 1 ) break;
|
|
||||||
else
|
if (!DebugAtThisLevel(DLevel, Module)) {
|
||||||
return NULL; case SOAP:
|
ret = NULL;
|
||||||
if( DEBUG_SOAP == 1 ) break;
|
|
||||||
else
|
|
||||||
return NULL; case GENA:
|
|
||||||
if( DEBUG_GENA == 1 ) break;
|
|
||||||
else
|
|
||||||
return NULL; case TPOOL:
|
|
||||||
if( DEBUG_TPOOL == 1 ) break;
|
|
||||||
else
|
|
||||||
return NULL; case MSERV:
|
|
||||||
if( DEBUG_MSERV == 1 ) break;
|
|
||||||
else
|
|
||||||
return NULL; case DOM:
|
|
||||||
if( DEBUG_DOM == 1 ) break;
|
|
||||||
else
|
|
||||||
return NULL; case API:
|
|
||||||
if( DEBUG_API == 1 ) break;
|
|
||||||
else
|
|
||||||
return NULL; default:
|
|
||||||
return NULL;}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( DEBUG_TARGET == 0 ) {
|
if (!DEBUG_TARGET) {
|
||||||
return stdout;}
|
ret = stdout;
|
||||||
else
|
} else if (DLevel == 0) {
|
||||||
{
|
ret = ErrFileHnd;
|
||||||
if( DLevel == 0 ) {
|
} else {
|
||||||
return ErrFileHnd;}
|
ret = InfoFileHnd;
|
||||||
else
|
|
||||||
{
|
|
||||||
return InfoFileHnd;}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
)
|
return ret;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@@ -305,17 +304,39 @@ return NULL; default:
|
|||||||
* debug statement is coming to the log file
|
* debug statement is coming to the log file
|
||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
DBGONLY( void UpnpDisplayFileAndLine( IN FILE * fd,
|
#ifdef DEBUG
|
||||||
|
void UpnpDisplayFileAndLine(
|
||||||
|
IN FILE * fd,
|
||||||
IN const char *DbgFileName,
|
IN const char *DbgFileName,
|
||||||
IN int DbgLineNo ) {
|
IN int DbgLineNo)
|
||||||
int starlength = 66;
|
{
|
||||||
const char *lines[2];
|
#define NLINES 2
|
||||||
char FileAndLine[500]; lines[0] = "DEBUG"; if( DbgFileName ) {
|
#define MAX_LINE_SIZE 512
|
||||||
sprintf( FileAndLine, "FILE: %s, LINE: %d", DbgFileName,
|
#define NUMBER_OF_STARS 80
|
||||||
DbgLineNo ); lines[1] = FileAndLine;}
|
const char *lines[NLINES];
|
||||||
|
char buf[NLINES][MAX_LINE_SIZE];
|
||||||
|
int i;
|
||||||
|
|
||||||
UpnpDisplayBanner( fd, lines, 2, starlength ); fflush( fd );}
|
/* Initialize the pointer array */
|
||||||
)
|
for (i = 0; i < NLINES; i++) {
|
||||||
|
lines[i] = buf[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Put the debug lines in the buffer */
|
||||||
|
sprintf(buf[0], "DEBUG - THREAD ID: 0x%lX",
|
||||||
|
(unsigned long int)ithread_self());
|
||||||
|
if (DbgFileName) {
|
||||||
|
sprintf(buf[1],
|
||||||
|
"FILE: %s, LINE: %d",
|
||||||
|
DbgFileName,
|
||||||
|
DbgLineNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Show the lines centered */
|
||||||
|
UpnpDisplayBanner(fd, lines, NLINES, NUMBER_OF_STARS);
|
||||||
|
fflush(fd);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@@ -332,47 +353,58 @@ return NULL; default:
|
|||||||
* per the requested banner
|
* per the requested banner
|
||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
DBGONLY( void UpnpDisplayBanner( IN FILE * fd,
|
#ifdef DEBUG
|
||||||
|
void UpnpDisplayBanner(
|
||||||
|
IN FILE * fd,
|
||||||
IN const char **lines,
|
IN const char **lines,
|
||||||
IN size_t size,
|
IN size_t size,
|
||||||
IN int starLength ) {
|
IN int starLength)
|
||||||
char *stars = ( char * )malloc( starLength + 1 );
|
{
|
||||||
const char *line = NULL;
|
|
||||||
int leftMarginLength = starLength / 2 + 1;
|
int leftMarginLength = starLength / 2 + 1;
|
||||||
int rightMarginLength = starLength / 2 + 1;
|
int rightMarginLength = starLength / 2 + 1;
|
||||||
char *leftMargin = ( char * )malloc( leftMarginLength );
|
|
||||||
char *rightMargin = ( char * )malloc( rightMarginLength );
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int LineSize = 0;
|
int LineSize = 0;
|
||||||
|
int starLengthMinus2 = starLength - 2;
|
||||||
|
|
||||||
|
char *leftMargin = ( char * )malloc( leftMarginLength );
|
||||||
|
char *rightMargin = ( char * )malloc( rightMarginLength );
|
||||||
|
char *stars = ( char * )malloc( starLength + 1 );
|
||||||
char *currentLine = ( char * )malloc( starLength + 1 );
|
char *currentLine = ( char * )malloc( starLength + 1 );
|
||||||
|
const char *line = NULL;
|
||||||
|
|
||||||
memset( stars, '*', starLength );
|
memset( stars, '*', starLength );
|
||||||
stars[starLength] = 0;
|
stars[starLength] = 0;
|
||||||
memset( leftMargin, 0, leftMarginLength );
|
memset( leftMargin, 0, leftMarginLength );
|
||||||
memset( rightMargin, 0, rightMarginLength );
|
memset( rightMargin, 0, rightMarginLength );
|
||||||
fprintf( fd, "\n%s\n", stars ); for( i = 0; i < size; i++ ) {
|
fprintf( fd, "\n%s\n", stars );
|
||||||
|
for( i = 0; i < size; i++ ) {
|
||||||
LineSize = strlen( lines[i] );
|
LineSize = strlen( lines[i] );
|
||||||
line = lines[i]; while( LineSize > ( starLength - 2 ) ) {
|
line = lines[i];
|
||||||
memcpy( currentLine, line, ( starLength - 2 ) );
|
while( LineSize > starLengthMinus2 ) {
|
||||||
currentLine[( starLength - 2 )] = 0;
|
memcpy( currentLine, line, starLengthMinus2 );
|
||||||
|
currentLine[starLengthMinus2] = 0;
|
||||||
fprintf( fd, "*%s*\n", currentLine );
|
fprintf( fd, "*%s*\n", currentLine );
|
||||||
LineSize -= ( starLength - 2 ); line += ( starLength - 2 );}
|
LineSize -= starLengthMinus2;
|
||||||
|
line += starLengthMinus2;
|
||||||
|
}
|
||||||
|
leftMarginLength = (starLengthMinus2 - LineSize)/2;
|
||||||
if( LineSize % 2 == 0 ) {
|
if( LineSize % 2 == 0 ) {
|
||||||
leftMarginLength = rightMarginLength =
|
rightMarginLength = leftMarginLength;
|
||||||
( ( starLength - 2 ) - LineSize ) / 2;}
|
} else {
|
||||||
else
|
rightMarginLength = leftMarginLength + 1;
|
||||||
{
|
}
|
||||||
leftMarginLength = ( ( starLength - 2 ) - LineSize ) / 2;
|
|
||||||
rightMarginLength =
|
|
||||||
( ( starLength - 2 ) - LineSize ) / 2 + 1;}
|
|
||||||
|
|
||||||
memset( leftMargin, ' ', leftMarginLength );
|
memset( leftMargin, ' ', leftMarginLength );
|
||||||
memset( rightMargin, ' ', rightMarginLength );
|
memset( rightMargin, ' ', rightMarginLength );
|
||||||
leftMargin[leftMarginLength] = 0;
|
leftMargin[leftMarginLength] = 0;
|
||||||
rightMargin[rightMarginLength] = 0;
|
rightMargin[rightMarginLength] = 0;
|
||||||
fprintf( fd, "*%s%s%s*\n", leftMargin, line, rightMargin );}
|
fprintf( fd, "*%s%s%s*\n", leftMargin, line, rightMargin );
|
||||||
|
}
|
||||||
fprintf( fd, "%s\n\n", stars );
|
fprintf( fd, "%s\n\n", stars );
|
||||||
|
|
||||||
|
free( currentLine );
|
||||||
|
free( stars );
|
||||||
|
free( rightMargin );
|
||||||
free( leftMargin );
|
free( leftMargin );
|
||||||
free( rightMargin ); free( stars ); free( currentLine );}
|
}
|
||||||
)
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#include "uri.h"
|
#include "uri.h"
|
||||||
#define HEADER_LENGTH 2000
|
#define HEADER_LENGTH 2000
|
||||||
|
|
||||||
//Structure to maintain a error code and string associated with the
|
// Structure to maintain a error code and string associated with the
|
||||||
// error code
|
// error code
|
||||||
struct ErrorString {
|
struct ErrorString {
|
||||||
int rc; /* error code */
|
int rc; /* error code */
|
||||||
@@ -44,7 +44,7 @@ struct ErrorString {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//Intializing the array of error structures.
|
// Initializing the array of error structures.
|
||||||
struct ErrorString ErrorMessages[] = { {UPNP_E_SUCCESS, "UPNP_E_SUCCESS"},
|
struct ErrorString ErrorMessages[] = { {UPNP_E_SUCCESS, "UPNP_E_SUCCESS"},
|
||||||
{UPNP_E_INVALID_HANDLE, "UPNP_E_INVALID_HANDLE"},
|
{UPNP_E_INVALID_HANDLE, "UPNP_E_INVALID_HANDLE"},
|
||||||
{UPNP_E_INVALID_PARAM, "UPNP_E_INVALID_PARAM"},
|
{UPNP_E_INVALID_PARAM, "UPNP_E_INVALID_PARAM"},
|
||||||
@@ -256,8 +256,8 @@ makeAction( IN int response,
|
|||||||
IN const char *Arg,
|
IN const char *Arg,
|
||||||
IN va_list ArgList )
|
IN va_list ArgList )
|
||||||
{
|
{
|
||||||
const char *ArgName,
|
const char *ArgName;
|
||||||
*ArgValue;
|
const char *ArgValue;
|
||||||
char *ActBuff;
|
char *ActBuff;
|
||||||
int Idx = 0;
|
int Idx = 0;
|
||||||
IXML_Document *ActionDoc;
|
IXML_Document *ActionDoc;
|
||||||
@@ -298,7 +298,7 @@ makeAction( IN int response,
|
|||||||
if( NumArg > 0 ) {
|
if( NumArg > 0 ) {
|
||||||
//va_start(ArgList, Arg);
|
//va_start(ArgList, Arg);
|
||||||
ArgName = Arg;
|
ArgName = Arg;
|
||||||
while( Idx++ != NumArg ) {
|
for ( ; ; ) {
|
||||||
ArgValue = va_arg( ArgList, const char * );
|
ArgValue = va_arg( ArgList, const char * );
|
||||||
|
|
||||||
if( ArgName != NULL ) {
|
if( ArgName != NULL ) {
|
||||||
@@ -313,7 +313,11 @@ makeAction( IN int response,
|
|||||||
ixmlNode_appendChild( node, ( IXML_Node * ) Ele );
|
ixmlNode_appendChild( node, ( IXML_Node * ) Ele );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (++Idx < NumArg) {
|
||||||
ArgName = va_arg( ArgList, const char * );
|
ArgName = va_arg( ArgList, const char * );
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//va_end(ArgList);
|
//va_end(ArgList);
|
||||||
}
|
}
|
||||||
@@ -577,4 +581,5 @@ UpnpCreatePropertySet( IN int NumArg,
|
|||||||
return PropSet;
|
return PropSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // EXCLUDE_DOM == 0
|
||||||
|
|
||||||
|
|||||||
@@ -93,37 +93,35 @@ genaCallback( IN http_parser_t * parser,
|
|||||||
xboolean found_function = FALSE;
|
xboolean found_function = FALSE;
|
||||||
|
|
||||||
if( request->method == HTTPMETHOD_SUBSCRIBE ) {
|
if( request->method == HTTPMETHOD_SUBSCRIBE ) {
|
||||||
DEVICEONLY( found_function = TRUE;
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
if( httpmsg_find_hdr( request, HDR_NT, NULL ) == NULL )
|
found_function = TRUE;
|
||||||
{
|
if( httpmsg_find_hdr( request, HDR_NT, NULL ) == NULL ) {
|
||||||
// renew subscription
|
// renew subscription
|
||||||
gena_process_subscription_renewal_request
|
gena_process_subscription_renewal_request
|
||||||
( info, request );}
|
( info, request );
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
// subscribe
|
// subscribe
|
||||||
gena_process_subscription_request( info, request );}
|
gena_process_subscription_request( info, request );
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf
|
|
||||||
( UPNP_ALL, GENA, __FILE__, __LINE__,
|
|
||||||
"got subscription request\n" ); )
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
else
|
UpnpPrintf( UPNP_ALL, GENA, __FILE__, __LINE__,
|
||||||
if( request->method == HTTPMETHOD_UNSUBSCRIBE ) {
|
"got subscription request\n" );
|
||||||
DEVICEONLY( found_function = TRUE;
|
} else if( request->method == HTTPMETHOD_UNSUBSCRIBE ) {
|
||||||
|
found_function = TRUE;
|
||||||
// unsubscribe
|
// unsubscribe
|
||||||
gena_process_unsubscribe_request( info,
|
gena_process_unsubscribe_request( info, request );
|
||||||
request ); )
|
#endif
|
||||||
} else if( request->method == HTTPMETHOD_NOTIFY ) {
|
} else if( request->method == HTTPMETHOD_NOTIFY ) {
|
||||||
CLIENTONLY( found_function = TRUE;
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
|
found_function = TRUE;
|
||||||
// notify
|
// notify
|
||||||
gena_process_notification_event( info, request ); )
|
gena_process_notification_event( info, request );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !found_function ) {
|
if( !found_function ) {
|
||||||
// handle missing functions of device or ctrl pt
|
// handle missing functions of device or ctrl pt
|
||||||
error_respond( info, HTTP_NOT_IMPLEMENTED, request );
|
error_respond( info, HTTP_NOT_IMPLEMENTED, request );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // EXCLUDE_GENA
|
#endif // EXCLUDE_GENA
|
||||||
|
|
||||||
|
|||||||
@@ -72,14 +72,14 @@ GenaAutoRenewSubscription( IN void *input )
|
|||||||
int eventType = 0;
|
int eventType = 0;
|
||||||
|
|
||||||
if( AUTO_RENEW_TIME == 0 ) {
|
if( AUTO_RENEW_TIME == 0 ) {
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"GENA SUB EXPIRED" ) );
|
"GENA SUB EXPIRED" );
|
||||||
sub_struct->ErrCode = UPNP_E_SUCCESS;
|
sub_struct->ErrCode = UPNP_E_SUCCESS;
|
||||||
send_callback = 1;
|
send_callback = 1;
|
||||||
eventType = UPNP_EVENT_SUBSCRIPTION_EXPIRED;
|
eventType = UPNP_EVENT_SUBSCRIPTION_EXPIRED;
|
||||||
} else {
|
} else {
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"GENA AUTO RENEW" ) );
|
"GENA AUTO RENEW" );
|
||||||
if( ( ( sub_struct->ErrCode = genaRenewSubscription( event->handle,
|
if( ( ( sub_struct->ErrCode = genaRenewSubscription( event->handle,
|
||||||
sub_struct->
|
sub_struct->
|
||||||
Sid,
|
Sid,
|
||||||
@@ -93,17 +93,17 @@ GenaAutoRenewSubscription( IN void *input )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( send_callback ) {
|
if( send_callback ) {
|
||||||
HandleLock( );
|
HandleReadLock();
|
||||||
if( GetHandleInfo( event->handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( event->handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
free_upnp_timeout( event );
|
free_upnp_timeout( event );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"HANDLE IS VALID" ) );
|
"HANDLE IS VALID" );
|
||||||
callback_fun = handle_info->Callback;
|
callback_fun = handle_info->Callback;
|
||||||
cookie = handle_info->Cookie;
|
cookie = handle_info->Cookie;
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
//make callback
|
//make callback
|
||||||
|
|
||||||
callback_fun( eventType, event->Event, cookie );
|
callback_fun( eventType, event->Event, cookie );
|
||||||
@@ -397,9 +397,9 @@ genaUnregisterClient( IN UpnpClient_Handle client_handle )
|
|||||||
http_parser_t response;
|
http_parser_t response;
|
||||||
|
|
||||||
while( TRUE ) {
|
while( TRUE ) {
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_HANDLE;
|
return GENA_E_BAD_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,7 +417,7 @@ genaUnregisterClient( IN UpnpClient_Handle client_handle )
|
|||||||
RemoveClientSubClientSID( &handle_info->ClientSubList,
|
RemoveClientSubClientSID( &handle_info->ClientSubList,
|
||||||
sub_copy.sid );
|
sub_copy.sid );
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
return_code = gena_unsubscribe( sub_copy.EventURL,
|
return_code = gena_unsubscribe( sub_copy.EventURL,
|
||||||
sub_copy.ActualSID, &response );
|
sub_copy.ActualSID, &response );
|
||||||
@@ -429,7 +429,7 @@ genaUnregisterClient( IN UpnpClient_Handle client_handle )
|
|||||||
}
|
}
|
||||||
|
|
||||||
freeClientSubList( handle_info->ClientSubList );
|
freeClientSubList( handle_info->ClientSubList );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,6 +449,7 @@ genaUnregisterClient( IN UpnpClient_Handle client_handle )
|
|||||||
* return UPNP_E_SUCCESS if service response is OK else
|
* return UPNP_E_SUCCESS if service response is OK else
|
||||||
* returns appropriate error
|
* returns appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
int
|
int
|
||||||
genaUnSubscribe( IN UpnpClient_Handle client_handle,
|
genaUnSubscribe( IN UpnpClient_Handle client_handle,
|
||||||
IN const Upnp_SID in_sid )
|
IN const Upnp_SID in_sid )
|
||||||
@@ -459,25 +460,25 @@ genaUnSubscribe( IN UpnpClient_Handle client_handle,
|
|||||||
client_subscription sub_copy;
|
client_subscription sub_copy;
|
||||||
http_parser_t response;
|
http_parser_t response;
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
// validate handle and sid
|
// validate handle and sid
|
||||||
|
|
||||||
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_HANDLE;
|
return GENA_E_BAD_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( sub =
|
if( ( sub =
|
||||||
GetClientSubClientSID( handle_info->ClientSubList, in_sid ) )
|
GetClientSubClientSID( handle_info->ClientSubList, in_sid ) )
|
||||||
== NULL ) {
|
== NULL ) {
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_SID;
|
return GENA_E_BAD_SID;
|
||||||
}
|
}
|
||||||
|
|
||||||
return_code = copy_client_subscription( sub, &sub_copy );
|
return_code = copy_client_subscription( sub, &sub_copy );
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
return_code = gena_unsubscribe( sub_copy.EventURL, sub_copy.ActualSID,
|
return_code = gena_unsubscribe( sub_copy.EventURL, sub_copy.ActualSID,
|
||||||
&response );
|
&response );
|
||||||
@@ -488,19 +489,20 @@ genaUnSubscribe( IN UpnpClient_Handle client_handle,
|
|||||||
|
|
||||||
free_client_subscription( &sub_copy );
|
free_client_subscription( &sub_copy );
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_HANDLE;
|
return GENA_E_BAD_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveClientSubClientSID( &handle_info->ClientSubList, in_sid );
|
RemoveClientSubClientSID( &handle_info->ClientSubList, in_sid );
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : genaSubscribe
|
* Function : genaSubscribe
|
||||||
@@ -524,6 +526,7 @@ genaUnSubscribe( IN UpnpClient_Handle client_handle,
|
|||||||
* return UPNP_E_SUCCESS if service response is OK else
|
* return UPNP_E_SUCCESS if service response is OK else
|
||||||
* returns appropriate error
|
* returns appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
int
|
int
|
||||||
genaSubscribe( IN UpnpClient_Handle client_handle,
|
genaSubscribe( IN UpnpClient_Handle client_handle,
|
||||||
IN char *PublisherURL,
|
IN char *PublisherURL,
|
||||||
@@ -538,28 +541,28 @@ genaSubscribe( IN UpnpClient_Handle client_handle,
|
|||||||
struct Handle_Info *handle_info;
|
struct Handle_Info *handle_info;
|
||||||
char *EventURL = NULL;
|
char *EventURL = NULL;
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"GENA SUBSCRIBE BEGIN" ) );
|
"GENA SUBSCRIBE BEGIN" );
|
||||||
HandleLock( );
|
|
||||||
|
|
||||||
memset( out_sid, 0, sizeof( Upnp_SID ) );
|
memset( out_sid, 0, sizeof( Upnp_SID ) );
|
||||||
|
|
||||||
|
HandleReadLock();
|
||||||
// validate handle
|
// validate handle
|
||||||
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_HANDLE;
|
return GENA_E_BAD_HANDLE;
|
||||||
}
|
}
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
// subscribe
|
// subscribe
|
||||||
SubscribeLock( );
|
SubscribeLock();
|
||||||
return_code =
|
return_code =
|
||||||
gena_subscribe( PublisherURL, TimeOut, NULL, &ActualSID );
|
gena_subscribe( PublisherURL, TimeOut, NULL, &ActualSID );
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
if( return_code != UPNP_E_SUCCESS ) {
|
if( return_code != UPNP_E_SUCCESS ) {
|
||||||
DBGONLY( UpnpPrintf( UPNP_CRITICAL, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_CRITICAL, GENA, __FILE__, __LINE__,
|
||||||
"SUBSCRIBE FAILED in transfer error code: %d returned\n",
|
"SUBSCRIBE FAILED in transfer error code: %d returned\n",
|
||||||
return_code ) );
|
return_code );
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -605,10 +608,11 @@ genaSubscribe( IN UpnpClient_Handle client_handle,
|
|||||||
free( EventURL );
|
free( EventURL );
|
||||||
free( newSubscription );
|
free( newSubscription );
|
||||||
}
|
}
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
SubscribeUnlock( );
|
SubscribeUnlock();
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : genaRenewSubscription
|
* Function : genaRenewSubscription
|
||||||
@@ -643,17 +647,17 @@ genaRenewSubscription( IN UpnpClient_Handle client_handle,
|
|||||||
char *ActualSID;
|
char *ActualSID;
|
||||||
ThreadPoolJob tempJob;
|
ThreadPoolJob tempJob;
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
// validate handle and sid
|
// validate handle and sid
|
||||||
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_HANDLE;
|
return GENA_E_BAD_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( sub = GetClientSubClientSID( handle_info->ClientSubList,
|
if( ( sub = GetClientSubClientSID( handle_info->ClientSubList,
|
||||||
in_sid ) ) == NULL ) {
|
in_sid ) ) == NULL ) {
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_SID;
|
return GENA_E_BAD_SID;
|
||||||
}
|
}
|
||||||
// remove old events
|
// remove old events
|
||||||
@@ -663,13 +667,13 @@ genaRenewSubscription( IN UpnpClient_Handle client_handle,
|
|||||||
free_upnp_timeout( ( upnp_timeout * ) tempJob.arg );
|
free_upnp_timeout( ( upnp_timeout * ) tempJob.arg );
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"REMOVED AUTO RENEW EVENT" ) );
|
"REMOVED AUTO RENEW EVENT" );
|
||||||
|
|
||||||
sub->RenewEventId = -1;
|
sub->RenewEventId = -1;
|
||||||
return_code = copy_client_subscription( sub, &sub_copy );
|
return_code = copy_client_subscription( sub, &sub_copy );
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
if( return_code != HTTP_SUCCESS ) {
|
if( return_code != HTTP_SUCCESS ) {
|
||||||
return return_code;
|
return return_code;
|
||||||
@@ -677,10 +681,10 @@ genaRenewSubscription( IN UpnpClient_Handle client_handle,
|
|||||||
|
|
||||||
return_code = gena_subscribe( sub_copy.EventURL, TimeOut,
|
return_code = gena_subscribe( sub_copy.EventURL, TimeOut,
|
||||||
sub_copy.ActualSID, &ActualSID );
|
sub_copy.ActualSID, &ActualSID );
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
if( return_code == UPNP_E_SUCCESS ) {
|
if( return_code == UPNP_E_SUCCESS ) {
|
||||||
free( ActualSID );
|
free( ActualSID );
|
||||||
}
|
}
|
||||||
@@ -693,7 +697,7 @@ genaRenewSubscription( IN UpnpClient_Handle client_handle,
|
|||||||
// network failure (remove client sub)
|
// network failure (remove client sub)
|
||||||
RemoveClientSubClientSID( &handle_info->ClientSubList, in_sid );
|
RemoveClientSubClientSID( &handle_info->ClientSubList, in_sid );
|
||||||
free_client_subscription( &sub_copy );
|
free_client_subscription( &sub_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
// get subscription
|
// get subscription
|
||||||
@@ -701,7 +705,7 @@ genaRenewSubscription( IN UpnpClient_Handle client_handle,
|
|||||||
in_sid ) ) == NULL ) {
|
in_sid ) ) == NULL ) {
|
||||||
free( ActualSID );
|
free( ActualSID );
|
||||||
free_client_subscription( &sub_copy );
|
free_client_subscription( &sub_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_SID;
|
return GENA_E_BAD_SID;
|
||||||
}
|
}
|
||||||
// store actual sid
|
// store actual sid
|
||||||
@@ -714,7 +718,7 @@ genaRenewSubscription( IN UpnpClient_Handle client_handle,
|
|||||||
RemoveClientSubClientSID( &handle_info->ClientSubList, sub->sid );
|
RemoveClientSubClientSID( &handle_info->ClientSubList, sub->sid );
|
||||||
}
|
}
|
||||||
free_client_subscription( &sub_copy );
|
free_client_subscription( &sub_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -795,12 +799,12 @@ gena_process_notification_event( IN SOCKINFO * info,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
// get client info
|
// get client info
|
||||||
if( GetClientHandleInfo( &client_handle, &handle_info ) != HND_CLIENT ) {
|
if( GetClientHandleInfo( &client_handle, &handle_info ) != HND_CLIENT ) {
|
||||||
error_respond( info, HTTP_PRECONDITION_FAILED, event );
|
error_respond( info, HTTP_PRECONDITION_FAILED, event );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
ixmlDocument_free( ChangedVars );
|
ixmlDocument_free( ChangedVars );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -813,20 +817,20 @@ gena_process_notification_event( IN SOCKINFO * info,
|
|||||||
// (if we are in the middle)
|
// (if we are in the middle)
|
||||||
// this is to avoid mistakenly rejecting the first event if we
|
// this is to avoid mistakenly rejecting the first event if we
|
||||||
// receive it before the subscription response
|
// receive it before the subscription response
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
// try and get Subscription Lock
|
// try and get Subscription Lock
|
||||||
// (in case we are in the process of subscribing)
|
// (in case we are in the process of subscribing)
|
||||||
SubscribeLock( );
|
SubscribeLock();
|
||||||
|
|
||||||
// get HandleLock again
|
// get HandleLock again
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
if( GetClientHandleInfo( &client_handle, &handle_info )
|
if( GetClientHandleInfo( &client_handle, &handle_info )
|
||||||
!= HND_CLIENT ) {
|
!= HND_CLIENT ) {
|
||||||
error_respond( info, HTTP_PRECONDITION_FAILED, event );
|
error_respond( info, HTTP_PRECONDITION_FAILED, event );
|
||||||
SubscribeUnlock( );
|
SubscribeUnlock();
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
ixmlDocument_free( ChangedVars );
|
ixmlDocument_free( ChangedVars );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -836,17 +840,17 @@ gena_process_notification_event( IN SOCKINFO * info,
|
|||||||
GetClientSubActualSID( handle_info->ClientSubList,
|
GetClientSubActualSID( handle_info->ClientSubList,
|
||||||
&sid ) ) == NULL ) {
|
&sid ) ) == NULL ) {
|
||||||
error_respond( info, HTTP_PRECONDITION_FAILED, event );
|
error_respond( info, HTTP_PRECONDITION_FAILED, event );
|
||||||
SubscribeUnlock( );
|
SubscribeUnlock();
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
ixmlDocument_free( ChangedVars );
|
ixmlDocument_free( ChangedVars );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubscribeUnlock( );
|
SubscribeUnlock();
|
||||||
} else {
|
} else {
|
||||||
error_respond( info, HTTP_PRECONDITION_FAILED, event );
|
error_respond( info, HTTP_PRECONDITION_FAILED, event );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
ixmlDocument_free( ChangedVars );
|
ixmlDocument_free( ChangedVars );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -864,7 +868,7 @@ gena_process_notification_event( IN SOCKINFO * info,
|
|||||||
callback = handle_info->Callback;
|
callback = handle_info->Callback;
|
||||||
cookie = handle_info->Cookie;
|
cookie = handle_info->Cookie;
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
// make callback with event struct
|
// make callback with event struct
|
||||||
// In future, should find a way of mainting
|
// In future, should find a way of mainting
|
||||||
@@ -877,3 +881,4 @@ gena_process_notification_event( IN SOCKINFO * info,
|
|||||||
|
|
||||||
#endif // INCLUDE_CLIENT_APIS
|
#endif // INCLUDE_CLIENT_APIS
|
||||||
#endif // EXCLUDE_GENA
|
#endif // EXCLUDE_GENA
|
||||||
|
|
||||||
|
|||||||
@@ -62,19 +62,19 @@ genaUnregisterDevice( IN UpnpDevice_Handle device_handle )
|
|||||||
{
|
{
|
||||||
struct Handle_Info *handle_info;
|
struct Handle_Info *handle_info;
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_CRITICAL, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_CRITICAL, GENA, __FILE__, __LINE__,
|
||||||
"genaUnregisterDevice : BAD Handle : %d\n",
|
"genaUnregisterDevice : BAD Handle : %d\n",
|
||||||
device_handle ) );
|
device_handle );
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_HANDLE;
|
return GENA_E_BAD_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
freeServiceTable( &handle_info->ServiceTable );
|
freeServiceTable( &handle_info->ServiceTable );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -188,7 +188,7 @@ free_notify_struct( IN notify_thread_struct * input )
|
|||||||
*
|
*
|
||||||
* Note : called by genaNotify
|
* Note : called by genaNotify
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static XINLINE int
|
static UPNP_INLINE int
|
||||||
notify_send_and_recv( IN uri_type * destination_url,
|
notify_send_and_recv( IN uri_type * destination_url,
|
||||||
IN membuffer * mid_msg,
|
IN membuffer * mid_msg,
|
||||||
IN char *propertySet,
|
IN char *propertySet,
|
||||||
@@ -203,10 +203,10 @@ notify_send_and_recv( IN uri_type * destination_url,
|
|||||||
SOCKINFO info;
|
SOCKINFO info;
|
||||||
|
|
||||||
// connect
|
// connect
|
||||||
DBGONLY( UpnpPrintf( UPNP_ALL, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, GENA, __FILE__, __LINE__,
|
||||||
"gena notify to: %.*s\n",
|
"gena notify to: %.*s\n",
|
||||||
destination_url->hostport.text.size,
|
(int)destination_url->hostport.text.size,
|
||||||
destination_url->hostport.text.buff ); )
|
destination_url->hostport.text.buff );
|
||||||
|
|
||||||
conn_fd = http_Connect( destination_url, &url );
|
conn_fd = http_Connect( destination_url, &url );
|
||||||
if( conn_fd < 0 ) {
|
if( conn_fd < 0 ) {
|
||||||
@@ -365,12 +365,12 @@ genaNotifyThread( IN void *input )
|
|||||||
struct Handle_Info *handle_info;
|
struct Handle_Info *handle_info;
|
||||||
ThreadPoolJob job;
|
ThreadPoolJob job;
|
||||||
|
|
||||||
HandleLock( );
|
HandleReadLock();
|
||||||
//validate context
|
//validate context
|
||||||
|
|
||||||
if( GetHandleInfo( in->device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetHandleInfo( in->device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
free_notify_struct( in );
|
free_notify_struct( in );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ genaNotifyThread( IN void *input )
|
|||||||
|| ( ( sub = GetSubscriptionSID( in->sid, service ) ) == NULL )
|
|| ( ( sub = GetSubscriptionSID( in->sid, service ) ) == NULL )
|
||||||
|| ( ( copy_subscription( sub, &sub_copy ) != HTTP_SUCCESS ) ) ) {
|
|| ( ( copy_subscription( sub, &sub_copy ) != HTTP_SUCCESS ) ) ) {
|
||||||
free_notify_struct( in );
|
free_notify_struct( in );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//If the event is out of order push it back to the job queue
|
//If the event is out of order push it back to the job queue
|
||||||
@@ -392,22 +392,22 @@ genaNotifyThread( IN void *input )
|
|||||||
ThreadPoolAdd( &gSendThreadPool, &job, NULL );
|
ThreadPoolAdd( &gSendThreadPool, &job, NULL );
|
||||||
|
|
||||||
freeSubscription( &sub_copy );
|
freeSubscription( &sub_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
//send the notify
|
//send the notify
|
||||||
return_code = genaNotify( in->headers, in->propertySet, &sub_copy );
|
return_code = genaNotify( in->headers, in->propertySet, &sub_copy );
|
||||||
|
|
||||||
freeSubscription( &sub_copy );
|
freeSubscription( &sub_copy );
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
if( GetHandleInfo( in->device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetHandleInfo( in->device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
free_notify_struct( in );
|
free_notify_struct( in );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//validate context
|
//validate context
|
||||||
@@ -416,7 +416,7 @@ genaNotifyThread( IN void *input )
|
|||||||
|| ( !service->active )
|
|| ( !service->active )
|
||||||
|| ( ( sub = GetSubscriptionSID( in->sid, service ) ) == NULL ) ) {
|
|| ( ( sub = GetSubscriptionSID( in->sid, service ) ) == NULL ) ) {
|
||||||
free_notify_struct( in );
|
free_notify_struct( in );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,7 +430,7 @@ genaNotifyThread( IN void *input )
|
|||||||
}
|
}
|
||||||
|
|
||||||
free_notify_struct( in );
|
free_notify_struct( in );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -477,8 +477,8 @@ genaInitNotify( IN UpnpDevice_Handle device_handle,
|
|||||||
|
|
||||||
notify_thread_struct *thread_struct = NULL;
|
notify_thread_struct *thread_struct = NULL;
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"GENA BEGIN INITIAL NOTIFY " ) );
|
"GENA BEGIN INITIAL NOTIFY " );
|
||||||
|
|
||||||
reference_count = ( int * )malloc( sizeof( int ) );
|
reference_count = ( int * )malloc( sizeof( int ) );
|
||||||
|
|
||||||
@@ -504,13 +504,13 @@ genaInitNotify( IN UpnpDevice_Handle device_handle,
|
|||||||
strcpy( UDN_copy, UDN );
|
strcpy( UDN_copy, UDN );
|
||||||
strcpy( servId_copy, servId );
|
strcpy( servId_copy, servId );
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_HANDLE;
|
return GENA_E_BAD_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,26 +519,25 @@ genaInitNotify( IN UpnpDevice_Handle device_handle,
|
|||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_SERVICE;
|
return GENA_E_BAD_SERVICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"FOUND SERVICE IN INIT NOTFY: UDN %s, ServID: %s ",
|
"FOUND SERVICE IN INIT NOTFY: UDN %s, ServID: %s ",
|
||||||
UDN, servId ) );
|
UDN, servId );
|
||||||
|
|
||||||
if( ( ( sub = GetSubscriptionSID( sid, service ) ) == NULL ) ||
|
if( ( ( sub = GetSubscriptionSID( sid, service ) ) == NULL ) ||
|
||||||
( sub->active ) ) {
|
( sub->active ) ) {
|
||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_SID;
|
return GENA_E_BAD_SID;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"FOUND SUBSCRIPTION IN INIT NOTIFY: SID %s ",
|
"FOUND SUBSCRIPTION IN INIT NOTIFY: SID %s ", sid );
|
||||||
sid ) );
|
|
||||||
|
|
||||||
sub->active = 1;
|
sub->active = 1;
|
||||||
|
|
||||||
@@ -549,13 +548,13 @@ genaInitNotify( IN UpnpDevice_Handle device_handle,
|
|||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"GENERATED PROPERY SET IN INIT NOTIFY: \n'%s'\n",
|
"GENERATED PROPERY SET IN INIT NOTIFY: \n'%s'\n",
|
||||||
propertySet ) );
|
propertySet );
|
||||||
|
|
||||||
headers_size = strlen( "CONTENT-TYPE text/xml\r\n" ) +
|
headers_size = strlen( "CONTENT-TYPE text/xml\r\n" ) +
|
||||||
strlen( "CONTENT-LENGTH: \r\n" ) + MAX_CONTENT_LENGTH +
|
strlen( "CONTENT-LENGTH: \r\n" ) + MAX_CONTENT_LENGTH +
|
||||||
@@ -569,12 +568,12 @@ genaInitNotify( IN UpnpDevice_Handle device_handle,
|
|||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( headers, "CONTENT-TYPE: text/xml\r\nCONTENT-LENGTH: "
|
sprintf( headers, "CONTENT-TYPE: text/xml\r\nCONTENT-LENGTH: "
|
||||||
"%zd\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n",
|
"%"PRIzu"\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n",
|
||||||
strlen( propertySet ) + 1 );
|
strlen( propertySet ) + 1 );
|
||||||
|
|
||||||
//schedule thread for initial notification
|
//schedule thread for initial notification
|
||||||
@@ -621,7 +620,7 @@ genaInitNotify( IN UpnpDevice_Handle device_handle,
|
|||||||
free( headers );
|
free( headers );
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
@@ -668,8 +667,8 @@ genaInitNotifyExt( IN UpnpDevice_Handle device_handle,
|
|||||||
|
|
||||||
notify_thread_struct *thread_struct = NULL;
|
notify_thread_struct *thread_struct = NULL;
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"GENA BEGIN INITIAL NOTIFY EXT" ) );
|
"GENA BEGIN INITIAL NOTIFY EXT" );
|
||||||
reference_count = ( int * )malloc( sizeof( int ) );
|
reference_count = ( int * )malloc( sizeof( int ) );
|
||||||
|
|
||||||
if( reference_count == NULL ) {
|
if( reference_count == NULL ) {
|
||||||
@@ -694,13 +693,13 @@ genaInitNotifyExt( IN UpnpDevice_Handle device_handle,
|
|||||||
strcpy( UDN_copy, UDN );
|
strcpy( UDN_copy, UDN );
|
||||||
strcpy( servId_copy, servId );
|
strcpy( servId_copy, servId );
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_HANDLE;
|
return GENA_E_BAD_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -709,24 +708,23 @@ genaInitNotifyExt( IN UpnpDevice_Handle device_handle,
|
|||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_SERVICE;
|
return GENA_E_BAD_SERVICE;
|
||||||
}
|
}
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"FOUND SERVICE IN INIT NOTFY EXT: UDN %s, ServID: %s\n",
|
"FOUND SERVICE IN INIT NOTFY EXT: UDN %s, ServID: %s\n",
|
||||||
UDN, servId ) );
|
UDN, servId );
|
||||||
|
|
||||||
if( ( ( sub = GetSubscriptionSID( sid, service ) ) == NULL ) ||
|
if( ( ( sub = GetSubscriptionSID( sid, service ) ) == NULL ) ||
|
||||||
( sub->active ) ) {
|
( sub->active ) ) {
|
||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return GENA_E_BAD_SID;
|
return GENA_E_BAD_SID;
|
||||||
}
|
}
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"FOUND SUBSCRIPTION IN INIT NOTIFY EXT: SID %s",
|
"FOUND SUBSCRIPTION IN INIT NOTIFY EXT: SID %s", sid );
|
||||||
sid ) );
|
|
||||||
|
|
||||||
sub->active = 1;
|
sub->active = 1;
|
||||||
|
|
||||||
@@ -735,13 +733,13 @@ genaInitNotifyExt( IN UpnpDevice_Handle device_handle,
|
|||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_PARAM;
|
return UPNP_E_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"GENERATED PROPERY SET IN INIT EXT NOTIFY: %s",
|
"GENERATED PROPERY SET IN INIT EXT NOTIFY: %s",
|
||||||
propertySet ) );
|
propertySet );
|
||||||
|
|
||||||
headers_size = strlen( "CONTENT-TYPE text/xml\r\n" ) +
|
headers_size = strlen( "CONTENT-TYPE text/xml\r\n" ) +
|
||||||
strlen( "CONTENT-LENGTH: \r\n" ) + MAX_CONTENT_LENGTH +
|
strlen( "CONTENT-LENGTH: \r\n" ) + MAX_CONTENT_LENGTH +
|
||||||
@@ -754,7 +752,7 @@ genaInitNotifyExt( IN UpnpDevice_Handle device_handle,
|
|||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
free( reference_count );
|
free( reference_count );
|
||||||
ixmlFreeDOMString( propertySet );
|
ixmlFreeDOMString( propertySet );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -804,7 +802,7 @@ genaInitNotifyExt( IN UpnpDevice_Handle device_handle,
|
|||||||
free( thread_struct );
|
free( thread_struct );
|
||||||
free( headers );
|
free( headers );
|
||||||
}
|
}
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
@@ -899,7 +897,7 @@ genaNotifyAllExt( IN UpnpDevice_Handle device_handle,
|
|||||||
"%ld\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n",
|
"%ld\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n",
|
||||||
(long) strlen( propertySet ) + 1 );
|
(long) strlen( propertySet ) + 1 );
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE )
|
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE )
|
||||||
return_code = GENA_E_BAD_HANDLE;
|
return_code = GENA_E_BAD_HANDLE;
|
||||||
@@ -959,7 +957,7 @@ genaNotifyAllExt( IN UpnpDevice_Handle device_handle,
|
|||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
@@ -1061,7 +1059,7 @@ genaNotifyAll( IN UpnpDevice_Handle device_handle,
|
|||||||
" upnp:event\r\nNTS: upnp:propchange\r\n",
|
" upnp:event\r\nNTS: upnp:propchange\r\n",
|
||||||
(long) strlen( propertySet ) + 1 );
|
(long) strlen( propertySet ) + 1 );
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetHandleInfo( device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
return_code = GENA_E_BAD_HANDLE;
|
return_code = GENA_E_BAD_HANDLE;
|
||||||
@@ -1123,7 +1121,7 @@ genaNotifyAll( IN UpnpDevice_Handle device_handle,
|
|||||||
free( UDN_copy );
|
free( UDN_copy );
|
||||||
free( servId_copy );
|
free( servId_copy );
|
||||||
}
|
}
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
@@ -1317,8 +1315,8 @@ gena_process_subscription_request( IN SOCKINFO * info,
|
|||||||
memptr callback_hdr;
|
memptr callback_hdr;
|
||||||
memptr timeout_hdr;
|
memptr timeout_hdr;
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"Subscription Request Received:\n" ) );
|
"Subscription Request Received:\n" );
|
||||||
|
|
||||||
if( httpmsg_find_hdr( request, HDR_NT, &nt_hdr ) == NULL ) {
|
if( httpmsg_find_hdr( request, HDR_NT, &nt_hdr ) == NULL ) {
|
||||||
error_respond( info, HTTP_BAD_REQUEST, request );
|
error_respond( info, HTTP_BAD_REQUEST, request );
|
||||||
@@ -1347,18 +1345,17 @@ gena_process_subscription_request( IN SOCKINFO * info,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"SubscriptionRequest for event URL path: %s\n",
|
"SubscriptionRequest for event URL path: %s\n",
|
||||||
event_url_path );
|
event_url_path );
|
||||||
)
|
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
// CURRENTLY, ONLY ONE DEVICE
|
// CURRENTLY, ONLY ONE DEVICE
|
||||||
if( GetDeviceHandleInfo( &device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetDeviceHandleInfo( &device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
free( event_url_path );
|
free( event_url_path );
|
||||||
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
service = FindServiceEventURLPath( &handle_info->ServiceTable,
|
service = FindServiceEventURLPath( &handle_info->ServiceTable,
|
||||||
@@ -1367,28 +1364,28 @@ gena_process_subscription_request( IN SOCKINFO * info,
|
|||||||
|
|
||||||
if( service == NULL || !service->active ) {
|
if( service == NULL || !service->active ) {
|
||||||
error_respond( info, HTTP_NOT_FOUND, request );
|
error_respond( info, HTTP_NOT_FOUND, request );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"Subscription Request: Number of Subscriptions already %d\n "
|
"Subscription Request: Number of Subscriptions already %d\n "
|
||||||
"Max Subscriptions allowed: %d\n",
|
"Max Subscriptions allowed: %d\n",
|
||||||
service->TotalSubscriptions,
|
service->TotalSubscriptions,
|
||||||
handle_info->MaxSubscriptions ) );
|
handle_info->MaxSubscriptions );
|
||||||
|
|
||||||
// too many subscriptions
|
// too many subscriptions
|
||||||
if( handle_info->MaxSubscriptions != -1 &&
|
if( handle_info->MaxSubscriptions != -1 &&
|
||||||
service->TotalSubscriptions >= handle_info->MaxSubscriptions ) {
|
service->TotalSubscriptions >= handle_info->MaxSubscriptions ) {
|
||||||
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// generate new subscription
|
// generate new subscription
|
||||||
sub = ( subscription * ) malloc( sizeof( subscription ) );
|
sub = ( subscription * ) malloc( sizeof( subscription ) );
|
||||||
if( sub == NULL ) {
|
if( sub == NULL ) {
|
||||||
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sub->eventKey = 0;
|
sub->eventKey = 0;
|
||||||
@@ -1405,13 +1402,13 @@ gena_process_subscription_request( IN SOCKINFO * info,
|
|||||||
&sub->DeliveryURLs ) ) == 0 ) {
|
&sub->DeliveryURLs ) ) == 0 ) {
|
||||||
error_respond( info, HTTP_PRECONDITION_FAILED, request );
|
error_respond( info, HTTP_PRECONDITION_FAILED, request );
|
||||||
freeSubscriptionList( sub );
|
freeSubscriptionList( sub );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( return_code == UPNP_E_OUTOF_MEMORY ) {
|
if( return_code == UPNP_E_OUTOF_MEMORY ) {
|
||||||
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
||||||
freeSubscriptionList( sub );
|
freeSubscriptionList( sub );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// set the timeout
|
// set the timeout
|
||||||
@@ -1447,7 +1444,7 @@ gena_process_subscription_request( IN SOCKINFO * info,
|
|||||||
// respond OK
|
// respond OK
|
||||||
if( respond_ok( info, time_out, sub, request ) != UPNP_E_SUCCESS ) {
|
if( respond_ok( info, time_out, sub, request ) != UPNP_E_SUCCESS ) {
|
||||||
freeSubscriptionList( sub );
|
freeSubscriptionList( sub );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//add to subscription list
|
//add to subscription list
|
||||||
@@ -1464,7 +1461,7 @@ gena_process_subscription_request( IN SOCKINFO * info,
|
|||||||
callback_fun = handle_info->Callback;
|
callback_fun = handle_info->Callback;
|
||||||
cookie = handle_info->Cookie;
|
cookie = handle_info->Cookie;
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
|
|
||||||
//make call back with request struct
|
//make call back with request struct
|
||||||
//in the future should find a way of mainting
|
//in the future should find a way of mainting
|
||||||
@@ -1527,7 +1524,7 @@ gena_process_subscription_renewal_request( IN SOCKINFO * info,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
// CURRENTLY, ONLY SUPPORT ONE DEVICE
|
// CURRENTLY, ONLY SUPPORT ONE DEVICE
|
||||||
if( GetDeviceHandleInfo( &device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetDeviceHandleInfo( &device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
@@ -1544,22 +1541,21 @@ gena_process_subscription_renewal_request( IN SOCKINFO * info,
|
|||||||
!service->active ||
|
!service->active ||
|
||||||
( ( sub = GetSubscriptionSID( sid, service ) ) == NULL ) ) {
|
( ( sub = GetSubscriptionSID( sid, service ) ) == NULL ) ) {
|
||||||
error_respond( info, HTTP_PRECONDITION_FAILED, request );
|
error_respond( info, HTTP_PRECONDITION_FAILED, request );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"Renew request: Number of subscriptions already: %d\n "
|
"Renew request: Number of subscriptions already: %d\n "
|
||||||
"Max Subscriptions allowed:%d\n",
|
"Max Subscriptions allowed:%d\n",
|
||||||
service->TotalSubscriptions,
|
service->TotalSubscriptions,
|
||||||
handle_info->MaxSubscriptions );
|
handle_info->MaxSubscriptions );
|
||||||
)
|
|
||||||
// too many subscriptions
|
// too many subscriptions
|
||||||
if( handle_info->MaxSubscriptions != -1 &&
|
if( handle_info->MaxSubscriptions != -1 &&
|
||||||
service->TotalSubscriptions > handle_info->MaxSubscriptions ) {
|
service->TotalSubscriptions > handle_info->MaxSubscriptions ) {
|
||||||
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
error_respond( info, HTTP_INTERNAL_SERVER_ERROR, request );
|
||||||
RemoveSubscriptionSID( sub->sid, service );
|
RemoveSubscriptionSID( sub->sid, service );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// set the timeout
|
// set the timeout
|
||||||
@@ -1598,7 +1594,7 @@ gena_process_subscription_renewal_request( IN SOCKINFO * info,
|
|||||||
RemoveSubscriptionSID( sub->sid, service );
|
RemoveSubscriptionSID( sub->sid, service );
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -1651,13 +1647,13 @@ gena_process_unsubscribe_request( IN SOCKINFO * info,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleLock( );
|
HandleLock();
|
||||||
|
|
||||||
// CURRENTLY, ONLY SUPPORT ONE DEVICE
|
// CURRENTLY, ONLY SUPPORT ONE DEVICE
|
||||||
if( GetDeviceHandleInfo( &device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetDeviceHandleInfo( &device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
error_respond( info, HTTP_PRECONDITION_FAILED, request );
|
error_respond( info, HTTP_PRECONDITION_FAILED, request );
|
||||||
membuffer_destroy( &event_url_path );
|
membuffer_destroy( &event_url_path );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
service = FindServiceEventURLPath( &handle_info->ServiceTable,
|
service = FindServiceEventURLPath( &handle_info->ServiceTable,
|
||||||
@@ -1670,14 +1666,14 @@ gena_process_unsubscribe_request( IN SOCKINFO * info,
|
|||||||
//CheckSubscriptionSID(sid, service) == NULL )
|
//CheckSubscriptionSID(sid, service) == NULL )
|
||||||
{
|
{
|
||||||
error_respond( info, HTTP_PRECONDITION_FAILED, request );
|
error_respond( info, HTTP_PRECONDITION_FAILED, request );
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveSubscriptionSID( sid, service );
|
RemoveSubscriptionSID( sid, service );
|
||||||
error_respond( info, HTTP_OK, request ); // success
|
error_respond( info, HTTP_OK, request ); // success
|
||||||
|
|
||||||
HandleUnlock( );
|
HandleUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // INCLUDE_DEVICE_APIS
|
#endif // INCLUDE_DEVICE_APIS
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,7 @@
|
|||||||
* messages.
|
* messages.
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
|
#define _GNU_SOURCE // For strcasestr() in string.h
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -100,7 +101,7 @@ str_int_entry Http_Header_Names[NUM_HTTP_HEADER_NAMES] = {
|
|||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
/************* scanner **************/
|
/************* scanner *************/
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
@@ -120,7 +121,7 @@ str_int_entry Http_Header_Names[NUM_HTTP_HEADER_NAMES] = {
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE void
|
static UPNP_INLINE void
|
||||||
scanner_init( OUT scanner_t * scanner,
|
scanner_init( OUT scanner_t * scanner,
|
||||||
IN membuffer * bufptr )
|
IN membuffer * bufptr )
|
||||||
{
|
{
|
||||||
@@ -141,7 +142,7 @@ scanner_init( OUT scanner_t * scanner,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE xboolean
|
static UPNP_INLINE xboolean
|
||||||
is_separator_char( IN char c )
|
is_separator_char( IN char c )
|
||||||
{
|
{
|
||||||
return strchr( " \t()<>@,;:\\\"/[]?={}", c ) != NULL;
|
return strchr( " \t()<>@,;:\\\"/[]?={}", c ) != NULL;
|
||||||
@@ -159,7 +160,7 @@ is_separator_char( IN char c )
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE xboolean
|
static UPNP_INLINE xboolean
|
||||||
is_identifier_char( IN char c )
|
is_identifier_char( IN char c )
|
||||||
{
|
{
|
||||||
return ( c >= 32 && c <= 126 ) && !is_separator_char( c );
|
return ( c >= 32 && c <= 126 ) && !is_separator_char( c );
|
||||||
@@ -177,7 +178,7 @@ is_identifier_char( IN char c )
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE xboolean
|
static UPNP_INLINE xboolean
|
||||||
is_control_char( IN char c )
|
is_control_char( IN char c )
|
||||||
{
|
{
|
||||||
return ( ( c >= 0 && c <= 31 ) || ( c == 127 ) );
|
return ( ( c >= 0 && c <= 31 ) || ( c == 127 ) );
|
||||||
@@ -195,7 +196,7 @@ is_control_char( IN char c )
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE xboolean
|
static UPNP_INLINE xboolean
|
||||||
is_qdtext_char( IN char cc )
|
is_qdtext_char( IN char cc )
|
||||||
{
|
{
|
||||||
unsigned char c = ( unsigned char )cc;
|
unsigned char c = ( unsigned char )cc;
|
||||||
@@ -374,7 +375,7 @@ scanner_get_token( INOUT scanner_t * scanner,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE char *
|
static UPNP_INLINE char *
|
||||||
scanner_get_str( IN scanner_t * scanner )
|
scanner_get_str( IN scanner_t * scanner )
|
||||||
{
|
{
|
||||||
return scanner->msg->buf + scanner->cursor;
|
return scanner->msg->buf + scanner->cursor;
|
||||||
@@ -394,7 +395,14 @@ scanner_get_str( IN scanner_t * scanner )
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE void
|
#ifndef WIN32
|
||||||
|
#warning The only use of the function 'scanner_pushback()' in the code is commented out.
|
||||||
|
#warning 'scanner_pushback()' is a candidate for removal.
|
||||||
|
#else
|
||||||
|
#pragma message ("The only use of the function 'scanner_pushback()' in the code is commented out.")
|
||||||
|
#pragma message ("'scanner_pushback()' is a candidate for removal.")
|
||||||
|
#endif
|
||||||
|
static UPNP_INLINE void
|
||||||
scanner_pushback( INOUT scanner_t * scanner,
|
scanner_pushback( INOUT scanner_t * scanner,
|
||||||
IN size_t pushback_bytes )
|
IN size_t pushback_bytes )
|
||||||
{
|
{
|
||||||
@@ -561,7 +569,7 @@ httpmsg_find_hdr_str( IN http_message_t * msg,
|
|||||||
*
|
*
|
||||||
* Description : Finds header from a list, with the given 'name_id'.
|
* Description : Finds header from a list, with the given 'name_id'.
|
||||||
*
|
*
|
||||||
* Return : http_header_t* - Pointer to a header on success; *
|
* Return : http_header_t* - Pointer to a header on success;
|
||||||
* NULL on failure
|
* NULL on failure
|
||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
@@ -613,7 +621,7 @@ httpmsg_find_hdr( IN http_message_t * msg,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE int
|
static UPNP_INLINE int
|
||||||
skip_blank_lines( INOUT scanner_t * scanner )
|
skip_blank_lines( INOUT scanner_t * scanner )
|
||||||
{
|
{
|
||||||
memptr token;
|
memptr token;
|
||||||
@@ -650,7 +658,7 @@ skip_blank_lines( INOUT scanner_t * scanner )
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE int
|
static UPNP_INLINE int
|
||||||
skip_lws( INOUT scanner_t * scanner )
|
skip_lws( INOUT scanner_t * scanner )
|
||||||
{
|
{
|
||||||
memptr token;
|
memptr token;
|
||||||
@@ -697,7 +705,7 @@ skip_lws( INOUT scanner_t * scanner )
|
|||||||
*
|
*
|
||||||
* Description : Match a string without whitespace or CRLF (%S)
|
* Description : Match a string without whitespace or CRLF (%S)
|
||||||
*
|
*
|
||||||
* Return : XINLINE parse_status_t ;
|
* Return : UPNP_INLINE parse_status_t ;
|
||||||
* PARSE_OK
|
* PARSE_OK
|
||||||
* PARSE_NO_MATCH
|
* PARSE_NO_MATCH
|
||||||
* PARSE_FAILURE
|
* PARSE_FAILURE
|
||||||
@@ -705,7 +713,7 @@ skip_lws( INOUT scanner_t * scanner )
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE parse_status_t
|
static UPNP_INLINE parse_status_t
|
||||||
match_non_ws_string( INOUT scanner_t * scanner,
|
match_non_ws_string( INOUT scanner_t * scanner,
|
||||||
OUT memptr * str )
|
OUT memptr * str )
|
||||||
{
|
{
|
||||||
@@ -771,7 +779,7 @@ match_non_ws_string( INOUT scanner_t * scanner,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE parse_status_t
|
static UPNP_INLINE parse_status_t
|
||||||
match_raw_value( INOUT scanner_t * scanner,
|
match_raw_value( INOUT scanner_t * scanner,
|
||||||
OUT memptr * raw_value )
|
OUT memptr * raw_value )
|
||||||
{
|
{
|
||||||
@@ -862,7 +870,7 @@ match_raw_value( INOUT scanner_t * scanner,
|
|||||||
* PARSE_FAILURE -- bad input
|
* PARSE_FAILURE -- bad input
|
||||||
* PARSE_INCOMPLETE
|
* PARSE_INCOMPLETE
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE int
|
static UPNP_INLINE int
|
||||||
match_int( INOUT scanner_t * scanner,
|
match_int( INOUT scanner_t * scanner,
|
||||||
IN int base,
|
IN int base,
|
||||||
OUT int *value )
|
OUT int *value )
|
||||||
@@ -909,7 +917,7 @@ match_int( INOUT scanner_t * scanner,
|
|||||||
* Function: read_until_crlf
|
* Function: read_until_crlf
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* INOUT scanner_t* scanner ; Scanner Object
|
* INOUT scanner_t* scanner ;Scanner Object
|
||||||
* OUT memptr* str ; Buffer to copy scanner buffer contents to
|
* OUT memptr* str ; Buffer to copy scanner buffer contents to
|
||||||
*
|
*
|
||||||
* Description: Reads data until end of line; the crlf at the end of
|
* Description: Reads data until end of line; the crlf at the end of
|
||||||
@@ -921,7 +929,7 @@ match_int( INOUT scanner_t * scanner,
|
|||||||
* PARSE_FAILURE
|
* PARSE_FAILURE
|
||||||
* PARSE_INCOMPLETE
|
* PARSE_INCOMPLETE
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE int
|
static UPNP_INLINE int
|
||||||
read_until_crlf( INOUT scanner_t * scanner,
|
read_until_crlf( INOUT scanner_t * scanner,
|
||||||
OUT memptr * str )
|
OUT memptr * str )
|
||||||
{
|
{
|
||||||
@@ -962,7 +970,14 @@ read_until_crlf( INOUT scanner_t * scanner,
|
|||||||
* PARSE_FAILURE
|
* PARSE_FAILURE
|
||||||
* PARSE_INCOMPLETE
|
* PARSE_INCOMPLETE
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE int
|
#ifndef WIN32
|
||||||
|
#warning There are currently no uses of the function 'skip_to_end_of_header()' in the code.
|
||||||
|
#warning 'skip_to_end_of_header()' is a candidate for removal.
|
||||||
|
#else
|
||||||
|
#pragma message("There are currently no uses of the function 'skip_to_end_of_header()' in the code.")
|
||||||
|
#pragma message("'skip_to_end_of_header()' is a candidate for removal.")
|
||||||
|
#endif
|
||||||
|
static UPNP_INLINE int
|
||||||
skip_to_end_of_header( INOUT scanner_t * scanner )
|
skip_to_end_of_header( INOUT scanner_t * scanner )
|
||||||
{
|
{
|
||||||
memptr dummy_raw_value;
|
memptr dummy_raw_value;
|
||||||
@@ -978,8 +993,8 @@ skip_to_end_of_header( INOUT scanner_t * scanner )
|
|||||||
* Parameters:
|
* Parameters:
|
||||||
* INOUT scanner_t* scanner ; Scanner Object
|
* INOUT scanner_t* scanner ; Scanner Object
|
||||||
* IN char c ; Character to be compared with
|
* IN char c ; Character to be compared with
|
||||||
* IN xboolean case_sensitive; Flag indicating whether comparison should
|
* IN xboolean case_sensitive; Flag indicating whether
|
||||||
* be case sensitive
|
* comparison should be case sensitive
|
||||||
*
|
*
|
||||||
* Description: Compares a character to the next char in the scanner;
|
* Description: Compares a character to the next char in the scanner;
|
||||||
* on error, scanner chars are not restored
|
* on error, scanner chars are not restored
|
||||||
@@ -989,7 +1004,7 @@ skip_to_end_of_header( INOUT scanner_t * scanner )
|
|||||||
* PARSE_NO_MATCH
|
* PARSE_NO_MATCH
|
||||||
* PARSE_INCOMPLETE
|
* PARSE_INCOMPLETE
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE parse_status_t
|
static UPNP_INLINE parse_status_t
|
||||||
match_char( INOUT scanner_t * scanner,
|
match_char( INOUT scanner_t * scanner,
|
||||||
IN char c,
|
IN char c,
|
||||||
IN xboolean case_sensitive )
|
IN xboolean case_sensitive )
|
||||||
@@ -1336,7 +1351,7 @@ matchstr( IN char *str,
|
|||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE void
|
static UPNP_INLINE void
|
||||||
parser_init( OUT http_parser_t * parser )
|
parser_init( OUT http_parser_t * parser )
|
||||||
{
|
{
|
||||||
memset( parser, 0, sizeof( http_parser_t ) );
|
memset( parser, 0, sizeof( http_parser_t ) );
|
||||||
@@ -1871,7 +1886,7 @@ parser_parse_headers_old( INOUT http_parser_t * parser )
|
|||||||
* PARSE_FAILURE -- entity length > content-length value
|
* PARSE_FAILURE -- entity length > content-length value
|
||||||
* PARSE_SUCCESS
|
* PARSE_SUCCESS
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE parse_status_t
|
static UPNP_INLINE parse_status_t
|
||||||
parser_parse_entity_using_clen( INOUT http_parser_t * parser )
|
parser_parse_entity_using_clen( INOUT http_parser_t * parser )
|
||||||
{
|
{
|
||||||
//int entity_length;
|
//int entity_length;
|
||||||
@@ -1918,7 +1933,7 @@ parser_parse_entity_using_clen( INOUT http_parser_t * parser )
|
|||||||
* PARSE_FAILURE -- entity length > content-length value
|
* PARSE_FAILURE -- entity length > content-length value
|
||||||
* PARSE_SUCCESS
|
* PARSE_SUCCESS
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE parse_status_t
|
static UPNP_INLINE parse_status_t
|
||||||
parser_parse_chunky_body( INOUT http_parser_t * parser )
|
parser_parse_chunky_body( INOUT http_parser_t * parser )
|
||||||
{
|
{
|
||||||
parse_status_t status;
|
parse_status_t status;
|
||||||
@@ -1963,7 +1978,7 @@ parser_parse_chunky_body( INOUT http_parser_t * parser )
|
|||||||
* PARSE_FAILURE -- entity length > content-length value
|
* PARSE_FAILURE -- entity length > content-length value
|
||||||
* PARSE_SUCCESS
|
* PARSE_SUCCESS
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE parse_status_t
|
static UPNP_INLINE parse_status_t
|
||||||
parser_parse_chunky_headers( INOUT http_parser_t * parser )
|
parser_parse_chunky_headers( INOUT http_parser_t * parser )
|
||||||
{
|
{
|
||||||
parse_status_t status;
|
parse_status_t status;
|
||||||
@@ -2003,7 +2018,7 @@ parser_parse_chunky_headers( INOUT http_parser_t * parser )
|
|||||||
* PARSE_SUCCESS
|
* PARSE_SUCCESS
|
||||||
* PARSE_CONTINUE_1
|
* PARSE_CONTINUE_1
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE parse_status_t
|
static UPNP_INLINE parse_status_t
|
||||||
parser_parse_chunky_entity( INOUT http_parser_t * parser )
|
parser_parse_chunky_entity( INOUT http_parser_t * parser )
|
||||||
{
|
{
|
||||||
scanner_t *scanner = &parser->scanner;
|
scanner_t *scanner = &parser->scanner;
|
||||||
@@ -2019,9 +2034,8 @@ parser_parse_chunky_entity( INOUT http_parser_t * parser )
|
|||||||
status = match( scanner, "%x%L%c", &parser->chunk_size, &dummy );
|
status = match( scanner, "%x%L%c", &parser->chunk_size, &dummy );
|
||||||
if( status != PARSE_OK ) {
|
if( status != PARSE_OK ) {
|
||||||
scanner->cursor = save_pos;
|
scanner->cursor = save_pos;
|
||||||
DBGONLY( UpnpPrintf
|
UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
"CHUNK COULD NOT BE PARSED\n" );
|
||||||
"CHUNK COULD NOT BE PARSED\n" ); )
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
// remove chunk info just matched; just retain data
|
// remove chunk info just matched; just retain data
|
||||||
@@ -2055,7 +2069,7 @@ parser_parse_chunky_entity( INOUT http_parser_t * parser )
|
|||||||
* Returns:
|
* Returns:
|
||||||
* PARSE_INCOMPLETE_ENTITY
|
* PARSE_INCOMPLETE_ENTITY
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE parse_status_t
|
static UPNP_INLINE parse_status_t
|
||||||
parser_parse_entity_until_close( INOUT http_parser_t * parser )
|
parser_parse_entity_until_close( INOUT http_parser_t * parser )
|
||||||
{
|
{
|
||||||
size_t cursor;
|
size_t cursor;
|
||||||
@@ -2090,7 +2104,7 @@ parser_parse_entity_until_close( INOUT http_parser_t * parser )
|
|||||||
* PARSE_FAILURE
|
* PARSE_FAILURE
|
||||||
* PARSE_COMPLETE -- no more reading to do
|
* PARSE_COMPLETE -- no more reading to do
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
XINLINE parse_status_t
|
UPNP_INLINE parse_status_t
|
||||||
parser_get_entity_read_method( INOUT http_parser_t * parser )
|
parser_get_entity_read_method( INOUT http_parser_t * parser )
|
||||||
{
|
{
|
||||||
http_message_t *hmsg = &parser->msg;
|
http_message_t *hmsg = &parser->msg;
|
||||||
@@ -2148,9 +2162,8 @@ parser_get_entity_read_method( INOUT http_parser_t * parser )
|
|||||||
if( raw_find_str( &hdr_value, "chunked" ) >= 0 ) {
|
if( raw_find_str( &hdr_value, "chunked" ) >= 0 ) {
|
||||||
// read method to use chunked transfer encoding
|
// read method to use chunked transfer encoding
|
||||||
parser->ent_position = ENTREAD_USING_CHUNKED;
|
parser->ent_position = ENTREAD_USING_CHUNKED;
|
||||||
DBGONLY( UpnpPrintf
|
UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
"Found Chunked Encoding ....\n" );
|
||||||
"Found Chunked Encoding ....\n" ); )
|
|
||||||
|
|
||||||
return PARSE_CONTINUE_1;
|
return PARSE_CONTINUE_1;
|
||||||
}
|
}
|
||||||
@@ -2196,7 +2209,7 @@ parser_get_entity_read_method( INOUT http_parser_t * parser )
|
|||||||
* PARSE_FAILURE
|
* PARSE_FAILURE
|
||||||
* PARSE_COMPLETE -- no more reading to do
|
* PARSE_COMPLETE -- no more reading to do
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
XINLINE parse_status_t
|
UPNP_INLINE parse_status_t
|
||||||
parser_parse_entity( INOUT http_parser_t * parser )
|
parser_parse_entity( INOUT http_parser_t * parser )
|
||||||
{
|
{
|
||||||
parse_status_t status = PARSE_OK;
|
parse_status_t status = PARSE_OK;
|
||||||
@@ -2421,28 +2434,42 @@ raw_to_int( IN memptr * raw_value,
|
|||||||
*
|
*
|
||||||
* Description: Find a substring from raw character string buffer
|
* Description: Find a substring from raw character string buffer
|
||||||
*
|
*
|
||||||
|
* Side effects: raw_value is transformed to lowercase.
|
||||||
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* int - index at which the substring is found.
|
* int - index at which the substring is found.
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
raw_find_str( IN memptr * raw_value,
|
raw_find_str( IN memptr *raw_value,
|
||||||
IN const char *str )
|
IN const char *str )
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
c = raw_value->buf[raw_value->length]; // save
|
// save
|
||||||
raw_value->buf[raw_value->length] = 0; // null-terminate
|
c = raw_value->buf[raw_value->length];
|
||||||
|
|
||||||
|
// Make it lowercase
|
||||||
|
for (i = 0; raw_value->buf[i]; ++i) {
|
||||||
|
raw_value->buf[i] = tolower(raw_value->buf[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// null-terminate
|
||||||
|
raw_value->buf[raw_value->length] = 0;
|
||||||
|
|
||||||
|
// Find the substring position
|
||||||
ptr = strstr( raw_value->buf, str );
|
ptr = strstr( raw_value->buf, str );
|
||||||
|
|
||||||
raw_value->buf[raw_value->length] = c; // restore
|
// restore the "length" byte
|
||||||
|
raw_value->buf[raw_value->length] = c;
|
||||||
|
|
||||||
if( ptr == 0 ) {
|
if( ptr == 0 ) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ptr - raw_value->buf; // return index
|
// return index
|
||||||
|
return ptr - raw_value->buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -2455,7 +2482,7 @@ raw_find_str( IN memptr * raw_value,
|
|||||||
* nameConverts a http_method id stored in the HTTP Method
|
* nameConverts a http_method id stored in the HTTP Method
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* const char* ptr - Ptr to the HTTP Method *
|
* const char* ptr - Ptr to the HTTP Method
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
const char *
|
const char *
|
||||||
method_to_str( IN http_method_t method )
|
method_to_str( IN http_method_t method )
|
||||||
@@ -2480,40 +2507,38 @@ method_to_str( IN http_method_t method )
|
|||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
#ifdef DEBUG
|
||||||
void
|
void
|
||||||
print_http_headers( http_message_t * hmsg )
|
print_http_headers( http_message_t * hmsg )
|
||||||
{
|
{
|
||||||
|
|
||||||
ListNode *node;
|
ListNode *node;
|
||||||
|
// NNS: dlist_node *node;
|
||||||
//NNS: dlist_node *node;
|
|
||||||
http_header_t *header;
|
http_header_t *header;
|
||||||
|
|
||||||
// print start line
|
// print start line
|
||||||
if( hmsg->is_request ) {
|
if( hmsg->is_request ) {
|
||||||
//printf( "method = %d, version = %d.%d, url = %.*s\n",
|
printf( "method = %d, version = %d.%d, url = %.*s\n",
|
||||||
// hmsg->method, hmsg->major_version, hmsg->minor_version,
|
hmsg->method, hmsg->major_version, hmsg->minor_version,
|
||||||
// hmsg->uri.pathquery.size, hmsg->uri.pathquery.buff);
|
(int)hmsg->uri.pathquery.size, hmsg->uri.pathquery.buff);
|
||||||
} else {
|
} else {
|
||||||
// printf( "resp status = %d, version = %d.%d, status msg = %.*s\n",
|
printf( "resp status = %d, version = %d.%d, status msg = %.*s\n",
|
||||||
// hmsg->status_code, hmsg->major_version, hmsg->minor_version,
|
hmsg->status_code, hmsg->major_version, hmsg->minor_version,
|
||||||
// (int)hmsg->status_msg.length, hmsg->status_msg.buf);
|
(int)hmsg->status_msg.length, hmsg->status_msg.buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// print headers
|
// print headers
|
||||||
|
|
||||||
node = ListHead( &hmsg->headers );
|
node = ListHead( &hmsg->headers );
|
||||||
//NNS: node = dlist_first_node( &hmsg->headers );
|
// NNS: node = dlist_first_node( &hmsg->headers );
|
||||||
while( node != NULL ) {
|
while( node != NULL ) {
|
||||||
|
|
||||||
header = ( http_header_t * ) node->item;
|
header = ( http_header_t * ) node->item;
|
||||||
//NNS: header = (http_header_t *)node->data;
|
// NNS: header = (http_header_t *)node->data;
|
||||||
//printf( "hdr name: %.*s, value: %.*s\n",
|
printf( "hdr name: %.*s, value: %.*s\n",
|
||||||
// (int)header->name.length, header->name.buf,
|
(int)header->name.length, header->name.buf,
|
||||||
// (int)header->value.length, header->value.buf );
|
(int)header->value.length, header->value.buf );
|
||||||
|
|
||||||
node = ListNext( &hmsg->headers, node );
|
node = ListNext( &hmsg->headers, node );
|
||||||
|
// NNS: node = dlist_next( &hmsg->headers, node );
|
||||||
//NNS: node = dlist_next( &hmsg->headers, node );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -118,7 +118,7 @@ static xboolean gInitialized = FALSE;
|
|||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE void
|
static UPNP_INLINE void
|
||||||
init_table( IN const char *encoded_str,
|
init_table( IN const char *encoded_str,
|
||||||
OUT const char *table[],
|
OUT const char *table[],
|
||||||
IN int tbl_size )
|
IN int tbl_size )
|
||||||
@@ -144,7 +144,7 @@ init_table( IN const char *encoded_str,
|
|||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE void
|
static UPNP_INLINE void
|
||||||
init_tables( void )
|
init_tables( void )
|
||||||
{
|
{
|
||||||
init_table( Http1xxStr, Http1xxCodes, NUM_1XX_CODES );
|
init_table( Http1xxStr, Http1xxCodes, NUM_1XX_CODES );
|
||||||
@@ -176,7 +176,7 @@ http_get_code_text( int statusCode )
|
|||||||
int table_num;
|
int table_num;
|
||||||
|
|
||||||
if( !gInitialized ) {
|
if( !gInitialized ) {
|
||||||
init_tables( );
|
init_tables();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( statusCode < 100 && statusCode >= 600 ) {
|
if( statusCode < 100 && statusCode >= 600 ) {
|
||||||
|
|||||||
@@ -29,20 +29,18 @@
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/************************************************************************
|
/******************************************************************************
|
||||||
* Purpose: This file defines the Web Server and has functions to carry out
|
* Purpose: This file defines the Web Server and has functions to carry out
|
||||||
* operations of the Web Server.
|
* operations of the Web Server.
|
||||||
************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifndef UPNP_USE_BCBPP
|
#ifndef UPNP_USE_BCBPP
|
||||||
#ifndef UPNP_USE_MSVCPP
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "strintmap.h"
|
#include "strintmap.h"
|
||||||
#include "membuffer.h"
|
#include "membuffer.h"
|
||||||
@@ -64,7 +62,11 @@
|
|||||||
/*
|
/*
|
||||||
Response Types
|
Response Types
|
||||||
*/
|
*/
|
||||||
enum resp_type { RESP_FILEDOC, RESP_XMLDOC, RESP_HEADERS, RESP_WEBDOC,
|
enum resp_type {
|
||||||
|
RESP_FILEDOC,
|
||||||
|
RESP_XMLDOC,
|
||||||
|
RESP_HEADERS,
|
||||||
|
RESP_WEBDOC,
|
||||||
RESP_POST };
|
RESP_POST };
|
||||||
|
|
||||||
// mapping of file extension to content-type of document
|
// mapping of file extension to content-type of document
|
||||||
@@ -182,12 +184,9 @@ static const char *gEncodedMediaTypes =
|
|||||||
"zip\0" APPLICATION_STR "zip\0" "\0";
|
"zip\0" APPLICATION_STR "zip\0" "\0";
|
||||||
// *** end ***
|
// *** end ***
|
||||||
|
|
||||||
/***********************************************************************/
|
/************************************************************************
|
||||||
/*
|
|
||||||
module variables - Globals, static and externs
|
module variables - Globals, static and externs
|
||||||
*/
|
************************************************************************/
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
static struct document_type_t gMediaTypeList[NUM_MEDIA_TYPES];
|
static struct document_type_t gMediaTypeList[NUM_MEDIA_TYPES];
|
||||||
membuffer gDocumentRootDir; // a local dir which serves as webserver root
|
membuffer gDocumentRootDir; // a local dir which serves as webserver root
|
||||||
static struct xml_alias_t gAliasDoc; // XML document
|
static struct xml_alias_t gAliasDoc; // XML document
|
||||||
@@ -195,17 +194,17 @@ static ithread_mutex_t gWebMutex;
|
|||||||
extern str_int_entry Http_Header_Names[NUM_HTTP_HEADER_NAMES];
|
extern str_int_entry Http_Header_Names[NUM_HTTP_HEADER_NAMES];
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: has_xml_content_type
|
* Function: has_xml_content_type
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* none
|
* none
|
||||||
*
|
*
|
||||||
* Description: decodes list and stores it in gMediaTypeList
|
* Description: decodes list and stores it in gMediaTypeList
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE void
|
static UPNP_INLINE void
|
||||||
media_list_init( void )
|
media_list_init( void )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -229,21 +228,21 @@ media_list_init( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: has_xml_content_type
|
* Function: has_xml_content_type
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN const char* extension ;
|
* IN const char* extension ;
|
||||||
* OUT const char** con_type,
|
* OUT const char** con_type,
|
||||||
* OUT const char** con_subtype
|
* OUT const char** con_subtype
|
||||||
*
|
*
|
||||||
* Description: Based on the extension, returns the content type and
|
* Description: Based on the extension, returns the content type and
|
||||||
* content subtype
|
* content subtype
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* 0 on success;
|
* 0 on success;
|
||||||
* -1 on error
|
* -1 on error
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE int
|
static UPNP_INLINE int
|
||||||
search_extension( IN const char *extension,
|
search_extension( IN const char *extension,
|
||||||
OUT const char **con_type,
|
OUT const char **con_type,
|
||||||
OUT const char **con_subtype )
|
OUT const char **con_subtype )
|
||||||
@@ -276,21 +275,21 @@ search_extension( IN const char *extension,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: get_content_type
|
* Function: get_content_type
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN const char* filename,
|
* IN const char* filename,
|
||||||
* OUT DOMString* content_type
|
* OUT DOMString* content_type
|
||||||
*
|
*
|
||||||
* Description: Based on the extension, clones an XML string based on
|
* Description: Based on the extension, clones an XML string based on
|
||||||
* type and content subtype. If content type and sub type are not
|
* type and content subtype. If content type and sub type are not
|
||||||
* found, unknown types are used
|
* found, unknown types are used
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* 0 - On Sucess
|
* 0 - On Sucess
|
||||||
* UPNP_E_OUTOF_MEMORY - on memory allocation failures
|
* UPNP_E_OUTOF_MEMORY - on memory allocation failures
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
XINLINE int
|
UPNP_INLINE int
|
||||||
get_content_type( IN const char *filename,
|
get_content_type( IN const char *filename,
|
||||||
OUT DOMString * content_type )
|
OUT DOMString * content_type )
|
||||||
{
|
{
|
||||||
@@ -337,18 +336,18 @@ get_content_type( IN const char *filename,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: glob_alias_init
|
* Function: glob_alias_init
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* none
|
* none
|
||||||
*
|
*
|
||||||
* Description: Initialize the global XML document. Allocate buffers
|
* Description: Initialize the global XML document. Allocate buffers
|
||||||
* for the XML document
|
* for the XML document
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE void
|
static UPNP_INLINE void
|
||||||
glob_alias_init( void )
|
glob_alias_init( void )
|
||||||
{
|
{
|
||||||
struct xml_alias_t *alias = &gAliasDoc;
|
struct xml_alias_t *alias = &gAliasDoc;
|
||||||
@@ -360,34 +359,34 @@ glob_alias_init( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: is_valid_alias
|
* Function: is_valid_alias
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN const struct xml_alias_t* alias ; XML alias object
|
* IN const struct xml_alias_t* alias ; XML alias object
|
||||||
*
|
*
|
||||||
* Description: Check for the validity of the XML object buffer
|
* Description: Check for the validity of the XML object buffer
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* BOOLEAN
|
* BOOLEAN
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE xboolean
|
static UPNP_INLINE xboolean
|
||||||
is_valid_alias( IN const struct xml_alias_t *alias )
|
is_valid_alias( IN const struct xml_alias_t *alias )
|
||||||
{
|
{
|
||||||
return alias->doc.buf != NULL;
|
return alias->doc.buf != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: alias_grab
|
* Function: alias_grab
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* OUT struct xml_alias_t* alias ; XML alias object
|
* OUT struct xml_alias_t* alias ; XML alias object
|
||||||
*
|
*
|
||||||
* Description: Copy the contents of the global XML document into the
|
* Description: Copy the contents of the global XML document into the
|
||||||
* local OUT parameter
|
* local OUT parameter
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static void
|
static void
|
||||||
alias_grab( OUT struct xml_alias_t *alias )
|
alias_grab( OUT struct xml_alias_t *alias )
|
||||||
{
|
{
|
||||||
@@ -402,17 +401,17 @@ alias_grab( OUT struct xml_alias_t *alias )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: alias_release
|
* Function: alias_release
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN struct xml_alias_t* alias ; XML alias object
|
* IN struct xml_alias_t* alias ; XML alias object
|
||||||
*
|
*
|
||||||
* Description: Release the XML document referred to by the IN parameter
|
* Description: Release the XML document referred to by the IN parameter
|
||||||
* Free the allocated buffers associated with this object
|
* Free the allocated buffers associated with this object
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static void
|
static void
|
||||||
alias_release( IN struct xml_alias_t *alias )
|
alias_release( IN struct xml_alias_t *alias )
|
||||||
{
|
{
|
||||||
@@ -436,24 +435,24 @@ alias_release( IN struct xml_alias_t *alias )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_set_alias
|
* Function: web_server_set_alias
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* alias_name: webserver name of alias; created by caller and freed by
|
* alias_name: webserver name of alias; created by caller and freed by
|
||||||
* caller (doesn't even have to be malloc()d .)
|
* caller (doesn't even have to be malloc()d .)
|
||||||
* alias_content: the xml doc; this is allocated by the caller; and
|
* alias_content: the xml doc; this is allocated by the caller; and
|
||||||
* freed by the web server
|
* freed by the web server
|
||||||
* alias_content_length: length of alias body in bytes
|
* alias_content_length: length of alias body in bytes
|
||||||
* last_modified: time when the contents of alias were last
|
* last_modified: time when the contents of alias were last
|
||||||
* changed (local time)
|
* changed (local time)
|
||||||
*
|
*
|
||||||
* Description: Replaces current alias with the given alias. To remove
|
* Description: Replaces current alias with the given alias. To remove
|
||||||
* the current alias, set alias_name to NULL.
|
* the current alias, set alias_name to NULL.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* 0 - OK
|
* 0 - OK
|
||||||
* UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here
|
* UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
web_server_set_alias( IN const char *alias_name,
|
web_server_set_alias( IN const char *alias_name,
|
||||||
IN const char *alias_content,
|
IN const char *alias_content,
|
||||||
@@ -516,28 +515,28 @@ web_server_set_alias( IN const char *alias_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_init
|
* Function: web_server_init
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* none
|
* none
|
||||||
*
|
*
|
||||||
* Description: Initilialize the different documents. Initialize the
|
* Description: Initilialize the different documents. Initialize the
|
||||||
* memory for root directory for web server. Call to initialize global
|
* memory for root directory for web server. Call to initialize global
|
||||||
* XML document. Sets bWebServerState to WEB_SERVER_ENABLED
|
* XML document. Sets bWebServerState to WEB_SERVER_ENABLED
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* 0 - OK
|
* 0 - OK
|
||||||
* UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here
|
* UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
web_server_init( void )
|
web_server_init( void )
|
||||||
{
|
{
|
||||||
int ret_code;
|
int ret_code;
|
||||||
|
|
||||||
if( bWebServerState == WEB_SERVER_DISABLED ) {
|
if( bWebServerState == WEB_SERVER_DISABLED ) {
|
||||||
media_list_init( ); // decode media list
|
media_list_init(); // decode media list
|
||||||
membuffer_init( &gDocumentRootDir );
|
membuffer_init( &gDocumentRootDir );
|
||||||
glob_alias_init( );
|
glob_alias_init();
|
||||||
|
|
||||||
pVirtualDirList = NULL;
|
pVirtualDirList = NULL;
|
||||||
|
|
||||||
@@ -552,18 +551,18 @@ web_server_init( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_destroy
|
* Function: web_server_destroy
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* none
|
* none
|
||||||
*
|
*
|
||||||
* Description: Release memory allocated for the global web server root
|
* Description: Release memory allocated for the global web server root
|
||||||
* directory and the global XML document
|
* directory and the global XML document
|
||||||
* Resets the flag bWebServerState to WEB_SERVER_DISABLED
|
* Resets the flag bWebServerState to WEB_SERVER_DISABLED
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
void
|
void
|
||||||
web_server_destroy( void )
|
web_server_destroy( void )
|
||||||
{
|
{
|
||||||
@@ -584,23 +583,22 @@ web_server_destroy( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: get_file_info
|
* Function: get_file_info
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN const char* filename ; Filename having the description document
|
* IN const char* filename ; Filename having the description document
|
||||||
* OUT struct File_Info * info ; File information object having file
|
* OUT struct File_Info * info ; File information object having file
|
||||||
* attributes such as filelength, when was
|
* attributes such as filelength, when was the file last
|
||||||
* the file last modified, whether a file
|
* modified, whether a file or a directory and whether the
|
||||||
* or a directory and whether the file or
|
* file or directory is readable.
|
||||||
* directory is readable.
|
*
|
||||||
*
|
* Description: Release memory allocated for the global web server root
|
||||||
* Description: Release memory allocated for the global web server root
|
* directory and the global XML document
|
||||||
* directory and the global XML document
|
* Resets the flag bWebServerState to WEB_SERVER_DISABLED
|
||||||
* Resets the flag bWebServerState to WEB_SERVER_DISABLED
|
*
|
||||||
*
|
* Returns:
|
||||||
* Returns:
|
* int
|
||||||
* int
|
************************************************************************/
|
||||||
************************************************************************/
|
|
||||||
static int
|
static int
|
||||||
get_file_info( IN const char *filename,
|
get_file_info( IN const char *filename,
|
||||||
OUT struct File_Info *info )
|
OUT struct File_Info *info )
|
||||||
@@ -637,29 +635,29 @@ get_file_info( IN const char *filename,
|
|||||||
|
|
||||||
rc = get_content_type( filename, &info->content_type );
|
rc = get_content_type( filename, &info->content_type );
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
"file info: %s, length: %lld, last_mod=%s readable=%d\n",
|
"file info: %s, length: %lld, last_mod=%s readable=%d\n",
|
||||||
filename, (long long)info->file_length,
|
filename, (long long)info->file_length,
|
||||||
asctime( gmtime( &info->last_modified ) ),
|
asctime( gmtime( &info->last_modified ) ),
|
||||||
info->is_readable ); )
|
info->is_readable );
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_set_root_dir
|
* Function: web_server_set_root_dir
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN const char* root_dir ; String having the root directory for the
|
* IN const char* root_dir ; String having the root directory for the
|
||||||
* document
|
* document
|
||||||
*
|
*
|
||||||
* Description: Assign the path specfied by the IN const char* root_dir
|
* Description: Assign the path specfied by the IN const char* root_dir
|
||||||
* parameter to the global Document root directory. Also check for
|
* parameter to the global Document root directory. Also check for
|
||||||
* path names ending in '/'
|
* path names ending in '/'
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* int
|
* int
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
web_server_set_root_dir( IN const char *root_dir )
|
web_server_set_root_dir( IN const char *root_dir )
|
||||||
{
|
{
|
||||||
@@ -682,25 +680,24 @@ web_server_set_root_dir( IN const char *root_dir )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: get_alias
|
* Function: get_alias
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN const char* request_file ; request file passed in to be compared with
|
* IN const char* request_file ; request file passed in to be compared with
|
||||||
* OUT struct xml_alias_t* alias ; xml alias object which has a file name
|
* OUT struct xml_alias_t* alias ; xml alias object which has a file name
|
||||||
* stored
|
* stored
|
||||||
* OUT struct File_Info * info ; File information object which will be
|
* OUT struct File_Info * info ; File information object which will be
|
||||||
* filled up if the file comparison
|
* filled up if the file comparison succeeds
|
||||||
* succeeds
|
*
|
||||||
*
|
* Description: Compare the files names between the one on the XML alias
|
||||||
* Description: Compare the files names between the one on the XML alias
|
* the one passed in as the input parameter. If equal extract file
|
||||||
* the one passed in as the input parameter. If equal extract file
|
* information
|
||||||
* information
|
*
|
||||||
*
|
* Returns:
|
||||||
* Returns:
|
* TRUE - On Success
|
||||||
* TRUE - On Success
|
* FALSE if request is not an alias
|
||||||
* FALSE if request is not an alias
|
************************************************************************/
|
||||||
************************************************************************/
|
static UPNP_INLINE xboolean
|
||||||
static XINLINE xboolean
|
|
||||||
get_alias( IN const char *request_file,
|
get_alias( IN const char *request_file,
|
||||||
OUT struct xml_alias_t *alias,
|
OUT struct xml_alias_t *alias,
|
||||||
OUT struct File_Info *info )
|
OUT struct File_Info *info )
|
||||||
@@ -720,17 +717,17 @@ get_alias( IN const char *request_file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: isFileInVirtualDir
|
* Function: isFileInVirtualDir
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN char *filePath ; directory path to be tested for virtual directory
|
* IN char *filePath ; directory path to be tested for virtual directory
|
||||||
*
|
*
|
||||||
* Description: Compares filePath with paths from the list of virtual
|
* Description: Compares filePath with paths from the list of virtual
|
||||||
* directory lists
|
* directory lists
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* BOOLEAN
|
* BOOLEAN
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
isFileInVirtualDir( IN char *filePath )
|
isFileInVirtualDir( IN char *filePath )
|
||||||
{
|
{
|
||||||
@@ -746,7 +743,7 @@ isFileInVirtualDir( IN char *filePath )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
if( ( strncmp( pCurVirtualDir->dirName, filePath, webDirLen )
|
if( ( strncmp( pCurVirtualDir->dirName, filePath, webDirLen )
|
||||||
== 0 ) && ( filePath[webDirLen] == '/' ) )
|
== 0 ) && ( filePath[webDirLen] == '/' || filePath[webDirLen] == '\0' || filePath[webDirLen] == '?' ) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -757,16 +754,16 @@ isFileInVirtualDir( IN char *filePath )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: ToUpperCase
|
* Function: ToUpperCase
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* INOUT char * Str ; Input string to be converted
|
* INOUT char * Str ; Input string to be converted
|
||||||
*
|
*
|
||||||
* Description: Converts input string to upper case
|
* Description: Converts input string to upper case
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* int
|
* int
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
ToUpperCase( char *Str )
|
ToUpperCase( char *Str )
|
||||||
{
|
{
|
||||||
@@ -779,17 +776,17 @@ ToUpperCase( char *Str )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: StrStr
|
* Function: StrStr
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN char * S1 ; Input string
|
* IN char * S1 ; Input string
|
||||||
* IN char * S2 ; Input sub-string
|
* IN char * S2 ; Input sub-string
|
||||||
*
|
*
|
||||||
* Description: Finds a substring from a string
|
* Description: Finds a substring from a string
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* char * ptr - pointer to the first occurence of S2 in S1
|
* char * ptr - pointer to the first occurence of S2 in S1
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
char *
|
char *
|
||||||
StrStr( char *S1,
|
StrStr( char *S1,
|
||||||
char *S2 )
|
char *S2 )
|
||||||
@@ -829,17 +826,17 @@ StrStr( char *S1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: StrTok
|
* Function: StrTok
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN char ** Src ; String containing the token
|
* IN char ** Src ; String containing the token
|
||||||
* IN char * del ; Set of delimiter characters
|
* IN char * del ; Set of delimiter characters
|
||||||
*
|
*
|
||||||
* Description: Finds next token in a string
|
* Description: Finds next token in a string
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* char * ptr - pointer to the first occurence of S2 in S1
|
* char * ptr - pointer to the first occurence of S2 in S1
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
char *
|
char *
|
||||||
StrTok( char **Src,
|
StrTok( char **Src,
|
||||||
char *Del )
|
char *Del )
|
||||||
@@ -863,39 +860,41 @@ StrTok( char **Src,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: GetNextRange
|
* Function: GetNextRange
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN char ** SrcRangeStr ; string containing the token / range
|
* IN char ** SrcRangeStr ; string containing the token / range
|
||||||
* OUT int * FirstByte ; gets the first byte of the token
|
* OUT int * FirstByte ; gets the first byte of the token
|
||||||
* OUT int * LastByte ; gets the last byte of the token
|
* OUT int * LastByte ; gets the last byte of the token
|
||||||
*
|
*
|
||||||
* Description: Returns a range of integers from a sring
|
* Description: Returns a range of integers from a string
|
||||||
*
|
*
|
||||||
* Returns: int ;
|
* Returns: int ;
|
||||||
* always returns 1;
|
* always returns 1;
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
GetNextRange( char **SrcRangeStr,
|
GetNextRange( char **SrcRangeStr,
|
||||||
off_t *FirstByte,
|
off_t *FirstByte,
|
||||||
off_t *LastByte )
|
off_t *LastByte )
|
||||||
{
|
{
|
||||||
char *Ptr,
|
char *Ptr;
|
||||||
*Tok;
|
char *Tok;
|
||||||
int i,
|
int i;
|
||||||
F = -1,
|
int64_t F = -1;
|
||||||
L = -1;
|
int64_t L = -1;
|
||||||
int Is_Suffix_byte_Range = 1;
|
int Is_Suffix_byte_Range = 1;
|
||||||
|
|
||||||
if( *SrcRangeStr == NULL )
|
if( *SrcRangeStr == NULL ) {
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
Tok = StrTok( SrcRangeStr, "," );
|
Tok = StrTok( SrcRangeStr, "," );
|
||||||
|
|
||||||
if( ( Ptr = strstr( Tok, "-" ) ) == NULL )
|
if( ( Ptr = strstr( Tok, "-" ) ) == NULL ) {
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
*Ptr = ' ';
|
*Ptr = ' ';
|
||||||
sscanf( Tok, "%d%d", &F, &L );
|
sscanf( Tok, "%"SCNd64"%"SCNd64, &F, &L );
|
||||||
|
|
||||||
if( F == -1 || L == -1 ) {
|
if( F == -1 || L == -1 ) {
|
||||||
*Ptr = '-';
|
*Ptr = '-';
|
||||||
@@ -910,36 +909,35 @@ GetNextRange( char **SrcRangeStr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( Is_Suffix_byte_Range ) {
|
if( Is_Suffix_byte_Range ) {
|
||||||
*FirstByte = L;
|
*FirstByte = (off_t)L;
|
||||||
*LastByte = F;
|
*LastByte = (off_t)F;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*FirstByte = (off_t)F;
|
||||||
|
*LastByte = (off_t)L;
|
||||||
|
|
||||||
*FirstByte = F;
|
|
||||||
*LastByte = L;
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: CreateHTTPRangeResponseHeader
|
* Function: CreateHTTPRangeResponseHeader
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* char * ByteRangeSpecifier ; String containing the range
|
* char * ByteRangeSpecifier ; String containing the range
|
||||||
* long FileLength ; Length of the file
|
* long FileLength ; Length of the file
|
||||||
* OUT struct SendInstruction * Instr ; SendInstruction object where the
|
* OUT struct SendInstruction * Instr ; SendInstruction object
|
||||||
* range operations will be stored
|
* where the range operations will be stored
|
||||||
*
|
*
|
||||||
* Description: Fills in the Offset, read size and contents to send out
|
* Description: Fills in the Offset, read size and contents to send out
|
||||||
* as an HTTP Range Response
|
* as an HTTP Range Response
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* HTTP_BAD_REQUEST
|
* HTTP_BAD_REQUEST
|
||||||
* UPNP_E_OUTOF_MEMORY
|
* UPNP_E_OUTOF_MEMORY
|
||||||
* HTTP_REQUEST_RANGE_NOT_SATISFIABLE
|
* HTTP_REQUEST_RANGE_NOT_SATISFIABLE
|
||||||
* HTTP_OK
|
* HTTP_OK
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
||||||
off_t FileLength,
|
off_t FileLength,
|
||||||
@@ -1035,24 +1033,24 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: CheckOtherHTTPHeaders
|
* Function: CheckOtherHTTPHeaders
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN http_message_t * Req ; HTTP Request message
|
* IN http_message_t * Req ; HTTP Request message
|
||||||
* OUT struct SendInstruction * RespInstr ; Send Instruction object to
|
* OUT struct SendInstruction * RespInstr ; Send Instruction object to
|
||||||
* data for the response
|
* data for the response
|
||||||
* int FileSize ; Size of the file containing the request document
|
* int FileSize ; Size of the file containing the request document
|
||||||
*
|
*
|
||||||
* Description: Get header id from the request parameter and take
|
* Description: Get header id from the request parameter and take
|
||||||
* appropriate action based on the ids.
|
* appropriate action based on the ids.
|
||||||
* as an HTTP Range Response
|
* as an HTTP Range Response
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* HTTP_BAD_REQUEST
|
* HTTP_BAD_REQUEST
|
||||||
* UPNP_E_OUTOF_MEMORY
|
* UPNP_E_OUTOF_MEMORY
|
||||||
* HTTP_REQUEST_RANGE_NOT_SATISFIABLE
|
* HTTP_REQUEST_RANGE_NOT_SATISFIABLE
|
||||||
* HTTP_OK
|
* HTTP_OK
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
CheckOtherHTTPHeaders( IN http_message_t * Req,
|
CheckOtherHTTPHeaders( IN http_message_t * Req,
|
||||||
OUT struct SendInstruction *RespInstr,
|
OUT struct SendInstruction *RespInstr,
|
||||||
@@ -1166,27 +1164,27 @@ CheckOtherHTTPHeaders( IN http_message_t * Req,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: process_request
|
* Function: process_request
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN http_message_t *req ; HTTP Request message
|
* IN http_message_t *req ; HTTP Request message
|
||||||
* OUT enum resp_type *rtype ; Tpye of response
|
* OUT enum resp_type *rtype ; Tpye of response
|
||||||
* OUT membuffer *headers ;
|
* OUT membuffer *headers ;
|
||||||
* OUT membuffer *filename ; Get filename from request document
|
* OUT membuffer *filename ; Get filename from request document
|
||||||
* OUT struct xml_alias_t *alias ; Xml alias document from the
|
* OUT struct xml_alias_t *alias ; Xml alias document from the
|
||||||
* request document,
|
* request document,
|
||||||
* OUT struct SendInstruction * RespInstr ; Send Instruction object
|
* OUT struct SendInstruction * RespInstr ; Send Instruction object
|
||||||
* where the response is set up.
|
* where the response is set up.
|
||||||
*
|
*
|
||||||
* Description: Processes the request and returns the result in the OUT
|
* Description: Processes the request and returns the result in the OUT
|
||||||
* parameters
|
* parameters
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* HTTP_BAD_REQUEST
|
* HTTP_BAD_REQUEST
|
||||||
* UPNP_E_OUTOF_MEMORY
|
* UPNP_E_OUTOF_MEMORY
|
||||||
* HTTP_REQUEST_RANGE_NOT_SATISFIABLE
|
* HTTP_REQUEST_RANGE_NOT_SATISFIABLE
|
||||||
* HTTP_OK
|
* HTTP_OK
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static int
|
static int
|
||||||
process_request( IN http_message_t * req,
|
process_request( IN http_message_t * req,
|
||||||
OUT enum resp_type *rtype,
|
OUT enum resp_type *rtype,
|
||||||
@@ -1494,23 +1492,23 @@ process_request( IN http_message_t * req,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: http_RecvPostMessage
|
* Function: http_RecvPostMessage
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* http_parser_t* parser ; HTTP Parser object
|
* http_parser_t* parser ; HTTP Parser object
|
||||||
* IN SOCKINFO *info ; Socket Information object
|
* IN SOCKINFO *info ; Socket Information object
|
||||||
* char * filename ; File where received data is copied to
|
* char * filename ; File where received data is copied to
|
||||||
* struct SendInstruction * Instr ; Send Instruction object which gives
|
* struct SendInstruction * Instr ; Send Instruction object which gives
|
||||||
* information whether the file is a virtual file or not.
|
* information whether the file is a virtual file or not.
|
||||||
*
|
*
|
||||||
* Description: Receives the HTTP post message
|
* Description: Receives the HTTP post message
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* HTTP_INTERNAL_SERVER_ERROR
|
* HTTP_INTERNAL_SERVER_ERROR
|
||||||
* HTTP_UNAUTHORIZED
|
* HTTP_UNAUTHORIZED
|
||||||
* HTTP_REQUEST_RANGE_NOT_SATISFIABLE
|
* HTTP_REQUEST_RANGE_NOT_SATISFIABLE
|
||||||
* HTTP_OK
|
* HTTP_OK
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
http_RecvPostMessage( http_parser_t * parser,
|
http_RecvPostMessage( http_parser_t * parser,
|
||||||
IN SOCKINFO * info,
|
IN SOCKINFO * info,
|
||||||
@@ -1531,7 +1529,7 @@ http_RecvPostMessage( http_parser_t * parser,
|
|||||||
|
|
||||||
if( Instr && Instr->IsVirtualFile ) {
|
if( Instr && Instr->IsVirtualFile ) {
|
||||||
|
|
||||||
Fp = virtualDirCallback.open( filename, UPNP_WRITE );
|
Fp = (virtualDirCallback.open)( filename, UPNP_WRITE );
|
||||||
if( Fp == NULL ) {
|
if( Fp == NULL ) {
|
||||||
return HTTP_INTERNAL_SERVER_ERROR;
|
return HTTP_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
@@ -1586,13 +1584,10 @@ http_RecvPostMessage( http_parser_t * parser,
|
|||||||
}
|
}
|
||||||
} else if( num_read == 0 ) {
|
} else if( num_read == 0 ) {
|
||||||
if( ok_on_close ) {
|
if( ok_on_close ) {
|
||||||
DBGONLY( UpnpPrintf
|
UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
|
||||||
"<<< (RECVD) <<<\n%s\n-----------------\n",
|
"<<< (RECVD) <<<\n%s\n-----------------\n",
|
||||||
parser->msg.msg.buf );
|
parser->msg.msg.buf );
|
||||||
//print_http_headers( &parser->msg );
|
print_http_headers( &parser->msg );
|
||||||
)
|
|
||||||
|
|
||||||
parser->position = POS_COMPLETE;
|
parser->position = POS_COMPLETE;
|
||||||
} else {
|
} else {
|
||||||
// partial msg
|
// partial msg
|
||||||
@@ -1661,19 +1656,19 @@ http_RecvPostMessage( http_parser_t * parser,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_callback
|
* Function: web_server_callback
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN http_parser_t *parser ; HTTP Parser Object
|
* IN http_parser_t *parser ; HTTP Parser Object
|
||||||
* INOUT http_message_t* req ; HTTP Message request
|
* INOUT http_message_t* req ; HTTP Message request
|
||||||
* IN SOCKINFO *info ; Socket information object
|
* IN SOCKINFO *info ; Socket information object
|
||||||
*
|
*
|
||||||
* Description: main entry point into web server;
|
* Description: main entry point into web server;
|
||||||
* handles HTTP GET and HEAD requests
|
* handles HTTP GET and HEAD requests
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
void
|
void
|
||||||
web_server_callback( IN http_parser_t * parser,
|
web_server_callback( IN http_parser_t * parser,
|
||||||
INOUT http_message_t * req,
|
INOUT http_message_t * req,
|
||||||
@@ -1760,10 +1755,10 @@ web_server_callback( IN http_parser_t * parser,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
"webserver: request processed...\n" );
|
"webserver: request processed...\n" );
|
||||||
)
|
|
||||||
|
|
||||||
membuffer_destroy( &headers );
|
membuffer_destroy( &headers );
|
||||||
membuffer_destroy( &filename );
|
membuffer_destroy( &filename );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -231,6 +231,15 @@ sock_read_write( IN SOCKINFO * info,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SO_NOSIGPIPE
|
||||||
|
{
|
||||||
|
int old;
|
||||||
|
int set = 1;
|
||||||
|
socklen_t olen = sizeof(old);
|
||||||
|
getsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &old, &olen);
|
||||||
|
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &set, sizeof(set));
|
||||||
|
#endif
|
||||||
|
|
||||||
if( bRead ) {
|
if( bRead ) {
|
||||||
// read data
|
// read data
|
||||||
numBytes = recv( sockfd, buffer, bufsize,MSG_NOSIGNAL);
|
numBytes = recv( sockfd, buffer, bufsize,MSG_NOSIGNAL);
|
||||||
@@ -243,6 +252,9 @@ sock_read_write( IN SOCKINFO * info,
|
|||||||
send( sockfd, buffer + bytes_sent, byte_left,
|
send( sockfd, buffer + bytes_sent, byte_left,
|
||||||
MSG_DONTROUTE|MSG_NOSIGNAL);
|
MSG_DONTROUTE|MSG_NOSIGNAL);
|
||||||
if( num_written == -1 ) {
|
if( num_written == -1 ) {
|
||||||
|
#ifdef SO_NOSIGPIPE
|
||||||
|
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &old, olen);
|
||||||
|
#endif
|
||||||
return num_written;
|
return num_written;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,6 +265,11 @@ sock_read_write( IN SOCKINFO * info,
|
|||||||
numBytes = bytes_sent;
|
numBytes = bytes_sent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SO_NOSIGPIPE
|
||||||
|
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &old, olen);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if( numBytes < 0 ) {
|
if( numBytes < 0 ) {
|
||||||
return UPNP_E_SOCKET_ERROR;
|
return UPNP_E_SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,11 @@
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
|
#include <osreldate.h>
|
||||||
|
#if __FreeBSD_version < 601103
|
||||||
#include <lwres/netdb.h>
|
#include <lwres/netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "uri.h"
|
#include "uri.h"
|
||||||
|
|
||||||
@@ -364,16 +367,20 @@ free_URL_list( URL_list * list )
|
|||||||
* uri_type *in ; URI object
|
* uri_type *in ; URI object
|
||||||
*
|
*
|
||||||
* Description : Function useful in debugging for printing a parsed uri.
|
* Description : Function useful in debugging for printing a parsed uri.
|
||||||
* Compiled out with DBGONLY macro.
|
|
||||||
*
|
*
|
||||||
* Return : void ;
|
* Return : void ;
|
||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
DBGONLY( void print_uri( uri_type * in ) {
|
#ifdef DEBUG
|
||||||
|
void print_uri( uri_type *in )
|
||||||
|
{
|
||||||
print_token( &in->scheme );
|
print_token( &in->scheme );
|
||||||
print_token( &in->hostport.text );
|
print_token( &in->hostport.text );
|
||||||
print_token( &in->pathquery ); print_token( &in->fragment );} )
|
print_token( &in->pathquery );
|
||||||
|
print_token( &in->fragment );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : print_token
|
* Function : print_token
|
||||||
@@ -382,20 +389,23 @@ DBGONLY( void print_uri( uri_type * in ) {
|
|||||||
* token * in ; token
|
* token * in ; token
|
||||||
*
|
*
|
||||||
* Description : Function useful in debugging for printing a token.
|
* Description : Function useful in debugging for printing a token.
|
||||||
* Compiled out with DBGONLY macro.
|
|
||||||
*
|
*
|
||||||
* Return : void ;
|
* Return : void ;
|
||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
DBGONLY( void print_token( token * in ) {
|
#ifdef DEBUG
|
||||||
|
void print_token(token * in)
|
||||||
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
printf( "Token Size : %d\n\'", in->size );
|
printf( "Token Size : %"PRIzu"\n\'", in->size );
|
||||||
for( i = 0; i < in->size; i++ ) {
|
for( i = 0; i < in->size; i++ ) {
|
||||||
putchar( in->buff[i] );}
|
putchar( in->buff[i] );
|
||||||
putchar( '\'' ); putchar( '\n' );}
|
}
|
||||||
|
putchar( '\'' );
|
||||||
)
|
putchar( '\n' );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : token_string_casecmp
|
* Function : token_string_casecmp
|
||||||
@@ -414,8 +424,10 @@ DBGONLY( void print_token( token * in ) {
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int token_string_casecmp( token * in1,
|
int token_string_casecmp(
|
||||||
char *in2 ) {
|
token * in1,
|
||||||
|
char *in2 )
|
||||||
|
{
|
||||||
int in2_length = strlen( in2 );
|
int in2_length = strlen( in2 );
|
||||||
|
|
||||||
if( in1->size != in2_length )
|
if( in1->size != in2_length )
|
||||||
@@ -543,7 +555,7 @@ parse_hostport( const char *in,
|
|||||||
int begin_port;
|
int begin_port;
|
||||||
int hostport_size = 0;
|
int hostport_size = 0;
|
||||||
int host_size = 0;
|
int host_size = 0;
|
||||||
#ifndef WIN32
|
#if !defined(WIN32) && !(defined(__OSX__) || defined(__APPLE__))
|
||||||
char temp_hostbyname_buff[BUFFER_SIZE];
|
char temp_hostbyname_buff[BUFFER_SIZE];
|
||||||
struct hostent h_buf;
|
struct hostent h_buf;
|
||||||
#endif
|
#endif
|
||||||
@@ -614,27 +626,61 @@ parse_hostport( const char *in,
|
|||||||
// TODO: Use autoconf to discover this rather than the
|
// TODO: Use autoconf to discover this rather than the
|
||||||
// platform-specific stuff below
|
// platform-specific stuff below
|
||||||
#if defined(WIN32) || defined(__CYGWIN__)
|
#if defined(WIN32) || defined(__CYGWIN__)
|
||||||
h=gethostbyname(temp_host_name);
|
h = gethostbyname(temp_host_name);
|
||||||
#elif defined(SPARC_SOLARIS)
|
#elif defined(SPARC_SOLARIS)
|
||||||
errCode = gethostbyname_r( temp_host_name,
|
errCode = gethostbyname_r(
|
||||||
|
temp_host_name,
|
||||||
&h,
|
&h,
|
||||||
temp_hostbyname_buff,
|
temp_hostbyname_buff,
|
||||||
BUFFER_SIZE, &errcode );
|
BUFFER_SIZE, &errcode );
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) && __FreeBSD_version < 601103
|
||||||
h = lwres_gethostbyname_r( temp_host_name,
|
h = lwres_gethostbyname_r(
|
||||||
|
temp_host_name,
|
||||||
&h_buf,
|
&h_buf,
|
||||||
temp_hostbyname_buff,
|
temp_hostbyname_buff,
|
||||||
BUFFER_SIZE, &errcode );
|
BUFFER_SIZE, &errcode );
|
||||||
if ( h == NULL ) {
|
if ( h == NULL ) {
|
||||||
errCode = 1;
|
errCode = 1;
|
||||||
}
|
}
|
||||||
#else
|
#elif defined(__OSX__) || defined(__APPLE__)
|
||||||
errCode = gethostbyname_r( temp_host_name,
|
h = gethostbyname(temp_host_name);
|
||||||
|
if ( h == NULL ) {
|
||||||
|
errCode = 1;
|
||||||
|
}
|
||||||
|
#elif defined(__linux__)
|
||||||
|
errCode = gethostbyname_r(
|
||||||
|
temp_host_name,
|
||||||
&h_buf,
|
&h_buf,
|
||||||
temp_hostbyname_buff,
|
temp_hostbyname_buff,
|
||||||
BUFFER_SIZE, &h, &errcode );
|
BUFFER_SIZE, &h, &errcode );
|
||||||
#endif
|
#else
|
||||||
|
{
|
||||||
|
struct addrinfo hints, *res, *res0;
|
||||||
|
|
||||||
|
h = NULL;
|
||||||
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
hints.ai_family = PF_INET;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
errCode = getaddrinfo(temp_host_name, "http", &hints, &res0);
|
||||||
|
|
||||||
|
if (!errCode) {
|
||||||
|
for (res = res0; res; res = res->ai_next) {
|
||||||
|
if (res->ai_family == PF_INET &&
|
||||||
|
res->ai_addr->sa_family == AF_INET)
|
||||||
|
{
|
||||||
|
h = &h_buf;
|
||||||
|
h->h_addrtype = res->ai_addr->sa_family;
|
||||||
|
h->h_length = 4;
|
||||||
|
h->h_addr = (void *) temp_hostbyname_buff;
|
||||||
|
*(struct in_addr *)h->h_addr =
|
||||||
|
((struct sockaddr_in *)res->ai_addr)->sin_addr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
freeaddrinfo(res0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if( errCode == 0 ) {
|
if( errCode == 0 ) {
|
||||||
if( h ) {
|
if( h ) {
|
||||||
if( ( h->h_addrtype == AF_INET ) && ( h->h_length == 4 ) ) {
|
if( ( h->h_addrtype == AF_INET ) && ( h->h_length == 4 ) ) {
|
||||||
@@ -787,9 +833,8 @@ remove_dots( char *in,
|
|||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
|
|
||||||
Segments[0] = NULL;
|
Segments[0] = NULL;
|
||||||
DBGONLY( UpnpPrintf
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
( UPNP_ALL, API, __FILE__, __LINE__,
|
"REMOVE_DOTS: before: %s\n", in );
|
||||||
"REMOVE_DOTS: before: %s\n", in ) );
|
|
||||||
while( ( copyFrom < max ) && ( *copyFrom != '?' )
|
while( ( copyFrom < max ) && ( *copyFrom != '?' )
|
||||||
&& ( *copyFrom != '#' ) ) {
|
&& ( *copyFrom != '#' ) ) {
|
||||||
|
|
||||||
@@ -834,9 +879,8 @@ remove_dots( char *in,
|
|||||||
}
|
}
|
||||||
( *copyTo ) = 0;
|
( *copyTo ) = 0;
|
||||||
free( Segments );
|
free( Segments );
|
||||||
DBGONLY( UpnpPrintf
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
( UPNP_ALL, API, __FILE__, __LINE__,
|
"REMOVE_DOTS: after: %s\n", in );
|
||||||
"REMOVE_DOTS: after: %s\n", in ) );
|
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ FindServiceControlURLPath( service_table * table,
|
|||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters :
|
||||||
* service_info *service ;Service whose information is to be printed
|
* service_info *service ;Service whose information is to be printed
|
||||||
* Dbg_Level level ; Debug level specified to the print function
|
* Upnp_LogLevel level ; Debug level specified to the print function
|
||||||
* Dbg_Module module ; Debug module specified to the print function
|
* Dbg_Module module ; Debug module specified to the print function
|
||||||
*
|
*
|
||||||
* Description : For debugging purposes prints information from the
|
* Description : For debugging purposes prints information from the
|
||||||
@@ -443,38 +443,54 @@ FindServiceControlURLPath( service_table * table,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
DBGONLY( void printService( service_info * service, Dbg_Level level,
|
#ifdef DEBUG
|
||||||
Dbg_Module module ) {
|
void printService(
|
||||||
|
service_info *service,
|
||||||
|
Upnp_LogLevel level,
|
||||||
|
Dbg_Module module )
|
||||||
|
{
|
||||||
if( service ) {
|
if( service ) {
|
||||||
if( service->serviceType )
|
if( service->serviceType ) {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"serviceType: %s\n", service->serviceType );
|
"serviceType: %s\n", service->serviceType );
|
||||||
if( service->serviceId )
|
}
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__, "serviceId: %s\n",
|
if( service->serviceId ) {
|
||||||
service->serviceId ); if( service->SCPDURL )
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__, "SCPDURL: %s\n",
|
"serviceId: %s\n", service->serviceId );
|
||||||
service->SCPDURL ); if( service->controlURL )
|
}
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__, "controlURL: %s\n",
|
if( service->SCPDURL ) {
|
||||||
service->controlURL ); if( service->eventURL )
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__, "eventURL: %s\n",
|
"SCPDURL: %s\n", service->SCPDURL );
|
||||||
service->eventURL ); if( service->UDN )
|
}
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__, "UDN: %s\n\n",
|
if( service->controlURL ) {
|
||||||
service->UDN ); if( service->active )
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
|
"controlURL: %s\n", service->controlURL );
|
||||||
|
}
|
||||||
|
if( service->eventURL ) {
|
||||||
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
|
"eventURL: %s\n", service->eventURL );
|
||||||
|
}
|
||||||
|
if( service->UDN ) {
|
||||||
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
|
"UDN: %s\n\n", service->UDN );
|
||||||
|
}
|
||||||
|
if( service->active ) {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"Service is active\n" );
|
"Service is active\n" );
|
||||||
else
|
} else {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"Service is inactive\n" );}
|
"Service is inactive\n" );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
)
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : printServiceList
|
* Function : printServiceList
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters :
|
||||||
* service_info *service ; Service whose information is to be printed
|
* service_info *service ; Service whose information is to be printed
|
||||||
* Dbg_Level level ; Debug level specified to the print function
|
* Upnp_LogLevel level ; Debug level specified to the print function
|
||||||
* Dbg_Module module ; Debug module specified to the print function
|
* Dbg_Module module ; Debug module specified to the print function
|
||||||
*
|
*
|
||||||
* Description : For debugging purposes prints information of each
|
* Description : For debugging purposes prints information of each
|
||||||
@@ -484,43 +500,55 @@ DBGONLY( void printService( service_info * service, Dbg_Level level,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
DBGONLY( void printServiceList( service_info * service,
|
#ifdef DEBUG
|
||||||
Dbg_Level level,
|
void printServiceList(
|
||||||
Dbg_Module module ) {
|
service_info * service,
|
||||||
|
Upnp_LogLevel level,
|
||||||
|
Dbg_Module module )
|
||||||
|
{
|
||||||
while( service ) {
|
while( service ) {
|
||||||
if( service->serviceType )
|
if( service->serviceType ) {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"serviceType: %s\n", service->serviceType );
|
"serviceType: %s\n", service->serviceType );
|
||||||
if( service->serviceId )
|
}
|
||||||
|
if( service->serviceId ) {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"serviceId: %s\n", service->serviceId );
|
"serviceId: %s\n", service->serviceId );
|
||||||
if( service->SCPDURL )
|
}
|
||||||
|
if( service->SCPDURL ) {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"SCPDURL: %s\n", service->SCPDURL );
|
"SCPDURL: %s\n", service->SCPDURL );
|
||||||
if( service->controlURL )
|
}
|
||||||
|
if( service->controlURL ) {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"controlURL: %s\n", service->controlURL );
|
"controlURL: %s\n", service->controlURL );
|
||||||
if( service->eventURL )
|
}
|
||||||
|
if( service->eventURL ) {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"eventURL: %s\n", service->eventURL );
|
"eventURL: %s\n", service->eventURL );
|
||||||
if( service->UDN )
|
}
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__, "UDN: %s\n\n",
|
if( service->UDN ) {
|
||||||
service->UDN ); if( service->active )
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
|
"UDN: %s\n\n", service->UDN );
|
||||||
|
}
|
||||||
|
if( service->active ) {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"Service is active\n" );
|
"Service is active\n" );
|
||||||
else
|
} else {
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"Service is inactive\n" );
|
"Service is inactive\n" );
|
||||||
service = service->next;}
|
|
||||||
}
|
}
|
||||||
)
|
service = service->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : printServiceTable
|
* Function : printServiceTable
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters :
|
||||||
* service_table * table ; Service table to be printed
|
* service_table * table ; Service table to be printed
|
||||||
* Dbg_Level level ; Debug level specified to the print function
|
* Upnp_LogLevel level ; Debug level specified to the print function
|
||||||
* Dbg_Module module ; Debug module specified to the print function
|
* Dbg_Module module ; Debug module specified to the print function
|
||||||
*
|
*
|
||||||
* Description : For debugging purposes prints the URL base of the table
|
* Description : For debugging purposes prints the URL base of the table
|
||||||
@@ -531,15 +559,18 @@ DBGONLY( void printService( service_info * service, Dbg_Level level,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
DBGONLY( void printServiceTable( service_table * table,
|
#ifdef DEBUG
|
||||||
Dbg_Level level,
|
void printServiceTable(
|
||||||
Dbg_Module module ) {
|
service_table * table,
|
||||||
|
Upnp_LogLevel level,
|
||||||
|
Dbg_Module module )
|
||||||
|
{
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"URL_BASE: %s\n", table->URLBase );
|
"URL_BASE: %s\n", table->URLBase );
|
||||||
UpnpPrintf( level, module, __FILE__, __LINE__,
|
UpnpPrintf( level, module, __FILE__, __LINE__,
|
||||||
"Services: \n" );
|
"Services: \n" );
|
||||||
printServiceList( table->serviceList, level, module );}
|
printServiceList( table->serviceList, level, module );}
|
||||||
)
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : freeService
|
* Function : freeService
|
||||||
@@ -554,7 +585,7 @@ DBGONLY( void printService( service_info * service, Dbg_Level level,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
void freeService( service_info * in )
|
void freeService( service_info * in )
|
||||||
{
|
{
|
||||||
if( in ) {
|
if( in ) {
|
||||||
if( in->serviceType )
|
if( in->serviceType )
|
||||||
@@ -849,12 +880,10 @@ getServiceList( IXML_Node * node,
|
|||||||
( !
|
( !
|
||||||
( current->controlURL =
|
( current->controlURL =
|
||||||
resolve_rel_url( URLBase, tempDOMString ) ) ) ) {
|
resolve_rel_url( URLBase, tempDOMString ) ) ) ) {
|
||||||
DBGONLY( UpnpPrintf
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
( UPNP_INFO, GENA, __FILE__, __LINE__,
|
"BAD OR MISSING CONTROL URL" );
|
||||||
"BAD OR MISSING CONTROL URL" ) );
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
DBGONLY( UpnpPrintf
|
"CONTROL URL SET TO NULL IN SERVICE INFO" );
|
||||||
( UPNP_INFO, GENA, __FILE__, __LINE__,
|
|
||||||
"CONTROL URL SET TO NULL IN SERVICE INFO" ) );
|
|
||||||
current->controlURL = NULL;
|
current->controlURL = NULL;
|
||||||
fail = 0;
|
fail = 0;
|
||||||
}
|
}
|
||||||
@@ -870,12 +899,10 @@ getServiceList( IXML_Node * node,
|
|||||||
( !
|
( !
|
||||||
( current->eventURL =
|
( current->eventURL =
|
||||||
resolve_rel_url( URLBase, tempDOMString ) ) ) ) {
|
resolve_rel_url( URLBase, tempDOMString ) ) ) ) {
|
||||||
DBGONLY( UpnpPrintf
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
( UPNP_INFO, GENA, __FILE__, __LINE__,
|
"BAD OR MISSING EVENT URL" );
|
||||||
"BAD OR MISSING EVENT URL" ) );
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
DBGONLY( UpnpPrintf
|
"EVENT URL SET TO NULL IN SERVICE INFO" );
|
||||||
( UPNP_INFO, GENA, __FILE__, __LINE__,
|
|
||||||
"EVENT URL SET TO NULL IN SERVICE INFO" ) );
|
|
||||||
current->eventURL = NULL;
|
current->eventURL = NULL;
|
||||||
fail = 0;
|
fail = 0;
|
||||||
}
|
}
|
||||||
@@ -1092,20 +1119,20 @@ addServiceTable( IXML_Node * node,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : getServiceTable
|
* Function : getServiceTable
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters :
|
||||||
* IXML_Node *node ; XML node information
|
* IXML_Node *node ; XML node information
|
||||||
* service_table *out ; output parameter which will contain the
|
* service_table *out ; output parameter which will contain the
|
||||||
* service list and URL
|
* service list and URL
|
||||||
* const char *DefaultURLBase ; Default base URL on which the URL
|
* const char *DefaultURLBase ; Default base URL on which the URL
|
||||||
* will be returned.
|
* will be returned.
|
||||||
*
|
*
|
||||||
* Description : Retrieve service from the table
|
* Description : Retrieve service from the table
|
||||||
*
|
*
|
||||||
* Return : int ;
|
* Return : int ;
|
||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int
|
int
|
||||||
getServiceTable( IXML_Node * node,
|
getServiceTable( IXML_Node * node,
|
||||||
@@ -1126,9 +1153,8 @@ getServiceTable( IXML_Node * node,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( out->serviceList = getAllServiceList( root, out->URLBase,
|
if( ( out->serviceList = getAllServiceList(
|
||||||
&out->
|
root, out->URLBase, &out->endServiceList ) ) ) {
|
||||||
endServiceList ) ) ) {
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ memptr_cmp_nocase( IN memptr * m,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
static XINLINE void
|
static UPNP_INLINE void
|
||||||
membuffer_initialize( INOUT membuffer * m )
|
membuffer_initialize( INOUT membuffer * m )
|
||||||
{
|
{
|
||||||
m->buf = NULL;
|
m->buf = NULL;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#ifndef INTERNAL_CONFIG_H
|
#ifndef INTERNAL_CONFIG_H
|
||||||
#define INTERNAL_CONFIG_H
|
#define INTERNAL_CONFIG_H
|
||||||
|
|
||||||
|
|
||||||
#include "autoconfig.h"
|
#include "autoconfig.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -261,7 +262,7 @@
|
|||||||
|
|
||||||
/** @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:
|
||||||
see <upnp/upnpdebug.h>
|
see <upnp/inc/upnpdebug.h>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DEBUG_ALL 1
|
#define DEBUG_ALL 1
|
||||||
@@ -304,27 +305,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** @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
|
||||||
@@ -359,13 +339,6 @@
|
|||||||
# define CLIENTONLY(x)
|
# define CLIENTONLY(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef INCLUDE_DEVICE_APIS
|
|
||||||
# define DEVICEONLY(x) x
|
|
||||||
#else
|
|
||||||
# define DEVICEONLY(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -89,25 +89,26 @@
|
|||||||
#define DEFAULT_TIMEOUT 1801
|
#define DEFAULT_TIMEOUT 1801
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern ithread_mutex_t GlobalClientSubscribeMutex;
|
extern ithread_mutex_t GlobalClientSubscribeMutex;
|
||||||
|
|
||||||
//Lock the subscription
|
// Lock the subscription
|
||||||
#define SubscribeLock() \
|
#define SubscribeLock() \
|
||||||
DBGONLY(UpnpPrintf(UPNP_INFO,GENA,__FILE__,__LINE__, \
|
UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__, \
|
||||||
"Trying Subscribe Lock")); \
|
"Trying Subscribe Lock"); \
|
||||||
ithread_mutex_lock(&GlobalClientSubscribeMutex); \
|
ithread_mutex_lock(&GlobalClientSubscribeMutex); \
|
||||||
DBGONLY(UpnpPrintf(UPNP_INFO,GENA,__FILE__,__LINE__,"Subscribe Lock");)
|
UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__, \
|
||||||
|
"Subscribe Lock");
|
||||||
|
|
||||||
//Unlock the subscription
|
// Unlock the subscription
|
||||||
#define SubscribeUnlock() \
|
#define SubscribeUnlock() \
|
||||||
DBGONLY(UpnpPrintf(UPNP_INFO,GENA,__FILE__,__LINE__, \
|
UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__, \
|
||||||
"Trying Subscribe UnLock")); \
|
"Trying Subscribe UnLock"); \
|
||||||
ithread_mutex_unlock(&GlobalClientSubscribeMutex); \
|
ithread_mutex_unlock(&GlobalClientSubscribeMutex); \
|
||||||
DBGONLY(UpnpPrintf(UPNP_INFO,GENA,__FILE__,__LINE__,"Subscribe UnLock");)
|
UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__, \
|
||||||
|
"Subscribe UnLock");
|
||||||
|
|
||||||
|
|
||||||
//Structure to send NOTIFY message to all subscribed control points
|
// Structure to send NOTIFY message to all subscribed control points
|
||||||
typedef struct NOTIFY_THREAD_STRUCT {
|
typedef struct NOTIFY_THREAD_STRUCT {
|
||||||
char * headers;
|
char * headers;
|
||||||
DOMString propertySet;
|
DOMString propertySet;
|
||||||
@@ -161,11 +162,13 @@ EXTERN_C void genaCallback (IN http_parser_t *parser,
|
|||||||
* return UPNP_E_SUCCESS if service response is OK else
|
* return UPNP_E_SUCCESS if service response is OK else
|
||||||
* returns appropriate error
|
* returns appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
CLIENTONLY(
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
EXTERN_C int genaSubscribe(UpnpClient_Handle client_handle,
|
EXTERN_C int genaSubscribe(
|
||||||
|
UpnpClient_Handle client_handle,
|
||||||
char * PublisherURL,
|
char * PublisherURL,
|
||||||
int * TimeOut,
|
int * TimeOut,
|
||||||
Upnp_SID out_sid );)
|
Upnp_SID out_sid );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -184,8 +187,11 @@ CLIENTONLY(
|
|||||||
* return UPNP_E_SUCCESS if service response is OK else
|
* return UPNP_E_SUCCESS if service response is OK else
|
||||||
* returns appropriate error
|
* returns appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
CLIENTONLY(EXTERN_C int genaUnSubscribe(UpnpClient_Handle client_handle,
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
const Upnp_SID in_sid);)
|
EXTERN_C int genaUnSubscribe(
|
||||||
|
UpnpClient_Handle client_handle,
|
||||||
|
const Upnp_SID in_sid);
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : genaUnregisterClient
|
* Function : genaUnregisterClient
|
||||||
@@ -202,8 +208,9 @@ CLIENTONLY(EXTERN_C int genaUnSubscribe(UpnpClient_Handle client_handle,
|
|||||||
* Returns: int
|
* Returns: int
|
||||||
* return UPNP_E_SUCCESS if successful else returns appropriate error
|
* return UPNP_E_SUCCESS if successful else returns appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
CLIENTONLY(EXTERN_C int genaUnregisterClient(
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
UpnpClient_Handle client_handle);)
|
EXTERN_C int genaUnregisterClient(UpnpClient_Handle client_handle);
|
||||||
|
#endif
|
||||||
|
|
||||||
//server
|
//server
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -218,8 +225,9 @@ CLIENTONLY(EXTERN_C int genaUnregisterClient(
|
|||||||
* Returns: int
|
* Returns: int
|
||||||
* returns UPNP_E_SUCCESS if successful else returns GENA_E_BAD_HANDLE
|
* returns UPNP_E_SUCCESS if successful else returns GENA_E_BAD_HANDLE
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
DEVICEONLY(EXTERN_C int genaUnregisterDevice(
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
UpnpDevice_Handle device_handle);)
|
EXTERN_C int genaUnregisterDevice(UpnpDevice_Handle device_handle);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -242,10 +250,12 @@ DEVICEONLY(EXTERN_C int genaUnregisterDevice(
|
|||||||
* return UPNP_E_SUCCESS if service response is OK else
|
* return UPNP_E_SUCCESS if service response is OK else
|
||||||
* returns appropriate error
|
* returns appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
CLIENTONLY(EXTERN_C int genaRenewSubscription(
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
|
EXTERN_C int genaRenewSubscription(
|
||||||
IN UpnpClient_Handle client_handle,
|
IN UpnpClient_Handle client_handle,
|
||||||
IN const Upnp_SID in_sid,
|
IN const Upnp_SID in_sid,
|
||||||
OUT int * TimeOut);)
|
OUT int * TimeOut);
|
||||||
|
#endif
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function : genaNotifyAll
|
* Function : genaNotifyAll
|
||||||
*
|
*
|
||||||
@@ -265,13 +275,15 @@ CLIENTONLY(EXTERN_C int genaRenewSubscription(
|
|||||||
* Note : This function is similar to the genaNotifyAllExt. The only difference
|
* Note : This function is similar to the genaNotifyAllExt. The only difference
|
||||||
* is it takes event variable array instead of xml document.
|
* is it takes event variable array instead of xml document.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
DEVICEONLY(EXTERN_C int genaNotifyAll(UpnpDevice_Handle device_handle,
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
|
EXTERN_C int genaNotifyAll(
|
||||||
|
UpnpDevice_Handle device_handle,
|
||||||
char *UDN,
|
char *UDN,
|
||||||
char *servId,
|
char *servId,
|
||||||
char **VarNames,
|
char **VarNames,
|
||||||
char **VarValues,
|
char **VarValues,
|
||||||
int var_count
|
int var_count);
|
||||||
);)
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function : genaNotifyAllExt
|
* Function : genaNotifyAllExt
|
||||||
@@ -290,8 +302,13 @@ DEVICEONLY(EXTERN_C int genaNotifyAll(UpnpDevice_Handle device_handle,
|
|||||||
* Note : This function is similar to the genaNotifyAll. the only difference
|
* Note : This function is similar to the genaNotifyAll. the only difference
|
||||||
* is it takes the document instead of event variable array
|
* is it takes the document instead of event variable array
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
DEVICEONLY(EXTERN_C int genaNotifyAllExt(UpnpDevice_Handle device_handle,
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
char *UDN, char *servId,IN IXML_Document *PropSet);)
|
EXTERN_C int genaNotifyAllExt(
|
||||||
|
UpnpDevice_Handle device_handle,
|
||||||
|
char *UDN,
|
||||||
|
char *servId,
|
||||||
|
IN IXML_Document *PropSet);
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function : genaInitNotify
|
* Function : genaInitNotify
|
||||||
@@ -314,13 +331,15 @@ DEVICEONLY(EXTERN_C int genaNotifyAllExt(UpnpDevice_Handle device_handle,
|
|||||||
* Note : No other event will be sent to this control point before the
|
* Note : No other event will be sent to this control point before the
|
||||||
* intial state table dump.
|
* intial state table dump.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
DEVICEONLY(EXTERN_C int genaInitNotify(IN UpnpDevice_Handle device_handle,
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
|
EXTERN_C int genaInitNotify(IN UpnpDevice_Handle device_handle,
|
||||||
IN char *UDN,
|
IN char *UDN,
|
||||||
IN char *servId,
|
IN char *servId,
|
||||||
IN char **VarNames,
|
IN char **VarNames,
|
||||||
IN char **VarValues,
|
IN char **VarValues,
|
||||||
IN int var_count,
|
IN int var_count,
|
||||||
IN Upnp_SID sid);)
|
IN Upnp_SID sid);
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function : genaInitNotifyExt
|
* Function : genaInitNotifyExt
|
||||||
@@ -342,12 +361,14 @@ DEVICEONLY(EXTERN_C int genaInitNotify(IN UpnpDevice_Handle device_handle,
|
|||||||
* Note : No other event will be sent to this control point before the
|
* Note : No other event will be sent to this control point before the
|
||||||
* intial state table dump.
|
* intial state table dump.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
DEVICEONLY(EXTERN_C int genaInitNotifyExt(
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
|
EXTERN_C int genaInitNotifyExt(
|
||||||
IN UpnpDevice_Handle device_handle,
|
IN UpnpDevice_Handle device_handle,
|
||||||
IN char *UDN,
|
IN char *UDN,
|
||||||
IN char *servId,
|
IN char *servId,
|
||||||
IN IXML_Document *PropSet,
|
IN IXML_Document *PropSet,
|
||||||
IN Upnp_SID sid);)
|
IN Upnp_SID sid);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
|||||||
@@ -214,37 +214,101 @@ EXTERN_C ssize_t readLine(int fd, char *out, int max, int *timeout);
|
|||||||
EXTERN_C int remove_dots(char * in, int size);
|
EXTERN_C int remove_dots(char * in, int size);
|
||||||
|
|
||||||
|
|
||||||
DBGONLY(EXTERN_C void print_http_request(http_message
|
#ifdef DEBUG
|
||||||
*message,Dbg_Level DLevel,
|
EXTERN_C void print_http_request(
|
||||||
Dbg_Module Module,char *DbgFileName,
|
http_message *message,
|
||||||
int DbgLineNo););
|
Upnp_LogLevel DLevel,
|
||||||
|
|
||||||
DBGONLY(EXTERN_C void print_http_response(http_message *message,
|
|
||||||
Dbg_Level DLevel,
|
|
||||||
Dbg_Module Module,char *DbgFileName,
|
|
||||||
int DbgLineNo););
|
|
||||||
|
|
||||||
DBGONLY(EXTERN_C void print_token( token * in,
|
|
||||||
Dbg_Level DLevel,
|
|
||||||
Dbg_Module Module,
|
Dbg_Module Module,
|
||||||
char *DbgFileName,
|
char *DbgFileName,
|
||||||
int DbgLineNo););
|
int DbgLineNo);
|
||||||
|
#else
|
||||||
DBGONLY(EXTERN_C void print_status_line(http_status *in,
|
static inline void print_http_request(
|
||||||
Dbg_Level DLevel,
|
http_message *message,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
Dbg_Module Module,
|
Dbg_Module Module,
|
||||||
char *DbgFileName,
|
char *DbgFileName,
|
||||||
int DbgLineNo););
|
int DbgLineNo) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
DBGONLY(EXTERN_C void print_request_line(http_request *in,
|
#ifdef DEBUG
|
||||||
Dbg_Level DLevel,
|
EXTERN_C void print_http_response(
|
||||||
Dbg_Module Module,
|
http_message *message,
|
||||||
char *DbgFileName,int DbgLineNo));
|
Upnp_LogLevel DLevel,
|
||||||
|
|
||||||
DBGONLY(EXTERN_C void print_uri( uri_type *in,
|
|
||||||
Dbg_Level DLevel,
|
|
||||||
Dbg_Module Module,
|
Dbg_Module Module,
|
||||||
char *DbgFileName,
|
char *DbgFileName,
|
||||||
int DbgLineNo););
|
int DbgLineNo);
|
||||||
|
#else
|
||||||
|
static inline void print_http_response(
|
||||||
|
http_message *message,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
char *DbgFileName,
|
||||||
|
int DbgLineNo) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
EXTERN_C void print_token(
|
||||||
|
token *in,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
char *DbgFileName,
|
||||||
|
int DbgLineNo);
|
||||||
|
#else
|
||||||
|
static inline void print_token(
|
||||||
|
token *in,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
char *DbgFileName,
|
||||||
|
int DbgLineNo) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
EXTERN_C void print_status_line(
|
||||||
|
http_status *in,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
char *DbgFileName,
|
||||||
|
int DbgLineNo);
|
||||||
|
#else
|
||||||
|
static inline void print_status_line(
|
||||||
|
http_status *in,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
char *DbgFileName,
|
||||||
|
int DbgLineNo) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
EXTERN_C void print_request_line(
|
||||||
|
http_request *in,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
char *DbgFileName,
|
||||||
|
int DbgLineNo);
|
||||||
|
#else
|
||||||
|
static inline void print_request_line(
|
||||||
|
http_request *in,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
char *DbgFileName,
|
||||||
|
int DbgLineNo) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
EXTERN_C void print_uri(
|
||||||
|
uri_type *in,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
char *DbgFileName,
|
||||||
|
int DbgLineNo);
|
||||||
|
#else
|
||||||
|
static inline void print_uri(
|
||||||
|
uri_type *in,
|
||||||
|
Upnp_LogLevel DLevel,
|
||||||
|
Dbg_Module Module,
|
||||||
|
char *DbgFileName,
|
||||||
|
int DbgLineNo) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -456,6 +456,8 @@ int raw_to_int( IN memptr* raw_value, int base );
|
|||||||
*
|
*
|
||||||
* Description: Find a substring from raw character string buffer
|
* Description: Find a substring from raw character string buffer
|
||||||
*
|
*
|
||||||
|
* Side effects: raw_value is transformed to lowercase.
|
||||||
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* int - index at which the substring is found.
|
* int - index at which the substring is found.
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
@@ -486,7 +488,11 @@ const char* method_to_str( IN http_method_t method );
|
|||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
void print_http_headers( IN http_message_t* hmsg );
|
#ifdef DEBUG
|
||||||
|
void print_http_headers( IN http_message_t *hmsg );
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE void print_http_headers( IN http_message_t *hmsg ) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
@@ -494,3 +500,4 @@ void print_http_headers( IN http_message_t* hmsg );
|
|||||||
|
|
||||||
|
|
||||||
#endif // GENLIB_NET_HTTP_HTTPPARSER_H
|
#endif // GENLIB_NET_HTTP_HTTPPARSER_H
|
||||||
|
|
||||||
|
|||||||
@@ -50,73 +50,78 @@ int
|
|||||||
http_CancelHttpGet( IN void *Handle );
|
http_CancelHttpGet( IN void *Handle );
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: http_FixUrl
|
* Function: http_FixUrl
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN uri_type* url ; URL to be validated and fixed
|
* IN uri_type* url; URL to be validated and fixed
|
||||||
* OUT uri_type* fixed_url ; URL after being fixed.
|
* OUT uri_type* fixed_url; URL after being fixed.
|
||||||
*
|
*
|
||||||
* Description: Validates URL
|
* Description:
|
||||||
*
|
* Validates URL
|
||||||
* Returns:
|
*
|
||||||
* UPNP_E_INVALID_URL
|
* Returns:
|
||||||
* UPNP_E_SUCCESS
|
* UPNP_E_INVALID_URL
|
||||||
************************************************************************/
|
* UPNP_E_SUCCESS
|
||||||
|
************************************************************************/
|
||||||
int http_FixUrl( IN uri_type* url, OUT uri_type* fixed_url );
|
int http_FixUrl( IN uri_type* url, OUT uri_type* fixed_url );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: http_FixStrUrl
|
* Function: http_FixStrUrl
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN char* urlstr ; Character string as a URL
|
* IN char* urlstr ; Character string as a URL
|
||||||
* IN int urlstrlen ; Length of the character string
|
* IN int urlstrlen ; Length of the character string
|
||||||
* OUT uri_type* fixed_url ; Fixed and corrected URL
|
* OUT uri_type* fixed_url ; Fixed and corrected URL
|
||||||
*
|
*
|
||||||
* Description: Parses URL and then validates URL
|
* Description:
|
||||||
*
|
* Parses URL and then validates URL
|
||||||
* Returns:
|
*
|
||||||
* UPNP_E_INVALID_URL
|
* Returns:
|
||||||
* UPNP_E_SUCCESS
|
* UPNP_E_INVALID_URL
|
||||||
************************************************************************/
|
* UPNP_E_SUCCESS
|
||||||
|
************************************************************************/
|
||||||
int http_FixStrUrl( IN char* urlstr, IN int urlstrlen, OUT uri_type* fixed_url );
|
int http_FixStrUrl( IN char* urlstr, IN int urlstrlen, OUT uri_type* fixed_url );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: http_Connect
|
* Function: http_Connect
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN uri_type* destination_url ; URL containing destination information
|
* IN uri_type* destination_url; URL containing destination information
|
||||||
* OUT uri_type *url ; Fixed and corrected URL
|
* OUT uri_type *url; Fixed and corrected URL
|
||||||
*
|
*
|
||||||
* Description: Gets destination address from URL and then connects to the
|
* Description:
|
||||||
* remote end
|
* Gets destination address from URL and then connects to the remote end
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* socket descriptor on sucess
|
* socket descriptor on sucess
|
||||||
* UPNP_E_OUTOF_SOCKET
|
* UPNP_E_OUTOF_SOCKET
|
||||||
* UPNP_E_SOCKET_CONNECT on error
|
* UPNP_E_SOCKET_CONNECT on error
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int http_Connect( IN uri_type* destination_url, OUT uri_type *url );
|
int http_Connect( IN uri_type* destination_url, OUT uri_type *url );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: http_RecvMessage
|
* Function: http_RecvMessage
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN SOCKINFO *info ; Socket information object
|
* IN SOCKINFO *info; Socket information object
|
||||||
* OUT http_parser_t* parser, HTTP parser object
|
* OUT http_parser_t* parser; HTTP parser object
|
||||||
* IN http_method_t request_method ; HTTP request method
|
* IN http_method_t request_method; HTTP request method
|
||||||
* IN OUT int* timeout_secs ; time out
|
* IN OUT int* timeout_secs; time out
|
||||||
* OUT int* http_error_code ; HTTP error code returned
|
* OUT int* http_error_code; HTTP error code returned
|
||||||
*
|
*
|
||||||
* Description: Get the data on the socket and take actions based on the
|
* Description:
|
||||||
* read data to modify the parser objects buffer. If an error is reported
|
* Get the data on the socket and take actions based on the read data
|
||||||
* while parsing the data, the error code is passed in the http_errr_code
|
* to modify the parser objects buffer. If an error is reported while
|
||||||
* parameter
|
* parsing the data, the error code is passed in the http_errr_code
|
||||||
*
|
* parameter
|
||||||
* Returns:
|
*
|
||||||
* UPNP_E_BAD_HTTPMSG
|
* Returns:
|
||||||
* UPNP_E_SUCCESS
|
* UPNP_E_BAD_HTTPMSG
|
||||||
************************************************************************/
|
* UPNP_E_SUCCESS
|
||||||
|
************************************************************************/
|
||||||
int http_RecvMessage( IN SOCKINFO *info, OUT http_parser_t* parser,
|
int http_RecvMessage( IN SOCKINFO *info, OUT http_parser_t* parser,
|
||||||
IN http_method_t request_method,
|
IN http_method_t request_method,
|
||||||
IN OUT int* timeout_secs,
|
IN OUT int* timeout_secs,
|
||||||
@@ -124,302 +129,311 @@ int http_RecvMessage( IN SOCKINFO *info, OUT http_parser_t* parser,
|
|||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: http_SendMessage
|
* Function: http_SendMessage
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN SOCKINFO *info ; Socket information object
|
* IN SOCKINFO *info ; Socket information object
|
||||||
* IN OUT int * TimeOut ; time out value
|
* IN OUT int * TimeOut ; time out value
|
||||||
* IN const char* fmt, ... Pattern format to take actions upon
|
* IN const char* fmt, ... Pattern format to take actions upon
|
||||||
*
|
*
|
||||||
* Description: Sends a message to the destination based on the
|
* Description:
|
||||||
* IN const char* fmt parameter
|
* Sends a message to the destination based on the
|
||||||
* fmt types:
|
* IN const char* fmt parameter
|
||||||
* 'f': arg = const char * file name
|
* fmt types:
|
||||||
* 'm': arg1 = const char * mem_buffer; arg2= size_t buf_length
|
* 'f': arg = const char * file name
|
||||||
* E.g.:
|
* 'm': arg1 = const char * mem_buffer; arg2= size_t buf_length
|
||||||
* char *buf = "POST /xyz.cgi http/1.1\r\n\r\n";
|
* E.g.:
|
||||||
* char *filename = "foo.dat";
|
* char *buf = "POST /xyz.cgi http/1.1\r\n\r\n";
|
||||||
* int status = http_SendMessage( tcpsock, "mf",
|
* char *filename = "foo.dat";
|
||||||
* buf, strlen(buf), // args for memory buffer
|
* int status = http_SendMessage( tcpsock, "mf",
|
||||||
* filename ); // arg for file
|
* buf, strlen(buf), // args for memory buffer
|
||||||
*
|
* filename ); // arg for file
|
||||||
* Returns:
|
*
|
||||||
* UPNP_E_OUTOF_MEMORY
|
* Returns:
|
||||||
* UPNP_E_FILE_READ_ERROR
|
* UPNP_E_OUTOF_MEMORY
|
||||||
* UPNP_E_SUCCESS
|
* UPNP_E_FILE_READ_ERROR
|
||||||
************************************************************************/
|
* UPNP_E_SUCCESS
|
||||||
int http_SendMessage( IN SOCKINFO *info, IN OUT int* timeout_secs,
|
************************************************************************/
|
||||||
|
int http_SendMessage(
|
||||||
|
IN SOCKINFO *info,
|
||||||
|
IN OUT int* timeout_secs,
|
||||||
IN const char* fmt, ... );
|
IN const char* fmt, ... );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: http_RequestAndResponse
|
* Function: http_RequestAndResponse
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN uri_type* destination ; Destination URI object which contains
|
* IN uri_type* destination; Destination URI object which contains
|
||||||
* remote IP address among other elements
|
* remote IP address among other elements
|
||||||
* IN const char* request ; Request to be sent
|
* IN const char* request; Request to be sent
|
||||||
* IN size_t request_length ; Length of the request
|
* IN size_t request_length; Length of the request
|
||||||
* IN http_method_t req_method ; HTTP Request method
|
* IN http_method_t req_method; HTTP Request method
|
||||||
* IN int timeout_secs ; time out value
|
* IN int timeout_secs; time out value
|
||||||
* OUT http_parser_t* response ; Parser object to receive the repsonse
|
* OUT http_parser_t* response; Parser object to receive the repsonse
|
||||||
*
|
*
|
||||||
* Description: Initiates socket, connects to the destination, sends a
|
* Description:
|
||||||
* request and waits for the response from the remote end
|
* Initiates socket, connects to the destination, sends a
|
||||||
*
|
* request and waits for the response from the remote end
|
||||||
* Returns:
|
*
|
||||||
* UPNP_E_SOCKET_ERROR
|
* Returns:
|
||||||
* UPNP_E_SOCKET_CONNECT
|
* UPNP_E_SOCKET_ERROR
|
||||||
* Error Codes returned by http_SendMessage
|
* UPNP_E_SOCKET_CONNECT
|
||||||
* Error Codes returned by http_RecvMessage
|
* Error Codes returned by http_SendMessage
|
||||||
************************************************************************/
|
* Error Codes returned by http_RecvMessage
|
||||||
int http_RequestAndResponse( IN uri_type* destination,
|
************************************************************************/
|
||||||
IN const char* request, IN size_t request_length,
|
int http_RequestAndResponse(
|
||||||
|
IN uri_type* destination,
|
||||||
|
IN const char* request,
|
||||||
|
IN size_t request_length,
|
||||||
IN http_method_t req_method,
|
IN http_method_t req_method,
|
||||||
IN int timeout_secs,
|
IN int timeout_secs,
|
||||||
OUT http_parser_t* response );
|
OUT http_parser_t* response );
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* return codes:
|
|
||||||
* 0 -- success
|
|
||||||
* UPNP_E_OUTOF_MEMORY
|
|
||||||
* UPNP_E_TIMEDOUT
|
|
||||||
* UPNP_E_BAD_REQUEST
|
|
||||||
* UPNP_E_BAD_RESPONSE
|
|
||||||
* UPNP_E_INVALID_URL
|
|
||||||
* UPNP_E_SOCKET_READ
|
|
||||||
* UPNP_E_SOCKET_WRITE
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_Download
|
* return codes:
|
||||||
*
|
* 0 -- success
|
||||||
* Parameters :
|
* UPNP_E_OUTOF_MEMORY
|
||||||
* IN const char* url_str : String as a URL
|
* UPNP_E_TIMEDOUT
|
||||||
* IN int timeout_secs : time out value
|
* UPNP_E_BAD_REQUEST
|
||||||
* OUT char** document : buffer to store the document extracted
|
* UPNP_E_BAD_RESPONSE
|
||||||
* from the donloaded message.
|
* UPNP_E_INVALID_URL
|
||||||
* OUT int* doc_length : length of the extracted document
|
* UPNP_E_SOCKET_READ
|
||||||
* OUT char* content_type : Type of content
|
* UPNP_E_SOCKET_WRITE
|
||||||
*
|
************************************************************************/
|
||||||
* Description : Download the document message and extract the document
|
|
||||||
* from the message.
|
|
||||||
*
|
/************************************************************************
|
||||||
* Return : int;
|
* Function: http_Download
|
||||||
* UPNP_E_SUCCESS;
|
*
|
||||||
* UPNP_E_INVALID_URL;
|
* Parameters:
|
||||||
*
|
* IN const char* url_str; String as a URL
|
||||||
*
|
* IN int timeout_secs; time out value
|
||||||
* Note :
|
* OUT char** document; buffer to store the document extracted
|
||||||
************************************************************************/
|
* from the donloaded message.
|
||||||
int http_Download( IN const char* url,
|
* OUT int* doc_length; length of the extracted document
|
||||||
|
* OUT char* content_type; Type of content
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Download the document message and extract the document
|
||||||
|
* from the message.
|
||||||
|
*
|
||||||
|
* Return: int
|
||||||
|
* UPNP_E_SUCCESS
|
||||||
|
* UPNP_E_INVALID_URL
|
||||||
|
************************************************************************/
|
||||||
|
int http_Download(
|
||||||
|
IN const char* url,
|
||||||
IN int timeout_secs,
|
IN int timeout_secs,
|
||||||
OUT char** document, OUT int* doc_length,
|
OUT char** document,
|
||||||
|
OUT int* doc_length,
|
||||||
OUT char* content_type );
|
OUT char* content_type );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_WriteHttpPost
|
* Function: http_WriteHttpPost
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* IN void *Handle : Handle to the http post object
|
* IN void *Handle: Handle to the http post object
|
||||||
* IN char *buf : Buffer to send to peer, if format used
|
* IN char *buf: Buffer to send to peer, if format used
|
||||||
* is not UPNP_USING_CHUNKED,
|
* is not UPNP_USING_CHUNKED,
|
||||||
* IN unsigned int *size : Size of the data to be sent.
|
* IN unsigned int *size: Size of the data to be sent.
|
||||||
* IN int timeout : time out value
|
* IN int timeout: time out value
|
||||||
*
|
*
|
||||||
* Description : Formats data if format used is UPNP_USING_CHUNKED.
|
* Description:
|
||||||
* Writes data on the socket connected to the peer.
|
* Formats data if format used is UPNP_USING_CHUNKED.
|
||||||
*
|
* Writes data on the socket connected to the peer.
|
||||||
* Return : int ;
|
*
|
||||||
* UPNP_E_SUCCESS - On Success
|
* Return: int
|
||||||
* UPNP_E_INVALID_PARAM - Invalid Parameter
|
* UPNP_E_SUCCESS - On Success
|
||||||
* -1 - On Socket Error.
|
* UPNP_E_INVALID_PARAM - Invalid Parameter
|
||||||
*
|
* -1 - On Socket Error.
|
||||||
* Note :
|
************************************************************************/
|
||||||
************************************************************************/
|
|
||||||
int http_WriteHttpPost(IN void *Handle,
|
int http_WriteHttpPost(IN void *Handle,
|
||||||
IN char *buf,
|
IN char *buf,
|
||||||
IN unsigned int *size,
|
IN unsigned int *size,
|
||||||
IN int timeout);
|
IN int timeout);
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_CloseHttpPost
|
* Function: http_CloseHttpPost
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* IN void *Handle : Handle to the http post object
|
* IN void *Handle; Handle to the http post object
|
||||||
* IN OUT int *httpStatus : HTTP status returned on receiving a
|
* IN OUT int *httpStatus; HTTP status returned on receiving a
|
||||||
* response message
|
* response message
|
||||||
* IN int timeout : time out value
|
* IN int timeout; time out value
|
||||||
*
|
*
|
||||||
* Description : Sends remaining data if using UPNP_USING_CHUNKED
|
* Description:
|
||||||
* format. Receives any more messages. Destroys socket and any socket
|
* Sends remaining data if using UPNP_USING_CHUNKED
|
||||||
* associated memory. Frees handle associated with the HTTP POST msg.
|
* format. Receives any more messages. Destroys socket and any socket
|
||||||
*
|
* associated memory. Frees handle associated with the HTTP POST msg.
|
||||||
* Return : int ;
|
*
|
||||||
* UPNP_E_SUCCESS - On Sucess ;
|
* Return: int
|
||||||
* UPNP_E_INVALID_PARAM - Invalid Parameter;
|
* UPNP_E_SUCCESS - On Sucess
|
||||||
*
|
* UPNP_E_INVALID_PARAM - Invalid Parameter
|
||||||
* Note :
|
************************************************************************/
|
||||||
************************************************************************/
|
|
||||||
int http_CloseHttpPost(IN void *Handle,
|
int http_CloseHttpPost(IN void *Handle,
|
||||||
IN OUT int *httpStatus,
|
IN OUT int *httpStatus,
|
||||||
IN int timeout);
|
IN int timeout);
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_OpenHttpPost
|
* Function: http_OpenHttpPost
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* IN const char *url_str : String as a URL
|
* IN const char *url_str; String as a URL
|
||||||
* IN OUT void **Handle : Pointer to buffer to store HTTP
|
* IN OUT void **Handle; Pointer to buffer to store HTTP
|
||||||
* post handle
|
* post handle
|
||||||
* IN const char *contentType : Type of content
|
* IN const char *contentType; Type of content
|
||||||
* IN int contentLength : length of content
|
* IN int contentLength; length of content
|
||||||
* IN int timeout : time out value
|
* IN int timeout; time out value
|
||||||
*
|
*
|
||||||
* Description : Makes the HTTP POST message, connects to the peer,
|
* Description:
|
||||||
* sends the HTTP POST request. Adds the post handle to buffer of
|
* Makes the HTTP POST message, connects to the peer,
|
||||||
* such handles
|
* sends the HTTP POST request. Adds the post handle to buffer of
|
||||||
*
|
* such handles
|
||||||
* Return : int;
|
*
|
||||||
* UPNP_E_SUCCESS - On Sucess ;
|
* Return : int;
|
||||||
* UPNP_E_INVALID_PARAM - Invalid Paramter ;
|
* UPNP_E_SUCCESS - On Sucess
|
||||||
* UPNP_E_OUTOF_MEMORY ;
|
* UPNP_E_INVALID_PARAM - Invalid Parameter
|
||||||
* UPNP_E_SOCKET_ERROR ;
|
* UPNP_E_OUTOF_MEMORY
|
||||||
* UPNP_E_SOCKET_CONNECT ;
|
* UPNP_E_SOCKET_ERROR
|
||||||
*
|
* UPNP_E_SOCKET_CONNECT
|
||||||
* Note :
|
************************************************************************/
|
||||||
************************************************************************/
|
|
||||||
int http_OpenHttpPost(IN const char *url_str,
|
int http_OpenHttpPost(IN const char *url_str,
|
||||||
IN OUT void **Handle,
|
IN OUT void **Handle,
|
||||||
IN const char *contentType,
|
IN const char *contentType,
|
||||||
IN int contentLength,
|
IN int contentLength,
|
||||||
IN int timeout);
|
IN int timeout);
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_ReadHttpGet
|
* Function: http_ReadHttpGet
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* IN void *Handle : Handle to the HTTP get object
|
* IN void *Handle; Handle to the HTTP get object
|
||||||
* IN OUT char *buf : Buffer to get the read and parsed data
|
* IN OUT char *buf; Buffer to get the read and parsed data
|
||||||
* IN OUT unsigned int *size : Size of tge buffer passed
|
* IN OUT unsigned int *size; Size of the buffer passed
|
||||||
* IN int timeout : time out value
|
* IN int timeout; time out value
|
||||||
*
|
*
|
||||||
* Description : Parses already existing data, then gets new data.
|
* Description:
|
||||||
* Parses and extracts information from the new data.
|
* Parses already existing data, then gets new data.
|
||||||
*
|
* Parses and extracts information from the new data.
|
||||||
* Return : int ;
|
*
|
||||||
* UPNP_E_SUCCESS - On Sucess ;
|
* Return: int
|
||||||
* UPNP_E_INVALID_PARAM - Invalid Parameter;
|
* UPNP_E_SUCCESS - On Sucess
|
||||||
* UPNP_E_BAD_RESPONSE ;
|
* UPNP_E_INVALID_PARAM - Invalid Parameter
|
||||||
* UPNP_E_BAD_HTTPMSG ;
|
* UPNP_E_BAD_RESPONSE
|
||||||
*
|
* UPNP_E_BAD_HTTPMSG
|
||||||
* Note :
|
* UPNP_E_CANCELED
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int http_ReadHttpGet(IN void *Handle,
|
int http_ReadHttpGet(
|
||||||
|
IN void *Handle,
|
||||||
IN OUT char *buf,
|
IN OUT char *buf,
|
||||||
IN OUT unsigned int *size,
|
IN OUT unsigned int *size,
|
||||||
IN int timeout);
|
IN int timeout);
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_HttpGetProgress
|
* Function: http_HttpGetProgress
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* IN void *Handle : Handle to the HTTP get object
|
* IN void *Handle; Handle to the HTTP get object
|
||||||
* OUT unsigned int *length : Buffer to get the read and parsed data
|
* OUT unsigned int *length; Buffer to get the read and parsed data
|
||||||
* OUT unsigned int *total : Size of tge buffer passed
|
* OUT unsigned int *total; Size of tge buffer passed
|
||||||
*
|
*
|
||||||
* Description : Extracts information from the Handle to the HTTP get
|
* Description:
|
||||||
* object.
|
* Extracts information from the Handle to the HTTP get object.
|
||||||
*
|
*
|
||||||
* Return : int ;
|
* Return: int
|
||||||
* UPNP_E_SUCCESS - On Sucess ;
|
* UPNP_E_SUCCESS - On Sucess
|
||||||
* UPNP_E_INVALID_PARAM - Invalid Parameter;
|
* UPNP_E_INVALID_PARAM - Invalid Parameter
|
||||||
*
|
************************************************************************/
|
||||||
* Note :
|
int http_HttpGetProgress(
|
||||||
************************************************************************/
|
IN void *Handle,
|
||||||
int http_HttpGetProgress(IN void *Handle,
|
|
||||||
OUT unsigned int *length,
|
OUT unsigned int *length,
|
||||||
OUT unsigned int *total );
|
OUT unsigned int *total );
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* Function : http_CloseHttpGet
|
|
||||||
*
|
|
||||||
* Parameters :
|
|
||||||
* IN void *Handle ; Handle to HTTP get object
|
|
||||||
*
|
|
||||||
* Description : Clears the handle allocated for the HTTP GET operation
|
|
||||||
* Clears socket states and memory allocated for socket operations.
|
|
||||||
*
|
|
||||||
* Return : int ;
|
|
||||||
* UPNP_E_SUCCESS - On Success
|
|
||||||
* UPNP_E_INVALID_PARAM - Invalid Parameter
|
|
||||||
*
|
|
||||||
* Note :
|
|
||||||
************************************************************************/
|
|
||||||
int http_CloseHttpGet(IN void *Handle);
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_OpenHttpGet
|
* Function: http_CloseHttpGet
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* IN const char *url_str : String as a URL
|
* IN void *Handle; Handle to HTTP get object
|
||||||
* IN OUT void **Handle : Pointer to buffer to store HTTP
|
*
|
||||||
* post handle
|
* Description:
|
||||||
* IN OUT char **contentType : Type of content
|
* Clears the handle allocated for the HTTP GET operation
|
||||||
* OUT int *contentLength : length of content
|
* Clears socket states and memory allocated for socket operations.
|
||||||
* OUT int *httpStatus : HTTP status returned on receiving a
|
*
|
||||||
* response message
|
* Return: int
|
||||||
* IN int timeout : time out value
|
* UPNP_E_SUCCESS - On Success
|
||||||
*
|
* UPNP_E_INVALID_PARAM - Invalid Parameter
|
||||||
* Description : Makes the HTTP GET message, connects to the peer,
|
************************************************************************/
|
||||||
* sends the HTTP GET request, gets the response and parses the
|
int http_CloseHttpGet(IN void *Handle);
|
||||||
* response.
|
|
||||||
*
|
|
||||||
* Return : int;
|
/************************************************************************
|
||||||
* UPNP_E_SUCCESS - On Success ;
|
* Function: http_OpenHttpGet
|
||||||
* UPNP_E_INVALID_PARAM - Invalid Paramters ;
|
*
|
||||||
* UPNP_E_OUTOF_MEMORY ;
|
* Parameters:
|
||||||
* UPNP_E_SOCKET_ERROR ;
|
* IN const char *url_str: String as a URL
|
||||||
* UPNP_E_BAD_RESPONSE ;
|
* IN OUT void **Handle: Pointer to buffer to store HTTP
|
||||||
*
|
* post handle
|
||||||
* Note :
|
* IN OUT char **contentType: Type of content
|
||||||
*
|
* OUT int *contentLength: length of content
|
||||||
************************************************************************/
|
* OUT int *httpStatus: HTTP status returned on receiving a
|
||||||
int http_OpenHttpGet(IN const char *url_str,
|
* response message
|
||||||
|
* IN int timeout: time out value
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Makes the HTTP GET message, connects to the peer,
|
||||||
|
* sends the HTTP GET request, gets the response and parses the
|
||||||
|
* response.
|
||||||
|
*
|
||||||
|
* Return: int
|
||||||
|
* UPNP_E_SUCCESS - On Success
|
||||||
|
* UPNP_E_INVALID_PARAM - Invalid Paramters
|
||||||
|
* UPNP_E_OUTOF_MEMORY
|
||||||
|
* UPNP_E_SOCKET_ERROR
|
||||||
|
* UPNP_E_BAD_RESPONSE
|
||||||
|
************************************************************************/
|
||||||
|
int http_OpenHttpGet(
|
||||||
|
IN const char *url_str,
|
||||||
IN OUT void **Handle,
|
IN OUT void **Handle,
|
||||||
IN OUT char **contentType,
|
IN OUT char **contentType,
|
||||||
OUT int *contentLength,
|
OUT int *contentLength,
|
||||||
OUT int *httpStatus,
|
OUT int *httpStatus,
|
||||||
IN int timeout);
|
IN int timeout);
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_OpenHttpGetProxy
|
* Function: http_OpenHttpGetProxy
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* IN const char *url_str : String as a URL
|
* IN const char *url_str; String as a URL
|
||||||
* IN const char *proxy_str : String as a URL to the proxy
|
* IN const char *proxy_str; String as a URL
|
||||||
* IN OUT void **Handle : Pointer to buffer to store HTTP
|
* IN OUT void **Handle; Pointer to buffer to store HTTP
|
||||||
* post handle
|
* post handle
|
||||||
* IN OUT char **contentType : Type of content
|
* IN OUT char **contentType; Type of content
|
||||||
* OUT int *contentLength : length of content
|
* OUT int *contentLength; length of content
|
||||||
* OUT int *httpStatus : HTTP status returned on receiving a
|
* OUT int *httpStatus; HTTP status returned on receiving a
|
||||||
* response message
|
* response message
|
||||||
* IN int timeout : time out value
|
* IN int timeout: time out value
|
||||||
*
|
*
|
||||||
* Description : Makes the HTTP GET message, connects to the peer,
|
* Description:
|
||||||
* sends the HTTP GET request, gets the response and parses the
|
* Makes the HTTP GET message, connects to the peer,
|
||||||
* response.
|
* sends the HTTP GET request, gets the response and parses the response.
|
||||||
*
|
* If a proxy URL is defined then the connection is made there.
|
||||||
* Return : int;
|
*
|
||||||
* UPNP_E_SUCCESS - On Success ;
|
* Return: int
|
||||||
* UPNP_E_INVALID_PARAM - Invalid Paramters ;
|
* UPNP_E_SUCCESS - On Success
|
||||||
* UPNP_E_OUTOF_MEMORY ;
|
* UPNP_E_INVALID_PARAM - Invalid Paramters
|
||||||
* UPNP_E_SOCKET_ERROR ;
|
* UPNP_E_OUTOF_MEMORY
|
||||||
* UPNP_E_BAD_RESPONSE ;
|
* UPNP_E_SOCKET_ERROR
|
||||||
*
|
* UPNP_E_BAD_RESPONSE
|
||||||
* Note :
|
************************************************************************/
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
int http_OpenHttpGetProxy(IN const char *url_str,
|
int http_OpenHttpGetProxy(IN const char *url_str,
|
||||||
IN const char *proxy_str,
|
IN const char *proxy_str,
|
||||||
IN OUT void **Handle,
|
IN OUT void **Handle,
|
||||||
@@ -430,126 +444,134 @@ int http_OpenHttpGetProxy(IN const char *url_str,
|
|||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_SendStatusResponse
|
* Function: http_SendStatusResponse
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* IN SOCKINFO *info : Socket information object
|
* IN SOCKINFO *info; Socket information object
|
||||||
* IN int http_status_code : error code returned while making
|
* IN int http_status_code; error code returned while making
|
||||||
* or sending the response message
|
* or sending the response message
|
||||||
* IN int request_major_version : request major version
|
* IN int request_major_version; request major version
|
||||||
* IN int request_minor_version : request minor version
|
* IN int request_minor_version; request minor version
|
||||||
*
|
*
|
||||||
* Description : Generate a response message for the status query and
|
* Description:
|
||||||
* send the status response.
|
* Generate a response message for the status query and send the
|
||||||
*
|
* status response.
|
||||||
* Return : int;
|
*
|
||||||
* 0 -- success
|
* Return: int
|
||||||
* UPNP_E_OUTOF_MEMORY
|
* 0 -- success
|
||||||
* UPNP_E_SOCKET_WRITE
|
* UPNP_E_OUTOF_MEMORY
|
||||||
* UPNP_E_TIMEDOUT
|
* UPNP_E_SOCKET_WRITE
|
||||||
*
|
* UPNP_E_TIMEDOUT
|
||||||
* Note :
|
************************************************************************/
|
||||||
************************************************************************/
|
int http_SendStatusResponse(
|
||||||
int http_SendStatusResponse( IN SOCKINFO *info, IN int http_status_code,
|
IN SOCKINFO *info,
|
||||||
|
IN int http_status_code,
|
||||||
IN int request_major_version,
|
IN int request_major_version,
|
||||||
IN int request_minor_version );
|
IN int request_minor_version );
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_MakeMessage
|
* Function: http_MakeMessage
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* INOUT membuffer* buf : buffer with the contents of the
|
* INOUT membuffer* buf; buffer with the contents of the
|
||||||
* message
|
* message
|
||||||
* IN int http_major_version : HTTP major version
|
* IN int http_major_version; HTTP major version
|
||||||
* IN int http_minor_version : HTTP minor version
|
* IN int http_minor_version; HTTP minor version
|
||||||
* IN const char* fmt : Pattern format
|
* IN const char* fmt; Pattern format
|
||||||
* ... :
|
* ...;
|
||||||
*
|
*
|
||||||
* Description : Generate an HTTP message based on the format that is
|
* Description:
|
||||||
* specified in the input parameters.
|
* Generate an HTTP message based on the format that is specified
|
||||||
*
|
* in the input parameters.
|
||||||
* fmt types:
|
*
|
||||||
* 's': arg = const char* C_string
|
* fmt types:
|
||||||
* 'b': arg1 = const char* buf; arg2 = size_t buf_length
|
* 'B': arg = int status_code
|
||||||
* memory ptr
|
* appends content-length, content-type and HTML body
|
||||||
* 'c': (no args) appends CRLF "\r\n"
|
* for given code
|
||||||
* 'd': arg = int number // appends decimal number
|
* 'b': arg1 = const char* buf;
|
||||||
* 'h': arg = off_t number // appends off_t number
|
* arg2 = size_t buf_length memory ptr
|
||||||
* 't': arg = time_t * gmt_time // appends time in RFC 1123 fmt
|
* 'C': (no args) appends a HTTP CONNECTION: close header
|
||||||
* 'D': (no args) appends HTTP DATE: header
|
* depending on major,minor version
|
||||||
* 'S': (no args) appends HTTP SERVER: header
|
* 'c': (no args) appends CRLF "\r\n"
|
||||||
* 'U': (no args) appends HTTP USER-AGENT: header
|
* 'D': (no args) appends HTTP DATE: header
|
||||||
* 'C': (no args) appends a HTTP CONNECTION: close header
|
* 'd': arg = int number // appends decimal number
|
||||||
* depending on major,minor version
|
* 'G': arg = range information // add range header
|
||||||
* 'N': arg1 = int content_length // content-length header
|
* 'h': arg = off_t number // appends off_t number
|
||||||
* 'Q': arg1 = http_method_t; arg2 = char* url;
|
* 'K': (no args) // add chunky header
|
||||||
* arg3 = int url_length // start line of request
|
* 'N': arg1 = off_t content_length // content-length header
|
||||||
* 'R': arg = int status_code // adds a response start line
|
* 'q': arg1 = http_method_t // request start line and HOST header
|
||||||
* 'B': arg = int status_code
|
* arg2 = (uri_type *)
|
||||||
* appends content-length, content-type and HTML body for given code
|
* 'Q': arg1 = http_method_t; // start line of request
|
||||||
* 'T': arg = char * content_type; format e.g: "text/html";
|
* arg2 = char* url;
|
||||||
* content-type header
|
* arg3 = size_t url_length
|
||||||
*
|
* 'R': arg = int status_code // adds a response start line
|
||||||
* Return : int;
|
* 'S': (no args) appends HTTP SERVER: header
|
||||||
* 0 - On Success
|
* 's': arg = const char* C_string
|
||||||
* UPNP_E_OUTOF_MEMORY
|
* 'T': arg = char * content_type; format
|
||||||
* UPNP_E_INVALID_URL;
|
* e.g: "text/html"; content-type header
|
||||||
*
|
* 't': arg = time_t * gmt_time // appends time in RFC 1123 fmt
|
||||||
* Note :
|
* 'U': (no args) appends HTTP USER-AGENT: header
|
||||||
************************************************************************/
|
* 'X': arg = const char useragent; "redsonic" HTTP X-User-Agent: useragent
|
||||||
int http_MakeMessage( INOUT membuffer* buf,
|
*
|
||||||
|
* Return: int
|
||||||
|
* 0 - On Success
|
||||||
|
* UPNP_E_OUTOF_MEMORY
|
||||||
|
* UPNP_E_INVALID_URL
|
||||||
|
************************************************************************/
|
||||||
|
int http_MakeMessage(
|
||||||
|
INOUT membuffer* buf,
|
||||||
IN int http_major_version,
|
IN int http_major_version,
|
||||||
IN int http_minor_version,
|
IN int http_minor_version,
|
||||||
IN const char* fmt, ... );
|
IN const char* fmt, ... );
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* Function : http_CalcResponseVersion
|
|
||||||
*
|
|
||||||
* Parameters :
|
|
||||||
* IN int request_major_vers : Request major version
|
|
||||||
* IN int request_minor_vers : Request minor version
|
|
||||||
* OUT int* response_major_vers : Response mojor version
|
|
||||||
* OUT int* response_minor_vers : Response minor version
|
|
||||||
*
|
|
||||||
* Description : Calculate HTTP response versions based on the request
|
|
||||||
* versions.
|
|
||||||
*
|
|
||||||
* Return : void
|
|
||||||
*
|
|
||||||
* Note :
|
|
||||||
************************************************************************/
|
|
||||||
void http_CalcResponseVersion(
|
|
||||||
IN int request_major_vers, IN int request_minor_vers,
|
|
||||||
OUT int* response_major_vers, OUT int* response_minor_vers );
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : http_OpenHttpGetEx
|
* Function: http_CalcResponseVersion
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* IN const char *url_str : String as a URL
|
* IN int request_major_vers; Request major version
|
||||||
* IN OUT void **Handle : Pointer to buffer to store HTTP
|
* IN int request_minor_vers; Request minor version
|
||||||
* post handle
|
* OUT int* response_major_vers; Response mojor version
|
||||||
* IN OUT char **contentType : Type of content
|
* OUT int* response_minor_vers; Response minor version
|
||||||
* OUT int *contentLength : length of content
|
*
|
||||||
* OUT int *httpStatus : HTTP status returned on receiving a
|
* Description:
|
||||||
* response message
|
* Calculate HTTP response versions based on the request versions.
|
||||||
* IN int timeout : time out value
|
*
|
||||||
*
|
* Return: void
|
||||||
* Description : Makes the HTTP GET message, connects to the peer,
|
************************************************************************/
|
||||||
* sends the HTTP GET request, gets the response and parses the
|
void http_CalcResponseVersion(
|
||||||
* response.
|
IN int request_major_vers,
|
||||||
*
|
IN int request_minor_vers,
|
||||||
* Return : int;
|
OUT int* response_major_vers,
|
||||||
* UPNP_E_SUCCESS - On Success ;
|
OUT int* response_minor_vers );
|
||||||
* UPNP_E_INVALID_PARAM - Invalid Paramters ;
|
|
||||||
* UPNP_E_OUTOF_MEMORY ;
|
|
||||||
* UPNP_E_SOCKET_ERROR ;
|
/************************************************************************
|
||||||
* UPNP_E_BAD_RESPONSE ;
|
* Function: http_OpenHttpGetEx
|
||||||
*
|
*
|
||||||
* Note :
|
* Parameters:
|
||||||
*
|
* IN const char *url_str; String as a URL
|
||||||
************************************************************************/
|
* IN OUT void **Handle; Pointer to buffer to store HTTP
|
||||||
|
* post handle
|
||||||
|
* IN OUT char **contentType; Type of content
|
||||||
|
* OUT int *contentLength; length of content
|
||||||
|
* OUT int *httpStatus; HTTP status returned on receiving a
|
||||||
|
* response message
|
||||||
|
* IN int timeout; time out value
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Makes the HTTP GET message, connects to the peer,
|
||||||
|
* sends the HTTP GET request, gets the response and parses the
|
||||||
|
* response.
|
||||||
|
*
|
||||||
|
* Return: int
|
||||||
|
* UPNP_E_SUCCESS - On Success
|
||||||
|
* UPNP_E_INVALID_PARAM - Invalid Paramters
|
||||||
|
* UPNP_E_OUTOF_MEMORY
|
||||||
|
* UPNP_E_SOCKET_ERROR
|
||||||
|
* UPNP_E_BAD_RESPONSE
|
||||||
|
************************************************************************/
|
||||||
int http_OpenHttpGetEx(IN const char *url_str,
|
int http_OpenHttpGetEx(IN const char *url_str,
|
||||||
IN OUT void **Handle,
|
IN OUT void **Handle,
|
||||||
IN OUT char **contentType,
|
IN OUT char **contentType,
|
||||||
@@ -559,19 +581,19 @@ int http_OpenHttpGetEx(IN const char *url_str,
|
|||||||
IN int highRange,
|
IN int highRange,
|
||||||
IN int timeout);
|
IN int timeout);
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : get_sdk_info
|
* Function: get_sdk_info
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* OUT char *info ;
|
* OUT char *info; buffer to store the operating system information
|
||||||
*
|
*
|
||||||
* Description : Returns the server information for the operating
|
* Description:
|
||||||
* system
|
* Returns the server information for the operating system
|
||||||
*
|
*
|
||||||
* Return : void ;
|
* Return:
|
||||||
*
|
* UPNP_INLINE void
|
||||||
* Note :
|
************************************************************************/
|
||||||
************************************************************************/
|
|
||||||
void get_sdk_info( OUT char *info );
|
void get_sdk_info( OUT char *info );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -580,3 +602,4 @@ void get_sdk_info( OUT char *info );
|
|||||||
|
|
||||||
|
|
||||||
#endif // GENLIB_NET_HTTP_HTTPREADWRITE_H
|
#endif // GENLIB_NET_HTTP_HTTPREADWRITE_H
|
||||||
|
|
||||||
|
|||||||
@@ -1,150 +1,150 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/************************************************************************
|
||||||
//
|
*
|
||||||
// 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 MINISERVER_H
|
#ifndef MINISERVER_H
|
||||||
#define MINISERVER_H
|
#define MINISERVER_H
|
||||||
|
|
||||||
|
|
||||||
#include "sock.h"
|
#include "sock.h"
|
||||||
#include "httpparser.h"
|
#include "httpparser.h"
|
||||||
|
|
||||||
|
|
||||||
extern SOCKET gMiniServerStopSock;
|
extern SOCKET gMiniServerStopSock;
|
||||||
|
|
||||||
|
|
||||||
typedef struct MServerSockArray {
|
typedef struct MServerSockArray {
|
||||||
int miniServerSock; //socket for listening for miniserver
|
/* socket for listening for miniserver requests */
|
||||||
//requests
|
int miniServerSock;
|
||||||
int miniServerStopSock; //socket for stopping miniserver
|
/* socket for stopping miniserver */
|
||||||
int ssdpSock; //socket for incoming advertisments and search requests
|
int miniServerStopSock;
|
||||||
|
/* socket for incoming advertisments and search requests */
|
||||||
|
int ssdpSock;
|
||||||
|
|
||||||
int stopPort;
|
int stopPort;
|
||||||
int miniServerPort;
|
int miniServerPort;
|
||||||
|
|
||||||
CLIENTONLY(int ssdpReqSock;) //socket for sending search
|
/* socket for sending search requests and receiving search replies */
|
||||||
//requests and receiving
|
CLIENTONLY(int ssdpReqSock;)
|
||||||
// search replies
|
|
||||||
|
|
||||||
} MiniServerSockArray;
|
} MiniServerSockArray;
|
||||||
|
|
||||||
//typedef void (*MiniServerCallback) ( const char* document, int sockfd );
|
|
||||||
|
|
||||||
typedef void (*MiniServerCallback) ( IN http_parser_t *parser,
|
typedef void (*MiniServerCallback)(
|
||||||
|
IN http_parser_t *parser,
|
||||||
IN http_message_t* request,
|
IN http_message_t* request,
|
||||||
IN SOCKINFO *info );
|
IN SOCKINFO *info );
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : SetHTTPGetCallback
|
* Function: SetHTTPGetCallback
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* MiniServerCallback callback ; - HTTP Callback to be invoked
|
* MiniServerCallback callback; - HTTP Callback to be invoked
|
||||||
*
|
*
|
||||||
* Description : Set HTTP Get Callback
|
* Description: Set HTTP Get Callback
|
||||||
*
|
*
|
||||||
* Return : void
|
* Return: void
|
||||||
*
|
************************************************************************/
|
||||||
* Note :
|
|
||||||
************************************************************************/
|
|
||||||
void SetHTTPGetCallback( MiniServerCallback callback );
|
void SetHTTPGetCallback( MiniServerCallback callback );
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : SetSoapCallback
|
* Function: SetSoapCallback
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* MiniServerCallback callback ; - SOAP Callback to be invoked
|
* MiniServerCallback callback; - SOAP Callback to be invoked
|
||||||
*
|
*
|
||||||
* Description : Set SOAP Callback
|
* Description: Set SOAP Callback
|
||||||
*
|
*
|
||||||
* Return : void
|
* Return: void
|
||||||
*
|
************************************************************************/
|
||||||
* Note :
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
************************************************************************/
|
|
||||||
void SetSoapCallback( MiniServerCallback callback );
|
void SetSoapCallback( MiniServerCallback callback );
|
||||||
|
#else /* INCLUDE_DEVICE_APIS */
|
||||||
|
static inline void SetSoapCallback( MiniServerCallback callback ) {}
|
||||||
|
#endif /* INCLUDE_DEVICE_APIS */
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : SetGenaCallback
|
* Function: SetGenaCallback
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* MiniServerCallback callback ; - GENA Callback to be invoked
|
* MiniServerCallback callback; - GENA Callback to be invoked
|
||||||
*
|
*
|
||||||
* Description : Set GENA Callback
|
* D6escription: Set GENA Callback
|
||||||
*
|
*
|
||||||
* Return : void
|
* Return: void
|
||||||
*
|
************************************************************************/
|
||||||
* Note :
|
|
||||||
************************************************************************/
|
|
||||||
void SetGenaCallback( MiniServerCallback callback );
|
void SetGenaCallback( MiniServerCallback callback );
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : StartMiniServer
|
* Function: StartMiniServer
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* unsigned short listen_port ; Port on which the server listens for
|
* unsigned short listen_port ; Port on which the server listens for
|
||||||
* incoming connections
|
* incoming connections
|
||||||
*
|
*
|
||||||
* Description : Initialize the sockets functionality for the
|
* Description: Initialize the sockets functionality for the
|
||||||
* Miniserver. Initialize a thread pool job to run the MiniServer
|
* Miniserver. Initialize a thread pool job to run the MiniServer
|
||||||
* and the job to the thread pool. If listen port is 0, port is
|
* and the job to the thread pool. If listen port is 0, port is
|
||||||
* dynamically picked
|
* dynamically picked
|
||||||
*
|
*
|
||||||
* Use timer mechanism to start the MiniServer, failure to meet the
|
* Use timer mechanism to start the MiniServer, failure to meet the
|
||||||
* allowed delay aborts the attempt to launch the MiniServer.
|
* allowed delay aborts the attempt to launch the MiniServer.
|
||||||
*
|
*
|
||||||
* Return : int ;
|
* Return: int;
|
||||||
* Actual port socket is bound to - On Success:
|
* Actual port socket is bound to - On Success:
|
||||||
* A negative number UPNP_E_XXX - On Error
|
* A negative number UPNP_E_XXX - On Error
|
||||||
* Note :
|
************************************************************************/
|
||||||
************************************************************************/
|
|
||||||
int StartMiniServer( unsigned short listen_port );
|
int StartMiniServer( unsigned short listen_port );
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : StopMiniServer
|
* Function: StopMiniServer
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters:
|
||||||
* void ;
|
* void;
|
||||||
*
|
*
|
||||||
* Description : Stop and Shutdown the MiniServer and free socket
|
* Description: Stop and Shutdown the MiniServer and free socket resources.
|
||||||
* resources.
|
*
|
||||||
*
|
* Return : int;
|
||||||
* Return : int ;
|
* Always returns 0
|
||||||
* Always returns 0
|
************************************************************************/
|
||||||
*
|
int StopMiniServer();
|
||||||
* Note :
|
|
||||||
************************************************************************/
|
|
||||||
int StopMiniServer( void );
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern C */
|
} /* extern C */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* MINISERVER_H */
|
#endif /* MINISERVER_H */
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define SID_SIZE 41
|
#define SID_SIZE 41
|
||||||
|
|
||||||
DEVICEONLY(
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
|
|
||||||
typedef struct SUBSCRIPTION {
|
typedef struct SUBSCRIPTION {
|
||||||
Upnp_SID sid;
|
Upnp_SID sid;
|
||||||
@@ -73,6 +73,7 @@ typedef struct SERVICE_INFO {
|
|||||||
struct SERVICE_INFO *next;
|
struct SERVICE_INFO *next;
|
||||||
} service_info;
|
} service_info;
|
||||||
|
|
||||||
|
|
||||||
typedef struct SERVICE_TABLE {
|
typedef struct SERVICE_TABLE {
|
||||||
DOMString URLBase;
|
DOMString URLBase;
|
||||||
service_info *serviceList;
|
service_info *serviceList;
|
||||||
@@ -253,7 +254,7 @@ service_info * FindServiceControlURLPath( service_table *table,
|
|||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters :
|
||||||
* service_info *service ;Service whose information is to be printed
|
* service_info *service ;Service whose information is to be printed
|
||||||
* Dbg_Level level ; Debug level specified to the print function
|
* Upnp_LogLevel level ; Debug level specified to the print function
|
||||||
* Dbg_Module module ; Debug module specified to the print function
|
* Dbg_Module module ; Debug module specified to the print function
|
||||||
*
|
*
|
||||||
* Description : For debugging purposes prints information from the
|
* Description : For debugging purposes prints information from the
|
||||||
@@ -263,16 +264,24 @@ service_info * FindServiceControlURLPath( service_table *table,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
DBGONLY(void printService(service_info *service,Dbg_Level
|
#ifdef DEBUG
|
||||||
level,
|
void printService(
|
||||||
Dbg_Module module));
|
service_info *service,
|
||||||
|
Upnp_LogLevel level,
|
||||||
|
Dbg_Module module);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE void printService(
|
||||||
|
service_info *service,
|
||||||
|
Upnp_LogLevel level,
|
||||||
|
Dbg_Module module) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : printServiceList
|
* Function : printServiceList
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters :
|
||||||
* service_info *service ; Service whose information is to be printed
|
* service_info *service ; Service whose information is to be printed
|
||||||
* Dbg_Level level ; Debug level specified to the print function
|
* Upnp_LogLevel level ; Debug level specified to the print function
|
||||||
* Dbg_Module module ; Debug module specified to the print function
|
* Dbg_Module module ; Debug module specified to the print function
|
||||||
*
|
*
|
||||||
* Description : For debugging purposes prints information of each
|
* Description : For debugging purposes prints information of each
|
||||||
@@ -282,15 +291,24 @@ DBGONLY(void printService(service_info *service,Dbg_Level
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
DBGONLY(void printServiceList(service_info *service,
|
#ifdef DEBUG
|
||||||
Dbg_Level level, Dbg_Module module));
|
void printServiceList(
|
||||||
|
service_info *service,
|
||||||
|
Upnp_LogLevel level,
|
||||||
|
Dbg_Module module);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE void printServiceList(
|
||||||
|
service_info *service,
|
||||||
|
Upnp_LogLevel level,
|
||||||
|
Dbg_Module module) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : printServiceTable
|
* Function : printServiceTable
|
||||||
*
|
*
|
||||||
* Parameters :
|
* Parameters :
|
||||||
* service_table * table ; Service table to be printed
|
* service_table * table ; Service table to be printed
|
||||||
* Dbg_Level level ; Debug level specified to the print function
|
* Upnp_LogLevel level ; Debug level specified to the print function
|
||||||
* Dbg_Module module ; Debug module specified to the print function
|
* Dbg_Module module ; Debug module specified to the print function
|
||||||
*
|
*
|
||||||
* Description : For debugging purposes prints the URL base of the table
|
* Description : For debugging purposes prints the URL base of the table
|
||||||
@@ -301,9 +319,17 @@ DBGONLY(void printServiceList(service_info *service,
|
|||||||
*
|
*
|
||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
DBGONLY(void printServiceTable(service_table *
|
#ifdef DEBUG
|
||||||
table,Dbg_Level
|
void printServiceTable(
|
||||||
level,Dbg_Module module));
|
service_table *table,
|
||||||
|
Upnp_LogLevel level,
|
||||||
|
Dbg_Module module);
|
||||||
|
#else
|
||||||
|
static UPNP_INLINE void printServiceTable(
|
||||||
|
service_table *table,
|
||||||
|
Upnp_LogLevel level,
|
||||||
|
Dbg_Module module) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : freeService
|
* Function : freeService
|
||||||
@@ -451,10 +477,11 @@ int getSubElement(const char *element_name, IXML_Node *node,
|
|||||||
IXML_Node **out);
|
IXML_Node **out);
|
||||||
|
|
||||||
|
|
||||||
) /* DEVICEONLY */
|
#endif /* INCLUDE_DEVICE_APIS */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _SERVICE_TABLE */
|
#endif /* _SERVICE_TABLE */
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#define SOAPLIB_H
|
#define SOAPLIB_H
|
||||||
|
|
||||||
|
|
||||||
//SOAP module API to be called in Upnp-Dk API
|
// SOAP module API to be called in Upnp-Dk API
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function : soap_device_callback
|
* Function : soap_device_callback
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -211,8 +211,15 @@ int Make_Socket_NoBlocking (int sock);
|
|||||||
* Returns: void *
|
* Returns: void *
|
||||||
* 1 if successful else appropriate error
|
* 1 if successful else appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void ssdp_handle_device_request( IN http_message_t* hmsg,
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
|
void ssdp_handle_device_request(
|
||||||
|
IN http_message_t* hmsg,
|
||||||
IN struct sockaddr_in* dest_addr );
|
IN struct sockaddr_in* dest_addr );
|
||||||
|
#else
|
||||||
|
static inline void ssdp_handle_device_request(
|
||||||
|
IN http_message_t* hmsg,
|
||||||
|
IN struct sockaddr_in* dest_addr ) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : ssdp_handle_ctrlpt_msg
|
* Function : ssdp_handle_ctrlpt_msg
|
||||||
@@ -234,7 +241,8 @@ void ssdp_handle_device_request( IN http_message_t* hmsg,
|
|||||||
* Returns: void
|
* Returns: void
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void ssdp_handle_ctrlpt_msg( IN http_message_t* hmsg,
|
void ssdp_handle_ctrlpt_msg(
|
||||||
|
IN http_message_t* hmsg,
|
||||||
IN struct sockaddr_in* dest_addr,
|
IN struct sockaddr_in* dest_addr,
|
||||||
IN xboolean timeout,
|
IN xboolean timeout,
|
||||||
IN void* cookie );
|
IN void* cookie );
|
||||||
@@ -326,12 +334,10 @@ int ssdp_request_type(IN char * cmd, OUT SsdpEvent * Evt);
|
|||||||
* Function : SearchByTarget
|
* Function : SearchByTarget
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN int Mx:Number of seconds to wait, to collect all the
|
* IN int Mx:Number of seconds to wait, to collect all the responses.
|
||||||
* responses.
|
|
||||||
* char *St: Search target.
|
* char *St: Search target.
|
||||||
* void *Cookie: cookie provided by control point application. This
|
* void *Cookie: cookie provided by control point application. This
|
||||||
* cokie will be returned to application in the
|
* cokie will be returned to application in the callback.
|
||||||
* callback.
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates and send the search request for a specific URL.
|
* This function creates and send the search request for a specific URL.
|
||||||
@@ -345,12 +351,11 @@ int SearchByTarget(IN int Mx, IN char *St, IN void *Cookie);
|
|||||||
* Function : DeviceAdvertisement
|
* Function : DeviceAdvertisement
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN char * DevType : type of the device
|
* IN char *DevType : type of the device
|
||||||
* IN int RootDev: flag to indicate if the device is root device
|
* IN int RootDev : flag to indicate if the device is root device
|
||||||
* IN char * nt : value of NT
|
* IN char *Udn :
|
||||||
* IN char * usn :
|
* IN char *Location: Location URL.
|
||||||
* IN char * location :Location URL.
|
* IN int Duration : Service duration in sec.
|
||||||
* IN int duration :Service duration in sec.
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates the device advertisement request based on
|
* This function creates the device advertisement request based on
|
||||||
@@ -359,8 +364,12 @@ int SearchByTarget(IN int Mx, IN char *St, IN void *Cookie);
|
|||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int DeviceAdvertisement(IN char * DevType, int RootDev,char * Udn,
|
int DeviceAdvertisement(
|
||||||
IN char * Location, IN int Duration);
|
IN char *DevType,
|
||||||
|
IN int RootDev,
|
||||||
|
IN char *Udn,
|
||||||
|
IN char *Location,
|
||||||
|
IN int Duration);
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -369,9 +378,9 @@ int DeviceAdvertisement(IN char * DevType, int RootDev,char * Udn,
|
|||||||
* Parameters:
|
* Parameters:
|
||||||
* IN char *DevType: Device Type.
|
* IN char *DevType: Device Type.
|
||||||
* IN int RootDev:1 means root device.
|
* IN int RootDev:1 means root device.
|
||||||
* IN char * Udn: Device UDN
|
* IN char *Udn: Device UDN
|
||||||
* IN char *_Server:
|
* IN char *_Server:
|
||||||
* IN char * Location: Location URL
|
* IN char *Location: Location URL
|
||||||
* IN int Duration :Device duration in sec.
|
* IN int Duration :Device duration in sec.
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -381,12 +390,13 @@ int DeviceAdvertisement(IN char * DevType, int RootDev,char * Udn,
|
|||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int DeviceShutdown( IN char * DevType,
|
int DeviceShutdown(
|
||||||
|
IN char *DevType,
|
||||||
IN int RootDev,
|
IN int RootDev,
|
||||||
IN char * Udn,
|
IN char *Udn,
|
||||||
IN char * _Server,
|
IN char *_Server,
|
||||||
IN char * Location,
|
IN char *Location,
|
||||||
IN int Duration );
|
IN int Duration);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : DeviceReply
|
* Function : DeviceReply
|
||||||
@@ -395,10 +405,10 @@ int DeviceShutdown( IN char * DevType,
|
|||||||
* IN struct sockaddr_in * DestAddr:destination IP address.
|
* IN struct sockaddr_in * DestAddr:destination IP address.
|
||||||
* IN char *DevType: Device type
|
* IN char *DevType: Device type
|
||||||
* IN int RootDev: 1 means root device 0 means embedded device.
|
* IN int RootDev: 1 means root device 0 means embedded device.
|
||||||
* IN char * Udn: Device UDN
|
* IN char *Udn: Device UDN
|
||||||
* IN char * Location: Location of Device description document.
|
* IN char *Location: Location of Device description document.
|
||||||
* IN int Duration :Life time of this device.
|
* IN int Duration :Life time of this device.
|
||||||
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates the reply packet based on the input parameter,
|
* This function creates the reply packet based on the input parameter,
|
||||||
* and send it to the client address given in its input parameter DestAddr.
|
* and send it to the client address given in its input parameter DestAddr.
|
||||||
@@ -406,11 +416,12 @@ int DeviceShutdown( IN char * DevType,
|
|||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int DeviceReply(IN struct sockaddr_in * DestAddr,
|
int DeviceReply(
|
||||||
|
IN struct sockaddr_in * DestAddr,
|
||||||
IN char *DevType,
|
IN char *DevType,
|
||||||
IN int RootDev,
|
IN int RootDev,
|
||||||
IN char * Udn,
|
IN char *Udn,
|
||||||
IN char * Location, IN int Duration);
|
IN char *Location, IN int Duration);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : SendReply
|
* Function : SendReply
|
||||||
@@ -421,7 +432,7 @@ int DeviceReply(IN struct sockaddr_in * DestAddr,
|
|||||||
* IN int RootDev: 1 means root device 0 means embedded device.
|
* IN int RootDev: 1 means root device 0 means embedded device.
|
||||||
* IN char * Udn: Device UDN
|
* IN char * Udn: Device UDN
|
||||||
* IN char *_Server:
|
* IN char *_Server:
|
||||||
* IN char * Location: Location of Device description document.
|
* IN char *Location: Location of Device description document.
|
||||||
* IN int Duration :Life time of this device.
|
* IN int Duration :Life time of this device.
|
||||||
* IN int ByType:
|
* IN int ByType:
|
||||||
*
|
*
|
||||||
@@ -432,11 +443,12 @@ int DeviceReply(IN struct sockaddr_in * DestAddr,
|
|||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int SendReply(IN struct sockaddr_in * DestAddr,
|
int SendReply(
|
||||||
|
IN struct sockaddr_in * DestAddr,
|
||||||
IN char *DevType,
|
IN char *DevType,
|
||||||
IN int RootDev,
|
IN int RootDev,
|
||||||
IN char * Udn,
|
IN char *Udn,
|
||||||
IN char * Location,
|
IN char *Location,
|
||||||
IN int Duration,
|
IN int Duration,
|
||||||
IN int ByType );
|
IN int ByType );
|
||||||
|
|
||||||
@@ -448,18 +460,18 @@ int SendReply(IN struct sockaddr_in * DestAddr,
|
|||||||
* IN char *ServType: Service Type.
|
* IN char *ServType: Service Type.
|
||||||
* IN char * Location: Location of Device description document.
|
* IN char * Location: Location of Device description document.
|
||||||
* IN int Duration :Life time of this device.
|
* IN int Duration :Life time of this device.
|
||||||
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates the advertisement packet based
|
* This function creates the advertisement packet based
|
||||||
* on the input parameter, and send it to the multicast channel.
|
* on the input parameter, and send it to the multicast channel.
|
||||||
|
|
||||||
*
|
*
|
||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int ServiceAdvertisement( IN char * Udn,
|
int ServiceAdvertisement(
|
||||||
IN char * ServType,
|
IN char *Udn,
|
||||||
IN char * Location,
|
IN char *ServType,
|
||||||
|
IN char *Location,
|
||||||
IN int Duration);
|
IN int Duration);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -467,35 +479,35 @@ int ServiceAdvertisement( IN char * Udn,
|
|||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN struct sockaddr_in *DestAddr:
|
* IN struct sockaddr_in *DestAddr:
|
||||||
* IN char * Udn: Device UDN
|
* IN char *Udn: Device UDN
|
||||||
* IN char *ServType: Service Type.
|
* IN char *ServType: Service Type.
|
||||||
* IN char *Server: Not used
|
* IN char *Server: Not used
|
||||||
* IN char * Location: Location of Device description document.
|
* IN char *Location: Location of Device description document.
|
||||||
* IN int Duration :Life time of this device.
|
* IN int Duration :Life time of this device.
|
||||||
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates the advertisement packet based
|
* This function creates the advertisement packet based
|
||||||
* on the input parameter, and send it to the multicast channel.
|
* on the input parameter, and send it to the multicast channel.
|
||||||
|
|
||||||
*
|
*
|
||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int ServiceReply(IN struct sockaddr_in *DestAddr,
|
int ServiceReply(
|
||||||
IN char * ServType,
|
IN struct sockaddr_in *DestAddr,
|
||||||
IN char * Udn,
|
IN char *ServType,
|
||||||
IN char * Location,
|
IN char *Udn,
|
||||||
|
IN char *Location,
|
||||||
IN int Duration);
|
IN int Duration);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : ServiceShutdown
|
* Function : ServiceShutdown
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN char * Udn: Device UDN
|
* IN char *Udn: Device UDN
|
||||||
* IN char *ServType: Service Type.
|
* IN char *ServType: Service Type.
|
||||||
* IN char * Location: Location of Device description document.
|
* IN char *Location: Location of Device description document.
|
||||||
* IN int Duration :Service duration in sec.
|
* IN int Duration :Service duration in sec.
|
||||||
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates a HTTP service shutdown request packet
|
* This function creates a HTTP service shutdown request packet
|
||||||
* and sent it to the multicast channel through RequestHandler.
|
* and sent it to the multicast channel through RequestHandler.
|
||||||
@@ -503,8 +515,10 @@ int ServiceReply(IN struct sockaddr_in *DestAddr,
|
|||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int ServiceShutdown( IN char * Udn, IN char * ServType,
|
int ServiceShutdown(
|
||||||
IN char * Location,
|
IN char *Udn,
|
||||||
|
IN char *ServType,
|
||||||
|
IN char *Location,
|
||||||
IN int Duration);
|
IN int Duration);
|
||||||
|
|
||||||
|
|
||||||
@@ -521,13 +535,14 @@ int ServiceShutdown( IN char * Udn, IN char * ServType,
|
|||||||
* Returns: void *
|
* Returns: void *
|
||||||
* always return NULL
|
* always return NULL
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void * advertiseAndReplyThread(IN void * data);
|
void *advertiseAndReplyThread(IN void * data);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : AdvertiseAndReply
|
* Function : AdvertiseAndReply
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN int AdFlag: -1 = Send shutdown, 0 = send reply,
|
* IN int AdFlag: -1 = Send shutdown,
|
||||||
|
* 0 = send reply,
|
||||||
* 1 = Send Advertisement
|
* 1 = Send Advertisement
|
||||||
* IN UpnpDevice_Handle Hnd: Device handle
|
* IN UpnpDevice_Handle Hnd: Device handle
|
||||||
* IN enum SsdpSearchType SearchType:Search type for sending replies
|
* IN enum SsdpSearchType SearchType:Search type for sending replies
|
||||||
@@ -543,7 +558,8 @@ void * advertiseAndReplyThread(IN void * data);
|
|||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int AdvertiseAndReply(IN int AdFlag,
|
int AdvertiseAndReply(
|
||||||
|
IN int AdFlag,
|
||||||
IN UpnpDevice_Handle Hnd,
|
IN UpnpDevice_Handle Hnd,
|
||||||
IN enum SsdpSearchType SearchType,
|
IN enum SsdpSearchType SearchType,
|
||||||
IN struct sockaddr_in *DestAddr,
|
IN struct sockaddr_in *DestAddr,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user