add export demo and test
This commit is contained in:
291
_demo/go/export/libexport.h.want
Normal file
291
_demo/go/export/libexport.h.want
Normal file
@@ -0,0 +1,291 @@
|
||||
/* Code generated by llgo; DO NOT EDIT. */
|
||||
|
||||
#ifndef __LIBEXPORT_H_
|
||||
#define __LIBEXPORT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Platform-specific symbol renaming macro
|
||||
#ifdef __APPLE__
|
||||
#define GO_SYMBOL_RENAME(go_name) __asm("_" go_name);
|
||||
#else
|
||||
#define GO_SYMBOL_RENAME(go_name) __asm(go_name);
|
||||
#endif
|
||||
|
||||
// Go runtime types
|
||||
typedef struct { const char *p; intptr_t n; } GoString;
|
||||
typedef struct { void *data; intptr_t len; intptr_t cap; } GoSlice;
|
||||
typedef struct { void *data; } GoMap;
|
||||
typedef struct { void *data; } GoChan;
|
||||
typedef struct { void *data; void *type; } GoInterface;
|
||||
typedef struct { float real; float imag; } GoComplex64;
|
||||
typedef struct { double real; double imag; } GoComplex128;
|
||||
|
||||
typedef struct {
|
||||
int32_t Matrix[3][4];
|
||||
GoSlice Slices;
|
||||
intptr_t IntArray[5];
|
||||
GoSlice DataList;
|
||||
} main_ComplexData;
|
||||
|
||||
typedef struct {
|
||||
double data[5][4];
|
||||
} Array_double_5_4;
|
||||
|
||||
typedef struct {
|
||||
int8_t ID;
|
||||
_Bool Flag;
|
||||
} main_SmallStruct;
|
||||
|
||||
typedef struct {
|
||||
int64_t ID;
|
||||
GoString Name;
|
||||
double Values[10];
|
||||
GoMap Metadata;
|
||||
GoSlice Children;
|
||||
int32_t Extra1;
|
||||
uint64_t Extra2;
|
||||
float Extra3;
|
||||
_Bool Extra4;
|
||||
uintptr_t Extra5;
|
||||
} main_LargeStruct;
|
||||
|
||||
typedef struct {
|
||||
int32_t data[4];
|
||||
} Array_int32_t_4;
|
||||
|
||||
typedef struct {
|
||||
int32_t data[3][4];
|
||||
} Array_int32_t_3_4;
|
||||
|
||||
typedef struct {
|
||||
uint8_t data[2][3][4];
|
||||
} Array_uint8_t_2_3_4;
|
||||
|
||||
typedef struct main_Node main_Node;
|
||||
struct main_Node {
|
||||
intptr_t Data;
|
||||
main_Node* Next;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int32_t ID;
|
||||
GoString Name;
|
||||
double Value;
|
||||
_Bool Flag;
|
||||
} C_XType;
|
||||
|
||||
typedef intptr_t main_MyInt;
|
||||
|
||||
typedef GoString main_MyString;
|
||||
|
||||
GoString
|
||||
Concat(GoString a, GoString b);
|
||||
|
||||
int64_t
|
||||
Sub(int64_t a, int64_t b);
|
||||
|
||||
intptr_t
|
||||
Add(intptr_t a, intptr_t b);
|
||||
|
||||
float
|
||||
mul(float a, float b);
|
||||
|
||||
void
|
||||
github_com_goplus_llgo__demo_go_export_c_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/_demo/go/export/c.init")
|
||||
|
||||
main_ComplexData
|
||||
CreateComplexData(void);
|
||||
|
||||
Array_double_5_4
|
||||
CreateGrid5x4(void);
|
||||
|
||||
main_LargeStruct
|
||||
CreateLargeStruct(int64_t id, GoString name);
|
||||
|
||||
Array_int32_t_4
|
||||
CreateMatrix1D(void);
|
||||
|
||||
Array_int32_t_3_4
|
||||
CreateMatrix2D(void);
|
||||
|
||||
Array_uint8_t_2_3_4
|
||||
CreateMatrix3D(void);
|
||||
|
||||
main_Node*
|
||||
CreateNode(intptr_t data);
|
||||
|
||||
main_SmallStruct
|
||||
CreateSmallStruct(int8_t id, _Bool flag);
|
||||
|
||||
C_XType
|
||||
CreateXType(int32_t id, GoString name, double value, _Bool flag);
|
||||
|
||||
void
|
||||
HelloWorld(void);
|
||||
|
||||
void
|
||||
LinkNodes(main_Node* first, main_Node* second);
|
||||
|
||||
GoString
|
||||
MultipleParams(int8_t a, uint16_t b, int32_t c, uint64_t d, float e, double f, GoString g, _Bool h);
|
||||
|
||||
intptr_t
|
||||
NoParams(void);
|
||||
|
||||
void
|
||||
NoReturn(GoString message);
|
||||
|
||||
intptr_t
|
||||
OneParam(intptr_t x);
|
||||
|
||||
_Bool
|
||||
ProcessBool(_Bool b);
|
||||
|
||||
int32_t
|
||||
ProcessComplexData(main_ComplexData data);
|
||||
|
||||
float
|
||||
ProcessFloat32(float x);
|
||||
|
||||
double
|
||||
ProcessFloat64(double x);
|
||||
|
||||
double
|
||||
ProcessGrid5x4(double grid[5][4]);
|
||||
|
||||
intptr_t
|
||||
ProcessInt(intptr_t x);
|
||||
|
||||
int16_t
|
||||
ProcessInt16(int16_t x);
|
||||
|
||||
int32_t
|
||||
ProcessInt32(int32_t x);
|
||||
|
||||
int64_t
|
||||
ProcessInt64(int64_t x);
|
||||
|
||||
int8_t
|
||||
ProcessInt8(int8_t x);
|
||||
|
||||
intptr_t
|
||||
ProcessIntArray(intptr_t arr[5]);
|
||||
|
||||
intptr_t
|
||||
ProcessIntChannel(GoChan ch);
|
||||
|
||||
intptr_t
|
||||
ProcessIntSlice(GoSlice slice);
|
||||
|
||||
intptr_t
|
||||
ProcessInterface(GoInterface i);
|
||||
|
||||
int64_t
|
||||
ProcessLargeStruct(main_LargeStruct ls);
|
||||
|
||||
main_LargeStruct*
|
||||
ProcessLargeStructPtr(main_LargeStruct* ls);
|
||||
|
||||
int32_t
|
||||
ProcessMatrix2D(int32_t matrix[3][4]);
|
||||
|
||||
uint32_t
|
||||
ProcessMatrix3D(uint8_t cube[2][3][4]);
|
||||
|
||||
main_MyInt
|
||||
ProcessMyInt(main_MyInt x);
|
||||
|
||||
main_MyString
|
||||
ProcessMyString(main_MyString s);
|
||||
|
||||
main_SmallStruct
|
||||
ProcessSmallStruct(main_SmallStruct s);
|
||||
|
||||
main_SmallStruct*
|
||||
ProcessSmallStructPtr(main_SmallStruct* s);
|
||||
|
||||
GoString
|
||||
ProcessString(GoString s);
|
||||
|
||||
intptr_t
|
||||
ProcessStringMap(GoMap m);
|
||||
|
||||
uintptr_t
|
||||
ProcessUint(uintptr_t x);
|
||||
|
||||
uint16_t
|
||||
ProcessUint16(uint16_t x);
|
||||
|
||||
uint32_t
|
||||
ProcessUint32(uint32_t x);
|
||||
|
||||
uint64_t
|
||||
ProcessUint64(uint64_t x);
|
||||
|
||||
uint8_t
|
||||
ProcessUint8(uint8_t x);
|
||||
|
||||
uintptr_t
|
||||
ProcessUintptr(uintptr_t x);
|
||||
|
||||
void*
|
||||
ProcessUnsafePointer(void* p);
|
||||
|
||||
C_XType
|
||||
ProcessXType(C_XType x);
|
||||
|
||||
C_XType*
|
||||
ProcessXTypePtr(C_XType* x);
|
||||
|
||||
double
|
||||
ThreeParams(int32_t a, double b, _Bool c);
|
||||
|
||||
intptr_t
|
||||
TraverseNodes(main_Node* head);
|
||||
|
||||
GoString
|
||||
TwoParams(intptr_t a, GoString b);
|
||||
|
||||
void
|
||||
github_com_goplus_llgo__demo_go_export_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/_demo/go/export.init")
|
||||
|
||||
void
|
||||
github_com_goplus_llgo_runtime_abi_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/abi.init")
|
||||
|
||||
void
|
||||
github_com_goplus_llgo_runtime_internal_clite_bdwgc_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/clite/bdwgc.init")
|
||||
|
||||
void
|
||||
github_com_goplus_llgo_runtime_internal_clite_bitcast_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/clite/bitcast.init")
|
||||
|
||||
void
|
||||
github_com_goplus_llgo_runtime_internal_clite_debug_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/clite/debug.init")
|
||||
|
||||
void
|
||||
github_com_goplus_llgo_runtime_internal_clite_pthread_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/clite/pthread.init")
|
||||
|
||||
void
|
||||
github_com_goplus_llgo_runtime_internal_clite_pthread_sync_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/clite/pthread/sync.init")
|
||||
|
||||
void
|
||||
github_com_goplus_llgo_runtime_internal_runtime_goarch_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/runtime/goarch.init")
|
||||
|
||||
void
|
||||
github_com_goplus_llgo_runtime_internal_runtime_math_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/runtime/math.init")
|
||||
|
||||
void
|
||||
github_com_goplus_llgo_runtime_internal_runtime_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/runtime.init")
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LIBEXPORT_H_ */
|
||||
Reference in New Issue
Block a user