libnjb 2.2.7

njb_error.h
1#ifndef __NJB__ERROR__H
2#define __NJB__ERROR__H
3
4#include <stdio.h>
5#include "libnjb.h"
6
11#define EO_USBCTL 1
12#define EO_USBBLK 2
13#define EO_RDSHORT 3
14#define EO_NOMEM 4
15#define EO_BADDATA 5
16#define EO_EOM 6
17#define EO_BADSTATUS 7
18#define EO_BADNJBID 8
19#define EO_BADCOUNT 9
20#define EO_WRSHORT 10
21#define EO_NULLTMP 11
22#define EO_TOOBIG 12
23#define EO_CANTMOVE 13
24#define EO_TIMEOUT 14
25#define EO_ABORTED 15
26#define EO_EOF 16
27#define EO_DEVICE 17
28#define EO_INIT 18
29#define EO_TMPFILE 19
30#define EO_XFERDENIED 20
31#define EO_WRFILE 21
32#define EO_XFERERROR 22
33#define EO_SRCFILE 23
34#define EO_INVALID 24
35#define EO_AGAIN 25
36#define EO_BAD_NJB1_REPLACE 26
38
39#define MAX_ERRLEN 128
40#define MAX_ERRORS 16
41
42 typedef struct njb_error_stack_struct njb_error_stack_t;
46 struct njb_error_stack_struct {
47 int idx;
48 int count;
49 char **msg;
50};
51
52 void initialize_errorstack(njb_t *njb);
53 void destroy_errorstack(njb_t *njb);
54 void njb_error_add (njb_t *njb, const char *sub, int err);
55 void njb_error_add2 (njb_t *njb, const char *sub, const char *prefix, int err);
56 void njb_error_add3 (njb_t *njb, const char *sub, const char *prefix, const
57 char *suffix, int err);
58 void njb_error_add_string (njb_t *njb, const char *sub, const char* error);
59 void njb_error_clear (njb_t *njb);
60
61#define NJB_ERROR(a,b) njb_error_add(a,subroutinename,b)
62#define NJB_ERROR2(a,b,c) njb_error_add2(a,subroutinename,b,c)
63#define NJB_ERROR3(a,b,c,d) njb_error_add3(a,subroutinename,b,c,d)
64
65#endif
66
njb_t
struct njb_struct njb_t
Definition libnjb.h:168
libnjb.h
njb_error_stack_struct
Definition njb_error.h:46
njb_error_stack_struct::count
int count
Definition njb_error.h:48
njb_error_stack_struct::msg
char ** msg
Definition njb_error.h:49
njb_error_stack_struct::idx
int idx
Definition njb_error.h:47