1 /* 2 Copyright (C) 2015-2021, Dirk Krause 3 SPDX-License-Identifier: BSD-3-Clause 4 */ 5 6 /* 7 WARNING: This file was generated by the dkct program (see 8 http://dktools.sourceforge.net/ for details). 9 Changes you make here will be lost if dkct is run again! 10 You should modify the original source and run dkct on it. 11 Original source: dk4rec02.ctr 12 */ 13 14 #ifndef DK4REC02_H_INCLUDED 15 /** Avoid multiple inclusions. */ 16 #define DK4REC02_H_INCLUDED 1 17 18 19 /** @file 20 String recoding from ANSI to ASCII 21 22 CRT on Windows: Not used. 23 */ 24 25 #ifndef DK4CONF_H_INCLUDED 26 #if DK4_BUILDING_DKTOOLS4 27 #include "dk4conf.h" 28 #else 29 #include <dktools-4/dk4conf.h> 30 #endif 31 #endif 32 33 #ifndef DK4TYPES_H_INCLUDED 34 #if DK4_BUILDING_DKTOOLS4 35 #include <libdk4base/dk4types.h> 36 #else 37 #include <dktools-4/dk4types.h> 38 #endif 39 #endif 40 41 #ifndef DK4ERROR_H_INCLUDED 42 #if DK4_BUILDING_DKTOOLS4 43 #include <libdk4base/dk4error.h> 44 #else 45 #include <dktools-4/dk4error.h> 46 #endif 47 #endif 48 49 #ifdef __cplusplus 50 extern "C" { 51 #endif 52 53 /** Recode string from ANSI to ASCII 54 @param dstb Destination buffer. 55 @param szdstb Size of destination buffer (number of bytes). 56 @param src Source string to convert. 57 @param erp Error report, may be NULL. 58 @return 1 on success, 0 on error. 59 60 Error codes: 61 - DK4_E_INVALID_ARGUMENTS<br> 62 if src or dstb is NULL or szdstb is 0, 63 - DK4_E_BUFFER_TOO_SMALL<br> 64 if dstb is too small, 65 - DK4_E_SYNTAX<br> 66 with the number of successfully recoded characters in nelem if a 67 non-recodable character was found. 68 */ 69 int 70 dk4recode_ansi_to_ascii( 71 char *dstb, size_t szdstb, const char *src, dk4_er_t *erp 72 ); 73 74 #ifdef __cplusplus 75 } 76 #endif 77 78 79 #endif 80