/**************************************************************************** * * ftstdlib.h * * ANSI-specific library and header configuration file (specification * only). * * Copyright (C) 2002-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, * modified, and distributed under the terms of the FreeType project * license, LICENSE.TXT. By continuing to use, modify, or distribute * this file you indicate that you have read the license and * understand and accept it fully. * */ /************************************************************************** * * This file is used to group all `#includes` to the ANSI~C library that * FreeType normally requires. It also defines macros to rename the * standard functions within the FreeType source code. * * Load a file which defines `FTSTDLIB_H_` before this one to override it. * */ #ifndef FTSTDLIB_H_ #define FTSTDLIB_H_ #include <stddef.h> #define ft_ptrdiff_t … /************************************************************************** * * integer limits * * `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of * `int` and `long` in bytes at compile-time. So far, this works for all * platforms the library has been tested on. We also check `ULLONG_MAX` * to see whether we can use 64-bit `long long` later on. * * Note that on the extremely rare platforms that do not provide integer * types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where * `int` is 36~bits), we do not make any guarantee about the correct * behaviour of FreeType~2 with all fonts. * * In these cases, `ftconfig.h` will refuse to compile anyway with a * message like 'couldn't find 32-bit type' or something similar. * */ #include <limits.h> #define FT_CHAR_BIT … #define FT_USHORT_MAX … #define FT_INT_MAX … #define FT_INT_MIN … #define FT_UINT_MAX … #define FT_LONG_MIN … #define FT_LONG_MAX … #define FT_ULONG_MAX … #ifdef LLONG_MAX #define FT_LLONG_MAX … #endif #ifdef LLONG_MIN #define FT_LLONG_MIN … #endif #ifdef ULLONG_MAX #define FT_ULLONG_MAX … #endif /************************************************************************** * * character and string processing * */ #include <string.h> #define ft_memchr … #define ft_memcmp … #define ft_memcpy … #define ft_memmove … #define ft_memset … #define ft_strcat … #define ft_strcmp … #define ft_strcpy … #define ft_strlen … #define ft_strncmp … #define ft_strncpy … #define ft_strrchr … #define ft_strstr … /************************************************************************** * * file handling * */ #include <stdio.h> #define FT_FILE … #define ft_fclose … #define ft_fopen … #define ft_fread … #define ft_fseek … #define ft_ftell … #define ft_snprintf … /************************************************************************** * * sorting * */ #include <stdlib.h> #define ft_qsort … /************************************************************************** * * memory allocation * */ #define ft_scalloc … #define ft_sfree … #define ft_smalloc … #define ft_srealloc … /************************************************************************** * * miscellaneous * */ #define ft_strtol … #define ft_getenv … /************************************************************************** * * execution control * */ #include <setjmp.h> #define ft_jmp_buf … /* `jmp_buf` is defined as a macro */ /* on certain platforms */ #define ft_longjmp … #define ft_setjmp( b ) … /* The following is only used for debugging purposes, i.e., if */ /* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */ #include <stdarg.h> #endif /* FTSTDLIB_H_ */ /* END */