- fix function header size,

- fix public API extern declaration.
This commit is contained in:
Arnaud G. GIBERT 2024-04-21 23:49:52 +02:00
parent 27f401dff6
commit 4fbe71e892
3 changed files with 1305 additions and 1301 deletions

View File

@ -770,7 +770,7 @@ typedef int NDT_Recursive_Offset;
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
# if defined( _WIN32) && !defined( LIBNODE_STATIC)
# ifndef _LIBNODE_C_
@ -779,45 +779,49 @@ typedef int NDT_Recursive_Offset;
# define NDD_DLL_API __declspec( dllexport)
# endif
# else
# ifndef _LIBNODE_C_
# define NDD_DLL_API
# else
# define NDD_DLL_API extern
# endif
# endif
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Library initialisation */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Debug_Mode: Open library in debug mode */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Library_Open_I ( int);
NDD_DLL_API NDT_Status ND_Library_Open_C ( int);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Library deinitialisation */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Library_Close_I( void);
NDD_DLL_API NDT_Status ND_Library_Close_C( void);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Library Standard Error output setup */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Stream: StdErr output stream */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_I( FILE *);
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Create a new data structure */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Root_Ptr_Ptr: Pointer adress of the new sata structure */
/* (I) Index_Nb: Number of index */
/* (I) Index_Type_Ptr: Array of Index type (List, tree, ...) */
@ -829,83 +833,83 @@ NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *);
/* (I) Deallocator_Ptr: Value deallocator function pointer */
/* (I) Own_Value: Flag indicating if the structure is the node owner */
/* (I) Data_Ptr: User pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
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 *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Destroy a data structure */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Close_I( NDT_Root *);
NDD_DLL_API NDT_Status ND_DataStruct_Close_C( NDT_Root *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Destroy all data of a data structure */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Flush_I( NDT_Root *);
NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Check & repare a datat structure: */
/* - Check & fix node links */
/* - Update data structure statistics */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (O) Error_Dectected_Nb_Ptr: Number of error detected pointer */
/* (O) Error_Corrected_Nb_Ptr: Number of error corected pointer */
/* (I) Out: Output stream */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Check_I( NDT_Root *, int *, int *, FILE *);
NDD_DLL_API NDT_Status ND_DataStruct_Check_C( NDT_Root *, int *, int *, FILE *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Convert a data structure indexe types */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Type_Ptr: Array of index type (List, tree, ...) */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Convert_I( NDT_Root *, NDT_Index_Type *);
NDD_DLL_API NDT_Status ND_DataStruct_Convert_C( NDT_Root *, NDT_Index_Type *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Reorganise a data structure indexes: */
/* - Sort a non-sorted list */
/* - Rebalance a non auto-balanced tree */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
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_Ptr: Data structure pointer */
/* (I) Command: Manager command */
/* (I) ...: User args */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *, NDT_Command, va_list *);
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *, NDT_Command, va_list *);
@ -914,55 +918,55 @@ NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command, ...
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Print data structure information */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Stream: Output stream */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Recursive_Mode: Child or Parent */
/* (I) Recursive_Depth: Curent recursion depth */
/* (I) Recursive_Offset: Curent print out offset */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_C( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Add a new value to a data structure */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Value_Ptr: Value pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_I( NDT_Root *, void *);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Remove the first matching value from a data structure */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Ref_Value_Ptr: Reference value pointer to search */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_I( NDT_Root *, void *);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Print all the data structure values */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Stream: Output stream */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Recursive_Mode: Child or Parent */
/* (I) Recursive_Depth: Curent recursion depth */
/* (I) Recursive_Offset: Curent print out offset */
/* (I) ...: User args */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_VI( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list *);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
@ -970,14 +974,14 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Find a value in a data structure */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Value_Ptr_Ptr: Value pointer address found */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Ref_Value_Ptr: Reference value pointer to search */
/* (I) ...: User args */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VI( void **, NDT_Root *, void *, va_list *);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VC( void **, NDT_Root *, void *, va_list *);
@ -986,95 +990,95 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_C( void **, NDT_Root *, void
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Create a new index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (I) Index_Type: Index type (List, tree, ...) */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Open_I( NDT_Root *, NDT_Index_Id, NDT_Index_Type);
NDD_DLL_API NDT_Status ND_Index_Open_C( NDT_Root *, NDT_Index_Id, NDT_Index_Type);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Remove an Index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Close_I( NDT_Root *, NDT_Index_Id);
NDD_DLL_API NDT_Status ND_Index_Close_C( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Remove an Index (Private API ?) */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Flush_I( NDT_Root *, NDT_Index_Id);
NDD_DLL_API NDT_Status ND_Index_Flush_C( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Check & repare a data structure index: */
/* - Check & fix node links */
/* - Update data structure statistics */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (O) Error_Dectected_Nb_Ptr: Number of error detected pointer */
/* (O) Error_Corrected_Nb_Ptr: Number of error corected pointer */
/* (I) Out: Output stream */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Check_I( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
NDD_DLL_API NDT_Status ND_Index_Check_C( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Convert a data structure index to another type */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (I) Index_Type: Index type (List, tree, ...) */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Convert_I ( NDT_Root *, NDT_Index_Id, NDT_Index_Type);
NDD_DLL_API NDT_Status ND_Index_Convert_C ( NDT_Root *, NDT_Index_Id, NDT_Index_Type);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Reorganise a data structure index: */
/* - Sort a non-sorted list */
/* - Rebalance a non auto-balanced tree */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Reorg_I( NDT_Root *, NDT_Index_Id);
NDD_DLL_API NDT_Status ND_Index_Reorg_C( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Traverse a data structure index & execute a command on each node */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (I) Command: Manager command */
/* (I) ...: User args */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Traverse_VI( NDT_Root *, NDT_Index_Id, NDT_Command, va_list *);
NDD_DLL_API NDT_Status ND_Index_Traverse_VC( NDT_Root *, NDT_Index_Id, NDT_Command, va_list *);
@ -1083,51 +1087,51 @@ NDD_DLL_API NDT_Status ND_Index_Traverse_C( NDT_Root *, NDT_Index_Id, NDT_Com
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Print data structure index information */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Stream: Output stream */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (I) Recursive_Mode: Child or Parent */
/* (I) Recursive_Depth: Curent recursion depth */
/* (I) Recursive_Offset: Curent print out offset */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Info_Print_I( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
NDD_DLL_API NDT_Status ND_Index_Info_Print_C( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Add a new value to a data structure index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (I) Value_Ptr: Value pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Value_Add_I( NDT_Root *, NDT_Index_Id, void *);
NDD_DLL_API NDT_Status ND_Index_Value_Add_C( NDT_Root *, NDT_Index_Id, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Remove the first matching value from a data structure index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (I) Ref_Value_Ptr: Reference value pointer to search */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Value_Remove_I( NDT_Root *, NDT_Index_Id, void *);
NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *, NDT_Index_Id, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Print all the data structure index values */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Stream: Output stream */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
@ -1135,7 +1139,7 @@ NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *, NDT_Index_Id, void
/* (I) Recursive_Depth: Curent recursion depth */
/* (I) Recursive_Offset: Curent print out offset */
/* (I) ...: User args */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Value_Print_VI( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list *);
NDD_DLL_API NDT_Status ND_Index_Value_Print_I( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
@ -1143,89 +1147,89 @@ NDD_DLL_API NDT_Status ND_Index_Value_Print_C( FILE *, NDT_Root *, NDT_Index
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Add a new node to a data structure index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (I) Node_Ptr: Node pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_Add_I( NDT_Root *, NDT_Index_Id, NDT_Node *);
NDD_DLL_API NDT_Status ND_Index_Node_Add_C( NDT_Root *, NDT_Index_Id, NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Remove a node from a data structure index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Node_Ptr: Node pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_Remove_I( NDT_Node *);
NDD_DLL_API NDT_Status ND_Index_Node_Remove_C( NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Get the first node of a data structure index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Node_Ptr_Ptr: Node pointer address */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_First_Get_I( NDT_Node **, NDT_Root *, NDT_Index_Id);
NDD_DLL_API NDT_Status ND_Index_Node_First_Get_C( NDT_Node **, NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Get the last node of a data structure index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Node_Ptr_Ptr: Node pointer address */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_Last_Get_I( NDT_Node **, NDT_Root *, NDT_Index_Id);
NDD_DLL_API NDT_Status ND_Index_Node_Last_Get_C( NDT_Node **, NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Get the next node of a data structure index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Node_Ptr_Ptr: Node pointer address */
/* (I) Node_Ptr: Node pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_Next_Get_I( NDT_Node **, NDT_Node *);
NDD_DLL_API NDT_Status ND_Index_Node_Next_Get_C( NDT_Node **, NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Get the previous node of a data structure index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Node_Ptr_Ptr: Node pointer address */
/* (I) Node_Ptr: Node pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_Previous_Get_I( NDT_Node **, NDT_Node *);
NDD_DLL_API NDT_Status ND_Index_Node_Previous_Get_C( NDT_Node **, NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Find a node from a value in a data structure index */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Node_Ptr_Ptr: Node pointer address */
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (I) Ref_Value_Ptr: Reference value pointer to search */
/* (I) ...: User args */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_Find_VI( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list *);
NDD_DLL_API NDT_Status ND_Index_Node_Find_VC( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list *);
@ -1234,52 +1238,52 @@ NDD_DLL_API NDT_Status ND_Index_Node_Find_C( NDT_Node **, NDT_Root *, NDT_In
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Get the root node of a data structure */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Root_Ptr_Ptr: Data structure pointer address */
/* (I) Node_Ptr: Node pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Node_Root_Get_I( NDT_Root **, NDT_Node *);
NDD_DLL_API NDT_Status ND_Node_Root_Get_C( NDT_Root **, NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Allocate a new value */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Value_Ptr_Ptr: Value pointer address */
/* (I) Root_Ptr: Data structure pointer */
/* (I) ...: User args */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Value_Alloc_I( void **, NDT_Root *, ...);
NDD_DLL_API NDT_Status ND_Value_Alloc_C( void **, NDT_Root *, ...);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Deallocate a value */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Value_Ptr: Value pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Value_Free_I( NDT_Root *, void *);
NDD_DLL_API NDT_Status ND_Value_Free_C( NDT_Root *, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Execute a manager command */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Index_Id: Id of the index */
/* (I) Node_Ptr: Node pointer */
/* (I) Command: Manager command */
/* (I) ...: User args */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Manager_Exec_VI( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
NDD_DLL_API NDT_Status ND_Manager_Exec_VC( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
@ -1288,28 +1292,28 @@ NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Execute an allocator function */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (O) Value_Ptr_Ptr: Value pointer address */
/* (I) Allocator_Name: Value allocator function name */
/* (I) Allocator_Ptr: Value allocator function pointer */
/* (I) Data_Ptr: User pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Allocator_Exec_I( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *);
NDD_DLL_API NDT_Status ND_Allocator_Exec_C( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Execute a deallocator function */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Value_Ptr: Value pointer */
/* (I) Allocator_Name: Value deallocator function name */
/* (I) Allocator_Ptr: Value deallocator function pointer */
/* (I) Data_Ptr: User pointer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
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 *);

File diff suppressed because it is too large Load Diff

View File

@ -129,185 +129,185 @@ NDT_Base NDG_Base =
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Fonctions et procédures privées de la librairie (moyen niveau) */
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Manager par défaut */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) va_list Arguments : Liste d'arguments contextuels */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_Default_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* OpenStruct Manager */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) va_list Arguments : Liste d'arguments contextuels */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_OpenStruct_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Redéfinition de la fonction malloc() avec retour de type NDT_Status */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
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_Deallocator( void *, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Création d'un noeud */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : adresse de la racine pour laquelle on crée un noeud */
/* (O) New_Node : adresse du pointeur sur le nouveau noeud */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_Node_Alloc( NDT_Root * Root, NDT_Node ** New_Node);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Destruction d'un noeud */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : adresse de la racine dans laquelle on détruit un noeud */
/* (I) Node : pointeur sur le noeud à détruire */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_Node_Free( NDT_Root *, NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Création d'une nouvelle structure de données */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (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) 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_Index_Clear( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Création de la racine d'une structure de données quelconque */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (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) 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_Deallocator *, short, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Destruction d'une racine */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine à détruire */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_Node_Root_Free( NDT_Root *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Ajout d'un noeud à une liste chaînée */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de la liste */
/* (I) New_Node : pointeur sur le noeud à ajouter */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_List_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Ajout d'une nouvelle valeur à une liste */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de la liste */
/* (I) Value : pointeur sur la valeur à ajouter */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_List_Value_Add( NDT_Root *, NDT_Index_Id, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Ajout d'un noeud à un arbre binaire */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de l'arbre */
/* (I) Value : pointeur sur la valeur à ajouter */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_Tree_Value_Add( NDT_Root *, NDT_Index_Id, void *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Supprime le noeud d'une liste */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Node : pointeur sur le noeud à supprimer */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_List_Node_Remove( NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Conversion d'une structure en liste chaînée */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine du la structure à convertir */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_List_Make( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Recherche une valeur dans une liste et retourne le noeud correspondant */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Conversion d'une structure en arbre binaire */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine du la structure à convertir */
/* (I) Type : type du futur arbre */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_Tree_Make( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Equilibrage d'un arbre */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de l'arbre */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_Tree_Equalize( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Retourne la profondeur de la plus grande branche à partir d'un noeud */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Node : pointeur sur le noeud */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
long ND_Tree_MaxDepth_Get( NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Retourne la profondeur de la plus petite branche à partir d'un noeud */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Node : pointeur sur le noeud */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
long ND_Tree_MinDepth_Get( NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Ajout d'un noeud à un arbre binaire */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de l'arbre */
/* (I) Node : pointeur sur le noeud à ajouter */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_Tree_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Ajoute tous les noeud d'une liste à un arbre */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Tree_Root : pointeur sur la racine de l'arbre */
/* (I) List_Root : pointeur sur la racine de la liste */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_Tree_List_Add( NDT_Root *, NDT_Index_Id, NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Fonction de comparaison de noeuds (pour le quick sort) */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
int ND_Node_Compare( void **, void **);
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Ordonne une liste chaînée selon l'algorithme du tri à bulle */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de la liste à trier */
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
NDT_Status ND_List_Sort( NDT_Root *, NDT_Index_Id);
@ -315,11 +315,11 @@ NDT_Status ND_List_Sort( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* PRIVATE FUNCTIONS */
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
void ND_List_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);