On Friday 08 December 2006 20:28, Alon Bar-Lev wrote:
> On Friday 08 December 2006 20:20, Alon Bar-Lev wrote:
> > Hi!
> >
> > I've modified pkcs11-helper to use the new free pkcs11.h header.
> > I was surprised that it went relatively OK, good work! :)
> >
> > Some modifications:
>
> One more:

One more... I hope it is the last...
I just have a lot of environments...

7. C++ compatability
a. Don't use template keyword.
b. Add extern "C".

Most recent code is at:
http://www.opensc-project.org/svn/pkcs11-helper/trunk/include/pkcs11-helper-1.0/pkcs11.h

Best Regards,
Alon Bar-Lev.

--- pkcs11.h
+++ pkcs11.h
@@ -48,6 +48,10 @@
 #ifndef PKCS11_H
 #define PKCS11_H 1
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 #ifndef CRYPTOKI_COMPAT
 #define CRYPTOKI_COMPAT 1
 #endif
@@ -664,11 +668,11 @@
 
 _CK_DECLARE_FUNCTION (C_CreateObject,
                      (ck_session_handle_t session,
-                      struct ck_attribute *template,
+                      struct ck_attribute *_template,
                       unsigned long count, ck_object_handle_t *object));
 _CK_DECLARE_FUNCTION (C_CopyObject,
                      (ck_session_handle_t session, ck_object_handle_t object,
-                      struct ck_attribute *template, unsigned long count,
+                      struct ck_attribute *_template, unsigned long count,
                       ck_object_handle_t *new_object));
 _CK_DECLARE_FUNCTION (C_DestroyObject,
                      (ck_session_handle_t session,
@@ -680,16 +684,16 @@
 _CK_DECLARE_FUNCTION (C_GetAttributeValue,
                      (ck_session_handle_t session,
                       ck_object_handle_t object,
-                      struct ck_attribute *template,
+                      struct ck_attribute *_template,
                       unsigned long count));
 _CK_DECLARE_FUNCTION (C_SetAttributeValue,
                      (ck_session_handle_t session,
                       ck_object_handle_t object,
-                      struct ck_attribute *template,
+                      struct ck_attribute *_template,
                       unsigned long count));
 _CK_DECLARE_FUNCTION (C_FindObjectsInit,
                      (ck_session_handle_t session,
-                      struct ck_attribute *template,
+                      struct ck_attribute *_template,
                       unsigned long count));
 _CK_DECLARE_FUNCTION (C_FindObjects,
                      (ck_session_handle_t session,
@@ -834,7 +838,7 @@
 _CK_DECLARE_FUNCTION (C_GenerateKey,
                      (ck_session_handle_t session,
                       struct ck_mechanism *mechanism,
-                      struct ck_attribute *template,
+                      struct ck_attribute *_template,
                       unsigned long count,
                       ck_object_handle_t *key));
 _CK_DECLARE_FUNCTION (C_GenerateKeyPair,
@@ -859,14 +863,14 @@
                       ck_object_handle_t unwrapping_key,
                       unsigned char *wrapped_key,
                       unsigned long wrapped_key_len,
-                      struct ck_attribute *template,
+                      struct ck_attribute *_template,
                       unsigned long attribute_count,
                       ck_object_handle_t *key));
 _CK_DECLARE_FUNCTION (C_DeriveKey,
                      (ck_session_handle_t session,
                       struct ck_mechanism *mechanism,
                       ck_object_handle_t base_key,
-                      struct ck_attribute *template,
+                      struct ck_attribute *_template,
                       unsigned long attribute_count,
                       ck_object_handle_t *key));
 
@@ -1213,4 +1217,8 @@
 #pragma pack(pop, cryptoki)
 #endif /* !CRYPTOKI_COMPAT */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* PKCS11_H */
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to