From 579d40eff31c7a17cc4e4f07d26c6189619fee31 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 31 Mar 2011 18:37:31 +0200 Subject: Add C++ header guards, and require API instability acknowledgement. --- p11-kit/Makefile.am | 3 +++ p11-kit/p11-kit-uri.h | 23 ++++++++++++++++++++--- p11-kit/p11-kit.h | 17 +++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) (limited to 'p11-kit') 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 */ +#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__ */ -- cgit v1.1