Compare commits

..

10 Commits

Author SHA1 Message Date
agibert
7afac7d349 Update to 2.2.0 release,
Update Source and URL entry.
2010-06-06 21:39:03 +00:00
agibert
e1409ab6d8 Fix project URL. 2010-06-06 21:38:28 +00:00
agibert
702c0f117d Add 2.2.0-1 entry. 2010-06-06 21:30:59 +00:00
agibert
0d4b1d3125 Update version from 2.1 to 2.2,
Change Mandrake to Mandriva.
2010-06-06 21:29:44 +00:00
agibert
ec7a688881 Add -fPIC flag in .c to .o makefile rule. 2010-06-06 21:28:14 +00:00
agibert
90eb853801 Add LibNode 2.2 support: Use ND_VA_* macros in manager. 2010-06-06 21:27:12 +00:00
agibert
8cfdf696d1 Add support C99 va_arg for curent gcc (4.4.1),
Add ND_VA_* macros to help manager varargs,
Update Managers to use ND_VA_* macros,
Add example manager template in public node.h file.
2010-06-06 21:26:31 +00:00
agibert
986c67d2fc Add 2.1.1-1 entry: Improve LibShMem support by restricting OpenStruct tracking on local DataStruct (Manager_Ptr != NULL). 2005-06-27 00:23:19 +00:00
agibert
b7ce3250e1 In Library Debug Mode, only perform OpenStruct tracking on local DataStruct: Manager_Ptr != NULL. Improve LibShMem support. 2005-06-26 22:41:10 +00:00
agibert
6a6ae07870 Fix release suffix problem. 2005-01-24 01:34:01 +00:00
9 changed files with 953 additions and 432 deletions

View File

@ -1,7 +1,7 @@
# $RCSfile: Makefile.rule,v $ # $RCSfile: Makefile.rule,v $
# $Revision: 1.4 $ # $Revision: 1.5 $
# $Name: $ # $Name: $
# $Date: 2003/07/16 23:37:37 $ # $Date: 2010/06/06 21:28:14 $
# $Author: agibert $ # $Author: agibert $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
@ -20,7 +20,7 @@ default:all
# Here are all the rules allowing to compile sources files # Here are all the rules allowing to compile sources files
# c -> o # c -> o
%.o:%.c %.o:%.c
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(CC) $(CFLAGS) $(INCLUDE) -fPIC -c $< -o $@
# c -> executable # c -> executable
.c : .c :

View File

@ -1,19 +1,19 @@
# $RCSfile: ReadMe.txt,v $ # $RCSfile: ReadMe.txt,v $
# $Revision: 2.8 $ # $Revision: 2.10 $
# $Name: $ # $Name: $
# $Date: 2005/01/24 01:19:50 $ # $Date: 2010/06/06 21:38:28 $
# $Author: agibert $ # $Author: agibert $
Welcome to LibNode 2.1.x ! Welcome to LibNode 2.2.x !
This release of LibNode supports the following OS: 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, - Solaris 2.6,
- Windows NT4, 2000 and XP. - Windows NT4, 2000 and XP.
@ -41,4 +41,4 @@ Enjoy it!
Your LibNode Team. Your LibNode Team.
arnaud@rx3.net arnaud@rx3.net
http://www.rx3.org/dvp/libnode http://www.rx3.org/dvp/?dvp=libnode

View File

@ -1,13 +1,28 @@
# $RCSfile: ReleaseNotes.txt,v $ # $RCSfile: ReleaseNotes.txt,v $
# $Revision: 2.20 $ # $Revision: 2.22 $
# $Name: $ # $Name: $
# $Date: 2005/01/24 00:50:55 $ # $Date: 2010/06/06 21:30:59 $
# $Author: agibert $ # $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 LibNode V 2.1.0-1 - A. Gibert - 24/01/05
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------

