Rename "demo0.*" into "nddemo0.*",

Rename "nddemo0.txt" into "nddemo0.dat".
This commit is contained in:
agibert 2003-07-16 00:13:20 +00:00
parent 69d684f700
commit 6410c70eb1

View File

@ -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 <stdio.h>
#include <errno.h>
#ifdef _LIBVER_SUPPORT
# include <ver.h>
#endif
#include <node.h>
//#include <windows.h>
#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
@ -77,7 +64,7 @@ typedef struct Demo_Value
/* 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);
@ -93,7 +80,7 @@ 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);
}
@ -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);
}
@ -678,33 +665,39 @@ 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");
}
*/