瀏覽代碼

cleanup build settings; remove old doxygen documentation

Julius Pfrommer 9 年之前
父節點
當前提交
b210b19ae2
共有 48 個文件被更改,包括 471 次插入4178 次删除
  1. 209 185
      CMakeLists.txt
  2. 3 3
      appveyor.yml
  3. 0 2311
      doc/Doxyfile.in
  4. 0 194
      doc/DoxygenLayout.xml
  5. 47 59
      doc/building.rst
  6. 3 3
      doc/datatypes.rst
  7. 0 110
      doc/mainpage.dox
  8. 0 336
      doc/style/doxygen.css
  9. 0 20
      doc/style/footer.html
  10. 0 19
      doc/style/header.html
  11. 0 4
      doc/style/jquery-1.11.1.min.js
  12. 0 58
      doc/style/load-style.js
  13. 20 16
      examples/CMakeLists.txt
  14. 4 4
      examples/client.c
  15. 0 696
      examples/client_legacy.c
  16. 3 3
      examples/networklayer_tcp.c
  17. 1 1
      examples/networklayer_udp.c
  18. 8 8
      examples/server.c
  19. 1 1
      include/ua_client.h
  20. 1 1
      include/ua_client_highlevel.h
  21. 11 5
      include/ua_config.h.in
  22. 1 1
      include/ua_server.h
  23. 34 24
      include/ua_types.h
  24. 2 2
      src/client/ua_client.c
  25. 2 2
      src/client/ua_client_internal.h
  26. 3 3
      src/server/ua_nodes.c
  27. 1 1
      src/server/ua_nodes.h
  28. 1 1
      src/server/ua_nodestore.h
  29. 3 3
      src/server/ua_securechannel_manager.c
  30. 13 13
      src/server/ua_server.c
  31. 7 7
      src/server/ua_server_binary.c
  32. 4 4
      src/server/ua_server_internal.h
  33. 12 12
      src/server/ua_server_worker.c
  34. 3 3
      src/server/ua_services.h
  35. 6 6
      src/server/ua_services_attribute.c
  36. 5 5
      src/server/ua_services_nodemanagement.c
  37. 7 7
      src/server/ua_services_view.c
  38. 2 2
      src/ua_connection.c
  39. 2 2
      src/ua_securechannel.c
  40. 2 2
      src/ua_session.c
  41. 2 2
      src/ua_session.h
  42. 2 2
      src/ua_util.h
  43. 3 3
      tests/CMakeLists.txt
  44. 19 19
      tests/check_nodestore.c
  45. 4 4
      tests/check_services_attributes.c
  46. 1 1
      tests/check_services_nodemanagement.c
  47. 16 7
      tools/travis_linux_script.sh
  48. 3 3
      tools/travis_osx_script.sh

+ 209 - 185
CMakeLists.txt

@@ -1,50 +1,63 @@
 cmake_minimum_required(VERSION 2.8.11)
-# set(CMAKE_VERBOSE_MAKEFILE ON)
-
 project(open62541 C)
+# set(CMAKE_VERBOSE_MAKEFILE ON)
 
-FIND_PACKAGE(PythonInterp REQUIRED)
+######################
+# Check Dependencies #
+######################
 
-# Find Python-lxml
-execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+# Find Python and Python-lxml
+find_package(PythonInterp REQUIRED)
+execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
+                OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
+                OUTPUT_STRIP_TRAILING_WHITESPACE)
 if(NOT EXISTS "${PYTHON_SITE_PACKAGES}/lxml")
-    execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))"
+                  OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
+                  OUTPUT_STRIP_TRAILING_WHITESPACE)
     if(NOT EXISTS "${PYTHON_SITE_PACKAGES}/lxml")
-        message( FATAL_ERROR "Python-lxml is not installed.")
+        message(FATAL_ERROR "Python-lxml is not installed.")
     endif()
 endif()
 
+# Check for git
 find_package(Git)
 if(GIT_FOUND)
-    execute_process(COMMAND ${GIT_EXECUTABLE} describe --abbrev=7 --dirty --always --tags RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COM_ID )
-    if( NOT ${res_var} EQUAL 0 )
-        set( GIT_COMMIT_ID "unknown--git-commit-id-unknown")
-        message( STATUS "Git failed (not a repo, or no tags). Build will not contain git revision info." )
+  execute_process(COMMAND ${GIT_EXECUTABLE} describe --abbrev=7 --dirty --always --tags
+                  RESULT_VARIABLE res_var
+                  OUTPUT_VARIABLE GIT_COM_ID )
+    if(NOT ${res_var} EQUAL 0)
+        set(GIT_COMMIT_ID "unknown--git-commit-id-unknown")
+        message(STATUS "Git failed (not a repo, or no tags). Build will not contain git revision info." )
     else()
-        string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COM_ID} )
+        string(REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COM_ID} )
     endif()
 else()
-    set( GIT_COMMIT_ID "unknown--no-git-found")
-    message( STATUS "Git not found. Build will not contain git revision info." )
+    set(GIT_COMMIT_ID "unknown--no-git-found")
+    message(STATUS "Git not found. Build will not contain git revision info." )
 endif()
 add_definitions("-DVERSION=${GIT_COMMIT_ID}")
 
-MESSAGE (STATUS "Git version: "  ${GIT_COMMIT_ID})
+message(STATUS "Git version: "  ${GIT_COMMIT_ID})
 
 set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
 
+####################################
+# Build Type and Compiler Settings #
+####################################
+
 # Set default build type.
 if(NOT CMAKE_BUILD_TYPE)
-    message(STATUS "CMAKE_BUILD_TYPE not given; setting to 'RelWithDebInfo'.")
-    set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build." FORCE)
+    message(STATUS "CMAKE_BUILD_TYPE not given; setting to 'Debug'.")
+    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)
 endif()
 
 # compiler flags
 if(CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang")
     add_definitions(-std=c99 -pipe -Wall -Wextra -Werror -Wformat -Wno-unused-parameter
-                      -Wno-unused-function -Wno-unused-label -Wpointer-arith -Wreturn-type -Wsign-compare -Wmultichar
-                      -Wcast-qual -Wmissing-prototypes -Wstrict-prototypes #-Wshadow #-Wconversion
-                      -Winit-self -Wuninitialized -Wformat-security -Wformat-nonliteral)
+                    -Wno-unused-function -Wno-unused-label -Wpointer-arith -Wreturn-type -Wsign-compare -Wmultichar
+                    -Wcast-qual -Wmissing-prototypes -Wstrict-prototypes #-Wshadow #-Wconversion
+                    -Winit-self -Wuninitialized -Wformat-security -Wformat-nonliteral)
     # binary size reduction settings
     add_definitions(-ffunction-sections -fdata-sections -fno-stack-protector -fno-unwind-tables
                     -fno-asynchronous-unwind-tables -fno-math-errno -fmerge-all-constants -fno-ident)
@@ -76,7 +89,66 @@ elseif(MSVC)
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
 endif()
 
-# build the main library
+############
+# Settings #
+############
+
+# Options
+set(UA_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported")
+option(UA_ENABLE_SUBSCRIPTIONS "Enable compilation of subscription and monitoring support." OFF)
+option(UA_ENABLE_METHODCALLS "Enable CallMethod/MethodCall service set" OFF)
+option(UA_ENABLE_MULTITHREADING "Enable multithreading" OFF)
+option(UA_ENABLE_NODEMANAGEMENT "Enable dynamic addition and removal of nodes" ON)
+option(UA_ENABLE_AMALGAMATION "Concatenate the library to a single file open62541.h/.c" OFF)
+option(UA_ENABLE_COVERAGE "Enable gcov coverage" OFF)
+if(UA_ENABLE_COVERAGE)
+  set(CMAKE_BUILD_TYPE DEBUG)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+endif()
+
+# Advanced options
+option(UA_ENABLE_TYPENAMES "Add the type and member names to the UA_DataType structure" OFF)
+mark_as_advanced(UA_ENABLE_TYPENAMES)
+
+option(UA_ENABLE_GENERATE_NAMESPACE0 "Generate and load UA XML Namespace 0 definition" OFF)
+mark_as_advanced(UA_ENABLE_GENERATE_NAMESPACE0)
+
+option(UA_ENABLE_EMBEDDED_LIBC "Target has no libc, use internal definitions" OFF)
+mark_as_advanced(UA_ENABLE_EMBEDDED_LIBC)
+
+option(UA_ENABLE_EXTERNAL_NAMESPACES "Enable namespace handling by an external component (experimental)" OFF)
+mark_as_advanced(UA_ENABLE_EXTERNAL_NAMESPACES)
+
+option(UA_ENABLE_NONSTANDARD_STATELESS "Enable stateless extension" OFF)
+mark_as_advanced(UA_ENABLE_NONSTANDARD_STATELESS)
+
+option(UA_ENABLE_NONSTANDARD_UDP "Enable udp extension" OFF)
+mark_as_advanced(UA_ENABLE_NONSTANDARD_UDP)
+if(UA_ENABLE_NONSTANDARD_UDP)
+  set(UA_ENABLE_NONSTANDARD_STATELESS ON)
+endif()
+
+# Build Targets
+option(UA_BUILD_EXAMPLESERVER "Build the example server" OFF)
+option(UA_BUILD_EXAMPLECLIENT "Build a test client" OFF)
+option(UA_BUILD_UNIT_TESTS "Run unit tests after building" OFF)
+option(UA_BUILD_EXAMPLES "Build example servers and clients" OFF)
+option(UA_BUILD_DOCUMENTATION "Generate doxygen/sphinx documentation" OFF)
+
+# Advanced Build Targets
+option(UA_BUILD_SELFSIGNED_CERTIFICATE "Generate self-signed certificate" OFF)
+mark_as_advanced(UA_BUILD_SELFSIGNED_CERTIFICATE)
+
+#########################
+# Generate Main Library #
+#########################
+
+file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated")
+include_directories(${PROJECT_BINARY_DIR}/src_generated) #needed to locate an include of examples/server_nodeset.c
+configure_file("include/ua_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/ua_config.h")
+
 set(exported_headers ${PROJECT_BINARY_DIR}/src_generated/ua_config.h
                      ${PROJECT_SOURCE_DIR}/include/ua_statuscodes.h
                      ${PROJECT_SOURCE_DIR}/include/ua_types.h
@@ -133,76 +205,98 @@ set(lib_sources ${PROJECT_SOURCE_DIR}/src/ua_types.c
                 ${PROJECT_SOURCE_DIR}/deps/pcg_basic.c)
                 ##TODO: make client stuff optional
 
-## generate code from xml definitions
-file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated")
+if(UA_ENABLE_METHODCALLS)
+  list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_services_call.c)
+endif()
 
-option(ENABLE_TYPEINTROSPECTION "Add the type and member names to the internal structures" OFF)
-mark_as_advanced(ENABLE_TYPEINTROSPECTION)
-if(ENABLE_TYPEINTROSPECTION)
-  set(generate_typeintrospection "--typeintrospection")
+if(UA_ENABLE_EMBEDDED_LIBC)
+  list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/deps/libc_string.c)
+endif()
+
+if(UA_ENABLE_MULTITHREADING)
+  find_package(Threads REQUIRED)
+  list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_concurrent.c)
 else()
-  set(generate_typeintrospection "")
+  list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore.c)
 endif()
 
-option(UA_EMBEDDED_LIBC "Target has no libc, use internal definitions" OFF)
-if(UA_EMBEDDED_LIBC)
-  list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/deps/libc_string.c)
+set(generate_typeintrospection "")
+if(UA_ENABLE_TYPENAMES)
+  set(generate_typeintrospection "--typeintrospection")
 endif()
 
-option(ENABLE_SUBSCRIPTIONS "Enable compilation of subscription and monitoring support." OFF)
-if(ENABLE_SUBSCRIPTIONS)
-  set(ENABLE_SUBSCRIPTIONS ON) #to propagate it to the config file
+set(generate_subscriptiontypes "")
+if(UA_ENABLE_SUBSCRIPTIONS)
   list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_services_subscription.c
                           ${PROJECT_SOURCE_DIR}/src/server/ua_subscription.c
                           ${PROJECT_SOURCE_DIR}/src/server/ua_subscription_manager.c
                           ${PROJECT_SOURCE_DIR}/src/client/ua_client_highlevel_subscriptions.c)
-  ##append subscription headers at before ua_session.
+  #append subscription headers at before ua_session
   list(FIND internal_headers "${PROJECT_SOURCE_DIR}/src/ua_session.h" UaSessionPos)
   list(INSERT internal_headers  ${UaSessionPos} ${PROJECT_SOURCE_DIR}/src/server/ua_subscription.h
                                                 ${PROJECT_SOURCE_DIR}/src/server/ua_subscription_manager.h)
+  set(generate_subscriptiontypes "--enable-subscription-types=1")
+endif()
 
-  add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c
-                            ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h
-                            ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated_encoding_binary.h
-                     PRE_BUILD
-                     COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py --enable-subscription-types=1 ${generate_typeintrospection} --typedescriptions ${PROJECT_SOURCE_DIR}/tools/schema/NodeIds.csv 0 ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd ${PROJECT_BINARY_DIR}/src_generated/ua_types
-                     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_datatypes.py
-                             ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd
-                             ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/NodeIds.csv)
-else()
+if(UA_ENABLE_GENERATE_NAMESPACE0)
+  set(GENERATE_NAMESPACE0_FILE "Opc.Ua.NodeSet2.xml" CACHE STRING "Namespace definition XML file")
+  set_property(CACHE GENERATE_NAMESPACE0_FILE PROPERTY STRINGS Opc.Ua.NodeSet2.xml Opc.Ua.NodeSet2.Minimal.xml)
+  list(APPEND internal_headers ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.h)
+  list(APPEND lib_sources ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.c)
+endif()
+
+#########################
+# Generate source files #
+#########################
+
+# standard data types
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c
                           ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h
                           ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated_encoding_binary.h
                    PRE_BUILD
-                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py ${generate_typeintrospection} --typedescriptions ${PROJECT_SOURCE_DIR}/tools/schema/NodeIds.csv 0 ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd ${PROJECT_BINARY_DIR}/src_generated/ua_types
+                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
+                                                ${generate_subscriptiontypes}
+                                                ${generate_typeintrospection}
+                                                --typedescriptions ${PROJECT_SOURCE_DIR}/tools/schema/NodeIds.csv
+                                                0
+                                                ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd
+                                                ${PROJECT_BINARY_DIR}/src_generated/ua_types
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_datatypes.py
                            ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd
                            ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/NodeIds.csv)
-endif()
 
+# transport data types
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated.c
                           ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated.h
                           ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated_encoding_binary.h
                    PRE_BUILD
-                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py ${generate_typeintrospection} --ns0-types-xml ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd 1 ${PROJECT_SOURCE_DIR}/tools/schema/Custom.Opc.Ua.Transport.bsd ${PROJECT_BINARY_DIR}/src_generated/ua_transport
+                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
+                                                ${generate_typeintrospection}
+                                                --ns0-types-xml ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd
+                                                1
+                                                ${PROJECT_SOURCE_DIR}/tools/schema/Custom.Opc.Ua.Transport.bsd
+                                                ${PROJECT_BINARY_DIR}/src_generated/ua_transport
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_datatypes.py
                            ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/Custom.Opc.Ua.Transport.bsd)
 
+# nodeids
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_nodeids.h
                    PRE_BUILD
-                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_nodeids.py ${PROJECT_SOURCE_DIR}/tools/schema/NodeIds.csv ${PROJECT_BINARY_DIR}/src_generated/ua_nodeids
+                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_nodeids.py
+                                                ${PROJECT_SOURCE_DIR}/tools/schema/NodeIds.csv
+                                                ${PROJECT_BINARY_DIR}/src_generated/ua_nodeids
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_nodeids.py
                            ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/NodeIds.csv)
 
-option(ENABLE_GENERATE_NAMESPACE0 "Generate and load UA XML Namespace 0 definition" OFF)
-if(ENABLE_GENERATE_NAMESPACE0)
-add_definitions(-DENABLE_GENERATE_NAMESPACE0)
-set(GENERATE_NAMESPACE0_FILE "Opc.Ua.NodeSet2.xml" CACHE STRING "Namespace definition XML file")
-set_property(CACHE GENERATE_NAMESPACE0_FILE PROPERTY STRINGS Opc.Ua.NodeSet2.xml Opc.Ua.NodeSet2.Minimal.xml)
+# generated namespace 0
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.c
                           ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.h
                    PRE_BUILD
-                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py -i ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_AssumeExternal.txt -s description -b ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist.txt ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/${GENERATE_NAMESPACE0_FILE} ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated
+                   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
+                                                -i ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_AssumeExternal.txt
+                                                -s description -b ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist.txt
+                                                ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/${GENERATE_NAMESPACE0_FILE}
+                                                ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated
                    DEPENDS ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/${GENERATE_NAMESPACE0_FILE}
                            ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
                            ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/logger.py
@@ -212,81 +306,35 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_g
                            ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_namespace.py
                            ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_node_types.py)
 
