summaryrefslogtreecommitdiff
path: root/toxrtp/toxrtp_error.h
blob: 0e017246e86c1f599c2a0f8620f39e9baf211a45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef _RTP_ERROR_
#define _RTP_ERROR_

#define PRINT_FORMAT "Error %d: %s at %s:%d\n"
#define PRINT_ARGS( _errno ) _errno, t_rtperr(_errno), __FILE__, __LINE__


const char* t_rtperr ( int _errno );
void        t_rtperr_register ( int _id, const char* _info );

void        t_invoke_error ( int _id );
void        t_rtperr_print ( const char* _val, ... );


#ifdef _USE_ERRORS
#define t_perror( _errno ) t_rtperr_print ( PRINT_FORMAT, PRINT_ARGS ( _errno ) )
#else
#define t_perror( _errno )do { } while(0)
#endif /* _USE_ERRORS */

#ifdef _STDIO_H
#define t_errexit( _errno ) exit(-_errno)
#endif /* _STDIO_H */

#endif /* _RTP_ERROR_ */