diff options
-rw-r--r-- | src/xine-utils/xine_check.c | 97 | ||||
-rw-r--r-- | src/xine-utils/xine_check.h | 3 |
2 files changed, 50 insertions, 50 deletions
diff --git a/src/xine-utils/xine_check.c b/src/xine-utils/xine_check.c index ed0911b64..867bdb1d0 100644 --- a/src/xine-utils/xine_check.c +++ b/src/xine-utils/xine_check.c @@ -94,6 +94,56 @@ xine_health_check_t* xine_health_check (xine_health_check_t* hc, int check_num) return hc; } +static void set_hc_result(xine_health_check_t* hc, int state, char *format, ...) { + + va_list args; + char *buf = NULL; + int n, size; + + if (!hc) { + printf("%s() GASP, hc is NULL\n", __XINE_FUNCTION__); + abort(); + } + + if (!format) { + printf("%s() GASP, format is NULL\n", __XINE_FUNCTION__); + abort(); + } + + size = strlen(format) + 1; + + if((buf = malloc(size)) == NULL) { + printf("%s() GASP, malloc() failed\n", __XINE_FUNCTION__); + abort(); + } + + while(1) { + va_start(args, format); + n = vsnprintf(buf, size, format, args); + va_end(args); + + if(n > -1 && n < size) { + break; + } + + if(n > -1) { + size = n + 1; + } + else { + size *= 2; + } + + if((buf = realloc(buf, size)) == NULL) { + printf("%s() GASP, realloc() failed\n", __XINE_FUNCTION__); + abort(); + } + } + + hc->msg = buf; + hc->status = state; +} + + xine_health_check_t* xine_health_check_kernel (xine_health_check_t* hc) { struct utsname kernel; @@ -361,51 +411,4 @@ xine_health_check_t* xine_health_check (xine_health_check_t* hc, int check_num) } #endif /* !__linux__ */ -static void set_hc_result(xine_health_check_t* hc, int state, char *format, ...) { - - va_list args; - char *buf = NULL; - int n, size; - - if (!hc) { - printf("%s() GASP, hc is NULL\n", __XINE_FUNCTION__); - abort(); - } - - if (!format) { - printf("%s() GASP, format is NULL\n", __XINE_FUNCTION__); - abort(); - } - - size = strlen(format) + 1; - - if((buf = malloc(size)) == NULL) { - printf("%s() GASP, malloc() failed\n", __XINE_FUNCTION__); - abort(); - } - - while(1) { - va_start(args, format); - n = vsnprintf(buf, size, format, args); - va_end(args); - - if(n > -1 && n < size) { - break; - } - - if(n > -1) { - size = n + 1; - } - else { - size *= 2; - } - - if((buf = realloc(buf, size)) == NULL) { - printf("%s() GASP, realloc() failed\n", __XINE_FUNCTION__); - abort(); - } - } - hc->msg = buf; - hc->status = state; -} diff --git a/src/xine-utils/xine_check.h b/src/xine-utils/xine_check.h index 594e1bad4..64c72eef1 100644 --- a/src/xine-utils/xine_check.h +++ b/src/xine-utils/xine_check.h @@ -45,8 +45,5 @@ xine_health_check_t* xine_health_check_x(xine_health_check_t*); /* health_check Xv extension */ xine_health_check_t* xine_health_check_xv(xine_health_check_t*); -/* Format message string */ -/* Format must not be NULL */ -static void set_hc_result (xine_health_check_t* hc, int state, char *format, ...); #endif |