added hton,ntoh

renamed qse_getcmgrbyname() to qse_findcmgr()
added qse_setcmgrfinder()/qse_getcmgrfinder()
started adding ipad,nwad
This commit is contained in:
2012-02-13 14:43:50 +00:00
parent 35ac9924ac
commit b330d2c350
19 changed files with 1309 additions and 431 deletions

View File

@ -11,11 +11,14 @@ pkginclude_HEADERS = \
fs.h \
gdl.h \
htb.h \
hton.h \
ipad.h \
lda.h \
main.h \
map.h \
mbwc.h \
mem.h \
nwad.h \
oht.h \
opt.h \
path.h \

View File

@ -52,10 +52,10 @@ CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__pkginclude_HEADERS_DIST = alg.h chr.h dll.h env.h fio.h fma.h \
fmt.h fs.h gdl.h htb.h lda.h main.h map.h mbwc.h mem.h oht.h \
opt.h path.h pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h \
stdio.h str.h time.h tio.h tre.h utf8.h xma.h Mmgr.hpp \
StdMmgr.hpp Mmged.hpp
fmt.h fs.h gdl.h htb.h hton.h ipad.h lda.h main.h map.h mbwc.h \
mem.h nwad.h oht.h opt.h path.h pio.h pma.h rbt.h rex.h sio.h \
sll.h slmb.h stdio.h str.h time.h tio.h tre.h utf8.h xma.h \
Mmgr.hpp StdMmgr.hpp Mmged.hpp
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@ -229,9 +229,10 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
pkginclude_HEADERS = alg.h chr.h dll.h env.h fio.h fma.h fmt.h fs.h \
gdl.h htb.h lda.h main.h map.h mbwc.h mem.h oht.h opt.h path.h \
pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h stdio.h str.h \
time.h tio.h tre.h utf8.h xma.h $(am__append_1)
gdl.h htb.h hton.h ipad.h lda.h main.h map.h mbwc.h mem.h \
nwad.h oht.h opt.h path.h pio.h pma.h rbt.h rex.h sio.h sll.h \
slmb.h stdio.h str.h time.h tio.h tre.h utf8.h xma.h \
$(am__append_1)
all: all-am
.SUFFIXES:

View File

