tizen beta release
[framework/messaging/email-service.git] / ipc / common / include / cm-sys-msg-queue.h
1 /*
2 *  email-service
3 *
4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5 *
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
7
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 */
21
22
23 #ifndef _IPC_MESSAGE_Q_H_
24 #define _IPC_MESSAGE_Q_H_
25 #include <sys/ipc.h>
26 #include <sys/msg.h>
27 #include <errno.h>
28
29 #include "emf-dbglog.h"
30 #define IPC_MSGQ_SIZE 512
31
32 typedef struct {
33         long mtype;                                     /* type of message ¸Þ¼¼Áö Å¸ÀÔ */
34         char mtext[IPC_MSGQ_SIZE];      /* message text ¸Þ¼¼Áö ³»¿ë */
35 }ipcMsgbuf;
36
37 class cmSysMsgQueue
38 {
39 public:
40         cmSysMsgQueue(int a_nMsgType);
41         virtual ~ cmSysMsgQueue();
42
43 private:
44         int             m_nMsgType;
45         /* key_t                m_nKey; */ /*CID = 17033 BU not used */
46         long            m_nMsgqid;
47         ipcMsgbuf       *m_pSendBuf;
48         ipcMsgbuf       *m_pRecvBuf;
49         
50 public:
51         void MsgCreate();
52         int MsgSnd(void *a_pMsg, int a_nSize, long a_nType);
53         int MsgRcv(void *a_pMsg, int a_nSize);
54         bool MsgDestroy();
55
56 };
57
58 #endif  /* _IPC_MESSAGE_Q_H_ */
59
60
61
62