Compare commits
10 Commits
b477d4b154
...
7afac7d349
Author | SHA1 | Date | |
---|---|---|---|
|
7afac7d349 | ||
|
e1409ab6d8 | ||
|
702c0f117d | ||
|
0d4b1d3125 | ||
|
ec7a688881 | ||
|
90eb853801 | ||
|
8cfdf696d1 | ||
|
986c67d2fc | ||
|
b7ce3250e1 | ||
|
6a6ae07870 |
@ -1,7 +1,7 @@
|
||||
# $RCSfile: Makefile.rule,v $
|
||||
# $Revision: 1.4 $
|
||||
# $Revision: 1.5 $
|
||||
# $Name: $
|
||||
# $Date: 2003/07/16 23:37:37 $
|
||||
# $Date: 2010/06/06 21:28:14 $
|
||||
# $Author: agibert $
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -20,7 +20,7 @@ default:all
|
||||
# Here are all the rules allowing to compile sources files
|
||||
# c -> o
|
||||
%.o:%.c
|
||||
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
|
||||
$(CC) $(CFLAGS) $(INCLUDE) -fPIC -c $< -o $@
|
||||
|
||||
# c -> executable
|
||||
.c :
|
||||
|
10
ReadMe.txt
10
ReadMe.txt
@ -1,19 +1,19 @@
|
||||
# $RCSfile: ReadMe.txt,v $
|
||||
# $Revision: 2.8 $
|
||||
# $Revision: 2.10 $
|
||||
# $Name: $
|
||||
# $Date: 2005/01/24 01:19:50 $
|
||||
# $Date: 2010/06/06 21:38:28 $
|
||||
# $Author: agibert $
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Welcome to LibNode 2.1.x !
|
||||
Welcome to LibNode 2.2.x !
|
||||
|
||||
|
||||
|
||||
This release of LibNode supports the following OS:
|
||||
- Linux 2.2.x, 2.4.x and 2.6.x (tested on RedHat & Mandrake),
|
||||
- Linux 2.2.x, 2.4.x and 2.6.x (tested on RedHat & Mandriva),
|
||||
- Solaris 2.6,
|
||||
- Windows NT4, 2000 and XP.
|
||||
|
||||
@ -41,4 +41,4 @@ Enjoy it!
|
||||
Your LibNode Team.
|
||||
|
||||
arnaud@rx3.net
|
||||
http://www.rx3.org/dvp/libnode
|
||||
http://www.rx3.org/dvp/?dvp=libnode
|
||||
|
@ -1,13 +1,28 @@
|
||||
# $RCSfile: ReleaseNotes.txt,v $
|
||||
# $Revision: 2.20 $
|
||||
# $Revision: 2.22 $
|
||||
# $Name: $
|
||||
# $Date: 2005/01/24 00:50:55 $
|
||||
# $Date: 2010/06/06 21:30:59 $
|
||||
# $Author: agibert $
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
LibNode V 2.2.0-1 - A. Gibert - 06/06/10
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
All: Add support C99 va_arg for curent gcc (4.4.1),
|
||||
Add -fPIC flag in .c to .o makefile rule,
|
||||
LibNode: Add ND_VA_* macros to help manager varargs,
|
||||
Update Managers to use ND_VA_* macros,
|
||||
Improve LibShMem support by restricting OpenStruct tracking on local DataStruct (Manager_Ptr != NULL),
|
||||
Add example manager template in public node.h file,
|
||||
NDDemo0: Add LibNode 2.2 support: Use ND_VA_* macros in manager,
|
||||
NDBench: Add LibNode 2.2 support: Use ND_VA_* macros in manager.
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
LibNode V 2.1.0-1 - A. Gibert - 24/01/05
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
171
demo/nddemo0.c
171
demo/nddemo0.c
@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: nddemo0.c,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.8 $ */
|
||||
/* $Revision: 2.9 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2004/08/23 22:48:37 $ */
|
||||
/* $Date: 2010/06/06 21:27:12 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@ -64,7 +64,7 @@ typedef struct Demo_Value
|
||||
/* Prototypes */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status Demo_DS_Manager( 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 Demo_DS_Manager( 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_Ptr)
|
||||
{
|
||||
NDT_Command_Name Command_Name;
|
||||
|
||||
@ -89,12 +89,12 @@ NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
{
|
||||
case NDD_CMD_MANAGER_VERSION:
|
||||
{
|
||||
NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *);
|
||||
ND_VA_ARG_GET( Version_Name_Ptr, *Args_Ptr, NDT_Version_Name *);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||
|
||||
*Version_Name_Ptr = "$Revision: 2.8 $ $Name: $ $Date: 2004/08/23 22:48:37 $ $Author: agibert $";
|
||||
*Version_Name_Ptr = "$Revision: 2.9 $ $Name: $ $Date: 2010/06/06 21:27:12 $ $Author: agibert $";
|
||||
|
||||
return( NDS_OK);
|
||||
}
|
||||
@ -102,15 +102,15 @@ NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
case NDD_CMD_INDEX_GET:
|
||||
{
|
||||
/*
|
||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
||||
void *Value_ptr = (void *)va_arg( Args, void *);
|
||||
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
*/
|
||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
||||
Demo_Value *Value_ptr = (Demo_Value *)va_arg( Args, Demo_Value *);
|
||||
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, Demo_Value *);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_INDEX_GET";
|
||||
@ -159,12 +159,15 @@ NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
case NDD_CMD_VALUE_ALLOC:
|
||||
{
|
||||
/*
|
||||
void **Value_Ptr_Ptr = (void **)va_arg( Args, void **);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
Demo_Value **Value_Ptr_Ptr = va_arg( Args, Demo_Value **);
|
||||
ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, Demo_Value **);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_ALLOC";
|
||||
@ -187,12 +190,15 @@ NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
case NDD_CMD_VALUE_FREE:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
Demo_Value *Value_Ptr = (Demo_Value *)va_arg( Args, Demo_Value *);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, Demo_Value *);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_FREE";
|
||||
@ -205,14 +211,17 @@ NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
case NDD_CMD_VALUE_COMP:
|
||||
{
|
||||
/*
|
||||
void *Value1_Ptr = (void *)va_arg( Args, void *);
|
||||
void *Value2_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
|
||||
ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
Demo_Value *Value1_Ptr = va_arg( Args, Demo_Value *);
|
||||
Demo_Value *Value2_Ptr = va_arg( Args, Demo_Value *);
|
||||
ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, Demo_Value *);
|
||||
ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, Demo_Value *);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_COMP";
|
||||
@ -302,12 +311,17 @@ NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
case NDD_CMD_VALUE_ADD:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_ADD";
|
||||
|
||||
return( NDS_OK);
|
||||
@ -316,38 +330,56 @@ NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
case NDD_CMD_VALUE_REMOVE:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_REMOVE";
|
||||
|
||||
return( NDS_OK);
|
||||
}
|
||||
|
||||
|
||||
case NDD_CMD_VALUE_PRINT:
|
||||
{
|
||||
/*
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
va_list user_args = (va_list)va_arg( lib_args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
/*
|
||||
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
|
||||
void *Value_Ptr = Node_Ptr->Value;
|
||||
*/
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
|
||||
Demo_Value *Value_Ptr = Node_Ptr->Value;
|
||||
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
ND_VA_LIST_CLOSE( lib_args);
|
||||
*/
|
||||
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
|
||||
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
|
||||
ND_VA_LIST_CLOSE( lib_args);
|
||||
|
||||
|
||||
Demo_Value *Value_Ptr = Node_Ptr->Value;
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_PRINT";
|
||||
@ -361,18 +393,25 @@ NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
|
||||
case NDD_CMD_INFO_PRINT:
|
||||
{
|
||||
/*
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
va_list user_args = (va_list)va_arg( lib_args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
|
||||
void *Value_Ptr = Node_Ptr->Value;
|
||||
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
ND_VA_LIST_CLOSE( lib_args);
|
||||
*/
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_INFO_PRINT";
|
||||
|
||||
return( NDS_OK);
|
||||
@ -409,7 +448,7 @@ void DataStruct_Load( NDT_Root *ds_ptr, FILE *demo_file)
|
||||
while( !feof( demo_file))
|
||||
{
|
||||
str = fgets( input_string, STRING_SIZE, demo_file);
|
||||
if( ( (const int)str != EOF) && ( str != NULL))
|
||||
if( str != NULL)
|
||||
{
|
||||
if( strlen( input_string) >= STRING_LEN)
|
||||
{
|
||||
|
373
include/node.h
373
include/node.h
@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: node.h,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.12 $ */
|
||||
/* $Revision: 2.13 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2005/01/20 00:00:25 $ */
|
||||
/* $Date: 2010/06/06 21:26:31 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@ -151,6 +151,349 @@ typedef int NDT_Index_Type;
|
||||
|
||||
|
||||
|
||||
/* Manager Template */
|
||||
|
||||
// NDT_Status ND_Example_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list *Args_Ptr)
|
||||
// {
|
||||
// NDT_Command_Name Command_Name;
|
||||
//
|
||||
//
|
||||
// switch( Command)
|
||||
// {
|
||||
// case NDD_CMD_MANAGER_VERSION:
|
||||
// {
|
||||
// ND_VA_ARG_GET( Version_Name_Ptr, *Args_Ptr, NDT_Version_Name *);
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||
//
|
||||
// *Version_Name_Ptr = "$Revision: 2.13 $ $Name: $ $Date: 2010/06/06 21:26:31 $ $Author: agibert $";
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_INDEX_GET:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
// ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
// ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
// */
|
||||
// ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
// ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
// ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_INDEX_GET";
|
||||
//
|
||||
// switch(Cmd)
|
||||
// {
|
||||
// /*
|
||||
// case NDT_CMD_SOME_USER_CMD:
|
||||
// {
|
||||
// *Reply_Index_Id_Ptr = 0;
|
||||
// *Reply_Command_Ptr = NDD_CMD_SOME_OTHER_CMD;
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// ...
|
||||
// */
|
||||
//
|
||||
// default:
|
||||
// {
|
||||
// *Reply_Index_Id_Ptr = Index_Id;
|
||||
// *Reply_Command_Ptr = Cmd;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_ALLOC:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_ALLOC";
|
||||
//
|
||||
// /*
|
||||
// if( ( *Value_Ptr_Ptr = (void *)malloc( sizeof(void))) == NULL)
|
||||
// {
|
||||
// return(NDS_ERRMEM);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ...
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// }
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_FREE:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_FREE";
|
||||
//
|
||||
// /*
|
||||
// free( Value_Ptr);
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_COMP:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
|
||||
// ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_COMP";
|
||||
//
|
||||
// switch( Index_Id)
|
||||
// {
|
||||
// case 0:
|
||||
// {
|
||||
// int rc;
|
||||
//
|
||||
//
|
||||
// rc = strcmp( Value1_Ptr->..., Value2_Ptr->...);
|
||||
//
|
||||
// if( rc < 0)
|
||||
// {
|
||||
// return(NDS_LOWER);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if( rc > 0)
|
||||
// {
|
||||
// return(NDS_GREATER);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return(NDS_EQUAL);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// case 1:
|
||||
// {
|
||||
// int val1 = atoi(Value1_Ptr->...);
|
||||
// int val2 = atoi(Value2_Ptr->...);
|
||||
//
|
||||
//
|
||||
// if( val1 < val2)
|
||||
// {
|
||||
// return(NDS_LOWER);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if( val1 > val2)
|
||||
// {
|
||||
// return(NDS_GREATER);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return(NDS_EQUAL);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// case 2:
|
||||
// {
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// default:
|
||||
// {
|
||||
// printf( "Unknown COMP idx (%d) !\n", Index_Id);
|
||||
// return( NDS_KO);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_ADD:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_ADD";
|
||||
//
|
||||
// /*
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_REMOVE:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_REMOVE";
|
||||
// /*
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_PRINT:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
// ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
// ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
// ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// ND_VA_LIST_CLOSE( lib_args);
|
||||
//
|
||||
// void *Value_Ptr = Node_Ptr->Value;
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_PRINT";
|
||||
//
|
||||
// /*
|
||||
// fprintf( Out, "...\n", Value_Ptr->..., ...);
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_INFO_PRINT:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
// ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
// ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
// ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// ND_VA_LIST_CLOSE( lib_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_INFO_PRINT";
|
||||
//
|
||||
// /*
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_USER_TRAVERSE:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
//
|
||||
//
|
||||
// void *Value_Ptr = Node_Ptr->Value;
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_USER_TRAVERSE";
|
||||
//
|
||||
// /*
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// default:
|
||||
// {
|
||||
// printf( "ND_Default_Manager() called with an undefined command %d\n", Command);
|
||||
// return(NDS_ERRAPI);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// printf( "ND_Default_Manager() called with command %d (%s)\n", Command, Command_Name);
|
||||
// return(NDS_OK);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/* Var Args Manager Macros */
|
||||
|
||||
#define ND_VA_LIST_OPEN( VA_List_Target, VA_List_Source) va_list VA_List_Target; va_copy( VA_List_Target, *va_arg( VA_List_Source, va_list *))
|
||||
#define ND_VA_LIST_CLOSE( VA_List) va_end( VA_List)
|
||||
#define ND_VA_ARG_GET( Arg, VA_List, Type) Type Arg = va_arg( VA_List, Type)
|
||||
|
||||
|
||||
|
||||
/* Commandes du manager */
|
||||
|
||||
typedef int NDT_Command;
|
||||
@ -216,7 +559,7 @@ struct NDT_Node;
|
||||
|
||||
typedef char *NDT_Manager_Name;
|
||||
|
||||
typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Node *, NDT_Command, va_list);
|
||||
typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Node *, NDT_Command, va_list *);
|
||||
|
||||
|
||||
/* Pointeur de fonction sur l'allocateur */
|
||||
@ -553,8 +896,8 @@ 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, 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_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, ...);
|
||||
|
||||
@ -600,7 +943,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *, void *);
|
||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||
/* (I) Out : flux de sortie */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_VI( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_VI( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||
|
||||
@ -615,8 +958,8 @@ 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 **, 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_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 *, ...);
|
||||
|
||||
@ -703,8 +1046,8 @@ NDD_DLL_API NDT_Status ND_Index_Reorg_C( NDT_Root *, NDT_Index_Id);
|
||||
/* (I) Command: Commande à exécuter sur chaque noeud traversé */
|
||||
/* (I) Data: pointeur de données utilisateur */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VI( NDT_Root *, NDT_Index_Id, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VC( NDT_Root *, NDT_Index_Id, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VI( NDT_Root *, NDT_Index_Id, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VC( NDT_Root *, NDT_Index_Id, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_I( NDT_Root *, NDT_Index_Id, NDT_Command, ...);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_C( NDT_Root *, NDT_Index_Id, NDT_Command, ...);
|
||||
|
||||
@ -752,7 +1095,7 @@ NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *, NDT_Index_Id, void
|
||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||
/* (I) Out : flux de sortie */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_VI( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_VI( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_I( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_C( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||
|
||||
@ -831,8 +1174,8 @@ NDD_DLL_API NDT_Status ND_Index_Node_Previous_Get_C( NDT_Node **, NDT_Node *)
|
||||
/* (I) Value : pointeur sur la valeur à rechercher */
|
||||
/* (I) Data : pointeur de données */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VI( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VC( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VI( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VC( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_I( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_C( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...);
|
||||
|
||||
@ -877,8 +1220,8 @@ NDD_DLL_API NDT_Status ND_Value_Free_C( NDT_Root *, void *);
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* (I) Function : nom de la fonction manager à exécuter */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VI( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VC( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VI( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VC( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_I( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...);
|
||||
|
||||
|
571
lib/libnode.c
571
lib/libnode.c
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: libnode.h,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.9 $ */
|
||||
/* $Revision: 2.10 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2005/01/19 23:59:42 $ */
|
||||
/* $Date: 2010/06/06 21:26:31 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@ -127,14 +127,14 @@ NDT_Base NDG_Base =
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* (I) va_list Arguments : Liste d'arguments contextuels */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Status ND_Default_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDT_Status ND_Default_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* OpenStruct Manager */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* (I) va_list Arguments : Liste d'arguments contextuels */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Status ND_OpenStruct_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDT_Status ND_OpenStruct_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Redéfinition de la fonction malloc() avec retour de type NDT_Status */
|
||||
@ -233,12 +233,12 @@ NDT_Status ND_List_Make( NDT_Root *, NDT_Index_Id);
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Recherche une valeur dans une liste et retourne le noeud correspondant */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list);
|
||||
NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list);
|
||||
NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Conversion d'une structure en arbre binaire */
|
||||
@ -328,7 +328,7 @@ NDT_Node *ND_Tree_Node_First_Recursive_Get( NDT_Node *);
|
||||
|
||||
NDT_Node *ND_Tree_Node_Last_Recursive_Get( NDT_Node *);
|
||||
|
||||
NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *, void *, va_list);
|
||||
NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *, void *, va_list *);
|
||||
|
||||
NDT_Node *ND_Tree_Parent_Next_Recursive_Get( NDT_Node *);
|
||||
|
||||
|
21
libnode.spec
21
libnode.spec
@ -1,8 +1,13 @@
|
||||
Name: libnode
|
||||
Version: 2.1.0
|
||||
Release: 1rx3
|
||||
Name: libnode
|
||||
Version: 2.2.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
|
||||
|
||||
|
||||
@ -14,8 +19,8 @@ Distribution: Rx3 OpenSource
|
||||
Vendor: Rx3
|
||||
Packager: Arnaud G. Gibert <arnaud@rx3.net>
|
||||
|
||||
Source: ftp://ftp.rx3.org/pub/%{source}
|
||||
Url: http://www.rx3.org/dvp/libnode/download/
|
||||
Source: ftp://ftp.rx3.org/pub/arc/dvp/%{source}
|
||||
Url: http://www.rx3.org/dvp/?dvp=libnode
|
||||
BuildRoot: %{_tmppath}/%{libnode_name}-buildroot
|
||||
AutoReqProv: no
|
||||
|
||||
@ -53,6 +58,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Jun 6 2010 Arnaud G. Gibert <arnaud@rx3.net> 2.2.0-1rx3
|
||||
- Update to 2.2.0 release,
|
||||
- Update Source and URL entry.
|
||||
|
||||
* 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,
|
||||
|
182
util/ndbench.c
182
util/ndbench.c
@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: ndbench.c,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.9 $ */
|
||||
/* $Revision: 2.10 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2005/01/20 00:07:27 $ */
|
||||
/* $Date: 2010/06/06 21:27:12 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef _LIBVER_SUPPORT
|
||||
VER_INFO_EXPORT( ndbench, "$Revision: 2.9 $", "$Name: $", __FILE__, "$Author: agibert $");
|
||||
VER_INFO_EXPORT( ndbench, "$Revision: 2.10 $", "$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"
|
||||
@ -200,7 +200,7 @@ NDT_Index_Type idx_type_balanced_tree = NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYP
|
||||
/* Prototype */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status Module_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDT_Status Module_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||
|
||||
void Menu_Print( FILE *, NDT_Root *);
|
||||
void Command_Get( int *, char **, char **, FILE *, FILE *, short);
|
||||
@ -258,7 +258,7 @@ Command Command_Tab[] =
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args)
|
||||
NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list *Args_Ptr)
|
||||
{
|
||||
NDT_Command_Name Command_Name;
|
||||
|
||||
@ -267,11 +267,12 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
{
|
||||
case NDD_CMD_MANAGER_VERSION:
|
||||
{
|
||||
NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *);
|
||||
ND_VA_ARG_GET( Version_Name_Ptr, *Args_Ptr, NDT_Version_Name *);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||
|
||||
*Version_Name_Ptr = "$Revision: 2.9 $ $Name: $ $Date: 2005/01/20 00:07:27 $ $Author: agibert $";
|
||||
*Version_Name_Ptr = "$Revision: 2.10 $ $Name: $ $Date: 2010/06/06 21:27:12 $ $Author: agibert $";
|
||||
|
||||
return( NDS_OK);
|
||||
}
|
||||
@ -279,15 +280,15 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
case NDD_CMD_INDEX_GET:
|
||||
{
|
||||
/*
|
||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
||||
void *Value_ptr = (void *)va_arg( Args, void *);
|
||||
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
*/
|
||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
||||
T_Module **Module_Ptr_Ptr = (T_Module **)va_arg( Args, T_Module **);
|
||||
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
ND_VA_ARG_GET( Module_Ptr_Ptr, *Args_Ptr, T_Module **);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_INDEX_GET";
|
||||
@ -318,15 +319,23 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
case NDD_CMD_VALUE_ALLOC:
|
||||
{
|
||||
/*
|
||||
void **Value_Ptr_Ptr = (void **)va_arg( Args, void **);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
T_Module **Module_Ptr_Ptr = (T_Module **)va_arg( Args, T_Module **);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
char *Nom = (char *)va_arg( user_args, char *);
|
||||
int Id = (int)va_arg( user_args, int);
|
||||
ND_VA_ARG_GET( Module_Ptr_Ptr, *Args_Ptr, T_Module **);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( Nom, user_args, char *);
|
||||
ND_VA_ARG_GET( Id, user_args, int);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_ALLOC";
|
||||
@ -348,12 +357,16 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
case NDD_CMD_VALUE_FREE:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
T_Module *Module_Ptr = (T_Module *)va_arg( Args, T_Module *);
|
||||
ND_VA_ARG_GET( Module_Ptr, *Args_Ptr, T_Module *);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_FREE";
|
||||
@ -368,14 +381,18 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
case NDD_CMD_VALUE_COMP:
|
||||
{
|
||||
/*
|
||||
void *Value1_Ptr = (void *)va_arg( Args, void *);
|
||||
void *Value2_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
|
||||
ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
T_Module *Value1 = (T_Module *)va_arg( Args, T_Module *);
|
||||
T_Module *Value2 = (T_Module *)va_arg( Args, T_Module *);
|
||||
ND_VA_ARG_GET( Module1_Ptr, *Args_Ptr, T_Module *);
|
||||
ND_VA_ARG_GET( Module2_Ptr, *Args_Ptr, T_Module *);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_COMP";
|
||||
@ -385,7 +402,7 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
int rc;
|
||||
|
||||
|
||||
rc = Value1->Id - Value2->Id;
|
||||
rc = Module1_Ptr->Id - Module2_Ptr->Id;
|
||||
|
||||
if( rc < 0)
|
||||
{
|
||||
@ -415,10 +432,14 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
case NDD_CMD_VALUE_ADD:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -430,10 +451,14 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
case NDD_CMD_VALUE_REMOVE:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -443,25 +468,38 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
|
||||
case NDD_CMD_VALUE_PRINT:
|
||||
{
|
||||
/*
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
va_list user_args = (va_list)va_arg( lib_args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
/*
|
||||
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
|
||||
void *Value_Ptr = Node_Ptr->Value;
|
||||
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
ND_VA_LIST_CLOSE( lib_args);
|
||||
|
||||
void *Value_Ptr = Node_Ptr->Value;
|
||||
*/
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
|
||||
T_Module *Module_Ptr = Node_Ptr->Value;
|
||||
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
|
||||
ND_VA_LIST_CLOSE( lib_args);
|
||||
|
||||
T_Module *Module_Ptr = Node_Ptr->Value;
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_VALUE_PRINT";
|
||||
@ -474,16 +512,22 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
|
||||
case NDD_CMD_INFO_PRINT:
|
||||
{
|
||||
/*
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
va_list user_args = (va_list)va_arg( lib_args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
|
||||
void *Value_Ptr = Node_Ptr->Value;
|
||||
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
ND_VA_LIST_CLOSE( lib_args);
|
||||
*/
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user