Browse Source

Merge remote-tracking branch 'upstream/master'

Leon Urbas 11 years ago
parent
commit
cf350371a2
8 changed files with 2403 additions and 31 deletions
  1. 5 4
      Makefile.am
  2. 47 4
      configure.ac
  3. 2310 0
      doc/Doxyfile.in
  4. 18 0
      doc/Makefile.am
  5. BIN
      doc/secureLayer/secureLayer.vsdx
  6. BIN
      doc/transportLayer/transportLayer.vsdx
  7. 11 11
      include/ua_basictypes.h
  8. 12 12
      src/ua_basictypes.c

+ 5 - 4
Makefile.am

@@ -7,12 +7,13 @@ endif
 
 export GLOBAL_AM_CFLAGS = $(AM_CFLAGS)
 
+SUBS=tool include src
 if HAVE_CHECK
-    SUBS=tool include src tests
-
-else 
-    SUBS=tool include src
+	SUBS+= tests
 endif
 
+if USE_DOXYGEN
+	SUBS+= doc
+endif
 SUBDIRS = $(SUBS) examples/src	
 

+ 47 - 4
configure.ac

@@ -1,8 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT(OPCUAServer, 1.0)
-
+AC_INIT(Open62541, 1.0)
 
 AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE()
@@ -53,14 +52,58 @@ AS_HELP_STRING([--enable-multithreading],
                		 yes) multithreading=true ;;
              		 no)  multithreading=false ;;
              		 *)   AC_MSG_ERROR([bad value ${enableval} for --enable-multithreading]) ;; esac],
-[multithreading=true])
+[multithreading=false])
 AM_CONDITIONAL(MULTITHREADING, test x"$multithreading" = x"true")
 AM_COND_IF([MULTITHREADING],
     AC_DEFINE([MULTITHREADING])) #define MULTITHREADING is accessible from pre-processor
