/home/briantrice/src/slate-language/src/vm/external-library.cpp File Reference

#include "slate.hpp"
#include <dlfcn.h>

Include dependency graph for external-library.cpp:

Go to the source code of this file.

Defines

#define DLL_FILE_NAME_EXTENSION   ".so"
#define SLATE_LIB_HANDLE   void*
#define __stdcall
#define MAX_ARG_COUNT   16

Typedefs

typedef word_t(* ext_fn0_t )(void)
typedef word_t(* ext_fn1_t )(word_t)
typedef word_t(* ext_fn2_t )(word_t, word_t)
typedef word_t(* ext_fn3_t )(word_t, word_t, word_t)
typedef word_t(* ext_fn4_t )(word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn5_t )(word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn6_t )(word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn7_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn8_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn9_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn10_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn11_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn12_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn13_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn14_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn15_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)
typedef word_t(* ext_fn16_t )(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Enumerations

enum  ArgFormat {
  ARG_FORMAT_VOID = (0 << 1) | 1, ARG_FORMAT_INT = (1 << 1) | 1, ARG_FORMAT_FLOAT = (2 << 1) | 1, ARG_FORMAT_POINTER = (3 << 1) | 1,
  ARG_FORMAT_BYTES = (4 << 1) | 1, ARG_FORMAT_BOOLEAN = (5 << 1) | 1, ARG_FORMAT_CSTRING = (6 << 1) | 1, ARG_FORMAT_C_STRUCT_VALUE = (7 << 1) | 1,
  ARG_FORMAT_DOUBLE = (8 << 1) | 1
}
enum  CallFormat { CALL_FORMAT_C = (0 << 1) | 1, CALL_FORMAT_STD = (1 << 1) | 1 }

Functions

bool_t openExternalLibrary (struct object_heap *oh, struct ByteArray *libname, struct ByteArray *handle)
bool_t closeExternalLibrary (struct object_heap *oh, struct ByteArray *handle)
bool_t lookupExternalLibraryPrimitive (struct object_heap *oh, struct ByteArray *handle, struct ByteArray *symname, struct ByteArray *ptr)
int readExternalLibraryError (struct ByteArray *messageBuffer)
typedef word_t (__stdcall *ext_std_fn0_t)(void)
word_t extractBigInteger (struct ByteArray *bigInt)
struct ObjectinjectBigInteger (struct object_heap *oh, word_t value)
struct Objectheap_new_cstring (struct object_heap *oh, byte_t *input)
struct ObjectapplyExternalLibraryPrimitive (struct object_heap *oh, struct ByteArray *fnHandle, struct OopArray *argsFormat, struct Object *callFormat, struct Object *resultFormat, struct OopArray *argsArr)

Variables

typedef word_t


Define Documentation

#define __stdcall

Definition at line 128 of file external-library.cpp.

#define DLL_FILE_NAME_EXTENSION   ".so"

Definition at line 6 of file external-library.cpp.

#define MAX_ARG_COUNT   16

Definition at line 230 of file external-library.cpp.

#define SLATE_LIB_HANDLE   void*

Definition at line 13 of file external-library.cpp.


Typedef Documentation

typedef word_t(* ext_fn0_t)(void)

Definition at line 150 of file external-library.cpp.

typedef word_t(* ext_fn10_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 160 of file external-library.cpp.

typedef word_t(* ext_fn11_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 161 of file external-library.cpp.

typedef word_t(* ext_fn12_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 162 of file external-library.cpp.

typedef word_t(* ext_fn13_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 163 of file external-library.cpp.

typedef word_t(* ext_fn14_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 164 of file external-library.cpp.

typedef word_t(* ext_fn15_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 165 of file external-library.cpp.

typedef word_t(* ext_fn16_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 166 of file external-library.cpp.

typedef word_t(* ext_fn1_t)(word_t)

Definition at line 151 of file external-library.cpp.

typedef word_t(* ext_fn2_t)(word_t, word_t)

Definition at line 152 of file external-library.cpp.

typedef word_t(* ext_fn3_t)(word_t, word_t, word_t)

Definition at line 153 of file external-library.cpp.

typedef word_t(* ext_fn4_t)(word_t, word_t, word_t, word_t)

Definition at line 154 of file external-library.cpp.

typedef word_t(* ext_fn5_t)(word_t, word_t, word_t, word_t, word_t)

Definition at line 155 of file external-library.cpp.

typedef word_t(* ext_fn6_t)(word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 156 of file external-library.cpp.

typedef word_t(* ext_fn7_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 157 of file external-library.cpp.

typedef word_t(* ext_fn8_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 158 of file external-library.cpp.

typedef word_t(* ext_fn9_t)(word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t, word_t)

Definition at line 159 of file external-library.cpp.


Enumeration Type Documentation

enum ArgFormat

Enumerator:
ARG_FORMAT_VOID 
ARG_FORMAT_INT 
ARG_FORMAT_FLOAT 
ARG_FORMAT_POINTER 
ARG_FORMAT_BYTES 
ARG_FORMAT_BOOLEAN 
ARG_FORMAT_CSTRING 
ARG_FORMAT_C_STRUCT_VALUE 
ARG_FORMAT_DOUBLE 

Definition at line 131 of file external-library.cpp.

enum CallFormat

Enumerator:
CALL_FORMAT_C 
CALL_FORMAT_STD 

Definition at line 144 of file external-library.cpp.


Function Documentation

struct Object* applyExternalLibraryPrimitive ( struct object_heap oh,
struct ByteArray fnHandle,
struct OopArray argsFormat,
struct Object callFormat,
struct Object resultFormat,
struct OopArray argsArr 
) [read]

Definition at line 236 of file external-library.cpp.

bool_t closeExternalLibrary ( struct object_heap oh,
struct ByteArray handle 
)

Definition at line 56 of file external-library.cpp.

word_t extractBigInteger ( struct ByteArray bigInt  ) 

Definition at line 186 of file external-library.cpp.

struct Object * heap_new_cstring ( struct object_heap oh,
byte_t input 
) [read]

Definition at line 232 of file external-library.cpp.

struct Object* injectBigInteger ( struct object_heap oh,
word_t  value 
) [read]

Definition at line 208 of file external-library.cpp.

bool_t lookupExternalLibraryPrimitive ( struct object_heap oh,
struct ByteArray handle,
struct ByteArray symname,
struct ByteArray ptr 
)

Definition at line 69 of file external-library.cpp.

bool_t openExternalLibrary ( struct object_heap oh,
struct ByteArray libname,
struct ByteArray handle 
)

Definition at line 26 of file external-library.cpp.

int readExternalLibraryError ( struct ByteArray messageBuffer  ) 

Definition at line 97 of file external-library.cpp.

typedef word_t ( __stdcall *  ext_std_fn0_t  ) 


Variable Documentation

typedef word_t

Definition at line 170 of file external-library.cpp.


Generated on Fri Feb 5 09:54:07 2010 for Slate VM by  doxygen 1.5.8