| @@ -125,27 +125,27 @@ typedef struct pgp_error { | | | @@ -125,27 +125,27 @@ typedef struct pgp_error { |
125 | int sys_errno; /* irrelevent unless errcode == | | 125 | int sys_errno; /* irrelevent unless errcode == |
126 | * PGP_E_SYSTEM_ERROR */ | | 126 | * PGP_E_SYSTEM_ERROR */ |
127 | char *comment; | | 127 | char *comment; |
128 | const char *file; | | 128 | const char *file; |
129 | int line; | | 129 | int line; |
130 | struct pgp_error *next; | | 130 | struct pgp_error *next; |
131 | } pgp_error_t; | | 131 | } pgp_error_t; |
132 | | | 132 | |
133 | const char *pgp_errcode(const pgp_errcode_t); | | 133 | const char *pgp_errcode(const pgp_errcode_t); |
134 | | | 134 | |
135 | void | | 135 | void |
136 | pgp_push_error(pgp_error_t **, pgp_errcode_t, | | 136 | pgp_push_error(pgp_error_t **, pgp_errcode_t, |
137 | int, | | 137 | int, |
138 | const char *, int, const char *,...); | | 138 | const char *, int, const char *,...) __printflike(6, 7); |
139 | void pgp_print_error(pgp_error_t *); | | 139 | void pgp_print_error(pgp_error_t *); |
140 | void pgp_print_errors(pgp_error_t *); | | 140 | void pgp_print_errors(pgp_error_t *); |
141 | void pgp_free_errors(pgp_error_t *); | | 141 | void pgp_free_errors(pgp_error_t *); |
142 | int pgp_has_error(pgp_error_t *, pgp_errcode_t); | | 142 | int pgp_has_error(pgp_error_t *, pgp_errcode_t); |
143 | | | 143 | |
144 | #define PGP_SYSTEM_ERROR_1(err,code,sys,fmt,arg) do { \ | | 144 | #define PGP_SYSTEM_ERROR_1(err,code,sys,fmt,arg) do { \ |
145 | pgp_push_error(err,PGP_E_SYSTEM_ERROR,errno,__FILE__,__LINE__,sys);\ | | 145 | pgp_push_error(err,PGP_E_SYSTEM_ERROR,errno,__FILE__,__LINE__,sys);\ |
146 | pgp_push_error(err,code,0,__FILE__,__LINE__,fmt,arg); \ | | 146 | pgp_push_error(err,code,0,__FILE__,__LINE__,fmt,arg); \ |
147 | } while(/*CONSTCOND*/0) | | 147 | } while(/*CONSTCOND*/0) |
148 | | | 148 | |
149 | #define PGP_MEMORY_ERROR(err) { \ | | 149 | #define PGP_MEMORY_ERROR(err) { \ |
150 | fprintf(stderr, "Memory error\n"); \ | | 150 | fprintf(stderr, "Memory error\n"); \ |
151 | } /* \todo placeholder for better error | | 151 | } /* \todo placeholder for better error |