diff --git a/.gitignore b/.gitignore index a57a8747..199ab59d 100644 --- a/.gitignore +++ b/.gitignore @@ -90,6 +90,7 @@ tests/.deps tests/oss-fuzz/Makefile.ci tests/testdriver tests/*.o +tests/test_common.h # ctags - Sublime plugin tags diff --git a/CMakeLists.txt b/CMakeLists.txt index 76642140..284d10f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -382,12 +382,15 @@ else(ENABLE_TCP) endif(ENABLE_TCP) # creates config header file in build directory -configure_file(${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap.h.in - ${CMAKE_CURRENT_BINARY_DIR}/include/coap2/coap.h) +configure_file(${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap.h.in + ${CMAKE_CURRENT_BINARY_DIR}/include/coap${LIBCOAP_API_VERSION}/coap.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake_coap_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/coap_config.h) +configure_file(${CMAKE_CURRENT_LIST_DIR}/tests/test_common.h.in + ${CMAKE_CURRENT_LIST_DIR}/tests/test_common.h) + # # sources # @@ -431,35 +434,34 @@ target_sources( $<$:${CMAKE_CURRENT_LIST_DIR}/src/coap_gnutls.c> $<$:${CMAKE_CURRENT_LIST_DIR}/src/coap_mbedtls.c> # headers - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/address.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/async.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/bits.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/block.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_cache.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_debug.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_dtls.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_event.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_hashkey.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap.h.in - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_io.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_session.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_time.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/encode.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/libcoap.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/lwippools.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/mem.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/net.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/option.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/pdu.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_prng.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/resource.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/str.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/subscribe.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/uri.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/uthash.h - ${CMAKE_CURRENT_LIST_DIR}/include/coap2/utlist.h) -# TODO: some *.c are still including the filename instead of "coap2/header.h" + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/address.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/async.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/bits.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/block.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_cache.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_debug.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_dtls.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_event.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_hashkey.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap.h.in + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_io.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_session.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_time.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/encode.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/libcoap.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/lwippools.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/mem.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/net.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/option.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/pdu.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap_prng.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/resource.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/str.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/subscribe.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/uri.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/uthash.h + ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/utlist.h) target_include_directories( ${COAP_LIBRARY_NAME} PUBLIC # config headers are generated during configuration time @@ -515,6 +517,7 @@ if(ENABLE_TESTS) add_executable( testdriver ${CMAKE_CURRENT_LIST_DIR}/tests/testdriver.c + ${CMAKE_CURRENT_LIST_DIR}/tests/test_common.h ${CMAKE_CURRENT_LIST_DIR}/tests/test_encode.c ${CMAKE_CURRENT_LIST_DIR}/tests/test_encode.h ${CMAKE_CURRENT_LIST_DIR}/tests/test_error_response.c diff --git a/Makefile.am b/Makefile.am index 3726324c..a7e7d335 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,6 +17,9 @@ EXTRA_DIST = \ CONTRIBUTE \ TODO \ LICENSE \ + coap_config.h.lwip \ + coap_config.h.riot \ + coap_config.h.windows \ libcoap-$(LIBCOAP_API_VERSION).pc.in \ libcoap-$(LIBCOAP_API_VERSION).map \ libcoap-$(LIBCOAP_API_VERSION).sym \ @@ -31,6 +34,9 @@ EXTRA_DIST = \ include/coap$(LIBCOAP_API_VERSION)/coap_session_internal.h \ include/coap$(LIBCOAP_API_VERSION)/coap_subscribe_internal.h \ include/coap$(LIBCOAP_API_VERSION)/coap_tcp_internal.h \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.in \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.windows \ + include/coap$(LIBCOAP_API_VERSION)/coap.h.windows.in \ include/coap$(LIBCOAP_API_VERSION)/utlist.h \ src/coap_io_riot.c \ tests/test_error_response.h \ diff --git a/coap_config.h.lwip b/coap_config.h.lwip index 48f444e9..8cce2042 100644 --- a/coap_config.h.lwip +++ b/coap_config.h.lwip @@ -15,9 +15,9 @@ #define COAP_DISABLE_TCP 1 #endif -#define PACKAGE_NAME "libcoap-lwip" -#define PACKAGE_VERSION "?" -#define PACKAGE_STRING PACKAGE_NAME PACKAGE_VERSION +#define PACKAGE_NAME "libcoap" +#define PACKAGE_VERSION "4.3.0rc1" +#define PACKAGE_STRING "libcoap 4.3.0rc1" #define assert(x) LWIP_ASSERT("CoAP assert failed", x) diff --git a/coap_config.h.lwip.in b/coap_config.h.lwip.in new file mode 100644 index 00000000..576aedc7 --- /dev/null +++ b/coap_config.h.lwip.in @@ -0,0 +1,31 @@ +#ifndef COAP_CONFIG_H_ +#define COAP_CONFIG_H_ + +#include +#include +#include /* provide ntohs, htons */ + +#define WITH_LWIP 1 + +#ifndef COAP_CONSTRAINED_STACK +#define COAP_CONSTRAINED_STACK 1 +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 1 +#endif + +#define PACKAGE_NAME "@PACKAGE_NAME@" +#define PACKAGE_VERSION "@PACKAGE_VERSION@" +#define PACKAGE_STRING "@PACKAGE_STRING@" + +#define assert(x) LWIP_ASSERT("CoAP assert failed", x) + +/* it's just provided by libc. i hope we don't get too many of those, as + * actually we'd need autotools again to find out what environment we're + * building in */ +#define HAVE_STRNLEN 1 + +#define HAVE_LIMITS_H + +#endif /* COAP_CONFIG_H_ */ diff --git a/coap_config.h.riot b/coap_config.h.riot index a07f5a11..08775645 100644 --- a/coap_config.h.riot +++ b/coap_config.h.riot @@ -94,16 +94,16 @@ #define HAVE_UNISTD_H 1 /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" +#define PACKAGE_BUGREPORT "libcoap-developers@lists.sourceforge.net" /* Define to the full name of this package. */ #define PACKAGE_NAME "libcoap" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.2.0" +#define PACKAGE_VERSION "4.3.0rc1" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libcoap 4.2.0" +#define PACKAGE_STRING "libcoap 4.3.0rc1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 diff --git a/coap_config.h.riot.in b/coap_config.h.riot.in new file mode 100644 index 00000000..a5a3907b --- /dev/null +++ b/coap_config.h.riot.in @@ -0,0 +1,132 @@ +#ifndef COAP_CONFIG_H_RIOT_ +#define COAP_CONFIG_H_RIOT_ + +#define WITH_POSIX 1 + +#ifndef COAP_CONSTRAINED_STACK +#define COAP_CONSTRAINED_STACK 1 +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 1 +#endif + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +/* #undef HAVE_GETADDRINFO */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIMITS_H */ + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETDB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the `select' function. */ +/* #undef HAVE_SELECT */ + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strnlen' function. */ +/* #undef HAVE_STRNLEN */ + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +#endif /* COAP_CONFIG_H_RIOT_ */ diff --git a/coap_config.h.windows b/coap_config.h.windows index 86e54060..aec20b3c 100644 --- a/coap_config.h.windows +++ b/coap_config.h.windows @@ -78,7 +78,7 @@ #define PACKAGE_NAME "libcoap" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libcoap 4.2.0" +#define PACKAGE_STRING "libcoap 4.3.0rc1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libcoap" @@ -87,7 +87,7 @@ #define PACKAGE_URL "https://libcoap.net/" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.2.0" +#define PACKAGE_VERSION "4.3.0rc1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 diff --git a/coap_config.h.windows.in b/coap_config.h.windows.in new file mode 100644 index 00000000..84ef458c --- /dev/null +++ b/coap_config.h.windows.in @@ -0,0 +1,118 @@ +#ifndef COAP_CONFIG_H_ +#define COAP_CONFIG_H_ + +#if defined(_WIN32) + +/* Define to 1 if you have header file. */ +#define HAVE_WS2TCPIP_H 1 + +/* Define to 1 if you have header file. */ +#define HAVE_WINSOCK2_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `malloc' function. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if the system has the type `struct cmsghdr'. */ +#define HAVE_STRUCT_CMSGHDR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(snprintf) +#define snprintf _snprintf +#endif + +#ifndef COAP_DISABLE_TCP +#define COAP_DISABLE_TCP 0 +#endif + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "@PACKAGE_TARNAME@" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "@PACKAGE_URL@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define this to 1 for ancillary data on MacOS */ +/* #undef __APPLE_USE_RFC_3542 */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +#endif + +#endif /* COAP_CONFIG_H_ */ diff --git a/configure.ac b/configure.ac index 9f51f4c6..d7b032f4 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ AM_SILENT_RULES([yes]) AC_HEADER_ASSERT # Generate one configuration header file for building the library itself with -# an auto generated template. We need later a second one (include/libcoap.h) -# that will be installed alongside the library. +# an auto generated template. We need later a second one +# (include/coap$LIBCOAP_API_VERSION/libcoap.h) that will be installed alongside the library. AC_CONFIG_HEADERS([coap_config.h]) AC_PROG_CC @@ -814,9 +814,13 @@ CFLAGS="$CFLAGS $ADDITIONAL_CFLAGS" # AC_CONFIG_FILES([ Makefile +coap_config.h.lwip +coap_config.h.riot +coap_config.h.windows doc/Makefile examples/Makefile -include/coap2/coap.h +include/coap$LIBCOAP_API_VERSION/coap.h +include/coap$LIBCOAP_API_VERSION/coap.h.windows man/coap.txt man/coap_attribute.txt man/coap_block.txt @@ -838,6 +842,7 @@ man/coap-client.txt man/coap-server.txt man/coap-rd.txt man/Makefile +tests/test_common.h tests/Makefile tests/oss-fuzz/Makefile.ci libcoap-$LIBCOAP_NAME_SUFFIX.pc:libcoap-$LIBCOAP_API_VERSION.pc.in diff --git a/include/coap2/address.h b/include/coap2/address.h index 2e706106..857fd8c3 100644 --- a/include/coap2/address.h +++ b/include/coap2/address.h @@ -19,7 +19,7 @@ #include #include #include -#include "coap2/libcoap.h" +#include "libcoap.h" #if defined(WITH_LWIP) diff --git a/include/coap2/async.h b/include/coap2/async.h index 7a4bbe8c..57f6be3d 100644 --- a/include/coap2/async.h +++ b/include/coap2/async.h @@ -15,7 +15,7 @@ #ifndef COAP_ASYNC_H_ #define COAP_ASYNC_H_ -#include "coap2/net.h" +#include "net.h" #ifndef WITHOUT_ASYNC diff --git a/include/coap2/block.h b/include/coap2/block.h index 413a3c81..b905331e 100644 --- a/include/coap2/block.h +++ b/include/coap2/block.h @@ -10,9 +10,9 @@ #ifndef COAP_BLOCK_H_ #define COAP_BLOCK_H_ -#include "coap2/encode.h" -#include "coap2/option.h" -#include "coap2/pdu.h" +#include "encode.h" +#include "option.h" +#include "pdu.h" /** * @defgroup block Block Transfer diff --git a/include/coap2/coap.h.in b/include/coap2/coap.h.in index f90dc104..a75708d5 100644 --- a/include/coap2/coap.h.in +++ b/include/coap2/coap.h.in @@ -33,29 +33,29 @@ extern "C" { #endif -#include "coap2/libcoap.h" +#include "coap@LIBCOAP_API_VERSION@/libcoap.h" -#include "coap2/coap_forward_decls.h" -#include "coap2/address.h" -#include "coap2/async.h" -#include "coap2/bits.h" -#include "coap2/block.h" -#include "coap2/coap_cache.h" -#include "coap2/coap_dtls.h" -#include "coap2/coap_event.h" -#include "coap2/coap_io.h" -#include "coap2/coap_time.h" -#include "coap2/coap_debug.h" -#include "coap2/encode.h" -#include "coap2/mem.h" -#include "coap2/net.h" -#include "coap2/option.h" -#include "coap2/pdu.h" -#include "coap2/coap_prng.h" -#include "coap2/resource.h" -#include "coap2/str.h" -#include "coap2/subscribe.h" -#include "coap2/uri.h" +#include "coap@LIBCOAP_API_VERSION@/coap_forward_decls.h" +#include "coap@LIBCOAP_API_VERSION@/address.h" +#include "coap@LIBCOAP_API_VERSION@/async.h" +#include "coap@LIBCOAP_API_VERSION@/bits.h" +#include "coap@LIBCOAP_API_VERSION@/block.h" +#include "coap@LIBCOAP_API_VERSION@/coap_cache.h" +#include "coap@LIBCOAP_API_VERSION@/coap_debug.h" +#include "coap@LIBCOAP_API_VERSION@/coap_dtls.h" +#include "coap@LIBCOAP_API_VERSION@/coap_event.h" +#include "coap@LIBCOAP_API_VERSION@/coap_io.h" +#include "coap@LIBCOAP_API_VERSION@/coap_prng.h" +#include "coap@LIBCOAP_API_VERSION@/coap_time.h" +#include "coap@LIBCOAP_API_VERSION@/encode.h" +#include "coap@LIBCOAP_API_VERSION@/mem.h" +#include "coap@LIBCOAP_API_VERSION@/net.h" +#include "coap@LIBCOAP_API_VERSION@/option.h" +#include "coap@LIBCOAP_API_VERSION@/pdu.h" +#include "coap@LIBCOAP_API_VERSION@/resource.h" +#include "coap@LIBCOAP_API_VERSION@/str.h" +#include "coap@LIBCOAP_API_VERSION@/subscribe.h" +#include "coap@LIBCOAP_API_VERSION@/uri.h" #ifdef __cplusplus } diff --git a/include/coap2/coap.h.windows b/include/coap2/coap.h.windows index b6aac6f6..85521774 100644 --- a/include/coap2/coap.h.windows +++ b/include/coap2/coap.h.windows @@ -18,13 +18,13 @@ #define LIBCOAP_PACKAGE_NAME "libcoap" /* Define the full name and version of libcoap. */ -#define LIBCOAP_PACKAGE_STRING "libcoap 4.2.0" +#define LIBCOAP_PACKAGE_STRING "libcoap 4.3.0rc1" /* Define the home page for libcoap. */ #define LIBCOAP_PACKAGE_URL "https://libcoap.net/" /* Define the version of libcoap this file belongs to. */ -#define LIBCOAP_PACKAGE_VERSION "4.2.0" +#define LIBCOAP_PACKAGE_VERSION "4.3.0rc1" #ifdef __cplusplus extern "C" { diff --git a/include/coap2/coap.h.windows.in b/include/coap2/coap.h.windows.in new file mode 100644 index 00000000..a75708d5 --- /dev/null +++ b/include/coap2/coap.h.windows.in @@ -0,0 +1,64 @@ +/* + * coap.h -- main header file for CoAP stack of libcoap + * + * Copyright (C) 2010-2012,2015-2017 Olaf Bergmann + * 2015 Carsten Schoenert + * + * This file is part of the CoAP library libcoap. Please see README for terms + * of use. + */ + +#ifndef COAP_H_ +#define COAP_H_ + +/* Define the address where bug reports for libcoap should be sent. */ +#define LIBCOAP_PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define the full name of libcoap. */ +#define LIBCOAP_PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define the full name and version of libcoap. */ +#define LIBCOAP_PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define the home page for libcoap. */ +#define LIBCOAP_PACKAGE_URL "@PACKAGE_URL@" + +/* Define the version of libcoap this file belongs to. */ +#define LIBCOAP_PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Define the numeric version identifier for libcoap */ +#define LIBCOAP_VERSION (@LIBCOAP_VERSION@U) + +#ifdef __cplusplus +extern "C" { +#endif + +#include "coap@LIBCOAP_API_VERSION@/libcoap.h" + +#include "coap@LIBCOAP_API_VERSION@/coap_forward_decls.h" +#include "coap@LIBCOAP_API_VERSION@/address.h" +#include "coap@LIBCOAP_API_VERSION@/async.h" +#include "coap@LIBCOAP_API_VERSION@/bits.h" +#include "coap@LIBCOAP_API_VERSION@/block.h" +#include "coap@LIBCOAP_API_VERSION@/coap_cache.h" +#include "coap@LIBCOAP_API_VERSION@/coap_debug.h" +#include "coap@LIBCOAP_API_VERSION@/coap_dtls.h" +#include "coap@LIBCOAP_API_VERSION@/coap_event.h" +#include "coap@LIBCOAP_API_VERSION@/coap_io.h" +#include "coap@LIBCOAP_API_VERSION@/coap_prng.h" +#include "coap@LIBCOAP_API_VERSION@/coap_time.h" +#include "coap@LIBCOAP_API_VERSION@/encode.h" +#include "coap@LIBCOAP_API_VERSION@/mem.h" +#include "coap@LIBCOAP_API_VERSION@/net.h" +#include "coap@LIBCOAP_API_VERSION@/option.h" +#include "coap@LIBCOAP_API_VERSION@/pdu.h" +#include "coap@LIBCOAP_API_VERSION@/resource.h" +#include "coap@LIBCOAP_API_VERSION@/str.h" +#include "coap@LIBCOAP_API_VERSION@/subscribe.h" +#include "coap@LIBCOAP_API_VERSION@/uri.h" + +#ifdef __cplusplus +} +#endif + +#endif /* COAP_H_ */ diff --git a/include/coap2/coap_block_internal.h b/include/coap2/coap_block_internal.h index b099263f..dd1c6f69 100644 --- a/include/coap2/coap_block_internal.h +++ b/include/coap2/coap_block_internal.h @@ -17,7 +17,7 @@ #ifndef COAP_BLOCK_INTERNAL_H_ #define COAP_BLOCK_INTERNAL_H_ -#include "coap2/resource.h" +#include "resource.h" /** * @defgroup block_internal Block (Internal) diff --git a/include/coap2/coap_debug.h b/include/coap2/coap_debug.h index a9cc7292..6bb7a87c 100644 --- a/include/coap2/coap_debug.h +++ b/include/coap2/coap_debug.h @@ -153,7 +153,7 @@ void coap_log_impl(coap_log_t level, const char *format, ...); } while(0) #endif -#include "coap2/pdu.h" +#include "pdu.h" /** * Defines the output mode for the coap_show_pdu() function. diff --git a/include/coap2/coap_dtls.h b/include/coap2/coap_dtls.h index a690abd8..a86879b5 100644 --- a/include/coap2/coap_dtls.h +++ b/include/coap2/coap_dtls.h @@ -11,8 +11,8 @@ #ifndef COAP_DTLS_H_ #define COAP_DTLS_H_ -#include "coap2/coap_time.h" -#include "coap2/str.h" +#include "coap_time.h" +#include "str.h" /** * @defgroup dtls DTLS Support diff --git a/include/coap2/coap_event.h b/include/coap2/coap_event.h index 34e09635..60ff991b 100644 --- a/include/coap2/coap_event.h +++ b/include/coap2/coap_event.h @@ -10,7 +10,7 @@ #ifndef COAP_EVENT_H_ #define COAP_EVENT_H_ -#include "coap2/libcoap.h" +#include "libcoap.h" /** * @defgroup events Event API diff --git a/include/coap2/coap_hashkey.h b/include/coap2/coap_hashkey.h index 129c9da9..2d568784 100644 --- a/include/coap2/coap_hashkey.h +++ b/include/coap2/coap_hashkey.h @@ -15,9 +15,9 @@ #ifndef COAP_HASHKEY_H_ #define COAP_HASHKEY_H_ -#include "coap2/libcoap.h" -#include "coap2/uthash.h" -#include "coap2/str.h" +#include "libcoap.h" +#include "uthash.h" +#include "str.h" typedef unsigned char coap_key_t[4]; diff --git a/include/coap2/coap_internal.h b/include/coap2/coap_internal.h index e4d7116d..bd71567e 100644 --- a/include/coap2/coap_internal.h +++ b/include/coap2/coap_internal.h @@ -40,18 +40,18 @@ */ /* Not defined in coap.h - internal usage .h files */ -#include "coap2/utlist.h" -#include "coap2/uthash.h" -#include "coap2/coap_hashkey.h" -#include "coap2/coap_mutex.h" +#include "utlist.h" +#include "uthash.h" +#include "coap_hashkey.h" +#include "coap_mutex.h" /* Specifically defined internal .h files */ -#include "coap2/coap_asn1_internal.h" -#include "coap2/coap_block_internal.h" -#include "coap2/coap_cache_internal.h" -#include "coap2/coap_session_internal.h" -#include "coap2/coap_resource_internal.h" -#include "coap2/coap_subscribe_internal.h" -#include "coap2/coap_tcp_internal.h" +#include "coap_asn1_internal.h" +#include "coap_block_internal.h" +#include "coap_cache_internal.h" +#include "coap_session_internal.h" +#include "coap_resource_internal.h" +#include "coap_subscribe_internal.h" +#include "coap_tcp_internal.h" #endif /* COAP_INTERNAL_H_ */ diff --git a/include/coap2/coap_io.h b/include/coap2/coap_io.h index c58531d4..51f12489 100644 --- a/include/coap2/coap_io.h +++ b/include/coap2/coap_io.h @@ -12,7 +12,7 @@ #include -#include "coap2/address.h" +#include "address.h" #ifdef RIOT_VERSION #include "net/gnrc.h" diff --git a/include/coap2/coap_session.h b/include/coap2/coap_session.h index 82b1a64b..4cab1290 100644 --- a/include/coap2/coap_session.h +++ b/include/coap2/coap_session.h @@ -15,12 +15,12 @@ #define COAP_SESSION_H_ -#include "coap2/coap_forward_decls.h" -#include "coap2/coap_io.h" -#include "coap2/coap_time.h" -#include "coap2/pdu.h" -#include "coap2/uthash.h" -#include "coap2/coap_dtls.h" +#include "coap_forward_decls.h" +#include "coap_io.h" +#include "coap_time.h" +#include "pdu.h" +#include "uthash.h" +#include "coap_dtls.h" /** * Abstraction of a fixed point number that can be used where necessary instead diff --git a/include/coap2/coap_tcp_internal.h b/include/coap2/coap_tcp_internal.h index 7f8549a8..c56d8d7b 100644 --- a/include/coap2/coap_tcp_internal.h +++ b/include/coap2/coap_tcp_internal.h @@ -15,7 +15,7 @@ #ifndef COAP_TCP_INTERNAL_H_ #define COAP_TCP_INTERNAL_H_ -#include "coap2/coap_io.h" +#include "coap_io.h" /** * @defgroup tcp TCP Support (Internal) diff --git a/include/coap2/lwippools.h b/include/coap2/lwippools.h index bb36ede2..acc810a0 100644 --- a/include/coap2/lwippools.h +++ b/include/coap2/lwippools.h @@ -9,10 +9,10 @@ * include this or include something more generic which includes this), and * MEMP_USE_CUSTOM_POOLS has to be set in lwipopts.h. */ -#include "coap2/coap_internal.h" -#include -#include -#include +#include "coap_internal.h" +#include "net.h" +#include "resource.h" +#include "subscribe.h" #ifndef MEMP_NUM_COAPCONTEXT #define MEMP_NUM_COAPCONTEXT 1 diff --git a/include/coap2/resource.h b/include/coap2/resource.h index bd639c4e..02233ad0 100644 --- a/include/coap2/resource.h +++ b/include/coap2/resource.h @@ -20,13 +20,13 @@ #define COAP_RESOURCE_CHECK_TIME 2 #endif /* COAP_RESOURCE_CHECK_TIME */ -#include "coap2/uthash.h" -#include "coap2/async.h" -#include "coap2/block.h" -#include "coap2/str.h" -#include "coap2/pdu.h" -#include "coap2/net.h" -#include "coap2/subscribe.h" +#include "uthash.h" +#include "async.h" +#include "block.h" +#include "str.h" +#include "pdu.h" +#include "net.h" +#include "subscribe.h" /** * @defgroup coap_resource Resource Configuraton diff --git a/tests/test_common.h.in b/tests/test_common.h.in new file mode 100644 index 00000000..0b50705c --- /dev/null +++ b/tests/test_common.h.in @@ -0,0 +1,10 @@ +/* libcoap unit tests common include + * + * Copyright (C) 2021 Olaf Bergmann + * + * This file is part of the CoAP library libcoap. Please see + * README for terms of use. + */ + +#include "coap@LIBCOAP_API_VERSION@/coap_internal.h" + diff --git a/tests/test_encode.c b/tests/test_encode.c index 672a1010..8e06c559 100644 --- a/tests/test_encode.c +++ b/tests/test_encode.c @@ -6,11 +6,9 @@ * README for terms of use. */ -#include "coap_config.h" +#include "test_common.h" #include "test_encode.h" -#include - #include #include #include diff --git a/tests/test_error_response.c b/tests/test_error_response.c index 34854851..d8526e45 100644 --- a/tests/test_error_response.c +++ b/tests/test_error_response.c @@ -6,11 +6,9 @@ * README for terms of use. */ -#include "coap_config.h" +#include "test_common.h" #include "test_error_response.h" -#include - #include #include #include diff --git a/tests/test_options.c b/tests/test_options.c index 50b99bb6..387c3829 100644 --- a/tests/test_options.c +++ b/tests/test_options.c @@ -6,11 +6,9 @@ * README for terms of use. */ -#include "coap_config.h" +#include "test_common.h" #include "test_options.h" -#include - #include #include #include diff --git a/tests/test_pdu.c b/tests/test_pdu.c index 0a4e8232..ef759b23 100644 --- a/tests/test_pdu.c +++ b/tests/test_pdu.c @@ -6,11 +6,9 @@ * README for terms of use. */ -#include "coap_config.h" +#include "test_common.h" #include "test_pdu.h" -#include - #include #include #include diff --git a/tests/test_sendqueue.c b/tests/test_sendqueue.c index c536d550..9fe4fae6 100644 --- a/tests/test_sendqueue.c +++ b/tests/test_sendqueue.c @@ -6,11 +6,9 @@ * README for terms of use. */ -#include "coap_config.h" +#include "test_common.h" #include "test_sendqueue.h" -#include - #include static coap_context_t *ctx; /* Holds the coap context for most tests */ diff --git a/tests/test_session.c b/tests/test_session.c index b1326891..ebe75034 100644 --- a/tests/test_session.c +++ b/tests/test_session.c @@ -6,11 +6,9 @@ * README for terms of use. */ -#include "coap_config.h" +#include "test_common.h" #include "test_session.h" -#include - #include /* The error threshold for timeout calculations. The precision of diff --git a/tests/test_tls.c b/tests/test_tls.c index 099e154a..ffb1262e 100644 --- a/tests/test_tls.c +++ b/tests/test_tls.c @@ -6,11 +6,9 @@ * README for terms of use. */ -#include "coap_config.h" +#include "test_common.h" #include "test_tls.h" -#include - #undef HAVE_DTLS #ifdef HAVE_LIBTINYDTLS diff --git a/tests/test_uri.c b/tests/test_uri.c index 5e6b50b6..f24b68b2 100644 --- a/tests/test_uri.c +++ b/tests/test_uri.c @@ -6,11 +6,9 @@ * README for terms of use. */ -#include "coap_config.h" +#include "test_common.h" #include "test_uri.h" -#include - #include static void diff --git a/tests/test_wellknown.c b/tests/test_wellknown.c index b70317e7..805885e5 100644 --- a/tests/test_wellknown.c +++ b/tests/test_wellknown.c @@ -6,11 +6,8 @@ * README for terms of use. */ -#include "coap_config.h" +#include "test_common.h" #include "test_wellknown.h" -#include "coap2/coap_internal.h" - -#include #include #ifdef HAVE_NETINET_IN_H diff --git a/tests/testdriver.c b/tests/testdriver.c index efc4e087..93b5292e 100644 --- a/tests/testdriver.c +++ b/tests/testdriver.c @@ -3,6 +3,7 @@ #include #include +#include "test_common.h" #include "test_uri.h" #include "test_encode.h" #include "test_options.h" @@ -12,7 +13,6 @@ #include "test_sendqueue.h" #include "test_wellknown.h" #include "test_tls.h" -#include "coap2/libcoap.h" int main(int argc COAP_UNUSED, char **argv COAP_UNUSED) { diff --git a/win32/install/install.vcxproj b/win32/install/install.vcxproj index 76897945..0942975d 100644 --- a/win32/install/install.vcxproj +++ b/win32/install/install.vcxproj @@ -171,8 +171,8 @@ Installing - if not exist "$(OutDir)include\coap2" mkdir "$(OutDir)include\coap2" -copy "$(SolutionDir)..\include\coap2\*.h" "$(OutDir)include\coap2" + if not exist "$(OutDir)$(LibCoAPIncludeDir)" mkdir "$(OutDir)$(LibCoAPIncludeDir)" +copy "$(SolutionDir)..\$(LibCoAPIncludeDir)\*.h" "$(OutDir)$(LibCoAPIncludeDir)" if not exist "$(OutDir)bin" mkdir "$(OutDir)bin" for %%f in ( coap-client$(DbgSuffix).exe coap-client$(DbgSuffix).pdb coap-server$(DbgSuffix).exe coap-server$(DbgSuffix).pdb coap-rd$(DbgSuffix).exe coap-rd$(DbgSuffix).pdb ) do copy "$(SolutionDir)$(Configuration)%%f" "$(OutDir)bin" if not exist "$(OutDir)lib" mkdir "$(OutDir)lib" @@ -183,8 +183,8 @@ copy "$(SolutionDir)$(Configuration)\libcoap$(DbgSuffix).pdb" "$(OutDir)lib" Installing - if not exist "$(OutDir)include\coap2" mkdir "$(OutDir)include\coap2" -copy "$(SolutionDir)..\include\coap2\*.h" "$(OutDir)include\coap2" + if not exist "$(OutDir)$(LibCoAPIncludeDir)" mkdir "$(OutDir)$(LibCoAPIncludeDir)" +copy "$(SolutionDir)..\$(LibCoAPIncludeDir)\*.h" "$(OutDir)$(LibCoAPIncludeDir)" if not exist "$(OutDir)bin" mkdir "$(OutDir)bin" for %%f in ( coap-client$(DbgSuffix).exe coap-client$(DbgSuffix).pdb coap-server$(DbgSuffix).exe coap-server$(DbgSuffix).pdb coap-rd$(DbgSuffix).exe coap-rd$(DbgSuffix).pdb libcoap-2$(DbgSuffix)-openssl.dll libcoap-2$(DbgSuffix)-openssl.pdb ) do copy "$(SolutionDir)$(Configuration)\%%f" "$(OutDir)bin" if not exist "$(OutDir)lib" mkdir "$(OutDir)lib" @@ -195,8 +195,8 @@ copy "$(SolutionDir)$(Configuration)\libcoap-2$(DbgSuffix)-openssl.lib" "$(OutDi Installing - if not exist "$(OutDir)include\coap2" mkdir "$(OutDir)include\coap2" -copy "$(SolutionDir)..\include\coap2\*.h" "$(OutDir)include\coap2" + if not exist "$(OutDir)$(LibCoAPIncludeDir)" mkdir "$(OutDir)$(LibCoAPIncludeDir)" +copy "$(SolutionDir)..\$(LibCoAPIncludeDir)\*.h" "$(OutDir)$(LibCoAPIncludeDir)" if not exist "$(OutDir)bin" mkdir "$(OutDir)bin" for %%f in ( coap-client.exe coap-client.pdb coap-server.exe coap-server.pdb coap-rd.exe coap-rd.pdb ) do copy "$(SolutionDir)$(Configuration)\%%f" "$(OutDir)bin" if not exist "$(OutDir)lib" mkdir "$(OutDir)lib" @@ -207,8 +207,8 @@ copy "$(SolutionDir)$(Configuration)\libcoap.pdb" "$(OutDir)lib" Installing - if not exist "$(OutDir)include\coap2" mkdir "$(OutDir)include\coap2" -copy "$(SolutionDir)..\include\coap2\*.h" "$(OutDir)include\coap2" + if not exist "$(OutDir)$(LibCoAPIncludeDir)" mkdir "$(OutDir)$(LibCoAPIncludeDir)" +copy "$(SolutionDir)..\$(LibCoAPIncludeDir)\*.h" "$(OutDir)$(LibCoAPIncludeDir)" if not exist "$(OutDir)bin" mkdir "$(OutDir)bin" for %%f in ( coap-client.exe coap-client.pdb coap-server.exe coap-server.pdb coap-rd.exe coap-rd.pdb libcoap-2-openssl.dll libcoap-2-openssl.pdb ) do copy "$(SolutionDir)$(Configuration)\%%f" "$(OutDir)bin" if not exist "$(OutDir)lib" mkdir "$(OutDir)lib" @@ -218,8 +218,8 @@ copy "$(SolutionDir)$(Configuration)\libcoap-2-openssl.lib" "$(OutDir)lib" - if not exist "$(OutDir)include\coap2" mkdir "$(OutDir)include\coap2" -copy "$(SolutionDir)..\include\coap2\*.h" "$(OutDir)include\coap2" + if not exist "$(OutDir)$(LibCoAPIncludeDir)" mkdir "$(OutDir)$(LibCoAPIncludeDir)" +copy "$(SolutionDir)..\$(LibCoAPIncludeDir)\*.h" "$(OutDir)$(LibCoAPIncludeDir)" if not exist "$(OutDir)bin" mkdir "$(OutDir)bin" for %%f in ( coap-client$(DbgSuffix).exe coap-client$(DbgSuffix).pdb coap-server$(DbgSuffix).exe coap-server$(DbgSuffix).pdb coap-rd$(DbgSuffix).exe coap-rd$(DbgSuffix).pdb ) do copy "$(SolutionDir)$(Platform)\$(Configuration)\%%f" "$(OutDir)bin" if not exist "$(OutDir)lib" mkdir "$(OutDir)lib" @@ -230,8 +230,8 @@ copy "$(SolutionDir)$(Platform)\$(Configuration)\libcoap$(DbgSuffix).pdb" "$(Out - if not exist "$(OutDir)include\coap2" mkdir "$(OutDir)include\coap2" -copy "$(SolutionDir)..\include\coap2\*.h" "$(OutDir)include\coap2" + if not exist "$(OutDir)$(LibCoAPIncludeDir)" mkdir "$(OutDir)$(LibCoAPIncludeDir)" +copy "$(SolutionDir)..\$(LibCoAPIncludeDir)\*.h" "$(OutDir)$(LibCoAPIncludeDir)" if not exist "$(OutDir)bin" mkdir "$(OutDir)bin" for %%f in ( coap-client$(DbgSuffix).exe coap-client$(DbgSuffix).pdb coap-server$(DbgSuffix).exe coap-server$(DbgSuffix).pdb coap-rd$(DbgSuffix).exe coap-rd$(DbgSuffix).pdb libcoap-2$(DbgSuffix)-openssl.dll libcoap-2$(DbgSuffix)-openssl.pdb ) do copy "$(SolutionDir)$(Platform)\$(Configuration)\%%f" "$(OutDir)bin" if not exist "$(OutDir)lib" mkdir "$(OutDir)lib" @@ -242,8 +242,8 @@ copy "$(SolutionDir)$(Platform)\$(Configuration)\libcoap-2$(DbgSuffix)-openssl.l - if not exist "$(OutDir)include\coap2" mkdir "$(OutDir)include\coap2" -copy "$(SolutionDir)..\include\coap2\*.h" "$(OutDir)include\coap2" + if not exist "$(OutDir)$(LibCoAPIncludeDir)" mkdir "$(OutDir)$(LibCoAPIncludeDir)" +copy "$(SolutionDir)..\$(LibCoAPIncludeDir)\*.h" "$(OutDir)$(LibCoAPIncludeDir)" if not exist "$(OutDir)bin" mkdir "$(OutDir)bin" for %%f in ( coap-client.exe coap-client.pdb coap-server.exe coap-server.pdb coap-rd.exe coap-rd.pdb ) do copy "$(SolutionDir)$(Platform)\$(Configuration)\%%f" "$(OutDir)bin" if not exist "$(OutDir)lib" mkdir "$(OutDir)lib" @@ -254,8 +254,8 @@ copy "$(SolutionDir)$(Platform)\$(Configuration)\libcoap.pdb" "$(OutDir)lib" - if not exist "$(OutDir)include\coap2" mkdir "$(OutDir)include\coap2" -copy "$(SolutionDir)..\include\coap2\*.h" "$(OutDir)include\coap2" + if not exist "$(OutDir)$(LibCoAPIncludeDir)" mkdir "$(OutDir)$(LibCoAPIncludeDir)" +copy "$(SolutionDir)..\$(LibCoAPIncludeDir)\*.h" "$(OutDir)$(LibCoAPIncludeDir)" if not exist "$(OutDir)bin" mkdir "$(OutDir)bin" for %%f in ( coap-client.exe coap-client.pdb coap-server.exe coap-server.pdb coap-rd.exe coap-rd.pdb libcoap-2-openssl.dll libcoap-2-openssl.pdb ) do copy "$(SolutionDir)$(Platform)\$(Configuration)\%%f" "$(OutDir)bin" if not exist "$(OutDir)lib" mkdir "$(OutDir)lib" @@ -266,8 +266,8 @@ copy "$(SolutionDir)$(Platform)\$(Configuration)\libcoap-2-openssl.lib" "$(OutDi - if not exist "$(OutDir)include\coap2" mkdir "$(OutDir)include\coap2" -copy "$(SolutionDir)..\include\coap2\*.h" "$(OutDir)include\coap2" + if not exist "$(OutDir)$(LibCoAPIncludeDir)" mkdir "$(OutDir)$(LibCoAPIncludeDir)" +copy "$(SolutionDir)..\$(LibCoAPIncludeDir)\*.h" "$(OutDir)$(LibCoAPIncludeDir)" if not exist "$(OutDir)bin" mkdir "$(OutDir)bin" for %%f in ( coap-client.exe coap-client.pdb coap-server.exe coap-server.pdb coap-rd.exe coap-rd.pdb ) do copy "$(SolutionDir)$(Platform)\$(Configuration)\%%f" "$(OutDir)bin" if not exist "$(OutDir)lib" mkdir "$(OutDir)lib" diff --git a/win32/libcoap.props b/win32/libcoap.props index eb85ea79..b7f902b4 100644 --- a/win32/libcoap.props +++ b/win32/libcoap.props @@ -17,6 +17,7 @@ $(CUnitRootDirDbg)include $(CUnitRootDir)lib $(CUnitRootDirDbg)lib + include\coap2 diff --git a/win32/libcoap.vcxproj b/win32/libcoap.vcxproj index f61e7550..4e79a7c9 100644 --- a/win32/libcoap.vcxproj +++ b/win32/libcoap.vcxproj @@ -68,41 +68,41 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -350,7 +350,7 @@ TYPE %(FullPath) >> "$(IntDir)$(TargetName).def" copy /Y ..\coap_config.h.windows ..\coap_config.h -copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h +copy /Y ..\$(LibCoAPIncludeDir)\coap.h.windows ..\$(LibCoAPIncludeDir)\coap.h Copying config files for windows @@ -393,7 +393,7 @@ copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h copy /Y ..\coap_config.h.windows ..\coap_config.h -copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h +copy /Y ..\$(LibCoAPIncludeDir)\coap.h.windows ..\$(LibCoAPIncludeDir)\coap.h Copying config files for windows @@ -433,7 +433,7 @@ copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h copy /Y ..\coap_config.h.windows ..\coap_config.h -copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h +copy /Y ..\$(LibCoAPIncludeDir)\coap.h.windows ..\$(LibCoAPIncludeDir)\coap.h Copying config files for windows @@ -458,7 +458,7 @@ copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h copy /Y ..\coap_config.h.windows ..\coap_config.h -copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h +copy /Y ..\$(LibCoAPIncludeDir)\coap.h.windows ..\$(LibCoAPIncludeDir)\coap.h Copying config files for windows @@ -481,7 +481,7 @@ copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h copy /Y ..\coap_config.h.windows ..\coap_config.h -copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h +copy /Y ..\$(LibCoAPIncludeDir)\coap.h.windows ..\$(LibCoAPIncludeDir)\coap.h Copying config files for windows @@ -526,7 +526,7 @@ copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h copy /Y ..\coap_config.h.windows ..\coap_config.h -copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h +copy /Y ..\$(LibCoAPIncludeDir)\coap.h.windows ..\$(LibCoAPIncludeDir)\coap.h Copying config files for windows @@ -568,7 +568,7 @@ copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h copy /Y ..\coap_config.h.windows ..\coap_config.h -copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h +copy /Y ..\$(LibCoAPIncludeDir)\coap.h.windows ..\$(LibCoAPIncludeDir)\coap.h Copying config files for windows @@ -596,7 +596,7 @@ copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h copy /Y ..\coap_config.h.windows ..\coap_config.h -copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h +copy /Y ..\$(LibCoAPIncludeDir)\coap.h.windows ..\$(LibCoAPIncludeDir)\coap.h Copying config files for windows @@ -620,7 +620,7 @@ copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h copy /Y ..\coap_config.h.windows ..\coap_config.h -copy /Y ..\include\coap2\coap.h.windows ..\include\coap2\coap.h +copy /Y ..\$(LibCoAPIncludeDir)\coap.h.windows ..\$(LibCoAPIncludeDir)\coap.h Copying config files for windows diff --git a/win32/libcoap.vcxproj.filters b/win32/libcoap.vcxproj.filters index d83da9d7..e59fc495 100644 --- a/win32/libcoap.vcxproj.filters +++ b/win32/libcoap.vcxproj.filters @@ -95,109 +95,109 @@ Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files