Compare commits
34 Commits
libnode-2_
...
libnode-2_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a6ae07870 | ||
|
|
b477d4b154 | ||
|
|
334f0cbeb1 | ||
|
|
676814b6cf | ||
|
|
f7c1f8bc5f | ||
|
|
652ab987a4 | ||
|
|
0431691352 | ||
|
|
3ad6e01702 | ||
|
|
4bf44a1fff | ||
|
|
aa69e7e7b1 | ||
|
|
29f7064ed0 | ||
|
|
97d57e391f | ||
|
|
d1778a5431 | ||
|
|
416ee6de00 | ||
|
|
8c1000401d | ||
|
|
11f4f585b3 | ||
|
|
0990ad102d | ||
|
|
da9d517e9a | ||
|
|
d50da065a6 | ||
|
|
f8f96b1ec8 | ||
|
|
b49d497bfb | ||
|
|
80665f9931 | ||
|
|
1d9539466d | ||
|
|
3ce278d6e5 | ||
|
|
3d91078a5c | ||
|
|
51482fb475 | ||
|
|
75cfc21e01 | ||
|
|
5aea056299 | ||
|
|
3f6d118ae2 | ||
|
|
7c96ad706b | ||
|
|
c70c4e5aba | ||
|
|
7f142acda3 | ||
|
|
64baaa1bc5 | ||
|
|
77330558f0 |
12
Makefile.var
12
Makefile.var
@@ -1,7 +1,7 @@
|
||||
# $RCSfile: Makefile.var,v $
|
||||
# $Revision: 1.2 $
|
||||
# $Revision: 1.4 $
|
||||
# $Name: $
|
||||
# $Date: 2003/07/16 22:55:51 $
|
||||
# $Date: 2005/01/19 23:30:05 $
|
||||
# $Author: agibert $
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@@ -11,7 +11,13 @@
|
||||
|
||||
|
||||
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
|
||||
AR=/usr/bin/ar
|
||||
|
||||
12
ReadMe.txt
12
ReadMe.txt
@@ -1,27 +1,27 @@
|
||||
# $RCSfile: ReadMe.txt,v $
|
||||
# $Revision: 2.6 $
|
||||
# $Revision: 2.8 $
|
||||
# $Name: $
|
||||
# $Date: 2003/07/27 23:10:55 $
|
||||
# $Date: 2005/01/24 01:19:50 $
|
||||
# $Author: agibert $
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Welcome to LibNode 2.0.x !
|
||||
Welcome to LibNode 2.1.x !
|
||||
|
||||
|
||||
|
||||
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,
|
||||
- Windows NT4 & 2000.
|
||||
- Windows NT4, 2000 and XP.
|
||||
|
||||
|
||||
|
||||
The support of LibVer is now optional (To enable it, use: make _LIBVER_SUPPORT=1 all).
|
||||
|
||||
LibShm and LibDataStr are no more supported.
|
||||
LibNode support LibShMem 2.0.0 and LibDataStr 2.0.0 !
|
||||
|
||||
|
||||
|
||||
|
||||
129
ReleaseNotes.txt
129
ReleaseNotes.txt
@@ -1,16 +1,56 @@
|
||||
# $RCSfile: ReleaseNotes.txt,v $
|
||||
# $Revision: 2.12 $
|
||||
# $Revision: 2.20 $
|
||||
# $Name: $
|
||||
# $Date: 2004/08/01 23:49:13 $
|
||||
# $Date: 2005/01/24 00:50:55 $
|
||||
# $Author: agibert $
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
LibNode V 2.1.0-1 - A. Gibert - 24/01/05
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
All: This new LibNode branch (2.1.x) should support the forthcoming new LibShMem branch (2.0.x),
|
||||
LibNode: Add symbol lookup support for manager, allocator and desallocator functions call,
|
||||
New Allocator and desallocator API interace,
|
||||
Code cleanup,
|
||||
NDBench: DS_Open now support an arg in order to use or not symbol lookup,
|
||||
Add test-*-s.ndb batch files witch use symbol lookup.
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
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
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
All: Add a new Makefile system (Makefile.rule and Makefile.var),
|
||||
Add 'make distrib' support,
|
||||
@@ -19,9 +59,9 @@ All: Add a new Makefile system (Makefile.rule and Makefile.var),
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
LibNode V 2.0.4-1 - A. Gibert - 29/07/02
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
All: This release of libnode pass with sucess valgrind test on linux.
|
||||
LibNode: Add and use ND_Index_Clear() private API,
|
||||
@@ -29,9 +69,9 @@ NbBench: Add fclose() call at the end of batch_run.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
LibNode V 2.0.3-1 - A. Gibert - 09/04/02
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
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,
|
||||
@@ -43,9 +83,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
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
All: Add GNU-GPL.txt, GNU-LGPL.txt and GNU-FDL.txt license files,
|
||||
All: Add license stuff in ReandMe.
|
||||
@@ -56,9 +96,9 @@ NbBench: Add GPL header in ndbench.c.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
LibNode V 2.0.2-1 - A. Gibert - 27/02/02
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
All: Makefiles now generate static and dynamic objects,
|
||||
All: Add no libver support in Makefiles,
|
||||
@@ -70,26 +110,26 @@ NbBench: Implement Index_Close and Index_Info_Print functions.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
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 V 2.0.0-1 - A. Gibert - 26/11/01
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
All: Merge the main CVS trunc with the win32 branche (2.0.0-alpha5),
|
||||
Switch file release to 2.0.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
LibNode V 2.0.0-alpha5 - A. Gibert - 25/10/01
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
LibNode: Add Open/Close Index support,
|
||||
LibNode: Fix return code next to empty struct manipulations,
|
||||
@@ -97,9 +137,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,
|
||||
LibNode: Fix missing recursive offset args,
|
||||
@@ -108,18 +148,18 @@ NdBench: Fix local stack pointer big bug.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
LibNode V 2.0.0-alpha3 - A. Gibert - 18/9/01
|
||||
--------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
New manager args interface (again !),
|
||||
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,
|
||||
Bug fixes,
|
||||
@@ -127,53 +167,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,
|
||||
Remove libver support,
|
||||
Multi index support,
|
||||
New manager args format,
|
||||
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)
|
||||
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)
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
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).
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
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).
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
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).
|
||||
|
||||
9
ToDo.txt
9
ToDo.txt
@@ -1,15 +1,14 @@
|
||||
# $RCSfile: ToDo.txt,v $
|
||||
# $Revision: 2.3 $
|
||||
# $Revision: 2.5 $
|
||||
# $Name: $
|
||||
# $Date: 2003/07/27 23:14:10 $
|
||||
# $Date: 2005/01/24 01:19:50 $
|
||||
# $Author: agibert $
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- Check LibShMem/LibDataStr support (via symbol lookup support),
|
||||
- Add Cache Value option,
|
||||
- More debug !
|
||||
- New English documentation (man/tex),
|
||||
- Improve API consitency,
|
||||
- Re-enable LibShm/LibDataStr support (via NDT_DataStruct implementation).
|
||||
- Improve API consitency.
|
||||
|
||||
@@ -10,12 +10,13 @@ include ../Makefile.rule
|
||||
|
||||
|
||||
|
||||
DEP_STATIC = ../lib/libnode.a
|
||||
DEP_DYNAMIC = ../lib/libnode.so
|
||||
INCLUDE = -I . -I ../include
|
||||
LIBDIR = -L . -L ../lib
|
||||
LIB_STATIC = ../lib/libnode.a
|
||||
LIB_DYNAMIC = -lnode
|
||||
DEP_STATIC += ../lib/libnode.a
|
||||
DEP_DYNAMIC += ../lib/libnode.so
|
||||
INCLUDE += -I . -I ../include
|
||||
LIBDIR += -L . -L ../lib
|
||||
LIB_STATIC += ../lib/libnode.a -ldl
|
||||
LIB_DYNAMIC += -lnode -ldl
|
||||
CFLAGS += -rdynamic
|
||||
|
||||
ifdef _LIBVER_SUPPORT
|
||||
DEP_STATIC += ../../libver/ver.h ../../libver/libver.a
|
||||
@@ -27,11 +28,11 @@ ifdef _LIBVER_SUPPORT
|
||||
LIB_STATIC += ../../libver/lib/libver.a
|
||||
LIB_DYNAMIC += -lver
|
||||
else
|
||||
LIB_STATIC += -ldl ../../libver/lib/libver.a
|
||||
LIB_DYNAMIC += -ldl -lver
|
||||
LIB_STATIC += ../../libver/lib/libver.a
|
||||
LIB_DYNAMIC += -lver
|
||||
endif
|
||||
|
||||
CFLAGS += -D_LIBVER_SUPPORT -rdynamic
|
||||
CFLAGS += -D_LIBVER_SUPPORT
|
||||
endif
|
||||
|
||||
ND_CHECK_FLAGS = -DND_MODE=0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: nddemo0.c,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.7 $ */
|
||||
/* $Revision: 2.8 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2004/08/01 23:35:39 $ */
|
||||
/* $Date: 2004/08/23 22:48:37 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
#define VAL_SIZE ( short) ( VAL_LEN + 1)
|
||||
#define INDEX_NB ( short) 4
|
||||
|
||||
#define NDT_CMD_INDEX0_PRINT (NDT_Command)64
|
||||
#define NDT_CMD_INDEX1_PRINT (NDT_Command)65
|
||||
#define NDT_CMD_INDEX2_PRINT (NDT_Command)66
|
||||
#define NDT_CMD_INDEX3_PRINT (NDT_Command)67
|
||||
#define NDD_CMD_INDEX0_PRINT ( NDT_Command) 64
|
||||
#define NDD_CMD_INDEX1_PRINT ( NDT_Command) 65
|
||||
#define NDD_CMD_INDEX2_PRINT ( NDT_Command) 66
|
||||
#define NDD_CMD_INDEX3_PRINT ( NDT_Command) 67
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ typedef struct Demo_Value
|
||||
/* 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 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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
*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);
|
||||
}
|
||||
@@ -117,28 +117,28 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
|
||||
switch(Cmd)
|
||||
{
|
||||
case NDT_CMD_INDEX0_PRINT:
|
||||
case NDD_CMD_INDEX0_PRINT:
|
||||
{
|
||||
*Reply_Index_Id_Ptr = 0;
|
||||
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
||||
break;
|
||||
}
|
||||
|
||||
case NDT_CMD_INDEX1_PRINT:
|
||||
case NDD_CMD_INDEX1_PRINT:
|
||||
{
|
||||
*Reply_Index_Id_Ptr = 1;
|
||||
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
||||
break;
|
||||
}
|
||||
|
||||
case NDT_CMD_INDEX2_PRINT:
|
||||
case NDD_CMD_INDEX2_PRINT:
|
||||
{
|
||||
*Reply_Index_Id_Ptr = 2;
|
||||
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
||||
break;
|
||||
}
|
||||
|
||||
case NDT_CMD_INDEX3_PRINT:
|
||||
case NDD_CMD_INDEX3_PRINT:
|
||||
{
|
||||
*Reply_Index_Id_Ptr = 3;
|
||||
*Reply_Command_Ptr = NDD_CMD_VALUE_PRINT;
|
||||
@@ -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";
|
||||
|
||||
return( NDS_OK);
|
||||
}
|
||||
|
||||
@@ -380,12 +381,12 @@ NDT_Status Manager_Demo_DS( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
default:
|
||||
{
|
||||
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);
|
||||
return NDS_OK;
|
||||
return( NDS_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -492,7 +493,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -503,7 +504,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -514,7 +515,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -525,7 +526,7 @@ void DataStruct_Dump( NDT_Root *ds_ptr)
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -584,7 +585,7 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
|
||||
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);
|
||||
}
|
||||
@@ -607,16 +608,11 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
|
||||
printf( "\n\n\nLaod Data File:\n\n");
|
||||
DataStruct_Load( demo_ds_ptr, demo_file);
|
||||
|
||||
|
||||
|
||||
if( Optimized_Mode)
|
||||
{
|
||||
|
||||
printf( "\n\n\nInitial Structure Dump:\n\n");
|
||||
DataStruct_Dump( demo_ds_ptr);
|
||||
|
||||
|
||||
|
||||
printf( "Convert data structure: ");
|
||||
|
||||
if( ( status = ND_DataStruct_Convert( demo_ds_ptr, index_type_final_tab)) != NDS_OK)
|
||||
@@ -634,8 +630,6 @@ void Demo( char *Demo_File_Name, short Optimized_Mode)
|
||||
printf( "\n\n\nFinal Structure Dump:\n\n");
|
||||
DataStruct_Dump( demo_ds_ptr);
|
||||
|
||||
|
||||
|
||||
printf( "Close demo datafile: ");
|
||||
|
||||
if( fclose( demo_file) != 0)
|
||||
|
||||
104
include/node.h
104
include/node.h
@@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: node.h,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.7 $ */
|
||||
/* $Revision: 2.12 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2004/08/01 23:18:37 $ */
|
||||
/* $Date: 2005/01/20 00:00:25 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -37,10 +37,9 @@
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
#include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
#include <signal.h>
|
||||
# include <stdarg.h>
|
||||
|
||||
# ifdef _LIBVER_SUPPORT
|
||||
@@ -227,7 +226,7 @@ typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Nod
|
||||
|
||||
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 */
|
||||
@@ -261,8 +260,8 @@ typedef struct NDT_Index
|
||||
|
||||
typedef struct NDT_Root
|
||||
{
|
||||
// NDT_Root_Type Type; /* Root Structure Type */
|
||||
// NDT_DataStruct_Type DS_Type; /* Type de la structure (liste, arbre ... ) */
|
||||
/* NDT_Root_Type Type;*/ /* Root Structure Type */
|
||||
/* NDT_DataStruct_Type DS_Type;*/ /* Type de la structure (liste, arbre ... ) */
|
||||
|
||||
NDT_Manager *Manager_Ptr; /* Pointeur sur 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 */
|
||||
|
||||
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_Open_Count;
|
||||
NDT_Index Index_Tab[0];
|
||||
NDT_Index Index_Tab[1];
|
||||
|
||||
} NDT_Root;
|
||||
|
||||
@@ -335,7 +334,7 @@ typedef int NDT_Recursive_Offset;
|
||||
|
||||
#define ND_Library_Open ND_Library_Open_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_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_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_Close ND_DataStruct_Close_C
|
||||
@@ -437,7 +436,7 @@ typedef int NDT_Recursive_Offset;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
# if defined(_MSC_VER) && !defined(LIBNODE_STATIC)
|
||||
# if defined(_WIN32) && !defined(LIBNODE_STATIC)
|
||||
# ifndef _LIBNODE_C_
|
||||
# define NDD_DLL_API __declspec(dllimport)
|
||||
# else
|
||||
@@ -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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_I( FILE *Out);
|
||||
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_C( FILE *Out);
|
||||
NDD_DLL_API NDT_Status ND_Library_StdErr_Set_I( FILE *);
|
||||
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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Close_I( NDT_Root *Root);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Close_C( 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 *);
|
||||
|
||||
|
||||
|
||||
@@ -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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Flush_I( NDT_Root *Root);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Flush_C( 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 *);
|
||||
|
||||
|
||||
|
||||
@@ -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 */
|
||||
/* (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_C( 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 *, 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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_I( NDT_Root *Root);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Reorg_C( 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 *);
|
||||
|
||||
|
||||
|
||||
@@ -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) 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_VC( NDT_Root *, NDT_Command 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_C( NDT_Root *, NDT_Command Command, ...);
|
||||
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, va_list);
|
||||
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, ...);
|
||||
|
||||
|
||||
|
||||
@@ -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) 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_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_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 *, 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) 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_C( 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 *, 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) 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_C( 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 *, 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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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_VC( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, 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_C( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, ...);
|
||||
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 **, NDT_Root *, void *, va_list);
|
||||
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 **, 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 */
|
||||
/* (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_C( 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 *, 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) 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_C ( 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, 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) 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_C( 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 *, 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) 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_C( 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 *, 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) 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_C( 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 *, 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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Remove_I( NDT_Node * Node);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Remove_C( 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 *);
|
||||
|
||||
|
||||
|
||||
@@ -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) 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_C( 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( void **, size_t, NDT_Allocator_Name, NDT_Allocator *, void *);
|
||||
|
||||
|
||||
|
||||
@@ -902,11 +901,12 @@ 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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* (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) 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_C( 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( void *, NDT_Desallocator_Name, NDT_Desallocator *, void *);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ include ../Makefile.rule
|
||||
|
||||
|
||||
|
||||
DEP = libnode.h ../include/node.h Makefile
|
||||
INCLUDE = -I . -I ../include
|
||||
DEP += libnode.h ../include/node.h Makefile
|
||||
INCLUDE += -I . -I ../include
|
||||
|
||||
ifdef _LIBVER_SUPPORT
|
||||
DEP += ../../libver/ver.h
|
||||
|
||||
385
lib/libnode.c
385
lib/libnode.c
@@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: libnode.c,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.10 $ */
|
||||
/* $Revision: 2.15 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2004/08/01 23:18:38 $ */
|
||||
/* $Date: 2005/01/19 23:59:41 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <libnode.h>
|
||||
|
||||
#ifdef _LIBVER_SUPPORT
|
||||
VER_INFO_EXPORT( libnode, "$Revision: 2.10 $", "$Name: $", __FILE__, "$Author: agibert $")
|
||||
VER_INFO_EXPORT( libnode, "$Revision: 2.15 $", "$Name: $", __FILE__, "$Author: agibert $")
|
||||
#endif
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
|
||||
Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||
|
||||
*Version_Name_Ptr = "$Revision: 2.10 $ $Name: $ $Date: 2004/08/01 23:18:38 $ $Author: agibert $";
|
||||
*Version_Name_Ptr = "$Revision: 2.15 $ $Name: $ $Date: 2005/01/19 23:59:41 $ $Author: agibert $";
|
||||
|
||||
return( NDS_OK);
|
||||
}
|
||||
@@ -369,7 +369,7 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
|
||||
|
||||
Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||
|
||||
*Version_Name_Ptr = "$Revision: 2.10 $ $Name: $ $Date: 2004/08/01 23:18:38 $ $Author: agibert $";
|
||||
*Version_Name_Ptr = "$Revision: 2.15 $ $Name: $ $Date: 2005/01/19 23:59:41 $ $Author: agibert $";
|
||||
|
||||
return( NDS_OK);
|
||||
}
|
||||
@@ -604,6 +604,16 @@ NDT_Status ND_Library_Open_I( int Debug_Mode)
|
||||
ND_Library_StdErr_Set_I( stderr);
|
||||
}
|
||||
|
||||
#if !defined(_WIN32)
|
||||
if( ( NDG_Base.DL_Ptr = dlopen( NULL, ( RTLD_NOW | RTLD_GLOBAL))) == NULL)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Library_Open: can't dlopen [%s]", dlerror());
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
#endif
|
||||
|
||||
return( NDS_OK);
|
||||
}
|
||||
|
||||
@@ -671,6 +681,15 @@ NDT_Status ND_Library_Close_I( void)
|
||||
|
||||
NDG_Base.Symbol_First_Ptr = (NDT_Symbol *)NULL;
|
||||
|
||||
#if !defined(_WIN32)
|
||||
if( dlclose( NDG_Base.DL_Ptr) != 0)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Library_Open: can't dlclose [%s]", dlerror());
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
#endif
|
||||
|
||||
NDG_Base.Open_Status = NDD_FALSE;
|
||||
|
||||
@@ -698,16 +717,16 @@ NDT_Status ND_Library_Close_C( void)
|
||||
return( NDS_KO);
|
||||
}
|
||||
|
||||
if( NDG_Base.Debug_Mode == NDD_TRUE)
|
||||
if( ( NDG_Base.Debug_Mode == NDD_TRUE) && ( NDG_Base.Err_Stream != NULL))
|
||||
{
|
||||
if( NDG_Base.OpenStruct_Ptr->Index_Tab[NDD_INDEX_PRIMARY].Node_Number > 0)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Library_Open_C: Unclosed DataStruct:");
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Library_Close_C: Unclosed DataStruct:");
|
||||
ND_Error_Print();
|
||||
|
||||
if( ( status = ND_DataStruct_Info_Print_I( NDG_Base.Err_Stream, NDG_Base.OpenStruct_Ptr, NDD_RECURSIVE_MODE_PARENT_CHILD, 0, 0)) != NDS_OK)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Library_Open_C: can't print OpenStruct info");
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Library_Close_C: can't print OpenStruct info");
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
@@ -716,7 +735,7 @@ NDT_Status ND_Library_Close_C( void)
|
||||
|
||||
if( ( status = ND_DataStruct_Close_I( NDG_Base.OpenStruct_Ptr)) != NDS_OK)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Library_Open_C: can't close OpenStruct");
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Library_Close_C: can't close OpenStruct");
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
@@ -903,7 +922,6 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_N
|
||||
NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, short Own_Value, void *Data)
|
||||
{
|
||||
NDT_Status status;
|
||||
// const char *Real_Allocator, *Real_Desallocator; // Win32
|
||||
NDT_Manager_Name Real_Manager_Name;
|
||||
NDT_Manager *Real_Manager_Ptr;
|
||||
NDT_Allocator_Name Real_Allocator_Name;
|
||||
@@ -914,7 +932,17 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_N
|
||||
|
||||
/* Valeurs par défaut des fonctions d'allocation et de désallocation */
|
||||
|
||||
if( Manager_Ptr)
|
||||
#if defined(_WIN32)
|
||||
if( ( Manager_Name != NULL) && ( Manager_Ptr == NULL))
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Manager_Ptr shouldn't be NULL");
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_ERRAPI);
|
||||
}
|
||||
#endif
|
||||
|
||||
if( ( Manager_Name != NULL) || ( Manager_Ptr != NULL))
|
||||
{
|
||||
Real_Manager_Name = Manager_Name;
|
||||
Real_Manager_Ptr = Manager_Ptr;
|
||||
@@ -925,7 +953,17 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_N
|
||||
Real_Manager_Ptr = ND_Default_Manager;
|
||||
}
|
||||
|
||||
if( Allocator_Ptr)
|
||||
#if defined(_WIN32)
|
||||
if( ( Allocator_Name != NULL) && ( Allocator_Ptr == NULL))
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Allocator_Ptr shouldn't be NULL");
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_ERRAPI);
|
||||
}
|
||||
#endif
|
||||
|
||||
if( ( Allocator_Name != NULL) || ( Allocator_Ptr != NULL))
|
||||
{
|
||||
Real_Allocator_Name = Allocator_Name;
|
||||
Real_Allocator_Ptr = Allocator_Ptr;
|
||||
@@ -936,7 +974,17 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_N
|
||||
Real_Allocator_Ptr = ND_Default_Allocator;
|
||||
}
|
||||
|
||||
if( Desallocator_Ptr)
|
||||
#if defined(_WIN32)
|
||||
if( ( Desallocator_Name != NULL) && ( Desallocator_Ptr == NULL))
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_DataStruct_Open_I: no symbol lookup support, Desallocator_Ptr shouldn't be NULL");
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_ERRAPI);
|
||||
}
|
||||
#endif
|
||||
|
||||
if( ( Desallocator_Name != NULL) || ( Desallocator_Ptr != NULL))
|
||||
{
|
||||
Real_Desallocator_Name = Desallocator_Name;
|
||||
Real_Desallocator_Ptr = Desallocator_Ptr;
|
||||
@@ -2162,7 +2210,7 @@ NDT_Status ND_Index_Info_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id
|
||||
memset( offset, ' ', Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET);
|
||||
offset[Recursive_Offset * ND_RECURSIVE_PRINT_OFFSET] = '\0';
|
||||
|
||||
printf( "%s Index Id: (%d)\tType: (%#06x) [%s:%s:%s]\tNode Nb: (%d)\tHead: (%s%p)\tTail: (%s%p)\n%s Min Depth: (%d)\tMax Depth: (%d)\tMax Dif: (%d)\tNb Equ: (%d)\tSave: (%s%p)\n\n",
|
||||
fprintf( Out, "%s Index Id: (%d)\tType: (%#06x) [%s:%s:%s]\tNode Nb: (%d)\tHead: (%s%p)\tTail: (%s%p)\n%s Min Depth: (%d)\tMax Depth: (%d)\tMax Dif: (%d)\tNb Equ: (%d)\tSave: (%s%p)\n\n",
|
||||
offset, Index_Id, Root_Ptr->Index_Tab[Index_Id].Type, ND_INDEX_STATUS_ASCII_GET( Root_Ptr, Index_Id), ND_INDEX_TYPE_ASCII_GET( Root_Ptr, Index_Id), ND_INDEX_SUBTYPE_ASCII_GET( Root_Ptr, Index_Id),
|
||||
Root_Ptr->Index_Tab[Index_Id].Node_Number,
|
||||
NDD_PRINTF_PTR_PREFIX, Root_Ptr->Index_Tab[Index_Id].Head, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Index_Tab[Index_Id].Tail,
|
||||
@@ -2249,9 +2297,9 @@ NDT_Status ND_DataStruct_Info_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Recu
|
||||
status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_MANAGER_VERSION, &version_name);
|
||||
if( ND_ERROR( status)) return( status);
|
||||
|
||||
printf( "%sRoot: (%s%p)\tIndex Nb: (%d)\tIndex Open Count: (%d)\tManager: (%s%p) [%s]\n%sAllocator: (%s%p) [%s]\tDesallocator: (%s%p) [%s]\tUser: (%s%p)\n%sManager Version: [%s]\n\n",
|
||||
fprintf( Out, "%sRoot: (%s%p)\tIndex Nb: (%d)\tIndex Open Count: (%d)\tManager: (%s%p) [%s]\n%sAllocator: (%s%p) [%s]\tDesallocator: (%s%p) [%s]\tUser: (%s%p)\n%sManager Version: [%s]\n\n",
|
||||
offset, NDD_PRINTF_PTR_PREFIX, Root_Ptr, Root_Ptr->Index_Nb, Root_Ptr->Index_Open_Count, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Manager_Ptr, Root_Ptr->Manager_Name,
|
||||
offset, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Allocator_Ptr, Root_Ptr->Allocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Desallocator_Ptr, Root_Ptr->Desallocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->User,
|
||||
offset, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Allocator_Ptr, Root_Ptr->Allocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->Desallocator_Ptr, Root_Ptr->Desallocator_Name, NDD_PRINTF_PTR_PREFIX, Root_Ptr->User_Ptr,
|
||||
offset, version_name);
|
||||
}
|
||||
|
||||
@@ -3796,7 +3844,20 @@ NDT_Status ND_Manager_Exec_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
NDT_Manager *manager_ptr;
|
||||
|
||||
|
||||
manager_ptr = Root_Ptr->Manager_Ptr; // Win32
|
||||
if( Root_Ptr->Manager_Ptr != NULL)
|
||||
{
|
||||
manager_ptr = Root_Ptr->Manager_Ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ND_Symbol_Find( (void **)&manager_ptr, Root_Ptr->Manager_Name) != NDS_OK)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "ND_Manager_Exec_VI: cant't find manger function");
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
}
|
||||
|
||||
status = manager_ptr( Root_Ptr, Index_Id, Node_Ptr, Command, Args);
|
||||
|
||||
@@ -3865,7 +3926,20 @@ NDT_Status ND_Manager_Exec_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_
|
||||
|
||||
va_start( args, Command);
|
||||
|
||||
manager_ptr = Root_Ptr->Manager_Ptr; // Win32
|
||||
if( Root_Ptr->Manager_Ptr != NULL)
|
||||
{
|
||||
manager_ptr = Root_Ptr->Manager_Ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ND_Symbol_Find( (void **)&manager_ptr, Root_Ptr->Manager_Name) != NDS_OK)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "ND_Manager_Exec_I: cant't find manger function");
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
}
|
||||
|
||||
status = manager_ptr( Root_Ptr, Index_Id, Node_Ptr, Command, args);
|
||||
|
||||
@@ -3936,15 +4010,27 @@ NDT_Status ND_Manager_Exec_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_
|
||||
/* (I) Data : données utilisateur utiles à l'allocateur */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status ND_Allocator_Exec_I( NDT_Allocator *Function, void **Ptr_Ptr, size_t Size, void *Data_Ptr)
|
||||
NDT_Status ND_Allocator_Exec_I( void **Ptr_Ptr, size_t Size, NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, void *Data_Ptr)
|
||||
{
|
||||
NDT_Allocator *allocator_ptr;
|
||||
|
||||
*Ptr_Ptr = NULL;
|
||||
|
||||
allocator_ptr = Function;
|
||||
if( Allocator_Ptr != NULL)
|
||||
{
|
||||
allocator_ptr = Allocator_Ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ND_Symbol_Find( (void **)&allocator_ptr, Allocator_Name) != NDS_OK)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_I: cant't find allocator function");
|
||||
ND_Error_Print();
|
||||
|
||||
return allocator_ptr( Size, Ptr_Ptr, Data_Ptr);
|
||||
return( NDS_KO);
|
||||
}
|
||||
}
|
||||
|
||||
return allocator_ptr( Ptr_Ptr, Size, Data_Ptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -3960,11 +4046,8 @@ NDT_Status ND_Allocator_Exec_I( NDT_Allocator *Function, void **Ptr_Ptr, size
|
||||
/* (I) Data : données utilisateur utiles à l'allocateur */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status ND_Allocator_Exec_C ( NDT_Allocator *Function, void **Ptr_Ptr, size_t Size, void *Data_Ptr)
|
||||
NDT_Status ND_Allocator_Exec_C( void **Ptr_Ptr, size_t Size, NDT_Allocator_Name Allocator_Name, NDT_Allocator *Allocator_Ptr, void *Data_Ptr)
|
||||
{
|
||||
NDT_Allocator *Allocator_Ptr;
|
||||
|
||||
|
||||
if( NDG_Base.Open_Status != NDD_TRUE)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Allocator_Exec_C: library is not open");
|
||||
@@ -3973,9 +4056,7 @@ NDT_Status ND_Allocator_Exec_C ( NDT_Allocator *Function, void **Ptr_Ptr, siz
|
||||
return( NDS_ERRAPI);
|
||||
}
|
||||
|
||||
*Ptr_Ptr = NULL;
|
||||
|
||||
if(!Function || !*Function)
|
||||
if( ( Allocator_Name == NULL) && ( Allocator_Ptr == NULL))
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Allocator_Exec_C: undefined function name");
|
||||
ND_Error_Print();
|
||||
@@ -3983,11 +4064,7 @@ NDT_Status ND_Allocator_Exec_C ( NDT_Allocator *Function, void **Ptr_Ptr, siz
|
||||
return( NDS_ERRAPI);
|
||||
}
|
||||
|
||||
Allocator_Ptr = Function;
|
||||
|
||||
if( !Allocator_Ptr) return( NDS_ERRAPI);
|
||||
|
||||
return( Allocator_Ptr (Size, Ptr_Ptr, Data_Ptr));
|
||||
return( ND_Allocator_Exec_I( Ptr_Ptr, Size, Allocator_Name, Allocator_Ptr, Data_Ptr));
|
||||
}
|
||||
|
||||
|
||||
@@ -4002,11 +4079,25 @@ NDT_Status ND_Allocator_Exec_C ( NDT_Allocator *Function, void **Ptr_Ptr, siz
|
||||
/* (I) Data : données utilisateur utiles à l'allocateur */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status ND_Desallocator_Exec_I( NDT_Desallocator *Function, void *Ptr, void *Data_Ptr)
|
||||
NDT_Status ND_Desallocator_Exec_I( void *Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, void *Data_Ptr)
|
||||
{
|
||||
NDT_Desallocator *desallocator_ptr;
|
||||
|
||||
desallocator_ptr = Function;
|
||||
|
||||
if( Desallocator_Ptr != NULL)
|
||||
{
|
||||
desallocator_ptr = Desallocator_Ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ND_Symbol_Find( (void **)&desallocator_ptr, Desallocator_Name) != NDS_OK)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Manager_Exec_I: cant't find desallocator function");
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
}
|
||||
|
||||
return( desallocator_ptr( Ptr, Data_Ptr));
|
||||
}
|
||||
@@ -4023,11 +4114,8 @@ NDT_Status ND_Desallocator_Exec_I( NDT_Desallocator *Function, void *Ptr, void
|
||||
/* (I) Data : données utilisateur utiles à l'allocateur */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status ND_Desallocator_Exec_C( NDT_Desallocator *Function, void *Ptr, void *Data_Ptr)
|
||||
NDT_Status ND_Desallocator_Exec_C( void *Ptr, NDT_Desallocator_Name Desallocator_Name, NDT_Desallocator *Desallocator_Ptr, void *Data_Ptr)
|
||||
{
|
||||
NDT_Desallocator *desallocator_ptr;
|
||||
|
||||
|
||||
if( NDG_Base.Open_Status != NDD_TRUE)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Desallocator_Exec_C: library is not open");
|
||||
@@ -4036,7 +4124,7 @@ NDT_Status ND_Desallocator_Exec_C( NDT_Desallocator *Function, void *Ptr, voi
|
||||
return( NDS_ERRAPI);
|
||||
}
|
||||
|
||||
if (!Function || !*Function)
|
||||
if( ( Desallocator_Name == NULL) && ( Desallocator_Ptr == NULL))
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Desallocator_Exec_C: undefined function name");
|
||||
ND_Error_Print();
|
||||
@@ -4044,11 +4132,7 @@ NDT_Status ND_Desallocator_Exec_C( NDT_Desallocator *Function, void *Ptr, voi
|
||||
return( NDS_ERRAPI);
|
||||
}
|
||||
|
||||
desallocator_ptr = Function;
|
||||
|
||||
if( !desallocator_ptr) return( NDS_ERRAPI);
|
||||
|
||||
return( desallocator_ptr( Ptr, Data_Ptr));
|
||||
return( ND_Desallocator_Exec_I( Ptr, Desallocator_Name, Desallocator_Ptr, Data_Ptr));
|
||||
}
|
||||
|
||||
|
||||
@@ -4058,25 +4142,20 @@ NDT_Status ND_Desallocator_Exec_C( NDT_Desallocator *Function, void *Ptr, voi
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* FONCTIONS SECURISEES (ND_MODE = 0) */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* FONCTIONS PRIVEES */
|
||||
/* PRIVATE FUNCTIONS */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Recherche d'un symbole */
|
||||
/* Symbol Lookup */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void *ND_Symbol_Find( const char *Symbol_Name)
|
||||
|
||||
NDT_Status ND_Symbol_Find( void **Ptr_Ptr, const char *Symbol_Name)
|
||||
{
|
||||
#if !defined(_WIN32)
|
||||
NDT_Symbol *Symbol_Ptr;
|
||||
void *Ptr = NULL;
|
||||
|
||||
|
||||
/* Recherche du symbole dans la table des symboles locale */
|
||||
|
||||
@@ -4084,31 +4163,47 @@ void *ND_Symbol_Find( const char *Symbol_Name)
|
||||
|
||||
while( Symbol_Ptr)
|
||||
{
|
||||
if( !strcmp( Symbol_Ptr->Name, Symbol_Name)) return( Symbol_Ptr->Ptr);
|
||||
else Symbol_Ptr = Symbol_Ptr->Next;
|
||||
if( !strcmp( Symbol_Ptr->Name, Symbol_Name))
|
||||
{
|
||||
*Ptr_Ptr = Symbol_Ptr->Ptr;
|
||||
return( NDS_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
Symbol_Ptr = Symbol_Ptr->Next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Si le symbole n'a pas été trouvée dans la table des symboles locale, on l'y ajoute */
|
||||
|
||||
// Ptr = dlsym( RTLD_DEFAULT, (const char *)Symbol_Name);
|
||||
if( !Ptr)
|
||||
if( ( *Ptr_Ptr = dlsym( NDG_Base.DL_Ptr, (const char *)Symbol_Name)) == NULL)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Symbol_Find: unable to find \"%s\"' in symbol table (%s)", Symbol_Name, NULL/*dlerror ()*/);
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Symbol_Find: unable to find \"%s\"' in symbol table (%s)", Symbol_Name, dlerror());
|
||||
ND_Error_Print();
|
||||
return NULL;
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
|
||||
Symbol_Ptr = (NDT_Symbol *)malloc( sizeof( NDT_Symbol));
|
||||
if( Symbol_Ptr)
|
||||
if( Symbol_Ptr == NULL)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Symbol_Find: no more memory");
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
else
|
||||
{
|
||||
Symbol_Ptr->Name = strdup (Symbol_Name);
|
||||
Symbol_Ptr->Ptr = Ptr;
|
||||
Symbol_Ptr->Ptr = *Ptr_Ptr;
|
||||
Symbol_Ptr->Next = NDG_Base.Symbol_First_Ptr;
|
||||
|
||||
NDG_Base.Symbol_First_Ptr = Symbol_Ptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
return Ptr;
|
||||
return( NDS_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -4127,7 +4222,7 @@ NDT_Status ND_Node_Alloc( NDT_Root *Root_Ptr, NDT_Node **Node_Ptr_Ptr )
|
||||
NDT_Status rc;
|
||||
|
||||
|
||||
rc = ND_Allocator_Exec_I( Root_Ptr->Allocator_Ptr, (void **)Node_Ptr_Ptr, sizeof(NDT_Node), Root_Ptr->User);
|
||||
rc = ND_Allocator_Exec_I( (void **)Node_Ptr_Ptr, sizeof(NDT_Node), Root_Ptr->Allocator_Name, Root_Ptr->Allocator_Ptr, Root_Ptr->User_Ptr);
|
||||
if( ND_ERROR( rc)) return( rc);
|
||||
|
||||
(*Node_Ptr_Ptr)->Root = NULL;
|
||||
@@ -4152,7 +4247,7 @@ NDT_Status ND_Node_Alloc( NDT_Root *Root_Ptr, NDT_Node **Node_Ptr_Ptr )
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Status ND_Node_Free( NDT_Root *Root_Ptr, NDT_Node *Node_Ptr)
|
||||
{
|
||||
return ND_Desallocator_Exec_I( Root_Ptr->Desallocator_Ptr, Node_Ptr, Root_Ptr->User);
|
||||
return( ND_Desallocator_Exec_I( Node_Ptr, Root_Ptr->Desallocator_Name, Root_Ptr->Desallocator_Ptr, Root_Ptr->User_Ptr));
|
||||
}
|
||||
|
||||
|
||||
@@ -4208,7 +4303,7 @@ NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb,
|
||||
NDT_Index_Id index_id;
|
||||
|
||||
|
||||
status = ND_Allocator_Exec_I( Allocator_Ptr, (void **)Root_Ptr_Ptr, ( sizeof (NDT_Root) + sizeof(NDT_Index) * (Index_Nb + 1)), Data_Ptr);
|
||||
status = ND_Allocator_Exec_I( (void **)Root_Ptr_Ptr, ( sizeof( NDT_Root) + sizeof(NDT_Index) * (Index_Nb - 1)), Allocator_Name, Allocator_Ptr, Data_Ptr);
|
||||
if( ND_ERROR(status)) return( status);
|
||||
|
||||
if( strlen(Manager_Name) > NDD_MANAGER_NAME_LEN_MAX) return( NDS_ERRAPI);
|
||||
@@ -4224,7 +4319,7 @@ NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb,
|
||||
(*Root_Ptr_Ptr)->Desallocator_Ptr = Desallocator_Ptr;
|
||||
|
||||
(*Root_Ptr_Ptr)->Own_Value = Own_Value;
|
||||
(*Root_Ptr_Ptr)->User = Data_Ptr;
|
||||
(*Root_Ptr_Ptr)->User_Ptr = Data_Ptr;
|
||||
|
||||
(*Root_Ptr_Ptr)->Index_Nb = Index_Nb;
|
||||
(*Root_Ptr_Ptr)->Index_Open_Count = 0;
|
||||
@@ -4263,7 +4358,7 @@ NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb,
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Status ND_Node_Root_Free( NDT_Root *Root_Ptr)
|
||||
{
|
||||
return ND_Desallocator_Exec_I( Root_Ptr->Desallocator_Ptr, Root_Ptr, Root_Ptr->User);
|
||||
return( ND_Desallocator_Exec_I( Root_Ptr, Root_Ptr->Desallocator_Name, Root_Ptr->Desallocator_Ptr, Root_Ptr->User_Ptr));
|
||||
}
|
||||
|
||||
|
||||
@@ -4702,10 +4797,12 @@ NDT_Status ND_List_Recursive_Make( NDT_Node *Node_Ptr, NDT_Root *Root_Ptr, ND
|
||||
|
||||
|
||||
/*--------------------------------- main body --------------------------------*/
|
||||
|
||||
NDT_Status ND_List_Make( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id)
|
||||
{
|
||||
NDT_Node *node_ptr;
|
||||
|
||||
|
||||
node_ptr = Root_Ptr->Index_Tab[Index_Id].Head;
|
||||
|
||||
Root_Ptr->Index_Tab[Index_Id].Head = NULL;
|
||||
@@ -4823,7 +4920,7 @@ NDT_Status ND_Tree_Make( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id )
|
||||
if( ND_INDEX_SUBTYPE_SORTED_IS( Root_Ptr, Index_Id))
|
||||
{
|
||||
rc = ND_List_Sort( Root_Ptr, Index_Id);
|
||||
if( ND_ERROR(rc)) return rc;
|
||||
if( ND_ERROR(rc)) return( rc);
|
||||
}
|
||||
|
||||
node_ptr = Root_Ptr->Index_Tab[Index_Id].Head;
|
||||
@@ -4840,7 +4937,7 @@ NDT_Status ND_Tree_Make( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id )
|
||||
|
||||
Root_Ptr->Index_Tab[Index_Id].Head = Root_Ptr->Index_Tab[Index_Id].Tail = ND_Tree_Recursive_Make( 1, node_number, node_ptr);
|
||||
|
||||
return NDS_OK;
|
||||
return( NDS_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -4857,14 +4954,10 @@ NDT_Status ND_Tree_Equalize( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id)
|
||||
{
|
||||
NDT_Status rc;
|
||||
NDT_Index_Type type;
|
||||
// char manager[30]; // Win32
|
||||
void *manager; // Win32
|
||||
long max_dif, nb_equ;
|
||||
|
||||
|
||||
type = Root_Ptr->Index_Tab[Index_Id].Type;
|
||||
// strcpy( Manager, Root_Ptr->Manager); // Win32
|
||||
manager = Root_Ptr->Manager_Ptr; // Win32
|
||||
max_dif = Root_Ptr->Index_Tab[Index_Id].Max_Dif;
|
||||
nb_equ = Root_Ptr->Index_Tab[Index_Id].Nb_Equ;
|
||||
|
||||
@@ -4877,8 +4970,6 @@ NDT_Status ND_Tree_Equalize( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id)
|
||||
if( ND_ERROR(rc)) return(rc);
|
||||
|
||||
Root_Ptr->Index_Tab[Index_Id].Type = type;
|
||||
// strcpy( Root_Ptr->Manager, Manager); // Win32
|
||||
Root_Ptr->Manager_Ptr = manager; // Win32
|
||||
Root_Ptr->Index_Tab[Index_Id].Max_Dif = max_dif;
|
||||
Root_Ptr->Index_Tab[Index_Id].Nb_Equ = nb_equ + 1;
|
||||
|
||||
@@ -5086,19 +5177,21 @@ int ND_Node_Compare( void **Node1_Ptr_Ptr, void **Node2_Ptr_Ptr)
|
||||
NDT_Status rc;
|
||||
|
||||
|
||||
// rc = ND_Manager_Exec_I( Tmp_Root->Manager, NDD_CMD_COMP_VALUE_COMP, ((NDT_Node *)(*Node1))->Value, ((NDT_Node *)(*Node2))->Value);
|
||||
rc = ND_Manager_Exec_I( ( ( NDT_Node *)( *Node1_Ptr_Ptr))->Root, ( ( NDT_Node *)(*Node1_Ptr_Ptr))->Index, *Node1_Ptr_Ptr, NDD_CMD_VALUE_COMP, ( (NDT_Node *) (*Node1_Ptr_Ptr))->Value, ( ( NDT_Node *)( *Node2_Ptr_Ptr))->Value, NULL);
|
||||
|
||||
switch( (int)rc)
|
||||
{
|
||||
case NDS_EQUAL: return 0;
|
||||
case NDS_LOWER: return -1;
|
||||
case NDS_GREATER: return 1;
|
||||
case NDS_EQUAL: return( 0);
|
||||
case NDS_LOWER: return( -1);
|
||||
case NDS_GREATER: return( 1);
|
||||
|
||||
default:
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Node_Compare : incorrect return code from the manager: %d", rc);
|
||||
ND_Error_Print();
|
||||
return 0;
|
||||
|
||||
return( 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5139,9 +5232,6 @@ NDT_Status ND_List_Sort( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id)
|
||||
|
||||
/* Tri du tableau de pointeurs de noeuds */
|
||||
|
||||
// Tmp_Root = Root;
|
||||
|
||||
// qsort( (void *)tab, (size_t)(Root_Ptr->Index_Tab[Index_Id].Node_Number), sizeof(NDT_Node *), (int (__cdecl *)(const void *, const void *))&ND_Node_Compare);
|
||||
qsort( (void *)tab, (size_t)( Root_Ptr->Index_Tab[Index_Id].Node_Number), sizeof( NDT_Node *), ( int (*)( const void *, const void *))&ND_Node_Compare);
|
||||
|
||||
/* On met à jour les liens entre les noeuds */
|
||||
@@ -5210,7 +5300,7 @@ NDT_Node *ND_Tree_Node_Last_Recursive_Get( NDT_Node *Node_Ptr)
|
||||
/* Redéfinition de la fonction malloc() avec retour de type NDT_Status */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status ND_Default_Allocator( size_t Size, void **Ptr_Ptr, void *Data_Ptr)
|
||||
NDT_Status ND_Default_Allocator( void **Ptr_Ptr, size_t Size, void *Data_Ptr)
|
||||
{
|
||||
*Ptr_Ptr = malloc( Size);
|
||||
|
||||
@@ -5560,31 +5650,126 @@ void ND_Tree_Link_Recursive_Check( NDT_Node *Node_Ptr, int *Nb_Detected_Ptr,
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Vérifie qu'une adresse est valide */
|
||||
/* Target address access try */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status ND_Address_Check( void *Address)
|
||||
{
|
||||
#if !defined(_WIN32)
|
||||
NDT_Status status;
|
||||
int rc;
|
||||
int test;
|
||||
struct sigaction act = {0}, oact_bus, oact_segv;
|
||||
|
||||
act.sa_handler = ND_Signal_Trap;
|
||||
|
||||
NDG_Base.Sig_Trapped = 0;
|
||||
|
||||
|
||||
|
||||
/* Trap SIGBUS and SIGSEGV */
|
||||
|
||||
if( ( rc = sigaction( SIGBUS, &act, &oact_bus)) != 0)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Address_Check: sigaction (Add SIGBUS Hdl) rc: %d errno: %d", rc, errno);
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
|
||||
if( ( rc = sigaction( SIGSEGV, &act, &oact_segv)) != 0)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Address_Check: sigaction (Add SIGSEGV Hdl) rc: %d errno: %d", rc, errno);
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Target address access try */
|
||||
|
||||
if( sigsetjmp( NDG_Base.SigLongJmp_Env, 1) == 0 )
|
||||
{
|
||||
test = *( (int *)Address);
|
||||
|
||||
status = NDS_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = NDS_KO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Untrap SIGBUS and SIGSEGV */
|
||||
|
||||
if( ( rc = sigaction( SIGBUS, &oact_bus, &act)) != 0)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Address_Check: sigaction (Remove SIGBUS Hdl) rc: %d errno: %d", rc, errno);
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
|
||||
if( ( rc = sigaction( SIGSEGV, &oact_segv, &act)) != 0)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Address_Check: sigaction (Remove SIGSEGV Hdl) rc: %d errno: %d", rc, errno);
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
|
||||
return( status);
|
||||
#else
|
||||
NDT_Status status;
|
||||
int test;
|
||||
void (__cdecl *old_sigsegv_sighandler)(int);
|
||||
|
||||
|
||||
NDG_Base.Sig_Trapped = 0;
|
||||
|
||||
/* On trappe les signaux SIGBUS et SIGSEGV */
|
||||
|
||||
// signal( SIGBUS, NDG_Base.Signal_Trap); Win32
|
||||
// signal( SIGSEGV, NDG_Base.Signal_Trap); Win32
|
||||
|
||||
/* On tente d'accéder à l'adresse fournie */
|
||||
/* Trap SIGSEGV */
|
||||
|
||||
if( ( old_sigsegv_sighandler = signal( SIGSEGV, ND_Signal_Trap)) == SIG_ERR)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Address_Check: signal (Add SIGSEGV Hdl) errno: %d", errno);
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Target address access try */
|
||||
|
||||
if( setjmp( NDG_Base.SigLongJmp_Env) == 0 )
|
||||
{
|
||||
test = *( (int *)Address);
|
||||
|
||||
// sigrelse( SIGBUS); Win32
|
||||
// sigrelse( SIGSEGV); Win32
|
||||
status = NDS_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = NDS_KO;
|
||||
}
|
||||
|
||||
if( NDG_Base.Sig_Trapped != 0) return( NDS_KO);
|
||||
|
||||
return( NDS_OK);
|
||||
|
||||
/* Untrap SIGSEGV */
|
||||
|
||||
if( ( old_sigsegv_sighandler = signal( SIGSEGV, old_sigsegv_sighandler)) == SIG_ERR)
|
||||
{
|
||||
sprintf( NDG_Base.Err_String, "Error ND_Address_Check: signal (Remove SIGSEGV Hdl) errno: %d", errno);
|
||||
ND_Error_Print();
|
||||
|
||||
return( NDS_KO);
|
||||
}
|
||||
|
||||
return( status);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -5598,6 +5783,12 @@ NDT_Status ND_Address_Check( void *Address)
|
||||
void ND_Signal_Trap( int Sig_Num)
|
||||
{
|
||||
NDG_Base.Sig_Trapped = Sig_Num;
|
||||
|
||||
#if !defined(_WIN32)
|
||||
siglongjmp( NDG_Base.SigLongJmp_Env, 1);
|
||||
#else
|
||||
longjmp( NDG_Base.SigLongJmp_Env, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: libnode.h,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.5 $ */
|
||||
/* $Revision: 2.9 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2004/08/01 23:18:38 $ */
|
||||
/* $Date: 2005/01/19 23:59:42 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -29,11 +29,20 @@
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.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>
|
||||
|
||||
|
||||
@@ -78,7 +87,13 @@ typedef struct NDT_Base
|
||||
char Err_String[512];
|
||||
FILE *Err_Stream;
|
||||
int Sig_Trapped;
|
||||
#if !defined(_WIN32)
|
||||
sigjmp_buf SigLongJmp_Env;
|
||||
#else
|
||||
jmp_buf SigLongJmp_Env;
|
||||
#endif
|
||||
NDT_Symbol *Symbol_First_Ptr;
|
||||
void *DL_Ptr;
|
||||
NDT_Index_Type OpenStruct_Index_Type[1];
|
||||
NDT_Root *OpenStruct_Ptr;
|
||||
} NDT_Base;
|
||||
@@ -90,15 +105,15 @@ NDT_Base NDG_Base =
|
||||
"",
|
||||
(FILE *) -1,
|
||||
0,
|
||||
{0},
|
||||
(NDT_Symbol *) NULL,
|
||||
NULL,
|
||||
{ NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYPE_LIST | NDD_INDEX_SUBTYPE_FIFO},
|
||||
(NDT_Root *) NULL
|
||||
};
|
||||
|
||||
|
||||
|
||||
//extern int sigrelse (int sig);
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
@@ -124,7 +139,7 @@ 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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
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 */
|
||||
@@ -282,9 +297,14 @@ int ND_Node_Compare( void **, void **);
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Status ND_List_Sort( NDT_Root *, NDT_Index_Id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Fonctions et procédures privées de la librairie (bas niveau) */
|
||||
/* PRIVATE FUNCTIONS */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -310,15 +330,15 @@ 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_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 *);
|
||||
|
||||
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);
|
||||
|
||||
|
||||
32
libnode.spec
32
libnode.spec
@@ -1,24 +1,33 @@
|
||||
Name: libnode
|
||||
Version: 2.0.5
|
||||
Release: 1
|
||||
Version: 2.1.0
|
||||
|
||||
%define libnode_name %{name}-%{version}-%{release}
|
||||
%define release_nb 1
|
||||
|
||||
Release: %{release_nb}rx3
|
||||
|
||||
|
||||
|
||||
%define libnode_name %{name}-%{version}-%{release_nb}
|
||||
%define source %{libnode_name}.src.tgz
|
||||
|
||||
|
||||
|
||||
Summary: Manages generic list and/or tree node structures
|
||||
Copyright: GPL
|
||||
Copyright: GPL/LGPL
|
||||
Group: Application/Utilitaires
|
||||
Distribution: Rx3 OpenSource
|
||||
Vendor: Rx3
|
||||
Packager: arnaud.gibert@rx3.net
|
||||
Packager: Arnaud G. Gibert <arnaud@rx3.net>
|
||||
|
||||
Source: ftp://ftp.rx3.org/pub/%{source}
|
||||
Url: http://www.rx3.org/dvp/libnode/download/
|
||||
BuildRoot: %{_tmppath}/%{libnode_name}-buildroot
|
||||
AutoReqProv: no
|
||||
|
||||
|
||||
|
||||
%description
|
||||
Manages generic list and/or tree node structures
|
||||
Manages generic list and/or tree node structures.
|
||||
|
||||
|
||||
|
||||
@@ -49,6 +58,17 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jan 24 2005 Arnaud G. Gibert <arnaud@rx3.net> 2.1.0-1rx3
|
||||
- Update to 2.1.0 release,
|
||||
- Now use "rx3" as release suffix,
|
||||
- Fix copyright entry.
|
||||
|
||||
* 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
|
||||
- Add release in libnode dir name support.
|
||||
|
||||
|
||||
@@ -11,12 +11,13 @@ include ../Makefile.rule
|
||||
|
||||
|
||||
|
||||
DEP_STATIC = ../lib/libnode.a
|
||||
DEP_DYNAMIC = ../lib/libnode.so
|
||||
INCLUDE = -I . -I ../include
|
||||
LIBDIR = -L . -L ../lib
|
||||
LIB_STATIC = ../lib/libnode.a
|
||||
LIB_DYNAMIC = -lnode
|
||||
DEP_STATIC += ../lib/libnode.a
|
||||
DEP_DYNAMIC += ../lib/libnode.so
|
||||
INCLUDE += -I . -I ../include
|
||||
LIBDIR += -L . -L ../lib
|
||||
LIB_STATIC += ../lib/libnode.a -ldl
|
||||
LIB_DYNAMIC += -lnode -ldl
|
||||
CFLAGS += -rdynamic
|
||||
|
||||
ifdef _LIBVER_SUPPORT
|
||||
DEP_STATIC += ../../libver/ver.h ../../libver/libver.a
|
||||
@@ -28,11 +29,11 @@ ifdef _LIBVER_SUPPORT
|
||||
LIB_STATIC += ../../libver/lib/libver.a
|
||||
LIB_DYNAMIC += -lver
|
||||
else
|
||||
LIB_STATIC += -ldl ../../libver/lib/libver.a
|
||||
LIB_DYNAMIC += -ldl -lver
|
||||
LIB_STATIC += ../../libver/lib/libver.a
|
||||
LIB_DYNAMIC += -lver
|
||||
endif
|
||||
|
||||
CFLAGS += -D_LIBVER_SUPPORT -rdynamic
|
||||
CFLAGS += -D_LIBVER_SUPPORT
|
||||
endif
|
||||
|
||||
ND_CHECK_FLAGS = -DND_MODE=0
|
||||
|
||||
151
util/ndbench.c
151
util/ndbench.c
@@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: ndbench.c,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.7 $ */
|
||||
/* $Revision: 2.9 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2004/08/01 23:38:52 $ */
|
||||
/* $Date: 2005/01/20 00:07:27 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef _LIBVER_SUPPORT
|
||||
VER_INFO_EXPORT( ndbench, "$Revision: 2.7 $", "$Name: $", __FILE__, "$Author: agibert $");
|
||||
VER_INFO_EXPORT( ndbench, "$Revision: 2.9 $", "$Name: $", __FILE__, "$Author: agibert $");
|
||||
# define USAGE "Usage : %s [ --help | --version [-v] | --batch_run <batch_file_name>]\n"
|
||||
#else
|
||||
# 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_INFO_PRINT 23
|
||||
#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
|
||||
|
||||
@@ -151,6 +153,7 @@ typedef struct
|
||||
|
||||
# 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 seed_get(x) (int)( (x).start.time)
|
||||
|
||||
#else
|
||||
|
||||
@@ -161,8 +164,9 @@ typedef struct
|
||||
struct timeval stop;
|
||||
} cpt;
|
||||
|
||||
# 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_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 seed_get(x) (int)( (x).start.tv_sec)
|
||||
|
||||
#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_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_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)}
|
||||
};
|
||||
|
||||
@@ -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";
|
||||
|
||||
*Version_Name_Ptr = "$Revision: 2.7 $ $Name: $ $Date: 2004/08/01 23:38:52 $ $Author: agibert $";
|
||||
*Version_Name_Ptr = "$Revision: 2.9 $ $Name: $ $Date: 2005/01/20 00:07:27 $ $Author: agibert $";
|
||||
|
||||
return( NDS_OK);
|
||||
}
|
||||
@@ -756,13 +762,30 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
{
|
||||
Command_Exec_Begin_Print( File_Output, Choice);
|
||||
|
||||
if( Arg1 == NULL)
|
||||
{
|
||||
fprintf( File_Output, "DataStruct_Open: Symbol Lookup ( 0:OFF | 1:ON) ? ");
|
||||
fgets( buf, BUF_LEN, File_Input);
|
||||
|
||||
Arg1 = buf;
|
||||
}
|
||||
|
||||
Choice = atoi( Arg1);
|
||||
|
||||
for( i = 0; i < INDEX_NB; i++)
|
||||
{
|
||||
idx_type_tab[i] = NDD_INDEX_STATUS_CLOSED;
|
||||
}
|
||||
|
||||
t_start( t_exec);
|
||||
if( Choice == 0)
|
||||
{
|
||||
ND_DataStruct_Open( DS_Ptr_Ptr, INDEX_NB, idx_type_tab, "Module_Manager", Module_Manager, NULL, NULL, NULL, NULL, NDD_TRUE, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ND_DataStruct_Open( DS_Ptr_Ptr, INDEX_NB, idx_type_tab, "Module_Manager", NULL, NULL, NULL, NULL, NULL, NDD_TRUE, NULL);
|
||||
}
|
||||
t_stop( t_exec);
|
||||
|
||||
Command_Exec_End_Print( File_Output, Choice, t_exec, 1);
|
||||
@@ -1001,7 +1024,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
|
||||
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);
|
||||
i++;
|
||||
}
|
||||
@@ -1090,6 +1113,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
|
||||
case INDEX_LIST_SUBTYPE_SET:
|
||||
{
|
||||
int subtype;
|
||||
|
||||
|
||||
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
|
||||
|
||||
if( low != -1)
|
||||
@@ -1102,9 +1128,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
Arg2 = buf;
|
||||
}
|
||||
|
||||
Choice = atoi( Arg2);
|
||||
subtype = atoi( Arg2);
|
||||
|
||||
switch( Choice)
|
||||
switch( subtype)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
@@ -1127,7 +1153,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
default:
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1161,6 +1187,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
|
||||
case INDEX_TREE_SUBTYPE_SET:
|
||||
{
|
||||
int subtype;
|
||||
|
||||
|
||||
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
|
||||
|
||||
if( low != -1)
|
||||
@@ -1173,9 +1202,9 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
Arg2 = buf;
|
||||
}
|
||||
|
||||
Choice = atoi( Arg2);
|
||||
subtype = atoi( Arg2);
|
||||
|
||||
switch( Choice)
|
||||
switch( subtype)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
@@ -1192,7 +1221,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
default:
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1301,7 +1330,7 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
|
||||
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);
|
||||
|
||||
for( i = low; i <= high; i++)
|
||||
@@ -1322,6 +1351,88 @@ void Command_Exec( NDT_Root **DS_Ptr_Ptr, FILE *File_Output, int Choice, cha
|
||||
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:
|
||||
{
|
||||
Command_Index_Range_Get( File_Output, &low, &high, Arg1, File_Input, Choice, "Index");
|
||||
@@ -1436,6 +1547,14 @@ int main( int argc, char ** argv)
|
||||
NDT_Root *ds_ptr = NULL;
|
||||
|
||||
|
||||
/* Init Random numbers... */
|
||||
|
||||
t_start( t_exec);
|
||||
t_stop( t_exec);
|
||||
srand( seed_get(t_exec));
|
||||
|
||||
|
||||
|
||||
/* Args Parsing */
|
||||
|
||||
if( argc >= 2)
|
||||
|
||||
10
util/test-10-s.ndb
Normal file
10
util/test-10-s.ndb
Normal file
@@ -0,0 +1,10 @@
|
||||
Lib_Open 0
|
||||
DS_Open 1
|
||||
Index_List_Open 0-0
|
||||
DS_Value_Add 1-10 0
|
||||
DS_Value_Find 1-10
|
||||
Index_List_To_Tree 0-0
|
||||
DS_Value_Find 1-10
|
||||
DS_Check
|
||||
DS_Close
|
||||
Lib_Close
|
||||
@@ -1,5 +1,5 @@
|
||||
Lib_Open 0
|
||||
DS_Open
|
||||
DS_Open 0
|
||||
Index_List_Open 0-0
|
||||
DS_Value_Add 1-10 0
|
||||
DS_Value_Find 1-10
|
||||
|
||||
10
util/test-100K-s.ndb
Normal file
10
util/test-100K-s.ndb
Normal file
@@ -0,0 +1,10 @@
|
||||
Lib_Open 0
|
||||
DS_Open 1
|
||||
Index_List_Open 0-0
|
||||
DS_Value_Add 1-100000 0
|
||||
DS_Value_Find 49900-50100
|
||||
Index_List_To_Tree 0-0
|
||||
DS_Value_Find 1-100000
|
||||
DS_Check
|
||||
DS_Close
|
||||
Lib_Close
|
||||
@@ -1,5 +1,5 @@
|
||||
Lib_Open 0
|
||||
DS_Open
|
||||
DS_Open 0
|
||||
Index_List_Open 0-0
|
||||
DS_Value_Add 1-100000 0
|
||||
DS_Value_Find 49900-50100
|
||||
|
||||
10
util/test-10K-s.ndb
Normal file
10
util/test-10K-s.ndb
Normal file
@@ -0,0 +1,10 @@
|
||||
Lib_Open 0
|
||||
DS_Open 1
|
||||
Index_List_Open 0-0
|
||||
DS_Value_Add 1-10000 0
|
||||
DS_Value_Find 4000-6000
|
||||
Index_List_To_Tree 0-0
|
||||
DS_Value_Find 1-10000
|
||||
DS_Check
|
||||
DS_Close
|
||||
Lib_Close
|
||||
@@ -1,5 +1,5 @@
|
||||
Lib_Open 0
|
||||
DS_Open
|
||||
DS_Open 0
|
||||
Index_List_Open 0-0
|
||||
DS_Value_Add 1-10000 0
|
||||
DS_Value_Find 4000-6000
|
||||
|
||||
10
util/test-1M-s.ndb
Normal file
10
util/test-1M-s.ndb
Normal file
@@ -0,0 +1,10 @@
|
||||
Lib_Open 0
|
||||
DS_Open 1
|
||||
Index_List_Open 0-0
|
||||
DS_Value_Add 1-1000000 0
|
||||
DS_Value_Find 499990-500010
|
||||
Index_List_To_Tree 0-0
|
||||
DS_Value_Find 1-1000000
|
||||
DS_Check
|
||||
DS_Close
|
||||
Lib_Close
|
||||
@@ -1,5 +1,5 @@
|
||||
Lib_Open 0
|
||||
DS_Open
|
||||
DS_Open 0
|
||||
Index_List_Open 0-0
|
||||
DS_Value_Add 1-1000000 0
|
||||
DS_Value_Find 499990-500010
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
Batch_Run test-error.ndb
|
||||
Batch_Run test-10.ndb
|
||||
Batch_Run test-10-s.ndb
|
||||
Batch_Run test-10K.ndb
|
||||
Batch_Run test-10K-s.ndb
|
||||
Batch_Run test-100K.ndb
|
||||
Batch_Run test-100K-s.ndb
|
||||
Batch_Run test-1M.ndb
|
||||
Batch_Run test-1M-s.ndb
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
DS_Open
|
||||
DS_Open 0
|
||||
Lib_Open 0
|
||||
DS_Open
|
||||
DS_Open 0
|
||||
Index_List_Open 0-0
|
||||
DS_Value_Add 1-10 0
|
||||
Lib_Close
|
||||
Lib_Open 1
|
||||
DS_Open
|
||||
DS_Open 0
|
||||
Index_List_Open 0-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
|
||||
|
||||
Reference in New Issue
Block a user