1 /* @(#) pforth.h 98/01/26 1.2 */
\r
5 /***************************************************************
\r
6 ** Include file for pForth, a portable Forth based on 'C'
\r
8 ** This file is included in any application that uses pForth as a tool.
\r
10 ** Author: Phil Burk
\r
11 ** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom
\r
13 ** The pForth software code is dedicated to the public domain,
\r
14 ** and any third party may reproduce, distribute and modify
\r
15 ** the pForth software code or any derivative works thereof
\r
16 ** without any compensation or license. The pForth software
\r
17 ** code is provided on an "as is" basis without any warranty
\r
18 ** of any kind, including, without limitation, the implied
\r
19 ** warranties of merchantability and fitness for a particular
\r
20 ** purpose and their equivalents under the laws of any jurisdiction.
\r
23 ***************************************************************/
\r
25 /* Define stubs for data types so we can pass pointers but not touch inside. */
\r
26 typedef void *PForthTask;
\r
27 typedef void *PForthDictionary;
\r
29 typedef unsigned long ExecToken; /* Execution Token */
\r
30 typedef long ThrowCode;
\r
40 /* Main entry point to pForth. */
\r
41 int32 pfDoForth( const char *DicName, const char *SourceName, int32 IfInit );
\r
43 /* Turn off messages. */
\r
44 void pfSetQuiet( int32 IfQuiet );
\r
46 /* Query message status. */
\r
47 int32 pfQueryQuiet( void );
\r
49 /* Send a message using low level I/O of pForth */
\r
50 void pfMessage( const char *CString );
\r
52 /* Create a task used to maintain context of execution. */
\r
53 PForthTask pfCreateTask( int32 UserStackDepth, int32 ReturnStackDepth );
\r
55 /* Establish this task as the current task. */
\r
56 void pfSetCurrentTask( PForthTask task );
\r
58 /* Delete task created by pfCreateTask */
\r
59 void pfDeleteTask( PForthTask task );
\r
61 /* Build a dictionary with all the basic kernel words. */
\r
62 PForthDictionary pfBuildDictionary( int32 HeaderSize, int32 CodeSize );
\r
64 /* Create an empty dictionary. */
\r
65 PForthDictionary pfCreateDictionary( int32 HeaderSize, int32 CodeSize );
\r
67 /* Load dictionary from a file. */
\r
68 PForthDictionary pfLoadDictionary( const char *FileName, ExecToken *EntryPointPtr );
\r
70 /* Load dictionary from static array in "pfdicdat.h". */
\r
71 PForthDictionary pfLoadStaticDictionary( void );
\r
73 /* Delete dictionary data. */
\r
74 void pfDeleteDictionary( PForthDictionary dict );
\r
76 /* Execute the pForth interpreter. Yes, QUIT is an odd name but it has historical meaning. */
\r
77 ThrowCode pfQuit( void );
\r
79 /* Execute a single execution token in the current task and return 0 or an error code. */
\r
80 int pfCatch( ExecToken XT );
\r
82 /* Include the given pForth source code file. */
\r
83 ThrowCode pfIncludeFile( const char *FileName );
\r
85 /* Execute a Forth word by name. */
\r
86 ThrowCode pfExecIfDefined( const char *CString );
\r
92 #endif /* _pforth_h */
\r