]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - qnx/src/api/MessageQ.c
Added function hook for the MessageQ_put method
[ipc/ipcdev.git] / qnx / src / api / MessageQ.c
index 397ec49b8f0f1ab29bdae9f41b597fbc33eb1f8b..189e652b1b4cbd3fc0f7320f5add37043ed899cd 100644 (file)
@@ -196,6 +196,8 @@ typedef struct MessageQ_ModuleObject {
     /*!< File Descriptors for sending to each remote processor */
     int                 seqNum;
     /*!< Process-specific sequence number */
+    MessageQ_PutHookFxn putHookFxn;
+    /*!< hook function for MessageQ_put method */
 } MessageQ_ModuleObject;
 
 /*!
@@ -223,8 +225,9 @@ static Bool verbose = FALSE;
  */
 static MessageQ_ModuleObject MessageQ_state =
 {
-    .refCount               = 0,
-    .nameServer             = NULL,
+    .refCount   = 0,
+    .nameServer = NULL,
+    .putHookFxn = NULL
 };
 
 /*!
@@ -523,6 +526,11 @@ Int MessageQ_put (MessageQ_QueueId queueId, MessageQ_Msg msg)
     msg->dstId     = queueIndex;
     msg->dstProc   = dstProcId;
 
+    /* invoke put hook function after addressing the message */
+    if (MessageQ_module->putHookFxn != NULL) {
+        MessageQ_module->putHookFxn(queueId, msg);
+    }
+
     status = transportPut(msg, queueIndex, dstProcId);
 
     return (status);