23 Commits

Author SHA1 Message Date
agibert
97d57e391f Add Makefile.var auto version label detection to 2.0.7-1 entry. 2005-01-19 23:40:40 +00:00
agibert
d1778a5431 Add PROG_VERSION_NAME varible auto filling from CVS TAG. 2005-01-19 23:30:05 +00:00
agibert
416ee6de00 Update release to libnode-2.0.7-1. 2005-01-19 23:02:30 +00:00
agibert
8c1000401d Reorder priority...
Remove need of debuging !
2005-01-19 22:37:44 +00:00
agibert
11f4f585b3 Update to 2.0.7 release. 2005-01-19 22:34:04 +00:00
agibert
0990ad102d Add Linux 2.6.x and Windows XP. 2005-01-19 22:32:05 +00:00
agibert
da9d517e9a Add 2.0.7-1 entry: should be the final release of the 2.0 branch and minor bug fixes in ND_*_Info_Print() functions and ND_Library_StdErr_Set alias defines. 2005-01-19 22:29:05 +00:00
agibert
d50da065a6 Minor variable definition fix. 2005-01-19 20:07:51 +00:00
agibert
f8f96b1ec8 Fix CFLAGS definition. Previous prevents to set debug mode... 2005-01-19 16:50:19 +00:00
agibert
b49d497bfb Add unconditionally -rdynamic and -ldl to CFLAGS. 2005-01-11 21:03:53 +00:00
agibert
80665f9931 Add dynamic symbol support to ND_Allocator_Exec_I(), ND_Desallocator_Exec_I(), ND_Manager_Exec_I() and ND_Manager_Exec_VI() functions, in order to add LibShMem support.
Break NDT_Allocator() API !!!
Win32 not compatible... 8^(
Code Cleanup.
2005-01-11 20:57:04 +00:00
agibert
1d9539466d Fix ND_Library_StdErr_Set alias defines. 2005-01-11 16:27:13 +00:00
agibert
3ce278d6e5 Fix printf into fprint in ND_*_Info_Print() functions.\n 2005-01-11 16:17:44 +00:00
agibert
3d91078a5c Add Index_Value_Break andDS_Check commands. 2004-08-24 20:32:47 +00:00
agibert
51482fb475 Add Index_Value_Break and Index_Node_Break commands,
Improve random number generation.
2004-08-24 20:31:28 +00:00
agibert
75cfc21e01 Add ndbech random number improvement in 2.0.6-1 entry. 2004-08-24 20:30:23 +00:00
agibert
5aea056299 Update to 2.0.6 release. 2004-08-23 22:53:02 +00:00
agibert
3f6d118ae2 Code cleanup. 2004-08-23 22:48:37 +00:00
agibert
7c96ad706b Implement signal support for Windows target,
Fix NDT_Root header for HP compilation: Index default number goes from 0 to 1.
2004-08-23 22:47:22 +00:00
agibert
c70c4e5aba Add final updates in libnode (ND_Check for Windows target) and *Break cmd for ndbench. 2004-08-23 22:45:17 +00:00
agibert
7f142acda3 Add re-implementation of address checking in 2.0.6-1 entry.
Fix Micot project spelling.
2004-08-02 21:33:53 +00:00
agibert
64baaa1bc5 Re-implement for unix target, address checking in ND_Address_Check: now use sigaction() and siglingjmp() instead of signal().
Minor code clean-up.
2004-08-02 21:26:03 +00:00
agibert
77330558f0 Add 2.0.6-1 entry,
Add TIMA project reference in 2.0.0-alpha1 entry,
extend -*- separators from 80 to 132 cols.
2004-08-02 00:25:43 +00:00
14 changed files with 776 additions and 460 deletions

View File

@@ -1,7 +1,7 @@
# $RCSfile: Makefile.var,v $ # $RCSfile: Makefile.var,v $
# $Revision: 1.2 $ # $Revision: 1.4 $
# $Name: $ # $Name: $
# $Date: 2003/07/16 22:55:51 $ # $Date: 2005/01/19 23:30:05 $
# $Author: agibert $ # $Author: agibert $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
@@ -11,7 +11,13 @@
PROG_NAME=libnode PROG_NAME=libnode
PROG_VERSION_NAME=libnode-2.0.5-1 PROG_TAG=$Name: $
ifeq ($(words $(PROG_TAG)),2)
PROG_VERSION_NAME=$(subst _,.,$(word 2, $(PROG_TAG)))
else
PROG_VERSION_NAME=$(PROG_NAME)
endif
CC=/usr/bin/gcc CC=/usr/bin/gcc
AR=/usr/bin/ar AR=/usr/bin/ar

View File

@@ -1,7 +1,7 @@
# $RCSfile: ReadMe.txt,v $ # $RCSfile: ReadMe.txt,v $
# $Revision: 2.6 $ # $Revision: 2.7 $
# $Name: $ # $Name: $
# $Date: 2003/07/27 23:10:55 $ # $Date: 2005/01/19 22:32:05 $
# $Author: agibert $ # $Author: agibert $
@@ -13,9 +13,9 @@ Welcome to LibNode 2.0.x !
This release of LibNode supports the following OS: This release of LibNode supports the following OS:
- Linux 2.2.X and 2.4.x (tested on RedHat & Mandrake), - Linux 2.2.x, 2.4.x and 2.6.x (tested on RedHat & Mandrake),
- Solaris 2.6, - Solaris 2.6,
- Windows NT4 & 2000. - Windows NT4, 2000 and XP.

View File

@@ -1,16 +1,43 @@
# $RCSfile: ReleaseNotes.txt,v $ # $RCSfile: ReleaseNotes.txt,v $
# $Revision: 2.12 $ # $Revision: 2.18 $
# $Name: $ # $Name: $
# $Date: 2004/08/01 23:49:13 $ # $Date: 2005/01/19 23:40:40 $
# $Author: agibert $ # $Author: agibert $
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.7-1 - A. Gibert - 20/01/05
------------------------------------------------------------------------------------------------------------------------------------
All: Add to Makefile.var auto version label detection from CVS Tag.
This should be the final release of the 2.0 branch,
This new release is developped for the MICOT/Target project (Banque de France - Paris).
LibNode: Minor bug fixes in ND_*_Info_Print() functions and ND_Library_StdErr_Set alias defines.
------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.6-1 - A. Gibert - 24/08/04
------------------------------------------------------------------------------------------------------------------------------------
All: Generate *-c executables with checking mode enabled (ND_MODE=1),
Code clean up and more cleanly indented,
This new release is developped for the MICOT/Target project (Banque de France - Paris),
LibNode: Add OpenStruct tracing support (Enabled by ND_MODE=1 and Debug=1),
Re-implement for Unix and Windows target, full address checking in ND_Address_Check(),
NDDemo0: Add LibNode 2.0.6 support: Add ND_Library_Open/Close() calls,
NDBench: Add Lib_Open, Lib_Close, Index_Value_Break and Index_Node_Break command,
Improve random number generation,
Add test-10.ndb and test-errror.ndb batch files.
------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.5-1 - A. Gibert / M. Regimbeau - 28/07/03 LibNode V 2.0.5-1 - A. Gibert / M. Regimbeau - 28/07/03
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
All: Add a new Makefile system (Makefile.rule and Makefile.var), All: Add a new Makefile system (Makefile.rule and Makefile.var),
Add 'make distrib' support, Add 'make distrib' support,
@@ -19,9 +46,9 @@ All: Add a new Makefile system (Makefile.rule and Makefile.var),
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.4-1 - A. Gibert - 29/07/02 LibNode V 2.0.4-1 - A. Gibert - 29/07/02
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
All: This release of libnode pass with sucess valgrind test on linux. All: This release of libnode pass with sucess valgrind test on linux.
LibNode: Add and use ND_Index_Clear() private API, LibNode: Add and use ND_Index_Clear() private API,
@@ -29,9 +56,9 @@ NbBench: Add fclose() call at the end of batch_run.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.3-1 - A. Gibert - 09/04/02 LibNode V 2.0.3-1 - A. Gibert - 09/04/02
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
All: Fix Microsoft Visual Project to generate Debug and Release config correctly, All: Fix Microsoft Visual Project to generate Debug and Release config correctly,
LibNode: Change index type numeric print value from decimal to hexa in ND_Index_Info_Print() API, LibNode: Change index type numeric print value from decimal to hexa in ND_Index_Info_Print() API,
@@ -43,9 +70,9 @@ NbBench: Generate in Debug mode ndbenchd.exe and in Release mode ndbenchd.exe.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.2-2 - A. Gibert - 01/03/02 LibNode V 2.0.2-2 - A. Gibert - 01/03/02
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
All: Add GNU-GPL.txt, GNU-LGPL.txt and GNU-FDL.txt license files, All: Add GNU-GPL.txt, GNU-LGPL.txt and GNU-FDL.txt license files,
All: Add license stuff in ReandMe. All: Add license stuff in ReandMe.
@@ -56,9 +83,9 @@ NbBench: Add GPL header in ndbench.c.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.2-1 - A. Gibert - 27/02/02 LibNode V 2.0.2-1 - A. Gibert - 27/02/02
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
All: Makefiles now generate static and dynamic objects, All: Makefiles now generate static and dynamic objects,
All: Add no libver support in Makefiles, All: Add no libver support in Makefiles,
@@ -70,26 +97,26 @@ NbBench: Implement Index_Close and Index_Info_Print functions.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.1-1 - A. Gibert - 28/11/01 LibNode V 2.0.1-1 - A. Gibert - 28/11/01
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode: Fix the error level of TIMAS_KO: it's now an error status. LibNode: Fix the error level of TIMAS_KO: it's now an error status.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.0-1 - A. Gibert - 26/11/01 LibNode V 2.0.0-1 - A. Gibert - 26/11/01
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
All: Merge the main CVS trunc with the win32 branche (2.0.0-alpha5), All: Merge the main CVS trunc with the win32 branche (2.0.0-alpha5),
Switch file release to 2.0. Switch file release to 2.0.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.0-alpha5 - A. Gibert - 25/10/01 LibNode V 2.0.0-alpha5 - A. Gibert - 25/10/01
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode: Add Open/Close Index support, LibNode: Add Open/Close Index support,
LibNode: Fix return code next to empty struct manipulations, LibNode: Fix return code next to empty struct manipulations,
@@ -97,9 +124,9 @@ NdBench: Add full multi index support.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.0-alpha4 - A. Gibert - 28/9/01 LibNode V 2.0.0-alpha4 - A. Gibert - 28/09/01
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
All: Add optional libver support, All: Add optional libver support,
LibNode: Fix missing recursive offset args, LibNode: Fix missing recursive offset args,
@@ -108,18 +135,18 @@ NdBench: Fix local stack pointer big bug.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.0-alpha3 - A. Gibert - 18/9/01 LibNode V 2.0.0-alpha3 - A. Gibert - 18/9/01
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
New manager args interface (again !), New manager args interface (again !),
ndbench support batch mode. ndbench support batch mode.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.0-alpha2 - A. Gibert - 8/9/01 LibNode V 2.0.0-alpha2 - A. Gibert - 08/09/01
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
Re-enable libver support for unix, Re-enable libver support for unix,
Bug fixes, Bug fixes,
@@ -127,53 +154,54 @@ Code cleanup.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 2.0.0-alpha1 - A. Gibert - 7/9/01 LibNode V 2.0.0-alpha1 - A. Gibert - 07/09/01
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
Add Full win32 support, Add Full win32 support,
Remove libver support, Remove libver support,
Multi index support, Multi index support,
New manager args format, New manager args format,
Major Code cleanup et standardisation. Major Code cleanup et standardisation.
This new version (2.0.x) is developped for the TIMA project (Misys IBS - France).
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 1.0.0 - S. Mas / A. Gibert - 18/7/00 LibNode V 1.0.0 - S. Mas / A. Gibert - 18/07/00
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
Unix (Linux and Solaris) version only, for BDM project (Société Générale - Paris) Unix (Linux and Solaris) version only, for BDM project (Société Générale - Paris)
Major code rewrite. Major code rewrite.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 0.2.2 - A. Gibert - 1/6/93 LibNode V 0.2.2 - A. Gibert - 01/06/93
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
Embeded version on OS/2 2.1 (Companie Générale des Eaux - Paris) Embeded version on OS/2 2.1 (Companie Générale des Eaux - Paris)
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 0.2.1 - A. Gibert - 1/4/92 LibNode V 0.2.1 - A. Gibert - 01/04/92
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
Amiga and PC support (Bareau de Draguignan - Ste Maxime). Amiga and PC support (Bareau de Draguignan - Ste Maxime).
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 0.2.0 - A. Gibert - 1/3/91 LibNode V 0.2.0 - A. Gibert - 01/03/91
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
C version aided by p2c tools on Pyramid (Swansee University - Wales). C version aided by p2c tools on Pyramid (Swansee University - Wales).
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
LibNode V 0.1.0 - A. Gibert - 1/12/90 LibNode V 0.1.0 - A. Gibert - 01/12/90
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------
Inital version in Pascal on Pyramid (Swansee University - Wales). Inital version in Pascal on Pyramid (Swansee University - Wales).

View File

@@ -1,15 +1,14 @@
# $RCSfile: ToDo.txt,v $ # $RCSfile: ToDo.txt,v $
# $Revision: 2.3 $ # $Revision: 2.4 $
# $Name: $ # $Name: $
# $Date: 2003/07/27 23:14:10 $ # $Date: 2005/01/19 22:37:44 $
# $Author: agibert $ # $Author: agibert $
- Re-enable LibShM/LibDataStr support (via symbol lookup support),
- Add Cache Value option, - Add Cache Value option,
- More debug !
- New English documentation (man/tex), - New English documentation (man/tex),
- Improve API consitency, - Improve API consitency.
- Re-enable LibShm/LibDataStr support (via NDT_DataStruct implementation).

View File

@@ -10,12 +10,13 @@ include ../Makefile.rule
DEP_STATIC = ../lib/libnode.a DEP_STATIC += ../lib/libnode.a
DEP_DYNAMIC = ../lib/libnode.so DEP_DYNAMIC += ../lib/libnode.so
INCLUDE = -I . -I ../include INCLUDE += -I . -I ../include
LIBDIR = -L . -L ../lib LIBDIR += -L . -L ../lib
LIB_STATIC = ../lib/libnode.a LIB_STATIC += ../lib/libnode.a -ldl
LIB_DYNAMIC = -lnode LIB_DYNAMIC += -lnode -ldl
CFLAGS += -rdynamic
ifdef _LIBVER_SUPPORT ifdef _LIBVER_SUPPORT
DEP_STATIC += ../../libver/ver.h ../../libver/libver.a DEP_STATIC += ../../libver/ver.h ../../libver/libver.a
@@ -27,11 +28,11 @@ ifdef _LIBVER_SUPPORT
LIB_STATIC += ../../libver/lib/libver.a LIB_STATIC += ../../libver/lib/libver.a
LIB_DYNAMIC += -lver LIB_DYNAMIC += -lver
else else
LIB_STATIC += -ldl ../../libver/lib/libver.a LIB_STATIC += ../../libver/lib/libver.a
LIB_DYNAMIC += -ldl -lver LIB_DYNAMIC += -lver
endif endif
CFLAGS += -D_LIBVER_SUPPORT -rdynamic CFLAGS += -D_LIBVER_SUPPORT
endif endif
ND_CHECK_FLAGS = -DND_MODE=0 ND_CHECK_FLAGS = -DND_MODE=0

View File

@@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: nddemo0.c,v $ */ /* $RCSfile: nddemo0.c,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.7 $ */ /* $Revision: 2.8 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2004/08/01 23:35:39 $ */ /* $Date: 2004/08/23 22:48:37 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@@ -37,25 +37,25 @@
#define DEMO_FILE_NAME "nddemo0.dat" #define DEMO_FILE_NAME "nddemo0.dat"
#define STRING_LEN (short)1024 #define STRING_LEN ( short) 1024
#define STRING_SIZE (short)(STRING_LEN + 1) #define STRING_SIZE ( short) ( STRING_LEN + 1)
#define VAL_LEN (short)64 #define VAL_LEN ( short) 64
#define VAL_SIZE (short)(VAL_LEN + 1) #define VAL_SIZE ( short) ( VAL_LEN + 1)
#define INDEX_NB (short)4 #define INDEX_NB ( short) 4
#define NDT_CMD_INDEX0_PRINT (NDT_Command)64 #define NDD_CMD_INDEX0_PRINT ( NDT_Command) 64
#define NDT_CMD_INDEX1_PRINT (NDT_Command)65 #define NDD_CMD_INDEX1_PRINT ( NDT_Command) 65
#define NDT_CMD_INDEX2_PRINT (NDT_Command)66 #define NDD_CMD_INDEX2_PRINT ( NDT_Command) 66
#define NDT_CMD_INDEX3_PRINT (NDT_Command)67 #define NDD_CMD_INDEX3_PRINT ( NDT_Command) 67
typedef struct Demo_Value typedef struct Demo_Value
{ {
char Val0[VAL_SIZE]; char Val0[ VAL_SIZE];
char Val1[VAL_SIZE]; char Val1[ VAL_SIZE];
char Val2[VAL_SIZE]; char Val2[ VAL_SIZE];
char Val3[VAL_SIZE]; char Val3[ VAL_SIZE];
} Demo_Value; } Demo_Value;
@@ -64,7 +64,7 @@ typedef struct Demo_Value
/* Prototypes */ /* Prototypes */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
NDT_Status Manager_Demo_DS( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list); NDT_Status Demo_DS_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
void DataStruct_Load( NDT_Root *, FILE *); void DataStruct_Load( NDT_Root *, FILE *);
void DataStruct_Load( NDT_Root *, FILE *); void DataStruct_Load( NDT_Root *, FILE *);
void Demo( char *, short); void Demo( char *, short);
@@ -80,7 +80,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 Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args)
{ {
NDT_Command_Name Command_Name; NDT_Command_Name Command_Name;
@@ -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.7 $ $Name: $ $Date: 2004/08/01 23:35:39 $ $Author: agibert $"; *Version_Name_Ptr = "$Revision: 2.8 $ $Name: $ $Date: 2004/08/23 22:48:37 $ $Author: agibert $";
return( NDS_OK); return( NDS_OK);
} }
@@ -117,28 +117,28 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
switch(Cmd) switch(Cmd)
{ {
case NDT_CMD_INDEX0_PRINT: case NDD_CMD_INDEX0_PRINT:
{ {
*Reply_Index_Id_Ptr = 0; *Reply_Index_Id_Ptr = 0;
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
break; break;
} }
case NDT_CMD_INDEX1_PRINT: case NDD_CMD_INDEX1_PRINT:
{ {
*Reply_Index_Id_Ptr = 1; *Reply_Index_Id_Ptr = 1;
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
break; break;
} }
case NDT_CMD_INDEX2_PRINT: case NDD_CMD_INDEX2_PRINT:
{ {
*Reply_Index_Id_Ptr = 2; *Reply_Index_Id_Ptr = 2;
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
break; break;
} }
case NDT_CMD_INDEX3_PRINT: case NDD_CMD_INDEX3_PRINT:
{ {
*Reply_Index_Id_Ptr = 3; *Reply_Index_Id_Ptr = 3;
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT; *Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
@@ -228,63 +228,63 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
if( rc < 0) if( rc < 0)
{ {
return(NDS_LOWER); return( NDS_LOWER);
} }
else else
{ {
if( rc > 0) if( rc > 0)
{ {
return(NDS_GREATER); return( NDS_GREATER);
} }
else else
{ {
return(NDS_EQUAL); return( NDS_EQUAL);
} }
} }
} }
case 1: case 1:
{ {
int val1 = atoi(Value1_Ptr->Val1); int val1 = atoi( Value1_Ptr->Val1);
int val2 = atoi(Value2_Ptr->Val1); int val2 = atoi( Value2_Ptr->Val1);
if( val1 < val2) if( val1 < val2)
{ {
return(NDS_LOWER); return( NDS_LOWER);
} }
else else
{ {
if( val1 > val2) if( val1 > val2)
{ {
return(NDS_GREATER); return( NDS_GREATER);
} }
else else
{ {
return(NDS_EQUAL); return( NDS_EQUAL);
} }
} }
} }
case 2: case 2:
{ {
int val1 = strlen(Value1_Ptr->Val2); int val1 = strlen( Value1_Ptr->Val2);
int val2 = strlen(Value2_Ptr->Val2); int val2 = strlen( Value2_Ptr->Val2);
if( val1 < val2) if( val1 < val2)
{ {
return(NDS_LOWER); return( NDS_LOWER);
} }
else else
{ {
if( val1 > val2) if( val1 > val2)
{ {
return(NDS_GREATER); return( NDS_GREATER);
} }
else else
{ {
return(NDS_EQUAL); return( NDS_EQUAL);
} }
} }
} }
@@ -323,6 +323,7 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
*/ */
Command_Name = "NDD_CMD_VALUE_REMOVE"; Command_Name = "NDD_CMD_VALUE_REMOVE";
return( NDS_OK); return( NDS_OK);
} }
@@ -380,12 +381,12 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
default: default:
{ {
printf( "Demo_DS_Manager() called with an undefined command %d\n", Command); printf( "Demo_DS_Manager() called with an undefined command %d\n", Command);
return NDS_ERRAPI; return( NDS_ERRAPI);
} }
} }
printf( "Demo_DS_Manager() called with command %d (%s)\n", Command, Command_Name); printf( "Demo_DS_Manager() called with command %d (%s)\n", Command, Command_Name);
return NDS_OK; return( NDS_OK);
} }
@@ -492,7 +493,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
printf( "Traverse DataStructure Index 0:\n"); printf( "Traverse DataStructure Index 0:\n");
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDT_CMD_INDEX0_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK) if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX0_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
{ {
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
} }
@@ -503,7 +504,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
printf( "Traverse DataStructure Index 1:\n"); printf( "Traverse DataStructure Index 1:\n");
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDT_CMD_INDEX1_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK) if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX1_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
{ {
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
} }
@@ -514,7 +515,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
printf( "Traverse DataStructure Index 2:\n"); printf( "Traverse DataStructure Index 2:\n");
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDT_CMD_INDEX2_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK) if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX2_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
{ {
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
} }
@@ -525,7 +526,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
printf( "Traverse DataStructure Index 3:\n"); printf( "Traverse DataStructure Index 3:\n");
if( ( status = ND_DataStruct_Traverse( ds_ptr, NDT_CMD_INDEX3_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK) if( ( status = ND_DataStruct_Traverse( ds_ptr, NDD_CMD_INDEX3_PRINT, stdout, NDD_RECURSIVE_MODE_PARENT, 0)) != NDS_OK)
{ {
printf( "ND_DataStruct_Traverse() failed (%d) !\n", status); printf( "ND_DataStruct_Traverse() failed (%d) !\n", status);
} }
@@ -584,7 +585,7 @@ 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, "Demo_DS_Manager", Demo_DS_Manager, NULL, NULL, NULL, NULL,0, NULL)) != NDS_OK)
{ {
printf( "ND_DataStruct_Open() failed (%d) !\n", status); printf( "ND_DataStruct_Open() failed (%d) !\n", status);
} }
@@ -606,16 +607,11 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
printf( "\n\n\nLaod Data File:\n\n"); printf( "\n\n\nLaod Data File:\n\n");
DataStruct_Load( demo_ds_ptr, demo_file); DataStruct_Load( demo_ds_ptr, demo_file);
if( Optimized_Mode) if( Optimized_Mode)
{ {
printf( "\n\n\nInitial Structure Dump:\n\n"); printf( "\n\n\nInitial Structure Dump:\n\n");
DataStruct_Dump( demo_ds_ptr); DataStruct_Dump( demo_ds_ptr);
printf( "Convert data structure: "); printf( "Convert data structure: ");
@@ -634,8 +630,6 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
printf( "\n\n\nFinal Structure Dump:\n\n"); printf( "\n\n\nFinal Structure Dump:\n\n");
DataStruct_Dump( demo_ds_ptr); DataStruct_Dump( demo_ds_ptr);
printf( "Close demo datafile: "); printf( "Close demo datafile: ");
if( fclose( demo_file) != 0) if( fclose( demo_file) != 0)

View File

@@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: node.h,v $ */ /* $RCSfile: node.h,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.7 $ */ /* $Revision: 2.11 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2004/08/01 23:18:37 $ */ /* $Date: 2005/01/11 20:57:04 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@@ -31,21 +31,20 @@
#ifndef _LIBNODE_H_ #ifndef _LIBNODE_H_
#define _LIBNODE_H_ # define _LIBNODE_H_
#ifdef __cplusplus # ifdef __cplusplus
extern "C" { extern "C" {
#endif # endif
#include <stdio.h> # include <stdlib.h>
#include <stdlib.h> # include <stdio.h>
#include <string.h> # include <string.h>
#include <signal.h> # include <stdarg.h>
#include <stdarg.h>
#ifdef _LIBVER_SUPPORT # ifdef _LIBVER_SUPPORT
# include <ver.h> # include <ver.h>
#endif # endif
@@ -227,7 +226,7 @@ typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Nod
typedef char *NDT_Allocator_Name; typedef char *NDT_Allocator_Name;
typedef NDT_Status NDT_Allocator(size_t, void **, void *); typedef NDT_Status NDT_Allocator( void **, size_t, void *);
/* Pointeur de fonction sur le désallocateur */ /* Pointeur de fonction sur le désallocateur */
@@ -237,7 +236,7 @@ typedef NDT_Status NDT_Allocator(size_t, void **, void *);
typedef char *NDT_Desallocator_Name; typedef char *NDT_Desallocator_Name;
typedef NDT_Status NDT_Desallocator(void *, void *); typedef NDT_Status NDT_Desallocator( void *, void *);
@@ -261,8 +260,8 @@ typedef struct NDT_Index
typedef struct NDT_Root typedef struct NDT_Root
{ {
// NDT_Root_Type Type; /* Root Structure Type */ /* NDT_Root_Type Type;*/ /* Root Structure Type */
// NDT_DataStruct_Type DS_Type; /* Type de la structure (liste, arbre ... ) */ /* NDT_DataStruct_Type DS_Type;*/ /* Type de la structure (liste, arbre ... ) */
NDT_Manager *Manager_Ptr; /* Pointeur sur la fonction manager */ NDT_Manager *Manager_Ptr; /* Pointeur sur la fonction manager */
char Manager_Name[NDD_MANAGER_NAME_SIZE_MAX]; /* Nom de la fonction manager */ char Manager_Name[NDD_MANAGER_NAME_SIZE_MAX]; /* Nom de la fonction manager */
@@ -272,11 +271,11 @@ typedef struct NDT_Root
char Desallocator_Name[NDD_DESALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction de désallocation */ char Desallocator_Name[NDD_DESALLOCATOR_NAME_SIZE_MAX]; /* Nom de la fonction de désallocation */
short Own_Value; /* Indique si la structure est propriétaire de ses valeurs */ short Own_Value; /* Indique si la structure est propriétaire de ses valeurs */
void *User; /* Pointeur utilisable librement par l'utilisateur */ void *User_Ptr; /* Pointeur utilisable librement par l'utilisateur */
NDT_Index_Nb Index_Nb; NDT_Index_Nb Index_Nb;
NDT_Index_Nb Index_Open_Count; NDT_Index_Nb Index_Open_Count;
NDT_Index Index_Tab[0]; NDT_Index Index_Tab[1];
} NDT_Root; } NDT_Root;
@@ -299,7 +298,7 @@ typedef struct NDT_DataStruct
typedef struct NDT_Node typedef struct NDT_Node
{ {
NDT_Root *Root; NDT_Root *Root;
NDT_Index_Id Index; NDT_Index_Id Index;
struct NDT_Node *Parent; struct NDT_Node *Parent;
struct NDT_Node *Left; struct NDT_Node *Left;
@@ -335,7 +334,7 @@ typedef int NDT_Recursive_Offset;
#define ND_Library_Open ND_Library_Open_I #define ND_Library_Open ND_Library_Open_I
#define ND_Library_Close ND_Library_Close_I #define ND_Library_Close ND_Library_Close_I
#define ND_Library_StdErr_Set ND_Library_Stderr_Set_I #define ND_Library_StdErr_Set ND_Library_StdErr_Set_I
#define ND_DataStruct_Open ND_DataStruct_Open_I #define ND_DataStruct_Open ND_DataStruct_Open_I
#define ND_DataStruct_Close ND_DataStruct_Close_I #define ND_DataStruct_Close ND_DataStruct_Close_I
@@ -385,7 +384,7 @@ typedef int NDT_Recursive_Offset;
#define ND_Library_Open ND_Library_Open_C #define ND_Library_Open ND_Library_Open_C
#define ND_Library_Close ND_Library_Close_C #define ND_Library_Close ND_Library_Close_C
#define ND_Library_StdErr_Set ND_Library_Stderr_Set_C #define ND_Library_StdErr_Set ND_Library_StdErr_Set_C
#define ND_DataStruct_Open ND_DataStruct_Open_C #define ND_DataStruct_Open ND_DataStruct_Open_C
#define ND_DataStruct_Close ND_DataStruct_Close_C #define ND_DataStruct_Close ND_DataStruct_Close_C
@@ -468,8 +467,8 @@ NDD_DLL_API NDT_Status ND_Library_Close_C( void);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Définition de la sortie standard des messages d'erreur de la librairie */ /* Définition de la sortie standard des messages d'erreur de la librairie */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_I( FILE *Out); NDD_DLL_API NDT_Status ND_Library_StdErr_Set_I( FILE *);
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *Out); NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *);
@@ -493,8 +492,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Open_C( NDT_Root **, NDT_Index_Nb, NDT_In
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (O) Root: pointeur sur la racine de la structure de données */ /* (O) Root: pointeur sur la racine de la structure de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Close_I( NDT_Root *Root); NDD_DLL_API NDT_Status ND_DataStruct_Close_I( NDT_Root *);
NDD_DLL_API NDT_Status ND_DataStruct_Close_C( NDT_Root *Root); NDD_DLL_API NDT_Status ND_DataStruct_Close_C( NDT_Root *);
@@ -503,8 +502,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Close_C( NDT_Root *Root);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (O) Root: pointeur sur la racine de la structure de données */ /* (O) Root: pointeur sur la racine de la structure de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Flush_I( NDT_Root *Root); NDD_DLL_API NDT_Status ND_DataStruct_Flush_I( NDT_Root *);
NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *Root); NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *);
@@ -518,8 +517,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( NDT_Root *Root);
/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */ /* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */
/* (I) Out : flux de sortie du rapport */ /* (I) Out : flux de sortie du rapport */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Check_I( NDT_Root *Root, int *Nb_Detected, int *Nb_Corrected, FILE *Out); NDD_DLL_API NDT_Status ND_DataStruct_Check_I( NDT_Root *, int *, int *, FILE *);
NDD_DLL_API NDT_Status ND_DataStruct_Check_C( NDT_Root *Root, int *Nb_Detected, int *Nb_Corrected, FILE *Out); NDD_DLL_API NDT_Status ND_DataStruct_Check_C( NDT_Root *, int *, int *, FILE *);
@@ -530,8 +529,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Check_C( NDT_Root *Root, int *Nb_Detecte
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Root: pointeur sur la racine de la structure de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_I( NDT_Root *Root); NDD_DLL_API NDT_Status ND_DataStruct_Reorg_I( NDT_Root *);
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_C( NDT_Root *Root); NDD_DLL_API NDT_Status ND_DataStruct_Reorg_C( NDT_Root *);
@@ -554,10 +553,10 @@ NDD_DLL_API NDT_Status ND_DataStruct_Convert_C( NDT_Root *, NDT_Index_Type *)
/* (I) Command: Commande à exécuter sur chaque noeud traversé */ /* (I) Command: Commande à exécuter sur chaque noeud traversé */
/* (I) Data: pointeur de données utilisateur */ /* (I) Data: pointeur de données utilisateur */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *, NDT_Command Command, va_list); NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *, NDT_Command, va_list);
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *, NDT_Command Command, va_list); NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *, NDT_Command, va_list);
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_I( NDT_Root *, NDT_Command Command, ...); NDD_DLL_API NDT_Status ND_DataStruct_Traverse_I( NDT_Root *, NDT_Command, ...);
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command Command, ...); NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command, ...);
@@ -567,8 +566,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command Com
/* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Root: pointeur sur la racine de la structure de données */
/* (I) Out : flux de sortie */ /* (I) Out : flux de sortie */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_I( FILE *, NDT_Root *Root, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset); NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_C( FILE *, NDT_Root *Root, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset); NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_C( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset);
@@ -578,8 +577,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Info_Print_C( FILE *, NDT_Root *Root, ND
/* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Root: pointeur sur la racine de la structure de données */
/* (I) Value: pointeur sur la valeur à ajouter */ /* (I) Value: pointeur sur la valeur à ajouter */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_I( NDT_Root *Root, void *Value); NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_I( NDT_Root *, void *);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *Root, void *Value); NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *, void *);
@@ -590,8 +589,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Add_C( NDT_Root *Root, void *Value
/* (I) Reference_Value : pointeur sur la valeur de référence */ /* (I) Reference_Value : pointeur sur la valeur de référence */
/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */ /* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_I( NDT_Root *Root, void *Value); NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_I( NDT_Root *, void *);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *Root, void *Value); NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *, void *);
@@ -616,10 +615,10 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_
/* (I) Data : pointeur de données */ /* (I) Data : pointeur de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VI( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list); NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VI( void **, NDT_Root *, void *, va_list);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VC( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list); NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VC( void **, NDT_Root *, void *, va_list);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_I( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, ...); NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_I( void **, NDT_Root *, void *, ...);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_C( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, ...); NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_C( void **, NDT_Root *, void *, ...);
@@ -668,8 +667,8 @@ NDD_DLL_API NDT_Status ND_Index_Flush_C( NDT_Root *, NDT_Index_Id);
/* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */ /* (O) Nb_Corrected : pointeur sur le nombre d'erreurs */
/* (I) Out : flux de sortie du rapport */ /* (I) Out : flux de sortie du rapport */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Check_I( NDT_Root *Root, NDT_Index_Id, int *, int *, FILE *); NDD_DLL_API NDT_Status ND_Index_Check_I( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
NDD_DLL_API NDT_Status ND_Index_Check_C( NDT_Root *Root, NDT_Index_Id, int *, int *, FILE *); NDD_DLL_API NDT_Status ND_Index_Check_C( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
@@ -679,8 +678,8 @@ NDD_DLL_API NDT_Status ND_Index_Check_C( NDT_Root *Root, NDT_Index_Id, int *,
/* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Root: pointeur sur la racine de la structure de données */
/* (I) Target_Type: type de structure cible */ /* (I) Target_Type: type de structure cible */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Convert_I ( NDT_Root *, NDT_Index_Id Index_Id, NDT_Index_Type); NDD_DLL_API NDT_Status ND_Index_Convert_I ( NDT_Root *, NDT_Index_Id, NDT_Index_Type);
NDD_DLL_API NDT_Status ND_Index_Convert_C ( NDT_Root *, NDT_Index_Id Index_Id, NDT_Index_Type); NDD_DLL_API NDT_Status ND_Index_Convert_C ( NDT_Root *, NDT_Index_Id, NDT_Index_Type);
@@ -730,8 +729,8 @@ NDD_DLL_API NDT_Status ND_Index_Info_Print_C( FILE *, NDT_Root *, NDT_Index_I
/* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Root: pointeur sur la racine de la structure de données */
/* (I) Value: pointeur sur la valeur à ajouter */ /* (I) Value: pointeur sur la valeur à ajouter */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Value_Add_I( NDT_Root *Root, NDT_Index_Id, void *Value); NDD_DLL_API NDT_Status ND_Index_Value_Add_I( NDT_Root *, NDT_Index_Id, void *);
NDD_DLL_API NDT_Status ND_Index_Value_Add_C( NDT_Root *Root, NDT_Index_Id, void *Value); NDD_DLL_API NDT_Status ND_Index_Value_Add_C( NDT_Root *, NDT_Index_Id, void *);
@@ -742,8 +741,8 @@ NDD_DLL_API NDT_Status ND_Index_Value_Add_C( NDT_Root *Root, NDT_Index_Id, voi
/* (I) Reference_Value : pointeur sur la valeur de référence */ /* (I) Reference_Value : pointeur sur la valeur de référence */
/* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */ /* (I) Removed_Value : adresse d'un pointeur sur la valeur supprimée */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Value_Remove_I( NDT_Root *Root, NDT_Index_Id, void *Value); NDD_DLL_API NDT_Status ND_Index_Value_Remove_I( NDT_Root *, NDT_Index_Id, void *);
NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *Root, NDT_Index_Id, void *Value); NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *, NDT_Index_Id, void *);
@@ -765,8 +764,8 @@ NDD_DLL_API NDT_Status ND_Index_Value_Print_C( FILE *, NDT_Root *, NDT_Index
/* (I) Root: pointeur sur la racine de la structure de données */ /* (I) Root: pointeur sur la racine de la structure de données */
/* (I) Node: pointeur sur le noeud à ajouter */ /* (I) Node: pointeur sur le noeud à ajouter */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_Add_I( NDT_Root * Root, NDT_Index_Id Index_Id, NDT_Node * Node ); NDD_DLL_API NDT_Status ND_Index_Node_Add_I( NDT_Root *, NDT_Index_Id, NDT_Node *);
NDD_DLL_API NDT_Status ND_Index_Node_Add_C( NDT_Root * Root, NDT_Index_Id Index_Id, NDT_Node * Node ); NDD_DLL_API NDT_Status ND_Index_Node_Add_C( NDT_Root *, NDT_Index_Id, NDT_Node *);
@@ -775,8 +774,8 @@ NDD_DLL_API NDT_Status ND_Index_Node_Add_C( NDT_Root * Root, NDT_Index_Id Inde
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Node: pointeur sur le noeud à supprimer de la structure de données */ /* (I) Node: pointeur sur le noeud à supprimer de la structure de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Node_Remove_I( NDT_Node * Node); NDD_DLL_API NDT_Status ND_Index_Node_Remove_I( NDT_Node *);
NDD_DLL_API NDT_Status ND_Index_Node_Remove_C( NDT_Node * Node); NDD_DLL_API NDT_Status ND_Index_Node_Remove_C( NDT_Node *);
@@ -893,8 +892,8 @@ NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node
/* (I) Size : taille de la zone à allouer */ /* (I) Size : taille de la zone à allouer */
/* (I) Data : pointeur de données utiles à l'allocateur */ /* (I) Data : pointeur de données utiles à l'allocateur */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Allocator_Exec_I( NDT_Allocator *, void **, size_t, void *); NDD_DLL_API NDT_Status ND_Allocator_Exec_I( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *);
NDD_DLL_API NDT_Status ND_Allocator_Exec_C( NDT_Allocator *, void **, size_t, void *); NDD_DLL_API NDT_Status ND_Allocator_Exec_C( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *);
@@ -902,16 +901,17 @@ NDD_DLL_API NDT_Status ND_Allocator_Exec_C( NDT_Allocator *, void **, size_t,
/* Exécution d'une fonction de désallocation le dont nom est passé en paramètre */ /* Exécution d'une fonction de désallocation le dont nom est passé en paramètre */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Function : nom de la fonction à exécuter */ /* (I) Function : nom de la fonction à exécuter */
/* (I) Function : nom de la fonction à exécuter */
/* (I) Ptr : adresse de la zone à désallouer */ /* (I) Ptr : adresse de la zone à désallouer */
/* (I) Data : pointeur de données utiles au désallocateur */ /* (I) Data : pointeur de données utiles au désallocateur */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Desallocator_Exec_I( NDT_Desallocator *, void *, void *); NDD_DLL_API NDT_Status ND_Desallocator_Exec_I( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *);
NDD_DLL_API NDT_Status ND_Desallocator_Exec_C( NDT_Desallocator *, void *, void *); NDD_DLL_API NDT_Status ND_Desallocator_Exec_C( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *);
#ifdef __cplusplus # ifdef __cplusplus
} }
#endif # endif
#endif #endif

View File

@@ -9,8 +9,8 @@ include ../Makefile.rule
DEP = libnode.h ../include/node.h Makefile DEP += libnode.h ../include/node.h Makefile
INCLUDE = -I . -I ../include INCLUDE += -I . -I ../include
ifdef _LIBVER_SUPPORT ifdef _LIBVER_SUPPORT
DEP += ../../libver/ver.h DEP += ../../libver/ver.h

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: libnode.h,v $ */ /* $RCSfile: libnode.h,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.5 $ */ /* $Revision: 2.8 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2004/08/01 23:18:38 $ */ /* $Date: 2005/01/11 20:57:04 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@@ -29,11 +29,20 @@
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include <errno.h>
#include <signal.h> #include <signal.h>
//#include <dlfcn.h> #include <setjmp.h>
#include <dlfcn.h>
/* Utilisation des API de la LIBNODE sans vérification des arguments */
#define ND_MODE 1
#include <node.h> #include <node.h>
@@ -52,7 +61,7 @@
#define NDD_HUGE_LONG (long)0xFFFFFFL #define NDD_HUGE_LONG ( long) 0xFFFFFFL
@@ -78,7 +87,13 @@ typedef struct NDT_Base
char Err_String[512]; char Err_String[512];
FILE *Err_Stream; FILE *Err_Stream;
int Sig_Trapped; int Sig_Trapped;
#if !defined(_MSC_VER)
sigjmp_buf SigLongJmp_Env;
#else
jmp_buf SigLongJmp_Env;
#endif
NDT_Symbol *Symbol_First_Ptr; NDT_Symbol *Symbol_First_Ptr;
void *DL_Ptr;
NDT_Index_Type OpenStruct_Index_Type[1]; NDT_Index_Type OpenStruct_Index_Type[1];
NDT_Root *OpenStruct_Ptr; NDT_Root *OpenStruct_Ptr;
} NDT_Base; } NDT_Base;
@@ -88,17 +103,17 @@ NDT_Base NDG_Base =
NDD_FALSE, NDD_FALSE,
NDD_TRUE, NDD_TRUE,
"", "",
(FILE *)-1, (FILE *) -1,
0, 0,
(NDT_Symbol *)NULL, {0},
(NDT_Symbol *) NULL,
NULL,
{ NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO}, { NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO},
(NDT_Root *)NULL (NDT_Root *) NULL
}; };
//extern int sigrelse (int sig);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
@@ -124,12 +139,12 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_C
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Redéfinition de la fonction malloc() avec retour de type NDT_Status */ /* Redéfinition de la fonction malloc() avec retour de type NDT_Status */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Default_Allocator( size_t Size, void **ptr, void *User); NDT_Status ND_Default_Allocator( void **, size_t, void *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Redéfinition de la fonction free() avec retour de type NDT_Status */ /* Redéfinition de la fonction free() avec retour de type NDT_Status */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Default_Desallocator( void *, void *); NDT_Status ND_Default_Desallocator( void *, void *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Création d'un noeud */ /* Création d'un noeud */
@@ -145,7 +160,7 @@ NDT_Status ND_Node_Alloc( NDT_Root * Root, NDT_Node ** New_Node);
/* (I) Root : adresse de la racine dans laquelle on détruit un noeud */ /* (I) Root : adresse de la racine dans laquelle on détruit un noeud */
/* (I) Node : pointeur sur le noeud à détruire */ /* (I) Node : pointeur sur le noeud à détruire */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Node_Free( NDT_Root *, NDT_Node *); NDT_Status ND_Node_Free( NDT_Root *, NDT_Node *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Création d'une nouvelle structure de données */ /* Création d'une nouvelle structure de données */
@@ -175,7 +190,7 @@ NDT_Status ND_Node_Root_Alloc( NDT_Root **, NDT_Index_Nb, NDT_Index_Type[], ch
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine à détruire */ /* (I) Root : pointeur sur la racine à détruire */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Node_Root_Free( NDT_Root *); NDT_Status ND_Node_Root_Free( NDT_Root *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Ajout d'un noeud à une liste chaînée */ /* Ajout d'un noeud à une liste chaînée */
@@ -183,7 +198,7 @@ NDT_Status ND_Node_Root_Free( NDT_Root *);
/* (I) Root : pointeur sur la racine de la liste */ /* (I) Root : pointeur sur la racine de la liste */
/* (I) New_Node : pointeur sur le noeud à ajouter */ /* (I) New_Node : pointeur sur le noeud à ajouter */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_List_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *); NDT_Status ND_List_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Ajout d'une nouvelle valeur à une liste */ /* Ajout d'une nouvelle valeur à une liste */
@@ -191,7 +206,7 @@ NDT_Status ND_List_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
/* (I) Root : pointeur sur la racine de la liste */ /* (I) Root : pointeur sur la racine de la liste */
/* (I) Value : pointeur sur la valeur à ajouter */ /* (I) Value : pointeur sur la valeur à ajouter */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_List_Value_Add( NDT_Root *, NDT_Index_Id, void *); NDT_Status ND_List_Value_Add( NDT_Root *, NDT_Index_Id, void *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Ajout d'un noeud à un arbre binaire */ /* Ajout d'un noeud à un arbre binaire */
@@ -199,26 +214,26 @@ NDT_Status ND_List_Value_Add( NDT_Root *, NDT_Index_Id, void *);
/* (I) Root : pointeur sur la racine de l'arbre */ /* (I) Root : pointeur sur la racine de l'arbre */
/* (I) Value : pointeur sur la valeur à ajouter */ /* (I) Value : pointeur sur la valeur à ajouter */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Tree_Value_Add( NDT_Root *, NDT_Index_Id, void *); NDT_Status ND_Tree_Value_Add( NDT_Root *, NDT_Index_Id, void *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Supprime le noeud d'une liste */ /* Supprime le noeud d'une liste */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Node : pointeur sur le noeud à supprimer */ /* (I) Node : pointeur sur le noeud à supprimer */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_List_Node_Remove( NDT_Node *); NDT_Status ND_List_Node_Remove( NDT_Node *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Conversion d'une structure en liste chaînée */ /* Conversion d'une structure en liste chaînée */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine du la structure à convertir */ /* (I) Root : pointeur sur la racine du la structure à convertir */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_List_Make( NDT_Root *, NDT_Index_Id); NDT_Status ND_List_Make( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Recherche une valeur dans une liste et retourne le noeud correspondant */ /* Recherche une valeur dans une liste et retourne le noeud correspondant */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Node * ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list); NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */ /* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */
@@ -231,28 +246,28 @@ NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list);
/* (I) Root : pointeur sur la racine du la structure à convertir */ /* (I) Root : pointeur sur la racine du la structure à convertir */
/* (I) Type : type du futur arbre */ /* (I) Type : type du futur arbre */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Tree_Make( NDT_Root *, NDT_Index_Id); NDT_Status ND_Tree_Make( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Equilibrage d'un arbre */ /* Equilibrage d'un arbre */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de l'arbre */ /* (I) Root : pointeur sur la racine de l'arbre */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Tree_Equalize( NDT_Root *, NDT_Index_Id); NDT_Status ND_Tree_Equalize( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Retourne la profondeur de la plus grande branche à partir d'un noeud */ /* Retourne la profondeur de la plus grande branche à partir d'un noeud */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Node : pointeur sur le noeud */ /* (I) Node : pointeur sur le noeud */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
long ND_Tree_MaxDepth_Get( NDT_Node *); long ND_Tree_MaxDepth_Get( NDT_Node *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Retourne la profondeur de la plus petite branche à partir d'un noeud */ /* Retourne la profondeur de la plus petite branche à partir d'un noeud */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Node : pointeur sur le noeud */ /* (I) Node : pointeur sur le noeud */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
long ND_Tree_MinDepth_Get( NDT_Node *); long ND_Tree_MinDepth_Get( NDT_Node *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Ajout d'un noeud à un arbre binaire */ /* Ajout d'un noeud à un arbre binaire */
@@ -260,7 +275,7 @@ long ND_Tree_MinDepth_Get( NDT_Node *);
/* (I) Root : pointeur sur la racine de l'arbre */ /* (I) Root : pointeur sur la racine de l'arbre */
/* (I) Node : pointeur sur le noeud à ajouter */ /* (I) Node : pointeur sur le noeud à ajouter */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Tree_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *); NDT_Status ND_Tree_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Ajoute tous les noeud d'une liste à un arbre */ /* Ajoute tous les noeud d'une liste à un arbre */
@@ -268,60 +283,65 @@ NDT_Status ND_Tree_Node_Add( NDT_Root *, NDT_Index_Id, NDT_Node *);
/* (I) Tree_Root : pointeur sur la racine de l'arbre */ /* (I) Tree_Root : pointeur sur la racine de l'arbre */
/* (I) List_Root : pointeur sur la racine de la liste */ /* (I) List_Root : pointeur sur la racine de la liste */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Tree_List_Add( NDT_Root *, NDT_Index_Id, NDT_Root *, NDT_Index_Id); NDT_Status ND_Tree_List_Add( NDT_Root *, NDT_Index_Id, NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Fonction de comparaison de noeuds (pour le quick sort) */ /* Fonction de comparaison de noeuds (pour le quick sort) */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
int ND_Node_Compare( void **, void **); int ND_Node_Compare( void **, void **);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Ordonne une liste chaînée selon l'algorithme du tri à bulle */ /* Ordonne une liste chaînée selon l'algorithme du tri à bulle */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) Root : pointeur sur la racine de la liste à trier */ /* (I) Root : pointeur sur la racine de la liste à trier */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_List_Sort( NDT_Root *, NDT_Index_Id); NDT_Status ND_List_Sort( NDT_Root *, NDT_Index_Id);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Fonctions et procédures privées de la librairie (bas niveau) */ /* PRIVATE FUNCTIONS */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
void ND_List_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); void ND_List_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
void ND_List_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); void ND_List_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
void ND_Value_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); void ND_Value_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
void ND_Tree_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); void ND_Tree_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
void ND_Tree_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *); void ND_Tree_Link_Check( NDT_Root *, NDT_Index_Id, int *, int *, FILE *);
NDT_Status ND_List_Recursive_Make( NDT_Node *, NDT_Root *, NDT_Index_Id); NDT_Status ND_List_Recursive_Make( NDT_Node *, NDT_Root *, NDT_Index_Id);
NDT_Node * ND_Tree_Recursive_Make( long, long, NDT_Node *); NDT_Node *ND_Tree_Recursive_Make( long, long, NDT_Node *);
void ND_Tree_Node_Recursive_Add( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Node **, long , NDT_Node *); void ND_Tree_Node_Recursive_Add( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Node **, long , NDT_Node *);
NDT_Node * ND_Tree_Node_First_Recursive_Get( NDT_Node *); NDT_Node *ND_Tree_Node_First_Recursive_Get( NDT_Node *);
NDT_Node * ND_Tree_Node_Last_Recursive_Get( NDT_Node *); NDT_Node *ND_Tree_Node_Last_Recursive_Get( NDT_Node *);
NDT_Node * ND_Tree_Node_Recursive_Find( NDT_Node *, void *, va_list); NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *, void *, va_list);
NDT_Node * ND_Tree_Parent_Next_Recursive_Get( NDT_Node * Node); NDT_Node *ND_Tree_Parent_Next_Recursive_Get( NDT_Node *);
NDT_Node * ND_Tree_Parent_Previous_Recursive_Get( NDT_Node *); NDT_Node *ND_Tree_Parent_Previous_Recursive_Get( NDT_Node *);
void ND_Tree_Recursive_Print( NDT_Node *, long, FILE *); void ND_Tree_Recursive_Print( NDT_Node *, long, FILE *);
void ND_Tree_Link_Recursive_Check( NDT_Node *Node, int *, int *, FILE *); void ND_Tree_Link_Recursive_Check( NDT_Node *, int *, int *, FILE *);
void * ND_Symbol_Find( const char *); NDT_Status ND_Symbol_Find( void **, const char *);
void ND_Error_Print( void); void ND_Error_Print( void);
void ND_Signal_Trap( int); void ND_Signal_Trap( int);
NDT_Status ND_Address_Check(void *); NDT_Status ND_Address_Check( void *);

View File

@@ -1,5 +1,5 @@
Name: libnode Name: libnode
Version: 2.0.5 Version: 2.0.7
Release: 1 Release: 1
%define libnode_name %{name}-%{version}-%{release} %define libnode_name %{name}-%{version}-%{release}
@@ -10,7 +10,7 @@ Copyright: GPL
Group: Application/Utilitaires Group: Application/Utilitaires
Distribution: Rx3 OpenSource Distribution: Rx3 OpenSource
Vendor: Rx3 Vendor: Rx3
Packager: arnaud.gibert@rx3.net Packager: Arnaud G. Gibert <arnaud@rx3.net>
Source: ftp://ftp.rx3.org/pub/%{source} Source: ftp://ftp.rx3.org/pub/%{source}
Url: http://www.rx3.org/dvp/libnode/download/ Url: http://www.rx3.org/dvp/libnode/download/
@@ -18,7 +18,7 @@ BuildRoot: %{_tmppath}/%{libnode_name}-buildroot
AutoReqProv: no AutoReqProv: no
%description %description
Manages generic list and/or tree node structures Manages generic list and/or tree node structures.
@@ -49,6 +49,12 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Wed Jan 19 2005 Arnaud G. Gibert <arnaud@rx3.net> 2.0.7-1
- Update to 2.0.7 release.
* Tue Aug 24 2004 Arnaud G. Gibert <arnaud@rx3.net> 2.0.6-1
- Update to 2.0.6 release.
* Tue Jul 15 2003 Arnaud G. Gibert <arnaud@rx3.net> - 2.0.5-1 * Tue Jul 15 2003 Arnaud G. Gibert <arnaud@rx3.net> - 2.0.5-1
- Add release in libnode dir name support. - Add release in libnode dir name support.

View File

@@ -11,12 +11,13 @@ include ../Makefile.rule
DEP_STATIC = ../lib/libnode.a DEP_STATIC += ../lib/libnode.a
DEP_DYNAMIC = ../lib/libnode.so DEP_DYNAMIC += ../lib/libnode.so
INCLUDE = -I . -I ../include INCLUDE += -I . -I ../include
LIBDIR = -L . -L ../lib LIBDIR += -L . -L ../lib
LIB_STATIC = ../lib/libnode.a LIB_STATIC += ../lib/libnode.a -ldl
LIB_DYNAMIC = -lnode LIB_DYNAMIC += -lnode -ldl
CFLAGS += -rdynamic
ifdef _LIBVER_SUPPORT ifdef _LIBVER_SUPPORT
DEP_STATIC += ../../libver/ver.h ../../libver/libver.a DEP_STATIC += ../../libver/ver.h ../../libver/libver.a
@@ -28,11 +29,11 @@ ifdef _LIBVER_SUPPORT
LIB_STATIC += ../../libver/lib/libver.a LIB_STATIC += ../../libver/lib/libver.a
LIB_DYNAMIC += -lver LIB_DYNAMIC += -lver
else else
LIB_STATIC += -ldl ../../libver/lib/libver.a LIB_STATIC += ../../libver/lib/libver.a
LIB_DYNAMIC += -ldl -lver LIB_DYNAMIC += -lver
endif endif
CFLAGS += -D_LIBVER_SUPPORT -rdynamic CFLAGS += -D_LIBVER_SUPPORT
endif endif
ND_CHECK_FLAGS = -DND_MODE=0 ND_CHECK_FLAGS = -DND_MODE=0

View File

@@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: ndbench.c,v $ */ /* $RCSfile: ndbench.c,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.7 $ */ /* $Revision: 2.8 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2004/08/01 23:38:52 $ */ /* $Date: 2004/08/24 20:31:28 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@@ -59,7 +59,7 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
#ifdef _LIBVER_SUPPORT #ifdef _LIBVER_SUPPORT
VER_INFO_EXPORT( ndbench, "$Revision: 2.7 $", "$Name: $", __FILE__, "$Author: agibert $"); VER_INFO_EXPORT( ndbench, "$Revision: 2.8 $", "$Name: $", __FILE__, "$Author: agibert $");
# define USAGE "Usage : %s [ --help | --version [-v] | --batch_run <batch_file_name>]\n" # define USAGE "Usage : %s [ --help | --version [-v] | --batch_run <batch_file_name>]\n"
#else #else
# define USAGE "Usage : %s [ --help | --batch_run <batch_file_name>]\n" # define USAGE "Usage : %s [ --help | --batch_run <batch_file_name>]\n"
@@ -94,9 +94,11 @@ VER_INFO_EXPORT( ndbench, "$Revision: 2.7 $", "$Name: $", __FILE__, "$Author: a
#define INDEX_REORG 22 #define INDEX_REORG 22
#define INDEX_INFO_PRINT 23 #define INDEX_INFO_PRINT 23
#define INDEX_VALUE_PRINT 24 #define INDEX_VALUE_PRINT 24
#define BATCH_RUN 25 #define INDEX_VALUE_BREAK 25
#define INDEX_NODE_BREAK 26
#define BATCH_RUN 27
#define COMMAND_NB 26 #define COMMAND_NB 28
#define INDEX_NB 32 #define INDEX_NB 32
@@ -149,8 +151,9 @@ typedef struct
struct _timeb stop; struct _timeb stop;
} cpt; } cpt;
# define t_start(x) { _ftime( &(x.start));} # define t_start(x) { _ftime( &(x.start));}
# define t_stop(x) { _ftime( &(x.stop)); x.sec = (double)(x.stop.time) - (double)(x.start.time) + ((double)(x.stop.millitm) - (double)(x.start.millitm)) / 1000;} # define t_stop(x) { _ftime( &(x.stop)); x.sec = (double)(x.stop.time) - (double)(x.start.time) + ((double)(x.stop.millitm) - (double)(x.start.millitm)) / 1000;}
# define seed_get(x) (int)( (x).start.time)
#else #else
@@ -161,8 +164,9 @@ typedef struct
struct timeval stop; struct timeval stop;
} cpt; } cpt;
# define t_start(x) { gettimeofday( &(x.start), NULL);} # define t_start(x) { gettimeofday( &((x).start), NULL);}
# define t_stop(x) { gettimeofday( &(x.stop), NULL); x.sec = (double)(x.stop.tv_sec) - (double)(x.start.tv_sec) + ((double)(x.stop.tv_usec) - (double)(x.start.tv_usec)) / 1000000;} # define t_stop(x) { gettimeofday( &((x).stop), NULL); (x).sec = (double)((x).stop.tv_sec) - (double)((x).start.tv_sec) + ((double)((x).stop.tv_usec) - (double)((x).start.tv_usec)) / 1000000;}
# define seed_get(x) (int)( (x).start.tv_sec)
#endif #endif
@@ -241,6 +245,8 @@ Command Command_Tab[] =
{ INDEX_REORG, "Index_Reorg", "Reorg Index", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, { INDEX_REORG, "Index_Reorg", "Reorg Index", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ INDEX_INFO_PRINT, "Index_Info_Print", "Print Index Informations", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, { INDEX_INFO_PRINT, "Index_Info_Print", "Print Index Informations", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ INDEX_VALUE_PRINT, "Index_Value_Print", "Print Index Values", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}, { INDEX_VALUE_PRINT, "Index_Value_Print", "Print Index Values", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ INDEX_VALUE_BREAK, "Index_Value_Break", "Break Index Value", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ INDEX_NODE_BREAK, "Index_Node_Break", "Break Index Node", ( DS_STATE_OPENED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)},
{ BATCH_RUN, "Batch_Run", "Run NDBench Bach", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)} { BATCH_RUN, "Batch_Run", "Run NDBench Bach", ( DS_STATE_OPENED | DS_STATE_CLOSED), ( NDD_INDEX_TYPE_LIST | NDD_INDEX_TYPE_TREE)}
}; };
@@ -265,7 +271,7 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
Command_Name = "NDD_CMD_MANAGER_VERSION"; Command_Name = "NDD_CMD_MANAGER_VERSION";
*Version_Name_Ptr = "$Revision: 2.7 $ $Name: $ $Date: 2004/08/01 23:38:52 $ $Author: agibert $"; *Version_Name_Ptr = "$Revision: 2.8 $ $Name: $ $Date: 2004/08/24 20:31:28 $ $Author: agibert $";
return( NDS_OK); return( NDS_OK);
} }
@@ -703,9 +709,9 @@ void Command_Index_Range_Get( FILE *File_Output, int *Low, int *High, char
void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, char *Arg1, char *Arg2, FILE *File_Input) void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, char *Arg1, char *Arg2, FILE *File_Input)
{ {
int low, high, i, j, nb_removed, Nb_Detected, Nb_Corrected; int low, high, i, j, nb_removed, Nb_Detected, Nb_Corrected;
T_Module Ref_Module, *Module_Ptr; T_Module Ref_Module, *Module_Ptr;
char buf[BUF_SIZE]; char buf[BUF_SIZE];
NDT_Index_Type index_subtype; NDT_Index_Type index_subtype;
@@ -1001,7 +1007,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
while( i < j) while( i < j)
{ {
Ref_Module.Id = low +( rand( ) % ( high - low)); Ref_Module.Id = low + (int)( (double)( high - low) * rand() / ( RAND_MAX + 1.0));
ND_DataStruct_Value_Find( (void *)&Module_Ptr, *DS_Ptr_Ptr, &Ref_Module); ND_DataStruct_Value_Find( (void *)&Module_Ptr, *DS_Ptr_Ptr, &Ref_Module);
i++; i++;
} }
@@ -1090,6 +1096,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
case INDEX_LIST_SUBTYPE_SET: case INDEX_LIST_SUBTYPE_SET:
{ {
int subtype;
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
if( low != -1) if( low != -1)
@@ -1102,9 +1111,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
Arg2 = buf; Arg2 = buf;
} }
Choice = atoi( Arg2); subtype = atoi( Arg2);
switch( Choice) switch( subtype)
{ {
case 0: case 0:
{ {
@@ -1127,7 +1136,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
default: default:
{ {
index_subtype = NDD_INDEX_SUBTYPE_UNKNOWN; index_subtype = NDD_INDEX_SUBTYPE_UNKNOWN;
printf ("Index_List_SubType_Set: Invalid selection (%d) !\n", Choice); printf ("Index_List_SubType_Set: Invalid selection (%d) !\n", subtype);
break; break;
} }
} }
@@ -1161,6 +1170,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
case INDEX_TREE_SUBTYPE_SET: case INDEX_TREE_SUBTYPE_SET:
{ {
int subtype;
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
if( low != -1) if( low != -1)
@@ -1173,9 +1185,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
Arg2 = buf; Arg2 = buf;
} }
Choice = atoi( Arg2); subtype = atoi( Arg2);
switch( Choice) switch( subtype)
{ {
case 0: case 0:
{ {
@@ -1192,7 +1204,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
default: default:
{ {
index_subtype = NDD_INDEX_SUBTYPE_UNKNOWN; index_subtype = NDD_INDEX_SUBTYPE_UNKNOWN;
printf ("Index_Tree_SubType_Set: Invalid selection (%d)!\n", Choice); printf ("Index_Tree_SubType_Set: Invalid selection (%d)!\n", subtype);
break; break;
} }
} }
@@ -1301,7 +1313,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
if( low != -1) if( low != -1)
{ {
fprintf( File_Output, "DS_Info_Print: Printing index from: (%d) to: (%d)...\n", low, high); fprintf( File_Output, "Index_Info_Print: Printing index from: (%d) to: (%d)...\n", low, high);
fflush( File_Output); fflush( File_Output);
for( i = low; i <= high; i++) for( i = low; i <= high; i++)
@@ -1322,6 +1334,88 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
break; break;
} }
case INDEX_VALUE_BREAK:
{
int position;
NDT_Node *node_ptr;
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
if( low != -1)
{
if( Arg2 == NULL)
{
fprintf( File_Output, "Index_Value_Break: Value position (0:Head | 1:Tail | 2:Random) ? ");
fgets( buf, BUF_LEN, stdin);
Arg2 = buf;
}
position = atoi( Arg2);
fprintf( File_Output, "Index_Value_Break: Breaking %s values from index : (%d) to: (%d)...\n",
( position == 0 ) ? "Head" : ( ( position == 1) ? "Tail" : "Random"),
low, high);
fflush( File_Output);
t_start( t_exec);
fprintf( File_Output, "Index_Value_Break: Breaking value of nodes: ");
fflush( File_Output);
for( i = low; i <= high; i++)
{
switch( position)
{
case 0:
{
node_ptr =(*DS_Ptr_Ptr)->Index_Tab[i].Head;
break;
}
case 1:
{
node_ptr=(*DS_Ptr_Ptr)->Index_Tab[i].Tail;
break;
}
case 2:
{
j = (int)( (double)( (*DS_Ptr_Ptr)->Index_Tab[i].Node_Number) * rand() / ( RAND_MAX + 1.0));
for( node_ptr = (*DS_Ptr_Ptr)->Index_Tab[i].Head; j > 0; j--)
{
node_ptr = node_ptr->Right;
}
break;
}
}
fprintf( File_Output, "0x(%x)", node_ptr);
fflush( File_Output);
node_ptr->Value = (void *)-1;
}
t_stop (t_exec);
fprintf( File_Output, "\n");
fflush( File_Output);
Command_Exec_End_Print( File_Output, Choice, t_exec, high - low);
}
break;
}
case INDEX_NODE_BREAK:
{
break;
}
case INDEX_CHECK: case INDEX_CHECK:
{ {
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index"); Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
@@ -1431,11 +1525,19 @@ void Batch_Run( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, FILE *File_Input,
/* */ /* */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
int main( int argc, char ** argv) int main( int argc, char **argv)
{ {
NDT_Root *ds_ptr = NULL; NDT_Root *ds_ptr = NULL;
/* Init Random numbers... */
t_start( t_exec);
t_stop( t_exec);
srand( seed_get(t_exec));
/* Args Parsing */ /* Args Parsing */
if( argc >= 2) if( argc >= 2)

View File

@@ -8,4 +8,8 @@ Lib_Open 1
DS_Open DS_Open
Index_List_Open 0-0 Index_List_Open 0-0
DS_Value_Add 1-10 0 DS_Value_Add 1-10 0
Index_Value_Break 0-0 0
Index_Value_Break 0-0 1
Index_Value_Break 0-0 2
DS_Check
Lib_Close Lib_Close