version 1.1, 2001/10/02 11:17:10 |
version 1.2, 2002/09/11 07:27:03 |
Line 52 typedef struct stack { |
|
Line 52 typedef struct stack { |
|
void *value; |
void *value; |
} stack; |
} stack; |
|
|
|
/* history */ |
|
typedef struct { |
|
GEN *res; /* array of previous results, FIFO */ |
|
size_t size; /* # res */ |
|
ulong total; /* # of results computed since big bang */ |
|
} gp_hist; |
|
|
|
/* prettyprinter */ |
|
typedef struct { |
|
pariFILE *file; |
|
char *cmd; |
|
} gp_pp; |
|
|
|
/* path */ |
|
typedef struct { |
|
char *PATH; |
|
char **dirs; |
|
} gp_path; |
|
|
void push_stack(stack **pts, void *a); |
void push_stack(stack **pts, void *a); |
void *pop_stack(stack **pts); |
void *pop_stack(stack **pts); |
|
|
Line 62 int is_identifier(char *s); |
|
Line 81 int is_identifier(char *s); |
|
entree *is_entry_intern(char *s, entree **table, long *hash); |
entree *is_entry_intern(char *s, entree **table, long *hash); |
long is_keyword_char(char c); |
long is_keyword_char(char c); |
char *readstring(char *src, char *s); |
char *readstring(char *src, char *s); |
long loop_break(); |
long loop_break(void); |
long did_break(); |
long did_break(void); |
void print_prefixed_text(char *s, char *prefix, char *str); |
void print_prefixed_text(char *s, char *prefix, char *str); |
|
GEN gp_history(gp_hist *H, long p, char *old, char *entry); |
|
GEN set_hist_entry(gp_hist *H, GEN x); |
|
|
|
char* get_analyseur(void); |
|
void set_analyseur(char *s); |
|
|
void term_color(int c); |
void term_color(int c); |
char *term_get_color(int c); |
char *term_get_color(int c); |
void hit_return(); |
void hit_return(void); |
|
|
void push_val(entree *ep, GEN a); |
void push_val(entree *ep, GEN a); |
void pop_val(entree *ep); |
void pop_val(entree *ep); |
|
|
extern long prec, secure; |
extern ulong prec; |
extern GEN gnil; |
extern GEN gnil; |
|
|
extern char *current_function; |
extern char *current_function; |
extern GEN (*gp_history_fun)(long, long, char *, char *); |
|
extern int (*whatnow_fun)(char *, int); |
extern int (*whatnow_fun)(char *, int); |
extern void (*output_fun)(GEN); |
|
extern void *foreignHandler; |
extern void *foreignHandler; |
extern GEN (*foreignExprHandler)(char*); |
extern GEN (*foreignExprHandler)(char*); |
extern char foreignExprSwitch; |
extern char foreignExprSwitch; |
Line 111 extern char *oldhelpmessage[], *helpmessages_oldgp[] |
|
Line 133 extern char *oldhelpmessage[], *helpmessages_oldgp[] |
|
extern entree oldfonctions[], functions_oldgp[]; |
extern entree oldfonctions[], functions_oldgp[]; |
|
|
/* backward compatibility */ |
/* backward compatibility */ |
extern long compatible; |
extern ulong compatible; |
enum { NONE, WARN, OLDFUN, OLDALL }; |
enum { NONE, WARN, OLDFUN, OLDALL }; |
#define new_fun_set (compatible == NONE || compatible == WARN) |
#define new_fun_set (compatible == NONE || compatible == WARN) |
|
|
/* return type for GP functions */ |
/* return type for GP functions */ |
enum { RET_GEN, RET_INT, RET_VOID }; |
enum { RET_GEN, RET_INT, RET_VOID }; |
|
|
/* emacs/texmacs interface */ |
|
extern int under_emacs; |
|
extern int under_texmacs; |
|
|
|
#ifdef STACK_CHECK |
#ifdef STACK_CHECK |
extern void *PARI_stack_limit; |
extern void *PARI_stack_limit; |
#endif |
#endif |
Line 195 enum { c_ERR, c_HIST, c_PROMPT, c_INPUT, c_OUTPUT, c_H |
|
Line 213 enum { c_ERR, c_HIST, c_PROMPT, c_INPUT, c_OUTPUT, c_H |
|
#define mf_TEST 32 |
#define mf_TEST 32 |
|
|
/* for filtre */ |
/* for filtre */ |
#define f_COMMENT 0 |
typedef struct { |
#define f_INIT 1 |
char *s, *t, *end; /* source, target, last char read */ |
#define f_KEEPCASE 2 |
int in_string, in_comment, more_input, wait_for_brace, downcase; |
#define f_REG 4 |
void *data; |
#define f_ENDFILE 8 |
} filtre_t; |
|
|
|
#define LBRACE '{' |
|
#define RBRACE '}' |
|
|
|
extern char *filtre0(filtre_t *F); |
|
extern char *filtre(char *s, int flag); |
|
extern void check_filtre(filtre_t *F); |
|
|
|
typedef struct Buffer { |
|
char *buf; |
|
ulong len; |
|
jmp_buf env; |
|
int flenv; |
|
} Buffer; |
|
|
|
typedef struct input_method { |
|
int free; |
|
char *prompt; |
|
FILE *file; |
|
char * (*fgets)(char *,int,FILE*); |
|
char * (*getline)(Buffer*, char**, struct input_method*); |
|
} input_method; |
|
|
|
/* GP output && output format */ |
|
enum { f_RAW, f_PRETTYMAT, f_PRETTYOLD, f_PRETTY, f_TEX }; |
|
|
|
void error0(GEN *g); |
|
void gpwritebin(char *s, GEN x); |
|
void print (GEN *g); |
|
void print0(GEN *g, long flag); |
|
void print1 (GEN *g); |
|
void printp (GEN *g); |
|
void printp1 (GEN *g); |
|
void printtex(GEN *g); |
|
void write0 (char *s, GEN *g); |
|
void write1 (char *s, GEN *g); |
|
void writetex(char *s, GEN *g); |
|
|
|
/* for output */ |
|
typedef struct { |
|
char format; /* e,f,g */ |
|
long fieldw; /* 0 (ignored) or field width */ |
|
long sigd; /* -1 (all) or number of sign. digits printed */ |
|
int sp; |
|
int initial; |
|
int prettyp; |
|
} pariout_t; |
|
|
|
extern void gen_output(GEN x, pariout_t *T); |
|
extern char *GENtostr0(GEN x, pariout_t *T, void(*do_out)(GEN, pariout_t *)); |
|
extern void bruti(GEN g, pariout_t *T, int nosign); |
|
extern void matbruti(GEN g, pariout_t *T); |
|
extern void sori(GEN g, pariout_t *T); |
|
extern void texi(GEN g, pariout_t *T, int nosign); |
|
extern pariout_t DFLT_OUTPUT; |
|
|
|
/* GP_DATA->flags */ |
|
enum { QUIET=1, TEST=2, SIMPLIFY=4, CHRONO=8, ECHO=16, STRICTMATCH=32, |
|
USE_READLINE=64, SECURE=128, EMACS=256, TEXMACS=512, LOG=1024}; |
|
/* GP */ |
|
#define pariputs_opt(s) if (!(GP_DATA->flags & QUIET)) pariputs(s) |
|
|
|
#if 0 /* to debug TeXmacs interface */ |
|
#define DATA_BEGIN ((char) 'B') |
|
#define DATA_END ((char) 'E') |
|
#else |
|
#define DATA_BEGIN ((char) 2) |
|
#define DATA_END ((char) 5) |
|
#endif |
|
#define DATA_ESCAPE ((char) 27) |
|
|
|
typedef struct { |
|
gp_hist *hist; |
|
gp_pp *pp; |
|
gp_path *path; |
|
pariout_t *fmt; |
|
ulong flags, lim_lines; |
|
char *help; |
|
pari_timer *T; |
|
} gp_data; |
|
|
|
extern gp_data *GP_DATA; |
|
|