- Implement DS_DataStruct_Close_I(), DS_DataStruct_Alloc(), DS_DataStruct_Free(),
- Fix DS_Name_Prefix() implementation (As for ShMemLib), - Debug with dsbech: CREATE_STRUCT, OPEN_STRUCT, CLOSE_STRUCT, DELETE_STRUCT.
This commit is contained in:
@@ -636,23 +636,25 @@ int main( int argc, char **argv)
|
||||
LG_LOG_ERROR_1( "Can't create data structure: (%d)", status);
|
||||
}
|
||||
else
|
||||
{
|
||||
// strcpy( Root->Manager, "Module_Manager");
|
||||
|
||||
{
|
||||
LG_LOG_INFO_1( "Data structure: [%s] created", DataStruct_Name);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
/*
|
||||
|
||||
case DELETE_STRUCT:
|
||||
{
|
||||
if (DS_DataStruct_Close (Root, DSD_DESTROY) == DSS_KO) printf ("\nNOK\n");
|
||||
if( ( status = DS_DataStruct_Close( Root_Ptr, DSD_DESTROY)) != DSS_OK)
|
||||
{
|
||||
LG_LOG_ERROR_2( "Can't delete data structure: [%s], status: (%d)", DataStruct_Name, status);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\nStructure détruite : OK\n");
|
||||
Root = NULL;
|
||||
LG_LOG_INFO_1( "Data structure: [%s] deleted", DataStruct_Name);
|
||||
|
||||
Root_Ptr = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -661,28 +663,42 @@ int main( int argc, char **argv)
|
||||
case OPEN_STRUCT:
|
||||
{
|
||||
fprintf (stdout, "\nNom de la structure à ouvrir ? ");
|
||||
gets (DataStruct_Name);
|
||||
|
||||
if (DS_DataStruct_Open (DataStruct_Name, &Root, 0, NULL, 0, DSD_OPEN, TRUE) == NDS_KO)
|
||||
printf ("\nNOK\n");
|
||||
fgets( DataStruct_Name, 100, stdin);
|
||||
if( strlen( DataStruct_Name) < 2)
|
||||
{
|
||||
fprintf( stdout, "Bad name!\n");
|
||||
}
|
||||
else
|
||||
printf ("\nStructure ouverte : OK\n");
|
||||
|
||||
{
|
||||
DataStruct_Name[ strlen( DataStruct_Name) - 1] = 0;
|
||||
if( ( status = DS_DataStruct_Open( &Root_Ptr, DataStruct_Name, 1, &index_type, "Module_Manager", 0, DSD_OPEN, TRUE)) != DSS_OK)
|
||||
{
|
||||
LG_LOG_ERROR_1( "Can't open data structure: (%d)", status);
|
||||
}
|
||||
else
|
||||
{
|
||||
LG_LOG_INFO_1( "Data structure: [%s] opened", DataStruct_Name);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case CLOSE_STRUCT:
|
||||
{
|
||||
if (DS_DataStruct_Close (Root, DSD_CLOSE) == DSS_KO) printf ("\nNOK\n");
|
||||
if( ( status = DS_DataStruct_Close( Root_Ptr, DSD_CLOSE) != DSS_OK))
|
||||
{
|
||||
LG_LOG_ERROR_1( "Can't close data structure: (%d)", status);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\nStructure fermée : OK\n");
|
||||
Root = NULL;
|
||||
LG_LOG_INFO_1( "Data structure: [%s] Closed", DataStruct_Name);
|
||||
Root_Ptr = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
case FIND_VALUE:
|
||||
{
|
||||
fprintf (stdout, "\nPlage de recherche (?->?) : ");
|
||||
|
||||
Reference in New Issue
Block a user