summaryrefslogtreecommitdiff
path: root/toxrtp/toxrtp_error.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxrtp/toxrtp_error.h')
-rw-r--r--toxrtp/toxrtp_error.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/toxrtp/toxrtp_error.h b/toxrtp/toxrtp_error.h
new file mode 100644
index 00000000..0e017246
--- /dev/null
+++ b/toxrtp/toxrtp_error.h
@@ -0,0 +1,25 @@
1#ifndef _RTP_ERROR_
2#define _RTP_ERROR_
3
4#define PRINT_FORMAT "Error %d: %s at %s:%d\n"
5#define PRINT_ARGS( _errno ) _errno, t_rtperr(_errno), __FILE__, __LINE__
6
7
8const char* t_rtperr ( int _errno );
9void t_rtperr_register ( int _id, const char* _info );
10
11void t_invoke_error ( int _id );
12void t_rtperr_print ( const char* _val, ... );
13
14
15#ifdef _USE_ERRORS
16#define t_perror( _errno ) t_rtperr_print ( PRINT_FORMAT, PRINT_ARGS ( _errno ) )
17#else
18#define t_perror( _errno )do { } while(0)
19#endif /* _USE_ERRORS */
20
21#ifdef _STDIO_H
22#define t_errexit( _errno ) exit(-_errno)
23#endif /* _STDIO_H */
24
25#endif /* _RTP_ERROR_ */