Kyle Swenson | 8d8f654 | 2021-03-15 11:02:55 -0600 | [diff] [blame^] | 1 | /* $Id: dqueue.h,v 1.1.2.2 2001/02/08 12:25:43 armin Exp $ */ |
| 2 | |
| 3 | #ifndef _DIVA_USER_MODE_IDI_DATA_QUEUE_H__ |
| 4 | #define _DIVA_USER_MODE_IDI_DATA_QUEUE_H__ |
| 5 | |
| 6 | #define DIVA_UM_IDI_MAX_MSGS 64 |
| 7 | |
| 8 | typedef struct _diva_um_idi_data_queue { |
| 9 | int segments; |
| 10 | int max_length; |
| 11 | int read; |
| 12 | int write; |
| 13 | int count; |
| 14 | int segment_pending; |
| 15 | void *data[DIVA_UM_IDI_MAX_MSGS]; |
| 16 | int length[DIVA_UM_IDI_MAX_MSGS]; |
| 17 | } diva_um_idi_data_queue_t; |
| 18 | |
| 19 | int diva_data_q_init(diva_um_idi_data_queue_t *q, |
| 20 | int max_length, int max_segments); |
| 21 | int diva_data_q_finit(diva_um_idi_data_queue_t *q); |
| 22 | int diva_data_q_get_max_length(const diva_um_idi_data_queue_t *q); |
| 23 | void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t *q); |
| 24 | void diva_data_q_ack_segment4write(diva_um_idi_data_queue_t *q, |
| 25 | int length); |
| 26 | const void *diva_data_q_get_segment4read(const diva_um_idi_data_queue_t * |
| 27 | q); |
| 28 | int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t *q); |
| 29 | void diva_data_q_ack_segment4read(diva_um_idi_data_queue_t *q); |
| 30 | |
| 31 | #endif |