@ -0,0 +1,75 @@
/*
* $Id$
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
QSE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _QSE_CMN_HTON_H_
#define _QSE_CMN_HTON_H_
#include <qse/types.h>
#include <qse/macros.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(QSE_HAVE_UINT16_T)
qse_uint16_t qse_ntoh16 (
qse_uint16_t x
);
qse_uint16_t qse_hton16 (
qse_uint16_t x
);
#endif
#if defined(QSE_HAVE_UINT32_T)
qse_uint32_t qse_ntoh32 (
qse_uint32_t x
);
qse_uint32_t qse_hton32 (
qse_uint32_t x
);
#endif
#if defined(QSE_HAVE_UINT64_T)
qse_uint64_t qse_ntoh64 (
qse_uint64_t x
);
qse_uint64_t qse_hton64 (
qse_uint64_t x
);
#endif
#if defined(QSE_HAVE_UINT128_T)
qse_uint128_t qse_ntoh128 (
qse_uint128_t x
);
qse_uint128_t qse_hton128 (
qse_uint128_t x
);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,66 @@
/*
* $Id$
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
QSE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _QSE_CMN_IPAD_H_
#define _QSE_CMN_IPAD_H_
#include <qse/types.h>
#include <qse/macros.h>
typedef struct qse_ipad_t qse_ipad_t;
typedef struct qse_ipad4_t qse_ipad4_t;
typedef struct qse_ipad6_t qse_ipad6_t;
#include <qse/pack1.h>
struct qse_ipad4_t
{
qse_uint32_t value;
};
struct qse_ipad6_t
{
qse_uint8_t value[16];
};
#include <qse/unpack.h>
struct qse_ipad_t
{
enum
{
QSE_IPAD_IP4,
QSE_IPAD_IP6
} type;
union
{
qse_ipad4_t ip4;
qse_ipad4_t ip6;
} u;
};
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -28,6 +28,8 @@
#include <qse/types.h>
#include <qse/macros.h>
typedef qse_cmgr_t* (*qse_cmgr_finder_t) (const qse_char_t* name);
#ifdef __cplusplus
extern "C" {
#endif
@ -39,15 +41,23 @@ extern qse_cmgr_t* qse_utf8cmgr;
extern qse_cmgr_t* qse_slmbcmgr;
/**
* The qse_getcmgrbyname() function find a builtin cmgr matching a given
* The qse_getfindcmgr() function find a builtin cmgr matching a given
* @a name and returns it. It returns #QSE_NULL if no match is found.
* The @a name can be one of "utf8", "slmb", and an empty string. Calling this
* function with an empty string is the same as calling qse_getdflcmgr().
*/
qse_cmgr_t* qse_getcmgrbyname (
qse_cmgr_t* qse_findcmgr (
const qse_char_t* name
);
void qse_setcmgrfinder (
qse_cmgr_finder_t finder
);
qse_cmgr_finder_t qse_getcmgrfinder (
void
);
/* --------------------------------------------------- */
/* DEFAULT GLOBAL CMGR */
/* --------------------------------------------------- */

View File

@ -0,0 +1,52 @@
/*
* $Id$
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
QSE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _QSE_CMN_NWAD_H_
#define _QSE_CMN_NWAD_H_
#include <qse/types.h>
#include <qse/macros.h>
#include <qse/cmn/ipad.h>
struct qse_nwad_t
{
enum
{
QSE_NWAD_IP4,
QSE_NWAD_IP6
} type;
union
{
struct
{
qse_ipad4_t addr;
qse_uint16_t port;
} ip4;
struct
{
qse_ipad6_t addr;
qse_uint16_t port;
} ip6;
} u;
};
#endif

View File

@ -52,6 +52,14 @@ enum qse_httpd_option_t
QSE_HTTPD_CGINOCLOEXEC = (1 << 1)
};
typedef struct qse_httpd_stat_t qse_httpd_stat_t;
struct qse_httpd_stat_t
{
qse_foff_t size;
qse_ntime_t mtime;
const qse_mchar_t* mime;
};
typedef struct qse_httpd_cbs_t qse_httpd_cbs_t;
struct qse_httpd_cbs_t
{
@ -65,14 +73,16 @@ struct qse_httpd_cbs_t
struct
{
int (*executable) (qse_httpd_t* httpd, const qse_mchar_t* path);
} path;
int (*executable) (
qse_httpd_t* httpd, const qse_mchar_t* path);
struct
{
int (*stat) (
qse_httpd_t* httpd, const qse_mchar_t* path,
qse_httpd_stat_t* stat);
int (*ropen) (
qse_httpd_t* httpd, const qse_mchar_t* path,
qse_ubi_t* handle, qse_foff_t* size);
qse_ubi_t* handle);
int (*wopen) (
qse_httpd_t* httpd, const qse_mchar_t* path,
qse_ubi_t* handle);
@ -115,7 +125,6 @@ struct qse_httpd_cbs_t
int (*handle_request) (
qse_httpd_t* httpd, qse_httpd_client_t* client, qse_htre_t* req);
const qse_mchar_t* (*getmimetype) (qse_httpd_t* httpd, const qse_mchar_t* path);
int (*listdir) (qse_httpd_t* httpd, const qse_mchar_t* path);
};
@ -313,6 +322,14 @@ qse_httpd_task_t* qse_httpd_entaskcontinue (
qse_htre_t* req
);
qse_httpd_task_t* qse_httpd_entaskauth (
qse_httpd_t* httpd,
qse_httpd_client_t* client,
const qse_httpd_task_t* task,
const qse_mchar_t* realm,
qse_htre_t* req
);
qse_httpd_task_t* qse_httpd_entaskdir (
qse_httpd_t* httpd,
qse_httpd_client_t* client,