2022-02-18 17:27:51 -05:00
|
|
|
/*********************/
|
|
|
|
/* errmsg.h */
|
|
|
|
/* for Par 3.20 */
|
|
|
|
/* Copyright 1993 by */
|
|
|
|
/* Adam M. Costello */
|
|
|
|
/*********************/
|
|
|
|
|
2022-03-04 12:15:43 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
/**
|
|
|
|
* @brief Set an error indication, with a specified error message.
|
|
|
|
* @param msg Pointer to the error message. The string passed by the caller
|
|
|
|
* will be copied.
|
|
|
|
*/
|
|
|
|
void set_error(char *msg);
|
2022-02-18 17:27:51 -05:00
|
|
|
|
2022-03-04 12:15:43 -05:00
|
|
|
/**
|
|
|
|
* @brief Test whether there is currently an error indication.
|
|
|
|
* @return 1 if an error indication currently exists, 0 otherwise.
|
|
|
|
*/
|
|
|
|
int is_error();
|
2022-02-18 17:27:51 -05:00
|
|
|
|
2022-03-04 12:15:43 -05:00
|
|
|
/**
|
|
|
|
* @brief Issue any existing error message to the specified output stream.
|
|
|
|
* @param file Stream to which the error message is to be issued.
|
|
|
|
* @return 0 if either there was no existing error message, or else there
|
|
|
|
* was an existing error message and it was successfully output.
|
|
|
|
* Return non-zero if the attempt to output an existing error message
|
|
|
|
* failed.
|
|
|
|
*/
|
|
|
|
int report_error(FILE *file);
|
2022-02-18 17:27:51 -05:00
|
|
|
|
2022-03-04 12:15:43 -05:00
|
|
|
/**
|
|
|
|
* Clear any existing error indication and free storage occupied by
|
|
|
|
* any existing error message.
|
|
|
|
*/
|
|
|
|
void clear_error();
|
|
|
|
static char * outofmem;
|