#include <stdio.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include <stdlib.h>
#include <inttypes.h>
#include <math.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <tiffio.h>
#include "spandsp/queue.h"
Functions | |
int | queue_empty (queue_t *p) |
Check if a queue is empty. | |
int | queue_free_space (queue_t *p) |
Check available free space. | |
int | queue_contents (queue_t *p) |
Check the contents of a queue. | |
void | queue_flush (queue_t *p) |
Flush the contents of a queue. | |
int | queue_view (queue_t *p, uint8_t *buf, int len) |
Copy bytes from a queue. | |
int | queue_read (queue_t *p, uint8_t *buf, int len) |
Read bytes from a queue. | |
int | queue_write (queue_t *p, const uint8_t *buf, int len) |
Write bytes to a queue. | |
int | queue_test_msg (queue_t *p) |
Test message length. | |
int | queue_read_msg (queue_t *p, uint8_t *buf, int len) |
Read a message from a queue. | |
int | queue_write_msg (queue_t *p, const uint8_t *buf, int len) |
Write a message to a queue. | |
int | queue_create (queue_t *p, int len, int flags) |
Create a queue. | |
int | queue_delete (queue_t *p) |
Delete a queue. |
int queue_contents | ( | queue_t * | p | ) |
Check the contents of a queue.
Check the contents of a queue.
p | The queue context. |
int queue_create | ( | queue_t * | p, | |
int | len, | |||
int | flags | |||
) |
Create a queue.
Create a queue.
p | The queue context. | |
len | The length of the queue's buffer. | |
flags | Flags controlling the operation of the queue. Valid flags are QUEUE_READ_ATOMIC and QUEUE_WRITE_ATOMIC. |
int queue_delete | ( | queue_t * | p | ) |
Delete a queue.
Delete a queue.
p | The queue context. |
int queue_empty | ( | queue_t * | p | ) |
Check if a queue is empty.
Check if a queue is empty.
p | The queue context. |
void queue_flush | ( | queue_t * | p | ) |
Flush the contents of a queue.
Flush the contents of a queue.
p | The queue context. |
int queue_free_space | ( | queue_t * | p | ) |
Check available free space.
Check the available free space in a queue's buffer.
p | The queue context. |
int queue_read | ( | queue_t * | p, | |
uint8_t * | buf, | |||
int | len | |||
) |
Read bytes from a queue.
Read bytes from a queue.
p | The queue context. | |
buf | The buffer into which the bytes will be read. | |
len | The length of the buffer. |
int queue_read_msg | ( | queue_t * | p, | |
uint8_t * | buf, | |||
int | len | |||
) |
Read a message from a queue.
Read a message from a queue. If the message is longer than the buffer provided, only the first len bytes of the message will be returned. The remainder of the message will be discarded.
p | The queue context. | |
buf | The buffer into which the message will be read. | |
len | The length of the buffer. |
int queue_test_msg | ( | queue_t * | p | ) |
Test message length.
Test the length of the message at the head of a queue.
p | The queue context. |
int queue_view | ( | queue_t * | p, | |
uint8_t * | buf, | |||
int | len | |||
) |
Copy bytes from a queue.
Copy bytes from a queue. This is similar to queue_read, but the data remains in the queue.
p | The queue context. | |
buf | The buffer into which the bytes will be read. | |
len | The length of the buffer. |
int queue_write | ( | queue_t * | p, | |
const uint8_t * | buf, | |||
int | len | |||
) |
Write bytes to a queue.
Write bytes to a queue.
p | The queue context. | |
buf | The buffer containing the bytes to be written. | |
len | The length of the buffer. |
int queue_write_msg | ( | queue_t * | p, | |
const uint8_t * | buf, | |||
int | len | |||
) |
Write a message to a queue.
Write a message to a queue.
p | The queue context. | |
buf | The buffer from which the message will be written. | |
len | The length of the message. |