View File

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: nddemo0.c,v $ */ /* $RCSfile: nddemo0.c,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.8 $ */ /* $Revision: 2.9 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2004/08/23 22:48:37 $ */ /* $Date: 2010/06/06 21:27:12 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -64,7 +64,7 @@ typedef struct Demo_Value
/* Prototypes */ /* 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 DataStruct_Load( NDT_Root *, FILE *); void DataStruct_Load( NDT_Root *, FILE *);
void Demo( char *, short); void Demo( char *, short);
@ -80,7 +80,7 @@ int main( int, char **);
/* */ /* */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
NDT_Status 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; 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: 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"; 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); 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: case NDD_CMD_INDEX_GET:
{ {
/* /*
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
void *Value_ptr = (void *)va_arg( Args, void *); 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 *); ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
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_INDEX_GET"; 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: case NDD_CMD_VALUE_ALLOC:
{ {
/* /*
void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...); 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"; 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: case NDD_CMD_VALUE_FREE:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...); 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"; 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: case NDD_CMD_VALUE_COMP:
{ {
/* /*
void *Value1_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
void *Value2_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...); 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 *); ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, Demo_Value *);
Demo_Value *Value2_Ptr = va_arg( Args, Demo_Value *); ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, Demo_Value *);
Command_Name = "NDD_CMD_VALUE_COMP"; 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: case NDD_CMD_VALUE_ADD:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
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"; Command_Name = "NDD_CMD_VALUE_ADD";
return( NDS_OK); return( NDS_OK);
@ -316,36 +330,54 @@ NDT_Status Demo_DS_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_No
case NDD_CMD_VALUE_REMOVE: case NDD_CMD_VALUE_REMOVE:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
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"; Command_Name = "NDD_CMD_VALUE_REMOVE";
return( NDS_OK); return( NDS_OK);
} }
case NDD_CMD_VALUE_PRINT: case NDD_CMD_VALUE_PRINT:
{ {
/* /*
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, 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, ...);
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);
*/ */
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
va_list lib_args = (va_list)va_arg( Args, va_list);
FILE *Out = (FILE *)va_arg( lib_args, FILE *); ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
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( 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; Demo_Value *Value_Ptr = Node_Ptr->Value;
@ -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: case NDD_CMD_INFO_PRINT:
{ {
/* /*
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, 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, ...);
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"; Command_Name = "NDD_CMD_INFO_PRINT";
return( NDS_OK); return( NDS_OK);
@ -409,7 +448,7 @@ void DataStruct_Load( NDT_Root *ds_ptr, FILE *demo_file)
while( !feof( demo_file)) while( !feof( demo_file))
{ {
str = fgets( input_string, STRING_SIZE, 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) if( strlen( input_string) >= STRING_LEN)
{ {

View File

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: node.h,v $ */ /* $RCSfile: node.h,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.12 $ */ /* $Revision: 2.13 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2005/01/20 00:00:25 $ */ /* $Date: 2010/06/06 21:26:31 $ */
/* $Author: agibert $ */ /* $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 */ /* Commandes du manager */
typedef int NDT_Command; typedef int NDT_Command;
@ -216,7 +559,7 @@ struct NDT_Node;
typedef char *NDT_Manager_Name; 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 */ /* 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) Command: Commande à exécuter sur chaque noeud traversé */
/* (I) Data: pointeur de données utilisateur */ /* (I) Data: pointeur de données utilisateur */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *, NDT_Command, 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_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_I( NDT_Root *, NDT_Command, ...);
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( 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) Root: pointeur sur la racine de la structure de données */
/* (I) Out : flux de sortie */ /* (I) Out : flux de sortie */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_DataStruct_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_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, ...); 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 */ /* (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_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_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_I( void **, NDT_Root *, void *, ...);
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_C( 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) Command: Commande à exécuter sur chaque noeud traversé */
/* (I) Data: pointeur de données utilisateur */ /* (I) Data: pointeur de données utilisateur */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_Index_Traverse_VI( 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_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_I( NDT_Root *, NDT_Index_Id, NDT_Command, ...);
NDD_DLL_API NDT_Status ND_Index_Traverse_C( 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) Root: pointeur sur la racine de la structure de données */
/* (I) Out : flux de sortie */ /* (I) Out : flux de sortie */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDD_DLL_API NDT_Status ND_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_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, ...); 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) Value : pointeur sur la valeur à rechercher */
/* (I) Data : pointeur de données */ /* (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_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_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_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 *, ...); 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 */ /* (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_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_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_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, ...); NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...);

View File

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: libnode.c,v $ */ /* $RCSfile: libnode.c,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.15 $ */ /* $Revision: 2.17 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2005/01/19 23:59:41 $ */ /* $Date: 2010/06/06 21:26:31 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -34,7 +34,7 @@
#include <libnode.h> #include <libnode.h>
#ifdef _LIBVER_SUPPORT #ifdef _LIBVER_SUPPORT
VER_INFO_EXPORT( libnode, "$Revision: 2.15 $", "$Name: $", __FILE__, "$Author: agibert $") VER_INFO_EXPORT( libnode, "$Revision: 2.17 $", "$Name: $", __FILE__, "$Author: agibert $")
#endif #endif
@ -49,7 +49,7 @@ VER_INFO_EXPORT( libnode, "$Revision: 2.15 $", "$Name: $", __FILE__, "$Author:
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) NDT_Status ND_Default_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; NDT_Command_Name Command_Name;
@ -58,12 +58,12 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
{ {
case NDD_CMD_MANAGER_VERSION: 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"; Command_Name = "NDD_CMD_MANAGER_VERSION";
*Version_Name_Ptr = "$Revision: 2.15 $ $Name: $ $Date: 2005/01/19 23:59:41 $ $Author: agibert $"; *Version_Name_Ptr = "$Revision: 2.17 $ $Name: $ $Date: 2010/06/06 21:26:31 $ $Author: agibert $";
return( NDS_OK); return( NDS_OK);
} }
@ -71,15 +71,15 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
case NDD_CMD_INDEX_GET: case NDD_CMD_INDEX_GET:
{ {
/* /*
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
void *Value_ptr = (void *)va_arg( Args, void *); 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 *); ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
void *Value_ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
Command_Name = "NDD_CMD_INDEX_GET"; Command_Name = "NDD_CMD_INDEX_GET";
@ -111,10 +111,14 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
case NDD_CMD_VALUE_ALLOC: case NDD_CMD_VALUE_ALLOC:
{ {
/* /*
void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -137,10 +141,14 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
case NDD_CMD_VALUE_FREE: case NDD_CMD_VALUE_FREE:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -156,11 +164,15 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
case NDD_CMD_VALUE_COMP: case NDD_CMD_VALUE_COMP:
{ {
/* /*
void *Value1_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
void *Value2_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -227,18 +239,22 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
return( NDS_KO); return( NDS_KO);
} }
} }
return( NDS_OK);
*/ */
return( NDS_OK);
} }
case NDD_CMD_VALUE_ADD: case NDD_CMD_VALUE_ADD:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -252,10 +268,14 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
case NDD_CMD_VALUE_REMOVE: case NDD_CMD_VALUE_REMOVE:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -268,15 +288,22 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
case NDD_CMD_VALUE_PRINT: case NDD_CMD_VALUE_PRINT:
{ {
/* /*
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
va_list lib_args = (va_list)va_arg( Args, va_list);
FILE *Out = (FILE *)va_arg( lib_args, FILE *); ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
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( Out, lib_args, FILE *);
NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
va_list user_args = (va_list)va_arg( lib_args, va_list); ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
... = (...)va_arg( user_args, ...);
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; void *Value_Ptr = Node_Ptr->Value;
*/ */
@ -294,17 +321,22 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
case NDD_CMD_INFO_PRINT: case NDD_CMD_INFO_PRINT:
{ {
/* /*
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, 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);
NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset);
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, ...);
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);
*/ */
@ -318,10 +350,15 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
case NDD_CMD_USER_TRAVERSE: case NDD_CMD_USER_TRAVERSE:
{ {
/* /*
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
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; void *Value_Ptr = Node_Ptr->Value;
*/ */
@ -355,7 +392,7 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
/* OpenStruct Manager */ /* OpenStruct Manager */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) NDT_Status ND_OpenStruct_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; NDT_Command_Name Command_Name;
@ -364,12 +401,12 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
{ {
case NDD_CMD_MANAGER_VERSION: 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"; Command_Name = "NDD_CMD_MANAGER_VERSION";
*Version_Name_Ptr = "$Revision: 2.15 $ $Name: $ $Date: 2005/01/19 23:59:41 $ $Author: agibert $"; *Version_Name_Ptr = "$Revision: 2.17 $ $Name: $ $Date: 2010/06/06 21:26:31 $ $Author: agibert $";
return( NDS_OK); return( NDS_OK);
} }
@ -377,15 +414,15 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
case NDD_CMD_INDEX_GET: case NDD_CMD_INDEX_GET:
{ {
/* /*
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
void *Value_ptr = (void *)va_arg( Args, void *); 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 *); ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
void *Value_ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
Command_Name = "NDD_CMD_INDEX_GET"; Command_Name = "NDD_CMD_INDEX_GET";
@ -406,10 +443,14 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
case NDD_CMD_VALUE_ALLOC: case NDD_CMD_VALUE_ALLOC:
{ {
/* /*
void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -421,10 +462,14 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
case NDD_CMD_VALUE_FREE: case NDD_CMD_VALUE_FREE:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -436,15 +481,18 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
case NDD_CMD_VALUE_COMP: case NDD_CMD_VALUE_COMP:
{ {
/* /*
void *Value1_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
void *Value2_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, 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, ...);
*/
void *Value1_Ptr = (void *)va_arg( Args, void *); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
void *Value2_Ptr = (void *)va_arg( Args, void *);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/
ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
Command_Name = "NDD_CMD_VALUE_COMP"; Command_Name = "NDD_CMD_VALUE_COMP";
@ -483,10 +531,14 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
case NDD_CMD_VALUE_ADD: case NDD_CMD_VALUE_ADD:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -498,10 +550,14 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
case NDD_CMD_VALUE_REMOVE: case NDD_CMD_VALUE_REMOVE:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -513,15 +569,22 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
case NDD_CMD_VALUE_PRINT: case NDD_CMD_VALUE_PRINT:
{ {
/* /*
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
va_list lib_args = (va_list)va_arg( Args, va_list);
FILE *Out = (FILE *)va_arg( lib_args, FILE *); ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
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( Out, lib_args, FILE *);
NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
va_list user_args = (va_list)va_arg( lib_args, va_list); ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
... = (...)va_arg( user_args, ...);
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; void *Value_Ptr = Node_Ptr->Value;
*/ */
@ -535,25 +598,33 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
case NDD_CMD_INFO_PRINT: case NDD_CMD_INFO_PRINT:
{ {
/* /*
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, 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);
NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset);
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, ...);
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);
*/ */
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
va_list lib_args = (va_list)va_arg( Args, va_list);
FILE *Out = (FILE *)va_arg( lib_args, FILE *); ND_VA_ARG_GET( Out, lib_args, FILE *);
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode); ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth); ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset); ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
ND_VA_LIST_CLOSE( lib_args);
void *Value_Ptr = Node_Ptr->Value; void *Value_Ptr = Node_Ptr->Value;
@ -607,7 +678,7 @@ NDT_Status ND_Library_Open_I( int Debug_Mode)
#if !defined(_WIN32) #if !defined(_WIN32)
if( ( NDG_Base.DL_Ptr = dlopen( NULL, ( RTLD_NOW | RTLD_GLOBAL))) == NULL) 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()); sprintf( NDG_Base.Err_String, "Error ND_Library_Open_I: can't dlopen [%s]", dlerror());
ND_Error_Print(); ND_Error_Print();
return( NDS_KO); return( NDS_KO);
@ -684,7 +755,7 @@ NDT_Status ND_Library_Close_I( void)
#if !defined(_WIN32) #if !defined(_WIN32)
if( dlclose( NDG_Base.DL_Ptr) != 0) if( dlclose( NDG_Base.DL_Ptr) != 0)
{ {
sprintf( NDG_Base.Err_String, "Error ND_Library_Open: can't dlclose [%s]", dlerror()); sprintf( NDG_Base.Err_String, "Error ND_Library_Close_I: can't dlclose [%s]", dlerror());
ND_Error_Print(); ND_Error_Print();
return( NDS_KO); return( NDS_KO);
@ -1036,7 +1107,7 @@ NDT_Status ND_DataStruct_Open_C( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_
return( status); return( status);
} }
if( ( NDG_Base.Debug_Mode == NDD_TRUE) && ( NDG_Base.Open_Status == NDD_TRUE)) if( ( NDG_Base.Debug_Mode == NDD_TRUE) && ( Manager_Ptr != NULL) && ( NDG_Base.Open_Status == NDD_TRUE))
{ {
if( ( status = ND_DataStruct_Value_Add_I( NDG_Base.OpenStruct_Ptr, (void **)*Root_Ptr_Ptr)) != NDS_OK) if( ( status = ND_DataStruct_Value_Add_I( NDG_Base.OpenStruct_Ptr, (void **)*Root_Ptr_Ptr)) != NDS_OK)
{ {
@ -1862,7 +1933,7 @@ NDT_Status ND_DataStruct_Reorg_C( NDT_Root *Root_Ptr)
/* (I) Data : pointeur de données utilisateur */ /* (I) Data : pointeur de données utilisateur */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Index_Traverse_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Command Command, va_list Args) NDT_Status ND_Index_Traverse_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Command Command, va_list *Args_Ptr)
{ {
NDT_Status rc; NDT_Status rc;
NDT_Node *Node_Ptr, *Next_Node_Ptr; NDT_Node *Node_Ptr, *Next_Node_Ptr;
@ -1881,7 +1952,7 @@ NDT_Status ND_Index_Traverse_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, ND
case NDD_CMD_VALUE_FREE: case NDD_CMD_VALUE_FREE:
{ {
rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Node_Ptr->Value, Args); rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Node_Ptr->Value, Args_Ptr);
if (ND_ERROR( rc)) return rc; if (ND_ERROR( rc)) return rc;
rc = ND_Index_Node_Remove_I( Node_Ptr); rc = ND_Index_Node_Remove_I( Node_Ptr);
@ -1895,7 +1966,7 @@ NDT_Status ND_Index_Traverse_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, ND
default: default:
{ {
rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Next_Node_Ptr, Args); rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Next_Node_Ptr, Args_Ptr);
if (ND_ERROR( rc)) return rc; if (ND_ERROR( rc)) return rc;
break; break;
@ -1921,7 +1992,7 @@ NDT_Status ND_Index_Traverse_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, ND
/* (I) Data : pointeur de données utilisateur */ /* (I) Data : pointeur de données utilisateur */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Index_Traverse_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Command Command, va_list Args) NDT_Status ND_Index_Traverse_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Command Command, va_list *Args_Ptr)
{ {
if( NDG_Base.Open_Status != NDD_TRUE) if( NDG_Base.Open_Status != NDD_TRUE)
{ {
@ -1939,7 +2010,7 @@ NDT_Status ND_Index_Traverse_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, N
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
return( ND_Index_Traverse_VI( Root_Ptr, Index_Id, Command, Args)); return( ND_Index_Traverse_VI( Root_Ptr, Index_Id, Command, Args_Ptr));
} }
@ -1979,7 +2050,7 @@ NDT_Status ND_Index_Traverse_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
case NDD_CMD_VALUE_FREE: case NDD_CMD_VALUE_FREE:
{ {
status = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Node_Ptr->Value, args); status = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Node_Ptr->Value, &args);
if( ND_ERROR( status)) return( status); if( ND_ERROR( status)) return( status);
status = ND_Index_Node_Remove_I( Node_Ptr); status = ND_Index_Node_Remove_I( Node_Ptr);
@ -1993,7 +2064,7 @@ NDT_Status ND_Index_Traverse_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
default: default:
{ {
status = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Next_Node_Ptr, args); status = ND_Manager_Exec_I( Root_Ptr, Index_Id, Node_Ptr, Command, Next_Node_Ptr, &args);
if( ND_ERROR( status)) return( status); if( ND_ERROR( status)) return( status);
break; break;
@ -2045,7 +2116,7 @@ NDT_Status ND_Index_Traverse_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, ND
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_Index_Traverse_VI( Root_Ptr, Index_Id, Command, args); status = ND_Index_Traverse_VI( Root_Ptr, Index_Id, Command, &args);
va_end( args); va_end( args);
@ -2065,7 +2136,7 @@ NDT_Status ND_Index_Traverse_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, ND
/* (I) Data : pointeur de données utilisateur */ /* (I) Data : pointeur de données utilisateur */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *Root_Ptr, NDT_Command Command, va_list Args) NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *Root_Ptr, NDT_Command Command, va_list *Args_Ptr)
{ {
NDT_Status status; NDT_Status status;
NDT_Index_Id new_index; NDT_Index_Id new_index;
@ -2075,7 +2146,7 @@ NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *Root_Ptr, NDT_Command Command,
status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, Command, NULL); status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, Command, NULL);
if( ND_ERROR(status)) return( status); if( ND_ERROR(status)) return( status);
return( ND_Index_Traverse_VI( Root_Ptr, new_index, new_cmd, Args)); return( ND_Index_Traverse_VI( Root_Ptr, new_index, new_cmd, Args_Ptr));
} }
@ -2091,7 +2162,7 @@ NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *Root_Ptr, NDT_Command Command,
/* (I) Data : pointeur de données utilisateur */ /* (I) Data : pointeur de données utilisateur */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *Root_Ptr, NDT_Command Command, va_list Args) NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *Root_Ptr, NDT_Command Command, va_list *Args_Ptr)
{ {
if( NDG_Base.Open_Status != NDD_TRUE) if( NDG_Base.Open_Status != NDD_TRUE)
{ {
@ -2108,7 +2179,7 @@ NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *Root_Ptr, NDT_Command Command
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
return( ND_DataStruct_Traverse_VI( Root_Ptr, Command, Args)); return( ND_DataStruct_Traverse_VI( Root_Ptr, Command, Args_Ptr));
} }
@ -2137,7 +2208,7 @@ NDT_Status ND_DataStruct_Traverse_I( NDT_Root *Root_Ptr, NDT_Command Command,
status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, Command, NULL); status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, Command, NULL);
if( ND_ERROR( status)) return( status); if( ND_ERROR( status)) return( status);
status = ND_Index_Traverse_VI( Root_Ptr, new_index, new_cmd, args); status = ND_Index_Traverse_VI( Root_Ptr, new_index, new_cmd, &args);
va_end( args); va_end( args);
@ -2181,7 +2252,7 @@ NDT_Status ND_DataStruct_Traverse_C( NDT_Root *Root_Ptr, NDT_Command Command,
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_DataStruct_Traverse_VI( Root_Ptr, Command, args); status = ND_DataStruct_Traverse_VI( Root_Ptr, Command, &args);
va_end( args); va_end( args);
@ -2667,12 +2738,12 @@ NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *Root_Ptr, void *Value_Ptr)
/* (I) Root : pointeur sur la racine de la structure de données à afficher */ /* (I) Root : pointeur sur la racine de la structure de données à afficher */
/* (I) Out : flux de sortie */ /* (I) Out : flux de sortie */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Index_Value_Print_VI( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, va_list Args) NDT_Status ND_Index_Value_Print_VI( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, va_list *Args_Ptr)
{ {
NDT_Status status; NDT_Status status;
status = ND_Index_Traverse_I( Root_Ptr, Index_Id, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, Args); status = ND_Index_Traverse_I( Root_Ptr, Index_Id, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, Args_Ptr);
return( status); return( status);
} }
@ -2695,7 +2766,7 @@ NDT_Status ND_Index_Value_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_Id
va_start( user_args, Recursive_Offset); va_start( user_args, Recursive_Offset);
status = ND_Index_Traverse_I( Root_Ptr, Index_Id, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, user_args); status = ND_Index_Traverse_I( Root_Ptr, Index_Id, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, &user_args);
va_end( user_args); va_end( user_args);
@ -2745,7 +2816,7 @@ NDT_Status ND_Index_Value_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_I
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_Index_Value_Print_VI( Out, Root_Ptr, Index_Id, Recursive_Mode, Recursive_Depth, Recursive_Offset, user_args); status = ND_Index_Value_Print_VI( Out, Root_Ptr, Index_Id, Recursive_Mode, Recursive_Depth, Recursive_Offset, &user_args);
va_end( user_args); va_end( user_args);
@ -2762,11 +2833,11 @@ NDT_Status ND_Index_Value_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_I
/* (I) Root : pointeur sur la racine de la structure de données à afficher */ /* (I) Root : pointeur sur la racine de la structure de données à afficher */
/* (I) Out : flux de sortie */ /* (I) Out : flux de sortie */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_DataStruct_Value_Print_VI( FILE *Out, NDT_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, va_list User_Args) NDT_Status ND_DataStruct_Value_Print_VI( FILE *Out, NDT_Root *Root_Ptr, NDT_Recursive_Mode Recursive_Mode, NDT_Recursive_Depth Recursive_Depth, NDT_Recursive_Offset Recursive_Offset, va_list *User_Args_Ptr)
{ {
NDT_Status status; NDT_Status status;
status = ND_DataStruct_Traverse_I( Root_Ptr, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, User_Args); status = ND_DataStruct_Traverse_I( Root_Ptr, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, User_Args_Ptr);
return( status); return( status);
} }
@ -2789,7 +2860,7 @@ NDT_Status ND_DataStruct_Value_Print_I( FILE *Out, NDT_Root *Root_Ptr, NDT_Rec
va_start( user_args, Recursive_Offset); va_start( user_args, Recursive_Offset);
status = ND_DataStruct_Traverse_I( Root_Ptr, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, user_args); status = ND_DataStruct_Traverse_I( Root_Ptr, NDD_CMD_VALUE_PRINT, Out, Recursive_Mode, Recursive_Depth, Recursive_Offset, &user_args);
va_end( user_args); va_end( user_args);
@ -2839,7 +2910,7 @@ NDT_Status ND_DataStruct_Value_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Re
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_DataStruct_Value_Print_VI( Out, Root_Ptr, Recursive_Mode, Recursive_Depth, Recursive_Offset, user_args); status = ND_DataStruct_Value_Print_VI( Out, Root_Ptr, Recursive_Mode, Recursive_Depth, Recursive_Offset, &user_args);
va_end( user_args); va_end( user_args);
@ -3301,15 +3372,15 @@ NDT_Status ND_Index_Node_Previous_Get_C( NDT_Node **Prev_Node_Ptr_Ptr, NDT_Nod
/* (I) Data : pointeur de données */ /* (I) Data : pointeur de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Index_Node_Find_VI( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list Args) NDT_Status ND_Index_Node_Find_VI( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list *Args_Ptr)
{ {
if( ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id)) if( ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id))
{ {
*Node_Ptr_Ptr = ND_List_Node_Find( Root_Ptr, Index_Id, Value_Ptr, Args); *Node_Ptr_Ptr = ND_List_Node_Find( Root_Ptr, Index_Id, Value_Ptr, Args_Ptr);
} }
else if ( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id)) else if ( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id))
{ {
*Node_Ptr_Ptr = ND_Tree_Node_Find( Root_Ptr, Index_Id, Value_Ptr, Args); *Node_Ptr_Ptr = ND_Tree_Node_Find( Root_Ptr, Index_Id, Value_Ptr, Args_Ptr);
} }
else else
{ {
@ -3335,7 +3406,7 @@ NDT_Status ND_Index_Node_Find_VI( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr
/* (I) Data : pointeur de données */ /* (I) Data : pointeur de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Index_Node_Find_VC( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list Args) NDT_Status ND_Index_Node_Find_VC( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list *Args_Ptr)
{ {
NDT_Status status; NDT_Status status;
@ -3364,7 +3435,7 @@ NDT_Status ND_Index_Node_Find_VC( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_Index_Node_Find_VI( Node_Ptr_Ptr, Root_Ptr, Index_Id, Value_Ptr, Args); status = ND_Index_Node_Find_VI( Node_Ptr_Ptr, Root_Ptr, Index_Id, Value_Ptr, Args_Ptr);
return( status); return( status);
@ -3392,11 +3463,11 @@ NDT_Status ND_Index_Node_Find_I( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr,
if( ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id)) if( ND_INDEX_TYPE_LIST_IS( Root_Ptr, Index_Id))
{ {
*Node_Ptr_Ptr = ND_List_Node_Find( Root_Ptr, Index_Id, Value_Ptr, user_args); *Node_Ptr_Ptr = ND_List_Node_Find( Root_Ptr, Index_Id, Value_Ptr, &user_args);
} }
else if ( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id)) else if ( ND_INDEX_TYPE_TREE_IS( Root_Ptr, Index_Id))
{ {
*Node_Ptr_Ptr = ND_Tree_Node_Find( Root_Ptr, Index_Id, Value_Ptr, user_args); *Node_Ptr_Ptr = ND_Tree_Node_Find( Root_Ptr, Index_Id, Value_Ptr, &user_args);
} }
else else
{ {
@ -3454,7 +3525,7 @@ NDT_Status ND_Index_Node_Find_C( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr,
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_Index_Node_Find_VI( Node_Ptr_Ptr, Root_Ptr, Index_Id, Value_Ptr, user_args); status = ND_Index_Node_Find_VI( Node_Ptr_Ptr, Root_Ptr, Index_Id, Value_Ptr, &user_args);
va_end( user_args); va_end( user_args);
@ -3474,7 +3545,7 @@ NDT_Status ND_Index_Node_Find_C( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr,
/* (I) Data : pointeur de données */ /* (I) Data : pointeur de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_DataStruct_Value_Find_VI( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list Args) NDT_Status ND_DataStruct_Value_Find_VI( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list *Args_Ptr)
{ {
NDT_Status status; NDT_Status status;
NDT_Index_Id new_index; NDT_Index_Id new_index;
@ -3485,7 +3556,7 @@ NDT_Status ND_DataStruct_Value_Find_VI( void **Value_Ptr_Ptr, NDT_Root *Root_
status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, NDD_CMD_VALUE_FIND, Ref_Value_Ptr); status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, NDD_CMD_VALUE_FIND, Ref_Value_Ptr);
if( ND_ERROR(status)) return( status); if( ND_ERROR(status)) return( status);
status = ND_Index_Node_Find_VI( &node_ptr, Root_Ptr, new_index, Ref_Value_Ptr, Args); status = ND_Index_Node_Find_VI( &node_ptr, Root_Ptr, new_index, Ref_Value_Ptr, Args_Ptr);
if( ND_ERROR(status)) return( status); if( ND_ERROR(status)) return( status);
if( node_ptr != NULL) if( node_ptr != NULL)
@ -3513,7 +3584,7 @@ NDT_Status ND_DataStruct_Value_Find_VI( void **Value_Ptr_Ptr, NDT_Root *Root_
/* (I) Data : pointeur de données */ /* (I) Data : pointeur de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_DataStruct_Value_Find_VC( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list Args) NDT_Status ND_DataStruct_Value_Find_VC( void **Value_Ptr_Ptr, NDT_Root *Root_Ptr, void *Ref_Value_Ptr, va_list *Args_Ptr)
{ {
NDT_Status status; NDT_Status status;
@ -3542,7 +3613,7 @@ NDT_Status ND_DataStruct_Value_Find_VC( void **Value_Ptr_Ptr, NDT_Root *Root_
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_DataStruct_Value_Find_VI( Value_Ptr_Ptr, Root_Ptr, Ref_Value_Ptr, Args); status = ND_DataStruct_Value_Find_VI( Value_Ptr_Ptr, Root_Ptr, Ref_Value_Ptr, Args_Ptr);
return( status); return( status);
} }
@ -3574,7 +3645,7 @@ NDT_Status ND_DataStruct_Value_Find_I( void **Value_Ptr_Ptr, NDT_Root *Root_P
status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, NDD_CMD_VALUE_FIND, Ref_Value_Ptr); status = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_PRIMARY, NULL, NDD_CMD_INDEX_GET, &new_index, &new_cmd, NDD_CMD_VALUE_FIND, Ref_Value_Ptr);
if( ND_ERROR(status)) return( status); if( ND_ERROR(status)) return( status);
status = ND_Index_Node_Find_VI( &node_ptr, Root_Ptr, new_index, Ref_Value_Ptr, user_args); status = ND_Index_Node_Find_VI( &node_ptr, Root_Ptr, new_index, Ref_Value_Ptr, &user_args);
if( ND_ERROR(status)) return( status); if( ND_ERROR(status)) return( status);
if( node_ptr != NULL) if( node_ptr != NULL)
@ -3636,7 +3707,7 @@ NDT_Status ND_DataStruct_Value_Find_C( void **Value_Ptr_Ptr, NDT_Root *Root_P
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_DataStruct_Value_Find_VI( Value_Ptr_Ptr, Root_Ptr, Ref_Value_Ptr, user_args); status = ND_DataStruct_Value_Find_VI( Value_Ptr_Ptr, Root_Ptr, Ref_Value_Ptr, &user_args);
va_end( user_args); va_end( user_args);
@ -3717,7 +3788,7 @@ NDT_Status ND_Value_Alloc_I( NDT_Root *Root_Ptr, void **Value_Ptr_Ptr, ...)
/* Appel du manager */ /* Appel du manager */
rc = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_VALUE_ALLOC, Value_Ptr_Ptr, user_args); rc = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_VALUE_ALLOC, Value_Ptr_Ptr, &user_args);
va_end( user_args); va_end( user_args);
@ -3764,7 +3835,7 @@ NDT_Status ND_Value_Alloc_C( NDT_Root *Root_Ptr, void **Value_Ptr_Ptr, ...)
/* Appel du manager */ /* Appel du manager */
rc = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_VALUE_ALLOC, Value_Ptr_Ptr, user_args); rc = ND_Manager_Exec_I( Root_Ptr, NDD_INDEX_UNKNOWN, NULL, NDD_CMD_VALUE_ALLOC, Value_Ptr_Ptr, &user_args);
va_end( user_args); va_end( user_args);
@ -3838,7 +3909,7 @@ NDT_Status ND_Value_Free_C( NDT_Root *Root_Ptr, void *Value_Ptr)
/* (I) Function : nom de la fonction manager à exécuter */ /* (I) Function : nom de la fonction manager à exécuter */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Manager_Exec_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) NDT_Status ND_Manager_Exec_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list *Args_Ptr)
{ {
NDT_Status status; NDT_Status status;
NDT_Manager *manager_ptr; NDT_Manager *manager_ptr;
@ -3859,7 +3930,7 @@ NDT_Status ND_Manager_Exec_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
} }
} }
status = manager_ptr( Root_Ptr, Index_Id, Node_Ptr, Command, Args); status = manager_ptr( Root_Ptr, Index_Id, Node_Ptr, Command, Args_Ptr);
return( status); return( status);
} }
@ -3873,7 +3944,7 @@ NDT_Status ND_Manager_Exec_VI( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
/* (I) Function : nom de la fonction manager à exécuter */ /* (I) Function : nom de la fonction manager à exécuter */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Status ND_Manager_Exec_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list Args) NDT_Status ND_Manager_Exec_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list *Args_Ptr)
{ {
NDT_Status status; NDT_Status status;
@ -3902,7 +3973,7 @@ NDT_Status ND_Manager_Exec_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_Manager_Exec_VI( Root_Ptr, Index_Id, Node_Ptr, Command, Args); status = ND_Manager_Exec_VI( Root_Ptr, Index_Id, Node_Ptr, Command, Args_Ptr);
return( status); return( status);
} }
@ -3941,7 +4012,7 @@ NDT_Status ND_Manager_Exec_I( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_
} }
} }
status = manager_ptr( Root_Ptr, Index_Id, Node_Ptr, Command, args); status = manager_ptr( Root_Ptr, Index_Id, Node_Ptr, Command, &args);
va_end( args); va_end( args);
@ -3990,7 +4061,7 @@ NDT_Status ND_Manager_Exec_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_
return( NDS_ERRAPI); return( NDS_ERRAPI);
} }
status = ND_Manager_Exec_VI( Root_Ptr, Index_Id, Node_Ptr, Command, args); status = ND_Manager_Exec_VI( Root_Ptr, Index_Id, Node_Ptr, Command, &args);
va_end( args); va_end( args);
@ -4604,7 +4675,7 @@ NDT_Status ND_Tree_Value_Add( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void
/* (I) Data : pointeur de données */ /* (I) Data : pointeur de données */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Node *ND_List_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list User_Args) NDT_Node *ND_List_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list *User_Args_Ptr)
{ {
NDT_Node *node_ptr; NDT_Node *node_ptr;
NDT_Status rc; NDT_Status rc;
@ -4618,7 +4689,7 @@ NDT_Node *ND_List_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void
while( node_ptr) while( node_ptr)
{ {
rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_COMP, Value_Ptr, node_ptr->Value, User_Args); rc = ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_COMP, Value_Ptr, node_ptr->Value, User_Args_Ptr);
switch( rc) switch( rc)
{ {
@ -4646,7 +4717,7 @@ NDT_Node *ND_List_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void
{ {
/* Pour les listes non triées, il faut parcourir toute la liste */ /* Pour les listes non triées, il faut parcourir toute la liste */
while( node_ptr && ( ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_COMP, Value_Ptr, node_ptr->Value, User_Args) != NDS_EQUAL)) while( node_ptr && ( ND_Manager_Exec_I( Root_Ptr, Index_Id, node_ptr, NDD_CMD_VALUE_COMP, Value_Ptr, node_ptr->Value, User_Args_Ptr) != NDS_EQUAL))
{ {
node_ptr = node_ptr->Right; node_ptr = node_ptr->Right;
} }
@ -4669,14 +4740,14 @@ NDT_Node *ND_List_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void
/*------------------------------ Recursive Kernel ------------------------------*/ /*------------------------------ Recursive Kernel ------------------------------*/
NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *Node_Ptr, void *Value_Ptr, va_list User_Args) NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *Node_Ptr, void *Value_Ptr, va_list *User_Args_Ptr)
{ {
NDT_Status answer; NDT_Status answer;
if( !Node_Ptr) return(NULL); if( !Node_Ptr) return(NULL);
answer = ND_Manager_Exec_I( Node_Ptr->Root, Node_Ptr->Index, Node_Ptr, NDD_CMD_VALUE_COMP, Value_Ptr, Node_Ptr->Value, User_Args); answer = ND_Manager_Exec_I( Node_Ptr->Root, Node_Ptr->Index, Node_Ptr, NDD_CMD_VALUE_COMP, Value_Ptr, Node_Ptr->Value, User_Args_Ptr);
/* Noeud trouvé */ /* Noeud trouvé */
@ -4684,9 +4755,9 @@ NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *Node_Ptr, void *Value_Ptr, v
/* Continuation de la recherche par appel récursif */ /* Continuation de la recherche par appel récursif */
if( answer == NDS_LOWER) return( ND_Tree_Node_Recursive_Find( Node_Ptr->Left, Value_Ptr, User_Args)); if( answer == NDS_LOWER) return( ND_Tree_Node_Recursive_Find( Node_Ptr->Left, Value_Ptr, User_Args_Ptr));
if( answer == NDS_GREATER) return( ND_Tree_Node_Recursive_Find( Node_Ptr->Right, Value_Ptr, User_Args)); if( answer == NDS_GREATER) return( ND_Tree_Node_Recursive_Find( Node_Ptr->Right, Value_Ptr, User_Args_Ptr));
return( NULL); return( NULL);
} }
@ -4695,9 +4766,9 @@ NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *Node_Ptr, void *Value_Ptr, v
/*-------------------------------- main body ---------------------------------*/ /*-------------------------------- main body ---------------------------------*/
NDT_Node *ND_Tree_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list User_Args) NDT_Node *ND_Tree_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void *Value_Ptr, va_list *User_Args_Ptr)
{ {
return( ND_Tree_Node_Recursive_Find( Root_Ptr->Index_Tab[Index_Id].Head, Value_Ptr, User_Args)); return( ND_Tree_Node_Recursive_Find( Root_Ptr->Index_Tab[Index_Id].Head, Value_Ptr, User_Args_Ptr));
} }

View File

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: libnode.h,v $ */ /* $RCSfile: libnode.h,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.9 $ */ /* $Revision: 2.10 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2005/01/19 23:59:42 $ */ /* $Date: 2010/06/06 21:26:31 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -127,14 +127,14 @@ NDT_Base NDG_Base =
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) va_list Arguments : Liste d'arguments contextuels */ /* (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 */ /* OpenStruct Manager */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* (I) va_list Arguments : Liste d'arguments contextuels */ /* (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 */ /* 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 */ /* Recherche une valeur dans une liste et retourne le noeud correspondant */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list); NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */ /* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
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 */ /* 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_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 *); NDT_Node *ND_Tree_Parent_Next_Recursive_Get( NDT_Node *);

View File

@ -1,8 +1,13 @@
Name: libnode Name: libnode
Version: 2.1.0 Version: 2.2.0
Release: 1rx3
%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 %define source %{libnode_name}.src.tgz
@ -14,8 +19,8 @@ Distribution: Rx3 OpenSource
Vendor: Rx3 Vendor: Rx3
Packager: Arnaud G. Gibert <arnaud@rx3.net> Packager: Arnaud G. Gibert <arnaud@rx3.net>
Source: ftp://ftp.rx3.org/pub/%{source} Source: ftp://ftp.rx3.org/pub/arc/dvp/%{source}
Url: http://www.rx3.org/dvp/libnode/download/ Url: http://www.rx3.org/dvp/?dvp=libnode
BuildRoot: %{_tmppath}/%{libnode_name}-buildroot BuildRoot: %{_tmppath}/%{libnode_name}-buildroot
AutoReqProv: no AutoReqProv: no
@ -53,6 +58,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog %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 * Mon Jan 24 2005 Arnaud G. Gibert <arnaud@rx3.net> 2.1.0-1rx3
- Update to 2.1.0 release, - Update to 2.1.0 release,
- Now use "rx3" as release suffix, - Now use "rx3" as release suffix,

View File

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: ndbench.c,v $ */ /* $RCSfile: ndbench.c,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.9 $ */ /* $Revision: 2.10 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2005/01/20 00:07:27 $ */ /* $Date: 2010/06/06 21:27:12 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -59,7 +59,7 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
#ifdef _LIBVER_SUPPORT #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" # define USAGE "Usage : %s [ --help | --version [-v] | --batch_run <batch_file_name>]\n"
#else #else
# define USAGE "Usage : %s [ --help | --batch_run <batch_file_name>]\n" # define USAGE "Usage : %s [ --help | --batch_run <batch_file_name>]\n"
@ -200,7 +200,7 @@ NDT_Index_Type idx_type_balanced_tree = NDD_INDEX_STATUS_OPENED | NDD_INDEX_TYP
/* Prototype */ /* 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 Menu_Print( FILE *, NDT_Root *);
void Command_Get( int *, char **, char **, FILE *, FILE *, short); 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; 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: 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"; 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); 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: case NDD_CMD_INDEX_GET:
{ {
/* /*
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *); ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
void *Value_ptr = (void *)va_arg( Args, void *); 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 *); ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *); ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command); ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
T_Module **Module_Ptr_Ptr = (T_Module **)va_arg( Args, T_Module **); ND_VA_ARG_GET( Module_Ptr_Ptr, *Args_Ptr, T_Module **);
Command_Name = "NDD_CMD_INDEX_GET"; 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: case NDD_CMD_VALUE_ALLOC:
{ {
/* /*
void **Value_Ptr_Ptr = (void **)va_arg( Args, void **); ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
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 **); ND_VA_ARG_GET( Module_Ptr_Ptr, *Args_Ptr, T_Module **);
va_list user_args = (va_list)va_arg( Args, va_list);
char *Nom = (char *)va_arg( user_args, char *); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
int Id = (int)va_arg( user_args, int);
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"; 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: case NDD_CMD_VALUE_FREE:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
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"; 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: case NDD_CMD_VALUE_COMP:
{ {
/* /*
void *Value1_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
void *Value2_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
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 *); ND_VA_ARG_GET( Module1_Ptr, *Args_Ptr, T_Module *);
T_Module *Value2 = (T_Module *)va_arg( Args, T_Module *); ND_VA_ARG_GET( Module2_Ptr, *Args_Ptr, T_Module *);
Command_Name = "NDD_CMD_VALUE_COMP"; 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; int rc;
rc = Value1->Id - Value2->Id; rc = Module1_Ptr->Id - Module2_Ptr->Id;
if( rc < 0) 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: case NDD_CMD_VALUE_ADD:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
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: case NDD_CMD_VALUE_REMOVE:
{ {
/* /*
void *Value_Ptr = (void *)va_arg( Args, void *); ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
va_list user_args = (va_list)va_arg( Args, va_list);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_LIST_OPEN( user_args, *Args_Ptr);
... = (...)va_arg( user_args, ...);
ND_VA_ARG_GET( user_data, user_args, user_type);
ND_VA_ARG_GET( ..., user_args, ...);
ND_VA_LIST_CLOSE( user_args);
*/ */
@ -444,22 +469,35 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
case NDD_CMD_VALUE_PRINT: case NDD_CMD_VALUE_PRINT:
{ {
/* /*
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
va_list lib_args = (va_list)va_arg( Args, va_list);
FILE *Out = (FILE *)va_arg( lib_args, FILE *); ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
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( Out, lib_args, FILE *);
va_list user_args = (va_list)va_arg( lib_args, va_list); ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
user_type user_data = (user_type)va_arg( user_args, user_type); ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
... = (...)va_arg( user_args, ...); 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; void *Value_Ptr = Node_Ptr->Value;
*/ */
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
va_list lib_args = (va_list)va_arg( Args, va_list);
FILE *Out = (FILE *)va_arg( lib_args, FILE *); ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
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( 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; T_Module *Module_Ptr = Node_Ptr->Value;
@ -474,16 +512,22 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
case NDD_CMD_INFO_PRINT: case NDD_CMD_INFO_PRINT:
{ {
/* /*
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *); ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, 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, ...);
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);
*/ */