| TiFFEP Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
#include <tiffep.h> (shm.h) Types Linux: #define SHM_NAME "/tmp" typedef int ShmId; Win32: #define SHM_NAME "TiFFEP" typedef HANDLE ShmId; struct Shm; Internal functions gint shm_create (Shm *s, const char *name, int option); gint shm_attach (Shm *s, gint option); gint shm_detach (Shm *s); gint shm_destroy (Shm *s); gint shm_is_exist (); |
struct Shm
{
gint size;
ShmId id;
void* data;
};
|
The Shm struct is a
data structure containing informations about an attached memory segment.
The data field is a pointer of the shared memory segment.
gint shm_create (Shm *s, const char *name, int option); |
Create a unique shared memory segment.
| s : | the shm descriptor |
|
option :
|
unused for the moment |
| Returns : | 0 if success, an error code otherwise |
gint shm_attach (Shm *s, gint option); |
Attached a previously created memory segment.
| s : | the shm desciptor got with shm_create |
|
option :
|
unused |
| Returns : | 0 if success, an error code otherwise |
gint shm_detach (Shm *s); |
Detach a previously attached shm.
| s : | the shm desciptor |
| Returns : | 0 if success, an error code otherwise |
gint shm_destroy (Shm *s); |
Destroy a previously deteched shared memory segment.
| s : | the shm descriptor |
| Returns : | 0 if success, an error code otherwise |
gint shm_is_exist (); |
Check if the shared memory segment has been already created. Useful for checking if the server is running.
| Returns : | 1 if shm exist, 0 otherwise |
| <<< Previous Page | Home | Up | Next Page >>> |
| String Utility Functions | Hook Functions | ||