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.
This commit is contained in:
parent
986c67d2fc
commit
8cfdf696d1
373
include/node.h
373
include/node.h
@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: node.h,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.12 $ */
|
||||
/* $Revision: 2.13 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2005/01/20 00:00:25 $ */
|
||||
/* $Date: 2010/06/06 21:26:31 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@ -151,6 +151,349 @@ typedef int NDT_Index_Type;
|
||||
|
||||
|
||||
|
||||
/* Manager Template */
|
||||
|
||||
// NDT_Status ND_Example_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node *Node_Ptr, NDT_Command Command, va_list *Args_Ptr)
|
||||
// {
|
||||
// NDT_Command_Name Command_Name;
|
||||
//
|
||||
//
|
||||
// switch( Command)
|
||||
// {
|
||||
// case NDD_CMD_MANAGER_VERSION:
|
||||
// {
|
||||
// ND_VA_ARG_GET( Version_Name_Ptr, *Args_Ptr, NDT_Version_Name *);
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||
//
|
||||
// *Version_Name_Ptr = "$Revision: 2.13 $ $Name: $ $Date: 2010/06/06 21:26:31 $ $Author: agibert $";
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_INDEX_GET:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
// ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
// ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
// */
|
||||
// ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
// ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
// ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_INDEX_GET";
|
||||
//
|
||||
// switch(Cmd)
|
||||
// {
|
||||
// /*
|
||||
// case NDT_CMD_SOME_USER_CMD:
|
||||
// {
|
||||
// *Reply_Index_Id_Ptr = 0;
|
||||
// *Reply_Command_Ptr = NDD_CMD_SOME_OTHER_CMD;
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// ...
|
||||
// */
|
||||
//
|
||||
// default:
|
||||
// {
|
||||
// *Reply_Index_Id_Ptr = Index_Id;
|
||||
// *Reply_Command_Ptr = Cmd;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_ALLOC:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_ALLOC";
|
||||
//
|
||||
// /*
|
||||
// if( ( *Value_Ptr_Ptr = (void *)malloc( sizeof(void))) == NULL)
|
||||
// {
|
||||
// return(NDS_ERRMEM);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ...
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// }
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_FREE:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_FREE";
|
||||
//
|
||||
// /*
|
||||
// free( Value_Ptr);
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_COMP:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
|
||||
// ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_COMP";
|
||||
//
|
||||
// switch( Index_Id)
|
||||
// {
|
||||
// case 0:
|
||||
// {
|
||||
// int rc;
|
||||
//
|
||||
//
|
||||
// rc = strcmp( Value1_Ptr->..., Value2_Ptr->...);
|
||||
//
|
||||
// if( rc < 0)
|
||||
// {
|
||||
// return(NDS_LOWER);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if( rc > 0)
|
||||
// {
|
||||
// return(NDS_GREATER);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return(NDS_EQUAL);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// case 1:
|
||||
// {
|
||||
// int val1 = atoi(Value1_Ptr->...);
|
||||
// int val2 = atoi(Value2_Ptr->...);
|
||||
//
|
||||
//
|
||||
// if( val1 < val2)
|
||||
// {
|
||||
// return(NDS_LOWER);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if( val1 > val2)
|
||||
// {
|
||||
// return(NDS_GREATER);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return(NDS_EQUAL);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// case 2:
|
||||
// {
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// default:
|
||||
// {
|
||||
// printf( "Unknown COMP idx (%d) !\n", Index_Id);
|
||||
// return( NDS_KO);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_ADD:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_ADD";
|
||||
//
|
||||
// /*
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_REMOVE:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_REMOVE";
|
||||
// /*
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_VALUE_PRINT:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
// ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
// ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
// ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// ND_VA_LIST_CLOSE( lib_args);
|
||||
//
|
||||
// void *Value_Ptr = Node_Ptr->Value;
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_VALUE_PRINT";
|
||||
//
|
||||
// /*
|
||||
// fprintf( Out, "...\n", Value_Ptr->..., ...);
|
||||
//
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_INFO_PRINT:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
// ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
// ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
// ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
// ND_VA_LIST_CLOSE( lib_args);
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_INFO_PRINT";
|
||||
//
|
||||
// /*
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// case NDD_CMD_USER_TRAVERSE:
|
||||
// {
|
||||
// /*
|
||||
// ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
//
|
||||
// ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
//
|
||||
// ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
// ND_VA_ARG_GET( ..., user_args, ...);
|
||||
//
|
||||
// ND_VA_LIST_CLOSE( user_args);
|
||||
//
|
||||
//
|
||||
// void *Value_Ptr = Node_Ptr->Value;
|
||||
// */
|
||||
//
|
||||
//
|
||||
// Command_Name = "NDD_CMD_USER_TRAVERSE";
|
||||
//
|
||||
// /*
|
||||
// return( NDS_OK);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// default:
|
||||
// {
|
||||
// printf( "ND_Default_Manager() called with an undefined command %d\n", Command);
|
||||
// return(NDS_ERRAPI);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// printf( "ND_Default_Manager() called with command %d (%s)\n", Command, Command_Name);
|
||||
// return(NDS_OK);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/* Var Args Manager Macros */
|
||||
|
||||
#define ND_VA_LIST_OPEN( VA_List_Target, VA_List_Source) va_list VA_List_Target; va_copy( VA_List_Target, *va_arg( VA_List_Source, va_list *))
|
||||
#define ND_VA_LIST_CLOSE( VA_List) va_end( VA_List)
|
||||
#define ND_VA_ARG_GET( Arg, VA_List, Type) Type Arg = va_arg( VA_List, Type)
|
||||
|
||||
|
||||
|
||||
/* Commandes du manager */
|
||||
|
||||
typedef int NDT_Command;
|
||||
@ -216,7 +559,7 @@ struct NDT_Node;
|
||||
|
||||
typedef char *NDT_Manager_Name;
|
||||
|
||||
typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Node *, NDT_Command, va_list);
|
||||
typedef NDT_Status NDT_Manager( struct NDT_Root *, NDT_Index_Id, struct NDT_Node *, NDT_Command, va_list *);
|
||||
|
||||
|
||||
/* Pointeur de fonction sur l'allocateur */
|
||||
@ -553,8 +896,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Convert_C( NDT_Root *, NDT_Index_Type *)
|
||||
/* (I) Command: Commande à exécuter sur chaque noeud traversé */
|
||||
/* (I) Data: pointeur de données utilisateur */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VI( NDT_Root *, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_I( NDT_Root *, NDT_Command, ...);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Traverse_C( NDT_Root *, NDT_Command, ...);
|
||||
|
||||
@ -600,7 +943,7 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Remove_C( NDT_Root *, void *);
|
||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||
/* (I) Out : flux de sortie */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_VI( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_VI( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_I( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||
|
||||
@ -615,8 +958,8 @@ NDD_DLL_API NDT_Status ND_DataStruct_Value_Print_C( FILE *, NDT_Root *, NDT_
|
||||
/* (I) Data : pointeur de données */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VI( void **, NDT_Root *, void *, va_list);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VC( void **, NDT_Root *, void *, va_list);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VI( void **, NDT_Root *, void *, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_VC( void **, NDT_Root *, void *, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_I( void **, NDT_Root *, void *, ...);
|
||||
NDD_DLL_API NDT_Status ND_DataStruct_Value_Find_C( void **, NDT_Root *, void *, ...);
|
||||
|
||||
@ -703,8 +1046,8 @@ NDD_DLL_API NDT_Status ND_Index_Reorg_C( NDT_Root *, NDT_Index_Id);
|
||||
/* (I) Command: Commande à exécuter sur chaque noeud traversé */
|
||||
/* (I) Data: pointeur de données utilisateur */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VI( NDT_Root *, NDT_Index_Id, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VC( NDT_Root *, NDT_Index_Id, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VI( NDT_Root *, NDT_Index_Id, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_VC( NDT_Root *, NDT_Index_Id, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_I( NDT_Root *, NDT_Index_Id, NDT_Command, ...);
|
||||
NDD_DLL_API NDT_Status ND_Index_Traverse_C( NDT_Root *, NDT_Index_Id, NDT_Command, ...);
|
||||
|
||||
@ -752,7 +1095,7 @@ NDD_DLL_API NDT_Status ND_Index_Value_Remove_C( NDT_Root *, NDT_Index_Id, void
|
||||
/* (I) Root: pointeur sur la racine de la structure de données */
|
||||
/* (I) Out : flux de sortie */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_VI( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_VI( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_I( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||
NDD_DLL_API NDT_Status ND_Index_Value_Print_C( FILE *, NDT_Root *, NDT_Index_Id, NDT_Recursive_Mode, NDT_Recursive_Depth, NDT_Recursive_Offset, ...);
|
||||
|
||||
@ -831,8 +1174,8 @@ NDD_DLL_API NDT_Status ND_Index_Node_Previous_Get_C( NDT_Node **, NDT_Node *)
|
||||
/* (I) Value : pointeur sur la valeur à rechercher */
|
||||
/* (I) Data : pointeur de données */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VI( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VC( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VI( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_VC( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_I( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...);
|
||||
NDD_DLL_API NDT_Status ND_Index_Node_Find_C( NDT_Node **, NDT_Root *, NDT_Index_Id, void *, ...);
|
||||
|
||||
@ -877,8 +1220,8 @@ NDD_DLL_API NDT_Status ND_Value_Free_C( NDT_Root *, void *);
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* (I) Function : nom de la fonction manager à exécuter */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VI( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VC( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VI( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_VC( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_I( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...);
|
||||
NDD_DLL_API NDT_Status ND_Manager_Exec_C( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, ...);
|
||||
|
||||
|
417
lib/libnode.c
417
lib/libnode.c
@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: libnode.c,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.16 $ */
|
||||
/* $Revision: 2.17 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2005/06/26 22:41:10 $ */
|
||||
/* $Date: 2010/06/06 21:26:31 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include <libnode.h>
|
||||
|
||||
#ifdef _LIBVER_SUPPORT
|
||||
VER_INFO_EXPORT( libnode, "$Revision: 2.16 $", "$Name: $", __FILE__, "$Author: agibert $")
|
||||
VER_INFO_EXPORT( libnode, "$Revision: 2.17 $", "$Name: $", __FILE__, "$Author: agibert $")
|
||||
#endif
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ VER_INFO_EXPORT( libnode, "$Revision: 2.16 $", "$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;
|
||||
|
||||
@ -58,12 +58,12 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
{
|
||||
case NDD_CMD_MANAGER_VERSION:
|
||||
{
|
||||
NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *);
|
||||
ND_VA_ARG_GET( Version_Name_Ptr, *Args_Ptr, NDT_Version_Name *);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||
|
||||
*Version_Name_Ptr = "$Revision: 2.16 $ $Name: $ $Date: 2005/06/26 22:41:10 $ $Author: agibert $";
|
||||
*Version_Name_Ptr = "$Revision: 2.17 $ $Name: $ $Date: 2010/06/06 21:26:31 $ $Author: agibert $";
|
||||
|
||||
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:
|
||||
{
|
||||
/*
|
||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
||||
void *Value_ptr = (void *)va_arg( Args, void *);
|
||||
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
*/
|
||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
||||
void *Value_ptr = (void *)va_arg( Args, void *);
|
||||
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
|
||||
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:
|
||||
{
|
||||
/*
|
||||
void **Value_Ptr_Ptr = (void **)va_arg( Args, void **);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -137,10 +141,14 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
case NDD_CMD_VALUE_FREE:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -156,11 +164,15 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
case NDD_CMD_VALUE_COMP:
|
||||
{
|
||||
/*
|
||||
void *Value1_Ptr = (void *)va_arg( Args, void *);
|
||||
void *Value2_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
|
||||
ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -227,18 +239,22 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
return( NDS_KO);
|
||||
}
|
||||
}
|
||||
|
||||
return( NDS_OK);
|
||||
*/
|
||||
return( NDS_OK);
|
||||
|
||||
}
|
||||
|
||||
case NDD_CMD_VALUE_ADD:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -252,10 +268,14 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
case NDD_CMD_VALUE_REMOVE:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -268,15 +288,22 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
case NDD_CMD_VALUE_PRINT:
|
||||
{
|
||||
/*
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
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, ...);
|
||||
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;
|
||||
*/
|
||||
@ -294,17 +321,22 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
case NDD_CMD_INFO_PRINT:
|
||||
{
|
||||
/*
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
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, ...);
|
||||
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
|
||||
void *Value_Ptr = Node_Ptr->Value;
|
||||
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
ND_VA_LIST_CLOSE( lib_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -318,10 +350,15 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
case NDD_CMD_USER_TRAVERSE:
|
||||
{
|
||||
/*
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, 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);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
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;
|
||||
*/
|
||||
@ -355,7 +392,7 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
/* 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;
|
||||
|
||||
@ -364,12 +401,12 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
|
||||
{
|
||||
case NDD_CMD_MANAGER_VERSION:
|
||||
{
|
||||
NDT_Version_Name *Version_Name_Ptr = (NDT_Version_Name *)va_arg( Args, NDT_Version_Name *);
|
||||
ND_VA_ARG_GET( Version_Name_Ptr, *Args_Ptr, NDT_Version_Name *);
|
||||
|
||||
|
||||
Command_Name = "NDD_CMD_MANAGER_VERSION";
|
||||
|
||||
*Version_Name_Ptr = "$Revision: 2.16 $ $Name: $ $Date: 2005/06/26 22:41:10 $ $Author: agibert $";
|
||||
*Version_Name_Ptr = "$Revision: 2.17 $ $Name: $ $Date: 2010/06/06 21:26:31 $ $Author: agibert $";
|
||||
|
||||
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:
|
||||
{
|
||||
/*
|
||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
||||
void *Value_ptr = (void *)va_arg( Args, void *);
|
||||
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
*/
|
||||
NDT_Index_Id *Reply_Index_Id_Ptr = (NDT_Index_Id *)va_arg( Args, NDT_Index_Id *);
|
||||
NDT_Command *Reply_Command_Ptr = (NDT_Command *)va_arg( Args, NDT_Command *);
|
||||
NDT_Command Cmd = (NDT_Command)va_arg( Args, NDT_Command);
|
||||
void *Value_ptr = (void *)va_arg( Args, void *);
|
||||
ND_VA_ARG_GET( Reply_Index_Id_Ptr, *Args_Ptr, NDT_Index_Id *);
|
||||
ND_VA_ARG_GET( Reply_Command_Ptr, *Args_Ptr, NDT_Command *);
|
||||
ND_VA_ARG_GET( Cmd, *Args_Ptr, NDT_Command);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
|
||||
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:
|
||||
{
|
||||
/*
|
||||
void **Value_Ptr_Ptr = (void **)va_arg( Args, void **);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr_Ptr, *Args_Ptr, void **);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -421,10 +462,14 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
|
||||
case NDD_CMD_VALUE_FREE:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -436,15 +481,18 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
|
||||
case NDD_CMD_VALUE_COMP:
|
||||
{
|
||||
/*
|
||||
void *Value1_Ptr = (void *)va_arg( Args, void *);
|
||||
void *Value2_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
*/
|
||||
ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
|
||||
ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
|
||||
|
||||
void *Value1_Ptr = (void *)va_arg( Args, void *);
|
||||
void *Value2_Ptr = (void *)va_arg( Args, 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);
|
||||
*/
|
||||
ND_VA_ARG_GET( Value1_Ptr, *Args_Ptr, void *);
|
||||
ND_VA_ARG_GET( Value2_Ptr, *Args_Ptr, void *);
|
||||
|
||||
|
||||
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:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -498,10 +550,14 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
|
||||
case NDD_CMD_VALUE_REMOVE:
|
||||
{
|
||||
/*
|
||||
void *Value_Ptr = (void *)va_arg( Args, void *);
|
||||
va_list user_args = (va_list)va_arg( Args, va_list);
|
||||
user_type user_data = (user_type)va_arg( user_args, user_type);
|
||||
... = (...)va_arg( user_args, ...);
|
||||
ND_VA_ARG_GET( Value_Ptr, *Args_Ptr, void *);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
*/
|
||||
|
||||
|
||||
@ -513,15 +569,22 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
|
||||
case NDD_CMD_VALUE_PRINT:
|
||||
{
|
||||
/*
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
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, ...);
|
||||
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;
|
||||
*/
|
||||
@ -535,25 +598,33 @@ NDT_Status ND_OpenStruct_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id,
|
||||
case NDD_CMD_INFO_PRINT:
|
||||
{
|
||||
/*
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
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, ...);
|
||||
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
|
||||
void *Value_Ptr = Node_Ptr->Value;
|
||||
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
|
||||
ND_VA_LIST_OPEN( user_args, lib_args);
|
||||
|
||||
ND_VA_ARG_GET( user_data, user_args, user_type);
|
||||
ND_VA_ARG_GET( ..., user_args, ...);
|
||||
|
||||
ND_VA_LIST_CLOSE( user_args);
|
||||
ND_VA_LIST_CLOSE( lib_args);
|
||||
*/
|
||||
ND_VA_ARG_GET( Next_Node_Ptr, *Args_Ptr, NDT_Node *);
|
||||
|
||||
NDT_Node *Next_Node_Ptr = (NDT_Node *)va_arg( Args, NDT_Node *);
|
||||
va_list lib_args = (va_list)va_arg( Args, va_list);
|
||||
FILE *Out = (FILE *)va_arg( lib_args, FILE *);
|
||||
NDT_Recursive_Mode Recursive_Mode = (NDT_Recursive_Mode)va_arg( lib_args, NDT_Recursive_Mode);
|
||||
NDT_Recursive_Depth Recursive_Depth = (NDT_Recursive_Depth)va_arg( lib_args, NDT_Recursive_Depth);
|
||||
NDT_Recursive_Offset Recursive_Offset = (NDT_Recursive_Offset)va_arg( lib_args, NDT_Recursive_Offset);
|
||||
ND_VA_LIST_OPEN( lib_args, *Args_Ptr);
|
||||
|
||||
ND_VA_ARG_GET( Out, lib_args, FILE *);
|
||||
ND_VA_ARG_GET( Recursive_Mode, lib_args, NDT_Recursive_Mode);
|
||||
ND_VA_ARG_GET( Recursive_Depth, lib_args, NDT_Recursive_Depth);
|
||||
ND_VA_ARG_GET( Recursive_Offset, lib_args, NDT_Recursive_Offset);
|
||||
|
||||
ND_VA_LIST_CLOSE( lib_args);
|
||||
|
||||
void *Value_Ptr = Node_Ptr->Value;
|
||||
|
||||
@ -1862,7 +1933,7 @@ NDT_Status ND_DataStruct_Reorg_C( NDT_Root *Root_Ptr)
|
||||
/* (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_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:
|
||||
{
|
||||
|
||||
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;
|
||||
|
||||
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:
|
||||
{
|
||||
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;
|
||||
|
||||
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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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)
|
||||
{
|
||||
@ -1939,7 +2010,7 @@ NDT_Status ND_Index_Traverse_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, N
|
||||
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:
|
||||
{
|
||||
|
||||
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);
|
||||
|
||||
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:
|
||||
{
|
||||
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);
|
||||
|
||||
break;
|
||||
@ -2045,7 +2116,7 @@ NDT_Status ND_Index_Traverse_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, ND
|
||||
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);
|
||||
|
||||
@ -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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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_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);
|
||||
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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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)
|
||||
{
|
||||
@ -2108,7 +2179,7 @@ NDT_Status ND_DataStruct_Traverse_VC( NDT_Root *Root_Ptr, NDT_Command Command
|
||||
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);
|
||||
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);
|
||||
|
||||
@ -2181,7 +2252,7 @@ NDT_Status ND_DataStruct_Traverse_C( NDT_Root *Root_Ptr, NDT_Command Command,
|
||||
return( NDS_ERRAPI);
|
||||
}
|
||||
|
||||
status = ND_DataStruct_Traverse_VI( Root_Ptr, Command, args);
|
||||
status = ND_DataStruct_Traverse_VI( Root_Ptr, Command, &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) 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;
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
@ -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);
|
||||
|
||||
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);
|
||||
|
||||
@ -2745,7 +2816,7 @@ NDT_Status ND_Index_Value_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Index_I
|
||||
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);
|
||||
|
||||
@ -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) 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;
|
||||
|
||||
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);
|
||||
}
|
||||
@ -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);
|
||||
|
||||
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);
|
||||
|
||||
@ -2839,7 +2910,7 @@ NDT_Status ND_DataStruct_Value_Print_C( FILE *Out, NDT_Root *Root_Ptr, NDT_Re
|
||||
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);
|
||||
|
||||
@ -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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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))
|
||||
{
|
||||
*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))
|
||||
{
|
||||
*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
|
||||
{
|
||||
@ -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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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;
|
||||
|
||||
@ -3364,7 +3435,7 @@ NDT_Status ND_Index_Node_Find_VC( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr
|
||||
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);
|
||||
@ -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))
|
||||
{
|
||||
*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))
|
||||
{
|
||||
*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
|
||||
{
|
||||
@ -3454,7 +3525,7 @@ NDT_Status ND_Index_Node_Find_C( NDT_Node **Node_Ptr_Ptr, NDT_Root *Root_Ptr,
|
||||
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);
|
||||
|
||||
@ -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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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_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);
|
||||
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( 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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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;
|
||||
|
||||
@ -3542,7 +3613,7 @@ NDT_Status ND_DataStruct_Value_Find_VC( void **Value_Ptr_Ptr, NDT_Root *Root_
|
||||
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);
|
||||
}
|
||||
@ -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);
|
||||
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( 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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@ -3717,7 +3788,7 @@ NDT_Status ND_Value_Alloc_I( NDT_Root *Root_Ptr, void **Value_Ptr_Ptr, ...)
|
||||
|
||||
/* 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);
|
||||
|
||||
@ -3764,7 +3835,7 @@ NDT_Status ND_Value_Alloc_C( NDT_Root *Root_Ptr, void **Value_Ptr_Ptr, ...)
|
||||
|
||||
/* 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);
|
||||
|
||||
@ -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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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_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);
|
||||
}
|
||||
@ -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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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;
|
||||
|
||||
@ -3902,7 +3973,7 @@ NDT_Status ND_Manager_Exec_VC( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
|
||||
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);
|
||||
}
|
||||
@ -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);
|
||||
|
||||
@ -3990,7 +4061,7 @@ NDT_Status ND_Manager_Exec_C( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_
|
||||
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);
|
||||
|
||||
@ -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 */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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_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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
@ -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 */
|
||||
|
||||
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;
|
||||
}
|
||||
@ -4669,14 +4740,14 @@ NDT_Node *ND_List_Node_Find( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, void
|
||||
|
||||
/*------------------------------ 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;
|
||||
|
||||
|
||||
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é */
|
||||
|
||||
@ -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 */
|
||||
|
||||
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);
|
||||
}
|
||||
@ -4695,9 +4766,9 @@ NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *Node_Ptr, void *Value_Ptr, v
|
||||
|
||||
/*-------------------------------- 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));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $RCSfile: libnode.h,v $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* $Revision: 2.9 $ */
|
||||
/* $Revision: 2.10 $ */
|
||||
/* $Name: $ */
|
||||
/* $Date: 2005/01/19 23:59:42 $ */
|
||||
/* $Date: 2010/06/06 21:26:31 $ */
|
||||
/* $Author: agibert $ */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
||||
@ -127,14 +127,14 @@ NDT_Base NDG_Base =
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* (I) va_list Arguments : Liste d'arguments contextuels */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Status ND_Default_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDT_Status ND_Default_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* OpenStruct Manager */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* (I) va_list Arguments : Liste d'arguments contextuels */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Status ND_OpenStruct_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list);
|
||||
NDT_Status ND_OpenStruct_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Redéfinition de la fonction malloc() avec retour de type NDT_Status */
|
||||
@ -233,12 +233,12 @@ NDT_Status ND_List_Make( NDT_Root *, NDT_Index_Id);
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Recherche une valeur dans une liste et retourne le noeud correspondant */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list);
|
||||
NDT_Node *ND_List_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Recherche un noeud dans un arbre et retourne le pointeur sur le noeud */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list);
|
||||
NDT_Node *ND_Tree_Node_Find( NDT_Root *, NDT_Index_Id, void *, va_list *);
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* Conversion d'une structure en arbre binaire */
|
||||
@ -328,7 +328,7 @@ NDT_Node *ND_Tree_Node_First_Recursive_Get( NDT_Node *);
|
||||
|
||||
NDT_Node *ND_Tree_Node_Last_Recursive_Get( NDT_Node *);
|
||||
|
||||
NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *, void *, va_list);
|
||||
NDT_Node *ND_Tree_Node_Recursive_Find( NDT_Node *, void *, va_list *);
|
||||
|
||||
NDT_Node *ND_Tree_Parent_Next_Recursive_Get( NDT_Node *);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user