add looping buffers

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4849 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-04-04 18:22:59 +00:00
parent 79e54b1fd1
commit ceb98915bb
4 changed files with 50 additions and 48 deletions
+15
View File
@@ -96,6 +96,21 @@ SWITCH_DECLARE(switch_size_t) switch_buffer_inuse(switch_buffer_t *buffer);
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_read(switch_buffer_t *buffer, void *data, switch_size_t datalen);
/*! \brief Read data endlessly from a switch_buffer_t
* \param buffer any buffer of type switch_buffer_t
* \param data pointer to the read data to be returned
* \param datalen amount of data to be returned
* \return int ammount of data actually read
* \note Once you have read all the data from the buffer it will loop around.
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_read_loop(switch_buffer_t *buffer, void *data, switch_size_t datalen);
/*! \brief Assign a number of loops to read
* \param buffer any buffer of type switch_buffer_t
* \param loops the number of loops (-1 for infinite)
*/
SWITCH_DECLARE(void) switch_buffer_set_loops(switch_buffer_t *buffer, int32_t loops);
/*! \brief Write data into a switch_buffer_t up to the length of datalen
* \param buffer any buffer of type switch_buffer_t
* \param data pointer to the data to be written