From 3250833a6214475b4ed564ef35b3fa09b6ff9716 Mon Sep 17 00:00:00 2001 From: Mickael Savinaud Date: Thu, 25 Oct 2012 13:46:40 +0000 Subject: [PATCH] [trunk]remove old opj_event_mgr function --- src/lib/openjp2/event.c | 45 ----------------------------------------- src/lib/openjp2/event.h | 10 +-------- 2 files changed, 1 insertion(+), 54 deletions(-) diff --git a/src/lib/openjp2/event.c b/src/lib/openjp2/event.c index fa505619..a7a52039 100644 --- a/src/lib/openjp2/event.c +++ b/src/lib/openjp2/event.c @@ -69,52 +69,7 @@ _itoa(int i, char *a, int r) { static void opj_default_callback (const char *msg, void *client_data){} /* ----------------------------------------------------------------------- */ -opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...) { -#define MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */ - opj_msg_callback msg_handler = NULL; - opj_event_mgr_t *event_mgr = cinfo->event_mgr; - if(event_mgr != NULL) { - switch(event_type) { - case EVT_ERROR: - msg_handler = event_mgr->error_handler; - break; - case EVT_WARNING: - msg_handler = event_mgr->warning_handler; - break; - case EVT_INFO: - msg_handler = event_mgr->info_handler; - break; - default: - break; - } - if(msg_handler == NULL) { - return OPJ_FALSE; - } - } else { - return OPJ_FALSE; - } - - if ((fmt != NULL) && (event_mgr != NULL)) { - va_list arg; - size_t str_length/*, i, j*/; /* UniPG */ - char message[MSG_SIZE]; - memset(message, 0, MSG_SIZE); - /* initialize the optional parameter list */ - va_start(arg, fmt); - /* check the length of the format string */ - str_length = (strlen(fmt) > MSG_SIZE) ? MSG_SIZE : strlen(fmt); - /* parse the format string and put the result in 'message' */ - vsprintf(message, fmt, arg); /* UniPG */ - /* deinitialize the optional parameter list */ - va_end(arg); - - /* output the message to the user program */ - msg_handler(message, cinfo->client_data); - } - - return OPJ_TRUE; -} /* ----------------------------------------------------------------------- */ opj_bool opj_event_msg_v2(opj_event_mgr_t* p_event_mgr, int event_type, const char *fmt, ...) { diff --git a/src/lib/openjp2/event.h b/src/lib/openjp2/event.h index 111cea9f..9489084b 100644 --- a/src/lib/openjp2/event.h +++ b/src/lib/openjp2/event.h @@ -68,15 +68,7 @@ typedef struct opj_event_mgr /** @name Exported functions (see also openjpeg.h) */ /*@{*/ /* ----------------------------------------------------------------------- */ -/** -Write formatted data to a string and send the string to a user callback. -@param cinfo Codec context info -@param event_type Event type or callback to use to send the message -@param fmt Format-control string (plus optional arguments) -@return Returns true if successful, returns false otherwise -* FIXME Change by its v2 version this function after ended the merge -*/ -opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...); + /* ----------------------------------------------------------------------- */