/* @(#) pf_main.c 98/01/26 1.2 */
/***************************************************************
** main() routine that demonstrates how to call PForth as
** a module from 'C' based application.
** Customize this as needed for your application.
** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom
** The pForth software code is dedicated to the public domain,
** and any third party may reproduce, distribute and modify
** the pForth software code or any derivative works thereof
** without any compensation or license. The pForth software
** code is provided on an "as is" basis without any warranty
** of any kind, including, without limitation, the implied
** warranties of merchantability and fitness for a particular
** purpose and their equivalents under the laws of any jurisdiction.
***************************************************************/
#if (defined(PF_NO_STDIO) || defined(PF_EMBEDDED))
#define NULL ((void *) 0)
#define ERR(msg) /* { printf msg; } */
#define ERR(msg) { printf msg; }
#ifndef PF_DEFAULT_DICTIONARY
#define PF_DEFAULT_DICTIONARY "pforth.dic"
const char *DicName
= NULL
;
const char *SourceName
= NULL
;
pfMessage("\npForth Embedded\n");
return pfDoForth( DicName
, SourceName
, IfInit
);
int main( int argc
, char **argv
)
const char *DicName
= NULL
;
#else /* PF_STATIC_DIC */
const char *DicName
= PF_DEFAULT_DICTIONARY
;
#endif /* !PF_STATIC_DIC */
const char *SourceName
= NULL
;
/* For Metroworks on Mac */
/* Parse command line. */
if( *s
!= '\0' ) DicName
= s
;
else DicName
= PF_DEFAULT_DICTIONARY
;
ERR(("Unrecognized option!\n"));
ERR(("pforth {-i} {-q} {-dfilename.dic} {sourcefilename}\n"));
Result
= pfDoForth( DicName
, SourceName
, IfInit
);