Annotation of OpenXM_contrib/pari-2.2/src/headers/paristio.h, Revision 1.1
1.1 ! noro 1: /* $Id: paristio.h,v 1.8 2001/04/15 16:24:58 karim Exp $
! 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:
! 18: typedef unsigned char *byteptr;
! 19:
! 20: typedef struct stackzone
! 21: {
! 22: long zonetop, bot, top, avma, memused;
! 23: } stackzone;
! 24:
! 25: typedef struct entree {
! 26: char *name;
! 27: ulong valence;
! 28: void *value;
! 29: long menu;
! 30: char *code;
! 31: struct entree *next;
! 32: char *help;
! 33: void *args;
! 34: } entree;
! 35:
! 36: typedef struct PariOUT {
! 37: void (*putch)(char);
! 38: void (*puts)(char*);
! 39: void (*flush)(void); /* Finalize a report of a non fatal-error. */
! 40: void (*die)(void); /* If not-NULL, should be called to finalize
! 41: a report of a fatal error (no "\n" required). */
! 42: } PariOUT;
! 43:
! 44: typedef struct pariFILE {
! 45: FILE *file;
! 46: int type;
! 47: char *name;
! 48: struct pariFILE* prev;
! 49: struct pariFILE* next;
! 50: } pariFILE;
! 51: /* Common global variables: */
! 52:
! 53: extern PariOUT *pariOut, *pariErr;
! 54: extern FILE *pari_outfile, *logfile, *infile, *errfile;
! 55:
! 56: extern ulong avma,bot,top,memused;
! 57: extern byteptr diffptr;
! 58: extern entree **varentries;
! 59: extern char *errmessage[], *current_psfile;
! 60:
! 61: #define is_universal_constant(x) ((GEN)(x) >= gzero && (GEN)(x) <= gi)
! 62:
! 63: #define copyifstack(x,y) {ulong t=(ulong)(x); \
! 64: (y)=(t>=bot &&t<top)? lcopy((GEN)t): t;}
! 65: #define icopyifstack(x,y) {ulong t=(ulong)(x); \
! 66: (y)=(t>=bot &&t<top)? licopy((GEN)t): t;}
! 67: #define isonstack(x) ((ulong)(x)>=bot && (ulong)(x)<top)
! 68:
! 69: /* Define this to (1) locally (in a given file, NOT here) to check
! 70: * "random" garbage collecting
! 71: */
! 72: #ifdef DYNAMIC_STACK
! 73: # define low_stack(x,l) (avma < (ulong)(l))
! 74: #else
! 75: # define low_stack(x,l) (avma < (ulong)(x))
! 76: #endif
! 77:
! 78: #define stack_lim(av,n) (bot + (((av)-bot)>>(n)))
! 79:
! 80: #ifndef SIG_IGN
! 81: # define SIG_IGN (void(*)())1
! 82: #endif
! 83: #ifndef SIGINT
! 84: # define SIGINT 2
! 85: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>