Add ND_Library_Open() and ND_Library_Close() calls,

Code clean up.
This commit is contained in:
agibert 2004-08-01 23:35:39 +00:00
parent 126de83bc9
commit 3c40fadbff

View File

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: nddemo0.c,v $ */ /* $RCSfile: nddemo0.c,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.6 $ */ /* $Revision: 2.7 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2004/06/17 22:28:52 $ */ /* $Date: 2004/08/01 23:35:39 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -31,8 +31,8 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <node.h> #include <node.h>
//#include <windows.h>
@ -94,7 +94,7 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
Command_Name = "NDD_CMD_MANAGER_VERSION"; Command_Name = "NDD_CMD_MANAGER_VERSION";
*Version_Name_Ptr = "$Revision: 2.6 $ $Name: $ $Date: 2004/06/17 22:28:52 $ $Author: agibert $"; *Version_Name_Ptr = "$Revision: 2.7 $ $Name: $ $Date: 2004/08/01 23:35:39 $ $Author: agibert $";
return( NDS_OK); return( NDS_OK);
} }
@ -563,6 +563,16 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
FILE *demo_file; FILE *demo_file;
printf( "Open library: ");
if( ( status = ND_Library_Open( NDD_TRUE)) != NDS_OK)
{
printf( "ND_Library_Open() failed (%d) !\n", status);
}
else
{
printf( "Ok !\n");
printf( "Create demo DataStructure: "); printf( "Create demo DataStructure: ");
if( Optimized_Mode) if( Optimized_Mode)
@ -574,8 +584,6 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
index_type_ptr = index_type_final_tab; index_type_ptr = index_type_final_tab;
} }
if( ( status = ND_DataStruct_Open( &demo_ds_ptr, INDEX_NB, index_type_ptr, "Manager_Demo_DS", Manager_Demo_DS, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK) if( ( status = ND_DataStruct_Open( &demo_ds_ptr, INDEX_NB, index_type_ptr, "Manager_Demo_DS", Manager_Demo_DS, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK)
{ {
printf( "ND_DataStruct_Open() failed (%d) !\n", status); printf( "ND_DataStruct_Open() failed (%d) !\n", status);
@ -641,7 +649,6 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
} }
printf( "Close demo DataStructure: "); printf( "Close demo DataStructure: ");
if( ( status = ND_DataStruct_Close( demo_ds_ptr)) != NDS_OK) if( ( status = ND_DataStruct_Close( demo_ds_ptr)) != NDS_OK)
@ -653,6 +660,18 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
printf( "Ok !\n"); printf( "Ok !\n");
} }
} }
printf( "Close library: ");
if( ( status = ND_Library_Close()) != NDS_OK)
{
printf( "ND_Library_Close() failed (%d) !\n", status);
}
else
{
printf( "Ok !\n");
}
}
} }
@ -670,34 +689,4 @@ int main( int argc, char **argv)
printf( "\n\n\n\n\nOptimized Demo\n--------------\n\n\n"); printf( "\n\n\n\n\nOptimized Demo\n--------------\n\n\n");
Demo( DEMO_FILE_NAME, 1); Demo( DEMO_FILE_NAME, 1);
{
/*
HMODULE my_module;
char buf[256];
FARPROC my_function;
my_module = GetModuleHandle( NULL);
printf( "Module_Handle: (%p)\n", my_module);
buf[0] = '\0';
GetModuleFileName( my_module, buf, 255);
printf( "Module_Name: (%s)\n", buf);
my_function = GetProcAddress( my_module, "zob");
printf( "Function_Addr: (%p)\n", my_function);
my_function();
*/
}
} }
/*
__declspec(dllexport) void zob(void)
{
printf( "Zoby la mouche qui pête...!!!\n");
}
*/