From 0c031d79040cec7041d07c7bd3726a5d9d505f9e Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Sat, 27 Feb 2021 22:16:21 +0000 Subject: [PATCH] include: Move header files into libcoap namespace I.E. '#include "mem.h"' becomes '#include "coap2/mem.h"' This prevents header name clashes. Replacement for #487 --- .gitignore | 2 +- CMakeLists.txt | 51 ++++++++++++------- Makefile.am | 2 +- Makefile.libcoap | 2 +- cmake-format.yaml | 2 +- ...coap_config.h.in => cmake_coap_config.h.in | 1 - examples/coap_list.c | 8 +-- examples/contiki/coap-observer.c | 2 +- examples/contiki/server.c | 2 +- examples/etsi_iot_01.c | 1 - examples/lwip/Makefile | 2 +- examples/lwip/server-coap.c | 2 +- examples/lwip/server-coap.h | 2 +- include/coap2/address.h | 2 +- include/coap2/async.h | 2 +- include/coap2/block.h | 6 +-- include/coap2/coap.h.in | 44 ++++++++-------- include/coap2/coap_block_internal.h | 2 +- include/coap2/coap_debug.h | 2 +- include/coap2/coap_dtls.h | 4 +- include/coap2/coap_event.h | 2 +- include/coap2/coap_hashkey.h | 6 +-- include/coap2/coap_internal.h | 24 ++++----- include/coap2/coap_io.h | 2 +- include/coap2/coap_session.h | 12 ++--- include/coap2/coap_tcp_internal.h | 2 +- include/coap2/lwippools.h | 8 +-- include/coap2/resource.h | 14 ++--- src/address.c | 2 +- src/async.c | 2 +- src/block.c | 2 +- src/coap_asn1.c | 2 +- src/coap_cache.c | 2 +- src/coap_debug.c | 2 +- src/coap_event.c | 2 +- src/coap_gnutls.c | 2 +- src/coap_hashkey.c | 2 +- src/coap_io.c | 2 +- src/coap_io_lwip.c | 2 +- src/coap_io_riot.c | 2 +- src/coap_mbedtls.c | 2 +- src/coap_notls.c | 2 +- src/coap_openssl.c | 2 +- src/coap_prng.c | 2 +- src/coap_session.c | 2 +- src/coap_tcp.c | 2 +- src/coap_time.c | 2 +- src/coap_tinydtls.c | 2 +- src/encode.c | 2 +- src/mem.c | 2 +- src/net.c | 2 +- src/option.c | 2 +- src/pdu.c | 2 +- src/resource.c | 2 +- src/str.c | 2 +- src/subscribe.c | 2 +- src/uri.c | 2 +- tests/Makefile.am | 2 +- tests/test_encode.c | 2 +- tests/test_error_response.c | 2 +- tests/test_options.c | 2 +- tests/test_pdu.c | 2 +- tests/test_sendqueue.c | 2 +- tests/test_session.c | 2 +- tests/test_tls.c | 2 +- tests/test_uri.c | 2 +- tests/test_wellknown.c | 4 +- tests/testdriver.c | 4 +- 68 files changed, 149 insertions(+), 146 deletions(-) rename include/coap2/coap_config.h.in => cmake_coap_config.h.in (98%) diff --git a/.gitignore b/.gitignore index 19646b3d..a57a8747 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ aclocal.m4 ar-lib autom4te.cache/ coap_config.h -/coap_config.h.in +coap_config.h.in compile config.* configure diff --git a/CMakeLists.txt b/CMakeLists.txt index 97cf43dc..a8ce3628 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,13 +27,13 @@ set(DTLS_BACKEND "default" CACHE STRING - " \ - Name of the dtls backend, only relevant if `ENABLE_DTLS` is ON which is default. \ - Possible values: default, gnutls, openssl, tinydtls and mbedtls. \ - If specified then this library will be searched and if found also used. \ - If not found then the cmake configuration will stop with an error. \ - If not specified, then cmake will try to use the first one found in the following order: \ - gnutls, openssl, tinydtls, mbedtls \ + "\ +Name of the dtls backend, only relevant if `ENABLE_DTLS` is ON which is default. \ +Possible values: default, gnutls, openssl, tinydtls and mbedtls. \ +If specified then this library will be searched and if found also used. \ +If not found then the cmake configuration will stop with an error. \ +If not specified, then cmake will try to use the first one found in the following order: \ +gnutls, openssl, tinydtls, mbedtls \ ") set_property( CACHE DTLS_BACKEND @@ -220,7 +220,8 @@ function(compile_tinydtls) IMPORTED) set_target_properties( tinydtls - PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/include" + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + "${CMAKE_CURRENT_BINARY_DIR}/include" IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${LIBTINYDTLS_PATH}") @@ -266,7 +267,10 @@ if(ENABLE_DTLS) else() # no cryto lib found - message(FATAL_ERROR "cannot find any cryto lib, either install one or compile without DTLS support") + message( + FATAL_ERROR + "cannot find any cryto lib, either install one or compile without DTLS support" + ) endif() endif() @@ -377,9 +381,10 @@ 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/coap2/coap.h.in + ${CMAKE_CURRENT_BINARY_DIR}/include/coap2/coap.h) -configure_file(${CMAKE_CURRENT_LIST_DIR}/include/coap2/coap_config.h.in +configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake_coap_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/coap_config.h) # @@ -459,9 +464,7 @@ target_include_directories( PUBLIC # config headers are generated during configuration time $ $ - $ $ - $ $ $<$:${CMAKE_BINARY_DIR}/include/tinydtls> $<$:${GNUTLS_INCLUDE_DIR}> @@ -530,7 +533,8 @@ if(ENABLE_TESTS) ${CMAKE_CURRENT_LIST_DIR}/tests/test_wellknown.c ${CMAKE_CURRENT_LIST_DIR}/tests/test_wellknown.h) # tests require libcunit (e.g. debian libcunit1-dev) - target_link_libraries(testdriver PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME} -lcunit) + target_link_libraries(testdriver PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME} + -lcunit) endif() # @@ -539,17 +543,20 @@ endif() if(ENABLE_EXAMPLES) add_executable(coap-client ${CMAKE_CURRENT_LIST_DIR}/examples/coap-client.c) - target_link_libraries(coap-client PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) + target_link_libraries(coap-client + PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) add_executable(coap-rd ${CMAKE_CURRENT_LIST_DIR}/examples/coap-rd.c) target_link_libraries(coap-rd PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) add_executable(coap-server ${CMAKE_CURRENT_LIST_DIR}/examples/coap-server.c) - target_link_libraries(coap-server PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) + target_link_libraries(coap-server + PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) if(NOT WIN32) add_executable(etsi_iot_01 ${CMAKE_CURRENT_LIST_DIR}/examples/etsi_iot_01.c) - target_link_libraries(etsi_iot_01 PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) + target_link_libraries(etsi_iot_01 + PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) add_executable(tiny ${CMAKE_CURRENT_LIST_DIR}/examples/tiny.c) target_link_libraries(tiny PUBLIC ${PROJECT_NAME}::${COAP_LIBRARY_NAME}) @@ -586,7 +593,9 @@ if(ENABLE_DOCS) message(STATUS "Setup up the Doxygen documention build") else(Doxygen_FOUND) - message(WARNING "Doxygen need to be installed to generate the doxygen documentation") + message( + WARNING + "Doxygen need to be installed to generate the doxygen documentation") endif(Doxygen_FOUND) endif() @@ -616,7 +625,9 @@ configure_package_config_file( ${PROJECT_NAME}Config.cmake INSTALL_DESTINATION ${LIBCOAP_CONFIG_INSTALL_DIR}) -write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake COMPATIBILITY SameMajorVersion) +write_basic_package_version_file( + ${PROJECT_NAME}ConfigVersion.cmake + COMPATIBILITY SameMajorVersion) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake @@ -629,6 +640,8 @@ install( COMPONENT dev FILES_MATCHING PATTERN "*.h" + PATTERN "coap.h" EXCLUDE + PATTERN "utlist.h" EXCLUDE PATTERN "*internal.h" EXCLUDE) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ diff --git a/Makefile.am b/Makefile.am index 887ba1da..3726324c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -55,7 +55,7 @@ EXTRA_DIST = \ win32/testdriver/testdriver.vcxproj.filters \ win32/testdriver/testdriver.vcxproj.user -AM_CFLAGS = -I$(top_builddir)/include/coap$(LIBCOAP_API_VERSION) -I$(top_srcdir)/include/coap$(LIBCOAP_API_VERSION) $(WARNING_CFLAGS) $(DTLS_CFLAGS) -std=c99 $(EXTRA_CFLAGS) +AM_CFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include $(WARNING_CFLAGS) $(DTLS_CFLAGS) -std=c99 $(EXTRA_CFLAGS) SUBDIRS = $(subdirs) . man $(DOC_DIR) tests examples diff --git a/Makefile.libcoap b/Makefile.libcoap index 9275f794..ea868df6 100644 --- a/Makefile.libcoap +++ b/Makefile.libcoap @@ -4,4 +4,4 @@ libcoap_dir := $(filter %libcoap,$(APPDS)) vpath %c $(libcoap_dir)/src # set include path for coap sources -CFLAGS += -I$(libcoap_dir)/include/coap2 +CFLAGS += -I$(libcoap_dir)/include diff --git a/cmake-format.yaml b/cmake-format.yaml index 869c625d..3e255423 100644 --- a/cmake-format.yaml +++ b/cmake-format.yaml @@ -4,7 +4,7 @@ # https://github.com/cheshirekow/cmake_format # How wide to allow formatted cmake files -line_width: 120 +line_width: 80 # How many spaces to tab for indent tab_size: 2 diff --git a/include/coap2/coap_config.h.in b/cmake_coap_config.h.in similarity index 98% rename from include/coap2/coap_config.h.in rename to cmake_coap_config.h.in index 534002e5..40b1330e 100644 --- a/include/coap2/coap_config.h.in +++ b/cmake_coap_config.h.in @@ -1,4 +1,3 @@ -/* coap_config.h. Generated from coap_config.h.in by cmake. */ #ifndef COAP_CONFIG_H_ #define COAP_CONFIG_H_ diff --git a/examples/coap_list.c b/examples/coap_list.c index 70f8bc41..7486fbff 100644 --- a/examples/coap_list.c +++ b/examples/coap_list.c @@ -25,16 +25,10 @@ * of coap-client */ -/* #include "coap_config.h" */ - #include #include -#include -#include -#include -#include "coap_list.h" - +#include int coap_insert(coap_list_t **head, coap_list_t *node) { diff --git a/examples/contiki/coap-observer.c b/examples/contiki/coap-observer.c index 00378bd9..22beab15 100644 --- a/examples/contiki/coap-observer.c +++ b/examples/contiki/coap-observer.c @@ -35,7 +35,7 @@ #include -#include "coap.h" +#include "coap2/coap.h" static coap_context_t *coap_context; diff --git a/examples/contiki/server.c b/examples/contiki/server.c index e980d0ad..307c4318 100644 --- a/examples/contiki/server.c +++ b/examples/contiki/server.c @@ -38,7 +38,7 @@ #include -#include "coap.h" +#include "coap2/coap.h" static coap_context_t *coap_context; diff --git a/examples/etsi_iot_01.c b/examples/etsi_iot_01.c index fc5a6cb4..9df773c6 100644 --- a/examples/etsi_iot_01.c +++ b/examples/etsi_iot_01.c @@ -22,7 +22,6 @@ #include #include -#include "uthash.h" #include #define COAP_RESOURCE_CHECK_TIME_SEC 1 diff --git a/examples/lwip/Makefile b/examples/lwip/Makefile index 79027d5b..6158f82f 100644 --- a/examples/lwip/Makefile +++ b/examples/lwip/Makefile @@ -35,7 +35,7 @@ LWIPOBJS += mld6.o ip6.o icmp6.o ethip6.o nd6.o ip6_addr.o ip6_frag.o CFLAGS += -std=gnu99 -CFLAGS += -I$(top_srcdir)/include/coap2 +CFLAGS += -I$(top_srcdir)/include -I$(top_srcdir)/include/coap2 vpath %.c $(top_srcdir)/src diff --git a/examples/lwip/server-coap.c b/examples/lwip/server-coap.c index fec0936d..ebde3f38 100644 --- a/examples/lwip/server-coap.c +++ b/examples/lwip/server-coap.c @@ -1,5 +1,5 @@ #include "coap_config.h" -#include +#include coap_context_t *main_coap_context; diff --git a/examples/lwip/server-coap.h b/examples/lwip/server-coap.h index e45e263b..3ec726e1 100644 --- a/examples/lwip/server-coap.h +++ b/examples/lwip/server-coap.h @@ -1,5 +1,5 @@ #include "coap_config.h" -#include +#include void server_coap_init(void); /* call this when you think that resources could be dirty */ diff --git a/include/coap2/address.h b/include/coap2/address.h index 857fd8c3..2e706106 100644 --- a/include/coap2/address.h +++ b/include/coap2/address.h @@ -19,7 +19,7 @@ #include #include #include -#include "libcoap.h" +#include "coap2/libcoap.h" #if defined(WITH_LWIP) diff --git a/include/coap2/async.h b/include/coap2/async.h index 6a51245f..4ba9a8f8 100644 --- a/include/coap2/async.h +++ b/include/coap2/async.h @@ -15,7 +15,7 @@ #ifndef COAP_ASYNC_H_ #define COAP_ASYNC_H_ -#include "net.h" +#include "coap2/net.h" #ifndef WITHOUT_ASYNC diff --git a/include/coap2/block.h b/include/coap2/block.h index b905331e..413a3c81 100644 --- a/include/coap2/block.h +++ b/include/coap2/block.h @@ -10,9 +10,9 @@ #ifndef COAP_BLOCK_H_ #define COAP_BLOCK_H_ -#include "encode.h" -#include "option.h" -#include "pdu.h" +#include "coap2/encode.h" +#include "coap2/option.h" +#include "coap2/pdu.h" /** * @defgroup block Block Transfer diff --git a/include/coap2/coap.h.in b/include/coap2/coap.h.in index d8c2e72f..f90dc104 100644 --- a/include/coap2/coap.h.in +++ b/include/coap2/coap.h.in @@ -33,29 +33,29 @@ extern "C" { #endif -#include "libcoap.h" +#include "coap2/libcoap.h" -#include "coap_forward_decls.h" -#include "address.h" -#include "async.h" -#include "bits.h" -#include "block.h" -#include "coap_cache.h" -#include "coap_dtls.h" -#include "coap_event.h" -#include "coap_io.h" -#include "coap_time.h" -#include "coap_debug.h" -#include "encode.h" -#include "mem.h" -#include "net.h" -#include "option.h" -#include "pdu.h" -#include "coap_prng.h" -#include "resource.h" -#include "str.h" -#include "subscribe.h" -#include "uri.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" #ifdef __cplusplus } diff --git a/include/coap2/coap_block_internal.h b/include/coap2/coap_block_internal.h index 1ce36dbc..8ba2d19f 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 +#include "coap2/resource.h" /** * @defgroup block_internal Block (Internal) diff --git a/include/coap2/coap_debug.h b/include/coap2/coap_debug.h index 6bb7a87c..a9cc7292 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 "pdu.h" +#include "coap2/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 a86879b5..a690abd8 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 "coap_time.h" -#include "str.h" +#include "coap2/coap_time.h" +#include "coap2/str.h" /** * @defgroup dtls DTLS Support diff --git a/include/coap2/coap_event.h b/include/coap2/coap_event.h index 60ff991b..34e09635 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 "libcoap.h" +#include "coap2/libcoap.h" /** * @defgroup events Event API diff --git a/include/coap2/coap_hashkey.h b/include/coap2/coap_hashkey.h index 2d568784..129c9da9 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 "libcoap.h" -#include "uthash.h" -#include "str.h" +#include "coap2/libcoap.h" +#include "coap2/uthash.h" +#include "coap2/str.h" typedef unsigned char coap_key_t[4]; diff --git a/include/coap2/coap_internal.h b/include/coap2/coap_internal.h index ea88abf7..e4d7116d 100644 --- a/include/coap2/coap_internal.h +++ b/include/coap2/coap_internal.h @@ -33,25 +33,25 @@ # include #endif -#include "coap.h" +#include "coap2/coap.h" /* * Include all the header files that are for internal use only. */ /* Not defined in coap.h - internal usage .h files */ -#include "utlist.h" -#include "uthash.h" -#include "coap_hashkey.h" -#include "coap_mutex.h" +#include "coap2/utlist.h" +#include "coap2/uthash.h" +#include "coap2/coap_hashkey.h" +#include "coap2/coap_mutex.h" /* Specifically defined internal .h files */ -#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" +#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" #endif /* COAP_INTERNAL_H_ */ diff --git a/include/coap2/coap_io.h b/include/coap2/coap_io.h index b9939eb8..4b355c3b 100644 --- a/include/coap2/coap_io.h +++ b/include/coap2/coap_io.h @@ -12,7 +12,7 @@ #include -#include "address.h" +#include "coap2/address.h" #ifdef RIOT_VERSION #include "net/gnrc.h" diff --git a/include/coap2/coap_session.h b/include/coap2/coap_session.h index 6fc4dffe..8cbf6fd7 100644 --- a/include/coap2/coap_session.h +++ b/include/coap2/coap_session.h @@ -15,12 +15,12 @@ #define COAP_SESSION_H_ -#include "coap_forward_decls.h" -#include "coap_io.h" -#include "coap_time.h" -#include "pdu.h" -#include "uthash.h" -#include "coap_dtls.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" /** * 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 c56d8d7b..7f8549a8 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 "coap_io.h" +#include "coap2/coap_io.h" /** * @defgroup tcp TCP Support (Internal) diff --git a/include/coap2/lwippools.h b/include/coap2/lwippools.h index 2cbcd16d..bb36ede2 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 "coap_internal.h" -#include -#include -#include +#include "coap2/coap_internal.h" +#include +#include +#include #ifndef MEMP_NUM_COAPCONTEXT #define MEMP_NUM_COAPCONTEXT 1 diff --git a/include/coap2/resource.h b/include/coap2/resource.h index 02233ad0..bd639c4e 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 "uthash.h" -#include "async.h" -#include "block.h" -#include "str.h" -#include "pdu.h" -#include "net.h" -#include "subscribe.h" +#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" /** * @defgroup coap_resource Resource Configuraton diff --git a/src/address.c b/src/address.c index 42567d36..42b6004e 100644 --- a/src/address.c +++ b/src/address.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #if !defined(WITH_CONTIKI) && !defined(WITH_LWIP) #ifdef HAVE_ARPA_INET_H diff --git a/src/async.c b/src/async.c index e6f3cfbc..3675bddb 100644 --- a/src/async.c +++ b/src/async.c @@ -11,7 +11,7 @@ * @brief state management for asynchronous messages */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifndef WITHOUT_ASYNC diff --git a/src/block.c b/src/block.c index 51eee989..6ac1ffae 100644 --- a/src/block.c +++ b/src/block.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) diff --git a/src/coap_asn1.c b/src/coap_asn1.c index 1147e8e6..162266a0 100644 --- a/src/coap_asn1.c +++ b/src/coap_asn1.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" size_t asn1_len(const uint8_t **ptr) diff --git a/src/coap_cache.c b/src/coap_cache.c index 6a880832..b85da9df 100644 --- a/src/coap_cache.c +++ b/src/coap_cache.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" /* Determines if the given option_type denotes an option type that can * be used as CacheKey. Options that can be cache keys are not Unsafe diff --git a/src/coap_debug.c b/src/coap_debug.c index 9a34c325..13a21c21 100644 --- a/src/coap_debug.c +++ b/src/coap_debug.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #if defined(HAVE_STRNLEN) && defined(__GNUC__) && !defined(_GNU_SOURCE) #define _GNU_SOURCE 1 diff --git a/src/coap_event.c b/src/coap_event.c index 86f5c9b0..51230a60 100644 --- a/src/coap_event.c +++ b/src/coap_event.c @@ -7,7 +7,7 @@ * of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" /* * This replaces coap_set_event_handler() so that handler registration is diff --git a/src/coap_gnutls.c b/src/coap_gnutls.c index 139169d4..5fc71e2c 100644 --- a/src/coap_gnutls.c +++ b/src/coap_gnutls.c @@ -41,7 +41,7 @@ * 3.6.6 or later is required to support Raw Public Key(RPK) */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifdef HAVE_LIBGNUTLS diff --git a/src/coap_hashkey.c b/src/coap_hashkey.c index a62bfb20..fc1965ae 100644 --- a/src/coap_hashkey.c +++ b/src/coap_hashkey.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" void coap_hash_impl(const unsigned char *s, size_t len, coap_key_t h) { diff --git a/src/coap_io.c b/src/coap_io.c index 6f9205d1..6f7471aa 100644 --- a/src/coap_io.c +++ b/src/coap_io.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifdef HAVE_STDIO_H # include diff --git a/src/coap_io_lwip.c b/src/coap_io_lwip.c index 50250238..372a59eb 100644 --- a/src/coap_io_lwip.c +++ b/src/coap_io_lwip.c @@ -7,7 +7,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #include #if NO_SYS diff --git a/src/coap_io_riot.c b/src/coap_io_riot.c index d641fb91..2d779079 100644 --- a/src/coap_io_riot.c +++ b/src/coap_io_riot.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifdef HAVE_STDIO_H # include diff --git a/src/coap_mbedtls.c b/src/coap_mbedtls.c index d4edca12..df031161 100644 --- a/src/coap_mbedtls.c +++ b/src/coap_mbedtls.c @@ -18,7 +18,7 @@ * m_env A coap_mbedtls_env_t * (held in c_session->tls) */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifdef HAVE_MBEDTLS diff --git a/src/coap_notls.c b/src/coap_notls.c index 0d07a716..dcdc2975 100644 --- a/src/coap_notls.c +++ b/src/coap_notls.c @@ -7,7 +7,7 @@ * of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #if !defined(HAVE_LIBTINYDTLS) && !defined(HAVE_OPENSSL) && !defined(HAVE_LIBGNUTLS) && !defined(HAVE_MBEDTLS) diff --git a/src/coap_openssl.c b/src/coap_openssl.c index 371cbd3f..e75598b6 100644 --- a/src/coap_openssl.c +++ b/src/coap_openssl.c @@ -8,7 +8,7 @@ * of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifdef HAVE_OPENSSL diff --git a/src/coap_prng.c b/src/coap_prng.c index 7bbb9bbf..8be0ade1 100644 --- a/src/coap_prng.c +++ b/src/coap_prng.c @@ -7,7 +7,7 @@ * for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifdef HAVE_GETRANDOM #include diff --git a/src/coap_session.c b/src/coap_session.c index ad5d11d5..fd784fe5 100644 --- a/src/coap_session.c +++ b/src/coap_session.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifndef COAP_SESSION_C_ #define COAP_SESSION_C_ diff --git a/src/coap_tcp.c b/src/coap_tcp.c index ba46b4be..db9faf45 100644 --- a/src/coap_tcp.c +++ b/src/coap_tcp.c @@ -7,7 +7,7 @@ * of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #include #include diff --git a/src/coap_time.c b/src/coap_time.c index 1af76e06..49d561ef 100644 --- a/src/coap_time.c +++ b/src/coap_time.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifdef HAVE_TIME_H #include diff --git a/src/coap_tinydtls.c b/src/coap_tinydtls.c index fce43de2..3ec109e3 100644 --- a/src/coap_tinydtls.c +++ b/src/coap_tinydtls.c @@ -8,7 +8,7 @@ * of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #ifdef HAVE_LIBTINYDTLS diff --git a/src/encode.c b/src/encode.c index 759978da..9f375c30 100644 --- a/src/encode.c +++ b/src/encode.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" /* Carsten suggested this when fls() is not available: */ #ifndef HAVE_FLS diff --git a/src/mem.c b/src/mem.c index ed23f161..708aef29 100644 --- a/src/mem.c +++ b/src/mem.c @@ -7,7 +7,7 @@ */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #if defined(RIOT_VERSION) && defined(MODULE_MEMARRAY) #include diff --git a/src/net.c b/src/net.c index 6e1fc574..827183c6 100644 --- a/src/net.c +++ b/src/net.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #include #include diff --git a/src/option.c b/src/option.c index 2f1d3bca..594dac14 100644 --- a/src/option.c +++ b/src/option.c @@ -8,7 +8,7 @@ */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #include #include diff --git a/src/pdu.c b/src/pdu.c index 1bfe5805..ea4ed4da 100644 --- a/src/pdu.c +++ b/src/pdu.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #if defined(HAVE_LIMITS_H) #include diff --git a/src/resource.c b/src/resource.c index 02a2581e..c230d60e 100644 --- a/src/resource.c +++ b/src/resource.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #include #include diff --git a/src/str.c b/src/str.c index 8cf4129b..36dbcb0a 100644 --- a/src/str.c +++ b/src/str.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #include diff --git a/src/subscribe.c b/src/subscribe.c index f919d34a..0b554cc3 100644 --- a/src/subscribe.c +++ b/src/subscribe.c @@ -7,7 +7,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" void coap_subscription_init(coap_subscription_t *s) { diff --git a/src/uri.c b/src/uri.c index 60c01d51..119822e0 100644 --- a/src/uri.c +++ b/src/uri.c @@ -6,7 +6,7 @@ * README for terms of use. */ -#include "coap_internal.h" +#include "coap2/coap_internal.h" #if defined(HAVE_LIMITS_H) #include diff --git a/tests/Makefile.am b/tests/Makefile.am index 37ea0c1a..46fef800 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -9,7 +9,7 @@ if HAVE_CUNIT # picking up the default warning CFLAGS -AM_CFLAGS = -I$(top_builddir)/include/coap$(LIBCOAP_API_VERSION) -I$(top_srcdir)/include/coap$(LIBCOAP_API_VERSION) $(WARNING_CFLAGS) $(CUNIT_CFLAGS) $(DTLS_CFLAGS) -std=c99 +AM_CFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include $(WARNING_CFLAGS) $(CUNIT_CFLAGS) $(DTLS_CFLAGS) -std=c99 noinst_PROGRAMS = \ testdriver diff --git a/tests/test_encode.c b/tests/test_encode.c index 8d64bb2c..672a1010 100644 --- a/tests/test_encode.c +++ b/tests/test_encode.c @@ -9,7 +9,7 @@ #include "coap_config.h" #include "test_encode.h" -#include +#include #include #include diff --git a/tests/test_error_response.c b/tests/test_error_response.c index 8901c4ac..7ef4721a 100644 --- a/tests/test_error_response.c +++ b/tests/test_error_response.c @@ -9,7 +9,7 @@ #include "coap_config.h" #include "test_error_response.h" -#include +#include #include #include diff --git a/tests/test_options.c b/tests/test_options.c index 3d086b3f..50b99bb6 100644 --- a/tests/test_options.c +++ b/tests/test_options.c @@ -9,7 +9,7 @@ #include "coap_config.h" #include "test_options.h" -#include +#include #include #include diff --git a/tests/test_pdu.c b/tests/test_pdu.c index cca39edc..099a7bdd 100644 --- a/tests/test_pdu.c +++ b/tests/test_pdu.c @@ -9,7 +9,7 @@ #include "coap_config.h" #include "test_pdu.h" -#include +#include #include #include diff --git a/tests/test_sendqueue.c b/tests/test_sendqueue.c index a50c762f..c536d550 100644 --- a/tests/test_sendqueue.c +++ b/tests/test_sendqueue.c @@ -9,7 +9,7 @@ #include "coap_config.h" #include "test_sendqueue.h" -#include +#include #include diff --git a/tests/test_session.c b/tests/test_session.c index 21b5419c..b1326891 100644 --- a/tests/test_session.c +++ b/tests/test_session.c @@ -9,7 +9,7 @@ #include "coap_config.h" #include "test_session.h" -#include +#include #include diff --git a/tests/test_tls.c b/tests/test_tls.c index 4dacff4f..099e154a 100644 --- a/tests/test_tls.c +++ b/tests/test_tls.c @@ -9,7 +9,7 @@ #include "coap_config.h" #include "test_tls.h" -#include +#include #undef HAVE_DTLS diff --git a/tests/test_uri.c b/tests/test_uri.c index b4fab1c7..5e6b50b6 100644 --- a/tests/test_uri.c +++ b/tests/test_uri.c @@ -9,7 +9,7 @@ #include "coap_config.h" #include "test_uri.h" -#include +#include #include diff --git a/tests/test_wellknown.c b/tests/test_wellknown.c index 1f5c730c..661eb0ac 100644 --- a/tests/test_wellknown.c +++ b/tests/test_wellknown.c @@ -8,9 +8,9 @@ #include "coap_config.h" #include "test_wellknown.h" -#include "coap_internal.h" +#include "coap2/coap_internal.h" -#include +#include #include #ifdef HAVE_NETINET_IN_H diff --git a/tests/testdriver.c b/tests/testdriver.c index 5d4bf4d0..0536abdc 100644 --- a/tests/testdriver.c +++ b/tests/testdriver.c @@ -3,8 +3,6 @@ #include #include -/* #include */ - #include "test_uri.h" #include "test_encode.h" #include "test_options.h" @@ -14,7 +12,7 @@ #include "test_sendqueue.h" #include "test_wellknown.h" #include "test_tls.h" -#include "libcoap.h" +#include "coap2/libcoap.h" #ifdef __GNUC__ #define UNUSED_PARAM __attribute__ ((unused))