Adding errormanager to toolkit api

This commit is contained in:
Michael Tryby
2018-07-13 11:47:47 -04:00
parent c8803a9f1b
commit 4723336726
7 changed files with 246 additions and 28 deletions

30
src/util/errormanager.h Normal file
View File

@@ -0,0 +1,30 @@
/*
* errormanager.h
*
* Created on: Aug 25, 2017
*
* Author: Michael E. Tryby
* US EPA - ORD/NRMRL
*/
#ifndef ERRORMANAGER_H_
#define ERRORMANAGER_H_
#include <stdlib.h>
#include <string.h>
#define ERR_MAXMSG 256
typedef struct error_s {
int error_status;
void (*p_msg_lookup)(int, char*, int);
} error_handle_t;
error_handle_t* new_errormanager(void (*p_error_message)(int, char*, int));
void dst_errormanager(error_handle_t* error_handle);
int set_error(error_handle_t* error_handle, int errorcode);
char* check_error(error_handle_t* error_handle);
void clear_error(error_handle_t* error_handle);
#endif /* ERRORMANAGER_H_ */