diff options
48 files changed, 328 insertions, 325 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d89dd32..7ad588f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -201,6 +201,14 @@ * Update type identifiers; * Fix long doulbe type suffixes; +* Remove fmtlen; +* Temporarily disable fmt; +* Temporarily disable opt; +* Update file structure of private headers; +* Use int short instead of short; +* Rename implementation file directory: imp => det; +* Fix *fil functions; + # 0.0.2 * Migrate to CMake; @@ -91,13 +91,13 @@ static_assert(::zp::isusgn<int>::val == ::std::is_unsigned<in static_assert(::zp::isusgn<int long>::val == ::std::is_unsigned<int long>::value); static_assert(::zp::isusgn<double long>::val == ::std::is_unsigned<double long>::value); static_assert(::zp::isusgn<int long long>::val == ::std::is_unsigned<int long long>::value); -static_assert(::zp::isusgn<short>::val == ::std::is_unsigned<short>::value); +static_assert(::zp::isusgn<int short>::val == ::std::is_unsigned<int short>::value); static_assert(::zp::isusgn<char signed>::val == ::std::is_unsigned<char signed>::value); static_assert(::zp::isusgn<char unsigned>::val == ::std::is_unsigned<char unsigned>::value); static_assert(::zp::isusgn<int unsigned>::val == ::std::is_unsigned<int unsigned>::value); static_assert(::zp::isusgn<int long unsigned>::val == ::std::is_unsigned<int long unsigned>::value); static_assert(::zp::isusgn<int long long unsigned>::val == ::std::is_unsigned<int long long unsigned>::value); -static_assert(::zp::isusgn<short unsigned>::val == ::std::is_unsigned<short unsigned>::value); +static_assert(::zp::isusgn<int short unsigned>::val == ::std::is_unsigned<int short unsigned>::value); static_assert(::zp::isusgn<wchar_t>::val == ::std::is_unsigned<wchar_t>::value); static_assert(::zp::issgn<char>::val == ::std::is_signed<char>::value); @@ -107,13 +107,13 @@ static_assert(::zp::issgn<int>::val == ::std::is_signed<int>: static_assert(::zp::issgn<int long>::val == ::std::is_signed<int long>::value); static_assert(::zp::issgn<double long>::val == ::std::is_signed<double long>::value); static_assert(::zp::issgn<int long long>::val == ::std::is_signed<int long long>::value); -static_assert(::zp::issgn<short>::val == ::std::is_signed<short>::value); +static_assert(::zp::issgn<int short>::val == ::std::is_signed<int short>::value); static_assert(::zp::issgn<char signed>::val == ::std::is_signed<char signed>::value); static_assert(::zp::issgn<char unsigned>::val == ::std::is_signed<char unsigned>::value); static_assert(::zp::issgn<int unsigned>::val == ::std::is_signed<int unsigned>::value); static_assert(::zp::issgn<int long unsigned>::val == ::std::is_signed<int long unsigned>::value); static_assert(::zp::issgn<int long long unsigned>::val == ::std::is_signed<int long long unsigned>::value); -static_assert(::zp::issgn<short unsigned>::val == ::std::is_signed<short unsigned>::value); +static_assert(::zp::issgn<int short unsigned>::val == ::std::is_signed<int short unsigned>::value); static_assert(::zp::issgn<wchar_t>::val == ::std::is_signed<wchar_t>::value); static_assert(::zp::bytelen == CHAR_BIT); @@ -129,10 +129,10 @@ static_assert(::zp::minval<int>::val == ::std::numeric_limits static_assert(::zp::minval<int long>::val == ::std::numeric_limits<int long>::lowest()); static_assert(::zp::minval<double long>::val == ::std::numeric_limits<double long>::lowest()); static_assert(::zp::minval<int long long>::val == ::std::numeric_limits<int long long>::lowest()); -static_assert(::zp::minval<short>::val == ::std::numeric_limits<short>::lowest()); +static_assert(::zp::minval<int short>::val == ::std::numeric_limits<int short>::lowest()); static_assert(::zp::minval<char signed>::val == ::std::numeric_limits<char signed>::lowest()); static_assert(::zp::minval<char unsigned>::val == ::std::numeric_limits<char unsigned>::lowest()); -static_assert(::zp::minval<short unsigned>::val == ::std::numeric_limits<short unsigned>::lowest()); +static_assert(::zp::minval<int short unsigned>::val == ::std::numeric_limits<int short unsigned>::lowest()); static_assert(::zp::minval<int unsigned>::val == ::std::numeric_limits<int unsigned>::lowest()); static_assert(::zp::minval<int long unsigned>::val == ::std::numeric_limits<int long unsigned>::lowest()); static_assert(::zp::minval<int long long unsigned>::val == ::std::numeric_limits<int long long unsigned>::lowest()); @@ -149,18 +149,18 @@ static_assert(::zp::maxval<int>::val == ::std::numeric_limits static_assert(::zp::maxval<int long>::val == ::std::numeric_limits<int long>::max()); static_assert(::zp::maxval<double long>::val == ::std::numeric_limits<double long>::max()); static_assert(::zp::maxval<int long long>::val == ::std::numeric_limits<int long long>::max()); -static_assert(::zp::maxval<short>::val == ::std::numeric_limits<short>::max()); +static_assert(::zp::maxval<int short>::val == ::std::numeric_limits<int short>::max()); static_assert(::zp::maxval<char signed>::val == ::std::numeric_limits<char signed>::max()); static_assert(::zp::maxval<char unsigned>::val == ::std::numeric_limits<char unsigned>::max()); -static_assert(::zp::maxval<short unsigned>::val == ::std::numeric_limits<short unsigned>::max()); +static_assert(::zp::maxval<int short unsigned>::val == ::std::numeric_limits<int short unsigned>::max()); static_assert(::zp::maxval<int unsigned>::val == ::std::numeric_limits<int unsigned>::max()); static_assert(::zp::maxval<int long unsigned>::val == ::std::numeric_limits<int long unsigned>::max()); static_assert(::zp::maxval<int long long unsigned>::val == ::std::numeric_limits<int long long unsigned>::max()); static_assert(::zp::maxval<wchar_t>::val == ::std::numeric_limits<wchar_t>::max()); template<typename ltyp,typename rtyp> static auto cmp(int unsigned & numerr,int long const ln,ltyp const & lvalref,rtyp const & rvalref) noexcept { - char const * const ltypnm = typeid (ltyp).name(); - char const * const rtypnm = typeid (rtyp).name(); + char const* const ltypnm = typeid (ltyp).name(); + char const* const rtypnm = typeid (rtyp).name(); auto const getval = [](auto const & valref) { using typ = typename ::zp::remqual<typename ::zp::remref<decltype (valref)>::typ>::typ; @@ -191,13 +191,14 @@ template<typename ltyp,typename rtyp> static auto cmp(int unsigned & numerr,int int main() { int unsigned numerr = 0x0u; - auto const tst = [](char const * const tst) noexcept { + auto const tst = [](char const* const tst) noexcept { ::std::cout <<"\n\x1B[38;5;75mtesting\x1B[0m " << tst <<"\n\n"; }; ::std::cout <<"zp " <<::zp::ver.api <<"." <<::zp::ver.ext <<", run-time test\n"; try { +#if false [&] { tst("optionals"); @@ -205,7 +206,7 @@ int main() { cmp(opt.chk(),false); - auto const fun = [](char const * msg) -> void { + auto const fun = [](char const* msg) -> void { ::std::cout << msg << ::std::endl; ::std::abort(); @@ -216,6 +217,7 @@ int main() { cmp(opt.chk(),true); cmp(opt.exp(fun,"expectation failed"),-0x45); }(); +#endif [&] { tst("special numbers"); diff --git a/zp/GNUmakefile b/zp/GNUmakefile index 2e71b51..fbb4788 100644 --- a/zp/GNUmakefile +++ b/zp/GNUmakefile @@ -38,7 +38,6 @@ OBJ_MTH_ISNAN := source/any/mth/isnan.o #OBJ_MTH_VSUB := source/any/mth/vsub.o OBJ_STR_FMT := source/any/str/fmt.o -OBJ_STR_FMTLEN := source/any/str/fmtlen.o OBJ_STR_STRCPY := source/any/str/strcpy.o OBJ_STR_STREQU := source/any/str/strequ.o OBJ_STR_STRFIL := source/any/str/strfil.o @@ -147,26 +146,27 @@ LIB := libzp.a endif HDRS := \ - include/zp/mem \ - include/zp/mem.h \ - include/zp/mth \ - include/zp/mth.h \ - include/zp/str \ - include/zp/str.h \ - include/zp/zp \ - include/zp/zp.h \ - include/zp/imp/mem.ii \ - include/zp/imp/mth.ii \ - include/zp/imp/str.ii \ - include/zp/imp/zp.ii \ - include/zp/prv/arc.h \ - include/zp/prv/chr.h \ - include/zp/prv/flt.h \ - include/zp/prv/imp.h \ - include/zp/prv/int.h \ - include/zp/prv/std.h \ - include/zp/prv/sys.h \ - include-private/zp/imp/prv.ii + include/zp/mem \ + include/zp/mem.h \ + include/zp/mth \ + include/zp/mth.h \ + include/zp/str \ + include/zp/str.h \ + include/zp/zp \ + include/zp/zp.h \ + include/zp/det/mem.ii \ + include/zp/det/mth.ii \ + include/zp/det/str.ii \ + include/zp/det/zp.ii \ + include/zp/prv/arc.h \ + include/zp/prv/chr.h \ + include/zp/prv/flt.h \ + include/zp/prv/imp.h \ + include/zp/prv/int.h \ + include/zp/prv/std.h \ + include/zp/prv/sys.h \ + include-private/zp/prv/fmt \ + include-private/zp/prv/str CFLAGS := \ -Iinclude \ @@ -232,11 +232,11 @@ endif $(OBJS): $(HDRS) install: $(LIB) - mkdir -pvm755 "$(HDRDIR)/zp/imp" + mkdir -pvm755 "$(HDRDIR)/zp/det" mkdir -pvm755 "$(HDRDIR)/zp/prv" mkdir -pvm755 "$(LIBDIR)" install -vm644 "include/zp/"{"mem","mth","str","zp"}{"",".h"} "$(HDRDIR)/zp" - install -vm644 "include/zp/imp/"{"mem","mth","str","zp"}".ii" "$(HDRDIR)/zp/imp" + install -vm644 "include/zp/det/"{"mem","mth","str","zp"}".ii" "$(HDRDIR)/zp/imp" install -vm644 "include/zp/prv/"{"arc","chr","flt","imp","int","std","sys"}".h" "$(HDRDIR)/zp/prv" install -vm755 "$(LIB)" "$(LIBDIR)" diff --git a/zp/include-private/zp/prv b/zp/include-private/zp/prv deleted file mode 100644 index 03e63e5..0000000 --- a/zp/include-private/zp/prv +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright 2022-2023 Gabriel Jensen. - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. -*/ - -#ifndef zp_prv_cxxhdr_prv -#define zp_prv_cxxhdr_prv - -#include <zp/zp> -#include <zp/prv.h> - -namespace zp { - namespace det { - template<typename typ> zp_nothw ::zp::siz strcpy(typ * dst, typ const * src); - template<typename typ> zp_nothw bool strequ(typ const * lstr,typ const * rsrc); - template<typename typ> zp_nothw ::zp::siz strfil(typ * dst, typ chr); - template<typename typ> zp_nothw ::zp::siz strlen(typ const * str); - template<typename typ> zp_nothw typ * strsrh(typ const * str, typ chr); - } -} - -#include <zp/imp/prv.ii> - -#endif diff --git a/zp/include/zp/imp/str.ii b/zp/include-private/zp/prv/fmt index e8310b8..52a6935 100644 --- a/zp/include/zp/imp/str.ii +++ b/zp/include-private/zp/prv/fmt @@ -4,11 +4,28 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#if false -template<typename sgntyp> constexpr auto zp::fmt(::zp::c02 * buf,sgntyp sgnval,::zp::i8 const bs,bool const rtl) noexcept -> void { +#pragma once + +#include <zp/str> + + + +template<typename typ> zp_nothw ::zp::siz zp::prv::numdig(typ fmtval,::zp::i8 const bs) { + //static_assert(::zp::isinttyp<typ>::val,"type must be an integral type"); + + if (fmtval == typ (0x0)) return 0x1u; + + ::zp::siz len = 0x0u; + + for (typ val = fmtval;val > typ (0x0);val /= static_cast<typ>(bs)) {++len;} + + return len; +} + +template<typename sgntyp> constexpr auto zp::det::fmt(char * buf,sgntyp sgnval,::zp::i8 const bs,bool const rtl) noexcept -> void { using typ = typename ::zp::usgn<sgntyp>::typ; - ::zp::c02 const * digs = U"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + ::zp::c02 const* digs = U"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (bs == 0xCu) digs = U"0123456789\u218A\u218B"; if (sgnval < sgntyp {0x0}) { @@ -28,33 +45,3 @@ template<typename sgntyp> constexpr auto zp::fmt(::zp::c02 * buf,sgntyp sgnval,: for (;val > 0x0u;val /= bs) *buf++ = digs[static_cast< ::zp::siz>(val % static_cast<typ>(bs))]; } -#endif - -#if false -template<typename typ> constexpr auto zp::fmtlen(typ val,::zp::i8 const bs) noexcept -> ::zp::siz { - static_assert(::zp::isinttyp<typ>::val,"type must be an integral type"); - - ::zp::siz len = 0x0u; - - if (val < typ {0x0}) { - val = typ {0x0}-val; - len = 0x1u; - } - - len += ::zp::prv::numdig(val,bs); - - return len; -} -#endif - -template<typename typ> zp_nothw ::zp::siz zp::prv::numdig(typ fmtval,::zp::i8 const bs) { - //static_assert(::zp::isinttyp<typ>::val,"type must be an integral type"); - - if (fmtval == typ (0x0)) return 0x1u; - - ::zp::siz len = 0x0u; - - for (typ val = fmtval;val > typ (0x0);val /= static_cast<typ>(bs)) {++len;} - - return len; -} diff --git a/zp/include-private/zp/imp/prv.ii b/zp/include-private/zp/prv/str index a91db49..fee12e5 100644 --- a/zp/include-private/zp/imp/prv.ii +++ b/zp/include-private/zp/prv/str @@ -4,7 +4,21 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -template<typename typ> zp_nothw ::zp::siz zp::det::strcpy(typ * dst,typ const * src) { +#pragma once + +#include <zp/str> + +namespace zp { + namespace det { + template<typename typ> zp_nothw ::zp::siz strcpy(typ * dst, typ const* src); + template<typename typ> zp_nothw bool strequ(typ const* lstr,typ const* rsrc); + template<typename typ> zp_nothw ::zp::siz strfil(typ * dst, typ chr); + template<typename typ> zp_nothw ::zp::siz strlen(typ const* str); + template<typename typ> zp_nothw typ * strsrh(typ const* str, typ chr); + } +} + +template<typename typ> zp_nothw ::zp::siz zp::det::strcpy(typ * dst,typ const* src) { //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); typ * const dstsrt = dst; @@ -14,7 +28,7 @@ template<typename typ> zp_nothw ::zp::siz zp::det::strcpy(typ * dst,typ const * return static_cast< ::zp::siz>(dst-dstsrt); /* Number of values copied. */ } -template<typename typ> zp_nothw bool zp::det::strequ(typ const * lstr,typ const * rstr) { +template<typename typ> zp_nothw bool zp::det::strequ(typ const* lstr,typ const* rstr) { //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); for (;;++lstr,++rstr) { @@ -35,17 +49,17 @@ template<typename typ> zp_nothw ::zp::siz zp::det::strfil(typ * str,typ const ch return static_cast< ::zp::siz>(str-srt)-0x1u; } -template<typename typ> zp_nothw ::zp::siz zp::det::strlen(typ const * str) { +template<typename typ> zp_nothw ::zp::siz zp::det::strlen(typ const* str) { //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); /* If the string format uses multiple values per character, the number of these values is returned (use utfXdeclen if the number of characters is needed). */ - typ const * const srt = str; + typ const* const srt = str; while (*str++ != typ (0x0)) {} return static_cast< ::zp::siz>(str-srt)-0x1u; } -template<typename typ> zp_nothw typ * zp::det::strsrh(typ const * str,typ const chr) { +template<typename typ> zp_nothw typ * zp::det::strsrh(typ const* str,typ const chr) { //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); for (;;++str) { diff --git a/zp/include/zp/imp/mem.ii b/zp/include/zp/det/mem.ii index 8c439e8..11c6aab 100644 --- a/zp/include/zp/imp/mem.ii +++ b/zp/include/zp/det/mem.ii @@ -4,6 +4,17 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ +template<typename dsttyp,typename srctyp> zp_nothw inline ::zp::cpyres<dsttyp,srctyp> zp::memcpy(dsttyp * dst,srctyp const* src,::zp::siz const num) { + ::zp_cpyres const cpyres = ::zp_memcpy(dst,src,num); + + ::zp::cpyres<dsttyp,srctyp> res = { + static_cast<dsttyp *>(cpyres.dst), + static_cast<srctyp *>(cpyres.src), + }; + + return res; +} + #if zp_std_cxx11 template<typename ltyp,typename rtyp> constexpr auto zp::cpy(ltyp * dst,rtyp * src,::zp::siz const num) noexcept -> ::zp::cpyres<ltyp,rtyp> { ltyp * const stp = dst+num; @@ -11,11 +22,9 @@ template<typename ltyp,typename rtyp> constexpr auto zp::cpy(ltyp * dst,rtyp * s return ::zp::cpyres<ltyp,rtyp> {dst,src,}; } -#endif -#if zp_std_cxx11 template<typename ltyp,typename rtyp> constexpr auto zp::equ(ltyp * lbuf,rtyp * rbuf,::zp::siz const num) noexcept -> bool { - ltyp const * const stp = lbuf+num; + ltyp const* const stp = lbuf+num; while (lbuf != stp) { zp_lik (*lbuf++ != *rbuf++) {return false;} @@ -23,29 +32,14 @@ template<typename ltyp,typename rtyp> constexpr auto zp::equ(ltyp * lbuf,rtyp * return true; } -#endif -#if zp_std_cxx11 template<typename buftyp,typename valtyp> constexpr auto zp::fil(buftyp * buf,valtyp & val,::zp::siz const num) noexcept -> buftyp * { buftyp * const stp = buf+num; while (buf != stp) {*buf++ = val;} return stp; } -#endif - -template<typename dsttyp,typename srctyp> zp_nothw inline ::zp::cpyres<dsttyp,srctyp> zp::memcpy(dsttyp * dst,srctyp const * src,::zp::siz const num) { - ::zp_cpyres const cpyres = ::zp_memcpy(dst,src,num); - ::zp::cpyres<dsttyp,srctyp> res = { - static_cast<dsttyp *>(cpyres.dst), - static_cast<srctyp *>(cpyres.src), - }; - - return res; -} - -#if zp_std_cxx11 template<typename buftyp,typename valtyp> constexpr auto zp::srh(buftyp * buf,valtyp & val,::zp::siz const num) noexcept -> buftyp * { buftyp * const stp = buf+num; diff --git a/zp/include/zp/imp/mth.ii b/zp/include/zp/det/mth.ii index 255c285..255c285 100644 --- a/zp/include/zp/imp/mth.ii +++ b/zp/include/zp/det/mth.ii diff --git a/zp/include-private/zp/prv.h b/zp/include/zp/det/str.ii index 2d25dc0..255c285 100644 --- a/zp/include-private/zp/prv.h +++ b/zp/include/zp/det/str.ii @@ -3,14 +3,3 @@ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ - -#ifndef zp_prv_hdr_prv -#define zp_prv_hdr_prv - -#include <zp/zp.h> - -zp_prv_cdecl - -zp_prv_cdeclend - -#endif diff --git a/zp/include/zp/imp/zp.ii b/zp/include/zp/det/zp.ii index f49d346..ddc34e8 100644 --- a/zp/include/zp/imp/zp.ii +++ b/zp/include/zp/det/zp.ii @@ -17,6 +17,7 @@ constexpr auto ::zp::iscstevl() noexcept -> bool { } #endif +#if false #if zp_std_cxx11 template<typename typ> constexpr ::zp::opt<typ>::opt(::zp::det::nulopt) noexcept : hasval(false),valval(typ {}) { } @@ -45,3 +46,4 @@ template<typename typ> constexpr auto ::zp::opt<typ>::operator = (typ const & va return *this; } #endif +#endif // false diff --git a/zp/include/zp/mem b/zp/include/zp/mem index 3f63fda..57deaa3 100644 --- a/zp/include/zp/mem +++ b/zp/include/zp/mem @@ -16,11 +16,11 @@ namespace zp { srctyp * src; }; - template<typename dsttyp,typename srctyp> zp_iln zp_nothw inline ::zp::cpyres<dsttyp,srctyp> memcpy(dsttyp * dst, srctyp const * src, ::zp::siz const num); - template<typename ltyp, typename rtyp> zp_useres zp_iln zp_nothw inline bool memequ(ltyp const * lbuf,rtyp const * rbuf,::zp::siz const num) {return ::zp_memequ(lbuf,rbuf,num);} + template<typename dsttyp,typename srctyp> zp_iln zp_nothw inline ::zp::cpyres<dsttyp,srctyp> memcpy(dsttyp * dst, srctyp const* src, ::zp::siz const num); + template<typename ltyp, typename rtyp> zp_useres zp_iln zp_nothw inline bool memequ(ltyp const* lbuf,rtyp const* rbuf,::zp::siz const num) {return ::zp_memequ(lbuf,rbuf,num);} template<typename typ> zp_iln zp_nothw inline typ * memfil(typ * dst, char unsigned val, ::zp::siz const num) {return static_cast<typ *>(::zp_memfil(dst,val,num));} template<typename typ> zp_useres zp_nothw zp_iln inline typ * memsrh(typ * buf, char unsigned val, ::zp::siz const num) {return static_cast<typ *>(::zp_memsrh(buf,val,num));} - template<typename typ> zp_useres zp_nothw zp_iln inline typ const * memsrh(typ const * buf, char unsigned val, ::zp::siz const num) {return const_cast<typ const *>(static_cast<typ *>(::zp_memsrh(buf,val,num)));} + template<typename typ> zp_useres zp_nothw zp_iln inline typ const* memsrh(typ const* buf, char unsigned val, ::zp::siz const num) {return const_cast<typ const*>(static_cast<typ *>(::zp_memsrh(buf,val,num)));} #if zp_std_cxx11 template<typename ltyp, typename rtyp> constexpr auto cpy(ltyp * dst, rtyp * src, ::zp::siz num) noexcept -> ::zp::cpyres<ltyp,rtyp>; @@ -30,6 +30,6 @@ namespace zp { #endif } -#include <zp/imp/mem.ii> +#include <zp/det/mem.ii> #endif diff --git a/zp/include/zp/mem.h b/zp/include/zp/mem.h index 36de020..84a2801 100644 --- a/zp/include/zp/mem.h +++ b/zp/include/zp/mem.h @@ -16,10 +16,10 @@ typedef struct { void * src; } zp_cpyres; -zp_nothw zp_cpyres zp_memcpy(void * dst, void const * src, zp_siz num); -zp_nothw zp_useres bool zp_memequ(void const * lbuf,void const * rbuf,zp_siz num); +zp_nothw zp_cpyres zp_memcpy(void * dst, void const* src, zp_siz num); +zp_nothw zp_useres bool zp_memequ(void const* lbuf,void const* rbuf,zp_siz num); zp_nothw void * zp_memfil(void * dst, char unsigned val, zp_siz num); -zp_nothw zp_useres void * zp_memsrh(void const * buf, char unsigned val, zp_siz num); +zp_nothw zp_useres void * zp_memsrh(void const* buf, char unsigned val, zp_siz num); zp_prv_cdeclend diff --git a/zp/include/zp/prv/chr.h b/zp/include/zp/prv/chr.h index acac733..7bece29 100644 --- a/zp/include/zp/prv/chr.h +++ b/zp/include/zp/prv/chr.h @@ -47,9 +47,9 @@ #if \ zp_sys_dos -#define zp_minvalw ((zp_wchr)+zp_minvalsu) -#define zp_maxvalw ((zp_wchr)+zp_maxvalsu) -typedef short unsigned zp_prv_wchr; +#define zp_minvalw ((zp_wchr)+zp_minvalisu) +#define zp_maxvalw ((zp_wchr)+zp_maxvalisu) +typedef int short unsigned zp_prv_wchr; #else #if zp_uchr diff --git a/zp/include/zp/prv/int.h b/zp/include/zp/prv/int.h index b760167..6d1f55a 100644 --- a/zp/include/zp/prv/int.h +++ b/zp/include/zp/prv/int.h @@ -43,21 +43,21 @@ */ #define zp_minvalcu ((char unsigned) +0x0u) -#define zp_minvalsu ((short unsigned) +0x0u) +#define zp_minvalisu ((int short unsigned) +0x0u) #define zp_minvaliu ((int unsigned) +0x0u) #define zp_minvalilu ((int long unsigned) +0x0lu) #define zp_minvalillu ((int long long unsigned)+0x0llu) #define zp_minvalcs ((char signed) -0x80) -#define zp_minvals ((short) -0x8000) +#define zp_minvalis ((int short) -0x8000) #define zp_minvali ((int) -0x80000000l) #define zp_minvalill ((int long long) -0x8000000000000000ll) #define zp_maxvalcu ((char unsigned) +0xFFu) -#define zp_maxvalsu ((short unsigned) +0xFFFFu) +#define zp_maxvalisu ((int short unsigned) +0xFFFFu) #define zp_maxvaliu ((int unsigned) +0xFFFFFFFFu) #define zp_maxvalillu ((int long long unsigned)+0xFFFFFFFFFFFFFFFFllu) #define zp_maxvalcs ((char signed) +0x7F) -#define zp_maxvals ((short) +0x7FFF) +#define zp_maxvalis ((int short) +0x7FFF) #define zp_maxvali ((int) +0x7FFFFFFF) #define zp_maxvalill ((int long long) +0x7FFFFFFFFFFFFFFFll) @@ -70,13 +70,17 @@ #define zp_maxvali8s zp_maxvalcs typedef char unsigned zp_i8; typedef char signed zp_i8s; - -#define zp_minvali01 zp_minvalsu -#define zp_minvali01s zp_minvals -#define zp_maxvali01 zp_maxvalsu -#define zp_maxvali01s zp_maxvals -typedef short unsigned zp_i01; -typedef short zp_i01s; +#define zp_fmti8 zp_fmtcu +#define zp_fmti8s zp_fmtcs + +#define zp_minvali01 zp_minvalisu +#define zp_minvali01s zp_minvalis +#define zp_maxvali01 zp_maxvalisu +#define zp_maxvali01s zp_maxvalis +typedef int short unsigned zp_i01; +typedef int short zp_i01s; +#define zp_fmti8 zp_fmtcu +#define zp_fmti8s zp_fmtcs #if \ zp_arc_arm diff --git a/zp/include/zp/str b/zp/include/zp/str index d04350e..b062e3d 100644 --- a/zp/include/zp/str +++ b/zp/include/zp/str @@ -15,44 +15,44 @@ namespace zp { template<typename typ> zp_nothw zp_useres ::zp::siz numdig(typ val,::zp::i8 bs); } - zp_iln zp_nothw inline ::zp::siz strcpy(char * dst, char const * src) {return ::zp_strcpy(dst,src);} - zp_iln zp_nothw zp_useres inline bool strequ(char const * lstr,char const * rstr) {return ::zp_strequ(lstr,rstr);} - zp_iln zp_nothw zp_useres inline ::zp::siz strfil(char * str,char chr) {return ::zp_strfil(str,chr);} - zp_iln zp_nothw inline ::zp::siz strlen(char const * str) {return ::zp_strlen(str);} - zp_iln zp_nothw zp_useres inline char * strsrh(char * str, char chr) {return ::zp_strsrh(str,chr);} - zp_iln zp_nothw zp_useres inline char const * strsrh(char const * str, char chr) {return const_cast<char const *>(::zp_strsrh(str,chr));} - - zp_iln zp_nothw inline ::zp::siz wstrcpy(wchar_t * dst, wchar_t const * src) {return ::zp_wstrcpy(dst,src);} - zp_iln zp_nothw zp_useres inline bool wstrequ(wchar_t const * lstr,wchar_t const * rstr) {return ::zp_wstrequ(lstr,rstr);} - zp_iln zp_nothw zp_useres inline ::zp::siz wstrfil(wchar_t * str,wchar_t chr) {return ::zp_wstrfil(str,chr);} - zp_iln zp_nothw inline ::zp::siz wstrlen(wchar_t const * str) {return ::zp_wstrlen(str);} - zp_iln zp_nothw zp_useres inline wchar_t * wstrsrh(wchar_t * str, wchar_t chr) {return ::zp_wstrsrh(str,chr);} - zp_iln zp_nothw zp_useres inline wchar_t const * wstrsrh(wchar_t const * str, wchar_t chr) {return const_cast<wchar_t const *>(::zp_wstrsrh(str,chr));} - - zp_iln zp_nothw inline ::zp::siz utf32cpy(::zp::c02 * dst, ::zp::c02 const * src) {return ::zp_utf32cpy(dst,src);} - zp_iln zp_nothw zp_useres inline bool utf32equ(::zp::c02 const * lstr,::zp::c02 const * rstr) {return ::zp_utf32equ(lstr,rstr);} - zp_iln zp_nothw zp_useres inline ::zp::siz utf32fil(::zp::c02 * str, ::zp::c02 chr) {return ::zp_utf32fil(str,chr);} - zp_iln zp_nothw inline ::zp::siz utf32len(::zp::c02 const * str) {return ::zp_utf32len(str);} - zp_iln zp_nothw zp_useres inline ::zp::c02 * utf32srh(::zp::c02 * str, ::zp::c02 chr) {return ::zp_utf32srh(str,chr);} - zp_iln zp_nothw zp_useres inline ::zp::c02 const * utf32srh(::zp::c02 const * str, ::zp::c02 chr) {return const_cast< ::zp::c02 const *>(::zp_utf32srh(str,chr));} - - zp_iln zp_nothw zp_useres inline ::zp::siz utf8enclen( ::zp::c02 const * str) {return ::zp_utf8enclen(str);} - zp_iln zp_nothw zp_useres inline ::zp::siz utf8declen( ::zp::c8 const * str) {return ::zp_utf8declen(str);} - zp_iln zp_nothw zp_useres inline ::zp::siz utf16enclen(::zp::c02 const * str) {return ::zp_utf16enclen(str);} - zp_iln zp_nothw zp_useres inline ::zp::siz utf16declen(::zp::c01 const * str) {return ::zp_utf16declen(str);} - - zp_iln zp_nothw inline void utf8enc( ::zp::c8 * dst,::zp::c02 const * src) {return ::zp_utf8enc(dst,src);} - zp_iln zp_nothw inline void utf8dec( ::zp::c02 * dst,::zp::c8 const * src) {return ::zp_utf8dec(dst,src);} - zp_iln zp_nothw inline void utf16enc( ::zp::c01 * dst,::zp::c02 const * src) {return ::zp_utf16enc(dst,src);} - zp_iln zp_nothw inline void utf16dec( ::zp::c02 * dst,::zp::c01 const * src) {return ::zp_utf16dec(dst,src);} - zp_iln zp_nothw inline void win1252enc(::zp::c8 * dst,::zp::c02 const * src) {return ::zp_win1252enc(dst,src);} - zp_iln zp_nothw inline void win1252dec(::zp::c02 * dst,::zp::c8 const * src) {return ::zp_win1252dec(dst,src);} + zp_iln zp_nothw inline ::zp::siz strcpy(char * dst, char const* src) {return ::zp_strcpy(dst,src);} + zp_iln zp_nothw zp_useres inline bool strequ(char const* lstr,char const* rstr) {return ::zp_strequ(lstr,rstr);} + zp_iln zp_nothw zp_useres inline ::zp::siz strfil(char * str,char chr) {return ::zp_strfil(str,chr);} + zp_iln zp_nothw inline ::zp::siz strlen(char const* str) {return ::zp_strlen(str);} + zp_iln zp_nothw zp_useres inline char * strsrh(char * str, char chr) {return ::zp_strsrh(str,chr);} + zp_iln zp_nothw zp_useres inline char const* strsrh(char const* str, char chr) {return const_cast<char const*>(::zp_strsrh(str,chr));} + + zp_iln zp_nothw inline ::zp::siz wstrcpy(wchar_t * dst, wchar_t const* src) {return ::zp_wstrcpy(dst,src);} + zp_iln zp_nothw zp_useres inline bool wstrequ(wchar_t const* lstr,wchar_t const* rstr) {return ::zp_wstrequ(lstr,rstr);} + zp_iln zp_nothw zp_useres inline ::zp::siz wstrfil(wchar_t * str,wchar_t chr) {return ::zp_wstrfil(str,chr);} + zp_iln zp_nothw inline ::zp::siz wstrlen(wchar_t const* str) {return ::zp_wstrlen(str);} + zp_iln zp_nothw zp_useres inline wchar_t * wstrsrh(wchar_t * str, wchar_t chr) {return ::zp_wstrsrh(str,chr);} + zp_iln zp_nothw zp_useres inline wchar_t const* wstrsrh(wchar_t const* str, wchar_t chr) {return const_cast<wchar_t const*>(::zp_wstrsrh(str,chr));} + + zp_iln zp_nothw inline ::zp::siz utf32cpy(::zp::c02 * dst, ::zp::c02 const* src) {return ::zp_utf32cpy(dst,src);} + zp_iln zp_nothw zp_useres inline bool utf32equ(::zp::c02 const* lstr,::zp::c02 const* rstr) {return ::zp_utf32equ(lstr,rstr);} + zp_iln zp_nothw zp_useres inline ::zp::siz utf32fil(::zp::c02 * str, ::zp::c02 chr) {return ::zp_utf32fil(str,chr);} + zp_iln zp_nothw inline ::zp::siz utf32len(::zp::c02 const* str) {return ::zp_utf32len(str);} + zp_iln zp_nothw zp_useres inline ::zp::c02 * utf32srh(::zp::c02 str, ::zp::c02 chr) {return ::zp_utf32srh(str,chr);} + zp_iln zp_nothw zp_useres inline ::zp::c02 const* utf32srh(::zp::c02 const* str, ::zp::c02 chr) {return const_cast< ::zp::c02 const*>(::zp_utf32srh(str,chr));} + + zp_iln zp_nothw zp_useres inline ::zp::siz utf8enclen( ::zp::c02 const* str) {return ::zp_utf8enclen(str);} + zp_iln zp_nothw zp_useres inline ::zp::siz utf8declen( ::zp::c8 const* str) {return ::zp_utf8declen(str);} + zp_iln zp_nothw zp_useres inline ::zp::siz utf16enclen(::zp::c02 const* str) {return ::zp_utf16enclen(str);} + zp_iln zp_nothw zp_useres inline ::zp::siz utf16declen(::zp::c01 const* str) {return ::zp_utf16declen(str);} + + zp_iln zp_nothw inline void utf8enc( ::zp::c8 * dst,::zp::c02 const* src) {return ::zp_utf8enc(dst,src);} + zp_iln zp_nothw inline void utf8dec( ::zp::c02 * dst,::zp::c8 const* src) {return ::zp_utf8dec(dst,src);} + zp_iln zp_nothw inline void utf16enc( ::zp::c01 * dst,::zp::c02 const* src) {return ::zp_utf16enc(dst,src);} + zp_iln zp_nothw inline void utf16dec( ::zp::c02 * dst,::zp::c01 const* src) {return ::zp_utf16dec(dst,src);} + zp_iln zp_nothw inline void win1252enc(::zp::c8 * dst,::zp::c02 const* src) {return ::zp_win1252enc(dst,src);} + zp_iln zp_nothw inline void win1252dec(::zp::c02 * dst,::zp::c8 const* src) {return ::zp_win1252dec(dst,src);} //template<typename typ> zp_nothw zp_useres ::zp::siz fmtlen(typ val,::zp::i8 bs); /* Including (potential) decorations. */ //template<typename typ> zp_nothw void fmt(::zp::c02 * buf,typ val,::zp::i8 bs,bool rtl = false); } -#include <zp/imp/str.ii> +#include <zp/det/str.ii> #endif diff --git a/zp/include/zp/str.h b/zp/include/zp/str.h index c204298..10a6aff 100644 --- a/zp/include/zp/str.h +++ b/zp/include/zp/str.h @@ -11,61 +11,93 @@ zp_prv_cdecl -zp_nothw zp_siz zp_strcpy(char * dst, char const * src); -zp_nothw zp_useres bool zp_strequ(char const * lstr,char const * rstr); +zp_nothw zp_siz zp_strcpy(char * dst, char const* src); +zp_nothw zp_useres bool zp_strequ(char const* lstr,char const* rstr); zp_nothw zp_siz zp_strfil(char * str, char chr); -zp_nothw zp_siz zp_strlen(char const * str); -zp_nothw char * zp_strsrh(char const * str, char chr); +zp_nothw zp_siz zp_strlen(char const* str); +zp_nothw char * zp_strsrh(char const* str, char chr); -zp_nothw zp_siz zp_wstrcpy(zp_wchr * dst, zp_wchr const * src); -zp_nothw zp_useres bool zp_wstrequ(zp_wchr const * lstr,zp_wchr const * rstr); +zp_nothw zp_siz zp_wstrcpy(zp_wchr * dst, zp_wchr const* src); +zp_nothw zp_useres bool zp_wstrequ(zp_wchr const* lstr,zp_wchr const* rstr); zp_nothw zp_siz zp_wstrfil(zp_wchr * str, zp_wchr chr); -zp_nothw zp_siz zp_wstrlen(zp_wchr const * str); -zp_nothw zp_wchr * zp_wstrsrh(zp_wchr const * str, zp_wchr chr); +zp_nothw zp_siz zp_wstrlen(zp_wchr const* str); +zp_nothw zp_wchr * zp_wstrsrh(zp_wchr const* str, zp_wchr chr); -zp_nothw zp_siz zp_utf32cpy(zp_c02 * dst, zp_c02 const * src); -zp_nothw zp_useres bool zp_utf32equ(zp_c02 const * lstr,zp_c02 const * rstr); +zp_nothw zp_siz zp_utf32cpy(zp_c02 * dst, zp_c02 const* src); +zp_nothw zp_useres bool zp_utf32equ(zp_c02 const* lstr,zp_c02 const* rstr); zp_nothw zp_siz zp_utf32fil(zp_c02 * str, zp_c02 chr); -zp_nothw zp_siz zp_utf32len(zp_c02 const * str); -zp_nothw zp_c02 * zp_utf32srh(zp_c02 const * str, zp_c02 chr); - -zp_nothw zp_useres zp_siz zp_utf8enclen( zp_c02 const * str); -zp_nothw zp_useres zp_siz zp_utf8declen( zp_c8 const * str); -zp_nothw zp_useres zp_siz zp_utf16enclen(zp_c02 const * str); -zp_nothw zp_useres zp_siz zp_utf16declen(zp_c01 const * str); - -zp_nothw void zp_utf8enc( zp_c8 * dst,zp_c02 const * src); -zp_nothw void zp_utf8dec( zp_c02 * dst,zp_c8 const * src); -zp_nothw void zp_utf16enc( zp_c01 * dst,zp_c02 const * src); -zp_nothw void zp_utf16dec( zp_c02 * dst,zp_c01 const * src); -zp_nothw void zp_win1252enc(zp_c8 * dst,zp_c02 const * src); -zp_nothw void zp_win1252dec(zp_c02 * dst,zp_c8 const * src); - -zp_nothw zp_useres zp_siz zp_fmtleni( int val,zp_i8 bs); -zp_nothw zp_useres zp_siz zp_fmtlenl( int long val,zp_i8 bs); -zp_nothw zp_useres zp_siz zp_fmtlens( short val,zp_i8 bs); -zp_nothw zp_useres zp_siz zp_fmtlensc( char signed val,zp_i8 bs); -zp_nothw zp_useres zp_siz zp_fmtlenuc( char unsigned val,zp_i8 bs); -zp_nothw zp_useres zp_siz zp_fmtlenui( int unsigned val,zp_i8 bs); -zp_nothw zp_useres zp_siz zp_fmtlenul( int long unsigned val,zp_i8 bs); -zp_nothw zp_useres zp_siz zp_fmtlenus( short unsigned val,zp_i8 bs); -#if zp_std_c99 || zp_std_cxx11 -zp_nothw zp_useres zp_siz zp_fmtlenll( int long long val,zp_i8 bs); -zp_nothw zp_useres zp_siz zp_fmtlenull(int long long unsigned val,zp_i8 bs); -#endif +zp_nothw zp_siz zp_utf32len(zp_c02 const* str); +zp_nothw zp_c02 * zp_utf32srh(zp_c02 const* str, zp_c02 chr); -zp_nothw void zp_fmti( zp_c02 * buf,int val,zp_i8 bs,bool rtl); -zp_nothw void zp_fmtl( zp_c02 * buf,int long val,zp_i8 bs,bool rtl); -zp_nothw void zp_fmts( zp_c02 * buf,short val,zp_i8 bs,bool rtl); -zp_nothw void zp_fmtsc( zp_c02 * buf,char signed val,zp_i8 bs,bool rtl); -zp_nothw void zp_fmtuc( zp_c02 * buf,char unsigned val,zp_i8 bs,bool rtl); -zp_nothw void zp_fmtui( zp_c02 * buf,int unsigned val,zp_i8 bs,bool rtl); -zp_nothw void zp_fmtul( zp_c02 * buf,int long unsigned val,zp_i8 bs,bool rtl); -zp_nothw void zp_fmtus( zp_c02 * buf,short unsigned val,zp_i8 bs,bool rtl); -#if zp_std_c99 || zp_std_cxx11 -zp_nothw void zp_fmtll( zp_c02 * buf,int long long val,zp_i8 bs,bool rtl); -zp_nothw void zp_fmtull(zp_c02 * buf,int long long unsigned val,zp_i8 bs,bool rtl); -#endif +zp_nothw zp_useres zp_siz zp_utf8enclen( zp_c02 const* str); +zp_nothw zp_useres zp_siz zp_utf8declen( zp_c8 const* str); +zp_nothw zp_useres zp_siz zp_utf16enclen(zp_c02 const* str); +zp_nothw zp_useres zp_siz zp_utf16declen(zp_c01 const* str); + +zp_nothw void zp_utf8enc( zp_c8 * dst,zp_c02 const* src); +zp_nothw void zp_utf8dec( zp_c02 * dst,zp_c8 const* src); +zp_nothw void zp_utf16enc( zp_c01 * dst,zp_c02 const* src); +zp_nothw void zp_utf16dec( zp_c02 * dst,zp_c01 const* src); +zp_nothw void zp_win1252enc(zp_c8 * dst,zp_c02 const* src); +zp_nothw void zp_win1252dec(zp_c02 * dst,zp_c8 const* src); + +/* + fmt: + + fmt is similar to the C printf and C++ print in + that it "formats" (transforms) a string and + inserts the provided parameters into it as + character sequences: + + zp_fmt(buf,"Hello {s}!\n","there"); + + will yield the string "Hello there!\n" into the + buffer buf. The curly brackets denote format + options, which have the following format: + + {code:base:left-to-right-override} + + ... wherein: + - code is a character sequence identifying the + type to converted; + - base is a hexadecimal (uppercase) character + sequence denoting the base of the conversion; + - left-to-right-override is either the + character '0' or '1', where '1' will result in + the parameter being formated right-to-left; + + The following is a list of standard type codes + and their equivalent type: + - c char + - cu char unsigned + - d double + - dl double long + - f float + - f02 zp_f02 + - f04 zp_f04 + - i int + - i8 zp_i8 + - i8s zp_i8s + - i01 zp_i01 + - i01s zp_i01s + - i02 zp_i02 + - i02s zp_i02s + - i04 zp_i04 + - i04s zp_i04s + - il int long + - ill int long long (if supported) + - illu int long long unsigned (if supported) + - ilu int long unsigned + - is int short + - isu int short unsigned + - iu int unsigned + - p zp_ptr + - pd zp_ptrdif + - s char const*, char * + - z zp_siz + - ze zp_sizerr +*/ +zp_nothw zp_siz zp_fmt(char * buf,char const* msg,...); zp_prv_cdeclend diff --git a/zp/include/zp/zp b/zp/include/zp/zp index a94f43f..37a1ec2 100644 --- a/zp/include/zp/zp +++ b/zp/include/zp/zp @@ -72,12 +72,12 @@ namespace zp { template<> struct minval<int> {constexpr static auto val = zp_minvali;}; template<> struct minval<int long> {constexpr static auto val = zp_minvalil;}; template<> struct minval<double long> {constexpr static auto val = zp_minvaldl;}; - template<> struct minval<short> {constexpr static auto val = zp_minvals;}; + template<> struct minval<int short> {constexpr static auto val = zp_minvalis;}; template<> struct minval<char signed> {constexpr static auto val = zp_minvalcs;}; template<> struct minval<char unsigned> {constexpr static auto val = zp_minvalcu;}; template<> struct minval<int unsigned> {constexpr static auto val = zp_minvaliu;}; template<> struct minval<int long unsigned> {constexpr static auto val = zp_minvalilu;}; - template<> struct minval<short unsigned> {constexpr static auto val = zp_minvalsu;}; + template<> struct minval<int short unsigned> {constexpr static auto val = zp_minvalisu;}; template<> struct minval<wchar_t> {constexpr static auto val = zp_minvalw;}; #if __cpp_char8_t >= 201811 template<> struct minval<char8_t> {constexpr static auto val = zp_minvalc8;}; @@ -98,12 +98,12 @@ namespace zp { template<> struct maxval<int> {constexpr static auto val = zp_maxvali;}; template<> struct maxval<int long> {constexpr static auto val = zp_maxvalil;}; template<> struct maxval<double long> {constexpr static auto val = zp_maxvaldl;}; - template<> struct maxval<short> {constexpr static auto val = zp_maxvals;}; + template<> struct maxval<int short> {constexpr static auto val = zp_maxvalis;}; template<> struct maxval<char signed> {constexpr static auto val = zp_maxvalcs;}; template<> struct maxval<char unsigned> {constexpr static auto val = zp_maxvalcu;}; template<> struct maxval<int unsigned> {constexpr static auto val = zp_maxvaliu;}; template<> struct maxval<int long unsigned> {constexpr static auto val = zp_maxvalilu;}; - template<> struct maxval<short unsigned> {constexpr static auto val = zp_maxvalsu;}; + template<> struct maxval<int short unsigned> {constexpr static auto val = zp_maxvalisu;}; template<> struct maxval<wchar_t> {constexpr static auto val = zp_maxvalw;}; #if __cpp_char8_t >= 201811 template<> struct maxval<char8_t> {constexpr static auto val = zp_maxvalc8;}; @@ -137,7 +137,7 @@ namespace zp { template<> struct sgn<char unsigned> {using typ = char signed;}; template<> struct sgn<int unsigned> {using typ = int;}; template<> struct sgn<int long unsigned> {using typ = int long;}; - template<> struct sgn<short unsigned> {using typ = short;}; + template<> struct sgn<int short unsigned> {using typ = int short;}; #if zp_std_cxx11 template<> struct sgn<int long long unsigned> {using typ = int long long;}; #endif @@ -152,7 +152,7 @@ namespace zp { template<> struct usgn<int> {using typ = int unsigned;}; template<> struct usgn<int long> {using typ = int long unsigned;}; template<> struct usgn<int long long> {using typ = int long long unsigned;}; - template<> struct usgn<short> {using typ = short unsigned;}; + template<> struct usgn<int short> {using typ = int short unsigned;}; template<typename ityp> struct usgn<ityp const> {using typ = typename usgn<ityp>::typ const;}; template<typename ityp> struct usgn<ityp volatile> {using typ = typename usgn<ityp>::typ volatile;}; @@ -177,7 +177,7 @@ namespace zp { template<> struct issgn<float> {constexpr static bool val = true;}; template<> struct issgn<int> {constexpr static bool val = true;}; template<> struct issgn<int long> {constexpr static bool val = true;}; - template<> struct issgn<short> {constexpr static bool val = true;}; + template<> struct issgn<int short> {constexpr static bool val = true;}; #if __STDCPP_BFLOAT16_T__ template<> struct issgn<decltype (0.0bf16)> {constexpr static bool val = true;}; #endif @@ -215,7 +215,7 @@ namespace zp { template<> struct isusgn<int unsigned> {constexpr static bool val = true;}; template<> struct isusgn<int long long unsigned> {constexpr static bool val = true;}; template<> struct isusgn<int long unsigned> {constexpr static bool val = true;}; - template<> struct isusgn<short unsigned> {constexpr static bool val = true;}; + template<> struct isusgn<int short unsigned> {constexpr static bool val = true;}; #if __cpp_char8_t >= 201811 template<> struct isusgn<char8_t> {constexpr static bool val = true;}; #endif @@ -265,8 +265,8 @@ namespace zp { template<> struct isinttyp<int long long> {constexpr static bool val = true;}; template<> struct isinttyp<int long long unsigned> {constexpr static bool val = true;}; template<> struct isinttyp<int long unsigned> {constexpr static bool val = true;}; - template<> struct isinttyp<short> {constexpr static bool val = true;}; - template<> struct isinttyp<short unsigned> {constexpr static bool val = true;}; + template<> struct isinttyp<int short> {constexpr static bool val = true;}; + template<> struct isinttyp<int short unsigned> {constexpr static bool val = true;}; template<typename typ> struct isinttyp<typ const> {constexpr static bool val = isinttyp<typ>::val;}; template<typename typ> struct isinttyp<typ volatile> {constexpr static bool val = isinttyp<typ>::val;}; @@ -309,6 +309,7 @@ namespace zp { template<typename typ> concept inttyp = ::zp::isinttyp<typ>::val; #endif +#if false #if zp_std_cxx11 namespace det { struct nulopt {}; @@ -334,6 +335,7 @@ namespace zp { typ valval; }; #endif +#endif // false namespace det { template<typename typ> struct ver { @@ -360,6 +362,6 @@ namespace zp { #endif } -#include <zp/imp/zp.ii> +#include <zp/det/zp.ii> #endif diff --git a/zp/source/any/mem/memcpy.c b/zp/source/any/mem/memcpy.c index f9848df..8ea32d3 100644 --- a/zp/source/any/mem/memcpy.c +++ b/zp/source/any/mem/memcpy.c @@ -6,11 +6,11 @@ #include <zp/mem.h> -zp_nothw zp_cpyres zp_memcpy(void * const dstptr,void const * const srcptr,zp_siz const num) { +zp_nothw zp_cpyres zp_memcpy(void * const dstptr,void const* const srcptr,zp_siz const num) { zp_cpyres res; char unsigned * dst = dstptr; - char unsigned const * src = srcptr; + char unsigned const* src = srcptr; char unsigned * const stp = dst+num; diff --git a/zp/source/any/mem/memequ.c b/zp/source/any/mem/memequ.c index 57d023c..a959d5a 100644 --- a/zp/source/any/mem/memequ.c +++ b/zp/source/any/mem/memequ.c @@ -6,11 +6,11 @@ #include <zp/mem.h> -bool zp_memequ(void const * const lbufptr,void const * const rbufptr,zp_siz const num) { - char unsigned const * lbuf = lbufptr; - char unsigned const * rbuf = rbufptr; +bool zp_memequ(void const* const lbufptr,void const* const rbufptr,zp_siz const num) { + char unsigned const* lbuf = lbufptr; + char unsigned const* rbuf = rbufptr; - char unsigned const * const stp = lbuf+num; + char unsigned const* const stp = lbuf+num; while (lbuf != stp) { zp_lik (*lbuf++ != *rbuf++) {return false;} diff --git a/zp/source/any/mem/memsrh.c b/zp/source/any/mem/memsrh.c index 1009962..b3d5071 100644 --- a/zp/source/any/mem/memsrh.c +++ b/zp/source/any/mem/memsrh.c @@ -6,13 +6,13 @@ #include <zp/mem.h> -void * zp_memsrh(void const * const bufptr,char unsigned const val,zp_siz const num) { - char unsigned const * buf = bufptr; +void * zp_memsrh(void const* const bufptr,char unsigned const val,zp_siz const num) { + char unsigned const* buf = bufptr; - char unsigned const * const stp = buf+num; + char unsigned const* const stp = buf+num; while (buf != stp) { - char unsigned const * const addr = buf++; + char unsigned const* const addr = buf++; zp_unlik (*addr == val) {return (char unsigned *)addr;} } diff --git a/zp/source/any/mth/divmod.cc b/zp/source/any/mth/divmod.cc index 48913f3..82dfa81 100644 --- a/zp/source/any/mth/divmod.cc +++ b/zp/source/any/mth/divmod.cc @@ -8,7 +8,7 @@ extern "C" { zp_nothw auto zp_divmodsc(char signed const num,char signed const den) -> ::divmodressc {return ::zp::divmod(num,den).cpair();} - zp_nothw auto zp_divmods( short const num,short const den) -> ::divmodress {return ::zp::divmod(num,den).cpair();} + zp_nothw auto zp_divmods( int short const num,int short const den) -> ::divmodress {return ::zp::divmod(num,den).cpair();} zp_nothw auto zp_divmodi( int const num,int const den) -> ::divmodresi {return ::zp::divmod(num,den).cpair();} zp_nothw auto zp_divmodl( int long const num,int long const den) -> ::divmodresl {return ::zp::divmod(num,den).cpair();} zp_nothw auto zp_divmodll(int long long const num,int long long const den) -> ::divmodresll {return ::zp::divmod(num,den).cpair();} diff --git a/zp/source/any/str/fmt.cc b/zp/source/any/str/fmt.cc index 6fdb5b1..b4d8f87 100644 --- a/zp/source/any/str/fmt.cc +++ b/zp/source/any/str/fmt.cc @@ -6,15 +6,30 @@ #include <zp/str> -/*extern "C" { - zp_nothw auto zp_fmti( char32_t * const buf,int const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nothw auto zp_fmtl( char32_t * const buf,int long const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nothw auto zp_fmtll( char32_t * const buf,int long long const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nothw auto zp_fmts( char32_t * const buf,short const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nothw auto zp_fmtsc( char32_t * const buf,char signed const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nothw auto zp_fmtuc( char32_t * const buf,char unsigned const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nothw auto zp_fmtui( char32_t * const buf,int unsigned const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nothw auto zp_fmtul( char32_t * const buf,int long unsigned const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nothw auto zp_fmtull(char32_t * const buf,int long long unsigned const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nothw auto zp_fmtus( char32_t * const buf,short unsigned const val,::zp::i8 const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} -}*/ +#include <zp/prv/fmt> + +#include <cstdarg> + +extern "C" zp_nothw ::zp::siz zp::fmt(char * const buf,char const* str,...) { + ::std::va_list arg; + va_start(arg,str); + + ::zp::siz len = 0x0u; + + if (buf == zp_nulptr) { + for (;;) { + char const chr = *buf++; + + zp_unlik (chr == '#') {return } + + zp_unlik (chr == '\x00') {} + } + } + else { + + } + + va_end(arg); + + return len; +} diff --git a/zp/source/any/str/fmtlen.cc b/zp/source/any/str/fmtlen.cc deleted file mode 100644 index ec2ea7b..0000000 --- a/zp/source/any/str/fmtlen.cc +++ /dev/null @@ -1,21 +0,0 @@ -/* - Copyright 2022-2023 Gabriel Jensen. - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. -*/ - -#include <zp/mth> -#include <zp/str> - -/* extern "C" { - zp_nothw auto zp_fmtleni( int const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nothw auto zp_fmtlenl( int long const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nothw auto zp_fmtlenll( int long long const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nothw auto zp_fmtlens( short const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nothw auto zp_fmtlensc( char signed const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nothw auto zp_fmtlenuc( char unsigned const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nothw auto zp_fmtlenui( int unsigned const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nothw auto zp_fmtlenul( int long unsigned const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nothw auto zp_fmtlenull(int long long unsigned const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nothw auto zp_fmtlenus( short unsigned const val,::zp::i8 const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} -} */ diff --git a/zp/source/any/str/strcpy.cc b/zp/source/any/str/strcpy.cc index b7af3f9..2a7986d 100644 --- a/zp/source/any/str/strcpy.cc +++ b/zp/source/any/str/strcpy.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw ::zp::siz zp_strcpy(char * const dst,char const * const src) { +extern "C" zp_nothw ::zp::siz zp_strcpy(char * const dst,char const* const src) { return ::zp::det::strcpy(dst,src); } diff --git a/zp/source/any/str/strequ.cc b/zp/source/any/str/strequ.cc index 6e4cedc..cd9f2bf 100644 --- a/zp/source/any/str/strequ.cc +++ b/zp/source/any/str/strequ.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw bool zp_strequ(char const * const lstr,char const * const rstr) { +extern "C" zp_nothw bool zp_strequ(char const* const lstr,char const* const rstr) { return ::zp::det::strequ(lstr,rstr); } diff --git a/zp/source/any/str/strfil.cc b/zp/source/any/str/strfil.cc index ac98d0f..06d09e2 100644 --- a/zp/source/any/str/strfil.cc +++ b/zp/source/any/str/strfil.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw bool zp_strfil(char * const str,char const chr) { +extern "C" zp_nothw zp_siz zp_strfil(char * const str,char const chr) { return ::zp::det::strfil(str,chr); } diff --git a/zp/source/any/str/strlen.cc b/zp/source/any/str/strlen.cc index 955567c..536f16e 100644 --- a/zp/source/any/str/strlen.cc +++ b/zp/source/any/str/strlen.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw ::zp::siz zp_strlen(char const * const str) { +extern "C" zp_nothw ::zp::siz zp_strlen(char const* const str) { return ::zp::det::strlen(str); } diff --git a/zp/source/any/str/strsrh.cc b/zp/source/any/str/strsrh.cc index e92c998..8156e11 100644 --- a/zp/source/any/str/strsrh.cc +++ b/zp/source/any/str/strsrh.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw char * zp_strsrh(char const * const str,char const chr) { +extern "C" zp_nothw char * zp_strsrh(char const* const str,char const chr) { return ::zp::det::strsrh(str,chr); } diff --git a/zp/source/any/str/utf16dec.c b/zp/source/any/str/utf16dec.c index b0c98db..0d2fbf4 100644 --- a/zp/source/any/str/utf16dec.c +++ b/zp/source/any/str/utf16dec.c @@ -6,7 +6,7 @@ #include <zp/str.h> -void zp_utf16dec(zp_c02 * dst,zp_c01 const * src) { +void zp_utf16dec(zp_c02 * dst,zp_c01 const* src) { for (;;++dst) { zp_c01 const hex = *src++; diff --git a/zp/source/any/str/utf16declen.c b/zp/source/any/str/utf16declen.c index adfe3cf..746e732 100644 --- a/zp/source/any/str/utf16declen.c +++ b/zp/source/any/str/utf16declen.c @@ -6,7 +6,7 @@ #include <zp/str.h> -zp_siz zp_utf16declen(zp_c01 const * str) { +zp_siz zp_utf16declen(zp_c01 const* str) { zp_siz len = 0x0u; for (;;++len) { diff --git a/zp/source/any/str/utf16enc.c b/zp/source/any/str/utf16enc.c index 0259214..7ed8e99 100644 --- a/zp/source/any/str/utf16enc.c +++ b/zp/source/any/str/utf16enc.c @@ -6,7 +6,7 @@ #include <zp/str.h> -void zp_utf16enc(zp_c01 * dst,zp_c02 const * src) { +void zp_utf16enc(zp_c01 * dst,zp_c02 const* src) { for (;;++src) { zp_c02 const chr = *src; diff --git a/zp/source/any/str/utf16enclen.c b/zp/source/any/str/utf16enclen.c index 803e224..4ebb41a 100644 --- a/zp/source/any/str/utf16enclen.c +++ b/zp/source/any/str/utf16enclen.c @@ -6,7 +6,7 @@ #include <zp/str.h> -zp_siz zp_utf16enclen(zp_c02 const * str) { +zp_siz zp_utf16enclen(zp_c02 const* str) { zp_siz len = 0x0u; for (;;++str) { diff --git a/zp/source/any/str/utf32cpy.cc b/zp/source/any/str/utf32cpy.cc index aed4370..fb64106 100644 --- a/zp/source/any/str/utf32cpy.cc +++ b/zp/source/any/str/utf32cpy.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw ::zp::siz zp_utf32cpy(::zp::c02 * const dst,::zp::c02 const * const src) { +extern "C" zp_nothw ::zp::siz zp_utf32cpy(::zp::c02 * const dst,::zp::c02 const* const src) { return ::zp::det::strcpy(dst,src); } diff --git a/zp/source/any/str/utf32equ.cc b/zp/source/any/str/utf32equ.cc index a293122..78d22f9 100644 --- a/zp/source/any/str/utf32equ.cc +++ b/zp/source/any/str/utf32equ.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw bool zp_utf32equ(::zp::c02 const * const lstr,::zp::c02 const * const rstr) { +extern "C" zp_nothw bool zp_utf32equ(::zp::c02 const* const lstr,::zp::c02 const* const rstr) { return ::zp::det::strequ(lstr,rstr); } diff --git a/zp/source/any/str/utf32fil.cc b/zp/source/any/str/utf32fil.cc index 2ce6b30..6e04d92 100644 --- a/zp/source/any/str/utf32fil.cc +++ b/zp/source/any/str/utf32fil.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw bool zp_utf32fil(::zp::c02 * const str,::zp::c02 const chr) { +extern "C" zp_nothw zp_siz zp_utf32fil(::zp::c02 * const str,::zp::c02 const chr) { return ::zp::det::strfil(str,chr); } diff --git a/zp/source/any/str/utf32len.cc b/zp/source/any/str/utf32len.cc index 1ee26a0..f66be43 100644 --- a/zp/source/any/str/utf32len.cc +++ b/zp/source/any/str/utf32len.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw ::zp::siz zp_utf32len(::zp::c02 const * const str) { +extern "C" zp_nothw ::zp::siz zp_utf32len(::zp::c02 const* const str) { return ::zp::det::strlen(str); } diff --git a/zp/source/any/str/utf32srh.cc b/zp/source/any/str/utf32srh.cc index 91fbbe8..d4dfa30 100644 --- a/zp/source/any/str/utf32srh.cc +++ b/zp/source/any/str/utf32srh.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw ::zp::c02 * zp_utf32srh(::zp::c02 const * const str,::zp::c02 const chr) { +extern "C" zp_nothw ::zp::c02 * zp_utf32srh(::zp::c02 const* const str,::zp::c02 const chr) { return ::zp::det::strsrh(str,chr); } diff --git a/zp/source/any/str/utf8dec.c b/zp/source/any/str/utf8dec.c index 60fd475..a2a9788 100644 --- a/zp/source/any/str/utf8dec.c +++ b/zp/source/any/str/utf8dec.c @@ -6,7 +6,7 @@ #include <zp/str.h> -void zp_utf8dec(zp_c02 * dst,zp_c8 const * src) { +void zp_utf8dec(zp_c02 * dst,zp_c8 const* src) { for (;;++dst) { zp_c8 const oct = *src++; diff --git a/zp/source/any/str/utf8declen.c b/zp/source/any/str/utf8declen.c index 58c4634..c791f9b 100644 --- a/zp/source/any/str/utf8declen.c +++ b/zp/source/any/str/utf8declen.c @@ -6,7 +6,7 @@ #include <zp/str.h> -zp_siz zp_utf8declen(zp_c8 const * str) { +zp_siz zp_utf8declen(zp_c8 const* str) { zp_siz len = 0x0u; for (;;++len) { diff --git a/zp/source/any/str/utf8enc.c b/zp/source/any/str/utf8enc.c index b3a8f86..e8ac3ce 100644 --- a/zp/source/any/str/utf8enc.c +++ b/zp/source/any/str/utf8enc.c @@ -6,7 +6,7 @@ #include <zp/str.h> -void zp_utf8enc(zp_c8 * dst,zp_c02 const * src) { +void zp_utf8enc(zp_c8 * dst,zp_c02 const* src) { for (;;++src) { zp_c02 const chr = *src; diff --git a/zp/source/any/str/utf8enclen.c b/zp/source/any/str/utf8enclen.c index 1f98ac2..e3de929 100644 --- a/zp/source/any/str/utf8enclen.c +++ b/zp/source/any/str/utf8enclen.c @@ -6,7 +6,7 @@ #include <zp/str.h> -zp_siz zp_utf8enclen(zp_c02 const * str) { +zp_siz zp_utf8enclen(zp_c02 const* str) { zp_siz len = 0x0u; for (;;++str) { diff --git a/zp/source/any/str/win1252dec.c b/zp/source/any/str/win1252dec.c index 826935f..8d67f38 100644 --- a/zp/source/any/str/win1252dec.c +++ b/zp/source/any/str/win1252dec.c @@ -6,7 +6,7 @@ #include <zp/str.h> -void zp_win1252dec(zp_c02 * dst,zp_c8 const * src) { +void zp_win1252dec(zp_c02 * dst,zp_c8 const* src) { for (;;++src,++dst) { zp_c8 const chr = *src; diff --git a/zp/source/any/str/win1252enc.c b/zp/source/any/str/win1252enc.c index 64c0ba6..43a8399 100644 --- a/zp/source/any/str/win1252enc.c +++ b/zp/source/any/str/win1252enc.c @@ -6,7 +6,7 @@ #include <zp/str.h> -void zp_win1252enc(zp_c8 * dst,zp_c02 const * src) { +void zp_win1252enc(zp_c8 * dst,zp_c02 const* src) { for (;;++src,++dst) { zp_c02 const chr = *src; diff --git a/zp/source/any/str/wstrcpy.cc b/zp/source/any/str/wstrcpy.cc index ac4520f..cbc576f 100644 --- a/zp/source/any/str/wstrcpy.cc +++ b/zp/source/any/str/wstrcpy.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw ::zp::siz zp_wstrcpy(::zp::wchr * const dst,::zp::wchr const * const src) { +extern "C" zp_nothw ::zp::siz zp_wstrcpy(::zp::wchr * const dst,::zp::wchr const* const src) { return ::zp::det::strcpy(dst,src); } diff --git a/zp/source/any/str/wstrequ.cc b/zp/source/any/str/wstrequ.cc index 2dbba05..14cc7d4 100644 --- a/zp/source/any/str/wstrequ.cc +++ b/zp/source/any/str/wstrequ.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw bool zp_wstrequ(::zp::wchr const * const lstr,::zp::wchr const * const rstr) { +extern "C" zp_nothw bool zp_wstrequ(::zp::wchr const* const lstr,::zp::wchr const* const rstr) { return ::zp::det::strequ(lstr,rstr);; } diff --git a/zp/source/any/str/wstrfil.cc b/zp/source/any/str/wstrfil.cc index 4685a12..ef59554 100644 --- a/zp/source/any/str/wstrfil.cc +++ b/zp/source/any/str/wstrfil.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw bool zp_wstrfil(::zp::wchr * const str,::zp::wchr const chr) { +extern "C" zp_nothw zp_siz zp_wstrfil(::zp::wchr * const str,::zp::wchr const chr) { return ::zp::det::strfil(str,chr); } diff --git a/zp/source/any/str/wstrlen.cc b/zp/source/any/str/wstrlen.cc index 51c7d96..9ca73cd 100644 --- a/zp/source/any/str/wstrlen.cc +++ b/zp/source/any/str/wstrlen.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw ::zp::siz zp_wstrlen(::zp::wchr const * const str) { +extern "C" zp_nothw ::zp::siz zp_wstrlen(::zp::wchr const* const str) { return ::zp::det::strlen(str); } diff --git a/zp/source/any/str/wstrsrh.cc b/zp/source/any/str/wstrsrh.cc index bf758e1..5dd5bbc 100644 --- a/zp/source/any/str/wstrsrh.cc +++ b/zp/source/any/str/wstrsrh.cc @@ -4,8 +4,8 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ -#include <zp/prv> +#include <zp/prv/str> -extern "C" zp_nothw ::zp::wchr * zp_wstrsrh(::zp::wchr const * const str,::zp::wchr const chr) { +extern "C" zp_nothw ::zp::wchr * zp_wstrsrh(::zp::wchr const* const str,::zp::wchr const chr) { return ::zp::det::strsrh(str,chr); } |