Annotation of OpenXM_contrib/pari-2.2/src/headers/paristio.h, Revision 1.2
1.2 ! noro 1: /* $Id: paristio.h,v 1.16 2002/09/08 10:41:22 karim Exp $
1.1 noro 2:
3: Copyright (C) 2000 The PARI group.
4:
5: This file is part of the PARI/GP package.
6:
7: PARI/GP is free software; you can redistribute it and/or modify it under the
8: terms of the GNU General Public License as published by the Free Software
9: Foundation. It is distributed in the hope that it will be useful, but WITHOUT
10: ANY WARRANTY WHATSOEVER.
11:
12: Check the License for details. You should have received a copy of it, along
13: with the package; see the file 'COPYING'. If not, write to the Free Software
14: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
15:
16: /* This file contains memory and I/O management definitions */
17:
1.2 ! noro 18: typedef struct {
! 19: long s, us;
! 20: } pari_timer;
! 21:
1.1 noro 22: typedef unsigned char *byteptr;
1.2 ! noro 23: typedef ulong gpmem_t;
1.1 noro 24:
25: typedef struct stackzone
26: {
1.2 ! noro 27: gpmem_t zonetop, bot, top, avma;
! 28: size_t memused;
1.1 noro 29: } stackzone;
30:
31: typedef struct entree {
32: char *name;
33: ulong valence;
34: void *value;
35: long menu;
36: char *code;
37: struct entree *next;
38: char *help;
39: void *args;
40: } entree;
41:
42: typedef struct PariOUT {
43: void (*putch)(char);
44: void (*puts)(char*);
45: void (*flush)(void); /* Finalize a report of a non fatal-error. */
46: void (*die)(void); /* If not-NULL, should be called to finalize
47: a report of a fatal error (no "\n" required). */
48: } PariOUT;
49:
50: typedef struct pariFILE {
51: FILE *file;
52: int type;
53: char *name;
54: struct pariFILE* prev;
55: struct pariFILE* next;
56: } pariFILE;
57: /* Common global variables: */
58:
59: extern PariOUT *pariOut, *pariErr;
60: extern FILE *pari_outfile, *logfile, *infile, *errfile;
61:
1.2 ! noro 62: extern gpmem_t avma,bot,top;
! 63: extern size_t memused;
1.1 noro 64: extern byteptr diffptr;
65: extern entree **varentries;
66: extern char *errmessage[], *current_psfile;
67:
68: #define is_universal_constant(x) ((GEN)(x) >= gzero && (GEN)(x) <= gi)
69:
1.2 ! noro 70: #define copyifstack(x,y) STMT_START {gpmem_t _t=(gpmem_t)(x); \
! 71: (y)=(_t>=bot &&_t<top)? lcopy((GEN)_t): (long)_t;} STMT_END
! 72: #define icopyifstack(x,y) STMT_START {gpmem_t _t=(gpmem_t)(x); \
! 73: (y)=(_t>=bot &&_t<top)? licopy((GEN)_t): (long)_t;} STMT_END
! 74: #define isonstack(x) ((gpmem_t)(x)>=bot && (gpmem_t)(x)<top)
1.1 noro 75:
76: /* Define this to (1) locally (in a given file, NOT here) to check
77: * "random" garbage collecting
78: */
79: #ifdef DYNAMIC_STACK
1.2 ! noro 80: # define low_stack(x,l) (avma < (gpmem_t)(l))
1.1 noro 81: #else
1.2 ! noro 82: # define low_stack(x,l) (avma < (gpmem_t)(x))
1.1 noro 83: #endif
84:
85: #define stack_lim(av,n) (bot + (((av)-bot)>>(n)))
86:
87: #ifndef SIG_IGN
88: # define SIG_IGN (void(*)())1
89: #endif
90: #ifndef SIGINT
91: # define SIGINT 2
92: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>