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

KCList.h File Reference

Linked list structure that contains constant values. More...

#include "ktypes.h"

Data Structures

struct  _KCList
 Linked list structure with constant elements. More...

Defines

#define KCList_new()   _KCList_new (__K_FILE__, __K_LINE__)
 Creates an empty list.
#define KCList_create(data, next)   _KCList_create (data, next, __K_FILE__, __K_LINE__)
 Creates a link and initializes it.
#define KCList_clone(list)   _KCList_clone (list, __K_FILE__, __K_LINE__)
 Clones a list.
#define KCList_append(klist, data)   _KCList_append (klist, data, __K_FILE__, __K_LINE__)
 Adds an element at the end of the list.

Typedefs

typedef _KCList KCList
 Linked list structure with constant elements.

Functions

KTL_API KCList_KCList_new (KString file, KInt32 line)
 Creates an empty list.
KTL_API KBool KCList_init (KCList *klist, KCPtr data, KCList *next)
 Initializes a link of the list.
KTL_API KCList_KCList_create (KCPtr data, KCList *next, KString file, KInt32 line)
 Creates a link and initializes it.
KTL_API KCList_KCList_clone (KCList *list, KString file, KInt32 line)
 Clones a list.
KTL_API void KCList_delete (KCList **klist)
 Deletes a list and all its elements.
KTL_API KCList_KCList_append (KCList *klist, KCPtr data, KString file, KInt32 line)
 Adds an element at the end of the list.
KTL_API KCListKCList_remove_link (KCList *klist, KCList *link)
 Removes a link of the list.
KTL_API KCListKCList_remove_data (KCList *klist, KCPtr data)
 Removes an element from the list.
KTL_API KBool KCList_contains (KCList *klist, KCPtr data)
 Searches of an element in a list.
KTL_API KCListKCList_insert (KCList *klist, KInt idx, KCPtr data)
 Inserts an element at a given position in a list.
KTL_API KUInt32 KCList_size (KCList *klist)
 Returns the number of element of a list.
KTL_API KCListKCList_concat (KCList *l1, KCList *l2)
 Concatenates two lists.
KTL_API void KCList_print_str (KCList *list)
 Writes to the standard output all the elements of a list (Used only for the string).
KTL_API KCListKCList_insert_order (KCList *list, KCPtr value, KFunc_cmp *cmp_func)
 Inserts an element to a list in ascending order regarding the comparison function.
KTL_API KCListKCList_remove_at (KCList *list, KInt n)
 Removes at a given position an element from a list.
KTL_API KCPtr KCList_data_at (KCList *list, KInt n)
 Removes at a given position an element from a list and returns it.


Detailed Description

Linked list structure that contains constant values.

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

Define Documentation

#define KCList_append klist,
data   )     _KCList_append (klist, data, __K_FILE__, __K_LINE__)
 

Adds an element at the end of the list.

Parameters:
klist the pointer to the list where element should be added
data the element to be added
Returns:
the pointer to the list with the element added if successful otherwise knull

#define KCList_clone list   )     _KCList_clone (list, __K_FILE__, __K_LINE__)
 

Clones a list.

Parameters:
list the pointer to the list to be cloned
Returns:
the cloned list if successful otherwise knull

#define KCList_create data,
next   )     _KCList_create (data, next, __K_FILE__, __K_LINE__)
 

Creates a link and initializes it.

Parameters:
data the data of the link
next the pointer to the next link of the list
Returns:
the list created if successful otherwise knull

 
#define KCList_new  )     _KCList_new (__K_FILE__, __K_LINE__)
 

Creates an empty list.

Returns:
the pointer to the created list if successful otherwise knull


Function Documentation

KTL_API KCList* _KCList_append KCList klist,
KCPtr  data,
KString  file,
KInt32  line
 

Adds an element at the end of the list.

