29 #include <apr_errno.h>
30 #include <apr_pools.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 #define APR_WANT_STDIO
44 #define SVN_NO_ERROR 0
107 const char *message);
110 #define svn_error_create \
111 (svn_error__locate(__FILE__,__LINE__), (svn_error_create))
122 __attribute__ ((format(printf, 3, 4)));
125 #define svn_error_createf \
126 (svn_error__locate(__FILE__,__LINE__), (svn_error_createf))
140 __attribute__((format(printf, 2, 3)));
143 #define svn_error_wrap_apr \
144 (svn_error__locate(__FILE__,__LINE__), (svn_error_wrap_apr))
152 const char *new_msg);
155 #define svn_error_quick_wrap \
156 (svn_error__locate(__FILE__,__LINE__), (svn_error_quick_wrap))
274 #define SVN_ERR(expr) \
276 svn_error_t *svn_err__temp = (expr); \
278 return svn_err__temp; \
287 #define SVN_ERR_W(expr, wrap_msg) \
289 svn_error_t *svn_err__temp = (expr); \
291 return svn_error_quick_wrap(svn_err__temp, wrap_msg); \
300 #define SVN_INT_ERR(expr) \
302 svn_error_t *svn_err__temp = (expr); \
303 if (svn_err__temp) { \
304 svn_handle_error2(svn_err__temp, stderr, FALSE, "svn: "); \
305 svn_error_clear(svn_err__temp); \
306 return EXIT_FAILURE; } \
320 #define SVN_ERR_IS_LOCK_ERROR(err) \
321 (err->apr_err == SVN_ERR_FS_PATH_ALREADY_LOCKED || \
322 err->apr_err == SVN_ERR_FS_OUT_OF_DATE) \
330 #define SVN_ERR_IS_UNLOCK_ERROR(err) \
331 (err->apr_err == SVN_ERR_FS_PATH_NOT_LOCKED || \
332 err->apr_err == SVN_ERR_FS_BAD_LOCK_TOKEN || \
333 err->apr_err == SVN_ERR_FS_LOCK_OWNER_MISMATCH || \
334 err->apr_err == SVN_ERR_FS_NO_SUCH_LOCK || \
335 err->apr_err == SVN_ERR_RA_NOT_LOCKED || \
336 err->apr_err == SVN_ERR_FS_LOCK_EXPIRED)
352 #define SVN_ERR_MALFUNCTION() \
354 return svn_error__malfunction(TRUE, __FILE__, __LINE__, NULL); \
364 #define SVN_ERR_MALFUNCTION_NO_RETURN() \
366 svn_error__malfunction(FALSE, __FILE__, __LINE__, NULL); \
389 #define SVN_ERR_ASSERT(expr) \
392 SVN_ERR(svn_error__malfunction(TRUE, __FILE__, __LINE__, #expr)); \
402 #define SVN_ERR_ASSERT_NO_RETURN(expr) \
405 svn_error__malfunction(FALSE, __FILE__, __LINE__, #expr); \
451 typedef svn_error_t *(*svn_error_malfunction_handler_t)
void svn_error__locate(const char *file, long line)
Set the error location for debug mode.
svn_error_malfunction_handler_t svn_error_set_malfunction_handler(svn_error_malfunction_handler_t func)
Cause subsequent malfunctions to be handled by func.
svn_error_t * svn_error_raise_on_malfunction(svn_boolean_t can_return, const char *file, int line, const char *expr)
Handle a malfunction by returning an error object that describes it.
void svn_handle_error2(svn_error_t *error, FILE *stream, svn_boolean_t fatal, const char *prefix)
Very basic default error handler: print out error stack error to the stdio stream stream...
svn_error_t * svn_error_compose_create(svn_error_t *err1, svn_error_t *err2)
Compose two errors, returning the composition as a brand new error and consuming the original errors...
#define svn_error_createf
Wrapper macro to collect file and line information.
svn_error_t *(* svn_error_malfunction_handler_t)(svn_boolean_t can_return, const char *file, int line, const char *expr)
A type of function that handles an assertion failure or other internal malfunction detected within th...
svn_error_t * svn_error__malfunction(svn_boolean_t can_return, const char *file, int line, const char *expr)
A helper function for the macros that report malfunctions.
void svn_error_compose(svn_error_t *chain, svn_error_t *new_err)
Add new_err to the end of chain's chain of errors.
void svn_handle_warning2(FILE *stream, svn_error_t *error, const char *prefix)
Very basic default warning handler: print out the error error to the stdio stream stream...
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
void svn_handle_error(svn_error_t *error, FILE *stream, svn_boolean_t fatal)
Like svn_handle_error2() but with prefix set to "svn: ".
const char * svn_err_best_message(svn_error_t *err, char *buf, apr_size_t bufsize)
If err has a custom error message, return that, otherwise store the generic error string associated w...
#define svn_error_quick_wrap
Wrapper macro to collect file and line information.
#define svn_error_wrap_apr
Wrapper macro to collect file and line information.
void svn_error_clear(svn_error_t *error)
Free the memory used by error, as well as all ancestors and descendants of error. ...
svn_error_t * svn_error_root_cause(svn_error_t *err)
Return the root cause of err by finding the last error in its chain (e.g.
char * svn_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize)
Put an English description of statcode into buf and return buf, NULL-terminated.
int svn_boolean_t
YABT: Yet Another Boolean Type.
svn_error_t * svn_error_dup(svn_error_t *err)
Create a new error that is a deep copy of err and return it.
svn_error_t * svn_error_abort_on_malfunction(svn_boolean_t can_return, const char *file, int line, const char *expr)
Handle a malfunction by printing a message to stderr and aborting.
#define svn_error_create
Wrapper macro to collect file and line information.
void svn_handle_warning(FILE *stream, svn_error_t *error)
Like svn_handle_warning2() but with prefix set to "svn: ".