00001 /* 00002 * The copyright in this software is being made available under the 2-clauses 00003 * BSD License, included below. This software may be subject to other third 00004 * party and contributor rights, including patent rights, and no such rights 00005 * are granted under this license. 00006 * 00007 * Copyright (c) 2005, Herve Drolon, FreeImage Team 00008 * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR 00009 * Copyright (c) 2012, CS Systemes d'Information, France 00010 * All rights reserved. 00011 * 00012 * Redistribution and use in source and binary forms, with or without 00013 * modification, are permitted provided that the following conditions 00014 * are met: 00015 * 1. Redistributions of source code must retain the above copyright 00016 * notice, this list of conditions and the following disclaimer. 00017 * 2. Redistributions in binary form must reproduce the above copyright 00018 * notice, this list of conditions and the following disclaimer in the 00019 * documentation and/or other materials provided with the distribution. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' 00022 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00023 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00024 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00025 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00026 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00027 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00028 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00029 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00030 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00031 * POSSIBILITY OF SUCH DAMAGE. 00032 */ 00033 #ifndef __EVENT_H 00034 #define __EVENT_H 00035 00050 typedef struct opj_event_mgr 00051 { 00053 void * m_error_data; 00055 void * m_warning_data; 00057 void * m_info_data; 00059 opj_msg_callback error_handler; 00061 opj_msg_callback warning_handler; 00063 opj_msg_callback info_handler; 00064 } opj_event_mgr_t; 00065 00066 00067 #define EVT_ERROR 1 00068 #define EVT_WARNING 2 00069 #define EVT_INFO 4 00073 00074 00076 /* ----------------------------------------------------------------------- */ 00077 00078 00079 /* ----------------------------------------------------------------------- */ 00080 00090 OPJ_BOOL opj_event_msg(opj_event_mgr_t* event_mgr, OPJ_INT32 event_type, const char *fmt, ...); 00091 /* ----------------------------------------------------------------------- */ 00092 00096 void opj_set_default_event_handler(opj_event_mgr_t * p_manager); 00097 00098 /* 00099 #ifdef __GNUC__ 00100 #pragma GCC poison printf fprintf 00101 #endif 00102 */ 00103 00107 00108 #endif /* __EVENT_H */