deprecated qse_ubi_t and introduced qse_httpd_hnd_t

This commit is contained in:
2014-09-16 14:14:51 +00:00
parent 3a30d67411
commit 94f015ea98
19 changed files with 195 additions and 330 deletions

View File

@ -234,9 +234,6 @@ QSE_EXPORT qse_fio_hnd_t qse_fio_gethandle (
const qse_fio_t* fio
);
QSE_EXPORT qse_ubi_t qse_fio_gethandleasubi (
const qse_fio_t* fio
);
/**
* The qse_fio_seek() function changes the current file position.

View File

@ -167,11 +167,6 @@ QSE_EXPORT qse_nwio_hnd_t qse_nwio_gethandle (
const qse_nwio_t* nwio
);
QSE_EXPORT qse_ubi_t qse_nwio_gethandleasubi (
const qse_nwio_t* nwio
);
QSE_EXPORT qse_cmgr_t* qse_nwio_getcmgr (
qse_nwio_t* nwio
);

View File

@ -299,16 +299,6 @@ QSE_EXPORT qse_pio_hnd_t qse_pio_gethandle (
qse_pio_hid_t hid /**< handle ID */
);
/**
* The qse_pio_gethandleasubi() function gets a pipe handle wrapped
* in the #qse_ubi_t type.
* @return pipe handle
*/
QSE_EXPORT qse_ubi_t qse_pio_gethandleasubi (
const qse_pio_t* pio, /**< pio object */
qse_pio_hid_t hid /**< handle ID */
);
/**
* The qse_pio_getchild() function gets a process handle.
* @return process handle

View File

@ -201,10 +201,6 @@ QSE_EXPORT qse_sio_hnd_t qse_sio_gethandle (
const qse_sio_t* sio
);
QSE_EXPORT qse_ubi_t qse_sio_gethandleasubi (
const qse_sio_t* sio
);
/**
* The qse_sio_getpath() returns the file path used to open the stream.
* It returns #QSE_NULL if #QSE_SIO_HANDLE was on or #QSE_SIO_KEEPPATH

View File

@ -36,6 +36,8 @@ typedef struct qse_httpd_client_t qse_httpd_client_t;
typedef struct qse_httpd_dns_t qse_httpd_dns_t;
typedef struct qse_httpd_urs_t qse_httpd_urs_t;
typedef qse_intptr_t qse_httpd_hnd_t;
enum qse_httpd_errnum_t
{
QSE_HTTPD_ENOERR,
@ -87,8 +89,6 @@ enum qse_httpd_trait_t
};
typedef enum qse_httpd_trait_t qse_httpd_trait_t;
typedef struct qse_httpd_mod_t qse_httpd_mod_t;
typedef int (*qse_httpd_mod_load_t) (
@ -149,7 +149,7 @@ struct qse_httpd_peer_t
{
qse_nwad_t nwad;
qse_nwad_t local; /* local side address facing the peer */
qse_ubi_t handle;
qse_httpd_hnd_t handle;
};
enum qse_httpd_mux_mask_t
@ -161,7 +161,7 @@ enum qse_httpd_mux_mask_t
typedef int (*qse_httpd_muxcb_t) (
qse_httpd_t* httpd,
void* mux,
qse_ubi_t handle,
qse_httpd_hnd_t handle,
int mask, /* ORed of qse_httpd_mux_mask_t */
void* cbarg
);
@ -244,7 +244,7 @@ typedef void (*qse_httpd_urs_close_t) (
typedef int (*qse_httpd_urs_recv_t) (
qse_httpd_t* httpd,
qse_httpd_urs_t* urs,
qse_ubi_t handle
qse_httpd_hnd_t handle
);
typedef int (*qse_httpd_urs_send_t) (
@ -318,12 +318,12 @@ struct qse_httpd_scb_t
{
void* (*open) (qse_httpd_t* httpd, qse_httpd_muxcb_t muxcb);
void (*close) (qse_httpd_t* httpd, void* mux);
int (*addhnd) (qse_httpd_t* httpd, void* mux, qse_ubi_t handle, int mask, void* cbarg);
int (*delhnd) (qse_httpd_t* httpd, void* mux, qse_ubi_t handle);
int (*addhnd) (qse_httpd_t* httpd, void* mux, qse_httpd_hnd_t handle, int mask, void* cbarg);
int (*delhnd) (qse_httpd_t* httpd, void* mux, qse_httpd_hnd_t handle);
int (*poll) (qse_httpd_t* httpd, void* mux, const qse_ntime_t* tmout);
int (*readable) (qse_httpd_t* httpd, qse_ubi_t handle, const qse_ntime_t* tmout);
int (*writable) (qse_httpd_t* httpd, qse_ubi_t handle, const qse_ntime_t* tmout);
int (*readable) (qse_httpd_t* httpd, qse_httpd_hnd_t handle, const qse_ntime_t* tmout);
int (*writable) (qse_httpd_t* httpd, qse_httpd_hnd_t handle, const qse_ntime_t* tmout);
} mux;
struct
@ -333,17 +333,17 @@ struct qse_httpd_scb_t
int (*ropen) (
qse_httpd_t* httpd, const qse_mchar_t* path,
qse_ubi_t* handle);
qse_httpd_hnd_t* handle);
int (*wopen) (
qse_httpd_t* httpd, const qse_mchar_t* path,
qse_ubi_t* handle);
void (*close) (qse_httpd_t* httpd, qse_ubi_t handle);
qse_httpd_hnd_t* handle);
void (*close) (qse_httpd_t* httpd, qse_httpd_hnd_t handle);
qse_ssize_t (*read) (
qse_httpd_t* httpd, qse_ubi_t handle,
qse_httpd_t* httpd, qse_httpd_hnd_t handle,
qse_mchar_t* buf, qse_size_t len);
qse_ssize_t (*write) (
qse_httpd_t* httpd, qse_ubi_t handle,
qse_httpd_t* httpd, qse_httpd_hnd_t handle,
const qse_mchar_t* buf, qse_size_t len);
} file;
@ -357,10 +357,10 @@ struct qse_httpd_scb_t
int (*open) (
qse_httpd_t* httpd, const qse_mchar_t* path,
qse_ubi_t* handle);
void (*close) (qse_httpd_t* httpd, qse_ubi_t handle);
qse_httpd_hnd_t* handle);
void (*close) (qse_httpd_t* httpd, qse_httpd_hnd_t handle);
int (*read) (
qse_httpd_t* httpd, qse_ubi_t handle,
qse_httpd_t* httpd, qse_httpd_hnd_t handle,
qse_httpd_dirent_t* ent);
} dir;
@ -388,7 +388,7 @@ struct qse_httpd_scb_t
qse_ssize_t (*sendfile) (
qse_httpd_t* httpd,
qse_httpd_client_t* client,
qse_ubi_t handle, qse_foff_t* offset, qse_size_t count);
qse_httpd_hnd_t handle, qse_foff_t* offset, qse_size_t count);
/* event notification */
int (*accepted) (
@ -403,7 +403,7 @@ struct qse_httpd_scb_t
{
int (*open) (qse_httpd_t* httpd, qse_httpd_dns_t* dns);
void (*close) (qse_httpd_t* httpd, qse_httpd_dns_t* dns);
int (*recv) (qse_httpd_t* httpd, qse_httpd_dns_t* dns, qse_ubi_t handle);
int (*recv) (qse_httpd_t* httpd, qse_httpd_dns_t* dns, qse_httpd_hnd_t handle);
int (*send) (qse_httpd_t* httpd, qse_httpd_dns_t* dns,
const qse_mchar_t* name, qse_httpd_resolve_t resol,
const qse_httpd_dns_server_t* dns_server, void* ctx);
@ -531,7 +531,7 @@ struct qse_httpd_task_trigger_t
struct
{
int mask; /* QSE_HTTPD_TASK_TRIGGER_READ | QSE_HTTPD_TASK_TRIGGER_WRITE */
qse_ubi_t handle;
qse_httpd_hnd_t handle;
} v[QSE_HTTPD_TASK_TRIGGER_MAX];
};
@ -573,8 +573,8 @@ struct qse_httpd_client_t
QSE_HTTPD_MATE_HDR;
/* == PUBLIC == */
qse_ubi_t handle;
qse_ubi_t handle2;
qse_httpd_hnd_t handle;
qse_httpd_hnd_t handle2;
qse_nwad_t remote_addr;
qse_nwad_t local_addr;
qse_nwad_t orgdst_addr;
@ -649,7 +649,7 @@ struct qse_httpd_server_t
qse_httpd_server_dope_t dope;
/* set by server.open callback */
qse_ubi_t handle;
qse_httpd_hnd_t handle;
/* private */
qse_httpd_t* httpd;
@ -664,7 +664,7 @@ struct qse_httpd_dns_t
QSE_HTTPD_MATE_HDR;
/* == PUBLIC == */
qse_ubi_t handle[5];
qse_httpd_hnd_t handle[5];
/* the number of effective slots in the handle array */
int handle_count;
@ -681,7 +681,7 @@ struct qse_httpd_urs_t
QSE_HTTPD_MATE_HDR;
/* == PUBLIC == */
qse_ubi_t handle[5];
qse_httpd_hnd_t handle[5];
int handle_count;
unsigned long handle_mask;
void* ctx;

View File

@ -28,6 +28,8 @@
typedef struct qse_upxd_t qse_upxd_t;
typedef qse_intptr_t qse_upxd_hnd_t;
enum qse_upxd_errnum_t
{
QSE_UPXD_ENOERR,
@ -52,7 +54,7 @@ typedef struct qse_upxd_session_t qse_upxd_session_t;
typedef struct qse_upxd_sock_t qse_upxd_sock_t;
struct qse_upxd_sock_t
{
qse_ubi_t handle;
qse_upxd_hnd_t handle;
qse_nwad_t bind;
const qse_char_t* dev;
qse_nwad_t from;
@ -89,7 +91,7 @@ struct qse_upxd_session_t
typedef int (*qse_upxd_muxcb_t) (
qse_upxd_t* upxd,
void* mux,
qse_ubi_t handle,
qse_upxd_hnd_t handle,
void* cbarg
);
@ -121,9 +123,9 @@ struct qse_upxd_cbs_t
void* (*open) (qse_upxd_t* upxd);
void (*close) (qse_upxd_t* upxd, void* mux);
int (*addhnd) (
qse_upxd_t* upxd, void* mux, qse_ubi_t handle,
qse_upxd_t* upxd, void* mux, qse_upxd_hnd_t handle,
qse_upxd_muxcb_t cbfun, void* cbarg);
int (*delhnd) (qse_upxd_t* upxd, void* mux, qse_ubi_t handle);
int (*delhnd) (qse_upxd_t* upxd, void* mux, qse_upxd_hnd_t handle);
int (*poll) (qse_upxd_t* upxd, void* mux, qse_ntime_t timeout);
} mux;
};

View File

@ -748,70 +748,6 @@ typedef struct qse_tmgr_t qse_tmgr_t;
# error Unsupported platform
#endif
/**
* The qse_ubi_t type defines a union type that includes most of built-in
* data types and numeric types defined in the library.
*/
union qse_ubi_t
{
char c;
unsigned char uc;
short s;
unsigned short us;
int i;
unsigned int ui;
long l;
unsigned long ul;
#if defined(QSE_SIZEOF_LONG_LONG) && (QSE_SIZEOF_LONG_LONG > 0)
long long ll;
unsigned long long ull;
#endif
float f;
double d;
#if defined(QSE_SIZEOF_LONG_DOUBLE) && (QSE_SIZEOF_LONG_DOUBLE > 0)
long double ld;
#endif
void* ptr;
qse_byte_t byte;
qse_int_t sint;
qse_uint_t uint;
qse_long_t slong;
qse_ulong_t ulong;
qse_size_t size;
qse_ssize_t ssize;
qse_word_t word;
qse_intptr_t intptr;
qse_uintptr_t uintptr;
qse_intmax_t intmax;
qse_uintmax_t uintmax;
qse_flt_t flt;
qse_char_t ch;
qse_mchar_t mch;
qse_wchar_t wch;
qse_cint_t cint;
qse_mcint_t mcint;
qse_wcint_t wcint;
qse_int8_t int8;
qse_uint8_t uint8;
qse_int16_t int16;
qse_uint16_t uint16;
qse_int32_t int32;
qse_uint32_t uint32;
#if defined(QSE_HAVE_INT64_T)
qse_int64_t int64;
qse_uint64_t uint64;
#endif
#if defined(QSE_HAVE_INT128_T)
qse_int128_t int128;
qse_uint128_t uint128;
#endif
qse_foff_t foff;
};
typedef union qse_ubi_t qse_ubi_t;
/*
* Note QSE_MBLEN_MAX was set to 2 when autoconf ran for _WIN32
* with mingw32. This is bad since it can't handle UTF-8. Here are