added more code for httpd

This commit is contained in:
2011-07-12 10:31:33 +00:00
parent ec02be14e5
commit fb574aa147
10 changed files with 1507 additions and 1172 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: fio.h 452 2011-05-04 15:11:23Z hyunghwan.chung $
* $Id: fio.h 504 2011-07-11 16:31:33Z hyunghwan.chung $
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
@ -55,7 +55,7 @@ enum qse_fio_open_flag_t
};
/* seek origin */
enum qse_fio_seek_origin_t
enum qse_fio_ori_t
{
QSE_FIO_BEGIN = 0,
QSE_FIO_CURRENT = 1,
@ -92,19 +92,10 @@ enum qse_fio_mode_t
#endif
/* file offset */
#if defined(QSE_HAVE_INT64_T) && (QSE_SIZEOF_OFF64_T==8)
typedef qse_int64_t qse_fio_off_t;
#elif defined(QSE_HAVE_INT64_T) && (QSE_SIZEOF_OFF_T==8)
typedef qse_int64_t qse_fio_off_t;
#elif defined(QSE_HAVE_INT32_T) && (QSE_SIZEOF_OFF_T==4)
typedef qse_int32_t qse_fio_off_t;
#elif defined(QSE_HAVE_INT16_T) && (QSE_SIZEOF_OFF_T==2)
typedef qse_int16_t qse_fio_off_t;
#else
# error Unsupported platform
#endif
typedef qse_foff_t qse_fio_off_t;
typedef enum qse_fio_seek_origin_t qse_fio_ori_t;
/* file origin for seek */
typedef enum qse_fio_ori_t qse_fio_ori_t;
typedef struct qse_fio_t qse_fio_t;
typedef struct qse_fio_lck_t qse_fio_lck_t;

View File

@ -1,5 +1,5 @@
/*
* $Id: str.h 500 2011-06-29 15:12:36Z hyunghwan.chung $
* $Id: str.h 504 2011-07-11 16:31:33Z hyunghwan.chung $
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
@ -2129,6 +2129,17 @@ int qse_wcstombs_strict (
qse_size_t mbslen
);
qse_wchar_t* qse_mbstowcsdup (
const qse_mchar_t* mbs,
qse_mmgr_t* mmgr
);
qse_mchar_t* qse_wcstombsdup (
const qse_wchar_t* wcs,
qse_mmgr_t* mmgr
);
QSE_DEFINE_COMMON_FUNCTIONS (mbs)
qse_mbs_t* qse_mbs_open (

View File

@ -66,7 +66,7 @@ struct qse_htrd_t
qse_htrd_errnum_t errnum;
int option;
qse_htrd_recbs_t recbs;
const qse_htrd_recbs_t* recbs;
struct
{

View File

@ -25,11 +25,23 @@
#include <qse/macros.h>
typedef struct qse_httpd_t qse_httpd_t;
struct qse_httpd_t
{
QSE_DEFINE_COMMON_FIELDS (httpd)
int stopreq;
enum qse_httpd_errnum_t
{
QSE_HTTPD_ENOERR,
QSE_HTTPD_ENOMEM,
QSE_HTTPD_EINVAL,
QSE_HTTPD_ESOCKET,
QSE_HTTPD_EINTERN,
QSE_HTTPD_ECOMCBS
};
typedef enum qse_httpd_errnum_t qse_httpd_errnum_t;
typedef struct qse_httpd_comcbs_t qse_httpd_comcbs_t;
struct qse_httpd_comcbs_t
{
int (*open_listeners) (qse_httpd_t* httpd);
int (*close_listeners) (qse_httpd_t* httpd);
};
#ifdef __cplusplus
@ -53,15 +65,28 @@ void qse_httpd_close (
qse_httpd_t* httpd
);
qse_httpd_t* qse_httpd_init (
void qse_httpd_setcomcbs (
qse_httpd_t* httpd,
qse_mmgr_t* mmgr
qse_httpd_comcbs_t* comcbs
);
void qse_httpd_fini (
int qse_httpd_loop (
qse_httpd_t* httpd
);
/**
* The qse_httpd_stop() function requests to stop qse_httpd_loop()
*/
void qse_httpd_stop (
qse_httpd_t* httpd
);
int qse_httpd_addlisteners (
qse_httpd_t* httpd,
const qse_char_t* uri
);
#ifdef __cplusplus
}
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: types.h 487 2011-06-04 16:22:20Z hyunghwan.chung $
* $Id: types.h 504 2011-07-11 16:31:33Z hyunghwan.chung $
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
@ -336,6 +336,7 @@ typedef qse_int_t qse_intptr_t;
typedef double qse_real_t;
#endif
/**
* The qse_mchar_t type defines a multi-byte character type.
*/
@ -561,4 +562,17 @@ struct qse_mmgr_t
};
typedef struct qse_mmgr_t qse_mmgr_t;
/* file offset */
#if defined(QSE_HAVE_INT64_T) && (QSE_SIZEOF_OFF64_T==8)
typedef qse_int64_t qse_foff_t;
#elif defined(QSE_HAVE_INT64_T) && (QSE_SIZEOF_OFF_T==8)
typedef qse_int64_t qse_foff_t;
#elif defined(QSE_HAVE_INT32_T) && (QSE_SIZEOF_OFF_T==4)
typedef qse_int32_t qse_foff_t;
#elif defined(QSE_HAVE_INT16_T) && (QSE_SIZEOF_OFF_T==2)
typedef qse_int16_t qse_foff_t;
#else
# error Unsupported platform
#endif
#endif