added qse_mbsbeg()/qse_wcsbeg()/qse_mbsend()/qse_wcsend() and related functions

This commit is contained in:
hyung-hwan 2011-04-12 08:15:30 +00:00
parent 10901ba0df
commit 610059c023
10 changed files with 565 additions and 328 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: str.h 428 2011-04-08 13:56:28Z hyunghwan.chung $ * $Id: str.h 429 2011-04-11 14:15:30Z hyunghwan.chung $
* *
Copyright 2006-2009 Chung, Hyung-Hwan. Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE. This file is part of QSE.
@ -190,7 +190,7 @@ qse_size_t qse_wcslen (
* The qse_mbsbytes() function returns the number of bytes a null-terminated * The qse_mbsbytes() function returns the number of bytes a null-terminated
* string is holding excluding a terminating null. * string is holding excluding a terminating null.
*/ */
qse_size_t qse_strbytes ( qse_size_t qse_mbsbytes (
const qse_mchar_t* str const qse_mchar_t* str
); );
@ -1127,86 +1127,145 @@ qse_wchar_t* qse_wcsxrchr (
#endif #endif
/** /**
* The qse_strbeg() function checks if the a string begins with a substring. * The qse_mbsbeg() function checks if a string begins with a substring.
* @return the pointer to a beginning of a matching beginning, * @return pointer to the beginning of a matching beginning,
* QSE_NULL if no match is found. * #SE_NULL if no match is found.
*/ */
qse_char_t* qse_strbeg ( qse_mchar_t* qse_mbsbeg (
const qse_char_t* str, const qse_mchar_t* str,
const qse_char_t* sub const qse_mchar_t* sub
); );
qse_char_t* qse_strxbeg ( /**
const qse_char_t* str, * The qse_wcsbeg() function checks if a string begins with a substring.
qse_size_t len, * @return pointer to the beginning of a matching beginning,
const qse_char_t* sub) * #QSE_NULL if no match is found.
;
/*
* The qse_strbeg() function checks if the a string begins with a substring.
* @return @a str on match, QSE_NULL on no match
*/ */
qse_char_t* qse_strnbeg ( qse_wchar_t* qse_wcsbeg (
const qse_char_t* str, const qse_wchar_t* str,
const qse_char_t* sub, const qse_wchar_t* sub
);
qse_mchar_t* qse_mbsxbeg (
const qse_mchar_t* str,
qse_size_t len,
const qse_mchar_t* sub
);
qse_wchar_t* qse_wcsxbeg (
const qse_wchar_t* str,
qse_size_t len,
const qse_wchar_t* sub
);
qse_mchar_t* qse_mbsnbeg (
const qse_mchar_t* str,
const qse_mchar_t* sub,
qse_size_t len qse_size_t len
); );
/* qse_wchar_t* qse_wcsnbeg (
* The qse_strbeg() function checks if the a string begins with a substring. const qse_wchar_t* str,
* @return @a str on match, QSE_NULL on no match const qse_wchar_t* sub,
*/
qse_char_t* qse_strxnbeg (
const qse_char_t* str,
qse_size_t len1,
const qse_char_t* sub,
qse_size_t len2
);
/**
* The qse_strend() function checks if the a string ends with a substring.
* @return the pointer to a beginning of a matching end,
* QSE_NULL if no match is found.
*/
qse_char_t* qse_strend (
const qse_char_t* str, /**< a string */
const qse_char_t* sub /**< a substring */
);
/**
* The qse_strxend function checks if the a string ends with a substring.
* @return the pointer to a beginning of a matching end,
* QSE_NULL if no match is found.
*/
qse_char_t* qse_strxend (
const qse_char_t* str,
qse_size_t len,
const qse_char_t* sub
);
/**
* The qse_strnend() function checks if the a string ends with a substring.
* @return the pointer to a beginning of a matching end,
* QSE_NULL if no match is found.
*/
qse_char_t* qse_strnend (
const qse_char_t* str,
const qse_char_t* sub,
qse_size_t len qse_size_t len
); );
/** qse_mchar_t* qse_mbsxnbeg (
* The qse_strxnend() function checks if the a string ends with a substring. const qse_mchar_t* str,
* @return the pointer to a beginning of a matching end,
* QSE_NULL if no match is found.
*/
qse_char_t* qse_strxnend (
const qse_char_t* str,
qse_size_t len1, qse_size_t len1,
const qse_char_t* sub, const qse_mchar_t* sub,
qse_size_t len2 qse_size_t len2
); );
qse_wchar_t* qse_wcsxnbeg (
const qse_wchar_t* str,
qse_size_t len1,
const qse_wchar_t* sub,
qse_size_t len2
);
#ifdef QSE_CHAR_IS_MCHAR
# define qse_strbeg(str,sub) qse_mbsxbeg(str,sub)
# define qse_strxbeg(str,len,sub) qse_mbsxbeg(str,len,sub)
# define qse_strnbeg(str,sub,len) qse_mbsnbeg(str,sub,len)
# define qse_strxnbeg(str,len1,sub,len2) qse_mbsxnbeg(str,len1,sub,len2)
#else
# define qse_strbeg(str,sub) qse_wcsxbeg(str,sub)
# define qse_strxbeg(str,len,sub) qse_wcsxbeg(str,len,sub)
# define qse_strnbeg(str,sub,len) qse_wcsnbeg(str,sub,len)
# define qse_strxnbeg(str,len1,sub,len2) qse_wcsxnbeg(str,len1,sub,len2)
#endif
/**
* The qse_mbsend() function checks if a string ends with a substring.
* @return pointer to the beginning of a matching ending,
* #SE_NULL if no match is found.
*/
qse_mchar_t* qse_mbsend (
const qse_mchar_t* str,
const qse_mchar_t* sub
);
/**
* The qse_wcsend() function checks if a string ends with a substring.
* @return pointer to the beginning of a matching ending,
* #QSE_NULL if no match is found.
*/
qse_wchar_t* qse_wcsend (
const qse_wchar_t* str,
const qse_wchar_t* sub
);
qse_mchar_t* qse_mbsxend (
const qse_mchar_t* str,
qse_size_t len,
const qse_mchar_t* sub
);
qse_wchar_t* qse_wcsxend (
const qse_wchar_t* str,
qse_size_t len,
const qse_wchar_t* sub
);
qse_mchar_t* qse_mbsnend (
const qse_mchar_t* str,
const qse_mchar_t* sub,
qse_size_t len
);
qse_wchar_t* qse_wcsnend (
const qse_wchar_t* str,
const qse_wchar_t* sub,
qse_size_t len
);
qse_mchar_t* qse_mbsxnend (
const qse_mchar_t* str,
qse_size_t len1,
const qse_mchar_t* sub,
qse_size_t len2
);
qse_wchar_t* qse_wcsxnend (
const qse_wchar_t* str,
qse_size_t len1,
const qse_wchar_t* sub,
qse_size_t len2
);
#ifdef QSE_CHAR_IS_MCHAR
# define qse_strend(str,sub) qse_mbsxend(str,sub)
# define qse_strxend(str,len,sub) qse_mbsxend(str,len,sub)
# define qse_strnend(str,sub,len) qse_mbsnend(str,sub,len)
# define qse_strxnend(str,len1,sub,len2) qse_mbsxnend(str,len1,sub,len2)
#else
# define qse_strend(str,sub) qse_wcsxend(str,sub)
# define qse_strxend(str,len,sub) qse_wcsxend(str,len,sub)
# define qse_strnend(str,sub,len) qse_wcsnend(str,sub,len)
# define qse_strxnend(str,len1,sub,len2) qse_wcsxnend(str,len1,sub,len2)
#endif
qse_size_t qse_mbsspn ( qse_size_t qse_mbsspn (
const qse_mchar_t* str1, const qse_mchar_t* str1,
const qse_mchar_t* str2 const qse_mchar_t* str2

View File

@ -9,9 +9,10 @@ lib_LTLIBRARIES = libqsecmn.la
libqsecmn_la_SOURCES = \ libqsecmn_la_SOURCES = \
syscall.h mem.h \ syscall.h mem.h \
mem.c xma.c fma.c chr.c chr_cnv.c rex.c \ mem.c xma.c fma.c chr.c chr_cnv.c rex.c \
str_bas.c str_cat.c str_chr.c str_cnv.c str_cmp.c str_cpy.c str_dup.c \ str_beg.c str_cat.c str_chr.c str_cnv.c str_cmp.c str_cpy.c \
str_dyn.c str_fcpy.c str_len.c str_pac.c str_pbrk.c str_put.c \ str_dup.c str_dyn.c str_end.c str_fcpy.c str_len.c str_pac.c \
str_spl.c str_spn.c str_str.c str_subst.c str_trm.c str_word.c \ str_pbrk.c str_put.c str_spl.c str_spn.c str_str.c str_subst.c \
str_trm.c str_word.c \
lda.c oht.c htb.c rbt.c sll.c gdl.c dll.c opt.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 \ tio.c tio_get.c tio_put.c \
fio.c pio.c sio.c \ fio.c pio.c sio.c \

View File

@ -73,10 +73,10 @@ am__installdirs = "$(DESTDIR)$(libdir)"
LTLIBRARIES = $(lib_LTLIBRARIES) LTLIBRARIES = $(lib_LTLIBRARIES)
libqsecmn_la_DEPENDENCIES = libqsecmn_la_DEPENDENCIES =
am_libqsecmn_la_OBJECTS = mem.lo xma.lo fma.lo chr.lo chr_cnv.lo \ am_libqsecmn_la_OBJECTS = mem.lo xma.lo fma.lo chr.lo chr_cnv.lo \
rex.lo str_bas.lo str_cat.lo str_chr.lo str_cnv.lo str_cmp.lo \ rex.lo str_beg.lo str_cat.lo str_chr.lo str_cnv.lo str_cmp.lo \
str_cpy.lo str_dup.lo str_dyn.lo str_fcpy.lo str_len.lo str_pac.lo \ str_cpy.lo str_dup.lo str_dyn.lo str_end.lo str_fcpy.lo str_len.lo \
str_pbrk.lo str_put.lo str_spl.lo str_spn.lo str_str.lo str_subst.lo \ str_pac.lo str_pbrk.lo str_put.lo str_spl.lo str_spn.lo str_str.lo \
str_trm.lo str_word.lo lda.lo oht.lo htb.lo rbt.lo sll.lo \ str_subst.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 \ 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 \ pio.lo sio.lo alg_search.lo alg_sort.lo time.lo misc.lo \
assert.lo main.lo stdio.lo assert.lo main.lo stdio.lo
@ -267,9 +267,10 @@ lib_LTLIBRARIES = libqsecmn.la $(am__append_1)
libqsecmn_la_SOURCES = \ libqsecmn_la_SOURCES = \
syscall.h mem.h \ syscall.h mem.h \
mem.c xma.c fma.c chr.c chr_cnv.c rex.c \ mem.c xma.c fma.c chr.c chr_cnv.c rex.c \
str_bas.c str_cat.c str_chr.c str_cnv.c str_cmp.c str_cpy.c str_dup.c \ str_beg.c str_cat.c str_chr.c str_cnv.c str_cmp.c str_cpy.c \
str_dyn.c str_fcpy.c str_len.c str_pac.c str_pbrk.c str_put.c \ str_dup.c str_dyn.c str_end.c str_fcpy.c str_len.c str_pac.c \
str_spl.c str_spn.c str_str.c str_subst.c str_trm.c str_word.c \ str_pbrk.c str_put.c str_spl.c str_spn.c str_str.c str_subst.c \
str_trm.c str_word.c \
lda.c oht.c htb.c rbt.c sll.c gdl.c dll.c opt.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 \ tio.c tio_get.c tio_put.c \
fio.c pio.c sio.c \ fio.c pio.c sio.c \
@ -387,7 +388,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sll.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_bas.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_beg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_cat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_cat.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_chr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_chr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_cmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_cmp.Plo@am__quote@
@ -395,6 +396,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_cpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_cpy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_dup.Plo@am__quote@ @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_dyn.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_end.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_fcpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_fcpy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_len.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_pac.Plo@am__quote@

View File

@ -1,124 +0,0 @@
/*
* $Id: str_bas.c 425 2011-04-03 14:57:23Z hyunghwan.chung $
*
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>
#include <qse/cmn/chr.h>
#include "mem.h"
qse_char_t* qse_strbeg (const qse_char_t* str, const qse_char_t* sub)
{
while (*sub != QSE_T('\0'))
{
if (*str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_char_t*)str;
}
qse_char_t* qse_strxbeg (
const qse_char_t* str, qse_size_t len, const qse_char_t* sub)
{
const qse_char_t* end = str + len;
while (*sub != QSE_T('\0'))
{
if (str >= end || *str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_char_t*)str;
}
qse_char_t* qse_strnbeg (
const qse_char_t* str, const qse_char_t* sub, qse_size_t len)
{
const qse_char_t* end = sub + len;
while (sub < end)
{
if (*str == QSE_T('\0') || *str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_char_t*)str;
}
qse_char_t* qse_strxnbeg (
const qse_char_t* str, qse_size_t len1,
const qse_char_t* sub, qse_size_t len2)
{
const qse_char_t* end1, * end2;
if (len2 > len1) return QSE_NULL;
end1 = str + len1;
end2 = sub + len2;
while (sub < end2)
{
if (str >= end1 || *str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_char_t*)str;
}
qse_char_t* qse_strend (const qse_char_t* str, const qse_char_t* sub)
{
return qse_strxnend (str, qse_strlen(str), sub, qse_strlen(sub));
}
qse_char_t* qse_strxend (
const qse_char_t* str, qse_size_t len, const qse_char_t* sub)
{
return qse_strxnend (str, len, sub, qse_strlen(sub));
}
qse_char_t* qse_strnend (
const qse_char_t* str, const qse_char_t* sub, qse_size_t len)
{
return qse_strxnend (str, qse_strlen(str), sub, len);
}
qse_char_t* qse_strxnend (
const qse_char_t* str, qse_size_t len1,
const qse_char_t* sub, qse_size_t len2)
{
const qse_char_t* end1, * end2;
if (len2 > len1) return QSE_NULL;
end1 = str + len1;
end2 = sub + len2;
while (end2 > sub)
{
if (end1 <= str) return QSE_NULL;
if (*(--end1) != *(--end2)) return QSE_NULL;
}
/* returns the pointer to the match start */
return (qse_char_t*)end1;
}

148
qse/lib/cmn/str_beg.c Normal file
View File

@ -0,0 +1,148 @@
/*
* $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_mchar_t* qse_mbsbeg (const qse_mchar_t* str, const qse_mchar_t* sub)
{
while (*sub != QSE_MT('\0'))
{
if (*str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_mchar_t*)str;
}
qse_mchar_t* qse_mbsxbeg (
const qse_mchar_t* str, qse_size_t len, const qse_mchar_t* sub)
{
const qse_mchar_t* end = str + len;
while (*sub != QSE_MT('\0'))
{
if (str >= end || *str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_mchar_t*)str;
}
qse_mchar_t* qse_mbsnbeg (
const qse_mchar_t* str, const qse_mchar_t* sub, qse_size_t len)
{
const qse_mchar_t* end = sub + len;
while (sub < end)
{
if (*str == QSE_MT('\0') || *str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_mchar_t*)str;
}
qse_mchar_t* qse_mbsxnbeg (
const qse_mchar_t* str, qse_size_t len1,
const qse_mchar_t* sub, qse_size_t len2)
{
const qse_mchar_t* end1, * end2;
if (len2 > len1) return QSE_NULL;
end1 = str + len1;
end2 = sub + len2;
while (sub < end2)
{
if (str >= end1 || *str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_mchar_t*)str;
}
qse_wchar_t* qse_wcsbeg (const qse_wchar_t* str, const qse_wchar_t* sub)
{
while (*sub != QSE_WT('\0'))
{
if (*str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_wchar_t*)str;
}
qse_wchar_t* qse_wcsxbeg (
const qse_wchar_t* str, qse_size_t len, const qse_wchar_t* sub)
{
const qse_wchar_t* end = str + len;
while (*sub != QSE_WT('\0'))
{
if (str >= end || *str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_wchar_t*)str;
}
qse_wchar_t* qse_wcsnbeg (
const qse_wchar_t* str, const qse_wchar_t* sub, qse_size_t len)
{
const qse_wchar_t* end = sub + len;
while (sub < end)
{
if (*str == QSE_WT('\0') || *str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_wchar_t*)str;
}
qse_wchar_t* qse_wcsxnbeg (
const qse_wchar_t* str, qse_size_t len1,
const qse_wchar_t* sub, qse_size_t len2)
{
const qse_wchar_t* end1, * end2;
if (len2 > len1) return QSE_NULL;
end1 = str + len1;
end2 = sub + len2;
while (sub < end2)
{
if (str >= end1 || *str != *sub) return QSE_NULL;
str++; sub++;
}
/* returns the pointer to the next character of the match */
return (qse_wchar_t*)str;
}

97
qse/lib/cmn/str_end.c Normal file
View File

@ -0,0 +1,97 @@
/*
* $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_mchar_t* qse_mbsend (const qse_mchar_t* str, const qse_mchar_t* sub)
{
return qse_mbsxnend (str, qse_mbslen(str), sub, qse_mbslen(sub));
}
qse_mchar_t* qse_mbsxend (
const qse_mchar_t* str, qse_size_t len, const qse_mchar_t* sub)
{
return qse_mbsxnend (str, len, sub, qse_mbslen(sub));
}
qse_mchar_t* qse_mbsnend (
const qse_mchar_t* str, const qse_mchar_t* sub, qse_size_t len)
{
return qse_mbsxnend (str, qse_mbslen(str), sub, len);
}
qse_mchar_t* qse_mbsxnend (
const qse_mchar_t* str, qse_size_t len1,
const qse_mchar_t* sub, qse_size_t len2)
{
const qse_mchar_t* end1, * end2;
if (len2 > len1) return QSE_NULL;
end1 = str + len1;
end2 = sub + len2;
while (end2 > sub)
{
if (end1 <= str) return QSE_NULL;
if (*(--end1) != *(--end2)) return QSE_NULL;
}
/* returns the pointer to the match start */
return (qse_mchar_t*)end1;
}
qse_wchar_t* qse_wcsend (const qse_wchar_t* str, const qse_wchar_t* sub)
{
return qse_wcsxnend (str, qse_wcslen(str), sub, qse_wcslen(sub));
}
qse_wchar_t* qse_wcsxend (
const qse_wchar_t* str, qse_size_t len, const qse_wchar_t* sub)
{
return qse_wcsxnend (str, len, sub, qse_wcslen(sub));
}
qse_wchar_t* qse_wcsnend (
const qse_wchar_t* str, const qse_wchar_t* sub, qse_size_t len)
{
return qse_wcsxnend (str, qse_wcslen(str), sub, len);
}
qse_wchar_t* qse_wcsxnend (
const qse_wchar_t* str, qse_size_t len1,
const qse_wchar_t* sub, qse_size_t len2)
{
const qse_wchar_t* end1, * end2;
if (len2 > len1) return QSE_NULL;
end1 = str + len1;
end2 = sub + len2;
while (end2 > sub)
{
if (end1 <= str) return QSE_NULL;
if (*(--end1) != *(--end2)) return QSE_NULL;
}
/* returns the pointer to the match start */
return (qse_wchar_t*)end1;
}

