diff --git a/ReadMe.txt b/ReadMe.txt index 620a956..7336b4a 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -8,14 +8,13 @@ -Welcome to LibNode 2.2.x ! +Welcome to LibNode 2.3.x ! This release of LibNode supports the following OS: - - Linux 2.2.x, 2.4.x and 2.6.x (tested on RedHat & Mandriva), - - Solaris 2.6, - - Windows NT4, 2000 and XP. + - Linux 5.15.x, (tested on Mageia 8), + - Other OS (Windows, ...). @@ -41,4 +40,4 @@ Enjoy it! Your LibNode Team. arnaud@rx3.net -http://www.rx3.org/dvp/?dvp=libnode +https://git.rx3.org/gitea/rx3/libnode diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index c99e0ae..145218f 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -9,7 +9,17 @@ ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.2.0-1 - A. Gibert - 06/06/10 +LibNode V 2.3.0-1 - A. GIBERT - ??/08/23 +------------------------------------------------------------------------------------------------------------------------------------ + +All: Full english translation (No more French!) + Convert all the files to UTF8 +LibNode: Rename mispelled Desallocator to Deallocator (API possible break...) + + + +------------------------------------------------------------------------------------------------------------------------------------ +LibNode V 2.2.0-1 - A. GIBERT - 06/06/10 ------------------------------------------------------------------------------------------------------------------------------------ All: Add support C99 va_arg for curent gcc (4.4.1), @@ -24,7 +34,7 @@ NDBench: Add LibNode 2.2 support: Use ND_VA_* macros in manager. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.1.0-1 - A. Gibert - 24/01/05 +LibNode V 2.1.0-1 - A. GIBERT - 24/01/05 ------------------------------------------------------------------------------------------------------------------------------------ All: This new LibNode branch (2.1.x) should support the forthcoming new LibShMem branch (2.0.x), @@ -37,7 +47,7 @@ NDBench: DS_Open now support an arg in order to use or not symbol lookup, ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.7-1 - A. Gibert - 20/01/05 +LibNode V 2.0.7-1 - A. GIBERT - 20/01/05 ------------------------------------------------------------------------------------------------------------------------------------ All: Add to Makefile.var auto version label detection from CVS Tag. @@ -48,7 +58,7 @@ LibNode: Minor bug fixes in ND_*_Info_Print() functions and ND_Library_StdErr_Se ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.6-1 - A. Gibert - 24/08/04 +LibNode V 2.0.6-1 - A. GIBERT - 24/08/04 ------------------------------------------------------------------------------------------------------------------------------------ All: Generate *-c executables with checking mode enabled (ND_MODE=1), @@ -64,7 +74,7 @@ NDBench: Add Lib_Open, Lib_Close, Index_Value_Break and Index_Node_Break command ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.5-1 - A. Gibert / M. Regimbeau - 28/07/03 +LibNode V 2.0.5-1 - A. GIBERT / M. REGIMBEAU - 28/07/03 ------------------------------------------------------------------------------------------------------------------------------------ All: Add a new Makefile system (Makefile.rule and Makefile.var), @@ -75,7 +85,7 @@ All: Add a new Makefile system (Makefile.rule and Makefile.var), ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.4-1 - A. Gibert - 29/07/02 +LibNode V 2.0.4-1 - A. GIBERT - 29/07/02 ------------------------------------------------------------------------------------------------------------------------------------ All: This release of libnode pass with sucess valgrind test on linux. @@ -85,7 +95,7 @@ NbBench: Add fclose() call at the end of batch_run. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.3-1 - A. Gibert - 09/04/02 +LibNode V 2.0.3-1 - A. GIBERT - 09/04/02 ------------------------------------------------------------------------------------------------------------------------------------ All: Fix Microsoft Visual Project to generate Debug and Release config correctly, @@ -99,7 +109,7 @@ NbBench: Generate in Debug mode ndbenchd.exe and in Release mode ndbenchd.exe. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.2-2 - A. Gibert - 01/03/02 +LibNode V 2.0.2-2 - A. GIBERT - 01/03/02 ------------------------------------------------------------------------------------------------------------------------------------ All: Add GNU-GPL.txt, GNU-LGPL.txt and GNU-FDL.txt license files, @@ -112,7 +122,7 @@ NbBench: Add GPL header in ndbench.c. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.2-1 - A. Gibert - 27/02/02 +LibNode V 2.0.2-1 - A. GIBERT - 27/02/02 ------------------------------------------------------------------------------------------------------------------------------------ All: Makefiles now generate static and dynamic objects, @@ -126,7 +136,7 @@ NbBench: Implement Index_Close and Index_Info_Print functions. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.1-1 - A. Gibert - 28/11/01 +LibNode V 2.0.1-1 - A. GIBERT - 28/11/01 ------------------------------------------------------------------------------------------------------------------------------------ LibNode: Fix the error level of TIMAS_KO: it's now an error status. @@ -134,7 +144,7 @@ LibNode: Fix the error level of TIMAS_KO: it's now an error status. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.0-1 - A. Gibert - 26/11/01 +LibNode V 2.0.0-1 - A. GIBERT - 26/11/01 ------------------------------------------------------------------------------------------------------------------------------------ All: Merge the main CVS trunc with the win32 branche (2.0.0-alpha5), @@ -143,7 +153,7 @@ All: Merge the main CVS trunc with the win32 branche (2.0.0-alpha5), ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.0-alpha5 - A. Gibert - 25/10/01 +LibNode V 2.0.0-alpha5 - A. GIBERT - 25/10/01 ------------------------------------------------------------------------------------------------------------------------------------ LibNode: Add Open/Close Index support, @@ -153,7 +163,7 @@ NdBench: Add full multi index support. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.0-alpha4 - A. Gibert - 28/09/01 +LibNode V 2.0.0-alpha4 - A. GIBERT - 28/09/01 ------------------------------------------------------------------------------------------------------------------------------------ All: Add optional libver support, @@ -164,7 +174,7 @@ NdBench: Fix local stack pointer big bug. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.0-alpha3 - A. Gibert - 18/9/01 +LibNode V 2.0.0-alpha3 - A. GIBERT - 18/9/01 ------------------------------------------------------------------------------------------------------------------------------------ New manager args interface (again !), @@ -173,7 +183,7 @@ ndbench support batch mode. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.0-alpha2 - A. Gibert - 08/09/01 +LibNode V 2.0.0-alpha2 - A. GIBERT - 08/09/01 ------------------------------------------------------------------------------------------------------------------------------------ Re-enable libver support for unix, @@ -183,7 +193,7 @@ Code cleanup. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 2.0.0-alpha1 - A. Gibert - 07/09/01 +LibNode V 2.0.0-alpha1 - A. GIBERT - 07/09/01 ------------------------------------------------------------------------------------------------------------------------------------ Add Full win32 support, @@ -196,24 +206,24 @@ This new version (2.0.x) is developped for the TIMA project (Misys IBS - France) ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 1.0.0 - S. Mas / A. Gibert - 18/07/00 +LibNode V 1.0.0 - S. MAS / A. GIBERT - 18/07/00 ------------------------------------------------------------------------------------------------------------------------------------ -Unix (Linux and Solaris) version only, for BDM project (Société Générale - Paris) +Unix (Linux and Solaris) version only, for BDM project (Société Générale - Paris) Major code rewrite. ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 0.2.2 - A. Gibert - 01/06/93 +LibNode V 0.2.2 - A. GIBERT - 01/06/93 ------------------------------------------------------------------------------------------------------------------------------------ -Embeded version on OS/2 2.1 (Companie Générale des Eaux - Paris) +Embeded version on OS/2 2.1 (Companie Générale des Eaux - Paris) ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 0.2.1 - A. Gibert - 01/04/92 +LibNode V 0.2.1 - A. GIBERT - 01/04/92 ------------------------------------------------------------------------------------------------------------------------------------ Amiga and PC support (Bareau de Draguignan - Ste Maxime). @@ -221,7 +231,7 @@ Amiga and PC support (Bareau de Draguignan - Ste Maxime). ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 0.2.0 - A. Gibert - 01/03/91 +LibNode V 0.2.0 - A. GIBERT - 01/03/91 ------------------------------------------------------------------------------------------------------------------------------------ C version aided by p2c tools on Pyramid (Swansee University - Wales). @@ -229,7 +239,7 @@ C version aided by p2c tools on Pyramid (Swansee University - Wales). ------------------------------------------------------------------------------------------------------------------------------------ -LibNode V 0.1.0 - A. Gibert - 01/12/90 +LibNode V 0.1.0 - A. GIBERT - 01/12/90 ------------------------------------------------------------------------------------------------------------------------------------ Inital version in Pascal on Pyramid (Swansee University - Wales). diff --git a/doc/man3/libnode.3 b/doc/man3/libnode.3 index 90903d1..70ab3ff 100644 --- a/doc/man3/libnode.3 +++ b/doc/man3/libnode.3 @@ -15,7 +15,7 @@ LIBNODE (librairie de structure de donnees a base de noeuds) .LP .BI "NDT_Status ND_Library_Stderr_Set ( FILE * " Out " );" .LP -.BI "NDT_Status ND_DataStruct_Open ( NDT_Root ** " Root ", NDT_DataStruct_Type " Type ", const char * " Allocator ", const char * " Desallocator ", void * " User " );" +.BI "NDT_Status ND_DataStruct_Open ( NDT_Root ** " Root ", NDT_DataStruct_Type " Type ", const char * " Allocator ", const char * " Deallocator ", void * " User " );" .LP .BI "NDT_Status ND_DataStruct_Close ( NDT_Root * " Root " );" .LP @@ -61,7 +61,7 @@ LIBNODE (librairie de structure de donnees a base de noeuds) .LP .BI "NDT_Status ND_Allocator_Exec (const char * " Function_Name ", void ** " Ptr ", size_t " Size ", void * " Data " );" .LP -.BI "NDT_Status ND_Desallocator_Exec (const char * " Function_Name ", void * " Ptr ", void * " Data " );" +.BI "NDT_Status ND_Deallocator_Exec (const char * " Function_Name ", void * " Ptr ", void * " Data " );" .LP .SH DESCRIPTION .LP @@ -153,7 +153,7 @@ La racine d'une structure reference enfin les fonctions suivantes par leur nom : : fonction qui realise l'allocation de memoire pour la structure .LP - -.B Desallocator +.B Deallocator : fonction qui realise la desallocation de memoire pour la structure .LP .RS -3 @@ -362,7 +362,7 @@ Par defaut, une structure de donnees definira la fonction malloc() comme fonctio (voir FONCTIONS). .LP .RS -3 -.BI NDT_Desallocator +.BI NDT_Deallocator .LP .RS 3 Designe le type d'une fonction de desallocation memoire. @@ -373,7 +373,7 @@ Par defaut, une structure de donnees definira la fonction free() comme fonction .LP .I NB : une fonction de desallocation devra etre executee via la fonction -.B NDT_Desallocator_Exec +.B NDT_Deallocator_Exec (voir FONCTIONS). .LP .RS -3 @@ -404,7 +404,7 @@ Cette fonction permet de definir comme la sortie standard des messages d'erreur de la librarie. .RS -3 .LP -.BI "NDT_Status ND_DataStruct_Open ( NDT_Root ** " Root ", NDT_DataStruct_Type " Type ", const char * " Allocator ", const char * " Desallocator ", void * " User " , int " Own_Value " );" +.BI "NDT_Status ND_DataStruct_Open ( NDT_Root ** " Root ", NDT_DataStruct_Type " Type ", const char * " Allocator ", const char * " Deallocator ", void * " User " , int " Own_Value " );" .RS 3 .LP Cette fonction permet de creer une structure de donnees. @@ -428,9 +428,9 @@ Elle doit recevoir les arguments suivants : Si cet argument est positionne a NULL, alors la fonction d'allocation locale malloc() sera utilisee par defaut. .LP * (In) -.I Desallocator +.I Deallocator : le nom de la fonction de desallocation memoire (fonction de type -.B NDT_Desallocator +.B NDT_Deallocator ) associee a la nouvelle structure de donnees. Si cet argument est positionne a NULL, alors la fonction de desallocation locale free() sera utilisee par defaut. .LP @@ -868,7 +868,7 @@ Elle doit recevoir les arguments suivants : .RS -3 .LP .RS -3 -.BI "NDT_Status ND_Desallocator_Exec (const char * " Function_Name ", void * " Ptr ", void * " Data " );" +.BI "NDT_Status ND_Deallocator_Exec (const char * " Function_Name ", void * " Ptr ", void * " Data " );" .LP .RS 3 Cette fonction permet d'executer une fonction de desallocation a partir de son nom. @@ -879,7 +879,7 @@ Elle doit recevoir les arguments suivants : * (In) .I Function_Name : le nom de la fonction de desallocation (fonction de type -.B NDT_Desallocator +.B NDT_Deallocator ) .LP * (In) diff --git a/include/node.h b/include/node.h index 27dd1d5..a393be3 100644 --- a/include/node.h +++ b/include/node.h @@ -63,9 +63,7 @@ extern "C" { /* - Différence de profondeur entre la branche la plus courte et - la plus longue d'un arbre. - Le dépassement de ce seuil provoque le rééquilibrage de l'arbre + Default allowed maximum depth between tree branches before rebalancing */ #define DEF_MAX_DIF 100 @@ -118,13 +116,13 @@ typedef int NDT_Index_Type; #define NDD_INDEX_SUBTYPE_UNKNOWN 0x0000 -#define NDD_INDEX_SUBTYPE_FIFO 0x0100 /* principe de la file d'attente (First In First Out) */ +#define NDD_INDEX_SUBTYPE_FIFO 0x0100 /* First In First Out list (queue) */ #define NDD_INDEX_SUBTYPE_LILO NDD_INDEX_SUBTYPE_FIFO -#define NDD_INDEX_SUBTYPE_LIFO 0x0200 /* principe de la pile (First In Last Out) */ +#define NDD_INDEX_SUBTYPE_LIFO 0x0200 /* First In Last Out list (stack) */ #define NDD_INDEX_SUBTYPE_FILO NDD_INDEX_SUBTYPE_LIFO -#define NDD_INDEX_SUBTYPE_SORTED 0x0300 /* liste triée */ +#define NDD_INDEX_SUBTYPE_SORTED 0x0300 /* Sorted list */ #define NDD_INDEX_SUBTYPE_UNBALANCED 0x0400 -#define NDD_INDEX_SUBTYPE_BALANCED 0x0500 /* arbre auto-équilibré */ +#define NDD_INDEX_SUBTYPE_BALANCED 0x0500 /* Auto balanced tree */ #define NDD_INDEX_SUBTYPE_MSK ( NDD_INDEX_SUBTYPE_UNKNOWN | NDD_INDEX_SUBTYPE_FIFO | NDD_INDEX_SUBTYPE_FILO | NDD_INDEX_SUBTYPE_SORTED | NDD_INDEX_SUBTYPE_UNBALANCED | NDD_INDEX_SUBTYPE_BALANCED) #define NDD_INDEX_SUBTYPE_RMSK (NDD_INDEX_MSK ^ NDD_INDEX_SUBTYPE_MSK) @@ -494,7 +492,7 @@ typedef int NDT_Index_Type; -/* Commandes du manager */ +/* Manager Commands */ typedef int NDT_Command; @@ -518,7 +516,7 @@ typedef char *NDT_Version_Name; -/* Types de réponse du manager ou code retour des diverses fonctions */ +/* Manager or Functions Return Codes */ typedef int NDT_Status; @@ -534,8 +532,8 @@ typedef int NDT_Status; #define NDS_GREATER 2 #define NDS_LOWER 3 -#define NDS_ERRMEM -1 /* Problème d'allocation mémoire */ -#define NDS_ERRAPI -2 /* Utilisation incorrecte des API */ +#define NDS_ERRMEM -1 /* Memory allocation problem */ +#define NDS_ERRAPI -2 /* Bad API usage */ @@ -552,7 +550,7 @@ struct NDT_Node; -/* Pointeur de fonction sur le manager */ +/* Manager function pointer */ #define NDD_MANAGER_NAME_LEN_MAX 64 #define NDD_MANAGER_NAME_SIZE_MAX (NDD_MANAGER_NAME_LEN_MAX + 1) @@ -562,7 +560,7 @@ typedef char *NDT_Manager_Name; typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Node *, NDT_Command, va_list *); -/* Pointeur de fonction sur l'allocateur */ +/* Memory allocator function pointer */ #define NDD_ALLOCATOR_NAME_LEN_MAX 64 #define NDD_ALLOCATOR_NAME_SIZE_MAX (NDD_ALLOCATOR_NAME_LEN_MAX + 1) @@ -572,30 +570,30 @@ typedef char *NDT_Allocator_Name; typedef NDT_Status NDT_Allocator( void **, size_t, void *); -/* Pointeur de fonction sur le désallocateur */ +/* Memory deallocator function pointer */ -#define NDD_DESALLOCATOR_NAME_LEN_MAX 64 -#define NDD_DESALLOCATOR_NAME_SIZE_MAX (NDD_DESALLOCATOR_NAME_LEN_MAX + 1) +#define NDD_DEALLOCATOR_NAME_LEN_MAX 64 +#define NDD_DEALLOCATOR_NAME_SIZE_MAX (NDD_DEALLOCATOR_NAME_LEN_MAX + 1) -typedef char *NDT_Desallocator_Name; +typedef char *NDT_Deallocator_Name; -typedef NDT_Status NDT_Desallocator( void *, void *); +typedef NDT_Status NDT_Deallocator( void *, void *); typedef struct NDT_Index { - NDT_Index_Type Type; /* Type de la structure (liste, arbre ... ) */ + NDT_Index_Type Type; /* Structure Type (Queue, Stack, Tree, ... ) */ - long Node_Number; /* Nombre de noeuds dans la structure */ - long Min_Depth; /* Profondeur minimale de l'arbre */ - long Max_Depth; /* Profondeur maximale de l'arbre */ - long Max_Dif; /* Différence maximale autorisée entre la branche la plus courte et la plus longue */ - long Nb_Equ; /* Nombre de réquilibrages réalisés sur l'arbre */ - struct NDT_Node *Head; /* Noeud de tête */ - struct NDT_Node *Tail; /* Noeud de queue */ - struct NDT_Node *Save; /* Pointeur de sauvegarde (utile pour la fonction de restauration) */ + long Node_Number; /* Number of node in the structure */ + long Min_Depth; /* Minimum tree depth */ + long Max_Depth; /* Maximum tree depth */ + long Max_Dif; /* Maximum allowed depth between tree branches before rebalancing */ + long Nb_Equ; /* Rebalancing count */ + struct NDT_Node *Head; /* Head node */ + struct NDT_Node *Tail; /* Tail node */ + struct NDT_Node *Save; /* Save pointer (Used by restore function) */ } NDT_Index; @@ -603,18 +601,15 @@ typedef struct NDT_Index typedef struct NDT_Root { -/* NDT_Root_Type Type;*/ /* Root Structure Type */ -/* NDT_DataStruct_Type DS_Type;*/ /* Type de la structure (liste, arbre ... ) */ + NDT_Manager *Manager_Ptr; /* Manager function pointer */ + char Manager_Name[NDD_MANAGER_NAME_SIZE_MAX]; /* Manager function name */ + NDT_Allocator *Allocator_Ptr; /* Value allocator function pointer */ + char Allocator_Name[NDD_ALLOCATOR_NAME_SIZE_MAX]; /* Value allocator function name */ + NDT_Deallocator *Deallocator_Ptr; /* Value deallocator function pointer */ + char Deallocator_Name[NDD_DEALLOCATOR_NAME_SIZE_MAX]; /* Value deallocator function name */ - NDT_Manager *Manager_Ptr; /* Pointeur sur la fonction manager */ - char Manager_Name[NDD_MANAGER_NAME_SIZE_MAX]; /* Nom de la fonction manager */ - NDT_Allocator *Allocator_Ptr; /* Pointeur sur la fonction d'allocation */ - char Allocator_Name[NDD_ALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction d'allocation */ - NDT_Desallocator *Desallocator_Ptr; /* Pointeur sur la fonction de désallocation */ - char Desallocator_Name[NDD_DESALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction de désallocation */ - - short Own_Value; /* Indique si la structure est propriétaire de ses valeurs */ - void *User_Ptr; /* Pointeur utilisable librement par l'utilisateur */ + short Own_Value; /* Flag indicating if the structure is the node owner */ + void *User_Ptr; /* User pointer */ NDT_Index_Nb Index_Nb; NDT_Index_Nb Index_Open_Count; @@ -629,15 +624,15 @@ typedef struct NDT_DataStruct NDT_Root *Root_Ptr; - NDT_Manager *Manager_Ptr; /* Manager function pointer */ - NDT_Allocator *Allocator_Ptr; /* Allocator function pointer */ - NDT_Desallocator *Desallocator_Ptr; /* Desallocator function pointer */ + NDT_Manager *Manager_Ptr; /* Manager function pointer */ + NDT_Allocator *Allocator_Ptr; /* Value allocator function pointer */ + NDT_Deallocator *Deallocator_Ptr; /* Value deallocator function pointer */ } NDT_DataStruct; -/* Structure de noeud */ +/* Node structure */ typedef struct NDT_Node { @@ -667,13 +662,13 @@ typedef int NDT_Recursive_Offset; -/* Définition des alias de l'API */ +/* Alias API definition */ #ifndef ND_MODE #define ND_MODE 0 #endif -#if ND_MODE == 1 /* API sans vérification des arguments */ +#if ND_MODE == 1 /* No arg checking API */ #define ND_Library_Open ND_Library_Open_I #define ND_Library_Close ND_Library_Close_I @@ -721,9 +716,13 @@ typedef int NDT_Recursive_Offset; #define ND_Manager_Exec_V ND_Manager_Exec_VI #define ND_Manager_Exec ND_Manager_Exec_I #define ND_Allocator_Exec ND_Allocator_Exec_I -#define ND_Desallocator_Exec ND_Desallocator_Exec_I +#define ND_Deallocator_Exec ND_Deallocator_Exec_I + + + +#else /* Arg checking API */ + -#else /* API avec vérification des arguments */ #define ND_Library_Open ND_Library_Open_C #define ND_Library_Close ND_Library_Close_C @@ -771,7 +770,7 @@ typedef int NDT_Recursive_Offset; #define ND_Manager_Exec_V ND_Manager_Exec_VC #define ND_Manager_Exec ND_Manager_Exec_C #define ND_Allocator_Exec ND_Allocator_Exec_C -#define ND_Desallocator_Exec ND_Desallocator_Exec_C +#define ND_Deallocator_Exec ND_Deallocator_Exec_C #endif @@ -792,7 +791,7 @@ typedef int NDT_Recursive_Offset; /*------------------------------------------------------------------------------*/ -/* Initialisation du contexte de la librairie */ +/* Library initialisation */ /*------------------------------------------------------------------------------*/ NDD_DLL_API NDT_Status ND_Library_Open_I ( int Debug_Mode ); NDD_DLL_API NDT_Status ND_Library_Open_C ( int Debug_Mode ); @@ -800,7 +799,7 @@ NDD_DLL_API NDT_Status ND_Library_Open_C ( int Debug_Mode ); /*------------------------------------------------------------------------------*/ -/* Fermeture du contexte de la librairie */ +/* Library deinitialisation */ /*------------------------------------------------------------------------------*/ NDD_DLL_API NDT_Status ND_Library_Close_I( void); NDD_DLL_API NDT_Status ND_Library_Close_C( void); @@ -808,7 +807,7 @@ NDD_DLL_API NDT_Status ND_Library_Close_C( void); /*------------------------------------------------------------------------------*/ -/* Définition de la sortie standard des messages d'erreur de la librairie */ +/* Library Standard Error output setup */ /*------------------------------------------------------------------------------*/ NDD_DLL_API NDT_Status ND_Library_StdErr_Set_I( FILE *); NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *); @@ -816,22 +815,22 @@ NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *); /*------------------------------------------------------------------------------*/ -/* Création d'une nouvelle structure de données */ +/* Create a new data structure */ /*------------------------------------------------------------------------------*/ /* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ /* (I) Type: type de la structure.de données (liste ou arbre binaire) */ /* (I) Allocator: pointeur vers la fonction d'allocation */ -/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Deallocator: pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ /*------------------------------------------------------------------------------*/ -NDD_DLL_API NDT_Status ND_DataStruct_Open_I( NDT_Root **, NDT_Index_Nb, NDT_Index_Type *, NDT_Manager_Name, NDT_Manager *, NDT_Allocator_Name, NDT_Allocator *, NDT_Desallocator_Name, NDT_Desallocator *, short, void *); -NDD_DLL_API NDT_Status ND_DataStruct_Open_C( NDT_Root **, NDT_Index_Nb, NDT_Index_Type *, NDT_Manager_Name, NDT_Manager *, NDT_Allocator_Name, NDT_Allocator *, NDT_Desallocator_Name, NDT_Desallocator *, short, void *); +NDD_DLL_API NDT_Status ND_DataStruct_Open_I( NDT_Root **, NDT_Index_Nb, NDT_Index_Type *, NDT_Manager_Name, NDT_Manager *, NDT_Allocator_Name, NDT_Allocator *, NDT_Deallocator_Name, NDT_Deallocator *, short, void *); +NDD_DLL_API NDT_Status ND_DataStruct_Open_C( NDT_Root **, NDT_Index_Nb, NDT_Index_Type *, NDT_Manager_Name, NDT_Manager *, NDT_Allocator_Name, NDT_Allocator *, NDT_Deallocator_Name, NDT_Deallocator *, short, void *); /*------------------------------------------------------------------------------*/ -/* Destruction d'une structure de données */ +/* Destroy a data structure */ /*------------------------------------------------------------------------------*/ /* (O) Root: pointeur sur la racine de la structure de données */ /*------------------------------------------------------------------------------*/ @@ -841,7 +840,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Close_C( NDT_Root *); /*------------------------------------------------------------------------------*/ -/* Destruction d'une structure de données */ +/* Destroy all data of a data structure */ /*------------------------------------------------------------------------------*/ /* (O) Root: pointeur sur la racine de la structure de données */ /*------------------------------------------------------------------------------*/ @@ -851,9 +850,9 @@ NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *); /*------------------------------------------------------------------------------*/ -/* Function de réparation d'une structure : */ -/* - vérifie que tous les noeuds sont correctement liés les uns aux autres */ -/* - corrige les informations statistiques de la racine */ +/* Check & repare a datat structure: */ +/* - Check & fix node links */ +/* - Update data structure statistics */ /*------------------------------------------------------------------------------*/ /* (I) Root : pointeur sur la racine de la structure */ /* (O) Nb_Detected : pointeur sur le nombre d'erreurs */ @@ -866,19 +865,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Check_C( NDT_Root *, int *, int *, FILE /*------------------------------------------------------------------------------*/ -/* Réorganisation d'une structure de données : */ -/* - ordonnancement d'une liste non ordonnée */ -/* - réquilibrage d'un arbre non auto-équilibré */ -/*------------------------------------------------------------------------------*/ -/* (I) Root: pointeur sur la racine de la structure de données */ -/*------------------------------------------------------------------------------*/ -NDD_DLL_API NDT_Status ND_DataStruct_Reorg_I( NDT_Root *); -NDD_DLL_API NDT_Status ND_DataStruct_Reorg_C( NDT_Root *); - - - -/*------------------------------------------------------------------------------*/ -/* Conversion d'une structure de données d'un type en un autre */ +/* Convert a data structure to another type */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Target_Type: type de structure cible */ @@ -889,8 +876,19 @@ NDD_DLL_API NDT_Status ND_DataStruct_Convert_C( NDT_Root *, NDT_Index_Type *) /*------------------------------------------------------------------------------*/ -/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ -/* commande sur chacun d'eux */ +/* Reorganise a data structure: */ +/* - sort a non-sorted list */ +/* - rebalance a non auto-balanced tree */ +/*------------------------------------------------------------------------------*/ +/* (I) Root: pointeur sur la racine de la structure de données */ +/*------------------------------------------------------------------------------*/ +NDD_DLL_API NDT_Status ND_DataStruct_Reorg_I( NDT_Root *); +NDD_DLL_API NDT_Status ND_DataStruct_Reorg_C( NDT_Root *); + + + +/*------------------------------------------------------------------------------*/ +/* Traverse a data structure & execute a command on each node */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Command: Commande à exécuter sur chaque noeud traversé */ @@ -904,7 +902,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command, ... /*------------------------------------------------------------------------------*/ -/* Affichage d'informations sur une structure de données */ +/* Print data structure information */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Out : flux de sortie */ @@ -915,7 +913,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_C( FILE *, NDT_Root *, NDT_Re /*------------------------------------------------------------------------------*/ -/* Ajout d'une valeur à une structure de données */ +/* Add a new value to a data structure */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Value: pointeur sur la valeur à ajouter */ @@ -926,7 +924,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *, void *); /*------------------------------------------------------------------------------*/ -/* Suppression du premier noeud correspondant à une valeur donnée */ +/* Remove the first matching value from a data structure */ /*------------------------------------------------------------------------------*/ /* (I) Root : pointeur sur la racine de la structure de données */ /* (I) Reference_Value : pointeur sur la valeur de référence */ @@ -938,7 +936,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *, void *); /*------------------------------------------------------------------------------*/ -/* Affichage de la valeur de tous les noeuds d'une structure de données */ +/* Print all the data structure values */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Out : flux de sortie */ @@ -950,7 +948,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_ /*------------------------------------------------------------------------------*/ -/* Recherche un noeud à partir d'une valeur */ +/* Find a node from a value in a datat structure */ /*------------------------------------------------------------------------------*/ /* (I) Root : pointeur sur la racine de l'abre */ /* (O) Node : pointeur sur le noeud à récuperer */ @@ -971,7 +969,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_C( void **, NDT_Root *, void /* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ /* (I) Type: type de la structure.de données (liste ou arbre binaire) */ /* (I) Allocator: pointeur vers la fonction d'allocation */ -/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Deallocator: pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ /*------------------------------------------------------------------------------*/ @@ -1001,9 +999,9 @@ NDD_DLL_API NDT_Status ND_Index_Flush_C( NDT_Root *, NDT_Index_Id); /*------------------------------------------------------------------------------*/ -/* Function de réparation d'une structure : */ -/* - vérifie que tous les noeuds sont correctement liés les uns aux autres */ -/* - corrige les informations statistiques de la racine */ +/* Check & repare a data structure index: */ +/* - Check & fix node links */ +/* - Update data structure statistics */ /*------------------------------------------------------------------------------*/ /* (I) Root : pointeur sur la racine de la structure */ /* (O) Nb_Detected : pointeur sur le nombre d'erreurs */ @@ -1016,7 +1014,7 @@ NDD_DLL_API NDT_Status ND_Index_Check_C( NDT_Root *, NDT_Index_Id, int *, int /*------------------------------------------------------------------------------*/ -/* Conversion d'une structure de données d'un type en un autre */ +/* Convert a data structure index to another type */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Target_Type: type de structure cible */ @@ -1027,9 +1025,9 @@ NDD_DLL_API NDT_Status ND_Index_Convert_C ( NDT_Root *, NDT_Index_Id, NDT_Inde /*------------------------------------------------------------------------------*/ -/* Réorganisation d'une structure de données : */ -/* - ordonnancement d'une liste non ordonnée */ -/* - réquilibrage d'un arbre non auto-équilibré */ +/* Reorganise a data structure index: */ +/* - sort a non-sorted list */ +/* - rebalance a non auto-balanced tree */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /*------------------------------------------------------------------------------*/ @@ -1039,8 +1037,7 @@ NDD_DLL_API NDT_Status ND_Index_Reorg_C( NDT_Root *, NDT_Index_Id); /*------------------------------------------------------------------------------*/ -/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ -/* commande sur chacun d'eux */ +/* Traverse a data structure index & execute a command on each node */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Command: Commande à exécuter sur chaque noeud traversé */ @@ -1054,8 +1051,7 @@ NDD_DLL_API NDT_Status ND_Index_Traverse_C( NDT_Root *, NDT_Index_Id, NDT_Com /*------------------------------------------------------------------------------*/ -/* Parcours de tous les noeuds d'une structure de données et exécution d'une */ -/* commande sur chacun d'eux */ +/* Print data structure index information */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Command: Commande à exécuter sur chaque noeud traversé */ @@ -1067,7 +1063,7 @@ NDD_DLL_API NDT_Status ND_Index_Info_Print_C( FILE *, NDT_Root *, NDT_Index_I /*------------------------------------------------------------------------------*/ -/* Ajout d'une valeur à une structure de données */ +/* Add a new value to a data structure index */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Value: pointeur sur la valeur à ajouter */ @@ -1078,7 +1074,7 @@ NDD_DLL_API NDT_Status ND_Index_Value_Add_C( NDT_Root *, NDT_Index_Id, void * /*------------------------------------------------------------------------------*/ -/* Suppression du premier noeud correspondant à une valeur donnée */ +/* Remove the first matching value from a data structure index */ /*------------------------------------------------------------------------------*/ /* (I) Root : pointeur sur la racine de la structure de données */ /* (I) Reference_Value : pointeur sur la valeur de référence */ @@ -1090,7 +1086,7 @@ NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *, NDT_Index_Id, void /*------------------------------------------------------------------------------*/ -/* Affichage de la valeur de tous les noeuds d'une structure de données */ +/* Print all the data structure index values */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Out : flux de sortie */ @@ -1102,7 +1098,7 @@ NDD_DLL_API NDT_Status ND_Index_Value_Print_C( FILE *, NDT_Root *, NDT_Index /*------------------------------------------------------------------------------*/ -/* Ajout d'un noeud à une structure de données */ +/* Add a new node to a data structure index */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Node: pointeur sur le noeud à ajouter */ @@ -1113,7 +1109,7 @@ NDD_DLL_API NDT_Status ND_Index_Node_Add_C( NDT_Root *, NDT_Index_Id, NDT_Node /*------------------------------------------------------------------------------*/ -/* Suppression d'un noeud dans une structure de données */ +/* Remove a node from a data structure index */ /*------------------------------------------------------------------------------*/ /* (I) Node: pointeur sur le noeud à supprimer de la structure de données */ /*------------------------------------------------------------------------------*/ @@ -1123,7 +1119,7 @@ NDD_DLL_API NDT_Status ND_Index_Node_Remove_C( NDT_Node *); /*------------------------------------------------------------------------------*/ -/* Récupération du premier noeud d'une structure */ +/* Get the first node of a data structure index */ /*------------------------------------------------------------------------------*/ /* (I) Root : pointeur sur la racine dont on cherche le premier noeud */ /* (O) Node : pointeur sur le noeud à récupérer */ @@ -1134,7 +1130,7 @@ NDD_DLL_API NDT_Status ND_Index_Node_First_Get_C( NDT_Node **, NDT_Root *, ND /*------------------------------------------------------------------------------*/ -/* Récupération du dernier noeud d'une structure */ +/* Get the last node of a data structure index */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine dont on cherche le dernier noeud */ /* (O) Node : pointeur sur le noeud à récupérer */ @@ -1145,7 +1141,7 @@ NDD_DLL_API NDT_Status ND_Index_Node_Last_Get_C( NDT_Node **, NDT_Root *, NDT /*------------------------------------------------------------------------------*/ -/* Récupération du noeud suivant */ +/* Get the next node of a data structure index */ /*------------------------------------------------------------------------------*/ /* (I) Node: pointeur sur le noeud dont on cherche le suivant */ /* (O) Next_Node : pointeur sur le noeud suivant */ @@ -1156,7 +1152,7 @@ NDD_DLL_API NDT_Status ND_Index_Node_Next_Get_C( NDT_Node **, NDT_Node *); /*------------------------------------------------------------------------------*/ -/* Récupération du noeud précédant */ +/* Get the previous node of a data structure index */ /*------------------------------------------------------------------------------*/ /* (I) Node: pointeur sur le noeud dont on cherche le précédant */ /* (O) Prev_Node : pointeur sur le noeud précédant */ @@ -1167,7 +1163,7 @@ NDD_DLL_API NDT_Status ND_Index_Node_Previous_Get_C( NDT_Node **, NDT_Node *) /*------------------------------------------------------------------------------*/ -/* Recherche un noeud à partir d'une valeur */ +/* Find a node from a value in a datat structure index */ /*------------------------------------------------------------------------------*/ /* (I) Root : pointeur sur la racine de l'abre */ /* (O) Node : pointeur sur le noeud à récuperer */ @@ -1182,7 +1178,7 @@ NDD_DLL_API NDT_Status ND_Index_Node_Find_C( NDT_Node **, NDT_Root *, NDT_In /*------------------------------------------------------------------------------*/ -/* Récupération de la racine d'une structure */ +/* Get the root node of a data structure */ /*------------------------------------------------------------------------------*/ /* (O) Root: Adresse du pointeur sur la racine à récupérer */ /* (I) Node: pointeur sur le noeud dont on cherche la racine */ @@ -1193,7 +1189,7 @@ NDD_DLL_API NDT_Status ND_Node_Root_Get_C( NDT_Root **, NDT_Node *); /*------------------------------------------------------------------------------*/ -/* Allocation d'une valeur d'une structure de données */ +/* Allocate a new value */ /*------------------------------------------------------------------------------*/ /* (I) Root : pointeur sur la racine de la structure de données */ /* (O) Value : adresse d'un pointeur sur la valeur à allouer */ @@ -1205,7 +1201,7 @@ NDD_DLL_API NDT_Status ND_Value_Alloc_C( NDT_Root *, void **, ...); /*------------------------------------------------------------------------------*/ -/* Désallocation d'une valeur d'une structure de données */ +/* Deallocate a value */ /*------------------------------------------------------------------------------*/ /* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Value: pointeur sur la valeur à désallouer */ @@ -1216,7 +1212,7 @@ NDD_DLL_API NDT_Status ND_Value_Free_C( NDT_Root *, void *); /*------------------------------------------------------------------------------*/ -/* Exécution d'une fonction Manager dont le nom est passé en paramètre */ +/* Execute a manager function */ /*------------------------------------------------------------------------------*/ /* (I) Function : nom de la fonction manager à exécuter */ /*------------------------------------------------------------------------------*/ @@ -1228,7 +1224,7 @@ NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node /*------------------------------------------------------------------------------*/ -/* Exécution d'une fonction d'allocation dont le nom est passé en paramètre */ +/* Execute an allocator function */ /*------------------------------------------------------------------------------*/ /* (I) Function : nom de la fonction à exécuter */ /* (O) Ptr : adresse d'un pointeur sur la zone à allouer */ @@ -1241,15 +1237,15 @@ NDD_DLL_API NDT_Status ND_Allocator_Exec_C( void **, size_t, NDT_Allocator_Nam /*------------------------------------------------------------------------------*/ -/* Exécution d'une fonction de désallocation le dont nom est passé en paramètre */ +/* Execute a deallocator function */ /*------------------------------------------------------------------------------*/ /* (I) Function : nom de la fonction à exécuter */ /* (I) Function : nom de la fonction à exécuter */ /* (I) Ptr : adresse de la zone à désallouer */ /* (I) Data : pointeur de données utiles au désallocateur */ /*------------------------------------------------------------------------------*/ -NDD_DLL_API NDT_Status ND_Desallocator_Exec_I( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *); -NDD_DLL_API NDT_Status ND_Desallocator_Exec_C( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *); +NDD_DLL_API NDT_Status ND_Deallocator_Exec_I( void *, NDT_Deallocator_Name, NDT_Deallocator *, void *); +NDD_DLL_API NDT_Status ND_Deallocator_Exec_C( void *, NDT_Deallocator_Name, NDT_Deallocator *, void *); diff --git a/lib/libnode.c b/lib/libnode.c index ea4c612..c6ece78 100644 --- a/lib/libnode.c +++ b/lib/libnode.c @@ -866,7 +866,7 @@ NDT_Status ND_Library_StdErr_Set_C( FILE *Out) /* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ /* (I) Type: type de la structure.de données (liste ou arbre binaire) */ /* (I) Allocator: pointeur vers la fonction d'allocation */ -/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Deallocator: pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ /*------------------------------------------------------------------------------*/ @@ -932,7 +932,7 @@ NDT_Status ND_Index_Open_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_In /* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ /* (I) Type: type de la structure.de données (liste ou arbre binaire) */ /* (I) Allocator: pointeur vers la fonction d'allocation */ -/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Deallocator: pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ /*------------------------------------------------------------------------------*/ @@ -984,21 +984,21 @@ NDT_Status ND_Index_Open_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_I /* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ /* (I) Type: type de la structure.de données (liste ou arbre binaire) */ /* (I) Allocator: pointeur vers la fonction d'allocation */ -/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Deallocator: pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ /*------------------------------------------------------------------------------*/ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb, NDT_Index_Type *Type_Ptr, NDT_Manager_Name Manager_Name, NDT_Manager *Manager_Ptr, - NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, short Own_Value, void *Data) + NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, NDT_Deallocator_Name Deallocator_Name, NDT_Deallocator *Deallocator_Ptr, short Own_Value, void *Data) { NDT_Status status; NDT_Manager_Name Real_Manager_Name; NDT_Manager *Real_Manager_Ptr; NDT_Allocator_Name Real_Allocator_Name; NDT_Allocator *Real_Allocator_Ptr; - NDT_Desallocator_Name Real_Desallocator_Name; - NDT_Desallocator *Real_Desallocator_Ptr; + NDT_Deallocator_Name Real_Deallocator_Name; + NDT_Deallocator *Real_Deallocator_Ptr; /* Valeurs par défaut des fonctions d'allocation et de désallocation */ @@ -1046,27 +1046,27 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_N } #if defined(_WIN32) - if( ( Desallocator_Name != NULL) && ( Desallocator_Ptr == NULL)) + if( ( Deallocator_Name != NULL) && ( Deallocator_Ptr == NULL)) { - sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Desallocator_Ptr shouldn't be NULL"); + sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Deallocator_Ptr shouldn't be NULL"); ND_Error_Print(); return( NDS_ERRAPI); } #endif - if( ( Desallocator_Name != NULL) || ( Desallocator_Ptr != NULL)) + if( ( Deallocator_Name != NULL) || ( Deallocator_Ptr != NULL)) { - Real_Desallocator_Name = Desallocator_Name; - Real_Desallocator_Ptr = Desallocator_Ptr; + Real_Deallocator_Name = Deallocator_Name; + Real_Deallocator_Ptr = Deallocator_Ptr; } else { - Real_Desallocator_Name = "ND_Default_Desallocator"; - Real_Desallocator_Ptr = ND_Default_Desallocator; + Real_Deallocator_Name = "ND_Default_Deallocator"; + Real_Deallocator_Ptr = ND_Default_Deallocator; } - status = ND_Node_Root_Alloc( Root_Ptr_Ptr, Index_Nb, Type_Ptr, Real_Manager_Name, Real_Manager_Ptr, Real_Allocator_Name, Real_Allocator_Ptr, Real_Desallocator_Name, Real_Desallocator_Ptr, Own_Value, Data); + status = ND_Node_Root_Alloc( Root_Ptr_Ptr, Index_Nb, Type_Ptr, Real_Manager_Name, Real_Manager_Ptr, Real_Allocator_Name, Real_Allocator_Ptr, Real_Deallocator_Name, Real_Deallocator_Ptr, Own_Value, Data); if( ND_ERROR( status)) return( status); @@ -1083,13 +1083,13 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_N /* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ /* (I) Type: type de la structure.de données (liste ou arbre binaire) */ /* (I) Allocator: pointeur vers la fonction d'allocation */ -/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Deallocator: pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ /*------------------------------------------------------------------------------*/ NDT_Status ND_DataStruct_Open_C( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb, NDT_Index_Type *Type_Ptr, NDT_Manager_Name Manager_Name, NDT_Manager *Manager_Ptr, - NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, short Own_Value, void *Data_Ptr) + NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, NDT_Deallocator_Name Deallocator_Name, NDT_Deallocator *Deallocator_Ptr, short Own_Value, void *Data_Ptr) { NDT_Status status; @@ -1102,7 +1102,7 @@ NDT_Status ND_DataStruct_Open_C( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_ return( NDS_ERRAPI); } - if( ( status = ND_DataStruct_Open_I( Root_Ptr_Ptr, Index_Nb, Type_Ptr, Manager_Name, Manager_Ptr, Allocator_Name, Allocator_Ptr, Desallocator_Name, Desallocator_Ptr, Own_Value, Data_Ptr)) != NDS_OK) + if( ( status = ND_DataStruct_Open_I( Root_Ptr_Ptr, Index_Nb, Type_Ptr, Manager_Name, Manager_Ptr, Allocator_Name, Allocator_Ptr, Deallocator_Name, Deallocator_Ptr, Own_Value, Data_Ptr)) != NDS_OK) { return( status); } @@ -2368,9 +2368,9 @@ NDT_Status ND_DataStruct_Info_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Recu status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_MANAGER_VERSION, &version_name); if( ND_ERROR( status)) return( status); - fprintf( Out, "%sRoot: (%s%p)\tIndex Nb: (%d)\tIndex Open Count: (%d)\tManager: (%s%p) [%s]\n%sAllocator: (%s%p) [%s]\tDesallocator: (%s%p) [%s]\tUser: (%s%p)\n%sManager Version: [%s]\n\n", + fprintf( Out, "%sRoot: (%s%p)\tIndex Nb: (%d)\tIndex Open Count: (%d)\tManager: (%s%p) [%s]\n%sAllocator: (%s%p) [%s]\tDeallocator: (%s%p) [%s]\tUser: (%s%p)\n%sManager Version: [%s]\n\n", offset, NDD_PRINTF_PTR_PREFIX, Root_Ptr, Root_Ptr->Index_Nb, Root_Ptr->Index_Open_Count, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Manager_Ptr, Root_Ptr->Manager_Name, - offset, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Allocator_Ptr, Root_Ptr->Allocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Desallocator_Ptr, Root_Ptr->Desallocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->User_Ptr, + offset, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Allocator_Ptr, Root_Ptr->Allocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Deallocator_Ptr, Root_Ptr->Deallocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->User_Ptr, offset, version_name); } @@ -4150,27 +4150,27 @@ NDT_Status ND_Allocator_Exec_C( void **Ptr_Ptr, size_t Size, NDT_Allocator_Na /* (I) Data : données utilisateur utiles à l'allocateur */ /*------------------------------------------------------------------------------*/ -NDT_Status ND_Desallocator_Exec_I( void *Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, void *Data_Ptr) +NDT_Status ND_Deallocator_Exec_I( void *Ptr, NDT_Deallocator_Name Deallocator_Name, NDT_Deallocator *Deallocator_Ptr, void *Data_Ptr) { - NDT_Desallocator *desallocator_ptr; + NDT_Deallocator *deallocator_ptr; - if( Desallocator_Ptr != NULL) + if( Deallocator_Ptr != NULL) { - desallocator_ptr = Desallocator_Ptr; + deallocator_ptr = Deallocator_Ptr; } else { - if( ND_Symbol_Find( (void **)&desallocator_ptr, Desallocator_Name) != NDS_OK) + if( ND_Symbol_Find( (void **)&deallocator_ptr, Deallocator_Name) != NDS_OK) { - sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_I: cant't find desallocator function"); + sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_I: cant't find deallocator function"); ND_Error_Print(); return( NDS_KO); } } - return( desallocator_ptr( Ptr, Data_Ptr)); + return( deallocator_ptr( Ptr, Data_Ptr)); } @@ -4185,25 +4185,25 @@ NDT_Status ND_Desallocator_Exec_I( void *Ptr, NDT_Desallocator_Name Desallocat /* (I) Data : données utilisateur utiles à l'allocateur */ /*------------------------------------------------------------------------------*/ -NDT_Status ND_Desallocator_Exec_C( void *Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, void *Data_Ptr) +NDT_Status ND_Deallocator_Exec_C( void *Ptr, NDT_Deallocator_Name Deallocator_Name, NDT_Deallocator *Deallocator_Ptr, void *Data_Ptr) { if( NDG_Base.Open_Status != NDD_TRUE) { - sprintf( NDG_Base.Err_String, "Error ND_Desallocator_Exec_C: library is not open"); + sprintf( NDG_Base.Err_String, "Error ND_Deallocator_Exec_C: library is not open"); ND_Error_Print(); return( NDS_ERRAPI); } - if( ( Desallocator_Name == NULL) && ( Desallocator_Ptr == NULL)) + if( ( Deallocator_Name == NULL) && ( Deallocator_Ptr == NULL)) { - sprintf( NDG_Base.Err_String, "Error ND_Desallocator_Exec_C: undefined function name"); + sprintf( NDG_Base.Err_String, "Error ND_Deallocator_Exec_C: undefined function name"); ND_Error_Print(); return( NDS_ERRAPI); } - return( ND_Desallocator_Exec_I( Ptr, Desallocator_Name, Desallocator_Ptr, Data_Ptr)); + return( ND_Deallocator_Exec_I( Ptr, Deallocator_Name, Deallocator_Ptr, Data_Ptr)); } @@ -4318,7 +4318,7 @@ NDT_Status ND_Node_Alloc( NDT_Root *Root_Ptr, NDT_Node **Node_Ptr_Ptr ) /*------------------------------------------------------------------------------*/ NDT_Status ND_Node_Free( NDT_Root *Root_Ptr, NDT_Node *Node_Ptr) { - return( ND_Desallocator_Exec_I( Node_Ptr, Root_Ptr->Desallocator_Name, Root_Ptr->Desallocator_Ptr, Root_Ptr->User_Ptr)); + return( ND_Deallocator_Exec_I( Node_Ptr, Root_Ptr->Deallocator_Name, Root_Ptr->Deallocator_Ptr, Root_Ptr->User_Ptr)); } @@ -4331,7 +4331,7 @@ NDT_Status ND_Node_Free( NDT_Root *Root_Ptr, NDT_Node *Node_Ptr) /* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ /* (I) Type: type de la structure.de données (liste ou arbre binaire) */ /* (I) Allocator: pointeur vers la fonction d'allocation */ -/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Deallocator: pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ /*------------------------------------------------------------------------------*/ @@ -4364,11 +4364,11 @@ NDT_Status ND_Index_Clear( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id) /* (O) New_Root: adresse du pointeur sur la nouvelle racine */ /* (I) Type: type de la structure de données */ /* (I) Allocator: pointeur vers la fonction d'allocation */ -/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Deallocator: pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /*------------------------------------------------------------------------------*/ -NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb, NDT_Index_Type *Type_Ptr, char *Manager_Name, NDT_Manager *Manager_Ptr, char *Allocator_Name, NDT_Allocator *Allocator_Ptr, char *Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, short Own_Value, void *Data_Ptr) +NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb, NDT_Index_Type *Type_Ptr, char *Manager_Name, NDT_Manager *Manager_Ptr, char *Allocator_Name, NDT_Allocator *Allocator_Ptr, char *Deallocator_Name, NDT_Deallocator *Deallocator_Ptr, short Own_Value, void *Data_Ptr) { NDT_Status status; NDT_Index_Id index_id; @@ -4385,9 +4385,9 @@ NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb, strcpy( (*Root_Ptr_Ptr)->Allocator_Name, Allocator_Name); (*Root_Ptr_Ptr)->Allocator_Ptr = Allocator_Ptr; - if( strlen(Desallocator_Name) > NDD_DESALLOCATOR_NAME_LEN_MAX) return( NDS_ERRAPI); - strcpy( (*Root_Ptr_Ptr)->Desallocator_Name, Desallocator_Name); - (*Root_Ptr_Ptr)->Desallocator_Ptr = Desallocator_Ptr; + if( strlen(Deallocator_Name) > NDD_DEALLOCATOR_NAME_LEN_MAX) return( NDS_ERRAPI); + strcpy( (*Root_Ptr_Ptr)->Deallocator_Name, Deallocator_Name); + (*Root_Ptr_Ptr)->Deallocator_Ptr = Deallocator_Ptr; (*Root_Ptr_Ptr)->Own_Value = Own_Value; (*Root_Ptr_Ptr)->User_Ptr = Data_Ptr; @@ -4429,7 +4429,7 @@ NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb, /*------------------------------------------------------------------------------*/ NDT_Status ND_Node_Root_Free( NDT_Root *Root_Ptr) { - return( ND_Desallocator_Exec_I( Root_Ptr, Root_Ptr->Desallocator_Name, Root_Ptr->Desallocator_Ptr, Root_Ptr->User_Ptr)); + return( ND_Deallocator_Exec_I( Root_Ptr, Root_Ptr->Deallocator_Name, Root_Ptr->Deallocator_Ptr, Root_Ptr->User_Ptr)); } @@ -5389,7 +5389,7 @@ NDT_Status ND_Default_Allocator( void **Ptr_Ptr, size_t Size, void *Data_Ptr /* Redéfinition de la fonction free() avec retour de type NDT_Status */ /*------------------------------------------------------------------------------*/ -NDT_Status ND_Default_Desallocator( void *Ptr, void *Data_Ptr) +NDT_Status ND_Default_Deallocator( void *Ptr, void *Data_Ptr) { if( !Ptr) return( NDS_ERRAPI); diff --git a/lib/libnode.h b/lib/libnode.h index bd0f4fe..e6343b8 100644 --- a/lib/libnode.h +++ b/lib/libnode.h @@ -144,7 +144,7 @@ NDT_Status ND_Default_Allocator( void **, size_t, void *); /*------------------------------------------------------------------------------*/ /* Redéfinition de la fonction free() avec retour de type NDT_Status */ /*------------------------------------------------------------------------------*/ -NDT_Status ND_Default_Desallocator( void *, void *); +NDT_Status ND_Default_Deallocator( void *, void *); /*------------------------------------------------------------------------------*/ /* Création d'un noeud */ @@ -168,7 +168,7 @@ NDT_Status ND_Node_Free( NDT_Root *, NDT_Node *); /* (O) Root: adresse d'un pointeur sur la racine de la nouvelle structure */ /* (I) Type: type de la structure.de données (liste ou arbre binaire) */ /* (I) Allocator: pointeur vers la fonction d'allocation */ -/* (I) Desallocator: pointeur vers la fonction de désallocation */ +/* (I) Deallocator: pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /* (I) Own_Value : indique si la structure est propriétaire de ses valeurs */ /*------------------------------------------------------------------------------*/ @@ -180,10 +180,10 @@ NDT_Status ND_Index_Clear( NDT_Root *, NDT_Index_Id); /* (O) New_Root : adresse du pointeur sur la nouvelle racine */ /* (I) Type : type de la structure de données */ /* (I) Allocater : pointeur vers la fonction d'allocation */ -/* (I) Desallocater : pointeur vers la fonction de désallocation */ +/* (I) Deallocater : pointeur vers la fonction de désallocation */ /* (I) Data : pointeur de données utiles à l'allocateur */ /*------------------------------------------------------------------------------*/ -NDT_Status ND_Node_Root_Alloc( NDT_Root **, NDT_Index_Nb, NDT_Index_Type[], char *, NDT_Manager *, char *, NDT_Allocator *, char *, NDT_Desallocator *, short, void *); +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 *); /*------------------------------------------------------------------------------*/ /* Destruction d'une racine */ diff --git a/libnode.spec b/libnode.spec index 79aa5bf..925962b 100644 --- a/libnode.spec +++ b/libnode.spec @@ -1,5 +1,5 @@ Name: libnode -Version: 2.2.0 +Version: 2.3.0 %define release_nb 1 @@ -8,7 +8,7 @@ Release: %{release_nb}rx3 %define libnode_name %{name}-%{version}-%{release_nb} -%define source %{libnode_name}.src.tgz +%define source %{libnode_name}.tar.tgz @@ -17,10 +17,10 @@ Copyright: GPL/LGPL Group: Application/Utilitaires Distribution: Rx3 OpenSource Vendor: Rx3 -Packager: Arnaud G. Gibert +Packager: Arnaud G. GIBERT -Source: ftp://ftp.rx3.org/pub/arc/dvp/%{source} -Url: http://www.rx3.org/dvp/?dvp=libnode +Source: https://git.rx3.org/gitea/rx3/%{name}/archive/%{source} +Url: https://git.rx3.org/gitea/rx3/%{name} BuildRoot: %{_tmppath}/%{libnode_name}-buildroot AutoReqProv: no @@ -58,23 +58,27 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Sun Jun 6 2010 Arnaud G. Gibert 2.2.0-1rx3 +* Wed Aug 16 2023 Arnaud G. GIBERT 2.3.0-1rx3 +- Update to 2.3.0 release, +- Update Source and URL entry. + +* Sun Jun 6 2010 Arnaud G. GIBERT 2.2.0-1rx3 - Update to 2.2.0 release, - Update Source and URL entry. -* Mon Jan 24 2005 Arnaud G. Gibert 2.1.0-1rx3 +* Mon Jan 24 2005 Arnaud G. GIBERT 2.1.0-1rx3 - Update to 2.1.0 release, - Now use "rx3" as release suffix, - Fix copyright entry. -* Wed Jan 19 2005 Arnaud G. Gibert 2.0.7-1 +* Wed Jan 19 2005 Arnaud G. GIBERT 2.0.7-1 - Update to 2.0.7 release. -* Tue Aug 24 2004 Arnaud G. Gibert 2.0.6-1 +* Tue Aug 24 2004 Arnaud G. GIBERT 2.0.6-1 - Update to 2.0.6 release. -* Tue Jul 15 2003 Arnaud G. Gibert - 2.0.5-1 +* Tue Jul 15 2003 Arnaud G. GIBERT - 2.0.5-1 - Add release in libnode dir name support. -* Tue Jul 15 2003 Marc Regimbeau - 2.0.4-2 +* Tue Jul 15 2003 Marc REGIMBEAU - 2.0.4-2 - Initial release of this spec file.