nuclear@0: /***************************************************************************/ nuclear@0: /* */ nuclear@0: /* ftstdlib.h */ nuclear@0: /* */ nuclear@0: /* ANSI-specific library and header configuration file (specification */ nuclear@0: /* only). */ nuclear@0: /* */ nuclear@0: /* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ nuclear@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ nuclear@0: /* */ nuclear@0: /* This file is part of the FreeType project, and may only be used, */ nuclear@0: /* modified, and distributed under the terms of the FreeType project */ nuclear@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ nuclear@0: /* this file you indicate that you have read the license and */ nuclear@0: /* understand and accept it fully. */ nuclear@0: /* */ nuclear@0: /***************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* This file is used to group all #includes to the ANSI C library that */ nuclear@0: /* FreeType normally requires. It also defines macros to rename the */ nuclear@0: /* standard functions within the FreeType source code. */ nuclear@0: /* */ nuclear@0: /* Load a file which defines __FTSTDLIB_H__ before this one to override */ nuclear@0: /* it. */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: #ifndef __FTSTDLIB_H__ nuclear@0: #define __FTSTDLIB_H__ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: #define ft_ptrdiff_t ptrdiff_t nuclear@0: nuclear@0: nuclear@0: /**********************************************************************/ nuclear@0: /* */ nuclear@0: /* integer limits */ nuclear@0: /* */ nuclear@0: /* UINT_MAX and ULONG_MAX are used to automatically compute the size */ nuclear@0: /* of `int' and `long' in bytes at compile-time. So far, this works */ nuclear@0: /* for all platforms the library has been tested on. */ nuclear@0: /* */ nuclear@0: /* Note that on the extremely rare platforms that do not provide */ nuclear@0: /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */ nuclear@0: /* old Crays where `int' is 36 bits), we do not make any guarantee */ nuclear@0: /* about the correct behaviour of FT2 with all fonts. */ nuclear@0: /* */ nuclear@0: /* In these case, `ftconfig.h' will refuse to compile anyway with a */ nuclear@0: /* message like `couldn't find 32-bit type' or something similar. */ nuclear@0: /* */ nuclear@0: /**********************************************************************/ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: #define FT_CHAR_BIT CHAR_BIT nuclear@0: #define FT_INT_MAX INT_MAX nuclear@0: #define FT_INT_MIN INT_MIN nuclear@0: #define FT_UINT_MAX UINT_MAX nuclear@0: #define FT_ULONG_MAX ULONG_MAX nuclear@0: nuclear@0: nuclear@0: /**********************************************************************/ nuclear@0: /* */ nuclear@0: /* character and string processing */ nuclear@0: /* */ nuclear@0: /**********************************************************************/ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: #define ft_memchr memchr nuclear@0: #define ft_memcmp memcmp nuclear@0: #define ft_memcpy memcpy nuclear@0: #define ft_memmove memmove nuclear@0: #define ft_memset memset nuclear@0: #define ft_strcat strcat nuclear@0: #define ft_strcmp strcmp nuclear@0: #define ft_strcpy strcpy nuclear@0: #define ft_strlen strlen nuclear@0: #define ft_strncmp strncmp nuclear@0: #define ft_strncpy strncpy nuclear@0: #define ft_strrchr strrchr nuclear@0: #define ft_strstr strstr nuclear@0: nuclear@0: nuclear@0: /**********************************************************************/ nuclear@0: /* */ nuclear@0: /* file handling */ nuclear@0: /* */ nuclear@0: /**********************************************************************/ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: #define FT_FILE FILE nuclear@0: #define ft_fclose fclose nuclear@0: #define ft_fopen fopen nuclear@0: #define ft_fread fread nuclear@0: #define ft_fseek fseek nuclear@0: #define ft_ftell ftell nuclear@0: #define ft_sprintf sprintf nuclear@0: nuclear@0: nuclear@0: /**********************************************************************/ nuclear@0: /* */ nuclear@0: /* sorting */ nuclear@0: /* */ nuclear@0: /**********************************************************************/ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: #define ft_qsort qsort nuclear@0: nuclear@0: nuclear@0: /**********************************************************************/ nuclear@0: /* */ nuclear@0: /* memory allocation */ nuclear@0: /* */ nuclear@0: /**********************************************************************/ nuclear@0: nuclear@0: nuclear@0: #define ft_scalloc calloc nuclear@0: #define ft_sfree free nuclear@0: #define ft_smalloc malloc nuclear@0: #define ft_srealloc realloc nuclear@0: nuclear@0: nuclear@0: /**********************************************************************/ nuclear@0: /* */ nuclear@0: /* miscellaneous */ nuclear@0: /* */ nuclear@0: /**********************************************************************/ nuclear@0: nuclear@0: nuclear@0: #define ft_atol atol nuclear@0: #define ft_labs labs nuclear@0: nuclear@0: nuclear@0: /**********************************************************************/ nuclear@0: /* */ nuclear@0: /* execution control */ nuclear@0: /* */ nuclear@0: /**********************************************************************/ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: #define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */ nuclear@0: /* jmp_buf is defined as a macro */ nuclear@0: /* on certain platforms */ nuclear@0: nuclear@0: #define ft_longjmp longjmp nuclear@0: #define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */ nuclear@0: nuclear@0: nuclear@0: /* the following is only used for debugging purposes, i.e., if */ nuclear@0: /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */ nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: nuclear@0: #endif /* __FTSTDLIB_H__ */ nuclear@0: nuclear@0: nuclear@0: /* END */