don't install libChf docs (outdated); more libChf slimming down
This commit is contained in:
parent
d3ef71cb2a
commit
dc122cf46f
7 changed files with 54 additions and 82 deletions
5
Makefile
5
Makefile
|
@ -145,7 +145,6 @@ dist/pack: src/pack.o src/disk_io.o src/debug.o src/libChf/libChf.a
|
|||
|
||||
doc:
|
||||
make -C docs
|
||||
make -C src/libChf doc
|
||||
|
||||
# Cleaning
|
||||
clean:
|
||||
|
@ -184,10 +183,10 @@ install: dist/$(NAME) doc
|
|||
cp -R dist/ROMs/ $(DESTDIR)$(PREFIX)/share/$(NAME)/
|
||||
|
||||
install -m 755 -d -- $(DESTDIR)$(DOCDIR)
|
||||
cp -R COPYING LICENSE README* ./*.png docs-4.1.1.1 docs/*.{dvi,ps,pdf} src/libChf/docs/*.{dvi,ps,pdf} $(DESTDIR)$(DOCDIR)
|
||||
cp -R COPYING LICENSE README* ./*.png docs-4.1.1.1 docs/*.{dvi,ps,pdf} $(DESTDIR)$(DOCDIR)
|
||||
|
||||
install -m 755 -d -- $(DESTDIR)$(INFODIR)
|
||||
cp docs/*.info src/libChf/docs/*.info $(DESTDIR)$(INFODIR)
|
||||
cp docs/*.info $(DESTDIR)$(INFODIR)
|
||||
|
||||
install -m 755 -d -- $(DESTDIR)$(PREFIX)/share/applications
|
||||
sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn48gx.desktop > $(DESTDIR)$(PREFIX)/share/applications/saturn48gx.desktop
|
||||
|
|
|
@ -263,7 +263,7 @@ Moreover, each module using the Chf library must include the header file
|
|||
@node ChfInit(), ChfMsgcatInit(), Initialization and exit, Initialization and exit
|
||||
@section ChfInit()
|
||||
@cindex Initialization
|
||||
@deftypefn Function int ChfInit (const char *app_name, const ChfOptions options, void *mrs_data, ChfMrsGet mrs_get, ChfMrsExit mrs_exit, const int condition_stack_size, const int handler_stack_size, const int exit_code)
|
||||
@deftypefn Function int ChfInit (const char *app_name, const int options, void *mrs_data, ChfMrsGet mrs_get, ChfMrsExit mrs_exit, const int condition_stack_size, const int handler_stack_size, const int exit_code)
|
||||
|
||||
This function initializes the Chf library using a custom message retrieval
|
||||
subsystem, and returns to the caller a condition code; that code will be either
|
||||
|
@ -364,7 +364,7 @@ must be invoked only once before starting multithreaded operation.
|
|||
@section ChfMsgcatInit()
|
||||
@cindex Initialization
|
||||
@cindex Internationalization
|
||||
@deftypefn Function int ChfMsgcatInit (const char *app_name, const ChfOptions options, const char *msgcat_name, const int condition_stack_size, const int handler_stack_size, const int exit_code)
|
||||
@deftypefn Function int ChfMsgcatInit (const char *app_name, const int options, const char *msgcat_name, const int condition_stack_size, const int handler_stack_size, const int exit_code)
|
||||
|
||||
This function initializes the Chf library and activates the message retrieval
|
||||
subsystem based on @code{catgets()}, offering support for
|
||||
|
@ -420,7 +420,7 @@ before.
|
|||
@node ChfStaticInit(), ChfWin32Init(), ChfMsgcatInit(), Initialization and exit
|
||||
@section ChfStaticInit()
|
||||
@cindex Initialization
|
||||
@deftypefn Function int ChfStaticInit (const char *app_name, const ChfOptions options, const ChfTable *table, const size_t table_size, const int condition_stack_size, const int handler_stack_size, const int exit_code)
|
||||
@deftypefn Function int ChfStaticInit (const char *app_name, const int options, const ChfTable *table, const size_t table_size, const int condition_stack_size, const int handler_stack_size, const int exit_code)
|
||||
|
||||
This function initializes the Chf library and activates the static
|
||||
message retrieval subsystem using the message table @code{table},
|
||||
|
@ -482,7 +482,7 @@ The message fragment or template associated with
|
|||
@section ChfWin32Init()
|
||||
@cindex Initialization
|
||||
@cindex Internationalization
|
||||
@deftypefn Function int ChfWin32Init (const char *app_name, const ChfOptions options, HINSTANCE instance, const int condition_stack_size, const int handler_stack_size, const int exit_code)
|
||||
@deftypefn Function int ChfWin32Init (const char *app_name, const int options, HINSTANCE instance, const int condition_stack_size, const int handler_stack_size, const int exit_code)
|
||||
|
||||
This function initializes the Chf library and activates the message
|
||||
retrieval subsystem based on the Win32 function @code{LoadString()},
|
||||
|
|
|
@ -103,9 +103,6 @@ typedef enum {
|
|||
CHF_UNWIND_KEEP /* Unwind, keep last cond. group */
|
||||
} ChfAction;
|
||||
|
||||
/* CHF options */
|
||||
typedef int ChfOptions;
|
||||
|
||||
#define CHF_DEFAULT 0x0000 /* default flags */
|
||||
#define CHF_ABORT 0x0001 /* use abort() instead of exit() */
|
||||
|
||||
|
@ -150,13 +147,13 @@ void ChfGenerate( const int module_id, const char* file_name, const int line_num
|
|||
/* used in saturn */
|
||||
/******************/
|
||||
/* Initialization with static message tables */
|
||||
int ChfStaticInit( const char* app_name, /* Application's name */
|
||||
const ChfOptions options, /* Options */
|
||||
const ChfTable* table, /* Static message table */
|
||||
const size_t table_size, /* Size of the message table */
|
||||
const int condition_stack_size, /* Size of the condition stack */
|
||||
const int handler_stack_size, /* Size of the handler stack */
|
||||
const int exit_code /* Abnormal exit code */
|
||||
int ChfStaticInit( const int module_id, const char* app_name, /* Application's name */
|
||||
const int options, /* Options */
|
||||
const ChfTable* table, /* Static message table */
|
||||
const size_t table_size, /* Size of the message table */
|
||||
const int condition_stack_size, /* Size of the condition stack */
|
||||
const int handler_stack_size, /* Size of the handler stack */
|
||||
const int exit_code /* Abnormal exit code */
|
||||
);
|
||||
|
||||
/* Push a new handler into the stack */
|
||||
|
|
|
@ -80,7 +80,7 @@ typedef struct ChfHandlerDescriptor_S {
|
|||
typedef struct ChfContext_S {
|
||||
ChfState state; /* Current CHF state */
|
||||
const char* app_name; /* Application's name */
|
||||
ChfOptions options; /* Options */
|
||||
int options; /* Options */
|
||||
void* mrs_data; /* Message retrieval private data */
|
||||
ChfMrsGet mrs_get; /* 'GetMessage' function */
|
||||
ChfMrsExit mrs_exit; /* 'Exit' function */
|
||||
|
@ -104,27 +104,6 @@ typedef struct ChfContext_S {
|
|||
# define chf_context _chf_context
|
||||
#endif
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
Structured condition handling
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* #define CHF_Try \ */
|
||||
/* { \ */
|
||||
/* sigjmp_buf _chf_sigjmp_buf; \ */
|
||||
/* if ( sigsetjmp( _chf_sigjmp_buf, 1 ) == 0 ) { \ */
|
||||
/* ChfPushHandler( CHF_NULL_HANDLER, _chf_sigjmp_buf, CHF_NULL_POINTER ); */
|
||||
|
||||
/* #define CHF_Catch \ */
|
||||
/* ChfPopHandler( CHF_MODULE_ID ); \ */
|
||||
/* } \ */
|
||||
/* else \ */
|
||||
/* { */
|
||||
|
||||
/* #define CHF_EndTry \ */
|
||||
/* ChfDiscard(); \ */
|
||||
/* } \ */
|
||||
/* } */
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
Global variables
|
||||
------------------------------------------------------------------------- */
|
||||
|
@ -139,14 +118,14 @@ ChfContext* _ChfGetContext( void );
|
|||
#endif
|
||||
|
||||
/* Generic initialization */
|
||||
int ChfInit( const char* app_name, /* Application's name */
|
||||
const ChfOptions options, /* Options */
|
||||
void* mrs_data, /* Message retrieval private data */
|
||||
ChfMrsGet mrs_get, /* 'GetMessage' function */
|
||||
ChfMrsExit mrs_exit, /* 'Exit' function */
|
||||
const int condition_stack_size, /* Size of the condition stack */
|
||||
const int handler_stack_size, /* Size of the handler stack */
|
||||
const int exit_code /* Abnormal exit code */
|
||||
int ChfInit( const int module_id, const char* app_name, /* Application's name */
|
||||
const int options, /* Options */
|
||||
void* mrs_data, /* Message retrieval private data */
|
||||
ChfMrsGet mrs_get, /* 'GetMessage' function */
|
||||
ChfMrsExit mrs_exit, /* 'Exit' function */
|
||||
const int condition_stack_size, /* Size of the condition stack */
|
||||
const int handler_stack_size, /* Size of the handler stack */
|
||||
const int exit_code /* Abnormal exit code */
|
||||
);
|
||||
|
||||
/* Abort application */
|
||||
|
@ -155,9 +134,6 @@ void ChfAbort( const int abort_code );
|
|||
/* Build a condition message */
|
||||
char* ChfBuildMessage( const ChfDescriptor* descriptor );
|
||||
|
||||
/* Retrieve top condition */
|
||||
/* const ChfDescriptor* ChfGetTopCondition( const int module_id ); */
|
||||
|
||||
/* Retrieve a condition message */
|
||||
const char* ChfGetMessage( const int module_id, const int condition_code, const char* default_message );
|
||||
|
||||
|
|
|
@ -289,8 +289,8 @@ static char* scopy( char* p, const char* q, char* p_end )
|
|||
- added Win32 support
|
||||
|
||||
.- */
|
||||
const char* ChfGetMessage( /* Retrieve a condition message */
|
||||
const int module_id, const int condition_code, const char* default_message )
|
||||
/* Retrieve a condition message */
|
||||
const char* ChfGetMessage( const int module_id, const int condition_code, const char* default_message )
|
||||
{
|
||||
const char* message;
|
||||
|
||||
|
@ -339,8 +339,8 @@ const char* ChfGetMessage( /* Retrieve a condition message */
|
|||
- added Win32 support
|
||||
|
||||
.- */
|
||||
char* ChfBuildMessage( /* Build a condition message */
|
||||
const ChfDescriptor* descriptor )
|
||||
/* Build a condition message */
|
||||
char* ChfBuildMessage( const ChfDescriptor* descriptor )
|
||||
{
|
||||
char* tmp_p;
|
||||
char* tmp_end;
|
||||
|
@ -421,7 +421,7 @@ char* ChfBuildMessage( /* Build a condition message */
|
|||
exit_code);
|
||||
.input :
|
||||
const char *app_name, Application's name
|
||||
const ChfOptions options, Options
|
||||
const int options, Options
|
||||
void *mrs_data, Message retrieval private data
|
||||
ChfMrsGet mrs_get, 'GetMessage' function
|
||||
ChfMrsExit mrs_exit, 'Exit' function
|
||||
|
@ -442,15 +442,15 @@ char* ChfBuildMessage( /* Build a condition message */
|
|||
- added Win32 support; a malloc() call was not portable.
|
||||
|
||||
.- */
|
||||
int ChfInit( /* Generic initialization */
|
||||
const char* app_name, /* Application's name */
|
||||
const ChfOptions options, /* Options */
|
||||
void* mrs_data, /* Message retrieval private data */
|
||||
ChfMrsGet mrs_get, /* 'GetMessage' function */
|
||||
ChfMrsExit mrs_exit, /* 'Exit' function */
|
||||
const int condition_stack_size, /* Size of the condition stack */
|
||||
const int handler_stack_size, /* Size of the handler stack */
|
||||
const int exit_code /* Abnormal exit code */
|
||||
/* Generic initialization */
|
||||
int ChfInit( const int module_id, const char* app_name, /* Application's name */
|
||||
const int options, /* Options */
|
||||
void* mrs_data, /* Message retrieval private data */
|
||||
ChfMrsGet mrs_get, /* 'GetMessage' function */
|
||||
ChfMrsExit mrs_exit, /* 'Exit' function */
|
||||
const int condition_stack_size, /* Size of the condition stack */
|
||||
const int handler_stack_size, /* Size of the handler stack */
|
||||
const int exit_code /* Abnormal exit code */
|
||||
)
|
||||
{
|
||||
int cc;
|
||||
|
@ -520,7 +520,7 @@ int ChfInit( /* Generic initialization */
|
|||
/* Push the default handler; in the reentrant case, this will be
|
||||
done once per thread, when the thread-specific context is primed.
|
||||
*/
|
||||
ChfPushHandler( CHF_MODULE_ID, DefaultHandler, CHF_NULL_CONTEXT, CHF_NULL_POINTER );
|
||||
ChfPushHandler( module_id, DefaultHandler, CHF_NULL_CONTEXT, CHF_NULL_POINTER );
|
||||
#endif
|
||||
|
||||
cc = CHF_S_OK;
|
||||
|
@ -694,7 +694,7 @@ ChfContext* _ChfGetContext( void )
|
|||
ChfAbort( CHF_ABORT_GET_CONTEXT );
|
||||
|
||||
/* Push the default handler */
|
||||
ChfPushHandler( /* FIXME */ 255, DefaultHandler, CHF_NULL_CONTEXT, CHF_NULL_POINTER );
|
||||
ChfPushHandler( module_id, DefaultHandler, CHF_NULL_CONTEXT, CHF_NULL_POINTER );
|
||||
}
|
||||
|
||||
return context;
|
||||
|
|
|
@ -106,7 +106,7 @@ static void ExitMessage( void* private_context ) {}
|
|||
exit_code);
|
||||
.input :
|
||||
const char *app_name, Application's name
|
||||
const ChfOptions options, Options
|
||||
const int options, Options
|
||||
const ChfTable *table, pointer to the static message table
|
||||
const size_t table_size, size of the table (# of entries)
|
||||
const int condition_stack_size, Size of the condition stack
|
||||
|
@ -121,13 +121,13 @@ static void ExitMessage( void* private_context ) {}
|
|||
|
||||
.- */
|
||||
/* Initialization with static message tables */
|
||||
int ChfStaticInit( const char* app_name, /* Application's name */
|
||||
const ChfOptions options, /* Options */
|
||||
const ChfTable* table, /* Static message table */
|
||||
const size_t table_size, /* Size of the message table */
|
||||
const int condition_stack_size, /* Size of the condition stack */
|
||||
const int handler_stack_size, /* Size of the handler stack */
|
||||
const int exit_code /* Abnormal exit code */
|
||||
int ChfStaticInit( const int module_id, const char* app_name, /* Application's name */
|
||||
const int options, /* Options */
|
||||
const ChfTable* table, /* Static message table */
|
||||
const size_t table_size, /* Size of the message table */
|
||||
const int condition_stack_size, /* Size of the condition stack */
|
||||
const int handler_stack_size, /* Size of the handler stack */
|
||||
const int exit_code /* Abnormal exit code */
|
||||
)
|
||||
{
|
||||
ChfStaticContext* private_context;
|
||||
|
@ -135,7 +135,7 @@ int ChfStaticInit( const char* app_name, /* Application's name */
|
|||
|
||||
if ( ( private_context = ( ChfStaticContext* )malloc( sizeof( ChfStaticContext ) ) ) == ( ChfStaticContext* )NULL )
|
||||
cc = CHF_F_MALLOC;
|
||||
else if ( ( cc = ChfInit( app_name, options, ( void* )private_context, StGetMessage, ExitMessage, condition_stack_size,
|
||||
else if ( ( cc = ChfInit( module_id, app_name, options, ( void* )private_context, StGetMessage, ExitMessage, condition_stack_size,
|
||||
handler_stack_size, exit_code ) ) != CHF_S_OK )
|
||||
free( private_context );
|
||||
else {
|
||||
|
|
14
src/main.c
14
src/main.c
|
@ -52,13 +52,13 @@ int main( int argc, char** argv )
|
|||
|
||||
/* Chf initialization with msgcat subsystem
|
||||
*/
|
||||
if ( ( ChfStaticInit( config.progname, /* Application's name */
|
||||
CHF_DEFAULT, /* Options */
|
||||
message_table, /* Name of the message catalog */
|
||||
message_table_size, /* message catalog size */
|
||||
CONDITION_STACK_SIZE, /* Size of the condition stack */
|
||||
HANDLER_STACK_SIZE, /* Size of the handler stack */
|
||||
EXIT_FAILURE /* Abnormal exit code */
|
||||
if ( ( ChfStaticInit( MAIN_CHF_MODULE_ID, config.progname, /* Application's name */
|
||||
CHF_DEFAULT, /* Options */
|
||||
message_table, /* Name of the message catalog */
|
||||
message_table_size, /* message catalog size */
|
||||
CONDITION_STACK_SIZE, /* Size of the condition stack */
|
||||
HANDLER_STACK_SIZE, /* Size of the handler stack */
|
||||
EXIT_FAILURE /* Abnormal exit code */
|
||||
) ) != CHF_S_OK ) {
|
||||
fprintf( stderr, "saturn-E-Primary Chf initialization failed\n" );
|
||||
exit( EXIT_FAILURE );
|
||||
|
|
Loading…
Add table
Reference in a new issue