-list(APPEND internal_headers ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.h)
-list(APPEND lib_sources ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.c)
-endif()
-
-## logging
-set(UA_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported")
-
-# Enable Methodcall service
-option(ENABLE_METHODCALLS "Enable CallMethod/MethodCall service set" OFF)
-if(ENABLE_METHODCALLS)
-    set(ENABLE_METHODCALLS ON) #to propagate it to the config file
-    list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_services_call.c)
-endif()
-
-## multithreading
-option(ENABLE_MULTITHREADING "Enable multithreading (experimental)" OFF)
-if(ENABLE_MULTITHREADING)
-	set(UA_MULTITHREADING ON) #to propagate it to the config file
-    find_package(Threads REQUIRED)
-    list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_concurrent.c)
-else()
-    list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore.c)
-endif()
-
-option(ENABLE_EXTERNAL_NAMESPACES "Enable namespace handling by an external component (experimental)" OFF)
-if(ENABLE_EXTERNAL_NAMESPACES)
-    add_definitions(-DUA_EXTERNAL_NAMESPACES)
-endif()
-
-## enable dynamic nodeset
-option(ENABLE_NODEMANAGEMENT "Enable dynamic addition and removal of nodes" ON)
-if(ENABLE_NODEMANAGEMENT)
-    add_definitions(-DENABLE_NODEMANAGEMENT)
-endif()
-
-## set the precompiler flags
-configure_file("include/ua_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/ua_config.h")
-
-## extensions
-option(EXTENSION_UDP "Enable udp extension" OFF)
-if(EXTENSION_UDP)
-	add_definitions(-DEXTENSION_STATELESS)
-	message(STATUS "Extensions: enabling udp")
-	add_definitions(-DEXTENSION_UDP)
-	add_executable(exampleServerUDP $<TARGET_OBJECTS:open62541-object> examples/networklayer_udp.c examples/server_udp.c)
-  if(ENABLE_MULTITHREADING)
-  	target_link_libraries(exampleServerUDP urcu-cds urcu urcu-common)
-  endif()
-  if (NOT APPLE)
-      target_link_libraries(exampleServerUDP rt)
-  endif()
-endif()
-
-option(ENABLE_LEGACY "Enable LEGACY code" OFF)
-mark_as_advanced(ENABLE_LEGACY)
-
-option(EXTENSION_STATELESS "Enable stateless extension" OFF)
-if(EXTENSION_STATELESS)
-	message(STATUS "Extensions: enabling stateless")
-	add_definitions(-DEXTENSION_STATELESS)
-endif()
-
-option(ENABLE_AMALGAMATION "Concatenate the library to a single file open62541.h/.c" OFF)
+# single-file release
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.h
-               PRE_BUILD
-               COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${GIT_COMMIT_ID} ${CMAKE_CURRENT_BINARY_DIR}/open62541.h ${exported_headers}
-               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${exported_headers} ${internal_headers})
+                   PRE_BUILD
+                   COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
+                                                ${GIT_COMMIT_ID}
+                                                ${CMAKE_CURRENT_BINARY_DIR}/open62541.h ${exported_headers}
+                   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
+                           ${exported_headers}
+                           ${internal_headers})
 
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.c
-               PRE_BUILD
-               COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${GIT_COMMIT_ID} ${CMAKE_CURRENT_BINARY_DIR}/open62541.c
-                                            ${internal_headers} ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc ${lib_sources}
-               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${internal_headers} ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc ${lib_sources})
-
-if(ENABLE_AMALGAMATION)
+                   PRE_BUILD
+                   COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
+                                                ${GIT_COMMIT_ID}
+                                                ${CMAKE_CURRENT_BINARY_DIR}/open62541.c
+                                                ${internal_headers}
+                                                ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc
+                                                ${lib_sources}
+                   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
+                           ${internal_headers}
+                           ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc
+                           ${lib_sources})
+
+#################
+# Build Targets #
+#################
+
+# build shared library
+if(UA_ENABLE_AMALGAMATION)
     add_custom_target(amalgamation ALL DEPENDS ${PROJECT_BINARY_DIR}/open62541.h ${PROJECT_BINARY_DIR}/open62541.c)
     add_library(open62541-object OBJECT ${PROJECT_BINARY_DIR}/open62541.c ${PROJECT_BINARY_DIR}/open62541.h)
     include_directories(${PROJECT_BINARY_DIR})
@@ -297,40 +345,21 @@ else()
     include_directories(${PROJECT_SOURCE_DIR}/deps)
     include_directories(${PROJECT_SOURCE_DIR}/src)
 endif()
-include_directories(${PROJECT_BINARY_DIR}/src_generated) #needed to locate an include of examples/server_nodeset.c
 target_compile_definitions(open62541-object PRIVATE -DUA_DYNAMIC_LINKING)
-
 add_library(open62541 SHARED $<TARGET_OBJECTS:open62541-object>)
 add_library(open62541-static STATIC $<TARGET_OBJECTS:open62541-object>)
 target_compile_definitions(open62541 PRIVATE -DUA_DYNAMIC_LINKING)
 target_compile_definitions(open62541-static PRIVATE -DUA_DYNAMIC_LINKING)
 if(WIN32)
-    # since networklayer_tcp is linked into the amalgate
-    target_link_libraries(open62541 ws2_32)
-    target_link_libraries(open62541-static ws2_32)
-endif()
-if(ENABLE_MULTITHREADING)
-  target_link_libraries(open62541 urcu-cds urcu urcu-common pthread)
-  target_link_libraries(open62541-static urcu-cds urcu urcu-common pthread)
-endif()
-
-# coverage
-option(ENABLE_COVERAGE "Enable gcov coverage" OFF)
-if(ENABLE_COVERAGE)
-    message(STATUS "Enabling gcov support")
-    set(CMAKE_BUILD_TYPE DEBUG)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
-    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+  target_link_libraries(open62541 ws2_32)
+  target_link_libraries(open62541-static ws2_32)
 endif()
 
-# build example server
-option(BUILD_EXAMPLESERVER "Build the example server" OFF)
-if(BUILD_EXAMPLESERVER)
+if(UA_BUILD_EXAMPLESERVER)
     set(server_source $<TARGET_OBJECTS:open62541-object>)
     add_executable(server_static examples/server.c ${server_source})
     add_executable(server examples/server.c)
-    if(ENABLE_AMALGAMATION)
+    if(UA_ENABLE_AMALGAMATION)
        ADD_DEPENDENCIES(server amalgamation)
     endif()
     target_link_libraries(server open62541)
@@ -341,15 +370,23 @@ if(BUILD_EXAMPLESERVER)
         target_link_libraries(server_static rt)
         target_link_libraries(server rt)
     endif()
-    if(ENABLE_MULTITHREADING)
+    if(UA_ENABLE_MULTITHREADING)
         target_link_libraries(server_static urcu-cds urcu urcu-common pthread)
         target_link_libraries(server urcu-cds urcu urcu-common pthread)
     endif()
+
+    if(UA_ENABLE_NONSTANDARD_UDP)
+      add_executable(exampleServerUDP $<TARGET_OBJECTS:open62541-object> examples/networklayer_udp.c examples/server_udp.c)
+      if(UA_ENABLE_MULTITHREADING)
+  	    target_link_libraries(exampleServerUDP urcu-cds urcu urcu-common)
+      endif()
+      if (NOT APPLE)
+        target_link_libraries(exampleServerUDP rt)
+      endif()
+    endif()
 endif()
 
-## self-signed certificates
-option(GENERATE_SELFSIGNED "Generate self-signed certificates" OFF)
-if(GENERATE_SELFSIGNED)
+if(UA_BUILD_SELFSIGNED_CERTIFICATE)
     message(STATUS "Enabling self-signed certificates")
     find_package(OpenSSL REQUIRED)
     add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/server_cert.der
@@ -360,14 +397,12 @@ if(GENERATE_SELFSIGNED)
     add_custom_target(selfsigned ALL DEPENDS ${PROJECT_BINARY_DIR}/server_cert.der ${PROJECT_BINARY_DIR}/ca.crt)
 endif()
 
-# build example client
-option(BUILD_EXAMPLECLIENT "Build a test client" OFF)
-if(BUILD_EXAMPLECLIENT)
+if(UA_BUILD_EXAMPLECLIENT)
 	add_definitions(-DBENCHMARK)
     set(client_source $<TARGET_OBJECTS:open62541-object>)
 	add_executable(client_static examples/client.c ${client_source})
     add_executable(client examples/client.c)
-	if(ENABLE_AMALGAMATION)
+	if(UA_ENABLE_AMALGAMATION)
 	   ADD_DEPENDENCIES(client amalgamation)
 	endif()
 	target_link_libraries(client open62541)
@@ -378,32 +413,25 @@ if(BUILD_EXAMPLECLIENT)
         target_link_libraries(client_static rt)
         target_link_libraries(client rt)
     endif()
-    if(ENABLE_MULTITHREADING)
+    if(UA_ENABLE_MULTITHREADING)
         target_link_libraries(client_static urcu-cds urcu urcu-common pthread)
         target_link_libraries(client urcu-cds urcu urcu-common pthread)
     endif()
     if(EXTENSION_STATELESS AND NOT ENABLE_AMALGAMATION)
         add_executable(client_stateless examples/client_stateless.c ${client_source})
-        if(ENABLE_MULTITHREADING)
+        if(UA_ENABLE_MULTITHREADING)
             target_link_libraries(client_stateless urcu-cds urcu urcu-common pthread)
         endif()
     endif()
-    if(ENABLE_LEGACY AND NOT ENABLE_AMALGAMATION)
-    	add_executable(client_legacy ${PROJECT_SOURCE_DIR}/examples/client_legacy.c $<TARGET_OBJECTS:open62541-object>)
-		target_link_libraries(client_legacy ${LIBS})
-	endif()
 endif()
 
-# build unit tests
-option(BUILD_UNIT_TESTS "Run unit tests after building" OFF)
-if(BUILD_UNIT_TESTS)
-	add_definitions(-DBUILD_UNIT_TESTS)
+if(UA_BUILD_UNIT_TESTS)
+	add_definitions(-DUA_BUILD_UNIT_TESTS)
     enable_testing()
     add_subdirectory(tests)
 endif()
 
-option(BUILD_EXAMPLES "Build example servers and clients" OFF)
-if(BUILD_EXAMPLES)
+if(UA_BUILD_EXAMPLES)
     #add_subdirectory(examples)
     #FIXME: we had problem with static linking for msvs, here a quick and dirty workaround
     #http://stackoverflow.com/questions/3704374/linking-error-lnk2019-in-msvc-unresolved-symbols-with-imp-prefix-but-shoul
@@ -416,9 +444,9 @@ if(BUILD_EXAMPLES)
 	else()
 		list(APPEND LIBS ws2_32)
 	endif()
-	if(ENABLE_MULTITHREADING)
+	if(UA_ENABLE_MULTITHREADING)
 		list(APPEND LIBS urcu-cds urcu urcu-common)
-	endif(ENABLE_MULTITHREADING)
+	endif(UA_ENABLE_MULTITHREADING)
 	
     add_executable(server_variable ${PROJECT_SOURCE_DIR}/examples/server_variable.c $<TARGET_OBJECTS:open62541-object>)
 	target_link_libraries(server_variable ${LIBS})
@@ -440,7 +468,11 @@ if(BUILD_EXAMPLES)
 
 	add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/nodeset.h ${PROJECT_BINARY_DIR}/src_generated/nodeset.c
 					   PRE_BUILD
-					   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py -i ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml ${PROJECT_BINARY_DIR}/src_generated/nodeset
+					   COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
+                                                    -i ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt
+                                                    ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml
+                                                    ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml
+                                                    ${PROJECT_BINARY_DIR}/src_generated/nodeset
 					   DEPENDS ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
 					           ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/logger.py
 					           ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/open62541_MacroHelper.py
@@ -451,35 +483,27 @@ if(BUILD_EXAMPLES)
 					           ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt
 					           ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml)
 					   
-	add_executable(server_nodeset ${PROJECT_SOURCE_DIR}/examples/server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/nodeset.c $<TARGET_OBJECTS:open62541-object>)
+	add_executable(server_nodeset ${PROJECT_SOURCE_DIR}/examples/server_nodeset.c
+                                  ${PROJECT_BINARY_DIR}/src_generated/nodeset.c
+                                  $<TARGET_OBJECTS:open62541-object>)
 	target_link_libraries(server_nodeset ${LIBS})
 
-	if(ENABLE_METHODCALLS)
+	if(UA_ENABLE_METHODCALLS)
 	  add_executable(server_method ${PROJECT_SOURCE_DIR}/examples/server_method.c $<TARGET_OBJECTS:open62541-object>)
 	  target_link_libraries(server_method ${LIBS})
 	endif()
 endif()
 
-# build documentation
-option(BUILD_DOCUMENTATION "Generate doxygen/sphinx documentation" OFF)
-if(BUILD_DOCUMENTATION)
-    find_package(Doxygen REQUIRED)
+if(UA_BUILD_DOCUMENTATION)
     find_package(Sphinx REQUIRED)
-    configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_BINARY_DIR}/Doxyfile @ONLY)
     configure_file(${PROJECT_SOURCE_DIR}/doc/conf.py ${PROJECT_BINARY_DIR}/conf.py @ONLY)
-    add_custom_target(doxygen
-                      ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
-                      WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
-                      COMMENT "Generating API documentation with Doxygen")
     add_custom_target(latex ${SPHINX_EXECUTABLE}
       -b latex -c "${PROJECT_BINARY_DIR}"
       "${PROJECT_SOURCE_DIR}/doc" "${PROJECT_BINARY_DIR}/doc/sphinx"
-      DEPENDS doxygen
       COMMENT "Building LaTeX sources for documentation with Sphinx")
     add_custom_target(doc ${SPHINX_EXECUTABLE}
       -b html -c "${PROJECT_BINARY_DIR}"
       "${PROJECT_SOURCE_DIR}/doc" "${PROJECT_BINARY_DIR}/doc/sphinx"
       COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/doc/open62541_html.png" "${PROJECT_BINARY_DIR}/doc/sphinx/_static/"
-      DEPENDS doxygen
       COMMENT "Building HTML documentation with Sphinx")
 endif()

+ 3 - 3
appveyor.yml

@@ -7,14 +7,14 @@ build_script:
 - cd c:\projects\open62541
 - md build
 - cd build
-- cmake -DBUILD_EXAMPLESERVER:BOOL=ON -DBUILD_EXAMPLECLIENT:BOOL=ON -DBUILD_EXAMPLES:BOOL=ON -G"Visual Studio 12 2013" ..
+- cmake -DUA_BUILD_EXAMPLESERVER:BOOL=ON -DUA_BUILD_EXAMPLECLIENT:BOOL=ON -DUA_BUILD_EXAMPLES:BOOL=ON -G"Visual Studio 12 2013" ..
 - msbuild open62541.sln
 - echo "Testing amalgamation"
 - cd ..
 - rd /s /q build
 - md build
 - cd build
-- cmake -DBUILD_EXAMPLESERVER:BOOL=ON -DBUILD_EXAMPLECLIENT:BOOL=ON -DBUILD_EXAMPLES:BOOL=ON -DENABLE_AMALGAMATION:BOOL=ON -G"Visual Studio 12 2013" ..
+- cmake -DUA_BUILD_EXAMPLESERVER:BOOL=ON -DUA_BUILD_EXAMPLECLIENT:BOOL=ON -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -G"Visual Studio 12 2013" ..
 - msbuild open62541.sln 
 - cp C:\projects\open62541\build\open62541.c C:\projects\open62541\build\Debug\open62541.c
 - cp C:\projects\open62541\build\open62541.h C:\projects\open62541\build\Debug\open62541.h
@@ -22,7 +22,7 @@ build_script:
 - echo "Win 64 build"
 - md build64
 - cd build64
-- cmake -DBUILD_EXAMPLESERVER:BOOL=ON -DBUILD_EXAMPLECLIENT:BOOL=ON -DBUILD_EXAMPLES:BOOL=ON -DENABLE_AMALGAMATION:BOOL=ON -G"Visual Studio 12 2013 Win64" ..
+- cmake -DUA_BUILD_EXAMPLESERVER:BOOL=ON -DUA_BUILD_EXAMPLECLIENT:BOOL=ON -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -G"Visual Studio 12 2013 Win64" ..
 - msbuild open62541.sln 
 - cp C:\projects\open62541\build64\open62541.c C:\projects\open62541\build64\Debug\open62541.c
 - cp C:\projects\open62541\build64\open62541.h C:\projects\open62541\build64\Debug\open62541.h

文件差異過大導致無法顯示
+ 0 - 2311
doc/Doxyfile.in


+ 0 - 194
doc/DoxygenLayout.xml

@@ -1,194 +0,0 @@
-<doxygenlayout version="1.0">
-  <!-- Generated by doxygen 1.8.6 -->
-  <!-- Navigation index tabs for HTML output -->
-  <navindex>
-    <tab type="mainpage" visible="yes" title=""/>
-    <tab type="pages" visible="yes" title="" intro=""/>
-    <tab type="modules" visible="yes" title="" intro=""/>
-    <tab type="namespaces" visible="no" title="">
-      <tab type="namespacelist" visible="yes" title="" intro=""/>
-      <tab type="namespacemembers" visible="yes" title="" intro=""/>
-    </tab>
-    <tab type="classes" visible="no" title="">
-      <tab type="classlist" visible="yes" title="" intro=""/>
-      <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> 
-      <tab type="hierarchy" visible="yes" title="" intro=""/>
-      <tab type="classmembers" visible="yes" title="" intro=""/>
-    </tab>
-    <tab type="files" visible="yes" title="">
-      <tab type="filelist" visible="yes" title="" intro=""/>
-      <tab type="globals" visible="yes" title="" intro=""/>
-    </tab>
-    <tab type="examples" visible="no" title="" intro=""/>  
-  </navindex>
-
-  <!-- Layout definition for a class page -->
-  <class>
-    <briefdescription visible="yes"/>
-    <includes visible="$SHOW_INCLUDE_FILES"/>
-    <inheritancegraph visible="$CLASS_GRAPH"/>
-    <collaborationgraph visible="$COLLABORATION_GRAPH"/>
-    <memberdecl>
-      <nestedclasses visible="yes" title=""/>
-      <publictypes title=""/>
-      <services title=""/>
-      <interfaces title=""/>
-      <publicslots title=""/>
-      <signals title=""/>
-      <publicmethods title=""/>
-      <publicstaticmethods title=""/>
-      <publicattributes title=""/>
-      <publicstaticattributes title=""/>
-      <protectedtypes title=""/>
-      <protectedslots title=""/>
-      <protectedmethods title=""/>
-      <protectedstaticmethods title=""/>
-      <protectedattributes title=""/>
-      <protectedstaticattributes title=""/>
-      <packagetypes title=""/>
-      <packagemethods title=""/>
-      <packagestaticmethods title=""/>
-      <packageattributes title=""/>
-      <packagestaticattributes title=""/>
-      <properties title=""/>
-      <events title=""/>
-      <privatetypes title=""/>
-      <privateslots title=""/>
-      <privatemethods title=""/>
-      <privatestaticmethods title=""/>
-      <privateattributes title=""/>
-      <privatestaticattributes title=""/>
-      <friends title=""/>
-      <related title="" subtitle=""/>
-      <membergroups visible="yes"/>
-    </memberdecl>
-    <detaileddescription title=""/>
-    <memberdef>
-      <inlineclasses title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <services title=""/>
-      <interfaces title=""/>
-      <constructors title=""/>
-      <functions title=""/>
-      <related title=""/>
-      <variables title=""/>
-      <properties title=""/>
-      <events title=""/>
-    </memberdef>
-    <allmemberslink visible="yes"/>
-    <usedfiles visible="$SHOW_USED_FILES"/>
-    <authorsection visible="yes"/>
-  </class>
-
-  <!-- Layout definition for a namespace page -->
-  <namespace>
-    <briefdescription visible="yes"/>
-    <memberdecl>
-      <nestednamespaces visible="yes" title=""/>
-      <constantgroups visible="yes" title=""/>
-      <classes visible="yes" title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <functions title=""/>
-      <variables title=""/>
-      <membergroups visible="yes"/>
-    </memberdecl>
-    <detaileddescription title=""/>
-    <memberdef>
-      <inlineclasses title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <functions title=""/>
-      <variables title=""/>
-    </memberdef>
-    <authorsection visible="yes"/>
-  </namespace>
-
-  <!-- Layout definition for a file page -->
-  <file>
-    <briefdescription visible="yes"/>
-    <includes visible="$SHOW_INCLUDE_FILES"/>
-    <includegraph visible="$INCLUDE_GRAPH"/>
-    <includedbygraph visible="$INCLUDED_BY_GRAPH"/>
-    <sourcelink visible="yes"/>
-    <memberdecl>
-      <classes visible="yes" title=""/>
-      <namespaces visible="yes" title=""/>
-      <constantgroups visible="yes" title=""/>
-      <defines title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <functions title=""/>
-      <variables title=""/>
-      <membergroups visible="yes"/>
-    </memberdecl>
-    <detaileddescription title=""/>
-    <memberdef>
-      <inlineclasses title=""/>
-      <defines title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <functions title=""/>
-      <variables title=""/>
-    </memberdef>
-    <authorsection/>
-  </file>
-
-  <!-- Layout definition for a group page -->
-  <group>
-    <briefdescription visible="no"/>
-    <groupgraph visible="$GROUP_GRAPHS"/>
-    <detaileddescription title=""/>
-    <memberdecl>
-      <nestedgroups visible="yes" title=""/>
-      <dirs visible="yes" title=""/>
-      <files visible="yes" title=""/>
-      <namespaces visible="yes" title=""/>
-      <classes visible="yes" title=""/>
-      <defines title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <enumvalues title=""/>
-      <functions title=""/>
-      <variables title=""/>
-      <signals title=""/>
-      <publicslots title=""/>
-      <protectedslots title=""/>
-      <privateslots title=""/>
-      <events title=""/>
-      <properties title=""/>
-      <friends title=""/>
-      <membergroups visible="yes"/>
-    </memberdecl>
-    <memberdef>
-      <pagedocs/>
-      <inlineclasses title=""/>
-      <defines title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <enumvalues title=""/>
-      <functions title=""/>
-      <variables title=""/>
-      <signals title=""/>
-      <publicslots title=""/>
-      <protectedslots title=""/>
-      <privateslots title=""/>
-      <events title=""/>
-      <properties title=""/>
-      <friends title=""/>
-    </memberdef>
-    <authorsection visible="no"/>
-  </group>
-
-  <!-- Layout definition for a directory page -->
-  <directory>
-    <briefdescription visible="yes"/>
-    <directorygraph visible="yes"/>
-    <memberdecl>
-      <dirs visible="yes"/>
-      <files visible="yes"/>
-    </memberdecl>
-    <detaileddescription title=""/>
-  </directory>
-</doxygenlayout>

