Loading...
Searching...
No Matches
async_read.h File Reference

Multiple asynchronous read on file descriptors. More...

Detailed Description

Multiple asynchronous read on file descriptors.

Author
Takuo Yonezawa Yonez.nosp@m.awa-.nosp@m.T2@ma.nosp@m.il.d.nosp@m.np.co.nosp@m..jp

Definition in file async_read.h.

#include <stdlib.h>
#include <poll.h>
+ Include dependency graph for async_read.h:

Go to the source code of this file.

Data Structures

struct  async_read_t
 Interrupt callback information structure. More...
 
#define ASYNC_READ_NUMOF   2
 Maximum number of file descriptors.
 
typedef void(* native_async_read_callback_t) (int fd, void *arg)
 asynchronous read callback type
 
void native_async_read_setup (void)
 initialize asynchronous read system
 
void native_async_read_cleanup (void)
 shutdown asynchronous read system
 
void native_async_read_continue (int fd)
 resume monitoring of file descriptors
 
void native_async_read_add_handler (int fd, void *arg, native_async_read_callback_t handler)
 start monitoring of file descriptor
 
void native_async_read_remove_handler (int fd)
 stop monitoring of file descriptor
 
void native_async_read_add_int_handler (int fd, void *arg, native_async_read_callback_t handler)
 start monitoring of file descriptor as interrupt
 

Macro Definition Documentation

◆ ASYNC_READ_NUMOF

#define ASYNC_READ_NUMOF   2

Maximum number of file descriptors.

Definition at line 32 of file async_read.h.

Typedef Documentation

◆ native_async_read_callback_t

typedef void(* native_async_read_callback_t) (int fd, void *arg)

asynchronous read callback type

Definition at line 38 of file async_read.h.

Function Documentation

◆ native_async_read_add_handler()

void native_async_read_add_handler ( int  fd,
void *  arg,
native_async_read_callback_t  handler 
)

start monitoring of file descriptor

Parameters
[in]fdThe file descriptor to monitor
[in]argPointer to be passed as arguments to the callback
[in]handlerThe callback function to be called when the file descriptor is ready to read.

◆ native_async_read_add_int_handler()

void native_async_read_add_int_handler ( int  fd,
void *  arg,
native_async_read_callback_t  handler 
)

start monitoring of file descriptor as interrupt

Parameters
[in]fdThe file descriptor to monitor
[in]argPointer to be passed as arguments to the callback
[in]handlerThe callback function to be called when the file descriptor is ready to read.

◆ native_async_read_cleanup()

void native_async_read_cleanup ( void  )

shutdown asynchronous read system

This deregisters SIGIO signal handler.

◆ native_async_read_continue()

void native_async_read_continue ( int  fd)

resume monitoring of file descriptors

Call this function after reading file descriptors.

Parameters
[in]fdThe file descriptor to monitor

◆ native_async_read_remove_handler()

void native_async_read_remove_handler ( int  fd)

stop monitoring of file descriptor

Parameters
[in]fdThe file descriptor to stop monitoring

◆ native_async_read_setup()

void native_async_read_setup ( void  )

initialize asynchronous read system

This registers SIGIO signal handler.