added qse_dir_t.
added qse_mux_t. added dir::xxx() for awk
This commit is contained in:
@ -5,6 +5,7 @@ pkginclude_HEADERS = \
|
||||
chr.h \
|
||||
cp949.h \
|
||||
cp950.h \
|
||||
dir.h \
|
||||
dll.h \
|
||||
env.h \
|
||||
fio.h \
|
||||
@ -21,6 +22,7 @@ pkginclude_HEADERS = \
|
||||
map.h \
|
||||
mbwc.h \
|
||||
mem.h \
|
||||
mux.h \
|
||||
nwad.h \
|
||||
nwif.h \
|
||||
nwio.h \
|
||||
|
@ -52,12 +52,12 @@ CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__pkginclude_HEADERS_DIST = alg.h chr.h cp949.h cp950.h dll.h env.h \
|
||||
fio.h fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h lda.h \
|
||||
main.h map.h mbwc.h mem.h nwad.h nwif.h nwio.h oht.h opt.h \
|
||||
path.h pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h stdio.h \
|
||||
str.h task.h time.h tio.h tre.h uri.h utf8.h xma.h Mmgr.hpp \
|
||||
StdMmgr.hpp Mmged.hpp
|
||||
am__pkginclude_HEADERS_DIST = alg.h chr.h cp949.h cp950.h dir.h dll.h \
|
||||
env.h fio.h fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h \
|
||||
lda.h main.h map.h mbwc.h mem.h mux.h nwad.h nwif.h nwio.h \
|
||||
oht.h opt.h path.h pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h \
|
||||
stdio.h str.h task.h time.h tio.h tre.h uri.h utf8.h xma.h \
|
||||
Mmgr.hpp StdMmgr.hpp Mmged.hpp
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
@ -262,11 +262,12 @@ target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
pkginclude_HEADERS = alg.h chr.h cp949.h cp950.h dll.h env.h fio.h \
|
||||
fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h lda.h main.h \
|
||||
map.h mbwc.h mem.h nwad.h nwif.h nwio.h oht.h opt.h path.h \
|
||||
pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h stdio.h str.h \
|
||||
task.h time.h tio.h tre.h uri.h utf8.h xma.h $(am__append_1)
|
||||
pkginclude_HEADERS = alg.h chr.h cp949.h cp950.h dir.h dll.h env.h \
|
||||
fio.h fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h lda.h \
|
||||
main.h map.h mbwc.h mem.h mux.h nwad.h nwif.h nwio.h oht.h \
|
||||
opt.h path.h pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h \
|
||||
stdio.h str.h task.h time.h tio.h tre.h uri.h utf8.h xma.h \
|
||||
$(am__append_1)
|
||||
all: all-am
|
||||
|
||||
.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
|
||||
);
|
||||
|
||||
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
|
||||
}
|
||||
#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;
|
||||
|
||||
#if defined(_WIN32)
|
||||
typedef qse_intptr_t qse_nwio_hnd_t;
|
||||
typedef qse_uintptr_t qse_nwio_hnd_t;
|
||||
#elif defined(__OS2__)
|
||||
typedef int qse_nwio_hnd_t; /**< defines a pipe handle type */
|
||||
typedef int qse_nwio_hnd_t;
|
||||
#elif defined(__DOS__)
|
||||
typedef int qse_nwio_hnd_t; /**< defines a pipe handle type */
|
||||
typedef int qse_nwio_hnd_t;
|
||||
#else
|
||||
typedef int qse_nwio_hnd_t; /**< defines a pipe handle type */
|
||||
typedef int qse_nwio_hnd_t;
|
||||
#endif
|
||||
|
||||
typedef struct qse_nwio_t qse_nwio_t;
|
||||
|
@ -49,6 +49,17 @@ enum qse_canonpath_flag_t
|
||||
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
|
||||
extern "C" {
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user