Coconut Framework  beta
Classes | Functions
CNListItem.h File Reference

Define CNListItem data structure. More...

#include "CNResource.h"

Go to the source code of this file.

Classes

struct  CNListItem
 Single linked list item. More...
 

Functions

static struct CNListItemCNAllocateListItem (void *data, struct CNResource *resource)
 Allocate CNListItem. More...
 
static void CNReleaseListItem (struct CNResource *resource, struct CNListItem *item)
 Release CNListItem object. More...
 
static struct CNListItemCNNextListItem (const struct CNListItem *src)
 Get next item of source list item. More...
 
static struct CNListItemCNPrevListItem (const struct CNListItem *src)
 Get previous item of source list item. More...
 
static void * CNDataOfListItem (const struct CNListItem *src)
 Get data of list item. More...
 

Detailed Description

Define CNListItem data structure.

Copyright
Copyright (C) 2012 Steel Wheels Project

Function Documentation

static struct CNListItem* CNAllocateListItem ( void *  data,
struct CNResource *  resource 
)
static

Allocate CNListItem.

Returns
Allocated item
Parameters
dataSource data pointed by the list item
resourceResource pool to allocate the list item
Warning
The member is NOT initialized in this function

References CNListItem::_nextItem, CNListItem::_prevItem, CNAllocateData(), and CNListItem::dataPtr.

Referenced by CNMakeEmptyList().

static void CNReleaseListItem ( struct CNResource *  resource,
struct CNListItem item 
)
inlinestatic

Release CNListItem object.

Parameters
resourceResource pool to store the item
itemDestination item to be released

References CNReleaseData().

static struct CNListItem* CNNextListItem ( const struct CNListItem src)
static

Get next item of source list item.

Returns
Next list item
Parameters
srcSource item

References CNListItem::_nextItem.

static struct CNListItem* CNPrevListItem ( const struct CNListItem src)
static

Get previous item of source list item.

Returns
Previous list item
Parameters
srcSource item

References CNListItem::_prevItem.

static void* CNDataOfListItem ( const struct CNListItem src)
inlinestatic

Get data of list item.

Returns
Pointer of the data
Parameters
srcSource list item

References CNListItem::dataPtr.