Soletta™ Framework
|
#include <sol-log.h>
#include <sol-mainloop.h>
#include <sol-types.h>
#include <sol-buffer.h>
#include <sol-util.h>
#include <sol-reentrant.h>
#include <soletta.h>
#include <unistd.h>
#include <stdio.h>
Data Structures | |
struct | my_stream_api_config |
[stream config] More... | |
struct | my_stream_api_handle |
[stream config] More... | |
Macros | |
#define | DEFAULT_BUFFER_SIZE (4096) |
#define | my_stream_device_add_io_monitor sol_fd_add |
#define | my_stream_device_monitor_handle struct sol_fd |
#define | my_stream_device_read read |
#define | my_stream_device_remove_io_monitor sol_fd_del |
#define | my_stream_device_write write |
Functions | |
static bool | _can_read (void *data, int fd, uint32_t active_flags) |
static bool | _can_write (void *data, int fd, uint32_t active_flags) |
[stream write] More... | |
static bool | _inform_user (void *data) |
[stream write] More... | |
static void | api_close (struct my_stream_api_handle *handle) |
[stream handle] More... | |
void | my_stream_api_close (struct my_stream_api_handle *handle) |
[stream write api] More... | |
int | my_stream_api_feed (struct my_stream_api_handle *handle, struct sol_blob *blob) |
[stream write api] More... | |
struct my_stream_api_handle * | my_stream_api_new (const struct my_stream_api_config *config, int dev) |
static ssize_t | on_data (void *user_data, struct my_stream_api_handle *handle, const struct sol_buffer *buf) |
static void | on_feed_done (void *data, struct my_stream_api_handle *handle, struct sol_blob *blob, int status) |
[stream read] More... | |
static void | shutdown (void) |
SOL_MAIN_DEFAULT (startup, shutdown) | |
static void | startup (void) |
Variables | |
static struct my_stream_api_handle * | out_handle |
#define DEFAULT_BUFFER_SIZE (4096) |
Referenced by _can_read().
#define my_stream_device_add_io_monitor sol_fd_add |
Referenced by my_stream_api_feed(), and my_stream_api_new().
#define my_stream_device_monitor_handle struct sol_fd |
#define my_stream_device_read read |
Referenced by _can_read().
#define my_stream_device_remove_io_monitor sol_fd_del |
Referenced by my_stream_api_close().
#define my_stream_device_write write |
Referenced by _can_write().
|
static |
References _inform_user(), sol_buffer::capacity, DEFAULT_BUFFER_SIZE, my_stream_api_handle::dev, sol_buffer::flags, my_stream_device_read, my_stream_api_handle::read_monitor, my_stream_api_handle::read_timeout, my_stream_api_handle::rx, sol_buffer_at_end(), sol_buffer_expand(), SOL_BUFFER_FLAGS_FIXED_CAPACITY, SOL_INT_CHECK, sol_timeout_add(), SOL_WRN, and sol_buffer::used.
Referenced by my_stream_api_new().
|
static |
[stream write]
References my_stream_api_handle::dev, sol_blob::mem, my_stream_device_write, my_stream_api_handle::on_feed_done, my_stream_api_handle::pending_blobs, my_stream_api_handle::pending_bytes, sol_blob::size, sol_blob_unref(), sol_ptr_vector_del(), sol_ptr_vector_get(), sol_ptr_vector_get_len(), SOL_WRN, my_stream_api_handle::user_data, my_stream_api_handle::write_monitor, and my_stream_api_handle::written.
Referenced by my_stream_api_feed().
|
static |
[stream write]
[stream read]
References api_close(), sol_reentrant::delete_me, my_stream_api_handle::on_data, my_stream_api_handle::read_timeout, my_stream_api_handle::reentrant, my_stream_api_handle::rx, sol_buffer_remove_data(), SOL_ERR, SOL_REENTRANT_CALL, SOL_REENTRANT_FREE, sol_buffer::used, and my_stream_api_handle::user_data.
Referenced by _can_read().
|
static |
[stream handle]
References my_stream_api_handle::on_data, my_stream_api_handle::on_feed_done, my_stream_api_handle::pending_blobs, my_stream_api_handle::rx, sol_blob_unref(), sol_buffer_fini(), sol_ptr_vector_clear(), SOL_PTR_VECTOR_FOREACH_IDX, sol_buffer::used, and my_stream_api_handle::user_data.
Referenced by _inform_user(), and my_stream_api_close().
void my_stream_api_close | ( | struct my_stream_api_handle * | handle | ) |
[stream write api]
References api_close(), sol_reentrant::delete_me, my_stream_device_remove_io_monitor, my_stream_api_handle::read_monitor, my_stream_api_handle::read_timeout, my_stream_api_handle::reentrant, SOL_EXP_CHECK, SOL_NULL_CHECK, SOL_REENTRANT_FREE, sol_timeout_del(), and my_stream_api_handle::write_monitor.
int my_stream_api_feed | ( | struct my_stream_api_handle * | handle, |
struct sol_blob * | blob | ||
) |
[stream write api]
References _can_write(), sol_reentrant::delete_me, my_stream_api_handle::dev, my_stream_api_handle::feed_size, my_stream_device_add_io_monitor, my_stream_api_handle::pending_blobs, my_stream_api_handle::pending_bytes, my_stream_api_handle::reentrant, sol_blob::size, sol_blob_ref(), sol_blob_unref(), SOL_EXP_CHECK, SOL_INT_CHECK, SOL_NULL_CHECK, SOL_NULL_CHECK_GOTO, sol_ptr_vector_append(), sol_ptr_vector_del_element(), and my_stream_api_handle::write_monitor.
Referenced by on_data().
struct my_stream_api_handle * my_stream_api_new | ( | const struct my_stream_api_config * | config, |
int | dev | ||
) |
References _can_read(), my_stream_api_config::data_buffer_size, my_stream_api_handle::dev, my_stream_api_config::feed_size, my_stream_api_handle::feed_size, my_stream_device_add_io_monitor, my_stream_api_config::on_data, my_stream_api_handle::on_data, my_stream_api_config::on_feed_done, my_stream_api_handle::on_feed_done, my_stream_api_handle::pending_blobs, my_stream_api_handle::read_monitor, my_stream_api_handle::rx, SOL_BUFFER_FLAGS_DEFAULT, SOL_BUFFER_FLAGS_FIXED_CAPACITY, SOL_BUFFER_FLAGS_NO_NUL_BYTE, sol_buffer_init_flags(), SOL_NULL_CHECK, SOL_NULL_CHECK_GOTO, sol_ptr_vector_init(), my_stream_api_config::user_data, and my_stream_api_handle::user_data.
Referenced by startup().
|
static |
References sol_str_slice::data, sol_str_slice::len, my_stream_api_close(), my_stream_api_feed(), sol_blob_new(), SOL_BLOB_TYPE_NO_FREE_DATA, sol_blob_unref(), sol_buffer_get_slice(), sol_quit(), SOL_STR_SLICE_PRINT, and sol_str_slice_str_eq().
Referenced by startup().
|
static |
[stream read]
References sol_str_slice_from_blob(), SOL_STR_SLICE_PRINT, and sol_util_strerrora.
Referenced by startup().
|
static |
|
static |
|
static |