View File

@ -42,7 +42,7 @@ WVList
0 0
10 10
WPickList WPickList
50 51
11 11
MItem MItem
3 3
@ -476,7 +476,7 @@ WVList
107 107
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_bas.c ..\..\..\..\..\lib\cmn\str_beg.c
108 108
WString WString
4 4
@ -619,8 +619,8 @@ WVList
0 0
139 139
MItem MItem
33 32
..\..\..\..\..\lib\cmn\str_fcpy.c ..\..\..\..\..\lib\cmn\str_end.c
140 140
WString WString
4 4
@ -637,8 +637,8 @@ WVList
0 0
143 143
MItem MItem
32 33
..\..\..\..\..\lib\cmn\str_len.c ..\..\..\..\..\lib\cmn\str_fcpy.c
144 144
WString WString
4 4
@ -656,7 +656,7 @@ WVList
147 147
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_pac.c ..\..\..\..\..\lib\cmn\str_len.c
148 148
WString WString
4 4
@ -673,8 +673,8 @@ WVList
0 0
151 151
MItem MItem
33 32
..\..\..\..\..\lib\cmn\str_pbrk.c ..\..\..\..\..\lib\cmn\str_pac.c
152 152
WString WString
4 4
@ -691,8 +691,8 @@ WVList
0 0
155 155
MItem MItem
32 33
..\..\..\..\..\lib\cmn\str_put.c ..\..\..\..\..\lib\cmn\str_pbrk.c
156 156
WString WString
4 4
@ -710,7 +710,7 @@ WVList
159 159
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_spl.c ..\..\..\..\..\lib\cmn\str_put.c
160 160
WString WString
4 4
@ -728,7 +728,7 @@ WVList
163 163
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_spn.c ..\..\..\..\..\lib\cmn\str_spl.c
164 164
WString WString
4 4
@ -746,7 +746,7 @@ WVList
167 167
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_str.c ..\..\..\..\..\lib\cmn\str_spn.c
168 168
WString WString
4 4
@ -763,8 +763,8 @@ WVList
0 0
171 171
MItem MItem
34 32
..\..\..\..\..\lib\cmn\str_subst.c ..\..\..\..\..\lib\cmn\str_str.c
172 172
WString WString
4 4
@ -781,8 +781,8 @@ WVList
0 0
175 175
MItem MItem
32 34
..\..\..\..\..\lib\cmn\str_trm.c ..\..\..\..\..\lib\cmn\str_subst.c
176 176
WString WString
4 4
@ -799,8 +799,8 @@ WVList
0 0
179 179
MItem MItem
33 32
..\..\..\..\..\lib\cmn\str_word.c ..\..\..\..\..\lib\cmn\str_trm.c
180 180
WString WString
4 4
@ -817,8 +817,8 @@ WVList
0 0
183 183
MItem MItem
29 33
..\..\..\..\..\lib\cmn\time.c ..\..\..\..\..\lib\cmn\str_word.c
184 184
WString WString
4 4
@ -835,8 +835,8 @@ WVList
0 0
187 187
MItem MItem
28 29
..\..\..\..\..\lib\cmn\tio.c ..\..\..\..\..\lib\cmn\time.c
188 188
WString WString
4 4
@ -853,8 +853,8 @@ WVList
0 0
191 191
MItem MItem
32 28
..\..\..\..\..\lib\cmn\tio_get.c ..\..\..\..\..\lib\cmn\tio.c
192 192
WString WString
4 4
@ -872,7 +872,7 @@ WVList
195 195
MItem MItem
32 32
..\..\..\..\..\lib\cmn\tio_put.c ..\..\..\..\..\lib\cmn\tio_get.c
196 196
WString WString
4 4
@ -889,8 +889,8 @@ WVList
0 0
199 199
MItem MItem
28 32
..\..\..\..\..\lib\cmn\xma.c ..\..\..\..\..\lib\cmn\tio_put.c
200 200
WString WString
4 4
@ -907,26 +907,26 @@ WVList
0 0
203 203
MItem MItem
3 28
*.h ..\..\..\..\..\lib\cmn\xma.c
204 204
WString WString
3 4
NIL COBJ
205 205
WVList WVList
0 0
206 206
WVList WVList
0 0
-1 11
1 1
1 1
0 0
207 207
MItem MItem
28 3
..\..\..\..\..\lib\cmn\mem.h *.h
208 208
WString WString
3 3
@ -937,14 +937,14 @@ WVList
210 210
WVList WVList
0 0
203 -1
1 1
1 1
0 0
211 211
MItem MItem
32 28
..\..\..\..\..\lib\cmn\syscall.h ..\..\..\..\..\lib\cmn\mem.h
212 212
WString WString
3 3
@ -955,7 +955,25 @@ WVList
214 214
WVList WVList
0 0
203 207
1
1
0
215
MItem
32
..\..\..\..\..\lib\cmn\syscall.h
216
WString
3
NIL
217
WVList
0
218
WVList
0
207
1 1
1 1
0 0

