1 //
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4 //
5 
6 #define CK_PTR *
7 #ifndef NULL_PTR
8 #define NULL_PTR 0
9 #endif
10 #define CK_DEFINE_FUNCTION(returnType, name) returnType name
11 #define CK_DECLARE_FUNCTION(returnType, name) returnType name
12 #define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType (* name)
13 #define CK_CALLBACK_FUNCTION(returnType, name) returnType (* name)
14 
15 #include <unistd.h>
16 #ifdef PACKED_STRUCTURES
17 # pragma pack(push, 1)
18 # include "pkcs11.h"
19 # pragma pack(pop)
20 #else
21 # include "pkcs11.h"
22 #endif
23 
24 // Copy of CK_INFO but with default alignment (not packed). Go hides unaligned
25 // struct fields so copying to an aligned struct is necessary to read CK_INFO
26 // from Go on Windows where packing is required.
27 typedef struct ckInfo {
28 	CK_VERSION cryptokiVersion;
29 	CK_UTF8CHAR manufacturerID[32];
30 	CK_FLAGS flags;
31 	CK_UTF8CHAR libraryDescription[32];
32 	CK_VERSION libraryVersion;
33 } ckInfo, *ckInfoPtr;
34