fixed some spacing
This commit is contained in:
parent
969a03b3c3
commit
b8ef500278
@ -84,7 +84,6 @@ struct QSE_AIO_PACKED qse_aio_ip6addr_t
|
|||||||
};
|
};
|
||||||
typedef struct qse_aio_ip6addr_t qse_aio_ip6addr_t;
|
typedef struct qse_aio_ip6addr_t qse_aio_ip6addr_t;
|
||||||
|
|
||||||
|
|
||||||
struct QSE_AIO_PACKED qse_aio_ethhdr_t
|
struct QSE_AIO_PACKED qse_aio_ethhdr_t
|
||||||
{
|
{
|
||||||
qse_uint8_t dest[QSE_AIO_ETHADDR_LEN];
|
qse_uint8_t dest[QSE_AIO_ETHADDR_LEN];
|
||||||
|
@ -230,7 +230,7 @@ struct qse_aio_wq_t
|
|||||||
|
|
||||||
#define QSE_AIO_DEV_HEADERS \
|
#define QSE_AIO_DEV_HEADERS \
|
||||||
qse_aio_t* aio; \
|
qse_aio_t* aio; \
|
||||||
qse_size_t dev_size; \
|
qse_size_t dev_size; \
|
||||||
int dev_capa; \
|
int dev_capa; \
|
||||||
qse_aio_dev_mth_t* dev_mth; \
|
qse_aio_dev_mth_t* dev_mth; \
|
||||||
qse_aio_dev_evcb_t* dev_evcb; \
|
qse_aio_dev_evcb_t* dev_evcb; \
|
||||||
@ -295,9 +295,9 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QSE_EXPORT qse_aio_t* qse_aio_open (
|
QSE_EXPORT qse_aio_t* qse_aio_open (
|
||||||
qse_mmgr_t* mmgr,
|
qse_mmgr_t* mmgr,
|
||||||
qse_size_t xtnsize,
|
qse_size_t xtnsize,
|
||||||
qse_size_t tmrcapa, /**< initial timer capacity */
|
qse_size_t tmrcapa, /**< initial timer capacity */
|
||||||
qse_aio_errnum_t* errnum
|
qse_aio_errnum_t* errnum
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -330,10 +330,10 @@ QSE_EXPORT void qse_aio_stop (
|
|||||||
|
|
||||||
QSE_EXPORT qse_aio_dev_t* qse_aio_makedev (
|
QSE_EXPORT qse_aio_dev_t* qse_aio_makedev (
|
||||||
qse_aio_t* aio,
|
qse_aio_t* aio,
|
||||||
qse_size_t dev_size,
|
qse_size_t dev_size,
|
||||||
qse_aio_dev_mth_t* dev_mth,
|
qse_aio_dev_mth_t* dev_mth,
|
||||||
qse_aio_dev_evcb_t* dev_evcb,
|
qse_aio_dev_evcb_t* dev_evcb,
|
||||||
void* make_ctx
|
void* make_ctx
|
||||||
);
|
);
|
||||||
|
|
||||||
QSE_EXPORT void qse_aio_killdev (
|
QSE_EXPORT void qse_aio_killdev (
|
||||||
@ -351,12 +351,12 @@ QSE_EXPORT int qse_aio_dev_watch (
|
|||||||
qse_aio_dev_t* dev,
|
qse_aio_dev_t* dev,
|
||||||
qse_aio_dev_watch_cmd_t cmd,
|
qse_aio_dev_watch_cmd_t cmd,
|
||||||
/** 0 or bitwise-ORed of #QSE_AIO_DEV_EVENT_IN and #QSE_AIO_DEV_EVENT_OUT */
|
/** 0 or bitwise-ORed of #QSE_AIO_DEV_EVENT_IN and #QSE_AIO_DEV_EVENT_OUT */
|
||||||
int events
|
int events
|
||||||
);
|
);
|
||||||
|
|
||||||
QSE_EXPORT int qse_aio_dev_read (
|
QSE_EXPORT int qse_aio_dev_read (
|
||||||
qse_aio_dev_t* dev,
|
qse_aio_dev_t* dev,
|
||||||
int enabled
|
int enabled
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -379,10 +379,10 @@ QSE_EXPORT int qse_aio_dev_write (
|
|||||||
|
|
||||||
QSE_EXPORT int qse_aio_dev_timedwrite (
|
QSE_EXPORT int qse_aio_dev_timedwrite (
|
||||||
qse_aio_dev_t* dev,
|
qse_aio_dev_t* dev,
|
||||||
const void* data,
|
const void* data,
|
||||||
qse_aio_iolen_t len,
|
qse_aio_iolen_t len,
|
||||||
const qse_ntime_t* tmout,
|
const qse_ntime_t* tmout,
|
||||||
void* wrctx,
|
void* wrctx,
|
||||||
const qse_aio_devaddr_t* dstaddr
|
const qse_aio_devaddr_t* dstaddr
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -424,7 +424,7 @@ QSE_EXPORT qse_aio_tmrjob_t* qse_aio_gettmrjob (
|
|||||||
QSE_EXPORT int qse_aio_gettmrjobdeadline (
|
QSE_EXPORT int qse_aio_gettmrjobdeadline (
|
||||||
qse_aio_t* aio,
|
qse_aio_t* aio,
|
||||||
qse_aio_tmridx_t index,
|
qse_aio_tmridx_t index,
|
||||||
qse_ntime_t* deadline
|
qse_ntime_t* deadline
|
||||||
);
|
);
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
@ -87,7 +87,7 @@ void qse_aio_closeasyncsck (qse_aio_t* aio, qse_aio_sckhnd_t sck)
|
|||||||
|
|
||||||
int qse_aio_makesckasync (qse_aio_t* aio, qse_aio_sckhnd_t sck)
|
int qse_aio_makesckasync (qse_aio_t* aio, qse_aio_sckhnd_t sck)
|
||||||
{
|
{
|
||||||
return qse_aio_makesyshndasync (aio, (qse_aio_syshnd_t)sck);
|
return qse_aio_makesyshndasync(aio, (qse_aio_syshnd_t)sck);
|
||||||
}
|
}
|
||||||
|
|
||||||
qse_aio_sckhnd_t qse_aio_openasyncsck (qse_aio_t* aio, int domain, int type, int proto)
|
qse_aio_sckhnd_t qse_aio_openasyncsck (qse_aio_t* aio, int domain, int type, int proto)
|
||||||
@ -451,7 +451,7 @@ static int dev_sck_make_client (qse_aio_dev_t* dev, void* ctx)
|
|||||||
qse_aio_dev_sck_t* rdev = (qse_aio_dev_sck_t*)dev;
|
qse_aio_dev_sck_t* rdev = (qse_aio_dev_sck_t*)dev;
|
||||||
qse_aio_syshnd_t* sck = (qse_aio_syshnd_t*)ctx;
|
qse_aio_syshnd_t* sck = (qse_aio_syshnd_t*)ctx;
|
||||||
|
|
||||||
/* nothing special is done here except setting the sock et handle.
|
/* nothing special is done here except setting the socket handle.
|
||||||
* most of the initialization is done by the listening socket device
|
* most of the initialization is done by the listening socket device
|
||||||
* after a client socket has been created. */
|
* after a client socket has been created. */
|
||||||
|
|
||||||
@ -1399,7 +1399,7 @@ static int dev_evcb_sck_ready_stateful (qse_aio_dev_t* dev, int events)
|
|||||||
qse_aio_scklen_t len;
|
qse_aio_scklen_t len;
|
||||||
|
|
||||||
len = QSE_SIZEOF(errcode);
|
len = QSE_SIZEOF(errcode);
|
||||||
if (getsockopt (rdev->sck, SOL_SOCKET, SO_ERROR, (char*)&errcode, &len) == -1)
|
if (getsockopt(rdev->sck, SOL_SOCKET, SO_ERROR, (char*)&errcode, &len) == -1)
|
||||||
{
|
{
|
||||||
/* the error number is set to the socket error code.
|
/* the error number is set to the socket error code.
|
||||||
* errno resulting from getsockopt() doesn't reflect the actual
|
* errno resulting from getsockopt() doesn't reflect the actual
|
||||||
|
@ -520,7 +520,7 @@ int main ()
|
|||||||
SSL_library_init ();
|
SSL_library_init ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aio = qse_aio_open (QSE_MMGR_GETDFL(), 0, 512, QSE_NULL);
|
aio = qse_aio_open(QSE_MMGR_GETDFL(), 0, 512, QSE_NULL);
|
||||||
if (!aio)
|
if (!aio)
|
||||||
{
|
{
|
||||||
printf ("Cannot open aio\n");
|
printf ("Cannot open aio\n");
|
||||||
@ -561,7 +561,7 @@ int main ()
|
|||||||
tcp_make.on_write = tcp_sck_on_write;
|
tcp_make.on_write = tcp_sck_on_write;
|
||||||
tcp_make.on_read = tcp_sck_on_read;
|
tcp_make.on_read = tcp_sck_on_read;
|
||||||
tcp_make.on_disconnect = tcp_sck_on_disconnect;
|
tcp_make.on_disconnect = tcp_sck_on_disconnect;
|
||||||
tcp[0] = qse_aio_dev_sck_make (aio, QSE_SIZEOF(tcp_server_t), &tcp_make);
|
tcp[0] = qse_aio_dev_sck_make(aio, QSE_SIZEOF(tcp_server_t), &tcp_make);
|
||||||
if (!tcp[0])
|
if (!tcp[0])
|
||||||
{
|
{
|
||||||
printf ("Cannot make tcp\n");
|
printf ("Cannot make tcp\n");
|
||||||
@ -581,7 +581,7 @@ int main ()
|
|||||||
qse_inittime (&tcp_conn.connect_tmout, 5, 0);
|
qse_inittime (&tcp_conn.connect_tmout, 5, 0);
|
||||||
tcp_conn.on_connect = tcp_sck_on_connect;
|
tcp_conn.on_connect = tcp_sck_on_connect;
|
||||||
tcp_conn.options = QSE_AIO_DEV_SCK_CONNECT_SSL;
|
tcp_conn.options = QSE_AIO_DEV_SCK_CONNECT_SSL;
|
||||||
if (qse_aio_dev_sck_connect (tcp[0], &tcp_conn) <= -1)
|
if (qse_aio_dev_sck_connect(tcp[0], &tcp_conn) <= -1)
|
||||||
{
|
{
|
||||||
printf ("qse_aio_dev_sck_connect() failed....\n");
|
printf ("qse_aio_dev_sck_connect() failed....\n");
|
||||||
/* carry on regardless of failure */
|
/* carry on regardless of failure */
|
||||||
@ -594,7 +594,7 @@ int main ()
|
|||||||
tcp_make.on_read = tcp_sck_on_read;
|
tcp_make.on_read = tcp_sck_on_read;
|
||||||
tcp_make.on_disconnect = tcp_sck_on_disconnect;
|
tcp_make.on_disconnect = tcp_sck_on_disconnect;
|
||||||
|
|
||||||
tcp[1] = qse_aio_dev_sck_make (aio, QSE_SIZEOF(tcp_server_t), &tcp_make);
|
tcp[1] = qse_aio_dev_sck_make(aio, QSE_SIZEOF(tcp_server_t), &tcp_make);
|
||||||
if (!tcp[1])
|
if (!tcp[1])
|
||||||
{
|
{
|
||||||
printf ("Cannot make tcp\n");
|
printf ("Cannot make tcp\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user