| 1 | /* @(#) pf_cglue.h 96/12/18 1.7 */ |
| 2 | #ifndef _pf_c_glue_h |
| 3 | #define _pf_c_glue_h |
| 4 | |
| 5 | /*************************************************************** |
| 6 | ** Include file for PForth 'C' Glue support |
| 7 | ** |
| 8 | ** Author: Phil Burk |
| 9 | ** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom |
| 10 | ** |
| 11 | ** Permission to use, copy, modify, and/or distribute this |
| 12 | ** software for any purpose with or without fee is hereby granted. |
| 13 | ** |
| 14 | ** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 15 | ** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 16 | ** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL |
| 17 | ** THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR |
| 18 | ** CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING |
| 19 | ** FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF |
| 20 | ** CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 21 | ** OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 22 | ** |
| 23 | ***************************************************************/ |
| 24 | |
| 25 | typedef cell_t (*CFunc0)( void ); |
| 26 | typedef cell_t (*CFunc1)( cell_t P1 ); |
| 27 | typedef cell_t (*CFunc2)( cell_t P1, cell_t P2 ); |
| 28 | typedef cell_t (*CFunc3)( cell_t P1, cell_t P2, cell_t P3 ); |
| 29 | typedef cell_t (*CFunc4)( cell_t P1, cell_t P2, cell_t P3, cell_t P4 ); |
| 30 | typedef cell_t (*CFunc5)( cell_t P1, cell_t P2, cell_t P3, cell_t P4, cell_t P5 ); |
| 31 | |
| 32 | #ifdef __cplusplus |
| 33 | extern "C" { |
| 34 | #endif |
| 35 | |
| 36 | Err CreateGlueToC( const char *CName, ucell_t Index, cell_t ReturnMode, int32_t NumParams ); |
| 37 | Err CompileCustomFunctions( void ); |
| 38 | Err LoadCustomFunctionTable( void ); |
| 39 | cell_t CallUserFunction( cell_t Index, int32_t ReturnMode, int32_t NumParams ); |
| 40 | |
| 41 | #ifdef __cplusplus |
| 42 | } |
| 43 | #endif |
| 44 | |
| 45 | #define C_RETURNS_VOID (0) |
| 46 | #define C_RETURNS_VALUE (1) |
| 47 | |
| 48 | #endif /* _pf_c_glue_h */ |