/* WARNING: This file was generated by dkct. Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: dk3wxs.cpt */ /* Copyright (C) 2011-2017, Dirk Krause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above opyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file dk3wxs.cpp The dk3wxs module. */ #line 333 "dk3wxs.cpt" #ifdef DK3_USE_WX #undef DK3_USE_WX #endif /** Use wxWidgets libraries to build GUI programs. */ #define DK3_USE_WX 1 #include #include "dk3wxs.h" #include "dk3wxcs.h" #line 348 "dk3wxs.cpt" void dk3wxs_cpy(wxChar *d, wxChar const *s) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 dk3str_c32_cpy((dk3_c32_t *)d, (const dk3_c32_t *)s); #else dk3str_c16_cpy((dk3_c16_t *)d, (const dk3_c16_t *)s); #endif #else dk3str_c8_cpy((char *)d, (const char *)s); #endif } wxChar * dk3wxs_get_suffix(wxChar const *s) { wxChar *back = NULL; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = (wxChar *)dk3str_c32_get_suffix((const dk3_c32_t *)s); #else back = (wxChar *)dk3str_c16_get_suffix((const dk3_c16_t *)s); #endif #else back = (wxChar *)dk3str_c8_get_suffix((const char *)s); #endif return back; } void dk3wxs_ncpy(wxChar *d, wxChar const *s, size_t n) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 dk3str_c32_ncpy((dk3_c32_t *)d, (const dk3_c32_t *)s, n); #else dk3str_c16_ncpy((dk3_c16_t *)d, (const dk3_c16_t *)s, n); #endif #else dk3str_c8_ncpy((char *)d, (const char *)s, n); #endif } void dk3wxs_cat(wxChar *d, wxChar const *s) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 dk3str_c32_cat((dk3_c32_t *)d, (const dk3_c32_t *)s); #else dk3str_c16_cat((dk3_c16_t *)d, (const dk3_c16_t *)s); #endif #else dk3str_c8_cat((char *)d, (const char *)s); #endif } wxChar dk3wxs_tolower(wxChar c) { wxChar back; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_tolower((dk3_c32_t)c); #else back = dk3str_c16_tolower((dk3_c16_t)c); #endif #else back = dk3str_c8_tolower((char)c); #endif return back; } wxChar dk3wxs_toupper(wxChar c) { wxChar back; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_toupper((dk3_c32_t)c); #else back = dk3str_c16_toupper((dk3_c16_t)c); #endif #else back = dk3str_c8_toupper((char)c); #endif return back; } wxChar * dk3wxs_chr(wxChar const *s, wxChar c) { wxChar *back = NULL; if(s) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = (wxChar *)dk3str_c32_chr((const dk3_c32_t *)s, (dk3_c32_t)c); #else back = (wxChar *)dk3str_c16_chr((const dk3_c16_t *)s, (dk3_c16_t)c); #endif #else back = (wxChar *)dk3str_c8_chr((const char *)s, (char)c); #endif } return back; } wxChar * dk3wxs_rchr(wxChar const *s, wxChar c) { wxChar *back = NULL; if(s) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = (wxChar *)dk3str_c32_rchr((const dk3_c32_t *)s, (dk3_c32_t)c); #else back = (wxChar *)dk3str_c16_rchr((const dk3_c16_t *)s, (dk3_c16_t)c); #endif #else back = (wxChar *)dk3str_c8_rchr((const char *)s, (char)c); #endif } return back; } size_t dk3wxs_len(wxChar const *s) { size_t back = 0; if(s) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_len((const dk3_c32_t *)s); #else back = dk3str_c16_len((const dk3_c16_t *)s); #endif #else back = dk3str_c8_len((const char *)s); #endif } return back; } wxChar * dk3wxs_dup_app(wxChar const *s, dk3_app_t *app) { wxChar *back = NULL; if(s) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = (wxChar *)dk3str_c32_dup_app((const dk3_c32_t *)s, app); #else back = (wxChar *)dk3str_c16_dup_app((const dk3_c16_t *)s, app); #endif #else back = (wxChar *)dk3str_c8_dup_app((const char *)s, app); #endif } return back; } wxChar * dk3wxs_dup(wxChar const *s) { wxChar *back = NULL; if(s) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = (wxChar *)dk3str_c32_dup_app((const dk3_c32_t *)s, NULL); #else back = (wxChar *)dk3str_c16_dup_app((const dk3_c16_t *)s, NULL); #endif #else back = (wxChar *)dk3str_c8_dup_app((const char *)s, NULL); #endif } return back; } int dk3wxs_ncmp(wxChar const *l, wxChar const *r, size_t n) { int back = 0; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_ncmp((const dk3_c32_t *)l, (const dk3_c32_t *)r, n); #else back = dk3str_c16_ncmp((const dk3_c16_t *)l, (const dk3_c16_t *)r, n); #endif #else back = dk3str_c8_ncmp((const char *)l, (const char *)r, n); #endif return back; } int dk3wxs_cmp(wxChar const *l, wxChar const *r) { int back = 0; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_cmp((const dk3_c32_t *)l, (const dk3_c32_t *)r); #else back = dk3str_c16_cmp((const dk3_c16_t *)l, (const dk3_c16_t *)r); #endif #else back = dk3str_c8_cmp((const char *)l, (const char *)r); #endif return back; } int dk3wxs_casecmp(wxChar const *l, wxChar const *r) { int back = 0; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_casecmp((const dk3_c32_t *)l, (const dk3_c32_t *)r); #else back = dk3str_c16_casecmp((const dk3_c16_t *)l, (const dk3_c16_t *)r); #endif #else back = dk3str_c8_casecmp((const char *)l, (const char *)r); #endif return back; } int dk3wxs_array_index(wxChar const * const *a, wxChar const *s, int c) { int back = -1; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_array_index( (const dk3_c32_t * const *)a, (const dk3_c32_t *)s, c ); #else back = dk3str_c16_array_index( (const dk3_c16_t * const *)a, (const dk3_c16_t *)s, c ); #endif #else back = dk3str_c8_array_index((const char * const *)a, (const char *)s, c); #endif return back; } wxChar * dk3wxs_start(wxChar *s, wxChar const *whsp) { wxChar *back = NULL; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = (wxChar *)dk3str_c32_start((dk3_c32_t *)s, (const dk3_c32_t *)whsp); #else back = (wxChar *)dk3str_c16_start((dk3_c16_t *)s, (const dk3_c16_t *)whsp); #endif #else back = (wxChar *)dk3str_c8_start((char *)s, (const char *)whsp); #endif return back; } wxChar * dk3wxs_next(wxChar *s, wxChar const *whsp) { wxChar *back = NULL; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = (wxChar *)dk3str_c32_next((dk3_c32_t *)s, (const dk3_c32_t *)whsp); #else back = (wxChar *)dk3str_c16_next((dk3_c16_t *)s, (const dk3_c16_t *)whsp); #endif #else back = (wxChar *)dk3str_c8_next((char *)s, (const char *)whsp); #endif return back; } int dk3wxs_is_bool(wxChar const *s) { int back = 0; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_is_bool((const dk3_c32_t *)s); #else back = dk3str_c16_is_bool((const dk3_c16_t *)s); #endif #else back = dk3str_c8_is_bool((const char *)s); #endif return back; } int dk3wxs_is_on(wxChar const *s) { int back = 0; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_is_on((const dk3_c32_t *)s); #else back = dk3str_c16_is_on((const dk3_c16_t *)s); #endif #else back = dk3str_c8_is_on((const char *)s); #endif return back; } size_t dk3wxs_explode(wxChar **array, size_t sz, wxChar *s, wxChar const *whsp) { size_t back; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_explode( (dk3_c32_t **)array, sz, (dk3_c32_t *)s, (const dk3_c32_t *)whsp ); #else back = dk3str_c16_explode( (dk3_c16_t **)array, sz, (dk3_c16_t *)s, (const dk3_c16_t *)whsp ); #endif #else back = dk3str_c8_explode( (char **)array, sz, (char *)s, (const char *)whsp ); #endif return back; } void dk3wxs_normalize(wxChar *l, wxChar const *w, wxChar c) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 dk3str_c32_normalize((dk3_c32_t *)l, (const dk3_c32_t *)w, (dk3_c32_t)c); #else dk3str_c16_normalize((dk3_c16_t *)l, (const dk3_c16_t *)w, (dk3_c16_t)c); #endif #else dk3str_c8_normalize((char *)l, (const char *)w, (char)c); #endif } int dk3wxs_is_abs_path(wxChar const *n) { int back = 0; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_is_abs_path((const dk3_c32_t *)n); #else back = dk3str_c16_is_abs_path((const dk3_c16_t *)n); #endif #else back = dk3str_c8_is_abs_path((const char *)n); #endif return back; } int dk3wxs_append_path(wxChar *d, size_t sz, wxChar const *n) { int back = 0; #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 back = dk3str_c32_append_path_app( (dk3_c32_t *)d, sz, (const dk3_c32_t *)n, NULL ); #else back = dk3str_c16_append_path_app( (dk3_c16_t *)d, sz, (const dk3_c16_t *)n, NULL ); #endif #else back = dk3str_c8_append_path_app((char *)d, sz, (const char *)n, NULL); #endif return back; } void dk3wxs_correct_filename(wxChar *n) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 dk3str_c32_correct_filename((dk3_c32_t *)n); #else dk3str_c16_correct_filename((dk3_c16_t *)n); #endif #else dk3str_c8_correct_filename((char *)n); #endif } int dk3wxs_from_utf8(wxChar *d, size_t sz, char const *s) { int back = 0; #line 755 "dk3wxs.cpt" if((d) && (sz) && (s)) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 #line 759 "dk3wxs.cpt" if(sz >= dk3str_cnvsz_c8u_to_c32_app(s, NULL)) { #line 761 "dk3wxs.cpt" back = dk3str_cnv_c8u_to_c32_app( (dk3_c32_t *)d, sz, s, NULL); } #else #line 765 "dk3wxs.cpt" if(sz >= dk3str_cnvsz_c8u_to_c16_app(s, NULL)) { #line 767 "dk3wxs.cpt" back = dk3str_cnv_c8u_to_c16_app( (dk3_c16_t *)d, sz, s, NULL); } #endif #else #line 772 "dk3wxs.cpt" if(sz >= dk3str_cnvsz_c8u_to_c8p_app(s, NULL)) { #line 774 "dk3wxs.cpt" back = dk3str_cnv_c8u_to_c8p_app((char *)d, sz, s, NULL); } #endif } #line 778 "dk3wxs.cpt" return back; } int dk3wxs_from_plain(wxChar *d, size_t sz, char const *s) { int back = 0; if((d) && (sz) && (s)) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 if(sz >= dk3str_cnvsz_c8p_to_c32_app(s, NULL)) { back = dk3str_cnv_c8p_to_c32_app((dk3_c32_t *)d, sz, s, NULL); } #else if(sz >= dk3str_cnvsz_c8p_to_c16_app(s, NULL)) { back = dk3str_cnv_c8p_to_c16_app((dk3_c16_t *)d, sz, s, NULL); } #endif #else if(sz >= dk3str_c8_len(s)) { dk3str_c8_cpy((char *)d, s); back = 1; } #endif } return back; } int dk3wxs_from_utf16(wxChar *d, size_t sz, dk3_c16_t const *s) { int back = 0; if((d) && (sz) && (s)) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 if(sz >= dk3str_cnvsz_c16_to_c32_app(s, NULL)) { back = dk3str_cnv_c16_to_c32_app((dk3_c32_t *)d, sz, s, NULL); } #else if(sz >= dk3str_c16_len(s)) { dk3str_c16_cpy((dk3_c16_t *)d, s); back = 1; } #endif #else if(sz >= dk3str_cnvsz_c16_to_c8p_app(s, NULL)) { back = dk3str_cnv_c16_to_c8p_app((char *)d, sz, s, NULL); } #endif } return back; } int dk3wxs_from_dkstr(wxChar *dp, size_t sz, int wxe, dkChar const *src, int dke) { int back = 0; if((dp) && (sz) && (src)) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 /* + wxChar 4 */ #if DK3_CHAR_SIZE > 1 #if DK3_CHAR_SIZE > 2 /* + dkChar 4 */ if(dk3str_c32_len((const dk3_c32_t *)src) < sz) { dk3str_c32_cpy((dk3_c32_t *)dp, (const dk3_c32_t *)src); back = 1; } /* - dkChar 4 */ #else /* + dkChar 2 */ if(sz >= dk3str_cnvsz_c16_to_c32_app((const dk3_c16_t *)src, NULL)) { back = dk3str_cnv_c16_to_c32_app( (dk3_c32_t *)dp, sz, (const dk3_c16_t *)src, NULL ); } /* - dkChar 2 */ #endif #else /* + dkChar 1 */ if(dke == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c8p_to_c32_app((const char *)src, NULL)) { back = dk3str_cnv_c8p_to_c32_app( (dk3_c32_t *)dp, sz, (const char *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c8u_to_c32_app(src, NULL)) { back = dk3str_cnv_c8u_to_c32_app(dp, sz, src, NULL); } } /* - dkChar 1 */ #endif /* - wxChar 4 */ #else /* + wxChar 2 */ #if DK3_CHAR_SIZE > 1 #if DK3_CHAR_SIZE > 2 /* + dkChar 4 */ if(sz >= dk3str_cnvsz_c32_to_c16_app((const dk3_c32_t *)src, NULL)) { back = dk3str_cnv_c32_to_c16_app( (dk3_c16_t *)dp, sz, (const dk3_c32_t *)src, NULL ); } /* - dkChar 4 */ #else /* + dkChar 2 */ if(dk3str_c16_len((const dk3_c16_t *)src) < sz) { dk3str_c16_cpy((dk3_c16_t *)dp, (const dk3_c16_t *)src); back = 1; } /* - dkChar 2 */ #endif #else /* + dkChar 1 */ if(dke == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c8p_to_c16_app((const char *)src, NULL)) { back = dk3str_cnv_c8p_to_c16_app( (dk3_c16_t *)dp, sz, (const char *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c8u_to_c16_app((const char *)src, NULL)) { back = dk3str_cnv_c8u_to_c16_app( (dk3_c16_t *)dp, sz, (const char *)src, NULL ); } } /* - dkChar 1 */ #endif /* - wxChar 2 */ #endif #else /* + wxChar 1 */ #if DK3_CHAR_SIZE > 1 #if DK3_CHAR_SIZE > 2 /* + dkChar 4 */ if(wxe == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c8p_to_c32_app((const dk3_c32_t *)src, NULL)) { back = dk3str_cnv_c8p_to_c32_app( (char *)dp, sz, (const dk3_c32_t *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c8u_to_c32_app((const dk3_c32_t *)src, NULL)) { back = dk3str_cnv_c8u_to_c32_app( (char *)dp, sz, (const dk3_c32_t *)src, NULL ); } } /* - dkChar 4 */ #else /* + dkChar 2 */ if(wxe == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c8p_to_c16_app((const dk3_c16_t *)src, NULL)) { back =dk3str_cnv_c8p_to_c16_app( (char *)dp, sz, (const dk3_c16_t *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c8u_to_c16_app((const dk3_c16_t *)src, NULL)) { back =dk3str_cnv_c8u_to_c16_app( (char *)dp, sz, (const dk3_c16_t *)src, NULL ); } } /* - dkChar 2 */ #endif #else /* + dkChar 1 */ if(wxe == dke) { if(dk3str_c8_len((const char *)src) < sz) { dk3str_c8_cpy((char *)dp, (const char *)src); back = 1; } } else { if(wxe == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c8u_to_c8p_app((const char *)src, NULL)) { back = dk3str_cnv_c8u_to_c8p_app( (char *)dp, sz, (const char *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c8p_to_c8u_app((const char *)src, NULL)) { back = dk3str_cnv_c8p_to_c8u_app( (char *)dp, sz, (const char *)src, NULL ); } } } /* - dkChar 1 */ #endif /* - wxChar 1 */ #endif } return back; } int dk3wxs_to_dkstr(dkChar *dp, size_t sz, int dke, wxChar const *src, int wxe) { int back = 0; if((dp) && (sz) && (src)) { #if DK3_CHAR_SIZE > 1 #if DK3_CHAR_SIZE > 2 /* + dkChar 4 */ #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 /* + wxChar 4 */ if(dk3str_c32_len((const dk3_c32_t *)src) < sz) { dk3str_c32_cpy((dk3_c32_t *)dp, (const dk3_c32_t *)src); back = 1; } /* - wxChar 4 */ #else /* + wxChar 2 */ if(sz >= dk3str_cnvsz_c16_to_c32_app((const dk3_c16_t *)src, NULL)) { back = dk3str_cnv_c16_to_c32_app( (dk3_c32_t *)dp, sz, (const dk3_c16_t *)src, NULL ); } /* - wxChar 2 */ #endif #else /* + wxChar 1 */ if(wxe == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c8p_to_c32_app((const char *)src, NULL)) { back = dk3str_cnv_c8p_to_c32_app( (dk3_c32_t *)dp, sz, (const char *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c8u_to_c32_app((const char *)src, NULL)) { back = dk3str_cnv_c8u_to_c32_app( (dk3_c32_t *)dp, sz, (const char *)src, NULL ); } } /* - wxChar 1 */ #endif /* - dkChar 4 */ #else /* + dkChar 2 */ #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 /* + wxChar 4 */ if(sz >= dk3str_cnvsz_c32_to_c16_app((const dk3_c32_t *)src, NULL)) { back = dk3str_cnv_c32_to_c16_app( (dk3_c16_t *)dp, sz, (const dk3_c32_t *)src, NULL ); } /* - wxChar 4 */ #else /* + wxChar 2 */ if(sz > dk3str_c16_len((const dk3_c16_t *)src)) { dk3str_c16_cpy((dk3_c16_t *)dp, (const dk3_c16_t *)src); back = 1; } /* - wxChar 2 */ #endif #else /* + wxChar 1 */ if(wxe == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c8p_to_c16_app((const char *)src, NULL)) { back = dk3str_cnv_c8p_to_c16_app( (dk3_c16_t *)dp, sz, (const char *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c8u_to_c16_app((const char *)src, NULL)) { back = dk3str_cnv_c8u_to_c16_app( (dk3_c16_t *)dp, sz, (const char *)src, NULL ); } } /* - wxChar 1 */ #endif /* - dkChar 2 */ #endif #else /* + dkChar 1 */ #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 /* + wxChar 4 */ if(dke == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c32_to_c8p_app((const dk3_c32_t *)src, NULL)) { back = dk3str_cnv_c32_to_c8p_app( (char *)dp, sz, (const dk3_c32_t *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c32_to_c8u_app((const dk3_c32_t *)src, NULL)) { back = dk3str_cnv_c32_to_c8u_app( (char *)dp, sz, (const dk3_c32_t *)src, NULL ); } } /* - wxChar 4 */ #else /* + wxChar 2 */ if(dke == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c16_to_c8p_app((const dk3_c16_t *)src, NULL)) { back = dk3str_cnv_c16_to_c8p_app( (char *)dp, sz, (const dk3_c16_t *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c16_to_c8u_app((const dk3_c16_t *)src, NULL)) { back = dk3str_cnv_c16_to_c8u_app( (char *)dp, sz, (const dk3_c16_t *)src, NULL ); } } /* - wxChar 2 */ #endif #else /* + wxChar 1 */ if(dke == wxe) { if(sz > dk3str_c8_len((const char *)src)) { dk3str_c8_cpy((char *)dp, (const char *)src); back = 1; } } else { if(dke == DK3_ENCODING_PLAIN) { if(sz >= dk3str_cnvsz_c8u_to_c8p_app((const char *)src, NULL)) { back = dk3str_cnv_c8u_to_c8p_app( (char *)dp, sz, (const char *)src, NULL ); } } else { if(sz >= dk3str_cnvsz_c8p_to_c8u_app((const char *)src, NULL)) { back = dk3str_cnv_c8p_to_c8u_app( (char *)dp, sz, (const char *)src, NULL ); } } } /* - wxChar 1 */ #endif /* - dkChar 1 */ #endif } return back; } int dk3wxs_to_c8(char *dp, size_t sz, int c8e, wxChar const *src, int wxe) { int back = 0; #line 1137 "dk3wxs.cpt" if((dp) && (sz) && (src)) { #if DK3_SIZEOF_WXCHAR > 1 #if DK3_SIZEOF_WXCHAR > 2 if(DK3_ENCODING_UTF8 == c8e) { #line 1141 "dk3wxs.cpt" if(sz >= dk3str_cnvsz_c32_to_c8u_app((const dk3_c32_t *)src, NULL)) { back = dk3str_cnv_c32_to_c8u_app( dp, sz, (const dk3_c32_t *)src, NULL ); } } else { #line 1147 "dk3wxs.cpt" if(sz >= dk3str_cnvsz_c32_to_c8p_app((const dk3_c32_t *)src, NULL)) { back = dk3str_cnv_c32_to_c8p_app( dp, sz, (const dk3_c32_t *)src, NULL ); } } #else if(DK3_ENCODING_UTF8 == c8e) { #line 1155 "dk3wxs.cpt" if(sz >= dk3str_cnvsz_c16_to_c8u_app((const dk3_c16_t *)src, NULL)) { back = dk3str_cnv_c16_to_c8u_app( dp, sz, (const dk3_c16_t *)src, NULL ); } } else { #line 1161 "dk3wxs.cpt" if(sz >= dk3str_cnvsz_c16_to_c8p_app((const dk3_c16_t *)src, NULL)) { back = dk3str_cnv_c16_to_c8p_app( dp, sz, (const dk3_c16_t *)src, NULL ); } } #endif #else if(c8e == wxe) { #line 1170 "dk3wxs.cpt" if(sz > strlen((const char *)src)) { strcpy(dp, (const char *)src); } } else { if(DK3_ENCODING_UTF8 == c8e) { #line 1175 "dk3wxs.cpt" if(sz >= dk3str_cnvsz_c8p_to_c8u_app((const char *)src, NULL)) { back = dk3str_cnv_c8p_to_c8u_app(dp, sz, (const char *)src, NULL); } } else { #line 1179 "dk3wxs.cpt" if(sz >= dk3str_cnvsz_c8u_to_c8p_app((const char *)src, NULL)) { back = dk3str_cnv_c8u_to_c8p_app(dp, sz, (const char *)src, NULL); } } } #endif } #line 1186 "dk3wxs.cpt" return back; }