Fix public header files for c++

Fix the public header files for c++ usage.
This commit is contained in:
Stefan Berger 2014-07-14 17:22:14 -04:00
parent fd8aa8c36f
commit e04b1231ec
4 changed files with 31 additions and 0 deletions

View File

@ -44,6 +44,10 @@
#include "tpm_types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define TPM_LIBRARY_VER_MAJOR @LIBTPMS_VER_MAJOR@
#define TPM_LIBRARY_VER_MINOR @LIBTPMS_VER_MINOR@
#define TPM_LIBRARY_VER_MICRO @LIBTPMS_VER_MICRO@
@ -124,5 +128,8 @@ enum TPMLIB_BlobType {
TPM_RESULT TPMLIB_DecodeBlob(const char *data, enum TPMLIB_BlobType type,
unsigned char **result, size_t *result_len);
#ifdef __cplusplus
}
#endif
#endif /* TPM_LIBRARY_H */

View File

@ -42,8 +42,17 @@
#include "tpm_types.h"
#ifdef __cplusplus
extern "C" {
#endif
TPM_RESULT TPM_Malloc(unsigned char **buffer, uint32_t size);
TPM_RESULT TPM_Realloc(unsigned char **buffer, uint32_t size);
void TPM_Free(unsigned char *buffer);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -42,6 +42,10 @@
#include "tpm_types.h"
#ifdef __cplusplus
extern "C" {
#endif
TPM_RESULT TPM_IO_Hash_Start(void);
TPM_RESULT TPM_IO_Hash_Data(const unsigned char *data,
uint32_t data_length);
@ -49,5 +53,8 @@ TPM_RESULT TPM_IO_Hash_End(void);
TPM_RESULT TPM_IO_TpmEstablished_Get(TPM_BOOL *tpmEstablished);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -46,6 +46,10 @@
#include <netinet/in.h> /* for byte order conversions */
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* 2.2.1 Basic data types rev 87 */
typedef unsigned char BYTE; /* Basic byte used to transmit all character fields. */
typedef unsigned char TPM_BOOL; /* TRUE/FALSE field. TRUE = 0x01, FALSE = 0x00 Use TPM_BOOL
@ -135,4 +139,8 @@ typedef uint16_t TPM_TAG; /* The command and response tags */
typedef unsigned char * TPM_SYMMETRIC_KEY_TOKEN; /* abstract symmetric key token */
typedef unsigned char * TPM_BIGNUM; /* abstract bignum */
#ifdef __cplusplus
}
#endif
#endif