osaf/libs/saf/include/Makefile.am    |   1 +
 osaf/libs/saf/include/saAis.h        |   2 +
 osaf/libs/saf/include/saAis_B_5_14.h |  39 ++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 0 deletions(-)


Add a definition of SaConstStringT as an OpenSAF extension to the AIS types.
The following example code illustrates a use case where SaConstStringT is
needed:

void foo(SaConstStringT s) {
        printf("%s", s);
}

void bar(const char* s) {
        foo(s);
}

By using SaConstStringT instead of SaStringT (or const SaStringT), we avoid
having to cast way the const qualifier of the string when calling foo() from
bar().

diff --git a/osaf/libs/saf/include/Makefile.am 
b/osaf/libs/saf/include/Makefile.am
--- a/osaf/libs/saf/include/Makefile.am
+++ b/osaf/libs/saf/include/Makefile.am
@@ -20,6 +20,7 @@ MAINTAINERCLEANFILES = Makefile.in
 
 include_HEADERS = \
        saAis.h \
+       saAis_B_5_14.h \
        saAmf.h \
        saCkpt.h \
        saCkpt_B_02_03.h \
diff --git a/osaf/libs/saf/include/saAis.h b/osaf/libs/saf/include/saAis.h
--- a/osaf/libs/saf/include/saAis.h
+++ b/osaf/libs/saf/include/saAis.h
@@ -179,5 +179,7 @@ typedef union {
 }
 #endif
 
+#include <saAis_B_5_14.h>
+
 #endif  /* _SA_AIS_H */
 
diff --git a/osaf/libs/saf/include/saAis_B_5_14.h 
b/osaf/libs/saf/include/saAis_B_5_14.h
new file mode 100644
--- /dev/null
+++ b/osaf/libs/saf/include/saAis_B_5_14.h
@@ -0,0 +1,39 @@
+/*      -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2014 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ */
+
+/*
+ * DESCRIPTION:
+ *   This file provides the suggested additions to the C language binding for
+ *   the Service Availability(TM) Forum.  It contains only the prototypes and
+ *   type definitions that are part of this proposed addition.  These additions
+ *   are currently NON STANDARD. But the intention is to get these additions
+ *   approved formally by SAF in the future.
+ */
+
+#ifndef _SA_AIS_B_5_14_H
+#define _SA_AIS_B_5_14_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+typedef const char* SaConstStringT;
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif   /* _SA_AIS_B_5_14_H */

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to