[SOLVED] CS /***************************************************************************/

$25

File Name: CS_/***************************************************************************/.zip
File Size: 753.6 KB

5/5 - (1 vote)

/***************************************************************************/
/* */
/*fterrors.h */
/* */
/*FreeType error code handling (specification).*/
/* */
/*Copyright 1996-2015 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.*/
/* */
/***************************************************************************/

/*************************************************************************/
/* */
/*

*/
/* error_enumerations*/
/* */
/* */<br />/* Error Enumerations*/<br />/* */<br />/*<abstract> */ <br /> /* How to handle errors and error strings. */ <br /> /* */ <br /> /* <description>*/<br />/* The header file `fterrors.h (which is automatically included by*/<br />/* `freetype.h defines the handling of FreeTypes enumeration */<br />/* constants.It can also be used to generate error message strings */<br />/* with a small macro trick explained below. */<br />/* */<br />/* *Error* *Formats* */<br />/* */<br />/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */<br />/* defined in `ftoption.h in order to make the higher byte indicate */<br />/* the module where the error has happened (this is not compatible */<br />/* with standard builds of FreeType2, however).See the file*/<br />/* `ftmoderr.h for more details.*/<br />/* */<br />/* *Error* *Message* *Strings* */<br />/* */<br />/* Error definitions are set up with special macros that allow client*/<br />/* applications to build a table of error message strings.The*/<br />/* strings are not included in a normal build of FreeType2 to*/<br />/* save space (most client applications do not use them).*/<br />/* */<br />/* To do so, you have to define the following macros before including*/<br />/* this file.*/<br />/* */<br />/* { */<br />/* FT_ERROR_START_LIST */<br />/* } */<br />/* */<br />/* This macro is called before anything else to define the start of*/<br />/* the error list.It is followed by several FT_ERROR_DEF calls.*/<br />/* */<br />/* { */<br />/* FT_ERROR_DEF( e, v, s ) */<br />/* } */<br />/* */<br />/* This macro is called to define one single error.`e is the error*/<br />/* code identifier (e.g., `Invalid_Argument), `v is the errors*/<br />/* numerical value, and `s is the corresponding error string. */<br />/* */<br />/* { */<br />/* FT_ERROR_END_LIST */<br />/* } */<br />/* */<br />/* This macro ends the list. */<br />/* */<br />/* Additionally, you have to undefine `__FTERRORS_H__ before*/<br />/* #including this file. */<br />/* */<br />/* Here is a simple example. */<br />/* */<br />/* { */<br />/* #undef __FTERRORS_H__ */<br />/* #define FT_ERRORDEF( e, v, s ){ e, s }, */<br />/* #define FT_ERROR_START_LIST { */<br />/* #define FT_ERROR_END_LIST { 0, NULL } };*/<br />/* */<br />/* const struct*/<br />/* { */<br />/* interr_code;*/<br />/* const char*err_msg; */<br />/* } ft_errors[] = */<br />/* */<br />/* #include FT_ERRORS_H*/<br />/* } */<br />/* */<br />/* Note that `FT_Err_Ok is _not_ defined with `FT_ERRORDEF but with*/<br />/* `FT_NOERRORDEF; it is always zero. */<br />/* */<br />/*************************************************************************/ </description></abstract>

/* */

#ifndef __FTERRORS_H__
#define __FTERRORS_H__

/* include module base error codes */
#include FT_MODULE_ERRORS_H

/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** SETUP MACROS*****/
/***** *****/
/*******************************************************************/
/*******************************************************************/

#undefFT_NEED_EXTERN_C

/* FT_ERR_PREFIX is used as a prefix for error identifiers. */
/* By default, we use `FT_Err_.*/
/**/
#ifndef FT_ERR_PREFIX
#define FT_ERR_PREFIXFT_Err_
#endif

/* FT_ERR_BASE is used as the base for module-specific errors. */
/* */
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS

#ifndef FT_ERR_BASE
#define FT_ERR_BASEFT_Mod_Err_Base
#endif

#else

#undef FT_ERR_BASE
#define FT_ERR_BASE0

#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */

/* If FT_ERRORDEF is not defined, we need to define a simple */
/* enumeration type. */
/* */
#ifndef FT_ERRORDEF

#define FT_ERRORDEF( e, v, s )e = v,
#define FT_ERROR_START_LIST enum {
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };

#ifdef __cplusplus
#define FT_NEED_EXTERN_C
extern C {
#endif

#endif /* !FT_ERRORDEF */

/* this macro is used to define an error */
#define FT_ERRORDEF_( e, v, s )
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )

/* this is only used for _Err_Ok, which must be 0! */
#define FT_NOERRORDEF_( e, v, s )
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )

#ifdef FT_ERROR_START_LIST
FT_ERROR_START_LIST
#endif

/* now include the error codes */
#include FT_ERROR_DEFINITIONS_H

#ifdef FT_ERROR_END_LIST
FT_ERROR_END_LIST
#endif

/*******************************************************************/
/*******************************************************************/
/***** *****/
/*****SIMPLE CLEANUP *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/

#ifdef FT_NEED_EXTERN_C
}
#endif

#undef FT_ERROR_START_LIST
#undef FT_ERROR_END_LIST

#undef FT_ERRORDEF
#undef FT_ERRORDEF_
#undef FT_NOERRORDEF_

#undef FT_NEED_EXTERN_C
#undef FT_ERR_BASE

/* FT_ERR_PREFIX is needed internally */
#ifndef FT2_BUILD_LIBRARY
#undef FT_ERR_PREFIX
#endif

#endif /* __FTERRORS_H__ */

/* END */

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS /***************************************************************************/
$25