Skip to content

Commit

Permalink
Move header files to a more unix-like structure
Browse files Browse the repository at this point in the history
This commit drops the 'ua_' prefix and changes the public includes
to the form `#include <open62541/server.h>` instead of the old
`#include <ua_server.h>`
  • Loading branch information
jpfr committed Mar 21, 2019
1 parent 1083c11 commit c9c8188
Show file tree
Hide file tree
Showing 198 changed files with 779 additions and 886 deletions.
170 changes: 81 additions & 89 deletions CMakeLists.txt

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ Using the GCC compiler, just run ```gcc -std=c99 -DUA_ARCHITECTURE_POSIX <server
and change `-DUA_ARCHITECTURE_POSIX` to `-DUA_ARCHITECTURE_WIN32`).
```c
#include <signal.h>
#include "open62541.h"
#include <open62541/server.h>
#include <open62541/server_config_default.h>

UA_Boolean running = true;
void signalHandler(int sig) {
Expand Down Expand Up @@ -171,7 +172,8 @@ int main(int argc, char** argv)
### Example Client Implementation
```c
#include <stdio.h>
#include "open62541.h"
#include <open62541/client.h>
#include <open62541/client_config_default.h>
int main(int argc, char *argv[])
{
Expand Down
2 changes: 1 addition & 1 deletion arch/posix/ua_architecture_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#ifdef UA_ARCHITECTURE_POSIX

#include "ua_types.h"
#include <open62541/types.h>

unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){
int opts = fcntl(sockfd, F_GETFL);
Expand Down
2 changes: 1 addition & 1 deletion arch/posix/ua_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#ifdef UA_ARCHITECTURE_POSIX

#include "ua_types.h"
#include <open62541/types.h>
#include <time.h>
#include <sys/time.h>

Expand Down
13 changes: 3 additions & 10 deletions arch/ua_architecture_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
#ifndef PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_
#define PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_

#include "ua_config.h"
#include <open62541/config.h>

#ifdef __cplusplus
extern "C" {
#endif
_UA_BEGIN_DECLS

/*
* Allocation functions
Expand Down Expand Up @@ -204,11 +202,6 @@ int UA_access(const char *pathname, int mode); //equivalent implementation of ht

#include "ua_architecture_definitions.h"

#ifdef __cplusplus
}
#endif



_UA_END_DECLS

#endif /* PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_ */
4 changes: 2 additions & 2 deletions arch/ua_network_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
*/

#define UA_INTERNAL
#include <open62541/util.h>
#include <open62541/plugin/log_stdout.h>
#include "ua_network_tcp.h"
#include "ua_log_stdout.h"
#include "open62541_queue.h"
#include "ua_util.h"

#include <string.h> // memset

Expand Down
6 changes: 3 additions & 3 deletions arch/ua_network_tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#ifndef UA_NETWORK_TCP_H_
#define UA_NETWORK_TCP_H_

#include "ua_server.h"
#include "ua_client.h"
#include "ua_plugin_log.h"
#include <open62541/server.h>
#include <open62541/client.h>
#include <open62541/plugin/log.h>

_UA_BEGIN_DECLS

Expand Down
2 changes: 1 addition & 1 deletion arch/win32/ua_architecture_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#ifdef UA_ARCHITECTURE_WIN32

#include "ua_types.h"
#include <open62541/types.h>

unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){
u_long iMode = 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/win32/ua_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# define _BSD_SOURCE
#endif

#include "ua_types.h"
#include <open62541/types.h>
#include <time.h>
/* Backup definition of SLIST_ENTRY on mingw winnt.h */
# ifdef SLIST_ENTRY
Expand Down
3 changes: 2 additions & 1 deletion deps/atoi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
extern "C" {
#endif

#include "ua_types.h"
#include <open62541/types.h>

UA_StatusCode atoiUnsigned(const char *s, size_t size, UA_UInt64 *result);
UA_StatusCode atoiSigned(const char *s, size_t size, UA_Int64 *result);

Expand Down
5 changes: 2 additions & 3 deletions deps/itoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/


#ifndef ITOA_H
#define ITOA_H

#ifdef __cplusplus
extern "C" {
#endif

#include "ua_types.h"
#include <open62541/types.h>

UA_UInt16 itoaUnsigned(UA_UInt64 value, char* buffer, UA_Byte base);
UA_UInt16 itoaSigned(UA_Int64 value, char* buffer);

Expand Down
4 changes: 2 additions & 2 deletions deps/pcg_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
#ifndef PCG_BASIC_H_
#define PCG_BASIC_H_

#include <open62541/config.h>

#ifdef __cplusplus
extern "C" {
#endif

#include "ua_config.h"

typedef struct pcg_state_setseq_64 {
uint64_t state; /* RNG state. All values are possible. */
uint64_t inc; /* Controls which RNG sequence (stream) is selected. Must
Expand Down
36 changes: 18 additions & 18 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ function(generate_rst in out)
endfunction()

# Doc from headers
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_types.h ${DOC_SRC_DIR}/types.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_constants.h ${DOC_SRC_DIR}/constants.rst)
generate_rst(${PROJECT_BINARY_DIR}/src_generated/ua_statuscodes.h ${DOC_SRC_DIR}/statuscodes.rst)
generate_rst(${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h ${DOC_SRC_DIR}/types_generated.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_server_config.h ${DOC_SRC_DIR}/server_config.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_server.h ${DOC_SRC_DIR}/server.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client_config.h ${DOC_SRC_DIR}/client_config.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client_subscriptions.h ${DOC_SRC_DIR}/client_subscriptions.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client.h ${DOC_SRC_DIR}/client.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client_highlevel.h ${DOC_SRC_DIR}/client_highlevel.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_log.h ${DOC_SRC_DIR}/plugin_log.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_network.h ${DOC_SRC_DIR}/plugin_network.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_access_control.h ${DOC_SRC_DIR}/plugin_access_control.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/types.h ${DOC_SRC_DIR}/types.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/constants.h ${DOC_SRC_DIR}/constants.rst)
generate_rst(${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.h ${DOC_SRC_DIR}/statuscodes.rst)
generate_rst(${PROJECT_BINARY_DIR}/src_generated/open62541/types_generated.h ${DOC_SRC_DIR}/types_generated.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/server_config.h ${DOC_SRC_DIR}/server_config.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/server.h ${DOC_SRC_DIR}/server.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/client_config.h ${DOC_SRC_DIR}/client_config.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/client_subscriptions.h ${DOC_SRC_DIR}/client_subscriptions.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/client.h ${DOC_SRC_DIR}/client.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/client_highlevel.h ${DOC_SRC_DIR}/client_highlevel.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/log.h ${DOC_SRC_DIR}/plugin_log.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/network.h ${DOC_SRC_DIR}/plugin_network.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/accesscontrol.h ${DOC_SRC_DIR}/plugin_accesscontrol.rst)
generate_rst(${PROJECT_SOURCE_DIR}/src/server/ua_services.h ${DOC_SRC_DIR}/services.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_nodestore.h ${DOC_SRC_DIR}/nodestore.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_pubsub.h ${DOC_SRC_DIR}/plugin_pubsub_connection.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_server_pubsub.h ${DOC_SRC_DIR}/pubsub.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/nodestore.h ${DOC_SRC_DIR}/nodestore.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/plugin/pubsub.h ${DOC_SRC_DIR}/plugin_pubsub_connection.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/open62541/server_pubsub.h ${DOC_SRC_DIR}/pubsub.rst)

# Doc from tutorial code
generate_rst(${PROJECT_SOURCE_DIR}/examples/tutorial_datatypes.c ${DOC_SRC_DIR}/tutorial_datatypes.rst)
Expand All @@ -56,7 +56,7 @@ add_custom_target(doc_latex ${SPHINX_EXECUTABLE}
${DOC_SRC_DIR}/client.rst ${DOC_SRC_DIR}/client_subscriptions.rst
${DOC_SRC_DIR}/client_highlevel.rst ${DOC_SRC_DIR}/client_config.rst
${DOC_SRC_DIR}/plugin_log.rst ${DOC_SRC_DIR}/plugin_network.rst
${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_access_control.rst
${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_accesscontrol.rst
${DOC_SRC_DIR}/nodestore.rst
${DOC_SRC_DIR}/tutorials.rst
${DOC_SRC_DIR}/tutorial_datatypes.rst
Expand Down Expand Up @@ -91,7 +91,7 @@ add_custom_target(doc ${SPHINX_EXECUTABLE}
${DOC_SRC_DIR}/client.rst ${DOC_SRC_DIR}/client_subscriptions.rst
${DOC_SRC_DIR}/client_highlevel.rst ${DOC_SRC_DIR}/client_config.rst
${DOC_SRC_DIR}/plugin_log.rst ${DOC_SRC_DIR}/plugin_network.rst
${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_access_control.rst
${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_accesscontrol.rst
${DOC_SRC_DIR}/nodestore.rst
${DOC_SRC_DIR}/tutorials.rst
${DOC_SRC_DIR}/tutorial_datatypes.rst
Expand Down
2 changes: 1 addition & 1 deletion doc/internal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Internals

statuscodes
plugin_network
plugin_access_control
plugin_accesscontrol
plugin_log
plugin_pubsub_connection
pubsub
5 changes: 2 additions & 3 deletions examples/access_control/client_access_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
* Using access_control_server
*/

#include <ua_client.h>
#include <ua_config_default.h>
#include <ua_client_highlevel.h>
#include <open62541/client_highlevel.h>
#include <open62541/client_config_default.h>

#include <stdlib.h>

Expand Down
9 changes: 4 additions & 5 deletions examples/access_control/server_access_control.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */

#include <ua_server.h>
#include <ua_config_default.h>
#include <ua_plugin_access_control.h>
#include <ua_accesscontrol_default.h>
#include <ua_log_stdout.h>
#include <open62541/server.h>
#include <open62541/server_config_default.h>
#include <open62541/plugin/log_stdout.h>
#include <open62541/plugin/accesscontrol_default.h>

#include <signal.h>
#include <stdlib.h>
Expand Down
8 changes: 4 additions & 4 deletions examples/client.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */

#include <ua_client_subscriptions.h>
#include <ua_client_highlevel.h>
#include <ua_config_default.h>
#include <ua_log_stdout.h>
#include <open62541/client_subscriptions.h>
#include <open62541/client_highlevel.h>
#include <open62541/client_config_default.h>
#include <open62541/plugin/log_stdout.h>

#include <stdlib.h>

Expand Down
9 changes: 5 additions & 4 deletions examples/client_async.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */

#include <ua_config_default.h>
#include <ua_client_subscriptions.h>
#include <ua_log_stdout.h>
#include <ua_client_highlevel_async.h>
#include <open62541/client_subscriptions.h>
#include <open62541/client_highlevel_async.h>
#include <open62541/server_config_default.h>
#include <open62541/client_config_default.h>
#include <open62541/plugin/log_stdout.h>

#include <stdlib.h>

Expand Down
8 changes: 3 additions & 5 deletions examples/client_connect_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
*
* This example is very similar to the tutorial_client_firststeps.c. */


#include <ua_client_highlevel.h>
#include <ua_config_default.h>
#include <ua_log_stdout.h>

#include <open62541/client_highlevel.h>
#include <open62541/client_config_default.h>
#include <open62541/plugin/log_stdout.h>
#include <signal.h>
#include <stdlib.h>

Expand Down
6 changes: 3 additions & 3 deletions examples/client_connectivitycheck_loop.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */

#include <ua_client.h>
#include <ua_config_default.h>
#include <ua_log_stdout.h>
#include <open62541/client.h>
#include <open62541/client_config_default.h>
#include <open62541/plugin/log_stdout.h>

#include <signal.h>
#include <stdlib.h>
Expand Down
5 changes: 2 additions & 3 deletions examples/client_historical.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */

#include <ua_client_highlevel.h>
#include <ua_client.h>
#include <ua_config_default.h>
#include <open62541/client_highlevel.h>
#include <open62541/client_config_default.h>

#include <stdio.h>
#include <stdlib.h>
Expand Down
6 changes: 3 additions & 3 deletions examples/client_subscription_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
*
* This example is very similar to the tutorial_client_firststeps.c. */

#include <ua_config_default.h>
#include <ua_client_subscriptions.h>
#include <ua_log_stdout.h>
#include <open62541/client_subscriptions.h>
#include <open62541/client_config_default.h>
#include <open62541/plugin/log_stdout.h>

#include <signal.h>
#include <stdlib.h>
Expand Down
9 changes: 2 additions & 7 deletions examples/common.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */


#ifdef UA_ENABLE_AMALGAMATION
# include <open62541.h>
#else
# include "ua_types.h"
# include "ua_types_generated_handling.h"
#endif
# include <open62541/types.h>
# include <open62541/types_generated_handling.h>

/* loadFile parses the certificate file.
*
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_datatype/client_types_custom.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */

#include <ua_client_highlevel.h>
#include <ua_config_default.h>
#include <open62541/client_highlevel.h>
#include <open62541/client_config_default.h>
#include "custom_datatype.h"

#include <stdlib.h>
Expand Down
6 changes: 3 additions & 3 deletions examples/custom_datatype/server_types_custom.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */

#include <ua_server.h>
#include <ua_log_stdout.h>
#include <ua_config_default.h>
#include <open62541/server.h>
#include <open62541/server_config_default.h>
#include <open62541/plugin/log_stdout.h>
#include "custom_datatype.h"

#include <signal.h>
Expand Down
6 changes: 3 additions & 3 deletions examples/discovery/client_find_servers.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* and then calls GetEndpoints on the returned list of servers.
*/

#include <ua_client.h>
#include <ua_config_default.h>
#include <ua_log_stdout.h>
#include <open62541/client_highlevel.h>
#include <open62541/client_config_default.h>
#include <open62541/plugin/log_stdout.h>

#include <stdlib.h>

Expand Down
4 changes: 2 additions & 2 deletions examples/discovery/server_lds.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* find servers service to get all registered servers (see client_find_servers.c).
*/

#include <ua_server.h>
#include <ua_config_default.h>
#include <open62541/server.h>
#include <open62541/server_config_default.h>

#include <signal.h>
#include <stdlib.h>
Expand Down
Loading

0 comments on commit c9c8188

Please sign in to comment.