View File

@ -42,7 +42,7 @@ WVList
0 0
10 10
WPickList WPickList
50 51
11 11
MItem MItem
3 3
@ -476,7 +476,7 @@ WVList
107 107
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_bas.c ..\..\..\..\..\lib\cmn\str_beg.c
108 108
WString WString
4 4
@ -619,8 +619,8 @@ WVList
0 0
139 139
MItem MItem
33 32
..\..\..\..\..\lib\cmn\str_fcpy.c ..\..\..\..\..\lib\cmn\str_end.c
140 140
WString WString
4 4
@ -637,8 +637,8 @@ WVList
0 0
143 143
MItem MItem
32 33
..\..\..\..\..\lib\cmn\str_len.c ..\..\..\..\..\lib\cmn\str_fcpy.c
144 144
WString WString
4 4
@ -656,7 +656,7 @@ WVList
147 147
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_pac.c ..\..\..\..\..\lib\cmn\str_len.c
148 148
WString WString
4 4
@ -673,8 +673,8 @@ WVList
0 0
151 151
MItem MItem
33 32
..\..\..\..\..\lib\cmn\str_pbrk.c ..\..\..\..\..\lib\cmn\str_pac.c
152 152
WString WString
4 4
@ -691,8 +691,8 @@ WVList
0 0
155 155
MItem MItem
32 33
..\..\..\..\..\lib\cmn\str_put.c ..\..\..\..\..\lib\cmn\str_pbrk.c
156 156
WString WString
4 4
@ -710,7 +710,7 @@ WVList
159 159
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_spl.c ..\..\..\..\..\lib\cmn\str_put.c
160 160
WString WString
4 4
@ -728,7 +728,7 @@ WVList
163 163
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_spn.c ..\..\..\..\..\lib\cmn\str_spl.c
164 164
WString WString
4 4
@ -746,7 +746,7 @@ WVList
167 167
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_str.c ..\..\..\..\..\lib\cmn\str_spn.c
168 168
WString WString
4 4
@ -763,8 +763,8 @@ WVList
0 0
171 171
MItem MItem
34 32
..\..\..\..\..\lib\cmn\str_subst.c ..\..\..\..\..\lib\cmn\str_str.c
172 172
WString WString
4 4
@ -781,8 +781,8 @@ WVList
0 0
175 175
MItem MItem
32 34
..\..\..\..\..\lib\cmn\str_trm.c ..\..\..\..\..\lib\cmn\str_subst.c
176 176
WString WString
4 4
@ -799,8 +799,8 @@ WVList
0 0
179 179
MItem MItem
33 32
..\..\..\..\..\lib\cmn\str_word.c ..\..\..\..\..\lib\cmn\str_trm.c
180 180
WString WString
4 4
@ -817,8 +817,8 @@ WVList
0 0
183 183
MItem MItem
29 33
..\..\..\..\..\lib\cmn\time.c ..\..\..\..\..\lib\cmn\str_word.c
184 184
WString WString
4 4
@ -835,8 +835,8 @@ WVList
0 0
187 187
MItem MItem
28 29
..\..\..\..\..\lib\cmn\tio.c ..\..\..\..\..\lib\cmn\time.c
188 188
WString WString
4 4
@ -853,8 +853,8 @@ WVList
0 0
191 191
MItem MItem
32 28
..\..\..\..\..\lib\cmn\tio_get.c ..\..\..\..\..\lib\cmn\tio.c
192 192
WString WString
4 4
@ -872,7 +872,7 @@ WVList
195 195
MItem MItem
32 32
..\..\..\..\..\lib\cmn\tio_put.c ..\..\..\..\..\lib\cmn\tio_get.c
196 196
WString WString
4 4
@ -889,8 +889,8 @@ WVList
0 0
199 199
MItem MItem
28 32
..\..\..\..\..\lib\cmn\xma.c ..\..\..\..\..\lib\cmn\tio_put.c
200 200
WString WString
4 4
@ -907,26 +907,26 @@ WVList
0 0
203 203
MItem MItem
3 28
*.h ..\..\..\..\..\lib\cmn\xma.c
204 204
WString WString
3 4
NIL COBJ
205 205
WVList WVList
0 0
206 206
WVList WVList
0 0
-1 11
1 1
1 1
0 0
207 207
MItem MItem
28 3
..\..\..\..\..\lib\cmn\mem.h *.h
208 208
WString WString
3 3
@ -937,14 +937,14 @@ WVList
210 210
WVList WVList
0 0
203 -1
1 1
1 1
0 0
211 211
MItem MItem
32 28
..\..\..\..\..\lib\cmn\syscall.h ..\..\..\..\..\lib\cmn\mem.h
212 212
WString WString
3 3
@ -955,7 +955,25 @@ WVList
214 214
WVList WVList
0 0
203 207
1
1
0
215
MItem
32
..\..\..\..\..\lib\cmn\syscall.h
216
WString
3
NIL
217
WVList
0
218
WVList
0
207
1 1
1 1
0 0

