xref: /f-stack/tools/compat/ff_ipc.h (revision 2317ada5)
1df6ad731Slogwang /*
2*2317ada5Sfengbojiang  * Copyright (C) 2017-2021 THL A29 Limited, a Tencent company.
3df6ad731Slogwang  * All rights reserved.
4df6ad731Slogwang  *
5df6ad731Slogwang  * Redistribution and use in source and binary forms, with or without
6df6ad731Slogwang  * modification, are permitted provided that the following conditions are met:
7df6ad731Slogwang  *
8df6ad731Slogwang  * 1. Redistributions of source code must retain the above copyright notice, this
9df6ad731Slogwang  *   list of conditions and the following disclaimer.
10df6ad731Slogwang  * 2. Redistributions in binary form must reproduce the above copyright notice,
11df6ad731Slogwang  *   this list of conditions and the following disclaimer in the documentation
12df6ad731Slogwang  *   and/or other materials provided with the distribution.
13df6ad731Slogwang  *
14df6ad731Slogwang  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15df6ad731Slogwang  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16df6ad731Slogwang  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17df6ad731Slogwang  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18df6ad731Slogwang  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19df6ad731Slogwang  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20df6ad731Slogwang  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21df6ad731Slogwang  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22df6ad731Slogwang  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23df6ad731Slogwang  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24df6ad731Slogwang  *
25df6ad731Slogwang  */
26df6ad731Slogwang 
27df6ad731Slogwang #ifndef _FF_IPC_H_
28df6ad731Slogwang #define _FF_IPC_H_
29df6ad731Slogwang 
30df6ad731Slogwang #include "ff_msg.h"
31df6ad731Slogwang 
32df6ad731Slogwang /* Set F-Stack proccess id to communicate with */
33df6ad731Slogwang void ff_set_proc_id(int pid);
34df6ad731Slogwang 
3585eb2ae9SAndy int ff_ipc_init(void);
36e10b9b93Szjwsoft void ff_ipc_exit(void);
37df6ad731Slogwang struct ff_msg *ff_ipc_msg_alloc(void);
38df6ad731Slogwang int ff_ipc_msg_free(struct ff_msg *msg);
39df6ad731Slogwang 
40df6ad731Slogwang int ff_ipc_send(const struct ff_msg *msg);
416194fcd2Sfengbojiang(姜凤波) int ff_ipc_recv(struct ff_msg **msg, enum FF_MSG_TYPE msg_type);
42df6ad731Slogwang 
43df6ad731Slogwang #endif
44