Imported Upstream version 21
[debian/pforth] / csrc / pf_text.h
1 /* @(#) pf_text.h 96/12/18 1.10 */
2 #ifndef _pforth_text_h
3 #define _pforth_text_h
4
5 /***************************************************************
6 ** Include file for PForth Text
7 **
8 ** Author: Phil Burk
9 ** Copyright 1994 3DO, Phil Burk, Larry Polansky, Devid Rosenboom
10 **
11 ** The pForth software code is dedicated to the public domain,
12 ** and any third party may reproduce, distribute and modify
13 ** the pForth software code or any derivative works thereof
14 ** without any compensation or license.  The pForth software
15 ** code is provided on an "as is" basis without any warranty
16 ** of any kind, including, without limitation, the implied
17 ** warranties of merchantability and fitness for a particular
18 ** purpose and their equivalents under the laws of any jurisdiction.
19 **
20 ***************************************************************/
21
22 #define PF_ERR_INDEX_MASK (0xFFFF)
23 #define PF_ERR_BASE            (0x80000000)
24 #define PF_ERR_NO_MEM          (PF_ERR_BASE |  0)
25 #define PF_ERR_BAD_ADDR        (PF_ERR_BASE |  1)
26 #define PF_ERR_TOO_BIG         (PF_ERR_BASE |  2)
27 #define PF_ERR_NUM_PARAMS      (PF_ERR_BASE |  3)
28 #define PF_ERR_OPEN_FILE       (PF_ERR_BASE |  4)
29 #define PF_ERR_WRONG_FILE      (PF_ERR_BASE |  5)
30 #define PF_ERR_BAD_FILE        (PF_ERR_BASE |  6)
31 #define PF_ERR_READ_FILE       (PF_ERR_BASE |  7)
32 #define PF_ERR_WRITE_FILE      (PF_ERR_BASE |  8)
33 #define PF_ERR_CORRUPT_DIC     (PF_ERR_BASE |  9)
34 #define PF_ERR_NOT_SUPPORTED   (PF_ERR_BASE | 10)
35 #define PF_ERR_VERSION_FUTURE  (PF_ERR_BASE | 11)
36 #define PF_ERR_VERSION_PAST    (PF_ERR_BASE | 12)
37 #define PF_ERR_COLON_STACK     (PF_ERR_BASE | 13)
38 #define PF_ERR_HEADER_ROOM     (PF_ERR_BASE | 14)
39 #define PF_ERR_CODE_ROOM       (PF_ERR_BASE | 15)
40 #define PF_ERR_NO_SHELL        (PF_ERR_BASE | 16)
41 #define PF_ERR_NO_NAMES        (PF_ERR_BASE | 17)\r
42 #define PF_ERR_OUT_OF_RANGE    (PF_ERR_BASE | 18)\r
43 #define PF_ERR_ENDIAN_CONFLICT (PF_ERR_BASE | 19)\r
44 #define PF_ERR_FLOAT_CONFLICT  (PF_ERR_BASE | 20)
45 /* If you add an error code here, also add a text message in "pf_text.c". */
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 void pfReportError( const char *FunctionName, Err ErrCode );
52
53 char  *ForthStringToC( char *dst, const char *FString );
54 char  *CStringToForth( char *dst, const char *CString );
55
56 int32 ffCompare( const char *s1, int32 len1, const char *s2, int32 len2 );
57 int32 ffCompareText( const char *s1, const char *s2, int32 len );
58 int32 ffCompareTextCaseN( const char *s1, const char *s2, int32 len );
59
60 void  DumpMemory( void *addr, int32 cnt);
61 char *ConvertNumberToText( int32 Num, int32 Base, int32 IfSigned, int32 MinChars );
62 void  TypeName( const char *Name );
63
64 #ifdef __cplusplus
65 }   
66 #endif
67
68 #endif /* _pforth_text_h */