ajmess.c
Fatal error message to standard error.
Includes filename and line number in the source code that invokes it.
Newline is added automatically at the end of the format string.
Input
format: | (Input) | Format |
: | (Vararg) | Variable length argument list |
Returns
Description
Fatal error message to standard error.
Includes filename and line number in the source code that invokes it.
Newline is added automatically at the end of the format string.
See Also
See other functions in this section
Availability
In release 6.4.0
Crash error message to standard error.
Includes filename and line number in the source code that invokes it.
Newline is added automatically at the end of the format string.
Input
format: | (Input) | Format |
: | (Vararg) | Variable length argument list |
Returns
Description
Crash error message to standard error.
Includes filename and line number in the source code that invokes it.
Newline is added automatically at the end of the format string.
See Also
See other functions in this section
Availability
In release 6.4.0
Used to trace in a debugger as a breakpoint
Synopsis
Prototype
void ajMessInvokeDebugger (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Used to trace in a debugger as a breakpoint
See Also
See other functions in this section
Availability
In release 6.4.0
Sets a function to process beeps
Synopsis
Prototype
AjMessVoidRoutine ajMessRegBeep (
AjMessVoidRoutine func
);
Type | Name | Read/Write | Description |
AjMessVoidRoutine | func | Function | Function to be registered |
AjMessVoidRoutine | | RETURN | Previously defined function |
Input
func: | (Function) | Function to be registered |
Returns
AjMessVoidRoutine: | Previously defined function |
Description
Sets a function to process beeps
See Also
See other functions in this section
Availability
In release 6.4.0
Sets a function to write messages
Synopsis
Prototype
AjMessOutRoutine ajMessRegOut (
AjMessOutRoutine func
);
Type | Name | Read/Write | Description |
AjMessOutRoutine | func | Function | Function to be registered |
AjMessOutRoutine | | RETURN | Previously defined function |
Input
func: | (Function) | Function to be registered |
Returns
AjMessOutRoutine: | Previously defined function |
Description
Sets a function to write messages
See Also
See other functions in this section
Availability
In release 6.4.0
Sets a function to dump data
Synopsis
Prototype
AjMessOutRoutine ajMessRegDump (
AjMessOutRoutine func
);
Type | Name | Read/Write | Description |
AjMessOutRoutine | func | Function | Function to be registered |
AjMessOutRoutine | | RETURN | Previously defined function |
Input
func: | (Function) | Function to be registered |
Returns
AjMessOutRoutine: | Previously defined function |
Description
Sets a function to dump data
See Also
See other functions in this section
Availability
In release 6.4.0
Sets a function to report errors
Synopsis
Prototype
AjMessOutRoutine ajMessRegErr (
AjMessOutRoutine func
);
Type | Name | Read/Write | Description |
AjMessOutRoutine | func | Function | Function to be registered |
AjMessOutRoutine | | RETURN | Previously defined function |
Input
func: | (Function) | Function to be registered |
Returns
AjMessOutRoutine: | Previously defined function |
Description
Sets a function to report errors
See Also
See other functions in this section
Availability
In release 6.4.0
Sets a function to exit
Synopsis
Prototype
AjMessOutRoutine ajMessRegExit (
AjMessOutRoutine func
);
Type | Name | Read/Write | Description |
AjMessOutRoutine | func | Function | Function to be registered |
AjMessOutRoutine | | RETURN | Previously defined function |
Input
func: | (Function) | Function to be registered |
Returns
AjMessOutRoutine: | Previously defined function |
Description
Sets a function to exit
See Also
See other functions in this section
Availability
In release 6.4.0
Sets a function to crash
Synopsis
Prototype
AjMessOutRoutine ajMessRegCrash (
AjMessOutRoutine func
);
Type | Name | Read/Write | Description |
AjMessOutRoutine | func | Function | Function to be registered |
AjMessOutRoutine | | RETURN | Previously defined function |
Input
func: | (Function) | Function to be registered |
Returns
AjMessOutRoutine: | Previously defined function |
Description
Sets a function to crash
See Also
See other functions in this section
Availability
In release 6.4.0
Sets a function to print warnings
Synopsis
Prototype
AjMessOutRoutine ajMessRegWarn (
AjMessOutRoutine func
);
Type | Name | Read/Write | Description |
AjMessOutRoutine | func | Function | Function to be registered |
AjMessOutRoutine | | RETURN | Previously defined function |
Input
func: | (Function) | Function to be registered |
Returns
AjMessOutRoutine: | Previously defined function |
Description
Sets a function to print warnings
See Also
See other functions in this section
Availability
In release 6.4.0
Calls the defined beep function, if any. Otherwise prints ASCII 7 to
standard error.
Synopsis
Prototype
void ajMessBeep (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Calls the defined beep function, if any. Otherwise prints ASCII 7 to
standard error.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats a message. Calls the defined output function (if any).
Otherwise prints the message to standard error with an extra newline.
Synopsis
Prototype
void ajUser (
const char* format,
...
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format string |
... | vararg | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format string |
: | (Vararg) | Variable length argument list |
Returns
Description
Formats a message. Calls the defined output function (if any).
Otherwise prints the message to standard error with an extra newline.
See Also
See other functions in this section
Availability
In release 6.4.0
Prints a string unchanged. Calls the defined output function (if any).
Otherwise prints the message to standard error with an extra newline.
Synopsis
Prototype
void ajUserDumpC (
const char* txt
);
Type | Name | Read/Write | Description |
const char* | txt | Input | String to print unchanged |
void | | RETURN | |
Input
txt: | (Input) | String to print unchanged |
Returns
Description
Prints a string unchanged. Calls the defined output function (if any).
Otherwise prints the message to standard error with an extra newline.
See Also
See other functions in this section
Availability
In release 6.4.0
Prints a string unchanged. Calls the defined output function (if any).
Otherwise prints the message to standard error with an extra newline.
Synopsis
Prototype
void ajUserDumpS (
const AjPStr str
);
Type | Name | Read/Write | Description |
const AjPStr | str | Input | String to print unchanged |
void | | RETURN | |
Input
str: | (Input) | String to print unchanged |
Returns
Description
Prints a string unchanged. Calls the defined output function (if any).
Otherwise prints the message to standard error with an extra newline.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats a message. Calls the defined output function (if any).
Otherwise prints the message to standard error with no newline.
Synopsis
Prototype
void ajMessOut (
const char* format,
...
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format string |
... | vararg | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format string |
: | (Vararg) | Variable length argument list |
Returns
Description
Formats a message. Calls the defined output function (if any).
Otherwise prints the message to standard error with no newline.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats a message. Calls the defined output function (if any).
Otherwise prints the message to standard error.
Synopsis
Prototype
void ajVUser (
const char* format,
va_list args
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format string |
va_list | args | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format string |
args: | (Vararg) | Variable length argument list |
Returns
Description
Formats a message. Calls the defined output function (if any).
Otherwise prints the message to standard error.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats a message. Calls the dump function (if any).
Otherwise no further action.
Synopsis
Prototype
void ajMessDump (
const char* format,
...
);
Type | Name | Read/Write | Description |
const char* | format | Input | format string. |
... | vararg | Vararg | Variable length argument list. |
void | | RETURN | |
Input
format: | (Input) | format string. |
: | (Vararg) | Variable length argument list. |
Returns
Description
Formats a message. Calls the dump function (if any).
Otherwise no further action.
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the number of times the error routines have been called.
Synopsis
Prototype
ajint ajMessGetCountError (
void
);
Type | Name | Read/Write | Description |
ajint | | RETURN | Error function call count. |
Returns
ajint: | Error function call count. |
Description
Returns the number of times the error routines have been called.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats an error message. Calls the error function (if any).
Otherwise prints the message to standard error with a trailing newline.
The error message count is incremented by 1 for each call.
Synopsis
Prototype
void ajErr (
const char* format,
...
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format |
... | vararg | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format |
: | (Vararg) | Variable length argument list |
Returns
Description
Formats an error message. Calls the error function (if any).
Otherwise prints the message to standard error with a trailing newline.
The error message count is incremented by 1 for each call.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats an error message. Calls the error function (if any).
Otherwise prints the message to standard error with a trailing newline.
The error message count is incremented by 1 for each call.
Synopsis
Prototype
void ajVErr (
const char* format,
va_list args
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format |
va_list | args | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format |
args: | (Vararg) | Variable length argument list |
Returns
Description
Formats an error message. Calls the error function (if any).
Otherwise prints the message to standard error with a trailing newline.
The error message count is incremented by 1 for each call.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats an error message. Calls the error function (if any).
Otherwise prints the message to standard error with a trailing newline.
Then kills the application.
The error message count is incremented by 1 for each call.
Synopsis
Prototype
void ajDie (
const char* format,
...
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format |
... | vararg | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format |
: | (Vararg) | Variable length argument list |
Returns
Description
Formats an error message. Calls the error function (if any).
Otherwise prints the message to standard error with a trailing newline.
Then kills the application.
The error message count is incremented by 1 for each call.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats an error message. Calls the error function (if any).
Otherwise prints the message to standard error with a trailing newline.
Then kills the application.
The error message count is incremented by 1 for each call.
Synopsis
Prototype
void ajVDie (
const char* format,
va_list args
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format |
va_list | args | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format |
args: | (Vararg) | Variable length argument list |
Returns
Description
Formats an error message. Calls the error function (if any).
Otherwise prints the message to standard error with a trailing newline.
Then kills the application.
The error message count is incremented by 1 for each call.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats a warning message. Calls the warning function (if any).
Otherwise prints the message to standard error with a trailing newline.
Synopsis
Prototype
void ajWarn (
const char* format,
...
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format |
... | vararg | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format |
: | (Vararg) | Variable length argument list |
Returns
Description
Formats a warning message. Calls the warning function (if any).
Otherwise prints the message to standard error with a trailing newline.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats a warning message. Calls the warning function (if any).
Otherwise prints the message to standard error with a trailing newline.
Synopsis
Prototype
void ajVWarn (
const char* format,
va_list args
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format |
va_list | args | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format |
args: | (Vararg) | Variable length argument list |
Returns
Description
Formats a warning message. Calls the warning function (if any).
Otherwise prints the message to standard error with a trailing newline.
See Also
See other functions in this section
Availability
In release 6.4.0
Formats an exit message and calls the exit function (if any).
Otherwise prints the message to standard error with a trailing newline
and exist with code EXIT_FAILURE.
Use this function for errors that while being unrecoverable are not a
problem with the AJAX code.
Note that there errors are logged but that this routine will exit without
any chance to interrupt it (see the crash routine in ajMessCrashFL), this
could be changed to allow the application to register an exit handler.
Synopsis
Prototype
void ajMessExitmsg (
const char* format,
...
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format |
... | vararg | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format |
: | (Vararg) | Variable length argument list |
Returns
Description
Formats an exit message and calls the exit function (if any).
Otherwise prints the message to standard error with a trailing newline
and exist with code EXIT_FAILURE.
Use this function for errors that while being unrecoverable are not a
problem with the AJAX code.
Note that there errors are logged but that this routine will exit without
any chance to interrupt it (see the crash routine in ajMessCrashFL), this
could be changed to allow the application to register an exit handler.
See Also
See other functions in this section
Availability
In release 6.4.0
This is the routine called by the ajFatal macro and others.
This routine may encounter errors itself, in which case it will attempt
to call itself to report the error. To avoid infinite recursion we limit
this to just one reporting of an internal error and then we abort.
Synopsis
Prototype
void ajMessCrashFL (
const char* format,
...
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format |
... | vararg | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format |
: | (Vararg) | Variable length argument list |
Returns
Description
This is the routine called by the ajFatal macro and others.
This routine may encounter errors itself, in which case it will attempt
to call itself to report the error. To avoid infinite recursion we limit
this to just one reporting of an internal error and then we abort.
See Also
See other functions in this section
Availability
In release 6.4.0
This is the routine called by the ajVFatal macro and others.
This routine may encounter errors itself, in which case it will attempt
to call itself to report the error. To avoid infinite recursion we limit
this to just one reporting of an internal error and then we abort.
Synopsis
Prototype
void ajMessVCrashFL (
const char* format,
va_list args
);
Type | Name | Read/Write | Description |
const char* | format | Input | Format |
va_list | args | Vararg | Variable length argument list |
void | | RETURN | |
Input
format: | (Input) | Format |
args: | (Vararg) | Variable length argument list |
Returns
Description
This is the routine called by the ajVFatal macro and others.
This routine may encounter errors itself, in which case it will attempt
to call itself to report the error. To avoid infinite recursion we limit
this to just one reporting of an internal error and then we abort.
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the current message text.
Synopsis
Prototype
const char* ajMessGetMessageC (
void
);
Type | Name | Read/Write | Description |
const char* | | RETURN | Message text |
Returns
Description
Returns the current message text.
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the system message text from 'strerror' from the standard C
library.
Synopsis
Prototype
const char* ajMessGetSysmessageC (
void
);
Type | Name | Read/Write | Description |
const char* | | RETURN | System error message. |
Returns
const char*: | System error message. |
Description
Returns the system message text from 'strerror' from the standard C
library.
See Also
See other functions in this section
Availability
In release 6.4.0
Initialises the stored program name.
Synopsis
Prototype
void ajMessErrorInit (
const char* progname
);
Type | Name | Read/Write | Description |
const char* | progname | Input | Program name. |
void | | RETURN | |
Input
progname: | (Input) | Program name. |
Returns
Description
Initialises the stored program name.
See Also
See other functions in this section
Availability
In release 6.4.0
Stores the source file name (converted to a base name)
and the source line number to be
reported by the crash routines.
Invoked automatically by a macro (e.g. ajFatal) where needed.
Synopsis
Prototype
void ajMessSetErr (
const char* filename,
ajint line_num
);
Type | Name | Read/Write | Description |
const char* | filename | Input | source filename, __FILE__ |
ajint | line_num | Input | source line number, __LINE__ |
void | | RETURN | |
Input
filename: | (Input) | source filename, __FILE__ |
line_num: | (Input) | source line number, __LINE__ |
Returns
Description
Stores the source file name (converted to a base name)
and the source line number to be
reported by the crash routines.
Invoked automatically by a macro (e.g. ajFatal) where needed.
See Also
See other functions in this section
Availability
In release 6.4.0
Opens a file and sets this to be the error file.
Synopsis
Prototype
AjBool ajMessErrorSetFile (
const char* errfile
);
Type | Name | Read/Write | Description |
const char* | errfile | Input | Error file name |
AjBool | | RETURN | ajTrue on success |
Input
errfile: | (Input) | Error file name |
Returns
Description
Opens a file and sets this to be the error file.
See Also
See other functions in this section
Availability
In release 6.4.0
Writes an output message for a given message code.
Synopsis
Prototype
void ajMessOutCode (
const char* code
);
Type | Name | Read/Write | Description |
const char* | code | Input | Message code |
void | | RETURN | |
Input
Returns
Description
Writes an output message for a given message code.
See Also
See other functions in this section
Availability
In release 6.4.0
Writes an error message for a given message code.
Synopsis
Prototype
void ajMessErrorCode (
const char* code
);
Type | Name | Read/Write | Description |
const char* | code | Input | Error code |
void | | RETURN | |
Input
Returns
Description
Writes an error message for a given message code.
See Also
See other functions in this section
Availability
In release 6.4.0
Writes an error message for a given message code and crashes.
Synopsis
Prototype
void ajMessCrashCodeFL (
const char* code
);
Type | Name | Read/Write | Description |
const char* | code | Input | Error code |
void | | RETURN | |
Input
Returns
Description
Writes an error message for a given message code and crashes.
See Also
See other functions in this section
Availability
In release 6.4.0
Deletes the message codes table.
Synopsis
Prototype
void ajMessCodesDelete (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Deletes the message codes table.
See Also
See other functions in this section
Availability
In release 6.4.0
Writes a debug message to the debug file if debugging is on.
Typically, debugging is turned on by adding '-debug' to the command line
or by defining a variable prefix_DEBUG
Avoid using this call in any code which can be invoked before the command
line processing is complete as it can be a problem to find a reasonable
file name for debug output under these circumstances.
Synopsis
Prototype
void ajDebug (
const char* fmt,
...
);
Type | Name | Read/Write | Description |
const char* | fmt | Input | Format. |
... | vararg | Vararg | Variable argument list. |
void | | RETURN | |
Input
fmt: | (Input) | Format. |
: | (Vararg) | Variable argument list. |
Returns
Description
Writes a debug message to the debug file if debugging is on.
Typically, debugging is turned on by adding '-debug' to the command line
or by defining a variable prefix_DEBUG
Avoid using this call in any code which can be invoked before the command
line processing is complete as it can be a problem to find a reasonable
file name for debug output under these circumstances.
See Also
See other functions in this section
Availability
In release 6.4.0
Test whether debugging is on.
Synopsis
Prototype
AjBool ajDebugOn (
void
);
Type | Name | Read/Write | Description |
AjBool | | RETURN | True if user has enabled debugging |
Returns
AjBool: | True if user has enabled debugging |
Description
Test whether debugging is on.
See Also
See other functions in this section
Availability
In release 6.4.0
Tests a token string and returns true if the user has requested debug output
Synopsis
Prototype
AjBool ajDebugTest (
const char* token
);
Type | Name | Read/Write | Description |
const char* | token | Input | Token name |
AjBool | | RETURN | True if token has debugging requested |
Input
Returns
AjBool: | True if token has debugging requested |
Description
Tests a token string and returns true if the user has requested debug output
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the file used for debug output, or NULL if no debug file is open.
Synopsis
Prototype
FILE* ajMessGetDebugfile (
void
);
Type | Name | Read/Write | Description |
FILE* | | RETURN | C runtime library file handle for debug output. |
Returns
FILE*: | C runtime library file handle for debug output. |
Description
Returns the file used for debug output, or NULL if no debug file is open.
See Also
See other functions in this section
Availability
In release 6.4.0
Writes a prompt to the terminal and reads one line from the user.
Synopsis
Prototype
ajint ajUserGet (
AjPStr* pthis,
const char* fmt,
...
);
Type | Name | Read/Write | Description |
AjPStr* | pthis | Output | Buffer for the user response. |
const char* | fmt | Input | Format string |
... | vararg | Vararg | Variable argument list. |
ajint | | RETURN | Length of response string. |
Input
fmt: | (Input) | Format string |
: | (Vararg) | Variable argument list. |
Output
pthis: | (Output) | Buffer for the user response. |
Returns
ajint: | Length of response string. |
Description
Writes a prompt to the terminal and reads one line from the user.
See Also
See other functions in this section
Availability
In release 6.4.0
Delete any static initialised values
Synopsis
Prototype
void ajMessExit (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Delete any static initialised values
See Also
See other functions in this section
Availability
In release 6.4.0
Delete any static initialised values for ajDebug calls
Synopsis
Prototype
void ajMessExitDebug (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Delete any static initialised values for ajDebug calls
See Also
See other functions in this section
Availability
In release 6.4.0