Changeset 5202:a6267bfa61b1 in roaraudio
- Timestamp:
- 10/23/11 20:01:40 (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/config.h
r5183 r5202 63 63 ROAR_LIBROAR_CONFIG_OPMODE_NORMAL = 0, 64 64 #define ROAR_LIBROAR_CONFIG_OPMODE_NORMAL ROAR_LIBROAR_CONFIG_OPMODE_NORMAL 65 ROAR_LIBROAR_CONFIG_OPMODE_FUNNY = 1 65 ROAR_LIBROAR_CONFIG_OPMODE_FUNNY = 1, 66 66 #define ROAR_LIBROAR_CONFIG_OPMODE_FUNNY ROAR_LIBROAR_CONFIG_OPMODE_FUNNY 67 ROAR_LIBROAR_CONFIG_OPMODE_MS = 2, 68 #define ROAR_LIBROAR_CONFIG_OPMODE_MS ROAR_LIBROAR_CONFIG_OPMODE_MS 67 69 }; 68 70 -
libroar/config.c
r5201 r5202 257 257 } else if ( !strcmp(v, "funny") ) { 258 258 config->opmode = ROAR_LIBROAR_CONFIG_OPMODE_FUNNY; 259 } else if ( !strcmp(v, "ms") ) { 260 config->opmode = ROAR_LIBROAR_CONFIG_OPMODE_MS; 259 261 } else { 260 262 ROAR_WARN("roar_libroar_config_parse(*): Unknown opmode: %s", v); -
libroar/error.c
r5184 r5202 911 911 912 912 // phi@ph7:roaraudio $ grep '^#define ROAR_ERROR_' error.h | tr -d /\* | while read d c d t; do printf " {%-23s \"%s\"},\n" $c, "$t"; done 913 914 static const char * roar_error2str_ms(const int error, const char * msg) { 915 static char buf[1024] = ""; 916 int num[8]; 917 int i; 918 int _ra_err = roar_error; 919 int _sys_err = errno; 920 921 for (i = 0; i < (sizeof(num)/sizeof(*num)); i++) 922 num[i] = roar_random_uint32(); 923 924 snprintf(buf, sizeof(buf), "\e[44;39;1m\e[2J\e[H" 925 " RoarAudio\n" 926 "\n\n" 927 "Fatal error %.4x: %s\n" 928 "RA Error: %.4i, Sys Error: %.4i (%s)\n" 929 "Random numbers:\n" 930 " A: 0x%.8X B: 0x%.8X\n" 931 " C: 0x%.8X D: 0x%.8X\n" 932 " E: 0x%.8X F: 0x%.8X\n" 933 " G: 0x%.8X H: 0x%.8X\n" 934 "\n\n" 935 "\e[0m", 936 error, msg, 937 _ra_err, _sys_err, strerror(_sys_err), 938 num[0], num[1], num[2], num[3], num[4], num[5], num[6], num[7]); 939 940 return buf; 941 } 913 942 914 943 const char * roar_error2str(const int error) { … … 1099 1128 int i; 1100 1129 1130 if ( config->opmode == ROAR_LIBROAR_CONFIG_OPMODE_MS ) 1131 for (i = 0; msgs[i].msg != NULL; i++) 1132 if ( msgs[i].err == error ) 1133 return roar_error2str_ms(error, msgs[i].msg); 1134 1101 1135 if ( config->opmode == ROAR_LIBROAR_CONFIG_OPMODE_FUNNY ) 1102 1136 for (i = 0; msgs_funny[i].msg != NULL; i++) -
roarclients/roarcat.c
r5109 r5202 169 169 170 170 if ( roar_simple_connect(&con, server, name) == -1 ) { 171 fprintf(stderr, "Error: can not connect to server \n");171 fprintf(stderr, "Error: can not connect to server: %s\n", roar_error2str(roar_error)); 172 172 return 10; 173 173 }
Note: See TracChangeset
for help on using the changeset viewer.