bb6b2dcd |
1 | /* @(#) pf_clib.h 96/12/18 1.10 */\r |
2 | #ifndef _pf_clib_h\r |
3 | #define _pf_clib_h\r |
4 | \r |
5 | /***************************************************************\r |
6 | ** Include file for PForth tools\r |
7 | **\r |
8 | ** Author: Phil Burk\r |
9 | ** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom\r |
10 | **\r |
11 | ** The pForth software code is dedicated to the public domain,\r |
12 | ** and any third party may reproduce, distribute and modify\r |
13 | ** the pForth software code or any derivative works thereof\r |
14 | ** without any compensation or license. The pForth software\r |
15 | ** code is provided on an "as is" basis without any warranty\r |
16 | ** of any kind, including, without limitation, the implied\r |
17 | ** warranties of merchantability and fitness for a particular\r |
18 | ** purpose and their equivalents under the laws of any jurisdiction.\r |
19 | **\r |
20 | ***************************************************************/\r |
21 | \r |
22 | #ifdef PF_NO_CLIB\r |
23 | \r |
24 | #ifdef __cplusplus\r |
25 | extern "C" {\r |
26 | #endif\r |
27 | \r |
1cb310e6 |
28 | cell_t pfCStringLength( const char *s );\r |
29 | void *pfSetMemory( void *s, cell_t c, cell_t n );\r |
30 | void *pfCopyMemory( void *s1, const void *s2, cell_t n);\r |
bb6b2dcd |
31 | #define EXIT(n) {while(1);}\r |
32 | \r |
33 | #ifdef __cplusplus\r |
34 | } \r |
35 | #endif\r |
36 | \r |
37 | #else /* PF_NO_CLIB */\r |
38 | \r |
39 | #ifdef PF_USER_CLIB\r |
40 | #include PF_USER_CLIB\r |
41 | #else\r |
42 | /* Use stdlib functions if available because they are probably faster. */\r |
43 | #define pfCStringLength strlen\r |
44 | #define pfSetMemory memset\r |
45 | #define pfCopyMemory memcpy\r |
46 | #define EXIT(n) exit(n)\r |
47 | #endif /* PF_USER_CLIB */\r |
48 | \r |
49 | #endif /* !PF_NO_CLIB */\r |
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 | \r |
63 | #endif /* _pf_clib_h */\r |