// Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker
// This file is part of the "Luxinia Engine".
// For conditions of distribution and use, see copyright notice in luxiniapublicsdk.txt
//
// <Author: Christoph Kubisch>

#ifndef __LUXCORE_ARRAYMISC_H__
#define __LUXCORE_ARRAYMISC_H__

#include <luxplatform/luxplatform.h>

#ifdef __cplusplus
extern "C"{
#endif

//////////////////////////////////////////////////////////////////////////
// Array operations

	// searches or appends value to list (count must be preset)
	// returns position in list, or
	// -1 if maxcnt is reached prior append
int lxArrayFindOrAdd8(uint8 *list, int *inoutCnt, uint8 value, int maxCnt);
int lxArrayFindOrAdd16(uint16 *list, int *inoutCnt, uint16 value, int maxCnt);
int lxArrayFindOrAdd32(uint32 *list, int *inoutCnt, uint32 value, int maxCnt);
int lxArrayFindOrAddFloat(float *list, int *inoutCnt, float value, int maxCnt);
int lxArrayFindOrAddPtr(void **list, int *inoutCnt, void *value, int maxCnt);

#ifdef __cplusplus
};  
#endif

#endif
