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 
00039 
00051 typedef struct _gdsl_node* _gdsl_node_t;
00052 
00060 typedef int (* _gdsl_node_map_func_t) (const _gdsl_node_t NODE,
00061                        void* USER_DATA
00062                        );
00063 
00070 typedef void (* _gdsl_node_write_func_t) (const _gdsl_node_t NODE,
00071                       FILE* OUTPUT_FILE,
00072                       void* USER_DATA
00073                       );
00074 
00075 /******************************************************************************/
00076 /* Management functions of low-level doubly linked nodes                      */
00077 /******************************************************************************/
00078 
00090 extern _gdsl_node_t
00091 _gdsl_node_alloc (void);
00092 
00103 extern gdsl_element_t
00104 _gdsl_node_free (_gdsl_node_t NODE
00105          );
00106 
00107 /******************************************************************************/
00108 /* Consultation functions of low-level doubly linked nodes                    */
00109 /******************************************************************************/
00110 
00122 extern _gdsl_node_t
00123 _gdsl_node_get_succ (const _gdsl_node_t NODE
00124              );
00125 
00137 extern _gdsl_node_t
00138 _gdsl_node_get_pred (const _gdsl_node_t NODE
00139              );
00140 
00150 extern gdsl_element_t
00151 _gdsl_node_get_content (const _gdsl_node_t NODE
00152             );
00153 
00154 /******************************************************************************/
00155 /* Modification functions of low-level doubly linked nodes                    */
00156 /******************************************************************************/
00157 
00169 extern void
00170 _gdsl_node_set_succ (_gdsl_node_t NODE,
00171              const _gdsl_node_t SUCC
00172              );
00173 
00185 extern void
00186 _gdsl_node_set_pred (_gdsl_node_t NODE,
00187              const _gdsl_node_t PRED
00188              );
00189 
00201 extern void
00202 _gdsl_node_set_content (_gdsl_node_t NODE,
00203             const gdsl_element_t CONTENT
00204             );
00205 
00218 extern void
00219 _gdsl_node_link (_gdsl_node_t NODE1,
00220          _gdsl_node_t NODE2
00221          );
00222 
00235 extern void
00236 _gdsl_node_unlink (_gdsl_node_t NODE1,
00237            _gdsl_node_t NODE2
00238            );
00239 
00240 /******************************************************************************/
00241 /* Input/output functions of low-level doubly linked nodes                    */
00242 /******************************************************************************/
00243 
00259 extern void
00260 _gdsl_node_write (const _gdsl_node_t NODE,
00261           const _gdsl_node_write_func_t WRITE_F,
00262           FILE* OUTPUT_FILE,
00263           void* USER_DATA
00264           );
00265 
00282 extern void
00283 _gdsl_node_write_xml (const _gdsl_node_t NODE,
00284               const _gdsl_node_write_func_t WRITE_F,
00285               FILE* OUTPUT_FILE,
00286               void* USER_DATA
00287               );
00288 
00305 extern void
00306 _gdsl_node_dump (const _gdsl_node_t NODE,
00307          const _gdsl_node_write_func_t WRITE_F,
00308          FILE* OUTPUT_FILE,
00309          void* USER_DATA
00310          );
00311 
00312 
00313 /*
00314  * @}
00315  */
00316 
00317 
00318 #ifdef __cplusplus
00319 }
00320 #endif /* __cplusplus */
00321 
00322 
00323 #endif /* __GDSL_NODE_H_ */
00324 
00325