Helixis 1.0
Task Programming API
sources/internal_includes/list.h
Go to the documentation of this file.
00001 /*
00002 ** Copyright 2009-2011, helixis.org
00003 ** All rights reserved.
00004 **
00005 ** Redistribution and use in source and binary forms, with or without modification, are permitted provided
00006 ** that the following conditions are met:
00007 **
00008 ** Redistributions of source code must retain the above copyright notice, this list of conditions and the
00009 ** following disclaimer.
00010 **
00011 ** Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
00012 ** the following disclaimer in the documentation and/or other materials provided with the distribution.
00013 **
00014 ** Neither the name of the helixis.org nor the names of its contributors may be used to endorse or promote
00015 ** products derived from this software without specific prior written permission.
00016 **
00017 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
00018 ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00019 ** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
00020 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
00021 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00022 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00023 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00024 ** POSSIBILITY OF SUCH DAMAGE.
00025 */
00026 
00027 #ifndef __HLX_LIST_H__
00028 # define __HLX_LIST_H__
00029 
00030 #ifdef __cplusplus
00031 extern "C"      {
00032 #endif
00033 
00034 /*
00035 ** TYPES
00036 */
00037 typedef struct                _hlx_list_node
00038 {
00039         void*                     data;
00040         struct _hlx_list_node*    parent;
00041         struct _hlx_list_node*    next;
00042 }                             hlx_list_node;
00043 
00044 typedef struct
00045 {
00046         hlx_list_node*            first;
00047         hlx_list_node*            last;
00048         atom_t                    size;
00049 }                             hlx_list;
00050 
00051 /*
00052 ** FUNCTIONS
00053 */
00054 void             hlx_list_construct(hlx_list*);
00055 void             hlx_list_destruct(hlx_list*);
00056 hlx_list_node*   hlx_list_push_front(hlx_list*, void*);
00057 hlx_list_node*   hlx_list_push_back(hlx_list*, void*);
00058 hlx_list_node*   hlx_list_find(const hlx_list*, void*);
00059 hlx_list_node*   hlx_list_get(const hlx_list*, unsigned int);
00060 void             hlx_list_erase(hlx_list*, hlx_list_node*);
00061 void             hlx_list_clear(hlx_list*);
00062 void             hlx_list_clear_data(hlx_list*);
00063 unsigned int     hlx_list_empty(const hlx_list*);
00064 
00065 #ifdef __cplusplus
00066 }
00067 #endif
00068 
00069 #endif /* !__HLX_LIST_H__ */
00070 
00071 /*
00072 ** END OF FILE
00073 */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines