-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprior_msgq.h
More file actions
95 lines (73 loc) · 2.23 KB
/
Copy pathprior_msgq.h
File metadata and controls
95 lines (73 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/**
* Copyright (c) 2016 Wei-Lun Hsu. All Rights Reserved.
*/
/** @file prior_msgq.h
*
* @author Wei-Lun Hsu
* @version 0.1
* @date 2016/03/03
* @license
* @description
*/
#ifndef __prior_msgq_H_w9bJV6Pw_lnG2_HlJj_souE_uFQSjfMZnC5G__
#define __prior_msgq_H_w9bJV6Pw_lnG2_HlJj_souE_uFQSjfMZnC5G__
#ifdef __cplusplus
extern "C" {
#endif
//=============================================================================
// Constant Definition
//=============================================================================
//=============================================================================
// Macro Definition
//=============================================================================
//=============================================================================
// Structure Definition
//=============================================================================
/**
* message queue initial info
*/
typedef struct msgq_init_info
{
int max_msg_num;
void *pTunnal_info;
} msgq_init_info_t;
/**
* message queue handle
*/
typedef struct msgq_handle
{
int max_msg_cnt;
int cur_msg_cnt;
} msgq_handle_t;
//=============================================================================
// Global Data Definition
//=============================================================================
//=============================================================================
// Private Function Definition
//=============================================================================
//=============================================================================
// Public Function Definition
//=============================================================================
int
msgq_create_handle(
msgq_handle_t **ppHMsgq,
msgq_init_info_t *pInit_info);
int
msgq_destroy_handle(
msgq_handle_t **ppHMsgq);
int
msgq_post_msg(
msgq_handle_t *pHMsgq,
void *pMsg_data);
int
msgq_fetch_msg(
msgq_handle_t *pHMsgq,
void **ppMsg_data);
int
msgq_sort_msg(
msgq_handle_t *pHMsgq,
int (*fp_compare)(void *a, void *b));
#ifdef __cplusplus
}
#endif
#endif