From 6410c70eb16ef833dd3607a3e781f97ce159a373 Mon Sep 17 00:00:00 2001 From: agibert Date: Wed, 16 Jul 2003 00:13:20 +0000 Subject: [PATCH] Rename "demo0.*" into "nddemo0.*", Rename "nddemo0.txt" into "nddemo0.dat". --- demo/nddemo0.c | 95 +++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/demo/nddemo0.c b/demo/nddemo0.c index d19d323..291656a 100644 --- a/demo/nddemo0.c +++ b/demo/nddemo0.c @@ -1,9 +1,9 @@ /*---------------------------------------------------------------------------------*/ /* $RCSfile: nddemo0.c,v $ */ /*---------------------------------------------------------------------------------*/ -/* $Revision: 2.4 $ */ +/* $Revision: 2.5 $ */ /* $Name: $ */ -/* $Date: 2003/01/23 00:23:08 $ */ +/* $Date: 2003/07/16 00:13:20 $ */ /* $Author: agibert $ */ /*---------------------------------------------------------------------------------*/ @@ -31,25 +31,12 @@ #include #include - -#ifdef _LIBVER_SUPPORT -# include -#endif - #include - //#include -#ifdef _LIBVER_SUPPORT - VER_INFO_EXPORT( demo0, "$Revision: 2.4 $", "$Name: $", __FILE__, "$Author: agibert $") -# define USAGE "Usage : %s [ --help | --version [-v]]\n" -#else -# define USAGE "Usage : %s [ --help]\n" -#endif - -#define DEMO_FILE_NAME "demo0.txt" +#define DEMO_FILE_NAME "nddemo0.dat" #define STRING_LEN (short)1024 #define STRING_SIZE (short)(STRING_LEN + 1) #define VAL_LEN (short)64 @@ -74,10 +61,10 @@ typedef struct Demo_Value /*---------------------------------------------------------------------------------*/ -/* Prototypes */ +/* Prototypes */ /*---------------------------------------------------------------------------------*/ -NDT_Status Manager_Demo0_DS( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); +NDT_Status Manager_Demo_DS( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); void DataStruct_Load( NDT_Root *, FILE *); void DataStruct_Load( NDT_Root *, FILE *); void Demo( char *, short); @@ -90,10 +77,10 @@ int main( int, char **); /*---------------------------------------------------------------------------------*/ -/* */ +/* */ /*---------------------------------------------------------------------------------*/ -NDT_Status Manager_Demo0_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) +NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) { NDT_Command_Name Command_Name; @@ -107,7 +94,7 @@ NDT_Status Manager_Demo0_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_N Command_Name = "NDD_CMD_MANAGER_VERSION"; - *Version_Name_Ptr = "$Revision: 2.4 $ $Name: $ $Date: 2003/01/23 00:23:08 $ $Author: agibert $"; + *Version_Name_Ptr = "$Revision: 2.5 $ $Name: $ $Date: 2003/07/16 00:13:20 $ $Author: agibert $"; return( NDS_OK); } @@ -364,8 +351,8 @@ NDT_Status Manager_Demo0_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_N Command_Name = "NDD_CMD_VALUE_PRINT"; - fprintf( Out, "Val0: (%s) Val1: (%s) Val2: (%s) %*sVal3: (%s)\n", - Value_Ptr->Val0, Value_Ptr->Val1, Value_Ptr->Val2, (8 - strlen(Value_Ptr->Val2)), " ", Value_Ptr->Val3); + fprintf( Out, "Val0: (%s) Val1: (%s) Val2: (%s) Val3: (%s)\n", + Value_Ptr->Val0, Value_Ptr->Val1, Value_Ptr->Val2, Value_Ptr->Val3); return( NDS_OK); } @@ -406,7 +393,7 @@ NDT_Status Manager_Demo0_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_N /*---------------------------------------------------------------------------------*/ -/* */ +/* */ /*---------------------------------------------------------------------------------*/ void DataStruct_Load( NDT_Root *ds_ptr, FILE *demo_file) @@ -551,7 +538,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr) /*---------------------------------------------------------------------------------*/ -/* */ +/* */ /*---------------------------------------------------------------------------------*/ void Demo( char *Demo_File_Name, short Optimized_Mode) @@ -589,7 +576,7 @@ void Demo( char *Demo_File_Name, short Optimized_Mode) - if( ( status = ND_DataStruct_Open( &demo_ds_ptr, INDEX_NB, index_type_ptr, "Manager_Demo0_DS", Manager_Demo0_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); } @@ -673,38 +660,44 @@ void Demo( char *Demo_File_Name, short Optimized_Mode) /*---------------------------------------------------------------------------------*/ -/* */ +/* */ /*---------------------------------------------------------------------------------*/ int main( int argc, char **argv) { - /* Args Parsing */ - - if( argc >= 2) - { - if( !strcmp( argv[1], "--help")) - { - fprintf( stderr, USAGE, argv[0]); - return( 1); - } -#ifdef _LIBVER_SUPPORT - else if( !strcmp( argv[1], "--version")) - { - if( argc >= 3 && !strcmp( argv[2], "-v")) - { - return( VER_Object_Print( stdout, VERD_VERBOSE)); - } - else - { - return( VER_Object_Print( stdout, VERD_MINIMAL)); - } - } -#endif - } - printf( "Non Optimized Demo\n------------------\n\n\n"); Demo( DEMO_FILE_NAME, 0); printf( "\n\n\n\n\nOptimized Demo\n--------------\n\n\n"); 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"); +} +*/