+
+AC_ARG_ENABLE(doxygen,
+	AS_HELP_STRING([--enable-doxygen],
+               [enable doxygen, default: no]),
+			   [case "${enableval}" in
+               		 yes) enabledoxygen=true ;;
+             		 no)  enabledoxygen=false ;;
+             		 *)   AC_MSG_ERROR([bad value ${enableval} for --enable-doxygen]) ;; esac],
+[enabledoxygen=false])
+
+AM_CONDITIONAL(ENABLE_DOXYGEN, test x"$enabledoxygen" = x"true")
+AC_CHECK_PROGS([DOXYGEN], [doxygen])
+AM_CONDITIONAL([HAVE_DOXYGEN],[test -n "$DOXYGEN"])
+
+AM_COND_IF([ENABLE_DOXYGEN],[AM_COND_IF([HAVE_DOXYGEN],[usedoxygen=true],[usedoxygen=false])],[usedoxygen=false])
+
+#if ENABLE_DOXYGEN;then
+   # if HAVE_DOXYGEN;then
+   #     usedoxygen = true
+   # else
+  #      usedoxygen = false
+ #  fi
+#else
+ #  usedoxygen = false
+#fi
+AM_CONDITIONAL([USE_DOXYGEN], test x"$usedoxygen" = x"true")
+
+AM_COND_IF([USE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
+
+
+
+
+
+    
+if test -z "$DOXYGEN";then 
+    AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
+fi
+
+
+
+
+
+
+
    
 AC_LIBTOOL_WIN32_DLL
 AC_PROG_LIBTOOL
 AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_FILES(Makefile include/Makefile src/Makefile tool/Makefile tests/Makefile examples/src/Makefile)
+AC_CONFIG_FILES(Makefile include/Makefile src/Makefile tool/Makefile tests/Makefile examples/src/Makefile doc/Makefile)
 AC_OUTPUT
 

File diff suppressed because it is too large
+ 2310 - 0
doc/Doxyfile.in


+ 18 - 0
doc/Makefile.am

@@ -0,0 +1,18 @@
+if USE_DOXYGEN
+directory = $(top_srcdir)/doc/man/man3/
+
+dist_man_MANS = $(directory)/man_page_1.3 $(directory)/man_page_2.3
+$(directory)/man_page_1.3: doxyfile.stamp
+$(directory)/man_page_2.3: doxyfile.stamp
+
+doxyfile.stamp:
+	$(DOXYGEN) Doxyfile
+	echo Timestamp > doxyfile.stamp
+
+CLEANFILES = doxyfile.stamp
+
+all-local: doxyfile.stamp
+clean-local:
+	rm -rf $(top_srcdir)/docs/man
+
+endif

BIN
doc/secureLayer/secureLayer.vsdx


BIN
doc/transportLayer/transportLayer.vsdx


+ 11 - 11
include/ua_basictypes.h

@@ -219,14 +219,14 @@ UA_String;
 UA_TYPE_METHOD_PROTOTYPES (UA_String)
 UA_Int32 UA_String_copy(UA_String const * src, UA_String* dst);
 UA_Int32 UA_String_copycstring(char const * src, UA_String* dst);
-UA_Int32 UA_String_compare(UA_String *string1, UA_String *string2);
-void UA_String_printf(char* label, UA_String* string);
-void UA_String_printx(char* label, UA_String* string);
-void UA_String_printx_hex(char* label, UA_String* string);
+UA_Int32 UA_String_compare(const UA_String *string1, const UA_String *string2);
+void UA_String_printf(char* label, const UA_String* string);
+void UA_String_printx(char* label, const UA_String* string);
+void UA_String_printx_hex(char* label, const UA_String* string);
 
 /* ByteString - Part: 6, Chapter: 5.2.2.7, Page: 17 */
 UA_TYPE_METHOD_PROTOTYPES (UA_ByteString)
-UA_Int32 UA_ByteString_compare(UA_ByteString *string1, UA_ByteString *string2);
+UA_Int32 UA_ByteString_compare(const UA_ByteString *string1, const UA_ByteString *string2);
 UA_Int32 UA_ByteString_copy(UA_ByteString const * src, UA_ByteString* dst);
 UA_Int32 UA_ByteString_newMembers(UA_ByteString* p, UA_Int32 length);
 extern UA_ByteString UA_ByteString_securityPoliceNone;
@@ -246,9 +246,9 @@ typedef struct T_UA_LocalizedText
 UA_LocalizedText;
 UA_TYPE_METHOD_PROTOTYPES (UA_LocalizedText)
 UA_Int32 UA_LocalizedText_copycstring(char const * src, UA_LocalizedText* dst);
-void UA_ByteString_printf(char* label, UA_ByteString* string);
-void UA_ByteString_printx(char* label, UA_ByteString* string);
-void UA_ByteString_printx_hex(char* label, UA_ByteString* string);
+void UA_ByteString_printf(char* label, const UA_ByteString* string);
+void UA_ByteString_printx(char* label, const UA_ByteString* string);
+void UA_ByteString_printx_hex(char* label, const UA_ByteString* string);
 
 /* GuidType - Part: 6, Chapter: 5.2.2.6 Page: 17 */
 typedef struct T_UA_Guid
@@ -259,7 +259,7 @@ typedef struct T_UA_Guid
 	UA_Byte data4[8];
 } UA_Guid;
 UA_TYPE_METHOD_PROTOTYPES (UA_Guid)
-UA_Int32 UA_Guid_compare(UA_Guid *g1, UA_Guid *g2);
+UA_Int32 UA_Guid_compare(const UA_Guid *g1, const UA_Guid *g2);
 
 /* DateTime - Part: 6, Chapter: 5.2.2.5, Page: 16 */
 typedef UA_Int64 UA_DateTime; //100 nanosecond resolution
@@ -296,8 +296,8 @@ typedef struct T_UA_NodeId
     identifier;
 } UA_NodeId;
 UA_TYPE_METHOD_PROTOTYPES (UA_NodeId)
-UA_Int32 UA_NodeId_compare(UA_NodeId *n1, UA_NodeId *n2);
-void UA_NodeId_printf(char* label, UA_NodeId* node);
+UA_Int32 UA_NodeId_compare(const UA_NodeId *n1, const UA_NodeId *n2);
+void UA_NodeId_printf(char* label, const UA_NodeId* node);
 
 /** XmlElement - Part: 6, Chapter: 5.2.2.8, Page: 17 */
 typedef struct T_UA_XmlElement

+ 12 - 12
src/ua_basictypes.c

@@ -465,7 +465,7 @@ UA_Int32 UA_String_init(UA_String* p){
 }
 
 
