- Add DS_DataStruct_Value_Find(), DS_Index_Reorg(),

- DSBech: Implement DS_Value_Remove, DS_Value_Find, Index_Close, Index_Reorg, Index_List_To_Tree & Index_Tree_To_List commands.
This commit is contained in:
2024-05-04 18:43:08 +02:00
parent 9fc9a44356
commit 618e86de1b
4 changed files with 323 additions and 226 deletions

View File

@@ -241,16 +241,18 @@ typedef struct DST_RootDescZ
# define DS_DataStruct_Reorg DS_DataStruct_Reorg_I
# define DS_DataStruct_Traverse DS_DataStruct_Traverse_I
# define DS_DataStruct_Info_Print DS_DataStruct_Info_Print_I
# define DS_DataStruct_Value_Print DS_DataStruct_Value_Print_I
# define DS_DataStruct_Print DS_DataStruct_Print_I
# define DS_DataStruct_Lock DS_DataStruct_Lock_I
# define DS_DataStruct_Unlock DS_DataStruct_Unlock_I
# define DS_DataStruct_Value_Add DS_DataStruct_Value_Add_I
# define DS_DataStruct_Value_Remove DS_DataStruct_Value_Remove_I
# define DS_DataStruct_Value_Print DS_DataStruct_Value_Print_I
# define DS_DataStruct_Value_Find DS_DataStruct_Value_Find_I
# define DS_Index_Open DS_Index_Open_I
# define DS_Index_Close DS_Index_Close_I
# define DS_Index_Convert DS_Index_Convert_I
# define DS_Index_Reorg DS_Index_Reorg_I
# define DS_Node_Root_Get DS_Node_Root_Get_I
# define DS_Node_First_Get DS_Node_First_Get_I
@@ -287,17 +289,19 @@ typedef struct DST_RootDescZ
# define DS_DataStruct_Traverse DS_DataStruct_Traverse_L
# define DS_DataStruct_Convert DS_DataStruct_Convert_L
# define DS_DataStruct_Info_Print DS_DataStruct_Info_Print_L
# define DS_DataStruct_Value_Print DS_DataStruct_Value_Print_L
# define DS_DataStruct_Print DS_DataStruct_Print_L
# define DS_DataStruct_Check DS_DataStruct_Check_L
# define DS_DataStruct_Lock DS_DataStruct_Lock_L
# define DS_DataStruct_Unlock DS_DataStruct_Unlock_L
# define DS_DataStruct_Value_Add DS_DataStruct_Value_Add_L
# define DS_DataStruct_Value_Remove DS_DataStruct_Value_Remove_L
# define DS_DataStruct_Value_Print DS_DataStruct_Value_Print_L
# define DS_DataStruct_Value_Find DS_DataStruct_Value_Find_L
# define DS_Index_Open DS_Index_Open_L
# define DS_Index_Close DS_Index_Close_L
# define DS_Index_Convert DS_Index_Convert_L
# define DS_Index_Reorg DS_Index_Reorg_L
# define DS_Node_Root_Get DS_Node_Root_Get_L
# define DS_Node_First_Get DS_Node_First_Get_L
@@ -333,16 +337,18 @@ typedef struct DST_RootDescZ
# define DS_DataStruct_Reorg DS_DataStruct_Reorg_CL
# define DS_DataStruct_Traverse DS_DataStruct_Traverse_CL
# define DS_DataStruct_Info_Print DS_DataStruct_Info_Print_CL
# define DS_DataStruct_Value_Print DS_DataStruct_Value_Print_CL
# define DS_DataStruct_Print DS_DataStruct_Print_CL
# define DS_DataStruct_Lock DS_DataStruct_Lock_CL
# define DS_DataStruct_Unlock DS_DataStruct_Unlock_CL
# define DS_DataStruct_Value_Add DS_DataStruct_Value_Add_CL
# define DS_DataStruct_Value_Remove DS_DataStruct_Value_Remove_CL
# define DS_DataStruct_Value_Print DS_DataStruct_Value_Print_CL
# define DS_DataStruct_Value_Find DS_DataStruct_Value_Find_CL
# define DS_Index_Open DS_Index_Open_CL
# define DS_Index_Close DS_Index_Close_CL
# define DS_Index_Convert DS_Index_Convert_CL
# define DS_Index_Reorg DS_Index_Reorg_CL
# define DS_Node_Root_Get DS_Node_Root_Get_CL
# define DS_Node_First_Get DS_Node_First_Get_CL
@@ -560,6 +566,51 @@ DSD_API DST_Status DS_DataStruct_Value_Add_CL( DST_Root *Root_Ptr, void *Valu
/*----------------------------------------------------------------------------*/
/* Remove the first matching value from a data structure */
/*----------------------------------------------------------------------------*/
/* (I) Root_Ptr: Data structure pointer */
/* (I) Ref_Value_Ptr: Reference value pointer to search */
/*----------------------------------------------------------------------------*/
DSD_API DST_Status DS_DataStruct_Value_Remove_I( DST_Root *Root_Ptr, void *Ref_Value_Ptr);
DSD_API DST_Status DS_DataStruct_Value_Remove_L( DST_Root *Root_Ptr, void *Ref_Value_Ptr);
DSD_API DST_Status DS_DataStruct_Value_Remove_CL( DST_Root *Root_Ptr, void *Ref_Value_Ptr);
/*----------------------------------------------------------------------------*/
/* 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 */
/*----------------------------------------------------------------------------*/
DSD_API DST_Status DS_DataStruct_Value_Print_I( FILE *Out_Ptr, DST_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...);
DSD_API DST_Status DS_DataStruct_Value_Print_L( FILE *Out_Ptr, DST_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...);
DSD_API DST_Status DS_DataStruct_Value_Print_CL( FILE *Out_Ptr, DST_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...);
/*----------------------------------------------------------------------------*/
/* 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 */
/*----------------------------------------------------------------------------*/
DSD_API DST_Status DS_DataStruct_Value_Find_I( void **Value_Ptr_Ptr, DST_Root *Root_Ptr, void *Ref_Value_Ptr, ...);
DSD_API DST_Status DS_DataStruct_Value_Find_C( void **Value_Ptr_Ptr, DST_Root *Root_Ptr, void *Ref_Value_Ptr, ...);
DSD_API DST_Status SD_DataStruct_Value_Find_CL( void **Value_Ptr_Ptr, DST_Root *Root_Ptr, void *Ref_Value_Ptr, ...);
/*----------------------------------------------------------------------------*/
/* Parcours de tous les noeuds d'une structure de données et exécution d'une */
/* commande sur chacun d'eux */
@@ -588,23 +639,6 @@ DSD_API DST_Status DS_DataStruct_Print_CL( NDT_Root * Root, FILE * Out);
/*----------------------------------------------------------------------------*/
/* 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 */
/*----------------------------------------------------------------------------*/
DSD_API DST_Status DS_DataStruct_Value_Print_I( FILE *Out_Ptr, DST_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...);
DSD_API DST_Status DS_DataStruct_Value_Print_L( FILE *Out_Ptr, DST_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...);
DSD_API DST_Status DS_DataStruct_Value_Print_CL( FILE *Out_Ptr, DST_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, ...);
/*----------------------------------------------------------------------------*/
/* Create a new index */
/*----------------------------------------------------------------------------*/
@@ -613,9 +647,9 @@ DSD_API DST_Status DS_DataStruct_Value_Print_CL( FILE *Out_Ptr, DST_Root *Roo
/* (I) Index_Type: Index type (List, tree, ...) */
/*----------------------------------------------------------------------------*/
DSD_API NDT_Status DS_Index_Open_I( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API NDT_Status DS_Index_Open_L( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API NDT_Status DS_Index_Open_CL( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API DST_Status DS_Index_Open_I( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API DST_Status DS_Index_Open_L( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API DST_Status DS_Index_Open_CL( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
@@ -626,9 +660,9 @@ DSD_API NDT_Status DS_Index_Open_CL( DST_Root *Root_Ptr, NDT_Index_Id Index_I
/* (I) Index_Id: Id of the index */
/*----------------------------------------------------------------------------*/
DSD_API NDT_Status DS_Index_Close_I( DST_Root *Root_Ptr, NDT_Index_Id Index_Id);
DSD_API NDT_Status DS_Index_Close_L( DST_Root *Root_Ptr, NDT_Index_Id Index_Id);
DSD_API NDT_Status DS_Index_Close_CL( DST_Root *Root_Ptr, NDT_Index_Id Index_Id);
DSD_API DST_Status DS_Index_Close_I( DST_Root *Root_Ptr, NDT_Index_Id Index_Id);
DSD_API DST_Status DS_Index_Close_L( DST_Root *Root_Ptr, NDT_Index_Id Index_Id);
DSD_API DST_Status DS_Index_Close_CL( DST_Root *Root_Ptr, NDT_Index_Id Index_Id);
@@ -640,9 +674,24 @@ DSD_API NDT_Status DS_Index_Close_CL( DST_Root *Root_Ptr, NDT_Index_Id Index_
/* (I) Index_Type: Index type (List, tree, ...) */
/*----------------------------------------------------------------------------*/
DSD_API NDT_Status DS_Index_Convert_I( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API NDT_Status DS_Index_Convert_L( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API NDT_Status DS_Index_Convert_CL( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API DST_Status DS_Index_Convert_I( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API DST_Status DS_Index_Convert_L( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type Index_Type);
DSD_API DST_Status DS_Index_Convert_CL( DST_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Index_Type 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 */
/*----------------------------------------------------------------------------*/
DSD_API DST_Status DS_Index_Reorg_I( DST_Root *Root_Ptr, NDT_Index_Id Index_Id);
DSD_API DST_Status DS_Index_Reorg_L( DST_Root *Root_Ptr, NDT_Index_Id Index_Id);
DSD_API DST_Status DS_Index_Reorg_CL( DST_Root *Root_Ptr, NDT_Index_Id Index_Id);
@@ -752,30 +801,16 @@ DSD_API DST_Status DS_Value_Alloc_CL( void **Value_Ptr_Ptr, DST_Root *Root_Pt
/*----------------------------------------------------------------------------*/
/* Suppression du premier noeud correspondant à une valeur donnée */
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de la structure de données */
/* (I) Reference_Value : pointeur sur la valeur de référence */
/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */
/*----------------------------------------------------------------------------*/
/*
DSD_API DST_Status DS_Value_Remove_I( NDT_Root * Root, void * Reference_Value, void ** Removed_Value);
DSD_API DST_Status DS_Value_Remove_L( NDT_Root * Root, void * Reference_Value, void ** Removed_Value);
DSD_API DST_Status DS_Value_Remove_CL( NDT_Root * Root, void * Reference_Value, void ** Removed_Value);
/*----------------------------------------------------------------------------*/
/* Désallocation d'une valeur d'une structure de données */
/*----------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de la structure de données */
/* (I) Value : pointeur sur la valeur à désallouer */
/*----------------------------------------------------------------------------*/
/*
DSD_API DST_Status DS_Value_Free_I( NDT_Root * Root, void * Value);
DSD_API DST_Status DS_Value_Free_L( NDT_Root * Root, void * Value);
DSD_API DST_Status DS_Value_Free_CL( NDT_Root * Root, void * Value);
DSD_API DST_Status DS_Value_Free_I( DST_Root *Root_Ptr, void *Value_Ptr);
DSD_API DST_Status DS_Value_Free_L( DST_Root *Root_Ptr, void *Value_Ptr);
DSD_API DST_Status DS_Value_Free_CL( DST_Root *Root_Ptr, void *Value_Ptr);