Add a utility header to convert error codes.
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
*/
|
||||
enum libab_result {
|
||||
LIBAB_SUCCESS,
|
||||
LIBAB_MALLOC
|
||||
LIBAB_MALLOC,
|
||||
LIBAB_BAD_PATTERN,
|
||||
LIBAB_FAILED_MATCH
|
||||
};
|
||||
|
||||
typedef enum libab_result libab_result;
|
||||
|
||||
21
include/libabacus_util.h
Normal file
21
include/libabacus_util.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef LIBABACUS_UTIL_H
|
||||
#define LIBABACUS_UTIL_H
|
||||
|
||||
#include "libds.h"
|
||||
#include "liblex.h"
|
||||
#include "libabacus.h"
|
||||
|
||||
/**
|
||||
* Converts a result code from liblex to libabacus.
|
||||
* @param to_convert the code to convert.
|
||||
* @return the libabacus equivalent of the error code.
|
||||
*/
|
||||
libab_result convert_lex_result(liblex_result to_convert);
|
||||
/**
|
||||
* Converts a result code from libds to libabacus.
|
||||
* @param to_convert the code to convert.
|
||||
* @return the libabacus equivalent of the error code.
|
||||
*/
|
||||
libab_result convert_ds_result(libds_result to_convert);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user