Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

KIntList.h File Reference

Linked list structures for few types. More...

#include "ktypes.h"

Data Structures

struct  _KTypeList
 Declares a list of KType elements (Not used). More...

Typedefs

typedef _KIntList KIntList
 Declaration of an integer list.
typedef _KUIntList KUIntList
 Declaration of an unsigned integer list.
typedef _KInt8List KInt8List
 Declaration of an 8 bits integer list.
typedef _KUInt8List KUInt8List
 Declaration of an unsigned 8 bits integer list.
typedef _KInt16List KInt16List
 Declaration of a 16 bits integer list.
typedef _KUInt16List KUInt16List
 Declaration of an unsigned 16 bits integer list.
typedef _KInt32List KInt32List
 Declaration of a 32 bits integer list.
typedef _KUInt32List KUInt32List
 Declaration of an unsigned 32 bits integer list.
typedef _KInt64List KInt64List
 Declaration of a 64 bits integer list.
typedef _KUInt64List KUInt64List
 Declaration of an unsigned 64 bits integer list.
typedef _KFloatList KFloatList
 Declaration of a float list.
typedef _KDoubleList KDoubleList
 Declaration of a double list.
typedef _KCharList KCharList
 Declaration of a char list.
typedef _KUCharList KUCharList
 Declaration of an unsigned char list.
typedef _KWCharList KWCharList
 Declaration of an unicode char list.
typedef _KBoolList KBoolList
 Declaration of a boolean list.
typedef _KTypeList KTypeList
 Declares a list of KType elements (Not used).
typedef KIntKFunc_KType_cmp )(KType, KType)
 Function type to compare two KType value.

Functions

KTypeListKTypeList_new ()
 Allocates a new element of the list.
KBool KTypeList_init (KTypeList *pList, const KType iValue, KTypeList *pNext)
 Initializes an element list.
KTypeListKTypeList_create (const KType iValue, KTypeList *pNext)
 Allocates and initialized a new element list.
KTypeListKTypeList_clone (KTypeList *pList)
 Clones a list.
void KTypeList_delete (KTypeList **ppList)
 Destroyed a list.
KTypeListKTypeList_append (KTypeList *pList, const KType iValue)
 Adds an element at the end of a list.
KTypeListKTypeList_remove_link (KTypeList *pList, KTypeList *pLink)
 Removes an element from a list.
KTypeListKTypeList_remove_data (KTypeList *pList, const KType iValue)
 Removes a value from a list.
KBool KTypeList_contains (KTypeList *pList, const KType iValue)
 Checks if a value is contained in a list.
KTypeListKTypeList_insert (KTypeList *pList, const KUInt32 iIdx, const KType iValue)
 Inserts a value in a list.
KUInt32 KTypeList_size (KTypeList *pList)
 Gets the size of the list.
KTypeListKTypeList_concat (KTypeList *pList1, KTypeList *pList2)
 Concatenates two lists.
KTypeListKTypeList_insert_order (KTypeList *pList, const KType iValue, KFunc_KType_cmp *fCompare)
 Inserts a value in a list with an order.
KTypeListKTypeList_remove_at (KTypeList *pList, const KUInt32 iIdx)
 Removes an element.
KType KTypeList_data_at (KTypeList *pList, const KUInt32 iIdx)
 Gets the value at an index.
KInt32 KTypeList_indexOf (KTypeList *pList, const KType iValue)
 Gets the index of a value.
KTypeListKTypeList_last (KTypeList *pList)
 Gets the last element of the list.


Detailed Description

Linked list structures for few types.

All declared lists in this file have the same functions. Its differencies are the suffix. A list of element of type KType is defined as the KTypeList type and its functions are defined as KTypeList_[function_name].

For this documentation, the only documented list is KTypeList. This not a real list, but all its function are identical to every others defined lists in this file.

To find functions of a specific list, replace the word KType by the type of your list. For example, if you use a list of 16 bits integer, the type of the list is KInt16List and all its functions begin with KInt16List_. (ex: KInt16List_append, KInt16List_delete, KInt16List_contains , ...)