-UA_Int32 UA_String_compare(UA_String* string1, UA_String* string2) {
+UA_Int32 UA_String_compare(const UA_String* string1, const UA_String* string2) {
 	UA_Int32 retval;
 
 	if (string1->length == 0 && string2->length == 0) {
@@ -481,11 +481,11 @@ UA_Int32 UA_String_compare(UA_String* string1, UA_String* string2) {
 	}
 	return retval;
 }
-void UA_String_printf(char* label, UA_String* string) {
+void UA_String_printf(char* label, const UA_String* string) {
 	printf("%s {Length=%d, Data=%.*s}\n", label, string->length,
 			string->length, (char*)string->data);
 }
-void UA_String_printx(char* label, UA_String* string) {
+void UA_String_printx(char* label, const UA_String* string) {
 	int i;
 	if (string == UA_NULL) { printf("%s {NULL}\n", label); return; }
 	printf("%s {Length=%d, Data=", label, string->length);
@@ -499,7 +499,7 @@ void UA_String_printx(char* label, UA_String* string) {
 	}
 	printf("}}\n");
 }
-void UA_String_printx_hex(char* label, UA_String* string) {
+void UA_String_printx_hex(char* label, const UA_String* string) {
 	int i;
 	printf("%s {Length=%d, Data=", label, string->length);
 	if (string->length > 0) {
@@ -516,16 +516,16 @@ void UA_String_printx_hex(char* label, UA_String* string) {
 // TODO: should we really handle UA_String and UA_ByteString the same way?
 UA_TYPE_METHOD_PROTOTYPES_AS(UA_ByteString, UA_String)
 UA_TYPE_METHOD_NEW_DEFAULT(UA_ByteString)
-UA_Int32 UA_ByteString_compare(UA_ByteString *string1, UA_ByteString *string2) {
-	return UA_String_compare((UA_String*) string1, (UA_String*) string2);
+UA_Int32 UA_ByteString_compare(const UA_ByteString *string1, const UA_ByteString *string2) {
+	return UA_String_compare((const UA_String*) string1, (const UA_String*) string2);
 }
-void UA_ByteString_printf(char* label, UA_ByteString* string) {
+void UA_ByteString_printf(char* label, const UA_ByteString* string) {
 	UA_String_printf(label, (UA_String*) string);
 }
-void UA_ByteString_printx(char* label, UA_ByteString* string) {
+void UA_ByteString_printx(char* label, const UA_ByteString* string) {
 	UA_String_printx(label, (UA_String*) string);
 }
-void UA_ByteString_printx_hex(char* label, UA_ByteString* string) {
+void UA_ByteString_printx_hex(char* label, const UA_ByteString* string) {
 	UA_String_printx_hex(label, (UA_String*) string);
 }
 
@@ -579,7 +579,7 @@ UA_Int32 UA_Guid_decodeBinary(UA_ByteString const * src, UA_Int32* pos, UA_Guid
 }
 UA_TYPE_METHOD_DELETE_STRUCT(UA_Guid)
 UA_Int32 UA_Guid_deleteMembers(UA_Guid* p) { return UA_SUCCESS; }
-UA_Int32 UA_Guid_compare(UA_Guid *g1, UA_Guid *g2) {
+UA_Int32 UA_Guid_compare(const UA_Guid *g1, const UA_Guid *g2) {
 	return memcmp(g1, g2, sizeof(UA_Guid));
 }
 UA_Int32 UA_Guid_init(UA_Guid* p){
@@ -788,7 +788,7 @@ UA_Int32 UA_NodeId_deleteMembers(UA_NodeId* p) {
 	return retval;
 }
 
-void UA_NodeId_printf(char* label, UA_NodeId* node) {
+void UA_NodeId_printf(char* label, const UA_NodeId* node) {
 	int l;
 
 	printf("%s {encodingByte=%d, namespace=%d,", label,
@@ -828,7 +828,7 @@ void UA_NodeId_printf(char* label, UA_NodeId* node) {
 	printf("}\n");
 }
 
-UA_Int32 UA_NodeId_compare(UA_NodeId *n1, UA_NodeId *n2) {
+UA_Int32 UA_NodeId_compare(const UA_NodeId *n1, const UA_NodeId *n2) {
 	if (n1->encodingByte != n2->encodingByte || n1->namespace != n2->namespace)
 		return FALSE;