mirror of https://gerrit.osmocom.org/libosmocore
osmo_io: Add osmo_io_get_ioops() function
This function can be used by user code to obtain the currently-set io operations, it's the inverse of osmo_io_set_ioops(). Change-Id: I03398c811b9534f50c6644b21eea89a04be29fb0
This commit is contained in:
parent
3c0d5001a5
commit
f574aea38f
|
@ -109,3 +109,4 @@ const char *osmo_iofd_get_name(const struct osmo_io_fd *iofd);
|
|||
void osmo_iofd_set_name(struct osmo_io_fd *iofd, const char *name);
|
||||
|
||||
int osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops);
|
||||
void osmo_iofd_get_ioops(struct osmo_io_fd *iofd, struct osmo_io_ops *ioops);
|
||||
|
|
|
@ -258,6 +258,7 @@ osmo_io_backend_names;
|
|||
osmo_iofd_close;
|
||||
osmo_iofd_free;
|
||||
osmo_iofd_get_data;
|
||||
osmo_iofd_get_ioops;
|
||||
osmo_iofd_get_fd;
|
||||
osmo_iofd_get_name;
|
||||
osmo_iofd_set_name;
|
||||
|
|
|
@ -896,6 +896,14 @@ int osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*! Get the osmo_io_ops for an iofd.
|
||||
* \param[in] iofd Target iofd file descriptor
|
||||
* \param[in] ioops caller-allocated osmo_io_ops structure to be filled */
|
||||
void osmo_iofd_get_ioops(struct osmo_io_fd *iofd, struct osmo_io_ops *ioops)
|
||||
{
|
||||
*ioops = iofd->io_ops;
|
||||
}
|
||||
|
||||
/*! Notify the user if/when the socket is connected.
|
||||
* When the socket is connected the write_cb will be called.
|
||||
* \param[in] iofd the file descriptor */
|
||||
|
|
Loading…
Reference in New Issue