Version:
KToolLib-1.0
Author:
Fabien Gallot
Date:
08/09/2009
Note:
Copyright © 2008-2010 iKlax Media SAS (www.iklaxmedia.com). All rights reserved.

Function Documentation

KTypeList* KTypeList_append KTypeList pList,
const KType  iValue
 

Adds an element at the end of a list.

Parameters:
pList a list (can be null)
iValue the KType value
Returns:
the new list

KTypeList* KTypeList_clone KTypeList pList  ) 
 

Clones a list.

All elements of the list are cloned. No pointer are identical between the first list and the cloned list

Parameters:
pList the list to clone
Returns:
a cloned list

KTypeList* KTypeList_concat KTypeList pList1,
KTypeList pList2
 

Concatenates two lists.

The lists are not cloned !

Parameters:
pList1 the first list
pList2 the second list
Returns:
the new list

KBool KTypeList_contains KTypeList pList,
const KType  iValue
 

Checks if a value is contained in a list.

Parameters:
pList a list
iValue a KType value
Returns:
ktrue if the value is in the list, otherwise kfalse

KTypeList* KTypeList_create const KType  iValue,
KTypeList pNext
 

Allocates and initialized a new element list.

Parameters:
iValue the KType value
pNext the next element (can be null)
Returns:
the new allocated element list

KType KTypeList_data_at KTypeList pList,
const KUInt32  iIdx
 

Gets the value at an index.

Parameters:
pList a list
iIdx the value index to return
Returns:
the value at the asked index

void KTypeList_delete KTypeList **  ppList  ) 
 

Destroyed a list.

Destroys all elements of the list.

Parameters:
ppList a reference to a list pointer

KInt32 KTypeList_indexOf KTypeList pList,
const KType  iValue
 

Gets the index of a value.

Returns the first value found in the list.

Parameters:
pList a list
iValue the value to found
Returns:
the index of the first found value

KBool KTypeList_init KTypeList pList,
const KType  iValue,
KTypeList pNext
 

Initializes an element list.

Parameters:
pList the element to initialized
iValue the KType value
pNext the next element (can be null)
Returns:
ktrue if successful otherwise kfalse

KTypeList* KTypeList_insert KTypeList pList,
const KUInt32  iIdx,
const KType  iValue
 

Inserts a value in a list.

Parameters:
pList a list
iIdx the index where the value must be inserted
iValue the KType value to insert
Returns:
the new list

KTypeList* KTypeList_insert_order KTypeList pList,
const KType  iValue,
KFunc_KType_cmp fCompare
 

Inserts a value in a list with an order.

Parameters:
pList a list
iValue the KType value to insert
fCompare a function to compare KType values
Returns:
the new list

KTypeList* KTypeList_last KTypeList pList  ) 
 

Gets the last element of the list.

Parameters:
pList a list
Returns:
the last element of the list

KTypeList* KTypeList_new  ) 
 

Allocates a new element of the list.

Returns:
an allocated element of the list

KTypeList* KTypeList_remove_at KTypeList pList,
const KUInt32  iIdx
 

Removes an element.

Only the element to removed is deleted. The next elements of the removed one, are stayed in the list.

Parameters:
pList a list
iIdx the index of the element to deleted
Returns:
the new list

KTypeList* KTypeList_remove_data KTypeList pList,
const KType  iValue
 

Removes a value from a list.

Only the first element the value is deleted. The next elements of the removed one, are stayed in the list.

Parameters:
pList a list
iValue the KType value to remove
Returns:
the new list

KTypeList* KTypeList_remove_link KTypeList pList,
KTypeList pLink
 

Removes an element from a list.

Only the element to removed is deleted. The next elements of the removed one, are stayed in the list.

Parameters:
pList a list
pLink the element to remove
Returns:
the new list

KUInt32 KTypeList_size KTypeList pList  ) 
 

Gets the size of the list.

Parameters:
pList a list
Returns:
the size of the list


Generated on Tue Mar 9 10:49:30 2010 for iKlax Tools Library (KToolLib) by doxygen 1.3.8