2024-04-17 18:49:56 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* libshmem.h */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-04-20 10:11:27 +02:00
|
|
|
|
/* This file is part of LibShMem. */
|
2024-04-17 18:49:56 +02:00
|
|
|
|
/* */
|
|
|
|
|
/* LibShMem is free software: you can redistribute it and/or modify it */
|
|
|
|
|
/* under the terms of the GNU Lesser General Public License as published */
|
|
|
|
|
/* by the Free Software Foundation, either version 3 of the License, or */
|
|
|
|
|
/* (at your option) any later version. */
|
|
|
|
|
/* */
|
|
|
|
|
/* LibShMem is distributed in the hope that it will be useful, */
|
|
|
|
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
|
|
|
|
/* GNU Lesser General Public License for more details. */
|
|
|
|
|
/* */
|
|
|
|
|
/* You should have received a copy of the GNU Lesser General Public */
|
2024-04-20 10:11:27 +02:00
|
|
|
|
/* License along with LibShMem. If not, see */
|
2024-04-17 18:49:56 +02:00
|
|
|
|
/* <https://www.gnu.org/licenses/>. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-18 00:54:07 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Includes */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
2005-01-24 23:57:06 +01:00
|
|
|
|
#include <stdarg.h>
|
2000-07-28 16:13:54 +02:00
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <errno.h>
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
#include <sys/sem.h>
|
|
|
|
|
#include <sys/shm.h>
|
|
|
|
|
#include <sys/ipc.h>
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
#include <shmem.h>
|
|
|
|
|
|
2024-04-17 18:49:56 +02:00
|
|
|
|
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-18 00:54:07 +02:00
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Definitions */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#define LGD_MODULE_NAME "sm"
|
|
|
|
|
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/* Compteur d'ouverture de la librairie */
|
|
|
|
|
|
|
|
|
|
unsigned int SM_Open_Counter = 0;
|
|
|
|
|
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/* Flux de sortie des messages d'erreur g<>n<EFBFBD>r<EFBFBD>s par la librairie */
|
|
|
|
|
|
|
|
|
|
FILE * SM_stderr;
|
|
|
|
|
|
|
|
|
|
extern char * strdup (const char *);
|
|
|
|
|
|
|
|
|
|
#define max(A,B) ((A < B) ? B : A)
|
|
|
|
|
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/* Limite sup<75>rieure d'adressage */
|
|
|
|
|
|
|
|
|
|
#define MEM_LIMIT 1000000000
|
|
|
|
|
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
2005-02-24 00:31:06 +01:00
|
|
|
|
//#define SMD_CMD_VALUE_SUM (NDT_Command)65
|
|
|
|
|
#define NDD_CMD_VALUE_SUM (NDT_Command)NDD_CMD_USER_TRAVERSE
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/* Taille d'un segment = 100 Ko par d<>faut */
|
|
|
|
|
|
|
|
|
|
#define K 1024
|
|
|
|
|
#define NB_BLOCS 100
|
|
|
|
|
#define SEGMENT_DEFAULT_SIZE NB_BLOCS * K
|
|
|
|
|
|
|
|
|
|
char Info_Msg [256];
|
|
|
|
|
|
2005-01-24 23:57:06 +01:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/* Etats possibles pour un heap */
|
|
|
|
|
|
|
|
|
|
#define SMD_STATE_VALID 0
|
2005-01-24 23:57:06 +01:00
|
|
|
|
#define SMD_STATE_UNVALIDATED 1
|
2000-07-28 16:13:54 +02:00
|
|
|
|
#define SMD_STATE_CORRUPTED 2
|
|
|
|
|
|
|
|
|
|
/* R<>f<EFBFBD>rence sur le heap syst<73>me */
|
|
|
|
|
|
|
|
|
|
SMT_Heap * System_Heap;
|
|
|
|
|
|
|
|
|
|
/* Liste des heaps ouverts par le processus courant */
|
|
|
|
|
|
|
|
|
|
NDT_Root * Opened_Heap_List;
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*
|
2005-01-24 23:57:06 +01:00
|
|
|
|
Taille par d<EFBFBD>faut des chunks allou<EFBFBD>s dans le heap syst<EFBFBD>me :
|
|
|
|
|
Cette taille est fix<EFBFBD>e <EFBFBD> la taille maximale des chunks pouvant
|
|
|
|
|
y <EFBFBD>tre allou<EFBFBD> (de type NDT_Node, NDT_Root, SMT_MHH ou SMT_DSH)
|
2000-07-28 16:13:54 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define DEFAULT_CHUNK_SIZE max(max(sizeof(NDT_Root), sizeof(NDT_Node)), max(sizeof(SMT_MHH), sizeof(SMT_DSH)))
|
|
|
|
|
|
|
|
|
|
/*
|
2005-01-24 23:57:06 +01:00
|
|
|
|
Nombre de chunk libre minimum avant extension du heap syst<EFBFBD>me par un
|
|
|
|
|
nouveau segment de donn<EFBFBD>es (fix<EFBFBD> <EFBFBD> 3 car l'ajout d'un nouveau segment
|
|
|
|
|
n<EFBFBD>cessite l'allocation de 2 chunks (un noeud et une ent<EFBFBD>te de segment).
|
2000-07-28 16:13:54 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define FREE_CHUNK_LIMIT 3
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
int SM_Instance;
|
|
|
|
|
char * SM_Context;
|
|
|
|
|
|
|
|
|
|
/* Contexte et instance d'utilisation de la librairie */
|
|
|
|
|
|
|
|
|
|
#define DEFAULT_INSTANCE 1000
|
|
|
|
|
#define INSTANCE_ENV_VAR "INSTANCE"
|
|
|
|
|
|
|
|
|
|
#define DEFAULT_CONTEXT "CTX"
|
|
|
|
|
#define CONTEXT_ENV_VAR "CONTEXT"
|
|
|
|
|
|
|
|
|
|
/*
|
2005-01-24 23:57:06 +01:00
|
|
|
|
Variable globale permettant d'indiquer que l'on est en train
|
|
|
|
|
d'<EFBFBD>tendre le heap syst<EFBFBD>me par ajout d'un nouveau segment.
|
2000-07-28 16:13:54 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
unsigned int Adding_Segment = FALSE;
|
|
|
|
|
|
|
|
|
|
SMT_Chunk * Tmp_Chunk;
|
|
|
|
|
SMT_MHH * Tmp_MHH;
|
|
|
|
|
|
|
|
|
|
/*
|
2005-01-24 23:57:06 +01:00
|
|
|
|
D<EFBFBD>finition des op<EFBFBD>rations de verouillage et de d<EFBFBD>verrouillage
|
|
|
|
|
NB : la valeur 1 d'un s<EFBFBD>maphore correspond <EFBFBD> l'<EFBFBD>tat non verrouill<EFBFBD>
|
2000-07-28 16:13:54 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* Pose d'un verrou en lecture : 2 op<6F>rations : ( -1 puis +2 ) */
|
|
|
|
|
|
|
|
|
|
struct sembuf SM_SemOp_SSL [2] = { {0, -1, SEM_UNDO}, {0, 2, SEM_UNDO} };
|
|
|
|
|
|
|
|
|
|
/* Lib<69>ration d'un verrou en lecture : 2 op<6F>rations ( -2 puis +1 ) */
|
|
|
|
|
|
|
|
|
|
struct sembuf SM_SemOp_RSL [2] = { {0, -2, SEM_UNDO|IPC_NOWAIT}, {0, 1, SEM_UNDO|IPC_NOWAIT} };
|
|
|
|
|
|
|
|
|
|
/* Pose d'un verrou en <20>criture : 2 op<6F>rations ( -1 puis 0 ) */
|
|
|
|
|
|
|
|
|
|
struct sembuf SM_SemOp_SEL [2] = { {0, -1, SEM_UNDO}, {0, 0, SEM_UNDO} };
|
|
|
|
|
|
|
|
|
|
/* Lib<69>ration d'un verrou en <20>criture : 2 op<6F>rations ( 0 puis +1 ) */
|
|
|
|
|
|
|
|
|
|
struct sembuf SM_SemOp_REL [2] = { {0, 0, SEM_UNDO|IPC_NOWAIT}, {0, 1, SEM_UNDO|IPC_NOWAIT} };
|
|
|
|
|
|
|
|
|
|
/* Transformation d'un verrou en <20>criture en un verrou en lecture : 2 op<6F>rations ( 0 puis +2 ) */
|
|
|
|
|
|
|
|
|
|
struct sembuf SM_SemOp_TSL [2] = { {0, 0, SEM_UNDO|IPC_NOWAIT}, {0, 2, SEM_UNDO|IPC_NOWAIT} };
|
|
|
|
|
|
|
|
|
|
typedef union semun
|
|
|
|
|
{
|
2005-01-24 23:57:06 +01:00
|
|
|
|
int val;
|
|
|
|
|
struct semid_ds * buf;
|
|
|
|
|
unsigned short int * array;
|
2000-07-28 16:13:54 +02:00
|
|
|
|
} semun;
|
|
|
|
|
|
2024-05-25 13:03:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-05-27 23:12:23 +02:00
|
|
|
|
/* LibShMem data struct handlers */
|
2024-05-25 13:03:36 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
|
2024-05-27 23:12:23 +02:00
|
|
|
|
NDT_Handler SMG_DataStruct_Handlers[ NDD_HANDLER_NB] =
|
2024-05-25 13:03:36 +02:00
|
|
|
|
{
|
2024-05-27 23:12:23 +02:00
|
|
|
|
{ "", /* Manager function name */
|
|
|
|
|
NULL}, /* Manager function pointer */
|
|
|
|
|
{ "", /* Init function name */
|
|
|
|
|
NULL}, /* Init function pointer */
|
|
|
|
|
{ "SM_Base_Alloc", /* Alloc function name */
|
|
|
|
|
NULL}, /* Alloc function pointer */
|
|
|
|
|
{ "SM_Base_Free", /* Free function name */
|
|
|
|
|
NULL}, /* Free function pointer */
|
|
|
|
|
{ "", /* Open function name */
|
|
|
|
|
NULL}, /* Open function pointer */
|
|
|
|
|
{ "", /* Close function name */
|
|
|
|
|
NULL}, /* Close function pointer */
|
|
|
|
|
{ "", /* Info function name */
|
|
|
|
|
NULL}, /* Info function pointer */
|
|
|
|
|
{ "", /* Lock function name */
|
|
|
|
|
NULL}, /* Lock function pointer */
|
|
|
|
|
{ "", /* Unlock function name */
|
|
|
|
|
NULL} /* Unlock function pointer */
|
2024-05-25 13:03:36 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#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); }
|
2024-04-17 18:49:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Allocation de m<>moire dans la base */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2024-05-03 00:28:06 +02:00
|
|
|
|
NDT_Status SM_Base_Alloc( void **, NDT_Root *ND_Root_Ptr, size_t, void *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* D<>sallocation de m<>moire dans la base */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2024-05-03 00:28:06 +02:00
|
|
|
|
NDT_Status SM_Base_Free( void *, NDT_Root *ND_Root_Ptr, void *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Allocation de m<>moire dans le heap syst<73>me */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2024-05-03 00:28:06 +02:00
|
|
|
|
NDT_Status SM_System_Alloc( void **, NDT_Root *ND_Root_Ptr, size_t, void *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* D<>sallocation de m<>moire dans le heap syst<73>me */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2024-05-03 00:28:06 +02:00
|
|
|
|
NDT_Status SM_System_Free( void *, NDT_Root *ND_Root_Ptr, void *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Initialisation de la base */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Base_Init (void);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Terminaison de la base */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Base_End (void);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Ouverture de la base */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Base_Open (void);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Fermeture de la base */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Base_Close (void);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Pose d'un verrou sur la base : */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Base_Lock (SMT_Flags);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Lib<69>ration d'un verrou sur la base : */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Base_Unlock (SMT_Flags);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Fonction manager de la liste des heaps ouverts */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2024-04-14 20:00:25 +02:00
|
|
|
|
NDT_Status SM_Opened_Heap_List_Manager ( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Fonction manager du MHR (Memory Heap Root) */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2024-04-14 20:00:25 +02:00
|
|
|
|
NDT_Status MHR_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Destruction d'un MHH (Memory Heap Header) */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_MHH_End (SMT_MHH *);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Fonction manager pour un DSR (Data Segment Root) */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2024-04-14 20:00:25 +02:00
|
|
|
|
NDT_Status SM_DSR_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Ouverture d'un segment de donn<6E>es */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_DataSegment_Open (SMT_DSH *);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Fermeture d'un segment de donn<6E>es */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_DataSegment_Close (SMT_DSH *);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Compression d'un segment de donn<6E>es */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
size_t SM_DataSegment_Compress (SMT_DSH *, NDT_Root *);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Fonction manager pour un ACR (Allocated Chunk Root) */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2024-04-14 20:00:25 +02:00
|
|
|
|
NDT_Status SM_ACR_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Fonction manager pour un FCR (Free Chunk Root) */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2024-04-14 20:00:25 +02:00
|
|
|
|
NDT_Status SM_FCR_Manager( NDT_Root *, NDT_Index_Id, NDT_Node *, NDT_Command, va_list *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Pose d'un verrou sur un heap : */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Heap_Lock_Set (SMT_MHH *, SMT_Flags);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Changement d'un verrou sur un heap : */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Heap_Lock_Change (SMT_MHH *, SMT_Flags);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Lib<69>ration d'un verrou sur un heap : */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Heap_Lock_Release (SMT_MHH *, SMT_Flags);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Op<4F>ration sur un s<>maphore */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
SMT_Status SM_Semaphore_Operate (int, struct sembuf *, unsigned int);
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* R<>cup<75>re sous forme explicite l'<27>tat d'un verrou */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
|
2024-04-19 18:44:32 +02:00
|
|
|
|
char * SM_Lock_Status_Get (const char *, void *);
|
2000-07-28 16:13:54 +02:00
|
|
|
|
|
2024-04-15 16:54:18 +02:00
|
|
|
|
|
|
|
|
|
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-15 16:54:18 +02:00
|
|
|
|
/* Add context prefix to heap name */
|
2000-07-28 16:13:54 +02:00
|
|
|
|
/*------------------------------------------------------------------------------*/
|
2024-04-15 16:54:18 +02:00
|
|
|
|
/* (O) Prefixed: Prefixed heap name */
|
|
|
|
|
/* (I) Unprefixed: Unprefixed heap name */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
SMT_Status SM_Name_Prefix( char *, const char *);
|
2024-04-17 18:49:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-18 00:54:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|