diff --git a/util/ndbench.c b/util/ndbench.c index 383db66..9a43f1e 100644 --- a/util/ndbench.c +++ b/util/ndbench.c @@ -1,9 +1,9 @@ /*---------------------------------------------------------------------------------*/ /* $RCSfile: ndbench.c,v $ */ /*---------------------------------------------------------------------------------*/ -/* $Revision: 2.0 $ */ +/* $Revision: 2.1 $ */ /* $Name: $ */ -/* $Date: 2001/11/26 10:54:41 $ */ +/* $Date: 2002/02/25 23:35:51 $ */ /* $Author: agibert $ */ /*---------------------------------------------------------------------------------*/ @@ -44,7 +44,7 @@ /*---------------------------------------------------------------------------------*/ #ifdef _LIBVER -VER_INFO_EXPORT( ndbench, "$Revision: 2.0 $", "$Name: $", __FILE__, "$Author: agibert $") +VER_INFO_EXPORT( ndbench, "$Revision: 2.1 $", "$Name: $", __FILE__, "$Author: agibert $") #endif #define ND_MODE 1 @@ -241,7 +241,7 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod Command_Name = "NDD_CMD_MANAGER_VERSION"; - *Version_Name_Ptr = "$Revision: 2.0 $ $Name: $ $Date: 2001/11/26 10:54:41 $ $Author: agibert $"; + *Version_Name_Ptr = "$Revision: 2.1 $ $Name: $ $Date: 2002/02/25 23:35:51 $ $Author: agibert $"; return( NDS_OK); } @@ -791,7 +791,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha order = atoi( Arg2); - fprintf( File_Output, "DS_Value_Add: from: (%d) to: (%d) order: (%d)...\n", low, high, order); + fprintf( File_Output, "DS_Value_Add: Adding from: (%d) to: (%d) order: (%d)...\n", low, high, order); fflush( File_Output); t_start( t_exec); @@ -962,7 +962,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha if( low != -1) { - fprintf( File_Output, "Index_List_Open: Open a FIFO List from: (%d) to: (%d)...\n", low, high); + fprintf( File_Output, "Index_List_Open: Opening a FIFO List from: (%d) to: (%d)...\n", low, high); fflush( File_Output); t_start( t_exec); @@ -987,7 +987,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha if( low != -1) { - fprintf( File_Output, "Index_Tree_Open: Open a balanced Tree from: (%d) to: (%d)...\n", low, high); + fprintf( File_Output, "Index_Tree_Open: Opening a balanced Tree from: (%d) to: (%d)...\n", low, high); fflush( File_Output); t_start( t_exec); @@ -1005,6 +1005,31 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha break; } + case INDEX_CLOSE: + { + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); + + if( low != -1) + { + + fprintf( File_Output, "Index_Close: Closing index from: (%d) to: (%d)...\n", low, high); + fflush( File_Output); + + t_start( t_exec); + + for( i = high; i >= low; i--) + { + ND_Index_Close( *DS_Ptr_Ptr, (NDT_Index_Id)i); + } + + t_stop( t_exec); + + Command_Exec_End_Print( File_Output, Choice, t_exec, high - low); + } + + break; + } + case INDEX_LIST_SUBTYPE_SET: { Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); @@ -1214,10 +1239,18 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha case INDEX_INFO_PRINT: { - fprintf( File_Output, "DS_Info_Print:\n"); - fflush( File_Output); + Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); - ND_DataStruct_Info_Print( File_Output, *DS_Ptr_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, 99, 0); + if( low != -1) + { + fprintf( File_Output, "DS_Info_Print: Printing index from: (%d) to: (%d)...\n", low, high); + fflush( File_Output); + + for( i = low; i <= high; i++) + { + ND_Index_Info_Print( File_Output, *DS_Ptr_Ptr, (NDT_Index_Id)i, NDD_RECURSIVE_MODE_PARENT_CHILD, 99, 0); + } + } break; } @@ -1344,7 +1377,7 @@ int main( int argc, char ** argv) int Debug = NDD_TRUE; - /* Lancement de commande en mode batch */ + /* Args Parsing */ if( argc >= 2) { @@ -1370,6 +1403,8 @@ int main( int argc, char ** argv) } else if( !strcmp( argv[1], "--batch_run")) { + /* Batch Mode */ + ND_Library_Open( Debug); Command_Exec( &ds_ptr, stdout, BATCH_RUN, argv[2], NULL, stdin); @@ -1385,7 +1420,9 @@ int main( int argc, char ** argv) } } - /* Lancement du menu intercatif */ + + + /* Interactive Mode */ ND_Library_Open( Debug);