1
/* proto.h: Prototype function definitions for "external" functions. */
3
/* This file is part of GNU bc.
4
Copyright (C) 1991-1994, 1997, 2000 Free Software Foundation, Inc.
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License , or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; see the file COPYING. If not, write to
18
The Free Software Foundation, Inc.
19
59 Temple Place, Suite 330
22
You may contact the author by:
23
e-mail: philnelson@acm.org
24
us-mail: Philip A. Nelson
25
Computer Science Department, 9062
26
Western Washington University
27
Bellingham, WA 98226-9062
29
*************************************************************************/
31
/* For the pc version using k&r ACK. (minix1.5 and earlier.) */
33
#define init_numbers i_numbers
34
#define push_constant push__constant
35
#define load_const in_load_const
36
#define yy_get_next_buffer yyget_next_buffer
37
#define yy_init_buffer yyinit_buffer
38
#define yy_last_accepting_state yylast_accepting_state
39
#define arglist1 arg1list
42
/* Include the standard library header files. */
50
/* Define the _PROTOTYPE macro if it is needed. */
54
#define _PROTOTYPE(func, args) func args
56
#define _PROTOTYPE(func, args) func()
61
_PROTOTYPE(void stop_execution, (int));
62
_PROTOTYPE(unsigned char byte, (program_counter *pc));
63
_PROTOTYPE(void execute, (void));
64
_PROTOTYPE(char prog_char, (void));
65
_PROTOTYPE(char input_char, (void));
66
_PROTOTYPE(void push_constant, (char (*in_char)(void), int conv_base));
67
_PROTOTYPE(void push_b10_const, (program_counter *pc));
68
_PROTOTYPE(void assign, (int c_code));
71
_PROTOTYPE(char *strcopyof, (char *str));
72
_PROTOTYPE(arg_list *nextarg, (arg_list *args, int val, int is_var));
73
_PROTOTYPE(char *arg_str, (arg_list *args));
74
_PROTOTYPE(char *call_str, (arg_list *args));
75
_PROTOTYPE(void free_args, (arg_list *args));
76
_PROTOTYPE(void check_params, (arg_list *params, arg_list *autos));
77
_PROTOTYPE(void init_gen, (void));
78
_PROTOTYPE(void generate, (char *str));
79
_PROTOTYPE(void run_code, (void));
80
_PROTOTYPE(void out_char, (int ch));
81
_PROTOTYPE(void out_schar, (int ch));
82
_PROTOTYPE(id_rec *find_id, (id_rec *tree, char *id));
83
_PROTOTYPE(int insert_id_rec, (id_rec **root, id_rec *new_id));
84
_PROTOTYPE(void init_tree, (void));
85
_PROTOTYPE(int lookup, (char *name, int namekind));
86
_PROTOTYPE(char *bc_malloc, (int));
87
_PROTOTYPE(void out_of_memory, (void));
88
_PROTOTYPE(void welcome, (void));
89
_PROTOTYPE(void warranty, (char *));
90
_PROTOTYPE(void show_bc_version, (void));
91
_PROTOTYPE(void limits, (void));
92
_PROTOTYPE(void yyerror, (char *str ,...));
93
_PROTOTYPE(void warn, (char *mesg ,...));
94
_PROTOTYPE(void rt_error, (char *mesg ,...));
95
_PROTOTYPE(void rt_warn, (char *mesg ,...));
98
_PROTOTYPE(void init_load, (void));
99
_PROTOTYPE(void addbyte, (int byte));
100
_PROTOTYPE(void def_label, (long lab));
101
_PROTOTYPE(long long_val, (char **str));
102
_PROTOTYPE(void load_code, (char *code));
105
_PROTOTYPE(int open_new_file, (void));
106
_PROTOTYPE(void new_yy_file, (FILE *file));
107
_PROTOTYPE(void use_quit, (int));
110
_PROTOTYPE(void init_storage, (void));
111
_PROTOTYPE(void more_functions, (void));
112
_PROTOTYPE(void more_variables, (void));
113
_PROTOTYPE(void more_arrays, (void));
114
_PROTOTYPE(void clear_func, (int func ));
115
_PROTOTYPE(int fpop, (void));
116
_PROTOTYPE(void fpush, (int val ));
117
_PROTOTYPE(void pop, (void));
118
_PROTOTYPE(void push_copy, (bc_num num ));
119
_PROTOTYPE(void push_num, (bc_num num ));
120
_PROTOTYPE(char check_stack, (int depth ));
121
_PROTOTYPE(bc_var *get_var, (int var_name ));
122
_PROTOTYPE(bc_num *get_array_num, (int var_index, long index ));
123
_PROTOTYPE(void store_var, (int var_name ));
124
_PROTOTYPE(void store_array, (int var_name ));
125
_PROTOTYPE(void load_var, (int var_name ));
126
_PROTOTYPE(void load_array, (int var_name ));
127
_PROTOTYPE(void decr_var, (int var_name ));
128
_PROTOTYPE(void decr_array, (int var_name ));
129
_PROTOTYPE(void incr_var, (int var_name ));
130
_PROTOTYPE(void incr_array, (int var_name ));
131
_PROTOTYPE(void auto_var, (int name ));
132
_PROTOTYPE(void free_a_tree, (bc_array_node *root, int depth ));
133
_PROTOTYPE(void pop_vars, (arg_list *list ));
134
_PROTOTYPE(void process_params, (program_counter *pc, int func ));
136
/* For the scanner and parser.... */
137
_PROTOTYPE(int yyparse, (void));
138
_PROTOTYPE(int yylex, (void));
141
/* The *?*&^ prompt function */
142
_PROTOTYPE(char *null_prompt, (EditLine *));
145
/* Other things... */
146
#ifndef HAVE_UNISTD_H
147
_PROTOTYPE (int getopt, (int, char *[], CONST char *));