Annotation of gforth/engine/libcc.h.in, revision 1.6

1.1       anton       1: /* header file for libcc-generated C code
                      2: 
1.2       anton       3:   Copyright (C) 2006,2007 Free Software Foundation, Inc.
1.1       anton       4: 
                      5:   This file is part of Gforth.
                      6: 
                      7:   Gforth is free software; you can redistribute it and/or
                      8:   modify it under the terms of the GNU General Public License
1.3       anton       9:   as published by the Free Software Foundation, either version 3
1.1       anton      10:   of the License, or (at your option) any later version.
                     11: 
                     12:   This program is distributed in the hope that it will be useful,
                     13:   but WITHOUT ANY WARRANTY; without even the implied warranty of
                     14:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     15:   GNU General Public License for more details.
                     16: 
                     17:   You should have received a copy of the GNU General Public License
1.3       anton      18:   along with this program. If not, see http://www.gnu.org/licenses/.
1.1       anton      19: */
                     20: 
                     21: #include <gforth/@PACKAGE_VERSION@/config.h>
                     22: 
1.5       pazsan     23: #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1.4       pazsan     24: #undef HAS_BACKLINK
                     25: #else
                     26: #define HAS_BACKLINK 1
                     27: #endif
                     28: 
1.1       anton      29: typedef CELL_TYPE Cell;
                     30: typedef double Float;
                     31: 
                     32: #define Clongest long long
                     33: typedef unsigned Clongest UClongest;
                     34: 
1.4       pazsan     35: #ifdef HAS_BACKLINK
1.1       anton      36: extern Cell *gforth_SP;
                     37: extern Float *gforth_FP;
1.4       pazsan     38: extern Cell *gforth_RP;
                     39: extern char *gforth_LP;
                     40: extern char *gforth_UP;
                     41: extern void *gforth_engine(void *, Cell *, Cell *, Float *, char *, char *);
1.6     ! pazsan     42: #ifdef HAS_FILE
        !            43: extern char *cstr(char *from, UCell size, int clear)
        !            44: extern char *tilde_cstr(char *from, UCell size, int clear)
        !            45: #endif
1.4       pazsan     46: #define GFORTH_ARGS void
                     47: #else
                     48: #define gforth_SP *((Cell **)(gforth_pointers[0]))
                     49: #define gforth_FP *((Float **)(gforth_pointers[1]))
                     50: #define gforth_LP *((char **)(gforth_pointers[2]))
                     51: #define gforth_RP *((Cell **)(gforth_pointers[3]))
                     52: #define gforth_UP *((char **)(gforth_pointers[4]))
                     53: #define gforth_engine ((char *(*)(Xt *, Cell *, Cell *, Float *, char *, char *))(((void **)(gforth_pointers[5]))))
1.6     ! pazsan     54: #ifdef HAS_FILE
        !            55: #define cstr ((char *(*)(char *, UCell *, int))(((void **)(gforth_pointers[6]))))
        !            56: #define tilde_cstr ((char *(*)(char *, UCell *, int))(((void **)(gforth_pointers[7]))))
        !            57: #endif
1.4       pazsan     58: #define GFORTH_ARGS void ** gforth_pointers 
                     59: #endif
1.1       anton      60: 
                     61: #define CELL_BITS      (sizeof(Cell) * 8)
                     62: 
                     63: #define gforth_d2ll(lo,hi) \
                     64:   ((sizeof(Cell) < sizeof(Clongest)) \
                     65:    ? (((UClongest)(lo))|(((UClongest)(hi))<<CELL_BITS)) \
                     66:    : (lo))
                     67: 
                     68: #define gforth_ll2d(ll,lo,hi) \
                     69:   do { \
                     70:     UClongest _ll = (ll); \
                     71:     (lo) = (Cell)_ll; \
                     72:     (hi) = ((sizeof(Cell) < sizeof(Clongest)) \
                     73:             ? (_ll >> CELL_BITS) \
                     74:             : 0); \
                     75:   } while (0);

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>