Change index type numeric print value from decimal to hexa in ND_Index_Info_Print_I() API,

Add new cases in ND_Index_Convert_I() handling (List->List:FIFO and List->List:LIFO).
This commit is contained in:
agibert 2002-04-09 17:08:17 +00:00
parent 5b48497b78
commit 882cde0d40

View File

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: libnode.c,v $ */ /* $RCSfile: libnode.c,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.5 $ */ /* $Revision: 2.6 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2002/02/28 21:53:47 $ */ /* $Date: 2002/04/09 17:08:17 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -34,7 +34,7 @@
#include <libnode.h> #include <libnode.h>
#ifdef _LIBVER #ifdef _LIBVER
VER_INFO_EXPORT (libnode,"$Revision: 2.5 $", "$Name: $",__FILE__,"$Author: agibert $") VER_INFO_EXPORT (libnode,"$Revision: 2.6 $", "$Name: $",__FILE__,"$Author: agibert $")
#endif #endif
@ -63,7 +63,7 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
Command_Name = "NDD_CMD_MANAGER_VERSION"; Command_Name = "NDD_CMD_MANAGER_VERSION";
*Version_Name_Ptr = "$Revision: 2.5 $ $Name: $ $Date: 2002/02/28 21:53:47 $ $Author: agibert $"; *Version_Name_Ptr = "$Revision: 2.6 $ $Name: $ $Date: 2002/04/09 17:08:17 $ $Author: agibert $";
return( NDS_OK); return( NDS_OK);
} }
@ -1066,19 +1066,31 @@ NDT_Status ND_Index_Convert_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
{ {
rc = ND_List_Sort( Root_Ptr, Index_Id); rc = ND_List_Sort( Root_Ptr, Index_Id);
if( ND_ERROR( rc)) return( rc); if( ND_ERROR( rc)) return( rc);
if( rc == NDS_OK) Root_Ptr->Index_Tab[Index_Id].Type = Target_Type;
Root_Ptr->Index_Tab[Index_Id].Type = Target_Type;
return( rc); return( rc);
} }
case( NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO):
case( NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_LIFO):
{
Root_Ptr->Index_Tab[Index_Id].Type = Target_Type;
return( NDS_OK);
}
case( NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED): case( NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_BALANCED):
case( NDD_INDEX_TYPE_TREE | NDD_INDEX_SUBTYPE_UNBALANCED):
{ {
rc = ND_List_Sort( Root_Ptr, Index_Id); rc = ND_List_Sort( Root_Ptr, Index_Id);
if( rc != NDS_OK) return( rc); if( rc != NDS_OK) return( rc);
rc = ND_Tree_Make( Root_Ptr, Index_Id); rc = ND_Tree_Make( Root_Ptr, Index_Id);
if( ND_ERROR( rc)) return( rc); if( ND_ERROR( rc)) return( rc);
if( rc == NDS_OK) Root_Ptr->Index_Tab[Index_Id].Type = Target_Type;
Root_Ptr->Index_Tab[Index_Id].Type = Target_Type;
return( rc); return( rc);
} }
@ -1103,7 +1115,10 @@ NDT_Status ND_Index_Convert_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
rc = ND_List_Make( Root_Ptr, Index_Id); rc = ND_List_Make( Root_Ptr, Index_Id);
if( ND_ERROR( rc)) return( rc); if( ND_ERROR( rc)) return( rc);
if( rc == NDS_OK) Root_Ptr->Index_Tab[Index_Id].Type = Target_Type;
Root_Ptr->Index_Tab[Index_Id].Type = Target_Type;
return( rc);
} }
default: default:
@ -1657,7 +1672,7 @@ NDT_Status ND_Index_Info_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id
memset( offset, ' ', Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET); memset( offset, ' ', Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET);
offset[Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET] = '\0'; offset[Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET] = '\0';
printf( "%s Index Id: (%d)\tType: (%d) [%s:%s:%s]\tNode Nb: (%d)\tHead: (%s%p)\tTail: (%s%p)\n%s Min Depth: (%d)\tMax Depth: (%d)\tMax Dif: (%d)\tNb Equ: (%d)\tSave: (%s%p)\n\n", printf( "%s Index Id: (%d)\tType: (%#06x) [%s:%s:%s]\tNode Nb: (%d)\tHead: (%s%p)\tTail: (%s%p)\n%s Min Depth: (%d)\tMax Depth: (%d)\tMax Dif: (%d)\tNb Equ: (%d)\tSave: (%s%p)\n\n",
offset, Index_Id, Root_Ptr->Index_Tab[Index_Id].Type, ND_INDEX_STATUS_ASCII_GET( Root_Ptr, Index_Id), ND_INDEX_TYPE_ASCII_GET( Root_Ptr, Index_Id), ND_INDEX_SUBTYPE_ASCII_GET( Root_Ptr, Index_Id), offset, Index_Id, Root_Ptr->Index_Tab[Index_Id].Type, ND_INDEX_STATUS_ASCII_GET( Root_Ptr, Index_Id), ND_INDEX_TYPE_ASCII_GET( Root_Ptr, Index_Id), ND_INDEX_SUBTYPE_ASCII_GET( Root_Ptr, Index_Id),
Root_Ptr->Index_Tab[Index_Id].Node_Number, Root_Ptr->Index_Tab[Index_Id].Node_Number,
NDD_PRINTF_PTR_PREFIX, Root_Ptr->Index_Tab[Index_Id].Head, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Index_Tab[Index_Id].Tail, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Index_Tab[Index_Id].Head, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Index_Tab[Index_Id].Tail,