-
/*
- * Copyright (c) 2005, Herv� Drolon, FreeImage Team
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
-
#ifndef __EVENT_H
#define __EVENT_H
/**
The functions in EVENT.C have for goal to send output messages (errors, warnings, debug) to the user.
*/
-#define EVT_ERROR 1 /**< Error event type */
-#define EVT_WARNING 2 /**< Warning event type */
-#define EVT_INFO 4 /**< Debug event type */
+#define EVT_ERROR 1 /**< Error event type */
+#define EVT_WARNING 2 /**< Warning event type */
+#define EVT_INFO 4 /**< Debug event type */
/** @defgroup EVENT EVENT - Implementation of a event callback system */
/*@{*/
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 optionnal arguments)
+@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
*/
-bool opg_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...);
+opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...);
+
/* ----------------------------------------------------------------------- */
/*@}*/
+/**
+ * Write formatted data to a string and send the string to a user callback.
+ *
+ * @param event_mgr Event handler
+ * @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
+ */
+opj_bool opj_event_msg_v2(opj_event_mgr_t* event_mgr, int event_type, const char *fmt, ...);
+
+/**
+ * Default callback function. No message sent to output.
+ */
+void opj_default_callback (const char *msg, void *client_data);
+
+/**
+ * Default info callback function, message is sent to the stdout output.
+ */
+void opj_info_default_callback (const char *msg, void *client_data);
+
+/**
+ * Default warning callback function, message is sent to stderr output.
+ */
+void opj_warning_default_callback (const char *msg, void *client_data);
+
+/**
+ * Default error callback function, message is sent to stderr output.
+ */
+void opj_error_default_callback (const char *msg, void *client_data);
+
+
/*@}*/
-#endif /* __EVENT_H */
\ No newline at end of file
+#endif /* __EVENT_H */