Add MessageQ interface header files to QNX include area
authorRobert Tivy <rtivy@ti.com>
Tue, 2 Dec 2014 00:36:09 +0000 (16:36 -0800)
committerRobert Tivy <rtivy@ti.com>
Tue, 2 Dec 2014 23:14:50 +0000 (15:14 -0800)
Even though QNX doesn't implement the new MessageQTransport interface,
it is including a common header (packages/ti/ipc/MessageQ.h) that does
reference the new interfaces.

qnx/include/IMessageQTransport.h [new file with mode: 0644]
qnx/include/INetworkTransport.h [new file with mode: 0644]
qnx/include/ITransport.h [new file with mode: 0644]

diff --git a/qnx/include/IMessageQTransport.h b/qnx/include/IMessageQTransport.h
new file mode 100644 (file)
index 0000000..81cff91
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ *  ======== IMessageQTransport.h ========
+ */
+
+#ifndef IMESSAGEQTRANSPORT_H
+#define IMESSAGEQTRANSPORT_H
+
+#include <ITransport.h>
+
+/* opaque instance handle */
+typedef struct IMessageQTransport_Object *IMessageQTransport_Handle;
+
+#define IMessageQTransport_TypeId 0x02
+
+/* virtual functions */
+typedef struct IMessageQTransport_Fxns {
+    Int (*bind)(void *handle, UInt32 queueId);
+    Int (*unbind)(void *handle, UInt32 queueId);
+    Bool (*put)(void *handle, Ptr msg);
+} IMessageQTransport_Fxns;
+
+/* abstract instance object */
+typedef struct IMessageQTransport_Object {
+    ITransport_Object base;             /* inheritance */
+    IMessageQTransport_Fxns *fxns;      /* virtual functions */
+} IMessageQTransport_Object;
+
+/* function stubs */
+static inline
+Int IMessageQTransport_bind(IMessageQTransport_Handle inst, UInt32 queueId)
+{
+    IMessageQTransport_Object *obj = (IMessageQTransport_Object *)inst;
+    return obj->fxns->bind((void *)inst, queueId);
+}
+
+static inline
+Int IMessageQTransport_unbind(IMessageQTransport_Handle inst, UInt32 queueId)
+{
+    IMessageQTransport_Object *obj = (IMessageQTransport_Object *)inst;
+    return obj->fxns->unbind((void *)inst, queueId);
+}
+
+static inline
+Bool IMessageQTransport_put(IMessageQTransport_Handle inst, Ptr msg)
+{
+    IMessageQTransport_Object *obj = (IMessageQTransport_Object *)inst;
+    return obj->fxns->put((void *)inst, msg);
+}
+
+/* instance convertors */
+static inline
+ITransport_Handle IMessageQTransport_upCast(IMessageQTransport_Handle inst)
+{
+    IMessageQTransport_Object *obj = (IMessageQTransport_Object *)inst;
+    return (ITransport_Handle)&obj->base;
+}
+
+static inline
+IMessageQTransport_Handle IMessageQTransport_downCast(ITransport_Handle base)
+{
+    return (IMessageQTransport_Handle)base;
+}
+
+#endif /* IMESSAGEQTRANSPORT_H */
+
diff --git a/qnx/include/INetworkTransport.h b/qnx/include/INetworkTransport.h
new file mode 100644 (file)
index 0000000..956fc67
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ *  ======== INetworkTransport.h ========
+ */
+
+#ifndef INETWORKTRANSPORT_H
+#define INETWORKTRANSPORT_H
+
+#include <ITransport.h>
+
+/* opaque instance handle */
+typedef struct INetworkTransport_Object *INetworkTransport_Handle;
+
+#define INetworkTransport_TypeId 0x03
+
+/* virtual functions */
+typedef struct INetworkTransport_Fxns {
+    Int (*bind)(void *handle, UInt32 queueId);
+    Int (*unbind)(void *handle, UInt32 queueId);
+    Bool (*put)(void *handle, Ptr msg);
+} INetworkTransport_Fxns;
+
+/* abstract instance object */
+typedef struct INetworkTransport_Object {
+    ITransport_Object base;             /* inheritance */
+    INetworkTransport_Fxns *fxns;       /* virtual functions */
+} INetworkTransport_Object;
+
+/* function stubs */
+static inline
+Bool INetworkTransport_bind(INetworkTransport_Handle inst, UInt32 queueId)
+{
+    INetworkTransport_Object *obj = (INetworkTransport_Object *)inst;
+    return obj->fxns->bind((void *)inst, queueId);
+}
+
+static inline
+Bool INetworkTransport_unbind(INetworkTransport_Handle inst, UInt32 queueId)
+{
+    INetworkTransport_Object *obj = (INetworkTransport_Object *)inst;
+    return obj->fxns->unbind((void *)inst, queueId);
+}
+
+static inline
+Bool INetworkTransport_put(INetworkTransport_Handle inst, Ptr msg)
+{
+    INetworkTransport_Object *obj = (INetworkTransport_Object *)inst;
+    return obj->fxns->put((void *)inst, msg);
+}
+
+/* instance convertors */
+ITransport_Handle INetworkTransport_upCast(INetworkTransport_Handle inst)
+{
+    INetworkTransport_Object *obj = (INetworkTransport_Object *)inst;
+    return (ITransport_Handle)&obj->base;
+}
+
+INetworkTransport_Handle INetworkTransport_downCast(ITransport_Handle base)
+{
+    return (INetworkTransport_Handle)base;
+}
+
+#endif /* INETWORKTRANSPORT_H */
+
diff --git a/qnx/include/ITransport.h b/qnx/include/ITransport.h
new file mode 100644 (file)
index 0000000..4287242
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ *  ======== ITransport.h ========
+ */
+
+#ifndef ITRANSPORT_H
+#define ITRANSPORT_H
+
+/* opaque instance handle */
+typedef struct ITransport_Object *ITransport_Handle;
+
+#define ITransport_TypeId 0x01
+
+/* instance object */
+typedef struct ITransport_Object {
+    Int interfaceType;
+} ITransport_Object;
+
+/* instance functions */
+static inline
+Int ITransport_itype(ITransport_Handle inst)
+{
+    ITransport_Object *obj = (ITransport_Object *)inst;
+    return obj->interfaceType;
+}
+
+#endif /* ITRANSPORT_H */
+