Parameters:
klist the pointer to the list where element should be added
data the data of the added element
file the file name where this function is called
line the line number where this function is called
Returns:
the pointer to the list with the element added if successful otherwise knull

KTL_API KCList* _KCList_clone KCList list,
KString  file,
KInt32  line
 

Clones a list.

Parameters:
list the pointer to the list to be cloned
file the file name where this function is called
line the line number where this function is called
Returns:
the cloned list if successful otherwise knull

KTL_API KCList* _KCList_create KCPtr  data,
KCList next,
KString  file,
KInt32  line
 

Creates a link and initializes it.

Parameters:
data the data of the link
next the pointer to the next link of the list
file the file name where this function is called
line the line number where this function is called
Returns:
the list created if successful otherwise knull

KTL_API KCList* _KCList_new KString  file,
KInt32  line
 

Creates an empty list.

Parameters:
file the name of the file where this function is called
line the line number where this function is called
Returns:
the pointer to the created list if successful otherwise knull

KTL_API KCList* KCList_concat KCList l1,
KCList l2
 

Concatenates two lists.

Parameters:
l1 the pointer to the first list
l2 the pointer to the second list
Returns:
the pointer to the concatenated list

KTL_API KBool KCList_contains KCList klist,
KCPtr  data
 

Searches of an element in a list.

Parameters:
klist the pointer to the list where element should be searched
data the element to be searched
Returns:
ktrue if the element is found otherwise kfalse

KTL_API KCPtr KCList_data_at KCList list,
KInt  n
 

Removes at a given position an element from a list and returns it.

Parameters:
list the pointer to the list where element should be removed
n the position of the element to be removed
Returns:
the pointer to the removed element if successful otherwise knull

KTL_API void KCList_delete KCList **  klist  ) 
 

Deletes a list and all its elements.

Parameters:
klist the pointers to the list to be deleted

KTL_API KBool KCList_init KCList klist,
KCPtr  data,
KCList next
 

Initializes a link of the list.

Parameters:
klist the pointer to the list to be initialized
data the data of the first link
next the pointer to the next link of the list
Returns:
ktrue if successful otherwise kfalse

KTL_API KCList* KCList_insert KCList klist,
KInt  idx,
KCPtr  data
 

Inserts an element at a given position in a list.

Parameters:
klist the pointer to the list where element should be inserted
idx the position of the inserted element
data the element to be inserted
Returns:
the pointer to the list where element is inserted if successful otherwise knull

KTL_API KCList* KCList_insert_order KCList list,
KCPtr  value,
KFunc_cmp cmp_func
 

Inserts an element to a list in ascending order regarding the comparison function.

Parameters:
list the pointer to the list where element should be inserted
value the value used by the comparison function
cmp_func the pointer to the comparison function
Returns:
the pointer to the list where the element is inserted if successful otherwise knull

KTL_API void KCList_print_str KCList list  ) 
 

Writes to the standard output all the elements of a list (Used only for the string).

Parameters:
list the pointer to the list to be displayed

KTL_API KCList* KCList_remove_at KCList list,
KInt  n
 

Removes at a given position an element from a list.

Parameters:
list the pointer to the list where element should be removed
n the position of the element to be removed
Returns:
the pointer to the list where the element is removed if successful otherwise knull

KTL_API KCList* KCList_remove_data KCList klist,
KCPtr  data
 

Removes an element from the list.

Parameters:
klist the pointer to the list where element should be removed
data the element to be removed
Returns:
the pointer to the list where element is removed if successful otherwise knull

KTL_API KCList* KCList_remove_link KCList klist,
KCList link
 

Removes a link of the list.

Parameters:
klist the pointer to the list where link should be removed
link the link to be removed
Returns:
the pointer to the list where link is removed if successful otherwise knull

KTL_API KUInt32 KCList_size KCList klist  ) 
 

Returns the number of element of a list.

Parameters:
klist the pointer to the list
Returns:
the size of the list if successful otherwise 0


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