/* 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.h Header file for the dk3wxs module. */ #ifndef DK3WXS_H_INCLUDED /** Avoid multiple inclusions. */ #define DK3WXS_H_INCLUDED 1 #line 9 "dk3wxs.cpt" #ifdef DK3_USE_WX #undef DK3_USE_WX #endif /** Use wxWidgets libraries to build GUI programs. */ #define DK3_USE_WX 1 #if 0 #include #else #include #include #include #endif #ifndef WX_WXPREC_H_INCLUDED #include #define WX_WXPREC_H_INCLUDED 1 #endif #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #if DK4_HAVE_WX_CHARTYPE_H #ifndef WX_CHARTYPE_H_INCLUDED #include #define WX_CHARTYPE_H_INCLUDED 1 #endif #else #if DK4_HAVE_WX_WXCHAR_H #ifndef WX_WXCHAR_H_INCLUDED #include #define WX_WXCHAR_H_INCLUDED 1 #endif #else #ifndef WX_WX_H_INCLUDED #include #define WX_WX_H_INCLUDED #endif #endif #endif #endif /** Pointer to wxChar string. */ typedef wxChar *DK3_PWXCHAR; /** Pointer to constant wxChar string. */ typedef wxChar const *DK3_PCWXCHAR; #if DK3_ON_WINDOWS || DK3_HAVE_BACKSLASH /** File name separator. */ #define DK3_WX_CHAR_SEP wxT('\\') #else /** File name separator. */ #define DK3_WX_CHAR_SEP wxT('/') #endif #ifdef __cplusplus extern "C" { #endif /** Copy string. * @param d Destination pointer. * @param s Source pointer. */ void dk3wxs_cpy(wxChar *d, wxChar const *s); /** Copy string, cut to buffer size if necessary. * @param d Destination pointer. * @param s Source pointer. * @param n Size of \a d (number of characters). */ void dk3wxs_ncpy(wxChar *d, wxChar const *s, size_t n); /** Concatenate two strings. * @param d Destination pointer. * @param s Source pointer. */ void dk3wxs_cat(wxChar *d, wxChar const *s); /** Convert to lower-case character. * @param c Character to convert. * @return Conversion result. */ wxChar dk3wxs_tolower(wxChar c); /** Convert to upper-case character. * @param c Character to convert. * @return Conversion result. */ wxChar dk3wxs_toupper(wxChar c); /** Find left-most orrucance of character in string. * @param s String probably containing the character. * @param c Character to search for. * @return Pointer to character position on success, NULL on error. */ wxChar * dk3wxs_chr(wxChar const *s, wxChar c); /** Find right-most orrucance of character in string. * @param s String probably containing the character. * @param c Character to search for. * @return Pointer to character position on success, NULL on error. */ wxChar * dk3wxs_rchr(wxChar const *s, wxChar c); /** Calculate string length. * @param s String to process. * @return String length (number of characters). */ size_t dk3wxs_len(wxChar const *s); /** Duplicate string into dynamically allocated memory. * Use dk3_delete() to release the memory when done. * @param s String to duplicate. * @return Pointer to new string on success, NULL on error. */ wxChar * dk3wxs_dup(wxChar const *s); /** Duplicate string into dynamically allocated memory. * Use dk3_delete() to release the memory when done. * @param s String to duplicate. * @param app Application structure for diagnostics, may be NULL. * @return Pointer to new string on success, NULL on error. */ wxChar * dk3wxs_dup_app(wxChar const *s, dk3_app_t *app); /** Compare two strings, use only the first \a n characters. * @param l Left side string. * @param r Right side string. * @param n Number of characters to use in comparison. * @return 1 for l>r, 0 for l=r, -1 for lr, 0 for l=r, -1 for lr, 0 for l=r, -1 for l