- Replace old RootDesc structure with a new DST_Root structure,

- Add support tot NDT_Root pointer in DS_DataStruct Alloc() & DS_DataStruct_Free().
- Impact dsbench.c.
This commit is contained in:
2024-05-03 00:32:08 +02:00
parent 6dccb387f7
commit 9fc9a44356
4 changed files with 457 additions and 216 deletions

View File

@@ -223,13 +223,13 @@ NDT_Index_Type DBD_IDX_TYPE_BALANCED_TREE = NDD_INDEX_STATUS_OPENED | NDD_INDEX
NDT_Status Module_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
void Menu_Print( FILE *, NDT_Root *);
void Menu_Print( FILE *, DST_Root *);
void Command_Get( int *, char **, char **, char **, FILE *, FILE *, short);
void Command_Exec_Begin_Print( FILE *, int);
void Command_Exec_End_Print( FILE *, int, cpt, int);
void Command_Index_Range_Get( FILE *, int *, int *, char *, char *, FILE *, int, char *);
void Command_Exec( NDT_Root **, FILE *, int, char *, char *, char *, FILE *);
void Batch_Run( NDT_Root **, FILE *, FILE *, short);
void Command_Exec( DST_Root **, FILE *, int, char *, char *, char *, FILE *);
void Batch_Run( DST_Root **, FILE *, FILE *, short);
@@ -588,7 +588,7 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
ND_VA_LIST_CLOSE( lib_args);
char *Root_Type;
DST_RootDesc *RootDesc;
// DST_RootDesc *RootDesc;
Command_Name = "NDD_CMD_INFO_PRINT";
@@ -682,7 +682,7 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
/* Menu_Print */
/*----------------------------------------------------------------------------*/
void Menu_Print( FILE *File_Output, NDT_Root *DS_Ptr)
void Menu_Print( FILE *File_Output, DST_Root *DS_Ptr)
{
short i;
char headc;
@@ -692,7 +692,7 @@ void Menu_Print( FILE *File_Output, NDT_Root *DS_Ptr)
for( i = 0; i < COMMAND_NB; i++)
{
if( ( DS_Ptr && ( Command_Tab[i].DS_State & DS_STATE_OPENED) && ( DS_Ptr->Index_Tab[0].Type & Command_Tab[i].Index_Type))
if( ( DS_Ptr && ( Command_Tab[i].DS_State & DS_STATE_OPENED) && ( DS_Ptr->ND_Root.Index_Tab[0].Type & Command_Tab[i].Index_Type))
|| ( !DS_Ptr && ( Command_Tab[i].DS_State & DS_STATE_CLOSED)))
{
headc = '-';
@@ -890,7 +890,7 @@ void Command_Index_Range_Get( FILE *File_Output, int *Low, int *High, char
/* Command_Exec */
/*----------------------------------------------------------------------------*/
void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, char *Arg1, char *Arg2, char *Arg3, FILE *File_Input)
void Command_Exec( DST_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, char *Arg1, char *Arg2, char *Arg3, FILE *File_Input)
{
DST_Status status;
int sub_choice_int1, sub_choice_int2, low, high, i, j, inc, nb_removed, nb_detected, nb_corrected;
@@ -1287,7 +1287,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
for( i = low; i <= high; i++)
{
ND_Index_Open( *DS_Ptr_Ptr, (NDT_Index_Id)i, DBD_IDX_TYPE_BALANCED_TREE);
ND_Index_Open( &( ( *DS_Ptr_Ptr)->ND_Root), (NDT_Index_Id)i, DBD_IDX_TYPE_BALANCED_TREE);
}
t_stop( t_exec);
@@ -1313,7 +1313,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
for( i = high; i >= low; i--)
{
ND_Index_Close( *DS_Ptr_Ptr, (NDT_Index_Id)i);
ND_Index_Close( &( ( *DS_Ptr_Ptr)->ND_Root), (NDT_Index_Id)i);
}
t_stop( t_exec);
@@ -1747,7 +1747,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
/* Batch_Run */
/*----------------------------------------------------------------------------*/
void Batch_Run( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, FILE *File_Input, short Interactive_Flag)
void Batch_Run( DST_Root **DS_Ptr_Ptr, FILE *File_Output, FILE *File_Input, short Interactive_Flag)
{
int choice;
char *arg1, *arg2, *arg3;
@@ -1786,7 +1786,7 @@ int main( int argc, char **argv)
{
int rc = 0;
LGT_Status lg_status;
NDT_Root *ds_ptr = NULL;
DST_Root *ds_ptr = NULL;
if( ( lg_status = LG_Library_Open( LGD_LOG_WRITER_DEFAULT, true)) != LGS_OK)