Fix LibVer support.
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
ifdef _LIBVER_SUPPORT
|
||||
DEP_STATIC += ../../libver/ver.h ../../libver/libver.a
|
||||
DEP_DYNAMIC += ../../libver/ver.h ../../libver/libver.so
|
||||
INCLUDE += -I ../../libver
|
||||
LIBDIR += -L ../../libver
|
||||
LIB_STATIC += ../../libver/libver.a
|
||||
LIB_DYNAMIC += -lver
|
||||
FLAG += -D_LIBVER_SUPPORT
|
||||
endif
|
||||
|
||||
all: demo0 demo0-static
|
||||
|
||||
demo0-static: demo0.c ../lib/node.h ../lib/libnode.a Makefile
|
||||
gcc -g -o demo0-static -I ../lib -ldl demo0.c ../lib/libnode.a
|
||||
demo0-static: demo0.c $(DEP_STATIC) ../lib/node.h ../lib/libnode.a Makefile
|
||||
gcc -g -o demo0-static $(FLAG) $(INCLUDE) -I ../lib demo0.c -ldl $(LIB_STATIC) ../lib/libnode.a
|
||||
|
||||
demo0: demo0.c ../lib/node.h ../lib/libnode.so Makefile
|
||||
gcc -g -o demo0 -I ../lib -L ../lib -ldl -lnode demo0.c
|
||||
demo0: demo0.c $(DEP_DYNAMIC) ../lib/node.h ../lib/libnode.so Makefile
|
||||
gcc -g -o demo0 $(FLAG) $(INCLUDE) -I ../lib $(LIBDIR) -L ../lib -ldl $(LIB_DYNAMIC) -lnode demo0.c
|
||||
|
||||
clean:
|
||||
rm -f demo0 demo0-static
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: nddemo0.c,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.1 $ */
|
||||
/* $Revision: 2.2 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2002/02/28 22:00:35 $ */
|
||||
/* $Date: 2003/01/17 08:07:46 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -31,11 +31,24 @@
|
||||
|
||||
#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( ndbench, "$Revision: 2.2 $", "$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 STRING_LEN (short)1024
|
||||
#define STRING_SIZE (short)(STRING_LEN + 1)
|
||||
@@ -64,7 +77,7 @@ typedef struct Demo_Value
|
||||
/* Prototypes */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status Manager_Demo_DS( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDT_Status Manager_Demo0_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);
|
||||
@@ -80,7 +93,7 @@ int main( int, char **);
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
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_Status Manager_Demo0_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;
|
||||
|
||||
@@ -94,7 +107,7 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
|
||||
Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||
|
||||
*Version_Name_Ptr = "$Revision: 2.1 $ $Name: $ $Date: 2002/02/28 22:00:35 $ $Author: agibert $";
|
||||
*Version_Name_Ptr = "$Revision: 2.2 $ $Name: $ $Date: 2003/01/17 08:07:46 $ $Author: agibert $";
|
||||
|
||||
return( NDS_OK);
|
||||
}
|
||||
@@ -576,7 +589,7 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
|
||||
|
||||
|
||||
|
||||
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_Demo0_DS", Manager_Demo0_DS, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK)
|
||||
{
|
||||
printf( "ND_DataStruct_Open() failed (%d) !\n", status);
|
||||
}
|
||||
@@ -665,39 +678,33 @@ 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");
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user