From 2c398e82620ebcbc27a7ba1d2f7f6e863a7125fb Mon Sep 17 00:00:00 2001 From: Dmitrii Okunev Date: Sat, 17 Apr 2021 00:40:56 +0100 Subject: [PATCH] An attempt to fix building --- go-tpm2-tss.yaml | 7 + go_tpm2_tss/cgo_helpers.c | 6 +- go_tpm2_tss/cgo_helpers.go | 292 ++----------------------------------- go_tpm2_tss/cgo_helpers.h | 3 +- go_tpm2_tss/const.go | 5 +- go_tpm2_tss/doc.go | 2 +- go_tpm2_tss/go_tpm2_tss.go | 286 +----------------------------------- go_tpm2_tss/types.go | 18 +-- 8 files changed, 29 insertions(+), 590 deletions(-) diff --git a/go-tpm2-tss.yaml b/go-tpm2-tss.yaml index e2f2b43..5c786db 100644 --- a/go-tpm2-tss.yaml +++ b/go-tpm2-tss.yaml @@ -9,6 +9,7 @@ GENERATOR: - tss2-tcti-mssim - tss2-tcti-device - tss2-mu + - tss2-fapi - tss2-tctildr - tss2-rc - tss2-sys @@ -24,6 +25,7 @@ GENERATOR: - tss2/tss2_tcti.h - tss2/tss2_tctildr.h - tss2/tss2_tcti_mssim.h + - tss2/tss2_tcti_tbs.h - tss2/tss2_tpm2_types.h PARSER: @@ -62,7 +64,12 @@ TRANSLATOR: - {transform: export} - {action: ignore, from: "^TSS2_ABI_VERSION_CURRENT"} - {action: ignore, from: "^__flexarr"} + - {action: ignore, from: "^__pthread_cond_s"} - {action: ignore, from: "^__PTHREAD_RWLOCK_ELISION_EXTRA"} + - {action: ignore, from: "^__GO__"} + - {action: ignore, from: ".*select.*"} + - {action: ignore, from: "^q.cvt.*"} + - {action: ignore, from: "^str.*"} - {action: ignore, from: "^(PRI|SCN)[diouxX].*"} - {action: accept, from: "^.*"} const: [] diff --git a/go_tpm2_tss/cgo_helpers.c b/go_tpm2_tss/cgo_helpers.c index 5c8e74a..f3aae1f 100644 --- a/go_tpm2_tss/cgo_helpers.c +++ b/go_tpm2_tss/cgo_helpers.c @@ -1,6 +1,6 @@ // License: CC-0 -// WARNING: This file has automatically been generated on Fri, 16 Apr 2021 23:53:50 IST. +// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 00:39:05 IST. // Code generated by https://git.io/c-for-go. DO NOT EDIT. #include "_cgo_export.h" @@ -22,10 +22,6 @@ unsigned int TSS2_TCTI_CANCEL_FCN_900241eb(TSS2_TCTI_CONTEXT* tctiContext) { return tss2TctiCancelFcn900241EB(tctiContext); } -unsigned int TSS2_TCTI_GET_POLL_HANDLES_FCN_d9753da9(TSS2_TCTI_CONTEXT* tctiContext, void* handles, unsigned long int* num_handles) { - return tss2TctiGetPollHandlesFcnD9753DA9(tctiContext, handles, num_handles); -} - unsigned int TSS2_TCTI_SET_LOCALITY_FCN_47c1ecda(TSS2_TCTI_CONTEXT* tctiContext, unsigned char locality) { return tss2TctiSetLocalityFcn47C1ECDA(tctiContext, locality); } diff --git a/go_tpm2_tss/cgo_helpers.go b/go_tpm2_tss/cgo_helpers.go index 32e8f17..d145828 100644 --- a/go_tpm2_tss/cgo_helpers.go +++ b/go_tpm2_tss/cgo_helpers.go @@ -1,13 +1,13 @@ // License: CC-0 -// WARNING: This file has automatically been generated on Fri, 16 Apr 2021 23:53:49 IST. +// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 00:39:05 IST. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package go_tpm2_tss /* #cgo pkg-config: tss2-tcti-mssim tss2-tcti-device tss2-mu tss2-tctildr tss2-rc tss2-sys tss2-esys -#cgo CFLAGS: -I ../c/include -O0 +#cgo CFLAGS: -I ../c/include #include "tss2/tss2_common.h" #include "tss2/tss2_esys.h" #include "tss2/tss2_fapi.h" @@ -18,6 +18,7 @@ package go_tpm2_tss #include "tss2/tss2_tcti.h" #include "tss2/tss2_tctildr.h" #include "tss2/tss2_tcti_mssim.h" +#include "tss2/tss2_tcti_tbs.h" #include "tss2/tss2_tpm2_types.h" #include #include "cgo_helpers.h" @@ -523,23 +524,11 @@ func tss2TctiCancelFcn900241EB(ctcticontext *C.TSS2_TCTI_CONTEXT) C.TSS2_RC { var tss2TctiCancelFcn900241EBFunc Tss2TctiCancelFcn func (x Tss2TctiGetPollHandlesFcn) PassRef() (ref *C.TSS2_TCTI_GET_POLL_HANDLES_FCN, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - if tss2TctiGetPollHandlesFcnD9753DA9Func == nil { - tss2TctiGetPollHandlesFcnD9753DA9Func = x - } - return (*C.TSS2_TCTI_GET_POLL_HANDLES_FCN)(C.TSS2_TCTI_GET_POLL_HANDLES_FCN_d9753da9), nil + panic("not implemented") } func (x Tss2TctiGetPollHandlesFcn) PassValue() (ref C.TSS2_TCTI_GET_POLL_HANDLES_FCN, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - if tss2TctiGetPollHandlesFcnD9753DA9Func == nil { - tss2TctiGetPollHandlesFcnD9753DA9Func = x - } - return (C.TSS2_TCTI_GET_POLL_HANDLES_FCN)(C.TSS2_TCTI_GET_POLL_HANDLES_FCN_d9753da9), nil + panic("not implemented") } func NewTss2TctiGetPollHandlesFcnRef(ref unsafe.Pointer) *Tss2TctiGetPollHandlesFcn { @@ -13636,117 +13625,6 @@ func (x *ImaxdivT) Deref() { x.Rem = (int32)(x.ref873cd79e.rem) } -// allocStruct__PthreadCondSMemory allocates memory for type C.struct___pthread_cond_s in C. -// The caller is responsible for freeing the this memory via C.free. -func allocStruct__PthreadCondSMemory(n int) unsafe.Pointer { - mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStruct__PthreadCondSValue)) - if mem == nil { - panic(fmt.Sprintln("memory alloc error: ", err)) - } - return mem -} - -const sizeOfStruct__PthreadCondSValue = unsafe.Sizeof([1]C.struct___pthread_cond_s{}) - -// Ref returns the underlying reference to C object or nil if struct is nil. -func (x *_PthreadCondS) Ref() *C.struct___pthread_cond_s { - if x == nil { - return nil - } - return x.ref3517d571 -} - -// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free. -// Does nothing if struct is nil or has no allocation map. -func (x *_PthreadCondS) Free() { - if x != nil && x.allocs3517d571 != nil { - x.allocs3517d571.(*cgoAllocMap).Free() - x.ref3517d571 = nil - } -} - -// New_PthreadCondSRef creates a new wrapper struct with underlying reference set to the original C object. -// Returns nil if the provided pointer to C object is nil too. -func New_PthreadCondSRef(ref unsafe.Pointer) *_PthreadCondS { - if ref == nil { - return nil - } - obj := new(_PthreadCondS) - obj.ref3517d571 = (*C.struct___pthread_cond_s)(unsafe.Pointer(ref)) - return obj -} - -// PassRef returns the underlying C object, otherwise it will allocate one and set its values -// from this wrapping struct, counting allocations into an allocation map. -func (x *_PthreadCondS) PassRef() (*C.struct___pthread_cond_s, *cgoAllocMap) { - if x == nil { - return nil, nil - } else if x.ref3517d571 != nil { - return x.ref3517d571, nil - } - mem3517d571 := allocStruct__PthreadCondSMemory(1) - ref3517d571 := (*C.struct___pthread_cond_s)(mem3517d571) - allocs3517d571 := new(cgoAllocMap) - allocs3517d571.Add(mem3517d571) - - var cfield0_allocs *cgoAllocMap - ref3517d571.field0, cfield0_allocs = *(*C.union_)(unsafe.Pointer(&x.Field0)), cgoAllocsUnknown - allocs3517d571.Borrow(cfield0_allocs) - - var cfield1_allocs *cgoAllocMap - ref3517d571.field1, cfield1_allocs = *(*C.union_)(unsafe.Pointer(&x.Field1)), cgoAllocsUnknown - allocs3517d571.Borrow(cfield1_allocs) - - var c__g_refs_allocs *cgoAllocMap - ref3517d571.__g_refs, c__g_refs_allocs = *(*[2]C.uint)(unsafe.Pointer(&x._GRefs)), cgoAllocsUnknown - allocs3517d571.Borrow(c__g_refs_allocs) - - var c__g_size_allocs *cgoAllocMap - ref3517d571.__g_size, c__g_size_allocs = *(*[2]C.uint)(unsafe.Pointer(&x._GSize)), cgoAllocsUnknown - allocs3517d571.Borrow(c__g_size_allocs) - - var c__g1_orig_size_allocs *cgoAllocMap - ref3517d571.__g1_orig_size, c__g1_orig_size_allocs = (C.uint)(x._G1OrigSize), cgoAllocsUnknown - allocs3517d571.Borrow(c__g1_orig_size_allocs) - - var c__wrefs_allocs *cgoAllocMap - ref3517d571.__wrefs, c__wrefs_allocs = (C.uint)(x._Wrefs), cgoAllocsUnknown - allocs3517d571.Borrow(c__wrefs_allocs) - - var c__g_signals_allocs *cgoAllocMap - ref3517d571.__g_signals, c__g_signals_allocs = *(*[2]C.uint)(unsafe.Pointer(&x._GSignals)), cgoAllocsUnknown - allocs3517d571.Borrow(c__g_signals_allocs) - - x.ref3517d571 = ref3517d571 - x.allocs3517d571 = allocs3517d571 - return ref3517d571, allocs3517d571 - -} - -// PassValue does the same as PassRef except that it will try to dereference the returned pointer. -func (x _PthreadCondS) PassValue() (C.struct___pthread_cond_s, *cgoAllocMap) { - if x.ref3517d571 != nil { - return *x.ref3517d571, nil - } - ref, allocs := x.PassRef() - return *ref, allocs -} - -// Deref uses the underlying reference to C object and fills the wrapping struct with values. -// Do not forget to call this method whether you get a struct for C object and want to read its values. -func (x *_PthreadCondS) Deref() { - if x.ref3517d571 == nil { - return - } - x.Field0 = *(*C.union_)(unsafe.Pointer(&x.ref3517d571.field0)) - x.Field1 = *(*C.union_)(unsafe.Pointer(&x.ref3517d571.field1)) - x._GRefs = *(*[2]uint32)(unsafe.Pointer(&x.ref3517d571.__g_refs)) - x._GSize = *(*[2]uint32)(unsafe.Pointer(&x.ref3517d571.__g_size)) - x._G1OrigSize = (uint32)(x.ref3517d571.__g1_orig_size) - x._Wrefs = (uint32)(x.ref3517d571.__wrefs) - x._GSignals = *(*[2]uint32)(unsafe.Pointer(&x.ref3517d571.__g_signals)) -} - // allocStruct__PthreadMutexSMemory allocates memory for type C.struct___pthread_mutex_s in C. // The caller is responsible for freeing the this memory via C.free. func allocStruct__PthreadMutexSMemory(n int) unsafe.Pointer { @@ -22367,158 +22245,6 @@ func allocWcharTMemory(n int) unsafe.Pointer { const sizeOfWcharTValue = unsafe.Sizeof([1]C.wchar_t{}) -// unpackArgSFdSet transforms a sliced Go data structure into plain C format. -func unpackArgSFdSet(x []FdSet) (unpacked *C.fd_set, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) - - len0 := len(x) - mem0 := allocFdSetMemory(len0) - allocs.Add(mem0) - h0 := &sliceHeader{ - Data: mem0, - Cap: len0, - Len: len0, - } - v0 := *(*[]C.fd_set)(unsafe.Pointer(h0)) - for i0 := range x { - allocs0 := new(cgoAllocMap) - v0[i0], allocs0 = x[i0].PassValue() - allocs.Borrow(allocs0) - } - h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.fd_set)(h.Data) - return -} - -// packSFdSet reads sliced Go data structure out from plain C format. -func packSFdSet(v []FdSet, ptr0 *C.fd_set) { - const m = 0x7fffffff - for i0 := range v { - ptr1 := (*(*[m / sizeOfFdSetValue]C.fd_set)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewFdSetRef(unsafe.Pointer(&ptr1)) - } -} - -// unpackArgSTimeval transforms a sliced Go data structure into plain C format. -func unpackArgSTimeval(x []Timeval) (unpacked *C.struct_timeval, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) - - len0 := len(x) - mem0 := allocStructTimevalMemory(len0) - allocs.Add(mem0) - h0 := &sliceHeader{ - Data: mem0, - Cap: len0, - Len: len0, - } - v0 := *(*[]C.struct_timeval)(unsafe.Pointer(h0)) - for i0 := range x { - allocs0 := new(cgoAllocMap) - v0[i0], allocs0 = x[i0].PassValue() - allocs.Borrow(allocs0) - } - h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.struct_timeval)(h.Data) - return -} - -// packSTimeval reads sliced Go data structure out from plain C format. -func packSTimeval(v []Timeval, ptr0 *C.struct_timeval) { - const m = 0x7fffffff - for i0 := range v { - ptr1 := (*(*[m / sizeOfStructTimevalValue]C.struct_timeval)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewTimevalRef(unsafe.Pointer(&ptr1)) - } -} - -// unpackArgSTimespec transforms a sliced Go data structure into plain C format. -func unpackArgSTimespec(x []Timespec) (unpacked *C.struct_timespec, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) - - len0 := len(x) - mem0 := allocStructTimespecMemory(len0) - allocs.Add(mem0) - h0 := &sliceHeader{ - Data: mem0, - Cap: len0, - Len: len0, - } - v0 := *(*[]C.struct_timespec)(unsafe.Pointer(h0)) - for i0 := range x { - allocs0 := new(cgoAllocMap) - v0[i0], allocs0 = x[i0].PassValue() - allocs.Borrow(allocs0) - } - h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.struct_timespec)(h.Data) - return -} - -// packSTimespec reads sliced Go data structure out from plain C format. -func packSTimespec(v []Timespec, ptr0 *C.struct_timespec) { - const m = 0x7fffffff - for i0 := range v { - ptr1 := (*(*[m / sizeOfStructTimespecValue]C.struct_timespec)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *NewTimespecRef(unsafe.Pointer(&ptr1)) - } -} - -// unpackArgS_SigsetT transforms a sliced Go data structure into plain C format. -func unpackArgS_SigsetT(x []_SigsetT) (unpacked *C.__sigset_t, allocs *cgoAllocMap) { - if x == nil { - return nil, nil - } - allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { - go a.Free() - }) - - len0 := len(x) - mem0 := alloc_SigsetTMemory(len0) - allocs.Add(mem0) - h0 := &sliceHeader{ - Data: mem0, - Cap: len0, - Len: len0, - } - v0 := *(*[]C.__sigset_t)(unsafe.Pointer(h0)) - for i0 := range x { - allocs0 := new(cgoAllocMap) - v0[i0], allocs0 = x[i0].PassValue() - allocs.Borrow(allocs0) - } - h := (*sliceHeader)(unsafe.Pointer(&v0)) - unpacked = (*C.__sigset_t)(h.Data) - return -} - -// packS_SigsetT reads sliced Go data structure out from plain C format. -func packS_SigsetT(v []_SigsetT, ptr0 *C.__sigset_t) { - const m = 0x7fffffff - for i0 := range v { - ptr1 := (*(*[m / sizeOf_SigsetTValue]C.__sigset_t)(unsafe.Pointer(ptr0)))[i0] - v[i0] = *New_SigsetTRef(unsafe.Pointer(&ptr1)) - } -} - // allocPTss2TctiInfoMemory allocates memory for type *C.TSS2_TCTI_INFO in C. // The caller is responsible for freeing the this memory via C.free. func allocPTss2TctiInfoMemory(n int) unsafe.Pointer { @@ -22666,9 +22392,9 @@ func packSS_GwcharT(v [][]_GwcharT, ptr0 **C.__gwchar_t) { const m = 0x7fffffff for i0 := range v { ptr1 := (*(*[m / sizeOfPtr]*C.__gwchar_t)(unsafe.Pointer(ptr0)))[i0] - hxf349858 := (*sliceHeader)(unsafe.Pointer(&v[i0])) - hxf349858.Data = unsafe.Pointer(ptr1) - hxf349858.Cap = 0x7fffffff - // hxf349858.Len = ? + hxfc03c44 := (*sliceHeader)(unsafe.Pointer(&v[i0])) + hxfc03c44.Data = unsafe.Pointer(ptr1) + hxfc03c44.Cap = 0x7fffffff + // hxfc03c44.Len = ? } } diff --git a/go_tpm2_tss/cgo_helpers.h b/go_tpm2_tss/cgo_helpers.h index f30b20d..9707e1d 100644 --- a/go_tpm2_tss/cgo_helpers.h +++ b/go_tpm2_tss/cgo_helpers.h @@ -1,6 +1,6 @@ // License: CC-0 -// WARNING: This file has automatically been generated on Fri, 16 Apr 2021 23:53:49 IST. +// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 00:39:05 IST. // Code generated by https://git.io/c-for-go. DO NOT EDIT. #include "tss2/tss2_common.h" @@ -13,6 +13,7 @@ #include "tss2/tss2_tcti.h" #include "tss2/tss2_tctildr.h" #include "tss2/tss2_tcti_mssim.h" +#include "tss2/tss2_tcti_tbs.h" #include "tss2/tss2_tpm2_types.h" #include #pragma once diff --git a/go_tpm2_tss/const.go b/go_tpm2_tss/const.go index b13f03e..17d9514 100644 --- a/go_tpm2_tss/const.go +++ b/go_tpm2_tss/const.go @@ -1,13 +1,13 @@ // License: CC-0 -// WARNING: This file has automatically been generated on Fri, 16 Apr 2021 23:53:49 IST. +// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 00:39:05 IST. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package go_tpm2_tss /* #cgo pkg-config: tss2-tcti-mssim tss2-tcti-device tss2-mu tss2-tctildr tss2-rc tss2-sys tss2-esys -#cgo CFLAGS: -I ../c/include -O0 +#cgo CFLAGS: -I ../c/include #include "tss2/tss2_common.h" #include "tss2/tss2_esys.h" #include "tss2/tss2_fapi.h" @@ -18,6 +18,7 @@ package go_tpm2_tss #include "tss2/tss2_tcti.h" #include "tss2/tss2_tctildr.h" #include "tss2/tss2_tcti_mssim.h" +#include "tss2/tss2_tcti_tbs.h" #include "tss2/tss2_tpm2_types.h" #include #include "cgo_helpers.h" diff --git a/go_tpm2_tss/doc.go b/go_tpm2_tss/doc.go index 14175e4..05cde29 100644 --- a/go_tpm2_tss/doc.go +++ b/go_tpm2_tss/doc.go @@ -1,6 +1,6 @@ // License: CC-0 -// WARNING: This file has automatically been generated on Fri, 16 Apr 2021 23:53:49 IST. +// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 00:39:05 IST. // Code generated by https://git.io/c-for-go. DO NOT EDIT. /* diff --git a/go_tpm2_tss/go_tpm2_tss.go b/go_tpm2_tss/go_tpm2_tss.go index 8fa0bc1..7792ff2 100644 --- a/go_tpm2_tss/go_tpm2_tss.go +++ b/go_tpm2_tss/go_tpm2_tss.go @@ -1,13 +1,13 @@ // License: CC-0 -// WARNING: This file has automatically been generated on Fri, 16 Apr 2021 23:53:49 IST. +// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 00:39:05 IST. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package go_tpm2_tss /* #cgo pkg-config: tss2-tcti-mssim tss2-tcti-device tss2-mu tss2-tctildr tss2-rc tss2-sys tss2-esys -#cgo CFLAGS: -I ../c/include -O0 +#cgo CFLAGS: -I ../c/include #include "tss2/tss2_common.h" #include "tss2/tss2_esys.h" #include "tss2/tss2_fapi.h" @@ -18,6 +18,7 @@ package go_tpm2_tss #include "tss2/tss2_tcti.h" #include "tss2/tss2_tctildr.h" #include "tss2/tss2_tcti_mssim.h" +#include "tss2/tss2_tcti_tbs.h" #include "tss2/tss2_tpm2_types.h" #include #include "cgo_helpers.h" @@ -28,13 +29,6 @@ import ( "unsafe" ) -// _Go_ function as declared in tpm2-tss/:36 -func _Go_(arg0 *byte) { - carg0, carg0AllocMap := (*C.char)(unsafe.Pointer(arg0)), cgoAllocsUnknown - C.__GO__(carg0) - runtime.KeepAlive(carg0AllocMap) -} - // EsysInitialize function as declared in tss2/tss2_esys.h:73 func EsysInitialize(esysContext []*EsysContext, tcti []Tss2TctiContext, abiversion []Tss2AbiVersion) Tss2Rc { cesysContext, cesysContextAllocMap := copyPEsysContextBytes((*sliceHeader)(unsafe.Pointer(&esysContext))) @@ -18968,126 +18962,6 @@ func Atoll(_Nptr *string) int64 { return __v } -// Strtod function as declared in include/stdlib.h:117 -func Strtod(_Nptr *string, _Endptr [][]byte) float64 { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - __ret := C.strtod(c_Nptr, c_Endptr) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (float64)(__ret) - return __v -} - -// Strtof function as declared in include/stdlib.h:123 -func Strtof(_Nptr *string, _Endptr [][]byte) float32 { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - __ret := C.strtof(c_Nptr, c_Endptr) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (float32)(__ret) - return __v -} - -// Strtold function as declared in include/stdlib.h:126 -func Strtold(_Nptr *string, _Endptr [][]byte) float64 { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - __ret := C.strtold(c_Nptr, c_Endptr) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (float64)(__ret) - return __v -} - -// Strtol function as declared in include/stdlib.h:176 -func Strtol(_Nptr *string, _Endptr [][]byte, _Base int32) int32 { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - c_Base, c_BaseAllocMap := (C.int)(_Base), cgoAllocsUnknown - __ret := C.strtol(c_Nptr, c_Endptr, c_Base) - runtime.KeepAlive(c_BaseAllocMap) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (int32)(__ret) - return __v -} - -// Strtoul function as declared in include/stdlib.h:180 -func Strtoul(_Nptr *string, _Endptr [][]byte, _Base int32) uint32 { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - c_Base, c_BaseAllocMap := (C.int)(_Base), cgoAllocsUnknown - __ret := C.strtoul(c_Nptr, c_Endptr, c_Base) - runtime.KeepAlive(c_BaseAllocMap) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (uint32)(__ret) - return __v -} - -// Strtoq function as declared in include/stdlib.h:187 -func Strtoq(_Nptr *string, _Endptr [][]byte, _Base int32) int64 { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - c_Base, c_BaseAllocMap := (C.int)(_Base), cgoAllocsUnknown - __ret := C.strtoq(c_Nptr, c_Endptr, c_Base) - runtime.KeepAlive(c_BaseAllocMap) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (int64)(__ret) - return __v -} - -// Strtouq function as declared in include/stdlib.h:192 -func Strtouq(_Nptr *string, _Endptr [][]byte, _Base int32) uint64 { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - c_Base, c_BaseAllocMap := (C.int)(_Base), cgoAllocsUnknown - __ret := C.strtouq(c_Nptr, c_Endptr, c_Base) - runtime.KeepAlive(c_BaseAllocMap) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (uint64)(__ret) - return __v -} - -// Strtoll function as declared in include/stdlib.h:200 -func Strtoll(_Nptr *string, _Endptr [][]byte, _Base int32) int64 { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - c_Base, c_BaseAllocMap := (C.int)(_Base), cgoAllocsUnknown - __ret := C.strtoll(c_Nptr, c_Endptr, c_Base) - runtime.KeepAlive(c_BaseAllocMap) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (int64)(__ret) - return __v -} - -// Strtoull function as declared in include/stdlib.h:205 -func Strtoull(_Nptr *string, _Endptr [][]byte, _Base int32) uint64 { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - c_Base, c_BaseAllocMap := (C.int)(_Base), cgoAllocsUnknown - __ret := C.strtoull(c_Nptr, c_Endptr, c_Base) - runtime.KeepAlive(c_BaseAllocMap) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (uint64)(__ret) - return __v -} - // L64a function as declared in include/stdlib.h:385 func L64a(_N int32) *byte { c_N, c_NAllocMap := (C.long)(_N), cgoAllocsUnknown @@ -19749,49 +19623,6 @@ func Gcvt(_Value float64, _Ndigit int32, _Buf []byte) *byte { return __v } -// Qecvt function as declared in include/stdlib.h:890 -func Qecvt(_Value float64, _Ndigit int32, _Decpt []int32, _Sign []int32) *byte { - c_Value, c_ValueAllocMap := (C.double)(_Value), cgoAllocsUnknown - c_Ndigit, c_NdigitAllocMap := (C.int)(_Ndigit), cgoAllocsUnknown - c_Decpt, c_DecptAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&_Decpt))) - c_Sign, c_SignAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&_Sign))) - __ret := C.qecvt(c_Value, c_Ndigit, c_Decpt, c_Sign) - runtime.KeepAlive(c_SignAllocMap) - runtime.KeepAlive(c_DecptAllocMap) - runtime.KeepAlive(c_NdigitAllocMap) - runtime.KeepAlive(c_ValueAllocMap) - __v := *(**byte)(unsafe.Pointer(&__ret)) - return __v -} - -// Qfcvt function as declared in include/stdlib.h:893 -func Qfcvt(_Value float64, _Ndigit int32, _Decpt []int32, _Sign []int32) *byte { - c_Value, c_ValueAllocMap := (C.double)(_Value), cgoAllocsUnknown - c_Ndigit, c_NdigitAllocMap := (C.int)(_Ndigit), cgoAllocsUnknown - c_Decpt, c_DecptAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&_Decpt))) - c_Sign, c_SignAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&_Sign))) - __ret := C.qfcvt(c_Value, c_Ndigit, c_Decpt, c_Sign) - runtime.KeepAlive(c_SignAllocMap) - runtime.KeepAlive(c_DecptAllocMap) - runtime.KeepAlive(c_NdigitAllocMap) - runtime.KeepAlive(c_ValueAllocMap) - __v := *(**byte)(unsafe.Pointer(&__ret)) - return __v -} - -// Qgcvt function as declared in include/stdlib.h:896 -func Qgcvt(_Value float64, _Ndigit int32, _Buf []byte) *byte { - c_Value, c_ValueAllocMap := (C.double)(_Value), cgoAllocsUnknown - c_Ndigit, c_NdigitAllocMap := (C.int)(_Ndigit), cgoAllocsUnknown - c_Buf, c_BufAllocMap := copyPCharBytes((*sliceHeader)(unsafe.Pointer(&_Buf))) - __ret := C.qgcvt(c_Value, c_Ndigit, c_Buf) - runtime.KeepAlive(c_BufAllocMap) - runtime.KeepAlive(c_NdigitAllocMap) - runtime.KeepAlive(c_ValueAllocMap) - __v := *(**byte)(unsafe.Pointer(&__ret)) - return __v -} - // EcvtR function as declared in include/stdlib.h:902 func EcvtR(_Value float64, _Ndigit int32, _Decpt []int32, _Sign []int32, _Buf []byte, _Len SizeT) int32 { c_Value, c_ValueAllocMap := (C.double)(_Value), cgoAllocsUnknown @@ -19830,44 +19661,6 @@ func FcvtR(_Value float64, _Ndigit int32, _Decpt []int32, _Sign []int32, _Buf [] return __v } -// QecvtR function as declared in include/stdlib.h:909 -func QecvtR(_Value float64, _Ndigit int32, _Decpt []int32, _Sign []int32, _Buf []byte, _Len SizeT) int32 { - c_Value, c_ValueAllocMap := (C.double)(_Value), cgoAllocsUnknown - c_Ndigit, c_NdigitAllocMap := (C.int)(_Ndigit), cgoAllocsUnknown - c_Decpt, c_DecptAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&_Decpt))) - c_Sign, c_SignAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&_Sign))) - c_Buf, c_BufAllocMap := copyPCharBytes((*sliceHeader)(unsafe.Pointer(&_Buf))) - c_Len, c_LenAllocMap := (C.size_t)(_Len), cgoAllocsUnknown - __ret := C.qecvt_r(c_Value, c_Ndigit, c_Decpt, c_Sign, c_Buf, c_Len) - runtime.KeepAlive(c_LenAllocMap) - runtime.KeepAlive(c_BufAllocMap) - runtime.KeepAlive(c_SignAllocMap) - runtime.KeepAlive(c_DecptAllocMap) - runtime.KeepAlive(c_NdigitAllocMap) - runtime.KeepAlive(c_ValueAllocMap) - __v := (int32)(__ret) - return __v -} - -// QfcvtR function as declared in include/stdlib.h:913 -func QfcvtR(_Value float64, _Ndigit int32, _Decpt []int32, _Sign []int32, _Buf []byte, _Len SizeT) int32 { - c_Value, c_ValueAllocMap := (C.double)(_Value), cgoAllocsUnknown - c_Ndigit, c_NdigitAllocMap := (C.int)(_Ndigit), cgoAllocsUnknown - c_Decpt, c_DecptAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&_Decpt))) - c_Sign, c_SignAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&_Sign))) - c_Buf, c_BufAllocMap := copyPCharBytes((*sliceHeader)(unsafe.Pointer(&_Buf))) - c_Len, c_LenAllocMap := (C.size_t)(_Len), cgoAllocsUnknown - __ret := C.qfcvt_r(c_Value, c_Ndigit, c_Decpt, c_Sign, c_Buf, c_Len) - runtime.KeepAlive(c_LenAllocMap) - runtime.KeepAlive(c_BufAllocMap) - runtime.KeepAlive(c_SignAllocMap) - runtime.KeepAlive(c_DecptAllocMap) - runtime.KeepAlive(c_NdigitAllocMap) - runtime.KeepAlive(c_ValueAllocMap) - __v := (int32)(__ret) - return __v -} - // Mblen function as declared in include/stdlib.h:922 func Mblen(_S *string, _N SizeT) int32 { c_S, c_SAllocMap := unpackPCharString(_S) @@ -20020,51 +19813,6 @@ func _Uint64Identity(_X _Uint64T) _Uint64T { return __v } -// Select function as declared in sys/select.h:101 -func Select(_Nfds int32, _Readfds []FdSet, _Writefds []FdSet, _Exceptfds []FdSet, _Timeout []Timeval) int32 { - c_Nfds, c_NfdsAllocMap := (C.int)(_Nfds), cgoAllocsUnknown - c_Readfds, c_ReadfdsAllocMap := unpackArgSFdSet(_Readfds) - c_Writefds, c_WritefdsAllocMap := unpackArgSFdSet(_Writefds) - c_Exceptfds, c_ExceptfdsAllocMap := unpackArgSFdSet(_Exceptfds) - c_Timeout, c_TimeoutAllocMap := unpackArgSTimeval(_Timeout) - __ret := C._select(c_Nfds, c_Readfds, c_Writefds, c_Exceptfds, c_Timeout) - packSTimeval(_Timeout, c_Timeout) - runtime.KeepAlive(c_TimeoutAllocMap) - packSFdSet(_Exceptfds, c_Exceptfds) - runtime.KeepAlive(c_ExceptfdsAllocMap) - packSFdSet(_Writefds, c_Writefds) - runtime.KeepAlive(c_WritefdsAllocMap) - packSFdSet(_Readfds, c_Readfds) - runtime.KeepAlive(c_ReadfdsAllocMap) - runtime.KeepAlive(c_NfdsAllocMap) - __v := (int32)(__ret) - return __v -} - -// Pselect function as declared in sys/select.h:113 -func Pselect(_Nfds int32, _Readfds []FdSet, _Writefds []FdSet, _Exceptfds []FdSet, _Timeout []Timespec, _Sigmask []_SigsetT) int32 { - c_Nfds, c_NfdsAllocMap := (C.int)(_Nfds), cgoAllocsUnknown - c_Readfds, c_ReadfdsAllocMap := unpackArgSFdSet(_Readfds) - c_Writefds, c_WritefdsAllocMap := unpackArgSFdSet(_Writefds) - c_Exceptfds, c_ExceptfdsAllocMap := unpackArgSFdSet(_Exceptfds) - c_Timeout, c_TimeoutAllocMap := unpackArgSTimespec(_Timeout) - c_Sigmask, c_SigmaskAllocMap := unpackArgS_SigsetT(_Sigmask) - __ret := C.pselect(c_Nfds, c_Readfds, c_Writefds, c_Exceptfds, c_Timeout, c_Sigmask) - packS_SigsetT(_Sigmask, c_Sigmask) - runtime.KeepAlive(c_SigmaskAllocMap) - packSTimespec(_Timeout, c_Timeout) - runtime.KeepAlive(c_TimeoutAllocMap) - packSFdSet(_Exceptfds, c_Exceptfds) - runtime.KeepAlive(c_ExceptfdsAllocMap) - packSFdSet(_Writefds, c_Writefds) - runtime.KeepAlive(c_WritefdsAllocMap) - packSFdSet(_Readfds, c_Readfds) - runtime.KeepAlive(c_ReadfdsAllocMap) - runtime.KeepAlive(c_NfdsAllocMap) - __v := (int32)(__ret) - return __v -} - // Alloca function as declared in include/alloca.h:32 func Alloca(_Size SizeT) unsafe.Pointer { c_Size, c_SizeAllocMap := (C.size_t)(_Size), cgoAllocsUnknown @@ -20185,34 +19933,6 @@ func Imaxdiv(_Numer IntmaxT, _Denom IntmaxT) ImaxdivT { return __v } -// Strtoimax function as declared in include/inttypes.h:297 -func Strtoimax(_Nptr *string, _Endptr [][]byte, _Base int32) IntmaxT { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - c_Base, c_BaseAllocMap := (C.int)(_Base), cgoAllocsUnknown - __ret := C.strtoimax(c_Nptr, c_Endptr, c_Base) - runtime.KeepAlive(c_BaseAllocMap) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (IntmaxT)(__ret) - return __v -} - -// Strtoumax function as declared in include/inttypes.h:301 -func Strtoumax(_Nptr *string, _Endptr [][]byte, _Base int32) UintmaxT { - c_Nptr, c_NptrAllocMap := unpackPCharString(_Nptr) - c_Endptr, c_EndptrAllocMap := unpackArgSSByte(_Endptr) - c_Base, c_BaseAllocMap := (C.int)(_Base), cgoAllocsUnknown - __ret := C.strtoumax(c_Nptr, c_Endptr, c_Base) - runtime.KeepAlive(c_BaseAllocMap) - packSSByte(_Endptr, c_Endptr) - runtime.KeepAlive(c_EndptrAllocMap) - runtime.KeepAlive(c_NptrAllocMap) - __v := (UintmaxT)(__ret) - return __v -} - // Wcstoimax function as declared in include/inttypes.h:305 func Wcstoimax(_Nptr *_GwcharT, _Endptr [][]_GwcharT, _Base int32) IntmaxT { c_Nptr, c_NptrAllocMap := (*C.__gwchar_t)(unsafe.Pointer(_Nptr)), cgoAllocsUnknown diff --git a/go_tpm2_tss/types.go b/go_tpm2_tss/types.go index 00d1729..aa4ca92 100644 --- a/go_tpm2_tss/types.go +++ b/go_tpm2_tss/types.go @@ -1,13 +1,13 @@ // License: CC-0 -// WARNING: This file has automatically been generated on Fri, 16 Apr 2021 23:53:49 IST. +// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 00:39:05 IST. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package go_tpm2_tss /* #cgo pkg-config: tss2-tcti-mssim tss2-tcti-device tss2-mu tss2-tctildr tss2-rc tss2-sys tss2-esys -#cgo CFLAGS: -I ../c/include -O0 +#cgo CFLAGS: -I ../c/include #include "tss2/tss2_common.h" #include "tss2/tss2_esys.h" #include "tss2/tss2_fapi.h" @@ -18,6 +18,7 @@ package go_tpm2_tss #include "tss2/tss2_tcti.h" #include "tss2/tss2_tctildr.h" #include "tss2/tss2_tcti_mssim.h" +#include "tss2/tss2_tcti_tbs.h" #include "tss2/tss2_tpm2_types.h" #include #include "cgo_helpers.h" @@ -2086,19 +2087,6 @@ type ImaxdivT struct { allocs873cd79e interface{} } -// _PthreadCondS as declared in bits/thread-shared-types.h:92 -type _PthreadCondS struct { - Field0 C.union_ - Field1 C.union_ - _GRefs [2]uint32 - _GSize [2]uint32 - _G1OrigSize uint32 - _Wrefs uint32 - _GSignals [2]uint32 - ref3517d571 *C.struct___pthread_cond_s - allocs3517d571 interface{} -} - // _PthreadMutexS as declared in bits/struct_mutex.h:22 type _PthreadMutexS struct { _Lock int32