Skip to content

Commit 785e609

Browse files
committed
Add the SDL_iconv type and related functions
1 parent c089bb2 commit 785e609

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: units/sdlstdinc.inc

+20
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,23 @@ function SDL_iconv_string(tocode, fromcode, inbuf: PAnsiChar; inbytesleft: csize
119119
function SDL_iconv_utf8_locale(str: PAnsiChar): PAnsiChar; cdecl;
120120
function SDL_iconv_utf8_ucs2(str: PAnsiChar): pcUint16; cdecl;
121121
function SDL_iconv_utf8_ucs4(str: PAnsiChar): pcUint32; cdecl;
122+
123+
(* The SDL implementation of iconv() returns these error codes *)
124+
const
125+
SDL_ICONV_ERROR = csize_t(-1);
126+
SDL_ICONV_E2BIG = csize_t(-2);
127+
SDL_ICONV_EILSEQ = csize_t(-3);
128+
SDL_ICONV_EINVAL = csize_t(-4);
129+
130+
type
131+
TSDL_iconv = record end;
132+
PSDL_iconv = ^TSDL_iconv;
133+
134+
function SDL_iconv_open(tocode, fromcode: PAnsiChar): PSDL_iconv; cdecl;
135+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_iconv_open' {$ENDIF} {$ENDIF};
136+
137+
function SDL_iconv_close(cd: PSDL_iconv): cint; cdecl;
138+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_iconv_close' {$ENDIF} {$ENDIF};
139+
140+
function SDL_iconv(cd: PSDL_iconv; inbuf: PPAnsiChar; inbytesleft: pcsize_t; outbuf: PPAnsiChar; outbytesleft: pcsize_t): csize_t; cdecl;
141+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_iconv' {$ENDIF} {$ENDIF};

0 commit comments

Comments
 (0)