Browse Source

cosmetic: keep lines under 80chars to avoid breaks in the pdf documentation

Julius Pfrommer 8 years ago
parent
commit
6258d088db

+ 2 - 2
doc/building.rst

@@ -11,7 +11,7 @@ Using the GCC compiler, the following calls build the examples on Linux.
 .. code-block:: bash
 
    cp /path-to/open62541.* . # copy single-file distribution to the local directory
-   cp /path-to/examples/server_variable.c . # copy the example server to the local directory
+   cp /path-to/examples/server_variable.c . # copy the example server
    gcc -std=c99 open62541.c server_variable.c -o server
 
 Building the Library
@@ -61,7 +61,7 @@ with MinGW, just replace the compiler selection in the call to CMake.
    mkdir build
    cd build
    <path-to>\cmake.exe .. -G "Visual Studio 14 2015"
-   :: You can use use cmake-gui for a graphical user-interface to select single features
+   :: You can use use cmake-gui for a graphical user-interface to select features
 
 - Then open :file:`build\open62541.sln` in Visual Studio 2015 and build as usual
 

+ 1 - 1
doc/internal.rst

@@ -5,6 +5,6 @@ Internals
 
    services
    nodestore
-   types_generated
    connection
    log
+   types_generated

+ 35 - 17
doc/tutorial_noderelations.rst

@@ -14,7 +14,11 @@ As an example, we will create a simple object model using UA Modeler and embed t
 
 .. code-block:: xml
 
-    <UANodeSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:uax="http://opcfoundation.org/UA/2008/02/Types.xsd" xmlns="http://opcfoundation.org/UA/2011/03/UANodeSet.xsd" xmlns:s1="http://yourorganisation.org/example_nodeset/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <UANodeSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xmlns:uax="http://opcfoundation.org/UA/2008/02/Types.xsd"
+               xmlns="http://opcfoundation.org/UA/2011/03/UANodeSet.xsd"
+               xmlns:s1="http://yourorganisation.org/example_nodeset/"
+               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <NamespaceUris>
             <Uri>http://yourorganisation.org/example_nodeset/</Uri>
         </NamespaceUris>
@@ -49,7 +53,8 @@ As an example, we will create a simple object model using UA Modeler and embed t
                 <Reference ReferenceType="HasComponent">ns=1;i=6002</Reference>
             </References>
         </UAObjectType>
-        <UAVariable DataType="String" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6001" BrowseName="1:ManufacturerName" UserAccessLevel="3" AccessLevel="3">
+        <UAVariable DataType="String" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6001"
+                    BrowseName="1:ManufacturerName" UserAccessLevel="3" AccessLevel="3">
             <DisplayName>ManufacturerName</DisplayName>
             <References>
                 <Reference ReferenceType="HasTypeDefinition">i=63</Reference>
@@ -57,7 +62,8 @@ As an example, we will create a simple object model using UA Modeler and embed t
                 <Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=1001</Reference>
             </References>
         </UAVariable>
-        <UAVariable DataType="String" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6002" BrowseName="1:ModelName" UserAccessLevel="3" AccessLevel="3">
+        <UAVariable DataType="String" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6002"
+                    BrowseName="1:ModelName" UserAccessLevel="3" AccessLevel="3">
             <DisplayName>ModelName</DisplayName>
             <References>
                 <Reference ReferenceType="HasTypeDefinition">i=63</Reference>
@@ -75,7 +81,8 @@ As an example, we will create a simple object model using UA Modeler and embed t
                 <Reference ReferenceType="HasComponent">ns=1;i=7002</Reference>
             </References>
         </UAObjectType>
-        <UAVariable DataType="Boolean" ParentNodeId="ns=1;i=1002" NodeId="ns=1;i=6003" BrowseName="1:isOn" UserAccessLevel="3" AccessLevel="3">
+        <UAVariable DataType="Boolean" ParentNodeId="ns=1;i=1002" NodeId="ns=1;i=6003"
+                    BrowseName="1:isOn" UserAccessLevel="3" AccessLevel="3">
             <DisplayName>isOn</DisplayName>
             <References>
                 <Reference ReferenceType="HasTypeDefinition">i=63</Reference>
@@ -83,7 +90,8 @@ As an example, we will create a simple object model using UA Modeler and embed t
                 <Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=1002</Reference>
             </References>
         </UAVariable>
-        <UAVariable DataType="UInt32" ParentNodeId="ns=1;i=1002" NodeId="ns=1;i=6004" BrowseName="1:MotorRPM" UserAccessLevel="3" AccessLevel="3">
+        <UAVariable DataType="UInt32" ParentNodeId="ns=1;i=1002" NodeId="ns=1;i=6004"
+                    BrowseName="1:MotorRPM" UserAccessLevel="3" AccessLevel="3">
             <DisplayName>MotorRPM</DisplayName>
             <References>
                 <Reference ReferenceType="HasTypeDefinition">i=63</Reference>
@@ -99,11 +107,14 @@ As an example, we will create a simple object model using UA Modeler and embed t
                 <Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=1002</Reference>
             </References>
         </UAMethod>
-        <UAVariable DataType="Argument" ParentNodeId="ns=1;i=7001" ValueRank="1" NodeId="ns=1;i=6005" ArrayDimensions="1" BrowseName="OutputArguments">
+        <UAVariable DataType="Argument" ParentNodeId="ns=1;i=7001" ValueRank="1"
+                    NodeId="ns=1;i=6005" ArrayDimensions="1"
+                    BrowseName="OutputArguments">
             <DisplayName>OutputArguments</DisplayName>
             <References>
                 <Reference ReferenceType="HasModellingRule">i=78</Reference>
-                <Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=7001</Reference>
+                <Reference ReferenceType="HasProperty"
+                           IsForward="false">ns=1;i=7001</Reference>
                 <Reference ReferenceType="HasTypeDefinition">i=68</Reference>
             </References>
             <Value>
@@ -127,19 +138,25 @@ As an example, we will create a simple object model using UA Modeler and embed t
                 </ListOfExtensionObject>
             </Value>
         </UAVariable>
-        <UAMethod ParentNodeId="ns=1;i=1002" NodeId="ns=1;i=7002" BrowseName="1:stopPump">
+        <UAMethod ParentNodeId="ns=1;i=1002" NodeId="ns=1;i=7002"
+                  BrowseName="1:stopPump">
             <DisplayName>stopPump</DisplayName>
             <References>
                 <Reference ReferenceType="HasModellingRule">i=78</Reference>
                 <Reference ReferenceType="HasProperty">ns=1;i=6006</Reference>
-                <Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=1002</Reference>
+                <Reference ReferenceType="HasComponent"
+                           IsForward="false">ns=1;i=1002</Reference>
             </References>
         </UAMethod>
-        <UAVariable DataType="Argument" ParentNodeId="ns=1;i=7002" ValueRank="1" NodeId="ns=1;i=6006" ArrayDimensions="1" BrowseName="OutputArguments">
+        <UAVariable DataType="Argument" ParentNodeId="ns=1;i=7002" ValueRank="1"
+                    NodeId="ns=1;i=6006" ArrayDimensions="1"
+                    BrowseName="OutputArguments">
             <DisplayName>OutputArguments</DisplayName>
             <References>
                 <Reference ReferenceType="HasModellingRule">i=78</Reference>
-                <Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=7002</Reference>
+                <Reference ReferenceType="HasProperty" IsForward="false">
+                    ns=1;i=7002
+                </Reference>
                 <Reference ReferenceType="HasTypeDefinition">i=68</Reference>
             </References>
             <Value>
@@ -340,10 +357,11 @@ Let's look at an example that will create a pump instance given the newly define
       running = 0;
     }
 
