gdsl  1.8
_gdsl_node.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of the Generic Data Structures Library (GDSL).
00003  * Copyright (C) 1998-2017 Nicolas Darnis <ndarnis@free.fr>.
00004  *
00005  * GDSL is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation, either version 3 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * GDSL is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with GDSL.  If not, see <http://www.gnu.org/licenses/>. 
00017  *
00018  * $RCSfile: _gdsl_node.h,v $
00019  * $Revision: 1.23 $
00020  * $Date: 2015/02/17 12:22:56 $
00021  */
00022 
00023 
00024 #ifndef __GDSL_NODE_H_
00025 #define __GDSL_NODE_H_
00026 
00027 
00028 #include <stdio.h>
00029 
00030 
00031 #include "gdsl_types.h"
00032 
00033 
00034 #ifdef __cplusplus
00035 extern "C" 
00036 {
00037 #endif /* __cplusplus */
00038 
00069 typedef struct _gdsl_node* _gdsl_node_t;
00070 
00078 typedef int (* _gdsl_node_map_func_t) (const _gdsl_node_t NODE,
00079                        void* USER_DATA
00080                        );
00081 
00088 typedef void (* _gdsl_node_write_func_t) (const _gdsl_node_t NODE,
00089                       FILE* OUTPUT_FILE,
00090                       void* USER_DATA
00091                       );
00092 
00093 /******************************************************************************/
00094 /* Management functions of low-level doubly linked nodes                      */
00095 /******************************************************************************/
00096 
00108 extern _gdsl_node_t
00109 _gdsl_node_alloc (void);
00110 
00121 extern gdsl_element_t
00122 _gdsl_node_free (_gdsl_node_t NODE
00123          );
00124 
00125 /******************************************************************************/
00126 /* Consultation functions of low-level doubly linked nodes                    */
00127 /******************************************************************************/
00128 
00140 extern _gdsl_node_t
00141 _gdsl_node_get_succ (const _gdsl_node_t NODE
00142              );
00143 
00155 extern _gdsl_node_t
00156 _gdsl_node_get_pred (const _gdsl_node_t NODE
00157              );
00158 
00168 extern gdsl_element_t
00169 _gdsl_node_get_content (const _gdsl_node_t NODE
00170             );
00171 
00172 /******************************************************************************/
00173 /* Modification functions of low-level doubly linked nodes                    */
00174 /******************************************************************************/
00175 
00187 extern void
00188 _gdsl_node_set_succ (_gdsl_node_t NODE,
00189              const _gdsl_node_t SUCC
00190              );
00191 
00203 extern void
00204 _gdsl_node_set_pred (_gdsl_node_t NODE,
00205              const _gdsl_node_t PRED
00206              );
00207 
00219 extern void
00220 _gdsl_node_set_content (_gdsl_node_t NODE,
00221             const gdsl_element_t CONTENT
00222             );
00223 
00236 extern void
00237 _gdsl_node_link (_gdsl_node_t NODE1,
00238          _gdsl_node_t NODE2
00239          );
00240 
00253 extern void
00254 _gdsl_node_unlink (_gdsl_node_t NODE1,
00255            _gdsl_node_t NODE2
00256            );
00257 
00258 /******************************************************************************/
00259 /* Input/output functions of low-level doubly linked nodes                    */
00260 /******************************************************************************/
00261 
00277 extern void
00278 _gdsl_node_write (const _gdsl_node_t NODE,
00279           const _gdsl_node_write_func_t WRITE_F,
00280           FILE* OUTPUT_FILE,
00281           void* USER_DATA
00282           );
00283 
00300 extern void
00301 _gdsl_node_write_xml (const _gdsl_node_t NODE,
00302               const _gdsl_node_write_func_t WRITE_F,
00303               FILE* OUTPUT_FILE,
00304               void* USER_DATA
00305               );
00306 
00323 extern void
00324 _gdsl_node_dump (const _gdsl_node_t NODE,
00325          const _gdsl_node_write_func_t WRITE_F,
00326          FILE* OUTPUT_FILE,
00327          void* USER_DATA
00328          );
00329 
00330 
00336 #ifdef __cplusplus
00337 }
00338 #endif /* __cplusplus */
00339 
00340 
00341 #endif /* __GDSL_NODE_H_ */
00342 
00343