|
Packit |
34410b |
/*
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
* BlueZ - Bluetooth protocol stack for Linux
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
* Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
* This library is free software; you can redistribute it and/or
|
|
Packit |
34410b |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
34410b |
* License as published by the Free Software Foundation; either
|
|
Packit |
34410b |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
34410b |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
34410b |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
34410b |
* Lesser General Public License for more details.
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
34410b |
* License along with this library; if not, write to the Free Software
|
|
Packit |
34410b |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
*/
|
|
Packit |
34410b |
|
|
Packit |
34410b |
#include <stdbool.h>
|
|
Packit |
34410b |
#include <sys/uio.h>
|
|
Packit |
34410b |
|
|
Packit |
34410b |
typedef void (*io_destroy_func_t)(void *data);
|
|
Packit |
34410b |
|
|
Packit |
34410b |
struct io;
|
|
Packit |
34410b |
|
|
Packit |
34410b |
struct io *io_new(int fd);
|
|
Packit |
34410b |
void io_destroy(struct io *io);
|
|
Packit |
34410b |
|
|
Packit |
34410b |
int io_get_fd(struct io *io);
|
|
Packit |
34410b |
bool io_set_close_on_destroy(struct io *io, bool do_close);
|
|
Packit |
34410b |
|
|
Packit |
34410b |
ssize_t io_send(struct io *io, const struct iovec *iov, int iovcnt);
|
|
Packit |
34410b |
bool io_shutdown(struct io *io);
|
|
Packit |
34410b |
|
|
Packit |
34410b |
typedef bool (*io_callback_func_t)(struct io *io, void *user_data);
|
|
Packit |
34410b |
|
|
Packit |
34410b |
bool io_set_read_handler(struct io *io, io_callback_func_t callback,
|
|
Packit |
34410b |
void *user_data, io_destroy_func_t destroy);
|
|
Packit |
34410b |
bool io_set_write_handler(struct io *io, io_callback_func_t callback,
|
|
Packit |
34410b |
void *user_data, io_destroy_func_t destroy);
|
|
Packit |
34410b |
bool io_set_disconnect_handler(struct io *io, io_callback_func_t callback,
|
|
Packit |
34410b |
void *user_data, io_destroy_func_t destroy);
|