-    UA_StatusCode pumpInstantiationCallback(UA_NodeId objectId, UA_NodeId definitionId, void *handle);
-    UA_StatusCode pumpInstantiationCallback(UA_NodeId objectId, UA_NodeId definitionId, void *handle) {
-      printf("Created new node ns=%d;i=%d according to template ns=%d;i=%d (handle was %d)\n", objectId.namespaceIndex, objectId.identifier.numeric,
-              definitionId.namespaceIndex, definitionId.identifier.numeric, *((UA_Int32 *) handle));
+    static UA_StatusCode pumpInstantiationCallback(UA_NodeId objectId, UA_NodeId definitionId,
+                                                   void *handle) {
+      printf("Created new node ns=%d;i=%d according to template ns=%d;i=%d (handle was %d)\n",
+             objectId.namespaceIndex, objectId.identifier.numeric,
+             definitionId.namespaceIndex, definitionId.identifier.numeric, *((UA_Int32 *) handle));
       return UA_STATUSCODE_GOOD;
     }
 
@@ -447,8 +465,8 @@ Since searching in nodes is a common operation, the high-level branch provides a
     #include "logger_stdout.h"
     #include "networklayer_tcp.h"
 
-    UA_StatusCode nodeIter(UA_NodeId childId, UA_Boolean isInverse, UA_NodeId referenceTypeId, void *handle);
-    UA_StatusCode nodeIter(UA_NodeId childId, UA_Boolean isInverse, UA_NodeId referenceTypeId, void *handle) {  
+    static UA_StatusCode nodeIter(UA_NodeId childId, UA_Boolean isInverse,
+                                  UA_NodeId referenceTypeId, void *handle) {  
       struct {
         UA_Client *client;
         UA_Boolean isAPump;

+ 53 - 50
examples/server_method.c

@@ -18,27 +18,29 @@ UA_Boolean running = true;
 UA_Logger logger = UA_Log_Stdout;
 
 
-// EXAMPLE 1 method
+/* Example 1 */
 static UA_StatusCode
-helloWorldMethod(void *handle, const UA_NodeId objectId, size_t inputSize, const UA_Variant *input,
+helloWorldMethod(void *handle, const UA_NodeId objectId,
+                 size_t inputSize, const UA_Variant *input,
                  size_t outputSize, UA_Variant *output) {
-        UA_String *inputStr = (UA_String*)input->data;
-        UA_String tmp = UA_STRING_ALLOC("Hello ");
-        if(inputStr->length > 0) {
-            tmp.data = realloc(tmp.data, tmp.length + inputStr->length);
-            memcpy(&tmp.data[tmp.length], inputStr->data, inputStr->length);
-            tmp.length += inputStr->length;
-        }
-        UA_Variant_setScalarCopy(output, &tmp, &UA_TYPES[UA_TYPES_STRING]);
-        UA_String_deleteMembers(&tmp);
-        UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "Hello World was called");
-        return UA_STATUSCODE_GOOD;
+    UA_String *inputStr = (UA_String*)input->data;
+    UA_String tmp = UA_STRING_ALLOC("Hello ");
+    if(inputStr->length > 0) {
+        tmp.data = realloc(tmp.data, tmp.length + inputStr->length);
+        memcpy(&tmp.data[tmp.length], inputStr->data, inputStr->length);
+        tmp.length += inputStr->length;
+    }
+    UA_Variant_setScalarCopy(output, &tmp, &UA_TYPES[UA_TYPES_STRING]);
+    UA_String_deleteMembers(&tmp);
+    UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "Hello World was called");
+    return UA_STATUSCODE_GOOD;
 }
 
-// EXAMPLE 2 method
+/* Example 2 */
 static UA_StatusCode
-IncInt32ArrayValuesMethod(void *handle, const UA_NodeId objectId, size_t inputSize,
-                          const UA_Variant *input, size_t outputSize, UA_Variant *output) {
+IncInt32ArrayValuesMethod(void *handle, const UA_NodeId objectId,
+                          size_t inputSize, const UA_Variant *input,
+                          size_t outputSize, UA_Variant *output) {
     UA_Variant_setArrayCopy(output, input->data, 5, &UA_TYPES[UA_TYPES_INT32]);
     for(size_t i = 0; i< input->arrayLength; i++)
         ((UA_Int32*)output->data)[i] = ((UA_Int32*)input->data)[i] + 1;
@@ -46,22 +48,23 @@ IncInt32ArrayValuesMethod(void *handle, const UA_NodeId objectId, size_t inputSi
 }
 
 
-// EXAMPLE 3 method
+/* Example 3 */
 static UA_StatusCode
-fooBarMethod(void *handle, const UA_NodeId objectId, size_t inputSize, const UA_Variant *input,
-                 size_t outputSize, UA_Variant *output) {
-    // Exactly the same as helloWorld, but returns foobar
-        UA_String *inputStr = (UA_String*)input->data;
-        UA_String tmp = UA_STRING_ALLOC("FooBar! ");
-        if(inputStr->length > 0) {
-            tmp.data = realloc(tmp.data, tmp.length + inputStr->length);
-            memcpy(&tmp.data[tmp.length], inputStr->data, inputStr->length);
-            tmp.length += inputStr->length;
-        }
-        UA_Variant_setScalarCopy(output, &tmp, &UA_TYPES[UA_TYPES_STRING]);
-        UA_String_deleteMembers(&tmp);
-        UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "FooBar was called");
-        return UA_STATUSCODE_GOOD;
+fooBarMethod(void *handle, const UA_NodeId objectId,
+             size_t inputSize, const UA_Variant *input,
+             size_t outputSize, UA_Variant *output) {
+    /* the same as helloWorld, but returns foobar */
+    UA_String *inputStr = (UA_String*)input->data;
+    UA_String tmp = UA_STRING_ALLOC("FooBar! ");
+    if(inputStr->length > 0) {
+        tmp.data = realloc(tmp.data, tmp.length + inputStr->length);
+        memcpy(&tmp.data[tmp.length], inputStr->data, inputStr->length);
+        tmp.length += inputStr->length;
+    }
+    UA_Variant_setScalarCopy(output, &tmp, &UA_TYPES[UA_TYPES_STRING]);
+    UA_String_deleteMembers(&tmp);
+    UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "FooBar was called");
+    return UA_STATUSCODE_GOOD;
 }
 
 static void stopHandler(int sign) {
@@ -74,12 +77,13 @@ int main(int argc, char** argv) {
 
     /* initialize the server */
     UA_ServerConfig config = UA_ServerConfig_standard;
-    UA_ServerNetworkLayer nl = UA_ServerNetworkLayerTCP(UA_ConnectionConfig_standard, 16664);
+    UA_ServerNetworkLayer nl;
+    nl = UA_ServerNetworkLayerTCP(UA_ConnectionConfig_standard, 16664);
     config.networkLayers = &nl;
     config.networkLayersSize = 1;
     UA_Server *server = UA_Server_new(config);
 
-    //EXAMPLE 1
+    /* Example 1 */
     /* add the method node with the callback */
     UA_Argument inputArguments1;
     UA_Argument_init(&inputArguments1);
@@ -111,11 +115,9 @@ int main(int argc, char** argv) {
                             UA_QUALIFIEDNAME(1, "hello world"),
                             helloAttr, &helloWorldMethod, NULL,
                             1, &inputArguments1, 1, &outputArguments1, NULL);
-    //END OF EXAMPLE 1
 
-    //EXAMPLE 2
+    /* Example 2 */
     /* add another method node: output argument as 1d Int32 array*/
-    // define input arguments
     UA_Argument inputArguments2;
     UA_Argument_init(&inputArguments2);
     inputArguments2.arrayDimensionsSize = 1;
@@ -128,7 +130,6 @@ int main(int argc, char** argv) {
     inputArguments2.name = UA_STRING("int32 value");
     inputArguments2.valueRank = 1;
 
-    // define output arguments
     UA_Argument outputArguments2;
     UA_Argument_init(&outputArguments2);
     outputArguments2.arrayDimensionsSize = 1;
@@ -136,14 +137,16 @@ int main(int argc, char** argv) {
     pOutputDimensions[0] = 5;
     outputArguments2.arrayDimensions = pOutputDimensions;
     outputArguments2.dataType = UA_TYPES[UA_TYPES_INT32].typeId;
-    outputArguments2.description = UA_LOCALIZEDTEXT("en_US", "increment each array index");
-    outputArguments2.name = UA_STRING("output is the array, each index is incremented by one");
+    outputArguments2.description = UA_LOCALIZEDTEXT("en_US",
+                                                    "increment each array index");
+    outputArguments2.name = UA_STRING("output is the array, "
+                                      "each index is incremented by one");
     outputArguments2.valueRank = 1;
 
     UA_MethodAttributes incAttr;
     UA_MethodAttributes_init(&incAttr);
-    incAttr.description = UA_LOCALIZEDTEXT("en_US","1dArrayExample");
-    incAttr.displayName = UA_LOCALIZEDTEXT("en_US","1dArrayExample");
+    incAttr.description = UA_LOCALIZEDTEXT("en_US", "1dArrayExample");
+    incAttr.displayName = UA_LOCALIZEDTEXT("en_US", "1dArrayExample");
     incAttr.executable = true;
     incAttr.userExecutable = true;
     UA_Server_addMethodNode(server, UA_NODEID_STRING(1, "IncInt32ArrayValues"),
@@ -152,25 +155,25 @@ int main(int argc, char** argv) {
                             UA_QUALIFIEDNAME(1, "IncInt32ArrayValues"),
                             incAttr, &IncInt32ArrayValuesMethod, NULL,
                             1, &inputArguments2, 1, &outputArguments2, NULL);
-    //END OF EXAMPLE 2
 
-    //EXAMPLE 3
+    /* Example 3 */
     UA_MethodAttributes method3Attr;
     UA_MethodAttributes_init(&method3Attr);
-    method3Attr.description = UA_LOCALIZEDTEXT("en_US","FooBar");
-    method3Attr.displayName = UA_LOCALIZEDTEXT("en_US","FooBar");
+    method3Attr.description = UA_LOCALIZEDTEXT("en_US", "FooBar");
+    method3Attr.displayName = UA_LOCALIZEDTEXT("en_US", "FooBar");
     method3Attr.executable = true;
     method3Attr.userExecutable = true;
-    UA_Server_addMethodNode(server, UA_NODEID_STRING(1,"FooBar"),
+    UA_Server_addMethodNode(server, UA_NODEID_STRING(1, "FooBar"),
                             UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
                             UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT),
                             UA_QUALIFIEDNAME(1, "FooBar"),
                             method3Attr, NULL, NULL,
                             1, &inputArguments1, 1, &outputArguments1, NULL);
-    /*  If the method node has no callback (because it was instantiated without one) or
-        if we just want to change it, this can be done with UA_Server_setMethodNode_callback() */
-    UA_Server_setMethodNode_callback(server,  UA_NODEID_NUMERIC(1,62542), &fooBarMethod, NULL);
-    //END OF EXAMPLE 3
+    /* If the method node has no callback (because it was instantiated without
+     * one) or if we just want to change it, this can be done
+     * UA_Server_setMethodNode_callback() */
+    UA_Server_setMethodNode_callback(server,  UA_NODEID_NUMERIC(1,62542),
+                                     &fooBarMethod, NULL);
 
     /* start server */
     UA_StatusCode retval = UA_Server_run(server, &running);

+ 10 - 5
examples/server_variable.c

@@ -21,19 +21,24 @@ static void stopHandler(int sign) {
     running = false;
 }
 
-static void onRead(void *handle, const UA_NodeId nodeid, const UA_Variant *data, const UA_NumericRange *range) {
-    UA_LOG_INFO(logger, UA_LOGCATEGORY_USERLAND, "onRead; handle is: %i", (uintptr_t)handle);
+static void onRead(void *handle, const UA_NodeId nodeid, const UA_Variant *data,
+                   const UA_NumericRange *range) {
+    UA_LOG_INFO(logger, UA_LOGCATEGORY_USERLAND, "onRead; handle is: %i",
+                (uintptr_t)handle);
 }
 
-static void onWrite(void *h, const UA_NodeId nodeid, const UA_Variant *data, const UA_NumericRange *range) {
-    UA_LOG_INFO(logger, UA_LOGCATEGORY_USERLAND, "onWrite; handle: %i", (uintptr_t)h);
+static void onWrite(void *h, const UA_NodeId nodeid, const UA_Variant *data,
+                    const UA_NumericRange *range) {
+    UA_LOG_INFO(logger, UA_LOGCATEGORY_USERLAND, "onWrite; handle: %i",
+                (uintptr_t)h);
 }
 
 int main(int argc, char** argv) {
     signal(SIGINT, stopHandler); /* catches ctrl-c */
 
     UA_ServerConfig config = UA_ServerConfig_standard;
-    UA_ServerNetworkLayer nl = UA_ServerNetworkLayerTCP(UA_ConnectionConfig_standard, 16664);
+    UA_ServerNetworkLayer nl;
+    nl = UA_ServerNetworkLayerTCP(UA_ConnectionConfig_standard, 16664);
     config.networkLayers = &nl;
     config.networkLayersSize = 1;
     UA_Server *server = UA_Server_new(config);

+ 367 - 157
include/ua_client_highlevel.h

@@ -47,96 +47,176 @@ extern "C" {
  * the regular service to read several attributes at once. */
 /* Don't call this function, use the typed versions */
 UA_StatusCode UA_EXPORT
-__UA_Client_readAttribute(UA_Client *client, const UA_NodeId *nodeId, UA_AttributeId attributeId,
-                          void *out, const UA_DataType *outDataType);
+__UA_Client_readAttribute(UA_Client *client, const UA_NodeId *nodeId,
+                          UA_AttributeId attributeId, void *out,
+                          const UA_DataType *outDataType);
 
 static UA_INLINE UA_StatusCode
-UA_Client_readNodeIdAttribute(UA_Client *client, const UA_NodeId nodeId, UA_NodeId *outNodeId) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_NODEID, outNodeId, &UA_TYPES[UA_TYPES_NODEID]); }
+UA_Client_readNodeIdAttribute(UA_Client *client, const UA_NodeId nodeId,
+                              UA_NodeId *outNodeId) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_NODEID,
+                                     outNodeId, &UA_TYPES[UA_TYPES_NODEID]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readNodeClassAttribute(UA_Client *client, const UA_NodeId nodeId, UA_NodeClass *outNodeClass) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_NODECLASS, outNodeClass, &UA_TYPES[UA_TYPES_NODECLASS]); }
+UA_Client_readNodeClassAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                 UA_NodeClass *outNodeClass) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_NODECLASS,
+                                     outNodeClass, &UA_TYPES[UA_TYPES_NODECLASS]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readBrowseNameAttribute(UA_Client *client, const UA_NodeId nodeId, UA_QualifiedName *outBrowseName) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_BROWSENAME, outBrowseName, &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); }
+UA_Client_readBrowseNameAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                  UA_QualifiedName *outBrowseName) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_BROWSENAME,
+                                     outBrowseName,
+                                     &UA_TYPES[UA_TYPES_QUALIFIEDNAME]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readDisplayNameAttribute(UA_Client *client, const UA_NodeId nodeId, UA_LocalizedText *outDisplayName) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME, outDisplayName, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); }
+UA_Client_readDisplayNameAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                   UA_LocalizedText *outDisplayName) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME,
+                                     outDisplayName,
+                                     &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readDescriptionAttribute(UA_Client *client, const UA_NodeId nodeId, UA_LocalizedText *outDescription) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_DESCRIPTION, outDescription, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); }
+UA_Client_readDescriptionAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                   UA_LocalizedText *outDescription) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_DESCRIPTION,
+                                     outDescription,
+                                     &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId, UA_UInt32 *outWriteMask) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_WRITEMASK, outWriteMask, &UA_TYPES[UA_TYPES_UINT32]); }
+UA_Client_readWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                 UA_UInt32 *outWriteMask) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_WRITEMASK,
+                                     outWriteMask, &UA_TYPES[UA_TYPES_UINT32]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readUserWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId, UA_UInt32 *outUserWriteMask) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_USERWRITEMASK, outUserWriteMask, &UA_TYPES[UA_TYPES_UINT32]); }
+UA_Client_readUserWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                     UA_UInt32 *outUserWriteMask) {
+    return __UA_Client_readAttribute(client, &nodeId,
+                                     UA_ATTRIBUTEID_USERWRITEMASK,
+                                     outUserWriteMask,
+                                     &UA_TYPES[UA_TYPES_UINT32]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readIsAbstractAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Boolean *outIsAbstract) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_ISABSTRACT, outIsAbstract, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_readIsAbstractAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                  UA_Boolean *outIsAbstract) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_ISABSTRACT,
+                                     outIsAbstract, &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readSymmetricAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Boolean *outSymmetric) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_SYMMETRIC, outSymmetric, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_readSymmetricAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                 UA_Boolean *outSymmetric) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_SYMMETRIC,
+                                     outSymmetric, &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readInverseNameAttribute(UA_Client *client, const UA_NodeId nodeId, UA_LocalizedText *outInverseName) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_INVERSENAME, outInverseName, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); }
+UA_Client_readInverseNameAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                   UA_LocalizedText *outInverseName) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_INVERSENAME,
+                                     outInverseName,
+                                     &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readContainsNoLoopsAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Boolean *outContainsNoLoops) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_CONTAINSNOLOOPS, outContainsNoLoops, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_readContainsNoLoopsAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                       UA_Boolean *outContainsNoLoops) {
+    return __UA_Client_readAttribute(client, &nodeId,
+                                     UA_ATTRIBUTEID_CONTAINSNOLOOPS,
+                                     outContainsNoLoops,
+                                     &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readEventNotifierAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Byte *outEventNotifier) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER, outEventNotifier, &UA_TYPES[UA_TYPES_BYTE]); }
+UA_Client_readEventNotifierAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                     UA_Byte *outEventNotifier) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER,
+                                     outEventNotifier, &UA_TYPES[UA_TYPES_BYTE]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readValueAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Variant *outValue) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUE, outValue, &UA_TYPES[UA_TYPES_VARIANT]); }
+UA_Client_readValueAttribute(UA_Client *client, const UA_NodeId nodeId,
+                             UA_Variant *outValue) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUE,
+                                     outValue, &UA_TYPES[UA_TYPES_VARIANT]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readDataTypeAttribute(UA_Client *client, const UA_NodeId nodeId, UA_NodeId *outDataType) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_DATATYPE, outDataType, &UA_TYPES[UA_TYPES_NODEID]); }
+UA_Client_readDataTypeAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                UA_NodeId *outDataType) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_DATATYPE,
+                                     outDataType, &UA_TYPES[UA_TYPES_NODEID]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readValueRankAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Int32 *outValueRank) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUERANK, outValueRank, &UA_TYPES[UA_TYPES_INT32]); }
+UA_Client_readValueRankAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                 UA_Int32 *outValueRank) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUERANK,
+                                     outValueRank, &UA_TYPES[UA_TYPES_INT32]);
+}
 
 UA_StatusCode UA_EXPORT
 UA_Client_readArrayDimensionsAttribute(UA_Client *client, const UA_NodeId nodeId,
-                                       UA_Int32 **outArrayDimensions, size_t *outArrayDimensionsSize);
+                                       UA_Int32 **outArrayDimensions,
+                                       size_t *outArrayDimensionsSize);
 
 static UA_INLINE UA_StatusCode
