diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 525aa5b..607e1d5 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -5,7 +5,8 @@ LibShMem V 3.0.0 - A. GIBERT - 2024/05/xx - All: - Working on new API... - LibShMem: - - Add LibNode 3 API support. + - Add LibNode 3 API support, + - Add LibLog 1.1 API support. diff --git a/lib/libshmem.c b/lib/libshmem.c index fad6a3b..8a0bc51 100644 --- a/lib/libshmem.c +++ b/lib/libshmem.c @@ -101,7 +101,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O if( SM_Open_Counter > 0) { - LG_LOG_ERROR_1( "SM_Library_Open : the current process has already opened an instance: (%d) of the LIBSHMEM base", SM_Instance); + LG_LOG_ERROR( "SM_Library_Open : the current process has already opened an instance: (%d) of the LIBSHMEM base", SM_Instance); return( SMS_ERRAPI); } @@ -111,7 +111,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O rc = ND_Library_Open( ND_Debug); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "SM_Library_Open : unable to open the LIBNODE library"); + LG_LOG_ERROR( "SM_Library_Open : unable to open the LIBNODE library"); return( rc); } @@ -121,7 +121,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O rc = ND_DataStruct_Open( &Opened_Heap_List, "SM Opened Heap", ND_OPEN_FLAG_CREATE, 1, &index_type, "SM_Opened_Heap_List_Manager", NULL, NULL, TRUE, NULL); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "SM_Library_Open : unable to create the local opened heap cache"); + LG_LOG_ERROR( "SM_Library_Open : unable to create the local opened heap cache"); goto Error1; } @@ -133,7 +133,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O rc = SM_Base_Init(); if( rc != SMS_OK ) { - LG_LOG_ERROR_0( "SM_Library_Open : unable to initialize the shared memory base"); + LG_LOG_ERROR( "SM_Library_Open : unable to initialize the shared memory base"); goto Error2; } @@ -144,7 +144,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O if( SM_Open_Counter > 0 && To_Open_Instance != SM_Instance) { - LG_LOG_ERROR_2( "SM_Library_Open : the current process cannot open instance: (%d) because it is already accessing instance: (%d)", To_Open_Instance, SM_Instance); + LG_LOG_ERROR( "SM_Library_Open : the current process cannot open instance: (%d) because it is already accessing instance: (%d)", To_Open_Instance, SM_Instance); return( SMS_ERRAPI); } @@ -160,7 +160,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O rc = ND_Library_Open( ND_Debug); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to open the LIBNODE library"); + LG_LOG_ERROR( "Unable to open the LIBNODE library"); return( rc); } @@ -170,7 +170,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O rc = ND_DataStruct_Open( &Opened_Heap_List, "SM Opened Heap", ND_OPEN_FLAG_CREATE, 1, &index_type, "SM_Opened_Heap_List_Manager", NULL, NULL, TRUE, NULL); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "Unable to create the local opened heap cache"); + LG_LOG_ERROR( "Unable to create the local opened heap cache"); goto Error1; } @@ -180,7 +180,7 @@ SMT_Status SM_Library_Open_I( int Instance, const char *Context, SMT_Flags O rc = SM_Base_Open(); if( rc != SMS_OK ) { - LG_LOG_ERROR_0( "Unable to open the shared memory base"); + LG_LOG_ERROR( "Unable to open the shared memory base"); goto Error2; } @@ -296,7 +296,7 @@ SMT_Status SM_Library_Close_I( SMT_Flags Close_Mode) rc = SM_Base_End(); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to destroy the shared memory base"); + LG_LOG_ERROR( "Unable to destroy the shared memory base"); return( rc); } @@ -333,7 +333,7 @@ SMT_Status SM_Library_Close_I( SMT_Flags Close_Mode) rc = SM_Base_Close(); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to close the shared memory base"); + LG_LOG_ERROR( "Unable to close the shared memory base"); return( rc); } @@ -383,17 +383,17 @@ SMT_Status SM_Library_Dump_I( FILE *Out) SM_Instance, SM_Context, SM_Base->Size, SM_Base->Creator, SM_Base->Writer, SM_Base->SysMemId, SM_Base->DataMemId, SM_Base->SemId, SM_Lock_Status_Get( "base", SM_Base)); */ - LG_LOG_INFO_5( "Base: (%d):[%s]\tSize: (%d)\tCreator PId: (%ld)\tLast write access PId: (%ld)", + LG_LOG_INFO( "Base: (%d):[%s]\tSize: (%d)\tCreator PId: (%ld)\tLast write access PId: (%ld)", SM_Instance, SM_Context, SM_Base->Size, SM_Base->Creator, SM_Base->Writer); - LG_LOG_INFO_4( "Id Mem: (%d):(%d)\tId Sem: (%d)\tStatus: [%s]", + LG_LOG_INFO( "Id Mem: (%d):(%d)\tId Sem: (%d)\tStatus: [%s]", SM_Base->SysMemId, SM_Base->DataMemId, SM_Base->SemId, SM_Lock_Status_Get( "base", SM_Base)); - LG_LOG_INFO_0( ""); + LG_LOG_INFO( ""); /* Affichage des informations du MHR */ ND_DataStruct_Info_Print( Out, SM_Base->MHR, NDD_RECURSIVE_MODE_PARENT_CHILD, 0, 0); // fprintf( Out, "\n"); - LG_LOG_INFO_0( ""); + LG_LOG_INFO( ""); /* Affichage des informations de chaque heap */ @@ -420,7 +420,7 @@ SMT_Status SM_Library_Unlock_I( void) if( semctl( SM_Base->SemId, 0, SETVAL, Sem_Ctl)) { - LG_LOG_ERROR_0( "Unable to unlock the shared memory base"); + LG_LOG_ERROR( "Unable to unlock the shared memory base"); return( SMS_ERRSEM); } @@ -437,7 +437,7 @@ SMT_Status SM_Library_Unlock_I( void) if( semctl( MHH->SemId, 0, SETVAL, Sem_Ctl)) { - LG_LOG_ERROR_1( "Unable to unlock heap: [%s]", MHH->Name); + LG_LOG_ERROR( "Unable to unlock heap: [%s]", MHH->Name); return( SMS_ERRSEM); } @@ -563,7 +563,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si rc = SM_Heap_Lock_I( *Heap_Ptr_Ptr, SMD_LOCK_MSK( Open_Mode), Locked); if( rc != SMS_OK) { - LG_LOG_ERROR_2( "Unable to lock heap: [%s] for: [%s]", Heap_Name, Open_Mode & SMD_READ ? "reading" : "writing"); + LG_LOG_ERROR( "Unable to lock heap: [%s] for: [%s]", Heap_Name, Open_Mode & SMD_READ ? "reading" : "writing"); return( rc); } @@ -572,7 +572,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si } else { - LG_LOG_ERROR_0( "The heap already exists but (Flags & SMD_OPEN) is false"); + LG_LOG_ERROR( "The heap already exists but (Flags & SMD_OPEN) is false"); return( SMS_ERRAPI); } @@ -601,7 +601,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si *Heap_Ptr_Ptr = (SMT_Heap *) malloc( sizeof( SMT_Heap)); if( !*Heap_Ptr_Ptr) { - LG_LOG_ERROR_1( "Unable to allocate memory for the opened heap: [%s]", prefixed_name); + LG_LOG_ERROR( "Unable to allocate memory for the opened heap: [%s]", prefixed_name); return( SMS_ERRMEM); } @@ -620,7 +620,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to open one of the data segments of heap: [%s]", prefixed_name); + LG_LOG_ERROR( "Unable to open one of the data segments of heap: [%s]", prefixed_name); goto Error1; } @@ -636,7 +636,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si if( rc != SMS_OK) { - LG_LOG_ERROR_2( "Unable to lock heap: [%s] for: [%s]", prefixed_name, Open_Mode & SMD_READ ? "reading" : "writing"); + LG_LOG_ERROR( "Unable to lock heap: [%s] for: [%s]", prefixed_name, Open_Mode & SMD_READ ? "reading" : "writing"); goto Error1; } @@ -647,7 +647,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to add heap: [%s] to the opened heap cache", prefixed_name); + LG_LOG_ERROR( "Unable to add heap: [%s] to the opened heap cache", prefixed_name); goto Error2; } @@ -656,7 +656,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si } else { - LG_LOG_ERROR_0( "The heap already exists but (Open_Mode & SMD_OPEN) is false"); + LG_LOG_ERROR( "The heap already exists but (Open_Mode & SMD_OPEN) is false"); return( SMS_ERRAPI); } @@ -665,7 +665,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si if( !( Open_Mode & SMD_CREATE)) { - LG_LOG_ERROR_1( "The heap: [%s] does no exist and (Open_Mode & SMD_CREATE) is false", prefixed_name); + LG_LOG_ERROR( "The heap: [%s] does no exist and (Open_Mode & SMD_CREATE) is false", prefixed_name); return( SMS_ERRAPI); } @@ -675,7 +675,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si rc = ND_Value_Alloc( (void **)&MHH, SM_Base->MHR, prefixed_name, Seg_Size); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "Unable to alloc a new MHH structure"); + LG_LOG_ERROR( "Unable to alloc a new MHH structure"); return(SMS_ERRAPI); } @@ -685,7 +685,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si rc = ND_DataStruct_Value_Add( SM_Base->MHR, MHH); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "Unable to add the new heap to the MHR structure"); + LG_LOG_ERROR( "Unable to add the new heap to the MHR structure"); goto Error9; } @@ -695,7 +695,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si rc = SM_Heap_Lock_Set( MHH, SMD_LOCK_MSK( Open_Mode)); if( rc != SMS_OK) { - LG_LOG_ERROR_2( "Unable to lock heap: [%s] for: [%s]", prefixed_name, Open_Mode & SMD_READ ? "reading" : "writing"); + LG_LOG_ERROR( "Unable to lock heap: [%s] for: [%s]", prefixed_name, Open_Mode & SMD_READ ? "reading" : "writing"); goto Error10; } @@ -707,7 +707,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si *Heap_Ptr_Ptr = (SMT_Heap *)malloc( sizeof( SMT_Heap)); if( !*Heap_Ptr_Ptr) { - LG_LOG_ERROR_1( "Unable to allocate memory for a new opened heap: [%s]", prefixed_name); + LG_LOG_ERROR( "Unable to allocate memory for a new opened heap: [%s]", prefixed_name); rc = SMS_ERRMEM; @@ -722,7 +722,7 @@ SMT_Status SM_Heap_Open_I( const char *Heap_Name, SMT_Heap **Heap_Ptr_Ptr, si rc = ND_DataStruct_Value_Add( Opened_Heap_List, *Heap_Ptr_Ptr); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to add heap: [%s] to the opened heap cache", prefixed_name); + LG_LOG_ERROR( "Unable to add heap: [%s] to the opened heap cache", prefixed_name); goto Error11; } @@ -847,7 +847,7 @@ SMT_Status SM_Heap_End_I( const char *Heap_Name ) if( SM_ERROR(rc)) return rc; if( rc == SMS_NO) { - LG_LOG_ERROR_1( "SM_Heap_End: heap: [%s] does not exist", Heap_Name); + LG_LOG_ERROR( "SM_Heap_End: heap: [%s] does not exist", Heap_Name); return SMS_KO; } @@ -867,7 +867,7 @@ SMT_Status SM_Heap_End_I( const char *Heap_Name ) rc = SM_Heap_Open_I( Heap_Name, &Heap, 0, SMD_OPEN | SMD_WRITE, &Locked); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to open the heap to remove for writing"); + LG_LOG_ERROR( "Unable to open the heap to remove for writing"); return( rc); } @@ -878,7 +878,7 @@ SMT_Status SM_Heap_End_I( const char *Heap_Name ) rc = ND_DataStruct_Value_Remove( SM_Base->MHR, Heap->MHH); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to remove heap: [%s] from the MHR structure", Heap_Name); + LG_LOG_ERROR( "Unable to remove heap: [%s] from the MHR structure", Heap_Name); return( rc); } @@ -886,7 +886,7 @@ SMT_Status SM_Heap_End_I( const char *Heap_Name ) rc = ND_Value_Free( SM_Base->MHR, Heap->MHH); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "SM_Heap_End: unable to free heap: [%s]", Heap_Name); + LG_LOG_ERROR( "SM_Heap_End: unable to free heap: [%s]", Heap_Name); return( rc); @@ -962,7 +962,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) fprintf( stderr, "SM_Heap_Lock: heap [%s] already locked in mode: (%d)!\n", Heap->Name, Lock_Mode); fflush( stderr); */ - LG_LOG_WARNING_2( "Heap: [%s] already locked in mode: (%d)", Heap->Name, Lock_Mode); + LG_LOG_WARNING( "Heap: [%s] already locked in mode: (%d)", Heap->Name, Lock_Mode); // LG_STACK_TRACE( LGD_LOG_LEVEL_DEFAULT); *Locked = FALSE; @@ -980,7 +980,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) if( Heap->MHH->State == SMD_STATE_CORRUPTED) { - LG_LOG_ERROR_1( "Heap: [%s] is flagged as being corrupted", Heap->Name); + LG_LOG_ERROR( "Heap: [%s] is flagged as being corrupted", Heap->Name); return( SMS_KO); } @@ -990,7 +990,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) rc = SM_Heap_Lock_Set( Heap->MHH, Lock_Mode); if( rc != SMS_OK) { - LG_LOG_ERROR_2( "Unable to lock heap [%s] for: [%s]", Heap->Name, Lock_Mode & SMD_READ ? "reading" : "writing"); + LG_LOG_ERROR( "Unable to lock heap [%s] for: [%s]", Heap->Name, Lock_Mode & SMD_READ ? "reading" : "writing"); return rc; } @@ -1006,7 +1006,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) rc = SM_Heap_Lock_Change( Heap->MHH, SMD_WRITE); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to lock heap: [%s] for writing before checking", Heap->Name); + LG_LOG_ERROR( "Unable to lock heap: [%s] for writing before checking", Heap->Name); SM_Heap_Unlock_I( Heap); return rc; @@ -1019,7 +1019,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) rc = SM_Heap_Check_I( Heap, &Nb_Detected, &Nb_Corrected, SM_stderr); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to check heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to check heap: [%s]", Heap->Name); SM_Heap_Unlock_I( Heap); return rc; @@ -1032,7 +1032,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) rc = SM_Heap_Lock_Change( Heap->MHH, SMD_READ); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to lock heap: [%s] for reading", Heap->Name); + LG_LOG_ERROR( "Unable to lock heap: [%s] for reading", Heap->Name); SM_Heap_Unlock_I( Heap); return rc; @@ -1049,7 +1049,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) if( SM_Heap_IsOpen_I( "system", &heap_ptr) != SMS_OK) { - LG_LOG_ERROR_0( "Internal Error 1 !"); + LG_LOG_ERROR( "Internal Error 1 !"); } else { @@ -1059,7 +1059,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) if( node_ptr == NULL) { - LG_LOG_ERROR_0( "Internal Error 2 !"); + LG_LOG_ERROR( "Internal Error 2 !"); } else { @@ -1067,12 +1067,12 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) { if( ( rc = SM_DataSegment_Open( node_ptr->Value)) != SMS_OK) { - LG_LOG_ERROR_1( "Unable to open one of the data segments of heap: [%s]", + LG_LOG_ERROR( "Unable to open one of the data segments of heap: [%s]", ( (SMT_MHH *)(node_ptr->Value))->Name); } else { -// LG_LOG_ERROR_1( "SM_Heap_Lock : Opening Segment (%x)", node_ptr->Value); +// LG_LOG_ERROR( "SM_Heap_Lock : Opening Segment (%x)", node_ptr->Value); // } @@ -1097,7 +1097,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) rc = SM_DataSegment_Open (Node->Value); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to open one of the data segments of heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to open one of the data segments of heap: [%s]", Heap->Name); SM_Heap_Unlock_I( Heap); return rc; @@ -1119,7 +1119,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) rc = SM_Heap_Lock_Change( Heap->MHH, Lock_Mode); if( rc != SMS_OK) { - LG_LOG_ERROR_2( "Unable to change lock of heap: [%s] for [%s]", Heap->Name, Lock_Mode & SMD_READ ? "reading" : "writing"); + LG_LOG_ERROR( "Unable to change lock of heap: [%s] for [%s]", Heap->Name, Lock_Mode & SMD_READ ? "reading" : "writing"); return rc; } @@ -1128,7 +1128,7 @@ SMT_Status SM_Heap_Lock_I( SMT_Heap *Heap, SMT_Flags Lock_Mode, int *Locked ) *Locked = TRUE; } - LG_LOG_TRACE_2( LGD_LOG_LEVEL_DEFAULT, "Locked: heap: [%s] lock_mode: (%d)", Heap->Name, Heap->Lock_Mode); + LG_LOG_TRACE( LGD_LOG_LEVEL_DEFAULT, "Locked: heap: [%s] lock_mode: (%d)", Heap->Name, Heap->Lock_Mode); return( SMS_OK); } @@ -1151,7 +1151,7 @@ SMT_Status SM_Heap_Unlock_I( SMT_Heap *Heap) rc = SM_Heap_Lock_Release( Heap->MHH, Heap->Lock_Mode); if( rc != SMS_OK) { - LG_LOG_ERROR_2( "Unable to unlock heap: [%s] for: [%s]", + LG_LOG_ERROR( "Unable to unlock heap: [%s] for: [%s]", Heap->Name, Heap->Lock_Mode & SMD_READ ? "reading" : "writing"); @@ -1160,7 +1160,7 @@ SMT_Status SM_Heap_Unlock_I( SMT_Heap *Heap) Heap->Lock_Mode = SMD_NO_LOCK; - LG_LOG_TRACE_2( LGD_LOG_LEVEL_DEFAULT, "Unlocked: heap: [%s] lock_mode: (%d)", Heap->Name, Heap->Lock_Mode); + LG_LOG_TRACE( LGD_LOG_LEVEL_DEFAULT, "Unlocked: heap: [%s] lock_mode: (%d)", Heap->Name, Heap->Lock_Mode); return( SMS_OK); } @@ -1216,7 +1216,7 @@ SMT_Status SM_Heap_Config_I( SMT_Heap *Heap, SMT_Config Tag, ... ) if( Current_Size > Size) { - LG_LOG_ERROR_1( "The heap has already exceeded the limit size: (%d) bytes", Current_Size); + LG_LOG_ERROR( "The heap has already exceeded the limit size: (%d) bytes", Current_Size); va_end( Arguments); return SMS_ERRAPI; @@ -1230,7 +1230,7 @@ SMT_Status SM_Heap_Config_I( SMT_Heap *Heap, SMT_Config Tag, ... ) default: { - LG_LOG_ERROR_1( "Unknown config tag: (%d)", Tag); + LG_LOG_ERROR( "Unknown config tag: (%d)", Tag); va_end( Arguments); @@ -1304,16 +1304,16 @@ SMT_Status SM_Heap_Check_I( SMT_Heap *Heap, int *Nb_Detected, int *Nb_Correct NDT_Node * Node; - LG_LOG_INFO_1( "Checking heap: [%s]", Heap->Name); + LG_LOG_INFO( "Checking heap: [%s]", Heap->Name); if( Heap->MHH->DSR->Index_Tab[NDD_INDEX_PRIMARY].Node_Number == 0) { - LG_LOG_ERROR_1( "Unable to check heap: [%s] which has no data segment", Heap->Name); + LG_LOG_ERROR( "Unable to check heap: [%s] which has no data segment", Heap->Name); ( *Nb_Detected) ++; - LG_LOG_INFO_2( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted", *Nb_Detected - *Nb_Corrected, Heap->Name); - LG_LOG_INFO_0( "Please contact an administrator about it"); + LG_LOG_INFO( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted", *Nb_Detected - *Nb_Corrected, Heap->Name); + LG_LOG_INFO( "Please contact an administrator about it"); Heap->MHH->State = SMD_STATE_CORRUPTED; @@ -1323,15 +1323,15 @@ SMT_Status SM_Heap_Check_I( SMT_Heap *Heap, int *Nb_Detected, int *Nb_Correct { /* Vérification de la structure DSR du heap */ - LG_LOG_INFO_0( "Checking the DSR node structure"); + LG_LOG_INFO( "Checking the DSR node structure"); rc = ND_DataStruct_Check (Heap->MHH->DSR, Nb_Detected, Nb_Corrected, Out); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "Unable to check the DSR structure"); + LG_LOG_ERROR( "Unable to check the DSR structure"); - LG_LOG_INFO_2( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted", *Nb_Detected - *Nb_Corrected, Heap->Name); - LG_LOG_INFO_0( "Please contact an administrator about it"); + LG_LOG_INFO( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted", *Nb_Detected - *Nb_Corrected, Heap->Name); + LG_LOG_INFO( "Please contact an administrator about it"); Heap->MHH->State = SMD_STATE_CORRUPTED; @@ -1339,7 +1339,7 @@ SMT_Status SM_Heap_Check_I( SMT_Heap *Heap, int *Nb_Detected, int *Nb_Correct } } - LG_LOG_INFO_0( "Trying to open every data segment of the heap"); + LG_LOG_INFO( "Trying to open every data segment of the heap"); /* Ouverture des segments du heap au cas ça n'aurait pas été fait */ @@ -1350,13 +1350,13 @@ SMT_Status SM_Heap_Check_I( SMT_Heap *Heap, int *Nb_Detected, int *Nb_Correct rc = SM_DataSegment_Open (Node->Value); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to open one of the data segments of heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to open one of the data segments of heap: [%s]", Heap->Name); ( *Nb_Detected) ++; - LG_LOG_INFO_2( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted.", + LG_LOG_INFO( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted.", *Nb_Detected - *Nb_Corrected, Heap->Name); - LG_LOG_INFO_0( "Please contact an administrator about it"); + LG_LOG_INFO( "Please contact an administrator about it"); Heap->MHH->State = SMD_STATE_CORRUPTED; @@ -1369,16 +1369,16 @@ SMT_Status SM_Heap_Check_I( SMT_Heap *Heap, int *Nb_Detected, int *Nb_Correct /* Vérification de la structure ACR du heap */ - LG_LOG_INFO_0( "Checking the ACR node structure"); + LG_LOG_INFO( "Checking the ACR node structure"); rc = ND_DataStruct_Check (Heap->MHH->ACR, Nb_Detected, Nb_Corrected, Out); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "SM_Heap_Check : unable to check the ACR node structure"); + LG_LOG_ERROR( "SM_Heap_Check : unable to check the ACR node structure"); - LG_LOG_INFO_2( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted.", + LG_LOG_INFO( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted.", *Nb_Detected - *Nb_Corrected, Heap->Name); - LG_LOG_INFO_0( "Please contact an administrator about it"); + LG_LOG_INFO( "Please contact an administrator about it"); Heap->MHH->State = SMD_STATE_CORRUPTED; @@ -1387,16 +1387,16 @@ SMT_Status SM_Heap_Check_I( SMT_Heap *Heap, int *Nb_Detected, int *Nb_Correct /* Vérification de la structure FCR du heap */ - LG_LOG_INFO_0( "Checking the FCR node structure"); + LG_LOG_INFO( "Checking the FCR node structure"); rc = ND_DataStruct_Check (Heap->MHH->FCR, Nb_Detected, Nb_Corrected, Out); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to check the ACR node structure"); + LG_LOG_ERROR( "Unable to check the ACR node structure"); - LG_LOG_INFO_2( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted", *Nb_Detected - *Nb_Corrected, Heap->Name); - LG_LOG_INFO_0( "Please contact an administrator about it"); + LG_LOG_INFO( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted", *Nb_Detected - *Nb_Corrected, Heap->Name); + LG_LOG_INFO( "Please contact an administrator about it"); Heap->MHH->State = SMD_STATE_CORRUPTED; @@ -1409,9 +1409,9 @@ SMT_Status SM_Heap_Check_I( SMT_Heap *Heap, int *Nb_Detected, int *Nb_Correct { /* On déclare le heap corrompu afin que plus personne n'y accède */ - LG_LOG_INFO_2( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted", + LG_LOG_INFO( "(%d) error(s) could not be corrected in heap: [%s] which will be declared as corrupted", *Nb_Detected - *Nb_Corrected, Heap->Name); - LG_LOG_INFO_0( "Please contact an administrator about it"); + LG_LOG_INFO( "Please contact an administrator about it"); Heap->MHH->State = SMD_STATE_CORRUPTED; @@ -1422,11 +1422,11 @@ SMT_Status SM_Heap_Check_I( SMT_Heap *Heap, int *Nb_Detected, int *Nb_Correct if( *Nb_Detected == 0) { - LG_LOG_INFO_1( "No error detected on heap: [%s] which will be declared as a valid heap", Heap->Name); + LG_LOG_INFO( "No error detected on heap: [%s] which will be declared as a valid heap", Heap->Name); } else { - LG_LOG_WARNING_2( "Every (%d) error(s) have beeen corrected on heap: [%s] which will be declared as a valid heap", *Nb_Corrected, Heap->Name); + LG_LOG_WARNING( "Every (%d) error(s) have beeen corrected on heap: [%s] which will be declared as a valid heap", *Nb_Corrected, Heap->Name); } Heap->MHH->State = SMD_STATE_VALID; @@ -1516,7 +1516,7 @@ SMT_Status SM_Chunk_Alloc_I( SMT_Heap *Heap, size_t Alloc_Size, void **Ptr ) rc = ND_Value_Alloc( (void**)&DSH, Heap->MHH->DSR, Heap->MHH, Seg_Size); if( rc != NDS_OK ) { - LG_LOG_ERROR_1( "Unable to create a new data segment for heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to create a new data segment for heap: [%s]", Heap->Name); return SMS_ERRSHM; } @@ -1524,7 +1524,7 @@ SMT_Status SM_Chunk_Alloc_I( SMT_Heap *Heap, size_t Alloc_Size, void **Ptr ) rc = ND_DataStruct_Value_Add (Heap->MHH->DSR, DSH); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to add a data segment to the DSR structure of heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to add a data segment to the DSR structure of heap: [%s]", Heap->Name); ND_Value_Free(Heap->MHH->DSR, DSH); @@ -1545,7 +1545,7 @@ SMT_Status SM_Chunk_Alloc_I( SMT_Heap *Heap, size_t Alloc_Size, void **Ptr ) rc = ND_Index_Node_Remove( Node); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to remove a chunk from the FCR structure of heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to remove a chunk from the FCR structure of heap: [%s]", Heap->Name); return rc; } @@ -1555,7 +1555,7 @@ SMT_Status SM_Chunk_Alloc_I( SMT_Heap *Heap, size_t Alloc_Size, void **Ptr ) rc = ND_Index_Node_Add( Heap->MHH->ACR, NDD_INDEX_PRIMARY, Node); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to add a chunk to the ACR structure of heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to add a chunk to the ACR structure of heap: [%s]", Heap->Name); /* On tente de revenir en arrière */ @@ -1606,7 +1606,7 @@ SMT_Status SM_Chunk_Alloc_I( SMT_Heap *Heap, size_t Alloc_Size, void **Ptr ) rc = ND_Index_Node_Add( Heap->MHH->FCR, NDD_INDEX_PRIMARY, New_Node); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to add a chunk to the FCR structure of heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to add a chunk to the FCR structure of heap: [%s]", Heap->Name); return rc; } @@ -1691,7 +1691,7 @@ SMT_Status SM_Chunk_Alloc_I( SMT_Heap *Heap, size_t Alloc_Size, void **Ptr ) rc = ND_Value_Alloc( (void**)&DSH, Heap->MHH->DSR, Heap->MHH, Heap->MHH->Segment_Size); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "Unable to create un new data segment for the system heap (anticipation)"); + LG_LOG_ERROR( "Unable to create un new data segment for the system heap (anticipation)"); return SMS_ERRSHM; @@ -1704,7 +1704,7 @@ SMT_Status SM_Chunk_Alloc_I( SMT_Heap *Heap, size_t Alloc_Size, void **Ptr ) rc = ND_Index_Node_Add( Heap->MHH->DSR, NDD_INDEX_PRIMARY, New_Node); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "Unable to add a data segment to the DSR structure of the system heap (anticipation)"); + LG_LOG_ERROR( "Unable to add a data segment to the DSR structure of the system heap (anticipation)"); ND_Value_Free( Heap->MHH->DSR, DSH); return rc; @@ -1765,7 +1765,7 @@ SMT_Status SM_Chunk_Free_I( SMT_Heap *Heap, void *Ptr) rc = ND_Index_Node_Remove( Node); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to remove the allocated chunk from the ACR structure of heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to remove the allocated chunk from the ACR structure of heap: [%s]", Heap->Name); return rc; } @@ -1775,7 +1775,7 @@ SMT_Status SM_Chunk_Free_I( SMT_Heap *Heap, void *Ptr) rc = ND_Index_Node_Add( Heap->MHH->FCR, NDD_INDEX_PRIMARY, Node); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to add the free chunk to the FCR structure of heap: [%s]", Heap->Name); + LG_LOG_ERROR( "Unable to add the free chunk to the FCR structure of heap: [%s]", Heap->Name); /* Retour arrière */ @@ -1801,7 +1801,7 @@ SMT_Status SM_Chunk_Free_I( SMT_Heap *Heap, void *Ptr) rc = SM_Heap_Compress (Heap, &Compress_Size); if( rc != SMS_OK) { - LG_LOG_ERROR_2( "Unable to compress FCR structure of heap: [%s] which contains: (%ld) free chunks", Heap->Name, Heap->MHH->FCR->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); + LG_LOG_ERROR( "Unable to compress FCR structure of heap: [%s] which contains: (%ld) free chunks", Heap->Name, Heap->MHH->FCR->Index_Tab[NDD_INDEX_PRIMARY].Node_Number); return rc; } @@ -2117,7 +2117,7 @@ SMT_Status SM_Heap_Config_C( SMT_Heap *Heap_Ptr, SMT_Config Tag, ... ) if( Current_Size > Limit_Size) { - LG_LOG_ERROR_1( "The heap has already exceeded the limit size: (%d) bytes", Current_Size); + LG_LOG_ERROR( "The heap has already exceeded the limit size: (%d) bytes", Current_Size); va_end( Arguments); return SMS_ERRAPI; @@ -2131,7 +2131,7 @@ SMT_Status SM_Heap_Config_C( SMT_Heap *Heap_Ptr, SMT_Config Tag, ... ) default: { - LG_LOG_ERROR_1( "Unknown config tag: (%d)", Tag); + LG_LOG_ERROR( "Unknown config tag: (%d)", Tag); va_end( Arguments); return SMS_ERRAPI; @@ -2161,7 +2161,7 @@ SMT_Status SM_Heap_Compress_C( SMT_Heap *Heap_Ptr, size_t *Compress) if( !Compress) { - LG_LOG_ERROR_0( "The compress size pointer is null"); + LG_LOG_ERROR( "The compress size pointer is null"); return SMS_ERRAPI; } @@ -2189,14 +2189,14 @@ SMT_Status SM_Heap_Check_C( SMT_Heap *Heap_Ptr, int *Nb_Detected, int *Nb_Cor if( !Nb_Detected || !Nb_Corrected) { - LG_LOG_ERROR_0( "The error number pointer is null"); + LG_LOG_ERROR( "The error number pointer is null"); return SMS_ERRAPI; } if( !Out) { - LG_LOG_ERROR_0( "The out stream is null"); + LG_LOG_ERROR( "The out stream is null"); return SMS_ERRAPI; } @@ -2223,7 +2223,7 @@ SMT_Status SM_Chunk_Alloc_C( SMT_Heap *Heap_Ptr, size_t Alloc_Size, void **Pt if( !Ptr) { - LG_LOG_ERROR_0( "The chunk address is null"); + LG_LOG_ERROR( "The chunk address is null"); return SMS_ERRAPI; } @@ -2249,7 +2249,7 @@ SMT_Status SM_Chunk_Free_C( SMT_Heap *Heap_Ptr, void *Ptr) if( !Ptr) { - LG_LOG_ERROR_0( "The chunk pointer is null"); + LG_LOG_ERROR( "The chunk pointer is null"); return SMS_ERRAPI; } @@ -2353,7 +2353,7 @@ SMT_Status SM_Base_Init ( void ) { case ENOMEM: { - LG_LOG_ERROR_0( "The amount of memory is not sufficient to create a new semaphore"); + LG_LOG_ERROR( "The amount of memory is not sufficient to create a new semaphore"); break; } @@ -2364,7 +2364,7 @@ SMT_Status SM_Base_Init ( void ) default: { - LG_LOG_ERROR_1( "Unknown error: (%d) while creating a semaphore", errno); + LG_LOG_ERROR( "Unknown error: (%d) while creating a semaphore", errno); break; } } @@ -2378,7 +2378,7 @@ SMT_Status SM_Base_Init ( void ) if( semctl( SemId, 0, SETVAL, Sem_Ctl )) { - LG_LOG_ERROR_1( "Unable to initialize the value of semaphore: (%d)", SemId); + LG_LOG_ERROR( "Unable to initialize the value of semaphore: (%d)", SemId); rc = SMS_ERRSEM; goto Error1; @@ -2397,31 +2397,31 @@ SMT_Status SM_Base_Init ( void ) { case EEXIST: { - LG_LOG_ERROR_1( "The shared memory segment identifier: (%d) already exists", SM_Instance); + LG_LOG_ERROR( "The shared memory segment identifier: (%d) already exists", SM_Instance); break; } case EINVAL: { - LG_LOG_ERROR_1( "The size of the shared memory segment: (%d) is out of the system-imposed bounds", sizeof( SMT_Base)); + LG_LOG_ERROR( "The size of the shared memory segment: (%d) is out of the system-imposed bounds", sizeof( SMT_Base)); break; } case ENOMEM: { - LG_LOG_ERROR_0( "The amount of memory is not sufficient to create the shared memory segment"); + LG_LOG_ERROR( "The amount of memory is not sufficient to create the shared memory segment"); break; } case ENOSPC: { - LG_LOG_ERROR_0( "The number of shared memory segments exceeds the system-imposed limit"); + LG_LOG_ERROR( "The number of shared memory segments exceeds the system-imposed limit"); break; } default: { - LG_LOG_ERROR_1( "Unknown error: (%d) while creating the shared memory segment", errno); + LG_LOG_ERROR( "Unknown error: (%d) while creating the shared memory segment", errno); break; } } @@ -2437,7 +2437,7 @@ SMT_Status SM_Base_Init ( void ) SM_Base = shmat( SysMemId, 0, 0); if( errno) { - LG_LOG_ERROR_1( "Unable to attach the first shared memory segment to the current process, error: (%d)", errno); + LG_LOG_ERROR( "Unable to attach the first shared memory segment to the current process, error: (%d)", errno); rc = SMS_ERRSHM; goto Error2; @@ -2472,19 +2472,19 @@ SMT_Status SM_Base_Init ( void ) switch( errno) { case EINVAL: - LG_LOG_ERROR_1( "The size of the shared memory segment: (%d) is out of the system-imposed bounds", Size); + LG_LOG_ERROR( "The size of the shared memory segment: (%d) is out of the system-imposed bounds", Size); break; case ENOMEM: - LG_LOG_ERROR_0( "The amount of memory is not sufficient to create the shared memory segment"); + LG_LOG_ERROR( "The amount of memory is not sufficient to create the shared memory segment"); break; case ENOSPC: - LG_LOG_ERROR_0( "The number of shared memory segments exceeds the system-imposed limit"); + LG_LOG_ERROR( "The number of shared memory segments exceeds the system-imposed limit"); break; default : - LG_LOG_ERROR_1( "Unknown error: (%d) while creating a shared memory segment", errno); + LG_LOG_ERROR( "Unknown error: (%d) while creating a shared memory segment", errno); break; } @@ -2519,7 +2519,7 @@ SMT_Status SM_Base_Init ( void ) if( errno) { - LG_LOG_ERROR_1( "Unable to attach the second shared memory segment to the current process: (%d)", errno); + LG_LOG_ERROR( "Unable to attach the second shared memory segment to the current process: (%d)", errno); rc = SMS_ERRSHM; goto Error4; @@ -2534,7 +2534,7 @@ SMT_Status SM_Base_Init ( void ) if( ( rc = ND_DataStruct_Open( &( SM_Base->MHR), "SHM-MHR", ND_OPEN_FLAG_CREATE, 1, &index_type, "MHR_Manager", NULL, SMG_DataStruct_Handlers, TRUE, NULL)) != NDS_OK) { - LG_LOG_ERROR_0( "Unable to create the MHR structure"); + LG_LOG_ERROR( "Unable to create the MHR structure"); goto Error4; } @@ -2549,7 +2549,7 @@ SMT_Status SM_Base_Init ( void ) rc = SM_Heap_Open_I( HEAP_SYSTEM, &System_Heap, 0, SMD_CREATE, &Locked); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to create the system heap"); + LG_LOG_ERROR( "Unable to create the system heap"); goto Error5; } @@ -2581,7 +2581,7 @@ SMT_Status SM_Base_Init ( void ) rc = SM_Base_Lock( SMD_READ); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to lock the shared memory base for reading"); + LG_LOG_ERROR( "Unable to lock the shared memory base for reading"); goto Error5; } @@ -2631,7 +2631,7 @@ SMT_Status SM_Base_End ( void ) rc = SM_Base_Unlock( SMD_READ); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to unlock the shared memory base"); + LG_LOG_ERROR( "Unable to unlock the shared memory base"); return rc; } @@ -2641,7 +2641,7 @@ SMT_Status SM_Base_End ( void ) rc = SM_Base_Lock( SMD_WRITE); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to lock the shared memory base for writing"); + LG_LOG_ERROR( "Unable to lock the shared memory base for writing"); SM_Base_Lock( SMD_READ); @@ -2678,7 +2678,7 @@ SMT_Status SM_Base_End ( void ) rc = ND_DataStruct_Value_Remove( SM_Base->MHR, MHH); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to remove heap: [%s] from the MHR", MHH->Name); + LG_LOG_ERROR( "Unable to remove heap: [%s] from the MHR", MHH->Name); SM_Base_Unlock( SMD_WRITE); SM_Base_Lock( SMD_READ); @@ -2691,7 +2691,7 @@ SMT_Status SM_Base_End ( void ) rc = ND_Value_Free( SM_Base->MHR, MHH); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to free heap: [%s]", MHH->Name); + LG_LOG_ERROR( "Unable to free heap: [%s]", MHH->Name); SM_Base_Unlock( SMD_WRITE); SM_Base_Lock( SMD_READ); @@ -2714,21 +2714,21 @@ SMT_Status SM_Base_End ( void ) { case EPERM: { - LG_LOG_ERROR_3( "Current process: (%d) is not allowed to destroy the shared memory segment: (%d) or (%d)", (int)getpid(), SysMemId, DataMemId); + LG_LOG_ERROR( "Current process: (%d) is not allowed to destroy the shared memory segment: (%d) or (%d)", (int)getpid(), SysMemId, DataMemId); break; } case EINVAL: { - LG_LOG_ERROR_2( "No shared memory segment exists for identifier: (%d) or (%d)", SysMemId, DataMemId); + LG_LOG_ERROR( "No shared memory segment exists for identifier: (%d) or (%d)", SysMemId, DataMemId); break; } default : { - LG_LOG_ERROR_3( "Unknown error: (%d) while destroying the shared memory segment: (%d) or (%d)", errno, SysMemId, DataMemId); + LG_LOG_ERROR( "Unknown error: (%d) while destroying the shared memory segment: (%d) or (%d)", errno, SysMemId, DataMemId); break; } @@ -2750,21 +2750,21 @@ SMT_Status SM_Base_End ( void ) { case EPERM: { - LG_LOG_ERROR_2( "Current process: (%d) is not allowed to destroy semaphore: (%d)", (int)getpid (), SemId); + LG_LOG_ERROR( "Current process: (%d) is not allowed to destroy semaphore: (%d)", (int)getpid (), SemId); break; } case EINVAL: { - LG_LOG_ERROR_1( "No semaphore corresponds to the identifier: (%d)", SemId); + LG_LOG_ERROR( "No semaphore corresponds to the identifier: (%d)", SemId); break; } default: { - LG_LOG_ERROR_2( "Unknown error: (%d) while destroying semaphore: (%d)", errno, SemId); + LG_LOG_ERROR( "Unknown error: (%d) while destroying semaphore: (%d)", errno, SemId); break; } @@ -2803,28 +2803,28 @@ SMT_Status SM_Base_Open ( void ) { case EACCES: { - LG_LOG_ERROR_1( "The shared memory segment: (%d) is not accessible to the current process", SM_Instance); + LG_LOG_ERROR( "The shared memory segment: (%d) is not accessible to the current process", SM_Instance); break; } case EIDRM: { - LG_LOG_ERROR_1( "The shared memory segment: (%d) has been deleted", SM_Instance); + LG_LOG_ERROR( "The shared memory segment: (%d) has been deleted", SM_Instance); break; } case ENOENT: { - LG_LOG_ERROR_1( "No shared memory segment corresponds to the identifier: (%d)", SM_Instance); + LG_LOG_ERROR( "No shared memory segment corresponds to the identifier: (%d)", SM_Instance); break; } default: { - LG_LOG_ERROR_1( "Unknown error: (%d) while retrieving a shared memory segment", errno); + LG_LOG_ERROR( "Unknown error: (%d) while retrieving a shared memory segment", errno); break; } @@ -2842,7 +2842,7 @@ SMT_Status SM_Base_Open ( void ) if( errno) { - LG_LOG_ERROR_1( "Unable to attach the shared memory segment to the current process, error: (%d)", errno); + LG_LOG_ERROR( "Unable to attach the shared memory segment to the current process, error: (%d)", errno); SM_Base = NULL; @@ -2853,7 +2853,7 @@ SMT_Status SM_Base_Open ( void ) Ptr = shmat (SM_Base->DataMemId, SM_Base->MHR, 0); if( errno) { - LG_LOG_ERROR_2( "Unable to attach the shared memory segment to the current process at the specified address: (%p) error: (%d)", SM_Base->MHR, errno); + LG_LOG_ERROR( "Unable to attach the shared memory segment to the current process at the specified address: (%p) error: (%d)", SM_Base->MHR, errno); shmdt( (void *)SM_Base); SM_Base = NULL; @@ -2867,7 +2867,7 @@ SMT_Status SM_Base_Open ( void ) rc = SM_Base_Lock( SMD_READ); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to lock the shared memory base for reading"); + LG_LOG_ERROR( "Unable to lock the shared memory base for reading"); shmdt( (void *)SM_Base); SM_Base = NULL; @@ -2881,7 +2881,7 @@ SMT_Status SM_Base_Open ( void ) rc = SM_Heap_Open_I( HEAP_SYSTEM, &System_Heap, 0, SMD_OPEN, &Locked); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to open the system heap"); + LG_LOG_ERROR( "Unable to open the system heap"); shmdt ( (void *)SM_Base); SM_Base = NULL; @@ -2956,7 +2956,7 @@ SMT_Status SM_Base_Lock( SMT_Flags Lock_Mode ) rc = SM_Semaphore_Operate( SM_Base->SemId, SM_SemOp_SSL, 2); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to lock the library base for reading"); + LG_LOG_ERROR( "Unable to lock the library base for reading"); return rc; } @@ -2967,7 +2967,7 @@ SMT_Status SM_Base_Lock( SMT_Flags Lock_Mode ) rc = SM_Semaphore_Operate( SM_Base->SemId, SM_SemOp_SEL, 2); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to lock the library base for writing"); + LG_LOG_ERROR( "Unable to lock the library base for writing"); return rc; } @@ -2993,7 +2993,7 @@ SMT_Status SM_Base_Unlock( SMT_Flags Lock_Mode ) rc = SM_Semaphore_Operate( SM_Base->SemId, SM_SemOp_RSL, 2); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to unlock the library base which had been locked for reading"); + LG_LOG_ERROR( "Unable to unlock the library base which had been locked for reading"); return rc; } @@ -3004,7 +3004,7 @@ SMT_Status SM_Base_Unlock( SMT_Flags Lock_Mode ) rc = SM_Semaphore_Operate( SM_Base->SemId, SM_SemOp_REL, 2); if( rc != SMS_OK) { - LG_LOG_ERROR_0( "Unable to unlock the library base which had been locked for writing"); + LG_LOG_ERROR( "Unable to unlock the library base which had been locked for writing"); return rc; } @@ -3236,7 +3236,7 @@ NDT_Status SM_Opened_Heap_List_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Inde SM_Context, Heap_Ptr->Name, Heap_Ptr, Heap_Ptr->MHH, Heap_Ptr->Lock_Mode, Heap_Ptr->Nb_Seg); */ - LG_LOG_INFO_6( "Heap_Name: [%s]/[%s] Heap_Addr: (%p) MHH_Ptr: (%p) Lock_Mode: (%d) Seg_Nb: (%d)", + LG_LOG_INFO( "Heap_Name: [%s]/[%s] Heap_Addr: (%p) MHH_Ptr: (%p) Lock_Mode: (%d) Seg_Nb: (%d)", SM_Context, Heap_Ptr->Name, Heap_Ptr, Heap_Ptr->MHH, Heap_Ptr->Lock_Mode, Heap_Ptr->Nb_Seg); return( NDS_OK); @@ -3273,13 +3273,13 @@ NDT_Status SM_Opened_Heap_List_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Inde default: { - LG_LOG_ERROR_1( "Manager called with an undefined command: (%d)", Command); + LG_LOG_ERROR( "Manager called with an undefined command: (%d)", Command); return( NDS_ERRAPI); } } - LG_LOG_ERROR_1( "Manager internal error in command: (%d)", Command); + LG_LOG_ERROR( "Manager internal error in command: (%d)", Command); return( NDS_ERRAPI); } @@ -3392,19 +3392,19 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node { case ENOMEM: { - LG_LOG_ERROR_0( "The amount of memory is not sufficient to create a new semaphore"); + LG_LOG_ERROR( "The amount of memory is not sufficient to create a new semaphore"); break; } case ENOSPC: { - LG_LOG_ERROR_0( "The number of semaphores exceeds the system-imposed limit"); + LG_LOG_ERROR( "The number of semaphores exceeds the system-imposed limit"); break; } default: { - LG_LOG_ERROR_1( "Unknown error: (%d) while creating a semaphore", errno); + LG_LOG_ERROR( "Unknown error: (%d) while creating a semaphore", errno); break; } } @@ -3419,7 +3419,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( semctl( SemId, 0, SETVAL, Sem_Ctl)) { - LG_LOG_ERROR_1( "Unable to initialize the value of the semaphore: (%d)", SemId); + LG_LOG_ERROR( "Unable to initialize the value of the semaphore: (%d)", SemId); rc = SMS_ERRSEM; goto Error3; @@ -3430,7 +3430,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( ND_Allocator_Exec( (void **)(MHH_Ptr_Ptr), SM_Base->MHR, sizeof( SMT_MHH), SM_Base->MHR->Allocator_Name, SM_Base->MHR->Allocator_Ptr, NULL) != NDS_OK) { - LG_LOG_ERROR_0( "Unable to allocate memory for the heap header"); + LG_LOG_ERROR( "Unable to allocate memory for the heap header"); rc = SMS_ERRSHM; goto Error3; @@ -3458,7 +3458,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( ( rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->DSR), "SHM-DSR", ND_OPEN_FLAG_CREATE, 1, &index_type, "SM_DSR_Manager", NULL, SMG_DataStruct_Handlers, TRUE, NULL)) != NDS_OK) { - LG_LOG_ERROR_0( "Unable to create the DSR structure"); + LG_LOG_ERROR( "Unable to create the DSR structure"); goto Error4; } @@ -3473,7 +3473,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( ( rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->ACR), "SHM-ACR", ND_OPEN_FLAG_CREATE, 1, &index_type, "SM_ACR_Manager", NULL, SMG_DataStruct_Handlers, TRUE, NULL)) != NDS_OK) { - LG_LOG_ERROR_0( "Unable to create the ACR structure"); + LG_LOG_ERROR( "Unable to create the ACR structure"); goto Error5; } @@ -3489,7 +3489,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( ( rc = ND_DataStruct_Open( &( ( *MHH_Ptr_Ptr)->FCR), "SHM-FCR", ND_OPEN_FLAG_CREATE, 1, &index_type, "SM_FCR_Manager", NULL, SMG_DataStruct_Handlers, TRUE, NULL)) != NDS_OK) { - LG_LOG_ERROR_0( "Unable to create the FCR structure"); + LG_LOG_ERROR( "Unable to create the FCR structure"); goto Error6; } @@ -3498,7 +3498,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node rc = ND_Value_Alloc( (void **)&DSH_Ptr, ( *MHH_Ptr_Ptr)->DSR, *MHH_Ptr_Ptr, ( *MHH_Ptr_Ptr)->Segment_Size); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "Unable to create the DSH structure"); + LG_LOG_ERROR( "Unable to create the DSH structure"); rc = SMS_ERRSHM; goto Error7; } @@ -3506,7 +3506,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node rc = ND_DataStruct_Value_Add( ( *MHH_Ptr_Ptr)->DSR, DSH_Ptr); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "Unable to add a data segment to the DSR structure"); + LG_LOG_ERROR( "Unable to add a data segment to the DSR structure"); goto Error8; } @@ -3603,7 +3603,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node rc = ND_DataStruct_Value_Remove( MHH_Ptr->DSR, DSH); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to remove the shared memory segment at address: (%p) from the DSR structure", DSH->Start); + LG_LOG_ERROR( "Unable to remove the shared memory segment at address: (%p) from the DSR structure", DSH->Start); if( SM_ERROR(rc)) return rc; } @@ -3613,7 +3613,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node rc = ND_Value_Free( MHH_Ptr->DSR, DSH); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to free the shared memory segment at address: (%p)", DSH->Start); + LG_LOG_ERROR( "Unable to free the shared memory segment at address: (%p)", DSH->Start); if( SM_ERROR(rc)) return rc; } @@ -3626,7 +3626,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node rc = ND_DataStruct_Close( MHH_Ptr->DSR); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to destroy the DSR structure of heap: [%s]", MHH_Ptr->Name); + LG_LOG_ERROR( "Unable to destroy the DSR structure of heap: [%s]", MHH_Ptr->Name); } } @@ -3641,13 +3641,13 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node rc = ND_Deallocator_Exec( MHH_Ptr->ACR, SM_Base->MHR, SM_Base->MHR->Deallocator_Name, SM_Base->MHR->Deallocator_Ptr, NULL); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to free the ACR root of heap: [%s]", MHH_Ptr->Name); + LG_LOG_ERROR( "Unable to free the ACR root of heap: [%s]", MHH_Ptr->Name); } rc = ND_Deallocator_Exec( MHH_Ptr->FCR, SM_Base->MHR, SM_Base->MHR->Deallocator_Name, SM_Base->MHR->Deallocator_Ptr, NULL); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to free the FCR root of heap: [%s]", MHH_Ptr->Name); + LG_LOG_ERROR( "Unable to free the FCR root of heap: [%s]", MHH_Ptr->Name); } /* Suppression du heap de la liste des heaps ouverts */ @@ -3683,7 +3683,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node rc = ND_Deallocator_Exec( MHH_Ptr, SM_Base->MHR, SM_Base->MHR->Deallocator_Name, SM_Base->MHR->Deallocator_Ptr, NULL); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to free the header of heap: [%s]", MHH_Ptr->Name); + LG_LOG_ERROR( "Unable to free the header of heap: [%s]", MHH_Ptr->Name); } @@ -3829,7 +3829,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node fprintf( Out, "Heap_Name: [%s]/[%s] Heap_Addr: (%lx) *** CORRUPTED *** Checker_PId: (%ld)\n", SM_Context, MHH_Ptr->Name, MHH_Ptr, MHH_Ptr->Writer); */ - LG_LOG_INFO_4( "Heap_Name: [%s]/[%s] Heap_Addr: (%lx) *** CORRUPTED *** Checker_PId: (%ld)", + LG_LOG_INFO( "Heap_Name: [%s]/[%s] Heap_Addr: (%lx) *** CORRUPTED *** Checker_PId: (%ld)", SM_Context, MHH_Ptr->Name, MHH_Ptr, MHH_Ptr->Writer); return( NDS_OK); @@ -3837,7 +3837,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( status = ( SM_Heap_Open_I( heap_name, &heap_ptr, 0, ( SMD_OPEN | SMD_READ), &locked)) != SMS_OK) { - LG_LOG_ERROR_1( "Unable to open Heap_Name: [%s] for reading", MHH_Ptr->Name); + LG_LOG_ERROR( "Unable to open Heap_Name: [%s] for reading", MHH_Ptr->Name); return( status); } @@ -3845,7 +3845,7 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( locked != TRUE) { - LG_LOG_ERROR_1( "Unable to lock Heap_Name: [%s] for reading", MHH_Ptr->Name); + LG_LOG_ERROR( "Unable to lock Heap_Name: [%s] for reading", MHH_Ptr->Name); // return( SMS_KO); } @@ -3865,13 +3865,13 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node alloc_chunk_nb, alloc_size, free_chunk_nb, free_size); */ - LG_LOG_INFO_5( "Heap_Name: [%s]/[%s] Heap_Addr: (%p) Sem_Id: (%d) Lock_Status: [%s]", + LG_LOG_INFO( "Heap_Name: [%s]/[%s] Heap_Addr: (%p) Sem_Id: (%d) Lock_Status: [%s]", SM_Context, heap_name, MHH_Ptr, MHH_Ptr->SemId, SM_Lock_Status_Get( "heap", MHH_Ptr)); - LG_LOG_INFO_6( "Writer_PId: (%ld) Seg_Nb: (%d) Heap_Size: (%lu) Size_Limit: (%ld) Auto_Compress: (%d) Compress_Nb: (%ld)", + LG_LOG_INFO( "Writer_PId: (%ld) Seg_Nb: (%d) Heap_Size: (%lu) Size_Limit: (%ld) Auto_Compress: (%d) Compress_Nb: (%ld)", MHH_Ptr->Writer, segment_nb, segment_size, MHH_Ptr->Limit_Size, MHH_Ptr->Auto_Compress, MHH_Ptr->Compress_Nb); - LG_LOG_INFO_4( "Alloc_Chunk_Nb: (%d) Alloc_Size: (%lu) Free_Chunk_Nb: (%d) Free_Size: (%lu)", + LG_LOG_INFO( "Alloc_Chunk_Nb: (%d) Alloc_Size: (%lu) Free_Chunk_Nb: (%d) Free_Size: (%lu)", alloc_chunk_nb, alloc_size, free_chunk_nb, free_size); - LG_LOG_INFO_0( ""); + LG_LOG_INFO( ""); if( locked == TRUE) { @@ -3921,12 +3921,12 @@ NDT_Status MHR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node default: { - LG_LOG_ERROR_1( "Manager called with an undefined command: (%d)", Command); + LG_LOG_ERROR( "Manager called with an undefined command: (%d)", Command); return( NDS_ERRAPI); } } - LG_LOG_ERROR_1( "Manager internal error in command: (%d)", Command); + LG_LOG_ERROR( "Manager internal error in command: (%d)", Command); return( NDS_ERRAPI); } @@ -3984,7 +3984,7 @@ SMT_Status SM_MHH_End( SMT_MHH *MHH) rc = ND_DataStruct_Value_Remove( MHH->DSR, DSH); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to remove the shared memory segment at address: (%p) from the DSR structure", DSH->Start); + LG_LOG_ERROR( "Unable to remove the shared memory segment at address: (%p) from the DSR structure", DSH->Start); if( SM_ERROR(rc)) return rc; } @@ -3994,7 +3994,7 @@ SMT_Status SM_MHH_End( SMT_MHH *MHH) rc = ND_Value_Free( MHH->DSR, DSH); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to free the shared memory segment at address: (%p)", DSH->Start); + LG_LOG_ERROR( "Unable to free the shared memory segment at address: (%p)", DSH->Start); if( SM_ERROR(rc)) return rc; } @@ -4007,7 +4007,7 @@ SMT_Status SM_MHH_End( SMT_MHH *MHH) rc = ND_DataStruct_Close( MHH->DSR); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to destroy the DSR structure of heap: [%s]", MHH->Name); + LG_LOG_ERROR( "Unable to destroy the DSR structure of heap: [%s]", MHH->Name); } } @@ -4022,13 +4022,13 @@ SMT_Status SM_MHH_End( SMT_MHH *MHH) rc = ND_Deallocator_Exec( MHH->ACR, SM_Base->MHR, SM_Base->MHR->Deallocator_Name, SM_Base->MHR->Deallocator_Ptr, NULL); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to free the ACR root of heap: [%s]", MHH->Name); + LG_LOG_ERROR( "Unable to free the ACR root of heap: [%s]", MHH->Name); } rc = ND_Deallocator_Exec( MHH->FCR, SM_Base->MHR, SM_Base->MHR->Deallocator_Name, SM_Base->MHR->Deallocator_Ptr, NULL); if( rc != NDS_OK) { - LG_LOG_ERROR_1( "Unable to free the FCR root of heap: [%s]", MHH->Name); + LG_LOG_ERROR( "Unable to free the FCR root of heap: [%s]", MHH->Name); } /* Suppression du heap de la liste des heaps ouverts */ @@ -4064,7 +4064,7 @@ SMT_Status SM_MHH_End( SMT_MHH *MHH) rc = ND_Deallocator_Exec( MHH, SM_Base->MHR, SM_Base->MHR->Deallocator_Name, SM_Base->MHR->Deallocator_Ptr, NULL); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to free the header of heap: [%s]", MHH->Name); + LG_LOG_ERROR( "Unable to free the header of heap: [%s]", MHH->Name); } return rc; @@ -4182,7 +4182,7 @@ NDT_Status SM_DSR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( Current_Size + Segment_Size > MHH_Ptr->Limit_Size) { - LG_LOG_ERROR_0( "The heap limit size would be exceeded"); + LG_LOG_ERROR( "The heap limit size would be exceeded"); *DSH_Ptr_Ptr = NULL; @@ -4194,7 +4194,7 @@ NDT_Status SM_DSR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( ND_Allocator_Exec( (void **)DSH_Ptr_Ptr, MHH_Ptr->DSR, sizeof (SMT_DSH), MHH_Ptr->DSR->Allocator_Name, MHH_Ptr->DSR->Allocator_Ptr, NULL) != NDS_OK) { - LG_LOG_ERROR_0( "Unable to allocate memory for the new data segment header"); + LG_LOG_ERROR( "Unable to allocate memory for the new data segment header"); return( NDS_KO); } @@ -4207,25 +4207,25 @@ NDT_Status SM_DSR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node { case EINVAL: { - LG_LOG_ERROR_1( "The size of the shared memory segment: (%d) is out of the system-imposed bounds", Segment_Size); + LG_LOG_ERROR( "The size of the shared memory segment: (%d) is out of the system-imposed bounds", Segment_Size); break; } case ENOMEM: { - LG_LOG_ERROR_0( "The amount of memory is not sufficient to create the shared memory segment"); + LG_LOG_ERROR( "The amount of memory is not sufficient to create the shared memory segment"); break; } case ENOSPC: { - LG_LOG_ERROR_0( "The number of shared memory segments exceeds the system-imposed limit"); + LG_LOG_ERROR( "The number of shared memory segments exceeds the system-imposed limit"); break; } default: { - LG_LOG_ERROR_1( "Unknown error: (%d) while creating a shared memory segment", errno); + LG_LOG_ERROR( "Unknown error: (%d) while creating a shared memory segment", errno); break; } } @@ -4245,7 +4245,7 @@ NDT_Status SM_DSR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node #endif if( errno) { - LG_LOG_ERROR_1( "Unable to attach the shared memory segment to the current process, error: (%d)", errno); + LG_LOG_ERROR( "Unable to attach the shared memory segment to the current process, error: (%d)", errno); shmctl( ( *DSH_Ptr_Ptr)->MemId, IPC_RMID, 0); @@ -4279,7 +4279,7 @@ NDT_Status SM_DSR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node if( ND_Index_Node_Add( MHH_Ptr->FCR, NDD_INDEX_PRIMARY, Chunk_Node) != NDS_OK) { - LG_LOG_ERROR_1( "Unable to add a first chunk to the FCR structure of heap: [%s]", MHH_Ptr->Name); + LG_LOG_ERROR( "Unable to add a first chunk to the FCR structure of heap: [%s]", MHH_Ptr->Name); shmctl ( ( *DSH_Ptr_Ptr)->MemId, IPC_RMID, 0); @@ -4319,19 +4319,19 @@ NDT_Status SM_DSR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node { case EPERM: { - LG_LOG_ERROR_2( "Current process: (%d) is not allowed to destroy the shared memory segment: (%d)", (int)getpid (), DSH_Ptr->MemId); + LG_LOG_ERROR( "Current process: (%d) is not allowed to destroy the shared memory segment: (%d)", (int)getpid (), DSH_Ptr->MemId); break; } case EINVAL: { - LG_LOG_ERROR_1( "No shared memory segment exists for identifier: (%d)", DSH_Ptr->MemId); + LG_LOG_ERROR( "No shared memory segment exists for identifier: (%d)", DSH_Ptr->MemId); break; } default: { - LG_LOG_ERROR_2( "Unknown error: (%d) while destroying the shared memory segment: (%d)", errno, DSH_Ptr->MemId); + LG_LOG_ERROR( "Unknown error: (%d) while destroying the shared memory segment: (%d)", errno, DSH_Ptr->MemId); break; } } @@ -4345,7 +4345,7 @@ NDT_Status SM_DSR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node rc = ND_Deallocator_Exec( DSH_Ptr, Root_Ptr, Root_Ptr->Deallocator_Name, Root_Ptr->Deallocator_Ptr, NULL); if( rc != NDS_OK) { - LG_LOG_ERROR_0( "The data segment header is nul"); + LG_LOG_ERROR( "The data segment header is nul"); return rc; } @@ -4462,7 +4462,7 @@ NDT_Status SM_DSR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node DSH_Ptr->MemId, DSH_Ptr->Start, DSH_Ptr->Size); */ - LG_LOG_INFO_3( "Data Segment Header: Mem_Id: (%d) Start: (%p) Size: (%ld)", + LG_LOG_INFO( "Data Segment Header: Mem_Id: (%d) Start: (%p) Size: (%ld)", DSH_Ptr->MemId, DSH_Ptr->Start, DSH_Ptr->Size); return( NDS_OK); @@ -4543,12 +4543,12 @@ NDT_Status SM_DSR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node default: { - LG_LOG_ERROR_1( "Manager called with an undefined command: (%d)", Command); + LG_LOG_ERROR( "Manager called with an undefined command: (%d)", Command); return( NDS_ERRAPI); } } - LG_LOG_ERROR_1( "Manager internal error in command: (%d)", Command); + LG_LOG_ERROR( "Manager internal error in command: (%d)", Command); return( NDS_ERRAPI); } @@ -4577,7 +4577,7 @@ SMT_Status SM_DataSegment_Open ( SMT_DSH *DSH) Ptr = shmat( DSH->MemId, DSH->Start, 0); if( errno) { - LG_LOG_ERROR_2( "Unable to attach the shared memory segment at the specified address: (%p) error: (%d)", DSH->Start, errno); + LG_LOG_ERROR( "Unable to attach the shared memory segment at the specified address: (%p) error: (%d)", DSH->Start, errno); return SMS_ERRSHM; } @@ -4893,7 +4893,7 @@ NDT_Status SM_ACR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node Chunk_Ptr, Chunk_Ptr->Data, Chunk_Ptr->Size); */ - LG_LOG_INFO_3( "Allocated Chunk: Chunk_Addr: (%p) Data_Addr: (%p) Data_Size: (%ld)", + LG_LOG_INFO( "Allocated Chunk: Chunk_Addr: (%p) Data_Addr: (%p) Data_Size: (%ld)", Chunk_Ptr, Chunk_Ptr->Data, Chunk_Ptr->Size); return( NDS_OK); @@ -4970,12 +4970,12 @@ NDT_Status SM_ACR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node default: { - LG_LOG_ERROR_1( "Manager called with an undefined command: (%d)", Command); + LG_LOG_ERROR( "Manager called with an undefined command: (%d)", Command); return( NDS_ERRAPI); } } - LG_LOG_ERROR_1( "Manager internal error in command: (%d)", Command); + LG_LOG_ERROR( "Manager internal error in command: (%d)", Command); return( NDS_ERRAPI); } @@ -5195,7 +5195,7 @@ NDT_Status SM_FCR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node // fprintf( Out, "Free Chunk: Chunk_Addr: (%p) Data_Ptr: (%p) Size: (%ld)\n", Chunk_Ptr, Chunk_Ptr->Data, Chunk_Ptr->Size); - LG_LOG_INFO_3( "Free Chunk: Chunk_Addr: (%p) Data_Ptr: (%p) Size: (%ld)", Chunk_Ptr, Chunk_Ptr->Data, Chunk_Ptr->Size); + LG_LOG_INFO( "Free Chunk: Chunk_Addr: (%p) Data_Ptr: (%p) Size: (%ld)", Chunk_Ptr, Chunk_Ptr->Data, Chunk_Ptr->Size); return( NDS_OK); } @@ -5272,12 +5272,12 @@ NDT_Status SM_FCR_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Node default: { - LG_LOG_ERROR_1( "Manager called with an undefined command: (%d)", Command); + LG_LOG_ERROR( "Manager called with an undefined command: (%d)", Command); return( NDS_ERRAPI); } } - LG_LOG_ERROR_1( "Manager internal error in command: (%d)", Command); + LG_LOG_ERROR( "Manager internal error in command: (%d)", Command); return( NDS_ERRAPI); } @@ -5299,7 +5299,7 @@ SMT_Status SM_Heap_Lock_Set ( SMT_MHH * MHH, SMT_Flags Lock_Mode ) rc = SM_Semaphore_Operate( MHH->SemId, SM_SemOp_SSL, 2); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to lock the heap: [%s] for reading", MHH->Name); + LG_LOG_ERROR( "Unable to lock the heap: [%s] for reading", MHH->Name); return rc; } @@ -5310,7 +5310,7 @@ SMT_Status SM_Heap_Lock_Set ( SMT_MHH * MHH, SMT_Flags Lock_Mode ) rc = SM_Semaphore_Operate( MHH->SemId, SM_SemOp_SEL, 2); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to lock the heap: [%s] for writing", MHH->Name); + LG_LOG_ERROR( "Unable to lock the heap: [%s] for writing", MHH->Name); return rc; } @@ -5343,14 +5343,14 @@ SMT_Status SM_Heap_Lock_Change( SMT_MHH * MHH, SMT_Flags Lock_Mode ) if( (rc = SM_Semaphore_Operate( MHH->SemId, SM_SemOp_RSL, 2)) != SMS_OK) { - LG_LOG_ERROR_1( "Unable to transform the heap: [%s] lock for writing", MHH->Name); + LG_LOG_ERROR( "Unable to transform the heap: [%s] lock for writing", MHH->Name); return rc; } if( (rc = SM_Semaphore_Operate( MHH->SemId, SM_SemOp_SEL, 2)) != SMS_OK) { - LG_LOG_ERROR_1( "Unable to transform the heap: [%s] lock for writing", MHH->Name); + LG_LOG_ERROR( "Unable to transform the heap: [%s] lock for writing", MHH->Name); /* On tente de revenir à l'état de verrouillage précédent */ @@ -5364,7 +5364,7 @@ SMT_Status SM_Heap_Lock_Change( SMT_MHH * MHH, SMT_Flags Lock_Mode ) rc = SM_Semaphore_Operate( MHH->SemId, SM_SemOp_TSL, 2); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to transform the heap: [%s] lock for reading", MHH->Name); + LG_LOG_ERROR( "Unable to transform the heap: [%s] lock for reading", MHH->Name); return rc; } @@ -5390,7 +5390,7 @@ SMT_Status SM_Heap_Lock_Release( SMT_MHH * MHH, SMT_Flags Lock_Mode ) rc = SM_Semaphore_Operate( MHH->SemId, SM_SemOp_RSL, 2); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to unlock the heap: [%s] which had been locked for reading", MHH->Name); + LG_LOG_ERROR( "Unable to unlock the heap: [%s] which had been locked for reading", MHH->Name); return rc; } @@ -5401,7 +5401,7 @@ SMT_Status SM_Heap_Lock_Release( SMT_MHH * MHH, SMT_Flags Lock_Mode ) rc = SM_Semaphore_Operate( MHH->SemId, SM_SemOp_REL, 2); if( rc != SMS_OK) { - LG_LOG_ERROR_1( "Unable to unlock the heap: [%s] which had been locked for writing", MHH->Name); + LG_LOG_ERROR( "Unable to unlock the heap: [%s] which had been locked for writing", MHH->Name); return rc; } @@ -5426,56 +5426,56 @@ SMT_Status SM_Semaphore_Operate( int SemId, struct sembuf * Operations, unsigned { case EAGAIN: { - LG_LOG_ERROR_0( "The operation would result in suspension of the calling process but the operations have been defined in no wait mode"); + LG_LOG_ERROR( "The operation would result in suspension of the calling process but the operations have been defined in no wait mode"); return SMS_NO_WAIT; } case EACCES: { - LG_LOG_ERROR_1( "Current process is not allowed to operate on semaphore: (%d)", SemId); + LG_LOG_ERROR( "Current process is not allowed to operate on semaphore: (%d)", SemId); break; } case EIDRM: { - LG_LOG_ERROR_1( "Semaphore: (%d) does not exist", SemId); + LG_LOG_ERROR( "Semaphore: (%d) does not exist", SemId); break; } case EINTR: { - LG_LOG_ERROR_1( "A signal was received while operating on semaphore: (%d)", SemId); + LG_LOG_ERROR( "A signal was received while operating on semaphore: (%d)", SemId); return SMS_ERRSIG; } case EINVAL: { - LG_LOG_ERROR_1( "The semaphore identifier: (%d) is incorrect or the number of operations which can be done in UNDO mode exceeds the system-imposed limit", SemId); + LG_LOG_ERROR( "The semaphore identifier: (%d) is incorrect or the number of operations which can be done in UNDO mode exceeds the system-imposed limit", SemId); break; } case ENOSPC: { - LG_LOG_ERROR_1( "The maximum number of process which can operate on semaphore: (%d) in UNDO mode has been reached", SemId); + LG_LOG_ERROR( "The maximum number of process which can operate on semaphore: (%d) in UNDO mode has been reached", SemId); break; } case ERANGE: { - LG_LOG_ERROR_1( "The value of semaphore: (%d) has reached the system-imposed limit", SemId); + LG_LOG_ERROR( "The value of semaphore: (%d) has reached the system-imposed limit", SemId); break; } default: { - LG_LOG_ERROR_2( "Unknown error: (%d) while operating on semaphore: (%d)", errno, SemId); + LG_LOG_ERROR( "Unknown error: (%d) while operating on semaphore: (%d)", errno, SemId); break; } diff --git a/lib/libshmem.h b/lib/libshmem.h index 7c785f3..37cd809 100644 --- a/lib/libshmem.h +++ b/lib/libshmem.h @@ -208,9 +208,9 @@ NDT_Handler SMG_DataStruct_Handlers[ NDD_HANDLER_NB] = /* */ /*------------------------------------------------------------------------------*/ -#define SM_LIBSHMEM_OPEN_CHECK() if( !SM_Base) { LG_LOG_ERROR_0( "LibShMem library is not open"); return( SMS_ERRAPI); } -#define SM_HEAP_NAME_CHECK(ptr) if( !(ptr)) { LG_LOG_ERROR_0( "Heap name is undefined"); return( SMS_ERRAPI); } -#define SM_HEAP_CHECK( ptr) if( !(ptr)) { LG_LOG_ERROR_0( "Heap is undefined"); return( SMS_ERRAPI); } +#define SM_LIBSHMEM_OPEN_CHECK() if( !SM_Base) { LG_LOG_ERROR( "LibShMem library is not open"); return( SMS_ERRAPI); } +#define SM_HEAP_NAME_CHECK(ptr) if( !(ptr)) { LG_LOG_ERROR( "Heap name is undefined"); return( SMS_ERRAPI); } +#define SM_HEAP_CHECK( ptr) if( !(ptr)) { LG_LOG_ERROR( "Heap is undefined"); return( SMS_ERRAPI); } diff --git a/util/smadmin.c b/util/smadmin.c index 689a772..0dd524b 100644 --- a/util/smadmin.c +++ b/util/smadmin.c @@ -252,7 +252,7 @@ int main( int argc, char **argv) return( -1); } - LG_LOG_INFO_0( "Start SMAdmin"); + LG_LOG_INFO( "Start SMAdmin"); /* Lancement de commande d'administration */ @@ -560,7 +560,7 @@ int main( int argc, char **argv) } - LG_LOG_INFO_0( "End SMAdmin"); + LG_LOG_INFO( "End SMAdmin"); if( ( lg_status = LG_Library_Close( true)) != LGS_OK) {