-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathstream_queue.h
38 lines (32 loc) · 979 Bytes
/
stream_queue.h
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
/*************************************************************************
> File Name: stream_queue.h
> Author: bxq
> Mail: [email protected]
> Created Time: Sunday, May 22, 2016 PM09:35:22 CST
************************************************************************/
#ifndef __STREAM_QUEUE_H__
#define __STREAM_QUEUE_H__
#ifdef __cplusplus
extern "C" {
#endif
struct stream_queue {
int pktsiz;
int nbpkts;
int head;
int tail;
int *pktlen;
char *buf;
};
struct stream_queue *streamq_alloc (int pktsiz, int nbpkts);
int streamq_query (struct stream_queue *q, int index, char **ppacket, int **ppktlen);
int streamq_inused (struct stream_queue *q, int index);
int streamq_next (struct stream_queue *q, int index);
int streamq_head (struct stream_queue *q);
int streamq_tail (struct stream_queue *q);
int streamq_push (struct stream_queue *q);
int streamq_pop (struct stream_queue *q);
void streamq_free (struct stream_queue *q);
#ifdef __cplusplus
}
#endif
#endif