-UA_Client_readAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId, UA_UInt32 *outAccessLevel) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL, outAccessLevel, &UA_TYPES[UA_TYPES_UINT32]); }
+UA_Client_readAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                   UA_UInt32 *outAccessLevel) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL,
+                                     outAccessLevel, &UA_TYPES[UA_TYPES_UINT32]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readUserAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId, UA_UInt32 *outUserAccessLevel) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_USERACCESSLEVEL, outUserAccessLevel, &UA_TYPES[UA_TYPES_UINT32]); }
+UA_Client_readUserAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                       UA_UInt32 *outUserAccessLevel) {
+    return __UA_Client_readAttribute(client, &nodeId,
+                                     UA_ATTRIBUTEID_USERACCESSLEVEL,
+                                     outUserAccessLevel,
+                                     &UA_TYPES[UA_TYPES_UINT32]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readMinimumSamplingIntervalAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Double *outMinimumSamplingInterval) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, outMinimumSamplingInterval, &UA_TYPES[UA_TYPES_DOUBLE]); }
+UA_Client_readMinimumSamplingIntervalAttribute(UA_Client *client,
+                                               const UA_NodeId nodeId,
+                                               UA_Double *outMinSamplingInterval) {
+    return __UA_Client_readAttribute(client, &nodeId,
+                                     UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL,
+                                     outMinSamplingInterval,
+                                     &UA_TYPES[UA_TYPES_DOUBLE]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readHistorizingAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Boolean *outHistorizing) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_HISTORIZING, outHistorizing, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_readHistorizingAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                   UA_Boolean *outHistorizing) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_HISTORIZING,
+                                     outHistorizing, &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readExecutableAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Boolean *outExecutable) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_EXECUTABLE, outExecutable, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_readExecutableAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                  UA_Boolean *outExecutable) {
+    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_EXECUTABLE,
+                                     outExecutable, &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_readUserExecutableAttribute(UA_Client *client, const UA_NodeId nodeId, UA_Boolean *outUserExecutable) {
-    return __UA_Client_readAttribute(client, &nodeId, UA_ATTRIBUTEID_USEREXECUTABLE, outUserExecutable, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_readUserExecutableAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                      UA_Boolean *outUserExecutable) {
+    return __UA_Client_readAttribute(client, &nodeId,
+                                     UA_ATTRIBUTEID_USEREXECUTABLE,
+                                     outUserExecutable,
+                                     &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 /**
  * Write Attributes
@@ -150,99 +230,180 @@ __UA_Client_writeAttribute(UA_Client *client, const UA_NodeId *nodeId,
                            const UA_DataType *inDataType);
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeNodeIdAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_NodeId *newNodeId) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_NODEID, newNodeId, &UA_TYPES[UA_TYPES_NODEID]); }
+UA_Client_writeNodeIdAttribute(UA_Client *client, const UA_NodeId nodeId,
+                               const UA_NodeId *newNodeId) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_NODEID,
+                                      newNodeId, &UA_TYPES[UA_TYPES_NODEID]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeNodeClassAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_NodeClass *newNodeClass) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_NODECLASS, newNodeClass, &UA_TYPES[UA_TYPES_NODECLASS]); }
+UA_Client_writeNodeClassAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                  const UA_NodeClass *newNodeClass) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_NODECLASS,
+                                      newNodeClass, &UA_TYPES[UA_TYPES_NODECLASS]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeBrowseNameAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_QualifiedName *newBrowseName) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_BROWSENAME, newBrowseName, &UA_TYPES[UA_TYPES_QUALIFIEDNAME]); }
+UA_Client_writeBrowseNameAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                   const UA_QualifiedName *newBrowseName) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_BROWSENAME,
+                                      newBrowseName,
+                                      &UA_TYPES[UA_TYPES_QUALIFIEDNAME]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeDisplayNameAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_LocalizedText *newDisplayName) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME, newDisplayName, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); }
+UA_Client_writeDisplayNameAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                    const UA_LocalizedText *newDisplayName) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_DISPLAYNAME,
+                                      newDisplayName,
+                                      &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeDescriptionAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_LocalizedText *newDescription) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_DESCRIPTION, newDescription, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); }
+UA_Client_writeDescriptionAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                    const UA_LocalizedText *newDescription) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_DESCRIPTION,
+                                      newDescription,
+                                      &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_UInt32 *newWriteMask) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_WRITEMASK, newWriteMask, &UA_TYPES[UA_TYPES_UINT32]); }
+UA_Client_writeWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                  const UA_UInt32 *newWriteMask) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_WRITEMASK,
+                                      newWriteMask, &UA_TYPES[UA_TYPES_UINT32]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeUserWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_UInt32 *newUserWriteMask) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_USERWRITEMASK, newUserWriteMask, &UA_TYPES[UA_TYPES_UINT32]); }
+UA_Client_writeUserWriteMaskAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                      const UA_UInt32 *newUserWriteMask) {
+    return __UA_Client_writeAttribute(client, &nodeId,
+                                      UA_ATTRIBUTEID_USERWRITEMASK,
+                                      newUserWriteMask,
+                                      &UA_TYPES[UA_TYPES_UINT32]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeIsAbstractAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Boolean *newIsAbstract) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_ISABSTRACT, newIsAbstract, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_writeIsAbstractAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                   const UA_Boolean *newIsAbstract) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_ISABSTRACT,
+                                      newIsAbstract, &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeSymmetricAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Boolean *newSymmetric) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_SYMMETRIC, newSymmetric, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_writeSymmetricAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                  const UA_Boolean *newSymmetric) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_SYMMETRIC,
+                                      newSymmetric, &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeInverseNameAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_LocalizedText *newInverseName) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_INVERSENAME, newInverseName, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]); }
+UA_Client_writeInverseNameAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                    const UA_LocalizedText *newInverseName) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_INVERSENAME,
+                                      newInverseName,
+                                      &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeContainsNoLoopsAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Boolean *newContainsNoLoops) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_CONTAINSNOLOOPS, newContainsNoLoops, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_writeContainsNoLoopsAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                        const UA_Boolean *newContainsNoLoops) {
+    return __UA_Client_writeAttribute(client, &nodeId,
+                                      UA_ATTRIBUTEID_CONTAINSNOLOOPS,
+                                      newContainsNoLoops,
+                                      &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeEventNotifierAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Byte *newEventNotifier) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_EVENTNOTIFIER, newEventNotifier, &UA_TYPES[UA_TYPES_BYTE]); }
+UA_Client_writeEventNotifierAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                      const UA_Byte *newEventNotifier) {
+    return __UA_Client_writeAttribute(client, &nodeId,
+                                      UA_ATTRIBUTEID_EVENTNOTIFIER,
+                                      newEventNotifier,
+                                      &UA_TYPES[UA_TYPES_BYTE]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeValueAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Variant *newValue) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUE, newValue, &UA_TYPES[UA_TYPES_VARIANT]); }
+UA_Client_writeValueAttribute(UA_Client *client, const UA_NodeId nodeId,
+                              const UA_Variant *newValue) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUE,
+                                      newValue, &UA_TYPES[UA_TYPES_VARIANT]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeDataTypeAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_NodeId *newDataType) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_DATATYPE, newDataType, &UA_TYPES[UA_TYPES_NODEID]); }
+UA_Client_writeDataTypeAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                 const UA_NodeId *newDataType) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_DATATYPE,
+                                      newDataType, &UA_TYPES[UA_TYPES_NODEID]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeValueRankAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Int32 *newValueRank) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUERANK, newValueRank, &UA_TYPES[UA_TYPES_INT32]); }
+UA_Client_writeValueRankAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                  const UA_Int32 *newValueRank) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_VALUERANK,
+                                      newValueRank, &UA_TYPES[UA_TYPES_INT32]);
+}
 
 UA_StatusCode UA_EXPORT
 UA_Client_writeArrayDimensionsAttribute(UA_Client *client, const UA_NodeId nodeId,
-                                        const UA_Int32 *newArrayDimensions, size_t newArrayDimensionsSize);
+                                        const UA_Int32 *newArrayDimensions,
+                                        size_t newArrayDimensionsSize);
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_UInt32 *newAccessLevel) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL, newAccessLevel, &UA_TYPES[UA_TYPES_UINT32]); }
+UA_Client_writeAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                    const UA_UInt32 *newAccessLevel) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_ACCESSLEVEL,
+                                      newAccessLevel, &UA_TYPES[UA_TYPES_UINT32]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeUserAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_UInt32 *newUserAccessLevel) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_USERACCESSLEVEL, newUserAccessLevel, &UA_TYPES[UA_TYPES_UINT32]); }
+UA_Client_writeUserAccessLevelAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                        const UA_UInt32 *newUserAccessLevel) {
+    return __UA_Client_writeAttribute(client, &nodeId,
+                                      UA_ATTRIBUTEID_USERACCESSLEVEL,
+                                      newUserAccessLevel,
+                                      &UA_TYPES[UA_TYPES_UINT32]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeMinimumSamplingIntervalAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Double *newMinimumSamplingInterval) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, newMinimumSamplingInterval, &UA_TYPES[UA_TYPES_DOUBLE]); }
+UA_Client_writeMinimumSamplingIntervalAttribute(UA_Client *client,
+                                                const UA_NodeId nodeId,
+                                                const UA_Double *newMinInterval) {
+    return __UA_Client_writeAttribute(client, &nodeId,
+                                      UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL,
+                                      newMinInterval, &UA_TYPES[UA_TYPES_DOUBLE]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeHistorizingAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Boolean *newHistorizing) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_HISTORIZING, newHistorizing, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_writeHistorizingAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                    const UA_Boolean *newHistorizing) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_HISTORIZING,
+                                      newHistorizing, &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeExecutableAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Boolean *newExecutable) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_EXECUTABLE, newExecutable, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_writeExecutableAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                   const UA_Boolean *newExecutable) {
+    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_EXECUTABLE,
+                                      newExecutable, &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 static UA_INLINE UA_StatusCode
-UA_Client_writeUserExecutableAttribute(UA_Client *client, const UA_NodeId nodeId, const UA_Boolean *newUserExecutable) {
-    return __UA_Client_writeAttribute(client, &nodeId, UA_ATTRIBUTEID_USEREXECUTABLE, newUserExecutable, &UA_TYPES[UA_TYPES_BOOLEAN]); }
+UA_Client_writeUserExecutableAttribute(UA_Client *client, const UA_NodeId nodeId,
+                                       const UA_Boolean *newUserExecutable) {
+    return __UA_Client_writeAttribute(client, &nodeId,
+                                      UA_ATTRIBUTEID_USEREXECUTABLE,
+                                      newUserExecutable,
+                                      &UA_TYPES[UA_TYPES_BOOLEAN]);
+}
 
 /**
  * Method Calling
  * ============== */
 UA_StatusCode UA_EXPORT
-UA_Client_call(UA_Client *client, const UA_NodeId objectId, const UA_NodeId methodId,
-               size_t inputSize, const UA_Variant *input, size_t *outputSize, UA_Variant **output);
+UA_Client_call(UA_Client *client, const UA_NodeId objectId,
+               const UA_NodeId methodId, size_t inputSize, const UA_Variant *input,
+               size_t *outputSize, UA_Variant **output);
 
 /**
  * Node Management
@@ -251,105 +412,145 @@ UA_Client_call(UA_Client *client, const UA_NodeId objectId, const UA_NodeId meth
  * See the section on :ref:`server-side node management <addnodes>`.
  */
 UA_StatusCode UA_EXPORT
-UA_Client_addReference(UA_Client *client, const UA_NodeId sourceNodeId, const UA_NodeId referenceTypeId,
-                       UA_Boolean isForward, const UA_String targetServerUri,
-                       const UA_ExpandedNodeId targetNodeId, UA_NodeClass targetNodeClass);
+UA_Client_addReference(UA_Client *client, const UA_NodeId sourceNodeId,
+                       const UA_NodeId referenceTypeId, UA_Boolean isForward,
+                       const UA_String targetServerUri,
+                       const UA_ExpandedNodeId targetNodeId,
+                       UA_NodeClass targetNodeClass);
 
 UA_StatusCode UA_EXPORT
-UA_Client_deleteReference(UA_Client *client, const UA_NodeId sourceNodeId, const UA_NodeId referenceTypeId,
-                          UA_Boolean isForward, const UA_ExpandedNodeId targetNodeId,
+UA_Client_deleteReference(UA_Client *client, const UA_NodeId sourceNodeId,
+                          const UA_NodeId referenceTypeId, UA_Boolean isForward,
+                          const UA_ExpandedNodeId targetNodeId,
                           UA_Boolean deleteBidirectional);
 
 UA_StatusCode UA_EXPORT
-UA_Client_deleteNode(UA_Client *client, const UA_NodeId nodeId, UA_Boolean deleteTargetReferences);
+UA_Client_deleteNode(UA_Client *client, const UA_NodeId nodeId,
+                     UA_Boolean deleteTargetReferences);
 
 /* Don't call this function, use the typed versions */
 UA_StatusCode UA_EXPORT
 __UA_Client_addNode(UA_Client *client, const UA_NodeClass nodeClass,
-                    const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId,
-                    const UA_NodeId referenceTypeId, const UA_QualifiedName browseName,
+                    const UA_NodeId requestedNewNodeId,
+                    const UA_NodeId parentNodeId,
+                    const UA_NodeId referenceTypeId,
+                    const UA_QualifiedName browseName,
                     const UA_NodeId typeDefinition, const UA_NodeAttributes *attr,
                     const UA_DataType *attributeType, UA_NodeId *outNewNodeId);
 
 static UA_INLINE UA_StatusCode
 UA_Client_addVariableNode(UA_Client *client, const UA_NodeId requestedNewNodeId,
-                          const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
-                          const UA_QualifiedName browseName, const UA_NodeId typeDefinition,
-                          const UA_VariableAttributes attr, UA_NodeId *outNewNodeId) {
+                          const UA_NodeId parentNodeId,
+                          const UA_NodeId referenceTypeId,
+                          const UA_QualifiedName browseName,
+                          const UA_NodeId typeDefinition,
+                          const UA_VariableAttributes attr,
+                          UA_NodeId *outNewNodeId) {
     return __UA_Client_addNode(client, UA_NODECLASS_VARIABLE, requestedNewNodeId,
-                               parentNodeId, referenceTypeId, browseName, typeDefinition,
-                               (const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],
-                               outNewNodeId); }
-
-static UA_INLINE UA_StatusCode
-UA_Client_addVariableTypeNode(UA_Client *client, const UA_NodeId requestedNewNodeId,
-                              const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
-                              const UA_QualifiedName browseName, const UA_VariableTypeAttributes attr,
+                               parentNodeId, referenceTypeId, browseName,
+                               typeDefinition, (const UA_NodeAttributes*)&attr,
+                               &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES],
+                               outNewNodeId);
+}
+
+static UA_INLINE UA_StatusCode
+UA_Client_addVariableTypeNode(UA_Client *client,
+                              const UA_NodeId requestedNewNodeId,
+                              const UA_NodeId parentNodeId,
+                              const UA_NodeId referenceTypeId,
+                              const UA_QualifiedName browseName,
+                              const UA_VariableTypeAttributes attr,
                               UA_NodeId *outNewNodeId) {
-    return __UA_Client_addNode(client, UA_NODECLASS_VARIABLETYPE, requestedNewNodeId,
-                               parentNodeId, referenceTypeId, browseName, UA_NODEID_NULL,
-                               (const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],
-                               outNewNodeId); }
+    return __UA_Client_addNode(client, UA_NODECLASS_VARIABLETYPE,
+                               requestedNewNodeId,
+                               parentNodeId, referenceTypeId, browseName,
+                               UA_NODEID_NULL, (const UA_NodeAttributes*)&attr,
+                               &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES],
+                               outNewNodeId);
+}
 
 static UA_INLINE UA_StatusCode
 UA_Client_addObjectNode(UA_Client *client, const UA_NodeId requestedNewNodeId,
-                        const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
-                        const UA_QualifiedName browseName, const UA_NodeId typeDefinition,
+                        const UA_NodeId parentNodeId,
+                        const UA_NodeId referenceTypeId,
+                        const UA_QualifiedName browseName,
+                        const UA_NodeId typeDefinition,
                         const UA_ObjectAttributes attr, UA_NodeId *outNewNodeId) {
     return __UA_Client_addNode(client, UA_NODECLASS_OBJECT, requestedNewNodeId,
-                               parentNodeId, referenceTypeId, browseName, typeDefinition,
-                               (const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES],
-                               outNewNodeId); }
+                               parentNodeId, referenceTypeId, browseName,
+                               typeDefinition, (const UA_NodeAttributes*)&attr,
+                               &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES], outNewNodeId);
+}
 
 static UA_INLINE UA_StatusCode
 UA_Client_addObjectTypeNode(UA_Client *client, const UA_NodeId requestedNewNodeId,
-                            const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
-                            const UA_QualifiedName browseName, const UA_ObjectTypeAttributes attr,
+                            const UA_NodeId parentNodeId,
+                            const UA_NodeId referenceTypeId,
+                            const UA_QualifiedName browseName,
+                            const UA_ObjectTypeAttributes attr,
                             UA_NodeId *outNewNodeId) {
     return __UA_Client_addNode(client, UA_NODECLASS_OBJECTTYPE, requestedNewNodeId,
-                               parentNodeId, referenceTypeId, browseName, UA_NODEID_NULL,
-                               (const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],
-                               outNewNodeId); }
+                               parentNodeId, referenceTypeId, browseName,
+                               UA_NODEID_NULL, (const UA_NodeAttributes*)&attr,
+                               &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES],
+                               outNewNodeId);
+}
 
 static UA_INLINE UA_StatusCode
 UA_Client_addViewNode(UA_Client *client, const UA_NodeId requestedNewNodeId,
-                      const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
-                      const UA_QualifiedName browseName, const UA_ViewAttributes attr,
+                      const UA_NodeId parentNodeId,
+                      const UA_NodeId referenceTypeId,
+                      const UA_QualifiedName browseName,
+                      const UA_ViewAttributes attr,
                       UA_NodeId *outNewNodeId) {
     return __UA_Client_addNode(client, UA_NODECLASS_VIEW, requestedNewNodeId,
-                               parentNodeId, referenceTypeId, browseName, UA_NODEID_NULL,
-                               (const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_VIEWATTRIBUTES],
-                               outNewNodeId); }
-
-static UA_INLINE UA_StatusCode
-UA_Client_addReferenceTypeNode(UA_Client *client, const UA_NodeId requestedNewNodeId,
-                               const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
-                               const UA_QualifiedName browseName, const UA_ReferenceTypeAttributes attr,
+                               parentNodeId, referenceTypeId, browseName,
+                               UA_NODEID_NULL, (const UA_NodeAttributes*)&attr,
+                               &UA_TYPES[UA_TYPES_VIEWATTRIBUTES], outNewNodeId);
+}
+
+static UA_INLINE UA_StatusCode
+UA_Client_addReferenceTypeNode(UA_Client *client,
+                               const UA_NodeId requestedNewNodeId,
+                               const UA_NodeId parentNodeId,
+                               const UA_NodeId referenceTypeId,
+                               const UA_QualifiedName browseName,
+                               const UA_ReferenceTypeAttributes attr,
                                UA_NodeId *outNewNodeId) {
-    return __UA_Client_addNode(client, UA_NODECLASS_REFERENCETYPE, requestedNewNodeId,
-                               parentNodeId, referenceTypeId, browseName, UA_NODEID_NULL,
-                               (const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES],
-                               outNewNodeId); }
+    return __UA_Client_addNode(client, UA_NODECLASS_REFERENCETYPE,
+                               requestedNewNodeId,
+                               parentNodeId, referenceTypeId, browseName,
+                               UA_NODEID_NULL, (const UA_NodeAttributes*)&attr,
+                               &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES],
+                               outNewNodeId);
+}
 
 static UA_INLINE UA_StatusCode
 UA_Client_addDataTypeNode(UA_Client *client, const UA_NodeId requestedNewNodeId,
-                          const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
-                          const UA_QualifiedName browseName, const UA_DataTypeAttributes attr,
+                          const UA_NodeId parentNodeId,
+                          const UA_NodeId referenceTypeId,
+                          const UA_QualifiedName browseName,
+                          const UA_DataTypeAttributes attr,
                           UA_NodeId *outNewNodeId) {
     return __UA_Client_addNode(client, UA_NODECLASS_DATATYPE, requestedNewNodeId,
-                               parentNodeId, referenceTypeId, browseName, UA_NODEID_NULL,
-                               (const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],
-                               outNewNodeId); }
+                               parentNodeId, referenceTypeId, browseName,
+                               UA_NODEID_NULL, (const UA_NodeAttributes*)&attr,
+                               &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES],
+                               outNewNodeId);
+}
 
 static UA_INLINE UA_StatusCode
 UA_Client_addMethodNode(UA_Client *client, const UA_NodeId requestedNewNodeId,
-                          const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
-                          const UA_QualifiedName browseName, const UA_MethodAttributes attr,
-                          UA_NodeId *outNewNodeId) {
+                        const UA_NodeId parentNodeId,
+                        const UA_NodeId referenceTypeId,
+                        const UA_QualifiedName browseName,
+                        const UA_MethodAttributes attr,
+                        UA_NodeId *outNewNodeId) {
     return __UA_Client_addNode(client, UA_NODECLASS_METHOD, requestedNewNodeId,
-                               parentNodeId, referenceTypeId, browseName, UA_NODEID_NULL,
-                               (const UA_NodeAttributes*)&attr, &UA_TYPES[UA_TYPES_METHODATTRIBUTES],
-                               outNewNodeId); }
+                               parentNodeId, referenceTypeId, browseName,
+                               UA_NODEID_NULL, (const UA_NodeAttributes*)&attr,
+                               &UA_TYPES[UA_TYPES_METHODATTRIBUTES], outNewNodeId);
+}
 
 /**
  * .. _client-subscriptions:
@@ -382,18 +583,24 @@ UA_Client_Subscriptions_new(UA_Client *client, UA_SubscriptionSettings settings,
 UA_StatusCode UA_EXPORT
 UA_Client_Subscriptions_remove(UA_Client *client, UA_UInt32 subscriptionId);
 
-UA_StatusCode UA_EXPORT UA_Client_Subscriptions_manuallySendPublishRequest(UA_Client *client);
+UA_StatusCode UA_EXPORT
+UA_Client_Subscriptions_manuallySendPublishRequest(UA_Client *client);
 
-typedef void (*UA_MonitoredItemHandlingFunction) (UA_UInt32 monId, UA_DataValue *value, void *context);
+typedef void (*UA_MonitoredItemHandlingFunction)(UA_UInt32 monId,
+                                                 UA_DataValue *value,
+                                                 void *context);
 
 UA_StatusCode UA_EXPORT
-UA_Client_Subscriptions_addMonitoredItem(UA_Client *client, UA_UInt32 subscriptionId,
+UA_Client_Subscriptions_addMonitoredItem(UA_Client *client,
+                                         UA_UInt32 subscriptionId,
                                          UA_NodeId nodeId, UA_UInt32 attributeID,
-                                         UA_MonitoredItemHandlingFunction handlingFunction,
-                                         void *handlingContext, UA_UInt32 *newMonitoredItemId);
+                                         UA_MonitoredItemHandlingFunction hFunc,
+                                         void *handlingContext,
+                                         UA_UInt32 *newMonitoredItemId);
 
 UA_StatusCode UA_EXPORT
-UA_Client_Subscriptions_removeMonitoredItem(UA_Client *client, UA_UInt32 subscriptionId,
+UA_Client_Subscriptions_removeMonitoredItem(UA_Client *client,
+                                            UA_UInt32 subscriptionId,
                                             UA_UInt32 monitoredItemId);
 
 #endif
@@ -409,14 +616,17 @@ UA_Client_Subscriptions_removeMonitoredItem(UA_Client *client, UA_UInt32 subscri
  *        in case of an error
  * @return Indicates whether the operation succeeded or returns an error code */
 UA_StatusCode UA_EXPORT
