Encoder: avoid global buffer overflow on irreversible conversion when too many decomp...
[openjpeg.git] / src / lib / openjp2 / function_list.h
index ffb75a0f7bdfad7033def65f80f9812871accab5..81a3954a1630c6a079ac2b4778a892a23c1af186 100644 (file)
@@ -1,4 +1,9 @@
 /*
+ * The copyright in this software is being made available under the 2-clauses
+ * BSD License, included below. This software may be subject to other third
+ * party and contributor rights, including patent rights, and no such rights
+ * are granted under this license.
+ *
  * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
  * All rights reserved.
  *
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef __FUNCTION_LIST_H
-#define __FUNCTION_LIST_H
+#ifndef OPJ_FUNCTION_LIST_H
+#define OPJ_FUNCTION_LIST_H
 
-/** 
+/**
  * @file function_list.h
  * @brief Implementation of a list of procedures.
 
@@ -49,20 +54,19 @@ typedef void (*opj_procedure)(void);
 /**
  * A list of procedures.
 */
-typedef struct opj_procedure_list 
-{
-       /**
-        * The number of validation procedures.
-        */
-       OPJ_UINT32 m_nb_procedures;
-       /**
-        * The number of the array of validation procedures.
-        */
-       OPJ_UINT32 m_nb_max_procedures;
-       /**
-        * The array of procedures.
-        */
-       opj_procedure * m_procedures;
+typedef struct opj_procedure_list {
+    /**
+     * The number of validation procedures.
+     */
+    OPJ_UINT32 m_nb_procedures;
+    /**
+     * The number of the array of validation procedures.
+     */
+    OPJ_UINT32 m_nb_max_procedures;
+    /**
+     * The array of procedures.
+     */
+    opj_procedure * m_procedures;
 
 } opj_procedure_list_t;
 
@@ -71,7 +75,7 @@ typedef struct opj_procedure_list
 /**
  * Creates a validation list.
  *
- * @return     the newly created validation list.
+ * @return  the newly created validation list.
  */
 opj_procedure_list_t *  opj_procedure_list_create(void);
 
@@ -85,42 +89,46 @@ void  opj_procedure_list_destroy(opj_procedure_list_t * p_list);
 /**
  * Adds a new validation procedure.
  *
- * @param      p_validation_list the list of procedure to modify.
- * @param      p_procedure             the procedure to add.
+ * @param   p_validation_list the list of procedure to modify.
+ * @param   p_procedure     the procedure to add.
+ * @param   p_manager the user event manager.
  *
- * @return     OPJ_TRUE if the procedure could be added.
+ * @return  OPJ_TRUE if the procedure could be added.
  */
-OPJ_BOOL opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_list, opj_procedure p_procedure);
+OPJ_BOOL opj_procedure_list_add_procedure(opj_procedure_list_t *
+        p_validation_list, opj_procedure p_procedure, opj_event_mgr_t* p_manager);
 
 /**
  * Gets the number of validation procedures.
  *
- * @param      p_validation_list the list of procedure to modify.
+ * @param   p_validation_list the list of procedure to modify.
  *
  * @return the number of validation procedures.
  */
-OPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_validation_list);
+OPJ_UINT32 opj_procedure_list_get_nb_procedures(opj_procedure_list_t *
+        p_validation_list);
 
 /**
  * Gets the pointer on the first validation procedure. This function is similar to the C++
  * iterator class to iterate through all the procedures inside the validation list.
  * the caller does not take ownership of the pointer.
  *
- * @param      p_validation_list the list of procedure to get the first procedure from.
+ * @param   p_validation_list the list of procedure to get the first procedure from.
  *
- * @return     a pointer to the first procedure.
+ * @return  a pointer to the first procedure.
  */
-opj_procedure* opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_validation_list);
+opj_procedure* opj_procedure_list_get_first_procedure(opj_procedure_list_t *
+        p_validation_list);
 
 
 /**
  * Clears the list of validation procedures.
  *
- * @param      p_validation_list the list of procedure to clear.
+ * @param   p_validation_list the list of procedure to clear.
  *
  */
-void opj_procedure_list_clear (opj_procedure_list_t * p_validation_list);
+void opj_procedure_list_clear(opj_procedure_list_t * p_validation_list);
 /*@}*/
 
-#endif /* __FUNCTION_LIST_H */
+#endif /* OPJ_FUNCTION_LIST_H */