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-2018 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 
00019 /*
00020  * GDSL - Generic Data Structures Library
00021  * $RCSfile: _gdsl_node.h,v $
00022  * $Revision: 1.23 $
00023  * $Date: 2015/02/17 12:22:56 $
00024  */
00025 
00026 
00027 #ifndef __GDSL_NODE_H_
00028 #define __GDSL_NODE_H_
00029 
00030 
00031 #include <stdio.h>
00032 
00033 
00034 #include "gdsl_types.h"
00035 
00036 
00037 #ifdef __cplusplus
00038 extern "C" 
00039 {
00040 #endif /* __cplusplus */
00041 
00054 typedef struct _gdsl_node* _gdsl_node_t;
00055 
00063 typedef int (* _gdsl_node_map_func_t) (const _gdsl_node_t NODE,
00064                        void* USER_DATA
00065                        );
00066 
00073 typedef void (* _gdsl_node_write_func_t) (const _gdsl_node_t NODE,
00074                       FILE* OUTPUT_FILE,
00075                       void* USER_DATA
00076                       );
00077 
00078 /******************************************************************************/
00079 /* Management functions of low-level doubly linked nodes                      */
00080 /******************************************************************************/
00081 
00093 extern _gdsl_node_t
00094 _gdsl_node_alloc (void);
00095 
00106 extern gdsl_element_t
00107 _gdsl_node_free (_gdsl_node_t NODE
00108          );
00109 
00110 /******************************************************************************/
00111 /* Consultation functions of low-level doubly linked nodes                    */
00112 /******************************************************************************/
00113 
00125 extern _gdsl_node_t
00126 _gdsl_node_get_succ (const _gdsl_node_t NODE
00127              );
00128 
00140 extern _gdsl_node_t
00141 _gdsl_node_get_pred (const _gdsl_node_t NODE
00142              );
00143 
00153 extern gdsl_element_t
00154 _gdsl_node_get_content (const _gdsl_node_t NODE
00155             );
00156 
00157 /******************************************************************************/
00158 /* Modification functions of low-level doubly linked nodes                    */
00159 /******************************************************************************/
00160 
00172 extern void
00173 _gdsl_node_set_succ (_gdsl_node_t NODE,
00174              const _gdsl_node_t SUCC
00175              );
00176 
00188 extern void
00189 _gdsl_node_set_pred (_gdsl_node_t NODE,
00190              const _gdsl_node_t PRED
00191              );
00192 
00204 extern void
00205 _gdsl_node_set_content (_gdsl_node_t NODE,
00206             const gdsl_element_t CONTENT
00207             );
00208 
00221 extern void
00222 _gdsl_node_link (_gdsl_node_t NODE1,
00223          _gdsl_node_t NODE2
00224          );
00225 
00238 extern void
00239 _gdsl_node_unlink (_gdsl_node_t NODE1,
00240            _gdsl_node_t NODE2
00241            );
00242 
00243 /******************************************************************************/
00244 /* Input/output functions of low-level doubly linked nodes                    */
00245 /******************************************************************************/
00246 
00262 extern void
00263 _gdsl_node_write (const _gdsl_node_t NODE,
00264           const _gdsl_node_write_func_t WRITE_F,
00265           FILE* OUTPUT_FILE,
00266           void* USER_DATA
00267           );
00268 
00285 extern void
00286 _gdsl_node_write_xml (const _gdsl_node_t NODE,
00287               const _gdsl_node_write_func_t WRITE_F,
00288               FILE* OUTPUT_FILE,
00289               void* USER_DATA
00290               );
00291 
00308 extern void
00309 _gdsl_node_dump (const _gdsl_node_t NODE,
00310          const _gdsl_node_write_func_t WRITE_F,
00311          FILE* OUTPUT_FILE,
00312          void* USER_DATA
00313          );
00314 
00315 
00321 #ifdef __cplusplus
00322 }
00323 #endif /* __cplusplus */
00324 
00325 
00326 #endif /* __GDSL_NODE_H_ */
00327 
00328