2024-04-18 00:54:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* libnode.h */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* This file is part of LibNode */
|
|
|
|
|
/* */
|
|
|
|
|
/* LibNode is free software: you can redistribute it and/or modify it */
|
|
|
|
|
/* under the terms of the GNU Lesser General Public License as published */
|
|
|
|
|
/* by the Free Software Foundation, either version 3 of the License, or */
|
|
|
|
|
/* (at your option) any later version. */
|
|
|
|
|
/* */
|
|
|
|
|
/* LibNode is distributed in the hope that it will be useful, */
|
|
|
|
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
|
|
|
|
/* GNU Lesser General Public License for more details. */
|
|
|
|
|
/* */
|
|
|
|
|
/* You should have received a copy of the GNU Lesser General Public */
|
2024-04-20 09:58:00 +02:00
|
|
|
|
/* License along with LibNode. If not, see */
|
2024-04-18 00:54:52 +02:00
|
|
|
|
/* <https://www.gnu.org/licenses/>. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Includes */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2001-11-26 11:17:44 +01:00
|
|
|
|
|
2000-07-18 16:51:56 +02:00
|
|
|
|
#include <stdlib.h>
|
2004-08-02 23:26:03 +02:00
|
|
|
|
#include <stdio.h>
|
2000-07-18 16:51:56 +02:00
|
|
|
|
#include <string.h>
|
2005-01-11 21:57:04 +01:00
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <signal.h>
|
|
|
|
|
#include <setjmp.h>
|
|
|
|
|
#include <dlfcn.h>
|
2004-08-02 23:26:03 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Utilisation des API de la LIBNODE sans v<>rification des arguments */
|
|
|
|
|
|
|
|
|
|
#define ND_MODE 1
|
2004-08-02 23:26:03 +02:00
|
|
|
|
|
2000-07-18 16:51:56 +02:00
|
|
|
|
#include <node.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-11-26 11:17:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-18 00:54:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Definitions */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#define LGD_MODULE_NAME "nd"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-11-26 11:17:44 +01:00
|
|
|
|
#ifdef __linux
|
|
|
|
|
# define NDD_PRINTF_PTR_PREFIX ""
|
|
|
|
|
#else
|
|
|
|
|
# define NDD_PRINTF_PTR_PREFIX "0x"
|
2000-07-18 16:51:56 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
2001-11-26 11:17:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-08-24 00:47:22 +02:00
|
|
|
|
#define NDD_HUGE_LONG ( long) 0xFFFFFFL
|
2001-11-26 11:17:44 +01:00
|
|
|
|
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Table des symboles locale */
|
|
|
|
|
|
2004-08-02 01:18:37 +02:00
|
|
|
|
struct NDT_Symbol;
|
|
|
|
|
|
|
|
|
|
typedef struct NDT_Symbol
|
|
|
|
|
{
|
|
|
|
|
void *Ptr;
|
|
|
|
|
char *Name;
|
|
|
|
|
struct NDT_Symbol *Next;
|
|
|
|
|
} NDT_Symbol;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* LibNode Global Base Structure */
|
|
|
|
|
|
|
|
|
|
typedef struct NDT_Base
|
|
|
|
|
{
|
|
|
|
|
int Open_Status;
|
|
|
|
|
int Debug_Mode;
|
|
|
|
|
char Err_String[512];
|
|
|
|
|
FILE *Err_Stream;
|
|
|
|
|
int Sig_Trapped;
|
2005-01-20 00:59:41 +01:00
|
|
|
|
#if !defined(_WIN32)
|
2004-08-02 23:26:03 +02:00
|
|
|
|
sigjmp_buf SigLongJmp_Env;
|
2004-08-24 00:47:22 +02:00
|
|
|
|
#else
|
|
|
|
|
jmp_buf SigLongJmp_Env;
|
|
|
|
|
#endif
|
2004-08-02 01:18:37 +02:00
|
|
|
|
NDT_Symbol *Symbol_First_Ptr;
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void *DL_Ptr;
|
2004-08-02 01:18:37 +02:00
|
|
|
|
NDT_Index_Type OpenStruct_Index_Type[1];
|
|
|
|
|
NDT_Root *OpenStruct_Ptr;
|
|
|
|
|
} NDT_Base;
|
|
|
|
|
|
|
|
|
|
NDT_Base NDG_Base =
|
|
|
|
|
{
|
|
|
|
|
NDD_FALSE,
|
|
|
|
|
NDD_TRUE,
|
|
|
|
|
"",
|
2004-08-24 00:47:22 +02:00
|
|
|
|
(FILE *) -1,
|
|
|
|
|
0,
|
|
|
|
|
{0},
|
|
|
|
|
(NDT_Symbol *) NULL,
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NULL,
|
2004-08-02 01:18:37 +02:00
|
|
|
|
{ NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO},
|
2004-08-24 00:47:22 +02:00
|
|
|
|
(NDT_Root *) NULL
|
2004-08-02 01:18:37 +02:00
|
|
|
|
};
|
|
|
|
|
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-05-24 17:16:12 +02:00
|
|
|
|
|
2024-05-26 16:27:29 +02:00
|
|
|
|
//{
|
|
|
|
|
// "", /* Default Manager function name */
|
|
|
|
|
// NULL, /* Default Manager function pointer */
|
|
|
|
|
// "", /* Default Init function name */
|
|
|
|
|
// NULL, /* Default Init function pointer */
|
|
|
|
|
//
|
|
|
|
|
//// "ND_Default_Allocator", /* Default Alloc function name */
|
|
|
|
|
//// ND_Default_Allocator, /* Default Alloc function pointer */
|
|
|
|
|
//// "ND_Default_Deallocator", /* Default Free function name */
|
|
|
|
|
//// ND_Default_Deallocator, /* Default Free function pointer */
|
|
|
|
|
//
|
|
|
|
|
// "", /* Default Alloc function name */
|
|
|
|
|
// NULL, /* Default Alloc function pointer */
|
|
|
|
|
// "", /* Default Free function name */
|
|
|
|
|
// NULL, /* Default Free function pointer */
|
|
|
|
|
// "", /* Default Open function name */
|
|
|
|
|
// NULL, /* Default Open function pointer */
|
|
|
|
|
// "", /* Default Close function name */
|
|
|
|
|
// NULL, /* Default Close function pointer */
|
|
|
|
|
// "", /* Default Lock function name */
|
|
|
|
|
// NULL, /* Default Lock function pointer */
|
|
|
|
|
// "", /* Default Unlock function name */
|
|
|
|
|
// NULL /* Default Unlock function pointer */
|
|
|
|
|
//};
|
2024-05-24 17:16:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-20 21:06:21 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#define ND_LIBNODE_OPEN_CHECK() if( NDG_Base.Open_Status != NDD_TRUE) { LG_LOG_ERROR_0( "LibNode library is not opened"); return( NDS_ERRAPI); }
|
|
|
|
|
#define ND_NOT_NULL_CHECK( ptr, msg) if( !(ptr)) { LG_LOG_ERROR_1( "%s is null", (msg)); return( NDS_ERRAPI); }
|
|
|
|
|
|
|
|
|
|
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2004-08-02 01:18:37 +02:00
|
|
|
|
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Fonctions et proc<6F>dures priv<69>es de la librairie (moyen niveau) */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Manager par d<>faut */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) va_list Arguments : Liste d'arguments contextuels */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2010-06-06 23:26:31 +02:00
|
|
|
|
NDT_Status ND_Default_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
2004-08-02 01:18:37 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* OpenStruct Manager */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) va_list Arguments : Liste d'arguments contextuels */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2010-06-06 23:26:31 +02:00
|
|
|
|
NDT_Status ND_OpenStruct_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Red<65>finition de la fonction malloc() avec retour de type NDT_Status */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-05-03 00:24:51 +02:00
|
|
|
|
NDT_Status ND_Default_Allocator( void **, NDT_Root *, size_t, void *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Red<65>finition de la fonction free() avec retour de type NDT_Status */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-05-03 00:24:51 +02:00
|
|
|
|
NDT_Status ND_Default_Deallocator( void *, NDT_Root *, void *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Cr<43>ation d'un noeud */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : adresse de la racine pour laquelle on cr<63>e un noeud */
|
|
|
|
|
/* (O) New_Node : adresse du pointeur sur le nouveau noeud */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2004-08-02 01:18:37 +02:00
|
|
|
|
NDT_Status ND_Node_Alloc( NDT_Root * Root, NDT_Node ** New_Node);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Destruction d'un noeud */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : adresse de la racine dans laquelle on d<>truit un noeud */
|
|
|
|
|
/* (I) Node : pointeur sur le noeud <20> d<>truire */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_Node_Free( NDT_Root *, NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Cr<43>ation d'une nouvelle structure de donn<6E>es */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */
|
|
|
|
|
/* (I) Type: type de la structure.de donn<6E>es (liste ou arbre binaire) */
|
|
|
|
|
/* (I) Allocator: pointeur vers la fonction d'allocation */
|
|
|
|
|
/* (I) Deallocator: pointeur vers la fonction de d<>sallocation */
|
|
|
|
|
/* (I) Data : pointeur de donn<6E>es utiles <20> l'allocateur */
|
|
|
|
|
/* (I) Own_Value : indique si la structure est propri<72>taire de ses valeurs */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2002-07-29 16:53:50 +02:00
|
|
|
|
NDT_Status ND_Index_Clear( NDT_Root *, NDT_Index_Id);
|
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-05-24 17:16:12 +02:00
|
|
|
|
/* Alocate and initialize a new data structure root node */
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-05-24 17:16:12 +02:00
|
|
|
|
/* (O) Root_Ptr_Ptr: Pointer adress of the new sata structure */
|
|
|
|
|
/* (I) DataStruct_Name: Name of the data structure */
|
|
|
|
|
/* (I) Index_Nb: Number of index */
|
|
|
|
|
/* (I) Index_Type_Ptr: Array of Index type (List, tree, ...) */
|
|
|
|
|
/* (I) Handlers_Ptr: Pointer to the data structure handlers */
|
|
|
|
|
/* (I) Own_Value: Flag indicating if the structure is the node owner */
|
|
|
|
|
/* (I) Data_Ptr: User pointer */
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-05-24 17:16:12 +02:00
|
|
|
|
//NDT_Status ND_Node_Root_Alloc( NDT_Root **, NDT_Index_Nb, NDT_Index_Type[], char *, NDT_Manager *, char *, NDT_Allocator *, char *, NDT_Deallocator *, short, void *);
|
|
|
|
|
|
2024-05-26 16:27:29 +02:00
|
|
|
|
NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_DataStruct_Name Name, NDT_Index_Nb Index_Nb, NDT_Index_Type *Type_Ptr, NDT_Handler *Handler_Tab, short Own_Value, void *Data_Ptr);
|
2024-05-24 17:16:12 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Destruction d'une racine */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : pointeur sur la racine <20> d<>truire */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_Node_Root_Free( NDT_Root *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Ajout d'un noeud <20> une liste cha<68>n<EFBFBD>e */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : pointeur sur la racine de la liste */
|
|
|
|
|
/* (I) New_Node : pointeur sur le noeud <20> ajouter */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_List_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Ajout d'une nouvelle valeur <20> une liste */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : pointeur sur la racine de la liste */
|
|
|
|
|
/* (I) Value : pointeur sur la valeur <20> ajouter */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_List_Value_Add( NDT_Root *, NDT_Index_Id, void *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Ajout d'un noeud <20> un arbre binaire */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : pointeur sur la racine de l'arbre */
|
|
|
|
|
/* (I) Value : pointeur sur la valeur <20> ajouter */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_Tree_Value_Add( NDT_Root *, NDT_Index_Id, void *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Supprime le noeud d'une liste */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Node : pointeur sur le noeud <20> supprimer */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_List_Node_Remove( NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Conversion d'une structure en liste cha<68>n<EFBFBD>e */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : pointeur sur la racine du la structure <20> convertir */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_List_Make( NDT_Root *, NDT_Index_Id);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Recherche une valeur dans une liste et retourne le noeud correspondant */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2010-06-06 23:26:31 +02:00
|
|
|
|
NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2010-06-06 23:26:31 +02:00
|
|
|
|
NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Conversion d'une structure en arbre binaire */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : pointeur sur la racine du la structure <20> convertir */
|
|
|
|
|
/* (I) Type : type du futur arbre */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_Tree_Make( NDT_Root *, NDT_Index_Id);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Equilibrage d'un arbre */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : pointeur sur la racine de l'arbre */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_Tree_Equalize( NDT_Root *, NDT_Index_Id);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Retourne la profondeur de la plus grande branche <20> partir d'un noeud */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Node : pointeur sur le noeud */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
long ND_Tree_MaxDepth_Get( NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Retourne la profondeur de la plus petite branche <20> partir d'un noeud */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Node : pointeur sur le noeud */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
long ND_Tree_MinDepth_Get( NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Ajout d'un noeud <20> un arbre binaire */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : pointeur sur la racine de l'arbre */
|
|
|
|
|
/* (I) Node : pointeur sur le noeud <20> ajouter */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_Tree_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Ajoute tous les noeud d'une liste <20> un arbre */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Tree_Root : pointeur sur la racine de l'arbre */
|
|
|
|
|
/* (I) List_Root : pointeur sur la racine de la liste */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_Tree_List_Add( NDT_Root *, NDT_Index_Id, NDT_Root *, NDT_Index_Id);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Fonction de comparaison de noeuds (pour le quick sort) */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
int ND_Node_Compare( void **, void **);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Ordonne une liste cha<68>n<EFBFBD>e selon l'algorithme du tri <20> bulle */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Root : pointeur sur la racine de la liste <20> trier */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_List_Sort( NDT_Root *, NDT_Index_Id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-26 16:27:29 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Post prototype global variable definitions */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
NDT_Handler NDG_Handler_Tab_Default[ NDD_HANDLER_NB] =
|
|
|
|
|
{
|
|
|
|
|
{ "", /* Default Manager function name */
|
|
|
|
|
NULL}, /* Default Manager function pointer */
|
|
|
|
|
{ "", /* Default Init function name */
|
|
|
|
|
NULL}, /* Default Init function pointer */
|
|
|
|
|
|
|
|
|
|
{ "ND_Default_Allocator", /* Default Alloc function name */
|
|
|
|
|
(NDT_Handler_Function *)ND_Default_Allocator}, /* Default Alloc function pointer */
|
|
|
|
|
{ "ND_Default_Deallocator", /* Default Free function name */
|
|
|
|
|
(NDT_Handler_Function *)ND_Default_Deallocator}, /* Default Free function pointer */
|
|
|
|
|
|
|
|
|
|
// { "", /* Default Alloc function name */
|
|
|
|
|
// NULL}, /* Default Alloc function pointer */
|
|
|
|
|
// { "", /* Default Free function name */
|
|
|
|
|
// NULL}, /* Default Free function pointer */
|
|
|
|
|
{ "", /* Default Open function name */
|
|
|
|
|
NULL}, /* Default Open function pointer */
|
|
|
|
|
{ "", /* Default Close function name */
|
|
|
|
|
NULL}, /* Default Close function pointer */
|
|
|
|
|
{ "", /* Default Lock function name */
|
|
|
|
|
NULL}, /* Default Lock function pointer */
|
|
|
|
|
{ "", /* Default Unlock function name */
|
|
|
|
|
NULL} /* Default Unlock function pointer */
|
|
|
|
|
};
|
|
|
|
|
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2024-04-21 23:49:52 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* PRIVATE FUNCTIONS */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void ND_List_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void ND_List_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void ND_Value_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void ND_Tree_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void ND_Tree_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_List_Recursive_Make( NDT_Node *, NDT_Root *, NDT_Index_Id);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Node *ND_Tree_Recursive_Make( long, long, NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void ND_Tree_Node_Recursive_Add( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Node **, long , NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Node *ND_Tree_Node_First_Recursive_Get( NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Node *ND_Tree_Node_Last_Recursive_Get( NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2010-06-06 23:26:31 +02:00
|
|
|
|
NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *, void *, va_list *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Node *ND_Tree_Parent_Next_Recursive_Get( NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Node *ND_Tree_Parent_Previous_Recursive_Get( NDT_Node *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void ND_Tree_Recursive_Print( NDT_Node *, long, FILE *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void ND_Tree_Link_Recursive_Check( NDT_Node *, int *, int *, FILE *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_Symbol_Find( void **, const char *);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
void ND_Signal_Trap( int);
|
2000-07-18 16:51:56 +02:00
|
|
|
|
|
2005-01-11 21:57:04 +01:00
|
|
|
|
NDT_Status ND_Address_Check( void *);
|