disable the unrecognized nls flag
[AROS-Contrib.git] / regina / extern.h
blobbb15a6efbc665131beb0effd5a7ce71a85e607ac
1 /*
2 * The Regina Rexx Interpreter
3 * Copyright (C) 1992-1994 Anders Christensen <anders@pvv.unit.no>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 /* JH 20-10-99 */ /* To make Direct setting of stems Direct and not Symbolic. */
24 * Routines in lexsrc.l
26 #ifndef FLEX_SCANNER
27 extern YY_CHAR_TYPE *yysptr, yysbuf[] ;
28 #endif
29 void fetch_file(tsd_t *TSD,
30 FILE *fptr,
31 internal_parser_type *ipt);
32 void fetch_string(tsd_t *TSD,
33 const streng *str,
34 internal_parser_type *ipt);
37 * Routines in parsing.c
39 int bmstrstr( const streng *heystack, int start, const streng *needle, int caseless ) ;
40 void doparse( tsd_t *TSD, const streng *source, cnodeptr subtree, int caseless ) ;
41 void parseargtree(tsd_t *TSD, cparamboxptr argbox, cnodeptr thisptr, int flags );
45 * Routines in debug.c
47 void dumpvars( const tsd_t *TSD );
48 void dumptree( const tsd_t *TSD, const treenode *thisptr, int level, int newline ) ;
49 streng *getsourceline( const tsd_t *TSD, int line, int charnr, const internal_parser_type *ipt ) ;
50 #ifdef TRACEMEM
51 void marksource( clineboxptr ) ;
52 #endif
56 * Routines in files.c
58 streng *readkbdline( tsd_t *TSD ) ;
59 void mark_filetable( const tsd_t *TSD) ;
60 int filename_cmp( const streng *name1, const streng *name2 );
61 void purge_filetable( tsd_t *TSD ) ;
62 int init_filetable( tsd_t *TSD ) ;
63 void fixup_file( tsd_t *TSD, const streng * ) ;
64 streng *get_external_routine( const tsd_t *TSD, const char *inname,
65 FILE **fp );
66 void find_shared_library(const tsd_t *TSD,const char *, const char *, char *);
67 void CloseOpenFiles ( const tsd_t *TSD, FilePtrDisposition fpd ) ;
68 streng *ConfigStreamQualified( tsd_t *TSD, const streng *name );
69 streng *std_charin( tsd_t *TSD, cparamboxptr parms ) ;
70 streng *std_charout( tsd_t *TSD, cparamboxptr parms ) ;
71 streng *std_chars( tsd_t *TSD, cparamboxptr parms ) ;
72 streng *std_linein( tsd_t *TSD, cparamboxptr parms ) ;
73 streng *std_lineout( tsd_t *TSD, cparamboxptr parms ) ;
74 streng *std_lines( tsd_t *TSD, cparamboxptr parms ) ;
75 streng *std_stream( tsd_t *TSD, cparamboxptr parms ) ;
76 void closefile( tsd_t *TSD, const streng *name ) ;
77 void *addr_reopen_file( tsd_t *TSD, const streng *filename, char code, int iserror );
78 streng *addr_io_file( tsd_t *TSD, void *fileptr, const streng *line ) ;
79 void addr_reset_file( tsd_t *TSD, void *fileptr );
80 streng *addr_file_info( tsd_t *TSD, const streng *source, int defchannel );
81 #ifndef NDEBUG
82 streng *dbg_dumpfiles( tsd_t *TSD, cparamboxptr parms ) ;
83 #endif
84 streng *unx_open( tsd_t *TSD, cparamboxptr parms ) ;
85 streng *unx_close( tsd_t *TSD, cparamboxptr parms ) ;
86 #if !defined(HAVE__SPLITPATH2) && !defined(HAVE__SPLITPATH) && !defined(__EMX__) && !defined(DJGPP)
87 int my_splitpath2( const char *in, char *out, char **drive, char **dir, char **name, char **ext ) ;
88 #endif
89 int my_fullpath( char *dst, const char *src );
90 int my_fullpathstreng( const tsd_t *TSD, char *dst, const streng *src );
91 streng *arexx_exists( tsd_t *TSD, cparamboxptr parms ) ;
92 streng *arexx_exists( tsd_t *TSD, cparamboxptr parms ) ;
95 * Routines in expr.c
97 int isboolean( tsd_t *TSD, nodeptr, int suberror, const char *op ) ;
98 num_descr *calcul( tsd_t *TSD, nodeptr, num_descr** ) ;
99 int init_expr( tsd_t *TSD ) ;
100 streng *evaluate( tsd_t *TSD, nodeptr thisptr, streng **kill ) ;
103 * Routines in cmsfuncs.c
105 streng *cms_sleep( tsd_t *TSD, cparamboxptr parms ) ;
106 streng *cms_makebuf( tsd_t *TSD, cparamboxptr parms ) ;
107 streng *cms_justify( tsd_t *TSD, cparamboxptr parms ) ;
108 streng *cms_find( tsd_t *TSD, cparamboxptr parms ) ;
109 streng *cms_index( tsd_t *TSD, cparamboxptr parms ) ;
110 streng *cms_desbuf( tsd_t *TSD, cparamboxptr parms ) ;
111 streng *cms_buftype( tsd_t *TSD, cparamboxptr parms ) ;
112 streng *cms_dropbuf( tsd_t *TSD, cparamboxptr parms ) ;
113 streng *cms_state( tsd_t *TSD, cparamboxptr parms ) ;
116 * Routines in memory.c
118 int init_memory( tsd_t *TSD ) ;
119 #ifdef FLISTS
120 void *get_a_chunk( int bytes ) ;
121 void *get_a_chunkTSD( const tsd_t *TSD, int bytes ) ;
122 streng *get_a_streng( int bytes ) ;
123 streng *get_a_strengTSD( const tsd_t *TSD, int bytes ) ;
124 void give_a_chunk( void *ptr ) ;
125 void give_a_chunkTSD( const tsd_t *TSD, void *ptr ) ;
126 void give_a_streng( streng *ptr ) ;
127 void give_a_strengTSD( const tsd_t *TSD, streng *ptr ) ;
128 int show_free_lists(const tsd_t *TSD);
129 void purge_flists(const tsd_t *TSD);
130 #endif
131 #ifdef TRACEMEM
132 void *mymalloc( int bytes ) ;
133 void *mymallocTSD( const tsd_t *TSD, int bytes ) ;
134 void myfree( void *ptr ) ;
135 void myfreeTSD( const tsd_t *TSD, void *ptr ) ;
136 void regmarker( const tsd_t *TSD, void (*func)(const tsd_t *TSD) ) ;
137 int have_allocated( tsd_t *TSD, int flag ) ;
138 void markmemory( void *ptr, int i ) ;
139 int listleaked( const tsd_t *TSD, int pflag ) ;
140 void memory_stats( const tsd_t *TSD ) ;
141 void mark_listleaked_params( const tsd_t *TSD ) ;
142 #endif /* TRACEMEM */
144 #ifdef TRACEMEM
145 # define Malloc(bytes) mymalloc(bytes)
146 # define Malloc_TSD(TSD,bytes) mymallocTSD(TSD,bytes)
147 # define MallocTSD(bytes) mymallocTSD(TSD,bytes)
148 # define Free(ptr) myfree(ptr)
149 # define Free_TSD(TSD,ptr) myfreeTSD(TSD,ptr)
150 # define FreeTSD(ptr) myfreeTSD(TSD,ptr)
151 # define Free_string(ptr) myfree(ptr)
152 # define Free_string_TSD(TSD,ptr) myfreeTSD(TSD,ptr)
153 # define Free_stringTSD(ptr) myfreeTSD(TSD,ptr)
154 #elif defined(FLISTS)
155 # define Malloc(bytes) get_a_chunk(bytes)
156 # define Malloc_TSD(TSD,bytes) get_a_chunkTSD(TSD,bytes)
157 # define MallocTSD(bytes) get_a_chunkTSD(TSD,bytes)
158 # define Free(ptr) give_a_chunk(ptr)
159 # define Free_TSD(TSD,ptr) give_a_chunkTSD(TSD,ptr)
160 # define FreeTSD(ptr) give_a_chunkTSD(TSD,ptr)
161 # define Free_string(ptr) give_a_streng(ptr)
162 # define Free_string_TSD(TSD,ptr) give_a_strengTSD(TSD,ptr)
163 # define Free_stringTSD(ptr) give_a_strengTSD(TSD,ptr)
164 #else /* neither TRACEMEM nor FLISTS */
165 # define Malloc(bytes) Malloc_TSD(__regina_get_tsd(),bytes)
166 # define Malloc_TSD(TSD,bytes) (TSD)->MTMalloc(TSD,bytes)
167 # define MallocTSD(bytes) Malloc_TSD(TSD,bytes)
168 # define Free(ptr) Free_TSD(__regina_get_tsd(),ptr)
169 # define Free_TSD(TSD,ptr) (TSD)->MTFree(TSD,ptr)
170 # define FreeTSD(ptr) Free_TSD(TSD,ptr)
171 # ifdef CHECK_MEMORY
172 void give_a_streng( streng *ptr ) ;
173 void give_a_strengTSD( const tsd_t *TSD, streng *ptr ) ;
174 # define Free_string(ptr) give_a_streng(ptr)
175 # define Free_string_TSD(TSD,ptr) give_a_strengTSD(TSD,ptr)
176 # define Free_stringTSD(ptr) give_a_strengTSD(TSD,ptr)
177 # else
178 # define Free_string(ptr) Free_string_TSD(__regina_get_tsd(),ptr)
179 # define Free_string_TSD(TSD,ptr) (TSD)->MTFree(TSD,ptr)
180 # define Free_stringTSD(ptr) Free_string_TSD(TSD,ptr)
181 # endif /* CHECK_MEMORY */
182 #endif /* ifdef TRACEMEM */
186 * Routines in stack.c
188 int init_stacks( tsd_t *TSD ) ;
189 int external_queues_used( const tsd_t *TSD ) ;
190 void purge_stacks( const tsd_t *TSD ) ;
191 streng *popline( tsd_t *TSD, const streng *queue_name, int *result, unsigned long waitflag ) ;
192 int stack_lifo( tsd_t *TSD, streng *line, const streng *queue_name ) ;
193 int stack_fifo( tsd_t *TSD, streng *line, const streng *queue_name ) ;
194 int lines_in_stack( tsd_t *TSD, const streng *queue_name ) ;
195 #ifdef TRACEMEM
196 void mark_stack( const tsd_t *TSD ) ;
197 #endif /* TRACEMEM */
198 int drop_buffer( const tsd_t *TSD, int num ) ;
199 int make_buffer( tsd_t *TSD ) ;
200 void type_buffer( tsd_t *TSD ) ;
201 Queue *find_free_slot( const tsd_t *TSD ) ;
202 Queue *fill_input_queue_stem( tsd_t *TSD, streng *stemname, int stem0 ) ;
203 Queue *fill_input_queue_stream( tsd_t *TSD, void *fileptr );
204 void flush_stack( const tsd_t *TSD, Queue *src, Queue *dst, int is_fifo ) ;
205 streng *stack_to_line( const tsd_t *TSD, Queue *q );
206 int create_queue( tsd_t *TSD, const streng *queue_name, streng **result );
207 int delete_queue( tsd_t *TSD, const streng *queue_name );
208 int timeout_queue( tsd_t *TSD, const streng *timeout, const streng *queue_name );
209 streng *get_queue( tsd_t *TSD );
210 void fill_queue_name( const tsd_t *TSD, int *len, char **name );
211 streng *set_queue( tsd_t *TSD, const streng *queue_name );
212 Queue *addr_reopen_queue( tsd_t *TSD, const streng *queuename, char code ) ;
213 int addr_same_queue( const tsd_t *TSD, const Queue *q1, const Queue *q2 ) ;
214 Queue *addr_redir_queue( const tsd_t *TSD, Queue *q ) ;
215 void addr_purge_queue( const tsd_t *TSD, Queue *q ) ;
216 streng *addr_io_queue( tsd_t *TSD, Queue *q, streng *buffer, int isFIFO ) ;
217 void addr_close_queue( const tsd_t *TSD, Queue *q ) ;
221 * Routines in misc.c
223 void set_locale_info( const char *info );
224 void mem_upper( void *m, int len );
225 void mem_lower( void *m, int len );
226 int mem_cmpic( const void *buf1, const void *buf2, int len );
227 const char *system_type( void ) ;
228 double cpu_time( void ) ;
229 void getsecs( time_t *secs, time_t *usecs ) ;
230 unsigned hashvalue(const char *string, int length ) ;
231 unsigned hashvalue_ic(const char *string, int length ) ;
232 unsigned hashvalue_var(const streng *name, int start, int *stop );
233 #ifdef SKYOS
234 clock_t clock( void );
235 #endif
236 char **makeargs(const char *string, char escape);
237 char *splitoffarg(const char *string, const char **trailer, char escape);
238 char **makesimpleargs(const char *string);
239 void destroyargs(char **args);
244 * Routines in error.c
246 int init_error( tsd_t *TSD ) ;
247 const streng *errortext( const tsd_t *TSD, int errorno, int suberrnum, int request_english, int apply_inserts ) ;
248 void exiterror( int errorno , int suberrorno, ... ) ;
249 void __reginaerror( char *errtext ) ;
250 const char *getsym( int numb ) ;
251 int lineno_of( cnodeptr ) ;
255 * Routines in variable.c
257 int known_reserved_variable( const char *name, unsigned length );
258 /* We need a fast determination: */
259 #define KNOWN_RESERVED(n,l) ((l) && (*(n)=='.') && known_reserved_variable((n),(l)))
261 void detach( const tsd_t *TSD, variableptr ptr ) ;
262 int init_vars( tsd_t *TSD ) ;
263 void expand_to_str( const tsd_t *TSD, variableptr ptr ) ;
264 int var_was_found( const tsd_t *TSD ) ;
265 var_hashtable *create_new_varpool( const tsd_t *TSD, int size ) ;
266 void setdirvalue( tsd_t *TSD, const streng *name, streng *value ) ;
267 void setvalue( tsd_t *TSD, const streng *name, streng *value, int pool ) ;
268 num_descr *fix_compoundnum( tsd_t *TSD, nodeptr thisptr, num_descr *newdescr,
269 streng *string_val );
270 void setshortcutnum( tsd_t *TSD, nodeptr thisptr, num_descr *value,
271 streng *string_val );
272 const streng *getdirvalue( tsd_t *TSD, const streng *name ) ;
273 const streng *getvalue( tsd_t *TSD, const streng *name, int pool ) ;
274 const streng *isvariable( tsd_t *TSD, const streng *name ) ;
275 int variables_per_SAA( tsd_t *TSD );
276 void restore_variable_state( const tsd_t *TSD, int state );
277 const streng *get_it_anyway( tsd_t *TSD, const streng *name, int pool ) ;
278 const streng *get_it_anyway_compound( tsd_t *TSD, const streng *str ) ;
279 void expose_var( tsd_t *TSD, const streng *name ) ;
280 void drop_var( tsd_t *TSD, const streng *name ) ;
281 void drop_dirvar( tsd_t *TSD, const streng *name ) ;
282 void upper_var( tsd_t *TSD, const streng *name ) ;
283 void set_ignore_novalue( const tsd_t *TSD ) ;
284 int valid_var_symbol( const streng *symbol ) ;
285 void clear_ignore_novalue( const tsd_t *TSD ) ;
286 #ifdef TRACEMEM
287 void markvariables( const tsd_t *TSD, cproclevel ) ;
288 #endif /* TRACEMEM */
289 const streng *shortcut( tsd_t *TSD, nodeptr ) ;
290 num_descr *shortcutnum( tsd_t *TSD, nodeptr ) ;
291 void setshortcut( tsd_t *TSD, nodeptr thisptr, streng *value ) ;
292 streng *fix_compound( tsd_t *TSD, nodeptr thisptr, streng *value ) ;
293 void kill_variables( const tsd_t *TSD, var_hashtable *array ) ;
294 variableptr get_next_variable( tsd_t *TSD, int reset ) ;
295 void set_reserved_value( tsd_t *TSD, int poolid, streng *val_str,
296 int val_int, int vflag );
300 * Routines in shell.c
302 void put_stem( tsd_t *TSD, environpart *e, streng *str );
303 int init_shell( tsd_t *TSD ) ;
304 void cleanup_envirpart(const tsd_t *TSD, environpart *ep);
305 int posix_do_command( tsd_t *TSD, const streng *command, int flag, environment *env, Queue *redir ) ;
310 * Routines in tracing.c
312 int init_tracing( tsd_t *TSD ) ;
313 void set_trace( tsd_t *TSD, const streng * ) ;
314 void set_trace_char( tsd_t *TSD, char ) ;
315 void flush_trace_chars( tsd_t *TSD ) ;
316 void queue_trace_char( const tsd_t *TSD, char ch ) ;
317 void tracenumber( tsd_t *TSD, const num_descr *num, char type ) ;
318 void tracebool( tsd_t *TSD, int value, char type ) ;
319 int pushcallstack( const tsd_t *TSD, treenode *thisptr ) ;
320 void popcallstack( const tsd_t *TSD, int value ) ;
321 void traceerror( tsd_t *TSD, const treenode *thisptr, int RC ) ;
322 void tracecompound( tsd_t *TSD, const streng *stem, int length, const streng *index, char trch ) ;
323 void starttrace( const tsd_t *TSD ) ;
324 int intertrace( tsd_t *TSD ) ;
325 void tracevalue( tsd_t *TSD, const streng *str, char type ) ;
326 void traceline( tsd_t *TSD, const treenode *thisptr, char tch, int offset ) ;
327 void traceback( tsd_t *TSD ) ;
331 * Routines in interp.c
333 streng *dointerpret( tsd_t *TSD, streng *string ) ;
338 * Routines in interpret.c
340 void update_envirs( const tsd_t *TSD, proclevel level ) ;
341 proclevel newlevel( tsd_t *TSD, proclevel oldlevel ) ;
342 #define IPRT_BUFSIZE 2 /* buffer elements for the state in InterpreterStatus */
343 void SaveInterpreterStatus(const tsd_t *TSD,unsigned *state);
344 void RestoreInterpreterStatus(const tsd_t *TSD,const unsigned *state);
345 streng *CallInternalFunction( tsd_t *TSD, nodeptr node, nodeptr thisptr,
346 paramboxptr args );
347 streng *interpret( tsd_t * volatile TSD, nodeptr volatile rootnode ) ;
348 nodeptr getlabel( const tsd_t *TSD, const streng *name ) ;
349 void removelevel( tsd_t *TSD, proclevel level ) ;
350 void jump_rexx_signal( tsd_t *TSD );
351 void jump_interpreter_exit( tsd_t *TSD, int processExitCode );
352 void jump_script_exit( tsd_t *TSD, streng *result );
353 int init_spec_vars( tsd_t *TSD ) ;
357 * Routines in yaccsrc.y
359 int yylex( void ) ;
360 int __reginaparse( void ) ;
361 void kill_lines( const tsd_t *TSD, lineboxptr first ) ;
362 void destroytree( const tsd_t *TSD, nodeptr thisptr ) ;
363 void newlabel( const tsd_t *TSD, internal_parser_type *ipt, nodeptr thisptr ) ;
368 * Routines in funcs.c
370 streng *buildtinfunc( tsd_t *TSD, nodeptr thisptr ) ;
371 void deallocplink( tsd_t *TSD, paramboxptr first ) ;
372 paramboxptr initplist( tsd_t *TSD, cnodeptr thisptr );
373 paramboxptr initargs( tsd_t *TSD, int argc, const int *lengths,
374 const char **strings );
375 int myatol( const tsd_t *TSD, const streng *text ) ;
376 void checkparam( cparamboxptr params, int min, int max, const char *name ) ;
377 char getoptionchar( tsd_t *TSD, const streng *param, const char *bif, int argnum, const char *ansi_options, const char *regina_options ) ;
378 int atozpos( tsd_t *TSD, const streng *text, const char *bif, int argnum ) ;
379 int atopos( tsd_t *TSD, const streng *text, const char *bif, int argnum ) ;
380 int atoposorzero( tsd_t *TSD, const streng *text, const char *bif, int argnum ) ;
381 char getonechar( tsd_t *TSD, const streng *text, const char *bif, int argnum ) ;
382 streng *int_to_streng( const tsd_t *TSD, int input ) ;
383 int convert_date(tsd_t *TSD, const streng *, char, struct tm *);
384 int convert_time(const tsd_t *TSD,const streng *, char, struct tm *, time_t *);
385 int basedays(int);
386 #ifdef TRACEMEM
387 void mark_param_cache( const tsd_t *TSD ) ;
388 #endif
389 void addtwostrings( char *one, char *two, char *answer ) ;
390 const char *BIFname( tsd_t *TSD );
394 * Routines in cmath.c
396 double myatof( const tsd_t *TSD, const streng *string ) ;
397 int myisnumber( const tsd_t *TSD, const streng *string ) ;
398 int myisinteger( const streng *string ) ;
402 Functions in rexx.c
404 #ifdef __cplusplus
405 extern "C" {
406 #endif
408 #ifdef RXLIB
409 # if defined(__LCC__)
410 int __regina_faked_main(int argc,char *argv[]) ;
411 # else
412 # ifdef __MINGW32__
413 # ifdef __REGINA_DLL
414 int APIENTRY __regina_faked_main(int argc,char *argv[]) __declspec(dllexport);
415 # else
416 int APIENTRY __regina_faked_main(int argc,char *argv[]) __declspec(dllimport);
417 # endif
418 # else
419 int APIENTRY __regina_faked_main(int argc,char *argv[]) ;
420 # endif
421 # endif
422 #else
423 int main(int argc,char *argv[]) ;
424 #endif
426 #ifdef __cplusplus
428 #endif
430 int __regina_reexecute_main(int argc, char **argv);
431 void mark_systeminfo( const tsd_t *TSD) ;
432 nodeptr treadit( cnodeptr ) ;
433 void setup_system( tsd_t *TSD, int isclient );
434 sysinfobox *creat_sysinfo( const tsd_t *TSD, streng *envir );
435 void setGlobalTSD( tsd_t *TSD);
436 tsd_t *getGlobalTSD( void );
440 * Functions in signals.h
442 trap *gettraps( const tsd_t *TSD, proclevel level ) ;
443 sigtype *getsigs( proclevel level ) ;
444 void mark_signals( const tsd_t *TSD ) ;
445 signal_handler regina_signal(int signum, signal_handler action);
446 void halt_raised( tsd_t *TSD );
447 int condition_hook( tsd_t *TSD, int, int, int, int, streng *, streng * ) ;
448 #ifdef WIN32
449 void __regina_Win32RaiseCtrlC( tsd_t *TSD );
450 #endif
452 void signal_setup( const tsd_t *TSD ) ;
453 int identify_trap( int type ) ;
454 void set_rexx_halt( tsd_t *TSD ) ;
457 * Routines in library.c
459 int init_library( tsd_t *TSD ) ;
460 void free_orphaned_libs( tsd_t *TSD );
461 void purge_library( tsd_t *TSD );
462 struct library *find_library( const tsd_t *TSD, const streng *name );
463 void set_err_message( const tsd_t *TSD, const char *message1, const char *message2 ) ;
464 streng *rex_rxfuncerrmsg( tsd_t *TSD, cparamboxptr parms ) ;
465 streng *rex_rxfuncquery( tsd_t *TSD, cparamboxptr parms ) ;
466 streng *rex_rxfuncadd( tsd_t *TSD, cparamboxptr parms ) ;
467 streng *rex_rxfuncdefine( tsd_t *TSD, cparamboxptr parms );
468 streng *rex_gciprefixchar( tsd_t *TSD, cparamboxptr parms );
469 streng *rex_rxfuncdrop( tsd_t *TSD, cparamboxptr parms ) ;
470 int IfcRegFunc( const tsd_t *TSD, const char *rxname, const char *module,
471 const char *objnam, PFN entry );
472 int IfcRegExit( const tsd_t *TSD, const char *rxname, const char *module,
473 const char *objnam, PFN entry, void *user_area );
474 int IfcRegSubcom( const tsd_t *TSD, const char *rxname, const char *module,
475 const char *objnam, PFN entry, void *user_area );
476 int IfcDelFunc( tsd_t *TSD, const char *rxname );
477 int IfcDelExit( tsd_t *TSD, const char *rxname, const char *module );
478 int IfcDelSubcom( tsd_t *TSD, const char *rxname, const char *module );
479 int IfcQueryFunc( const tsd_t *TSD, const char *rxname );
480 int IfcQueryExit( const tsd_t *TSD, const char *rxname, const char *module,
481 void *user_area );
482 int IfcQuerySubcom( const tsd_t *TSD, const char *rxname,
483 const char *module, void *user_area );
484 struct entry_point *loaded_lib_func( const tsd_t *TSD, const streng *name );
485 struct entry_point *exit_hook( const tsd_t *TSD, const char *env, int len );
486 struct entry_point *subcom_hook( const tsd_t *TSD, const char *com, int len );
489 * functions in mt_notmt.c/mt_<os>.c
491 int IfcReginaCleanup( void );
494 * functions in macros.c
496 void killsystem( tsd_t *TSD, sysinfo systm ) ;
497 internal_parser_type enter_macro( tsd_t *TSD, const streng *source,
498 void **ept, unsigned long *extlength);
499 streng *do_instore( tsd_t * volatile TSD, const streng *name, paramboxptr args,
500 const streng *envir, int * volatile RetCode, int hooks,
501 const void *instore, unsigned long instore_length,
502 const char *instore_source,
503 unsigned long instore_source_length,
504 const internal_parser_type *ipt,
505 int ctype ) ;
506 streng *execute_external( tsd_t * volatile TSD, const streng *command,
507 paramboxptr args, const streng *envir,
508 int * volatile RetCode, int hooks, int ctype ) ;
509 int count_params( cparamboxptr ptr, int soft ) ;
510 streng *get_parameter( paramboxptr ptr, int number ) ;
514 * Functions in envir.c
516 void post_process_system_call( tsd_t *TSD, const streng *cmd,
517 int rc_code, const streng *rc_value,
518 cnodeptr thisptr );
519 streng *perform( tsd_t *TSD, const streng *command, const streng *envir, cnodeptr thisptr, cnodeptr overwrite );
520 void add_envir( tsd_t *TSD, const streng *name, int type, int subtype ) ;
521 int envir_exists( const tsd_t *TSD, const streng *name );
522 streng *get_envir_details( const tsd_t *TSD, char opt, const streng *name );
523 int set_subcomed_envir( const tsd_t *TSD, const streng *name, int subcomed );
524 int get_subcomed_envir( const tsd_t *TSD, const streng *name );
525 int init_envir( tsd_t *TSD ) ;
526 void del_envir( tsd_t *TSD, const streng *name ) ;
527 int set_envir( const tsd_t *TSD, const streng *envirname, const nodeptr ios ) ;
528 streng *run_popen( tsd_t *TSD, const streng *command, const streng *envir ) ;
532 * Functions in client.c
534 int init_client( tsd_t *TSD ) ;
535 int hookup( tsd_t *TSD, int type ) ;
536 int hookup_output( tsd_t *TSD, int type, const streng *outdata ) ;
537 int hookup_output2( tsd_t *TSD, int type, const streng *outdata1, const streng *outdata2 ) ;
538 int hookup_input( tsd_t *TSD, int type, streng **indata ) ;
539 int hookup_input_output( tsd_t *TSD, int type, const streng *outdata, streng **indata ) ;
540 streng *call_unknown_external( tsd_t *TSD, const streng *name, cparamboxptr parms, char called ) ;
541 streng *call_known_external( tsd_t *TSD, const struct entry_point *vbox, cparamboxptr parms, char called ) ;
542 streng *SubCom( tsd_t *TSD, const streng *command, const streng *envir, int *rc ) ;
545 * Routines in aroscmd.c
547 #ifdef __AROS__
548 pid_t getpid(void);
549 #endif
552 * Routines in options.c
554 void do_options( tsd_t *TSD, proclevel pl, streng *options, int ) ;
555 int get_options_flag( cproclevel, int ) ;
556 void set_options_flag( proclevel, int, int ) ;
560 * Routines in rexxext.c
562 char *mygetenv( const tsd_t *TSD, const char *name, char *buf, int bufsize ) ;
563 void set_pause_at_exit( );
564 streng *rex_userid( tsd_t *TSD, cparamboxptr parms ) ;
565 streng *rex_rxqueue( tsd_t *TSD, cparamboxptr parms ) ;
566 #if defined(WIN32) && !defined(__WINS__) && !defined(__EPOC32__)
567 void set_pause_at_exit( void );
568 #endif
571 * Routines in vmscmd.c
573 int init_vms( tsd_t *TSD ) ;
574 int vms_do_command( tsd_t *TSD, const streng *cmd, int io_flags, environment *env, Queue *redir );
575 int vms_killproc( tsd_t *TSD ) ;
576 streng *vms_resolv_symbol( tsd_t *TSD, streng *name, streng *newstr, streng *pool ) ;
579 * Routines in builtin.c
581 int init_builtin( tsd_t *TSD ) ;
582 streng *ext_pool_value( tsd_t *TSD, streng *name, streng *value, streng *env );
583 streng *std_abbrev( tsd_t *TSD, cparamboxptr parms ) ;
584 streng *std_abs( tsd_t *TSD, cparamboxptr parms ) ;
585 streng *std_address( tsd_t *TSD, cparamboxptr parms ) ;
586 streng *std_arg( tsd_t *TSD, cparamboxptr parms ) ;
587 streng *std_bitand( tsd_t *TSD, cparamboxptr parms ) ;
588 streng *std_bitor( tsd_t *TSD, cparamboxptr parms ) ;
589 streng *std_bitxor( tsd_t *TSD, cparamboxptr parms ) ;
590 streng *std_center( tsd_t *TSD, cparamboxptr parms ) ;
591 streng *std_changestr( tsd_t *TSD, cparamboxptr parms ) ;
592 streng *std_compare( tsd_t *TSD, cparamboxptr parms ) ;
593 streng *std_condition( tsd_t *TSD, cparamboxptr parms ) ;
594 streng *std_copies( tsd_t *TSD, cparamboxptr parms ) ;
595 streng *std_countstr( tsd_t *TSD, cparamboxptr parms ) ;
596 streng *std_datatype( tsd_t *TSD, cparamboxptr parms ) ;
597 streng *std_date( tsd_t *TSD, cparamboxptr parms ) ;
598 streng *std_delstr( tsd_t *TSD, cparamboxptr parms ) ;
599 streng *std_delword( tsd_t *TSD, cparamboxptr parms ) ;
600 streng *std_digits( tsd_t *TSD, cparamboxptr parms ) ;
601 streng *std_errortext( tsd_t *TSD, cparamboxptr parms ) ;
602 streng *std_form( tsd_t *TSD, cparamboxptr parms ) ;
603 streng *std_format( tsd_t *TSD, cparamboxptr parms ) ;
604 streng *std_fuzz( tsd_t *TSD, cparamboxptr parms ) ;
605 streng *std_insert( tsd_t *TSD, cparamboxptr parms ) ;
606 streng *std_lastpos( tsd_t *TSD, cparamboxptr parms ) ;
607 streng *std_length( tsd_t *TSD, cparamboxptr parms ) ;
608 streng *std_left( tsd_t *TSD, cparamboxptr parms ) ;
609 streng *std_max( tsd_t *TSD, cparamboxptr parms ) ;
610 streng *std_min( tsd_t *TSD, cparamboxptr parms ) ;
611 streng *std_overlay( tsd_t *TSD, cparamboxptr parms ) ;
612 streng *std_pos( tsd_t *TSD, cparamboxptr parms ) ;
613 streng *std_qualify( tsd_t *TSD, cparamboxptr parms ) ;
614 streng *std_queued( tsd_t *TSD, cparamboxptr parms ) ;
615 streng *std_right( tsd_t *TSD, cparamboxptr parms ) ;
616 streng *std_reverse( tsd_t *TSD, cparamboxptr parms ) ;
617 streng *std_random( tsd_t *TSD, cparamboxptr parms ) ;
618 streng *std_sign( tsd_t *TSD, cparamboxptr parms ) ;
619 streng *std_sourceline( tsd_t *TSD, cparamboxptr parms ) ;
620 streng *std_space( tsd_t *TSD, cparamboxptr parms ) ;
621 streng *std_strip( tsd_t *TSD, cparamboxptr parms ) ;
622 streng *std_substr( tsd_t *TSD, cparamboxptr parms ) ;
623 streng *std_subword( tsd_t *TSD, cparamboxptr parms ) ;
624 streng *std_symbol( tsd_t *TSD, cparamboxptr parms ) ;
625 streng *std_time( tsd_t *TSD, cparamboxptr parms ) ;
626 streng *std_trace( tsd_t *TSD, cparamboxptr parms ) ;
627 streng *std_translate( tsd_t *TSD, cparamboxptr parms ) ;
628 streng *std_trunc( tsd_t *TSD, cparamboxptr parms ) ;
629 streng *std_value( tsd_t *TSD, cparamboxptr parms ) ;
630 streng *std_verify( tsd_t *TSD, cparamboxptr parms ) ;
631 streng *std_word( tsd_t *TSD, cparamboxptr parms ) ;
632 streng *std_wordindex( tsd_t *TSD, cparamboxptr parms ) ;
633 streng *std_wordlength( tsd_t *TSD, cparamboxptr parms ) ;
634 streng *std_wordpos( tsd_t *TSD, cparamboxptr parms ) ;
635 streng *std_words( tsd_t *TSD, cparamboxptr parms ) ;
636 streng *std_xrange( tsd_t *TSD, cparamboxptr parms ) ;
637 streng *rex_poolid( tsd_t *TSD, cparamboxptr parms ) ;
638 streng *rex_lower( tsd_t *TSD, cparamboxptr parms );
641 * Routines in convert.c
643 streng *std_b2x( tsd_t *TSD, cparamboxptr parms ) ;
644 streng *std_c2d( tsd_t *TSD, cparamboxptr parms ) ;
645 streng *std_c2x( tsd_t *TSD, cparamboxptr parms ) ;
646 streng *std_d2c( tsd_t *TSD, cparamboxptr parms ) ;
647 streng *std_d2x( tsd_t *TSD, cparamboxptr parms ) ;
648 streng *std_x2b( tsd_t *TSD, cparamboxptr parms ) ;
649 streng *std_x2c( tsd_t *TSD, cparamboxptr parms ) ;
650 streng *std_x2d( tsd_t *TSD, cparamboxptr parms ) ;
653 * Routines in dbgfuncs.c
655 #ifdef FLISTS
656 streng *dbg_freelists( tsd_t *TSD, cparamboxptr parms ) ;
657 #endif
658 #ifndef NDEBUG
659 # ifdef TRACEMEM
660 streng *dbg_allocated( tsd_t *TSD, cparamboxptr parms ) ;
661 # endif
662 streng *dbg_dumpvars( tsd_t *TSD, cparamboxptr parms ) ;
663 streng *dbg_dumptree( tsd_t *TSD, cparamboxptr parms ) ;
664 # ifdef TRACEMEM
665 streng *dbg_listleaked( tsd_t *TSD, cparamboxptr parms ) ;
666 streng *dbg_memorystats( tsd_t *TSD, cparamboxptr parms ) ;
667 # endif /* TRACEMEM */
668 #endif /* !NDEBUG */
669 streng *dbg_traceback( tsd_t *TSD, cparamboxptr parms ) ;
672 * Routines in vmsfuncs.c
674 #ifdef VMS
675 streng *vms_f_directory( tsd_t *TSD, cparamboxptr parms ) ;
676 streng *vms_f_file_attributes( tsd_t *TSD, cparamboxptr parms ) ;
677 streng *vms_f_getdvi( tsd_t *TSD, cparamboxptr parms ) ;
678 streng *vms_f_getjpi( tsd_t *TSD, cparamboxptr parms ) ;
679 streng *vms_f_getqui( tsd_t *TSD, cparamboxptr parms ) ;
680 streng *vms_f_getsyi( tsd_t *TSD, cparamboxptr parms ) ;
681 streng *vms_f_identifier( tsd_t *TSD, cparamboxptr parms ) ;
682 streng *vms_f_message( tsd_t *TSD, cparamboxptr parms ) ;
683 streng *vms_f_mode( tsd_t *TSD, cparamboxptr parms ) ;
684 streng *vms_f_pid( tsd_t *TSD, cparamboxptr parms ) ;
685 streng *vms_f_privilege( tsd_t *TSD, cparamboxptr parms ) ;
686 streng *vms_f_process( tsd_t *TSD, cparamboxptr parms ) ;
687 streng *vms_f_string( tsd_t *TSD, cparamboxptr parms ) ;
688 streng *vms_f_time( tsd_t *TSD, cparamboxptr parms ) ;
689 streng *vms_f_setprv( tsd_t *TSD, cparamboxptr parms ) ;
690 streng *vms_f_user( tsd_t *TSD, cparamboxptr parms ) ;
691 streng *vms_f_locate( tsd_t *TSD, cparamboxptr parms ) ;
692 streng *vms_f_length( tsd_t *TSD, cparamboxptr parms ) ;
693 streng *vms_f_integer( tsd_t *TSD, cparamboxptr parms ) ;
694 streng *vms_f_trnlnm( tsd_t *TSD, cparamboxptr parms ) ;
695 streng *vms_f_logical( tsd_t *TSD, cparamboxptr parms ) ;
696 streng *vms_f_parse( tsd_t *TSD, cparamboxptr parms ) ;
697 streng *vms_f_search( tsd_t *TSD, cparamboxptr parms ) ;
698 streng *vms_f_type( tsd_t *TSD, cparamboxptr parms ) ;
699 streng *vms_f_file_attributes( tsd_t *TSD, cparamboxptr parms ) ;
700 streng *vms_f_extract( tsd_t *TSD, cparamboxptr parms ) ;
701 streng *vms_f_element( tsd_t *TSD, cparamboxptr parms ) ;
702 streng *vms_f_cvui( tsd_t *TSD, cparamboxptr parms ) ;
703 streng *vms_f_cvsi( tsd_t *TSD, cparamboxptr parms ) ;
704 streng *vms_f_cvtime( tsd_t *TSD, cparamboxptr parms ) ;
705 streng *vms_f_fao( tsd_t *TSD, cparamboxptr parms ) ;
706 #endif
709 * Routines in unxfuncs.c
711 streng *unx_getpath( tsd_t *TSD, cparamboxptr dummy ) ;
712 streng *unx_popen( tsd_t *TSD, cparamboxptr parms ) ;
713 streng *unx_getpid( tsd_t *TSD, cparamboxptr parms ) ;
714 streng *unx_gettid( tsd_t *TSD, cparamboxptr parms ) ;
715 streng *unx_eof( tsd_t *TSD, cparamboxptr parms ) ;
716 streng *unx_uname( tsd_t *TSD, cparamboxptr parms ) ;
717 streng *unx_fork( tsd_t *TSD, cparamboxptr parms ) ;
718 streng *unx_unixerror( tsd_t *TSD, cparamboxptr parms ) ;
719 streng *unx_chdir( tsd_t *TSD, cparamboxptr parms ) ;
720 streng *unx_getenv( tsd_t *TSD, cparamboxptr parms ) ;
721 streng *unx_putenv( tsd_t *TSD, cparamboxptr parms ) ;
722 streng *unx_crypt( tsd_t *TSD, cparamboxptr parms ) ;
725 * Routines in os2funcs.c
727 streng *os2_directory( tsd_t *TSD, cparamboxptr parms ) ;
728 streng *os2_beep( tsd_t *TSD, cparamboxptr parms ) ;
729 streng *os2_filespec( tsd_t *TSD, cparamboxptr parms ) ;
732 * Routines in rexxsaa.c
734 int init_rexxsaa( tsd_t *TSD ) ;
735 void deinit_rexxsaa( tsd_t *TSD ) ;
738 * Routines in vmsfuncs.c
740 int init_vmf( tsd_t *TSD ) ;
743 * Routines in wrappers.c
745 void *wrapper_load( const tsd_t *TSD, const streng *module ) ;
746 void wrapper_unload( const tsd_t *TSD, void *libhandle ) ;
747 PFN wrapper_get_addr( const tsd_t *TSD, const struct library *lptr, const streng *name) ;
750 * Routines in staticld.c
752 #ifdef DYNAMIC_STATIC
753 void *static_dlopen( char *name );
754 int static_dlsym( void *addr, char *name, void **faddr );
755 #endif
758 * Routines in strings.c
759 * string and streng routines are ugly but we need the speedup of passing the
760 * TSD to take profit from flists in the multi-threading environment.
762 void __regina_Str_first( void );
763 #if !defined(FLISTS) || defined(TRACEMEM)
764 streng *__regina_Str_make( int size ) ;
765 streng *__regina_Str_make_TSD( const tsd_t *TSD, int size ) ;
766 # define Str_make(a) __regina_Str_make(a)
767 # define Str_make_TSD(TSD,a) __regina_Str_make_TSD(TSD,a)
768 # define Str_makeTSD(size) Str_make_TSD(TSD,size)
769 #else
770 # define Str_make(a) get_a_streng(a)
771 # define Str_make_TSD(TSD,a) get_a_strengTSD(TSD,a)
772 # define Str_makeTSD(a) get_a_strengTSD(TSD,a)
773 #endif
774 #define nullstringptr() Str_makeTSD(0)
775 streng *Str_ndup( const streng *name, int length ) ;
776 streng *Str_ndup_TSD( const tsd_t *TSD, const streng *name, int length ) ;
777 #define Str_ndupTSD(name,length) Str_ndup_TSD(TSD,name,length)
778 streng *Str_nodup( const streng *name, int length, int offset ) ;
779 streng *Str_nodup_TSD( const tsd_t *TSD, const streng *name, int offset, int length ) ;
780 #define Str_nodupTSD(name,length,offset) Str_nodup_TSD(TSD,name,length,offset)
781 streng *Str_dup( const streng *name ) ;
782 streng *Str_dup_TSD( const tsd_t *TSD, const streng *input ) ;
783 #define Str_dupTSD(name) Str_dup_TSD(TSD,name)
784 streng *Str_dupstr( const streng *name ) ;
785 streng *Str_dupstr_TSD( const tsd_t *TSD, const streng *input ) ;
786 #define Str_dupstrTSD(name) Str_dupstr_TSD(TSD,name)
787 streng *Str_ncpy( streng *to, const streng *from, int length ) ;
788 streng *Str_ncpy_TSD( const tsd_t *TSD, streng *to, const streng *from, int length ) ;
789 #define Str_ncpyTSD(to,from,length) Str_ncpy_TSD(TSD,to,from,length)
790 streng *Str_ncre( const char *from, int length ) ;
791 streng *Str_ncre_TSD( const tsd_t *TSD, const char *from, int length ) ;
792 #define Str_ncreTSD(from,length) Str_ncre_TSD(TSD,from,length)
793 streng *Str_cat( streng *to, const streng *from ) ;
794 streng *Str_cat_TSD( const tsd_t *TSD, streng *first, const streng *second ) ;
795 #define Str_catTSD(first,second) Str_cat_TSD(TSD,first,second)
796 streng *Str_ncat( streng *to, const streng *from, int length ) ;
797 streng *Str_ncat_TSD( const tsd_t *TSD, streng *first, const streng *second, int length ) ;
798 #define Str_ncatTSD(first,second,length) Str_ncat_TSD(TSD,first,second,length)
799 streng *Str_nocat( streng *to, const streng *from, int length, int offset ) ;
800 streng *Str_nocat_TSD( const tsd_t *TSD, streng *first, const streng *second, int length, int offset ) ;
801 #define Str_nocatTSD(first,second,length,offset) Str_nocat_TSD(TSD,first,second,length,offset)
802 int Str_ncmp( const streng *one, const streng *two, int length ) ;
803 int Str_cmp( const streng *one, const streng *two ) ;
804 int Str_ccmp( const streng *one, const streng *two ) ;
805 int Str_cncmp( const streng *one, const streng *two, int length ) ;
806 int Str_cnocmp( const streng *one, const streng *two, int length, int offset ) ;
807 streng *Str_cre( const char *value ) ;
808 streng *Str_cre_TSD( const tsd_t *TSD, const char *input ) ;
809 #define Str_creTSD(value) Str_cre_TSD(TSD,value)
810 streng *Str_crestr( const char *value );
811 streng *Str_crestr_TSD( const tsd_t *TSD, const char *input ) ;
812 #define Str_crestrTSD(input) Str_crestr_TSD(TSD,input)
813 streng *Str_catstr( streng *in, const char *more ) ;
814 streng *Str_catstr_TSD( const tsd_t *TSD, streng *base, const char *append ) ;
815 #define Str_catstrTSD(base,append) Str_catstr_TSD(TSD,base,append)
816 streng *Str_ncatstr( streng *base, const char *input, int length ) ;
817 streng *Str_ncatstr_TSD( const tsd_t *TSD, streng *base, const char *input, int length ) ;
818 #define Str_ncatstrTSD(base,input,length) Str_ncatstr_TSD(TSD,base,input,length)
819 char *str_of( const tsd_t *TSD, const streng *input ) ;
820 #define str_ofTSD(input) str_of(TSD,input)
821 #ifndef EXTERNAL_TO_REGINA
822 volatile char *tmpstr_of( tsd_t *TSD, const streng *input ) ;
823 #endif
824 streng *Str_upper( streng *in ) ;
825 streng *Str_lower( streng *in ) ;
826 streng *Str_strp( streng * input, char chr, char opt ) ;
827 void __regina_Str_last( void );
830 * Routines in strmath.c
832 #define DIVTYPE_NORMAL 0
833 #define DIVTYPE_INTEGER 1
834 #define DIVTYPE_REMAINDER 2
835 #define DIVTYPE_BOTH 3 /* use only with str_div directly ! */
837 int descr_sign( const void * ) ;
838 streng *str_sign( tsd_t *TSD, const streng*);
839 streng *str_trunc( tsd_t *TSD, const streng*, int ) ;
840 streng *str_normalize( const tsd_t *TSD, const streng* ) ;
841 streng *str_digitize( tsd_t *TSD, streng*, int, int, const char *, int ) ;
842 streng *str_format( tsd_t *TSD, const streng*, int, int, int, int ) ;
843 streng *str_binerize( tsd_t *TSD, num_descr *, int ) ;
844 int str_true( const tsd_t *TSD, const streng* ) ;
845 streng *str_abs( tsd_t *TSD, const streng* ) ;
846 num_descr *get_a_descr( tsd_t *TSD, const char *big, int argno, const streng* ) ;
847 void free_a_descr( const tsd_t *TSD, num_descr* ) ;
848 #ifdef TRACEMEM
849 void mark_descrs( const tsd_t *TSD ) ;
850 #endif
851 int init_math( tsd_t *TSD ) ;
852 void descr_copy( const tsd_t *TSD, const num_descr *f, num_descr *s ) ;
853 num_descr *string_incr( tsd_t *TSD, num_descr *input, cnodeptr node );
854 void string_mul( tsd_t *TSD, const num_descr *f, const num_descr *s,
855 num_descr *r, cnodeptr left, cnodeptr right );
856 void string_div( tsd_t *TSD, const num_descr *f, const num_descr *s,
857 num_descr *r, num_descr *r2, int type, cnodeptr left,
858 cnodeptr right );
859 int myiswnumber( tsd_t *TSD, const streng *number, num_descr **num,
860 int noDigitsLimit );
861 void str_round( num_descr *descr, int size ) ;
862 void str_round_lostdigits( tsd_t *TSD, num_descr *descr, int size );
863 void string_pow( tsd_t *TSD, const num_descr *num, num_descr *acc,
864 num_descr *res, cnodeptr lname, cnodeptr rname);
865 int descr_to_int( const num_descr *input ) ;
866 num_descr *is_a_descr( const tsd_t *TSD, const streng *input ) ;
867 int getdescr( const tsd_t *TSD, const streng *num, num_descr *descr ) ;
868 int string_test( const tsd_t *TSD, const num_descr *fdescr,
869 const num_descr *sdescr ) ;
870 void string_add( tsd_t *TSD, const num_descr *f, const num_descr *s,
871 num_descr *r, cnodeptr left, cnodeptr right );
872 void str_strip( num_descr *num ) ;
873 streng *str_norm( const tsd_t *TSD, num_descr *in, streng *trystr ) ;
874 int streng_to_int( const tsd_t *TSD, const streng *input, int *error ) ;
875 rx_64 streng_to_rx64( const tsd_t *TSD, const streng *input, int *error ) ;
878 * Routines in instore.c
880 void NewProg(void);
881 void EndProg(nodeptr Start);
882 nodeptr FreshNode(void);
883 void RejectNode(nodeptr NoLongerUsed);
884 offsrcline *FreshLine(void);
885 void DestroyInternalParsingTree(const tsd_t *TSD, internal_parser_type *ipt);
886 external_parser_type *TinTree(const tsd_t *TSD,
887 const internal_parser_type *ipt,
888 unsigned long *length);
889 internal_parser_type ExpandTinnedTree(const tsd_t *TSD,
890 const external_parser_type *ept,
891 unsigned long length,
892 const char *incore_source,
893 unsigned long incore_source_length);
894 int IsValidTin(const external_parser_type *ept, unsigned long eptlen);
896 #if defined(_AMIGA) || defined(__AROS__)
898 * Routines in amifuncs.c
900 int init_amigaf( tsd_t *TSD );
901 streng *amiga_show( tsd_t *TSD, cparamboxptr parm1 );
902 streng *amiga_addlib( tsd_t *TSD, cparamboxptr parm1 );
903 streng *amiga_remlib( tsd_t *TSD, cparamboxptr parm1 );
904 streng *try_func_amiga( tsd_t *TSD, const streng *name, cparamboxptr parms, char called );
905 streng *amiga_setclip( tsd_t *TSD, cparamboxptr parm1 );
906 streng *amiga_getclip( tsd_t *TSD, cparamboxptr parm1 );
907 streng *amiga_pragma( tsd_t *TSD, cparamboxptr parm1 );
909 /* Some support in amifuncs.c for os_amiga.c */
910 int __amiga_ptr2int( const tsd_t *TSD, void *ptr );
911 void *__amiga_getptr( const tsd_t *TSD, int index );
912 void __amiga_clearptr( const tsd_t *TSD, int index );
913 #endif
916 * Routines in arxfuncs.c
918 int init_arexxf( tsd_t *TSD );
919 streng *arexx_open ( tsd_t *TSD, cparamboxptr parm1 );
920 streng *arexx_close( tsd_t *TSD, cparamboxptr parm1 );
921 streng *arexx_writech( tsd_t *TSD, cparamboxptr parm1 );
922 streng *arexx_writeln( tsd_t *TSD, cparamboxptr parm1 );
923 streng *arexx_seek( tsd_t *TSD, cparamboxptr parm1 );
924 streng *arexx_readch( tsd_t *TSD, cparamboxptr parm1 );
925 streng *arexx_readln( tsd_t *TSD, cparamboxptr parm1 );
926 streng *arexx_eof( tsd_t *TSD, cparamboxptr parm1 );
927 streng *arexx_b2c( tsd_t *TSD, cparamboxptr parm1 );
928 streng *arexx_c2b( tsd_t *TSD, cparamboxptr parm1 );
929 streng *arexx_bitchg( tsd_t *TSD, cparamboxptr parm1 );
930 streng *arexx_bitclr( tsd_t *TSD, cparamboxptr parm1 );
931 streng *arexx_bitset( tsd_t *TSD, cparamboxptr parm1 );
932 streng *arexx_bittst( tsd_t *TSD, cparamboxptr parm1 );
933 streng *arexx_bitcomp( tsd_t *TSD, cparamboxptr parm1 );
934 streng *arexx_hash( tsd_t *TSD, cparamboxptr parm1 );
935 streng *arexx_compress( tsd_t *TSD, cparamboxptr parm1 );
936 streng *arexx_trim( tsd_t *TSD, cparamboxptr parm1 );
937 streng *arexx_upper( tsd_t *TSD, cparamboxptr parm1 );
938 streng *arexx_randu( tsd_t *TSD, cparamboxptr parm1 );
939 streng *arexx_getspace( tsd_t *TSD, cparamboxptr parm1 );
940 streng *arexx_freespace( tsd_t *TSD, cparamboxptr parm1 );
941 streng *arexx_import( tsd_t *TSD, cparamboxptr parm1 );
942 streng *arexx_export( tsd_t *TSD, cparamboxptr parm1 );
943 streng *arexx_storage( tsd_t *TSD, cparamboxptr parm1 );
944 streng *arexx_show( tsd_t *TSD, cparamboxptr parm1 );
947 ******************************************************************************
948 ******************************************************************************
949 ******************************************************************************
950 * global variables
953 /* externals which are protected by regina_parser (see lexsrc.l) */
954 extern internal_parser_type parser_data;
955 extern int retlength ; /* value shared by lexsrc.l and yaccsrc.y only */
956 extern char retvalue[] ; /* value shared by lexsrc.l and yaccsrc.y only */
957 extern char *__reginatext ; /* value shared by lexsrc.l and yaccsrc.y only */
958 extern unsigned SymbolDetect ; /* value shared by lexsrc.l and yaccsrc.y only */
959 #define SD_INPUT 0x00000001
960 #define SD_OUTPUT 0x00000002
961 #define SD_ERROR 0x00000004
962 #define SD_NORMAL 0x00000008
963 #define SD_APPEND 0x00000010
964 #define SD_REPLACE 0x00000020
965 #define SD_STREAM 0x00000040
966 #define SD_STEM 0x00000080
967 #define SD_LIFO 0x00000100
968 #define SD_FIFO 0x00000200
969 #define SD_ADDRWITH 0x000003FF /* All the above */
970 #ifndef NDEBUG
971 extern int __reginadebug ;
972 #endif
973 /* end of externals protected by regina_parser (see lexsrc.l) */
975 extern unsigned countthreads; /* Not protected and not save in use! */
977 extern const char *months[];
978 extern const char *signalnames[];
979 #ifdef WIN32
980 extern volatile int __regina_Win32CtrlCRaised;
981 #endif
982 extern unsigned char_info[];
983 extern unsigned char u_to_l[];
984 extern unsigned char l_to_u[];
985 extern const char *numeric_forms[] ;
986 extern const char *invo_strings[] ;
987 extern const char *argv0 ;
988 /* Don't terminate the following lines by a semicolon */
989 EXPORT_GLOBAL_PROTECTION_VAR(regina_globals)