remove libChf's ChfText

This commit is contained in:
Gwenhael Le Moine 2024-10-08 13:02:42 +02:00
parent 687f48b3e7
commit e103e6880b
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
5 changed files with 26 additions and 32 deletions

View file

@ -57,12 +57,6 @@
#include <stdlib.h>
#include <errno.h>
/* -------------------------------------------------------------------------
Win32 & UNICODE support
------------------------------------------------------------------------- */
#define ChfText( x ) x
/* -------------------------------------------------------------------------
CHF implementation limits and other symbolic constants
------------------------------------------------------------------------- */
@ -74,7 +68,7 @@
#define CHF_NULL_CONTEXT ( void* )NULL
#define CHF_NULL_POINTER ( ChfPointer* )NULL
#define CHF_NULL_HANDLER ( ChfHandler ) NULL
#define CHF_LIBRARY_ID ChfText( "$Id: Chf.h,v 2.2 2001/01/25 11:56:44 cibrario Exp $" )
#define CHF_LIBRARY_ID "$Id: Chf.h,v 2.2 2001/01/25 11:56:44 cibrario Exp $"
#define CHF_MAJOR_RELEASE_NUMBER 2
#define CHF_MINOR_RELEASE_NUMBER 2
@ -167,9 +161,9 @@ typedef /* Message retrieval 'exit' function */
# define CHF_Condition( module_id ) \
ChfGenerate( \
module_id, \
ChfText(__FILE__), __LINE__,
__FILE__, __LINE__,
# define CHF_ErrnoCondition ChfGenerate( CHF_ERRNO_SET, ChfText( __FILE__ ), __LINE__, errno, CHF_ERROR )
# define CHF_ErrnoCondition ChfGenerate( CHF_ERRNO_SET, __FILE__, __LINE__, errno, CHF_ERROR )
#else
# define CHF_Condition( module_id ) \

View file

@ -49,16 +49,16 @@
#define CHF_MODULE_ID CHF_SET
#define CHF_TMP_MESSAGE_LENGTH ( 2 * CHF_MAX_MESSAGE_LENGTH )
#define CHF_DEF_MESSAGE_LENGTH 40
#define CHF_DEF_PARTIAL_MSG_FMT ChfText( "Code <%d>d" )
#define CHF_DEF_MID_MSG_FMT ChfText( "Mid <%d>d" )
#define CHF_EXTENDED_INFO_FMT ChfText( "(%s,%d)" )
#define CHF_SEVERITY_NAMES { ChfText( "S" ), ChfText( "I" ), ChfText( "W" ), ChfText( "E" ), ChfText( "F" ) }
#define CHF_UNKNOWN_SEVERITY ChfText( "?" )
#define CHF_MESSAGE_SEPARATOR ChfText( "-" )
#define CHF_MESSAGE_TERMINATOR ChfText( "\n" )
#define CHF_ABORT_HEADER ChfText( "ChfAbort-F-" )
#define CHF_ABORT_BAD_CODE_FMT ChfText( "Bad abort code <%d>d\n" )
#define CHF_ABORT_GOOD_CODE_FMT ChfText( "%s\n" )
#define CHF_DEF_PARTIAL_MSG_FMT "Code <%d>d"
#define CHF_DEF_MID_MSG_FMT "Mid <%d>d"
#define CHF_EXTENDED_INFO_FMT "(%s,%)"
#define CHF_SEVERITY_NAMES { "S", "I", "W", "E", "F" }
#define CHF_UNKNOWN_SEVERITY "?"
#define CHF_MESSAGE_SEPARATOR "-"
#define CHF_MESSAGE_TERMINATOR "\n"
#define CHF_ABORT_HEADER "ChfAbort-F-"
#define CHF_ABORT_BAD_CODE_FMT "Bad abort code <%d>d\n"
#define CHF_ABORT_GOOD_CODE_FMT "%s\n"
/* -------------------------------------------------------------------------
Abort codes used with ChfAbort()

View file

@ -46,16 +46,16 @@
match the numeric codes CHF_ABORT_xxxx defined in ChfPriv.h
*/
static const char* message_table[] = { ( const char* )NULL,
ChfText( "Not initialized" ),
ChfText( "Temporary message buffer overflow" ),
ChfText( "Invalid action from last chance handler" ),
ChfText( "Already initialized" ),
ChfText( "Unwind request while unwinding" ),
ChfText( "Improperly handled condition" ),
ChfText( "Fatal condition while unwinding" ),
ChfText( "Condition stack overflow" ),
ChfText( "Can't prime a new Chf context" ),
ChfText( "Pthread interaction failed" ) };
"Not initialized",
"Temporary message buffer overflow",
"Invalid action from last chance handler",
"Already initialized",
"Unwind request while unwinding",
"Improperly handled condition",
"Fatal condition while unwinding",
"Condition stack overflow",
"Can't prime a new Chf context",
"Pthread interaction failed" };
#define MESSAGE_TABLE_SIZE ( sizeof( message_table ) / sizeof( const char* ) )

View file

@ -106,7 +106,7 @@ void ChfGenerate( /* Generate a condition into the stack */
new_descriptor->line_number = CHF_UNKNOWN_LINE_NUMBER;
new_descriptor->file_name = CHF_UNKNOWN_FILE_NAME;
ChfStrncpy( new_descriptor->message, ChfGetMessage( module_id, CHF_F_COND_STACK_FULL, ChfText( "Condition stack is full" ) ),
ChfStrncpy( new_descriptor->message, ChfGetMessage( module_id, CHF_F_COND_STACK_FULL, "Condition stack is full" ),
CHF_MAX_MESSAGE_LENGTH - 1 );
new_descriptor->message[ CHF_MAX_MESSAGE_LENGTH - 1 ] = '\0';

View file

@ -371,7 +371,7 @@ char* ChfBuildMessage( /* Build a condition message */
}
else
tmp_p = scopy( tmp_p, ChfText( "\t" ), tmp_end );
tmp_p = scopy( tmp_p, "\t", tmp_end );
/* The message continues with the module name */
ChfSprintf( def_message, CHF_DEF_MID_MSG_FMT, ChfGetModuleId( descriptor ) );
@ -380,7 +380,7 @@ char* ChfBuildMessage( /* Build a condition message */
/* Add also the extended information, if any */
if ( ChfGetLineNumber( descriptor ) != CHF_UNKNOWN_LINE_NUMBER ) {
tmp_p = scopy( tmp_p, ChfText( " " ), tmp_end );
tmp_p = scopy( tmp_p, " ", tmp_end );
ChfSprintf( def_message, CHF_EXTENDED_INFO_FMT, ChfGetFileName( descriptor ), ChfGetLineNumber( descriptor ) );