The Call-C-Function MISCN opcode This opcode calls the specified C function, performaing conversion of arguments and result as needed, and returning an indication of any errors it encounters. (MISCN CALL-C Function Conversion-spec Return-Code &REST Args-To-C-Fn) Function is a Lisp integer (FIXP or SMALLP) containing the address of the function to be called. CALL-C checks for some special values, 0 (meaning the function was never loaded) and -1 (meaning the function was loaded once, and subsequently unloaded at user request), and -2 (meaning that the function has been loaded, but there are unresolved externals). Conversion-spec specifies how the arguments and function-result are to be converted. This is a Lisp pointer to a block of 16-bit entries: +------------------------+ + Result Conversion Spec | +------------------------+ | Arg 0 Conversion | +------------------------+ | Arg 1 Conversion | +------------------------+ | etc. | +------------------------+ | -0- | +------------------------+ Possible values for the conversion fields: 0 VOID (return only, return NIL) 1 int (Lisp SMALLP/FIXP <=> 32-bit integer) 2 char (Lisp SMALLP/CHARACTER <=> char) 3 float 4 long 5 short 6 lisp 7 cpointer Return-Code is a FIXP cell into which CALL-C places a return value. Possible values are: 0 Successful call and return +n conversion error on argument n -1 conversion error on result -2 signal encountered while running C?? DEFFOREIGN%Define a foreign function for lisp. This macro tells Medley about a foreign function%its arguments, what type of result it returns, etc. It also creates a Medley function you can call to invoke the foreign function. (DEFFOREIGN Function Result-Type ArgList &KEY :function-name) Function is a symbol, the Lisp name for the function. Function is given a definition that results in the foreign function being called. Function returns what the foreign function returns, after conversion to a Lisp datatype. Result-Type is a symbol specifying what type of data the foreign function returns, and how it is to be converted to a Lisp type. Possible values are: :void The function returns no interesting value. Function will always return NIL. :long :short :int The function returns an integer. It is converted to a FIXP or a SMALLP. :char The function returns a character. It is converted to a SMALLP. :float The function returns a floating-point number. It is converted to a Lisp FLOATP. :lisp The function returns a lisp-pointer, which isn't converted, but DOES get reference counted. :byte ?? same as character, but converted to what?? :cpointer The function returns a pointer to a block of storage not in the Lisp virtual memory image. This may be a pointer to a C structure, or whatever. It is intended for use with CBLOCKRECORD and DEFCSTRUCT Where is a type defined using DEFCSTRUCT. The result is a pointer to a block of storage no in the Lisp virtual memory image.... ArgList is a list of symbols, each specifying what kind of data the foreign function expects for a given argument. The possible values are as above. Function-name is a symbol or string containing the true name (as far as the foreign language is concerned) of the function you want to call when the Lisp Function is called.5HBH, - T, ,TITAN GACHA CLASSIC CLASSIC MODERNVH(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8) (POSTSCRIPT (GACHA 8))) !$ ]F5+!,(  O"( K0  /KQ NJAR]/      z