1diff --git a/fficonfig.h b/fficonfig.h 2new file mode 100755 3index 0000000..d12db96 4--- /dev/null 5+++ b/fficonfig.h 6@@ -0,0 +1,230 @@ 7+/* fficonfig.h. Generated from fficonfig.h.in by configure. */ 8+/* fficonfig.h.in. Generated from configure.ac by autoheader. */ 9+ 10+/* Define if building universal (internal helper macro) */ 11+/* #undef AC_APPLE_UNIVERSAL_BUILD */ 12+ 13+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP 14+ systems. This function is required for `alloca.c' support on those systems. 15+ */ 16+/* #undef CRAY_STACKSEG_END */ 17+ 18+/* Define to 1 if using `alloca.c'. */ 19+/* #undef C_ALLOCA */ 20+ 21+/* Define to the flags needed for the .section .eh_frame directive. */ 22+#define EH_FRAME_FLAGS "a" 23+ 24+/* Define this if you want extra debugging. */ 25+/* #undef FFI_DEBUG */ 26+ 27+/* Define this if you want statically defined trampolines */ 28+#define FFI_EXEC_STATIC_TRAMP 1 29+ 30+/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */ 31+/* #undef FFI_EXEC_TRAMPOLINE_TABLE */ 32+ 33+/* Define this if you want to enable pax emulated trampolines */ 34+/* #undef FFI_MMAP_EXEC_EMUTRAMP_PAX */ 35+ 36+/* Cannot use malloc on this target, so, we revert to alternative means */ 37+/* #undef FFI_MMAP_EXEC_WRIT */ 38+ 39+/* Define this if you do not want support for the raw API. */ 40+/* #undef FFI_NO_RAW_API */ 41+ 42+/* Define this if you do not want support for aggregate types. */ 43+/* #undef FFI_NO_STRUCTS */ 44+ 45+/* Define to 1 if you have `alloca', as a function or macro. */ 46+#define HAVE_ALLOCA 1 47+ 48+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). 49+ */ 50+#define HAVE_ALLOCA_H 1 51+ 52+/* Define if your assembler supports .cfi_* directives. */ 53+#define HAVE_AS_CFI_PSEUDO_OP 1 54+ 55+/* Define if your assembler supports .register. */ 56+/* #undef HAVE_AS_REGISTER_PSEUDO_OP */ 57+ 58+/* Define if the compiler uses zarch features. */ 59+/* #undef HAVE_AS_S390_ZARCH */ 60+ 61+/* Define if your assembler and linker support unaligned PC relative relocs. 62+ */ 63+/* #undef HAVE_AS_SPARC_UA_PCREL */ 64+ 65+/* Define if your assembler supports unwind section type. */ 66+#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1 67+ 68+/* Define if your assembler supports PC relative relocs. */ 69+#define HAVE_AS_X86_PCREL 1 70+ 71+/* Define to 1 if you have the <dlfcn.h> header file. */ 72+#define HAVE_DLFCN_H 1 73+ 74+/* Define if __attribute__((visibility("hidden"))) is supported. */ 75+#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1 76+ 77+/* Define to 1 if you have the <inttypes.h> header file. */ 78+#define HAVE_INTTYPES_H 1 79+ 80+/* Define if you have the long double type and it is bigger than a double */ 81+#define HAVE_LONG_DOUBLE 1 82+ 83+/* Define if you support more than one size of the long double type */ 84+/* #undef HAVE_LONG_DOUBLE_VARIANT */ 85+ 86+/* Define to 1 if you have the `memcpy' function. */ 87+#define HAVE_MEMCPY 1 88+ 89+/* Define to 1 if you have the `memfd_create' function. */ 90+#define HAVE_MEMFD_CREATE 1 91+ 92+/* Define to 1 if you have the <memory.h> header file. */ 93+#define HAVE_MEMORY_H 1 94+ 95+/* Define to 1 if you have the `mkostemp' function. */ 96+#define HAVE_MKOSTEMP 1 97+ 98+/* Define to 1 if you have the `mkstemp' function. */ 99+#define HAVE_MKSTEMP 1 100+ 101+/* Define to 1 if you have the `mmap' function. */ 102+#define HAVE_MMAP 1 103+ 104+/* Define if mmap with MAP_ANON(YMOUS) works. */ 105+#define HAVE_MMAP_ANON 1 106+ 107+/* Define if mmap of /dev/zero works. */ 108+#define HAVE_MMAP_DEV_ZERO 1 109+ 110+/* Define if read-only mmap of a plain file works. */ 111+#define HAVE_MMAP_FILE 1 112+ 113+/* Define if your compiler supports pointer authentication. */ 114+/* #undef HAVE_PTRAUTH */ 115+ 116+/* Define if .eh_frame sections should be read-only. */ 117+#define HAVE_RO_EH_FRAME 1 118+ 119+/* Define to 1 if you have the <stdint.h> header file. */ 120+#define HAVE_STDINT_H 1 121+ 122+/* Define to 1 if you have the <stdlib.h> header file. */ 123+#define HAVE_STDLIB_H 1 124+ 125+/* Define to 1 if you have the <strings.h> header file. */ 126+#define HAVE_STRINGS_H 1 127+ 128+/* Define to 1 if you have the <string.h> header file. */ 129+#define HAVE_STRING_H 1 130+ 131+/* Define to 1 if you have the <sys/memfd.h> header file. */ 132+/* #undef HAVE_SYS_MEMFD_H */ 133+ 134+/* Define to 1 if you have the <sys/mman.h> header file. */ 135+#define HAVE_SYS_MMAN_H 1 136+ 137+/* Define to 1 if you have the <sys/stat.h> header file. */ 138+#define HAVE_SYS_STAT_H 1 139+ 140+/* Define to 1 if you have the <sys/types.h> header file. */ 141+#define HAVE_SYS_TYPES_H 1 142+ 143+/* Define to 1 if you have the <unistd.h> header file. */ 144+#define HAVE_UNISTD_H 1 145+ 146+/* Define to 1 if GNU symbol versioning is used for libatomic. */ 147+#define LIBFFI_GNU_SYMBOL_VERSIONING 1 148+ 149+/* Define to the sub-directory where libtool stores uninstalled libraries. */ 150+#define LT_OBJDIR ".libs/" 151+ 152+/* Name of package */ 153+#define PACKAGE "libffi" 154+ 155+/* Define to the address where bug reports for this package should be sent. */ 156+#define PACKAGE_BUGREPORT "http://github.com/libffi/libffi/issues" 157+ 158+/* Define to the full name of this package. */ 159+#define PACKAGE_NAME "libffi" 160+ 161+/* Define to the full name and version of this package. */ 162+#define PACKAGE_STRING "libffi 3.4.2" 163+ 164+/* Define to the one symbol short name of this package. */ 165+#define PACKAGE_TARNAME "libffi" 166+ 167+/* Define to the home page for this package. */ 168+#define PACKAGE_URL "" 169+ 170+/* Define to the version of this package. */ 171+#define PACKAGE_VERSION "3.4.2" 172+ 173+/* The size of `double', as computed by sizeof. */ 174+#define SIZEOF_DOUBLE 8 175+ 176+/* The size of `long double', as computed by sizeof. */ 177+#define SIZEOF_LONG_DOUBLE 16 178+ 179+/* The size of `size_t', as computed by sizeof. */ 180+#define SIZEOF_SIZE_T 8 181+ 182+/* If using the C implementation of alloca, define if you know the 183+ direction of stack growth for your system; otherwise it will be 184+ automatically deduced at runtime. 185+ STACK_DIRECTION > 0 => grows toward higher addresses 186+ STACK_DIRECTION < 0 => grows toward lower addresses 187+ STACK_DIRECTION = 0 => direction of growth unknown */ 188+/* #undef STACK_DIRECTION */ 189+ 190+/* Define to 1 if you have the ANSI C header files. */ 191+#define STDC_HEADERS 1 192+ 193+/* Define if symbols are underscored. */ 194+/* #undef SYMBOL_UNDERSCORE */ 195+ 196+/* Define this if you are using Purify and want to suppress spurious messages. 197+ */ 198+/* #undef USING_PURIFY */ 199+ 200+/* Version number of package */ 201+#define VERSION "3.4.2" 202+ 203+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 204+ significant byte first (like Motorola and SPARC, unlike Intel). */ 205+#if defined AC_APPLE_UNIVERSAL_BUILD 206+# if defined __BIG_ENDIAN__ 207+# define WORDS_BIGENDIAN 1 208+# endif 209+#else 210+# ifndef WORDS_BIGENDIAN 211+/* # undef WORDS_BIGENDIAN */ 212+# endif 213+#endif 214+ 215+/* Define to `unsigned int' if <sys/types.h> does not define. */ 216+/* #undef size_t */ 217+ 218+ 219+#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 220+#ifdef LIBFFI_ASM 221+#ifdef __APPLE__ 222+#define FFI_HIDDEN(name) .private_extern name 223+#else 224+#define FFI_HIDDEN(name) .hidden name 225+#endif 226+#else 227+#define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) 228+#endif 229+#else 230+#ifdef LIBFFI_ASM 231+#define FFI_HIDDEN(name) 232+#else 233+#define FFI_HIDDEN 234+#endif 235+#endif 236+ 237diff --git a/include/ffi.h b/include/ffi.h 238new file mode 100755 239index 0000000..48b7f3a 240--- /dev/null 241+++ b/include/ffi.h 242@@ -0,0 +1,538 @@ 243+/* -----------------------------------------------------------------*-C-*- 244+ libffi 3.4.2 245+ - Copyright (c) 2011, 2014, 2019, 2021 Anthony Green 246+ - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. 247+ 248+ Permission is hereby granted, free of charge, to any person 249+ obtaining a copy of this software and associated documentation 250+ files (the ``Software''), to deal in the Software without 251+ restriction, including without limitation the rights to use, copy, 252+ modify, merge, publish, distribute, sublicense, and/or sell copies 253+ of the Software, and to permit persons to whom the Software is 254+ furnished to do so, subject to the following conditions: 255+ 256+ The above copyright notice and this permission notice shall be 257+ included in all copies or substantial portions of the Software. 258+ 259+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, 260+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 261+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 262+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 263+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 264+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 265+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 266+ DEALINGS IN THE SOFTWARE. 267+ 268+ ----------------------------------------------------------------------- */ 269+ 270+/* ------------------------------------------------------------------- 271+ Most of the API is documented in doc/libffi.texi. 272+ 273+ The raw API is designed to bypass some of the argument packing and 274+ unpacking on architectures for which it can be avoided. Routines 275+ are provided to emulate the raw API if the underlying platform 276+ doesn't allow faster implementation. 277+ 278+ More details on the raw API can be found in: 279+ 280+ http://gcc.gnu.org/ml/java/1999-q3/msg00138.html 281+ 282+ and 283+ 284+ http://gcc.gnu.org/ml/java/1999-q3/msg00174.html 285+ -------------------------------------------------------------------- */ 286+ 287+#ifndef LIBFFI_H 288+#define LIBFFI_H 289+ 290+#ifdef __cplusplus 291+extern "C" { 292+#endif 293+ 294+/* Specify which architecture libffi is configured for. */ 295+#ifdef __x86_64__ 296+#ifndef X86_64 297+#define X86_64 298+#endif 299+#elif defined(__i386__) || defined(_M_IX86) || defined(_M_X64) 300+#ifndef X86_64 301+#define X86_64 302+#endif 303+#else 304+#ifndef AARCH64 305+#define AARCH64 306+#endif 307+#endif 308+ 309+/* ---- System configuration information --------------------------------- */ 310+ 311+#include <ffitarget.h> 312+ 313+#ifndef LIBFFI_ASM 314+ 315+#if defined(_MSC_VER) && !defined(__clang__) 316+#define __attribute__(X) 317+#endif 318+ 319+#include <stddef.h> 320+#include <limits.h> 321+ 322+/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). 323+ But we can find it either under the correct ANSI name, or under GNU 324+ C's internal name. */ 325+ 326+#define FFI_64_BIT_MAX 9223372036854775807 327+ 328+#ifdef LONG_LONG_MAX 329+# define FFI_LONG_LONG_MAX LONG_LONG_MAX 330+#else 331+# ifdef LLONG_MAX 332+# define FFI_LONG_LONG_MAX LLONG_MAX 333+# ifdef _AIX52 /* or newer has C99 LLONG_MAX */ 334+# undef FFI_64_BIT_MAX 335+# define FFI_64_BIT_MAX 9223372036854775807LL 336+# endif /* _AIX52 or newer */ 337+# else 338+# ifdef __GNUC__ 339+# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ 340+# endif 341+# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */ 342+# ifndef __PPC64__ 343+# if defined (__IBMC__) || defined (__IBMCPP__) 344+# define FFI_LONG_LONG_MAX LONGLONG_MAX 345+# endif 346+# endif /* __PPC64__ */ 347+# undef FFI_64_BIT_MAX 348+# define FFI_64_BIT_MAX 9223372036854775807LL 349+# endif 350+# endif 351+#endif 352+ 353+/* The closure code assumes that this works on pointers, i.e. a size_t 354+ can hold a pointer. */ 355+ 356+typedef struct _ffi_type 357+{ 358+ size_t size; 359+ unsigned short alignment; 360+ unsigned short type; 361+ struct _ffi_type **elements; 362+} ffi_type; 363+ 364+/* Need minimal decorations for DLLs to work on Windows. GCC has 365+ autoimport and autoexport. Always mark externally visible symbols 366+ as dllimport for MSVC clients, even if it means an extra indirection 367+ when using the static version of the library. 368+ Besides, as a workaround, they can define FFI_BUILDING if they 369+ *know* they are going to link with the static library. */ 370+#if defined _MSC_VER 371+# if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */ 372+# define FFI_API __declspec(dllexport) 373+# elif !defined FFI_BUILDING /* Importing libffi.DLL */ 374+# define FFI_API __declspec(dllimport) 375+# else /* Building/linking static library */ 376+# define FFI_API 377+# endif 378+#else 379+# define FFI_API 380+#endif 381+ 382+/* The externally visible type declarations also need the MSVC DLL 383+ decorations, or they will not be exported from the object file. */ 384+#if defined LIBFFI_HIDE_BASIC_TYPES 385+# define FFI_EXTERN FFI_API 386+#else 387+# define FFI_EXTERN extern FFI_API 388+#endif 389+ 390+#ifndef LIBFFI_HIDE_BASIC_TYPES 391+#if SCHAR_MAX == 127 392+# define ffi_type_uchar ffi_type_uint8 393+# define ffi_type_schar ffi_type_sint8 394+#else 395+ #error "char size not supported" 396+#endif 397+ 398+#if SHRT_MAX == 32767 399+# define ffi_type_ushort ffi_type_uint16 400+# define ffi_type_sshort ffi_type_sint16 401+#elif SHRT_MAX == 2147483647 402+# define ffi_type_ushort ffi_type_uint32 403+# define ffi_type_sshort ffi_type_sint32 404+#else 405+ #error "short size not supported" 406+#endif 407+ 408+#if INT_MAX == 32767 409+# define ffi_type_uint ffi_type_uint16 410+# define ffi_type_sint ffi_type_sint16 411+#elif INT_MAX == 2147483647 412+# define ffi_type_uint ffi_type_uint32 413+# define ffi_type_sint ffi_type_sint32 414+#elif INT_MAX == 9223372036854775807 415+# define ffi_type_uint ffi_type_uint64 416+# define ffi_type_sint ffi_type_sint64 417+#else 418+ #error "int size not supported" 419+#endif 420+ 421+#if LONG_MAX == 2147483647 422+# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX 423+ #error "no 64-bit data type supported" 424+# endif 425+#elif LONG_MAX != FFI_64_BIT_MAX 426+ #error "long size not supported" 427+#endif 428+ 429+#if LONG_MAX == 2147483647 430+# define ffi_type_ulong ffi_type_uint32 431+# define ffi_type_slong ffi_type_sint32 432+#elif LONG_MAX == FFI_64_BIT_MAX 433+# define ffi_type_ulong ffi_type_uint64 434+# define ffi_type_slong ffi_type_sint64 435+#else 436+ #error "long size not supported" 437+#endif 438+ 439+/* These are defined in types.c. */ 440+FFI_EXTERN ffi_type ffi_type_void; 441+FFI_EXTERN ffi_type ffi_type_uint8; 442+FFI_EXTERN ffi_type ffi_type_sint8; 443+FFI_EXTERN ffi_type ffi_type_uint16; 444+FFI_EXTERN ffi_type ffi_type_sint16; 445+FFI_EXTERN ffi_type ffi_type_uint32; 446+FFI_EXTERN ffi_type ffi_type_sint32; 447+FFI_EXTERN ffi_type ffi_type_uint64; 448+FFI_EXTERN ffi_type ffi_type_sint64; 449+FFI_EXTERN ffi_type ffi_type_float; 450+FFI_EXTERN ffi_type ffi_type_double; 451+FFI_EXTERN ffi_type ffi_type_pointer; 452+ 453+#if 1 454+FFI_EXTERN ffi_type ffi_type_longdouble; 455+#else 456+#define ffi_type_longdouble ffi_type_double 457+#endif 458+ 459+#ifdef FFI_TARGET_HAS_COMPLEX_TYPE 460+FFI_EXTERN ffi_type ffi_type_complex_float; 461+FFI_EXTERN ffi_type ffi_type_complex_double; 462+#if 1 463+FFI_EXTERN ffi_type ffi_type_complex_longdouble; 464+#else 465+#define ffi_type_complex_longdouble ffi_type_complex_double 466+#endif 467+#endif 468+#endif /* LIBFFI_HIDE_BASIC_TYPES */ 469+ 470+typedef enum { 471+ FFI_OK = 0, 472+ FFI_BAD_TYPEDEF, 473+ FFI_BAD_ABI, 474+ FFI_BAD_ARGTYPE 475+} ffi_status; 476+ 477+typedef struct { 478+ ffi_abi abi; 479+ unsigned nargs; 480+ ffi_type **arg_types; 481+ ffi_type *rtype; 482+ unsigned bytes; 483+ unsigned flags; 484+#ifdef FFI_EXTRA_CIF_FIELDS 485+ FFI_EXTRA_CIF_FIELDS; 486+#endif 487+} ffi_cif; 488+ 489+/* ---- Definitions for the raw API -------------------------------------- */ 490+ 491+#ifndef FFI_SIZEOF_ARG 492+# if LONG_MAX == 2147483647 493+# define FFI_SIZEOF_ARG 4 494+# elif LONG_MAX == FFI_64_BIT_MAX 495+# define FFI_SIZEOF_ARG 8 496+# endif 497+#endif 498+ 499+#ifndef FFI_SIZEOF_JAVA_RAW 500+# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG 501+#endif 502+ 503+typedef union { 504+ ffi_sarg sint; 505+ ffi_arg uint; 506+ float flt; 507+ char data[FFI_SIZEOF_ARG]; 508+ void* ptr; 509+} ffi_raw; 510+ 511+#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8 512+/* This is a special case for mips64/n32 ABI (and perhaps others) where 513+ sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */ 514+typedef union { 515+ signed int sint; 516+ unsigned int uint; 517+ float flt; 518+ char data[FFI_SIZEOF_JAVA_RAW]; 519+ void* ptr; 520+} ffi_java_raw; 521+#else 522+typedef ffi_raw ffi_java_raw; 523+#endif 524+ 525+ 526+FFI_API 527+void ffi_raw_call (ffi_cif *cif, 528+ void (*fn)(void), 529+ void *rvalue, 530+ ffi_raw *avalue); 531+ 532+FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); 533+FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); 534+FFI_API size_t ffi_raw_size (ffi_cif *cif); 535+ 536+/* This is analogous to the raw API, except it uses Java parameter 537+ packing, even on 64-bit machines. I.e. on 64-bit machines longs 538+ and doubles are followed by an empty 64-bit word. */ 539+ 540+#if !FFI_NATIVE_RAW_API 541+FFI_API 542+void ffi_java_raw_call (ffi_cif *cif, 543+ void (*fn)(void), 544+ void *rvalue, 545+ ffi_java_raw *avalue) __attribute__((deprecated)); 546+#endif 547+ 548+FFI_API 549+void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated)); 550+FFI_API 551+void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) __attribute__((deprecated)); 552+FFI_API 553+size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated)); 554+ 555+/* ---- Definitions for closures ----------------------------------------- */ 556+ 557+#if FFI_CLOSURES 558+ 559+#ifdef _MSC_VER 560+__declspec(align(8)) 561+#endif 562+typedef struct { 563+#if 0 564+ void *trampoline_table; 565+ void *trampoline_table_entry; 566+#else 567+ union { 568+ char tramp[FFI_TRAMPOLINE_SIZE]; 569+ void *ftramp; 570+ }; 571+#endif 572+ ffi_cif *cif; 573+ void (*fun)(ffi_cif*,void*,void**,void*); 574+ void *user_data; 575+} ffi_closure 576+#ifdef __GNUC__ 577+ __attribute__((aligned (8))) 578+#endif 579+ ; 580+ 581+#ifndef __GNUC__ 582+# ifdef __sgi 583+# pragma pack 0 584+# endif 585+#endif 586+ 587+FFI_API void *ffi_closure_alloc (size_t size, void **code); 588+FFI_API void ffi_closure_free (void *); 589+ 590+#if defined(PA_LINUX) || defined(PA_HPUX) 591+#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2)) 592+#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3)) 593+#else 594+#define FFI_CLOSURE_PTR(X) (X) 595+#define FFI_RESTORE_PTR(X) (X) 596+#endif 597+ 598+FFI_API ffi_status 599+ffi_prep_closure (ffi_closure*, 600+ ffi_cif *, 601+ void (*fun)(ffi_cif*,void*,void**,void*), 602+ void *user_data) 603+#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405) 604+ __attribute__((deprecated ("use ffi_prep_closure_loc instead"))) 605+#elif defined(__GNUC__) && __GNUC__ >= 3 606+ __attribute__((deprecated)) 607+#endif 608+ ; 609+ 610+FFI_API ffi_status 611+ffi_prep_closure_loc (ffi_closure*, 612+ ffi_cif *, 613+ void (*fun)(ffi_cif*,void*,void**,void*), 614+ void *user_data, 615+ void*codeloc); 616+ 617+#ifdef __sgi 618+# pragma pack 8 619+#endif 620+typedef struct { 621+#if 0 622+ void *trampoline_table; 623+ void *trampoline_table_entry; 624+#else 625+ char tramp[FFI_TRAMPOLINE_SIZE]; 626+#endif 627+ ffi_cif *cif; 628+ 629+#if !FFI_NATIVE_RAW_API 630+ 631+ /* If this is enabled, then a raw closure has the same layout 632+ as a regular closure. We use this to install an intermediate 633+ handler to do the transaltion, void** -> ffi_raw*. */ 634+ 635+ void (*translate_args)(ffi_cif*,void*,void**,void*); 636+ void *this_closure; 637+ 638+#endif 639+ 640+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*); 641+ void *user_data; 642+ 643+} ffi_raw_closure; 644+ 645+typedef struct { 646+#if 0 647+ void *trampoline_table; 648+ void *trampoline_table_entry; 649+#else 650+ char tramp[FFI_TRAMPOLINE_SIZE]; 651+#endif 652+ 653+ ffi_cif *cif; 654+ 655+#if !FFI_NATIVE_RAW_API 656+ 657+ /* If this is enabled, then a raw closure has the same layout 658+ as a regular closure. We use this to install an intermediate 659+ handler to do the translation, void** -> ffi_raw*. */ 660+ 661+ void (*translate_args)(ffi_cif*,void*,void**,void*); 662+ void *this_closure; 663+ 664+#endif 665+ 666+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*); 667+ void *user_data; 668+ 669+} ffi_java_raw_closure; 670+ 671+FFI_API ffi_status 672+ffi_prep_raw_closure (ffi_raw_closure*, 673+ ffi_cif *cif, 674+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*), 675+ void *user_data); 676+ 677+FFI_API ffi_status 678+ffi_prep_raw_closure_loc (ffi_raw_closure*, 679+ ffi_cif *cif, 680+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*), 681+ void *user_data, 682+ void *codeloc); 683+ 684+#if !FFI_NATIVE_RAW_API 685+FFI_API ffi_status 686+ffi_prep_java_raw_closure (ffi_java_raw_closure*, 687+ ffi_cif *cif, 688+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), 689+ void *user_data) __attribute__((deprecated)); 690+ 691+FFI_API ffi_status 692+ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*, 693+ ffi_cif *cif, 694+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), 695+ void *user_data, 696+ void *codeloc) __attribute__((deprecated)); 697+#endif 698+ 699+#endif /* FFI_CLOSURES */ 700+ 701+#if FFI_GO_CLOSURES 702+ 703+typedef struct { 704+ void *tramp; 705+ ffi_cif *cif; 706+ void (*fun)(ffi_cif*,void*,void**,void*); 707+} ffi_go_closure; 708+ 709+FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *, 710+ void (*fun)(ffi_cif*,void*,void**,void*)); 711+ 712+FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, 713+ void **avalue, void *closure); 714+ 715+#endif /* FFI_GO_CLOSURES */ 716+ 717+/* ---- Public interface definition -------------------------------------- */ 718+ 719+FFI_API 720+ffi_status ffi_prep_cif(ffi_cif *cif, 721+ ffi_abi abi, 722+ unsigned int nargs, 723+ ffi_type *rtype, 724+ ffi_type **atypes); 725+ 726+FFI_API 727+ffi_status ffi_prep_cif_var(ffi_cif *cif, 728+ ffi_abi abi, 729+ unsigned int nfixedargs, 730+ unsigned int ntotalargs, 731+ ffi_type *rtype, 732+ ffi_type **atypes); 733+ 734+FFI_API 735+void ffi_call(ffi_cif *cif, 736+ void (*fn)(void), 737+ void *rvalue, 738+ void **avalue); 739+ 740+FFI_API 741+ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, 742+ size_t *offsets); 743+ 744+/* Useful for eliminating compiler warnings. */ 745+#define FFI_FN(f) ((void (*)(void))f) 746+ 747+/* ---- Definitions shared with assembly code ---------------------------- */ 748+ 749+#endif 750+ 751+/* If these change, update src/mips/ffitarget.h. */ 752+#define FFI_TYPE_VOID 0 753+#define FFI_TYPE_INT 1 754+#define FFI_TYPE_FLOAT 2 755+#define FFI_TYPE_DOUBLE 3 756+#if 1 757+#define FFI_TYPE_LONGDOUBLE 4 758+#else 759+#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE 760+#endif 761+#define FFI_TYPE_UINT8 5 762+#define FFI_TYPE_SINT8 6 763+#define FFI_TYPE_UINT16 7 764+#define FFI_TYPE_SINT16 8 765+#define FFI_TYPE_UINT32 9 766+#define FFI_TYPE_SINT32 10 767+#define FFI_TYPE_UINT64 11 768+#define FFI_TYPE_SINT64 12 769+#define FFI_TYPE_STRUCT 13 770+#define FFI_TYPE_POINTER 14 771+#define FFI_TYPE_COMPLEX 15 772+ 773+/* This should always refer to the last type code (for sanity checks). */ 774+#define FFI_TYPE_LAST FFI_TYPE_COMPLEX 775+ 776+#ifdef __cplusplus 777+} 778+#endif 779+ 780+#endif 781