source: trunk/minix/commands/bc/proto.h@ 12

Last change on this file since 12 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 6.0 KB
Line 
1/* proto.h: Prototype function definitions for "external" functions. */
2
3/* This file is part of bc written for MINIX.
4 Copyright (C) 1991, 1992 Free Software Foundation, Inc.
5
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.
10
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.
15
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, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 You may contact the author by:
21 e-mail: phil@cs.wwu.edu
22 us-mail: Philip A. Nelson
23 Computer Science Department, 9062
24 Western Washington University
25 Bellingham, WA 98226-9062
26
27*************************************************************************/
28
29/* For the pc version using k&r ACK. (minix1.5 and earlier.) */
30#ifdef SHORTNAMES
31#define init_numbers i_numbers
32#define push_constant push__constant
33#define load_const in_load_const
34#define yy_get_next_buffer yyget_next_buffer
35#define yy_init_buffer yyinit_buffer
36#define yy_last_accepting_state yylast_accepting_state
37#define arglist1 arg1list
38#endif
39
40/* Include the standard library header files. */
41#ifndef NO_UNISTD
42#include <unistd.h>
43#endif
44#ifndef NO_STDLIB
45#ifdef __STDC__
46#include <stdlib.h>
47#endif
48#endif
49
50/* Define the _PROTOTYPE macro if it is needed. */
51
52#ifndef _PROTOTYPE
53#ifdef __STDC__
54#define _PROTOTYPE(func, args) func args
55#else
56#define _PROTOTYPE(func, args) func()
57#endif
58#endif
59
60/* From execute.c */
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));
69
70/* From util.c */
71_PROTOTYPE(char *strcopyof, (char *str));
72_PROTOTYPE(arg_list *nextarg, (arg_list *args, int val));
73_PROTOTYPE(char *arg_str, (arg_list *args, int));
74_PROTOTYPE(void free_args, (arg_list *args));
75_PROTOTYPE(void check_params, (arg_list *params, arg_list *autos));
76_PROTOTYPE(void init_gen, (void));
77_PROTOTYPE(void generate, (char *str));
78_PROTOTYPE(void run_code, (void));
79_PROTOTYPE(void out_char, (int ch));
80_PROTOTYPE(id_rec *find_id, (id_rec *tree, char *id));
81_PROTOTYPE(int insert_id_rec, (id_rec **root, id_rec *new_id));
82_PROTOTYPE(void init_tree, (void));
83_PROTOTYPE(int lookup, (char *name, int namekind));
84_PROTOTYPE(char *bc_malloc, (int));
85_PROTOTYPE(void out_of_memory, (void));
86_PROTOTYPE(void welcome, (void));
87_PROTOTYPE(void warranty, (char *));
88_PROTOTYPE(void limits, (void));
89_PROTOTYPE(void yyerror, (char *str ,...));
90_PROTOTYPE(void warn, (char *mesg ,...));
91_PROTOTYPE(void rt_error, (char *mesg ,...));
92_PROTOTYPE(void rt_warn, (char *mesg ,...));
93
94/* From load.c */
95_PROTOTYPE(void init_load, (void));
96_PROTOTYPE(void addbyte, (int byte));
97_PROTOTYPE(void def_label, (long lab));
98_PROTOTYPE(long long_val, (char **str));
99_PROTOTYPE(void load_code, (char *code));
100
101/* From main.c */
102_PROTOTYPE(int main, (int argc , char *argv []));
103_PROTOTYPE(int open_new_file, (void));
104_PROTOTYPE(void new_yy_file, (FILE *file));
105_PROTOTYPE(void use_quit, (int));
106
107/* From number.c */
108_PROTOTYPE(void free_num, (bc_num *num));
109_PROTOTYPE(bc_num new_num, (int length, int scale));
110_PROTOTYPE(void init_numbers, (void));
111_PROTOTYPE(bc_num copy_num, (bc_num num));
112_PROTOTYPE(void init_num, (bc_num *num));
113_PROTOTYPE(void str2num, (bc_num *num, char *str, int scale));
114_PROTOTYPE(char *num2str, (bc_num num));
115_PROTOTYPE(void int2num, (bc_num *num, int val));
116_PROTOTYPE(long num2long, (bc_num num));
117_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2));
118_PROTOTYPE(char is_zero, (bc_num num));
119_PROTOTYPE(char is_neg, (bc_num num));
120_PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result));
121_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result));
122_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale));
123_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale));
124_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result, int scale));
125_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result, int scale));
126_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale));
127_PROTOTYPE(void out_long, (long val, int size, int space,
128 void (*out_char)(int)));
129_PROTOTYPE(void out_num, (bc_num num, int o_base, void (* out_char)(int)));
130
131
132/* From storage.c */
133_PROTOTYPE(void init_storage, (void));
134_PROTOTYPE(void more_functions, (void));
135_PROTOTYPE(void more_variables, (void));
136_PROTOTYPE(void more_arrays, (void));
137_PROTOTYPE(void clear_func, (int func ));
138_PROTOTYPE(int fpop, (void));
139_PROTOTYPE(void fpush, (int val ));
140_PROTOTYPE(void pop, (void));
141_PROTOTYPE(void push_copy, (bc_num num ));
142_PROTOTYPE(void push_num, (bc_num num ));
143_PROTOTYPE(char check_stack, (int depth ));
144_PROTOTYPE(bc_var *get_var, (int var_name ));
145_PROTOTYPE(bc_num *get_array_num, (int var_index, long index ));
146_PROTOTYPE(void store_var, (int var_name ));
147_PROTOTYPE(void store_array, (int var_name ));
148_PROTOTYPE(void load_var, (int var_name ));
149_PROTOTYPE(void load_array, (int var_name ));
150_PROTOTYPE(void decr_var, (int var_name ));
151_PROTOTYPE(void decr_array, (int var_name ));
152_PROTOTYPE(void incr_var, (int var_name ));
153_PROTOTYPE(void incr_array, (int var_name ));
154_PROTOTYPE(void auto_var, (int name ));
155_PROTOTYPE(void free_a_tree, (bc_array_node *root, int depth ));
156_PROTOTYPE(void pop_vars, (arg_list *list ));
157_PROTOTYPE(void process_params, (program_counter *pc, int func ));
158
159/* For the scanner and parser.... */
160_PROTOTYPE(int yyparse, (void));
161_PROTOTYPE(int yylex, (void));
162
Note: See TracBrowser for help on using the repository browser.