Permalink
Browse files

update

Signed-off-by: yayanyang <yayanyang@gmail.com>
  • Loading branch information...
1 parent f45cb39 commit b39ababd320b5516c7c87fd347cf653fdb2308b5 @yayanyang yayanyang committed Sep 2, 2012
View
@@ -0,0 +1,5 @@
+lemon_c_cxx_files(SRC)
+
+lemon_library_project(lemon-message ${SRC})
+
+target_link_libraries(lemon-message lemon-io lemon-sys lemon-memory lemonxx)
View
No changes.
View
@@ -0,0 +1,141 @@
+/**
+ *
+ * @file abi
+ * @brief Copyright (C) 2012 yayanyang All Rights Reserved
+ * @author yayanyang
+ * @version 1.0.0.0
+ * @date 2012/09/01
+ */
+#ifndef LEMON_MESSAGE_ABI_H
+#define LEMON_MESSAGE_ABI_H
+
+#include <lemon/sys/abi.h>
+#include <lemon/message/configure.h>
+
+LEMON_DECLARE_HANDLE(LemonMessage);
+
+LEMON_DECLARE_HANDLE(LemonMailBox);
+
+LEMON_DECLARE_HANDLE(LemonMessageService);
+
+#define LEMON_mailbox_RESPONDER 0x01
+
+#define LEMON_mailbox_REQUESTER 0x02
+
+#define LEMON_mailbox_PUBLISHER 0x03
+
+#define LEMON_mailbox_SUBSCRIBER 0x04
+
+#define LEMON_mailbox_PUSH 0x05
+
+#define LEMON_mailbox_PULL 0x06
+
+LEMON_MESSAGE_API
+ LemonMailBox
+ LemonCreateMailBox(
+ __lemon_in LemonMessageService service,
+ __lemon_in size_t type,
+ __lemon_inout LemonErrorInfo * errorCode);
+
+LEMON_MESSAGE_API
+ void
+ LemonCloseMailBox(
+ __lemon_free LemonMailBox mailbox);
+
+LEMON_MESSAGE_API
+ void
+ LemonmailboxBind(
+ __lemon_in LemonMailBox mailbox,
+ __lemon_in const char * url,
+ __lemon_inout LemonErrorInfo * errorCode);
+
+
+LEMON_MESSAGE_API
+ void
+ LemonmailboxConnect(
+ __lemon_in LemonMailBox mailbox,
+ __lemon_in const char * url,
+ __lemon_inout LemonErrorInfo * errorCode);
+
+LEMON_MESSAGE_API
+ void
+ LemonSendMessage(
+ __lemon_in LemonMailBox mailbox,
+ __lemon_in LemonMessage msg,
+ __lemon_inout LemonErrorInfo * errorCode);
+
+LEMON_MESSAGE_API
+ LemonMessage
+ LemonReceiveMessage(
+ __lemon_in LemonMailBox mailbox,
+ __lemon_inout LemonErrorInfo * errorCode);
+
+
+typedef void(*LemonmailboxCallback)(void * userdata,LemonMessage msg,const LemonErrorInfo * errorCode);
+
+LEMON_MESSAGE_API
+ void
+ LemonAsyncReceiveMessage(
+ __lemon_in LemonMailBox mailbox,
+ __lemon_in LemonmailboxCallback callback,
+ __lemon_in void * userdata,
+ __lemon_inout LemonErrorInfo * errorCode);
+
+LEMON_MESSAGE_API
+ void
+ LemonAsyncSendMessage(
+ __lemon_in LemonMailBox mailbox,
+ __lemon_in LemonMessage msg,
+ __lemon_in LemonmailboxCallback callback,
+ __lemon_in void * userdata,
+ __lemon_inout LemonErrorInfo * errorCode);
+
+//////////////////////////////////////////////////////////////////////////
+LEMON_MESSAGE_API
+ LemonMessageService
+ LemonCreateMessageService(
+ __lemon_in size_t maxMessages,
+ __lemon_in size_t workThreads,
+ __lemon_inout LemonErrorInfo errorCode);
+
+LEMON_MESSAGE_API
+ void
+ LemonCloseMessageService(
+ __lemon_free LemonMessageService service);
+
+LEMON_MESSAGE_API
+ LemonMessage
+ LemonCreateMessage(
+ __lemon_in LemonMessageService service,
+ __lemon_inout LemonErrorInfo * errorCode);
+
+LEMON_MESSAGE_API
+ void LemonCloseMessage(
+ __lemon_in LemonMessageService service,
+ __lemon_free LemonMessage message);
+
+LEMON_MESSAGE_API size_t LemonMessageLength(__lemon_in LemonMessage message);
+
+LEMON_MESSAGE_API
+ size_t
+ LemonMessageWrite(
+ __lemon_in LemonMessage message,
+ __lemon_in const void * data,
+ __lemon_in size_t length,
+ __lemon_inout LemonErrorInfo *errorCode);
+
+LEMON_MESSAGE_API
+ size_t
+ LemonMessageRead(
+ __lemon_in LemonMessage message,
+ __lemon_in void * data,
+ __lemon_in size_t length,
+ __lemon_inout LemonErrorInfo *errorCode);
+
+LEMON_MESSAGE_API
+ size_t LemonMessageSeek(
+ __lemon_in LemonMessage message,
+ __lemon_in int offset,
+ __lemon_in size_t position);
+
+#endif // LEMON_MESSAGE_ABI_H
View
@@ -0,0 +1,9 @@
+assembly=
+{
+ name = "lemon-message";
+
+ errorcode =
+ {
+
+ };
+}
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
@@ -1,5 +0,0 @@
-lemon_c_cxx_files(SRC)
-
-lemon_library_project(lemon-play ${SRC})
-
-target_link_libraries(lemon-play lemon-sys lemon-memory)
View
@@ -1,33 +0,0 @@
-/**
-*
-* @file abi
-* @brief Copyright (C) 2012 yayanyang All Rights Reserved
-* @author yayanyang
-* @version 1.0.0.0
-* @date 2012/03/23
-*/
-#ifndef LEMON_PLAY_ABI_H
-#define LEMON_PLAY_ABI_H
-#include <lemon/sys/abi.h>
-#include <lemon/play/configure.h>
-
-typedef lemon_uint64_t LemonActor;
-
-typedef struct LemonActorId{
- lemon_uint32_t Id;
- lemon_uint32_t RunQueneId;
-} LemonActorId;
-
-LEMON_DECLARE_HANDLE(LemonPlay);
-
-LEMON_DECLARE_HANDLE(LemonPlayIRQ);
-
-LEMON_DECLARE_HANDLE(LemonPlayRunQueue);
-
-typedef void(*LemonActorProc)(LemonPlay play,void *uerData);
-
-#define LEMON_PLAY_NULL_ACTOR ((LemonActor)-1)
-
-#define LEMON_PLAY_COROUTINE_STACKSIZE 0
-
-#endif //LEMON_PLAY_ABI_H
View
@@ -1,58 +0,0 @@
-/**
-*
-* @file IRQ(...)
-* @brief Copyright (C) 2012 yayanyang All Rights Reserved
-* @author yayanyang
-* @version 1.0.0.0
-* @date 2012/03/23
-*/
-#ifndef LEMON_PLAY_IRQ_H
-#define LEMON_PLAY_IRQ_H
-
-#include <lemon/play/abi.h>
-#define LEMON_PLAY_IRQ_MAX_LEVEL 0x01
-
-#define LEMON_PLAY_IRQ_PASSIVE_LEVEL 0x00
-
-
-//////////////////////////////////////////////////////////////////////////
-
-#define LEMON_PLAY_IRQ_CREATE 0x00
-
-#define LEMON_PLAY_IRQ_JOIN 0x01
-
-#define LEMON_PLAY_IRQ_WAKEUPE 0x02
-
-//////////////////////////////////////////////////////////////////////////
-
-typedef union LemonPlayIRQData{
- struct{
- LemonActorProc Proc;
- void *UserData;
- } TaskData;
-} LemonPlayIRQData;
-
-LEMON_IMPLEMENT_HANDLE(LemonPlayIRQ){
-
- size_t IRQType;
-
- LemonActor Source;/*the IRQ source actor*/
-
- LemonActor Object;/*the IRQ target actor*/
-
- LemonPlayIRQData Data;
-
- LemonPlayIRQ NextIRQ;
-};
-
-typedef struct LemonPlayIRQArray{
-
- volatile size_t IRQs;
-
- volatile LemonPlayIRQ Array;
-
- volatile LemonPlayIRQ Tail;
-
-}LemonPlayIRQArray;
-
-#endif //LEMON_PLAY_IRQ_H
Oops, something went wrong.

0 comments on commit b39abab

Please sign in to comment.