summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-03-31 18:37:31 +0200
committerStef Walter <stefw@collabora.co.uk>2011-03-31 18:37:31 +0200
commit579d40eff31c7a17cc4e4f07d26c6189619fee31 (patch)
treefcb97fc78bfaefdd488ca170ec2725a4b66a2811
parentcf988aa7858d249887ea0818301c7211bb3cab38 (diff)
downloadp11-kit-579d40eff31c7a17cc4e4f07d26c6189619fee31.tar.gz
Add C++ header guards, and require API instability acknowledgement.
-rw-r--r--p11-kit/Makefile.am3
-rw-r--r--p11-kit/p11-kit-uri.h23
-rw-r--r--p11-kit/p11-kit.h17
-rw-r--r--tests/Makefile.am3
4 files changed, 42 insertions, 4 deletions
diff --git a/p11-kit/Makefile.am b/p11-kit/Makefile.am
index 989f482..a5a9195 100644
--- a/p11-kit/Makefile.am
+++ b/p11-kit/Makefile.am
@@ -1,4 +1,7 @@
+INCLUDES = \
+ -DP11_KIT_API_SUBJECT_TO_CHANGE
+
incdir = $(includedir)/p11-kit
inc_HEADERS = \
diff --git a/p11-kit/p11-kit-uri.h b/p11-kit/p11-kit-uri.h
index a3e52ed..f5bf3d5 100644
--- a/p11-kit/p11-kit-uri.h
+++ b/p11-kit/p11-kit-uri.h
@@ -32,10 +32,23 @@
* Author: Stef Walter <stefw@collabora.co.uk>
*/
+#ifndef P11_KIT_URI_H
+#define P11_KIT_URI_H
+
+/*
+ * To use this API, you need to be prepared for changes to the API,
+ * and add the C flag: -DP11_KIT_API_SUBJECT_TO_CHANGE
+ */
+
+#ifndef P11_KIT_API_SUBJECT_TO_CHANGE
+#error "This API has not yet reached stability."
+#endif
+
#include "pkcs11.h"
-#ifndef __P11_KIT_URI_H__
-#define __P11_KIT_URI_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
#define P11_KIT_URI_SCHEME "pkcs11:"
#define P11_KIT_URI_SCHEME_LEN 7
@@ -102,4 +115,8 @@ int p11_kit_uri_parse (const char *string,
void p11_kit_uri_free (P11KitUri *uri);
-#endif /* __P11_KIT_URI_H__ */
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* P11_KIT_URI_H */
diff --git a/p11-kit/p11-kit.h b/p11-kit/p11-kit.h
index b035f56..b3de330 100644
--- a/p11-kit/p11-kit.h
+++ b/p11-kit/p11-kit.h
@@ -35,8 +35,21 @@
#ifndef __P11_KIT_H__
#define __P11_KIT_H__
+/*
+ * To use this API, you need to be prepared for changes to the API,
+ * and add the C flag: -DP11_KIT_API_SUBJECT_TO_CHANGE
+ */
+
+#ifndef P11_KIT_API_SUBJECT_TO_CHANGE
+#error "This API has not yet reached stability."
+#endif
+
#include "pkcs11.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
CK_RV p11_kit_initialize_registered (void);
CK_RV p11_kit_finalize_registered (void);
@@ -56,4 +69,8 @@ CK_RV p11_kit_finalize_module (CK_FUNCTION_LIST_PTR
const char* p11_kit_strerror (CK_RV rv);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* __P11_KIT_H__ */
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3719a64..bb4bce3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,7 +3,8 @@ INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/p11-kit \
-Icutest \
- -DSRCDIR=\"$(srcdir)\"
+ -DSRCDIR=\"$(srcdir)\" \
+ -DP11_KIT_API_SUBJECT_TO_CHANGE
noinst_PROGRAMS = \
hash-test \