Imported Upstream version 21
[debian/pforth] / csrc / pf_clib.h
1 /* @(#) pf_clib.h 96/12/18 1.10 */
2 #ifndef _pf_clib_h
3 #define _pf_clib_h
4
5 /***************************************************************
6 ** Include file for PForth tools
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 #ifdef  PF_NO_CLIB
23
24         #ifdef __cplusplus
25         extern "C" {
26         #endif
27
28         cell pfCStringLength( const char *s );
29         void *pfSetMemory( void *s, cell c, cell n );
30         void *pfCopyMemory( void *s1, const void *s2, cell n);
31         #define EXIT(n)  {while(1);}
32         
33         #ifdef __cplusplus
34         }   
35         #endif
36
37 #else   /* PF_NO_CLIB */
38
39         #ifdef PF_USER_CLIB
40                 #include PF_USER_CLIB
41         #else\r
42 /* Use stdlib functions if available because they are probably faster. */
43                 #define pfCStringLength strlen
44                 #define pfSetMemory     memset
45                 #define pfCopyMemory    memcpy
46                 #define EXIT(n)  exit(n)
47         #endif /* PF_USER_CLIB */
48         
49 #endif  /* !PF_NO_CLIB */
50 \r
51 #ifdef __cplusplus\r
52 extern "C" {\r
53 #endif\r
54 \r
55 /* Always use my own functions to avoid macro expansion problems with tolower(*s++) */\r
56 char pfCharToUpper( char c );\r
57 char pfCharToLower( char c );\r
58 \r
59 #ifdef __cplusplus\r
60 }   \r
61 #endif\r
62
63 #endif /* _pf_clib_h */