eapol/eapol_framework/eapol_common/include/eap_array_algorithms.h
changeset 0 c8830336c852
child 2 1c7bc153c08e
equal deleted inserted replaced
-1:000000000000 0:c8830336c852
       
     1 /*
       
     2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  EAP and WLAN authentication protocols.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #if !defined(_EAP_ARRAY_ALGORITHMS_H_)
       
    22 #define _EAP_ARRAY_ALGORITHMS_H_
       
    23 
       
    24 #include "eap_am_memory.h"
       
    25 #include "eap_am_export.h"
       
    26 #include "eap_tools.h"
       
    27 #include "eap_am_tools.h"
       
    28 #include "eap_array.h"
       
    29 
       
    30 /** @file */
       
    31 
       
    32 //--------------------------------------------------
       
    33 
       
    34 #if defined(_WIN32) && !defined(__GNUC__)
       
    35 	#pragma warning( disable : 4275 ) // ingnores non dll-interface class 'abs_eap_array_compare_c<class eap_fast_pac_store_data_c>' used as base for dll-interface class 'eap_fast_pac_store_data_compare_A_ID_reference_c'
       
    36 #endif
       
    37 
       
    38 template <class Type>
       
    39 class EAP_EXPORT abs_eap_array_compare_c
       
    40 {
       
    41 
       
    42 public:
       
    43 
       
    44 	virtual ~abs_eap_array_compare_c()
       
    45 	{
       
    46 	}
       
    47 
       
    48 	virtual i32_t compare(const Type * const original_object_from_array, const Type * const searched_data) const = 0;
       
    49 };
       
    50 
       
    51 
       
    52 //--------------------------------------------------
       
    53 //--------------------------------------------------
       
    54 //--------------------------------------------------
       
    55 
       
    56 /**
       
    57  * This template function copies class objects from original_array to copy_array. 
       
    58  * Type must have the following member functions:
       
    59  * Type * copy();
       
    60  * bool get_is_valid();
       
    61  * bool get_is_valid_data();
       
    62  */
       
    63 template <class Type>
       
    64 eap_status_e copy(
       
    65 	EAP_TEMPLATE_CONST eap_array_c<Type> * const original_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
    66 	eap_array_c<Type> * const copy_array,
       
    67 	abs_eap_am_tools_c * const m_am_tools,
       
    68 	const bool when_true_add_objects)
       
    69 {
       
    70 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    71 
       
    72 	eap_status_e status = eap_status_ok; // Note original_array may be empty, then for loop will not be run. 
       
    73 
       
    74 	if (when_true_add_objects == false)
       
    75 	{
       
    76 		copy_array->reset();
       
    77 	}
       
    78 
       
    79 	for (u32_t ind = 0; ind < original_array->get_object_count(); ind++)
       
    80 	{
       
    81 		Type * const orig_object = original_array->get_object(ind);
       
    82 		if (orig_object == 0
       
    83 			|| orig_object->get_is_valid() == false)
       
    84 		{
       
    85 			EAP_UNREFERENCED_PARAMETER(m_am_tools);
       
    86 			EAP_TRACE_DEBUG(
       
    87 				m_am_tools,
       
    88 				TRACE_FLAGS_DEFAULT,
       
    89 				(EAPL("copy: orig_object=0x%08x, orig_object->get_is_valid()=%d"),
       
    90 				 orig_object,
       
    91 				 (orig_object != 0) ? orig_object->get_is_valid(): false));
       
    92 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    93 			return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter);
       
    94 		}
       
    95 
       
    96 		Type * const copy_object = orig_object->copy();
       
    97 		if (copy_object == 0
       
    98 			|| copy_object->get_is_valid() == false)
       
    99 		{
       
   100 			delete copy_object;
       
   101 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   102 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   103 		}
       
   104 
       
   105 		// Note the original object might be empty without data.
       
   106 		if (orig_object->get_is_valid_data() == true
       
   107 			&& copy_object->get_is_valid_data() == false)
       
   108 		{
       
   109 			delete copy_object;
       
   110 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   111 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   112 		}
       
   113 
       
   114 		status = copy_array->add_object(copy_object, true);
       
   115 		if (status != eap_status_ok)
       
   116 		{
       
   117 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   118 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   119 		}
       
   120 	}
       
   121 
       
   122 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   123 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   124 }
       
   125 
       
   126 
       
   127 //--------------------------------------------------
       
   128 
       
   129 
       
   130 /**
       
   131  * This template function copies simple objects from original_array to copy_array. 
       
   132  * Simple types are u16_t, eap_status_e, ...
       
   133  */
       
   134 template <class Type>
       
   135 eap_status_e copy_simple(
       
   136 	EAP_TEMPLATE_CONST eap_array_c<Type> * const original_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   137 	eap_array_c<Type> * const copy_array,
       
   138 	abs_eap_am_tools_c * const m_am_tools,
       
   139 	const bool when_true_add_objects)
       
   140 {
       
   141 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   142 
       
   143 	eap_status_e status = eap_status_ok; // Note original_array may be empty, then for loop will not be run. 
       
   144 
       
   145 	if (when_true_add_objects == false)
       
   146 	{
       
   147 		copy_array->reset();
       
   148 	}
       
   149 
       
   150 	for (u32_t ind = 0; ind < original_array->get_object_count(); ind++)
       
   151 	{
       
   152 		Type * original_object = original_array->get_object(ind);
       
   153 		if (original_object == 0)
       
   154 		{
       
   155 			EAP_UNREFERENCED_PARAMETER(m_am_tools);
       
   156 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   157 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   158 		}
       
   159 
       
   160 		Type * copy_object = new Type;
       
   161 		if (copy_object == 0)
       
   162 		{
       
   163 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   164 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   165 		}
       
   166 
       
   167 		*copy_object = *original_object;
       
   168 
       
   169 		status = copy_array->add_object(copy_object, true);
       
   170 		if (status != eap_status_ok)
       
   171 		{
       
   172 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   173 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   174 		}
       
   175 	}
       
   176 
       
   177 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   178 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   179 }
       
   180 
       
   181 //--------------------------------------------------
       
   182 
       
   183 /**
       
   184  * This template function copies data of objects to a eap_variable_data_c object. 
       
   185  */
       
   186 template <class Type>
       
   187 eap_status_e add_data(
       
   188 	EAP_TEMPLATE_CONST eap_array_c<Type> * const source_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   189 	eap_variable_data_c * const buffer,
       
   190 	abs_eap_am_tools_c * const m_am_tools)
       
   191 {
       
   192 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   193 
       
   194 	eap_status_e status = eap_status_ok; // Note source_array may be empty, then for loop will not be run. 
       
   195 
       
   196 	for (u32_t ind = 0; ind < source_array->get_object_count(); ind++)
       
   197 	{
       
   198 		Type * original_object = source_array->get_object(ind);
       
   199 		if (original_object == 0)
       
   200 		{
       
   201 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   202 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   203 		}
       
   204 
       
   205 		status = buffer->add_data(
       
   206 			original_object->get_data(original_object->get_data_length()),
       
   207 			original_object->get_data_length());
       
   208 		if (status != eap_status_ok)
       
   209 		{
       
   210 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   211 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   212 		}
       
   213 
       
   214 		EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("data"),
       
   215 			original_object->get_data(original_object->get_data_length()),
       
   216 			original_object->get_data_length()));
       
   217 	}
       
   218 
       
   219 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   220 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   221 }
       
   222 
       
   223 //--------------------------------------------------
       
   224 
       
   225 /**
       
   226  * This template function copies simple data of objects to a eap_variable_data_c object. 
       
   227  */
       
   228 template <class Type>
       
   229 eap_status_e add_simple_data(
       
   230 	EAP_TEMPLATE_CONST eap_array_c<Type> * const source_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   231 	eap_variable_data_c * const buffer,
       
   232 	abs_eap_am_tools_c * const m_am_tools)
       
   233 {
       
   234 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   235 
       
   236 	eap_status_e status = eap_status_ok; // Note source_array may be empty, then for loop will not be run. 
       
   237 
       
   238 	for (u32_t ind = 0; ind < source_array->get_object_count(); ind++)
       
   239 	{
       
   240 		Type * original_object = source_array->get_object(ind);
       
   241 		if (original_object == 0)
       
   242 		{
       
   243 			EAP_UNREFERENCED_PARAMETER(m_am_tools);
       
   244 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   245 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   246 		}
       
   247 
       
   248 		status = buffer->add_data(
       
   249 			original_object,
       
   250 			sizeof(*original_object));
       
   251 		if (status != eap_status_ok)
       
   252 		{
       
   253 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   254 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   255 		}
       
   256 
       
   257 		EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("data"),
       
   258 			original_object,
       
   259 			sizeof(*original_object)));
       
   260 	}
       
   261 
       
   262 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   263 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   264 }
       
   265 
       
   266 //--------------------------------------------------
       
   267 
       
   268 /**
       
   269  * This template function searches the supplied array for given object.
       
   270  * Function returns the index to the found object or -1 if not found or there 
       
   271  * is some other error.
       
   272  * Type must have the following member functions:
       
   273  * i32_t compare(const Type * const data)
       
   274  */
       
   275 template <class Type>
       
   276 const i32_t find(
       
   277 	EAP_TEMPLATE_CONST eap_array_c<Type> * const original_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   278 	const Type * const searched_data,
       
   279 	abs_eap_am_tools_c * const m_am_tools)
       
   280 {
       
   281 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   282 	EAP_UNREFERENCED_PARAMETER(m_am_tools);
       
   283 
       
   284 	i32_t index = -1;
       
   285 	for (u32_t ind = 0; ind < original_array->get_object_count(); ind++)
       
   286 	{
       
   287 		Type * original_object = original_array->get_object(ind);
       
   288 		if (original_object == 0)
       
   289 		{			
       
   290 			index = -1;
       
   291 			break;
       
   292 		}
       
   293 		if (!original_object->compare(const_cast<Type *> (searched_data)))
       
   294 		{
       
   295 			// Found it
       
   296 			index = ind;
       
   297 			break;
       
   298 		}
       
   299 	}
       
   300 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   301 	return index;
       
   302 }
       
   303 
       
   304 //--------------------------------------------------
       
   305 
       
   306 /**
       
   307  * This template function searches the supplied array for given object starting from the last index.
       
   308  * Function returns the index to the found object or -1 if not found or there 
       
   309  * is some other error.
       
   310  * Type must have the following member functions:
       
   311  * i32_t compare(const Type * const data)
       
   312  */
       
   313 template <class Type>
       
   314 const i32_t find_next(
       
   315 	const i32_t last_index,
       
   316 	EAP_TEMPLATE_CONST eap_array_c<Type> * const original_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   317 	const Type * const searched_data,
       
   318 	abs_eap_am_tools_c * const m_am_tools)
       
   319 {
       
   320 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   321 	EAP_UNREFERENCED_PARAMETER(m_am_tools);
       
   322 
       
   323 	i32_t index = -1;
       
   324 	for (u32_t ind = last_index+1; ind < original_array->get_object_count(); ind++)
       
   325 	{
       
   326 		Type * original_object = original_array->get_object(ind);
       
   327 		if (original_object == 0)
       
   328 		{			
       
   329 			index = -1;
       
   330 			break;
       
   331 		}
       
   332 		if (!original_object->compare(const_cast<Type *> (searched_data)))
       
   333 		{
       
   334 			// Found it
       
   335 			index = ind;
       
   336 			break;
       
   337 		}
       
   338 	}
       
   339 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   340 	return index;
       
   341 }
       
   342 
       
   343 //--------------------------------------------------
       
   344 
       
   345 /**
       
   346  * This template function searches the supplied array for given object.
       
   347  * Function returns the index to the found object or -1 if not found or there 
       
   348  * is some other error.
       
   349  * Type must have the following member functions:
       
   350  * i32_t compare(const Type * const data)
       
   351  */
       
   352 template <class Type>
       
   353 const i32_t find_with_compare(
       
   354 	const abs_eap_array_compare_c<Type> * const compare,
       
   355 	EAP_TEMPLATE_CONST eap_array_c<Type> * const original_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   356 	const Type * const searched_data,
       
   357 	abs_eap_am_tools_c * const m_am_tools)
       
   358 {
       
   359 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   360 	EAP_UNREFERENCED_PARAMETER(m_am_tools);
       
   361 
       
   362 	i32_t index = -1;
       
   363 	for (u32_t ind = 0; ind < original_array->get_object_count(); ind++)
       
   364 	{
       
   365 		Type * original_object = original_array->get_object(ind);
       
   366 		if (original_object == 0)
       
   367 		{			
       
   368 			index = -1;
       
   369 			break;
       
   370 		}
       
   371 
       
   372 		if (!compare->compare(original_object, searched_data))
       
   373 		{
       
   374 			// Found it
       
   375 			index = ind;
       
   376 			break;
       
   377 		}
       
   378 	}
       
   379 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   380 	return index;
       
   381 }
       
   382 
       
   383 //--------------------------------------------------
       
   384 
       
   385 /**
       
   386  * This template function searches the supplied array for given object starting from the last index.
       
   387  * Function returns the index to the found object or -1 if not found or there 
       
   388  * is some other error.
       
   389  * Type must have the following member functions:
       
   390  * i32_t compare(const Type * const data)
       
   391  */
       
   392 template <class Type>
       
   393 const i32_t find_next_with_compare(
       
   394 	const i32_t last_index,
       
   395 	const abs_eap_array_compare_c<Type> * const compare,
       
   396 	EAP_TEMPLATE_CONST eap_array_c<Type> * const original_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   397 	const Type * const searched_data,
       
   398 	abs_eap_am_tools_c * const m_am_tools)
       
   399 {
       
   400 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   401 	EAP_UNREFERENCED_PARAMETER(m_am_tools);
       
   402 
       
   403 	i32_t index = -1;
       
   404 	for (u32_t ind = last_index+1; ind < original_array->get_object_count(); ind++)
       
   405 	{
       
   406 		Type * original_object = original_array->get_object(ind);
       
   407 		if (original_object == 0)
       
   408 		{			
       
   409 			index = -1;
       
   410 			break;
       
   411 		}
       
   412 
       
   413 		if (!compare->compare(original_object, searched_data))
       
   414 		{
       
   415 			// Found it
       
   416 			index = ind;
       
   417 			break;
       
   418 		}
       
   419 	}
       
   420 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   421 	return index;
       
   422 }
       
   423 
       
   424 //--------------------------------------------------
       
   425 
       
   426 /**
       
   427  * This template function searches the supplied array for given simple type object.
       
   428  * Simple types are u16_t, eap_status_e, ...
       
   429  * It returns the index to the found object or -1 if not found or there 
       
   430  * is some other error.
       
   431  */
       
   432 template <class Type>
       
   433 const i32_t find_simple(
       
   434 	EAP_TEMPLATE_CONST eap_array_c<Type> * const original_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   435 	const Type * const searched_data,
       
   436 	abs_eap_am_tools_c * const m_am_tools)
       
   437 {
       
   438 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   439 	EAP_UNREFERENCED_PARAMETER(m_am_tools);
       
   440 
       
   441 	i32_t index = -1;
       
   442 	for (u32_t ind = 0; ind < original_array->get_object_count(); ind++)
       
   443 	{
       
   444 		Type * original_object = original_array->get_object(ind);
       
   445 		if (original_object == 0)
       
   446 		{			
       
   447 			index = -1;
       
   448 			break;
       
   449 		}
       
   450 		if (*original_object == *searched_data)
       
   451 		{
       
   452 			// Found it
       
   453 			index = ind;
       
   454 			break;
       
   455 		}
       
   456 		
       
   457 	}
       
   458 
       
   459 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   460 	return index;
       
   461 }
       
   462 
       
   463 //--------------------------------------------------
       
   464 
       
   465 /**
       
   466  * This template function searches the supplied array for given simple type object.
       
   467  * Simple types are u16_t, eap_status_e, ...
       
   468  * It returns the index to the found object or -1 if not found or there 
       
   469  * is some other error.
       
   470  */
       
   471 template <class Type>
       
   472 const i32_t find_next_simple(
       
   473 	const i32_t last_index,
       
   474 	EAP_TEMPLATE_CONST eap_array_c<Type> * const original_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   475 	const Type * const searched_data,
       
   476 	abs_eap_am_tools_c * const m_am_tools)
       
   477 {
       
   478 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   479 	EAP_UNREFERENCED_PARAMETER(m_am_tools);
       
   480 
       
   481 	i32_t index = -1;
       
   482 	for (u32_t ind = last_index+1; ind < original_array->get_object_count(); ind++)
       
   483 	{
       
   484 		Type * original_object = original_array->get_object(ind);
       
   485 		if (original_object == 0)
       
   486 		{			
       
   487 			index = -1;
       
   488 			break;
       
   489 		}
       
   490 		if (*original_object == *searched_data)
       
   491 		{
       
   492 			// Found it
       
   493 			index = ind;
       
   494 			break;
       
   495 		}
       
   496 		
       
   497 	}
       
   498 
       
   499 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   500 	return index;
       
   501 }
       
   502 
       
   503 //--------------------------------------------------
       
   504 
       
   505 /**
       
   506  * Template function for_each() runs supplied function to all type objects of the supplied array.
       
   507  */
       
   508 template <class Type>
       
   509 eap_status_e for_each(
       
   510 	EAP_TEMPLATE_CONST eap_array_c<Type> * const original_array, ///< Stupid Windows compiler cannot compile "const eap_array_c<Type> * const".
       
   511 	eap_status_e (*function)(
       
   512 		Type * const value,
       
   513 		abs_eap_am_tools_c * const m_am_tools),
       
   514 	abs_eap_am_tools_c * const m_am_tools,
       
   515 	const bool do_not_care_errors)
       
   516 {
       
   517 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   518 
       
   519 	eap_status_e status = eap_status_ok; // Note original_array may be empty, then for loop will not be run. 
       
   520 
       
   521 	EAP_TRACE_DEBUG(
       
   522 		m_am_tools, 
       
   523 		TRACE_FLAGS_DEFAULT, 
       
   524 		(EAPL("for_each(): function=0x%08x.\n"),
       
   525 		 function));
       
   526 
       
   527 
       
   528 	for (u32_t ind = 0; ind < original_array->get_object_count(); ind++)
       
   529 	{
       
   530 		Type * original_object = original_array->get_object(ind);
       
   531 
       
   532 		EAP_TRACE_DEBUG(
       
   533 			m_am_tools, 
       
   534 			TRACE_FLAGS_DEFAULT, 
       
   535 			(EAPL("for_each(): object=0x%08x, ")
       
   536 			 EAPL("function=0x%08x.\n"),
       
   537 			 original_object,
       
   538 			 function));
       
   539 
       
   540 		if (do_not_care_errors == false
       
   541 			&& original_object == 0)
       
   542 		{
       
   543 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   544 			return EAP_STATUS_RETURN(m_am_tools, eap_status_process_general_error);
       
   545 		}
       
   546 		else if (original_object != 0)
       
   547 		{
       
   548 			status = function(original_object, m_am_tools);
       
   549 
       
   550 			if (do_not_care_errors == false
       
   551 				&& status != eap_status_ok)
       
   552 			{
       
   553 				EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   554 				return EAP_STATUS_RETURN(m_am_tools, status);
       
   555 			}
       
   556 		}
       
   557 	}
       
   558 
       
   559 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   560 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   561 }
       
   562 
       
   563 //--------------------------------------------------
       
   564 
       
   565 #endif //#if !defined(_EAP_ARRAY_ALGORITHMS_H_)
       
   566 
       
   567 
       
   568 //--------------------------------------------------
       
   569 
       
   570 
       
   571 
       
   572 // End.