1 /* $NetBSD: cryptoki.h,v 1.1.1.3 2014/12/10 03:34:45 christos Exp $ */ 2 3 /* cryptoki.h include file for PKCS #11. */ 4 /* Revision: 1.2 */ 5 6 /* License to copy and use this software is granted provided that it is 7 * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface 8 * (Cryptoki)" in all material mentioning or referencing this software. 9 10 * License is also granted to make and use derivative works provided that 11 * such works are identified as "derived from the RSA Security Inc. PKCS #11 12 * Cryptographic Token Interface (Cryptoki)" in all material mentioning or 13 * referencing the derived work. 14 15 * RSA Security Inc. makes no representations concerning either the 16 * merchantability of this software or the suitability of this software for 17 * any particular purpose. It is provided "as is" without express or implied 18 * warranty of any kind. 19 */ 20 21 /* This is a sample file containing the top level include directives 22 * for building Win32 Cryptoki libraries and applications. 23 */ 24 25 #ifndef ___CRYPTOKI_H_INC___ 26 #define ___CRYPTOKI_H_INC___ 27 28 #pragma pack(push, cryptoki, 1) 29 30 /* Specifies that the function is a DLL entry point. */ 31 #define CK_IMPORT_SPEC __declspec(dllimport) 32 33 /* Define CRYPTOKI_EXPORTS during the build of cryptoki libraries. Do 34 * not define it in applications. 35 */ 36 #ifdef CRYPTOKI_EXPORTS 37 /* Specified that the function is an exported DLL entry point. */ 38 #define CK_EXPORT_SPEC __declspec(dllexport) 39 #else 40 #define CK_EXPORT_SPEC CK_IMPORT_SPEC 41 #endif 42 43 /* Ensures the calling convention for Win32 builds */ 44 #define CK_CALL_SPEC __cdecl 45 46 #define CK_PTR * 47 48 #define CK_DEFINE_FUNCTION(returnType, name) \ 49 returnType CK_EXPORT_SPEC CK_CALL_SPEC name 50 51 #define CK_DECLARE_FUNCTION(returnType, name) \ 52 returnType CK_EXPORT_SPEC CK_CALL_SPEC name 53 54 #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ 55 returnType CK_IMPORT_SPEC (CK_CALL_SPEC CK_PTR name) 56 57 #define CK_CALLBACK_FUNCTION(returnType, name) \ 58 returnType (CK_CALL_SPEC CK_PTR name) 59 60 #ifndef NULL_PTR 61 #define NULL_PTR 0 62 #endif 63 64 #include <pkcs11/pkcs11.h> 65 66 #pragma pack(pop, cryptoki) 67 68 #endif /* ___CRYPTOKI_H_INC___ */ 69