+ 47 - 59
doc/building.rst

@@ -87,91 +87,79 @@ Follow Ubuntu instructions without the ``apt-get`` commands as these are taken c
 Build Options
 -------------
 
-Generic CMake options
-~~~~~~~~~~~~~~~~~~~~~
-
 **CMAKE_BUILD_TYPE**
   - RelWithDebInfo: -O2 optimization with debug symbols
   - Release: -O2 optimization without debug symbols
   - Debug: -O0 optimization with debug symbols
   - MinSizeRel: -Os optimization without debug symbols
 
-BUILD_* group
+**UA_LOGLEVEL**
+   The level of logging events that are reported
+   - 600: Fatal and all below
+   - 500: Error and all below
+   - 400: Error and all below
+   - 300: Info and all below
+   - 200: Debug and all below
+   - 100: Trace and all below
+
+Further options that are not inherited from the CMake configuration are defined
+in ua_config.h. Usually there is no need to adjust them.
+
+**UA_NON_LITTLEENDIAN_ARCHITECTURE**
+   Big-endian or mixed endian platform
+**UA_MIXED_ENDIAN**
+   Mixed-endian platform (e.g., ARM7TDMI)
+**UA_ALIGNED_MEMORY_ACCESS**
+   Platform with aligned memory access only (some ARM processors, e.g. Cortex M3/M4 ARM7TDMI etc.)
+
+UA_BUILD_* group
 ~~~~~~~~~~~~~
 
 By default only the shared object libopen62541.so or the library open62541.dll
 and open62541.dll.a resp. open62541.lib are build. Additional artifacts can be
 specified by the following options:
 
-**BUILD_DOCUMENTATION**
+**UA_BUILD_DOCUMENTATION**
    Generate documentation with doxygen
-**BUILD_EXAMPLECLIENT**
+**UA_BUILD_EXAMPLECLIENT**
    Compile example clients from client.c. There are a static and a dynamic binary client and client_static, respectively
-**BUILD_EXAMPLESERVER**
+**UA_BUILD_EXAMPLESERVER**
    Compile example server from server.c There are a static and a dynamic binary server and server_static, respectively
-**BUILD_UNIT_TESTS**
+**UA_BUILD_UNIT_TESTS**
    Compile unit tests with Check framework. The tests can be executed with make test
-**BUILD_EXAMPLES**
+**UA_BUILD_EXAMPLES**
    Compile specific examples from https://github.com/acplt/open62541/blob/master/examples/
+**UA_BUILD_SELFIGNED_CERTIFICATE**
+   Generate a self-signed certificate for the server (openSSL required)
 
-ENABLE_* group
+UA_ENABLE_* group
 ~~~~~~~~~~~~~~
 
 This group contains build options related to the supported OPC UA features.
 
-**ENABLE_NODEMANAGEMENT**
-   Node management services (adding and removing nodes and references) in server and client
-**ENABLE_AMALGAMATION**
+**UA_ENABLE_SUBSCRIPTIONS**
+   Enable subscriptions
+**UA_ENABLE_METHODCALLS**
+   Enable method calls in server and client
+**UA_ENABLE_NODEMANAGEMENT**
+   Node management services (adding and removing nodes and references) at runtime in server and client
+**UA_ENABLE_AMALGAMATION**
    Compile a single-file release files open62541.c and open62541.h
-**ENABLE_COVERAGE**
+**UA_ENABLE_MULTITHREADING**
+   Enable multi-threading support (experimental)
+**UA_ENABLE_COVERAGE**
    Measure the coverage of unit tests
-**ENABLE_EXTERNAL_NAMESPACES**
+
+Some options are marked as advanced. The advanced options need to be toggled to
+be visible in the cmake GUIs.
+
+**UA_ENABLE_EXTERNAL_NAMESPACES**
    Enable external namespaces in server
-**ENABLE_GNERATE_NAMESPACE0**
+**UA_ENABLE_GENERATE_NAMESPACE0**
    Enable automatic generation of NS0
-**GENERATE_NAMESPACE0_FILE**
+**UA_ENABLE_GENERATE_NAMESPACE0_FILE**
    File for NS0 generation from namespace0 folder. Default value is Opc.Ua.NodeSet2.xml
-**ENABLE_METHODCALL**
-   Enable method calls in server and client
-**ENABLE_MULTITHREADING**
-   Enable multi-threading support (experimental)
-**ENABLE_SUBSCRIPTIONS**
-   Enable subscriptions
-**GENERATE_SELFSIGNED**
-   Generate a self-signed certificate for the server (openSSL required)
-
-EXTENSION_* group
-~~~~~~~~~~~~~~~~~
-
-Extensions mark experimental extensions that are not compliant with IEC 62541 or
-other OPC UA clients
-
-**EXTENSION_STATELESS**
+**UA_ENABLE_NONSTANDARD_STATELESS**
    Stateless service calls
-**EXTENSION_UDP**
+**UA_ENABLE_NONSTANDARD_UDP**
    UDP network layer
-
-UA_* group
-~~~~~~~~~~
-
-**UA_LOGLEVEL**
-   The level of logging events that are reported
-   - 600: Fatal and all below
-   - 500: Error and all below
-   - 400: Error and all below
-   - 300: Info and all below
-   - 200: Debug and all below
-   - 100: Trace and all below
-
-C precompiler configuration options
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Options that are not inherited from the CMake configuration are defined in
-ua_config.h. Usually there is no need to adjust them.
-
-**UA_NON_LITTLEENDIAN_ARCHITECTURE**
-   Big-endian or mixed endian platform
-**UA_MIXED_ENDIAN**
-   Mixed-endian platform (e.g., ARM7TDMI)
-**UA_ALIGNED_MEMORY_ACCESS**
-   Platform with aligned memory access only (some ARM processors, e.g. Cortex M3/M4 ARM7TDMI etc.)

+ 3 - 3
doc/datatypes.rst

@@ -94,7 +94,7 @@ The following functions and definitions are used with UA_UInt32.
 .. code-block:: c
 
   /* do not use for cryptographic entropy */
-  UA_EXPORT UA_UInt32 UA_UInt32_random(void);
+  UA_UInt32 UA_UInt32_random(void);
 
 UA_Int64
 ^^^^^^^^
@@ -161,9 +161,9 @@ The following functions and definitions are used with UA_DateTime.
       UA_UInt16 year;
   } UA_DateTimeStruct;
 
-  UA_DateTimeStruct UA_EXPORT UA_DateTime_toStruct(UA_DateTime time);
+  UA_DateTimeStruct UA_DateTime_toStruct(UA_DateTime time);
 
-  UA_String UA_EXPORT UA_DateTime_toString(UA_DateTime time);
+  UA_String UA_DateTime_toString(UA_DateTime time);
 
 UA_Guid
 ^^^^^^^

+ 0 - 110
doc/mainpage.dox

@@ -1,110 +0,0 @@
-/**
-\mainpage Open62541 Developer Documentation
-
-<a href="http://en.wikipedia.org/wiki/OPC_Unified_Architecture">OPC UA</a> (short for OPC Unified
-Architecture) is a protocol for industrial communication and has been standardized in the IEC62541.
-At its core, OPC UA defines a set of services to interact with a server-side object-oriented
-information model. Besides the service-calls initiated by the client, push-notification of remote
-events (such as data changes) can be negotiated with the server. The client/server interaction is
-mapped either to a binary encoding and TCP-based transmission or to SOAP-based webservices. As of
-late, OPC UA is marketed as the one standard for non-realtime industrial communication.
-
-We believe that it is best to understand OPC UA <em>from the inside out</em>, building upon conceptually
-simple first principles. After establishing a first understanding, we go on explaining how these
-principles are realized in detail. Examples are given based on the <em>open62541</em> implementation of the
-standard.
-
-<h2>OPC UA, a collection of services</h2>
-
-In OPC UA, all communication is based on service calls, each consisting of a request and a response
-message. Be careful to note the difference between services and methods. Services are pre-defined in
-the standard and cannot be changed. But you can use the <em>Call</em> service to invoke user-defined
-methods on the server.
-
-For completeness, the following tables contain all services defined in the standard. Do not bother
-with their details yet. We will introduce the different services later in the text. In open62541,
-each service is implemented in a single function. See the \ref services section for details.
-
-<b>Establishing communication</b>
-
-<table>
-<tr> <th>Discovery Service Set </th><th>SecureChannel Service Set </th><th>Session Service Set </th></tr>
-<tr> <td>FindServers </td><td>OpenSecureChannel </td><td>CreateSession </td></tr>
-<tr> <td>GetEndpoints </td><td>CloseSecureChannel </td><td>ActivateSession </td></tr>
-<tr> <td>RegisterServer </td><td></td><td>CloseSession </td></tr>
-<tr> <td></td><td></td><td>Cancel </td></tr>
-</table>
-
-<b>Interaction with the information model</b>
-
-<table>
-<tr> <th>NodeManagement Service Set </th><th>View Service Set </th><th>Query Service Set </th><th>Attribute Service Set </th><th>Method Service Set  </th></tr>
-<tr> <td>AddNodes </td><td>Browse </td><td>QueryFirst </td><td>Read </td><td>Call </td></tr>
-<tr> <td>AddReferences </td><td>BrowseNext </td><td>QueryNext </td><td>HistoryRead </td><td></td></tr>
-<tr> <td>DeleteNodes </td><td>TranslateBrowsePathsToNodeIds </td><td></td><td>Write </td><td></td></tr>
-<tr> <td>DeleteReferences </td><td>RegisterNodes </td><td></td><td>HistoryUpdate </td><td></td></tr>
-<tr> <td></td><td>UnregisterNodes </td><td></td><td></td><td></td></tr>
-</table>
-
-<b>Notifications</b>
-
-<table>
-<tr> <th>MonitoredItem Service Set </th><th>Subscription Service Set  </th></tr>
-<tr> <td>CreateMonitoredItems </td><td>CreateSubscription </td></tr>
-<tr> <td>ModifyMonitoredItems </td><td>ModifySubscription </td></tr>
-<tr> <td>SetMonitoringMode </td><td>SetPublishingMode </td></tr>
-<tr> <td>SetTriggering </td><td>Publish </td></tr>
-<tr> <td>DeleteMonitoredItems </td><td>Republish </td></tr>
-<tr> <td></td><td>TransferSubscription </td></tr>
-<tr> <td></td><td>DeleteSubscription </td></tr>
-</table>
-
-<h2>OPC UA, a web of nodes</h2>
-
-The information model in each OPC UA server is a web of interconnected nodes. There are eight
-different types of nodes. Depending on its type, every node contains different attributes. Some
-attributes, such as the <em>NodeId</em> (unique identifier) and the <em>BrowseName</em>, are
-contained in all node types.
-
-<table>
-<tr> <td>ReferenceTypeNode</td> <td>MethodNode</td> </tr>
-<tr> <td>DataTypeNode</td> <td>ObjectTypeNode</td> </tr>
-<tr> <td>VariableTypeNode</td> <td>ObjectNode</td> </tr>
-<tr> <td>VariableNode</td> <td>ViewNode</td> </tr>
-</table>
-                                                                                                            
-Nodes are interconnected by directed reference-triples of the form <dfn>(nodeid, referencetype,
-target-nodeid)</dfn>. Therefore an OPC UA information model is easiest imagined as a <em>web of nodes</em>.
-Reference types can be
-- standard- or user-defined and
-- either non-hierarchical (e.g., indicating the type of a variable-node) or hierarchical (e.g., indicating a parent-child relationship).
-
-<h2>OPC UA, a protocol</h2>
-
-The OPC UA protocol (both binary and XML-based) is based on 25 <em>built-in</em> datatypes. In
-open62541, these are defined in ua_types.h.
-
-<table>
-<tr> <td>Boolean</td> <td>Float</td> <td>StatusCode</td> </tr>
-<tr> <td>SByte</td> <td>Double</td> <td>QualifiedName</td> </tr>
-<tr> <td>Byte</td> <td>String</td> <td>LocalizedText</td> </tr>
-<tr> <td>Int16</td> <td>DateTime</td> <td>ExtensionObject</td> </tr>
-<tr> <td>UInt16</td> <td>Guid</td> <td>DataValue</td> </tr>
-<tr> <td>Int32</td> <td>ByteString</td> <td>Variant</td> </tr>
-<tr> <td>UInt32</td> <td>XmlElement</td> <td>DiagnosticInfo</td> </tr>
-<tr> <td>Int64</td> <td>NodeId</td> <td> </td> </tr>
-<tr> <td>UInt64</td> <td>ExpandedNodeId</td> <td> </td> </tr>
-</table>
-
-The builtin datatypes are combined into more complex structures. When the structure contains an array,
-then the size of the array is stored in an Int32 value just before the array itself. A size of -1
-indicates an undefined array. Positive sizes (and zero) have the usual semantics.
-
-Most importantly, every service has a request and a response message defined as such a data
-structure. The entire OPC UA protocol revolves around the exchange of these request and response
-messages. Their exact definitions can be looked up here:
-https://opcfoundation.org/UA/schemas/Opc.Ua.Types.bsd.xml. In open62541, we autogenerate the
-C-structs to handle the standard-defined structures automatically. See ua_types_generated.h for
-comparison.
-
-*/

文件差異過大導致無法顯示
+ 0 - 336
doc/style/doxygen.css


+ 0 - 20
doc/style/footer.html

@@ -1,20 +0,0 @@
-<!-- start footer part -->
-<!--BEGIN GENERATE_TREEVIEW-->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    $navpath
-    <li class="footer">$generatedby
-    <a href="http://www.doxygen.org/index.html">
-    <img class="footer" src="doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
-  </ul>
-</div>
-<!--END GENERATE_TREEVIEW-->
-<!--BEGIN !GENERATE_TREEVIEW-->
-<address class="footer"><small>
-$generatedby &#160;<a href="http://www.doxygen.org/index.html">
-<img class="footer" src="doxygen.png" alt="doxygen"/>
-</a> $doxygenversion
-</small></address>
-<!--END !GENERATE_TREEVIEW-->
-</body>
-</html>

+ 0 - 19
doc/style/header.html

@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen $doxygenversion"/>
-<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
-<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
-<script type="text/javascript" src="jquery-1.11.1.min.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<script type="text/javascript" src="load-style.js"></script>
-$treeview
-$search
-$mathjax
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-

文件差異過大導致無法顯示
+ 0 - 4
doc/style/jquery-1.11.1.min.js


+ 0 - 58
doc/style/load-style.js

