| /* common header file |
/* common header file |
| |
|
| Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006,2007 Free Software Foundation, Inc. |
Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. |
| |
|
| This file is part of Gforth. |
This file is part of Gforth. |
| |
|
| #include <sys/time.h> |
#include <sys/time.h> |
| #include <unistd.h> |
#include <unistd.h> |
| #ifndef STANDALONE |
#ifndef STANDALONE |
| |
#if defined(HAVE_LIBLTDL) |
| #include <ltdl.h> |
#include <ltdl.h> |
| #endif |
#endif |
| |
#endif |
| |
|
| #if !defined(FORCE_LL) && !defined(BUGGY_LONG_LONG) |
#if !defined(FORCE_LL) && !defined(BUGGY_LONG_LONG) |
| #define BUGGY_LONG_LONG |
#define BUGGY_LONG_LONG |
| #define DOVAL 6 |
#define DOVAL 6 |
| #define DODOES 7 |
#define DODOES 7 |
| #define DOESJUMP 8 |
#define DOESJUMP 8 |
| |
#define DOABICODE 9 |
| |
#define DOER_MAX 9 |
| |
|
| /* the size of the DOESJUMP, which resides between DOES> and the does-code */ |
/* the size of the DOESJUMP, which resides between DOES> and the does-code */ |
| #define DOES_HANDLER_SIZE (2*sizeof(Cell)) |
#define DOES_HANDLER_SIZE (2*sizeof(Cell)) |
| |
|
| /* shifts by less than CELL_BITS */ |
/* shifts by less than CELL_BITS */ |
| #define DLSHIFT(d,u) ({DCell _d=(d); UCell _u=(u); \ |
#define DLSHIFT(d,u) ({DCell _d=(d); UCell _u=(u); \ |
| (DCell){(_d.hi<<_u)|(_d.lo>>(CELL_BITS-_u)),_d.lo<<_u};}) |
((_u==0) ? \ |
| |
_d : \ |
| |
(DCell){(_d.hi<<_u)|(_d.lo>>(CELL_BITS-_u)), \ |
| |
_d.lo<<_u});}) |
| |
|
| #define UDLSHIFT(ud,u) D2UD(DLSHIFT(UD2D(ud),u)) |
#define UDLSHIFT(ud,u) D2UD(DLSHIFT(UD2D(ud),u)) |
| |
|
| #if SMALL_OFF_T |
#if SMALL_OFF_T |
| char name[0]; |
char name[0]; |
| }; |
}; |
| |
|
| #define LONGNAME_COUNT(np) ((np)->countetc & (((~((UCell)0))<<3)>>3)) |
#define LONGNAME_COUNT(np) ((np)->countetc & (((~((UCell)0))<<4)>>4)) |
| |
|
| struct Cellpair { |
struct Cellpair { |
| Cell n1; |
Cell n1; |
| UCell hashkey1(Char *c_addr, UCell u, UCell ubits); |
UCell hashkey1(Char *c_addr, UCell u, UCell ubits); |
| struct Cellpair parse_white(Char *c_addr1, UCell u1); |
struct Cellpair parse_white(Char *c_addr1, UCell u1); |
| Cell rename_file(Char *c_addr1, UCell u1, Char *c_addr2, UCell u2); |
Cell rename_file(Char *c_addr1, UCell u1, Char *c_addr2, UCell u2); |
| struct Cellquad read_line(Char *c_addr, UCell u1, Cell wfileid); |
struct Cellquad read_line(Char *c_addr, UCell u1, FILE *wfileid); |
| struct Cellpair file_status(Char *c_addr, UCell u); |
struct Cellpair file_status(Char *c_addr, UCell u); |
| Cell to_float(Char *c_addr, UCell u, Float *r_p); |
Cell to_float(Char *c_addr, UCell u, Float *r_p); |
| Float v_star(Float *f_addr1, Cell nstride1, Float *f_addr2, Cell nstride2, UCell ucount); |
Float v_star(Float *f_addr1, Cell nstride1, Float *f_addr2, Cell nstride2, UCell ucount); |
| UCell rshift(UCell u1, UCell n); |
UCell rshift(UCell u1, UCell n); |
| int gforth_system(Char *c_addr, UCell u); |
int gforth_system(Char *c_addr, UCell u); |
| void gforth_ms(UCell u); |
void gforth_ms(UCell u); |
| |
UCell gforth_dlopen(Char *c_addr, UCell u); |
| Cell capscompare(Char *c_addr1, UCell u1, Char *c_addr2, UCell u2); |
Cell capscompare(Char *c_addr1, UCell u1, Char *c_addr2, UCell u2); |
| |
int gf_ungetc(int c, FILE *stream); |
| |
void gf_regetc(FILE *stream); |
| |
int gf_ungottenc(FILE *stream); |
| |
|
| /* signal handler stuff */ |
/* signal handler stuff */ |
| void install_signal_handlers(void); |
void install_signal_handlers(void); |
| #endif |
#endif |
| |
|
| extern Cell *gforth_SP; |
extern Cell *gforth_SP; |
| |
extern Cell *gforth_RP; |
| |
extern Address gforth_LP; |
| extern Float *gforth_FP; |
extern Float *gforth_FP; |
| extern Address gforth_UP; |
extern Address gforth_UP; |
| |
#ifndef HAS_LINKBACK |
| |
extern void * gforth_pointers[]; |
| |
#endif |
| |
|
| #ifdef HAS_FFCALL |
#ifdef HAS_FFCALL |
| extern Cell *gforth_RP; |
extern Cell *gforth_RP; |
| extern void gforth_callback(Xt* fcall, void * alist); |
extern void gforth_callback(Xt* fcall, void * alist); |
| #endif |
#endif |
| |
|
| #ifdef HAS_LIBFFI |
|
| extern Cell *gforth_RP; |
|
| extern Address gforth_LP; |
|
| #include <ffi.h> |
|
| extern void gforth_callback(ffi_cif * cif, void * resp, void ** args, void * ip); |
|
| #endif |
|
| |
|
| #ifdef NO_IP |
#ifdef NO_IP |
| extern Label next_code; |
extern Label next_code; |
| #endif |
#endif |
| extern int ufileattr[6]; |
extern int ufileattr[6]; |
| #endif |
#endif |
| |
|
| extern lt_dladvise ltdl_advice; |
|
| |
|
| #ifdef PRINT_SUPER_LENGTHS |
#ifdef PRINT_SUPER_LENGTHS |
| Cell prim_length(Cell prim); |
Cell prim_length(Cell prim); |
| void print_super_lengths(); |
void print_super_lengths(); |