Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
error.c File Reference
#include "ykyh.h"
#include <stddef.h>
Include dependency graph for error.c:

Go to the source code of this file.

Classes

struct  err_t
 

Macros

#define ERR(name, desc)
 

Functions

const char * ykyh_strerror (ykyh_rc err)
 
const char * ykyh_strerror_name (ykyh_rc err)
 

Macro Definition Documentation

◆ ERR

#define ERR ( name,
desc )
Value:
{ name, #name, desc }
std::string name

Definition at line 21 of file error.c.

21#define ERR(name, desc) \
22 { name, #name, desc }

Function Documentation

◆ ykyh_strerror()

const char * ykyh_strerror ( ykyh_rc err)

Definition at line 40 of file error.c.

40 {
41 static const char *unknown = "Unknown ykyh error";
42 const char *p;
43
44 if (-err < 0 || -err >= (int) (sizeof(errors) / sizeof(errors[0]))) {
45 return unknown;
46 }
47
48 p = errors[-err].description;
49 if (!p) {
50 p = unknown;
51 }
52
53 return p;
54}
const mie::Vuint & p
Definition bn.cpp:27
const char * description
Definition error.c:26
bool unknown
Here is the caller graph for this function:

◆ ykyh_strerror_name()

const char * ykyh_strerror_name ( ykyh_rc err)

Definition at line 56 of file error.c.

56 {
57 if (-err < 0 || -err >= (int) (sizeof(errors) / sizeof(errors[0]))) {
58 return NULL;
59 }
60
61 return errors[-err].name;
62}
const char * name
Definition error.c:26