Changeset 4871:fd43e266a063 in roaraudio
- Timestamp:
- 04/26/11 10:24:47 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/error.h
r4869 r4871 74 74 75 75 void roar_err_clear(void); 76 void roar_err_clear_errno(void); 77 void roar_err_clear_all(void); 78 void roar_err_update(void); 79 int roar_err_is_errno_clean(void); 76 80 void roar_err_set(const int error); 77 81 void roar_err_from_errno(void); -
libroar/error.c
r4870 r4871 36 36 #include "libroar.h" 37 37 38 // 'no error' value for errno. 39 // zero is true for GNU/Linux. 40 // don't know about other systems. 41 #define CLEAN_ERRNO 0 42 38 43 int roar_errno = ROAR_ERROR_NONE; 39 44 … … 109 114 } 110 115 116 void roar_err_clear_errno(void) { 117 errno = CLEAN_ERRNO; 118 } 119 120 void roar_err_clear_all(void) { 121 roar_err_clear(); 122 roar_err_clear_errno(); 123 } 124 125 void roar_err_update(void) { 126 int * err = roar_errno2(); 127 if ( *err != ROAR_ERROR_NONE ) { 128 roar_err_to_errno(); 129 } else if ( !roar_err_is_errno_clean() ) { 130 roar_err_from_errno(); 131 } 132 } 133 134 int roar_err_is_errno_clean(void) { 135 return errno == CLEAN_ERRNO ? 1 : 0; 136 } 137 111 138 void roar_err_set(const int error) { 112 139 *roar_errno2() = error; … … 228 255 switch (*err) { 229 256 case ROAR_ERROR_NONE: 230 errno = 0; // just gussing257 roar_err_clear_errno(); 231 258 break; 232 259 #ifdef EPERM
Note: See TracChangeset
for help on using the changeset viewer.