Skip to content

Commit b7d20c5

Browse files
committed
Add SDL_is* character functions
1 parent 4ebe24b commit b7d20c5

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

units/sdlstdinc.inc

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,138 @@ function SDL_realloc(mem: Pointer; size: csize_t): Pointer; cdecl;
138138
procedure SDL_free(mem: Pointer); cdecl;
139139
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_free' {$ENDIF} {$ENDIF};
140140

141+
142+
(*** --- Character functions --- ***)
143+
144+
145+
(**
146+
* Check if the provided ASCII character is an alphabetic character (a letter).
147+
*
148+
* \returns 1 if the check passes, 0 otherwise.
149+
*
150+
* \since This function is available since SDL 2.0.16.
151+
*)
152+
function SDL_isalpha(x: cint):cint; cdecl;
153+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_isalpha' {$ENDIF} {$ENDIF};
154+
155+
(**
156+
* Check if the provided ASCII character is an alphanumeric character.
157+
*
158+
* \returns 1 if the check passes, 0 otherwise.
159+
*
160+
* \since This function is available since SDL 2.0.16.
161+
*)
162+
function SDL_isalnum(x: cint):cint; cdecl;
163+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_isalnum' {$ENDIF} {$ENDIF};
164+
165+
(**
166+
* Check if the provided ASCII character is a blank character (a space or a tab).
167+
*
168+
* \returns 1 if the check passes, 0 otherwise.
169+
*
170+
* \since This function is available since SDL 2.0.16.
171+
*)
172+
function SDL_isblank(x: cint):cint; cdecl;
173+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_isblank' {$ENDIF} {$ENDIF};
174+
175+
(**
176+
* Check if the provided ASCII character is a control character.
177+
*
178+
* \returns 1 if the check passes, 0 otherwise.
179+
*
180+
* \since This function is available since SDL 2.0.16.
181+
*)
182+
function SDL_iscntrl(x: cint):cint; cdecl;
183+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_iscntrl' {$ENDIF} {$ENDIF};
184+
185+
(**
186+
* Check if the provided ASCII character is a decimal digit.
187+
*
188+
* \returns 1 if the check passes, 0 otherwise.
189+
*
190+
* \since This function is available since SDL 2.0.4.
191+
*)
192+
function SDL_isdigit(x: cint):cint; cdecl;
193+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_isdigit' {$ENDIF} {$ENDIF};
194+
195+
(**
196+
* Check if the provided ASCII character is a hexadecimal digit.
197+
*
198+
* \returns 1 if the check passes, 0 otherwise.
199+
*
200+
* \since This function is available since SDL 2.0.16.
201+
*)
202+
function SDL_isxdigit(x: cint):cint; cdecl;
203+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_isxdigit' {$ENDIF} {$ENDIF};
204+
205+
(**
206+
* Check if the provided ASCII character is any printable character
207+
* which is not a space or an alphanumeric character.
208+
*
209+
* \returns 1 if the check passes, 0 otherwise.
210+
*
211+
* \since This function is available since SDL 2.0.16.
212+
*)
213+
function SDL_ispunct(x: cint):cint; cdecl;
214+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_ispunct' {$ENDIF} {$ENDIF};
215+
216+
(**
217+
* Check if the provided ASCII character is a whitespace character.
218+
* This set includes the following characters: space,
219+
* form feed (FF), newline/line feed (LF), carriage return (CR),
220+
* horizontal tab (HT), vertical tab (VT).
221+
*
222+
* \returns 1 if the check passes, 0 otherwise.
223+
*
224+
* \since This function is available since SDL 2.0.4.
225+
*)
226+
function SDL_isspace(x: cint):cint; cdecl;
227+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_isspace' {$ENDIF} {$ENDIF};
228+
229+
(**
230+
* Check if the provided ASCII character is an uppercase letter.
231+
*
232+
* \returns 1 if the check passes, 0 otherwise.
233+
*
234+
* \since This function is available since SDL 2.0.12.
235+
*)
236+
function SDL_isupper(x: cint):cint; cdecl;
237+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_isupper' {$ENDIF} {$ENDIF};
238+
239+
(**
240+
* Check if the provided ASCII character is a lowercase letter.
241+
*
242+
* \returns 1 if the check passes, 0 otherwise.
243+
*
244+
* \since This function is available since SDL 2.0.12.
245+
*)
246+
function SDL_islower(x: cint):cint; cdecl;
247+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_islower' {$ENDIF} {$ENDIF};
248+
249+
(**
250+
* Check if the provided ASCII character is a printable character (including space).
251+
*
252+
* \returns 1 if the check passes, 0 otherwise.
253+
*
254+
* \since This function is available since SDL 2.0.16.
255+
*)
256+
function SDL_isprint(x: cint):cint; cdecl;
257+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_isprint' {$ENDIF} {$ENDIF};
258+
259+
(**
260+
* Check if the provided ASCII character is a printable character (excluding space).
261+
*
262+
* \returns 1 if the check passes, 0 otherwise.
263+
*
264+
* \since This function is available since SDL 2.0.16.
265+
*)
266+
function SDL_isgraph(x: cint):cint; cdecl;
267+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_isgraph' {$ENDIF} {$ENDIF};
268+
269+
270+
(*** --- iconv functions --- ***)
271+
272+
141273
(**
142274
* This function converts a string between encodings in one pass, returning a
143275
* string that must be freed with SDL_free(), or NIL on error.

0 commit comments

Comments
 (0)