w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ftstdlib.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * ftstdlib.h
4  *
5  * ANSI-specific library and header configuration file (specification
6  * only).
7  *
8  * Copyright (C) 2002-2020 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 it.
27  *
28  */
29 
30 
31 #ifndef FTSTDLIB_H_
32 #define FTSTDLIB_H_
33 
34 
35 #include <stddef.h>
36 
37 #define ft_ptrdiff_t ptrdiff_t
38 
39 
40  /**************************************************************************
41  *
42  * integer limits
43  *
44  * `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
45  * `int` and `long` in bytes at compile-time. So far, this works for all
46  * platforms the library has been tested on.
47  *
48  * Note that on the extremely rare platforms that do not provide integer
49  * types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
50  * `int` is 36~bits), we do not make any guarantee about the correct
51  * behaviour of FreeType~2 with all fonts.
52  *
53  * In these cases, `ftconfig.h` will refuse to compile anyway with a
54  * message like 'couldn't find 32-bit type' or something similar.
55  *
56  */
57 
58 
59 #include <limits.h>
60 
61 #define FT_CHAR_BIT CHAR_BIT
62 #define FT_USHORT_MAX USHRT_MAX
63 #define FT_INT_MAX INT_MAX
64 #define FT_INT_MIN INT_MIN
65 #define FT_UINT_MAX UINT_MAX
66 #define FT_LONG_MIN LONG_MIN
67 #define FT_LONG_MAX LONG_MAX
68 #define FT_ULONG_MAX ULONG_MAX
69 
70 
71  /**************************************************************************
72  *
73  * character and string processing
74  *
75  */
76 
77 
78 #include <string.h>
79 
80 #define ft_memchr memchr
81 #define ft_memcmp memcmp
82 #define ft_memcpy memcpy
83 #define ft_memmove memmove
84 #define ft_memset memset
85 #define ft_strcat strcat
86 #define ft_strcmp strcmp
87 #define ft_strcpy strcpy
88 #define ft_strlen strlen
89 #define ft_strncmp strncmp
90 #define ft_strncpy strncpy
91 #define ft_strrchr strrchr
92 #define ft_strstr strstr
93 
94 
95  /**************************************************************************
96  *
97  * file handling
98  *
99  */
100 
101 
102 #include <stdio.h>
103 #if defined(_MSC_VER) && _MSC_VER > 1600
104 /* use fsyscp_fopen in kpathsea in order to support
105  * non-ascii font paths in XeTeX
106  */
107 FILE *
108 fsyscp_fopen (const char *filename, const char *mode);
109 #endif /* _MSC_VER */
110 #define FT_FILE FILE
111 #define ft_fclose fclose
112 #if defined(_MSC_VER) && _MSC_VER > 1600
113 #define ft_fopen fsyscp_fopen
114 #else
115 #define ft_fopen fopen
116 #endif /* _MSC_VER */
117 #define ft_fread fread
118 #define ft_fseek fseek
119 #define ft_ftell ftell
120 #define ft_sprintf sprintf
121 
122 
123  /**************************************************************************
124  *
125  * sorting
126  *
127  */
128 
129 
130 #include <stdlib.h>
131 
132 #define ft_qsort qsort
133 
134 
135  /**************************************************************************
136  *
137  * memory allocation
138  *
139  */
140 
141 
142 #define ft_scalloc calloc
143 #define ft_sfree free
144 #define ft_smalloc malloc
145 #define ft_srealloc realloc
146 
147 
148  /**************************************************************************
149  *
150  * miscellaneous
151  *
152  */
153 
154 
155 #define ft_strtol strtol
156 #define ft_getenv getenv
157 
158 
159  /**************************************************************************
160  *
161  * execution control
162  *
163  */
164 
165 
166 #include <setjmp.h>
167 
168 #define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
169  /* `jmp_buf` is defined as a macro */
170  /* on certain platforms */
171 
172 #define ft_longjmp longjmp
173 #define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
174 
175 
176  /* The following is only used for debugging purposes, i.e., if */
177  /* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */
178 
179 #include <stdarg.h>
180 
181 
182 #endif /* FTSTDLIB_H_ */
183 
184 
185 /* END */
#define mode
Definition: aptex-macros.h:510
char * filename[256]
Definition: pbmtopk.c:46
#define FILE
Definition: t1stdio.h:34