@@ -1,58 +0,0 @@
-$( document ).ready(function() {
-
-	$('#top > div > ul > li > a').wrapInner("<b></b>");
-
-	$("div.header").prepend("<h2></h2>");
-	$("div.header > h2").text($("div.title").text());
-	$("div.headertitle").remove();
-	$("#nav-path").remove();
-	
-	$("body").wrapInner("<div class='container'><div class='row'><div class='col-md-12'></div></div></div>");
-	$("ul.tablist").addClass("nav nav-pills nav-justified");
-	$("ul.tablist").css("margin-top", "0.5em");
-	$("ul.tablist").css("margin-bottom", "0.5em");
-	$("li.current").addClass("active");
-	$(".contents").wrapInner("<div class='panel panel-default' style='margin-top:1em;'><div class='panel-body'></div></div>");
-	$(".contents").find("h2.groupheader:first").remove();
-
-	$("iframe").attr("scrolling", "yes");
-	
-	$('img[src="ftv2ns.png"]').replaceWith('<span class="label label-danger">N</span> ');
-	$('img[src="ftv2cl.png"]').replaceWith('<span class="label label-danger">C</span> ');
-
-	// dirty workaround since doxygen 1.7 doesn't set table ids
-	$("table").each(function() {
-		if($(this).find("tbody > tr > td.indexkey").length > 0) {
-			$(this).addClass("table table-striped");
-		}
-	});
-	
-	$("table.params").addClass("table");
-	$("div.ingroups").wrapInner("<small></small>");
-	$("div.levels").css("margin", "0.5em");
-	$("div.levels > span").addClass("btn btn-default btn-xs");
-	$("div.levels > span").css("margin-right", "0.25em");
-	
-	$("table.directory").addClass("table table-striped");
-	$("div.summary > a").addClass("btn btn-default btn-xs");
-	$("table.fieldtable").addClass("table");
-	$(".fragment").addClass("well");
-	$(".memitem").addClass("panel panel-default");
-	$(".memproto").addClass("panel-heading");
-	$(".memdoc").addClass("panel-body");
-	$("span.mlabel").addClass("label label-info");
-	
-	$("table.memberdecls").addClass("table");
-	$("[class^=memitem]").addClass("active");
-	$("td.memSeparator").remove()
-	
-	$("div.ah").addClass("btn btn-default");
-	$("span.mlabels").addClass("pull-right");
-	$("table.mlabels").css("width", "100%")
-	$("td.mlabels-right").addClass("pull-right");
-
-	$("div.ttc").addClass("panel panel-info");
-	$("div.ttname").addClass("panel-heading");
-	$("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body");
-});
-

+ 20 - 16
examples/CMakeLists.txt

@@ -10,9 +10,9 @@ if(NOT WIN32)
 else()
     list(APPEND LIBS ws2_32)
 endif()
-if(ENABLE_MULTITHREADING)
+if(UA_ENABLE_MULTITHREADING)
     list(APPEND LIBS urcu-cds urcu urcu-common)
-endif(ENABLE_MULTITHREADING)
+endif()
 
 # add_executable(server_readspeed server_readspeed.c)
 # target_link_libraries(server_readspeed ${LIBS})
@@ -29,25 +29,29 @@ target_link_libraries(server_firstSteps ${LIBS})
 add_executable(client_firstSteps client_firstSteps.c)
 target_link_libraries(client_firstSteps ${LIBS})
 
-if(NOT ENABLE_AMALGAMATION)
+if(NOT UA_ENABLE_AMALGAMATION)
 	add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/nodeset.h ${PROJECT_BINARY_DIR}/src_generated/nodeset.c
-		           PRE_BUILD
-		           COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py -i ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml ${PROJECT_BINARY_DIR}/src_generated/nodeset
-		           DEPENDS ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
-		                   ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/logger.py
-		                   ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/open62541_MacroHelper.py
-		                   ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_builtin_types.py
-		                   ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_constants.py
-		                   ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_namespace.py
-		                   ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_node_types.py
-		                   ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt
-		                   ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml)
-		           
+		               PRE_BUILD
+		               COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
+                                                    -i ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt
+                                                    ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/Opc.Ua.NodeSet2.xml
+                                                    ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml
+                                                    ${PROJECT_BINARY_DIR}/src_generated/nodeset
+   		                DEPENDS ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
+		                        ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/logger.py
+		                        ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/open62541_MacroHelper.py
+		                        ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_builtin_types.py
+		                        ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_constants.py
+		                        ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_namespace.py
+		                        ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_node_types.py
+		                        ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist_FullNS0.txt
+		                        ${PROJECT_SOURCE_DIR}/examples/server_nodeset.xml)
+		                      
 	add_executable(server_nodeset server_nodeset.c ${PROJECT_BINARY_DIR}/src_generated/nodeset.c)
 	target_link_libraries(server_nodeset ${LIBS})
 endif()
 
-if(ENABLE_METHODCALLS)
+if(UA_ENABLE_METHODCALLS)
   add_executable(server_method server_method.c)
   target_link_libraries(server_method ${LIBS})
 endif()

+ 4 - 4
examples/client.c

@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
     UA_BrowseRequest_deleteMembers(&bReq);
     UA_BrowseResponse_deleteMembers(&bResp);
     
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
     // Create a subscription with interval 0 (immediate)...
     UA_UInt32 subId;
     UA_Client_Subscriptions_new(client, UA_SubscriptionSettings_standard, &subId);
