Browse Source

Docs: Fix generation for headers that end with _UA_END_DECLS

Julius Pfrommer 5 years ago
parent
commit
ca54e72363

+ 1 - 0
doc/tutorials.rst

@@ -12,6 +12,7 @@ Tutorials
    tutorial_server_variabletype.rst
    tutorial_server_object.rst
    tutorial_server_method.rst
+   tutorial_server_monitoreditems.rst
    tutorial_server_events.rst
    tutorial_client_firststeps.rst
    tutorial_pubsub_publish.rst

+ 4 - 1
examples/tutorial_server_firststeps.c

@@ -41,8 +41,10 @@ int main(void) {
     UA_Server *server = UA_Server_new(config);
 
     UA_StatusCode retval = UA_Server_run(server, &running);
+
     UA_Server_delete(server);
     UA_ServerConfig_delete(config);
+
     return retval == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
@@ -89,6 +91,7 @@ int main(void) {
  *
  * Server Lifecycle
  * ^^^^^^^^^^^^^^^^
+ *
  * The code in this example shows the three parts for server lifecycle
  * management: Creating a server, running the server, and deleting the server.
  * Creating and deleting a server is trivial once the configuration is set up.
@@ -102,7 +105,7 @@ int main(void) {
  * receives when the operating systems tries to close it. This happens for
  * example when you press ctrl-c in a terminal program. The signal handler then
  * sets the variable ``running`` to false and the server shuts down once it
- * takes back control. [#f1]_
+ * takes back control.
  *
  * In order to integrated OPC UA in a single-threaded application with its own
  * mainloop (for example provided by a GUI toolkit), one can alternatively drive

+ 8 - 3
include/open62541/client_highlevel.h

@@ -216,8 +216,8 @@ UA_Client_readUserExecutableAttribute(UA_Client *client, const UA_NodeId nodeId,
  * Historical Access
  * ^^^^^^^^^^^^^^^^^
  * The following functions can be used to read a single node historically.
- * Use the regular service to read several nodes at once.
- */
+ * Use the regular service to read several nodes at once. */
+
 #ifdef UA_ENABLE_HISTORIZING
 typedef UA_Boolean
 (*UA_HistoricalIteratorCallback)(UA_Client *client,
@@ -272,12 +272,14 @@ UA_Client_HistoryUpdate_deleteRaw(UA_Client *client,
                                   UA_DateTime endTimestamp);
 
 #endif // UA_ENABLE_HISTORIZING
+
 /**
  * Write Attributes
  * ^^^^^^^^^^^^^^^^
  *
  * The following functions can be use to write a single node attribute at a
  * time. Use the regular write service to write several attributes at once. */
+
 /* Don't call this function, use the typed versions */
 UA_StatusCode UA_EXPORT
 __UA_Client_writeAttribute(UA_Client *client, const UA_NodeId *nodeId,
@@ -455,6 +457,7 @@ UA_Client_writeUserExecutableAttribute(UA_Client *client, const UA_NodeId nodeId
 /**
  * Method Calling
  * ^^^^^^^^^^^^^^ */
+
 #ifdef UA_ENABLE_METHODCALLS
 UA_StatusCode UA_EXPORT
 UA_Client_call(UA_Client *client, const UA_NodeId objectId,
@@ -466,6 +469,7 @@ UA_Client_call(UA_Client *client, const UA_NodeId objectId,
  * Node Management
  * ^^^^^^^^^^^^^^^
  * 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,
@@ -627,6 +631,7 @@ UA_Client_addMethodNode(UA_Client *client, const UA_NodeId requestedNewNodeId,
 /**
  * Misc Highlevel Functionality
  * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
+
 /* Get the namespace-index of a namespace-URI
  *
  * @param client The UA_Client struct for this connection
@@ -648,7 +653,7 @@ typedef UA_StatusCode (*UA_NodeIteratorCallback)(UA_NodeId childId, UA_Boolean i
 
 UA_StatusCode UA_EXPORT
 UA_Client_forEachChildNodeCall(UA_Client *client, UA_NodeId parentNodeId,
-                               UA_NodeIteratorCallback callback, void *handle) ;
+                               UA_NodeIteratorCallback callback, void *handle);
 
 _UA_END_DECLS
 

+ 2 - 1
include/open62541/server_pubsub.h

@@ -68,6 +68,7 @@ _UA_BEGIN_DECLS
  *                 |    +-----------------+
  *                 +----> UA_DataSetField |  UA_PublishedDataSet_addDataSetField
  *                      +-----------------+
+ *
  * PubSub compile flags
  * --------------------
  *
@@ -81,7 +82,7 @@ _UA_BEGIN_DECLS
  *  Enable the information model representation of the PubSub configuration. For more details take a look at the following section `PubSub Information Model Representation`. Disabled by default.
  *
  * PubSub Information Model Representation
- * ----------------------------------------
+ * ---------------------------------------
  * .. _pubsub_informationmodel:
  *
  * The complete PubSub configuration is available inside the information model.

+ 5 - 1
tools/c2rst.py

@@ -51,9 +51,13 @@ def first_line(c):
 
 def last_line(c):
     "Searches for the latest ifdef (closing the include guard)"
+    reg = re.compile("^#ifdef")
+    for i in range(len(c)-1,1,-1):
+        if "_UA_END_DECLS" in c[i]:
+            reg = re.compile("^_UA_END_DECLS")
     last = 1
     for i in range(len(c)-1,1,-1):
-        m = re.search("^#ifdef", c[i])
+        m = reg.match(c[i])
         if m:
             last = i
             break