Messages functions

Name

Messages Functions -- functions for sending/receiving simple messages between instances of the TiFFEP library.

Synopsis

#include <tiffep.h> (messages.h)


Types

#define     STR_LEN                         1024
struct      TiffepMsg;
#define     TiffepMsgSize                   (sizeof(TiffepMsg))


DLLEXPORTed functions

gint        msg_clear                       (       TiffepMsg *m);
gint        msg_send                        (Shm s, TiffepMsg  m);
gint        msg_recv                        (Shm s, TiffepMsg *m);
gint        msg_check                       (Shm s);

Description

These functions provides a set of functions for sending/receiving/waiting messages between plug-ins. They use shared memory segment for this.

Details

struct TiffepMsg

struct TiffepMsg
{
  gint  type;
  gint  id;
  gint  cmd;
  gint  ack;
  gint  len;
  gint  data;
  gchar str[STRLEN+1];
};

The TiffepMsg struct is a basic data structure representing a TiFFEP internal message. Used as basic element for exchanging commands.
The type field defines the type of emitter.
The id field is a unique identifier depending on the emitter.
The cmd field contains the command to send.
The ack field is used to acknowledge the command.
The str field is used to pass strings (in several times in strings is too long).


msg_clear ()

gint        msg_clear                       (       TiffepMsg *m);

Clear the message (that is to say fill out the structure fields with null values).

 
m : the message
Returns : 0 if success, an error code otherwise