xref: /inferno-os/include/freetype/config/ftstdlib.h (revision 37da2899f40661e3e9631e497da8dc59b971cbd0)
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftstdlib.h                                                             */
4 /*                                                                         */
5 /*    ANSI-specific library and header configuration file (specification   */
6 /*    only).                                                               */
7 /*                                                                         */
8 /*  Copyright 2002 by                                                      */
9 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
10 /*                                                                         */
11 /*  This file is part of the FreeType project, and may only be used,       */
12 /*  modified, and distributed under the terms of the FreeType project      */
13 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
14 /*  this file you indicate that you have read the license and              */
15 /*  understand and accept it fully.                                        */
16 /*                                                                         */
17 /***************************************************************************/
18 
19 
20   /*************************************************************************/
21   /*                                                                       */
22   /* This file is used to group all #includes to the ANSI C library that   */
23   /* FreeType normally requires.  It also defines macros to rename the     */
24   /* standard functions within the FreeType source code.                   */
25   /*                                                                       */
26   /* Load a file which defines __FTSTDLIB_H__ before this one to override  */
27   /* it.                                                                   */
28   /*                                                                       */
29   /*************************************************************************/
30 
31 
32 #ifndef __FTSTDLIB_H__
33 #define __FTSTDLIB_H__
34 
35 
36   /**********************************************************************/
37   /*                                                                    */
38   /*                           integer limits                           */
39   /*                                                                    */
40   /* UINT_MAX and ULONG_MAX are used to automatically compute the size  */
41   /* of `int' and `long' in bytes at compile-time.  So far, this works  */
42   /* for all platforms the library has been tested on.                  */
43   /*                                                                    */
44   /* Note that on the extremely rare platforms that do not provide      */
45   /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some    */
46   /* old Crays where `int' is 36 bits), we do not make any guarantee    */
47   /* about the correct behaviour of FT2 with all fonts.                 */
48   /*                                                                    */
49   /* In these case, "ftconfig.h" will refuse to compile anyway with a   */
50   /* message like "couldn't find 32-bit type" or something similar.     */
51   /*                                                                    */
52   /* IMPORTANT NOTE: We do not define aliases for heap management and   */
53   /*                 i/o routines (i.e. malloc/free/fopen/fread/...)    */
54   /*                 since these functions should all be encapsulated   */
55   /*                 by platform-specific implementations of            */
56   /*                 "ftsystem.c".                                      */
57   /*                                                                    */
58   /**********************************************************************/
59 
60 
61 #include <lib9.h>
62 #define UINT_MAX	0xffffffffU
63 #define ULONG_MAX	0xffffffffUL
64 /*#include <limits.h>*/
65 
66 #define FT_UINT_MAX   UINT_MAX
67 #define FT_ULONG_MAX  ULONG_MAX
68 
69 
70   /**********************************************************************/
71   /*                                                                    */
72   /*                 character and string processing                    */
73   /*                                                                    */
74   /**********************************************************************/
75 
76 
77 #include <ctype.h>
78 
79 #define ft_isalnum  isalnum
80 #define ft_isupper  isupper
81 #define ft_islower  islower
82 #define ft_xdigit   isxdigit
83 
84 
85 /*#include <string.h>*/
86 
87 #define ft_strlen   strlen
88 #define ft_strcmp   strcmp
89 #define ft_strncmp  strncmp
90 #define ft_memcpy   memcpy
91 #define ft_strcpy   strcpy
92 #define ft_strncpy  strncpy
93 #define ft_memset   memset
94 #define ft_memmove  memmove
95 #define ft_memcmp   memcmp
96 
97 #include <stdio.h>
98 
99 #define ft_sprintf  sprintf
100 
101 
102   /**********************************************************************/
103   /*                                                                    */
104   /*                             sorting                                */
105   /*                                                                    */
106   /**********************************************************************/
107 
108 
109 
110 /*#include <stdlib.h>*/
111 
112 #define ft_qsort  qsort
113 
114 /*#define ft_exit   exit    /* only used to exit from unhandled exceptions */
115 
116 #define ft_exit(a)   exits("")    /* only used to exit from unhandled exceptions */
117 
118 #define ft_atoi   atoi
119 
120 
121   /**********************************************************************/
122   /*                                                                    */
123   /*                         execution control                          */
124   /*                                                                    */
125   /**********************************************************************/
126 
127 
128 /*#include <setjmp.h>*/
129 
130 #define ft_jmp_buf  jmp_buf   /* note: this cannot be a typedef since */
131                               /*       jmp_buf is defined as a macro  */
132                               /*       on certain platforms           */
133 
134 #define ft_setjmp   setjmp    /* same thing here */
135 #define ft_longjmp  longjmp   /* "               */
136 
137 
138   /* the following is only used for debugging purposes, i.e. when */
139   /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined     */
140   /*                                                              */
141 /*
142 #include <stdarg.h>
143 */
144 
145 
146 #endif /* __FTSTDLIB_H__ */
147 
148 
149 /* END */
150