View File

@ -78,8 +78,8 @@ WRect
WFileName WFileName
30 30
release/os2/lib/cmn/qsecmn.tgt release/os2/lib/cmn/qsecmn.tgt
34 18
40 22
20 20
VComponent VComponent
21 21
@ -142,8 +142,8 @@ WRect
WFileName WFileName
28 28
debug/os2/lib/cmn/qsecmn.tgt debug/os2/lib/cmn/qsecmn.tgt
33 24
40 31
32 32
VComponent VComponent
33 33
@ -206,8 +206,8 @@ WRect
WFileName WFileName
30 30
debug/win32/lib/cmn/qsecmn.tgt debug/win32/lib/cmn/qsecmn.tgt
33 17
38 22
44 44
VComponent VComponent
45 45

View File

@ -42,7 +42,7 @@ WVList
0 0
10 10
WPickList WPickList
50 51
11 11
MItem MItem
3 3
@ -540,7 +540,7 @@ WVList
123 123
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_bas.c ..\..\..\..\..\lib\cmn\str_beg.c
124 124
WString WString
4 4
@ -683,8 +683,8 @@ WVList
0 0
155 155
MItem MItem
33 32
..\..\..\..\..\lib\cmn\str_fcpy.c ..\..\..\..\..\lib\cmn\str_end.c
156 156
WString WString
4 4
@ -701,8 +701,8 @@ WVList
0 0
159 159
MItem MItem
32 33
..\..\..\..\..\lib\cmn\str_len.c ..\..\..\..\..\lib\cmn\str_fcpy.c
160 160
WString WString
4 4
@ -720,7 +720,7 @@ WVList
163 163
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_pac.c ..\..\..\..\..\lib\cmn\str_len.c
164 164
WString WString
4 4
@ -737,8 +737,8 @@ WVList
0 0
167 167
MItem MItem
33 32
..\..\..\..\..\lib\cmn\str_pbrk.c ..\..\..\..\..\lib\cmn\str_pac.c
168 168
WString WString
4 4
@ -755,8 +755,8 @@ WVList
0 0
171 171
MItem MItem
32 33
..\..\..\..\..\lib\cmn\str_put.c ..\..\..\..\..\lib\cmn\str_pbrk.c
172 172
WString WString
4 4
@ -774,7 +774,7 @@ WVList
175 175
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_spl.c ..\..\..\..\..\lib\cmn\str_put.c
176 176
WString WString
4 4
@ -792,7 +792,7 @@ WVList
179 179
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_spn.c ..\..\..\..\..\lib\cmn\str_spl.c
180 180
WString WString
4 4
@ -810,7 +810,7 @@ WVList
183 183
MItem MItem
32 32
..\..\..\..\..\lib\cmn\str_str.c ..\..\..\..\..\lib\cmn\str_spn.c
184 184
WString WString
4 4
@ -827,8 +827,8 @@ WVList
0 0
187 187
MItem MItem
34 32
..\..\..\..\..\lib\cmn\str_subst.c ..\..\..\..\..\lib\cmn\str_str.c
188 188
WString WString
4 4
@ -845,8 +845,8 @@ WVList
0 0
191 191
MItem MItem
32 34
..\..\..\..\..\lib\cmn\str_trm.c ..\..\..\..\..\lib\cmn\str_subst.c
192 192
WString WString
4 4
@ -863,8 +863,8 @@ WVList
0 0
195 195
MItem MItem
33 32
..\..\..\..\..\lib\cmn\str_word.c ..\..\..\..\..\lib\cmn\str_trm.c
196 196
WString WString
4 4
@ -881,8 +881,8 @@ WVList
0 0
199 199
MItem MItem
29 33
..\..\..\..\..\lib\cmn\time.c ..\..\..\..\..\lib\cmn\str_word.c
200 200
WString WString
4 4
@ -899,8 +899,8 @@ WVList
0 0
203 203
MItem MItem
28 29
..\..\..\..\..\lib\cmn\tio.c ..\..\..\..\..\lib\cmn\time.c
204 204
WString WString
4 4
@ -917,8 +917,8 @@ WVList
0 0
207 207
MItem MItem
32 28
..\..\..\..\..\lib\cmn\tio_get.c ..\..\..\..\..\lib\cmn\tio.c
208 208
WString WString
4 4
@ -936,7 +936,7 @@ WVList
211 211
MItem MItem
32 32
..\..\..\..\..\lib\cmn\tio_put.c ..\..\..\..\..\lib\cmn\tio_get.c
212 212
WString WString
4 4
@ -953,8 +953,8 @@ WVList
0 0
215 215
MItem MItem
28 32
..\..\..\..\..\lib\cmn\xma.c ..\..\..\..\..\lib\cmn\tio_put.c
216 216
WString WString
4 4
@ -971,26 +971,26 @@ WVList
0 0
219 219
MItem MItem
3 28
*.h ..\..\..\..\..\lib\cmn\xma.c
220 220
WString WString
3 4
NIL COBJ
221 221
WVList WVList
0 0
222 222
WVList WVList
0 0
-1 11
1 1
1 1
0 0
223 223
MItem MItem
28 3
..\..\..\..\..\lib\cmn\mem.h *.h
224 224
WString WString
3 3
@ -1001,14 +1001,14 @@ WVList
226 226
WVList WVList
0 0
219 -1
1 1
1 1
0 0
227 227
MItem MItem
32 28
..\..\..\..\..\lib\cmn\syscall.h ..\..\..\..\..\lib\cmn\mem.h
228 228
WString WString
3 3
@ -1019,7 +1019,25 @@ WVList
230 230
WVList WVList
0 0
219 223
1
1
0
231
MItem
32
..\..\..\..\..\lib\cmn\syscall.h
232
WString
3
NIL
233
WVList
0
234
WVList
0
223
1 1
1 1
0 0