=head1 NAME TPMLIB_MainInit - Initialize the TPM TPMLIB_Terminate - Terminate the TPM =head1 LIBRARY TPM library (libtpms, -ltpms) =head1 SYNOPSIS B<#include > B<#include > B<#include > B B =head1 DESCRIPTION The B and B functions are used to initialize and terminate the TPM respectively. The B function must be called before the TPM processes any TPM command. The B function is called to free all the internal resources (memory allocations) the TPM has used and must be called after the last TPM command was processed by the TPM. The B function can then be called again. Use B to set callback functions for initialization and writing and restoring the internal state in a portable format. =head1 ERRORS =over 4 =item B The function completed successfully. =item B General failure. =back For a complete list of TPM error codes please consult the include file B =head1 EXAMPLE #include #include #include #include int main(void) { TPM_RESULT res; unsigned char *respbuffer = NULL; uint32_t resp_size = 0; uint32_t respbufsize = 0; unsigned char *command; uint32_t command_size; [...] if (TPMLIB_MainInit() != TPM_SUCCESS) { fprintf(stderr, "Could not start the TPM.\n"); return 1; } [...] /* build TPM command */ [...] res = TPMLIB_Process(&respbuffer, &resp_size, &respbufsize, command, command_size); [...] TPMLIB_Terminate(); return 0; } =head1 SEE ALSO B(3), B(3), B(3) B(3), B(3) =cut