libCATS
Loading...
Searching...
No Matches
include
cats
error.h
Go to the documentation of this file.
1
6
#ifndef CATS_ERROR_H
7
#define CATS_ERROR_H
8
9
#define CATS_FAIL 0
10
#define CATS_SUCCESS 1
11
12
// Maybe find a better way to do this? Feels wrong.
13
//#define throw(err) do { cats_throw_err(err, #err " " (__FILE__ + SOURCE_PATH_SIZE) __LINE__); return CATS_FAIL; } while(0)
14
#define throw(err) do { cats_throw_err(err, #err); return CATS_FAIL; } while(0)
15
#define throw_msg(err, msg) do { cats_throw_err(err, #err " " msg); return CATS_FAIL; } while(0)
16
22
typedef
enum
{
23
MALLOC_FAIL,
24
UNSUPPORTED_WHISKER,
25
DECODE_FAIL,
26
PACKET_TOO_BIG,
27
INVALID_OR_NO_CALLSIGN,
28
INVALID_OR_NO_COMMENT,
29
LDPC_DECODE_FAIL,
30
INVALID_CRC,
31
WHISKER_NOT_FOUND,
32
EMPTY_PACKET,
33
MAX_WHISKERS_OF_TYPE_EXCEEDED
34
}
cats_error_t
;
35
39
extern
cats_error_t
cats_error
;
40
44
extern
char
cats_error_str
[255];
45
49
void
cats_throw_err
(
cats_error_t
error,
const
char
* msg);
50
51
#endif
// CATS_ERROR_H
cats_error_t
cats_error_t
Error codes for libCATS.
Definition
error.h:22
cats_error
cats_error_t cats_error
The most recent error thrown by libCATS.
Definition
error.c:6
cats_error_str
char cats_error_str[255]
Error string for the most recent error thrown by libCATS.
Definition
error.c:7
cats_throw_err
void cats_throw_err(cats_error_t error, const char *msg)
Do NOT use this function directly, use throw() instead.
Definition
error.c:9
Generated on Thu May 16 2024 for libCATS by
1.10.0