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: dk4rec21.ctr
12 */
13 
14 #ifndef DK4REC21_H_INCLUDED
15 /** Avoid multiple inclusions. */
16 #define DK4REC21_H_INCLUDED 1
17 
18 
19 /**	@file
20 	String conversion from ASCII to dkChar.
21 
22 	CRT on Windows: Not used.
23 */
24 
25 
26 
27 #ifndef DK4CONF_H_INCLUDED
28 #if DK4_BUILDING_DKTOOLS4
29 #include "dk4conf.h"
30 #else
31 #include <dktools-4/dk4conf.h>
32 #endif
33 #endif
34 
35 #ifndef DK4TYPES_H_INCLUDED
36 #if DK4_BUILDING_DKTOOLS4
37 #include <libdk4base/dk4types.h>
38 #else
39 #include <dktools-4/dk4types.h>
40 #endif
41 #endif
42 
43 #ifndef DK4ERROR_H_INCLUDED
44 #if DK4_BUILDING_DKTOOLS4
45 #include <libdk4base/dk4error.h>
46 #else
47 #include <dktools-4/dk4error.h>
48 #endif
49 #endif
50 
51 
52 
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 /**	Recode string from ASCII to dkChar
59 	@param	dstb	Destination buffer.
60 	@param	szdstb	Size of destination buffer (number of dkChar).
61 	@param	enc	Encoding for dkChar.
62 	@param	src	Source string to convert.
63 	@param	erp	Error report, may be NULL.
64 	@return	1 on success, 0 on error.
65 
66 	Error codes:
67 	- DK4_E_INVALID_ARGUMENTS<br>
68 	  if src or dstb is NULL or szdstb is 0,
69 	- DK4_E_BUFFER_TOO_SMALL<br>
70 	  if dstb is too small,
71 	- DK4_E_SYNTAX<br>
72 	  with the number of successfully recoded characters in nelem if a
73 	  non-recodable character was found.
74 */
75 int
76 dk4recode_ascii_to_dk(
77   dkChar *dstb, size_t szdstb, int enc, const char *src, dk4_er_t *erp
78 );
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 
85 
86 
87 #endif
88