1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  * Copyright (C) 2016 Mopria Alliance, Inc.
4  * Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #ifndef __WPRINT_MSGQ_H__
19 #define __WPRINT_MSGQ_H__
20 
21 #include "wtypes.h"
22 
23 #define WAIT_FOREVER -1
24 #define NO_WAIT 0
25 
26 #define MSG_Q_FIFO 0
27 
28 typedef void *msg_q_id;
29 
30 #define MSG_Q_INVALID_ID ((msg_q_id)NULL)
31 
32 /*
33  * Definitions corresponding to ifc_wprint_t interfaces
34  */
35 
36 msg_q_id msgQCreate(int max_msgs, int max_msg_length);
37 
38 status_t msgQDelete(msg_q_id msgQ);
39 
40 status_t msgQSend(msg_q_id msgQ, const char *buffer, unsigned long nbytes, int timeout,
41         int priority);
42 
43 status_t msgQReceive(msg_q_id msgQ, char *buffer, unsigned long max_nbytes, int timeout);
44 
45 int msgQNumMsgs(msg_q_id msgQ);
46 
47 #endif // __WPRINT_MSGQ_H__