@@ -125,7 +125,7 @@ int main(int argc, char *argv[]) {
     UA_WriteRequest_deleteMembers(&wReq);
     UA_WriteResponse_deleteMembers(&wResp);
 
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
     // Take another look at the.answer... this should call the handler.
     UA_Client_Subscriptions_manuallySendPublishRequest(client);
     
@@ -134,7 +134,7 @@ int main(int argc, char *argv[]) {
         printf("Subscription removed\n");
 #endif
     
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
     /* Note:  This example requires Namespace 0 Node 11489 (ServerType -> GetMonitoredItems) 
        FIXME: Provide a namespace 0 independant example on the server side
      */
@@ -157,7 +157,7 @@ int main(int argc, char *argv[]) {
 
 #endif
 
-#ifdef ENABLE_NODEMANAGEMENT 
+#ifdef UA_ENABLE_NODEMANAGEMENT 
     /* New ReferenceType */
     UA_NodeId ref_id;
     UA_ReferenceTypeAttributes ref_attr;

+ 0 - 696
examples/client_legacy.c

@@ -1,696 +0,0 @@
-/*
- C ECHO client example using sockets
-
- This is an example client for internal benchmarks. It works, but is not ready
- for serious use. We do not really check any of the returns from the server.
- */
-#include <stdio.h> //printf
-#include <string.h> //strlen
-#include <sys/socket.h> //socket
-#include <arpa/inet.h> //inet_addr
-#include <unistd.h> // for close
-#include <stdlib.h> // pulls in declaration of malloc, free
-
-//this legacy stuff can not be build with amalgamation options, since it need internal APIs
-#include "ua_util.h"
-#include "ua_transport_generated_encoding_binary.h"
-#include "ua_types_generated_encoding_binary.h"
-
-typedef struct ConnectionInfo {
-    UA_Int32 socket;
-    UA_UInt32 channelId;
-    UA_SequenceHeader sequenceHdr;
-    UA_NodeId authenticationToken;
-    UA_UInt32 tokenId;
-    UA_UInt32 reqestHandle;
-} ConnectionInfo;
-
-static UA_Int32 sendHello(UA_Int32 sock, UA_String *endpointURL) {
-
-    UA_TcpMessageHeader messageHeader;
-    messageHeader.messageTypeAndFinal = UA_MESSAGETYPEANDFINAL_HELF;
-
-    UA_TcpHelloMessage hello;
-    UA_String_copy(endpointURL, &hello.endpointUrl);
-    hello.maxChunkCount = 1;
-    hello.maxMessageSize = 16777216;
-    hello.protocolVersion = 0;
-    hello.receiveBufferSize = 65536;
-    hello.sendBufferSize = 65536;
-
-    UA_ByteString message;
-    UA_ByteString_newMembers(&message, 1024);
-
-    size_t offset = 0;
-    UA_TcpMessageHeader_encodeBinary((UA_TcpMessageHeader const*) &messageHeader, &message, &offset);
-    UA_TcpHelloMessage_encodeBinary((UA_TcpHelloMessage const*) &hello, &message, &offset);
-    messageHeader.messageSize = offset;
-
-    offset = 0;
-    UA_TcpMessageHeader_encodeBinary((UA_TcpMessageHeader const*) &messageHeader, &message, &offset);
-    UA_TcpHelloMessage_encodeBinary((UA_TcpHelloMessage const*) &hello, &message, &offset);
-
-    UA_Int32 sendret = send(sock, message.data, offset, 0);
-
-    UA_ByteString_deleteMembers(&message);
-    free(hello.endpointUrl.data);
-    if (sendret < 0)
-        return 1;
-    return 0;
-}
-
-static int sendOpenSecureChannel(UA_Int32 sock) {
-    UA_TcpMessageHeader msghdr;
-    msghdr.messageTypeAndFinal = UA_MESSAGETYPEANDFINAL_OPNF;
-
-    UA_UInt32 secureChannelId = 0;
-    UA_String securityPolicy;
-    securityPolicy = UA_STRING("http://opcfoundation.org/UA/SecurityPolicy#None");
-
-    UA_String senderCert;
-    senderCert.data = NULL;
-    senderCert.length = -1;
-
-    UA_String receiverCertThumb;
-    receiverCertThumb.data = NULL;
-    receiverCertThumb.length = -1;
-
-    UA_UInt32 sequenceNumber = 51;
-
-    UA_UInt32 requestId = 1;
-
-    UA_NodeId type;
-    type.identifier.numeric = 446; // id of opensecurechannelrequest
-    type.identifierType = UA_NODEIDTYPE_NUMERIC;
-    type.namespaceIndex = 0;
-
-    UA_OpenSecureChannelRequest opnSecRq;
-    UA_OpenSecureChannelRequest_init(&opnSecRq);
-    opnSecRq.requestHeader.timestamp = UA_DateTime_now();
-    UA_ByteString_newMembers(&opnSecRq.clientNonce, 1);
-    opnSecRq.clientNonce.data[0] = 0;
-    opnSecRq.clientProtocolVersion = 0;
-    opnSecRq.requestedLifetime = 30000;
-    opnSecRq.securityMode = UA_MESSAGESECURITYMODE_NONE;
-    opnSecRq.requestType = UA_SECURITYTOKENREQUESTTYPE_ISSUE;
-    opnSecRq.requestHeader.authenticationToken.identifier.numeric = 10;
-    opnSecRq.requestHeader.authenticationToken.identifierType = UA_NODEIDTYPE_NUMERIC;
-    opnSecRq.requestHeader.authenticationToken.namespaceIndex = 10;
-
-    msghdr.messageSize = 135; // todo: compute the message size from the actual content
-
-    UA_ByteString message;
-    UA_ByteString_newMembers(&message, 1000);
-    size_t offset = 0;
-    UA_TcpMessageHeader_encodeBinary(&msghdr, &message, &offset);
-    UA_UInt32_encodeBinary(&secureChannelId, &message, &offset);
-    UA_String_encodeBinary(&securityPolicy, &message, &offset);
-    UA_String_encodeBinary(&senderCert, &message, &offset);
-    UA_String_encodeBinary(&receiverCertThumb, &message, &offset);
-    UA_UInt32_encodeBinary(&sequenceNumber, &message, &offset);
-    UA_UInt32_encodeBinary(&requestId, &message, &offset);
-    UA_NodeId_encodeBinary(&type, &message, &offset);
-    UA_OpenSecureChannelRequest_encodeBinary(&opnSecRq, &message, &offset);
-
-    UA_OpenSecureChannelRequest_deleteMembers(&opnSecRq);
-    //UA_String_deleteMembers(&securityPolicy);
-
-    UA_Int32 sendret = send(sock, message.data, offset, 0);
-    UA_ByteString_deleteMembers(&message);
-    if (sendret < 0) {
-        printf("send opensecurechannel failed");
-        return 1;
-    }
-    return 0;
-}
-
-static UA_Int32 sendCreateSession(UA_Int32 sock, UA_UInt32 channelId, UA_UInt32 tokenId, UA_UInt32 sequenceNumber,
-        UA_UInt32 requestId, UA_String *endpointUrl) {
-    UA_ByteString message;
-    UA_ByteString_newMembers(&message, 65536);
-    UA_UInt32 tmpChannelId = channelId;
-    size_t offset = 0;
-
-    UA_TcpMessageHeader msghdr;
-    msghdr.messageTypeAndFinal = UA_MESSAGETYPEANDFINAL_MSGF;
-
-    UA_NodeId type;
-    type.identifier.numeric = 461;
-    type.identifierType = UA_NODEIDTYPE_NUMERIC;
-    type.namespaceIndex = 0;
-
-    UA_CreateSessionRequest rq;
-    UA_CreateSessionRequest_init(&rq);
-    rq.requestHeader.requestHandle = 1;
-    rq.requestHeader.timestamp = UA_DateTime_now();
-    rq.requestHeader.timeoutHint = 10000;
-    rq.requestHeader.authenticationToken.identifier.numeric = 10;
-    rq.requestHeader.authenticationToken.identifierType = UA_NODEIDTYPE_NUMERIC;
-    rq.requestHeader.authenticationToken.namespaceIndex = 10;
-    UA_String_copy(endpointUrl, &rq.endpointUrl);
-    rq.sessionName = UA_STRING("mysession");
-    rq.clientCertificate = UA_STRING("abcd");
-    UA_ByteString_newMembers(&rq.clientNonce, 1);
-    rq.clientNonce.data[0] = 0;
-    rq.requestedSessionTimeout = 1200000;
-    rq.maxResponseMessageSize = UA_INT32_MAX;
-
-    //workaround to get length calculated
-    offset = 0;
-    UA_CreateSessionRequest_encodeBinary(&rq, &message, &offset);
-    UA_TcpMessageHeader_encodeBinary(&msghdr, &message, &offset);
-    UA_NodeId_encodeBinary(&type, &message, &offset);
-    msghdr.messageSize = 16 + offset;
-    offset = 0;
-
-    UA_TcpMessageHeader_encodeBinary(&msghdr, &message, &offset);
-    UA_UInt32_encodeBinary(&tmpChannelId, &message, &offset);
-    UA_UInt32_encodeBinary(&tokenId, &message, &offset);
-    UA_UInt32_encodeBinary(&sequenceNumber, &message, &offset);
-    UA_UInt32_encodeBinary(&requestId, &message, &offset);
-    UA_NodeId_encodeBinary(&type, &message, &offset);
-    UA_CreateSessionRequest_encodeBinary(&rq, &message, &offset);
-
-    UA_Int32 sendret = send(sock, message.data, offset, 0);
-    UA_ByteString_deleteMembers(&message);
-    //fixme: potential leak
-    //UA_CreateSessionRequest_deleteMembers(&rq);
-    if (sendret < 0) {
-        printf("send opensecurechannel failed");
-        return 1;
-    }
-    return 0;
-}
-
-static UA_Int32 closeSession(ConnectionInfo *connectionInfo) {
-    size_t offset = 0;
-
-    UA_ByteString message;
-    UA_ByteString_newMembers(&message, 65536);
-
-    UA_CloseSessionRequest rq;
-    UA_CloseSessionRequest_init(&rq);
-
-    rq.requestHeader.requestHandle = connectionInfo->reqestHandle++;
-    rq.requestHeader.timestamp = UA_DateTime_now();
-    rq.requestHeader.timeoutHint = 10000;
-    rq.requestHeader.authenticationToken = connectionInfo->authenticationToken;
-    rq.deleteSubscriptions = UA_TRUE;
-
-    UA_TcpMessageHeader msghdr;
-    msghdr.messageTypeAndFinal = UA_MESSAGETYPEANDFINAL_MSGF;
-
-    UA_NodeId type;
-    type.identifier.numeric = 473;
-    type.identifierType = UA_NODEIDTYPE_NUMERIC;
-    type.namespaceIndex = 0;
-
-    //workaround to get length calculated
-    offset = 0;
-    UA_CloseSessionRequest_encodeBinary(&rq, &message, &offset);
-    UA_TcpMessageHeader_encodeBinary(&msghdr, &message, &offset);
-    UA_NodeId_encodeBinary(&type, &message, &offset);
-    msghdr.messageSize = 16 + offset;
-    offset = 0;
-
-    UA_TcpMessageHeader_encodeBinary(&msghdr, &message, &offset);
-    UA_UInt32_encodeBinary(&connectionInfo->channelId, &message, &offset);
-    UA_UInt32_encodeBinary(&connectionInfo->tokenId, &message, &offset);
-    connectionInfo->sequenceHdr.sequenceNumber++;
-    UA_UInt32_encodeBinary(&connectionInfo->sequenceHdr.sequenceNumber, &message, &offset);
-    connectionInfo->sequenceHdr.requestId++;
-    UA_UInt32_encodeBinary(&connectionInfo->sequenceHdr.requestId, &message, &offset);
-    UA_NodeId_encodeBinary(&type, &message, &offset);
-    UA_CloseSessionRequest_encodeBinary(&rq, &message, &offset);
-
-    UA_Int32 sendret = send(connectionInfo->socket, message.data, offset, 0);
-    UA_ByteString_deleteMembers(&message);
-    UA_CloseSessionRequest_deleteMembers(&rq);
-    if(sendret < 0) {
-        printf("send closesessionrequest failed");
-        return 1;
-    }
-
-    return 0;
-}
-
-static UA_Int32 closeSecureChannel(ConnectionInfo *connectionInfo) {
-    size_t offset = 0;
-
-    UA_ByteString message;
-    UA_ByteString_newMembers(&message, 65536);
-
-    UA_CloseSecureChannelRequest rq;
-    UA_CloseSecureChannelRequest_init(&rq);
-
-    rq.requestHeader.requestHandle = 1;
-    rq.requestHeader.timestamp = UA_DateTime_now();
-    rq.requestHeader.timeoutHint = 10000;
-    rq.requestHeader.authenticationToken.identifier.numeric = 10;
-    rq.requestHeader.authenticationToken.identifierType = UA_NODEIDTYPE_NUMERIC;
-    rq.requestHeader.authenticationToken.namespaceIndex = 10;
-
-    UA_TcpMessageHeader msghdr;
-    msghdr.messageTypeAndFinal = UA_MESSAGETYPEANDFINAL_CLOF;
-
-    //workaround to get length calculated
-    offset = 0;
-    UA_CloseSecureChannelRequest_encodeBinary(&rq, &message, &offset);
-    UA_TcpMessageHeader_encodeBinary(&msghdr, &message, &offset);
-    msghdr.messageSize = 4 + offset;
-    offset = 0;
-
-    UA_TcpMessageHeader_encodeBinary(&msghdr, &message, &offset);
-    UA_UInt32_encodeBinary(&connectionInfo->channelId, &message, &offset);
-    UA_CloseSecureChannelRequest_encodeBinary(&rq, &message, &offset);
-
-    UA_Int32 sendret = send(connectionInfo->socket, message.data, offset, 0);
-    UA_ByteString_deleteMembers(&message);
-    UA_CloseSecureChannelRequest_deleteMembers(&rq);
-    if(sendret < 0) {
-        printf("send CloseSecureChannelRequest failed");
-        return 1;
-    }
-
-    return 0;
-}
-
-static UA_Int32 sendActivateSession(UA_Int32 sock, UA_UInt32 channelId, UA_UInt32 tokenId, UA_UInt32 sequenceNumber,
-        UA_UInt32 requestId, UA_NodeId authenticationToken) {
-    UA_ByteString *message = UA_ByteString_new();
-    UA_ByteString_newMembers(message, 65536);
-    UA_UInt32 tmpChannelId = channelId;
-    size_t offset = 0;
-
-    UA_TcpMessageHeader msghdr;
-    msghdr.messageTypeAndFinal = UA_MESSAGETYPEANDFINAL_MSGF;
-    msghdr.messageSize = 86;
-
-    UA_NodeId type;
-    type.identifier.numeric = 467;
-    type.identifierType = UA_NODEIDTYPE_NUMERIC;
-    type.namespaceIndex = 0;
-
-    UA_ActivateSessionRequest rq;
-    UA_ActivateSessionRequest_init(&rq);
-    rq.requestHeader.requestHandle = 2;
-    rq.requestHeader.authenticationToken = authenticationToken;
-    rq.requestHeader.timestamp = UA_DateTime_now();
-    rq.requestHeader.timeoutHint = 10000;
-
-    //workaround to get length calculated
-    offset = 0;
-    UA_ActivateSessionRequest_encodeBinary(&rq, message, &offset);
-    UA_TcpMessageHeader_encodeBinary(&msghdr, message, &offset);
-    UA_NodeId_encodeBinary(&type, message, &offset);
-    msghdr.messageSize = 16 + offset;
-    offset = 0;
-
-    UA_TcpMessageHeader_encodeBinary(&msghdr, message, &offset);
-    UA_UInt32_encodeBinary(&tmpChannelId, message, &offset);
-    UA_UInt32_encodeBinary(&tokenId, message, &offset);
-    UA_UInt32_encodeBinary(&sequenceNumber, message, &offset);
-    UA_UInt32_encodeBinary(&requestId, message, &offset);
-    UA_NodeId_encodeBinary(&type, message, &offset);
-    UA_ActivateSessionRequest_encodeBinary(&rq, message, &offset);
-
-    UA_Int32 sendret = send(sock, message->data, offset, 0);
-    UA_ByteString_delete(message);
-
-    if (sendret < 0) {
-        printf("send opensecurechannel failed");
-        return 1;
-    }
-    return 0;
-
-}
-
-static UA_Int64 sendReadRequest(ConnectionInfo *connectionInfo, UA_Int32 nodeIds_size,UA_NodeId* nodeIds){
-    /*UA_Int32 sock, UA_UInt32 channelId, UA_UInt32 tokenId, UA_UInt32 sequenceNumber, UA_UInt32 requestId,
-                         UA_NodeId authenticationToken, UA_Int32 nodeIds_size,UA_NodeId* nodeIds) {
-     */
-    UA_ByteString *message = UA_ByteString_new();
-    UA_ByteString_newMembers(message, 65536);
-    UA_UInt32 tmpChannelId = connectionInfo->channelId;
-    size_t offset = 0;
-
-    UA_TcpMessageHeader msghdr;
-    msghdr.messageTypeAndFinal = UA_MESSAGETYPEANDFINAL_MSGF;
-
-    UA_NodeId type;
-    type.identifier.numeric = 631;
-    type.identifierType = UA_NODEIDTYPE_NUMERIC;
-    type.namespaceIndex = 0;
-
-    UA_ReadRequest rq;
-    UA_ReadRequest_init(&rq);
-    rq.maxAge = 0;
-    rq.nodesToRead = UA_Array_new(&UA_TYPES[UA_TYPES_READVALUEID], nodeIds_size);
-    rq.nodesToReadSize = 1;
-    for(UA_Int32 i=0;i<nodeIds_size;i++) {
-        UA_ReadValueId_init(&(rq.nodesToRead[i]));
-        rq.nodesToRead[i].attributeId = 6; //WriteMask
-        UA_NodeId_init(&(rq.nodesToRead[i].nodeId));
-        rq.nodesToRead[i].nodeId = nodeIds[i];
-        UA_QualifiedName_init(&(rq.nodesToRead[0].dataEncoding));
-    }
-    rq.requestHeader.timeoutHint = 10000;
-    rq.requestHeader.timestamp = UA_DateTime_now();
-    rq.requestHeader.authenticationToken = connectionInfo->authenticationToken;
-    rq.timestampsToReturn = 0x03;
-    rq.requestHeader.requestHandle = connectionInfo->reqestHandle++;
-
-    //workaround to get length calculated
-    offset = 0;
-    UA_ReadRequest_encodeBinary(&rq, message, &offset);
-    UA_TcpMessageHeader_encodeBinary(&msghdr, message, &offset);
-    UA_NodeId_encodeBinary(&type, message, &offset);
-    msghdr.messageSize = 16 + offset;
-    offset = 0;
-
-    UA_TcpMessageHeader_encodeBinary(&msghdr,message,&offset);
-    UA_UInt32_encodeBinary(&tmpChannelId, message, &offset);
-    UA_UInt32_encodeBinary(&connectionInfo->tokenId, message, &offset);
-    connectionInfo->sequenceHdr.sequenceNumber++;
-    UA_UInt32_encodeBinary(&connectionInfo->sequenceHdr.sequenceNumber, message, &offset);
-    connectionInfo->sequenceHdr.requestId++;
-    UA_UInt32_encodeBinary(&connectionInfo->sequenceHdr.requestId, message, &offset);
-    UA_NodeId_encodeBinary(&type,message,&offset);
-    UA_ReadRequest_encodeBinary(&rq, message, &offset);
-
-    UA_DateTime tic = UA_DateTime_now();
-    UA_Int32 sendret = send(connectionInfo->socket, message->data, offset, 0);
-    UA_Array_delete(rq.nodesToRead, &UA_TYPES[UA_TYPES_READVALUEID], nodeIds_size);
-    UA_ByteString_delete(message);
-
-    if (sendret < 0) {
-        printf("send readrequest failed");
-        return 1;
-    }
-    return tic;
-}
-
-static int ua_client_connectUA(char* ipaddress,int port, UA_String *endpointUrl, ConnectionInfo *connectionInfo,
-        UA_Boolean stateless, UA_Boolean udp) {
-    UA_ByteString reply;
-    UA_ByteString_newMembers(&reply, 65536);
-    int sock;
-    struct sockaddr_in server;
-    //Create socket
-    if(udp==UA_TRUE){
-        sock = socket(AF_INET, SOCK_DGRAM, 0);
-    }else{
-        sock = socket(AF_INET, SOCK_STREAM, 0);
-    }
-    if(sock == -1) {
-        printf("Could not create socket");
-        return 1;
-    }
-    server.sin_addr.s_addr = inet_addr(ipaddress);
-    server.sin_family = AF_INET;
-    server.sin_port = htons(port);
-
-    if(connect(sock, (struct sockaddr *) &server, sizeof(server)) < 0) {
-        perror("connect failed. Error");
-        return 1;
-    }
-    connectionInfo->socket = sock;
-
-    if(stateless){
-        UA_NodeId_init(&connectionInfo->authenticationToken);
-        connectionInfo->channelId=0;
-        UA_SequenceHeader_init(&connectionInfo->sequenceHdr);
-        connectionInfo->tokenId=0;
-        connectionInfo->reqestHandle = 1;
-        return 0;
-    }else{
-        sendHello(sock, endpointUrl);
-        recv(sock, reply.data, reply.length, 0);
-        sendOpenSecureChannel(sock);
-        recv(sock, reply.data, reply.length, 0);
-
-        size_t recvOffset = 0;
-        UA_TcpMessageHeader msghdr;
-        UA_TcpMessageHeader_decodeBinary(&reply, &recvOffset, &msghdr);
-
-        UA_AsymmetricAlgorithmSecurityHeader asymHeader;
-        UA_NodeId rspType;
-        UA_OpenSecureChannelResponse openSecChannelRsp;
-        UA_UInt32_decodeBinary(&reply, &recvOffset, &connectionInfo->channelId);
-        UA_AsymmetricAlgorithmSecurityHeader_decodeBinary(&reply,&recvOffset,&asymHeader);
-        UA_AsymmetricAlgorithmSecurityHeader_deleteMembers(&asymHeader);
-        UA_SequenceHeader_decodeBinary(&reply,&recvOffset,&connectionInfo->sequenceHdr);
-        UA_NodeId_decodeBinary(&reply,&recvOffset,&rspType);
-        UA_OpenSecureChannelResponse_decodeBinary(&reply,&recvOffset,&openSecChannelRsp);
-        connectionInfo->tokenId = openSecChannelRsp.securityToken.tokenId;
-
-        sendCreateSession(sock, connectionInfo->channelId, openSecChannelRsp.securityToken.tokenId, 52, 2, endpointUrl);
-        recv(sock, reply.data, reply.length, 0);
-
-        UA_NodeId messageType;
-        recvOffset = 24;
-        UA_NodeId_decodeBinary(&reply,&recvOffset,&messageType);
-        UA_CreateSessionResponse createSessionResponse;
-        UA_CreateSessionResponse_decodeBinary(&reply,&recvOffset,&createSessionResponse);
-        connectionInfo->authenticationToken = createSessionResponse.authenticationToken;
-        sendActivateSession(sock, connectionInfo->channelId, connectionInfo->tokenId, 53, 3,
-                connectionInfo->authenticationToken);
-        recv(sock, reply.data, reply.length, 0);
-
-        connectionInfo->sequenceHdr.requestId = 3;
-        connectionInfo->sequenceHdr.sequenceNumber = 53;
-        connectionInfo->reqestHandle = 3;
-
-        UA_OpenSecureChannelResponse_deleteMembers(&openSecChannelRsp);
-
-        UA_String_deleteMembers(&reply);
-        UA_CreateSessionResponse_deleteMembers(&createSessionResponse);
-        return 0;
-    }
-}
-
-int main(int argc, char *argv[]) {
-    int defaultParams = argc < 8;
-
-    //start parameters
-    if(defaultParams) {
-        printf("1st parameter: number of nodes to read \n");
-        printf("2nd parameter: number of measured read-tries \n");
-        printf("3rd parameter: name of the file to save measurement data \n");
-        printf("4th parameter: 1 = read same node, 0 = read different nodes \n");
-        printf("5th parameter: ip adress \n");
-        printf("6th parameter: port \n");
-        printf("7th parameter: 0=stateful, 1=stateless\n");
-        printf("8th parameter: 0=tcp, 1=udp (only with stateless calls)\n");
-        printf("9th parameter: number of tries to run in (not measured, added to tries)\n");
-        printf("9th parameter: number of tries to run out (not measured, added to tries)\n");
-        printf("\nUsing default parameters. \n");
-    }
-
-    UA_UInt32 nodesToReadSize;
-    UA_UInt32 tries;
-    UA_Boolean alwaysSameNode;
-    UA_ByteString reply;
-    UA_ByteString_newMembers(&reply, 65536);
-    UA_Boolean stateless;
-    UA_Boolean udp;
-    UA_UInt32 runIn;
-    UA_UInt32 runOut;
-
-    if(defaultParams)
-        nodesToReadSize = 1;
-    else
-        nodesToReadSize = atoi(argv[1]);
-
-    if(defaultParams)
-        tries= 1;
-    else
-        tries = (UA_UInt32) atoi(argv[2]);
-
-    if(defaultParams){
-        alwaysSameNode = UA_TRUE;
-    }else{
-        if(atoi(argv[4]) != 0)
-            alwaysSameNode = UA_TRUE;
-        else
-            alwaysSameNode = UA_FALSE;
-    }
-
-    if(defaultParams){
-        stateless = UA_FALSE;
-    }else{
-        if(atoi(argv[7]) != 0)
-            stateless = UA_TRUE;
-        else
-            stateless = UA_FALSE;
-    }
-
-    if(defaultParams){
-        udp = UA_FALSE;
-    }else{
-        if(atoi(argv[8]) != 0)
-            udp = UA_TRUE;
-        else
-            udp = UA_FALSE;
-    }
-
-    if(defaultParams){
-        runIn = 0;
-    }else{
-        runIn = (UA_UInt32) atoi(argv[9]);
-    }
-
-    if(defaultParams){
-        runOut = 0;
-    }else{
-        runOut = (UA_UInt32) atoi(argv[10]);
-    }
-
-
-
-    //Connect to remote server
-    UA_String endpoint;
-    endpoint = UA_STRING("none");
-    ConnectionInfo connectionInfo;
-
-
-    /* REQUEST START*/
-    UA_NodeId *nodesToRead;
-    nodesToRead = UA_Array_new(&UA_TYPES[UA_TYPES_NODEID], 1);
-
-    for(UA_UInt32 i = 0; i<1; i++) {
-        if(alwaysSameNode)
-            nodesToRead[i].identifier.numeric = 2253; //ask always the same node
-        else
-            nodesToRead[i].identifier.numeric = 19000 +i;
-        nodesToRead[i].identifierType = UA_NODEIDTYPE_NUMERIC;
-        nodesToRead[i].namespaceIndex = 0;
-    }
-
-    UA_DateTime tic, toc;
-    UA_Double *timeDiffs;
-    UA_Int32 received = 0;
-    timeDiffs = UA_Array_new(&UA_TYPES[UA_TYPES_DOUBLE], tries);
-    UA_Double sum = 0;
-
-    tic = UA_DateTime_now();
-
-    /**
-	UA_Double duration;
-
-	UA_UInt32 count = 0;
-	UA_Double start = 0, stop = 0;
-
-	UA_UInt32 timeToRun = 30;
-	UA_UInt32 timeToStart = 8;
-	UA_UInt32 timeToStop = 22;
-
-	do{
-		toc = UA_DateTime_now();
-		duration = ((UA_Double)toc-(UA_Double)tic)/(UA_Double)1e4;
-		if(duration>=timeToStart*1000 && duration <= timeToStop*1000){
-			if(start==0.0){
-				start=UA_DateTime_now();
-			}
-		}
-			//if(stateless || (!stateless && i==0)){
-				if(defaultParams){
-					if(ua_client_connectUA("127.0.0.1",atoi("16664"),&endpoint,&connectionInfo,stateless,udp) != 0){
-						return 0;
-					}
-				}else{
-					if(ua_client_connectUA(argv[5],atoi(argv[6]),&endpoint,&connectionInfo,stateless,udp) != 0){
-						return 0;
-					}
-				}
-			//}
-			sendReadRequest(&connectionInfo,1,nodesToRead);
-			received = recv(connectionInfo.socket, reply.data, 2000, 0);
-			if(duration>=timeToStart*1000 && duration <= timeToStop*1000){
-				count++;
-			}
-
-			if(!stateless){
-			closeSession(&connectionInfo);
-			recv(connectionInfo.socket, reply.data, 2000, 0);
-
-			closeSecureChannel(&connectionInfo);
-			}
-			//if(stateless || (!stateless && i==tries-1)){
-				close(connectionInfo.socket);
-			//}
-		if(duration >= timeToStop*1000 && stop==0){
-			stop=UA_DateTime_now();
-			printf("%i messages in %f secs, rate %f m/s\n", count, (stop-start)/(UA_Double)1e7, (UA_Double)count/((stop-start)/(UA_Double)1e7));
-		}
-
-	}while(duration<timeToRun*1000);
-
-	exit(0);
-     **/
-
-    for(UA_UInt32 i = 0; i < tries + runIn + runOut; i++) {
-        if(i >= runIn && i < runIn+tries)
-            tic = UA_DateTime_now();
-        if(defaultParams){
-            if(ua_client_connectUA("127.0.0.1",atoi("16664"),&endpoint,&connectionInfo,stateless,udp) != 0){
-                return 0;
-            }
-        }else{
-            if(ua_client_connectUA(argv[5],atoi(argv[6]),&endpoint,&connectionInfo,stateless,udp) != 0){
-                return 0;
-            }
-        }
-        for(UA_UInt32 i = 0; i < nodesToReadSize; i++) {
-            sendReadRequest(&connectionInfo,1,nodesToRead);
-            received = recv(connectionInfo.socket, reply.data, 2000, 0);
-        }
-
-        if(!stateless){
-            closeSession(&connectionInfo);
-            recv(connectionInfo.socket, reply.data, 2000, 0);
-            closeSecureChannel(&connectionInfo);
-        }
-        close(connectionInfo.socket);
-        if(i >= runIn && i < runIn+tries){
-            toc = UA_DateTime_now() - tic;
-            timeDiffs[i-runIn] = (UA_Double)toc/(UA_Double)1e4;
-            sum = sum + timeDiffs[i-runIn];
-        }
-    }
-
-    /* REQUEST END*/
-
-    UA_Double mean = sum / tries;
-    printf("total time for requests: %16.10f ms \n",sum);
-    printf("mean time for handling request: %16.10f ms \n",mean);
-
-    if(received>0)
-        printf("received: %i\n",received); // dummy
-
-
-    //save to file
-    char data[100];
-    const char flag = 'a';
-    FILE* fHandle = NULL;
-    if (defaultParams) {
-        fHandle =  fopen("client.log", &flag);
-    }else{
-        fHandle =  fopen(argv[3], &flag);
-    }
-    //header
-
-    UA_Int32 bytesToWrite = 0;//sprintf(data, "measurement %s in ms, nodesToRead %d \n", argv[3], 1);
-    //fwrite(data,1,bytesToWrite,fHandle);
-    for(UA_UInt32 i=0;i<tries;i++) {
-        bytesToWrite = sprintf(data,"%16.10f \n",timeDiffs[i]);
-        fwrite(data,1,bytesToWrite,fHandle);
-    }
-    fclose(fHandle);
-
-    UA_String_deleteMembers(&reply);
-    UA_Array_delete(nodesToRead,&UA_TYPES[UA_TYPES_NODEID], 1);
-    UA_free(timeDiffs);
-
-    return 0;
-}

+ 3 - 3
examples/networklayer_tcp.c

@@ -32,7 +32,7 @@
 # define CLOSESOCKET(S) close(S)
 #endif
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 # include <urcu/uatomic.h>
 #endif
 
@@ -234,7 +234,7 @@ static void setFDSet(ServerNetworkLayerTCP *layer) {
 
 /* callback triggered from the server */
 static void ServerNetworkLayerTCP_closeConnection(UA_Connection *connection) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     if(uatomic_xchg(&connection->state, UA_CONNECTION_CLOSED) == UA_CONNECTION_CLOSED)
         return;
 #else
@@ -481,7 +481,7 @@ ClientNetworkLayerReleaseBuffer(UA_Connection *connection, UA_ByteString *buf) {
 
 static void
 ClientNetworkLayerClose(UA_Connection *connection) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     if(uatomic_xchg(&connection->state, UA_CONNECTION_CLOSED) == UA_CONNECTION_CLOSED)
         return;
 #else

+ 1 - 1
examples/networklayer_udp.c

@@ -9,7 +9,7 @@
 #include <stdio.h>
 #include <string.h> // memset
 #include "networklayer_udp.h"
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 # include <urcu/uatomic.h>
 #endif
 

+ 8 - 8
examples/server.c

@@ -27,7 +27,7 @@
 # include <unistd.h> //access
 #endif
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 # ifdef UA_NO_AMALGAMATION
 #  ifndef __USE_XOPEN2K
 #   define __USE_XOPEN2K
@@ -99,7 +99,7 @@ readTemperature(void *handle, const UA_NodeId nodeId, UA_Boolean sourceTimeStamp
 /*************************/
 /* Read-write status led */
 /*************************/
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 pthread_rwlock_t writeLock;
 #endif
 FILE* triggerFile = NULL;
@@ -132,7 +132,7 @@ writeLedStatus(void *handle, const UA_NodeId nodeid,
     if(range)
         return UA_STATUSCODE_BADINDEXRANGEINVALID;
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	pthread_rwlock_wrlock(&writeLock);
 #endif
 	if(data->data)
@@ -148,13 +148,13 @@ writeLedStatus(void *handle, const UA_NodeId nodeid,
 			fprintf(ledFile, "%s", "0");
 		fflush(ledFile);
 	}
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	pthread_rwlock_unlock(&writeLock);
 #endif
 	return UA_STATUSCODE_GOOD;
 }
 
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
 static UA_StatusCode
 getMonitoredItems(void *methodHandle, const UA_NodeId objectId,
                   size_t inputSize, const UA_Variant *input,
@@ -202,7 +202,7 @@ nodeIter(UA_NodeId childId, UA_Boolean isInverse, UA_NodeId referenceTypeId, voi
 
 int main(int argc, char** argv) {
     signal(SIGINT, stopHandler); /* catches ctrl-c */
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     pthread_rwlock_init(&writeLock, 0);
 #endif
 
@@ -374,7 +374,7 @@ int main(int argc, char** argv) {
         UA_Variant_deleteMembers(&attr.value);
     }
 
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
     UA_Argument inputArguments;
     UA_Argument_init(&inputArguments);
     inputArguments.arrayDimensionsSize = 0;
@@ -435,7 +435,7 @@ int main(int argc, char** argv) {
     if(ledFile)
         fclose(ledFile);
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     pthread_rwlock_destroy(&writeLock);
 #endif
 

+ 1 - 1
include/ua_client.h

@@ -298,7 +298,7 @@ UA_Client_Service_call(UA_Client *client, const UA_CallRequest request) {
                         &response, &UA_TYPES[UA_TYPES_CALLRESPONSE]);
     return response; }
 
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
 /* MonitoredItem Service Set */
 
 /**

+ 1 - 1
include/ua_client_highlevel.h

@@ -255,7 +255,7 @@ UA_Client_call(UA_Client *client, const UA_NodeId objectId, const UA_NodeId meth
 /* Subscriptions Handling */
 /**************************/
 
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
 
 typedef struct {
     UA_Double requestedPublishingInterval;

+ 11 - 5
include/ua_config.h.in

@@ -6,11 +6,17 @@
 #endif
 
 #define UA_LOGLEVEL ${UA_LOGLEVEL}
-#cmakedefine UA_MULTITHREADING
-#cmakedefine ENABLE_METHODCALLS
-#cmakedefine ENABLE_SUBSCRIPTIONS
-#cmakedefine ENABLE_TYPEINTROSPECTION
-#cmakedefine UA_EMBEDDED_LIBC
+#cmakedefine UA_ENABLE_MULTITHREADING
+#cmakedefine UA_ENABLE_METHODCALLS
+#cmakedefine UA_ENABLE_SUBSCRIPTIONS
+#cmakedefine UA_ENABLE_TYPENAMES
+#cmakedefine UA_ENABLE_EMBEDDED_LIBC
+#cmakedefine UA_ENABLE_GENERATE_NAMESPACE0
+#cmakedefine UA_ENABLE_EXTERNAL_NAMESPACES
+#cmakedefine UA_ENABLE_NODEMANAGEMENT
+
+#cmakedefine UA_ENABLE_NONSTANDARD_UDP
+#cmakedefine UA_ENABLE_NONSTANDARD_STATELESS
 
 /* Function Export */
 #ifdef _WIN32

+ 1 - 1
include/ua_server.h

@@ -330,7 +330,7 @@ UA_Server_addDataSourceVariableNode(UA_Server *server, const UA_NodeId requested
                                     const UA_VariableAttributes attr, const UA_DataSource dataSource,
                                     UA_NodeId *outNewNodeId);
 
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
 typedef UA_StatusCode (*UA_MethodCallback)(void *methodHandle, const UA_NodeId objectId,
                                            size_t inputSize, const UA_Variant *input,
                                            size_t outputSize, UA_Variant *output);

+ 34 - 24
include/ua_types.h

@@ -157,11 +157,13 @@ UA_Guid UA_EXPORT UA_Guid_random(void);
 /************************************/
 typedef UA_String UA_ByteString;
 
-static UA_INLINE UA_Boolean UA_ByteString_equal(const UA_ByteString *string1, const UA_ByteString *string2) {
+static UA_INLINE UA_Boolean
+UA_ByteString_equal(const UA_ByteString *string1, const UA_ByteString *string2) {
     return UA_String_equal((const UA_String*)string1, (const UA_String*)string2); }
 
 /* Allocates memory of size length for the bytestring. The content is not set to zero. */
-UA_StatusCode UA_EXPORT UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) UA_FUNC_ATTR_WARN_UNUSED_RESULT;
+UA_StatusCode UA_EXPORT
+UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) UA_FUNC_ATTR_WARN_UNUSED_RESULT;
 
 UA_EXPORT extern const UA_ByteString UA_BYTESTRING_NULL;
 
@@ -346,8 +348,8 @@ typedef struct {
 } UA_Variant;
 
 /**
- * Returns true if the variant contains a scalar value. Note that empty variants contain an array of
- * length -1 (undefined).
+ * Returns true if the variant contains a scalar value. Note that empty variants
+ * contain an array of length -1 (undefined).
  *
  * @param v The variant
  * @return Does the variant contain a scalar value.
@@ -356,14 +358,15 @@ static UA_INLINE UA_Boolean UA_Variant_isScalar(const UA_Variant *v) {
     return (v->arrayLength == 0 && v->data > UA_EMPTY_ARRAY_SENTINEL); }
     
 /**
- * Set the variant to a scalar value that already resides in memory. The value takes on the
- * lifecycle of the variant and is deleted with it.
+ * Set the variant to a scalar value that already resides in memory. The value
+ * takes on the lifecycle of the variant and is deleted with it.
  *
  * @param v The variant
  * @param p A pointer to the value data
  * @param type The datatype of the value in question
  */
-void UA_EXPORT UA_Variant_setScalar(UA_Variant *v, void * UA_RESTRICT p, const UA_DataType *type);
+void UA_EXPORT
+UA_Variant_setScalar(UA_Variant *v, void * UA_RESTRICT p, const UA_DataType *type);
 
 /**
  * Set the variant to a scalar value that is copied from an existing variable.
@@ -373,11 +376,12 @@ void UA_EXPORT UA_Variant_setScalar(UA_Variant *v, void * UA_RESTRICT p, const U
  * @param type The datatype of the value
  * @return Indicates whether the operation succeeded or returns an error code
  */
-UA_StatusCode UA_EXPORT UA_Variant_setScalarCopy(UA_Variant *v, const void *p, const UA_DataType *type);
+UA_StatusCode UA_EXPORT
+UA_Variant_setScalarCopy(UA_Variant *v, const void *p, const UA_DataType *type);
 
 /**
- * Set the variant to an array that already resides in memory. The array takes on the lifecycle of
- * the variant and is deleted with it.
+ * Set the variant to an array that already resides in memory. The array takes
+ * on the lifecycle of the variant and is deleted with it.
  *
  * @param v The variant
  * @param array A pointer to the array data
@@ -385,7 +389,8 @@ UA_StatusCode UA_EXPORT UA_Variant_setScalarCopy(UA_Variant *v, const void *p, c
  * @param type The datatype of the array
  */
 void UA_EXPORT
-UA_Variant_setArray(UA_Variant *v, void * UA_RESTRICT array, size_t arraySize, const UA_DataType *type);
+UA_Variant_setArray(UA_Variant *v, void * UA_RESTRICT array,
+                    size_t arraySize, const UA_DataType *type);
 
 /**
  * Set the variant to an array that is copied from an existing array.
@@ -397,7 +402,8 @@ UA_Variant_setArray(UA_Variant *v, void * UA_RESTRICT array, size_t arraySize, c
  * @return Indicates whether the operation succeeded or returns an error code
  */
 UA_StatusCode UA_EXPORT
-UA_Variant_setArrayCopy(UA_Variant *v, const void *array, size_t arraySize, const UA_DataType *type);
+UA_Variant_setArrayCopy(UA_Variant *v, const void *array,
+                        size_t arraySize, const UA_DataType *type);
 
 /* NumericRanges are used to indicate subsets of a (multidimensional) variant
  * array. NumericRange has no official type structure in the standard. On the
@@ -436,7 +442,8 @@ UA_Variant_copyRange(const UA_Variant *src, UA_Variant *dst, const UA_NumericRan
  * @return Returns UA_STATUSCODE_GOOD or an error code
  */
 UA_StatusCode UA_EXPORT
-UA_Variant_setRange(UA_Variant *v, void * UA_RESTRICT array, size_t arraySize, const UA_NumericRange range);
+UA_Variant_setRange(UA_Variant *v, void * UA_RESTRICT array,
+                    size_t arraySize, const UA_NumericRange range);
 
 /**
  * Deep-copy a range of data into an existing variant.
@@ -448,7 +455,8 @@ UA_Variant_setRange(UA_Variant *v, void * UA_RESTRICT array, size_t arraySize, c
  * @return Returns UA_STATUSCODE_GOOD or an error code
  */
 UA_StatusCode UA_EXPORT
-UA_Variant_setRangeCopy(UA_Variant *v, const void *array, size_t arraySize, const UA_NumericRange range);
+UA_Variant_setRangeCopy(UA_Variant *v, const void *array,
+                        size_t arraySize, const UA_NumericRange range);
 
 /**************************************************************************/
 /* DataValue: A data value with an associated status code and timestamps. */
@@ -496,21 +504,23 @@ typedef struct UA_DiagnosticInfo {
 #define UA_MAX_TYPE_MEMBERS 13 // Maximum number of members per structured type
 
 typedef struct {
-#ifdef ENABLE_TYPEINTROSPECTION
+#ifdef UA_ENABLE_TYPENAMES
     const char *memberName;
 #endif
     UA_UInt16   memberTypeIndex;   ///< Index of the member in the datatypetable
-    UA_Byte     padding;           /**< How much padding is there before this member element? For arrays this is
-                                        split into 2 bytes padding before the length index (max 4 bytes) and 3
-                                        bytes padding before the pointer (max 8 bytes) */
-    UA_Boolean  namespaceZero : 1; /**< The type of the member is defined in namespace zero. In this
-                                        implementation, types from custom namespace may contain
-                                        members from the same namespace or ns0 only.*/
+    UA_Byte     padding;           /**< How much padding is there before this member
+                                        element? For arrays this is the padding before the
+                                        size_t lenght member. (No padding between size_t
+                                        and the following ptr.) */
+    UA_Boolean  namespaceZero : 1; /**< The type of the member is defined in namespace
+                                        zero. In this implementation, types from custom
+                                        namespace may contain members from the same
+                                        namespace or ns0 only.*/
     UA_Boolean  isArray       : 1; ///< The member is an array of the given type
 } UA_DataTypeMember;
     
 struct UA_DataType {
-#ifdef ENABLE_TYPEINTROSPECTION
+#ifdef UA_ENABLE_TYPENAMES
     const char *typeName;
 #endif
     UA_NodeId   typeId;           ///< The nodeid of the type
@@ -651,8 +661,8 @@ typedef enum {
 /***************************/
 
 /**
- * If UA_MULTITHREADING is enabled, then the seed is stored in thread local storage. The seed is
- * initialized for every thread in the server/client.
+ * If UA_ENABLE_MULTITHREADING is defined, then the seed is stored in thread local
+ * storage. The seed is initialized for every thread in the server/client.
  */
 UA_EXPORT void UA_random_seed(UA_UInt64 seed);
 

+ 2 - 2
src/client/ua_client.c

@@ -35,7 +35,7 @@ static void UA_Client_init(UA_Client* client, UA_ClientConfig config,
     client->config = config;
     client->scExpiresAt = 0;
 
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
     client->monitoredItemHandles = 0;
     LIST_INIT(&client->pendingNotificationsAcks);
     LIST_INIT(&client->subscriptions);
@@ -58,7 +58,7 @@ static void UA_Client_deleteMembers(UA_Client* client) {
     if(client->endpointUrl.data)
         UA_String_deleteMembers(&client->endpointUrl);
     UA_UserTokenPolicy_deleteMembers(&client->token);
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
     UA_Client_NotificationsAckNumber *n, *tmp;
     LIST_FOREACH_SAFE(n, &client->pendingNotificationsAcks, listEntry, tmp) {
         LIST_REMOVE(n, listEntry);

+ 2 - 2
src/client/ua_client_internal.h

@@ -8,7 +8,7 @@
 /* Subscriptions Handling */
 /**************************/
 
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
 
 typedef struct UA_Client_NotificationsAckNumber_s {
     UA_SubscriptionAcknowledgement subAck;
@@ -67,7 +67,7 @@ struct UA_Client {
     UA_NodeId authenticationToken;
     UA_UInt32 requestHandle;
     
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
     UA_Int32 monitoredItemHandles;
     LIST_HEAD(UA_ListOfUnacknowledgedNotificationNumbers, UA_Client_NotificationsAckNumber_s) pendingNotificationsAcks;
     LIST_HEAD(UA_ListOfClientSubscriptionItems, UA_Client_Subscription_s) subscriptions;

+ 3 - 3
src/server/ua_nodes.c

@@ -328,7 +328,7 @@ UA_MethodNode * UA_MethodNode_new(void) {
 }
 
 void UA_MethodNode_deleteMembers(UA_MethodNode *p) {
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
     p->attachedMethod = NULL;
 #endif
     UA_Node_deleteMembers((UA_Node*)p);
@@ -336,7 +336,7 @@ void UA_MethodNode_deleteMembers(UA_MethodNode *p) {
 
 void UA_MethodNode_delete(UA_MethodNode *p) {
     UA_MethodNode_deleteMembers(p);
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
     p->methodHandle   = NULL;
     p->attachedMethod = NULL;
 #endif
@@ -349,7 +349,7 @@ UA_StatusCode UA_MethodNode_copy(const UA_MethodNode *src, UA_MethodNode *dst) {
         return retval;
     dst->executable = src->executable;
     dst->userExecutable = src->userExecutable;
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
     dst->methodHandle  = src->methodHandle;
     dst->attachedMethod = src->attachedMethod;
 #endif

+ 1 - 1
src/server/ua_nodes.h

@@ -127,7 +127,7 @@ typedef struct {
     UA_STANDARD_NODEMEMBERS
     UA_Boolean executable;
     UA_Boolean userExecutable;
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
     void *methodHandle;
     UA_MethodCallback attachedMethod;
 #endif

+ 1 - 1
src/server/ua_nodestore.h

@@ -26,7 +26,7 @@
  */
 
 /* For multithreading, nodes in the nodestore are immutable */
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 # define UA_MT_CONST const
 #else
 # define UA_MT_CONST

+ 3 - 3
src/server/ua_securechannel_manager.c

@@ -33,7 +33,7 @@ void UA_SecureChannelManager_cleanupTimedOut(UA_SecureChannelManager *cm, UA_Dat
         if(timeout < now || !entry->channel.connection) {
             LIST_REMOVE(entry, pointers);
             UA_SecureChannel_deleteMembersCleanup(&entry->channel);
-#ifndef UA_MULTITHREADING
+#ifndef UA_ENABLE_MULTITHREADING
             cm->currentChannelCount--;
 #else
             cm->currentChannelCount = uatomic_add_return(
@@ -57,7 +57,7 @@ UA_SecureChannelManager_open(UA_SecureChannelManager *cm, UA_Connection *conn,
     channel_list_entry *entry = UA_malloc(sizeof(channel_list_entry));
     if(!entry)
         return UA_STATUSCODE_BADOUTOFMEMORY;
-#ifndef UA_MULTITHREADING
+#ifndef UA_ENABLE_MULTITHREADING
     cm->currentChannelCount++;
 #else
     cm->currentChannelCount = uatomic_add_return(&cm->currentChannelCount, 1);
@@ -141,7 +141,7 @@ UA_StatusCode UA_SecureChannelManager_close(UA_SecureChannelManager *cm, UA_UInt
             LIST_REMOVE(entry, pointers);
             UA_SecureChannel_deleteMembersCleanup(&entry->channel);
             UA_free(entry);
-#ifndef UA_MULTITHREADING
+#ifndef UA_ENABLE_MULTITHREADING
             cm->currentChannelCount--;
 #else
             cm->currentChannelCount = uatomic_add_return(&cm->currentChannelCount, -1);

+ 13 - 13
src/server/ua_server.c

@@ -6,7 +6,7 @@
 #include "ua_services.h"
 #include "ua_nodeids.h"
 
-#ifdef ENABLE_GENERATE_NAMESPACE0
+#ifdef UA_ENABLE_GENERATE_NAMESPACE0
 #include "ua_namespaceinit_generated.h"
 #endif
 
@@ -19,7 +19,7 @@ const UA_EXPORT UA_ServerConfig UA_ServerConfig_standard = {
     .Application_applicationURI = "urn:unconfigured:open62541:open62541Server",
     .Application_applicationName = "open62541" };
 
-#if defined(UA_MULTITHREADING) && !defined(NDEBUG)
+#if defined(UA_ENABLE_MULTITHREADING) && !defined(NDEBUG)
 UA_THREAD_LOCAL bool rcu_locked = UA_FALSE;
 #endif
 
@@ -44,7 +44,7 @@ static const UA_ExpandedNodeId expandedNodeIdBaseDataVariabletype = {
                .identifier.numeric = UA_NS0ID_BASEDATAVARIABLETYPE},
     .namespaceUri = {.length = -1, .data = NULL}, .serverIndex = 0};
 
-#ifndef ENABLE_GENERATE_NAMESPACE0
+#ifndef UA_ENABLE_GENERATE_NAMESPACE0
 static const UA_NodeId nodeIdNonHierarchicalReferences = {
         .namespaceIndex = 0, .identifierType = UA_NODEIDTYPE_NUMERIC,
         .identifier.numeric = UA_NS0ID_NONHIERARCHICALREFERENCES};
@@ -54,7 +54,7 @@ static const UA_NodeId nodeIdNonHierarchicalReferences = {
 /* Namespace Handling */
 /**********************/
 
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
 static void UA_ExternalNamespace_init(UA_ExternalNamespace *ens) {
     ens->index = 0;
     UA_String_init(&ens->url);
@@ -96,7 +96,7 @@ UA_Server_addExternalNamespace(UA_Server *server, UA_UInt16 namespaceIndex,
     server->externalNamespacesSize++;
     return UA_STATUSCODE_GOOD;
 }
-#endif /* UA_EXTERNAL_NAMESPACES*/
+#endif /* UA_ENABLE_EXTERNAL_NAMESPACES*/
 
 UA_UInt16 UA_Server_addNamespace(UA_Server *server, const char* name) {
     server->namespaces = UA_realloc(server->namespaces,
@@ -273,7 +273,7 @@ void UA_Server_delete(UA_Server *server) {
     UA_SecureChannelManager_deleteMembers(&server->secureChannelManager);
     UA_SessionManager_deleteMembers(&server->sessionManager, server);
     UA_NodeStore_delete(server->nodestore);
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
     UA_Server_deleteExternalNamespaces(server);
 #endif
     UA_ByteString_deleteMembers(&server->serverCertificate);
@@ -290,7 +290,7 @@ void UA_Server_delete(UA_Server *server) {
     UA_free(server->networkLayers);
 
     UA_RCU_UNLOCK();
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     /* so the workers don't spin if the queue is empty */
     pthread_cond_destroy(&server->dispatchQueue_condition);
     rcu_barrier(); // wait for all scheduled call_rcu work to complete
@@ -453,7 +453,7 @@ UA_Server * UA_Server_new(UA_ServerConfig config) {
     server->config = config;
 
     LIST_INIT(&server->repeatedJobs);
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     rcu_init();
    	rcu_register_thread();
     cds_wfcq_init(&server->dispatchQueue_head, &server->dispatchQueue_tail);
@@ -584,7 +584,7 @@ UA_Server * UA_Server_new(UA_ServerConfig config) {
     /**************/
     /* References */
     /**************/
-#ifndef ENABLE_GENERATE_NAMESPACE0
+#ifndef UA_ENABLE_GENERATE_NAMESPACE0
     /* Bootstrap by manually inserting "references" and "hassubtype" */
     UA_ReferenceTypeNode *references = UA_ReferenceTypeNode_new();
     copyNames((UA_Node*)references, "References");
@@ -916,7 +916,7 @@ UA_Server * UA_Server_new(UA_ServerConfig config) {
                                 UA_NS0ID_BASEVARIABLETYPE, UA_FALSE);
 #endif
 
-#ifdef ENABLE_GENERATE_NAMESPACE0
+#ifdef UA_ENABLE_GENERATE_NAMESPACE0
     //load the generated namespace
     ua_namespaceinit_generated(server);
 #endif
@@ -1000,13 +1000,13 @@ UA_Server * UA_Server_new(UA_ServerConfig config) {
     UA_UInt16 profileArraySize = 0;
     ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/NanoEmbeddedDevice");
 
-#ifdef ENABLE_SERVICESET_NODEMANAGEMENT
+#ifdef UA_ENABLE_SERVICESET_NODEMANAGEMENT
     ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/NodeManagement");
 #endif
-#ifdef ENABLE_SERVICESET_METHOD
+#ifdef UA_ENABLE_SERVICESET_METHOD
     ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/Methods");
 #endif
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
     ADDPROFILEARRAY("http://opcfoundation.org/UA-Profile/Server/EmbeddedDataChangeSubscription");
 #endif
 

+ 7 - 7
src/server/ua_server_binary.c

@@ -97,7 +97,7 @@ static void processOPN(UA_Connection *connection, UA_Server *server, const UA_By
     }
 
     /* send the response with an asymmetric security header */
-#ifndef UA_MULTITHREADING
+#ifndef UA_ENABLE_MULTITHREADING
     seqHeader.sequenceNumber = ++channel->sequenceNumber;
 #else
     seqHeader.sequenceNumber = uatomic_add_return(&channel->sequenceNumber, 1);
@@ -211,7 +211,7 @@ getServicePointers(UA_UInt32 requestTypeId, const UA_DataType **requestType,
         *responseType = &UA_TYPES[UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE];
         break;
 
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
     case UA_NS0ID_CREATESUBSCRIPTIONREQUEST:
         *service = (UA_Service)Service_CreateSubscription;
         *requestType = &UA_TYPES[UA_TYPES_CREATESUBSCRIPTIONREQUEST];
@@ -249,7 +249,7 @@ getServicePointers(UA_UInt32 requestTypeId, const UA_DataType **requestType,
         break;
 #endif
 
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
     case UA_NS0ID_CALLREQUEST:
         *service = (UA_Service)Service_Call;
         *requestType = &UA_TYPES[UA_TYPES_CALLREQUEST];
@@ -257,7 +257,7 @@ getServicePointers(UA_UInt32 requestTypeId, const UA_DataType **requestType,
 	break;
 #endif
 
-#ifdef ENABLE_NODEMANAGEMENT
+#ifdef UA_ENABLE_NODEMANAGEMENT
     case UA_NS0ID_ADDNODESREQUEST:
         *service = (UA_Service)Service_AddNodes;
         *requestType = &UA_TYPES[UA_TYPES_ADDNODESREQUEST];
@@ -365,7 +365,7 @@ processMSG(UA_Connection *connection, UA_Server *server, const UA_ByteString *ms
     }
 
     /* Most services can only be called with a valid securechannel */
-#ifndef EXTENSION_STATELESS
+#ifndef UA_ENABLE_NONSTANDARD_STATELESS
     if(channel == &anonymousChannel &&
        requestType->typeIndex > UA_TYPES_OPENSECURECHANNELREQUEST) {
         sendError(channel, msg, *pos, sequenceHeader.requestId, UA_STATUSCODE_BADSECURECHANNELIDINVALID);
@@ -399,7 +399,7 @@ processMSG(UA_Connection *connection, UA_Server *server, const UA_ByteString *ms
         sendError(channel, msg, *pos, sequenceHeader.requestId, UA_STATUSCODE_BADSESSIONNOTACTIVATED);
         return;
     }
-#ifndef EXTENSION_STATELESS
+#ifndef UA_ENABLE_NONSTANDARD_STATELESS
     if(session == &anonymousSession &&
        requestType->typeIndex > UA_TYPES_ACTIVATESESSIONREQUEST) {
         UA_LOG_INFO(server->logger, UA_LOGCATEGORY_SERVER, "Client tries to call a service without a session");
@@ -463,7 +463,7 @@ void UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection
             processOPN(connection, server, msg, &pos);
             break;
         case UA_MESSAGETYPEANDFINAL_MSGF & 0xffffff:
-#ifndef EXTENSION_STATELESS
+#ifndef UA_ENABLE_NONSTANDARD_STATELESS
             if(connection->state != UA_CONNECTION_ESTABLISHED) {
                 connection->close(connection);
                 return;

+ 4 - 4
src/server/ua_server_internal.h

@@ -8,7 +8,7 @@
 #include "ua_securechannel_manager.h"
 #include "ua_nodestore.h"
 
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
 #include "ua_subscription_manager.h"
 #endif
 
@@ -16,7 +16,7 @@
 #define ANONYMOUS_POLICY "open62541-anonymous-policy"
 #define USERNAME_POLICY "open62541-username-policy"
 
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
 /** Mapping of namespace-id and url to an external nodestore. For namespaces
     that have no mapping defined, the internal nodestore is used by default. */
 typedef struct UA_ExternalNamespace {
@@ -52,7 +52,7 @@ struct UA_Server {
     size_t namespacesSize;
     UA_String *namespaces;
 
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
     size_t externalNamespacesSize;
     UA_ExternalNamespace *externalNamespaces;
 #endif
@@ -60,7 +60,7 @@ struct UA_Server {
     /* Jobs with a repetition interval */
     LIST_HEAD(RepeatedJobsList, RepeatedJobs) repeatedJobs;
     
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     /* Dispatch queue head for the worker threads (the tail should not be in the same cache line) */
 	struct cds_wfcq_head dispatchQueue_head;
 

+ 12 - 12
src/server/ua_server_worker.c

@@ -82,7 +82,7 @@ static void processJobs(UA_Server *server, UA_Job *jobs, UA_Int32 jobsSize) {
 /* Worker Threads and Dispatch */
 /*******************************/
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 
 struct MainLoopJob {
     struct cds_lfs_node node;
@@ -271,7 +271,7 @@ static UA_StatusCode addRepeatedJob(UA_Server *server, struct AddRepeatedJob * U
     matchingTw->jobsSize++;
 
  cleanup:
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     UA_free(arw);
 #endif
     return retval;
@@ -283,7 +283,7 @@ UA_StatusCode UA_Server_addRepeatedJob(UA_Server *server, UA_Job job, UA_UInt32
         return UA_STATUSCODE_BADINTERNALERROR;
     interval *= 10000; // from ms to 100ns resolution
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     struct AddRepeatedJob *arw = UA_malloc(sizeof(struct AddRepeatedJob));
     if(!arw)
         return UA_STATUSCODE_BADOUTOFMEMORY;
@@ -328,7 +328,7 @@ static UA_UInt16 processRepeatedJobs(UA_Server *server) {
         if(tw->nextTime > current)
             break;
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
         // copy the entry and insert at the new location
         UA_Job *jobsCopy = UA_malloc(sizeof(UA_Job) * tw->jobsSize);
         if(!jobsCopy) {
@@ -393,14 +393,14 @@ static void removeRepeatedJob(UA_Server *server, UA_Guid *jobId) {
         }
     }
  finish:
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     UA_free(jobId);
 #endif
     return;
 }
 
 UA_StatusCode UA_Server_removeRepeatedJob(UA_Server *server, UA_Guid jobId) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     UA_Guid *idptr = UA_malloc(sizeof(UA_Guid));
     if(!idptr)
         return UA_STATUSCODE_BADOUTOFMEMORY;
@@ -429,7 +429,7 @@ void UA_Server_deleteAllRepeatedJobs(UA_Server *server) {
 /* Delayed Jobs */
 /****************/
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 
 #define DELAYEDJOBSSIZE 100 // Collect delayed jobs until we have DELAYEDWORKSIZE items
 
@@ -537,7 +537,7 @@ static void dispatchDelayedJobs(UA_Server *server, void *data /* not used, but n
 /* Main Server Loop */
 /********************/
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 static void processMainLoopJobs(UA_Server *server) {
     /* no synchronization required if we only use push and pop_all */
     struct cds_lfs_head *head = __cds_lfs_pop_all(&server->mainLoopJobs);
@@ -557,7 +557,7 @@ static void processMainLoopJobs(UA_Server *server) {
 UA_StatusCode UA_Server_run_startup(UA_Server *server, UA_UInt16 nThreads, UA_Boolean *running) {
 UA_StatusCode result = UA_STATUSCODE_GOOD;
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     /* Prepare the worker threads */
     server->running = running; // the threads need to access the variable
     server->nThreads = nThreads;
@@ -585,7 +585,7 @@ UA_StatusCode result = UA_STATUSCODE_GOOD;
 }
 
 UA_StatusCode UA_Server_run_mainloop(UA_Server *server, UA_Boolean *running) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     /* Run Work in the main loop */
     processMainLoopJobs(server);
 #endif
@@ -605,7 +605,7 @@ UA_StatusCode UA_Server_run_mainloop(UA_Server *server, UA_Boolean *running) {
         } else
             jobsSize = server->networkLayers[i]->stop(nl, &jobs);
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
         /* Filter out delayed work */
         for(UA_Int32 k=0;k<jobsSize;k++) {
             if(jobs[k].type != UA_JOBTYPE_METHODCALL_DELAYED)
@@ -636,7 +636,7 @@ UA_StatusCode UA_Server_run_shutdown(UA_Server *server, UA_UInt16 nThreads){
         processJobs(server, stopJobs, stopJobsSize);
         UA_free(stopJobs);
     }
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     /* Wait for all worker threads to finish */
     for(UA_UInt32 i=0;i<nThreads;i++) {
         pthread_join(server->thr[i], NULL);

+ 3 - 3
src/server/ua_services.h

@@ -216,7 +216,7 @@ void Service_UnregisterNodes(UA_Server *server, UA_Session *session,
  */
 
 /* Mock-Up of the function signature for Unit Tests */
-#ifdef BUILD_UNIT_TESTS
+#ifdef UA_BUILD_UNIT_TESTS
 UA_StatusCode parse_numericrange(const UA_String *str, UA_NumericRange *range);
 #endif
 
@@ -262,7 +262,7 @@ Service_Write_single(UA_Server *server, UA_Session *session, const UA_WriteValue
  *
  * @{
  */
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
 void
 Service_Call(UA_Server *server, UA_Session *session,
              const UA_CallRequest *request,
@@ -270,7 +270,7 @@ Service_Call(UA_Server *server, UA_Session *session,
 #endif
 /** @} */
 
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
 /**
  * @name MonitoredItem Service Set
  *

+ 6 - 6
src/server/ua_services_attribute.c

@@ -39,7 +39,7 @@ static size_t readDimension(UA_Byte *buf, UA_Int32 buflen, struct UA_NumericRang
     return progress + progress2 + 1;
 }
 
-#ifndef BUILD_UNIT_TESTS
+#ifndef UA_BUILD_UNIT_TESTS
 static
 #endif
 UA_StatusCode parse_numericrange(const UA_String *str, UA_NumericRange *range) {
@@ -353,7 +353,7 @@ void Service_Read(UA_Server *server, UA_Session *session, const UA_ReadRequest *
         return;
     }
 
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
     UA_Boolean isExternal[size];
     UA_UInt32 indices[size];
     memset(isExternal, UA_FALSE, sizeof(UA_Boolean) * size);
@@ -375,7 +375,7 @@ void Service_Read(UA_Server *server, UA_Session *session, const UA_ReadRequest *
 #endif
 
     for(size_t i = 0;i < size;i++) {
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
         if(!isExternal[i])
 #endif
             Service_Read_single(server, session, request->timestampsToReturn,
@@ -428,7 +428,7 @@ UA_StatusCode UA_Server_editNode(UA_Server *server, UA_Session *session, const U
         UA_MT_CONST UA_Node *node = UA_NodeStore_get(server->nodestore, nodeId);
         if(!node)
             return UA_STATUSCODE_BADNODEIDUNKNOWN;
-#ifndef UA_MULTITHREADING
+#ifndef UA_ENABLE_MULTITHREADING
         retval = callback(server, session, node, data);
         return retval;
 #else
@@ -703,7 +703,7 @@ void Service_Write(UA_Server *server, UA_Session *session, const UA_WriteRequest
         return;
     }
 
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
     UA_Boolean isExternal[request->nodesToWriteSize];
     UA_UInt32 indices[request->nodesToWriteSize];
     memset(isExternal, UA_FALSE, sizeof(UA_Boolean)*request->nodesToWriteSize);
@@ -727,7 +727,7 @@ void Service_Write(UA_Server *server, UA_Session *session, const UA_WriteRequest
     
     response->resultsSize = request->nodesToWriteSize;
     for(size_t i = 0;i < request->nodesToWriteSize;i++) {
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
         if(!isExternal[i])
 #endif
 		  response->results[i] = Service_Write_single(server, session, &request->nodesToWrite[i]);

+ 5 - 5
src/server/ua_services_nodemanagement.c

@@ -542,7 +542,7 @@ void Service_AddNodes(UA_Server *server, UA_Session *session, const UA_AddNodesR
         return;
     }
     
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
 #ifdef _MSVC_VER
     UA_Boolean *isExternal = UA_alloca(size);
     UA_UInt32 *indices = UA_alloca(sizeof(UA_UInt32)*size);
@@ -571,7 +571,7 @@ void Service_AddNodes(UA_Server *server, UA_Session *session, const UA_AddNodesR
     
     response->resultsSize = size;
     for(size_t i = 0; i < size; i++) {
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
         if(!isExternal[i])
 #endif
             Service_AddNodes_single(server, session, &request->nodesToAdd[i], &response->results[i]);
@@ -639,7 +639,7 @@ UA_Server_addDataSourceVariableNode(UA_Server *server, const UA_NodeId requested
     return result.statusCode;
 }
 
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
 UA_StatusCode UA_EXPORT
 UA_Server_addMethodNode(UA_Server *server, const UA_NodeId requestedNewNodeId,
                         const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
@@ -795,7 +795,7 @@ void Service_AddReferences(UA_Server *server, UA_Session *session, const UA_AddR
 	}
 	response->resultsSize = size;
 
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
 #ifdef NO_ALLOCA
     UA_Boolean isExternal[size];
     UA_UInt32 indices[size];
@@ -824,7 +824,7 @@ void Service_AddReferences(UA_Server *server, UA_Session *session, const UA_AddR
 
 	response->resultsSize = size;
 	for(size_t i = 0; i < response->resultsSize; i++) {
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
 		if(!isExternal[i])
 #endif
             Service_AddReferences_single(server, session, &request->referencesToAdd[i]);

+ 7 - 7
src/server/ua_services_view.c

@@ -33,7 +33,7 @@ fillReferenceDescription(UA_NodeStore *ns, const UA_Node *curr, UA_ReferenceNode
     return retval;
 }
 
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
 static const UA_Node *
 returnRelevantNodeExternal(UA_ExternalNodeStore *ens, const UA_BrowseDescription *descr,
                            const UA_ReferenceNode *reference) {
@@ -109,7 +109,7 @@ returnRelevantNode(UA_Server *server, const UA_BrowseDescription *descr, UA_Bool
             return NULL;
     }
 
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
     /* return the node from an external namespace*/
 	for(size_t nsIndex = 0; nsIndex < server->externalNamespacesSize; nsIndex++) {
 		if(reference->targetId.nodeId.namespaceIndex != server->externalNamespaces[nsIndex].index)
@@ -302,7 +302,7 @@ Service_Browse_single(UA_Server *server, UA_Session *session, struct Continuatio
                                                descr->resultMask, &result->references[referencesCount]);
             referencesCount++;
         }
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
         /* relevant_node returns a node malloced with UA_ObjectNode_new
            if it is external (there is no UA_Node_new function) */
         if(isExternal == UA_TRUE)
@@ -384,7 +384,7 @@ void Service_Browse(UA_Server *server, UA_Session *session, const UA_BrowseReque
     }
     response->resultsSize = size;
     
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
 #ifdef NO_ALLOCA
     UA_Boolean isExternal[size];
     UA_UInt32 indices[size];
@@ -411,7 +411,7 @@ void Service_Browse(UA_Server *server, UA_Session *session, const UA_BrowseReque
 #endif
 
     for(size_t i = 0; i < size; i++) {
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
         if(!isExternal[i])
 #endif
             Service_Browse_single(server, session, NULL, &request->nodesToBrowse[i],
@@ -578,7 +578,7 @@ void Service_TranslateBrowsePathsToNodeIds(UA_Server *server, UA_Session *sessio
         return;
     }
 
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
 #ifdef NO_ALLOCA
     UA_Boolean isExternal[size];
     UA_UInt32 indices[size];
@@ -606,7 +606,7 @@ void Service_TranslateBrowsePathsToNodeIds(UA_Server *server, UA_Session *sessio
 
     response->resultsSize = size;
     for(size_t i = 0; i < size; i++) {
-#ifdef UA_EXTERNAL_NAMESPACES
+#ifdef UA_ENABLE_EXTERNAL_NAMESPACES
     	if(!isExternal[i])
 #endif
     		Service_TranslateBrowsePathsToNodeIds_single(server, session, &request->browsePaths[i],

+ 2 - 2
src/ua_connection.c

@@ -130,7 +130,7 @@ UA_Connection_completeMessages(UA_Connection *connection, UA_ByteString * UA_RES
 }
 
 void UA_Connection_detachSecureChannel(UA_Connection *connection) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     UA_SecureChannel *channel = connection->channel;
     if(channel)
         uatomic_cmpxchg(&channel->connection, connection, NULL);
@@ -143,7 +143,7 @@ void UA_Connection_detachSecureChannel(UA_Connection *connection) {
 }
 
 void UA_Connection_attachSecureChannel(UA_Connection *connection, UA_SecureChannel *channel) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     if(uatomic_cmpxchg(&channel->connection, NULL, connection) == NULL)
         uatomic_set(&connection->channel, channel);
 #else

+ 2 - 2
src/ua_securechannel.c

@@ -55,7 +55,7 @@ void UA_SecureChannel_attachSession(UA_SecureChannel *channel, UA_Session *sessi
     if(!se)
         return;
     se->session = session;
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
     if(uatomic_cmpxchg(&session->channel, NULL, channel) != NULL) {
         UA_free(se);
         return;
@@ -144,7 +144,7 @@ UA_StatusCode UA_SecureChannel_sendBinaryMessage(UA_SecureChannel *channel, UA_U
 
     /* now write the header with the size */
     respHeader.messageHeader.messageSize = messagePos;
-#ifndef UA_MULTITHREADING
+#ifndef UA_ENABLE_MULTITHREADING
     seqHeader.sequenceNumber = ++channel->sequenceNumber;
 #else
     seqHeader.sequenceNumber = uatomic_add_return(&channel->sequenceNumber, 1);

+ 2 - 2
src/ua_session.c

@@ -41,7 +41,7 @@ void UA_Session_init(UA_Session *session) {
     session->timeout = 0;
     UA_DateTime_init(&session->validTill);
     session->channel = NULL;
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
     SubscriptionManager_init(session);
 #endif
     session->availableContinuationPoints = MAXCONTINUATIONPOINTS;
@@ -62,7 +62,7 @@ void UA_Session_deleteMembersCleanup(UA_Session *session, UA_Server* server) {
     }
     if(session->channel)
         UA_SecureChannel_detachSession(session->channel, session);
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
     SubscriptionManager_deleteMembers(session, server);
 #endif
 }

+ 2 - 2
src/ua_session.h

@@ -8,7 +8,7 @@
 
 #define MAXCONTINUATIONPOINTS 5
 
-#ifdef ENABLE_SUBSCRIPTIONS
+#ifdef UA_ENABLE_SUBSCRIPTIONS
 #include "server/ua_subscription_manager.h"
 #endif
 
@@ -36,7 +36,7 @@ struct UA_Session {
     UA_UInt32         maxResponseMessageSize;
     UA_Int64          timeout; // [ms]
     UA_DateTime       validTill;
-    #ifdef ENABLE_SUBSCRIPTIONS
+    #ifdef UA_ENABLE_SUBSCRIPTIONS
         UA_SubscriptionManager subscriptionManager;
     #endif
     UA_SecureChannel *channel;

+ 2 - 2
src/ua_util.h

@@ -48,7 +48,7 @@
 /* Thread Local Storage */
 /************************/
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 # ifdef __GNUC__
 #  define UA_THREAD_LOCAL __thread
 # elif defined(_MSC_VER)
@@ -79,7 +79,7 @@
 
 #include "queue.h"
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 # define _LGPL_SOURCE
 # include <urcu.h>
 # include <urcu/wfcqueue.h>

+ 3 - 3
tests/CMakeLists.txt

@@ -15,9 +15,9 @@ if(NOT WIN32)
 else()
     list(APPEND LIBS ws2_32)
 endif()
-if(ENABLE_MULTITHREADING)
+if(UA_ENABLE_MULTITHREADING)
     list(APPEND LIBS urcu-cds urcu urcu-common)
-endif(ENABLE_MULTITHREADING)
+endif()
 
 # the unit test are built directly on the open62541 object files. so they can
 # access symbols that are hidden/not exported to the shared library
@@ -68,7 +68,7 @@ add_test(session ${CMAKE_CURRENT_BINARY_DIR}/check_session)
 #                           ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_HELOPN.hex)
 
 #set(check_fileinput_source check_server_interaction_fileinput.c testing_networklayers.c $<TARGET_OBJECTS:open62541-object>)
-#if(NOT ENABLE_AMALGAMATION)
+#if(NOT UA_ENABLE_AMALGAMATION)
 #    list(APPEND check_fileinput_source ${PROJECT_SOURCE_DIR}/examples/logger_stdout.c)
 #endif()
 #add_executable(check_server_interaction_fileinput ${check_fileinput_source})

+ 19 - 19
tests/check_nodestore.c

@@ -7,7 +7,7 @@
 #include "ua_util.h"
 #include "check.h"
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 #include <pthread.h>
 #include <urcu.h>
 #endif
@@ -61,7 +61,7 @@ START_TEST(replaceNonExistingNode) {
 END_TEST
 
 START_TEST(findNodeInUA_NodeStoreWithSingleEntry) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
    	rcu_register_thread();
 #endif
 	// given
@@ -74,14 +74,14 @@ START_TEST(findNodeInUA_NodeStoreWithSingleEntry) {
 	ck_assert_int_eq((uintptr_t)inserted, (uintptr_t)nr);
 	// finally
 	UA_NodeStore_delete(ns);
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	rcu_unregister_thread();
 #endif
 }
 END_TEST
 
 START_TEST(failToFindNodeInOtherUA_NodeStore) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
    	rcu_register_thread();
 #endif
 	// given
@@ -98,14 +98,14 @@ START_TEST(failToFindNodeInOtherUA_NodeStore) {
 	// finally
 	UA_VariableNode_delete((UA_VariableNode*)n);
 	UA_NodeStore_delete(ns);
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	rcu_unregister_thread();
 #endif
 }
 END_TEST
 
 START_TEST(findNodeInUA_NodeStoreWithSeveralEntries) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
    	rcu_register_thread();
 #endif
 	// given
@@ -130,14 +130,14 @@ START_TEST(findNodeInUA_NodeStoreWithSeveralEntries) {
 	ck_assert_int_eq((uintptr_t)nr, (uintptr_t)inserted);
 	// finally
 	UA_NodeStore_delete(ns);
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	rcu_unregister_thread();
 #endif
 }
 END_TEST
 
 START_TEST(iterateOverUA_NodeStoreShallNotVisitEmptyNodes) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
    	rcu_register_thread();
 #endif
 	// given
@@ -164,14 +164,14 @@ START_TEST(iterateOverUA_NodeStoreShallNotVisitEmptyNodes) {
 	ck_assert_int_eq(visitCnt, 6);
 	// finally
 	UA_NodeStore_delete(ns);
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	rcu_unregister_thread();
 #endif
 }
 END_TEST
 
 START_TEST(findNodeInExpandedNamespace) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
    	rcu_register_thread();
 #endif
 	// given
@@ -190,14 +190,14 @@ START_TEST(findNodeInExpandedNamespace) {
 	// finally
 	UA_free((void*)n2);
 	UA_NodeStore_delete(ns);
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	rcu_unregister_thread();
 #endif
 }
 END_TEST
 
 START_TEST(iterateOverExpandedNamespaceShallNotVisitEmptyNodes) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
    	rcu_register_thread();
 #endif
 	// given
@@ -217,14 +217,14 @@ START_TEST(iterateOverExpandedNamespaceShallNotVisitEmptyNodes) {
 	ck_assert_int_eq(visitCnt, 200);
 	// finally
 	UA_NodeStore_delete(ns);
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	rcu_unregister_thread();
 #endif
 }
 END_TEST
 
 START_TEST(failToFindNonExistantNodeInUA_NodeStoreWithSeveralEntries) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
    	rcu_register_thread();
 #endif
 	// given
@@ -248,7 +248,7 @@ START_TEST(failToFindNonExistantNodeInUA_NodeStoreWithSeveralEntries) {
 	// finally
 	UA_free((void *)n6);
 	UA_NodeStore_delete(ns);
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	rcu_unregister_thread();
 #endif
 }
@@ -258,7 +258,7 @@ END_TEST
 /* Performance Profiling Test Cases */
 /************************************/
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 struct UA_NodeStoreProfileTest {
 	UA_NodeStore *ns;
 	UA_Int32 min_val;
@@ -286,7 +286,7 @@ static void *profileGetThread(void *arg) {
 #endif
 
 START_TEST(profileGetDelete) {
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
    	rcu_register_thread();
 #endif
 
@@ -299,7 +299,7 @@ START_TEST(profileGetDelete) {
 	}
 	clock_t begin, end;
 	begin = clock();
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 #define THREADS 4
     pthread_t t[THREADS];
 	struct UA_NodeStoreProfileTest p[THREADS];
@@ -326,7 +326,7 @@ START_TEST(profileGetDelete) {
 
 	UA_NodeStore_delete(ns);
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 	rcu_unregister_thread();
 #endif
 }

+ 4 - 4
tests/check_services_attributes.c

@@ -12,7 +12,7 @@
 #include "ua_util.h"
 #include "server/ua_server_internal.h"
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 #include <pthread.h>
 #include <urcu.h>
 #endif
@@ -74,7 +74,7 @@ static UA_Server* makeTestSequence(void) {
                           UA_NODEID_NUMERIC(0, UA_NS0ID_HASSUBTYPE),
                           UA_QUALIFIEDNAME(0, "Viewtest"), view_attr, NULL);
 
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
 	/* MethodNode */
     UA_MethodAttributes ma;
     UA_MethodAttributes_init(&ma);
@@ -538,7 +538,7 @@ START_TEST(ReadSingleAttributeHistorizingWithoutTimestamp) {
 } END_TEST
 
 START_TEST(ReadSingleAttributeExecutableWithoutTimestamp) {
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
     UA_Server *server = makeTestSequence();
     UA_DataValue resp;
     UA_DataValue_init(&resp);
@@ -559,7 +559,7 @@ START_TEST(ReadSingleAttributeExecutableWithoutTimestamp) {
 } END_TEST
 
 START_TEST(ReadSingleAttributeUserExecutableWithoutTimestamp) {
-#ifdef ENABLE_METHODCALLS
+#ifdef UA_ENABLE_METHODCALLS
     UA_Server *server = makeTestSequence();
     UA_DataValue resp;
     UA_DataValue_init(&resp);

+ 1 - 1
tests/check_services_nodemanagement.c

@@ -12,7 +12,7 @@
 #include "ua_util.h"
 #include "server/ua_server_internal.h"
 
-#ifdef UA_MULTITHREADING
+#ifdef UA_ENABLE_MULTITHREADING
 #include <pthread.h>
 #include <urcu.h>
 #endif

+ 16 - 7
tools/travis_linux_script.sh

@@ -1,19 +1,21 @@
 #!/bin/bash
 set -ev
+
 echo "Checking the applicability of patches"
 # ./tools/.checkPorts.sh
 echo "Documentation and certificate build"
 mkdir -p build
 cd build
-cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCUMENTATION=ON -DGENERATE_SELFSIGNED=ON ..
+cmake -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_DOCUMENTATION=ON -DUA_BUILD_SELFSIGNED_CERTIFICATE=ON ..
 make doc
 make selfsigned
 cp -r doc ..
 cp server_cert.der ..
+
 echo "Testing builds"
 cd .. && rm build -rf && mkdir -p build && cd build
 echo "Cross compile release build for MinGW 32 bit"
-cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
+cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake -DUA_ENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLESERVER=ON -DUA_BUILD_EXAMPLECLIENT=ON ..
 make
 cp ../README.md .
 cp ../LICENSE .
@@ -23,8 +25,9 @@ cp ../server_cert.der .
 zip -r open62541-win32.zip doc server_cert.der LICENSE AUTHORS README.md server_static.exe server.exe client.exe client_static.exe libopen62541.dll libopen62541.dll.a open62541.h open62541.c
 cp open62541-win32.zip ..
 cd .. && rm build -rf && mkdir -p build && cd build
+
 echo "Cross compile release build for MinGW 64 bit"
-cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
+cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake -DUA_ENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLESERVER=ON -DUA_BUILD_EXAMPLECLIENT=ON ..
 make
 cp ../README.md .
 cp ../LICENSE .
@@ -34,35 +37,41 @@ cp ../server_cert.der .
 zip -r open62541-win64.zip doc server_cert.der LICENSE AUTHORS README.md server_static.exe server.exe client.exe client_static.exe libopen62541.dll libopen62541.dll.a open62541.h open62541.c
 cp open62541-win64.zip ..
 cd .. && rm build -rf && mkdir -p build && cd build
+
 echo "Cross compile release build for 32-bit linux"
-cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-gcc-m32.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
+cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-gcc-m32.cmake -DUA_ENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLESERVER=ON -DUA_BUILD_EXAMPLECLIENT=ON ..
 make
 tar -pczf open62541-linux32.tar.gz ../doc ../server_cert.der ../LICENSE ../AUTHORS ../README.md server_static server client_static client libopen62541.so open62541.h open62541.c
 cp open62541-linux32.tar.gz ..
 cd .. && rm build -rf && mkdir -p build && cd build
+
 echo "Compile release build for 64-bit linux"
-cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_AMALGAMATION=ON -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
+cmake -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLESERVER=ON -DUA_BUILD_EXAMPLECLIENT=ON ..
 make
 tar -pczf open62541-linux64.tar.gz ../doc ../server_cert.der ../LICENSE ../AUTHORS ../README.md server_static server client_static client libopen62541.so open62541.h open62541.c
 cp open62541-linux64.tar.gz ..
 cp open62541.h .. #copy single file-release
 cp open62541.c .. #copy single file-release
+
 echo "Upgrade to gcc 4.8"
 sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
 sudo apt-get update -qq
 sudo apt-get install -qq gcc-4.8 g++-4.8 valgrind
 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
 sudo update-alternatives --config gcc
+
 echo "Building the C++ example"
 gcc -std=c99 -c open62541.c
 g++-4.8 ../examples/server.cpp -I./ open62541.o -o cpp-server
 cd .. && rm build -rf && mkdir -p build && cd build
+
 echo "Compile multithreaded version"
-cmake -DENABLE_MULTITHREADING=ON -DBUILD_EXAMPLESERVER=ON ..
+cmake -DUA_ENABLE_MULTITHREADING=ON -DUA_BUILD_EXAMPLESERVER=ON ..
 make
 cd .. && rm build -rf && mkdir -p build && cd build
+
 echo "Debug build and unit tests (64 bit)"
-cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_DEMO_NODESET=ON -DBUILD_UNIT_TESTS=ON -DBUILD_EXAMPLESERVER=ON -DENABLE_COVERAGE=ON ..
+cmake -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_UNIT_TESTS=ON -DUA_BUILD_EXAMPLESERVER=ON -DUA_ENABLE_COVERAGE=ON ..
 make && make test ARGS="-V"
 echo "Run valgrind to see if the server leaks memory (just starting up and closing..)"
 if [[ ! ( ${TRAVIS_OS_NAME} == "linux" && ${CC} == "clang") ]]; then

+ 3 - 3
tools/travis_osx_script.sh

@@ -3,7 +3,7 @@ set -ev
 echo "Documentation and certificate build"
 mkdir -p build
 cd build
-cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCUMENTATION=ON -DGENERATE_SELFSIGNED=ON ..
+cmake -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_DOCUMENTATION=ON -DUA_BUILD_SELFSIGNED_CERTIFICATE=ON ..
 make doc
 make selfsigned
 cp -r doc ..
@@ -11,7 +11,7 @@ cp server_cert.der ..
 echo "Testing builds"
 cd .. && rm -rf build && mkdir -p build && cd build
 echo "Compile release build for OS X"
-cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_AMALGAMATION=ON -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
+cmake -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLESERVER=ON -DUA_BUILD_EXAMPLECLIENT=ON ..
 make
 tar -pczf open62541-osx.tar.gz ../doc ../server_cert.der ../LICENSE ../AUTHORS ../README.md server_static server client_static client libopen62541.dylib open62541.h open62541.c
 cp open62541-osx.tar.gz ..
@@ -23,7 +23,7 @@ cmake -DENABLE_MULTITHREADING=ON -DBUILD_EXAMPLESERVER=ON ..
 make
 cd .. && rm -rf build && mkdir -p build && cd build
 echo "Debug build and unit tests (64 bit)"
-cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_DEMO_NODESET=ON -DBUILD_UNIT_TESTS=ON -DBUILD_EXAMPLESERVER=ON -DENABLE_COVERAGE=ON ..
+cmake -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_UNIT_TESTS=ON -DUA_BUILD_EXAMPLESERVER=ON -DUA_ENABLE_COVERAGE=ON ..
 make && make test
 echo "Run valgrind to see if the server leaks memory (just starting up and closing..)"
 (valgrind --error-exitcode=3 ./server & export pid=$!; sleep 2; kill -INT $pid; wait $pid);