-UA_Client_NamespaceGetIndex(UA_Client *client, UA_String *namespaceUri, UA_UInt16 *namespaceIndex);
+UA_Client_NamespaceGetIndex(UA_Client *client, UA_String *namespaceUri,
+                            UA_UInt16 *namespaceIndex);
 
 #ifndef HAVE_NODEITER_CALLBACK
 #define HAVE_NODEITER_CALLBACK
 /* Iterate over all nodes referenced by parentNodeId by calling the callback
    function for each child node */
-typedef UA_StatusCode (*UA_NodeIteratorCallback)(UA_NodeId childId, UA_Boolean isInverse,
-                                                  UA_NodeId referenceTypeId, void *handle);
+typedef UA_StatusCode (*UA_NodeIteratorCallback)(UA_NodeId childId,
+                                                 UA_Boolean isInverse,
+                                                 UA_NodeId referenceTypeId,
+                                                 void *handle);
 #endif
 
 UA_StatusCode UA_EXPORT

+ 2 - 1
include/ua_connection.h

@@ -104,7 +104,8 @@ struct UA_Connection {
      *         can be repeated, UA_STATUSCODE_GOOD if it succeeded and
      *         UA_STATUSCODE_BADCONNECTIONCLOSED if the connection was
      *         closed. */
-    UA_StatusCode (*recv)(UA_Connection *connection, UA_ByteString *response, UA_UInt32 timeout);
+    UA_StatusCode (*recv)(UA_Connection *connection, UA_ByteString *response,
+                          UA_UInt32 timeout);
 
     /* Release the buffer of a received message */
     void (*releaseRecvBuffer)(UA_Connection *connection, UA_ByteString *buf);

+ 8 - 7
include/ua_log.h

@@ -58,7 +58,8 @@ typedef enum {
  *
  * Do not use the logger directly but make use of the following macros that take
  * the minimum log-level defined in ua_config.h into account. */
-typedef void (*UA_Logger)(UA_LogLevel level, UA_LogCategory category, const char *msg, ...);
+typedef void (*UA_Logger)(UA_LogLevel level, UA_LogCategory category,
+                          const char *msg, ...);
 
 #if UA_LOGLEVEL <= 100
 #define UA_LOG_TRACE(LOGGER, CATEGORY, ...) do { \
@@ -106,12 +107,12 @@ typedef void (*UA_Logger)(UA_LogLevel level, UA_LogCategory category, const char
  * Convenience macros for complex types
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
 #define UA_PRINTF_GUID_FORMAT "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"
-#define UA_PRINTF_GUID_DATA(GUID) (GUID).identifier.guid.data1, (GUID).identifier.guid.data2, \
-        (GUID).identifier.guid.data3, (GUID).identifier.guid.data4[0],  \
-        (GUID).identifier.guid.data4[1], (GUID).identifier.guid.data4[2], \
-        (GUID).identifier.guid.data4[3], (GUID).identifier.guid.data4[4], \
-        (GUID).identifier.guid.data4[5], (GUID).identifier.guid.data4[6], \
-        (GUID).identifier.guid.data4[7]
+#define UA_PRINTF_GUID_DATA(GUID) (GUID).identifier.guid.data1,     \
+        (GUID).identifier.guid.data2, (GUID).identifier.guid.data3, \
+        (GUID).identifier.guid.data4[0], (GUID).identifier.guid.data4[1], \
+        (GUID).identifier.guid.data4[2], (GUID).identifier.guid.data4[3], \
+        (GUID).identifier.guid.data4[4], (GUID).identifier.guid.data4[5], \
+        (GUID).identifier.guid.data4[6], (GUID).identifier.guid.data4[7]
 
 #define UA_PRINTF_STRING_FORMAT "\"%.*s\""
 #define UA_PRINTF_STRING_DATA(STRING) (STRING).length, (STRING).data

+ 16 - 8
src/server/ua_nodestore.h

@@ -36,14 +36,22 @@ void UA_NodeStore_delete(UA_NodeStore *ns);
  * added to the nodestore.) */
 /* Create an editable node of the given NodeClass. */
 UA_Node * UA_NodeStore_newNode(UA_NodeClass nodeClass);
-#define UA_NodeStore_newObjectNode() (UA_ObjectNode*)UA_NodeStore_newNode(UA_NODECLASS_OBJECT)
-#define UA_NodeStore_newVariableNode() (UA_VariableNode*)UA_NodeStore_newNode(UA_NODECLASS_VARIABLE)
-#define UA_NodeStore_newMethodNode() (UA_MethodNode*)UA_NodeStore_newNode(UA_NODECLASS_METHOD)
-#define UA_NodeStore_newObjectTypeNode() (UA_ObjectTypeNode*)UA_NodeStore_newNode(UA_NODECLASS_OBJECTTYPE)
-#define UA_NodeStore_newVariableTypeNode() (UA_VariableTypeNode*)UA_NodeStore_newNode(UA_NODECLASS_VARIABLETYPE)
-#define UA_NodeStore_newReferenceTypeNode() (UA_ReferenceTypeNode*)UA_NodeStore_newNode(UA_NODECLASS_REFERENCETYPE)
-#define UA_NodeStore_newDataTypeNode() (UA_DataTypeNode*)UA_NodeStore_newNode(UA_NODECLASS_DATATYPE)
-#define UA_NodeStore_newViewNode() (UA_ViewNode*)UA_NodeStore_newNode(UA_NODECLASS_VIEW)
+#define UA_NodeStore_newObjectNode() \
+	(UA_ObjectNode*)UA_NodeStore_newNode(UA_NODECLASS_OBJECT)
+#define UA_NodeStore_newVariableNode() \
+	(UA_VariableNode*)UA_NodeStore_newNode(UA_NODECLASS_VARIABLE)
+#define UA_NodeStore_newMethodNode() \
+	(UA_MethodNode*)UA_NodeStore_newNode(UA_NODECLASS_METHOD)
+#define UA_NodeStore_newObjectTypeNode() \
+	(UA_ObjectTypeNode*)UA_NodeStore_newNode(UA_NODECLASS_OBJECTTYPE)
+#define UA_NodeStore_newVariableTypeNode() \
+	(UA_VariableTypeNode*)UA_NodeStore_newNode(UA_NODECLASS_VARIABLETYPE)
+#define UA_NodeStore_newReferenceTypeNode() \
+	(UA_ReferenceTypeNode*)UA_NodeStore_newNode(UA_NODECLASS_REFERENCETYPE)
+#define UA_NodeStore_newDataTypeNode() \
+	(UA_DataTypeNode*)UA_NodeStore_newNode(UA_NODECLASS_DATATYPE)
+#define UA_NodeStore_newViewNode() \
+	(UA_ViewNode*)UA_NodeStore_newNode(UA_NODECLASS_VIEW)
 
 /* Delete an editable node. */
 void UA_NodeStore_deleteNode(UA_Node *node);

+ 20 - 12
src/server/ua_services.h

@@ -74,7 +74,8 @@ void Service_CreateSession(UA_Server *server, UA_SecureChannel *channel,
  * any other Service request after CreateSession. Failure to do so shall cause
  * the Server to close the Session. */
 void Service_ActivateSession(UA_Server *server, UA_SecureChannel *channel,
-                             UA_Session *session, const UA_ActivateSessionRequest *request,
+                             UA_Session *session,
+                             const UA_ActivateSessionRequest *request,
                              UA_ActivateSessionResponse *response);
 
 /* Used to terminate a Session. */
@@ -98,15 +99,18 @@ void Service_AddNodes(UA_Server *server, UA_Session *session,
                       UA_AddNodesResponse *response);
 
 void Service_AddNodes_single(UA_Server *server, UA_Session *session,
-                             const UA_AddNodesItem *item, UA_AddNodesResult *result,
+                             const UA_AddNodesItem *item,
+                             UA_AddNodesResult *result,
                              UA_InstantiationCallback *instantiationCallback);
 
 /* Add an existing node. The node is assumed to be "finished", i.e. no
  * instantiation from inheritance is necessary */
 void
 Service_AddNodes_existing(UA_Server *server, UA_Session *session, UA_Node *node,
-                          const UA_NodeId *parentNodeId, const UA_NodeId *referenceTypeId,
-                          const UA_NodeId *typeDefinition, UA_InstantiationCallback *instantiationCallback,
+                          const UA_NodeId *parentNodeId,
+                          const UA_NodeId *referenceTypeId,
+                          const UA_NodeId *typeDefinition,
+                          UA_InstantiationCallback *instantiationCallback,
                           UA_AddNodesResult *result);
 
 /* Used to add one or more References to one or more Nodes. */
@@ -114,7 +118,8 @@ void Service_AddReferences(UA_Server *server, UA_Session *session,
                            const UA_AddReferencesRequest *request,
                            UA_AddReferencesResponse *response);
 
-UA_StatusCode Service_AddReferences_single(UA_Server *server, UA_Session *session,
+UA_StatusCode Service_AddReferences_single(UA_Server *server,
+                                           UA_Session *session,
                                            const UA_AddReferencesItem *item);
 
 /* Used to delete one or more Nodes from the AddressSpace. */
@@ -131,8 +136,8 @@ void Service_DeleteReferences(UA_Server *server, UA_Session *session,
                               const UA_DeleteReferencesRequest *request,
                               UA_DeleteReferencesResponse *response);
 
-UA_StatusCode Service_DeleteReferences_single(UA_Server *server, UA_Session *session,
-                                              const UA_DeleteReferencesItem *item);
+UA_StatusCode Service_DeleteReferences_single(UA_Server *server,
+                      UA_Session *session, const UA_DeleteReferencesItem *item);
 
 /**
  * View Service Set
@@ -148,7 +153,8 @@ void Service_Browse(UA_Server *server, UA_Session *session,
                     UA_BrowseResponse *response);
 
 void Service_Browse_single(UA_Server *server, UA_Session *session,
-                           struct ContinuationPointEntry *cp, const UA_BrowseDescription *descr,
+                           struct ContinuationPointEntry *cp,
+                           const UA_BrowseDescription *descr,
                            UA_UInt32 maxrefs, UA_BrowseResult *result);
 
 /* Used to request the next set of Browse or BrowseNext response information
@@ -167,10 +173,11 @@ void UA_Server_browseNext_single(UA_Server *server, UA_Session *session,
 
 /* Used to translate textual node paths to their respective ids. */
 void Service_TranslateBrowsePathsToNodeIds(UA_Server *server, UA_Session *session,
-                                           const UA_TranslateBrowsePathsToNodeIdsRequest *request,
-                                           UA_TranslateBrowsePathsToNodeIdsResponse *response);
+             const UA_TranslateBrowsePathsToNodeIdsRequest *request,
+             UA_TranslateBrowsePathsToNodeIdsResponse *response);
 
-void Service_TranslateBrowsePathsToNodeIds_single(UA_Server *server, UA_Session *session,
+void Service_TranslateBrowsePathsToNodeIds_single(UA_Server *server,
+                                                  UA_Session *session,
                                                   const UA_BrowsePath *path,
                                                   UA_BrowsePathResult *result);
 
@@ -278,7 +285,8 @@ void Service_ModifyMonitoredItems(UA_Server *server, UA_Session *session,
                                   const UA_ModifyMonitoredItemsRequest *request,
                                   UA_ModifyMonitoredItemsResponse *response);
 
-/* Used to set the monitoring mode for one or more MonitoredItems of a Subscription. */
+/* Used to set the monitoring mode for one or more MonitoredItems of a
+   Subscription. */
 void Service_SetMonitoringMode(UA_Server *server, UA_Session *session,
                                const UA_SetMonitoringModeRequest *request,
                                UA_SetMonitoringModeResponse *response);

+ 9 - 9
tools/generate_datatypes.py

@@ -119,20 +119,20 @@ class Type(object):
         return "&" + self.outname.upper() + "[" + self.outname.upper() + "_" + self.name.upper() + "]"
         
     def functions_c(self):
-        funcs = "static UA_INLINE void UA_%s_init(UA_%s *p) { memset(p, 0, sizeof(UA_%s)); }\n" % (self.name, self.name, self.name)
-        funcs += "static UA_INLINE UA_%s * UA_%s_new(void) { return (UA_%s*) UA_new(%s); }\n" % (self.name, self.name, self.name, self.datatype_ptr())
+        funcs = "static UA_INLINE void\nUA_%s_init(UA_%s *p) {\n    memset(p, 0, sizeof(UA_%s));\n}\n" % (self.name, self.name, self.name)
+        funcs += "static UA_INLINE UA_%s *\nUA_%s_new(void) {\n    return (UA_%s*) UA_new(%s);\n}\n" % (self.name, self.name, self.name, self.datatype_ptr())
         if self.fixed_size == "true":
-            funcs += "static UA_INLINE UA_StatusCode UA_%s_copy(const UA_%s *src, UA_%s *dst) { *dst = *src; return UA_STATUSCODE_GOOD; }\n" % (self.name, self.name, self.name)
-            funcs += "static UA_INLINE void UA_%s_deleteMembers(UA_%s *p) { }\n" % (self.name, self.name)
+            funcs += "static UA_INLINE UA_StatusCode\nUA_%s_copy(const UA_%s *src,\n%sUA_%s *dst) {\n    *dst = *src; return UA_STATUSCODE_GOOD;\n}\n" % (self.name, self.name, ' ' * (len(self.name)+9), self.name)
+            funcs += "static UA_INLINE void\nUA_%s_deleteMembers(UA_%s *p) { }\n" % (self.name, self.name)
         else:
-            funcs += "static UA_INLINE UA_StatusCode UA_%s_copy(const UA_%s *src, UA_%s *dst) { return UA_copy(src, dst, %s); }\n" % (self.name, self.name, self.name, self.datatype_ptr())
-            funcs += "static UA_INLINE void UA_%s_deleteMembers(UA_%s *p) { UA_deleteMembers(p, %s); }\n" % (self.name, self.name, self.datatype_ptr())
-        funcs += "static UA_INLINE void UA_%s_delete(UA_%s *p) { UA_delete(p, %s); }" % (self.name, self.name, self.datatype_ptr())
+            funcs += "static UA_INLINE UA_StatusCode\nUA_%s_copy(const UA_%s *src,\n%sUA_%s *dst) {\n    return UA_copy(src, dst, %s);\n}\n" % (self.name, self.name, ' ' * (len(self.name)+9), self.name, self.datatype_ptr())
+            funcs += "static UA_INLINE void\nUA_%s_deleteMembers(UA_%s *p) {\n    UA_deleteMembers(p, %s);\n}\n" % (self.name, self.name, self.datatype_ptr())
+        funcs += "static UA_INLINE void\nUA_%s_delete(UA_%s *p) {\n    UA_delete(p, %s);\n}" % (self.name, self.name, self.datatype_ptr())
         return funcs
 
     def encoding_h(self):
-        enc = "static UA_INLINE UA_StatusCode UA_%s_encodeBinary(const UA_%s *src, UA_ByteString *dst, size_t *offset) { return UA_encodeBinary(src, %s, NULL, NULL, dst, offset); }\n"
-        enc += "static UA_INLINE UA_StatusCode UA_%s_decodeBinary(const UA_ByteString *src, size_t *offset, UA_%s *dst) { return UA_decodeBinary(src, offset, dst, %s); }"
+        enc = "static UA_INLINE UA_StatusCode\nUA_%s_encodeBinary(const UA_%s *src, UA_ByteString *dst, size_t *offset) {\n    return UA_encodeBinary(src, %s, NULL, NULL, dst, offset);\n}\n"
+        enc += "static UA_INLINE UA_StatusCode\nUA_%s_decodeBinary(const UA_ByteString *src, size_t *offset, UA_%s *dst) {\n    return UA_decodeBinary(src, offset, dst, %s);\n}"
         return enc % tuple(list(itertools.chain(*itertools.repeat([self.name, self.name, self.datatype_ptr()], 2))))
 
 class BuiltinType(Type):