added qse_dir_t.
added qse_mux_t. added dir::xxx() for awk
This commit is contained in:
parent
a3ee069804
commit
7e509d4daa
@ -1432,11 +1432,6 @@ QSE_EXPORT int qse_awk_close (
|
|||||||
qse_awk_t* awk /**< awk */
|
qse_awk_t* awk /**< awk */
|
||||||
);
|
);
|
||||||
|
|
||||||
QSE_EXPORT void qse_awk_setmmgr (
|
|
||||||
qse_awk_t* awk,
|
|
||||||
qse_mmgr_t* mmgr
|
|
||||||
);
|
|
||||||
|
|
||||||
QSE_EXPORT qse_mmgr_t* qse_awk_getmmgr (
|
QSE_EXPORT qse_mmgr_t* qse_awk_getmmgr (
|
||||||
qse_awk_t* awk
|
qse_awk_t* awk
|
||||||
);
|
);
|
||||||
|
@ -5,6 +5,7 @@ pkginclude_HEADERS = \
|
|||||||
chr.h \
|
chr.h \
|
||||||
cp949.h \
|
cp949.h \
|
||||||
cp950.h \
|
cp950.h \
|
||||||
|
dir.h \
|
||||||
dll.h \
|
dll.h \
|
||||||
env.h \
|
env.h \
|
||||||
fio.h \
|
fio.h \
|
||||||
@ -21,6 +22,7 @@ pkginclude_HEADERS = \
|
|||||||
map.h \
|
map.h \
|
||||||
mbwc.h \
|
mbwc.h \
|
||||||
mem.h \
|
mem.h \
|
||||||
|
mux.h \
|
||||||
nwad.h \
|
nwad.h \
|
||||||
nwif.h \
|
nwif.h \
|
||||||
nwio.h \
|
nwio.h \
|
||||||
|
@ -52,12 +52,12 @@ CONFIG_CLEAN_FILES =
|
|||||||
CONFIG_CLEAN_VPATH_FILES =
|
CONFIG_CLEAN_VPATH_FILES =
|
||||||
SOURCES =
|
SOURCES =
|
||||||
DIST_SOURCES =
|
DIST_SOURCES =
|
||||||
am__pkginclude_HEADERS_DIST = alg.h chr.h cp949.h cp950.h dll.h env.h \
|
am__pkginclude_HEADERS_DIST = alg.h chr.h cp949.h cp950.h dir.h dll.h \
|
||||||
fio.h fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h lda.h \
|
env.h fio.h fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h \
|
||||||
main.h map.h mbwc.h mem.h nwad.h nwif.h nwio.h oht.h opt.h \
|
lda.h main.h map.h mbwc.h mem.h mux.h nwad.h nwif.h nwio.h \
|
||||||
path.h pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h stdio.h \
|
oht.h opt.h path.h pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h \
|
||||||
str.h task.h time.h tio.h tre.h uri.h utf8.h xma.h Mmgr.hpp \
|
stdio.h str.h task.h time.h tio.h tre.h uri.h utf8.h xma.h \
|
||||||
StdMmgr.hpp Mmged.hpp
|
Mmgr.hpp StdMmgr.hpp Mmged.hpp
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||||
am__vpath_adj = case $$p in \
|
am__vpath_adj = case $$p in \
|
||||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||||
@ -262,11 +262,12 @@ target_alias = @target_alias@
|
|||||||
top_build_prefix = @top_build_prefix@
|
top_build_prefix = @top_build_prefix@
|
||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
pkginclude_HEADERS = alg.h chr.h cp949.h cp950.h dll.h env.h fio.h \
|
pkginclude_HEADERS = alg.h chr.h cp949.h cp950.h dir.h dll.h env.h \
|
||||||
fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h lda.h main.h \
|
fio.h fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h lda.h \
|
||||||
map.h mbwc.h mem.h nwad.h nwif.h nwio.h oht.h opt.h path.h \
|
main.h map.h mbwc.h mem.h mux.h nwad.h nwif.h nwio.h oht.h \
|
||||||
pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h stdio.h str.h \
|
opt.h path.h pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h \
|
||||||
task.h time.h tio.h tre.h uri.h utf8.h xma.h $(am__append_1)
|
stdio.h str.h task.h time.h tio.h tre.h uri.h utf8.h xma.h \
|
||||||
|
$(am__append_1)
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
108
qse/include/qse/cmn/dir.h
Normal file
108
qse/include/qse/cmn/dir.h
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
Copyright 2006-2012 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_DIR_H_
|
||||||
|
#define _QSE_DIR_H_
|
||||||
|
|
||||||
|
/** @file
|
||||||
|
* This file provides functions and data types for I/O multiplexing.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <qse/types.h>
|
||||||
|
#include <qse/macros.h>
|
||||||
|
#include <qse/cmn/time.h>
|
||||||
|
|
||||||
|
typedef struct qse_dir_t qse_dir_t;
|
||||||
|
typedef struct qse_dir_ent_t qse_dir_ent_t;
|
||||||
|
|
||||||
|
enum qse_dir_errnum_t
|
||||||
|
{
|
||||||
|
QSE_DIR_ENOERR = 0, /**< no error */
|
||||||
|
QSE_DIR_EOTHER, /**< other error */
|
||||||
|
QSE_DIR_ENOIMPL, /**< not implemented */
|
||||||
|
QSE_DIR_ESYSERR, /**< subsystem(system call) error */
|
||||||
|
QSE_DIR_EINTERN, /**< internal error */
|
||||||
|
|
||||||
|
QSE_DIR_ENOMEM, /**< out of memory */
|
||||||
|
QSE_DIR_EINVAL, /**< invalid parameter */
|
||||||
|
QSE_DIR_EACCES, /**< access denied */
|
||||||
|
QSE_DIR_ENOENT, /**< no such file */
|
||||||
|
QSE_DIR_EEXIST, /**< already exist */
|
||||||
|
QSE_DIR_EINTR /**< interrupted */
|
||||||
|
};
|
||||||
|
typedef enum qse_dir_errnum_t qse_dir_errnum_t;
|
||||||
|
|
||||||
|
enum qse_dir_flag_t
|
||||||
|
{
|
||||||
|
QSE_DIR_MBSPATH = (1 << 0),
|
||||||
|
QSE_DIR_SORT = (1 << 1),
|
||||||
|
QSE_DIR_STAT = (1 << 2)
|
||||||
|
};
|
||||||
|
|
||||||
|
struct qse_dir_ent_t
|
||||||
|
{
|
||||||
|
const qse_char_t* name;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
int type;
|
||||||
|
qse_foff_t size;
|
||||||
|
qse_ntime_t tmmod;
|
||||||
|
} stat;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
qse_dir_t* qse_dir_open (
|
||||||
|
qse_mmgr_t* mmgr,
|
||||||
|
qse_size_t xtnsize,
|
||||||
|
const qse_char_t* path,
|
||||||
|
int flags
|
||||||
|
);
|
||||||
|
|
||||||
|
void qse_dir_close (
|
||||||
|
qse_dir_t* dir
|
||||||
|
);
|
||||||
|
|
||||||
|
qse_mmgr_t* qse_dir_getmmgr (
|
||||||
|
qse_dir_t* dir
|
||||||
|
);
|
||||||
|
|
||||||
|
void* qse_dir_getxtn (
|
||||||
|
qse_dir_t* dir
|
||||||
|
);
|
||||||
|
|
||||||
|
int qse_dir_reset (
|
||||||
|
qse_dir_t* dir,
|
||||||
|
const qse_char_t* path
|
||||||
|
);
|
||||||
|
|
||||||
|
int qse_dir_read (
|
||||||
|
qse_dir_t* dir,
|
||||||
|
qse_dir_ent_t* ent
|
||||||
|
);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -66,15 +66,6 @@ int qse_glob (
|
|||||||
qse_mmgr_t* mmgr
|
qse_mmgr_t* mmgr
|
||||||
);
|
);
|
||||||
|
|
||||||
int qse_globwithcmgr (
|
|
||||||
const qse_char_t* pattern,
|
|
||||||
qse_glob_cbimpl_t cbimpl,
|
|
||||||
void* cbctx,
|
|
||||||
int flags,
|
|
||||||
qse_mmgr_t* mmgr,
|
|
||||||
qse_cmgr_t* cmgr
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
123
qse/include/qse/cmn/mux.h
Normal file
123
qse/include/qse/cmn/mux.h
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
Copyright 2006-2012 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_MUX_H_
|
||||||
|
#define _QSE_MUX_H_
|
||||||
|
|
||||||
|
/** @file
|
||||||
|
* This file provides functions and data types for I/O multiplexing.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <qse/types.h>
|
||||||
|
#include <qse/macros.h>
|
||||||
|
#include <qse/cmn/time.h>
|
||||||
|
|
||||||
|
typedef struct qse_mux_t qse_mux_t;
|
||||||
|
typedef struct qse_mux_evt_t qse_mux_evt_t;
|
||||||
|
|
||||||
|
enum qse_mux_errnum_t
|
||||||
|
{
|
||||||
|
QSE_MUX_ENOERR = 0, /**< no error */
|
||||||
|
QSE_MUX_EOTHER, /**< other error */
|
||||||
|
QSE_MUX_ENOIMPL, /**< not implemented */
|
||||||
|
QSE_MUX_ESYSERR, /**< subsystem(system call) error */
|
||||||
|
QSE_MUX_EINTERN, /**< internal error */
|
||||||
|
|
||||||
|
QSE_MUX_ENOMEM, /**< out of memory */
|
||||||
|
QSE_MUX_EINVAL, /**< invalid parameter */
|
||||||
|
QSE_MUX_EACCES, /**< access denied */
|
||||||
|
QSE_MUX_ENOENT, /**< no such file */
|
||||||
|
QSE_MUX_EEXIST, /**< already exist */
|
||||||
|
QSE_MUX_EINTR /**< interrupted */
|
||||||
|
};
|
||||||
|
typedef enum qse_mux_errnum_t qse_mux_errnum_t;
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
typedef qse_uintptr_t qse_mux_hnd_t;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
typedef int qse_mux_hnd_t;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
typedef int qse_mux_hnd_t;
|
||||||
|
#else
|
||||||
|
typedef int qse_mux_hnd_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
enum qse_mux_evtmask_t
|
||||||
|
{
|
||||||
|
QSE_MUX_IN = (1 << 0),
|
||||||
|
QSE_MUX_OUT = (1 << 1)
|
||||||
|
};
|
||||||
|
typedef enum qse_mux_evtmask_t qse_mux_evtmask_t;
|
||||||
|
|
||||||
|
typedef void (*qse_mux_evtfun_t) (
|
||||||
|
qse_mux_t* mux,
|
||||||
|
const qse_mux_evt_t* evt
|
||||||
|
);
|
||||||
|
|
||||||
|
struct qse_mux_evt_t
|
||||||
|
{
|
||||||
|
qse_mux_hnd_t hnd;
|
||||||
|
int mask;
|
||||||
|
void* data;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
qse_mux_t* qse_mux_open (
|
||||||
|
qse_mmgr_t* mmgr,
|
||||||
|
qse_size_t xtnsize,
|
||||||
|
qse_mux_evtfun_t evtfun,
|
||||||
|
qse_size_t capahint
|
||||||
|
);
|
||||||
|
|
||||||
|
void qse_mux_close (
|
||||||
|
qse_mux_t* mux
|
||||||
|
);
|
||||||
|
|
||||||
|
qse_mmgr_t* qse_mux_getmmgr (
|
||||||
|
qse_mux_t* mux
|
||||||
|
);
|
||||||
|
|
||||||
|
void* qse_mux_getxtn (
|
||||||
|
qse_mux_t* mux
|
||||||
|
);
|
||||||
|
|
||||||
|
int qse_mux_insert (
|
||||||
|
qse_mux_t* mux,
|
||||||
|
const qse_mux_evt_t* evt
|
||||||
|
);
|
||||||
|
|
||||||
|
int qse_mux_delete (
|
||||||
|
qse_mux_t* mux,
|
||||||
|
const qse_mux_evt_t* evt
|
||||||
|
);
|
||||||
|
|
||||||
|
int qse_mux_poll (
|
||||||
|
qse_mux_t* mux,
|
||||||
|
qse_ntime_t timeout
|
||||||
|
);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -80,13 +80,13 @@ struct qse_nwio_tmout_t
|
|||||||
typedef struct qse_nwio_tmout_t qse_nwio_tmout_t;
|
typedef struct qse_nwio_tmout_t qse_nwio_tmout_t;
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
typedef qse_intptr_t qse_nwio_hnd_t;
|
typedef qse_uintptr_t qse_nwio_hnd_t;
|
||||||
#elif defined(__OS2__)
|
#elif defined(__OS2__)
|
||||||
typedef int qse_nwio_hnd_t; /**< defines a pipe handle type */
|
typedef int qse_nwio_hnd_t;
|
||||||
#elif defined(__DOS__)
|
#elif defined(__DOS__)
|
||||||
typedef int qse_nwio_hnd_t; /**< defines a pipe handle type */
|
typedef int qse_nwio_hnd_t;
|
||||||
#else
|
#else
|
||||||
typedef int qse_nwio_hnd_t; /**< defines a pipe handle type */
|
typedef int qse_nwio_hnd_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct qse_nwio_t qse_nwio_t;
|
typedef struct qse_nwio_t qse_nwio_t;
|
||||||
|
@ -49,6 +49,17 @@ enum qse_canonpath_flag_t
|
|||||||
QSE_CANONPATH_DROPTRAILINGSEP = (1 << 2)
|
QSE_CANONPATH_DROPTRAILINGSEP = (1 << 2)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__)
|
||||||
|
# define QSE_ISPATHSEP(c) ((c) == QSE_T('/') || (c) == QSE_T('\\'))
|
||||||
|
# define QSE_ISPATHMBSEP(c) ((c) == QSE_MT('/') || (c) == QSE_MT('\\'))
|
||||||
|
# define QSE_ISPATHWCSEP(c) ((c) == QSE_WT('/') || (c) == QSE_WT('\\'))
|
||||||
|
#else
|
||||||
|
# define QSE_ISPATHSEP(c) ((c) == QSE_T('/'))
|
||||||
|
# define QSE_ISPATHMBSEP(c) ((c) == QSE_MT('/'))
|
||||||
|
# define QSE_ISPATHWCSEP(c) ((c) == QSE_WT('/'))
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -329,7 +329,6 @@
|
|||||||
* of a relevant object created with an extension size greater than 0.
|
* of a relevant object created with an extension size greater than 0.
|
||||||
*/
|
*/
|
||||||
#define QSE_DEFINE_COMMON_FUNCTIONS(name) \
|
#define QSE_DEFINE_COMMON_FUNCTIONS(name) \
|
||||||
void qse_##name##_setmmgr (qse_##name##_t* name, qse_mmgr_t* mmgr); \
|
|
||||||
qse_mmgr_t* qse_##name##_getmmgr (qse_##name##_t* name); \
|
qse_mmgr_t* qse_##name##_getmmgr (qse_##name##_t* name); \
|
||||||
void* qse_##name##_getxtn (qse_##name##_t* name);
|
void* qse_##name##_getxtn (qse_##name##_t* name);
|
||||||
|
|
||||||
@ -345,10 +344,6 @@ void* qse_##name##_getxtn (qse_##name##_t* name);
|
|||||||
* an object.
|
* an object.
|
||||||
*/
|
*/
|
||||||
#define QSE_IMPLEMENT_COMMON_FUNCTIONS(name) \
|
#define QSE_IMPLEMENT_COMMON_FUNCTIONS(name) \
|
||||||
void qse_##name##_setmmgr (qse_##name##_t* name, qse_mmgr_t* mmgr) \
|
|
||||||
{ \
|
|
||||||
(name)->mmgr = mmgr; \
|
|
||||||
} \
|
|
||||||
qse_mmgr_t* qse_##name##_getmmgr (qse_##name##_t* name) \
|
qse_mmgr_t* qse_##name##_getmmgr (qse_##name##_t* name) \
|
||||||
{ \
|
{ \
|
||||||
return (name)->mmgr; \
|
return (name)->mmgr; \
|
||||||
|
@ -135,11 +135,6 @@ QSE_EXPORT void qse_htrd_fini (
|
|||||||
qse_htrd_t* htrd
|
qse_htrd_t* htrd
|
||||||
);
|
);
|
||||||
|
|
||||||
QSE_EXPORT void qse_htrd_setmmgr (
|
|
||||||
qse_htrd_t* htrd,
|
|
||||||
qse_mmgr_t* mmgr
|
|
||||||
);
|
|
||||||
|
|
||||||
QSE_EXPORT qse_mmgr_t* qse_htrd_getmmgr (
|
QSE_EXPORT qse_mmgr_t* qse_htrd_getmmgr (
|
||||||
qse_htrd_t* htrd
|
qse_htrd_t* htrd
|
||||||
);
|
);
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <qse/cmn/time.h>
|
#include <qse/cmn/time.h>
|
||||||
|
|
||||||
typedef struct qse_httpd_t qse_httpd_t;
|
typedef struct qse_httpd_t qse_httpd_t;
|
||||||
|
typedef struct qse_httpd_server_t qse_httpd_server_t;
|
||||||
typedef struct qse_httpd_client_t qse_httpd_client_t;
|
typedef struct qse_httpd_client_t qse_httpd_client_t;
|
||||||
|
|
||||||
enum qse_httpd_errnum_t
|
enum qse_httpd_errnum_t
|
||||||
@ -73,36 +74,6 @@ struct qse_httpd_stat_t
|
|||||||
qse_ntime_t mtime;
|
qse_ntime_t mtime;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum qse_httpd_server_flag_t
|
|
||||||
{
|
|
||||||
QSE_HTTPD_SERVER_ACTIVE = (1 << 0),
|
|
||||||
QSE_HTTPD_SERVER_SECURE = (1 << 1),
|
|
||||||
QSE_HTTPD_SERVER_BINDTONWIF = (1 << 2)
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct qse_httpd_server_t qse_httpd_server_t;
|
|
||||||
|
|
||||||
typedef void (*qse_httpd_server_predetach_t) (
|
|
||||||
qse_httpd_t* httpd,
|
|
||||||
qse_httpd_server_t* server
|
|
||||||
);
|
|
||||||
|
|
||||||
struct qse_httpd_server_t
|
|
||||||
{
|
|
||||||
/* ---------------------------------------------- */
|
|
||||||
int flags;
|
|
||||||
qse_nwad_t nwad; /* binding address */
|
|
||||||
unsigned int nwif; /* interface number to bind to */
|
|
||||||
|
|
||||||
/* set by server.open callback */
|
|
||||||
qse_ubi_t handle;
|
|
||||||
|
|
||||||
/* private */
|
|
||||||
qse_httpd_server_predetach_t predetach;
|
|
||||||
qse_httpd_server_t* next;
|
|
||||||
qse_httpd_server_t* prev;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct qse_httpd_peer_t qse_httpd_peer_t;
|
typedef struct qse_httpd_peer_t qse_httpd_peer_t;
|
||||||
struct qse_httpd_peer_t
|
struct qse_httpd_peer_t
|
||||||
{
|
{
|
||||||
@ -162,11 +133,9 @@ struct qse_httpd_scb_t
|
|||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
void* (*open) (qse_httpd_t* httpd);
|
void* (*open) (qse_httpd_t* httpd, qse_httpd_muxcb_t muxcb);
|
||||||
void (*close) (qse_httpd_t* httpd, void* mux);
|
void (*close) (qse_httpd_t* httpd, void* mux);
|
||||||
int (*addhnd) (
|
int (*addhnd) (qse_httpd_t* httpd, void* mux, qse_ubi_t handle, int mask, void* cbarg);
|
||||||
qse_httpd_t* httpd, void* mux, qse_ubi_t handle,
|
|
||||||
int mask, qse_httpd_muxcb_t cbfun, void* cbarg);
|
|
||||||
int (*delhnd) (qse_httpd_t* httpd, void* mux, qse_ubi_t handle);
|
int (*delhnd) (qse_httpd_t* httpd, void* mux, qse_ubi_t handle);
|
||||||
int (*poll) (qse_httpd_t* httpd, void* mux, qse_ntime_t timeout);
|
int (*poll) (qse_httpd_t* httpd, void* mux, qse_ntime_t timeout);
|
||||||
|
|
||||||
@ -266,6 +235,8 @@ struct qse_httpd_rcb_t
|
|||||||
qse_mchar_t* buf, int bufsz);
|
qse_mchar_t* buf, int bufsz);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
typedef struct qse_httpd_task_t qse_httpd_task_t;
|
typedef struct qse_httpd_task_t qse_httpd_task_t;
|
||||||
|
|
||||||
typedef int (*qse_httpd_task_init_t) (
|
typedef int (*qse_httpd_task_init_t) (
|
||||||
@ -286,7 +257,6 @@ typedef int (*qse_httpd_task_main_t) (
|
|||||||
qse_httpd_task_t* task
|
qse_httpd_task_t* task
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
enum qse_httpd_task_trigger_mask_t
|
enum qse_httpd_task_trigger_mask_t
|
||||||
{
|
{
|
||||||
QSE_HTTPD_TASK_TRIGGER_READ = (1 << 0),
|
QSE_HTTPD_TASK_TRIGGER_READ = (1 << 0),
|
||||||
@ -322,11 +292,19 @@ struct qse_httpd_task_t
|
|||||||
qse_httpd_task_t* next;
|
qse_httpd_task_t* next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum qse_httpd_sctype_t
|
||||||
|
{
|
||||||
|
QSE_HTTPD_SERVER,
|
||||||
|
QSE_HTTPD_CLIENT
|
||||||
|
};
|
||||||
|
typedef enum qse_httpd_sctype_t qse_httpd_sctype_t;
|
||||||
|
|
||||||
struct qse_httpd_client_t
|
struct qse_httpd_client_t
|
||||||
{
|
{
|
||||||
/* == PUBLIC == */
|
/* == PRIVATE == */
|
||||||
|
qse_httpd_sctype_t type;
|
||||||
|
|
||||||
|
/* == PUBLIC == */
|
||||||
qse_ubi_t handle;
|
qse_ubi_t handle;
|
||||||
qse_ubi_t handle2;
|
qse_ubi_t handle2;
|
||||||
qse_nwad_t remote_addr;
|
qse_nwad_t remote_addr;
|
||||||
@ -354,6 +332,38 @@ struct qse_httpd_client_t
|
|||||||
} task;
|
} task;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum qse_httpd_server_flag_t
|
||||||
|
{
|
||||||
|
QSE_HTTPD_SERVER_ACTIVE = (1 << 0),
|
||||||
|
QSE_HTTPD_SERVER_SECURE = (1 << 1),
|
||||||
|
QSE_HTTPD_SERVER_BINDTONWIF = (1 << 2)
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef void (*qse_httpd_server_predetach_t) (
|
||||||
|
qse_httpd_t* httpd,
|
||||||
|
qse_httpd_server_t* server
|
||||||
|
);
|
||||||
|
|
||||||
|
struct qse_httpd_server_t
|
||||||
|
{
|
||||||
|
qse_httpd_sctype_t type;
|
||||||
|
|
||||||
|
/* ---------------------------------------------- */
|
||||||
|
int flags;
|
||||||
|
qse_nwad_t nwad; /* binding address */
|
||||||
|
unsigned int nwif; /* interface number to bind to */
|
||||||
|
|
||||||
|
/* set by server.open callback */
|
||||||
|
qse_ubi_t handle;
|
||||||
|
|
||||||
|
/* private */
|
||||||
|
qse_httpd_server_predetach_t predetach;
|
||||||
|
qse_httpd_server_t* next;
|
||||||
|
qse_httpd_server_t* prev;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_httpd_rsrc_type_t defines the resource type than can
|
* The qse_httpd_rsrc_type_t defines the resource type than can
|
||||||
* be entasked with qse_httpd_entaskrsrc().
|
* be entasked with qse_httpd_entaskrsrc().
|
||||||
@ -523,11 +533,6 @@ QSE_EXPORT void qse_httpd_close (
|
|||||||
qse_httpd_t* httpd
|
qse_httpd_t* httpd
|
||||||
);
|
);
|
||||||
|
|
||||||
QSE_EXPORT void qse_httpd_setmmgr (
|
|
||||||
qse_httpd_t* httpd,
|
|
||||||
qse_mmgr_t* mmgr
|
|
||||||
);
|
|
||||||
|
|
||||||
QSE_EXPORT qse_mmgr_t* qse_httpd_getmmgr (
|
QSE_EXPORT qse_mmgr_t* qse_httpd_getmmgr (
|
||||||
qse_httpd_t* httpd
|
qse_httpd_t* httpd
|
||||||
);
|
);
|
||||||
|
@ -152,11 +152,6 @@ QSE_EXPORT void qse_upxd_seterrnum (
|
|||||||
qse_upxd_errnum_t errnum
|
qse_upxd_errnum_t errnum
|
||||||
);
|
);
|
||||||
|
|
||||||
QSE_EXPORT void qse_upxd_setmmgr (
|
|
||||||
qse_upxd_t* upxd,
|
|
||||||
qse_mmgr_t* mmgr
|
|
||||||
);
|
|
||||||
|
|
||||||
QSE_EXPORT qse_mmgr_t* qse_upxd_getmmgr (
|
QSE_EXPORT qse_mmgr_t* qse_upxd_getmmgr (
|
||||||
qse_upxd_t* upxd
|
qse_upxd_t* upxd
|
||||||
);
|
);
|
||||||
|
@ -414,11 +414,6 @@ QSE_EXPORT void qse_sed_close (
|
|||||||
qse_sed_t* sed /**< stream editor */
|
qse_sed_t* sed /**< stream editor */
|
||||||
);
|
);
|
||||||
|
|
||||||
QSE_EXPORT void qse_sed_setmmgr (
|
|
||||||
qse_sed_t* sed,
|
|
||||||
qse_mmgr_t* mmgr
|
|
||||||
);
|
|
||||||
|
|
||||||
QSE_EXPORT qse_mmgr_t* qse_sed_getmmgr (
|
QSE_EXPORT qse_mmgr_t* qse_sed_getmmgr (
|
||||||
qse_sed_t* sed
|
qse_sed_t* sed
|
||||||
);
|
);
|
||||||
|
@ -412,11 +412,6 @@ int qse_awk_clear (qse_awk_t* awk)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void qse_awk_setmmgr (qse_awk_t* awk, qse_mmgr_t* mmgr)
|
|
||||||
{
|
|
||||||
awk->mmgr = mmgr;
|
|
||||||
}
|
|
||||||
|
|
||||||
qse_mmgr_t* qse_awk_getmmgr (qse_awk_t* awk)
|
qse_mmgr_t* qse_awk_getmmgr (qse_awk_t* awk)
|
||||||
{
|
{
|
||||||
return awk->mmgr;
|
return awk->mmgr;
|
||||||
|
@ -28,6 +28,7 @@ libqsecmn_la_SOURCES = \
|
|||||||
alg-sort.c \
|
alg-sort.c \
|
||||||
assert.c \
|
assert.c \
|
||||||
chr.c \
|
chr.c \
|
||||||
|
dir.c \
|
||||||
dll.c \
|
dll.c \
|
||||||
env.c \
|
env.c \
|
||||||
gdl.c \
|
gdl.c \
|
||||||
@ -46,6 +47,7 @@ libqsecmn_la_SOURCES = \
|
|||||||
mbwc.c \
|
mbwc.c \
|
||||||
mbwc-str.c \
|
mbwc-str.c \
|
||||||
mem.c \
|
mem.c \
|
||||||
|
mux.c \
|
||||||
nwad.c \
|
nwad.c \
|
||||||
nwif.c \
|
nwif.c \
|
||||||
nwio.c \
|
nwio.c \
|
||||||
|
@ -88,11 +88,11 @@ LTLIBRARIES = $(lib_LTLIBRARIES)
|
|||||||
am__DEPENDENCIES_1 =
|
am__DEPENDENCIES_1 =
|
||||||
libqsecmn_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
libqsecmn_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
||||||
am__libqsecmn_la_SOURCES_DIST = alg-base64.c alg-rand.c alg-search.c \
|
am__libqsecmn_la_SOURCES_DIST = alg-base64.c alg-rand.c alg-search.c \
|
||||||
alg-sort.c assert.c chr.c dll.c env.c gdl.c htb.c fio.c fma.c \
|
alg-sort.c assert.c chr.c dir.c dll.c env.c gdl.c htb.c fio.c \
|
||||||
fmt.c fs.c fs-err.c fs-move.c glob.c hton.c ipad.c lda.c \
|
fma.c fmt.c fs.c fs-err.c fs-move.c glob.c hton.c ipad.c lda.c \
|
||||||
main.c mbwc.c mbwc-str.c mem.c nwad.c nwif.c nwio.c oht.c \
|
main.c mbwc.c mbwc-str.c mem.c mux.c nwad.c nwif.c nwio.c \
|
||||||
opt.c path-basename.c path-canon.c pio.c pma.c rbt.c rex.c \
|
oht.c opt.c path-basename.c path-canon.c pio.c pma.c rbt.c \
|
||||||
sio.c sll.c slmb.c stdio.c str-beg.c str-cat.c str-chr.c \
|
rex.c sio.c sll.c slmb.c stdio.c str-beg.c str-cat.c str-chr.c \
|
||||||
str-cnv.c str-cmp.c str-cpy.c str-del.c str-dup.c str-dynm.c \
|
str-cnv.c str-cmp.c str-cpy.c str-del.c str-dup.c str-dynm.c \
|
||||||
str-dynw.c str-end.c str-excl.c str-fcpy.c str-fnmat.c \
|
str-dynw.c str-end.c str-excl.c str-fcpy.c str-fnmat.c \
|
||||||
str-incl.c str-len.c str-pac.c str-pbrk.c str-put.c str-rev.c \
|
str-incl.c str-len.c str-pac.c str-pbrk.c str-put.c str-rev.c \
|
||||||
@ -103,10 +103,10 @@ am__libqsecmn_la_SOURCES_DIST = alg-base64.c alg-rand.c alg-search.c \
|
|||||||
xma.c cp949.c cp950.c
|
xma.c cp949.c cp950.c
|
||||||
@INCLUDE_MORE_CMGRS_TRUE@am__objects_1 = cp949.lo cp950.lo
|
@INCLUDE_MORE_CMGRS_TRUE@am__objects_1 = cp949.lo cp950.lo
|
||||||
am_libqsecmn_la_OBJECTS = alg-base64.lo alg-rand.lo alg-search.lo \
|
am_libqsecmn_la_OBJECTS = alg-base64.lo alg-rand.lo alg-search.lo \
|
||||||
alg-sort.lo assert.lo chr.lo dll.lo env.lo gdl.lo htb.lo \
|
alg-sort.lo assert.lo chr.lo dir.lo dll.lo env.lo gdl.lo \
|
||||||
fio.lo fma.lo fmt.lo fs.lo fs-err.lo fs-move.lo glob.lo \
|
htb.lo fio.lo fma.lo fmt.lo fs.lo fs-err.lo fs-move.lo glob.lo \
|
||||||
hton.lo ipad.lo lda.lo main.lo mbwc.lo mbwc-str.lo mem.lo \
|
hton.lo ipad.lo lda.lo main.lo mbwc.lo mbwc-str.lo mem.lo \
|
||||||
nwad.lo nwif.lo nwio.lo oht.lo opt.lo path-basename.lo \
|
mux.lo nwad.lo nwif.lo nwio.lo oht.lo opt.lo path-basename.lo \
|
||||||
path-canon.lo pio.lo pma.lo rbt.lo rex.lo sio.lo sll.lo \
|
path-canon.lo pio.lo pma.lo rbt.lo rex.lo sio.lo sll.lo \
|
||||||
slmb.lo stdio.lo str-beg.lo str-cat.lo str-chr.lo str-cnv.lo \
|
slmb.lo stdio.lo str-beg.lo str-cat.lo str-chr.lo str-cnv.lo \
|
||||||
str-cmp.lo str-cpy.lo str-del.lo str-dup.lo str-dynm.lo \
|
str-cmp.lo str-cpy.lo str-del.lo str-dup.lo str-dynm.lo \
|
||||||
@ -350,9 +350,9 @@ noinst_HEADERS = \
|
|||||||
tre-stack.h
|
tre-stack.h
|
||||||
|
|
||||||
libqsecmn_la_SOURCES = alg-base64.c alg-rand.c alg-search.c alg-sort.c \
|
libqsecmn_la_SOURCES = alg-base64.c alg-rand.c alg-search.c alg-sort.c \
|
||||||
assert.c chr.c dll.c env.c gdl.c htb.c fio.c fma.c fmt.c fs.c \
|
assert.c chr.c dir.c dll.c env.c gdl.c htb.c fio.c fma.c fmt.c \
|
||||||
fs-err.c fs-move.c glob.c hton.c ipad.c lda.c main.c mbwc.c \
|
fs.c fs-err.c fs-move.c glob.c hton.c ipad.c lda.c main.c \
|
||||||
mbwc-str.c mem.c nwad.c nwif.c nwio.c oht.c opt.c \
|
mbwc.c mbwc-str.c mem.c mux.c nwad.c nwif.c nwio.c oht.c opt.c \
|
||||||
path-basename.c path-canon.c pio.c pma.c rbt.c rex.c sio.c \
|
path-basename.c path-canon.c pio.c pma.c rbt.c rex.c sio.c \
|
||||||
sll.c slmb.c stdio.c str-beg.c str-cat.c str-chr.c str-cnv.c \
|
sll.c slmb.c stdio.c str-beg.c str-cat.c str-chr.c str-cnv.c \
|
||||||
str-cmp.c str-cpy.c str-del.c str-dup.c str-dynm.c str-dynw.c \
|
str-cmp.c str-cpy.c str-del.c str-dup.c str-dynm.c str-dynw.c \
|
||||||
@ -455,6 +455,7 @@ distclean-compile:
|
|||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chr.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chr.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cp949.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cp949.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cp950.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cp950.Plo@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dll.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dll.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fio.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fio.Plo@am__quote@
|
||||||
@ -473,6 +474,7 @@ distclean-compile:
|
|||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbwc-str.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbwc-str.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbwc.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbwc.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mux.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nwad.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nwad.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nwif.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nwif.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nwio.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nwio.Plo@am__quote@
|
||||||
|
536
qse/lib/cmn/dir.c
Normal file
536
qse/lib/cmn/dir.c
Normal file
@ -0,0 +1,536 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
Copyright 2006-2012 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <qse/cmn/dir.h>
|
||||||
|
#include <qse/cmn/str.h>
|
||||||
|
#include <qse/cmn/mbwc.h>
|
||||||
|
#include <qse/cmn/path.h>
|
||||||
|
#include "mem.h"
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
# include <windows.h>
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
# define INCL_DOSFILEMGR
|
||||||
|
# define INCL_ERRORS
|
||||||
|
# include <os2.h>
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
# include <dos.h>
|
||||||
|
# include <errno.h>
|
||||||
|
#else
|
||||||
|
# include "syscall.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct qse_dir_t
|
||||||
|
{
|
||||||
|
qse_mmgr_t* mmgr;
|
||||||
|
int flags;
|
||||||
|
|
||||||
|
qse_str_t tbuf;
|
||||||
|
qse_mbs_t mbuf;
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
HANDLE h;
|
||||||
|
WIN32_FIND_DATA wfd;
|
||||||
|
int done;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
HDIR h;
|
||||||
|
FILEFINDBUF3L ffb;
|
||||||
|
ULONG count;
|
||||||
|
int opened;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
struct find_t f;
|
||||||
|
int done;
|
||||||
|
int opened;
|
||||||
|
#else
|
||||||
|
DIR* dp;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
int qse_dir_init (qse_dir_t* dir, qse_mmgr_t* mmgr, const qse_char_t* path, int flags);
|
||||||
|
void qse_dir_fini (qse_dir_t* dir);
|
||||||
|
|
||||||
|
static int reset_to_path (qse_dir_t* dir, const qse_char_t* path);
|
||||||
|
|
||||||
|
qse_dir_t* qse_dir_open (qse_mmgr_t* mmgr, qse_size_t xtnsize, const qse_char_t* path, int flags)
|
||||||
|
{
|
||||||
|
qse_dir_t* dir;
|
||||||
|
|
||||||
|
dir = QSE_MMGR_ALLOC (mmgr, QSE_SIZEOF(*dir) + xtnsize);
|
||||||
|
if (dir)
|
||||||
|
{
|
||||||
|
if (qse_dir_init (dir, mmgr, path, flags) <= -1)
|
||||||
|
{
|
||||||
|
QSE_MMGR_FREE (mmgr, dir);
|
||||||
|
dir = QSE_NULL;
|
||||||
|
}
|
||||||
|
else QSE_MEMSET (dir + 1, 0, xtnsize);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
void qse_dir_close (qse_dir_t* dir)
|
||||||
|
{
|
||||||
|
qse_dir_fini (dir);
|
||||||
|
QSE_MMGR_FREE (dir->mmgr, dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
qse_mmgr_t* qse_dir_getmmgr (qse_dir_t* dir)
|
||||||
|
{
|
||||||
|
return dir->mmgr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* qse_dir_getxtn (qse_dir_t* dir)
|
||||||
|
{
|
||||||
|
return QSE_XTN (dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
int qse_dir_init (qse_dir_t* dir, qse_mmgr_t* mmgr, const qse_char_t* path, int flags)
|
||||||
|
{
|
||||||
|
QSE_MEMSET (dir, 0, QSE_SIZEOF(*dir));
|
||||||
|
|
||||||
|
dir->mmgr = mmgr;
|
||||||
|
dir->flags = flags;
|
||||||
|
|
||||||
|
if (qse_str_init (&dir->tbuf, mmgr, 256) <= -1) return -1;
|
||||||
|
if (qse_mbs_init (&dir->mbuf, mmgr, 256) <= -1)
|
||||||
|
{
|
||||||
|
qse_str_fini (&dir->tbuf);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
dir->h = INVALID_HANDLE_VALUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return reset_to_path (dir, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void close_dir_safely (qse_dir_t* dir)
|
||||||
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
if (dir->h != INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
FindClose (dir->h);
|
||||||
|
dir->h = INVALID_HANDLE_VALUE;
|
||||||
|
}
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
if (dir->opened)
|
||||||
|
{
|
||||||
|
DosFindClose (dir->h);
|
||||||
|
dir->opened = 0;
|
||||||
|
}
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
if (dir->opened)
|
||||||
|
{
|
||||||
|
_dos_findclose (&dir->f);
|
||||||
|
dir->opened = 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (dir->dp)
|
||||||
|
{
|
||||||
|
QSE_CLOSEDIR (dir->dp);
|
||||||
|
dir->dp = QSE_NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void qse_dir_fini (qse_dir_t* dir)
|
||||||
|
{
|
||||||
|
close_dir_safely (dir);
|
||||||
|
|
||||||
|
qse_mbs_fini (&dir->mbuf);
|
||||||
|
qse_str_fini (&dir->tbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
static qse_mchar_t* wcs_to_mbuf (qse_dir_t* dir, const qse_wchar_t* wcs, qse_mbs_t* mbs)
|
||||||
|
{
|
||||||
|
qse_size_t ml, wl;
|
||||||
|
|
||||||
|
if (qse_wcstombs (wcs, &wl, QSE_NULL, &ml) <= -1 ||
|
||||||
|
qse_mbs_setlen (mbs, ml) == (qse_size_t)-1) return QSE_NULL;
|
||||||
|
|
||||||
|
qse_wcstombs (wcs, &wl, QSE_MBS_PTR(mbs), &ml);
|
||||||
|
return QSE_MBS_PTR(mbs);
|
||||||
|
}
|
||||||
|
|
||||||
|
static qse_wchar_t* mbs_to_wbuf (qse_dir_t* dir, const qse_mchar_t* mbs, qse_wcs_t* wcs)
|
||||||
|
{
|
||||||
|
qse_size_t ml, wl;
|
||||||
|
|
||||||
|
if (qse_mbstowcs (mbs, &ml, QSE_NULL, &wl) <= -1 ||
|
||||||
|
qse_wcs_setlen (wcs, wl) == (qse_size_t)-1) return QSE_NULL;
|
||||||
|
|
||||||
|
qse_mbstowcs (mbs, &ml, QSE_WCS_PTR(wcs), &wl);
|
||||||
|
return QSE_WCS_PTR(wcs);
|
||||||
|
}
|
||||||
|
|
||||||
|
static qse_mchar_t* make_mbsdos_path (qse_dir_t* dir, const qse_mchar_t* mpath)
|
||||||
|
{
|
||||||
|
if (mpath[0] == QSE_MT('\0'))
|
||||||
|
{
|
||||||
|
if (qse_mbs_cpy (&dir->mbuf, QSE_MT("*.*")) == (qse_size_t)-1) return QSE_NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qse_size_t len;
|
||||||
|
if ((len = qse_mbs_cpy (&dir->mbuf, mpath)) == (qse_size_t)-1 ||
|
||||||
|
(!QSE_ISPATHMBSEP(mpath[len - 1]) &&
|
||||||
|
!qse_ismbsdrivecurpath(mpath) &&
|
||||||
|
qse_mbs_ccat (&dir->mbuf, QSE_MT('\\')) == (qse_size_t)-1) ||
|
||||||
|
qse_mbs_cat (&dir->mbuf, QSE_MT("*.*")) == (qse_size_t)-1)
|
||||||
|
{
|
||||||
|
return QSE_NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QSE_MBS_PTR(&dir->mbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
static qse_char_t* make_dos_path (qse_dir_t* dir, const qse_char_t* path)
|
||||||
|
{
|
||||||
|
if (path[0] == QSE_T('\0'))
|
||||||
|
{
|
||||||
|
if (qse_str_cpy (&dir->tbuf, QSE_T("*.*")) == (qse_size_t)-1) return QSE_NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qse_size_t len;
|
||||||
|
if ((len = qse_str_cpy (&dir->tbuf, path)) == (qse_size_t)-1 ||
|
||||||
|
(!QSE_ISPATHSEP(path[len - 1]) &&
|
||||||
|
!qse_isdrivecurpath(path) &&
|
||||||
|
qse_str_ccat (&dir->tbuf, QSE_T('\\')) == (qse_size_t)-1) ||
|
||||||
|
qse_str_cat (&dir->tbuf, QSE_T("*.*")) == (qse_size_t)-1)
|
||||||
|
{
|
||||||
|
return QSE_NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QSE_STR_PTR(&dir->tbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static qse_mchar_t* mkdospath (qse_dir_t* dir, const qse_char_t* path)
|
||||||
|
{
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
return make_dos_path (dir, path);
|
||||||
|
#else
|
||||||
|
if (dir->flags & QSE_DIR_MBSPATH)
|
||||||
|
{
|
||||||
|
return make_mbsdos_path (dir, (const qse_mchar_t*) path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qse_char_t* tptr;
|
||||||
|
qse_mchar_t* mptr;
|
||||||
|
|
||||||
|
tptr = make_dos_path (dir, path);
|
||||||
|
if (tptr == QSE_NULL) return QSE_NULL;
|
||||||
|
|
||||||
|
mptr = wcs_to_mbuf (dir, QSE_STR_PTR(&dir->tbuf), &dir->mbuf);
|
||||||
|
if (mptr == QSE_NULL) return QSE_NULL;
|
||||||
|
|
||||||
|
return mptr;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static int reset_to_path (qse_dir_t* dir, const qse_char_t* path)
|
||||||
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
qse_char_t* tptr;
|
||||||
|
|
||||||
|
dir->done = 0;
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
tptr = make_dos_path (dir, path);
|
||||||
|
#else
|
||||||
|
if (dir->flags & QSE_DIR_MBSPATH)
|
||||||
|
{
|
||||||
|
qse_mchar_t* mptr = make_mbsdos_path (dir, (const qse_mchar_t*) path);
|
||||||
|
if (mptr == QSE_NULL) return -1;
|
||||||
|
tptr = mbs_to_wbuf (dir, mptr, &dir->tbuf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tptr = make_dos_path (dir, path);
|
||||||
|
if (tptr == QSE_NULL) return -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (tptr == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
dir->h = FindFirstFile (tptr, &dir->wfd);
|
||||||
|
if (dir->h == INVALID_HANDLE_VALUE) return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
APIRET rc;
|
||||||
|
qse_mchar_t* mptr;
|
||||||
|
|
||||||
|
dir->h = HDIR_CREATE;
|
||||||
|
dir->count = 1;
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
mptr = make_dos_path (dir, path);
|
||||||
|
#else
|
||||||
|
if (dir->flags & QSE_DIR_MBSPATH)
|
||||||
|
{
|
||||||
|
mptr = make_mbsdos_path (dir, (const qse_mchar_t*) path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qse_char_t* tptr = make_dos_path (dir, path);
|
||||||
|
if (tptr == QSE_NULL) return -1;
|
||||||
|
mptr = wcs_to_mbuf (dir, tptr, &dir->mbuf);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (mptr == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
rc = DosFindFirst (
|
||||||
|
mptr,
|
||||||
|
&dir->h,
|
||||||
|
FILE_DIRECTORY | FILE_READONLY,
|
||||||
|
&dir->ffb,
|
||||||
|
QSE_SIZEOF(dir->ffb),
|
||||||
|
&dir->count,
|
||||||
|
FIL_STANDARDL);
|
||||||
|
|
||||||
|
if (rc != NO_ERROR) return -1;
|
||||||
|
|
||||||
|
dir->opened = 1;
|
||||||
|
return 0;
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
unsigned int rc;
|
||||||
|
qse_mchar_t* mptr;
|
||||||
|
|
||||||
|
dir->done = 0;
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
mptr = make_dos_path (dir, path);
|
||||||
|
#else
|
||||||
|
if (dir->flags & QSE_DIR_MBSPATH)
|
||||||
|
{
|
||||||
|
mptr = make_mbsdos_path (dir, (const qse_mchar_t*) path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qse_char_t* tptr = make_dos_path (dir, path);
|
||||||
|
if (tptr == QSE_NULL) return -1;
|
||||||
|
mptr = wcs_to_mbuf (dir, tptr, &dir->mbuf);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (mptr == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
rc = _dos_findfirst (mptr, _A_NORMAL | _A_SUBDIR, &dir->f);
|
||||||
|
if (rc != 0) return -1;
|
||||||
|
|
||||||
|
dir->opened = 1;
|
||||||
|
return 0;
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#else
|
||||||
|
DIR* dp;
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
dp = QSE_OPENDIR (path[0] == QSE_MT('\0')? QSE_T("."): path);
|
||||||
|
#else
|
||||||
|
if (dir->flags & QSE_DIR_MBSPATH)
|
||||||
|
{
|
||||||
|
const qse_mchar_t* mpath = (const qse_mchar_t*)path;
|
||||||
|
dp = QSE_OPENDIR (mpath == QSE_MT('\0')? QSE_MT("."): mpath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (path[0] == QSE_T('\0'))
|
||||||
|
{
|
||||||
|
dp = QSE_OPENDIR (QSE_MT("."));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qse_mchar_t* mptr;
|
||||||
|
|
||||||
|
mptr = wcs_to_mbuf (dir, path, &dir->mbuf);
|
||||||
|
if (mptr == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
dp = QSE_OPENDIR (mptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
dir->dp = dp;
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int qse_dir_reset (qse_dir_t* dir, const qse_char_t* path)
|
||||||
|
{
|
||||||
|
close_dir_safely (dir);
|
||||||
|
return reset_to_path (dir, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int read_dir_to_tbuf (qse_dir_t* dir, void** name)
|
||||||
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
if (dir->done) return (dir->done > 0)? 0: -1;
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
if (qse_str_cpy (&dir->tbuf, dir->wfd.cFileName) == (qse_size_t)-1) return -1;
|
||||||
|
*name = QSE_STR_PTR(&dir->tbuf);
|
||||||
|
#else
|
||||||
|
if (dir->flags & QSE_DIR_MBSPATH)
|
||||||
|
{
|
||||||
|
if (wcs_to_mbuf (dir, dir->wfd.cFileName, &dir->mbuf) == QSE_NULL) return -1;
|
||||||
|
*name = QSE_STR_PTR(&dir->mbuf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (qse_str_cpy (&dir->tbuf, dir->wfd.cFileName) == (qse_size_t)-1) return -1;
|
||||||
|
*name = QSE_STR_PTR(&dir->tbuf);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (FindNextFile (dir->h, &dir->wfd) == FALSE)
|
||||||
|
dir->done = (GetLastError() == ERROR_NO_MORE_FILES)? 1: -1;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
APIRET rc;
|
||||||
|
|
||||||
|
if (dir->count <= 0) return 0;
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
if (qse_str_cpy (&dir->tbuf, dir->ffb.achName) == (qse_size_t)-1) return -1;
|
||||||
|
*name = QSE_STR_PTR(&dir->tbuf);
|
||||||
|
#else
|
||||||
|
if (dir->flags & QSE_DIR_MBSPATH)
|
||||||
|
{
|
||||||
|
if (qse_mbs_cpy (&dir->mbuf, dir->ffb.achName) == (qse_size_t)-1) return -1;
|
||||||
|
*name = QSE_MBS_PTR(&dir->mbuf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (mbs_to_wbuf (dir, dir->ffb.achName, &dir->tbuf) == QSE_NULL) return -1;
|
||||||
|
*name = QSE_STR_PTR(&dir->tbuf);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
rc = DosFindNext (dir->h, &dir->ffb, QSE_SIZEOF(dir->ffb), &dir->count);
|
||||||
|
if (rc == ERROR_NO_MORE_FILES) dir->count = 0;
|
||||||
|
else if (rc != NO_ERROR) return -1;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
unsigned int rc;
|
||||||
|
|
||||||
|
if (dir->done) return (dir->done > 0)? 0: -1;
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
if (qse_str_cpy (&dir->tbuf, dir->f.name) == (qse_size_t)-1) return -1;
|
||||||
|
*name = QSE_STR_PTR(&dir->tbuf);
|
||||||
|
#else
|
||||||
|
if (dir->flags & QSE_DIR_MBSPATH)
|
||||||
|
{
|
||||||
|
if (qse_mbs_cpy (&dir->mbuf, dir->f.name) == (qse_size_t)-1) return -1;
|
||||||
|
*name = QSE_MBS_PTR(&dir->mbuf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (mbs_to_wbuf (dir, dir->f.name, &dir->tbuf) == QSE_NULL) return -1;
|
||||||
|
*name = QSE_STR_PTR(&dir->tbuf);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
rc = _dos_findnext (&dir->f);
|
||||||
|
if (rc != 0) dir->done = (errno == ENOENT)? 1: -1;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
qse_dirent_t* de;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
de = QSE_READDIR (dir->dp);
|
||||||
|
if (de == NULL) return (errno == 0)? 0: -1;
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
if (qse_str_cpy (&dir->tbuf, de->d_name) == (qse_size_t)-1) return -1;
|
||||||
|
*name = QSE_STR_PTR(&dir->tbuf);
|
||||||
|
#else
|
||||||
|
if (dir->flags & QSE_DIR_MBSPATH)
|
||||||
|
{
|
||||||
|
if (qse_mbs_cpy (&dir->mbuf, de->d_name) == (qse_size_t)-1) return -1;
|
||||||
|
*name = QSE_MBS_PTR(&dir->mbuf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (mbs_to_wbuf (dir, de->d_name, &dir->tbuf) == QSE_NULL) return -1;
|
||||||
|
*name = QSE_STR_PTR(&dir->tbuf);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int qse_dir_read (qse_dir_t* dir, qse_dir_ent_t* ent)
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
void* name;
|
||||||
|
|
||||||
|
x = read_dir_to_tbuf (dir, &name);
|
||||||
|
if (x >= 1)
|
||||||
|
{
|
||||||
|
QSE_MEMSET (ent, 0, QSE_SIZEOF(ent));
|
||||||
|
ent->name = name;
|
||||||
|
|
||||||
|
if (dir->flags & QSE_DIR_STAT)
|
||||||
|
{
|
||||||
|
/* TODO: more information */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return x;
|
||||||
|
}
|
@ -22,6 +22,7 @@
|
|||||||
#include <qse/cmn/str.h>
|
#include <qse/cmn/str.h>
|
||||||
#include <qse/cmn/mbwc.h>
|
#include <qse/cmn/mbwc.h>
|
||||||
#include <qse/cmn/path.h>
|
#include <qse/cmn/path.h>
|
||||||
|
#include <qse/cmn/dir.h>
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
@ -44,17 +45,7 @@
|
|||||||
# define IS_ESC(c) ((c) == QSE_T('\\'))
|
# define IS_ESC(c) ((c) == QSE_T('\\'))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__)
|
#define IS_SEP(c) QSE_ISPATHSEP(c)
|
||||||
# define SEPC QSE_T('\\')
|
|
||||||
#else
|
|
||||||
# define SEPC QSE_T('/')
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__)
|
|
||||||
# define IS_SEP(c) ((c) == QSE_T('/') || (c) == QSE_T('\\'))
|
|
||||||
#else
|
|
||||||
# define IS_SEP(c) ((c) == QSE_T('/'))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IS_NIL(c) ((c) == QSE_T('\0'))
|
#define IS_NIL(c) ((c) == QSE_T('\0'))
|
||||||
#define IS_SEP_OR_NIL(c) (IS_SEP(c) || IS_NIL(c))
|
#define IS_SEP_OR_NIL(c) (IS_SEP(c) || IS_NIL(c))
|
||||||
@ -83,7 +74,6 @@ struct glob_t
|
|||||||
void* cbctx;
|
void* cbctx;
|
||||||
|
|
||||||
qse_mmgr_t* mmgr;
|
qse_mmgr_t* mmgr;
|
||||||
qse_cmgr_t* cmgr;
|
|
||||||
|
|
||||||
qse_str_t path;
|
qse_str_t path;
|
||||||
qse_str_t tbuf; /* temporary buffer */
|
qse_str_t tbuf; /* temporary buffer */
|
||||||
@ -108,10 +98,10 @@ static qse_mchar_t* wcs_to_mbuf (glob_t* g, const qse_wchar_t* wcs, qse_mbs_t* m
|
|||||||
{
|
{
|
||||||
qse_size_t ml, wl;
|
qse_size_t ml, wl;
|
||||||
|
|
||||||
if (qse_wcstombswithcmgr (wcs, &wl, QSE_NULL, &ml, g->cmgr) <= -1 ||
|
if (qse_wcstombs (wcs, &wl, QSE_NULL, &ml) <= -1 ||
|
||||||
qse_mbs_setlen (mbs, ml) == (qse_size_t)-1) return QSE_NULL;
|
qse_mbs_setlen (mbs, ml) == (qse_size_t)-1) return QSE_NULL;
|
||||||
|
|
||||||
qse_wcstombswithcmgr (wcs, &wl, QSE_MBS_PTR(mbs), &ml, g->cmgr);
|
qse_wcstombs (wcs, &wl, QSE_MBS_PTR(mbs), &ml);
|
||||||
return QSE_MBS_PTR(mbs);
|
return QSE_MBS_PTR(mbs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,338 +312,6 @@ static int get_next_segment (glob_t* g, segment_t* seg)
|
|||||||
return seg->type;
|
return seg->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
|
|
||||||
struct qse_dir_t
|
|
||||||
{
|
|
||||||
HANDLE h;
|
|
||||||
WIN32_FIND_DATA wfd;
|
|
||||||
int done;
|
|
||||||
};
|
|
||||||
typedef struct qse_dir_t qse_dir_t;
|
|
||||||
|
|
||||||
#elif defined(__OS2__)
|
|
||||||
|
|
||||||
struct qse_dir_t
|
|
||||||
{
|
|
||||||
HDIR h;
|
|
||||||
FILEFINDBUF3L ffb;
|
|
||||||
ULONG count;
|
|
||||||
};
|
|
||||||
typedef struct qse_dir_t qse_dir_t;
|
|
||||||
|
|
||||||
#elif defined(__DOS__)
|
|
||||||
|
|
||||||
struct qse_dir_t
|
|
||||||
{
|
|
||||||
struct find_t f;
|
|
||||||
int done;
|
|
||||||
};
|
|
||||||
typedef struct qse_dir_t qse_dir_t;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static qse_dir_t* xopendir (glob_t* g, const qse_cstr_t* path)
|
|
||||||
{
|
|
||||||
#if defined(_WIN32)
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
qse_dir_t* dp;
|
|
||||||
|
|
||||||
dp = QSE_MMGR_ALLOC (g->mmgr, QSE_SIZEOF(*dp));
|
|
||||||
if (dp == QSE_NULL) return QSE_NULL;
|
|
||||||
|
|
||||||
dp->done = 0;
|
|
||||||
|
|
||||||
if (path->len <= 0)
|
|
||||||
{
|
|
||||||
if (qse_str_cpy (&g->tbuf, QSE_T("*")) == (qse_size_t)-1)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (qse_str_cpy (&g->tbuf, path->ptr) == (qse_size_t)-1 ||
|
|
||||||
(!IS_SEP(path->ptr[path->len-1]) &&
|
|
||||||
!qse_isdrivecurpath(path->ptr) &&
|
|
||||||
qse_str_ccat (&g->tbuf, QSE_T('\\')) == (qse_size_t)-1) ||
|
|
||||||
qse_str_ccat (&g->tbuf, QSE_T('*')) == (qse_size_t)-1)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dp->h = FindFirstFile (QSE_STR_PTR(&g->tbuf), &dp->wfd);
|
|
||||||
if (dp->h == INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dp;
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#elif defined(__OS2__)
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
qse_dir_t* dp;
|
|
||||||
APIRET rc;
|
|
||||||
qse_mchar_t* mptr;
|
|
||||||
|
|
||||||
dp = QSE_MMGR_ALLOC (g->mmgr, QSE_SIZEOF(*dp));
|
|
||||||
if (dp == QSE_NULL) return QSE_NULL;
|
|
||||||
|
|
||||||
if (path->len <= 0)
|
|
||||||
{
|
|
||||||
if (qse_str_cpy (&g->tbuf, QSE_T("*.*")) == (qse_size_t)-1)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (qse_str_cpy (&g->tbuf, path->ptr) == (qse_size_t)-1 ||
|
|
||||||
(!IS_SEP(path->ptr[path->len-1]) &&
|
|
||||||
!qse_isdrivecurpath(path->ptr) &&
|
|
||||||
qse_str_ccat (&g->tbuf, QSE_T('\\')) == (qse_size_t)-1) ||
|
|
||||||
qse_str_cat (&g->tbuf, QSE_T("*.*")) == (qse_size_t)-1)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dp->h = HDIR_CREATE;
|
|
||||||
dp->count = 1;
|
|
||||||
|
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
|
||||||
mptr = QSE_STR_PTR(&g->tbuf);
|
|
||||||
#else
|
|
||||||
mptr = wcs_to_mbuf (g, QSE_STR_PTR(&g->tbuf), &g->mbuf);
|
|
||||||
if (mptr == QSE_NULL)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rc = DosFindFirst (
|
|
||||||
mptr,
|
|
||||||
&dp->h,
|
|
||||||
FILE_DIRECTORY | FILE_READONLY,
|
|
||||||
&dp->ffb,
|
|
||||||
QSE_SIZEOF(dp->ffb),
|
|
||||||
&dp->count,
|
|
||||||
FIL_STANDARDL);
|
|
||||||
|
|
||||||
if (rc != NO_ERROR)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dp;
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#elif defined(__DOS__)
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
qse_dir_t* dp;
|
|
||||||
unsigned int rc;
|
|
||||||
qse_mchar_t* mptr;
|
|
||||||
qse_size_t wl, ml;
|
|
||||||
|
|
||||||
dp = QSE_MMGR_ALLOC (g->mmgr, QSE_SIZEOF(*dp));
|
|
||||||
if (dp == QSE_NULL) return QSE_NULL;
|
|
||||||
|
|
||||||
dp->done = 0;
|
|
||||||
|
|
||||||
if (path->len <= 0)
|
|
||||||
{
|
|
||||||
if (qse_str_cpy (&g->tbuf, QSE_T("*.*")) == (qse_size_t)-1)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (qse_str_cpy (&g->tbuf, path->ptr) == (qse_size_t)-1 ||
|
|
||||||
(!IS_SEP(path->ptr[path->len-1]) &&
|
|
||||||
!qse_isdrivecurpath(path->ptr) &&
|
|
||||||
qse_str_ccat (&g->tbuf, QSE_T('\\')) == (qse_size_t)-1) ||
|
|
||||||
qse_str_cat (&g->tbuf, QSE_T("*.*")) == (qse_size_t)-1)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
|
||||||
mptr = QSE_STR_PTR(&g->tbuf);
|
|
||||||
#else
|
|
||||||
mptr = wcs_to_mbuf (g, QSE_STR_PTR(&g->tbuf), &g->mbuf);
|
|
||||||
if (mptr == QSE_NULL)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rc = _dos_findfirst (mptr, _A_NORMAL | _A_SUBDIR, &dp->f);
|
|
||||||
|
|
||||||
if (rc != 0)
|
|
||||||
{
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
return QSE_NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dp;
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
|
||||||
return QSE_OPENDIR ((path->len <= 0)? QSE_T("."): path->ptr);
|
|
||||||
#else
|
|
||||||
if (path->len <= 0)
|
|
||||||
{
|
|
||||||
return QSE_OPENDIR (QSE_MT("."));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qse_mchar_t* mptr;
|
|
||||||
|
|
||||||
mptr = wcs_to_mbuf (g, path->ptr, &g->mbuf);
|
|
||||||
if (mptr == QSE_NULL) return QSE_NULL;
|
|
||||||
|
|
||||||
return QSE_OPENDIR (mptr);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static int xreaddir (glob_t* g, qse_dir_t* dp, qse_str_t* path)
|
|
||||||
{
|
|
||||||
#if defined(_WIN32)
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
if (dp->done) return (dp->done > 0)? 0: -1;
|
|
||||||
|
|
||||||
if (qse_str_cat (path, dp->wfd.cFileName) == (qse_size_t)-1) return -1;
|
|
||||||
|
|
||||||
if (FindNextFile (dp->h, &dp->wfd) == FALSE)
|
|
||||||
dp->done = (GetLastError() == ERROR_NO_MORE_FILES)? 1: -1;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#elif defined(__OS2__)
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
APIRET rc;
|
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
|
||||||
/* nothing */
|
|
||||||
#else
|
|
||||||
qse_size_t ml, wl, tmp;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (dp->count <= 0) return 0;
|
|
||||||
|
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
|
||||||
if (qse_str_cat (path, dp->ffb.achName) == (qse_size_t)-1) return -1;
|
|
||||||
#else
|
|
||||||
tmp = QSE_STR_LEN(path);
|
|
||||||
if (qse_mbstowcswithcmgr (dp->ffb.achName, &ml, QSE_NULL, &wl, g->cmgr) <= -1 ||
|
|
||||||
qse_str_setlen (path, tmp + wl) == (qse_size_t)-1) return -1;
|
|
||||||
qse_mbstowcswithcmgr (dp->ffb.achName, &ml, QSE_STR_CPTR(&g->path,tmp), &wl, g->cmgr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rc = DosFindNext (dp->h, &dp->ffb, QSE_SIZEOF(dp->ffb), &dp->count);
|
|
||||||
if (rc == ERROR_NO_MORE_FILES) dp->count = 0;
|
|
||||||
else if (rc != NO_ERROR) return -1;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#elif defined(__DOS__)
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
unsigned int rc;
|
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
|
||||||
/* nothing */
|
|
||||||
#else
|
|
||||||
qse_size_t ml, wl, tmp;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (dp->done) return (dp->done > 0)? 0: -1;
|
|
||||||
|
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
|
||||||
if (qse_str_cat (path, dp->f.name) == (qse_size_t)-1) return -1;
|
|
||||||
#else
|
|
||||||
tmp = QSE_STR_LEN(path);
|
|
||||||
if (qse_mbstowcswithcmgr (dp->f.name, &ml, QSE_NULL, &wl, g->cmgr) <= -1 ||
|
|
||||||
qse_str_setlen (path, tmp + wl) == (qse_size_t)-1) return -1;
|
|
||||||
qse_mbstowcswithcmgr (dp->f.name, &ml, QSE_STR_CPTR(&g->path,tmp), &wl, g->cmgr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rc = _dos_findnext (&dp->f);
|
|
||||||
if (rc != 0) dp->done = (errno == ENOENT)? 1: -1;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
qse_dirent_t* de;
|
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
|
||||||
/* nothing */
|
|
||||||
#else
|
|
||||||
qse_size_t ml, wl, tmp;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
de = QSE_READDIR (dp);
|
|
||||||
if (de == NULL) return 0;
|
|
||||||
|
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
|
||||||
if (qse_str_cat (path, de->d_name) == (qse_size_t)-1) return -1;
|
|
||||||
#else
|
|
||||||
tmp = QSE_STR_LEN(path);
|
|
||||||
if (qse_mbstowcswithcmgr (de->d_name, &ml, QSE_NULL, &wl, g->cmgr) <= -1 ||
|
|
||||||
qse_str_setlen (path, tmp + wl) == (qse_size_t)-1) return -1;
|
|
||||||
qse_mbstowcswithcmgr (de->d_name, &ml, QSE_STR_CPTR(&g->path,tmp), &wl, g->cmgr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
/* ------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void xclosedir (glob_t* g, qse_dir_t* dp)
|
|
||||||
{
|
|
||||||
#if defined(_WIN32)
|
|
||||||
FindClose (dp->h);
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
#elif defined(__OS2__)
|
|
||||||
DosFindClose (dp->h);
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
#elif defined(__DOS__)
|
|
||||||
_dos_findclose (&dp->f);
|
|
||||||
QSE_MMGR_FREE (g->mmgr, dp);
|
|
||||||
#else
|
|
||||||
QSE_CLOSEDIR (dp);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static int handle_non_wild_segments (glob_t* g, segment_t* seg)
|
static int handle_non_wild_segments (glob_t* g, segment_t* seg)
|
||||||
{
|
{
|
||||||
while (get_next_segment(g, seg) != NONE && !seg->wild)
|
while (get_next_segment(g, seg) != NONE && !seg->wild)
|
||||||
@ -731,6 +389,8 @@ static int search (glob_t* g, segment_t* seg)
|
|||||||
{
|
{
|
||||||
qse_dir_t* dp;
|
qse_dir_t* dp;
|
||||||
qse_size_t tmp, tmp2;
|
qse_size_t tmp, tmp2;
|
||||||
|
qse_dir_ent_t ent;
|
||||||
|
int x;
|
||||||
|
|
||||||
#if defined(NO_RECURSION)
|
#if defined(NO_RECURSION)
|
||||||
stack_node_t* r;
|
stack_node_t* r;
|
||||||
@ -744,7 +404,7 @@ entry:
|
|||||||
|
|
||||||
if (seg->wild)
|
if (seg->wild)
|
||||||
{
|
{
|
||||||
dp = xopendir (g, QSE_STR_CSTR(&g->path));
|
dp = qse_dir_open (g->mmgr, 0, QSE_STR_PTR(&g->path), 0);
|
||||||
if (dp)
|
if (dp)
|
||||||
{
|
{
|
||||||
tmp = QSE_STR_LEN(&g->path);
|
tmp = QSE_STR_LEN(&g->path);
|
||||||
@ -756,7 +416,11 @@ entry:
|
|||||||
{
|
{
|
||||||
qse_str_setlen (&g->path, tmp2);
|
qse_str_setlen (&g->path, tmp2);
|
||||||
|
|
||||||
if (xreaddir (g, dp, &g->path) <= 0) break;
|
x = qse_dir_read (dp, &ent);
|
||||||
|
if (x <= -1) goto oops;
|
||||||
|
if (x == 0) break;
|
||||||
|
|
||||||
|
if (qse_str_cat (&g->path, ent.name) == (qse_size_t)-1) goto oops;
|
||||||
|
|
||||||
if (qse_strnfnmat (QSE_STR_CPTR(&g->path,tmp2), seg->ptr, seg->len, g->fnmat_flags) > 0)
|
if (qse_strnfnmat (QSE_STR_CPTR(&g->path,tmp2), seg->ptr, seg->len, g->fnmat_flags) > 0)
|
||||||
{
|
{
|
||||||
@ -810,7 +474,7 @@ entry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
qse_str_setlen (&g->path, tmp);
|
qse_str_setlen (&g->path, tmp);
|
||||||
xclosedir (g, dp); dp = QSE_NULL;
|
qse_dir_close (dp); dp = QSE_NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -850,14 +514,14 @@ entry:
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
oops:
|
oops:
|
||||||
if (dp) xclosedir (g, dp);
|
if (dp) qse_dir_close (dp);
|
||||||
|
|
||||||
#if defined(NO_RECURSION)
|
#if defined(NO_RECURSION)
|
||||||
while (g->stack)
|
while (g->stack)
|
||||||
{
|
{
|
||||||
r = g->stack;
|
r = g->stack;
|
||||||
g->stack = r->next;
|
g->stack = r->next;
|
||||||
xclosedir (g, r->dp);
|
qse_dir_close (r->dp);
|
||||||
QSE_MMGR_FREE (g->mmgr, r);
|
QSE_MMGR_FREE (g->mmgr, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -871,7 +535,7 @@ oops:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qse_globwithcmgr (const qse_char_t* pattern, qse_glob_cbimpl_t cbimpl, void* cbctx, int flags, qse_mmgr_t* mmgr, qse_cmgr_t* cmgr)
|
int qse_glob (const qse_char_t* pattern, qse_glob_cbimpl_t cbimpl, void* cbctx, int flags, qse_mmgr_t* mmgr)
|
||||||
{
|
{
|
||||||
segment_t seg;
|
segment_t seg;
|
||||||
glob_t g;
|
glob_t g;
|
||||||
@ -881,7 +545,6 @@ int qse_globwithcmgr (const qse_char_t* pattern, qse_glob_cbimpl_t cbimpl, void*
|
|||||||
g.cbimpl = cbimpl;
|
g.cbimpl = cbimpl;
|
||||||
g.cbctx = cbctx;
|
g.cbctx = cbctx;
|
||||||
g.mmgr = mmgr;
|
g.mmgr = mmgr;
|
||||||
g.cmgr = cmgr;
|
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__)
|
#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__)
|
||||||
g.fnmat_flags |= QSE_STRFNMAT_IGNORECASE;
|
g.fnmat_flags |= QSE_STRFNMAT_IGNORECASE;
|
||||||
@ -928,8 +591,3 @@ int qse_globwithcmgr (const qse_char_t* pattern, qse_glob_cbimpl_t cbimpl, void*
|
|||||||
return g.expanded;
|
return g.expanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qse_glob (const qse_char_t* pattern, qse_glob_cbimpl_t cbimpl, void* cbctx, int flags, qse_mmgr_t* mmgr)
|
|
||||||
{
|
|
||||||
return qse_globwithcmgr (pattern, cbimpl, cbctx, flags, mmgr, qse_getdflcmgr());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
621
qse/lib/cmn/mux.c
Normal file
621
qse/lib/cmn/mux.c
Normal file
@ -0,0 +1,621 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
Copyright 2006-2012 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <qse/cmn/mux.h>
|
||||||
|
#include "mem.h"
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
# define FD_SETSIZE 4096 /* what is the best value??? */
|
||||||
|
# include <winsock2.h>
|
||||||
|
# include <windows.h>
|
||||||
|
# define USE_SELECT
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
# include <types.h>
|
||||||
|
# include <sys/socket.h>
|
||||||
|
# include <netinet/in.h>
|
||||||
|
# include <tcpustd.h>
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
# include <nerrno.h>
|
||||||
|
# define INCL_DOSERRORS
|
||||||
|
# include <os2.h>
|
||||||
|
# pragma library("tcpip32.lib")
|
||||||
|
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
# include <errno.h>
|
||||||
|
#else
|
||||||
|
# include <unistd.h>
|
||||||
|
# include <fcntl.h>
|
||||||
|
# include <errno.h>
|
||||||
|
# if defined(HAVE_SYS_EPOLL_H)
|
||||||
|
# include <sys/epoll.h>
|
||||||
|
# if defined(HAVE_EPOLL_CREATE)
|
||||||
|
# define USE_EPOLL
|
||||||
|
# endif
|
||||||
|
# elif defined(HAVE_POLL_H)
|
||||||
|
# define USE_POLL
|
||||||
|
# else
|
||||||
|
# define USE_SELECT
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct qse_mux_t
|
||||||
|
{
|
||||||
|
qse_mmgr_t* mmgr;
|
||||||
|
qse_mux_errnum_t errnum;
|
||||||
|
|
||||||
|
qse_mux_evtfun_t evtfun;
|
||||||
|
|
||||||
|
#if defined(USE_SELECT)
|
||||||
|
fd_set rset;
|
||||||
|
fd_set wset;
|
||||||
|
fd_set tmprset;
|
||||||
|
fd_set tmpwset;
|
||||||
|
int size;
|
||||||
|
int maxhnd;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
qse_mux_evt_t** ptr;
|
||||||
|
int ubound;
|
||||||
|
} me;
|
||||||
|
|
||||||
|
#elif defined(USE_EPOLL)
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
struct epoll_event* ptr;
|
||||||
|
qse_size_t len;
|
||||||
|
qse_size_t capa;
|
||||||
|
} ee;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
qse_mux_evt_t** ptr;
|
||||||
|
int ubound;
|
||||||
|
} me;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
int qse_mux_init (qse_mux_t* mux, qse_mmgr_t* mmgr, qse_mux_evtfun_t evtfun, qse_size_t capahint);
|
||||||
|
void qse_mux_fini (qse_mux_t* mux);
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
static qse_mux_errnum_t syserr_to_errnum (DWORD e)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case ERROR_NOT_ENOUGH_MEMORY:
|
||||||
|
case ERROR_OUTOFMEMORY:
|
||||||
|
return QSE_MUX_ENOMEM;
|
||||||
|
|
||||||
|
case ERROR_INVALID_PARAMETER:
|
||||||
|
case ERROR_INVALID_HANDLE:
|
||||||
|
case ERROR_INVALID_NAME:
|
||||||
|
return QSE_MUX_EINVAL;
|
||||||
|
|
||||||
|
case ERROR_ACCESS_DENIED:
|
||||||
|
return QSE_MUX_EACCES;
|
||||||
|
|
||||||
|
case ERROR_FILE_NOT_FOUND:
|
||||||
|
case ERROR_PATH_NOT_FOUND:
|
||||||
|
return QSE_MUX_ENOENT;
|
||||||
|
|
||||||
|
case ERROR_ALREADY_EXISTS:
|
||||||
|
case ERROR_FILE_EXISTS:
|
||||||
|
return QSE_MUX_EEXIST;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return QSE_MUX_ESYSERR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
static qse_mux_errnum_t syserr_to_errnum (APIRET e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case ERROR_NOT_ENOUGH_MEMORY:
|
||||||
|
return QSE_MUX_ENOMEM;
|
||||||
|
|
||||||
|
case ERROR_INVALID_PARAMETER:
|
||||||
|
case ERROR_INVALID_HANDLE:
|
||||||
|
case ERROR_INVALID_NAME:
|
||||||
|
return QSE_MUX_EINVAL;
|
||||||
|
|
||||||
|
case ERROR_ACCESS_DENIED:
|
||||||
|
return QSE_MUX_EACCES;
|
||||||
|
|
||||||
|
case ERROR_FILE_NOT_FOUND:
|
||||||
|
case ERROR_PATH_NOT_FOUND:
|
||||||
|
return QSE_MUX_ENOENT;
|
||||||
|
|
||||||
|
case ERROR_ALREADY_EXISTS:
|
||||||
|
return QSE_MUX_EEXIST;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return QSE_MUX_ESYSERR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
static qse_mux_errnum_t syserr_to_errnum (int e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case ENOMEM:
|
||||||
|
return QSE_MUX_ENOMEM;
|
||||||
|
|
||||||
|
case EINVAL:
|
||||||
|
return QSE_MUX_EINVAL;
|
||||||
|
|
||||||
|
case EACCES:
|
||||||
|
return QSE_MUX_EACCES;
|
||||||
|
|
||||||
|
case ENOENT:
|
||||||
|
return QSE_MUX_ENOENT;
|
||||||
|
|
||||||
|
case EEXIST:
|
||||||
|
return QSE_MUX_EEXIST;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return QSE_MUX_ESYSERR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
static qse_mux_errnum_t syserr_to_errnum (int e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case ENOMEM:
|
||||||
|
return QSE_MUX_ENOMEM;
|
||||||
|
|
||||||
|
case EINVAL:
|
||||||
|
return QSE_MUX_EINVAL;
|
||||||
|
|
||||||
|
case ENOENT:
|
||||||
|
return QSE_MUX_ENOENT;
|
||||||
|
|
||||||
|
case EACCES:
|
||||||
|
return QSE_MUX_EACCES;
|
||||||
|
|
||||||
|
case EEXIST:
|
||||||
|
return QSE_MUX_EEXIST;
|
||||||
|
|
||||||
|
case EINTR:
|
||||||
|
return QSE_MUX_EINTR;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return QSE_MUX_ESYSERR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
qse_mux_t* qse_mux_open (qse_mmgr_t* mmgr, qse_size_t xtnsize, qse_mux_evtfun_t evtfun, qse_size_t capahint)
|
||||||
|
{
|
||||||
|
qse_mux_t* mux;
|
||||||
|
|
||||||
|
mux = QSE_MMGR_ALLOC (mmgr, QSE_SIZEOF(*mux) + xtnsize);
|
||||||
|
if (mux)
|
||||||
|
{
|
||||||
|
if (qse_mux_init (mux, mmgr, evtfun, capahint) <= -1)
|
||||||
|
{
|
||||||
|
QSE_MMGR_FREE (mmgr, mux);
|
||||||
|
mux = QSE_NULL;
|
||||||
|
}
|
||||||
|
else QSE_MEMSET (mux + 1, 0, xtnsize);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mux;
|
||||||
|
}
|
||||||
|
|
||||||
|
void qse_mux_close (qse_mux_t* mux)
|
||||||
|
{
|
||||||
|
qse_mux_fini (mux);
|
||||||
|
QSE_MMGR_FREE (mux->mmgr, mux);
|
||||||
|
}
|
||||||
|
|
||||||
|
int qse_mux_init (qse_mux_t* mux, qse_mmgr_t* mmgr, qse_mux_evtfun_t evtfun, qse_size_t capahint)
|
||||||
|
{
|
||||||
|
QSE_MEMSET (mux, 0, QSE_SIZEOF(*mux));
|
||||||
|
mux->mmgr = mmgr;
|
||||||
|
mux->evtfun = evtfun;
|
||||||
|
|
||||||
|
/* epoll_create returns an error and set errno to EINVAL
|
||||||
|
* if size is 0. Having a positive size greater than 0
|
||||||
|
* also makes easier other parts like maintaining internal
|
||||||
|
* event buffers */
|
||||||
|
if (capahint <= 0) capahint = 1;
|
||||||
|
|
||||||
|
#if defined(USE_SELECT)
|
||||||
|
FD_ZERO (&mux->rset);
|
||||||
|
FD_ZERO (&mux->wset);
|
||||||
|
mux->maxhnd = -1;
|
||||||
|
|
||||||
|
#elif defined(USE_EPOLL)
|
||||||
|
#if defined(HAVE_EPOLL_CREATE1) && defined(O_CLOEXEC)
|
||||||
|
mux->fd = epoll_create1 (O_CLOEXEC);
|
||||||
|
#else
|
||||||
|
mux->fd = epoll_create (capahint);
|
||||||
|
#endif
|
||||||
|
if (mux->fd <= -1)
|
||||||
|
{
|
||||||
|
mux->errnum = syserr_to_errnum (errno);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_EPOLL_CREATE1) && defined(O_CLOEXEC)
|
||||||
|
/* nothing to do */
|
||||||
|
#elif defined(FD_CLOEXEC)
|
||||||
|
{
|
||||||
|
int flag = fcntl (mux->fd, F_GETFD);
|
||||||
|
if (flag >= 0) fcntl (mux->fd, F_SETFD, flag | FD_CLOEXEC);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
/* TODO: */
|
||||||
|
mux->errnum = QSE_MUX_ENOIMPL;
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void qse_mux_fini (qse_mux_t* mux)
|
||||||
|
{
|
||||||
|
#if defined(USE_SELECT)
|
||||||
|
FD_ZERO (&mux->rset);
|
||||||
|
FD_ZERO (&mux->wset);
|
||||||
|
|
||||||
|
if (mux->me.ptr)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < mux->me.ubound; i++)
|
||||||
|
{
|
||||||
|
if (mux->me.ptr[i])
|
||||||
|
QSE_MMGR_FREE (mux->mmgr, mux->me.ptr[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSE_MMGR_FREE (mux->mmgr, mux->me.ptr);
|
||||||
|
mux->me.ubound = 0;
|
||||||
|
mux->maxhnd = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined(USE_EPOLL)
|
||||||
|
close (mux->fd);
|
||||||
|
|
||||||
|
if (mux->ee.ptr)
|
||||||
|
{
|
||||||
|
QSE_MMGR_FREE (mux->mmgr, mux->ee.ptr);
|
||||||
|
mux->ee.len = 0;
|
||||||
|
mux->ee.capa = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mux->me.ptr)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < mux->me.ubound; i++)
|
||||||
|
{
|
||||||
|
if (mux->me.ptr[i])
|
||||||
|
QSE_MMGR_FREE (mux->mmgr, mux->me.ptr[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSE_MMGR_FREE (mux->mmgr, mux->me.ptr);
|
||||||
|
mux->me.ubound = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
qse_mmgr_t* qse_mux_getmmgr (qse_mux_t* mux)
|
||||||
|
{
|
||||||
|
return mux->mmgr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* qse_mux_getxtn (qse_mux_t* mux)
|
||||||
|
{
|
||||||
|
return QSE_XTN (mux);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ALIGN_TO(num,align) ((((num) + (align) - 1) / (align)) * (align))
|
||||||
|
|
||||||
|
int qse_mux_insert (qse_mux_t* mux, const qse_mux_evt_t* evt)
|
||||||
|
{
|
||||||
|
#if defined(USE_SELECT)
|
||||||
|
|
||||||
|
if (evt->hnd >= mux->me.ubound)
|
||||||
|
{
|
||||||
|
qse_mux_evt_t** tmp;
|
||||||
|
int ubound;
|
||||||
|
|
||||||
|
ubound = evt->hnd + 1;
|
||||||
|
ubound = ALIGN_TO (ubound, 128);
|
||||||
|
|
||||||
|
tmp = QSE_MMGR_REALLOC (mux->mmgr, mux->me.ptr, QSE_SIZEOF(*mux->me.ptr) * ubound);
|
||||||
|
if (tmp == QSE_NULL)
|
||||||
|
{
|
||||||
|
mux->errnum = QSE_MUX_ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSE_MEMSET (&tmp[mux->me.ubound], 0, QSE_SIZEOF(*mux->me.ptr) * (ubound - mux->me.ubound));
|
||||||
|
mux->me.ptr = tmp;
|
||||||
|
mux->me.ubound = ubound;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mux->me.ptr[evt->hnd])
|
||||||
|
{
|
||||||
|
mux->me.ptr[evt->hnd] = QSE_MMGR_ALLOC (mux->mmgr, QSE_SIZEOF(*evt));
|
||||||
|
if (!mux->me.ptr[evt->hnd])
|
||||||
|
{
|
||||||
|
mux->errnum = QSE_MUX_ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (evt->mask & QSE_MUX_IN) FD_SET (evt->hnd, &mux->rset);
|
||||||
|
if (evt->mask & QSE_MUX_OUT) FD_SET (evt->hnd, &mux->wset);
|
||||||
|
|
||||||
|
*mux->me.ptr[evt->hnd] = *evt;
|
||||||
|
if (evt->hnd > mux->maxhnd) mux->maxhnd = evt->hnd;
|
||||||
|
mux->size++;
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#elif defined(USE_EPOLL)
|
||||||
|
struct epoll_event ev;
|
||||||
|
|
||||||
|
QSE_MEMSET (&ev, 0, QSE_SIZEOF(ev));
|
||||||
|
if (evt->mask & QSE_MUX_IN) ev.events |= EPOLLIN;
|
||||||
|
if (evt->mask & QSE_MUX_OUT) ev.events |= EPOLLOUT;
|
||||||
|
ev.data.fd = evt->hnd;
|
||||||
|
|
||||||
|
if (ev.events == 0 || evt->hnd < 0)
|
||||||
|
{
|
||||||
|
mux->errnum = QSE_MUX_EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (evt->hnd >= mux->me.ubound)
|
||||||
|
{
|
||||||
|
qse_mux_evt_t** tmp;
|
||||||
|
int ubound;
|
||||||
|
|
||||||
|
ubound = evt->hnd + 1;
|
||||||
|
ubound = ALIGN_TO (ubound, 128);
|
||||||
|
|
||||||
|
tmp = QSE_MMGR_REALLOC (mux->mmgr, mux->me.ptr, QSE_SIZEOF(*mux->me.ptr) * ubound);
|
||||||
|
if (tmp == QSE_NULL)
|
||||||
|
{
|
||||||
|
mux->errnum = QSE_MUX_ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSE_MEMSET (&tmp[mux->me.ubound], 0, QSE_SIZEOF(*mux->me.ptr) * (ubound - mux->me.ubound));
|
||||||
|
mux->me.ptr = tmp;
|
||||||
|
mux->me.ubound = ubound;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mux->me.ptr[evt->hnd])
|
||||||
|
{
|
||||||
|
mux->me.ptr[evt->hnd] = QSE_MMGR_ALLOC (mux->mmgr, QSE_SIZEOF(*evt));
|
||||||
|
if (!mux->me.ptr[evt->hnd])
|
||||||
|
{
|
||||||
|
mux->errnum = QSE_MUX_ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mux->ee.len >= mux->ee.capa)
|
||||||
|
{
|
||||||
|
struct epoll_event* tmp;
|
||||||
|
qse_size_t newcapa;
|
||||||
|
|
||||||
|
newcapa = (mux->ee.capa + 1) * 2;
|
||||||
|
newcapa = ALIGN_TO (newcapa, 256);
|
||||||
|
|
||||||
|
tmp = QSE_MMGR_REALLOC (
|
||||||
|
mux->mmgr, mux->ee.ptr,
|
||||||
|
QSE_SIZEOF(*mux->ee.ptr) * newcapa);
|
||||||
|
if (tmp == QSE_NULL)
|
||||||
|
{
|
||||||
|
mux->errnum = QSE_MUX_ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
mux->ee.ptr = tmp;
|
||||||
|
mux->ee.capa = newcapa;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (epoll_ctl (mux->fd, EPOLL_CTL_ADD, evt->hnd, &ev) == -1)
|
||||||
|
{
|
||||||
|
mux->errnum = syserr_to_errnum (errno);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*mux->me.ptr[evt->hnd] = *evt;
|
||||||
|
mux->ee.len++;
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
/* TODO: */
|
||||||
|
mux->errnum = QSE_MUX_ENOIMPL;
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int qse_mux_delete (qse_mux_t* mux, const qse_mux_evt_t* evt)
|
||||||
|
{
|
||||||
|
#if defined(USE_SELECT)
|
||||||
|
qse_mux_evt_t* mevt;
|
||||||
|
|
||||||
|
if (mux->size <= 0 || evt->hnd < 0 || evt->hnd >= mux->me.ubound)
|
||||||
|
{
|
||||||
|
mux->errnum = QSE_MUX_EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
mevt = mux->me.ptr[evt->hnd];
|
||||||
|
if (mevt->hnd != evt->hnd)
|
||||||
|
{
|
||||||
|
/* already deleted??? */
|
||||||
|
mux->errnum = QSE_MUX_EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mevt->mask & QSE_MUX_IN) FD_CLR (evt->hnd, &mux->rset);
|
||||||
|
if (mevt->mask & QSE_MUX_OUT) FD_CLR (evt->hnd, &mux->wset);
|
||||||
|
|
||||||
|
if (mevt->hnd == mux->maxhnd)
|
||||||
|
{
|
||||||
|
qse_mux_hnd_t i;
|
||||||
|
|
||||||
|
for (i = mevt->hnd; i > 0; )
|
||||||
|
{
|
||||||
|
i--;
|
||||||
|
if (mux->me.ptr[i] && mux->me.ptr[i]->hnd >= 0)
|
||||||
|
{
|
||||||
|
QSE_ASSERT (i == mux->me.ptr[i]->hnd);
|
||||||
|
mux->maxhnd = mux->me.ptr[i]->hnd;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mux->maxhnd = -1;
|
||||||
|
QSE_ASSERT (mux->size == 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
mevt->hnd = -1;
|
||||||
|
mux->size--;
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#elif defined(USE_EPOLL)
|
||||||
|
if (mux->ee.len <= 0)
|
||||||
|
{
|
||||||
|
mux->errnum = QSE_MUX_EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (epoll_ctl (mux->fd, EPOLL_CTL_DEL, evt->hnd, QSE_NULL) <= -1)
|
||||||
|
{
|
||||||
|
mux->errnum = syserr_to_errnum(errno);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
mux->ee.len--;
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
/* TODO */
|
||||||
|
mux->errnum = QSE_MUX_ENOIMPL;
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int qse_mux_poll (qse_mux_t* mux, qse_ntime_t timeout)
|
||||||
|
{
|
||||||
|
|
||||||
|
#if defined(USE_SELECT)
|
||||||
|
struct timeval tv;
|
||||||
|
int n;
|
||||||
|
|
||||||
|
tv.tv_sec = timeout / QSE_MSECS_PER_SEC;
|
||||||
|
tv.tv_usec = (timeout % QSE_MSECS_PER_SEC) * QSE_USECS_PER_MSEC;
|
||||||
|
|
||||||
|
mux->tmprset = mux->rset;
|
||||||
|
mux->tmpwset = mux->wset;
|
||||||
|
|
||||||
|
n = select (mux->maxhnd + 1, &mux->tmprset, &mux->tmpwset, QSE_NULL, &tv);
|
||||||
|
if (n <= -1)
|
||||||
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
mux->errnum = syserr_to_errnum(WSAGetLastError());
|
||||||
|
#else
|
||||||
|
mux->errnum = syserr_to_errnum(errno);
|
||||||
|
#endif
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (n > 0)
|
||||||
|
{
|
||||||
|
qse_mux_hnd_t i;
|
||||||
|
qse_mux_evt_t* evt, xevt;
|
||||||
|
|
||||||
|
for (i = 0 ; i < mux->maxhnd; i++)
|
||||||
|
{
|
||||||
|
evt = mux->me.ptr[i];
|
||||||
|
if (!evt || evt->hnd != i) continue;
|
||||||
|
|
||||||
|
QSE_MEMCPY (&xevt, evt, QSE_SIZEOF(xevt));
|
||||||
|
|
||||||
|
xevt.mask = 0;
|
||||||
|
if ((evt->mask & QSE_MUX_IN) && FD_ISSET(evt->hnd, &mux->tmprset)) xevt.mask |= QSE_MUX_IN;
|
||||||
|
if ((evt->mask & QSE_MUX_OUT) && FD_ISSET(evt->hnd, &mux->tmpwset)) xevt.mask |= QSE_MUX_OUT;
|
||||||
|
|
||||||
|
if (xevt.mask > 0) mux->evtfun (mux, &xevt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
|
|
||||||
|
#elif defined(USE_EPOLL)
|
||||||
|
int nfds, hnd, i, mask;
|
||||||
|
qse_mux_evt_t* evt, xevt;
|
||||||
|
|
||||||
|
nfds = epoll_wait (mux->fd, mux->ee.ptr, mux->ee.len, timeout);
|
||||||
|
if (nfds <= -1)
|
||||||
|
{
|
||||||
|
mux->errnum = syserr_to_errnum(errno);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < nfds; i++)
|
||||||
|
{
|
||||||
|
hnd = mux->ee.ptr[i].data.fd;
|
||||||
|
evt = mux->me.ptr[hnd];
|
||||||
|
|
||||||
|
QSE_ASSERT (evt->hnd == hnd);
|
||||||
|
|
||||||
|
QSE_MEMCPY (&xevt, evt, QSE_SIZEOF(xevt));
|
||||||
|
|
||||||
|
xevt.mask = 0;
|
||||||
|
if (mux->ee.ptr[i].events & EPOLLIN) xevt.mask |= QSE_MUX_IN;
|
||||||
|
if (mux->ee.ptr[i].events & EPOLLOUT) xevt.mask |= QSE_MUX_OUT;
|
||||||
|
|
||||||
|
if (mux->ee.ptr[i].events & EPOLLHUP)
|
||||||
|
{
|
||||||
|
if (evt->mask & QSE_MUX_IN)
|
||||||
|
xevt.mask |= QSE_MUX_IN;
|
||||||
|
if (evt->mask & QSE_MUX_OUT)
|
||||||
|
xevt.mask |= QSE_MUX_OUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
mux->evtfun (mux, &xevt);
|
||||||
|
}
|
||||||
|
|
||||||
|
return nfds;
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* TODO */
|
||||||
|
mux->errnum = QSE_MUX_ENOIMPL;
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -20,13 +20,8 @@
|
|||||||
|
|
||||||
#include <qse/cmn/path.h>
|
#include <qse/cmn/path.h>
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__)
|
#define IS_MSEP(c) QSE_ISPATHMBSEP(c)
|
||||||
# define IS_MSEP(c) ((c) == QSE_MT('/') || (c) == QSE_MT('\\'))
|
#define IS_WSEP(c) QSE_ISPATHWCSEP(c)
|
||||||
# define IS_WSEP(c) ((c) == QSE_WT('/') || (c) == QSE_WT('\\'))
|
|
||||||
#else
|
|
||||||
# define IS_MSEP(c) ((c) == QSE_MT('/'))
|
|
||||||
# define IS_WSEP(c) ((c) == QSE_WT('/'))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const qse_mchar_t* qse_mbsbasename (const qse_mchar_t* path)
|
const qse_mchar_t* qse_mbsbasename (const qse_mchar_t* path)
|
||||||
{
|
{
|
||||||
|
@ -24,12 +24,7 @@
|
|||||||
/* MBS IMPLEMENTATION */
|
/* MBS IMPLEMENTATION */
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#define IS_MSEP(c) QSE_ISPATHMBSEP(c)
|
||||||
#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__)
|
|
||||||
# define IS_MSEP(c) ((c) == QSE_MT('/') || (c) == QSE_MT('\\'))
|
|
||||||
#else
|
|
||||||
# define IS_MSEP(c) ((c) == QSE_MT('/'))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IS_MNIL(c) ((c) == QSE_MT('\0'))
|
#define IS_MNIL(c) ((c) == QSE_MT('\0'))
|
||||||
#define IS_MSEP_OR_MNIL(c) (IS_MSEP(c) || IS_MNIL(c))
|
#define IS_MSEP_OR_MNIL(c) (IS_MSEP(c) || IS_MNIL(c))
|
||||||
|
@ -363,7 +363,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ===== DIRECTORY - not really system calls ===== */
|
/* ===== DIRECTORY - not really system calls ===== */
|
||||||
typedef DIR qse_dir_t;
|
|
||||||
#define QSE_OPENDIR(name) opendir(name)
|
#define QSE_OPENDIR(name) opendir(name)
|
||||||
#define QSE_CLOSEDIR(name) closedir(name)
|
#define QSE_CLOSEDIR(name) closedir(name)
|
||||||
|
|
||||||
|
@ -448,11 +448,6 @@ void qse_htrd_clear (qse_htrd_t* htrd)
|
|||||||
clear_feed (htrd);
|
clear_feed (htrd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qse_htrd_setmmgr (qse_htrd_t* htrd, qse_mmgr_t* mmgr)
|
|
||||||
{
|
|
||||||
htrd->mmgr = mmgr;
|
|
||||||
}
|
|
||||||
|
|
||||||
qse_mmgr_t* qse_htrd_getmmgr (qse_htrd_t* htrd)
|
qse_mmgr_t* qse_htrd_getmmgr (qse_htrd_t* htrd)
|
||||||
{
|
{
|
||||||
return htrd->mmgr;
|
return htrd->mmgr;
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
#include <qse/cmn/alg.h>
|
#include <qse/cmn/alg.h>
|
||||||
#include <qse/cmn/fmt.h>
|
#include <qse/cmn/fmt.h>
|
||||||
#include <qse/cmn/path.h>
|
#include <qse/cmn/path.h>
|
||||||
|
#include <qse/cmn/mux.h>
|
||||||
|
#include <qse/cmn/dir.h>
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
@ -47,7 +49,7 @@
|
|||||||
# if defined(HAVE_SYS_SENDFILE_H)
|
# if defined(HAVE_SYS_SENDFILE_H)
|
||||||
# include <sys/sendfile.h>
|
# include <sys/sendfile.h>
|
||||||
# endif
|
# endif
|
||||||
# if defined(HAVE_EPOLL) && defined(HAVE_SYS_EPOLL_H)
|
# if defined(HAVE_SYS_EPOLL_H)
|
||||||
# include <sys/epoll.h>
|
# include <sys/epoll.h>
|
||||||
# endif
|
# endif
|
||||||
# if defined(__linux__)
|
# if defined(__linux__)
|
||||||
@ -544,11 +546,15 @@ static int server_open (qse_httpd_t* httpd, qse_httpd_server_t* server)
|
|||||||
fd = socket (SOCKADDR_FAMILY(&addr), SOCK_STREAM, IPPROTO_TCP);
|
fd = socket (SOCKADDR_FAMILY(&addr), SOCK_STREAM, IPPROTO_TCP);
|
||||||
if (fd <= -1) goto oops;
|
if (fd <= -1) goto oops;
|
||||||
|
|
||||||
|
#if defined(FD_CLOEXEC)
|
||||||
flag = fcntl (fd, F_GETFD);
|
flag = fcntl (fd, F_GETFD);
|
||||||
if (flag >= 0) fcntl (fd, F_SETFD, flag | FD_CLOEXEC);
|
if (flag >= 0) fcntl (fd, F_SETFD, flag | FD_CLOEXEC);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(SO_REUSEADDR)
|
||||||
flag = 1;
|
flag = 1;
|
||||||
setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &flag, QSE_SIZEOF(flag));
|
setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &flag, QSE_SIZEOF(flag));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* TODO: linux. use capset() to set required capabilities just in case */
|
/* TODO: linux. use capset() to set required capabilities just in case */
|
||||||
#if defined(IP_TRANSPARENT)
|
#if defined(IP_TRANSPARENT)
|
||||||
@ -621,21 +627,41 @@ IP_TRANSPRENT is needed for:
|
|||||||
|
|
||||||
if (listen (fd, 10) <= -1) goto oops;
|
if (listen (fd, 10) <= -1) goto oops;
|
||||||
|
|
||||||
|
#if defined(O_NONBLOCK)
|
||||||
flag = fcntl (fd, F_GETFL);
|
flag = fcntl (fd, F_GETFL);
|
||||||
if (flag >= 0) fcntl (fd, F_SETFL, flag | O_NONBLOCK);
|
if (flag >= 0) fcntl (fd, F_SETFL, flag | O_NONBLOCK);
|
||||||
|
#endif
|
||||||
|
|
||||||
server->handle.i = fd;
|
server->handle.i = fd;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
oops:
|
oops:
|
||||||
|
#if defined(_WIN32)
|
||||||
|
qse_httpd_seterrnum (httpd, syserr_to_errnum(WSAGetLastError()));
|
||||||
|
if (fd != INVALID_SOCKET) closesocket (fd);
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
qse_httpd_seterrnum (httpd, syserr_to_errnum(sock_errno()));
|
||||||
|
if (fd >= 0) soclose (fd);
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
#else
|
||||||
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
||||||
if (fd >= 0) QSE_CLOSE (fd);
|
if (fd >= 0) QSE_CLOSE (fd);
|
||||||
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void server_close (qse_httpd_t* httpd, qse_httpd_server_t* server)
|
static void server_close (qse_httpd_t* httpd, qse_httpd_server_t* server)
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
closesocket (server->handle.i);
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
soclose (server->handle.i);
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
#else
|
||||||
QSE_CLOSE (server->handle.i);
|
QSE_CLOSE (server->handle.i);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int server_accept (
|
static int server_accept (
|
||||||
@ -643,7 +669,7 @@ static int server_accept (
|
|||||||
{
|
{
|
||||||
sockaddr_t addr;
|
sockaddr_t addr;
|
||||||
|
|
||||||
#ifdef HAVE_SOCKLEN_T
|
#if defined(HAVE_SOCKLEN_T)
|
||||||
socklen_t addrlen;
|
socklen_t addrlen;
|
||||||
#else
|
#else
|
||||||
int addrlen;
|
int addrlen;
|
||||||
@ -667,12 +693,16 @@ qse_fprintf (QSE_STDERR, QSE_T("Error: too many client?\n"));
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(FD_CLOEXEC)
|
||||||
flag = fcntl (fd, F_GETFD);
|
flag = fcntl (fd, F_GETFD);
|
||||||
if (flag >= 0) fcntl (fd, F_SETFD, flag | FD_CLOEXEC);
|
if (flag >= 0) fcntl (fd, F_SETFD, flag | FD_CLOEXEC);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(O_NONBLOCK)
|
||||||
flag = fcntl (fd, F_GETFL);
|
flag = fcntl (fd, F_GETFL);
|
||||||
if (flag >= 0) fcntl (fd, F_SETFL, flag | O_NONBLOCK);
|
if (flag >= 0) fcntl (fd, F_SETFL, flag | O_NONBLOCK);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sockaddr_to_nwad (&addr, &client->remote_addr) <= -1)
|
if (sockaddr_to_nwad (&addr, &client->remote_addr) <= -1)
|
||||||
{
|
{
|
||||||
@ -721,10 +751,22 @@ qse_fprintf (QSE_STDERR, QSE_T("Error: too many client?\n"));
|
|||||||
|
|
||||||
static int peer_open (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
static int peer_open (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
||||||
{
|
{
|
||||||
int fd = -1, flag;
|
|
||||||
sockaddr_t connaddr, bindaddr;
|
sockaddr_t connaddr, bindaddr;
|
||||||
int connaddrsize, bindaddrsize;
|
int connaddrsize, bindaddrsize;
|
||||||
int connected = 1;
|
int connected = 1;
|
||||||
|
#if defined(_WIN32)
|
||||||
|
SOCKET fd = -1;
|
||||||
|
unsigned long cmd;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
int fd = -1;
|
||||||
|
int flag;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
int fd = -1;
|
||||||
|
int flag;
|
||||||
|
#else
|
||||||
|
int fd = -1;
|
||||||
|
int flag;
|
||||||
|
#endif
|
||||||
|
|
||||||
connaddrsize = nwad_to_sockaddr (&peer->nwad, &connaddr);
|
connaddrsize = nwad_to_sockaddr (&peer->nwad, &connaddr);
|
||||||
bindaddrsize = nwad_to_sockaddr (&peer->local, &bindaddr);
|
bindaddrsize = nwad_to_sockaddr (&peer->local, &bindaddr);
|
||||||
@ -741,14 +783,37 @@ static int peer_open (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
|||||||
flag = 1;
|
flag = 1;
|
||||||
setsockopt (fd, SOL_IP, IP_TRANSPARENT, &flag, QSE_SIZEOF(flag));
|
setsockopt (fd, SOL_IP, IP_TRANSPARENT, &flag, QSE_SIZEOF(flag));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (bind (fd, (struct sockaddr*)&bindaddr, bindaddrsize) <= -1)
|
if (bind (fd, (struct sockaddr*)&bindaddr, bindaddrsize) <= -1)
|
||||||
{
|
{
|
||||||
/* i won't care about binding faiulre */
|
/* i won't care about binding faiulre */
|
||||||
/* TODO: some logging for this failure though */
|
/* TODO: some logging for this failure though */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
cmd = 1;
|
||||||
|
if (ioctlsocket(fd, FIONBIO, &cmd) == SOCKET_ERROR) goto oops;
|
||||||
|
|
||||||
|
if (connect (fd, (struct sockaddr*)&connaddr, connaddrsize) <= -1)
|
||||||
|
{
|
||||||
|
if (WSAGetLastError() != WSAEWOULDBLOCK) goto oops;
|
||||||
|
connected = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd = 0;
|
||||||
|
if (ioctlsocket(fd, FIONBIO, &cmd) == SOCKET_ERROR) goto oops;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
/* TODO: */
|
||||||
|
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
#else
|
||||||
|
|
||||||
|
#if defined(FD_CLOEXEC)
|
||||||
flag = fcntl (fd, F_GETFD);
|
flag = fcntl (fd, F_GETFD);
|
||||||
if (flag >= 0) fcntl (fd, F_SETFD, flag | FD_CLOEXEC);
|
if (flag >= 0) fcntl (fd, F_SETFD, flag | FD_CLOEXEC);
|
||||||
|
#endif
|
||||||
|
|
||||||
flag = fcntl (fd, F_GETFL);
|
flag = fcntl (fd, F_GETFL);
|
||||||
if (flag >= 0) fcntl (fd, F_SETFL, flag | O_NONBLOCK);
|
if (flag >= 0) fcntl (fd, F_SETFL, flag | O_NONBLOCK);
|
||||||
@ -761,24 +826,73 @@ static int peer_open (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
|||||||
|
|
||||||
/* restore flags */
|
/* restore flags */
|
||||||
if (fcntl (fd, F_SETFL, flag) <= -1) goto oops;
|
if (fcntl (fd, F_SETFL, flag) <= -1) goto oops;
|
||||||
|
#endif
|
||||||
|
|
||||||
peer->handle.i = fd;
|
peer->handle.i = fd;
|
||||||
return connected;
|
return connected;
|
||||||
|
|
||||||
oops:
|
oops:
|
||||||
|
#if defined(_WIN32)
|
||||||
|
qse_httpd_seterrnum (httpd, syserr_to_errnum(WSAGetLastError()));
|
||||||
|
if (fd != INVALID_SOCKET) closesocket (fd);
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
qse_httpd_seterrnum (httpd, syserr_to_errnum(sock_errno()));
|
||||||
|
if (fd >= 0) soclose (fd);
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
#else
|
||||||
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
||||||
if (fd >= 0) QSE_CLOSE (fd);
|
if (fd >= 0) QSE_CLOSE (fd);
|
||||||
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void peer_close (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
static void peer_close (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
closesocket (peer->handle.i);
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
soclose (peer->handle.i);
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
#else
|
||||||
QSE_CLOSE (peer->handle.i);
|
QSE_CLOSE (peer->handle.i);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int peer_connected (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
static int peer_connected (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SOCKLEN_T
|
#if defined(_WIN32)
|
||||||
|
int len;
|
||||||
|
DWORD ret;
|
||||||
|
|
||||||
|
len = QSE_SIZEOF(ret);
|
||||||
|
if (getsockopt (peer->handle.i, SOL_SOCKET, SO_ERROR, (char*)&ret, &len) == SOCKET_ERROR)
|
||||||
|
{
|
||||||
|
qse_httpd_seterrnum (httpd, syserr_to_errnum (ret));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret == WSAEWOULDBLOCK) return 0;
|
||||||
|
if (ret != 0)
|
||||||
|
{
|
||||||
|
qse_httpd_seterrnum (httpd, syserr_to_errnum (ret));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1; /* connection completed */
|
||||||
|
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
/* TODO */
|
||||||
|
httpd->errnum = QSE_HTTPD_ENOIMPL;
|
||||||
|
return -1;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO */
|
||||||
|
httpd->errnum = QSE_HTTPD_ENOIMPL;
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
|
|
||||||
|
#if defined(HAVE_SOCKLEN_T)
|
||||||
socklen_t len;
|
socklen_t len;
|
||||||
#else
|
#else
|
||||||
int len;
|
int len;
|
||||||
@ -786,7 +900,11 @@ static int peer_connected (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
len = QSE_SIZEOF(ret);
|
len = QSE_SIZEOF(ret);
|
||||||
if (getsockopt (peer->handle.i, SOL_SOCKET, SO_ERROR, &ret, &len) <= -1) return -1;
|
if (getsockopt (peer->handle.i, SOL_SOCKET, SO_ERROR, &ret, &len) <= -1)
|
||||||
|
{
|
||||||
|
qse_httpd_seterrnum (httpd, syserr_to_errnum (ret));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret == EINPROGRESS) return 0;
|
if (ret == EINPROGRESS) return 0;
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
@ -796,13 +914,14 @@ static int peer_connected (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 1; /* connection completed */
|
return 1; /* connection completed */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static qse_ssize_t peer_recv (
|
static qse_ssize_t peer_recv (
|
||||||
qse_httpd_t* httpd, qse_httpd_peer_t* peer,
|
qse_httpd_t* httpd, qse_httpd_peer_t* peer,
|
||||||
qse_mchar_t* buf, qse_size_t bufsize)
|
qse_mchar_t* buf, qse_size_t bufsize)
|
||||||
{
|
{
|
||||||
ssize_t ret = read (peer->handle.i, buf, bufsize);
|
ssize_t ret = recv (peer->handle.i, buf, bufsize, 0);
|
||||||
if (ret <= -1) qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
if (ret <= -1) qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -811,216 +930,101 @@ static qse_ssize_t peer_send (
|
|||||||
qse_httpd_t* httpd, qse_httpd_peer_t* peer,
|
qse_httpd_t* httpd, qse_httpd_peer_t* peer,
|
||||||
const qse_mchar_t* buf, qse_size_t bufsize)
|
const qse_mchar_t* buf, qse_size_t bufsize)
|
||||||
{
|
{
|
||||||
ssize_t ret = write (peer->handle.i, buf, bufsize);
|
ssize_t ret = send (peer->handle.i, buf, bufsize, 0);
|
||||||
if (ret <= -1) qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
if (ret <= -1) qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
struct mux_ev_t
|
typedef struct mux_xtn_t mux_xtn_t;
|
||||||
|
struct mux_xtn_t
|
||||||
{
|
{
|
||||||
qse_ubi_t handle;
|
qse_httpd_t* httpd;
|
||||||
int reqmask;
|
|
||||||
qse_httpd_muxcb_t cbfun;
|
qse_httpd_muxcb_t cbfun;
|
||||||
void* cbarg;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mux_t
|
static void dispatch_muxcb (qse_mux_t* mux, const qse_mux_evt_t* evt)
|
||||||
{
|
{
|
||||||
int fd;
|
mux_xtn_t* xtn;
|
||||||
|
qse_ubi_t ubi;
|
||||||
|
|
||||||
struct
|
xtn = qse_mux_getxtn (mux);
|
||||||
|
ubi.i = evt->hnd;
|
||||||
|
xtn->cbfun (xtn->httpd, mux, ubi, evt->mask, evt->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void* mux_open (qse_httpd_t* httpd, qse_httpd_muxcb_t cbfun)
|
||||||
{
|
{
|
||||||
struct epoll_event* ptr;
|
qse_mux_t* mux;
|
||||||
qse_size_t len;
|
mux_xtn_t* xtn;
|
||||||
qse_size_t capa;
|
|
||||||
} ee;
|
|
||||||
|
|
||||||
struct
|
mux = qse_mux_open (httpd->mmgr, QSE_SIZEOF(*xtn), dispatch_muxcb, 256);
|
||||||
|
if (!mux)
|
||||||
{
|
{
|
||||||
struct mux_ev_t** ptr;
|
/* TODO
|
||||||
qse_size_t capa;
|
qse_httpd_seterrnum (httpd, muxerr_to_errnum(mux));
|
||||||
} mev;
|
*/
|
||||||
};
|
|
||||||
|
|
||||||
#define MUX_EV_ALIGN 64
|
|
||||||
|
|
||||||
static void* mux_open (qse_httpd_t* httpd)
|
|
||||||
{
|
|
||||||
struct mux_t* mux;
|
|
||||||
|
|
||||||
mux = qse_httpd_allocmem (httpd, QSE_SIZEOF(*mux));
|
|
||||||
if (mux == QSE_NULL) return QSE_NULL;
|
|
||||||
|
|
||||||
QSE_MEMSET (mux, 0, QSE_SIZEOF(*mux));
|
|
||||||
|
|
||||||
#if defined(HAVE_EPOLL_CREATE1) && defined(O_CLOEXEC)
|
|
||||||
mux->fd = epoll_create1 (O_CLOEXEC);
|
|
||||||
#else
|
|
||||||
mux->fd = epoll_create (100);
|
|
||||||
#endif
|
|
||||||
if (mux->fd <= -1)
|
|
||||||
{
|
|
||||||
qse_httpd_freemem (httpd, mux);
|
|
||||||
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
|
||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_EPOLL_CREATE1) && defined(O_CLOEXEC)
|
xtn = qse_mux_getxtn (mux);
|
||||||
/* nothing else to do */
|
xtn->httpd = httpd;
|
||||||
#else
|
xtn->cbfun = cbfun;
|
||||||
{
|
|
||||||
int flag = fcntl (mux->fd, F_GETFD);
|
|
||||||
if (flag >= 0) fcntl (mux->fd, F_SETFD, flag | FD_CLOEXEC);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return mux;
|
return mux;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mux_close (qse_httpd_t* httpd, void* vmux)
|
static void mux_close (qse_httpd_t* httpd, void* vmux)
|
||||||
{
|
{
|
||||||
struct mux_t* mux = (struct mux_t*)vmux;
|
qse_mux_close ((qse_mux_t*)vmux);
|
||||||
if (mux->ee.ptr) qse_httpd_freemem (httpd, mux->ee.ptr);
|
|
||||||
if (mux->mev.ptr)
|
|
||||||
{
|
|
||||||
qse_size_t i;
|
|
||||||
for (i = 0; i < mux->mev.capa; i++)
|
|
||||||
if (mux->mev.ptr[i]) qse_httpd_freemem (httpd, mux->mev.ptr[i]);
|
|
||||||
qse_httpd_freemem (httpd, mux->mev.ptr);
|
|
||||||
}
|
|
||||||
QSE_CLOSE (mux->fd);
|
|
||||||
qse_httpd_freemem (httpd, mux);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mux_addhnd (
|
static int mux_addhnd (
|
||||||
qse_httpd_t* httpd, void* vmux, qse_ubi_t handle,
|
qse_httpd_t* httpd, void* vmux, qse_ubi_t handle, int mask, void* data)
|
||||||
int mask, qse_httpd_muxcb_t cbfun, void* cbarg)
|
|
||||||
{
|
{
|
||||||
struct mux_t* mux = (struct mux_t*)vmux;
|
qse_mux_evt_t evt;
|
||||||
struct epoll_event ev;
|
|
||||||
struct mux_ev_t* mev;
|
|
||||||
|
|
||||||
ev.events = 0;
|
evt.hnd = handle.i;
|
||||||
if (mask & QSE_HTTPD_MUX_READ) ev.events |= EPOLLIN;
|
evt.mask = 0;
|
||||||
if (mask & QSE_HTTPD_MUX_WRITE) ev.events |= EPOLLOUT;
|
if (mask & QSE_HTTPD_MUX_READ) evt.mask |= QSE_MUX_IN;
|
||||||
|
if (mask & QSE_HTTPD_MUX_WRITE) evt.mask |= QSE_MUX_OUT;
|
||||||
|
evt.data = data;
|
||||||
|
|
||||||
if (ev.events == 0 || handle.i <= -1)
|
if (qse_mux_insert ((qse_mux_t*)vmux, &evt) <= -1)
|
||||||
{
|
{
|
||||||
qse_httpd_seterrnum (httpd, QSE_HTTPD_EINVAL);
|
/* TODO
|
||||||
|
qse_httpd_seterrnum (httpd, muxerr_to_errnum(mux));
|
||||||
|
*/
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handle.i >= mux->mev.capa)
|
|
||||||
{
|
|
||||||
struct mux_ev_t** tmp;
|
|
||||||
qse_size_t tmpcapa, i;
|
|
||||||
|
|
||||||
tmpcapa = (((handle.i + MUX_EV_ALIGN) / MUX_EV_ALIGN) * MUX_EV_ALIGN);
|
|
||||||
|
|
||||||
tmp = (struct mux_ev_t**) qse_httpd_reallocmem (
|
|
||||||
httpd, mux->mev.ptr,
|
|
||||||
QSE_SIZEOF(*mux->mev.ptr) * tmpcapa);
|
|
||||||
if (tmp == QSE_NULL) return -1;
|
|
||||||
|
|
||||||
for (i = mux->mev.capa; i < tmpcapa; i++) tmp[i] = QSE_NULL;
|
|
||||||
mux->mev.ptr = tmp;
|
|
||||||
mux->mev.capa = tmpcapa;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mux->mev.ptr[handle.i] == QSE_NULL)
|
|
||||||
{
|
|
||||||
/* the location of the data passed to epoll_ctl()
|
|
||||||
* must not change unless i update the info with epoll()
|
|
||||||
* whenever there is reallocation. so i simply
|
|
||||||
* make mux-mev.ptr reallocatable but auctual
|
|
||||||
* data fixed once allocated. */
|
|
||||||
mux->mev.ptr[handle.i] = qse_httpd_allocmem (
|
|
||||||
httpd, QSE_SIZEOF(*mux->mev.ptr[handle.i]));
|
|
||||||
if (mux->mev.ptr[handle.i] == QSE_NULL) return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mux->ee.len >= mux->ee.capa)
|
|
||||||
{
|
|
||||||
struct epoll_event* tmp;
|
|
||||||
|
|
||||||
tmp = qse_httpd_reallocmem (
|
|
||||||
httpd, mux->ee.ptr,
|
|
||||||
QSE_SIZEOF(*mux->ee.ptr) * (mux->ee.capa + 1) * 2);
|
|
||||||
if (tmp == QSE_NULL) return -1;
|
|
||||||
|
|
||||||
mux->ee.ptr = tmp;
|
|
||||||
mux->ee.capa = (mux->ee.capa + 1) * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
mev = mux->mev.ptr[handle.i];
|
|
||||||
mev->handle = handle;
|
|
||||||
mev->reqmask = mask;
|
|
||||||
mev->cbfun = cbfun;
|
|
||||||
mev->cbarg = cbarg;
|
|
||||||
|
|
||||||
ev.data.ptr = mev;
|
|
||||||
|
|
||||||
if (epoll_ctl (mux->fd, EPOLL_CTL_ADD, handle.i, &ev) <= -1)
|
|
||||||
{
|
|
||||||
/* don't rollback ee.ptr */
|
|
||||||
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
mux->ee.len++;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mux_delhnd (qse_httpd_t* httpd, void* vmux, qse_ubi_t handle)
|
static int mux_delhnd (qse_httpd_t* httpd, void* vmux, qse_ubi_t handle)
|
||||||
{
|
{
|
||||||
struct mux_t* mux = (struct mux_t*)vmux;
|
qse_mux_evt_t evt;
|
||||||
|
evt.hnd = handle.i;
|
||||||
if (epoll_ctl (mux->fd, EPOLL_CTL_DEL, handle.i, QSE_NULL) <= -1)
|
if (qse_mux_delete ((qse_mux_t*)vmux, &evt) <= -1)
|
||||||
{
|
{
|
||||||
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
/* TODO
|
||||||
|
qse_httpd_seterrnum (httpd, muxerr_to_errnum(mux));
|
||||||
|
*/
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
mux->ee.len--;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mux_poll (qse_httpd_t* httpd, void* vmux, qse_ntime_t timeout)
|
static int mux_poll (qse_httpd_t* httpd, void* vmux, qse_ntime_t timeout)
|
||||||
{
|
{
|
||||||
struct mux_t* mux = (struct mux_t*)vmux;
|
if (qse_mux_poll ((qse_mux_t*)vmux, timeout) <= -1)
|
||||||
struct mux_ev_t* mev;
|
|
||||||
int mask, nfds, i;
|
|
||||||
|
|
||||||
nfds = epoll_wait (mux->fd, mux->ee.ptr, mux->ee.len, timeout);
|
|
||||||
if (nfds <= -1)
|
|
||||||
{
|
{
|
||||||
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
/* TODO
|
||||||
|
qse_httpd_seterrnum (httpd, muxerr_to_errnum(mux));
|
||||||
|
*/
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < nfds; i++)
|
|
||||||
{
|
|
||||||
mev = mux->ee.ptr[i].data.ptr;
|
|
||||||
|
|
||||||
mask = 0;
|
|
||||||
|
|
||||||
if (mux->ee.ptr[i].events & EPOLLIN)
|
|
||||||
mask |= QSE_HTTPD_MUX_READ;
|
|
||||||
if (mux->ee.ptr[i].events & EPOLLOUT)
|
|
||||||
mask |= QSE_HTTPD_MUX_WRITE;
|
|
||||||
|
|
||||||
if (mux->ee.ptr[i].events & EPOLLHUP)
|
|
||||||
{
|
|
||||||
if (mev->reqmask & QSE_HTTPD_MUX_READ)
|
|
||||||
mask |= QSE_HTTPD_MUX_READ;
|
|
||||||
if (mev->reqmask & QSE_HTTPD_MUX_WRITE)
|
|
||||||
mask |= QSE_HTTPD_MUX_WRITE;
|
|
||||||
}
|
|
||||||
|
|
||||||
mev->cbfun (httpd, mux, mev->handle, mask, mev->cbarg);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1064,11 +1068,24 @@ static int mux_writable (qse_httpd_t* httpd, qse_ubi_t handle, qse_ntoff_t msec)
|
|||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
static int stat_file (
|
static int stat_file (
|
||||||
qse_httpd_t* httpd, const qse_mchar_t* path,
|
qse_httpd_t* httpd, const qse_mchar_t* path,
|
||||||
qse_httpd_stat_t* hst, int regonly)
|
qse_httpd_stat_t* hst, int regonly)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
qse_stat_t st;
|
qse_stat_t st;
|
||||||
|
|
||||||
/* TODO: lstat? or stat? */
|
/* TODO: lstat? or stat? */
|
||||||
@ -1101,15 +1118,30 @@ static int stat_file (
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
static int file_executable (qse_httpd_t* httpd, const qse_mchar_t* path)
|
static int file_executable (qse_httpd_t* httpd, const qse_mchar_t* path)
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
if (access (path, X_OK) == -1)
|
if (access (path, X_OK) == -1)
|
||||||
return (errno == EACCES)? 0 /*no*/: -1 /*error*/;
|
return (errno == EACCES)? 0 /*no*/: -1 /*error*/;
|
||||||
return 1; /* yes */
|
return 1; /* yes */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_stat (
|
static int file_stat (
|
||||||
@ -1121,6 +1153,20 @@ static int file_stat (
|
|||||||
static int file_ropen (
|
static int file_ropen (
|
||||||
qse_httpd_t* httpd, const qse_mchar_t* path, qse_ubi_t* handle)
|
qse_httpd_t* httpd, const qse_mchar_t* path, qse_ubi_t* handle)
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
@ -1143,12 +1189,27 @@ qse_printf (QSE_T("opening file [%hs] for reading\n"), path);
|
|||||||
handle->i = fd;
|
handle->i = fd;
|
||||||
qse_printf (QSE_T("opened file %hs\n"), path);
|
qse_printf (QSE_T("opened file %hs\n"), path);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_wopen (
|
static int file_wopen (
|
||||||
qse_httpd_t* httpd, const qse_mchar_t* path,
|
qse_httpd_t* httpd, const qse_mchar_t* path,
|
||||||
qse_ubi_t* handle)
|
qse_ubi_t* handle)
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
int fd;
|
int fd;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
@ -1167,26 +1228,69 @@ qse_printf (QSE_T("opening file [%hs] for writing\n"), path);
|
|||||||
|
|
||||||
handle->i = fd;
|
handle->i = fd;
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void file_close (qse_httpd_t* httpd, qse_ubi_t handle)
|
static void file_close (qse_httpd_t* httpd, qse_ubi_t handle)
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
qse_printf (QSE_T("closing file %d\n"), handle.i);
|
qse_printf (QSE_T("closing file %d\n"), handle.i);
|
||||||
QSE_CLOSE (handle.i);
|
QSE_CLOSE (handle.i);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static qse_ssize_t file_read (
|
static qse_ssize_t file_read (
|
||||||
qse_httpd_t* httpd, qse_ubi_t handle,
|
qse_httpd_t* httpd, qse_ubi_t handle,
|
||||||
qse_mchar_t* buf, qse_size_t len)
|
qse_mchar_t* buf, qse_size_t len)
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
return QSE_READ (handle.i, buf, len);
|
return QSE_READ (handle.i, buf, len);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static qse_ssize_t file_write (
|
static qse_ssize_t file_write (
|
||||||
qse_httpd_t* httpd, qse_ubi_t handle,
|
qse_httpd_t* httpd, qse_ubi_t handle,
|
||||||
const qse_mchar_t* buf, qse_size_t len)
|
const qse_mchar_t* buf, qse_size_t len)
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
/* TODO: */
|
||||||
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
return QSE_WRITE (handle.i, buf, len);
|
return QSE_WRITE (handle.i, buf, len);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------- */
|
||||||
@ -1217,7 +1321,7 @@ static int dir_open (qse_httpd_t* httpd, const qse_mchar_t* path, qse_ubi_t* han
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->dp = QSE_OPENDIR (path);
|
d->dp = qse_dir_open (httpd->mmgr, 0, (const qse_char_t*)path, QSE_DIR_MBSPATH | QSE_DIR_SORT);
|
||||||
if (d->dp == QSE_NULL)
|
if (d->dp == QSE_NULL)
|
||||||
{
|
{
|
||||||
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
||||||
@ -1236,7 +1340,7 @@ static void dir_close (qse_httpd_t* httpd, qse_ubi_t handle)
|
|||||||
|
|
||||||
d = (dir_t*)handle.ptr;
|
d = (dir_t*)handle.ptr;
|
||||||
|
|
||||||
QSE_CLOSEDIR (d->dp);
|
qse_dir_close (d->dp);
|
||||||
|
|
||||||
QSE_MMGR_FREE (httpd->mmgr, d->path);
|
QSE_MMGR_FREE (httpd->mmgr, d->path);
|
||||||
QSE_MMGR_FREE (httpd->mmgr, d);
|
QSE_MMGR_FREE (httpd->mmgr, d);
|
||||||
@ -1245,23 +1349,22 @@ static void dir_close (qse_httpd_t* httpd, qse_ubi_t handle)
|
|||||||
static int dir_read (qse_httpd_t* httpd, qse_ubi_t handle, qse_httpd_dirent_t* dirent)
|
static int dir_read (qse_httpd_t* httpd, qse_ubi_t handle, qse_httpd_dirent_t* dirent)
|
||||||
{
|
{
|
||||||
dir_t* d;
|
dir_t* d;
|
||||||
qse_dirent_t* de;
|
qse_dir_ent_t de;
|
||||||
qse_mchar_t* fpath;
|
qse_mchar_t* fpath;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
d = (dir_t*)handle.ptr;
|
d = (dir_t*)handle.ptr;
|
||||||
|
|
||||||
errno = 0;
|
n = qse_dir_read (d->dp, &de);
|
||||||
de = QSE_READDIR (d->dp);
|
if (n <= -1)
|
||||||
if (de == QSE_NULL)
|
|
||||||
{
|
{
|
||||||
if (errno == 0) return 0;
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ESYSERR);
|
||||||
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
else if (n == 0) return 0;
|
||||||
|
|
||||||
/* i assume that d->path ends with a slash */
|
/* i assume that d->path ends with a slash */
|
||||||
fpath = qse_mbsdup2 (d->path, de->d_name, httpd->mmgr);
|
fpath = qse_mbsdup2 (d->path, (const qse_mchar_t*)de.name, httpd->mmgr);
|
||||||
if (fpath == QSE_NULL)
|
if (fpath == QSE_NULL)
|
||||||
{
|
{
|
||||||
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOMEM);
|
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOMEM);
|
||||||
@ -1272,7 +1375,7 @@ static int dir_read (qse_httpd_t* httpd, qse_ubi_t handle, qse_httpd_dirent_t* d
|
|||||||
QSE_MMGR_FREE (httpd->mmgr, fpath);
|
QSE_MMGR_FREE (httpd->mmgr, fpath);
|
||||||
if (n <= -1) QSE_MEMSET (dirent, 0, QSE_SIZEOF(*dirent));
|
if (n <= -1) QSE_MEMSET (dirent, 0, QSE_SIZEOF(*dirent));
|
||||||
|
|
||||||
dirent->name = de->d_name;
|
dirent->name = (const qse_mchar_t*)de.name;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1966,7 +2069,17 @@ auth_ok:
|
|||||||
xpath = merge_paths (httpd, server_xtn->cfg[SERVER_XTN_CFG_DOCROOT], qpath);
|
xpath = merge_paths (httpd, server_xtn->cfg[SERVER_XTN_CFG_DOCROOT], qpath);
|
||||||
if (xpath == QSE_NULL) return -1;
|
if (xpath == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* TODO */
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
|
||||||
|
/* TODO */
|
||||||
|
#elif defined(__DOS__)
|
||||||
|
|
||||||
|
/* TODO */
|
||||||
|
#else
|
||||||
if (QSE_STAT (xpath, &st) == 0 && S_ISDIR(st.st_mode))
|
if (QSE_STAT (xpath, &st) == 0 && S_ISDIR(st.st_mode))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* it is a directory */
|
/* it is a directory */
|
||||||
if (server_xtn->cfg2.s.idxstd)
|
if (server_xtn->cfg2.s.idxstd)
|
||||||
|
@ -99,11 +99,6 @@ void qse_httpd_seterrnum (qse_httpd_t* httpd, qse_httpd_errnum_t errnum)
|
|||||||
httpd->errnum = errnum;
|
httpd->errnum = errnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void qse_httpd_setmmgr (qse_httpd_t* httpd, qse_mmgr_t* mmgr)
|
|
||||||
{
|
|
||||||
httpd->mmgr = mmgr;
|
|
||||||
}
|
|
||||||
|
|
||||||
qse_mmgr_t* qse_httpd_getmmgr (qse_httpd_t* httpd)
|
qse_mmgr_t* qse_httpd_getmmgr (qse_httpd_t* httpd)
|
||||||
{
|
{
|
||||||
return httpd->mmgr;
|
return httpd->mmgr;
|
||||||
@ -300,6 +295,7 @@ static qse_httpd_client_t* new_client (
|
|||||||
|
|
||||||
QSE_MEMSET (client, 0, QSE_SIZEOF(*client));
|
QSE_MEMSET (client, 0, QSE_SIZEOF(*client));
|
||||||
|
|
||||||
|
client->type = QSE_HTTPD_CLIENT;
|
||||||
client->htrd = qse_htrd_open (httpd->mmgr, QSE_SIZEOF(*xtn));
|
client->htrd = qse_htrd_open (httpd->mmgr, QSE_SIZEOF(*xtn));
|
||||||
if (client->htrd == QSE_NULL)
|
if (client->htrd == QSE_NULL)
|
||||||
{
|
{
|
||||||
@ -442,8 +438,7 @@ qse_printf (QSE_T("failed to accept from server %s\n"), tmp);
|
|||||||
|
|
||||||
qse_printf (QSE_T("MUX ADDHND CLIENT READ %d\n"), client->handle.i);
|
qse_printf (QSE_T("MUX ADDHND CLIENT READ %d\n"), client->handle.i);
|
||||||
if (httpd->scb->mux.addhnd (
|
if (httpd->scb->mux.addhnd (
|
||||||
httpd, mux, client->handle, QSE_HTTPD_MUX_READ,
|
httpd, mux, client->handle, QSE_HTTPD_MUX_READ, client) <= -1)
|
||||||
perform_client_task, client) <= -1)
|
|
||||||
{
|
{
|
||||||
free_client (httpd, client);
|
free_client (httpd, client);
|
||||||
return -1;
|
return -1;
|
||||||
@ -511,8 +506,7 @@ qse_printf (QSE_T("FAILED TO ACTIVATE SERVER....[%s]\n"), buf);
|
|||||||
|
|
||||||
qse_printf (QSE_T("MUX ADDHND SERVER %d\n"), server->handle.i);
|
qse_printf (QSE_T("MUX ADDHND SERVER %d\n"), server->handle.i);
|
||||||
if (httpd->scb->mux.addhnd (
|
if (httpd->scb->mux.addhnd (
|
||||||
httpd, httpd->mux, server->handle, QSE_HTTPD_MUX_READ,
|
httpd, httpd->mux, server->handle, QSE_HTTPD_MUX_READ, server) <= -1)
|
||||||
accept_client, server) <= -1)
|
|
||||||
{
|
{
|
||||||
qse_printf (QSE_T("FAILED TO ADD SERVER HANDLE TO MUX....\n"));
|
qse_printf (QSE_T("FAILED TO ADD SERVER HANDLE TO MUX....\n"));
|
||||||
httpd->scb->server.close (httpd, server);
|
httpd->scb->server.close (httpd, server);
|
||||||
@ -556,6 +550,7 @@ qse_httpd_server_t* qse_httpd_attachserver (
|
|||||||
QSE_MEMCPY (server, tmpl, QSE_SIZEOF(*server));
|
QSE_MEMCPY (server, tmpl, QSE_SIZEOF(*server));
|
||||||
QSE_MEMSET (server + 1, 0, xtnsize);
|
QSE_MEMSET (server + 1, 0, xtnsize);
|
||||||
|
|
||||||
|
server->type = QSE_HTTPD_SERVER;
|
||||||
server->flags &= ~QSE_HTTPD_SERVER_ACTIVE;
|
server->flags &= ~QSE_HTTPD_SERVER_ACTIVE;
|
||||||
server->predetach = predetach;
|
server->predetach = predetach;
|
||||||
|
|
||||||
@ -827,8 +822,7 @@ qse_printf (QSE_T("REMOVING XXXXX FROM READING NO MORE TASK....\n"));
|
|||||||
if (mux_status)
|
if (mux_status)
|
||||||
{
|
{
|
||||||
if (httpd->scb->mux.addhnd (
|
if (httpd->scb->mux.addhnd (
|
||||||
httpd, httpd->mux, client->handle,
|
httpd, httpd->mux, client->handle, mux_mask, client) <= -1)
|
||||||
mux_mask, perform_client_task, client) <= -1)
|
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -915,7 +909,7 @@ qse_printf (QSE_T("REMOVING XXXXX FROM READING NO MORE TASK....\n"));
|
|||||||
{
|
{
|
||||||
if (httpd->scb->mux.addhnd (
|
if (httpd->scb->mux.addhnd (
|
||||||
httpd, httpd->mux, task->trigger[i].handle,
|
httpd, httpd->mux, task->trigger[i].handle,
|
||||||
trigger_mux_mask, perform_client_task, client) <= -1)
|
trigger_mux_mask, client) <= -1)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -949,7 +943,7 @@ qse_printf (QSE_T("REMOVING XXXXX FROM READING NO MORE TASK....\n"));
|
|||||||
{
|
{
|
||||||
if (httpd->scb->mux.addhnd (
|
if (httpd->scb->mux.addhnd (
|
||||||
httpd, httpd->mux, client->handle,
|
httpd, httpd->mux, client->handle,
|
||||||
client_handle_mux_mask, perform_client_task, client) <= -1)
|
client_handle_mux_mask, client) <= -1)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1073,7 +1067,7 @@ qse_printf (QSE_T("MUX ADDHND CLIENT RW(ENTASK) %d\n"), client->handle.i);
|
|||||||
if (httpd->scb->mux.addhnd (
|
if (httpd->scb->mux.addhnd (
|
||||||
httpd, httpd->mux, client->handle,
|
httpd, httpd->mux, client->handle,
|
||||||
QSE_HTTPD_MUX_READ | QSE_HTTPD_MUX_WRITE,
|
QSE_HTTPD_MUX_READ | QSE_HTTPD_MUX_WRITE,
|
||||||
perform_client_task, client) <= -1)
|
client) <= -1)
|
||||||
{
|
{
|
||||||
/*purge_client (httpd, client);*/
|
/*purge_client (httpd, client);*/
|
||||||
client->status |= CLIENT_BAD;
|
client->status |= CLIENT_BAD;
|
||||||
@ -1085,6 +1079,14 @@ qse_printf (QSE_T("MUX ADDHND CLIENT RW(ENTASK) %d\n"), client->handle.i);
|
|||||||
return new_task;
|
return new_task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int dispatch_mux (
|
||||||
|
qse_httpd_t* httpd, void* mux, qse_ubi_t handle, int mask, void* cbarg)
|
||||||
|
{
|
||||||
|
return ((qse_httpd_server_t*)cbarg)->type == QSE_HTTPD_SERVER?
|
||||||
|
accept_client (httpd, mux, handle, mask, cbarg):
|
||||||
|
perform_client_task (httpd, mux, handle, mask, cbarg);
|
||||||
|
}
|
||||||
|
|
||||||
int qse_httpd_loop (qse_httpd_t* httpd, qse_httpd_scb_t* scb, qse_httpd_rcb_t* rcb, qse_ntime_t timeout)
|
int qse_httpd_loop (qse_httpd_t* httpd, qse_httpd_scb_t* scb, qse_httpd_rcb_t* rcb, qse_ntime_t timeout)
|
||||||
{
|
{
|
||||||
QSE_ASSERTX (httpd->server.list.head != QSE_NULL,
|
QSE_ASSERTX (httpd->server.list.head != QSE_NULL,
|
||||||
@ -1106,7 +1108,7 @@ int qse_httpd_loop (qse_httpd_t* httpd, qse_httpd_scb_t* scb, qse_httpd_rcb_t* r
|
|||||||
|
|
||||||
QSE_ASSERT (httpd->server.navail > 0);
|
QSE_ASSERT (httpd->server.navail > 0);
|
||||||
|
|
||||||
httpd->mux = httpd->scb->mux.open (httpd);
|
httpd->mux = httpd->scb->mux.open (httpd, dispatch_mux);
|
||||||
if (httpd->mux == QSE_NULL)
|
if (httpd->mux == QSE_NULL)
|
||||||
{
|
{
|
||||||
qse_printf (QSE_T("can't open mux....\n"));
|
qse_printf (QSE_T("can't open mux....\n"));
|
||||||
|
@ -73,12 +73,6 @@ void qse_upxd_fini (qse_upxd_t* upxd)
|
|||||||
free_all_servers (upxd);
|
free_all_servers (upxd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void qse_upxd_setmmgr (qse_upxd_t* upxd, qse_mmgr_t* mmgr)
|
|
||||||
{
|
|
||||||
upxd->mmgr = mmgr;
|
|
||||||
}
|
|
||||||
|
|
||||||
qse_mmgr_t* qse_upxd_getmmgr (qse_upxd_t* upxd)
|
qse_mmgr_t* qse_upxd_getmmgr (qse_upxd_t* upxd)
|
||||||
{
|
{
|
||||||
return upxd->mmgr;
|
return upxd->mmgr;
|
||||||
|
@ -143,11 +143,6 @@ void qse_sed_fini (qse_sed_t* sed)
|
|||||||
qse_str_fini (&sed->tmp.rex);
|
qse_str_fini (&sed->tmp.rex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qse_sed_setmmgr (qse_sed_t* sed, qse_mmgr_t* mmgr)
|
|
||||||
{
|
|
||||||
sed->mmgr = mmgr;
|
|
||||||
}
|
|
||||||
|
|
||||||
qse_mmgr_t* qse_sed_getmmgr (qse_sed_t* sed)
|
qse_mmgr_t* qse_sed_getmmgr (qse_sed_t* sed)
|
||||||
{
|
{
|
||||||
return sed->mmgr;
|
return sed->mmgr;
|
||||||
|
@ -15,6 +15,11 @@ libqseawk_sys_la_SOURCES = sys.c
|
|||||||
libqseawk_sys_la_LDFLAGS = $(LDFLAGS_COMMON)
|
libqseawk_sys_la_LDFLAGS = $(LDFLAGS_COMMON)
|
||||||
libqseawk_sys_la_LIBADD = $(LIBADD_COMMON)
|
libqseawk_sys_la_LIBADD = $(LIBADD_COMMON)
|
||||||
|
|
||||||
|
mod_LTLIBRARIES += libqseawk-dir.la
|
||||||
|
libqseawk_dir_la_SOURCES = dir.c
|
||||||
|
libqseawk_dir_la_LDFLAGS = $(LDFLAGS_COMMON)
|
||||||
|
libqseawk_dir_la_LIBADD = $(LIBADD_COMMON)
|
||||||
|
|
||||||
if HAVE_LIBUCI
|
if HAVE_LIBUCI
|
||||||
mod_LTLIBRARIES += libqseawk-uci.la
|
mod_LTLIBRARIES += libqseawk-uci.la
|
||||||
libqseawk_uci_la_SOURCES = uci.c
|
libqseawk_uci_la_SOURCES = uci.c
|
||||||
|
@ -81,6 +81,12 @@ am__uninstall_files_from_dir = { \
|
|||||||
am__installdirs = "$(DESTDIR)$(moddir)"
|
am__installdirs = "$(DESTDIR)$(moddir)"
|
||||||
LTLIBRARIES = $(mod_LTLIBRARIES)
|
LTLIBRARIES = $(mod_LTLIBRARIES)
|
||||||
am__DEPENDENCIES_1 =
|
am__DEPENDENCIES_1 =
|
||||||
|
libqseawk_dir_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
||||||
|
am_libqseawk_dir_la_OBJECTS = dir.lo
|
||||||
|
libqseawk_dir_la_OBJECTS = $(am_libqseawk_dir_la_OBJECTS)
|
||||||
|
libqseawk_dir_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||||
|
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||||
|
$(libqseawk_dir_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
@HAVE_C_MPI_TRUE@libqseawk_mpi_la_DEPENDENCIES = \
|
@HAVE_C_MPI_TRUE@libqseawk_mpi_la_DEPENDENCIES = \
|
||||||
@HAVE_C_MPI_TRUE@ $(am__DEPENDENCIES_1)
|
@HAVE_C_MPI_TRUE@ $(am__DEPENDENCIES_1)
|
||||||
am__libqseawk_mpi_la_SOURCES_DIST = mpi.c
|
am__libqseawk_mpi_la_SOURCES_DIST = mpi.c
|
||||||
@ -119,9 +125,10 @@ CCLD = $(CC)
|
|||||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||||
$(LDFLAGS) -o $@
|
$(LDFLAGS) -o $@
|
||||||
SOURCES = $(libqseawk_mpi_la_SOURCES) $(libqseawk_sys_la_SOURCES) \
|
SOURCES = $(libqseawk_dir_la_SOURCES) $(libqseawk_mpi_la_SOURCES) \
|
||||||
$(libqseawk_uci_la_SOURCES)
|
$(libqseawk_sys_la_SOURCES) $(libqseawk_uci_la_SOURCES)
|
||||||
DIST_SOURCES = $(am__libqseawk_mpi_la_SOURCES_DIST) \
|
DIST_SOURCES = $(libqseawk_dir_la_SOURCES) \
|
||||||
|
$(am__libqseawk_mpi_la_SOURCES_DIST) \
|
||||||
$(libqseawk_sys_la_SOURCES) \
|
$(libqseawk_sys_la_SOURCES) \
|
||||||
$(am__libqseawk_uci_la_SOURCES_DIST)
|
$(am__libqseawk_uci_la_SOURCES_DIST)
|
||||||
ETAGS = etags
|
ETAGS = etags
|
||||||
@ -307,10 +314,14 @@ AM_CPPFLAGS = \
|
|||||||
LDFLAGS_COMMON = -L$(abs_builddir)/../../lib/cmn -L$(abs_builddir)/../../lib/awk -L$(libdir) -no-undefined -version-info 1:0:0
|
LDFLAGS_COMMON = -L$(abs_builddir)/../../lib/cmn -L$(abs_builddir)/../../lib/awk -L$(libdir) -no-undefined -version-info 1:0:0
|
||||||
LIBADD_COMMON = -lqseawk -lqsecmn
|
LIBADD_COMMON = -lqseawk -lqsecmn
|
||||||
moddir = $(libdir)
|
moddir = $(libdir)
|
||||||
mod_LTLIBRARIES = libqseawk-sys.la $(am__append_1) $(am__append_2)
|
mod_LTLIBRARIES = libqseawk-sys.la libqseawk-dir.la $(am__append_1) \
|
||||||
|
$(am__append_2)
|
||||||
libqseawk_sys_la_SOURCES = sys.c
|
libqseawk_sys_la_SOURCES = sys.c
|
||||||
libqseawk_sys_la_LDFLAGS = $(LDFLAGS_COMMON)
|
libqseawk_sys_la_LDFLAGS = $(LDFLAGS_COMMON)
|
||||||
libqseawk_sys_la_LIBADD = $(LIBADD_COMMON)
|
libqseawk_sys_la_LIBADD = $(LIBADD_COMMON)
|
||||||
|
libqseawk_dir_la_SOURCES = dir.c
|
||||||
|
libqseawk_dir_la_LDFLAGS = $(LDFLAGS_COMMON)
|
||||||
|
libqseawk_dir_la_LIBADD = $(LIBADD_COMMON)
|
||||||
@HAVE_LIBUCI_TRUE@libqseawk_uci_la_SOURCES = uci.c
|
@HAVE_LIBUCI_TRUE@libqseawk_uci_la_SOURCES = uci.c
|
||||||
@HAVE_LIBUCI_TRUE@libqseawk_uci_la_LDFLAGS = $(LDFLAGS_COMMON)
|
@HAVE_LIBUCI_TRUE@libqseawk_uci_la_LDFLAGS = $(LDFLAGS_COMMON)
|
||||||
@HAVE_LIBUCI_TRUE@libqseawk_uci_la_LIBADD = $(LIBADD_COMMON) $(UCI_LIBS)
|
@HAVE_LIBUCI_TRUE@libqseawk_uci_la_LIBADD = $(LIBADD_COMMON) $(UCI_LIBS)
|
||||||
@ -383,6 +394,8 @@ clean-modLTLIBRARIES:
|
|||||||
echo "rm -f \"$${dir}/so_locations\""; \
|
echo "rm -f \"$${dir}/so_locations\""; \
|
||||||
rm -f "$${dir}/so_locations"; \
|
rm -f "$${dir}/so_locations"; \
|
||||||
done
|
done
|
||||||
|
libqseawk-dir.la: $(libqseawk_dir_la_OBJECTS) $(libqseawk_dir_la_DEPENDENCIES) $(EXTRA_libqseawk_dir_la_DEPENDENCIES)
|
||||||
|
$(libqseawk_dir_la_LINK) -rpath $(moddir) $(libqseawk_dir_la_OBJECTS) $(libqseawk_dir_la_LIBADD) $(LIBS)
|
||||||
libqseawk-mpi.la: $(libqseawk_mpi_la_OBJECTS) $(libqseawk_mpi_la_DEPENDENCIES) $(EXTRA_libqseawk_mpi_la_DEPENDENCIES)
|
libqseawk-mpi.la: $(libqseawk_mpi_la_OBJECTS) $(libqseawk_mpi_la_DEPENDENCIES) $(EXTRA_libqseawk_mpi_la_DEPENDENCIES)
|
||||||
$(libqseawk_mpi_la_LINK) $(am_libqseawk_mpi_la_rpath) $(libqseawk_mpi_la_OBJECTS) $(libqseawk_mpi_la_LIBADD) $(LIBS)
|
$(libqseawk_mpi_la_LINK) $(am_libqseawk_mpi_la_rpath) $(libqseawk_mpi_la_OBJECTS) $(libqseawk_mpi_la_LIBADD) $(LIBS)
|
||||||
libqseawk-sys.la: $(libqseawk_sys_la_OBJECTS) $(libqseawk_sys_la_DEPENDENCIES) $(EXTRA_libqseawk_sys_la_DEPENDENCIES)
|
libqseawk-sys.la: $(libqseawk_sys_la_OBJECTS) $(libqseawk_sys_la_DEPENDENCIES) $(EXTRA_libqseawk_sys_la_DEPENDENCIES)
|
||||||
@ -396,6 +409,7 @@ mostlyclean-compile:
|
|||||||
distclean-compile:
|
distclean-compile:
|
||||||
-rm -f *.tab.c
|
-rm -f *.tab.c
|
||||||
|
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqseawk_mpi_la-mpi.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqseawk_mpi_la-mpi.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uci.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uci.Plo@am__quote@
|
||||||
|
538
qse/mod/awk/dir.c
Normal file
538
qse/mod/awk/dir.c
Normal file
@ -0,0 +1,538 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
Copyright 2006-2012 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <qse/awk/awk.h>
|
||||||
|
#include <qse/cmn/str.h>
|
||||||
|
#include <qse/cmn/rbt.h>
|
||||||
|
#include <qse/cmn/dir.h>
|
||||||
|
#include "../../lib/cmn/mem.h"
|
||||||
|
|
||||||
|
typedef struct dir_list_t dir_list_t;
|
||||||
|
typedef struct dir_node_t dir_node_t;
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
DIR_ENOERR,
|
||||||
|
DIR_ENOMEM,
|
||||||
|
DIR_EINVAL,
|
||||||
|
DIR_ENOENT
|
||||||
|
};
|
||||||
|
|
||||||
|
struct dir_node_t
|
||||||
|
{
|
||||||
|
int id;
|
||||||
|
qse_dir_t* ctx;
|
||||||
|
dir_node_t* prev;
|
||||||
|
dir_node_t* next;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct dir_list_t
|
||||||
|
{
|
||||||
|
dir_node_t* head;
|
||||||
|
dir_node_t* tail;
|
||||||
|
dir_node_t* free;
|
||||||
|
|
||||||
|
/* mapping table to map 'id' to 'node' */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
dir_node_t** tab;
|
||||||
|
int capa;
|
||||||
|
int high;
|
||||||
|
} map;
|
||||||
|
|
||||||
|
int errnum;
|
||||||
|
};
|
||||||
|
|
||||||
|
static dir_node_t* new_dir_node (qse_awk_rtx_t* rtx, dir_list_t* list, const qse_char_t* path)
|
||||||
|
{
|
||||||
|
/* create a new context node and append it to the list tail */
|
||||||
|
dir_node_t* node;
|
||||||
|
|
||||||
|
node = QSE_NULL;
|
||||||
|
|
||||||
|
if (list->free) node = list->free;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
node = qse_awk_rtx_callocmem (rtx, QSE_SIZEOF(*node));
|
||||||
|
if (!node) goto oops;
|
||||||
|
}
|
||||||
|
|
||||||
|
node->ctx = qse_dir_open (qse_awk_rtx_getmmgr(rtx), 0, path, 0);
|
||||||
|
if (!node->ctx) goto oops;
|
||||||
|
|
||||||
|
if (node == list->free) list->free = node->next;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (list->map.high <= list->map.capa)
|
||||||
|
{
|
||||||
|
int newcapa;
|
||||||
|
dir_node_t** tmp;
|
||||||
|
|
||||||
|
newcapa = list->map.capa + 64;
|
||||||
|
if (newcapa < list->map.capa) goto oops; /* overflow */
|
||||||
|
|
||||||
|
tmp = (dir_node_t**) qse_awk_rtx_reallocmem (
|
||||||
|
rtx, list->map.tab, QSE_SIZEOF(*tmp) * newcapa);
|
||||||
|
if (!tmp) goto oops;
|
||||||
|
|
||||||
|
QSE_MEMSET (&tmp[list->map.capa], 0,
|
||||||
|
QSE_SIZEOF(*tmp) * (newcapa - list->map.capa));
|
||||||
|
|
||||||
|
list->map.tab = tmp;
|
||||||
|
list->map.capa = newcapa;
|
||||||
|
}
|
||||||
|
|
||||||
|
node->id = list->map.high;
|
||||||
|
QSE_ASSERT (list->map.tab[node->id] == QSE_NULL);
|
||||||
|
list->map.tab[node->id] = node;
|
||||||
|
list->map.high++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* append it to the tail */
|
||||||
|
node->next = QSE_NULL;
|
||||||
|
node->prev = list->tail;
|
||||||
|
if (list->tail) list->tail->next = node;
|
||||||
|
else list->head = node;
|
||||||
|
list->tail = node;
|
||||||
|
|
||||||
|
return node;
|
||||||
|
|
||||||
|
oops:
|
||||||
|
if (node) qse_awk_rtx_freemem (rtx, node);
|
||||||
|
qse_awk_rtx_seterrnum (rtx, QSE_AWK_ENOMEM, QSE_NULL);
|
||||||
|
return QSE_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void free_dir_node (qse_awk_rtx_t* rtx, dir_list_t* list, dir_node_t* node)
|
||||||
|
{
|
||||||
|
if (node->prev) node->prev->next = node->next;
|
||||||
|
if (node->next) node->next->prev = node->prev;
|
||||||
|
if (list->head == node) list->head = node->next;
|
||||||
|
if (list->tail == node) list->tail = node->prev;
|
||||||
|
|
||||||
|
list->map.tab[node->id] = QSE_NULL;
|
||||||
|
|
||||||
|
if (node->ctx)
|
||||||
|
{
|
||||||
|
qse_dir_close (node->ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (list->map.high == node->id + 1)
|
||||||
|
{
|
||||||
|
/* destroy the actual node if the node to be freed has the
|
||||||
|
* highest id */
|
||||||
|
QSE_MMGR_FREE (qse_awk_rtx_getmmgr(rtx), node);
|
||||||
|
list->map.high--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* otherwise, chain the node to the free list */
|
||||||
|
node->ctx = QSE_NULL;
|
||||||
|
node->next = list->free;
|
||||||
|
list->free = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* however, i destroy the whole free list when all the nodes are
|
||||||
|
* chanined to the free list */
|
||||||
|
if (list->head == QSE_NULL)
|
||||||
|
{
|
||||||
|
qse_mmgr_t* mmgr;
|
||||||
|
dir_node_t* curnode;
|
||||||
|
|
||||||
|
mmgr = qse_awk_rtx_getmmgr(rtx);
|
||||||
|
|
||||||
|
while (list->free)
|
||||||
|
{
|
||||||
|
curnode = list->free;
|
||||||
|
list->free = list->free->next;
|
||||||
|
QSE_ASSERT (curnode->ctx == QSE_NULL);
|
||||||
|
QSE_MMGR_FREE (mmgr, curnode);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSE_MMGR_FREE (mmgr, list->map.tab);
|
||||||
|
list->map.high = 0;
|
||||||
|
list->map.capa = 0;
|
||||||
|
list->map.tab = QSE_NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
static int close_byid (qse_awk_rtx_t* rtx, dir_list_t* list, qse_long_t id)
|
||||||
|
{
|
||||||
|
int x = DIR_EINVAL;
|
||||||
|
|
||||||
|
if (id >= 0 && id < list->map.high && list->map.tab[id])
|
||||||
|
{
|
||||||
|
free_dir_node (rtx, list, list->map.tab[id]);
|
||||||
|
x = DIR_ENOERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -x;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int reset_byid (qse_awk_rtx_t* rtx, dir_list_t* list, qse_long_t id, const qse_char_t* path)
|
||||||
|
{
|
||||||
|
int x = DIR_EINVAL;
|
||||||
|
|
||||||
|
if (id >= 0 && id < list->map.high && list->map.tab[id])
|
||||||
|
{
|
||||||
|
if (qse_dir_reset (list->map.tab[id]->ctx, path) >= 0) x = DIR_ENOERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -x;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int read_byid (qse_awk_rtx_t* rtx, dir_list_t* list, qse_long_t id, qse_awk_val_t** retv)
|
||||||
|
{
|
||||||
|
int x = DIR_EINVAL;
|
||||||
|
|
||||||
|
if (id >= 0 && id < list->map.high && list->map.tab[id])
|
||||||
|
{
|
||||||
|
int y;
|
||||||
|
qse_dir_ent_t ent;
|
||||||
|
y = qse_dir_read (list->map.tab[id]->ctx, &ent);
|
||||||
|
if (y == 0) x = DIR_ENOENT;
|
||||||
|
else if (y >= 1)
|
||||||
|
{
|
||||||
|
qse_awk_val_t* tmp;
|
||||||
|
tmp = qse_awk_rtx_makestrvalwithstr (rtx, ent.name);
|
||||||
|
if (tmp)
|
||||||
|
{
|
||||||
|
*retv = tmp;
|
||||||
|
x = DIR_ENOERR;
|
||||||
|
}
|
||||||
|
else x = DIR_ENOMEM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -x;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
static QSE_INLINE dir_list_t* rtx_to_list (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||||
|
{
|
||||||
|
qse_rbt_pair_t* pair;
|
||||||
|
pair = qse_rbt_search ((qse_rbt_t*)fi->mod->ctx, &rtx, QSE_SIZEOF(rtx));
|
||||||
|
QSE_ASSERT (pair != QSE_NULL);
|
||||||
|
return (dir_list_t*)QSE_RBT_VPTR(pair);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int fnc_dir_errno (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||||
|
{
|
||||||
|
dir_list_t* list;
|
||||||
|
qse_awk_val_t* retv;
|
||||||
|
|
||||||
|
list = rtx_to_list (rtx, fi);
|
||||||
|
|
||||||
|
retv = qse_awk_rtx_makeintval (rtx, list->errnum);
|
||||||
|
if (retv == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
qse_awk_rtx_setretval (rtx, retv);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static qse_char_t* errmsg[] =
|
||||||
|
{
|
||||||
|
QSE_T("no error"),
|
||||||
|
QSE_T("out of memory"),
|
||||||
|
QSE_T("invalid data"),
|
||||||
|
QSE_T("no entry"),
|
||||||
|
QSE_T("unknown error")
|
||||||
|
};
|
||||||
|
|
||||||
|
static int fnc_dir_errstr (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||||
|
{
|
||||||
|
dir_list_t* list;
|
||||||
|
qse_awk_val_t* retv;
|
||||||
|
qse_long_t errnum;
|
||||||
|
|
||||||
|
list = rtx_to_list (rtx, fi);
|
||||||
|
|
||||||
|
if (qse_awk_rtx_getnargs (rtx) <= 0 ||
|
||||||
|
qse_awk_rtx_valtolong (rtx, qse_awk_rtx_getarg (rtx, 0), &errnum) <= -1)
|
||||||
|
{
|
||||||
|
errnum = list->errnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errnum < 0 || errnum >= QSE_COUNTOF(errmsg)) errnum = QSE_COUNTOF(errmsg) - 1;
|
||||||
|
|
||||||
|
retv = qse_awk_rtx_makestrvalwithstr (rtx, errmsg[errnum]);
|
||||||
|
if (retv == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
qse_awk_rtx_setretval (rtx, retv);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int fnc_dir_open (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||||
|
{
|
||||||
|
dir_list_t* list;
|
||||||
|
dir_node_t* node;
|
||||||
|
qse_long_t ret;
|
||||||
|
qse_awk_val_t* retv;
|
||||||
|
qse_char_t* path;
|
||||||
|
|
||||||
|
list = rtx_to_list (rtx, fi);
|
||||||
|
|
||||||
|
path = qse_awk_rtx_valtostrdup (rtx, qse_awk_rtx_getarg (rtx, 0), QSE_NULL);
|
||||||
|
if (path == QSE_NULL)
|
||||||
|
{
|
||||||
|
list->errnum = DIR_ENOMEM;
|
||||||
|
ret = -DIR_ENOMEM;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
node = new_dir_node (rtx, list, path);
|
||||||
|
ret = node? node->id: -DIR_ENOMEM;
|
||||||
|
qse_awk_rtx_freemem (rtx, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret <= -1)
|
||||||
|
{
|
||||||
|
list->errnum = -ret;
|
||||||
|
ret = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
retv = qse_awk_rtx_makeintval (rtx, ret);
|
||||||
|
if (retv == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
qse_awk_rtx_setretval (rtx, retv);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int fnc_dir_close (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||||
|
{
|
||||||
|
dir_list_t* list;
|
||||||
|
qse_awk_val_t* retv;
|
||||||
|
qse_long_t id;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
list = rtx_to_list (rtx, fi);
|
||||||
|
|
||||||
|
ret = qse_awk_rtx_valtolong (rtx, qse_awk_rtx_getarg (rtx, 0), &id);
|
||||||
|
if (ret <= -1) ret = -DIR_EINVAL;
|
||||||
|
else ret = close_byid (rtx, list, id);
|
||||||
|
|
||||||
|
if (ret <= -1)
|
||||||
|
{
|
||||||
|
list->errnum = -ret;
|
||||||
|
ret = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
retv = qse_awk_rtx_makeintval (rtx, ret);
|
||||||
|
if (retv == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
qse_awk_rtx_setretval (rtx, retv);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int fnc_dir_reset (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||||
|
{
|
||||||
|
dir_list_t* list;
|
||||||
|
qse_awk_val_t* retv;
|
||||||
|
qse_long_t id;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
list = rtx_to_list (rtx, fi);
|
||||||
|
|
||||||
|
ret = qse_awk_rtx_valtolong (rtx, qse_awk_rtx_getarg (rtx, 0), &id);
|
||||||
|
if (ret <= -1) ret = -DIR_EINVAL;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qse_char_t* path;
|
||||||
|
|
||||||
|
path = qse_awk_rtx_valtostrdup (rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL);
|
||||||
|
if (path)
|
||||||
|
{
|
||||||
|
ret = reset_byid (rtx, list, id, path);
|
||||||
|
qse_awk_rtx_freemem (rtx, path);
|
||||||
|
}
|
||||||
|
else ret = -DIR_ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret <= -1)
|
||||||
|
{
|
||||||
|
list->errnum = -ret;
|
||||||
|
ret = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
retv = qse_awk_rtx_makeintval (rtx, ret);
|
||||||
|
if (retv == QSE_NULL) return -1;
|
||||||
|
|
||||||
|
qse_awk_rtx_setretval (rtx, retv);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int fnc_dir_read (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||||
|
{
|
||||||
|
dir_list_t* list;
|
||||||
|
qse_awk_val_t* retv;
|
||||||
|
qse_long_t id;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
list = rtx_to_list (rtx, fi);
|
||||||
|
|
||||||
|
ret = qse_awk_rtx_valtolong (rtx, qse_awk_rtx_getarg (rtx, 0), &id);
|
||||||
|
if (ret <= -1) ret = -DIR_EINVAL;
|
||||||
|
else ret = read_byid (rtx, list, id, &retv);
|
||||||
|
|
||||||
|
if (ret <= -1)
|
||||||
|
{
|
||||||
|
list->errnum = -ret;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qse_awk_rtx_setretval (rtx, retv);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
typedef struct fnctab_t fnctab_t;
|
||||||
|
struct fnctab_t
|
||||||
|
{
|
||||||
|
const qse_char_t* name;
|
||||||
|
qse_awk_mod_sym_fnc_t info;
|
||||||
|
};
|
||||||
|
|
||||||
|
static fnctab_t fnctab[] =
|
||||||
|
{
|
||||||
|
{ QSE_T("close"), { { 1, 1, QSE_NULL }, fnc_dir_close, 0 } },
|
||||||
|
{ QSE_T("errno"), { { 0, 0, QSE_NULL }, fnc_dir_errno, 0 } },
|
||||||
|
{ QSE_T("errstr"), { { 0, 1, QSE_NULL }, fnc_dir_errstr, 0 } },
|
||||||
|
{ QSE_T("open"), { { 1, 1, QSE_NULL }, fnc_dir_open, 0 } },
|
||||||
|
{ QSE_T("read"), { { 1, 1, QSE_NULL }, fnc_dir_read, 0 } },
|
||||||
|
{ QSE_T("reset"), { { 2, 2, QSE_NULL }, fnc_dir_reset, 0 } },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym)
|
||||||
|
{
|
||||||
|
qse_cstr_t ea;
|
||||||
|
int left, right, mid, n;
|
||||||
|
|
||||||
|
left = 0; right = QSE_COUNTOF(fnctab) - 1;
|
||||||
|
|
||||||
|
while (left <= right)
|
||||||
|
{
|
||||||
|
mid = (left + right) / 2;
|
||||||
|
|
||||||
|
n = qse_strcmp (fnctab[mid].name, name);
|
||||||
|
if (n > 0) right = mid - 1;
|
||||||
|
else if (n < 0) left = mid + 1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sym->type = QSE_AWK_MOD_FNC;
|
||||||
|
sym->u.fnc = fnctab[mid].info;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ea.ptr = name;
|
||||||
|
ea.len = qse_strlen(name);
|
||||||
|
qse_awk_seterror (awk, QSE_AWK_ENOENT, &ea, QSE_NULL);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int init (qse_awk_mod_t* mod, qse_awk_rtx_t* rtx)
|
||||||
|
{
|
||||||
|
qse_rbt_t* rbt;
|
||||||
|
dir_list_t list;
|
||||||
|
|
||||||
|
rbt = (qse_rbt_t*)mod->ctx;
|
||||||
|
|
||||||
|
QSE_MEMSET (&list, 0, QSE_SIZEOF(list));
|
||||||
|
if (qse_rbt_insert (rbt, &rtx, QSE_SIZEOF(rtx), &list, QSE_SIZEOF(list)) == QSE_NULL)
|
||||||
|
{
|
||||||
|
qse_awk_rtx_seterrnum (rtx, QSE_AWK_ENOMEM, QSE_NULL);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void fini (qse_awk_mod_t* mod, qse_awk_rtx_t* rtx)
|
||||||
|
{
|
||||||
|
qse_rbt_t* rbt;
|
||||||
|
qse_rbt_pair_t* pair;
|
||||||
|
|
||||||
|
rbt = (qse_rbt_t*)mod->ctx;
|
||||||
|
|
||||||
|
/* garbage clean-up */
|
||||||
|
pair = qse_rbt_search (rbt, &rtx, QSE_SIZEOF(rtx));
|
||||||
|
if (pair)
|
||||||
|
{
|
||||||
|
dir_list_t* list;
|
||||||
|
dir_node_t* node, * next;
|
||||||
|
|
||||||
|
list = QSE_RBT_VPTR(pair);
|
||||||
|
node = list->head;
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
next = node->next;
|
||||||
|
free_dir_node (rtx, list, node);
|
||||||
|
node = next;
|
||||||
|
}
|
||||||
|
|
||||||
|
qse_rbt_delete (rbt, &rtx, QSE_SIZEOF(rtx));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unload (qse_awk_mod_t* mod, qse_awk_t* awk)
|
||||||
|
{
|
||||||
|
qse_rbt_t* rbt;
|
||||||
|
|
||||||
|
rbt = (qse_rbt_t*)mod->ctx;
|
||||||
|
|
||||||
|
QSE_ASSERT (QSE_RBT_SIZE(rbt) == 0);
|
||||||
|
qse_rbt_close (rbt);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSE_EXPORT int load (qse_awk_mod_t* mod, qse_awk_t* awk)
|
||||||
|
{
|
||||||
|
qse_rbt_t* rbt;
|
||||||
|
|
||||||
|
mod->query = query;
|
||||||
|
mod->unload = unload;
|
||||||
|
|
||||||
|
mod->init = init;
|
||||||
|
mod->fini = fini;
|
||||||
|
|
||||||
|
rbt = qse_rbt_open (qse_awk_getmmgr(awk), 0, 1, 1);
|
||||||
|
if (rbt == QSE_NULL)
|
||||||
|
{
|
||||||
|
qse_awk_seterrnum (awk, QSE_AWK_ENOMEM, QSE_NULL);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
qse_rbt_setmancbs (rbt, qse_getrbtmancbs(QSE_RBT_MANCBS_INLINE_COPIERS));
|
||||||
|
|
||||||
|
mod->ctx = rbt;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(__DOS__)
|
||||||
|
/* kind of DllMain() for Causeway DLL */
|
||||||
|
int main (int eax) { return 0; }
|
||||||
|
#endif
|
||||||
|
|
@ -1,3 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
Copyright 2006-2012 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <qse/awk/awk.h>
|
#include <qse/awk/awk.h>
|
||||||
#include <qse/cmn/str.h>
|
#include <qse/cmn/str.h>
|
||||||
#include <qse/cmn/main.h>
|
#include <qse/cmn/main.h>
|
||||||
|
@ -1,3 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
Copyright 2006-2012 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <qse/awk/awk.h>
|
#include <qse/awk/awk.h>
|
||||||
#include <qse/cmn/str.h>
|
#include <qse/cmn/str.h>
|
||||||
#include <qse/cmn/time.h>
|
#include <qse/cmn/time.h>
|
||||||
|
@ -1,3 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
Copyright 2006-2012 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <qse/awk/awk.h>
|
#include <qse/awk/awk.h>
|
||||||
#include <qse/cmn/str.h>
|
#include <qse/cmn/str.h>
|
||||||
#include <qse/cmn/rbt.h>
|
#include <qse/cmn/rbt.h>
|
||||||
|
@ -42,7 +42,7 @@ WVList
|
|||||||
0
|
0
|
||||||
10
|
10
|
||||||
WPickList
|
WPickList
|
||||||
85
|
87
|
||||||
11
|
11
|
||||||
MItem
|
MItem
|
||||||
3
|
3
|
||||||
@ -222,7 +222,7 @@ WVList
|
|||||||
51
|
51
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/dll.c
|
../../../../../lib/cmn/dir.c
|
||||||
52
|
52
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -240,7 +240,7 @@ WVList
|
|||||||
55
|
55
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/env.c
|
../../../../../lib/cmn/dll.c
|
||||||
56
|
56
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -258,7 +258,7 @@ WVList
|
|||||||
59
|
59
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/fio.c
|
../../../../../lib/cmn/env.c
|
||||||
60
|
60
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -276,7 +276,7 @@ WVList
|
|||||||
63
|
63
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/fma.c
|
../../../../../lib/cmn/fio.c
|
||||||
64
|
64
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -294,7 +294,7 @@ WVList
|
|||||||
67
|
67
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/fmt.c
|
../../../../../lib/cmn/fma.c
|
||||||
68
|
68
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -311,8 +311,8 @@ WVList
|
|||||||
0
|
0
|
||||||
71
|
71
|
||||||
MItem
|
MItem
|
||||||
31
|
28
|
||||||
../../../../../lib/cmn/fs-err.c
|
../../../../../lib/cmn/fmt.c
|
||||||
72
|
72
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -329,8 +329,8 @@ WVList
|
|||||||
0
|
0
|
||||||
75
|
75
|
||||||
MItem
|
MItem
|
||||||
32
|
31
|
||||||
../../../../../lib/cmn/fs-move.c
|
../../../../../lib/cmn/fs-err.c
|
||||||
76
|
76
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -347,8 +347,8 @@ WVList
|
|||||||
0
|
0
|
||||||
79
|
79
|
||||||
MItem
|
MItem
|
||||||
27
|
32
|
||||||
../../../../../lib/cmn/fs.c
|
../../../../../lib/cmn/fs-move.c
|
||||||
80
|
80
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -365,8 +365,8 @@ WVList
|
|||||||
0
|
0
|
||||||
83
|
83
|
||||||
MItem
|
MItem
|
||||||
28
|
27
|
||||||
../../../../../lib/cmn/gdl.c
|
../../../../../lib/cmn/fs.c
|
||||||
84
|
84
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -383,8 +383,8 @@ WVList
|
|||||||
0
|
0
|
||||||
87
|
87
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/glob.c
|
../../../../../lib/cmn/gdl.c
|
||||||
88
|
88
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -401,8 +401,8 @@ WVList
|
|||||||
0
|
0
|
||||||
91
|
91
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/htb.c
|
../../../../../lib/cmn/glob.c
|
||||||
92
|
92
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -419,8 +419,8 @@ WVList
|
|||||||
0
|
0
|
||||||
95
|
95
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/hton.c
|
../../../../../lib/cmn/htb.c
|
||||||
96
|
96
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -438,7 +438,7 @@ WVList
|
|||||||
99
|
99
|
||||||
MItem
|
MItem
|
||||||
29
|
29
|
||||||
../../../../../lib/cmn/ipad.c
|
../../../../../lib/cmn/hton.c
|
||||||
100
|
100
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -455,8 +455,8 @@ WVList
|
|||||||
0
|
0
|
||||||
103
|
103
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/lda.c
|
../../../../../lib/cmn/ipad.c
|
||||||
104
|
104
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -473,8 +473,8 @@ WVList
|
|||||||
0
|
0
|
||||||
107
|
107
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/main.c
|
../../../../../lib/cmn/lda.c
|
||||||
108
|
108
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -491,8 +491,8 @@ WVList
|
|||||||
0
|
0
|
||||||
111
|
111
|
||||||
MItem
|
MItem
|
||||||
33
|
29
|
||||||
../../../../../lib/cmn/mbwc-str.c
|
../../../../../lib/cmn/main.c
|
||||||
112
|
112
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -509,8 +509,8 @@ WVList
|
|||||||
0
|
0
|
||||||
115
|
115
|
||||||
MItem
|
MItem
|
||||||
29
|
33
|
||||||
../../../../../lib/cmn/mbwc.c
|
../../../../../lib/cmn/mbwc-str.c
|
||||||
116
|
116
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -527,8 +527,8 @@ WVList
|
|||||||
0
|
0
|
||||||
119
|
119
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/mem.c
|
../../../../../lib/cmn/mbwc.c
|
||||||
120
|
120
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -545,8 +545,8 @@ WVList
|
|||||||
0
|
0
|
||||||
123
|
123
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/nwad.c
|
../../../../../lib/cmn/mem.c
|
||||||
124
|
124
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -563,8 +563,8 @@ WVList
|
|||||||
0
|
0
|
||||||
127
|
127
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/nwif.c
|
../../../../../lib/cmn/mux.c
|
||||||
128
|
128
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -582,7 +582,7 @@ WVList
|
|||||||
131
|
131
|
||||||
MItem
|
MItem
|
||||||
29
|
29
|
||||||
../../../../../lib/cmn/nwio.c
|
../../../../../lib/cmn/nwad.c
|
||||||
132
|
132
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -599,8 +599,8 @@ WVList
|
|||||||
0
|
0
|
||||||
135
|
135
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/oht.c
|
../../../../../lib/cmn/nwif.c
|
||||||
136
|
136
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -617,8 +617,8 @@ WVList
|
|||||||
0
|
0
|
||||||
139
|
139
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/opt.c
|
../../../../../lib/cmn/nwio.c
|
||||||
140
|
140
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -635,8 +635,8 @@ WVList
|
|||||||
0
|
0
|
||||||
143
|
143
|
||||||
MItem
|
MItem
|
||||||
38
|
28
|
||||||
../../../../../lib/cmn/path-basename.c
|
../../../../../lib/cmn/oht.c
|
||||||
144
|
144
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -653,8 +653,8 @@ WVList
|
|||||||
0
|
0
|
||||||
147
|
147
|
||||||
MItem
|
MItem
|
||||||
35
|
28
|
||||||
../../../../../lib/cmn/path-canon.c
|
../../../../../lib/cmn/opt.c
|
||||||
148
|
148
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -671,8 +671,8 @@ WVList
|
|||||||
0
|
0
|
||||||
151
|
151
|
||||||
MItem
|
MItem
|
||||||
28
|
38
|
||||||
../../../../../lib/cmn/pio.c
|
../../../../../lib/cmn/path-basename.c
|
||||||
152
|
152
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -689,8 +689,8 @@ WVList
|
|||||||
0
|
0
|
||||||
155
|
155
|
||||||
MItem
|
MItem
|
||||||
28
|
35
|
||||||
../../../../../lib/cmn/pma.c
|
../../../../../lib/cmn/path-canon.c
|
||||||
156
|
156
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -708,7 +708,7 @@ WVList
|
|||||||
159
|
159
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/rbt.c
|
../../../../../lib/cmn/pio.c
|
||||||
160
|
160
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -726,7 +726,7 @@ WVList
|
|||||||
163
|
163
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/rex.c
|
../../../../../lib/cmn/pma.c
|
||||||
164
|
164
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -744,7 +744,7 @@ WVList
|
|||||||
167
|
167
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/sio.c
|
../../../../../lib/cmn/rbt.c
|
||||||
168
|
168
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -762,7 +762,7 @@ WVList
|
|||||||
171
|
171
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/sll.c
|
../../../../../lib/cmn/rex.c
|
||||||
172
|
172
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -779,8 +779,8 @@ WVList
|
|||||||
0
|
0
|
||||||
175
|
175
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/slmb.c
|
../../../../../lib/cmn/sio.c
|
||||||
176
|
176
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -797,8 +797,8 @@ WVList
|
|||||||
0
|
0
|
||||||
179
|
179
|
||||||
MItem
|
MItem
|
||||||
30
|
28
|
||||||
../../../../../lib/cmn/stdio.c
|
../../../../../lib/cmn/sll.c
|
||||||
180
|
180
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -815,8 +815,8 @@ WVList
|
|||||||
0
|
0
|
||||||
183
|
183
|
||||||
MItem
|
MItem
|
||||||
32
|
29
|
||||||
../../../../../lib/cmn/str-beg.c
|
../../../../../lib/cmn/slmb.c
|
||||||
184
|
184
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -833,8 +833,8 @@ WVList
|
|||||||
0
|
0
|
||||||
187
|
187
|
||||||
MItem
|
MItem
|
||||||
32
|
30
|
||||||
../../../../../lib/cmn/str-cat.c
|
../../../../../lib/cmn/stdio.c
|
||||||
188
|
188
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -852,7 +852,7 @@ WVList
|
|||||||
191
|
191
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-chr.c
|
../../../../../lib/cmn/str-beg.c
|
||||||
192
|
192
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -870,7 +870,7 @@ WVList
|
|||||||
195
|
195
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-cmp.c
|
../../../../../lib/cmn/str-cat.c
|
||||||
196
|
196
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -888,7 +888,7 @@ WVList
|
|||||||
199
|
199
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-cnv.c
|
../../../../../lib/cmn/str-chr.c
|
||||||
200
|
200
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -906,7 +906,7 @@ WVList
|
|||||||
203
|
203
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-cpy.c
|
../../../../../lib/cmn/str-cmp.c
|
||||||
204
|
204
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -924,7 +924,7 @@ WVList
|
|||||||
207
|
207
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-del.c
|
../../../../../lib/cmn/str-cnv.c
|
||||||
208
|
208
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -942,7 +942,7 @@ WVList
|
|||||||
211
|
211
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-dup.c
|
../../../../../lib/cmn/str-cpy.c
|
||||||
212
|
212
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -959,8 +959,8 @@ WVList
|
|||||||
0
|
0
|
||||||
215
|
215
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-dynm.c
|
../../../../../lib/cmn/str-del.c
|
||||||
216
|
216
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -977,8 +977,8 @@ WVList
|
|||||||
0
|
0
|
||||||
219
|
219
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-dynw.c
|
../../../../../lib/cmn/str-dup.c
|
||||||
220
|
220
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -995,8 +995,8 @@ WVList
|
|||||||
0
|
0
|
||||||
223
|
223
|
||||||
MItem
|
MItem
|
||||||
32
|
33
|
||||||
../../../../../lib/cmn/str-end.c
|
../../../../../lib/cmn/str-dynm.c
|
||||||
224
|
224
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1014,7 +1014,7 @@ WVList
|
|||||||
227
|
227
|
||||||
MItem
|
MItem
|
||||||
33
|
33
|
||||||
../../../../../lib/cmn/str-excl.c
|
../../../../../lib/cmn/str-dynw.c
|
||||||
228
|
228
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1031,8 +1031,8 @@ WVList
|
|||||||
0
|
0
|
||||||
231
|
231
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-fcpy.c
|
../../../../../lib/cmn/str-end.c
|
||||||
232
|
232
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1049,8 +1049,8 @@ WVList
|
|||||||
0
|
0
|
||||||
235
|
235
|
||||||
MItem
|
MItem
|
||||||
34
|
33
|
||||||
../../../../../lib/cmn/str-fnmat.c
|
../../../../../lib/cmn/str-excl.c
|
||||||
236
|
236
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1068,7 +1068,7 @@ WVList
|
|||||||
239
|
239
|
||||||
MItem
|
MItem
|
||||||
33
|
33
|
||||||
../../../../../lib/cmn/str-incl.c
|
../../../../../lib/cmn/str-fcpy.c
|
||||||
240
|
240
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1085,8 +1085,8 @@ WVList
|
|||||||
0
|
0
|
||||||
243
|
243
|
||||||
MItem
|
MItem
|
||||||
32
|
34
|
||||||
../../../../../lib/cmn/str-len.c
|
../../../../../lib/cmn/str-fnmat.c
|
||||||
244
|
244
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1103,8 +1103,8 @@ WVList
|
|||||||
0
|
0
|
||||||
247
|
247
|
||||||
MItem
|
MItem
|
||||||
32
|
33
|
||||||
../../../../../lib/cmn/str-pac.c
|
../../../../../lib/cmn/str-incl.c
|
||||||
248
|
248
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1121,8 +1121,8 @@ WVList
|
|||||||
0
|
0
|
||||||
251
|
251
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-pbrk.c
|
../../../../../lib/cmn/str-len.c
|
||||||
252
|
252
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1140,7 +1140,7 @@ WVList
|
|||||||
255
|
255
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-put.c
|
../../../../../lib/cmn/str-pac.c
|
||||||
256
|
256
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1157,8 +1157,8 @@ WVList
|
|||||||
0
|
0
|
||||||
259
|
259
|
||||||
MItem
|
MItem
|
||||||
32
|
33
|
||||||
../../../../../lib/cmn/str-rev.c
|
../../../../../lib/cmn/str-pbrk.c
|
||||||
260
|
260
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1176,7 +1176,7 @@ WVList
|
|||||||
263
|
263
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-rot.c
|
../../../../../lib/cmn/str-put.c
|
||||||
264
|
264
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1194,7 +1194,7 @@ WVList
|
|||||||
267
|
267
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-set.c
|
../../../../../lib/cmn/str-rev.c
|
||||||
268
|
268
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1212,7 +1212,7 @@ WVList
|
|||||||
271
|
271
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-spl.c
|
../../../../../lib/cmn/str-rot.c
|
||||||
272
|
272
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1230,7 +1230,7 @@ WVList
|
|||||||
275
|
275
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-spn.c
|
../../../../../lib/cmn/str-set.c
|
||||||
276
|
276
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1248,7 +1248,7 @@ WVList
|
|||||||
279
|
279
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-str.c
|
../../../../../lib/cmn/str-spl.c
|
||||||
280
|
280
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1265,8 +1265,8 @@ WVList
|
|||||||
0
|
0
|
||||||
283
|
283
|
||||||
MItem
|
MItem
|
||||||
34
|
32
|
||||||
../../../../../lib/cmn/str-subst.c
|
../../../../../lib/cmn/str-spn.c
|
||||||
284
|
284
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1284,7 +1284,7 @@ WVList
|
|||||||
287
|
287
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-tok.c
|
../../../../../lib/cmn/str-str.c
|
||||||
288
|
288
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1301,8 +1301,8 @@ WVList
|
|||||||
0
|
0
|
||||||
291
|
291
|
||||||
MItem
|
MItem
|
||||||
32
|
34
|
||||||
../../../../../lib/cmn/str-trm.c
|
../../../../../lib/cmn/str-subst.c
|
||||||
292
|
292
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1319,8 +1319,8 @@ WVList
|
|||||||
0
|
0
|
||||||
295
|
295
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-word.c
|
../../../../../lib/cmn/str-tok.c
|
||||||
296
|
296
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1337,8 +1337,8 @@ WVList
|
|||||||
0
|
0
|
||||||
299
|
299
|
||||||
MItem
|
MItem
|
||||||
29
|
32
|
||||||
../../../../../lib/cmn/task.c
|
../../../../../lib/cmn/str-trm.c
|
||||||
300
|
300
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1355,8 +1355,8 @@ WVList
|
|||||||
0
|
0
|
||||||
303
|
303
|
||||||
MItem
|
MItem
|
||||||
29
|
33
|
||||||
../../../../../lib/cmn/time.c
|
../../../../../lib/cmn/str-word.c
|
||||||
304
|
304
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1373,8 +1373,8 @@ WVList
|
|||||||
0
|
0
|
||||||
307
|
307
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/tio.c
|
../../../../../lib/cmn/task.c
|
||||||
308
|
308
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1391,8 +1391,8 @@ WVList
|
|||||||
0
|
0
|
||||||
311
|
311
|
||||||
MItem
|
MItem
|
||||||
32
|
29
|
||||||
../../../../../lib/cmn/tre-ast.c
|
../../../../../lib/cmn/time.c
|
||||||
312
|
312
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1409,8 +1409,8 @@ WVList
|
|||||||
0
|
0
|
||||||
315
|
315
|
||||||
MItem
|
MItem
|
||||||
36
|
28
|
||||||
../../../../../lib/cmn/tre-compile.c
|
../../../../../lib/cmn/tio.c
|
||||||
316
|
316
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1427,8 +1427,8 @@ WVList
|
|||||||
0
|
0
|
||||||
319
|
319
|
||||||
MItem
|
MItem
|
||||||
44
|
32
|
||||||
../../../../../lib/cmn/tre-match-backtrack.c
|
../../../../../lib/cmn/tre-ast.c
|
||||||
320
|
320
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1445,8 +1445,8 @@ WVList
|
|||||||
0
|
0
|
||||||
323
|
323
|
||||||
MItem
|
MItem
|
||||||
43
|
36
|
||||||
../../../../../lib/cmn/tre-match-parallel.c
|
../../../../../lib/cmn/tre-compile.c
|
||||||
324
|
324
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1463,8 +1463,8 @@ WVList
|
|||||||
0
|
0
|
||||||
327
|
327
|
||||||
MItem
|
MItem
|
||||||
34
|
44
|
||||||
../../../../../lib/cmn/tre-parse.c
|
../../../../../lib/cmn/tre-match-backtrack.c
|
||||||
328
|
328
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1481,8 +1481,8 @@ WVList
|
|||||||
0
|
0
|
||||||
331
|
331
|
||||||
MItem
|
MItem
|
||||||
34
|
43
|
||||||
../../../../../lib/cmn/tre-stack.c
|
../../../../../lib/cmn/tre-match-parallel.c
|
||||||
332
|
332
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1499,8 +1499,8 @@ WVList
|
|||||||
0
|
0
|
||||||
335
|
335
|
||||||
MItem
|
MItem
|
||||||
28
|
34
|
||||||
../../../../../lib/cmn/tre.c
|
../../../../../lib/cmn/tre-parse.c
|
||||||
336
|
336
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1517,8 +1517,8 @@ WVList
|
|||||||
0
|
0
|
||||||
339
|
339
|
||||||
MItem
|
MItem
|
||||||
29
|
34
|
||||||
../../../../../lib/cmn/utf8.c
|
../../../../../lib/cmn/tre-stack.c
|
||||||
340
|
340
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1536,7 +1536,7 @@ WVList
|
|||||||
343
|
343
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/xma.c
|
../../../../../lib/cmn/tre.c
|
||||||
344
|
344
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1553,44 +1553,44 @@ WVList
|
|||||||
0
|
0
|
||||||
347
|
347
|
||||||
MItem
|
MItem
|
||||||
3
|
29
|
||||||
*.h
|
../../../../../lib/cmn/utf8.c
|
||||||
348
|
348
|
||||||
WString
|
WString
|
||||||
3
|
4
|
||||||
NIL
|
COBJ
|
||||||
349
|
349
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
350
|
350
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
-1
|
11
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
351
|
351
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/mem.h
|
../../../../../lib/cmn/xma.c
|
||||||
352
|
352
|
||||||
WString
|
WString
|
||||||
3
|
4
|
||||||
NIL
|
COBJ
|
||||||
353
|
353
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
354
|
354
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
347
|
11
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
355
|
355
|
||||||
MItem
|
MItem
|
||||||
32
|
3
|
||||||
../../../../../lib/cmn/syscall.h
|
*.h
|
||||||
356
|
356
|
||||||
WString
|
WString
|
||||||
3
|
3
|
||||||
@ -1601,7 +1601,43 @@ WVList
|
|||||||
358
|
358
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
347
|
-1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
359
|
||||||
|
MItem
|
||||||
|
28
|
||||||
|
../../../../../lib/cmn/mem.h
|
||||||
|
360
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
NIL
|
||||||
|
361
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
362
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
355
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
363
|
||||||
|
MItem
|
||||||
|
32
|
||||||
|
../../../../../lib/cmn/syscall.h
|
||||||
|
364
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
NIL
|
||||||
|
365
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
366
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
355
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
|
185
qse/watcom/debug/dos32/mod/awk/awk-dir.tgt
Executable file
185
qse/watcom/debug/dos32/mod/awk/awk-dir.tgt
Executable file
@ -0,0 +1,185 @@
|
|||||||
|
40
|
||||||
|
targetIdent
|
||||||
|
0
|
||||||
|
MProject
|
||||||
|
1
|
||||||
|
MComponent
|
||||||
|
0
|
||||||
|
2
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
CWDLL
|
||||||
|
3
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
dx2do
|
||||||
|
1
|
||||||
|
0
|
||||||
|
1
|
||||||
|
4
|
||||||
|
MCommand
|
||||||
|
0
|
||||||
|
5
|
||||||
|
MCommand
|
||||||
|
0
|
||||||
|
6
|
||||||
|
MItem
|
||||||
|
11
|
||||||
|
awk-dir.dll
|
||||||
|
7
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
CWDLL
|
||||||
|
8
|
||||||
|
WVList
|
||||||
|
4
|
||||||
|
9
|
||||||
|
MVState
|
||||||
|
10
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
WLINK
|
||||||
|
11
|
||||||
|
WString
|
||||||
|
28
|
||||||
|
?????Library directories(;):
|
||||||
|
1
|
||||||
|
12
|
||||||
|
WString
|
||||||
|
27
|
||||||
|
../../lib/cmn ../../lib/awk
|
||||||
|
0
|
||||||
|
13
|
||||||
|
MVState
|
||||||
|
14
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
WLINK
|
||||||
|
15
|
||||||
|
WString
|
||||||
|
18
|
||||||
|
?????Libraries(,):
|
||||||
|
1
|
||||||
|
16
|
||||||
|
WString
|
||||||
|
13
|
||||||
|
qsecmn qseawk
|
||||||
|
0
|
||||||
|
17
|
||||||
|
MVState
|
||||||
|
18
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
WLINK
|
||||||
|
19
|
||||||
|
WString
|
||||||
|
21
|
||||||
|
dx???Export names(,):
|
||||||
|
1
|
||||||
|
20
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
load_
|
||||||
|
0
|
||||||
|
21
|
||||||
|
MCState
|
||||||
|
22
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
WLINK
|
||||||
|
23
|
||||||
|
WString
|
||||||
|
24
|
||||||
|
?????Eliminate dead code
|
||||||
|
1
|
||||||
|
1
|
||||||
|
24
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
-1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
25
|
||||||
|
WPickList
|
||||||
|
2
|
||||||
|
26
|
||||||
|
MItem
|
||||||
|
3
|
||||||
|
*.c
|
||||||
|
27
|
||||||
|
WString
|
||||||
|
4
|
||||||
|
COBJ
|
||||||
|
28
|
||||||
|
WVList
|
||||||
|
3
|
||||||
|
29
|
||||||
|
MVState
|
||||||
|
30
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
WCC
|
||||||
|
31
|
||||||
|
WString
|
||||||
|
25
|
||||||
|
d????Include directories:
|
||||||
|
1
|
||||||
|
32
|
||||||
|
WString
|
||||||
|
37
|
||||||
|
"$(%watcom)/h;../../../../../include"
|
||||||
|
0
|
||||||
|
33
|
||||||
|
MVState
|
||||||
|
34
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
WCC
|
||||||
|
35
|
||||||
|
WString
|
||||||
|
23
|
||||||
|
?????Macro definitions:
|
||||||
|
1
|
||||||
|
36
|
||||||
|
WString
|
||||||
|
15
|
||||||
|
QSE_BUILD_DEBUG
|
||||||
|
0
|
||||||
|
37
|
||||||
|
MCState
|
||||||
|
38
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
WCC
|
||||||
|
39
|
||||||
|
WString
|
||||||
|
33
|
||||||
|
?????Disable stack depth checking
|
||||||
|
1
|
||||||
|
1
|
||||||
|
40
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
-1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
41
|
||||||
|
MItem
|
||||||
|
28
|
||||||
|
../../../../../mod/awk/dir.c
|
||||||
|
42
|
||||||
|
WString
|
||||||
|
4
|
||||||
|
COBJ
|
||||||
|
43
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
44
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
26
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
@ -42,7 +42,7 @@ WVList
|
|||||||
0
|
0
|
||||||
10
|
10
|
||||||
WPickList
|
WPickList
|
||||||
85
|
87
|
||||||
11
|
11
|
||||||
MItem
|
MItem
|
||||||
3
|
3
|
||||||
@ -234,7 +234,7 @@ WVList
|
|||||||
54
|
54
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/dll.c
|
../../../../../lib/cmn/dir.c
|
||||||
55
|
55
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -252,7 +252,7 @@ WVList
|
|||||||
58
|
58
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/env.c
|
../../../../../lib/cmn/dll.c
|
||||||
59
|
59
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -270,7 +270,7 @@ WVList
|
|||||||
62
|
62
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/fio.c
|
../../../../../lib/cmn/env.c
|
||||||
63
|
63
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -288,7 +288,7 @@ WVList
|
|||||||
66
|
66
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/fma.c
|
../../../../../lib/cmn/fio.c
|
||||||
67
|
67
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -306,7 +306,7 @@ WVList
|
|||||||
70
|
70
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/fmt.c
|
../../../../../lib/cmn/fma.c
|
||||||
71
|
71
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -323,8 +323,8 @@ WVList
|
|||||||
0
|
0
|
||||||
74
|
74
|
||||||
MItem
|
MItem
|
||||||
31
|
28
|
||||||
../../../../../lib/cmn/fs-err.c
|
../../../../../lib/cmn/fmt.c
|
||||||
75
|
75
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -341,8 +341,8 @@ WVList
|
|||||||
0
|
0
|
||||||
78
|
78
|
||||||
MItem
|
MItem
|
||||||
32
|
31
|
||||||
../../../../../lib/cmn/fs-move.c
|
../../../../../lib/cmn/fs-err.c
|
||||||
79
|
79
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -359,8 +359,8 @@ WVList
|
|||||||
0
|
0
|
||||||
82
|
82
|
||||||
MItem
|
MItem
|
||||||
27
|
32
|
||||||
../../../../../lib/cmn/fs.c
|
../../../../../lib/cmn/fs-move.c
|
||||||
83
|
83
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -377,8 +377,8 @@ WVList
|
|||||||
0
|
0
|
||||||
86
|
86
|
||||||
MItem
|
MItem
|
||||||
28
|
27
|
||||||
../../../../../lib/cmn/gdl.c
|
../../../../../lib/cmn/fs.c
|
||||||
87
|
87
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -395,8 +395,8 @@ WVList
|
|||||||
0
|
0
|
||||||
90
|
90
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/glob.c
|
../../../../../lib/cmn/gdl.c
|
||||||
91
|
91
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -413,8 +413,8 @@ WVList
|
|||||||
0
|
0
|
||||||
94
|
94
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/htb.c
|
../../../../../lib/cmn/glob.c
|
||||||
95
|
95
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -431,8 +431,8 @@ WVList
|
|||||||
0
|
0
|
||||||
98
|
98
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/hton.c
|
../../../../../lib/cmn/htb.c
|
||||||
99
|
99
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -450,7 +450,7 @@ WVList
|
|||||||
102
|
102
|
||||||
MItem
|
MItem
|
||||||
29
|
29
|
||||||
../../../../../lib/cmn/ipad.c
|
../../../../../lib/cmn/hton.c
|
||||||
103
|
103
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -467,8 +467,8 @@ WVList
|
|||||||
0
|
0
|
||||||
106
|
106
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/lda.c
|
../../../../../lib/cmn/ipad.c
|
||||||
107
|
107
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -485,8 +485,8 @@ WVList
|
|||||||
0
|
0
|
||||||
110
|
110
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/main.c
|
../../../../../lib/cmn/lda.c
|
||||||
111
|
111
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -503,8 +503,8 @@ WVList
|
|||||||
0
|
0
|
||||||
114
|
114
|
||||||
MItem
|
MItem
|
||||||
33
|
29
|
||||||
../../../../../lib/cmn/mbwc-str.c
|
../../../../../lib/cmn/main.c
|
||||||
115
|
115
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -521,8 +521,8 @@ WVList
|
|||||||
0
|
0
|
||||||
118
|
118
|
||||||
MItem
|
MItem
|
||||||
29
|
33
|
||||||
../../../../../lib/cmn/mbwc.c
|
../../../../../lib/cmn/mbwc-str.c
|
||||||
119
|
119
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -539,8 +539,8 @@ WVList
|
|||||||
0
|
0
|
||||||
122
|
122
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/mem.c
|
../../../../../lib/cmn/mbwc.c
|
||||||
123
|
123
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -557,8 +557,8 @@ WVList
|
|||||||
0
|
0
|
||||||
126
|
126
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/nwad.c
|
../../../../../lib/cmn/mem.c
|
||||||
127
|
127
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -575,8 +575,8 @@ WVList
|
|||||||
0
|
0
|
||||||
130
|
130
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/nwif.c
|
../../../../../lib/cmn/mux.c
|
||||||
131
|
131
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -594,7 +594,7 @@ WVList
|
|||||||
134
|
134
|
||||||
MItem
|
MItem
|
||||||
29
|
29
|
||||||
../../../../../lib/cmn/nwio.c
|
../../../../../lib/cmn/nwad.c
|
||||||
135
|
135
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -611,8 +611,8 @@ WVList
|
|||||||
0
|
0
|
||||||
138
|
138
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/oht.c
|
../../../../../lib/cmn/nwif.c
|
||||||
139
|
139
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -629,8 +629,8 @@ WVList
|
|||||||
0
|
0
|
||||||
142
|
142
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/opt.c
|
../../../../../lib/cmn/nwio.c
|
||||||
143
|
143
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -647,8 +647,8 @@ WVList
|
|||||||
0
|
0
|
||||||
146
|
146
|
||||||
MItem
|
MItem
|
||||||
38
|
28
|
||||||
../../../../../lib/cmn/path-basename.c
|
../../../../../lib/cmn/oht.c
|
||||||
147
|
147
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -665,8 +665,8 @@ WVList
|
|||||||
0
|
0
|
||||||
150
|
150
|
||||||
MItem
|
MItem
|
||||||
35
|
28
|
||||||
../../../../../lib/cmn/path-canon.c
|
../../../../../lib/cmn/opt.c
|
||||||
151
|
151
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -683,8 +683,8 @@ WVList
|
|||||||
0
|
0
|
||||||
154
|
154
|
||||||
MItem
|
MItem
|
||||||
28
|
38
|
||||||
../../../../../lib/cmn/pio.c
|
../../../../../lib/cmn/path-basename.c
|
||||||
155
|
155
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -701,8 +701,8 @@ WVList
|
|||||||
0
|
0
|
||||||
158
|
158
|
||||||
MItem
|
MItem
|
||||||
28
|
35
|
||||||
../../../../../lib/cmn/pma.c
|
../../../../../lib/cmn/path-canon.c
|
||||||
159
|
159
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -720,7 +720,7 @@ WVList
|
|||||||
162
|
162
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/rbt.c
|
../../../../../lib/cmn/pio.c
|
||||||
163
|
163
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -738,7 +738,7 @@ WVList
|
|||||||
166
|
166
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/rex.c
|
../../../../../lib/cmn/pma.c
|
||||||
167
|
167
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -756,7 +756,7 @@ WVList
|
|||||||
170
|
170
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/sio.c
|
../../../../../lib/cmn/rbt.c
|
||||||
171
|
171
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -774,7 +774,7 @@ WVList
|
|||||||
174
|
174
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/sll.c
|
../../../../../lib/cmn/rex.c
|
||||||
175
|
175
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -791,8 +791,8 @@ WVList
|
|||||||
0
|
0
|
||||||
178
|
178
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/slmb.c
|
../../../../../lib/cmn/sio.c
|
||||||
179
|
179
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -809,8 +809,8 @@ WVList
|
|||||||
0
|
0
|
||||||
182
|
182
|
||||||
MItem
|
MItem
|
||||||
30
|
28
|
||||||
../../../../../lib/cmn/stdio.c
|
../../../../../lib/cmn/sll.c
|
||||||
183
|
183
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -827,8 +827,8 @@ WVList
|
|||||||
0
|
0
|
||||||
186
|
186
|
||||||
MItem
|
MItem
|
||||||
32
|
29
|
||||||
../../../../../lib/cmn/str-beg.c
|
../../../../../lib/cmn/slmb.c
|
||||||
187
|
187
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -845,8 +845,8 @@ WVList
|
|||||||
0
|
0
|
||||||
190
|
190
|
||||||
MItem
|
MItem
|
||||||
32
|
30
|
||||||
../../../../../lib/cmn/str-cat.c
|
../../../../../lib/cmn/stdio.c
|
||||||
191
|
191
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -864,7 +864,7 @@ WVList
|
|||||||
194
|
194
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-chr.c
|
../../../../../lib/cmn/str-beg.c
|
||||||
195
|
195
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -882,7 +882,7 @@ WVList
|
|||||||
198
|
198
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-cmp.c
|
../../../../../lib/cmn/str-cat.c
|
||||||
199
|
199
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -900,7 +900,7 @@ WVList
|
|||||||
202
|
202
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-cnv.c
|
../../../../../lib/cmn/str-chr.c
|
||||||
203
|
203
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -918,7 +918,7 @@ WVList
|
|||||||
206
|
206
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-cpy.c
|
../../../../../lib/cmn/str-cmp.c
|
||||||
207
|
207
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -936,7 +936,7 @@ WVList
|
|||||||
210
|
210
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-del.c
|
../../../../../lib/cmn/str-cnv.c
|
||||||
211
|
211
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -954,7 +954,7 @@ WVList
|
|||||||
214
|
214
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-dup.c
|
../../../../../lib/cmn/str-cpy.c
|
||||||
215
|
215
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -971,8 +971,8 @@ WVList
|
|||||||
0
|
0
|
||||||
218
|
218
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-dynm.c
|
../../../../../lib/cmn/str-del.c
|
||||||
219
|
219
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -989,8 +989,8 @@ WVList
|
|||||||
0
|
0
|
||||||
222
|
222
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-dynw.c
|
../../../../../lib/cmn/str-dup.c
|
||||||
223
|
223
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1007,8 +1007,8 @@ WVList
|
|||||||
0
|
0
|
||||||
226
|
226
|
||||||
MItem
|
MItem
|
||||||
32
|
33
|
||||||
../../../../../lib/cmn/str-end.c
|
../../../../../lib/cmn/str-dynm.c
|
||||||
227
|
227
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1026,7 +1026,7 @@ WVList
|
|||||||
230
|
230
|
||||||
MItem
|
MItem
|
||||||
33
|
33
|
||||||
../../../../../lib/cmn/str-excl.c
|
../../../../../lib/cmn/str-dynw.c
|
||||||
231
|
231
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1043,8 +1043,8 @@ WVList
|
|||||||
0
|
0
|
||||||
234
|
234
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-fcpy.c
|
../../../../../lib/cmn/str-end.c
|
||||||
235
|
235
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1061,8 +1061,8 @@ WVList
|
|||||||
0
|
0
|
||||||
238
|
238
|
||||||
MItem
|
MItem
|
||||||
34
|
33
|
||||||
../../../../../lib/cmn/str-fnmat.c
|
../../../../../lib/cmn/str-excl.c
|
||||||
239
|
239
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1080,7 +1080,7 @@ WVList
|
|||||||
242
|
242
|
||||||
MItem
|
MItem
|
||||||
33
|
33
|
||||||
../../../../../lib/cmn/str-incl.c
|
../../../../../lib/cmn/str-fcpy.c
|
||||||
243
|
243
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1097,8 +1097,8 @@ WVList
|
|||||||
0
|
0
|
||||||
246
|
246
|
||||||
MItem
|
MItem
|
||||||
32
|
34
|
||||||
../../../../../lib/cmn/str-len.c
|
../../../../../lib/cmn/str-fnmat.c
|
||||||
247
|
247
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1115,8 +1115,8 @@ WVList
|
|||||||
0
|
0
|
||||||
250
|
250
|
||||||
MItem
|
MItem
|
||||||
32
|
33
|
||||||
../../../../../lib/cmn/str-pac.c
|
../../../../../lib/cmn/str-incl.c
|
||||||
251
|
251
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1133,8 +1133,8 @@ WVList
|
|||||||
0
|
0
|
||||||
254
|
254
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-pbrk.c
|
../../../../../lib/cmn/str-len.c
|
||||||
255
|
255
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1152,7 +1152,7 @@ WVList
|
|||||||
258
|
258
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-put.c
|
../../../../../lib/cmn/str-pac.c
|
||||||
259
|
259
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1169,8 +1169,8 @@ WVList
|
|||||||
0
|
0
|
||||||
262
|
262
|
||||||
MItem
|
MItem
|
||||||
32
|
33
|
||||||
../../../../../lib/cmn/str-rev.c
|
../../../../../lib/cmn/str-pbrk.c
|
||||||
263
|
263
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1188,7 +1188,7 @@ WVList
|
|||||||
266
|
266
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-rot.c
|
../../../../../lib/cmn/str-put.c
|
||||||
267
|
267
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1206,7 +1206,7 @@ WVList
|
|||||||
270
|
270
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-set.c
|
../../../../../lib/cmn/str-rev.c
|
||||||
271
|
271
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1224,7 +1224,7 @@ WVList
|
|||||||
274
|
274
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-spl.c
|
../../../../../lib/cmn/str-rot.c
|
||||||
275
|
275
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1242,7 +1242,7 @@ WVList
|
|||||||
278
|
278
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-spn.c
|
../../../../../lib/cmn/str-set.c
|
||||||
279
|
279
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1260,7 +1260,7 @@ WVList
|
|||||||
282
|
282
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-str.c
|
../../../../../lib/cmn/str-spl.c
|
||||||
283
|
283
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1277,8 +1277,8 @@ WVList
|
|||||||
0
|
0
|
||||||
286
|
286
|
||||||
MItem
|
MItem
|
||||||
34
|
32
|
||||||
../../../../../lib/cmn/str-subst.c
|
../../../../../lib/cmn/str-spn.c
|
||||||
287
|
287
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1296,7 +1296,7 @@ WVList
|
|||||||
290
|
290
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-tok.c
|
../../../../../lib/cmn/str-str.c
|
||||||
291
|
291
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1313,8 +1313,8 @@ WVList
|
|||||||
0
|
0
|
||||||
294
|
294
|
||||||
MItem
|
MItem
|
||||||
32
|
34
|
||||||
../../../../../lib/cmn/str-trm.c
|
../../../../../lib/cmn/str-subst.c
|
||||||
295
|
295
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1331,8 +1331,8 @@ WVList
|
|||||||
0
|
0
|
||||||
298
|
298
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-word.c
|
../../../../../lib/cmn/str-tok.c
|
||||||
299
|
299
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1349,8 +1349,8 @@ WVList
|
|||||||
0
|
0
|
||||||
302
|
302
|
||||||
MItem
|
MItem
|
||||||
29
|
32
|
||||||
../../../../../lib/cmn/task.c
|
../../../../../lib/cmn/str-trm.c
|
||||||
303
|
303
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1367,8 +1367,8 @@ WVList
|
|||||||
0
|
0
|
||||||
306
|
306
|
||||||
MItem
|
MItem
|
||||||
29
|
33
|
||||||
../../../../../lib/cmn/time.c
|
../../../../../lib/cmn/str-word.c
|
||||||
307
|
307
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1385,8 +1385,8 @@ WVList
|
|||||||
0
|
0
|
||||||
310
|
310
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/tio.c
|
../../../../../lib/cmn/task.c
|
||||||
311
|
311
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1403,8 +1403,8 @@ WVList
|
|||||||
0
|
0
|
||||||
314
|
314
|
||||||
MItem
|
MItem
|
||||||
32
|
29
|
||||||
../../../../../lib/cmn/tre-ast.c
|
../../../../../lib/cmn/time.c
|
||||||
315
|
315
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1421,8 +1421,8 @@ WVList
|
|||||||
0
|
0
|
||||||
318
|
318
|
||||||
MItem
|
MItem
|
||||||
36
|
28
|
||||||
../../../../../lib/cmn/tre-compile.c
|
../../../../../lib/cmn/tio.c
|
||||||
319
|
319
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1439,8 +1439,8 @@ WVList
|
|||||||
0
|
0
|
||||||
322
|
322
|
||||||
MItem
|
MItem
|
||||||
44
|
32
|
||||||
../../../../../lib/cmn/tre-match-backtrack.c
|
../../../../../lib/cmn/tre-ast.c
|
||||||
323
|
323
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1457,8 +1457,8 @@ WVList
|
|||||||
0
|
0
|
||||||
326
|
326
|
||||||
MItem
|
MItem
|
||||||
43
|
36
|
||||||
../../../../../lib/cmn/tre-match-parallel.c
|
../../../../../lib/cmn/tre-compile.c
|
||||||
327
|
327
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1475,8 +1475,8 @@ WVList
|
|||||||
0
|
0
|
||||||
330
|
330
|
||||||
MItem
|
MItem
|
||||||
34
|
44
|
||||||
../../../../../lib/cmn/tre-parse.c
|
../../../../../lib/cmn/tre-match-backtrack.c
|
||||||
331
|
331
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1493,8 +1493,8 @@ WVList
|
|||||||
0
|
0
|
||||||
334
|
334
|
||||||
MItem
|
MItem
|
||||||
34
|
43
|
||||||
../../../../../lib/cmn/tre-stack.c
|
../../../../../lib/cmn/tre-match-parallel.c
|
||||||
335
|
335
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1511,8 +1511,8 @@ WVList
|
|||||||
0
|
0
|
||||||
338
|
338
|
||||||
MItem
|
MItem
|
||||||
28
|
34
|
||||||
../../../../../lib/cmn/tre.c
|
../../../../../lib/cmn/tre-parse.c
|
||||||
339
|
339
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1529,8 +1529,8 @@ WVList
|
|||||||
0
|
0
|
||||||
342
|
342
|
||||||
MItem
|
MItem
|
||||||
29
|
34
|
||||||
../../../../../lib/cmn/utf8.c
|
../../../../../lib/cmn/tre-stack.c
|
||||||
343
|
343
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1548,7 +1548,7 @@ WVList
|
|||||||
346
|
346
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/xma.c
|
../../../../../lib/cmn/tre.c
|
||||||
347
|
347
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1565,44 +1565,44 @@ WVList
|
|||||||
0
|
0
|
||||||
350
|
350
|
||||||
MItem
|
MItem
|
||||||
3
|
29
|
||||||
*.h
|
../../../../../lib/cmn/utf8.c
|
||||||
351
|
351
|
||||||
WString
|
WString
|
||||||
3
|
4
|
||||||
NIL
|
COBJ
|
||||||
352
|
352
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
353
|
353
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
-1
|
11
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
354
|
354
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/mem.h
|
../../../../../lib/cmn/xma.c
|
||||||
355
|
355
|
||||||
WString
|
WString
|
||||||
3
|
4
|
||||||
NIL
|
COBJ
|
||||||
356
|
356
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
357
|
357
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
350
|
11
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
358
|
358
|
||||||
MItem
|
MItem
|
||||||
32
|
3
|
||||||
../../../../../lib/cmn/syscall.h
|
*.h
|
||||||
359
|
359
|
||||||
WString
|
WString
|
||||||
3
|
3
|
||||||
@ -1613,7 +1613,43 @@ WVList
|
|||||||
361
|
361
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
350
|
-1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
362
|
||||||
|
MItem
|
||||||
|
28
|
||||||
|
../../../../../lib/cmn/mem.h
|
||||||
|
363
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
NIL
|
||||||
|
364
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
365
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
358
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
366
|
||||||
|
MItem
|
||||||
|
32
|
||||||
|
../../../../../lib/cmn/syscall.h
|
||||||
|
367
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
NIL
|
||||||
|
368
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
369
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
358
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
|
185
qse/watcom/debug/os2/mod/awk/awk-dir.tgt
Executable file
185
qse/watcom/debug/os2/mod/awk/awk-dir.tgt
Executable file
@ -0,0 +1,185 @@
|
|||||||
|
40
|
||||||
|
targetIdent
|
||||||
|
0
|
||||||
|
MProject
|
||||||
|
1
|
||||||
|
MComponent
|
||||||
|
0
|
||||||
|
2
|
||||||
|
WString
|
||||||
|
4
|
||||||
|
ODLL
|
||||||
|
3
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
o_2do
|
||||||
|
1
|
||||||
|
0
|
||||||
|
1
|
||||||
|
4
|
||||||
|
MCommand
|
||||||
|
0
|
||||||
|
5
|
||||||
|
MCommand
|
||||||
|
0
|
||||||
|
6
|
||||||
|
MItem
|
||||||
|
11
|
||||||
|
awk-dir.dll
|
||||||
|
7
|
||||||
|
WString
|
||||||
|
4
|
||||||
|
ODLL
|
||||||
|
8
|
||||||
|
WVList
|
||||||
|
4
|
||||||
|
9
|
||||||
|
MVState
|
||||||
|
10
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
WLINK
|
||||||
|
11
|
||||||
|
WString
|
||||||
|
28
|
||||||
|
?????Library directories(;):
|
||||||
|
1
|
||||||
|
12
|
||||||
|
WString
|
||||||
|
27
|
||||||
|
../../lib/cmn ../../lib/awk
|
||||||
|
0
|
||||||
|
13
|
||||||
|
MVState
|
||||||
|
14
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
WLINK
|
||||||
|
15
|
||||||
|
WString
|
||||||
|
18
|
||||||
|
?????Libraries(,):
|
||||||
|
1
|
||||||
|
16
|
||||||
|
WString
|
||||||
|
13
|
||||||
|
qsecmn qseawk
|
||||||
|
0
|
||||||
|
17
|
||||||
|
MVState
|
||||||
|
18
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
WLINK
|
||||||
|
19
|
||||||
|
WString
|
||||||
|
21
|
||||||
|
o????Export names(,):
|
||||||
|
1
|
||||||
|
20
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
load_
|
||||||
|
0
|
||||||
|
21
|
||||||
|
MCState
|
||||||
|
22
|
||||||
|
WString
|
||||||
|
5
|
||||||
|
WLINK
|
||||||
|
23
|
||||||
|
WString
|
||||||
|
24
|
||||||
|
?????Eliminate dead code
|
||||||
|
1
|
||||||
|
1
|
||||||
|
24
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
-1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
25
|
||||||
|
WPickList
|
||||||
|
2
|
||||||
|
26
|
||||||
|
MItem
|
||||||
|
3
|
||||||
|
*.c
|
||||||
|
27
|
||||||
|
WString
|
||||||
|
4
|
||||||
|
COBJ
|
||||||
|
28
|
||||||
|
WVList
|
||||||
|
3
|
||||||
|
29
|
||||||
|
MVState
|
||||||
|
30
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
WCC
|
||||||
|
31
|
||||||
|
WString
|
||||||
|
25
|
||||||
|
o?2??Include directories:
|
||||||
|
1
|
||||||
|
32
|
||||||
|
WString
|
||||||
|
54
|
||||||
|
"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include"
|
||||||
|
0
|
||||||
|
33
|
||||||
|
MVState
|
||||||
|
34
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
WCC
|
||||||
|
35
|
||||||
|
WString
|
||||||
|
23
|
||||||
|
?????Macro definitions:
|
||||||
|
1
|
||||||
|
36
|
||||||
|
WString
|
||||||
|
15
|
||||||
|
QSE_BUILD_DEBUG
|
||||||
|
0
|
||||||
|
37
|
||||||
|
MCState
|
||||||
|
38
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
WCC
|
||||||
|
39
|
||||||
|
WString
|
||||||
|
33
|
||||||
|
?????Disable stack depth checking
|
||||||
|
1
|
||||||
|
1
|
||||||
|
40
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
-1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
41
|
||||||
|
MItem
|
||||||
|
28
|
||||||
|
../../../../../mod/awk/dir.c
|
||||||
|
42
|
||||||
|
WString
|
||||||
|
4
|
||||||
|
COBJ
|
||||||
|
43
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
44
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
26
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
@ -113,7 +113,7 @@ WString
|
|||||||
COBJ
|
COBJ
|
||||||
28
|
28
|
||||||
WVList
|
WVList
|
||||||
1
|
3
|
||||||
29
|
29
|
||||||
MVState
|
MVState
|
||||||
30
|
30
|
||||||
@ -131,24 +131,52 @@ WString
|
|||||||
"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include"
|
"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include"
|
||||||
0
|
0
|
||||||
33
|
33
|
||||||
|
MVState
|
||||||
|
34
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
WCC
|
||||||
|
35
|
||||||
|
WString
|
||||||
|
23
|
||||||
|
?????Macro definitions:
|
||||||
|
1
|
||||||
|
36
|
||||||
|
WString
|
||||||
|
15
|
||||||
|
QSE_BUILD_DEBUG
|
||||||
|
0
|
||||||
|
37
|
||||||
|
MCState
|
||||||
|
38
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
WCC
|
||||||
|
39
|
||||||
|
WString
|
||||||
|
33
|
||||||
|
?????Disable stack depth checking
|
||||||
|
1
|
||||||
|
1
|
||||||
|
40
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
-1
|
-1
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
34
|
41
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../mod/awk/sys.c
|
../../../../../mod/awk/sys.c
|
||||||
35
|
42
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
COBJ
|
COBJ
|
||||||
36
|
43
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
37
|
44
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
26
|
26
|
||||||
|
@ -4,8 +4,8 @@ projectIdent
|
|||||||
VpeMain
|
VpeMain
|
||||||
1
|
1
|
||||||
WRect
|
WRect
|
||||||
520
|
530
|
||||||
120
|
106
|
||||||
9320
|
9320
|
||||||
9680
|
9680
|
||||||
2
|
2
|
||||||
@ -16,7 +16,7 @@ MCommand
|
|||||||
4
|
4
|
||||||
MCommand
|
MCommand
|
||||||
0
|
0
|
||||||
15
|
17
|
||||||
5
|
5
|
||||||
WFileName
|
WFileName
|
||||||
30
|
30
|
||||||
@ -78,11 +78,19 @@ WFileName
|
|||||||
29
|
29
|
||||||
debug/os2/mod/awk/awk-sys.tgt
|
debug/os2/mod/awk/awk-sys.tgt
|
||||||
20
|
20
|
||||||
WVList
|
WFileName
|
||||||
15
|
29
|
||||||
|
debug/os2/mod/awk/awk-dir.tgt
|
||||||
21
|
21
|
||||||
VComponent
|
WFileName
|
||||||
|
31
|
||||||
|
debug/dos32/mod/awk/awk-dir.tgt
|
||||||
22
|
22
|
||||||
|
WVList
|
||||||
|
17
|
||||||
|
23
|
||||||
|
VComponent
|
||||||
|
24
|
||||||
WRect
|
WRect
|
||||||
1070
|
1070
|
||||||
2520
|
2520
|
||||||
@ -90,15 +98,15 @@ WRect
|
|||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
23
|
25
|
||||||
WFileName
|
WFileName
|
||||||
30
|
30
|
||||||
release/os2/lib/cmn/qsecmn.tgt
|
release/os2/lib/cmn/qsecmn.tgt
|
||||||
0
|
0
|
||||||
5
|
5
|
||||||
24
|
26
|
||||||
VComponent
|
VComponent
|
||||||
25
|
27
|
||||||
WRect
|
WRect
|
||||||
90
|
90
|
||||||
1240
|
1240
|
||||||
@ -106,15 +114,15 @@ WRect
|
|||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
26
|
28
|
||||||
WFileName
|
WFileName
|
||||||
30
|
30
|
||||||
release/os2/lib/sed/qsesed.tgt
|
release/os2/lib/sed/qsesed.tgt
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
27
|
29
|
||||||
VComponent
|
VComponent
|
||||||
28
|
30
|
||||||
WRect
|
WRect
|
||||||
2100
|
2100
|
||||||
1400
|
1400
|
||||||
@ -122,31 +130,31 @@ WRect
|
|||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
29
|
31
|
||||||
WFileName
|
WFileName
|
||||||
30
|
30
|
||||||
release/os2/cmd/sed/qsesed.tgt
|
release/os2/cmd/sed/qsesed.tgt
|
||||||
0
|
0
|
||||||
1
|
1
|
||||||
30
|
32
|
||||||
VComponent
|
VComponent
|
||||||
31
|
33
|
||||||
WRect
|
WRect
|
||||||
780
|
2830
|
||||||
480
|
346
|
||||||
5700
|
5700
|
||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
32
|
34
|
||||||
WFileName
|
WFileName
|
||||||
28
|
28
|
||||||
debug/os2/lib/cmn/qsecmn.tgt
|
debug/os2/lib/cmn/qsecmn.tgt
|
||||||
45
|
0
|
||||||
48
|
22
|
||||||
33
|
35
|
||||||
VComponent
|
VComponent
|
||||||
34
|
36
|
||||||
WRect
|
WRect
|
||||||
1050
|
1050
|
||||||
2360
|
2360
|
||||||
@ -154,31 +162,31 @@ WRect
|
|||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
35
|
37
|
||||||
WFileName
|
WFileName
|
||||||
28
|
28
|
||||||
debug/os2/lib/sed/qsesed.tgt
|
debug/os2/lib/sed/qsesed.tgt
|
||||||
0
|
0
|
||||||
3
|
3
|
||||||
36
|
38
|
||||||
VComponent
|
VComponent
|
||||||
37
|
39
|
||||||
WRect
|
WRect
|
||||||
420
|
420
|
||||||
333
|
320
|
||||||
5700
|
5700
|
||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
38
|
40
|
||||||
WFileName
|
WFileName
|
||||||
28
|
28
|
||||||
debug/os2/lib/awk/qseawk.tgt
|
debug/os2/lib/awk/qseawk.tgt
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
39
|
41
|
||||||
VComponent
|
VComponent
|
||||||
40
|
42
|
||||||
WRect
|
WRect
|
||||||
330
|
330
|
||||||
400
|
400
|
||||||
@ -186,47 +194,47 @@ WRect
|
|||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
41
|
43
|
||||||
WFileName
|
WFileName
|
||||||
28
|
28
|
||||||
debug/os2/cmd/awk/qseawk.tgt
|
debug/os2/cmd/awk/qseawk.tgt
|
||||||
0
|
0
|
||||||
1
|
1
|
||||||
42
|
44
|
||||||
VComponent
|
VComponent
|
||||||
43
|
45
|
||||||
WRect
|
WRect
|
||||||
2670
|
2670
|
||||||
40
|
40
|
||||||
5700
|
5700
|
||||||
4240
|
4240
|
||||||
1
|
|
||||||
0
|
0
|
||||||
44
|
0
|
||||||
|
46
|
||||||
WFileName
|
WFileName
|
||||||
30
|
30
|
||||||
debug/dos32/lib/cmn/qsecmn.tgt
|
debug/dos32/lib/cmn/qsecmn.tgt
|
||||||
0
|
0
|
||||||
0
|
2
|
||||||
45
|
47
|
||||||
VComponent
|
VComponent
|
||||||
46
|
48
|
||||||
WRect
|
WRect
|
||||||
1620
|
1620
|
||||||
1360
|
1360
|
||||||
5700
|
5700
|
||||||
4240
|
4240
|
||||||
1
|
|
||||||
0
|
0
|
||||||
47
|
0
|
||||||
|
49
|
||||||
WFileName
|
WFileName
|
||||||
30
|
30
|
||||||
debug/dos32/lib/awk/qseawk.tgt
|
debug/dos32/lib/awk/qseawk.tgt
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
48
|
50
|
||||||
VComponent
|
VComponent
|
||||||
49
|
51
|
||||||
WRect
|
WRect
|
||||||
0
|
0
|
||||||
200
|
200
|
||||||
@ -234,15 +242,15 @@ WRect
|
|||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
50
|
52
|
||||||
WFileName
|
WFileName
|
||||||
30
|
30
|
||||||
debug/dos32/cmd/awk/qseawk.tgt
|
debug/dos32/cmd/awk/qseawk.tgt
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
51
|
53
|
||||||
VComponent
|
VComponent
|
||||||
52
|
54
|
||||||
WRect
|
WRect
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
@ -250,15 +258,15 @@ WRect
|
|||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
53
|
55
|
||||||
WFileName
|
WFileName
|
||||||
30
|
30
|
||||||
debug/dos32/lib/sed/qsesed.tgt
|
debug/dos32/lib/sed/qsesed.tgt
|
||||||
0
|
0
|
||||||
5
|
5
|
||||||
54
|
56
|
||||||
VComponent
|
VComponent
|
||||||
55
|
57
|
||||||
WRect
|
WRect
|
||||||
580
|
580
|
||||||
560
|
560
|
||||||
@ -266,15 +274,15 @@ WRect
|
|||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
56
|
58
|
||||||
WFileName
|
WFileName
|
||||||
30
|
30
|
||||||
debug/dos32/cmd/sed/qsesed.tgt
|
debug/dos32/cmd/sed/qsesed.tgt
|
||||||
0
|
0
|
||||||
1
|
1
|
||||||
57
|
59
|
||||||
VComponent
|
VComponent
|
||||||
58
|
60
|
||||||
WRect
|
WRect
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
@ -282,15 +290,15 @@ WRect
|
|||||||
4240
|
4240
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
59
|
61
|
||||||
WFileName
|
WFileName
|
||||||
28
|
28
|
||||||
debug/os2/cmd/sed/qsesed.tgt
|
debug/os2/cmd/sed/qsesed.tgt
|
||||||
0
|
0
|
||||||
1
|
1
|
||||||
60
|
62
|
||||||
VComponent
|
VComponent
|
||||||
61
|
63
|
||||||
WRect
|
WRect
|
||||||
2610
|
2610
|
||||||
1080
|
1080
|
||||||
@ -298,26 +306,58 @@ WRect
|
|||||||
4240
|
4240
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
62
|
64
|
||||||
WFileName
|
WFileName
|
||||||
31
|
31
|
||||||
debug/dos32/mod/awk/awk-sys.tgt
|
debug/dos32/mod/awk/awk-sys.tgt
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
63
|
65
|
||||||
VComponent
|
VComponent
|
||||||
64
|
66
|
||||||
WRect
|
WRect
|
||||||
290
|
1140
|
||||||
280
|
226
|
||||||
5700
|
5700
|
||||||
4240
|
4240
|
||||||
|
1
|
||||||
0
|
0
|
||||||
0
|
67
|
||||||
65
|
|
||||||
WFileName
|
WFileName
|
||||||
29
|
29
|
||||||
debug/os2/mod/awk/awk-sys.tgt
|
debug/os2/mod/awk/awk-sys.tgt
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
63
|
68
|
||||||
|
VComponent
|
||||||
|
69
|
||||||
|
WRect
|
||||||
|
470
|
||||||
|
3066
|
||||||
|
5700
|
||||||
|
4253
|
||||||
|
1
|
||||||
|
0
|
||||||
|
70
|
||||||
|
WFileName
|
||||||
|
29
|
||||||
|
debug/os2/mod/awk/awk-dir.tgt
|
||||||
|
0
|
||||||
|
1
|
||||||
|
71
|
||||||
|
VComponent
|
||||||
|
72
|
||||||
|
WRect
|
||||||
|
580
|
||||||
|
573
|
||||||
|
5700
|
||||||
|
4253
|
||||||
|
0
|
||||||
|
0
|
||||||
|
73
|
||||||
|
WFileName
|
||||||
|
31
|
||||||
|
debug/dos32/mod/awk/awk-dir.tgt
|
||||||
|
0
|
||||||
|
0
|
||||||
|
71
|
||||||
|
@ -42,7 +42,7 @@ WVList
|
|||||||
0
|
0
|
||||||
10
|
10
|
||||||
WPickList
|
WPickList
|
||||||
83
|
85
|
||||||
11
|
11
|
||||||
MItem
|
MItem
|
||||||
3
|
3
|
||||||
@ -270,7 +270,7 @@ WVList
|
|||||||
63
|
63
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/dll.c
|
../../../../../lib/cmn/dir.c
|
||||||
64
|
64
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -288,7 +288,7 @@ WVList
|
|||||||
67
|
67
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/fio.c
|
../../../../../lib/cmn/dll.c
|
||||||
68
|
68
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -306,7 +306,7 @@ WVList
|
|||||||
71
|
71
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/fma.c
|
../../../../../lib/cmn/fio.c
|
||||||
72
|
72
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -324,7 +324,7 @@ WVList
|
|||||||
75
|
75
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/fmt.c
|
../../../../../lib/cmn/fma.c
|
||||||
76
|
76
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -341,8 +341,8 @@ WVList
|
|||||||
0
|
0
|
||||||
79
|
79
|
||||||
MItem
|
MItem
|
||||||
31
|
28
|
||||||
../../../../../lib/cmn/fs-err.c
|
../../../../../lib/cmn/fmt.c
|
||||||
80
|
80
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -359,8 +359,8 @@ WVList
|
|||||||
0
|
0
|
||||||
83
|
83
|
||||||
MItem
|
MItem
|
||||||
32
|
31
|
||||||
../../../../../lib/cmn/fs-move.c
|
../../../../../lib/cmn/fs-err.c
|
||||||
84
|
84
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -377,8 +377,8 @@ WVList
|
|||||||
0
|
0
|
||||||
87
|
87
|
||||||
MItem
|
MItem
|
||||||
27
|
32
|
||||||
../../../../../lib/cmn/fs.c
|
../../../../../lib/cmn/fs-move.c
|
||||||
88
|
88
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -395,8 +395,8 @@ WVList
|
|||||||
0
|
0
|
||||||
91
|
91
|
||||||
MItem
|
MItem
|
||||||
28
|
27
|
||||||
../../../../../lib/cmn/gdl.c
|
../../../../../lib/cmn/fs.c
|
||||||
92
|
92
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -413,8 +413,8 @@ WVList
|
|||||||
0
|
0
|
||||||
95
|
95
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/glob.c
|
../../../../../lib/cmn/gdl.c
|
||||||
96
|
96
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -431,8 +431,8 @@ WVList
|
|||||||
0
|
0
|
||||||
99
|
99
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/htb.c
|
../../../../../lib/cmn/glob.c
|
||||||
100
|
100
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -449,8 +449,8 @@ WVList
|
|||||||
0
|
0
|
||||||
103
|
103
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/ipad.c
|
../../../../../lib/cmn/htb.c
|
||||||
104
|
104
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -467,8 +467,8 @@ WVList
|
|||||||
0
|
0
|
||||||
107
|
107
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/lda.c
|
../../../../../lib/cmn/ipad.c
|
||||||
108
|
108
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -485,8 +485,8 @@ WVList
|
|||||||
0
|
0
|
||||||
111
|
111
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/main.c
|
../../../../../lib/cmn/lda.c
|
||||||
112
|
112
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -503,8 +503,8 @@ WVList
|
|||||||
0
|
0
|
||||||
115
|
115
|
||||||
MItem
|
MItem
|
||||||
33
|
29
|
||||||
../../../../../lib/cmn/mbwc-str.c
|
../../../../../lib/cmn/main.c
|
||||||
116
|
116
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -521,8 +521,8 @@ WVList
|
|||||||
0
|
0
|
||||||
119
|
119
|
||||||
MItem
|
MItem
|
||||||
29
|
33
|
||||||
../../../../../lib/cmn/mbwc.c
|
../../../../../lib/cmn/mbwc-str.c
|
||||||
120
|
120
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -539,8 +539,8 @@ WVList
|
|||||||
0
|
0
|
||||||
123
|
123
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/mem.c
|
../../../../../lib/cmn/mbwc.c
|
||||||
124
|
124
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -557,8 +557,8 @@ WVList
|
|||||||
0
|
0
|
||||||
127
|
127
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/nwad.c
|
../../../../../lib/cmn/mem.c
|
||||||
128
|
128
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -575,8 +575,8 @@ WVList
|
|||||||
0
|
0
|
||||||
131
|
131
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/nwif.c
|
../../../../../lib/cmn/mux.c
|
||||||
132
|
132
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -594,7 +594,7 @@ WVList
|
|||||||
135
|
135
|
||||||
MItem
|
MItem
|
||||||
29
|
29
|
||||||
../../../../../lib/cmn/nwio.c
|
../../../../../lib/cmn/nwad.c
|
||||||
136
|
136
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -611,8 +611,8 @@ WVList
|
|||||||
0
|
0
|
||||||
139
|
139
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/oht.c
|
../../../../../lib/cmn/nwif.c
|
||||||
140
|
140
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -629,8 +629,8 @@ WVList
|
|||||||
0
|
0
|
||||||
143
|
143
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/opt.c
|
../../../../../lib/cmn/nwio.c
|
||||||
144
|
144
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -647,8 +647,8 @@ WVList
|
|||||||
0
|
0
|
||||||
147
|
147
|
||||||
MItem
|
MItem
|
||||||
38
|
28
|
||||||
../../../../../lib/cmn/path-basename.c
|
../../../../../lib/cmn/oht.c
|
||||||
148
|
148
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -665,8 +665,8 @@ WVList
|
|||||||
0
|
0
|
||||||
151
|
151
|
||||||
MItem
|
MItem
|
||||||
35
|
28
|
||||||
../../../../../lib/cmn/path-canon.c
|
../../../../../lib/cmn/opt.c
|
||||||
152
|
152
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -683,8 +683,8 @@ WVList
|
|||||||
0
|
0
|
||||||
155
|
155
|
||||||
MItem
|
MItem
|
||||||
28
|
38
|
||||||
../../../../../lib/cmn/pio.c
|
../../../../../lib/cmn/path-basename.c
|
||||||
156
|
156
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -701,8 +701,8 @@ WVList
|
|||||||
0
|
0
|
||||||
159
|
159
|
||||||
MItem
|
MItem
|
||||||
28
|
35
|
||||||
../../../../../lib/cmn/pma.c
|
../../../../../lib/cmn/path-canon.c
|
||||||
160
|
160
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -720,7 +720,7 @@ WVList
|
|||||||
163
|
163
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/rbt.c
|
../../../../../lib/cmn/pio.c
|
||||||
164
|
164
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -738,7 +738,7 @@ WVList
|
|||||||
167
|
167
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/rex.c
|
../../../../../lib/cmn/pma.c
|
||||||
168
|
168
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -756,7 +756,7 @@ WVList
|
|||||||
171
|
171
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/sio.c
|
../../../../../lib/cmn/rbt.c
|
||||||
172
|
172
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -774,7 +774,7 @@ WVList
|
|||||||
175
|
175
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/sll.c
|
../../../../../lib/cmn/rex.c
|
||||||
176
|
176
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -791,8 +791,8 @@ WVList
|
|||||||
0
|
0
|
||||||
179
|
179
|
||||||
MItem
|
MItem
|
||||||
29
|
28
|
||||||
../../../../../lib/cmn/slmb.c
|
../../../../../lib/cmn/sio.c
|
||||||
180
|
180
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -809,8 +809,8 @@ WVList
|
|||||||
0
|
0
|
||||||
183
|
183
|
||||||
MItem
|
MItem
|
||||||
30
|
28
|
||||||
../../../../../lib/cmn/stdio.c
|
../../../../../lib/cmn/sll.c
|
||||||
184
|
184
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -827,8 +827,8 @@ WVList
|
|||||||
0
|
0
|
||||||
187
|
187
|
||||||
MItem
|
MItem
|
||||||
32
|
29
|
||||||
../../../../../lib/cmn/str-beg.c
|
../../../../../lib/cmn/slmb.c
|
||||||
188
|
188
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -845,8 +845,8 @@ WVList
|
|||||||
0
|
0
|
||||||
191
|
191
|
||||||
MItem
|
MItem
|
||||||
32
|
30
|
||||||
../../../../../lib/cmn/str-cat.c
|
../../../../../lib/cmn/stdio.c
|
||||||
192
|
192
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -864,7 +864,7 @@ WVList
|
|||||||
195
|
195
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-chr.c
|
../../../../../lib/cmn/str-beg.c
|
||||||
196
|
196
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -882,7 +882,7 @@ WVList
|
|||||||
199
|
199
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-cmp.c
|
../../../../../lib/cmn/str-cat.c
|
||||||
200
|
200
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -900,7 +900,7 @@ WVList
|
|||||||
203
|
203
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-cnv.c
|
../../../../../lib/cmn/str-chr.c
|
||||||
204
|
204
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -918,7 +918,7 @@ WVList
|
|||||||
207
|
207
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-cpy.c
|
../../../../../lib/cmn/str-cmp.c
|
||||||
208
|
208
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -936,7 +936,7 @@ WVList
|
|||||||
211
|
211
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-del.c
|
../../../../../lib/cmn/str-cnv.c
|
||||||
212
|
212
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -954,7 +954,7 @@ WVList
|
|||||||
215
|
215
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-dup.c
|
../../../../../lib/cmn/str-cpy.c
|
||||||
216
|
216
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -971,8 +971,8 @@ WVList
|
|||||||
0
|
0
|
||||||
219
|
219
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-dynm.c
|
../../../../../lib/cmn/str-del.c
|
||||||
220
|
220
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -989,8 +989,8 @@ WVList
|
|||||||
0
|
0
|
||||||
223
|
223
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-dynw.c
|
../../../../../lib/cmn/str-dup.c
|
||||||
224
|
224
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1007,8 +1007,8 @@ WVList
|
|||||||
0
|
0
|
||||||
227
|
227
|
||||||
MItem
|
MItem
|
||||||
32
|
33
|
||||||
../../../../../lib/cmn/str-end.c
|
../../../../../lib/cmn/str-dynm.c
|
||||||
228
|
228
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1026,7 +1026,7 @@ WVList
|
|||||||
231
|
231
|
||||||
MItem
|
MItem
|
||||||
33
|
33
|
||||||
../../../../../lib/cmn/str-excl.c
|
../../../../../lib/cmn/str-dynw.c
|
||||||
232
|
232
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1043,8 +1043,8 @@ WVList
|
|||||||
0
|
0
|
||||||
235
|
235
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-fcpy.c
|
../../../../../lib/cmn/str-end.c
|
||||||
236
|
236
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1061,8 +1061,8 @@ WVList
|
|||||||
0
|
0
|
||||||
239
|
239
|
||||||
MItem
|
MItem
|
||||||
34
|
33
|
||||||
../../../../../lib/cmn/str-fnmat.c
|
../../../../../lib/cmn/str-excl.c
|
||||||
240
|
240
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1080,7 +1080,7 @@ WVList
|
|||||||
243
|
243
|
||||||
MItem
|
MItem
|
||||||
33
|
33
|
||||||
../../../../../lib/cmn/str-incl.c
|
../../../../../lib/cmn/str-fcpy.c
|
||||||
244
|
244
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1097,8 +1097,8 @@ WVList
|
|||||||
0
|
0
|
||||||
247
|
247
|
||||||
MItem
|
MItem
|
||||||
32
|
34
|
||||||
../../../../../lib/cmn/str-len.c
|
../../../../../lib/cmn/str-fnmat.c
|
||||||
248
|
248
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1115,8 +1115,8 @@ WVList
|
|||||||
0
|
0
|
||||||
251
|
251
|
||||||
MItem
|
MItem
|
||||||
32
|
33
|
||||||
../../../../../lib/cmn/str-pac.c
|
../../../../../lib/cmn/str-incl.c
|
||||||
252
|
252
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1133,8 +1133,8 @@ WVList
|
|||||||
0
|
0
|
||||||
255
|
255
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-pbrk.c
|
../../../../../lib/cmn/str-len.c
|
||||||
256
|
256
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1152,7 +1152,7 @@ WVList
|
|||||||
259
|
259
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-put.c
|
../../../../../lib/cmn/str-pac.c
|
||||||
260
|
260
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1169,8 +1169,8 @@ WVList
|
|||||||
0
|
0
|
||||||
263
|
263
|
||||||
MItem
|
MItem
|
||||||
32
|
33
|
||||||
../../../../../lib/cmn/str-rev.c
|
../../../../../lib/cmn/str-pbrk.c
|
||||||
264
|
264
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1188,7 +1188,7 @@ WVList
|
|||||||
267
|
267
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-rot.c
|
../../../../../lib/cmn/str-put.c
|
||||||
268
|
268
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1206,7 +1206,7 @@ WVList
|
|||||||
271
|
271
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-set.c
|
../../../../../lib/cmn/str-rev.c
|
||||||
272
|
272
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1224,7 +1224,7 @@ WVList
|
|||||||
275
|
275
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-spl.c
|
../../../../../lib/cmn/str-rot.c
|
||||||
276
|
276
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1242,7 +1242,7 @@ WVList
|
|||||||
279
|
279
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-spn.c
|
../../../../../lib/cmn/str-set.c
|
||||||
280
|
280
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1260,7 +1260,7 @@ WVList
|
|||||||
283
|
283
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-str.c
|
../../../../../lib/cmn/str-spl.c
|
||||||
284
|
284
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1277,8 +1277,8 @@ WVList
|
|||||||
0
|
0
|
||||||
287
|
287
|
||||||
MItem
|
MItem
|
||||||
34
|
32
|
||||||
../../../../../lib/cmn/str-subst.c
|
../../../../../lib/cmn/str-spn.c
|
||||||
288
|
288
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1296,7 +1296,7 @@ WVList
|
|||||||
291
|
291
|
||||||
MItem
|
MItem
|
||||||
32
|
32
|
||||||
../../../../../lib/cmn/str-tok.c
|
../../../../../lib/cmn/str-str.c
|
||||||
292
|
292
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1313,8 +1313,8 @@ WVList
|
|||||||
0
|
0
|
||||||
295
|
295
|
||||||
MItem
|
MItem
|
||||||
32
|
34
|
||||||
../../../../../lib/cmn/str-trm.c
|
../../../../../lib/cmn/str-subst.c
|
||||||
296
|
296
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1331,8 +1331,8 @@ WVList
|
|||||||
0
|
0
|
||||||
299
|
299
|
||||||
MItem
|
MItem
|
||||||
33
|
32
|
||||||
../../../../../lib/cmn/str-word.c
|
../../../../../lib/cmn/str-tok.c
|
||||||
300
|
300
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1349,8 +1349,8 @@ WVList
|
|||||||
0
|
0
|
||||||
303
|
303
|
||||||
MItem
|
MItem
|
||||||
29
|
32
|
||||||
../../../../../lib/cmn/task.c
|
../../../../../lib/cmn/str-trm.c
|
||||||
304
|
304
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1367,8 +1367,8 @@ WVList
|
|||||||
0
|
0
|
||||||
307
|
307
|
||||||
MItem
|
MItem
|
||||||
29
|
33
|
||||||
../../../../../lib/cmn/time.c
|
../../../../../lib/cmn/str-word.c
|
||||||
308
|
308
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1385,8 +1385,8 @@ WVList
|
|||||||
0
|
0
|
||||||
311
|
311
|
||||||
MItem
|
MItem
|
||||||
28
|
29
|
||||||
../../../../../lib/cmn/tio.c
|
../../../../../lib/cmn/task.c
|
||||||
312
|
312
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1403,8 +1403,8 @@ WVList
|
|||||||
0
|
0
|
||||||
315
|
315
|
||||||
MItem
|
MItem
|
||||||
32
|
29
|
||||||
../../../../../lib/cmn/tre-ast.c
|
../../../../../lib/cmn/time.c
|
||||||
316
|
316
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1421,8 +1421,8 @@ WVList
|
|||||||
0
|
0
|
||||||
319
|
319
|
||||||
MItem
|
MItem
|
||||||
36
|
28
|
||||||
../../../../../lib/cmn/tre-compile.c
|
../../../../../lib/cmn/tio.c
|
||||||
320
|
320
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1439,8 +1439,8 @@ WVList
|
|||||||
0
|
0
|
||||||
323
|
323
|
||||||
MItem
|
MItem
|
||||||
44
|
32
|
||||||
../../../../../lib/cmn/tre-match-backtrack.c
|
../../../../../lib/cmn/tre-ast.c
|
||||||
324
|
324
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1457,8 +1457,8 @@ WVList
|
|||||||
0
|
0
|
||||||
327
|
327
|
||||||
MItem
|
MItem
|
||||||
43
|
36
|
||||||
../../../../../lib/cmn/tre-match-parallel.c
|
../../../../../lib/cmn/tre-compile.c
|
||||||
328
|
328
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1475,8 +1475,8 @@ WVList
|
|||||||
0
|
0
|
||||||
331
|
331
|
||||||
MItem
|
MItem
|
||||||
34
|
44
|
||||||
../../../../../lib/cmn/tre-parse.c
|
../../../../../lib/cmn/tre-match-backtrack.c
|
||||||
332
|
332
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1493,8 +1493,8 @@ WVList
|
|||||||
0
|
0
|
||||||
335
|
335
|
||||||
MItem
|
MItem
|
||||||
34
|
43
|
||||||
../../../../../lib/cmn/tre-stack.c
|
../../../../../lib/cmn/tre-match-parallel.c
|
||||||
336
|
336
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1511,8 +1511,8 @@ WVList
|
|||||||
0
|
0
|
||||||
339
|
339
|
||||||
MItem
|
MItem
|
||||||
28
|
34
|
||||||
../../../../../lib/cmn/tre.c
|
../../../../../lib/cmn/tre-parse.c
|
||||||
340
|
340
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1529,8 +1529,8 @@ WVList
|
|||||||
0
|
0
|
||||||
343
|
343
|
||||||
MItem
|
MItem
|
||||||
29
|
34
|
||||||
../../../../../lib/cmn/utf8.c
|
../../../../../lib/cmn/tre-stack.c
|
||||||
344
|
344
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1548,7 +1548,7 @@ WVList
|
|||||||
347
|
347
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/xma.c
|
../../../../../lib/cmn/tre.c
|
||||||
348
|
348
|
||||||
WString
|
WString
|
||||||
4
|
4
|
||||||
@ -1565,44 +1565,44 @@ WVList
|
|||||||
0
|
0
|
||||||
351
|
351
|
||||||
MItem
|
MItem
|
||||||
3
|
29
|
||||||
*.h
|
../../../../../lib/cmn/utf8.c
|
||||||
352
|
352
|
||||||
WString
|
WString
|
||||||
3
|
4
|
||||||
NIL
|
COBJ
|
||||||
353
|
353
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
354
|
354
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
-1
|
11
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
355
|
355
|
||||||
MItem
|
MItem
|
||||||
28
|
28
|
||||||
../../../../../lib/cmn/mem.h
|
../../../../../lib/cmn/xma.c
|
||||||
356
|
356
|
||||||
WString
|
WString
|
||||||
3
|
4
|
||||||
NIL
|
COBJ
|
||||||
357
|
357
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
358
|
358
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
351
|
11
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
359
|
359
|
||||||
MItem
|
MItem
|
||||||
32
|
3
|
||||||
../../../../../lib/cmn/syscall.h
|
*.h
|
||||||
360
|
360
|
||||||
WString
|
WString
|
||||||
3
|
3
|
||||||
@ -1613,7 +1613,43 @@ WVList
|
|||||||
362
|
362
|
||||||
WVList
|
WVList
|
||||||
0
|
0
|
||||||
351
|
-1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
363
|
||||||
|
MItem
|
||||||
|
28
|
||||||
|
../../../../../lib/cmn/mem.h
|
||||||
|
364
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
NIL
|
||||||
|
365
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
366
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
359
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
367
|
||||||
|
MItem
|
||||||
|
32
|
||||||
|
../../../../../lib/cmn/syscall.h
|
||||||
|
368
|
||||||
|
WString
|
||||||
|
3
|
||||||
|
NIL
|
||||||
|
369
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
370
|
||||||
|
WVList
|
||||||
|
0
|
||||||
|
359
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user