1 /**************************************************************************** 2 * 3 * fterrors.c 4 * 5 * FreeType API for error code handling. 6 * 7 * Copyright (C) 2018-2019 by 8 * Armin Hasitzka, David Turner, Robert Wilhelm, and Werner Lemberg. 9 * 10 * This file is part of the FreeType project, and may only be used, 11 * modified, and distributed under the terms of the FreeType project 12 * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 * this file you indicate that you have read the license and 14 * understand and accept it fully. 15 * 16 */ 17 18 19 #include <ft2build.h> 20 #include FT_INTERNAL_DEBUG_H 21 #include FT_ERRORS_H 22 23 24 /* documentation is in fterrors.h */ 25 26 FT_EXPORT_DEF( const char* ) FT_Error_String(FT_Error error_code)27 FT_Error_String( FT_Error error_code ) 28 { 29 if ( error_code < 0 || 30 error_code >= FT_ERR_CAT( FT_ERR_PREFIX, Max ) ) 31 return NULL; 32 33 #if defined( FT_CONFIG_OPTION_ERROR_STRINGS ) || \ 34 defined( FT_DEBUG_LEVEL_ERROR ) 35 36 #undef FTERRORS_H_ 37 #define FT_ERROR_START_LIST switch ( FT_ERROR_BASE( error_code ) ) { 38 #define FT_ERRORDEF( e, v, s ) case v: return s; 39 #define FT_ERROR_END_LIST } 40 41 #include FT_ERRORS_H 42 43 #endif /* defined( FT_CONFIG_OPTION_ERROR_STRINGS ) || ... */ 44 45 return NULL; 46 } 47