added qse_mbsincl()/qse_wcsincl()/qse_mbsexcl()/qse_wcsexcl() and related functions

This commit is contained in:
2011-04-17 09:40:57 +00:00
parent bdc537fbdc
commit 212a71460f
8 changed files with 262 additions and 24 deletions

View File

@ -10,9 +10,10 @@ libqsecmn_la_SOURCES = \
syscall.h mem.h \
mem.c xma.c fma.c chr.c chr_cnv.c rex.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_dyn.c str_end.c str_fcpy.c str_len.c str_pac.c \
str_pbrk.c str_put.c str_rev.c str_rot.c str_set.c str_spl.c \
str_spn.c str_str.c str_subst.c str_tok.c str_trm.c str_word.c \
str_del.c str_dup.c str_dyn.c str_end.c str_excl.c str_fcpy.c \
str_incl.c str_len.c str_pac.c str_pbrk.c str_put.c str_rev.c \
str_rot.c str_set.c str_spl.c str_spn.c str_str.c str_subst.c \
str_tok.c str_trm.c str_word.c \
lda.c oht.c htb.c rbt.c sll.c gdl.c dll.c opt.c \
tio.c tio_get.c tio_put.c \
fio.c pio.c sio.c \

View File

@ -74,12 +74,14 @@ LTLIBRARIES = $(lib_LTLIBRARIES)
libqsecmn_la_DEPENDENCIES =
am_libqsecmn_la_OBJECTS = mem.lo xma.lo fma.lo chr.lo chr_cnv.lo \
rex.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_dyn.lo str_end.lo str_fcpy.lo \
str_len.lo str_pac.lo str_pbrk.lo str_put.lo str_rev.lo str_rot.lo \
str_set.lo str_spl.lo str_spn.lo str_str.lo str_subst.lo str_tok.lo \
str_trm.lo str_word.lo lda.lo oht.lo htb.lo rbt.lo sll.lo gdl.lo \
dll.lo opt.lo tio.lo tio_get.lo tio_put.lo fio.lo pio.lo sio.lo \
alg_search.lo alg_sort.lo time.lo misc.lo assert.lo main.lo stdio.lo
str_cpy.lo str_del.lo str_dup.lo str_dyn.lo str_end.lo \
str_excl.lo str_fcpy.lo str_incl.lo str_len.lo str_pac.lo \
str_pbrk.lo str_put.lo str_rev.lo str_rot.lo str_set.lo \
str_spl.lo str_spn.lo str_str.lo str_subst.lo str_tok.lo \
str_trm.lo str_word.lo lda.lo oht.lo htb.lo rbt.lo sll.lo \
gdl.lo dll.lo opt.lo tio.lo tio_get.lo tio_put.lo fio.lo \
pio.lo sio.lo alg_search.lo alg_sort.lo time.lo misc.lo \
assert.lo main.lo stdio.lo
libqsecmn_la_OBJECTS = $(am_libqsecmn_la_OBJECTS)
libqsecmn_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@ -268,9 +270,10 @@ libqsecmn_la_SOURCES = \
syscall.h mem.h \
mem.c xma.c fma.c chr.c chr_cnv.c rex.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_dyn.c str_end.c str_fcpy.c str_len.c str_pac.c \
str_pbrk.c str_put.c str_rev.c str_rot.c str_set.c str_spl.c \
str_spn.c str_str.c str_subst.c str_tok.c str_trm.c str_word.c \
str_del.c str_dup.c str_dyn.c str_end.c str_excl.c str_fcpy.c \
str_incl.c str_len.c str_pac.c str_pbrk.c str_put.c str_rev.c \
str_rot.c str_set.c str_spl.c str_spn.c str_str.c str_subst.c \
str_tok.c str_trm.c str_word.c \
lda.c oht.c htb.c rbt.c sll.c gdl.c dll.c opt.c \
tio.c tio_get.c tio_put.c \
fio.c pio.c sio.c \
@ -398,7 +401,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_dup.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_dyn.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_end.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_excl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_fcpy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_incl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_len.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_pac.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_pbrk.Plo@am__quote@

80
qse/lib/cmn/str_excl.c Normal file
View File

@ -0,0 +1,80 @@
/*
* $Id$
*
Copyright 2006-2009 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/str.h>
qse_size_t qse_mbsexcl (qse_mchar_t* str, const qse_mchar_t* cs)
{
qse_mchar_t* p1, * p2;
p1 = p2 = str;
while (*p1 != QSE_MT('\0'))
{
if (qse_mbschr(cs,*p1) == QSE_NULL) *p2++ = *p1;
p1++;
}
*p2 = QSE_MT('\0');
return p2 - str;
}
qse_size_t qse_mbsxexcl (
qse_mchar_t* str, qse_size_t len, const qse_mchar_t* cs)
{
qse_mchar_t* p1, * p2, * end;
p1 = p2 = str;
end = p1 + len;
while (p1 < end)
{
if (qse_mbschr(cs,*p1) == QSE_NULL) *p2++ = *p1;
p1++;
}
return p2 - str;
}
qse_size_t qse_wcsexcl (qse_wchar_t* str, const qse_wchar_t* cs)
{
qse_wchar_t* p1, * p2;
p1 = p2 = str;
while (*p1 != QSE_WT('\0'))
{
if (qse_wcschr(cs,*p1) == QSE_NULL) *p2++ = *p1;
p1++;
}
*p2 = QSE_WT('\0');
return p2 - str;
}
qse_size_t qse_wcsxexcl (
qse_wchar_t* str, qse_size_t len, const qse_wchar_t* cs)
{
qse_wchar_t* p1, * p2, * end;
p1 = p2 = str;
end = p1 + len;
while (p1 < end)
{
if (qse_wcschr(cs,*p1) == QSE_NULL) *p2++ = *p1;
p1++;
}
return p2 - str;
}

80
qse/lib/cmn/str_incl.c Normal file
View File

@ -0,0 +1,80 @@
/*
* $Id$
*
Copyright 2006-2009 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/str.h>
qse_size_t qse_mbsincl (qse_mchar_t* str, const qse_mchar_t* cs)
{
qse_mchar_t* p1, * p2;
p1 = p2 = str;
while (*p1 != QSE_MT('\0'))
{
if (qse_mbschr(cs,*p1) != QSE_NULL) *p2++ = *p1;
p1++;
}
*p2 = QSE_MT('\0');
return p2 - str;
}
qse_size_t qse_mbsxincl (
qse_mchar_t* str, qse_size_t len, const qse_mchar_t* cs)
{
qse_mchar_t* p1, * p2, * end;
p1 = p2 = str;
end = p1 + len;
while (p1 < end)
{
if (qse_mbschr(cs,*p1) != QSE_NULL) *p2++ = *p1;
p1++;
}
return p2 - str;
}
qse_size_t qse_wcsincl (qse_wchar_t* str, const qse_wchar_t* cs)
{
qse_wchar_t* p1, * p2;
p1 = p2 = str;
while (*p1 != QSE_WT('\0'))
{
if (qse_wcschr(cs,*p1) != QSE_NULL) *p2++ = *p1;
p1++;
}
*p2 = QSE_WT('\0');
return p2 - str;
}
qse_size_t qse_wcsxincl (
qse_wchar_t* str, qse_size_t len, const qse_wchar_t* cs)
{
qse_wchar_t* p1, * p2, * end;
p1 = p2 = str;
end = p1 + len;
while (p1 < end)
{
if (qse_wcschr(cs,*p1) != QSE_NULL) *p2++ = *p1;
p1++;
}
return p2 - str;
}