/* Copyright (C) 2017-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). 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: dk4rec26.ctr */ #ifndef DK4REC26_H_INCLUDED /** Avoid multiple inclusions. */ #define DK4REC26_H_INCLUDED 1 #line 8 "dk4rec26.ctr" /** @file dk4rec26.h Recode characters to unsigned long. We can not simply convert unsing the (unsigned long) cast as on some systems wchar_t may be a signed integer type and unsigned long may be larger than 32 bits. Promoting negative wchar_t or wxChar values to 64 bit unsigned long will result in conversions for instance from wchar_t=0xFFFE0000 to ul=0xFFFFFFFFFFFE0000. So after an (unsigned long) cast we have to apply a mask, i.e. 0xFFFFFFFFUL when wchar_t is 4 bytes long or 0xFFFFU when wchar_t is 2 bytes long. */ #ifndef DK4CONF_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4conf.h" #else #include #endif #endif #ifndef DK4TYPES_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4types.h" #else #include #endif #endif #ifdef __cplusplus extern "C" { #endif /** Convert char to unsigned long. @param back Character to convert. @return Conversion result. */ unsigned long dk4recode_char_to_ul(unsigned long back); /** Convert 16 bit character to unsigned long. @param back Character to convert. @return Conversion result. */ unsigned long dk4recode_c16_to_ul(unsigned long back); /** Convert 32 bit character to unsigned long. @param back Character to convert. @return Conversion result. */ unsigned long dk4recode_c32_to_ul(unsigned long back); /** Convert dkChar to unsigned long. @param back Character to convert. @return Conversion result. */ unsigned long dk4recode_dk_to_ul(unsigned long back); /** Convert wchar_t to unsigned long. @param back Character to convert. @return Conversion result. */ unsigned long dk4recode_wc_to_ul(unsigned long back); #if 0 /** Convert wxChar to unsigned long. @param back Character to convert. @return Conversion result. */ unsigned long dk4recode_wx_to_ul(unsigned long back); #endif #ifdef __cplusplus } #endif #endif