]> git.sur5r.net Git - cc65/blob - doc/funcref.sgml
Fixed a problem and a typo
[cc65] / doc / funcref.sgml
1 <!doctype linuxdoc system>
2
3 <article>
4 <title>cc65 function reference
5 <author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
6 <date>07.11.2002
7
8 <abstract>
9 cc65 is a C compiler for 6502 based systems. This function reference describes
10 the C functions available in the standard library.
11 </abstract>
12
13 <!-- Table of contents -->
14 <toc>
15
16 <!-- Begin the document -->
17
18 <sect>Introduction<p>
19
20 cc65 is a C compiler for 6502 based systems. It implements a subset of the ISO
21 C standard plus additional functions specially crafted for 6502 systems or
22 just some of the supported machines. This function refrence describes the
23 available functions together with any limitations.
24
25 For an overview about the available libraries, their purpose, and any
26 differences to the ISO standard, please have a look at the <htmlurl
27 url="library.html" name="cc65 Library Overview">.
28
29 <bf/Note:/ Standard C functions are listed here, but not described in detail.
30 Since these functions behave identical on all standard compliant systems, they
31 are described in any book covering standard C.
32
33 Each entry for a function contains a detailed description
34
35 <quote>
36 <descrip>
37 <tag/Function/Summary of what <bf/function/ does.
38 <tag/Header/The header file that contains the declaration.
39 <tag/Declaration/Describes the needed header files and declaration of the
40 function.
41 <tag/Description/Description of the function.
42 <tag/Limits/Limits.
43 <tag/Availability/The availability of the function.
44 <tag/See also/Other related functions.
45 <tag/Example/A piece of actual code using the function.
46 </descrip>
47 </quote>
48
49
50 <sect>Functions by header file<p>
51
52 <sect1><tt/6502.h/<label id="6502.h"><p>
53
54 <itemize>
55 <item><ref id="BRK" name="BRK">
56 <item><ref id="CLI" name="CLI">
57 <item><ref id="SEI" name="SEI">
58 <item><ref id="_sys" name="_sys">
59 <item><ref id="getcpu" name="getcpu">
60 <!-- <item><ref id="reset_brk" name="reset_brk"> -->
61 <!-- <item><ref id="set_brk" name="set_brk"> -->
62 </itemize>
63
64
65 <sect1><tt/assert.h/<label id="assert.h"><p>
66
67 <itemize>
68 <item><ref id="assert" name="assert">
69 </itemize>
70
71
72 <sect1><tt/c128.h/<label id="c128.h"><p>
73
74 <itemize>
75 <item><ref id="c64mode" name="c64mode">
76 <item><ref id="fast" name="fast">
77 <item><ref id="toggle_videomode" name="toggle_videomode">
78 <item><ref id="slow" name="slow">
79 </itemize>
80
81
82 <sect1><tt/conio.h/<label id="conio.h"><p>
83
84 <itemize>
85 <item><ref id="bgcolor" name="bgcolor">
86 <item><ref id="bordercolor" name="bordercolor">
87 <item><ref id="cclear" name="cclear">
88 <item><ref id="cclearxy" name="cclearxy">
89 <item><ref id="cgetc" name="cgetc">
90 <item><ref id="chline" name="chline">
91 <item><ref id="chlinexy" name="chlinexy">
92 <item><ref id="clrscr" name="clrscr">
93 <!-- <item><ref id="cprintf" name="cprintf"> -->
94 <!-- <item><ref id="cputc" name="cputc"> -->
95 <!-- <item><ref id="cputcxy" name="cputcxy"> -->
96 <!-- <item><ref id="cputs" name="cputs"> -->
97 <!-- <item><ref id="cputsxy" name="cputsxy"> -->
98 <item><ref id="cursor" name="cursor">
99 <item><ref id="cvline" name="cvline">
100 <item><ref id="cvlinexy" name="cvlinexy">
101 <item><ref id="gotox" name="gotox">
102 <item><ref id="gotoxy" name="gotoxy">
103 <item><ref id="gotoy" name="gotoy">
104 <item><ref id="kbhit" name="kbhit">
105 <item><ref id="revers" name="revers">
106 <item><ref id="screensize" name="screensize">
107 <item><ref id="textcolor" name="textcolor">
108 <!-- <item><ref id="vcprintf" name="vcprintf"> -->
109 <item><ref id="wherex" name="wherex">
110 <item><ref id="wherey" name="wherey">
111 </itemize>
112
113
114 <sect1><tt/ctype.h/<label id="ctype.h"><p>
115
116 <itemize>
117 <item><ref id="isalnum" name="isalnum">
118 <item><ref id="isalpha" name="isalpha">
119 <item><ref id="isascii" name="isascii">
120 <item><ref id="isblank" name="isblank">
121 <item><ref id="iscntrl" name="iscntrl">
122 <item><ref id="isdigit" name="isdigit">
123 <item><ref id="isgraph" name="isgraph">
124 <item><ref id="islower" name="islower">
125 <item><ref id="isprint" name="isprint">
126 <item><ref id="ispunct" name="ispunct">
127 <item><ref id="isspace" name="isspace">
128 <item><ref id="isupper" name="isupper">
129 <item><ref id="isxdigit" name="isxdigit">
130 <item><ref id="tolower" name="tolower">
131 <item><ref id="toupper" name="toupper">
132 </itemize>
133
134
135 <sect1><tt/em.h/<label id="em.h"><p>
136
137 <itemize>
138 <item><ref id="em_commit" name="em_commit">
139 <item><ref id="em_copyfrom" name="em_copyfrom">
140 <item><ref id="em_copyto" name="em_copyto">
141 <item><ref id="em_load_driver" name="em_load_driver">
142 <item><ref id="em_map" name="em_map">
143 <item><ref id="em_pagecount" name="em_pagecount">
144 <item><ref id="em_unload" name="em_unload">
145 <item><ref id="em_use" name="em_use">
146 </itemize>
147
148
149 <sect1><tt/fcntl.h/<label id="fcntl.h"><p>
150
151 <itemize>
152 <item><ref id="close" name="close">
153 <item><ref id="creat" name="creat">
154 <item><ref id="open" name="open">
155 </itemize>
156
157
158 <sect1><tt/signal.h/<label id="signal.h"><p>
159
160 <itemize>
161 <item><ref id="raise" name="raise">
162 <item><ref id="signal" name="signal">
163 </itemize>
164
165
166 <sect1><tt/stdlib.h/<label id="stdlib.h"><p>
167
168 <itemize>
169 <item><ref id="_heapadd" name="_heapadd">
170 <item><ref id="_heapmaxavail" name="_heapmaxavail">
171 <item><ref id="_heapmemavail" name="_heapmemavail">
172 <item><ref id="_randomize" name="_randomize">
173 <item><ref id="_swap" name="_swap">
174 <item><ref id="abort" name="abort">
175 <item><ref id="abs" name="abs">
176 <item><ref id="atexit" name="atexit">
177 <item><ref id="atoi" name="atoi">
178 <item><ref id="atol" name="atol">
179 <!-- <item><ref id="bsearch" name="bsearch"> -->
180 <item><ref id="calloc" name="calloc">
181 <!-- <item><ref id="div" name="div"> -->
182 <item><ref id="exit" name="exit">
183 <item><ref id="free" name="free">
184 <item><ref id="getenv" name="getenv">
185 <item><ref id="itoa" name="itoa">
186 <item><ref id="labs" name="labs">
187 <item><ref id="ltoa" name="ltoa">
188 <item><ref id="malloc" name="malloc">
189 <!-- <item><ref id="qsort" name="qsort"> -->
190 <item><ref id="rand" name="rand">
191 <item><ref id="realloc" name="realloc">
192 <item><ref id="srand" name="srand">
193 <item><ref id="ultoa" name="ultoa">
194 <item><ref id="utoa" name="utoa">
195 </itemize>
196
197
198 <sect1><tt/string.h/<label id="string.h"><p>
199
200 <itemize>
201 <!-- <item><ref id="_stroserror" name="_stroserror"> -->
202 <item><ref id="bzero" name="bzero">
203 <!-- <item><ref id="memchr" name="memchr"> -->
204 <item><ref id="memcpy" name="memcpy">
205 <item><ref id="memmove" name="memmove">
206 <item><ref id="memset" name="memset">
207 <!-- <item><ref id="strcasecmp" name="strcasecmp"> -->
208 <item><ref id="strcat" name="strcat">
209 <item><ref id="strchr" name="strchr">
210 <!-- <item><ref id="strcmp" name="strcmp"> -->
211 <!-- <item><ref id="strcoll" name="strcoll"> -->
212 <item><ref id="strcpy" name="strcpy">
213 <!-- <item><ref id="strcspn" name="strcspn"> -->
214 <!-- <item><ref id="strdup" name="strdup"> -->
215 <!-- <item><ref id="strerror" name="strerror"> -->
216 <!-- <item><ref id="stricmp" name="stricmp"> -->
217 <item><ref id="strlen" name="strlen">
218 <item><ref id="strlower" name="strlower">
219 <item><ref id="strlwr" name="strlwr">
220 <!-- <item><ref id="strncat" name="strncat"> -->
221 <!-- <item><ref id="strncmp" name="strncmp"> -->
222 <item><ref id="strncpy" name="strncpy">
223 <item><ref id="strrchr" name="strrchr">
224 <!-- <item><ref id="strspn" name="strspn"> -->
225 <!-- <item><ref id="strstr" name="strstr"> -->
226 <!-- <item><ref id="strtok" name="strtok"> -->
227 <!-- <item><ref id="strxfrm" name="strxfrm"> -->
228 <item><ref id="strupper" name="strupper">
229 <item><ref id="strupr" name="strupr">
230 </itemize>
231
232
233 <sect1><tt/unistd.h/<label id="unistd.h"><p>
234
235 <itemize>
236 <!-- <item><ref id="chdir" name="chdir"> -->
237 <!-- <item><ref id="getcwd" name="getcwd"> -->
238 <!-- <item><ref id="lseek" name="lseek"> -->
239 <!-- <item><ref id="mkdir" name="mkdir"> -->
240 <!-- <item><ref id="read" name="read"> -->
241 <!-- <item><ref id="rmdir" name="rmdir"> -->
242 <item><ref id="sleep" name="sleep">
243 <!-- <item><ref id="unlink" name="unlink"> -->
244 <!-- <item><ref id="write" name="write"> -->
245 </itemize>
246
247
248
249
250 <sect>Alphabetical function reference<p>
251
252 <sect1>_heapadd<label id="_heapadd"><p>
253
254 <quote>
255 <descrip>
256 <tag/Function/Add a block to the heap.
257 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
258 <tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
259 <tag/Description/The function adds a block of raw memory to the heap.
260 <tag/Limits/
261 <itemize>
262 <item>The minimum blocksize that can be added is 6 bytes; the function will
263 ignore blocks with smaller sizes.
264 </itemize>
265 <tag/Availability/cc65
266 <tag/See also/
267 <ref id="_heapmaxavail" name="_heapmaxavail">,
268 <ref id="_heapmemavail" name="_heapmemavail">,
269 <ref id="calloc" name="calloc">,
270 <ref id="free" name="free">,
271 <ref id="malloc" name="malloc">,
272 <ref id="realloc" name="realloc">
273 <tag/Example/None.
274 </descrip>
275 </quote>
276
277
278 <sect1>_heapmaxavail<label id="_heapmaxavail"><p>
279
280 <quote>
281 <descrip>
282 <tag/Function/Return the largest block that is available on the heap.
283 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
284 <tag/Declaration/<tt/size_t __fastcall__ _heapmaxavail (void);/
285 <tag/Description/The function returns the size of the largest block that may
286 be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
287 <tag/Availability/cc65
288 <tag/See also/
289 <ref id="_heapadd" name="_heapadd">,
290 <ref id="_heapmemavail" name="_heapmemavail">,
291 <ref id="calloc" name="calloc">,
292 <ref id="free" name="free">,
293 <ref id="malloc" name="malloc">,
294 <ref id="realloc" name="realloc">
295 <tag/Example/None.
296 </descrip>
297 </quote>
298
299
300 <sect1>_heapmemavail<label id="_heapmemavail"><p>
301
302 <quote>
303 <descrip>
304 <tag/Function/Return the total available space on the heap.
305 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
306 <tag/Declaration/<tt/size_t __fastcall__ _heapmemavail (void);/
307 <tag/Description/The function returns the total number of bytes available on
308 the heap.
309 <tag/Limits/
310 <itemize>
311 <item>This function is of less use than usually assumed, since the returned
312 heap space may be available but not in one block. So even if this function
313 says that several times more heap space is available than needed, <ref
314 id="malloc" name="malloc"> may still return <tt/NULL/.
315 </itemize>
316 <tag/Availability/cc65
317 <tag/See also/
318 <ref id="_heapadd" name="_heapadd">,
319 <ref id="_heapmaxavail" name="_heapmaxavail">,
320 <ref id="calloc" name="calloc">,
321 <ref id="free" name="free">,
322 <ref id="malloc" name="malloc">,
323 <ref id="realloc" name="realloc">
324 <tag/Example/None.
325 </descrip>
326 </quote>
327
328
329 <sect1>_randomize<label id="_randomize"><p>
330
331 <quote>
332 <descrip>
333 <tag/Function/Initialize the pseudo random number generator.
334 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
335 <tag/Declaration/<tt/void _randomize (void);/
336 <tag/Description/The function initializes the random number generator with
337 a seed derived from fast changing hardware events, so the seed itself can be
338 considered random to a certain degree.
339 <tag/Limits/<itemize>
340 <item>The randomness of the seed depends on the machine hardware.
341 </itemize>
342 <tag/Availability/cc65
343 <tag/See also/
344 <ref id="rand" name="rand">,
345 <ref id="srand" name="srand">
346 <tag/Example/None.
347 </descrip>
348 </quote>
349
350
351 <sect1>_swap<label id="_swap"><p>
352
353 <quote>
354 <descrip>
355 <tag/Function/Swap the contents of memory areas.
356 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
357 <tag/Declaration/<tt/void __fastcall__ _swap (void* p, void* q, size_t size);/
358 <tag/Description/<tt/_swap/ will swap (exchange) the contents of the two memory
359 areas pointed to by <tt/p/ and <tt/q/. Both memory areas are assumed to be
360 <tt/size/ bytes in size.
361 <tag/Limits/<itemize>
362 <item>The memory areas may not overlap, otherwise the results are undefined.
363 <item>The function is only available as fastcall function, so it may only be
364 used in presence of a prototype.
365 </itemize>
366 <tag/Availability/cc65
367 <tag/See also/
368 <ref id="memcpy" name="memcpy">,
369 <ref id="memmove" name="memmove">
370 <tag/Example/None.
371 </descrip>
372 </quote>
373
374
375 <sect1>_sys<label id="_sys"><p>
376
377 <quote>
378 <descrip>
379 <tag/Function/Call a subroutine passing register values.
380 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
381 <tag/Declaration/<tt/void __fastcall__ _sys (struct regs* r);/
382 <tag/Description/The function will call the subroutine at the address
383 specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
384 registers and the CPU flags are set to the values given in the <tt/regs/
385 structure. On return from the subroutine, the new values of the registers and
386 flags are stored back overwriting the old values.
387 <tag/Limits/<itemize>
388 <item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
389 when calling the subroutine (they are unchanged from their current values).
390 <item>The function is only available as fastcall function, so it may only be
391 used in presence of a prototype.
392 </itemize>
393 <tag/Availability/cc65
394 <tag/Example/None.
395 </descrip>
396 </quote>
397
398
399 <sect1>BRK<label id="BRK"><p>
400
401 <quote>
402 <descrip>
403 <tag/Function/Insert a 6502 BRK instrunction into the code.
404 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
405 <tag/Declaration/<tt/void BRK (void);/
406 <tag/Description/The function will insert a 6502 BRK instruction into the code
407 which may be used to trigger a debugger.
408 <tag/Limits/<itemize>
409 <item>The function is actually a macro.
410 <item>The inserted instruction may lead to unexpected results if no debugger
411 is present.
412 </itemize>
413 <tag/Availability/cc65
414 <tag/See also/
415 <ref id="CLI" name="CLI">,
416 <ref id="SEI" name="SEI">
417 <tag/Example/None.
418 </descrip>
419 </quote>
420
421
422 <sect1>CLI<label id="CLI"><p>
423
424 <quote>
425 <descrip>
426 <tag/Function/Insert a 6502 CLI instrunction into the code.
427 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
428 <tag/Declaration/<tt/void CLI (void);/
429 <tag/Description/The function will insert a 6502 CLI instruction into the code,
430 so interrupts are disabled. Note that non maskable interrupts cannot be
431 disabled.
432 <tag/Limits/<itemize>
433 <item>The function is actually a macro.
434 <item>Disabling interrupts may lead to unexpected results.
435 </itemize>
436 <tag/Availability/cc65
437 <tag/See also/
438 <ref id="BRK" name="BRK">,
439 <ref id="SEI" name="SEI">
440 <tag/Example/None.
441 </descrip>
442 </quote>
443
444
445 <sect1>SEI<label id="SEI"><p>
446
447 <quote>
448 <descrip>
449 <tag/Function/Insert a 6502 SEI instrunction into the code.
450 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
451 <tag/Declaration/<tt/void SEI (void);/
452 <tag/Description/The function will insert a 6502 SEI instruction into the code,
453 so interrupts are enabled. Enabling interrupts has no effects if they are
454 already enabled (the default).
455 <tag/Limits/<itemize>
456 <item>The function is actually a macro.
457 </itemize>
458 <tag/Availability/cc65
459 <tag/See also/
460 <ref id="BRK" name="BRK">,
461 <ref id="CLI" name="CLI">
462 <tag/Example/None.
463 </descrip>
464 </quote>
465
466
467 <sect1>abort<label id="abort"><p>
468
469 <quote>
470 <descrip>
471 <tag/Function/Terminates a program abnormally.
472 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
473 <tag/Declaration/<tt/void abort (void);/
474 <tag/Description/<tt/abort/ raises <tt/SIGABRT/, writes a termination message
475 on stderr, then terminates the program with an exit code of 3.
476 <tag/Availability/ISO 9899
477 <tag/See also/
478 <ref id="assert" name="assert">,
479 <ref id="exit" name="exit">,
480 <ref id="raise" name="raise">
481 <tag/Example/None.
482 </descrip>
483 </quote>
484
485
486 <sect1>abs<label id="abs"><p>
487
488 <quote>
489 <descrip>
490 <tag/Function/Returns the absolute value of an integer.
491 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
492 <tag/Declaration/<tt/int __fastcall__ abs (int v);/
493 <tag/Description/<tt/abs/ returns the absolute value of the argument passed to
494 the function.
495 <tag/Limits/<itemize>
496 <item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
497 <item>The function is only available as fastcall function, so it may only be
498 used in presence of a prototype.
499 </itemize>
500 <tag/Availability/ISO 9899
501 <tag/See also/
502 <ref id="labs" name="labs">
503 <tag/Example/None.
504 </descrip>
505 </quote>
506
507
508 <sect1>assert<label id="assert"><p>
509
510 <quote>
511 <descrip>
512 <tag/Function/Test a condition and possibly abort.
513 <tag/Header/<tt/<ref id="assert.h" name="assert.h">/
514 <tag/Declaration/<tt/void assert (int cond);/
515 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
516 statement. If the condition evaluates t zero (false), assert prints a message
517 on stderr and aborts the program.
518 <tag/Limits/<itemize>
519 <item>The function is actually a macro.
520 </itemize>
521 <tag/Availability/ISO 9899
522 <tag/See also/
523 <ref id="abort" name="abort">,
524 <ref id="exit" name="exit">
525 <tag/Example/None.
526 </descrip>
527 </quote>
528
529
530 <sect1>atexit<label id="atexit"><p>
531
532 <quote>
533 <descrip>
534 <tag/Function/Register an exit function.
535 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
536 <tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
537 <tag/Description/<tt/atexit/ registers the function pointed to by
538 <tt/exitfunc/ as an exit function. Exit functions are called when the program
539 terminates, they are called in LIFO order (the last function registered is
540 called first). <tt/atexit/ returns zero on success and a nonzero value on
541 failure.
542 <tag/Limits/<itemize>
543 <item>A maximum of 5 exit functions can be registered.
544 <item>There is no way to unregister an exit function.
545 <item>The function is only available as fastcall function, so it may only be
546 used in presence of a prototype.
547 </itemize>
548 <tag/Availability/ISO 9899
549 <tag/See also/
550 <ref id="abort" name="abort">,
551 <ref id="exit" name="exit">
552 <tag/Example/None.
553 </descrip>
554 </quote>
555
556
557 <sect1>atoi<label id="atoi"><p>
558
559 <quote>
560 <descrip>
561 <tag/Function/Convert a string to an integer.
562 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
563 <tag/Declaration/<tt/int __fastcall__ atoi (const char* s);/
564 <tag/Description/<tt/atoi/ converts the given string into an integer.
565 Conversion stops as soon as any invalid character is encountered.
566 <tag/Limits/<itemize>
567 <item>There is no way to detect any conversion errors.
568 <item>The function does not check for an numerical overflow when converting.
569 <item>The function is only available as fastcall function, so it may only be
570 used in presence of a prototype.
571 </itemize>
572 <tag/Availability/ISO 9899
573 <tag/See also/
574 <ref id="atol" name="atol">,
575 <ref id="itoa" name="itoa">,
576 <ref id="ltoa" name="ltoa">,
577 <ref id="ultoa" name="ultoa">,
578 <ref id="utoa" name="utoa">
579 <tag/Example/None.
580 </descrip>
581 </quote>
582
583
584 <sect1>atol<label id="atol"><p>
585
586 <quote>
587 <descrip>
588 <tag/Function/Convert a string to a long integer.
589 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
590 <tag/Declaration/<tt/long __fastcall__ atol (const char* s);/
591 <tag/Description/<tt/atol/ converts the given string into a long integer.
592 Conversion stops as soon as any invalid character is encountered.
593 <tag/Limits/<itemize>
594 <item>There is no way to detect any conversion errors.
595 <item>The function does not check for an numerical overflow when converting.
596 <item>The function is only available as fastcall function, so it may only be
597 used in presence of a prototype.
598 </itemize>
599 <tag/Availability/ISO 9899
600 <tag/See also/
601 <ref id="atoi" name="atoi">,
602 <ref id="itoa" name="itoa">,
603 <ref id="ltoa" name="ltoa">,
604 <ref id="ultoa" name="ultoa">,
605 <ref id="utoa" name="utoa">
606 <tag/Example/None.
607 </descrip>
608 </quote>
609
610
611 <sect1>bgcolor<label id="bgcolor"><p>
612
613 <quote>
614 <descrip>
615 <tag/Function/Set the background text color.
616 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
617 <tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
618 <tag/Description/The function will set a new background text color. It returns
619 the old (current) background color.
620 <tag/Limits/<itemize>
621 <item>Background colors are system dependent. The function may have no effect
622 on systems where the background color cannot be changed.
623 <item>The function is only available as fastcall function, so it may only be
624 used in presence of a prototype.
625 </itemize>
626 <tag/Availability/cc65
627 <tag/See also/
628 <ref id="bordercolor" name="bordercolor">,
629 <ref id="textcolor" name="textcolor">
630 <tag/Example/None.
631 </descrip>
632 </quote>
633
634
635 <sect1>bordercolor<label id="bordercolor"><p>
636
637 <quote>
638 <descrip>
639 <tag/Function/Set the border (frame) color.
640 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
641 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
642 <tag/Description/The function will set a new border color. It returns the old
643 (current) border color.
644 <tag/Limits/<itemize>
645 <item>Border colors are system dependent. The function may have no effect
646 on systems where the border color cannot be changed.
647 <item>The function is only available as fastcall function, so it may only
648 be used in presence of a prototype.
649 </itemize>
650 <tag/Availability/cc65
651 <tag/See also/
652 <ref id="bgcolor" name="bgcolor">,
653 <ref id="textcolor" name="textcolor">
654 <tag/Example/None.
655 </descrip>
656 </quote>
657
658
659 <sect1>bzero<label id="bzero"><p>
660
661 <quote>
662 <descrip>
663 <tag/Function/Fill a memory area with zeroes.
664 <tag/Header/<tt/<ref id="string.h" name="string.h">/
665 <tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
666 <tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
667 zero.
668 <tag/Limits/
669 <itemize>
670 <item>The function is non standard and therefore only available in non ANSI
671 mode. You should use <tt/<ref id="memset" name="memset">/ instead.
672 <item>The function is only available as fastcall function, so it may only
673 be used in presence of a prototype.
674 </itemize>
675 <tag/Availability/cc65
676 <tag/See also/
677 <ref id="_swap" name="_swap">,
678 <ref id="memcpy" name="memcpy">,
679 <ref id="memmove" name="memmove">,
680 <ref id="memset" name="memset">,
681 <tag/Example/None.
682 </descrip>
683 </quote>
684
685
686 <sect1>c64mode<label id="c64mode"><p>
687
688 <quote>
689 <descrip>
690 <tag/Function/Switch the C128 into C64 compatible mode.
691 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
692 <tag/Declaration/<tt/void c64mode (void);/
693 <tag/Description/The function will cause the machine to reboot into C64 mode.
694 <tag/Limits/<itemize>
695 <item>The function is specific to the C128.
696 <item>The function will not return to the caller.
697 </itemize>
698 <tag/Availability/C128
699 <tag/Example/None.
700 </descrip>
701 </quote>
702
703
704 <sect1>calloc<label id="calloc"><p>
705
706 <quote>
707 <descrip>
708 <tag/Function/Allocate and clear memory.
709 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
710 <tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
711 <tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
712 of size <tt/size/, clears the whole block with binary zeroes and returns a
713 pointer to it. On error (not enough memory available), <tt/calloc/ returns
714 <tt/NULL/.
715 <tag/Limits/
716 <itemize>
717 <item>Clearing the memory may not have the expected effect on all platforms:
718 pointers in the block may not be <tt/NULL/ and floating point variables may
719 not be zero (0.0). In other words: The "clearing" effect of this function
720 should be used with care for portable programs.
721 <item>The function is only available as fastcall function, so it may only
722 be used in presence of a prototype.
723 </itemize>
724 <tag/Availability/ISO 9899
725 <tag/See also/
726 <ref id="_heapadd" name="_heapadd">,
727 <ref id="_heapmaxavail" name="_heapmaxavail">,
728 <ref id="_heapmemavail" name="_heapmemavail">,
729 <ref id="free" name="free">,
730 <ref id="malloc" name="malloc">,
731 <ref id="realloc" name="realloc">
732 <tag/Example/None.
733 </descrip>
734 </quote>
735
736
737 <sect1>cclear<label id="cclear"><p>
738
739 <quote>
740 <descrip>
741 <tag/Function/Clear part of a line (write a given amount of spaces).
742 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
743 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
744 <tag/Description/The function clears part of a line by writing <tt/length/
745 spaces in the current text color.
746 <tag/Limits/<itemize>
747 <item>The function is only available as fastcall function, so it may
748 only be used in presence of a prototype.
749 </itemize>
750 <tag/Availability/cc65
751 <tag/See also/
752 <ref id="cclearxy" name="cclearxy">,
753 <ref id="clrscr" name="clrscr">
754 <tag/Example/None.
755 </descrip>
756 </quote>
757
758
759 <sect1>cclearxy<label id="cclearxy"><p>
760
761 <quote>
762 <descrip>
763 <tag/Function/Clear part of a line (write a given amount of spaces) starting
764 at a specific screen position.
765 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
766 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char length);/
767 <tag/Description/The function moves the cursor to a specific position, and
768 will then clear part of the line by writing <tt/length/ spaces in the current
769 text color.
770 <tag/Limits/<itemize>
771 <item>The function is only available as fastcall function, so it may
772 only be used in presence of a prototype.
773 </itemize>
774 <tag/Availability/cc65
775 <tag/See also/
776 <ref id="cclear" name="cclear">,
777 <ref id="clrscr" name="clrscr">
778 <tag/Example/None.
779 </descrip>
780 </quote>
781
782
783 <sect1>cgetc<label id="cgetc"><p>
784
785 <quote>
786 <descrip>
787 <tag/Function/Read a character from the keyboard.
788 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
789 <tag/Declaration/<tt/char cgetc (void);/
790 <tag/Description/The function reads a character from the keyboard. If there is
791 no character available, <tt/cgetc/ waits until the user presses a key. If the
792 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
793 displayed while waiting.
794 <tag/Limits/<itemize>
795 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
796 from this buffer and wait only if the buffer is empty.
797 </itemize>
798 <tag/Availability/cc65
799 <tag/See also/
800 <ref id="cursor" name="cursor">,
801 <ref id="kbhit" name="kbhit">
802 <tag/Example/None.
803 </descrip>
804 </quote>
805
806
807 <sect1>chline<label id="chline"><p>
808
809 <quote>
810 <descrip>
811 <tag/Function/Output a horizontal line in text mode.
812 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
813 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
814 <tag/Description/The function outputs a horizontal line with the given length
815 starting at the current cursor position.
816 <tag/Limits/<itemize>
817 <item>The character used to draw the horizontal line is system dependent.
818 If available, a line drawing character is used. Drawing a line that is partially
819 off screen leads to undefined behaviour.
820 <item>The function is only available as fastcall function, so it may only be
821 used in presence of a prototype.
822 </itemize>
823 <tag/Availability/cc65
824 <tag/See also/
825 <ref id="chlinexy" name="chlinexy">,
826 <ref id="cvline" name="cvline">,
827 <ref id="cvlinexy" name="cvlinexy">
828 <tag/Example/None.
829 </descrip>
830 </quote>
831
832
833 <sect1>chlinexy<label id="chlinexy"><p>
834
835 <quote>
836 <descrip>
837 <tag/Function/Output a horizontal line at a given position in text mode.
838 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
839 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
840 <tag/Description/The function outputs a horizontal line with the given length
841 starting at a given position.
842 <tag/Limits/<itemize>
843 <item>The character used to draw the horizontal line is system dependent.
844 If available, a line drawing character is used. Drawing a line that is partially
845 off screen leads to undefined behaviour.
846 <item>The function is only available as fastcall function, so it may only be
847 used in presence of a prototype.
848 </itemize>
849 <tag/Availability/cc65
850 <tag/See also/
851 <ref id="chline" name="chline">,
852 <ref id="cvline" name="cvline">,
853 <ref id="cvlinexy" name="cvlinexy">
854 <tag/Example/None.
855 </descrip>
856 </quote>
857
858
859 <sect1>clrscr<label id="clrscr"><p>
860
861 <quote>
862 <descrip>
863 <tag/Function/Clear the text screen.
864 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
865 <tag/Declaration/<tt/void clrscr (void);/
866 <tag/Description/The function clears the text screen and moves the cursor to
867 the upper left corner.
868 <tag/Availability/cc65
869 <tag/See also/
870 <ref id="cclear" name="cclear">,
871 <ref id="cclearxy" name="cclearxy">
872 <tag/Example/None.
873 </descrip>
874 </quote>
875
876
877 <sect1>close<label id="close"><p>
878
879 <quote>
880 <descrip>
881 <tag/Function/Close a file descriptor.
882 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
883 <tag/Declaration/<tt/int __fastcall__ close (int fd);/
884 <tag/Description/The function closes the given file descriptor. It returns zero
885 on success and -1 on error. If an error occurs, the cause can be determined by
886 reading the <tt/errno/ variable.
887 <tag/Limits/<itemize>
888 <item>The function is only available as fastcall function, so it may only
889 be used in presence of a prototype.
890 </itemize>
891 <tag/Availability/POSIX
892 <tag/See also/
893 <ref id="creat" name="creat">,
894 <ref id="open" name="open">
895 <tag/Example/None.
896 </descrip>
897 </quote>
898
899
900 <sect1>creat<label id="creat"><p>
901
902 <quote>
903 <descrip>
904 <tag/Function/Create a file.
905 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
906 <tag/Declaration/<tt/int __fastcall__ creat (const char* name, unsigned mode);/
907 <tag/Description/<tt/creat/ creates a new file and returns the file descriptor
908 associated with it. On error, -1 is returned and an error code is stored in
909 <tt/errno/.
910 <tag/Limits/<itemize>
911 <item><tt/creat/ is identical to calling <tt/<ref id="open" name="open">/ with
912 <tt/flags/ equal to <tt/O_WRONLY | O_CREAT | O_TRUNC/.
913 <item>The function is only available as fastcall function, so it may only
914 be used in presence of a prototype.
915 </itemize>
916 <tag/Availability/POSIX
917 <tag/See also/
918 <ref id="close" name="close">,
919 <ref id="open" name="open">
920 <tag/Example/None.
921 </descrip>
922 </quote>
923
924
925 <sect1>cursor<label id="cursor"><p>
926
927 <quote>
928 <descrip>
929 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
930 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
931 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
932 <tag/Description/If the argument to the function is non zero, a blinking cursor
933 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
934 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
935 <tag/Limits/<itemize>
936 <item>The function is only available as fastcall function, so it may only
937 be used in presence of a prototype.
938 </itemize>
939 <tag/Availability/cc65
940 <tag/See also/
941 <ref id="cgetc" name="cgetc">,
942 <ref id="kbhit" name="kbhit">
943 <tag/Example/None.
944 </descrip>
945 </quote>
946
947
948 <sect1>cvline<label id="cvline"><p>
949
950 <quote>
951 <descrip>
952 <tag/Function/Output a vertical line in text mode.
953 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
954 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
955 <tag/Description/The function outputs a vertical line with the given length
956 starting at the current cursor position.
957 <tag/Limits/<itemize>
958 <item>The character used to draw the vertical line is system dependent.
959 If available, a line drawing character is used. Drawing a line that is partially
960 off screen leads to undefined behaviour.
961 <item>The function is only available as fastcall function, so it may only be
962 used in presence of a prototype.
963 </itemize>
964 <tag/Availability/cc65
965 <tag/See also/
966 <ref id="chline" name="chline">,
967 <ref id="chlinexy" name="chlinexy">,
968 <ref id="cvlinexy" name="cvlinexy">
969 <tag/Example/None.
970 </descrip>
971 </quote>
972
973
974 <sect1>cvlinexy<label id="cvlinexy"><p>
975
976 <quote>
977 <descrip>
978 <tag/Function/Output a vertical line at a given position in text mode.
979 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
980 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
981 <tag/Description/The function outputs a vertical line with the given length
982 starting at a given position.
983 <tag/Limits/<itemize>
984 <item>The character used to draw the vertical line is system dependent.
985 If available, a line drawing character is used. Drawing a line that is partially
986 off screen leads to undefined behaviour.
987 <item>The function is only available as fastcall function, so it may only be
988 used in presence of a prototype.
989 </itemize>
990 <tag/Availability/cc65
991 <tag/See also/
992 <ref id="chline" name="chline">,
993 <ref id="chlinexy" name="chlinexy">,
994 <ref id="cvline" name="cvline">
995 <tag/Example/None.
996 </descrip>
997 </quote>
998
999
1000 <sect1>em_commit<label id="em_commit"><p>
1001
1002 <quote>
1003 <descrip>
1004 <tag/Function/Commit changes into extended memory.
1005 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1006 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
1007 <tag/Description/Commit changes in the memory window to extended storage. If
1008 the contents of the memory window have been changed, these changes may be lost
1009 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
1010 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
1011 name="em_copyto">/ are called without calling <tt/em_commit/ first.
1012 <tag/Limits/<itemize>
1013 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
1014 memory window are discarded, it does just mean that the drivers is allowed
1015 to discard it.
1016 <item>The function is only available as fastcall function, so it may only be
1017 used in presence of a prototype.
1018 <item>The function produces undefined results if no extended memory driver is
1019 loaded.
1020 </itemize>
1021 <tag/Availability/cc65
1022 <tag/See also/
1023 <ref id="em_load_driver" name="em_load_driver">,
1024 <ref id="em_map" name="em_map">,
1025 <ref id="em_use" name="em_use">
1026 <tag/Example/None.
1027 </descrip>
1028 </quote>
1029
1030
1031 <sect1>em_copyfrom<label id="em_copyfrom"><p>
1032
1033 <quote>
1034 <descrip>
1035 <tag/Function/Copy from extended into normal memory.
1036 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1037 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
1038 <tag/Description/Copy data from extended memory into linear memory. Source and
1039 target addresses as well as the number of bytes to transfer are specified in
1040 the <tt/em_copy/ structure that is passed as a parameter.
1041 <tag/Limits/<itemize>
1042 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
1043 made any changes to the data in the window, call <tt/<ref id="em_commit"
1044 name="em_commit">/ first, or the changes are lost.
1045 <item>The function is only available as fastcall function, so it may only be
1046 used in presence of a prototype.
1047 <item>The function produces undefined results if no extended memory driver is
1048 loaded.
1049 </itemize>
1050 <tag/Availability/cc65
1051 <tag/See also/
1052 <ref id="em_commit" name="em_commit">,
1053 <ref id="em_copyto" name="em_copyto">,
1054 <ref id="em_load_driver" name="em_load_driver">
1055 <tag/Example/None.
1056 </descrip>
1057 </quote>
1058
1059
1060 <sect1>em_copyto<label id="em_copyto"><p>
1061
1062 <quote>
1063 <descrip>
1064 <tag/Function/Copy from normal into extended memory.
1065 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1066 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
1067 <tag/Description/Copy data from linear into extended memory. Source and
1068 target addresses as well as the number of bytes to transfer are specified in
1069 the <tt/em_copy/ structure that is passed as a parameter.
1070 <tag/Limits/<itemize>
1071 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
1072 made any changes to the data in the window, call <tt/<ref id="em_commit"
1073 name="em_commit">/ first, or the changes are lost.
1074 <item>The function is only available as fastcall function, so it may only be
1075 used in presence of a prototype.
1076 <item>The function produces undefined results if no extended memory driver is
1077 loaded.
1078 </itemize>
1079 <tag/Availability/cc65
1080 <tag/See also/
1081 <ref id="em_commit" name="em_commit">,
1082 <ref id="em_copyfrom" name="em_copyfrom">,
1083 <ref id="em_load_driver" name="em_load_driver">
1084 <tag/Example/None.
1085 </descrip>
1086 </quote>
1087
1088
1089 <sect1>em_load_driver<label id="em_load_driver"><p>
1090
1091 <quote>
1092 <descrip>
1093 <tag/Function/Load and initialize an extended memory driver.
1094 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1095 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
1096 <tag/Description/Load an extended memory driver into memory and initialize
1097 it. The function returns an error code that tells if all this has been
1098 successful.
1099 <tag/Limits/<itemize>
1100 <item>Not all drivers are able to detect if the supported hardware is really
1101 present.
1102 <item>The function is only available as fastcall function, so it may only be
1103 used in presence of a prototype.
1104 <item>The driver is loaded by name, so currently you must know the type of
1105 extended memory that should be supported. There is no autodetect capability.
1106 </itemize>
1107 <tag/Availability/cc65
1108 <tag/See also/
1109 <ref id="em_unload" name="em_unload">
1110 <tag/Example/None.
1111 </descrip>
1112 </quote>
1113
1114
1115 <sect1>em_map<label id="em_map"><p>
1116
1117 <quote>
1118 <descrip>
1119 <tag/Function/Make a page of extended memory accessible.
1120 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1121 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
1122 <tag/Description/The function maps one page of extended memory into linear
1123 memory and returns a pointer to the page frame. Depending on the hardware
1124 and driver, the data is either mapped into the address space or transfered
1125 into a buffer. If you don't need the actual contents of the page (for example
1126 because you're going to overwrite it completely, it is better to call
1127 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
1128 data if it is possible to avoid that.
1129 <tag/Limits/<itemize>
1130 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
1131 made any changes to the data in the window, call <tt/<ref id="em_commit"
1132 name="em_commit">/ first, or the changes are lost.
1133 <item>The function is only available as fastcall function, so it may only be
1134 used in presence of a prototype.
1135 <item>The function produces undefined results if no extended memory driver is
1136 loaded.
1137 </itemize>
1138 <tag/Availability/cc65
1139 <tag/See also/
1140 <ref id="em_commit" name="em_commit">,
1141 <ref id="em_load_driver" name="em_load_driver">,
1142 <ref id="em_use" name="em_use">
1143 <tag/Example/None.
1144 </descrip>
1145 </quote>
1146
1147
1148 <sect1>em_pagecount<label id="em_pagecount"><p>
1149
1150 <quote>
1151 <descrip>
1152 <tag/Function/Return the number of available extended memory pages.
1153 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1154 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
1155 <tag/Description/The function returns the size of the extended memory supported
1156 by the driver in 256 byte pages.
1157 <tag/Limits/<itemize>
1158 <item>The function returns zero if no extended memory driver is loaded.
1159 <item>The function may return zero if the supported hardware was not detected.
1160 </itemize>
1161 <tag/Availability/cc65
1162 <tag/See also/
1163 <ref id="em_load_driver" name="em_load_driver">
1164 <tag/Example/None.
1165 </descrip>
1166 </quote>
1167
1168
1169 <sect1>em_unload<label id="em_unload"><p>
1170
1171 <quote>
1172 <descrip>
1173 <tag/Function/Unload an extended memory driver.
1174 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1175 <tag/Declaration/<tt/void __fastcall__ em_unload (void);/
1176 <tag/Description/The function unloads a loaded extended memory driver and
1177 frees all memory allocated for the driver.
1178 <tag/Limits/<itemize>
1179 <item>The function does nothing if no driver is loaded.
1180 </itemize>
1181 <tag/Availability/cc65
1182 <tag/See also/
1183 <ref id="em_load_driver" name="em_load_driver">
1184 <tag/Example/None.
1185 </descrip>
1186 </quote>
1187
1188
1189 <sect1>em_use<label id="em_use"><p>
1190
1191 <quote>
1192 <descrip>
1193 <tag/Function/Prepare an extended memory page for use.
1194 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1195 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
1196 <tag/Description/The function maps one page of extended memory into linear
1197 memory and returns a pointer to the page frame. This function is similar to
1198 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
1199 actual memory window in the assumption that the existing data is wrong or
1200 will get overwritten.
1201 <tag/Limits/<itemize>
1202 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
1203 made any changes to the data in the window, call <tt/<ref id="em_commit"
1204 name="em_commit">/ first, or the changes are lost.
1205 <item>The function is only available as fastcall function, so it may only be
1206 used in presence of a prototype.
1207 <item>The function produces undefined results if no extended memory driver is
1208 loaded.
1209 </itemize>
1210 <tag/Availability/cc65
1211 <tag/See also/
1212 <ref id="em_commit" name="em_commit">,
1213 <ref id="em_load_driver" name="em_load_driver">,
1214 <ref id="em_map" name="em_map">
1215 <tag/Example/None.
1216 </descrip>
1217 </quote>
1218
1219
1220 <sect1>exit<label id="exit"><p>
1221
1222 <quote>
1223 <descrip>
1224 <tag/Function/Terminate the program.
1225 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1226 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
1227 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
1228 return code of the program. Before termination, all files are closed, buffered
1229 output is written and any functions registered with <tt/<ref id="atexit"
1230 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
1231 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
1232 name="stdlib.h">/.
1233 <tag/Limits/<itemize>
1234 <item>The function is only available as fastcall function, so it may only
1235 be used in presence of a prototype.
1236 <item>It depends on the host machine if the program return code can be
1237 evaluated or is ignored.
1238 </itemize>
1239 <tag/Availability/ISO 9899
1240 <tag/See also/
1241 <ref id="abort" name="abort">,
1242 <ref id="exit" name="exit">
1243 <tag/Example/None.
1244 </descrip>
1245 </quote>
1246
1247
1248 <sect1>fast<label id="fast"><p>
1249
1250 <quote>
1251 <descrip>
1252 <tag/Function/Switch the C128 into 2MHz mode.
1253 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1254 <tag/Declaration/<tt/void fast (void);/
1255 <tag/Description/The function will switch the clock of the C128 to 2MHz. This
1256 will nearly double the speed compared to slow mode.
1257 <tag/Limits/<itemize>
1258 <item>The function is specific to the C128.
1259 <item>2MHz clock will not work in 40 column mode.
1260 </itemize>
1261 <tag/Availability/C128
1262 <tag/See also/
1263 <ref id="slow" name="slow">,
1264 <ref id="toggle_videomode" name="toggle_videomode">
1265 <tag/Example/None.
1266 </descrip>
1267 </quote>
1268
1269
1270 <sect1>free<label id="free"><p>
1271
1272 <quote>
1273 <descrip>
1274 <tag/Function/Free a block of dynamic memory.
1275 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1276 <tag/Declaration/<tt/void __fastcall__ free (void* block);/
1277 <tag/Description/Free a block of dynamic memory previously allocated with
1278 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
1279 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
1280 pointer is <tt/NULL/, no action is performed.
1281 <tag/Limits/
1282 <itemize>
1283 <item>Passing an already free'd block to <tt/free/ again will cause undefined
1284 behaviour and may crash your program.
1285 <item>The function is only available as fastcall function, so it may only
1286 be used in presence of a prototype.
1287 </itemize>
1288 <tag/Availability/ISO 9899
1289 <tag/See also/
1290 <ref id="_heapadd" name="_heapadd">,
1291 <ref id="_heapmaxavail" name="_heapmaxavail">,
1292 <ref id="_heapmemavail" name="_heapmemavail">,
1293 <ref id="calloc" name="calloc">,
1294 <ref id="malloc" name="malloc">,
1295 <ref id="realloc" name="realloc">
1296 <tag/Example/None.
1297 </descrip>
1298 </quote>
1299
1300
1301 <sect1>getenv<label id="getenv"><p>
1302
1303 <quote>
1304 <descrip>
1305 <tag/Function/Return a value from the environment.
1306 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1307 <tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
1308 <tag/Description/The function searches the environment for an entry that
1309 matches <tt/name/ and returns its value. The environment consists of a list
1310 of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
1311 returns <tt/NULL/.
1312 <tag/Limits/<itemize>
1313 <item>What exactly is stored in the environment depends on the machine the
1314 program is running on.
1315 <item>The function is only available as fastcall function, so it may only
1316 be used in presence of a prototype.
1317 </itemize>
1318 <tag/Availability/ISO 9899
1319 <tag/Example/None.
1320 </descrip>
1321 </quote>
1322
1323
1324 <sect1>getcpu<label id="getcpu"><p>
1325
1326 <quote>
1327 <descrip>
1328 <tag/Function/Determine on which CPU the program is running.
1329 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
1330 <tag/Declaration/<tt/unsigned char getcpu (void);/
1331 <tag/Description/The function checks on which CPU the code is running. It
1332 returns one of the constants<itemize>
1333 <item><tt/CPU_6502/
1334 <item><tt/CPU_65C02/
1335 <item><tt/CPU_65816/
1336 </itemize>
1337 <tag/Limits/<itemize>
1338 <item>Other, more exotic CPU types are not disinguished.
1339 </itemize>
1340 <tag/Availability/cc65
1341 <tag/Example/None.
1342 </descrip>
1343 </quote>
1344
1345
1346 <sect1>gotox<label id="gotox"><p>
1347
1348 <quote>
1349 <descrip>
1350 <tag/Function/Move the text mode cursor to a new X position.
1351 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1352 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
1353 <tag/Description/The function moves the text mode cursor to the specified X
1354 position while leaving the Y position untouched. The leftmost position on the
1355 screen has the coordinate 0.
1356 <tag/Limits/<itemize>
1357 <item>The function is only available as fastcall function, so it may
1358 only be used in presence of a prototype.
1359 <item>Invalid values for the X position (out of screen coordinates) may
1360 lead to undefined behaviour.
1361 </itemize>
1362 <tag/Availability/cc65
1363 <tag/See also/
1364 <ref id="gotoy" name="gotoy">,
1365 <ref id="gotoxy" name="gotoxy">,
1366 <ref id="wherex" name="wherex">,
1367 <ref id="wherey" name="wherey">
1368 <tag/Example/None.
1369 </descrip>
1370 </quote>
1371
1372
1373 <sect1>gotoxy<label id="gotoxy"><p>
1374
1375 <quote>
1376 <descrip>
1377 <tag/Function/Move the text mode cursor to a new position.
1378 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1379 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
1380 <tag/Description/The function moves the text mode cursor to the specified
1381 position. The leftmost position on the screen has the X coordinate 0, the
1382 topmost line has the Y coordinate 0.
1383 <tag/Limits/<itemize>
1384 <item>The function is only available as fastcall function, so it may only be
1385 used in presence of a prototype.
1386 <item>Invalid values for any of both coordinates (out of screen positions) may
1387 lead to undefined behaviour.
1388 </itemize>
1389 <tag/Availability/cc65
1390 <tag/See also/
1391 <ref id="gotox" name="gotox">,
1392 <ref id="gotoy" name="gotoy">,
1393 <ref id="wherex" name="wherex">,
1394 <ref id="wherey" name="wherey">
1395 <tag/Example/None.
1396 </descrip>
1397 </quote>
1398
1399
1400 <sect1>gotoy<label id="gotoy"><p>
1401
1402 <quote>
1403 <descrip>
1404 <tag/Function/Move the text mode cursor to a new Y position.
1405 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1406 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
1407 <tag/Description/The function moves the text mode cursor to the specified Y
1408 position while leaving the X position untouched. The uppermost position on the
1409 screen has the coordinate 0.
1410 <tag/Limits/<itemize>
1411 <item>The function is only available as fastcall function, so it may
1412 only be used in presence of a prototype.
1413 <item>Invalid values for the Y position (out of screen coordinates) may lead
1414 to undefined behaviour.
1415 </itemize>
1416 <tag/Availability/cc65
1417 <tag/See also/
1418 <ref id="gotox" name="gotox">,
1419 <ref id="gotoxy" name="gotoxy">,
1420 <ref id="wherex" name="wherex">,
1421 <ref id="wherey" name="wherey">
1422 <tag/Example/None.
1423 </descrip>
1424 </quote>
1425
1426
1427 <sect1>isalnum<label id="isalnum"><p>
1428
1429 <quote>
1430 <descrip>
1431 <tag/Function/Check if a given character is a letter or digit.
1432 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1433 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
1434 <tag/Description/The function returns a value of zero if the given argument
1435 is a letter or digit. The return value is non zero if the character
1436 is anything else.
1437 <tag/Limits/<itemize>
1438 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1439 inline sequence generated by the macro will not work correctly for values
1440 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1441 this range. The non inline function may be accessed by <tt/#undef/'ing
1442 the macro.
1443 <item>When compiling without <tt/-Os/, the function is only available as
1444 fastcall function, so it may only be used in presence of a prototype.
1445 </itemize>
1446 <tag/Availability/ISO 9899
1447 <tag/See also/
1448 <ref id="isalpha" name="isalpha">,
1449 <ref id="isascii" name="isascii">,
1450 <ref id="isblank" name="isblank">,
1451 <ref id="iscntrl" name="iscntrl">,
1452 <ref id="isdigit" name="isdigit">,
1453 <ref id="isgraph" name="isgraph">,
1454 <ref id="islower" name="islower">,
1455 <ref id="isprint" name="isprint">,
1456 <ref id="ispunct" name="ispunct">,
1457 <ref id="isspace" name="isspace">,
1458 <ref id="isupper" name="isupper">,
1459 <ref id="isxdigit" name="isxdigit">
1460 <tag/Example/None.
1461 </descrip>
1462 </quote>
1463
1464
1465 <sect1>isalpha<label id="isalpha"><p>
1466
1467 <quote>
1468 <descrip>
1469 <tag/Function/Check if a given character is a letter.
1470 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1471 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
1472 <tag/Description/The function returns a value of zero if the given argument
1473 is a letter. The return value is non zero if the character is anything else.
1474 <tag/Limits/<itemize>
1475 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1476 inline sequence generated by the macro will not work correctly for values
1477 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1478 this range. The non inline function may be accessed by <tt/#undef/'ing the
1479 macro.
1480 <item>When compiling without <tt/-Os/, the function is only available as
1481 fastcall function, so it may only be used in presence of a prototype.
1482 </itemize>
1483 <tag/Availability/ISO 9899
1484 <tag/See also/
1485 <ref id="isalnum" name="isalnum">,
1486 <ref id="isascii" name="isascii">,
1487 <ref id="isblank" name="isblank">,
1488 <ref id="iscntrl" name="iscntrl">,
1489 <ref id="isdigit" name="isdigit">,
1490 <ref id="isgraph" name="isgraph">,
1491 <ref id="islower" name="islower">,
1492 <ref id="isprint" name="isprint">,
1493 <ref id="ispunct" name="ispunct">,
1494 <ref id="isspace" name="isspace">,
1495 <ref id="isupper" name="isupper">,
1496 <ref id="isxdigit" name="isxdigit">
1497 <tag/Example/None.
1498 </descrip>
1499 </quote>
1500
1501
1502 <sect1>isascii<label id="isascii"><p>
1503
1504 <quote>
1505 <descrip>
1506 <tag/Function/Check if a given character is in the ASCII (0..127) range.
1507 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1508 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
1509 <tag/Description/The function returns a value of zero if the given argument
1510 is in the range 0..127 (the range of valid ASCII characters) and a non zero
1511 value if not.
1512 <tag/Limits/<itemize>
1513 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1514 inline sequence generated by the macro will not work correctly for values
1515 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1516 this range. The non inline function may be accessed by <tt/#undef/'ing the
1517 macro.
1518 <item>When compiling without <tt/-Os/, the function is only available as
1519 fastcall function, so it may only be used in presence of a prototype.
1520 </itemize>
1521 <tag/Availability/ISO 9899
1522 <tag/See also/
1523 <ref id="isalnum" name="isalnum">,
1524 <ref id="isalpha" name="isalpha">,
1525 <ref id="isblank" name="isblank">,
1526 <ref id="iscntrl" name="iscntrl">,
1527 <ref id="isdigit" name="isdigit">,
1528 <ref id="isgraph" name="isgraph">,
1529 <ref id="islower" name="islower">,
1530 <ref id="isprint" name="isprint">,
1531 <ref id="ispunct" name="ispunct">,
1532 <ref id="isspace" name="isspace">,
1533 <ref id="isupper" name="isupper">,
1534 <ref id="isxdigit" name="isxdigit">
1535 <tag/Example/None.
1536 </descrip>
1537 </quote>
1538
1539
1540 <sect1>isblank<label id="isblank"><p>
1541
1542 <quote>
1543 <descrip>
1544 <tag/Function/Check if a given character is a space or tab.
1545 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1546 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
1547 <tag/Description/The function returns a value of zero if the given argument
1548 is a blank or space character. The return value is non zero if the character
1549 is anything else.
1550 <tag/Limits/<itemize>
1551 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1552 inline sequence generated by the macro will not work correctly for values
1553 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1554 this range. The non inline function may be accessed by <tt/#undef/'ing the
1555 macro.
1556 <item>When compiling without <tt/-Os/, the function is only available as
1557 fastcall function, so it may only be used in presence of a prototype.
1558 </itemize>
1559 <tag/Availability/cc65
1560 <tag/See also/
1561 <ref id="isalnum" name="isalnum">,
1562 <ref id="isalpha" name="isalpha">,
1563 <ref id="isascii" name="isascii">,
1564 <ref id="iscntrl" name="iscntrl">,
1565 <ref id="isdigit" name="isdigit">,
1566 <ref id="isgraph" name="isgraph">,
1567 <ref id="islower" name="islower">,
1568 <ref id="isprint" name="isprint">,
1569 <ref id="ispunct" name="ispunct">,
1570 <ref id="isspace" name="isspace">,
1571 <ref id="isupper" name="isupper">,
1572 <ref id="isxdigit" name="isxdigit">
1573 <tag/Example/None.
1574 </descrip>
1575 </quote>
1576
1577
1578 <sect1>iscntrl<label id="iscntrl"><p>
1579
1580 <quote>
1581 <descrip>
1582 <tag/Function/Check if a given character is a control character.
1583 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1584 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
1585 <tag/Description/The function returns a value of zero if the given argument
1586 is a control character. The return value is non zero if the character
1587 is anything else.
1588 <tag/Limits/<itemize>
1589 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1590 inline sequence generated by the macro will not work correctly for values
1591 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1592 this range. The non inline function may be accessed by <tt/#undef/'ing the
1593 macro.
1594 <item>When compiling without <tt/-Os/, the function is only available as
1595 fastcall function, so it may only be used in presence of a prototype.
1596 </itemize>
1597 <tag/Availability/ISO 9899
1598 <tag/See also/
1599 <ref id="isalnum" name="isalnum">,
1600 <ref id="isalpha" name="isalpha">,
1601 <ref id="isascii" name="isascii">,
1602 <ref id="isblank" name="isblank">,
1603 <ref id="isdigit" name="isdigit">,
1604 <ref id="isgraph" name="isgraph">,
1605 <ref id="islower" name="islower">,
1606 <ref id="isprint" name="isprint">,
1607 <ref id="ispunct" name="ispunct">,
1608 <ref id="isspace" name="isspace">,
1609 <ref id="isupper" name="isupper">,
1610 <ref id="isxdigit" name="isxdigit">
1611 <tag/Example/None.
1612 </descrip>
1613 </quote>
1614
1615
1616 <sect1>isdigit<label id="isdigit"><p>
1617
1618 <quote>
1619 <descrip>
1620 <tag/Function/Check if a given character is a digit.
1621 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1622 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
1623 <tag/Description/The function returns a value of zero if the given argument
1624 is a digit. The return value is non zero if the character is anything else.
1625 <tag/Limits/<itemize>
1626 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1627 inline sequence generated by the macro will not work correctly for values
1628 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1629 this range. The non inline function may be accessed by <tt/#undef/'ing the
1630 macro.
1631 <item>When compiling without <tt/-Os/, the function is only available as
1632 fastcall function, so it may only be used in presence of a prototype.
1633 </itemize>
1634 <tag/Availability/ISO 9899
1635 <tag/See also/
1636 <ref id="isalnum" name="isalnum">,
1637 <ref id="isalpha" name="isalpha">,
1638 <ref id="isascii" name="isascii">,
1639 <ref id="isblank" name="isblank">,
1640 <ref id="iscntrl" name="iscntrl">,
1641 <ref id="isgraph" name="isgraph">,
1642 <ref id="islower" name="islower">,
1643 <ref id="isprint" name="isprint">,
1644 <ref id="ispunct" name="ispunct">,
1645 <ref id="isspace" name="isspace">,
1646 <ref id="isupper" name="isupper">,
1647 <ref id="isxdigit" name="isxdigit">
1648 <tag/Example/None.
1649 </descrip>
1650 </quote>
1651
1652
1653 <sect1>isgraph<label id="isgraph"><p>
1654
1655 <quote>
1656 <descrip>
1657 <tag/Function/Check if a given character is a printable character (except
1658 space).
1659 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1660 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
1661 <tag/Description/The function returns a value of zero if the given argument
1662 is a printable character with the exception of space. The return value is non
1663 zero if the character is anything else.
1664 <tag/Limits/<itemize>
1665 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1666 inline sequence generated by the macro will not work correctly for values
1667 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1668 this range. The non inline function may be accessed by <tt/#undef/'ing the
1669 macro.
1670 <item>When compiling without <tt/-Os/, the function is only available as
1671 fastcall function, so it may only be used in presence of a prototype.
1672 </itemize>
1673 <tag/Availability/ISO 9899
1674 <tag/See also/
1675 <ref id="isalnum" name="isalnum">,
1676 <ref id="isalpha" name="isalpha">,
1677 <ref id="isascii" name="isascii">,
1678 <ref id="isblank" name="isblank">,
1679 <ref id="iscntrl" name="iscntrl">,
1680 <ref id="isdigit" name="isdigit">,
1681 <ref id="islower" name="islower">,
1682 <ref id="isprint" name="isprint">,
1683 <ref id="ispunct" name="ispunct">,
1684 <ref id="isspace" name="isspace">,
1685 <ref id="isupper" name="isupper">,
1686 <ref id="isxdigit" name="isxdigit">
1687 <tag/Example/None.
1688 </descrip>
1689 </quote>
1690
1691
1692 <sect1>islower<label id="islower"><p>
1693
1694 <quote>
1695 <descrip>
1696 <tag/Function/Check if a given character is a lower case letter.
1697 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1698 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
1699 <tag/Description/The function returns a value of zero if the given argument
1700 is a lower case letter. The return value is non zero if the character is
1701 anything else.
1702 <tag/Limits/<itemize>
1703 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1704 inline sequence generated by the macro will not work correctly for values
1705 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1706 this range. The non inline function may be accessed by <tt/#undef/'ing the
1707 macro.
1708 <item>When compiling without <tt/-Os/, the function is only available as
1709 fastcall function, so it may only be used in presence of a prototype.
1710 </itemize>
1711 <tag/Availability/ISO 9899
1712 <tag/See also/
1713 <ref id="isalnum" name="isalnum">,
1714 <ref id="isalpha" name="isalpha">,
1715 <ref id="isascii" name="isascii">,
1716 <ref id="isblank" name="isblank">,
1717 <ref id="iscntrl" name="iscntrl">,
1718 <ref id="isdigit" name="isdigit">,
1719 <ref id="isgraph" name="isgraph">,
1720 <ref id="isprint" name="isprint">,
1721 <ref id="ispunct" name="ispunct">,
1722 <ref id="isspace" name="isspace">,
1723 <ref id="isupper" name="isupper">,
1724 <ref id="isxdigit" name="isxdigit">
1725 <tag/Example/None.
1726 </descrip>
1727 </quote>
1728
1729
1730 <sect1>isprint<label id="isprint"><p>
1731
1732 <quote>
1733 <descrip>
1734 <tag/Function/Check if a given character is a printable character.
1735 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1736 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
1737 <tag/Description/The function returns a value of zero if the given argument
1738 is a printable character (this includes the space character). The return value
1739 is non zero if the character is anything else.
1740 <tag/Limits/<itemize>
1741 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1742 inline sequence generated by the macro will not work correctly for values
1743 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1744 this range. The non inline function may be accessed by <tt/#undef/'ing the
1745 macro.
1746 <item>When compiling without <tt/-Os/, the function is only available as
1747 fastcall function, so it may only be used in presence of a prototype.
1748 </itemize>
1749 <tag/Availability/ISO 9899
1750 <tag/See also/
1751 <ref id="isalnum" name="isalnum">,
1752 <ref id="isalpha" name="isalpha">,
1753 <ref id="isascii" name="isascii">,
1754 <ref id="isblank" name="isblank">,
1755 <ref id="iscntrl" name="iscntrl">,
1756 <ref id="isdigit" name="isdigit">,
1757 <ref id="isgraph" name="isgraph">,
1758 <ref id="islower" name="islower">,
1759 <ref id="ispunct" name="ispunct">,
1760 <ref id="isspace" name="isspace">,
1761 <ref id="isupper" name="isupper">,
1762 <ref id="isxdigit" name="isxdigit">
1763 <tag/Example/None.
1764 </descrip>
1765 </quote>
1766
1767
1768 <sect1>ispunct<label id="ispunct"><p>
1769
1770 <quote>
1771 <descrip>
1772 <tag/Function/Check if a given character is a printable character but not a
1773 space or an alphanumeric character.
1774 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1775 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
1776 <tag/Description/The function returns a value of zero if the given argument
1777 is a printable character, but not a space or anything alphanumeric. The return
1778 value is non zero if the character is anything else.
1779 <tag/Limits/<itemize>
1780 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1781 inline sequence generated by the macro will not work correctly for values
1782 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1783 this range. The non inline function may be accessed by <tt/#undef/'ing the
1784 macro.
1785 <item>When compiling without <tt/-Os/, the function is only available as
1786 fastcall function, so it may only be used in presence of a prototype.
1787 </itemize>
1788 <tag/Availability/ISO 9899
1789 <tag/See also/
1790 <ref id="isalnum" name="isalnum">,
1791 <ref id="isalpha" name="isalpha">,
1792 <ref id="isascii" name="isascii">,
1793 <ref id="isblank" name="isblank">,
1794 <ref id="iscntrl" name="iscntrl">,
1795 <ref id="isdigit" name="isdigit">,
1796 <ref id="isgraph" name="isgraph">,
1797 <ref id="islower" name="islower">,
1798 <ref id="isprint" name="isprint">,
1799 <ref id="isspace" name="isspace">,
1800 <ref id="isupper" name="isupper">,
1801 <ref id="isxdigit" name="isxdigit">
1802 <tag/Example/None.
1803 </descrip>
1804 </quote>
1805
1806
1807 <sect1>isspace<label id="isspace"><p>
1808
1809 <quote>
1810 <descrip>
1811 <tag/Function/Check if a given character is a a white-space character.
1812 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1813 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
1814 <tag/Description/The function returns a value of zero if the given argument
1815 is a white space character. The return value is non zero if the character is
1816 anything else. The standard white space characters are: space, formfeed ('\f'),
1817 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
1818 ('\v').
1819 <tag/Limits/<itemize>
1820 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1821 inline sequence generated by the macro will not work correctly for values
1822 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1823 this range. The non inline function may be accessed by <tt/#undef/'ing the
1824 macro.
1825 <item>When compiling without <tt/-Os/, the function is only available as
1826 fastcall function, so it may only be used in presence of a prototype.
1827 </itemize>
1828 <tag/Availability/ISO 9899
1829 <tag/See also/
1830 <ref id="isalnum" name="isalnum">,
1831 <ref id="isalpha" name="isalpha">,
1832 <ref id="isascii" name="isascii">,
1833 <ref id="isblank" name="isblank">,
1834 <ref id="iscntrl" name="iscntrl">,
1835 <ref id="isdigit" name="isdigit">,
1836 <ref id="isgraph" name="isgraph">,
1837 <ref id="islower" name="islower">,
1838 <ref id="isprint" name="isprint">,
1839 <ref id="ispunct" name="ispunct">,
1840 <ref id="isupper" name="isupper">,
1841 <ref id="isxdigit" name="isxdigit">
1842 <tag/Example/None.
1843 </descrip>
1844 </quote>
1845
1846
1847 <sect1>isupper<label id="isupper"><p>
1848
1849 <quote>
1850 <descrip>
1851 <tag/Function/Check if a given character is an upper case letter.
1852 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1853 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
1854 <tag/Description/The function returns a value of zero if the given argument
1855 is an upper case letter. The return value is non zero if the character is
1856 anything else.
1857 <tag/Limits/<itemize>
1858 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1859 inline sequence generated by the macro will not work correctly for values
1860 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1861 this range. The non inline function may be accessed by <tt/#undef/'ing the
1862 macro.
1863 <item>When compiling without <tt/-Os/, the function is only available as
1864 fastcall function, so it may only be used in presence of a prototype.
1865 </itemize>
1866 <tag/Availability/ISO 9899
1867 <tag/See also/
1868 <ref id="isalnum" name="isalnum">,
1869 <ref id="isalpha" name="isalpha">,
1870 <ref id="isascii" name="isascii">,
1871 <ref id="isblank" name="isblank">,
1872 <ref id="iscntrl" name="iscntrl">,
1873 <ref id="isdigit" name="isdigit">,
1874 <ref id="isgraph" name="isgraph">,
1875 <ref id="islower" name="islower">,
1876 <ref id="isprint" name="isprint">,
1877 <ref id="ispunct" name="ispunct">,
1878 <ref id="isspace" name="isspace">,
1879 <ref id="isxdigit" name="isxdigit">
1880 <tag/Example/None.
1881 </descrip>
1882 </quote>
1883
1884
1885 <sect1>isxdigit<label id="isxdigit"><p>
1886
1887 <quote>
1888 <descrip>
1889 <tag/Function/Check if a given character is a hexadecimal digit.
1890 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1891 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
1892 <tag/Description/The function returns a value of zero if the given argument
1893 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
1894 if the character is anything else.
1895 <tag/Limits/<itemize>
1896 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1897 inline sequence generated by the macro will not work correctly for values
1898 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1899 this range. The non inline function may be accessed by <tt/#undef/'ing the
1900 macro.
1901 <item>When compiling without <tt/-Os/, the function is only available as
1902 fastcall function, so it may only be used in presence of a prototype.
1903 </itemize>
1904 <tag/Availability/ISO 9899
1905 <tag/See also/
1906 <ref id="isalnum" name="isalnum">,
1907 <ref id="isalpha" name="isalpha">,
1908 <ref id="isascii" name="isascii">,
1909 <ref id="isblank" name="isblank">,
1910 <ref id="iscntrl" name="iscntrl">,
1911 <ref id="isdigit" name="isdigit">,
1912 <ref id="isgraph" name="isgraph">,
1913 <ref id="islower" name="islower">,
1914 <ref id="isprint" name="isprint">,
1915 <ref id="ispunct" name="ispunct">,
1916 <ref id="isspace" name="isspace">,
1917 <ref id="isupper" name="isupper">
1918 <tag/Example/None.
1919 </descrip>
1920 </quote>
1921
1922
1923 <sect1>itoa<label id="itoa"><p>
1924
1925 <quote>
1926 <descrip>
1927 <tag/Function/Convert an integer into a string.
1928 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1929 <tag/Declaration/<tt/char* __fastcall__ itoa (int val, char* buf, int radix);/
1930 <tag/Description/<tt/itoa/ converts the integer <tt/val/ into a string using
1931 <tt/radix/ as the base.
1932 <tag/Limits/<itemize>
1933 <item>There are no provisions to prevent a buffer overflow.
1934 <item>If <tt/val/ contains <tt/INT_MIN/, the behaviour is undefined.
1935 <item>The function is non standard, so it is not available in strict ANSI mode.
1936 You should probably use <tt/sprintf/ instead.
1937 <item>The function is only available as fastcall function, so it may only be
1938 used in presence of a prototype.
1939 </itemize>
1940 <tag/Availability/cc65
1941 <tag/See also/
1942 <ref id="atoi" name="atoi">,
1943 <ref id="atol" name="atol">,
1944 <ref id="ltoa" name="ltoa">,
1945 <ref id="ultoa" name="ultoa">,
1946 <ref id="utoa" name="utoa">
1947 <tag/Example/None.
1948 </descrip>
1949 </quote>
1950
1951
1952 <sect1>kbhit<label id="kbhit"><p>
1953
1954 <quote>
1955 <descrip>
1956 <tag/Function/Check if there's a key waiting in the keyboard buffer.
1957 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1958 <tag/Declaration/<tt/unsigned char kbhit (void);/
1959 <tag/Description/The function returns a value of zero if there is no character
1960 waiting to be read from the keyboard. It returns non zero otherwise.
1961 <tag/Limits/<itemize>
1962 <item>If the system does not support a keyboard buffer (most systems
1963 do), the function is rather useless.
1964 </itemize>
1965 <tag/Availability/cc65
1966 <tag/See also/
1967 <ref id="cgetc" name="cgetc">,
1968 <ref id="cursor" name="cursor">
1969 <tag/Example/None.
1970 </descrip>
1971 </quote>
1972
1973
1974 <sect1>labs<label id="labs"><p>
1975
1976 <quote>
1977 <descrip>
1978 <tag/Function/Returns the absolute value of a long integer.
1979 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1980 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
1981 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
1982 the function.
1983 <tag/Limits/<itemize>
1984 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
1985 <item>The function is only available as fastcall function, so it may only be
1986 used in presence of a prototype.
1987 </itemize>
1988 <tag/Availability/ISO 9899
1989 <tag/See also/
1990 <ref id="abs" name="abs">
1991 <tag/Example/None.
1992 </descrip>
1993 </quote>
1994
1995
1996 <sect1>ltoa<label id="ltoa"><p>
1997
1998 <quote>
1999 <descrip>
2000 <tag/Function/Convert a long integer into a string.
2001 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2002 <tag/Declaration/<tt/char* __fastcall__ ltoa (long val, char* buf, int radix);/
2003 <tag/Description/<tt/itoa/ converts the long integer <tt/val/ into a string
2004 using <tt/radix/ as the base.
2005 <tag/Limits/<itemize>
2006 <item>There are no provisions to prevent a buffer overflow.
2007 <item>If <tt/val/ contains <tt/LONG_MIN/, the behaviour is undefined.
2008 <item>The function is non standard, so it is not available in strict ANSI mode.
2009 You should probably use <tt/sprintf/ instead.
2010 <item>The function is only available as fastcall function, so it may only be
2011 used in presence of a prototype.
2012 </itemize>
2013 <tag/Availability/cc65
2014 <tag/See also/
2015 <ref id="atoi" name="atoi">,
2016 <ref id="atol" name="atol">,
2017 <ref id="itoa" name="itoa">,
2018 <ref id="ultoa" name="ultoa">,
2019 <ref id="utoa" name="utoa">
2020 <tag/Example/None.
2021 </descrip>
2022 </quote>
2023
2024
2025 <sect1>malloc<label id="malloc"><p>
2026
2027 <quote>
2028 <descrip>
2029 <tag/Function/Allocate dynamic memory.
2030 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2031 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
2032 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
2033 pointer to the allocated memory block. On error (not enough memory available),
2034 <tt/malloc/ returns <tt/NULL/.
2035 <tag/Limits/
2036 <itemize>
2037 <item>The function is only available as fastcall function, so it may only
2038 be used in presence of a prototype.
2039 </itemize>
2040 <tag/Availability/ISO 9899
2041 <tag/See also/
2042 <ref id="_heapadd" name="_heapadd">,
2043 <ref id="_heapmaxavail" name="_heapmaxavail">,
2044 <ref id="_heapmemavail" name="_heapmemavail">,
2045 <ref id="calloc" name="calloc">,
2046 <ref id="free" name="free">,
2047 <ref id="realloc" name="realloc">
2048 <tag/Example/None.
2049 </descrip>
2050 </quote>
2051
2052
2053 <sect1>memcpy<label id="memcpy"><p>
2054
2055 <quote>
2056 <descrip>
2057 <tag/Function/Copy a memory area.
2058 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2059 <tag/Declaration/<tt/void* __fastcall__ memcpy (void* dest, const void* src, size_t count);/
2060 <tag/Description/<tt/memcpy/ copies <tt/count/ bytes from the memory area
2061 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
2062 <tt/dest/.
2063 <tag/Limits/
2064 <itemize>
2065 <item>The result is undefined if the memory areas do overlap. Use
2066 <tt/<ref id="memmove" name="memmove">/ to copy overlapping memory areas.
2067 <item>The function is only available as fastcall function, so it may only
2068 be used in presence of a prototype.
2069 </itemize>
2070 <tag/Availability/ISO 9899
2071 <tag/See also/
2072 <ref id="_swap" name="_swap">,
2073 <ref id="memmove" name="memmove">,
2074 <ref id="memset" name="memset">
2075 <tag/Example/None.
2076 </descrip>
2077 </quote>
2078
2079
2080 <sect1>memmove<label id="memmove"><p>
2081
2082 <quote>
2083 <descrip>
2084 <tag/Function/Copy a memory area.
2085 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2086 <tag/Declaration/<tt/void* __fastcall__ memmove (void* dest, const void* src, size_t count);/
2087 <tag/Description/<tt/memmove/ copies <tt/count/ bytes from the memory area
2088 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
2089 <tt/dest/.
2090 <tag/Limits/
2091 <itemize>
2092 <item>While <tt/memmove/ allows the memory areas to overlap, it has some
2093 additional overhead compared to <tt/<ref id="memcpy" name="memcpy">/.
2094 <item>The function is only available as fastcall function, so it may only
2095 be used in presence of a prototype.
2096 </itemize>
2097 <tag/Availability/ISO 9899
2098 <tag/See also/
2099 <ref id="_swap" name="_swap">,
2100 <ref id="memcpy" name="memcpy">,
2101 <ref id="memset" name="memset">
2102 <tag/Example/None.
2103 </descrip>
2104 </quote>
2105
2106
2107 <sect1>memset<label id="memset"><p>
2108
2109 <quote>
2110 <descrip>
2111 <tag/Function/Fill a memory area.
2112 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2113 <tag/Declaration/<tt/void* __fastcall__ memset (void* p, int val, size_t count);/
2114 <tag/Description/<tt/memset/ fills the memory area pointed to by <tt/p/ with
2115 the value <tt/val/. The function returns <tt/p/.
2116 <tag/Limits/
2117 <itemize>
2118 <item>The function is only available as fastcall function, so it may only
2119 be used in presence of a prototype.
2120 </itemize>
2121 <tag/Availability/ISO 9899
2122 <tag/See also/
2123 <ref id="_swap" name="_swap">,
2124 <ref id="bzero" name="bzero">,
2125 <ref id="memcpy" name="memcpy">,
2126 <ref id="memmove" name="memmove">
2127 <tag/Example/None.
2128 </descrip>
2129 </quote>
2130
2131
2132 <sect1>open<label id="open"><p>
2133
2134 <quote>
2135 <descrip>
2136 <tag/Function/Open and possibly create a file.
2137 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
2138 <tag/Declaration/<tt/int __fastcall__ open (const char* name, int flags, ...);/
2139 <tag/Description/<tt/open/ opens a file and returns the file descriptor
2140 associated with it. On error, -1 is returned and an error code is stored in
2141 <tt/errno/. Several flags may be passed to <tt/open/ that change the behaviour.
2142 <tag/Limits/<itemize>
2143 <item>POSIX specifies an additional <tt/mode/ argument that may be passed to
2144 open, which is used as the permission mask when a new file is created. While
2145 cc65 allows to pass this argument, it is ignored.
2146 <item>The function is only available as fastcall function, so it may only
2147 be used in presence of a prototype.
2148 </itemize>
2149 <tag/Availability/POSIX
2150 <tag/See also/
2151 <ref id="close" name="close">,
2152 <ref id="creat" name="creat">
2153 <tag/Example/None.
2154 </descrip>
2155 </quote>
2156
2157
2158 <sect1>raise<label id="raise"><p>
2159
2160 <quote>
2161 <descrip>
2162 <tag/Function/Send a signal to the executing program.
2163 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
2164 <tag/Declaration/<tt/int __fastcall__ raise (int sig);/
2165 <tag/Description/<tt/raise/ sends the given signal to the program. If the
2166 program has installed a signal handler for the signal, this signal handler
2167 will be executed. If no handler has been installed, the default action for
2168 the raised signal will be taken. The function returns zero on success,
2169 nonzero otherwise.
2170 <tag/Limits/<itemize>
2171 <item>The function is only available as fastcall function, so it may only
2172 be used in presence of a prototype.
2173 </itemize>
2174 <tag/Availability/ISO 9899
2175 <tag/See also/
2176 <ref id="abort" name="abort">,
2177 <ref id="signal" name="signal">
2178 <tag/Example/None.
2179 </descrip>
2180 </quote>
2181
2182
2183 <sect1>rand<label id="rand"><p>
2184
2185 <quote>
2186 <descrip>
2187 <tag/Function/Return a pseudo random number.
2188 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2189 <tag/Declaration/<tt/int rand (void);/
2190 <tag/Description/The function returns a pseudo random number
2191 between 0 and <tt/RAND_MAX/ (exclusive).
2192 <tag/Limits/<itemize>
2193 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
2194 flow of numbers is generated.
2195 <item>On startup, the function behaves as if <ref id="srand" name="srand">
2196 had been used with an argument of 1.
2197 </itemize>
2198 <tag/Availability/ISO 9899
2199 <tag/See also/
2200 <ref id="_randomize" name="_randomize">,
2201 <ref id="srand" name="srand">
2202 <tag/Example/None.
2203 </descrip>
2204 </quote>
2205
2206
2207 <sect1>realloc<label id="realloc"><p>
2208
2209 <quote>
2210 <descrip>
2211 <tag/Function/Change the size of an allocated memory block.
2212 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2213 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
2214 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
2215 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
2216 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
2217 behaves as if <tt/free/ had been called. On error (not enough memory
2218 available), <tt/realloc/ returns <tt/NULL/.
2219 <tag/Limits/
2220 <itemize>
2221 <item>The part of the memory block that is returned will have its contents
2222 unchanged.
2223 <item>This function is somewhat dangerous to use. Be careful to save the
2224 pointer you're passing somewhere else, otherwise
2225 <tscreen><verb>
2226         ptr = realloc (ptr, size);
2227 </verb></tscreen>
2228 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
2229 <item>The function is only available as fastcall function, so it may only
2230 be used in presence of a prototype.
2231 </itemize>
2232 <tag/Availability/ISO 9899
2233 <tag/See also/
2234 <ref id="_heapadd" name="_heapadd">,
2235 <ref id="_heapmaxavail" name="_heapmaxavail">,
2236 <ref id="_heapmemavail" name="_heapmemavail">,
2237 <ref id="calloc" name="calloc">,
2238 <ref id="free" name="free">,
2239 <ref id="realloc" name="realloc">
2240 <tag/Example/None.
2241 </descrip>
2242 </quote>
2243
2244
2245 <sect1>revers<label id="revers"><p>
2246
2247 <quote>
2248 <descrip>
2249 <tag/Function/Control revers character display.
2250 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2251 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
2252 <tag/Description/If the argument is non zero, the function enables reverse
2253 character display. If the argument is zero, reverse character display is
2254 switched off. The old value of the setting is returned.
2255 <tag/Limits/<itemize>
2256 <item>The function may not be supported by the hardware, in which case
2257 the call is ignored.
2258 <item>The function is only available as fastcall function, so it may only
2259 be used in presence of a prototype.
2260 </itemize>
2261 <tag/Availability/cc65
2262 <tag/See also/
2263 <ref id="textcolor" name="textcolor">
2264 <tag/Example/None.
2265 </descrip>
2266 </quote>
2267
2268
2269 <sect1>screensize<label id="screensize"><p>
2270
2271 <quote>
2272 <descrip>
2273 <tag/Function/Return the dimensions of the text mode screen.
2274 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2275 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
2276 <tag/Description/The function returns the dimensions of the text mode screen.
2277 <tag/Limits/<itemize>
2278 <item>The function is only available as fastcall function, so it may only
2279 be used in presence of a prototype.
2280 </itemize>
2281 <tag/Availability/cc65
2282 <tag/See also/
2283 <ref id="gotox" name="gotox">,
2284 <ref id="gotoxy" name="gotoxy">,
2285 <ref id="gotoy" name="gotoy">,
2286 <ref id="wherex" name="wherex">,
2287 <ref id="wherey" name="wherey">
2288 <tag/Example/None.
2289 </descrip>
2290 </quote>
2291
2292
2293 <sect1>signal<label id="signal"><p>
2294
2295 <quote>
2296 <descrip>
2297 <tag/Function/Install a signal handler.
2298 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
2299 <tag/Declaration/<tt/__sigfunc __fastcall__ signal (int sig, __sigfunc func);/
2300 <tag/Description/<tt/signal/ installs a handler for the given signal. The
2301 handler may either be a user supplied function, or one of the predefined
2302 signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
2303 previous value if the signal , or the special function vector SIG_ERR in
2304 case of an error.
2305 <tag/Limits/<itemize>
2306 <item>The function is only available as fastcall function, so it may only
2307 be used in presence of a prototype.
2308 </itemize>
2309 <tag/Availability/ISO 9899
2310 <tag/See also/
2311 <ref id="abort" name="abort">,
2312 <ref id="raise" name="raise">
2313 <tag/Example/None.
2314 </descrip>
2315 </quote>
2316
2317
2318 <sect1>sleep<label id="sleep"><p>
2319
2320 <quote>
2321 <descrip>
2322 <tag/Function/Sleep for a specified amount of time.
2323 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
2324 <tag/Declaration/<tt/void __fastcall__ sleep (unsigned seconds);/
2325 <tag/Description/The function will return after the specified number of
2326 seconds have elapsed.
2327 <tag/Limits/<itemize>
2328 <item>The function is only available as fastcall function, so it may only
2329 be used in presence of a prototype.
2330 </itemize>
2331 <tag/Availability/POSIX
2332 <tag/Example/None.
2333 </descrip>
2334 </quote>
2335
2336
2337 <sect1>slow<label id="slow"><p>
2338
2339 <quote>
2340 <descrip>
2341 <tag/Function/Switch the C128 into 1MHz mode.
2342 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
2343 <tag/Declaration/<tt/void slow (void);/
2344 <tag/Description/The function will switch the clock of the C128 to 1MHz. This
2345 will halve the speed compared to fast mode.
2346 <tag/Limits/<itemize>
2347 <item>The function is specific to the C128.
2348 </itemize>
2349 <tag/Availability/C128
2350 <tag/See also/
2351 <ref id="fast" name="fast">,
2352 <ref id="toggle_videomode" name="toggle_videomode">
2353 <tag/Example/None.
2354 </descrip>
2355 </quote>
2356
2357
2358 <sect1>srand<label id="srand"><p>
2359
2360 <quote>
2361 <descrip>
2362 <tag/Function/Initialize the pseudo random number generator.
2363 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2364 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
2365 <tag/Description/The function initializes the random number generator using
2366 the given seed. On program startup, the generator behaves as if <tt/srand/ has
2367 been called with an argument of 1.
2368 <tag/Limits/<itemize>
2369 <item>The function is only available as fastcall function, so it may only
2370 be used in presence of a prototype.
2371 </itemize>
2372 <tag/Availability/ISO 9899
2373 <tag/See also/
2374 <ref id="_randomize" name="_randomize">,
2375 <ref id="rand" name="rand">
2376 <tag/Example/None.
2377 </descrip>
2378 </quote>
2379
2380
2381 <sect1>strcat<label id="strcat"><p>
2382
2383 <quote>
2384 <descrip>
2385 <tag/Function/Concatentate two strings.
2386 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2387 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
2388 <tag/Description/The <tt/strcat/ function appends a copy of the string
2389 pointed to by s2 (including the terminating null byte) to the end of the
2390 string pointed to by s1. The initial byte of s2 overwrites the null byte at
2391 the end of s1.
2392 <tag/Limits/<itemize>
2393 <item>The function is only available as fastcall function, so it may only
2394 be used in presence of a prototype.
2395 <item>If copying takes place between objects that overlap, the behavior
2396 is undefined.
2397 </itemize>
2398 <tag/Availability/ISO 9899
2399 <tag/See also/
2400 <ref id="strcpy" name="strcpy">
2401 <ref id="strncpy" name="strncpy">
2402 <tag/Example/None.
2403 </descrip>
2404 </quote>
2405
2406
2407 <sect1>strchr<label id="strchr"><p>
2408
2409 <quote>
2410 <descrip>
2411 <tag/Function/Search for a character in a string.
2412 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2413 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
2414 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
2415 (converted to a char) in the string pointed to by <tt/s/. The terminating null
2416 byte is considered to be part of the string. Upon completion, the function
2417 returns a pointer to the byte, or a null pointer if the byte was not found.
2418 <tag/Limits/<itemize>
2419 <item>The function is only available as fastcall function, so it may only
2420 be used in presence of a prototype.
2421 </itemize>
2422 <tag/Availability/ISO 9899
2423 <tag/See also/
2424 <ref id="strrchr" name="strrchr">
2425 <tag/Example/None.
2426 </descrip>
2427 </quote>
2428
2429
2430 <sect1>strcpy<label id="strcpy"><p>
2431
2432 <quote>
2433 <descrip>
2434 <tag/Function/Copy a string.
2435 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2436 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
2437 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
2438 <tt/s2/ (including the terminating null byte) into the array pointed to by
2439 <tt/s1/. The function will always return <tt/s1/.
2440 <tag/Limits/<itemize>
2441 <item>The function is only available as fastcall function, so it may only
2442 be used in presence of a prototype.
2443 <item>If copying takes place between objects that overlap, the behavior
2444 is undefined.
2445 </itemize>
2446 <tag/Availability/ISO 9899
2447 <tag/See also/
2448 <ref id="strcat" name="strcat">
2449 <ref id="strncpy" name="strncpy">
2450 <tag/Example/
2451 <verb>
2452 #include <string.h>
2453
2454 static char hello[14];
2455
2456 strcpy (hello, "Hello world!\n");
2457 </verb>
2458 </descrip>
2459 </quote>
2460
2461
2462 <sect1>strlen<label id="strlen"><p>
2463
2464 <quote>
2465 <descrip>
2466 <tag/Function/Return the length of a string.
2467 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2468 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
2469 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
2470 string to which s points, not including the terminating null byte.
2471 <tag/Limits/<itemize>
2472 <item>The function is only available as fastcall function, so it may only
2473 be used in presence of a prototype.
2474 <item>When compiling with <tt/-Os/ (inline known standard functions), the
2475 function does not work correctly for strings with more than 255 characters.
2476 </itemize>
2477 <tag/Availability/ISO 9899
2478 <tag/See also/
2479 <ref id="strcpy" name="strcpy">
2480 <tag/Example/None.
2481 </descrip>
2482 </quote>
2483
2484
2485 <sect1>strlower<label id="strlower"><p>
2486
2487 <quote>
2488 <descrip>
2489 <tag/Function/Make a string lower case.
2490 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2491 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
2492 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
2493 function to each character of a string. The function will always return <tt/s/.
2494 <tag/Limits/<itemize>
2495 <item>The function is only available as fastcall function, so it may only
2496 be used in presence of a prototype.
2497 <item>The function prototype is unavailable when compiling in strict ANSI mode.
2498 <item>An alias name for this function is <tt/strlwr/.
2499 </itemize>
2500 <tag/Availability/cc65
2501 <tag/See also/
2502 <ref id="strupper" name="strupper">
2503 <ref id="tolower" name="tolower">
2504 <tag/Example/None.
2505 </descrip>
2506 </quote>
2507
2508
2509 <sect1>strlwr<label id="strlwr"><p>
2510
2511 <quote>
2512 See <tt/strlower/.
2513 </quote>
2514
2515
2516 <sect1>strncpy<label id="strncpy"><p>
2517
2518 <quote>
2519 <descrip>
2520 <tag/Function/Copy part of a string.
2521 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2522 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
2523 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
2524 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
2525 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
2526 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
2527 written. The function will always return <tt/s1/.
2528 <tag/Limits/<itemize>
2529 <item>The function is only available as fastcall function, so it may only
2530 be used in presence of a prototype. If there is no null byte in the first <tt/n/
2531 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
2532 <item>If copying takes place between objects that overlap, the behavior is
2533 undefined.
2534 </itemize>
2535 <tag/Availability/ISO 9899
2536 <tag/See also/
2537 <ref id="strcat" name="strcat">
2538 <ref id="strcpy" name="strcpy">
2539 <tag/Example/
2540 <verb>
2541 #include <string.h>
2542
2543 static char hello[6];
2544
2545 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
2546 hello[5] = '\0';
2547 </verb>
2548 </descrip>
2549 </quote>
2550
2551
2552 <sect1>strrchr<label id="strrchr"><p>
2553
2554 <quote>
2555 <descrip>
2556 <tag/Function/Search for a character in a string.
2557 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2558 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
2559 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
2560 (converted to a char) in the string pointed to by <tt/s/. The terminating null
2561 byte is considered to be part of the string. Upon completion, the function
2562 returns a pointer to the byte, or a null pointer if the byte was not found.
2563 <tag/Limits/<itemize>
2564 <item>The function is only available as fastcall function, so it may only
2565 be used in presence of a prototype.
2566 </itemize>
2567 <tag/Availability/ISO 9899
2568 <tag/See also/
2569 <ref id="strchr" name="strchr">
2570 <tag/Example/None.
2571 </descrip>
2572 </quote>
2573
2574
2575 <sect1>strupper<label id="strupper"><p>
2576
2577 <quote>
2578 <descrip>
2579 <tag/Function/Make a string upper case.
2580 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2581 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
2582 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
2583 function to each character of a string. The function will always return <tt/s/.
2584 <tag/Limits/<itemize>
2585 <item>The function is only available as fastcall function, so it may only
2586 be used in presence of a prototype.
2587 <item>The function prototype is unavailable when compiling in strict ANSI mode.
2588 <item>An alias name for this function is <tt/strupr/.
2589 </itemize>
2590 <tag/Availability/cc65
2591 <tag/See also/
2592 <ref id="strlower" name="strlower">
2593 <ref id="toupper" name="toupper">
2594 <tag/Example/None.
2595 </descrip>
2596 </quote>
2597
2598
2599 <sect1>strupr<label id="strupr"><p>
2600
2601 <quote>
2602 See <tt/strupper/.
2603 </quote>
2604
2605
2606 <sect1>textcolor<label id="textcolor"><p>
2607
2608 <quote>
2609 <descrip>
2610 <tag/Function/Set the text color.
2611 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2612 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
2613 <tag/Description/The function will set a new text color. It returns the old
2614 (current) text color. Text output using any <tt/conio.h/ function will use
2615 the color set by this function.
2616 <tag/Limits/<itemize>
2617 <item>Text colors are system dependent. The function may have no effect
2618 on systems where the text color cannot be changed.
2619 <item>The function is only available as fastcall function, so it may only
2620 be used in presence of a prototype.
2621 </itemize>
2622 <tag/Availability/cc65
2623 <tag/See also/
2624 <ref id="bgcolor" name="bgcolor">,
2625 <ref id="bordercolor" name="bordercolor">
2626 <tag/Example/None.
2627 </descrip>
2628 </quote>
2629
2630
2631 <sect1>toggle_videomode<label id="toggle_videomode"><p>
2632
2633 <quote>
2634 <descrip>
2635 <tag/Function/Toggle between 40 and 80 column mode.
2636 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
2637 <tag/Declaration/<tt/void toggle_videomode (void);/
2638 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
2639 old mode (cursor position, color and so on) are saved and restored together
2640 with the mode.
2641 <tag/Limits/<itemize>
2642 <item>The function is specific to the C128.
2643 </itemize>
2644 <tag/Availability/C128
2645 <tag/See also/
2646 <ref id="fast" name="fast">,
2647 <ref id="slow" name="slow">
2648 <tag/Example/None.
2649 </descrip>
2650 </quote>
2651
2652
2653 <sect1>tolower<label id="tolower"><p>
2654
2655 <quote>
2656 <descrip>
2657 <tag/Function/Convert a character into its lower case representation.
2658 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2659 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
2660 <tag/Description/The function returns the given character converted to lower
2661 case. If the given character is not a letter, it is returned unchanged.
2662 <tag/Limits/<itemize>
2663 <item>The function is only available as fastcall function, so it may
2664 only be used in presence of a prototype.
2665 </itemize>
2666 <tag/Availability/ISO 9899
2667 <tag/See also/
2668 <ref id="islower" name="islower">,
2669 <ref id="isupper" name="isupper">,
2670 <ref id="toupper" name="toupper">
2671 <tag/Example/None.
2672 </descrip>
2673 </quote>
2674
2675
2676 <sect1>toupper<label id="toupper"><p>
2677
2678 <quote>
2679 <descrip>
2680 <tag/Function/Convert a character into its upper case representation.
2681 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2682 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
2683 <tag/Description/The function returns the given character converted to upper
2684 case. If the given character is not a letter, it is returned unchanged.
2685 <tag/Limits/<itemize>
2686 <item>The function is only available as fastcall function, so it may
2687 only be used in presence of a prototype.
2688 </itemize>
2689 <tag/Availability/ISO 9899
2690 <tag/See also/
2691 <ref id="islower" name="islower">,
2692 <ref id="isupper" name="isupper">,
2693 <ref id="tolower" name="tolower">
2694 <tag/Example/None.
2695 </descrip>
2696 </quote>
2697
2698
2699 <sect1>ultoa<label id="ultoa"><p>
2700
2701 <quote>
2702 <descrip>
2703 <tag/Function/Convert an unsigned long integer into a string.
2704 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2705 <tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
2706 <tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
2707 string using <tt/radix/ as the base.
2708 <tag/Limits/<itemize>
2709 <item>There are no provisions to prevent a buffer overflow.
2710 <item>The function is non standard, so it is not available in strict ANSI mode.
2711 You should probably use <tt/sprintf/ instead.
2712 <item>The function is only available as fastcall function, so it may only be
2713 used in presence of a prototype.
2714 </itemize>
2715 <tag/Availability/cc65
2716 <tag/See also/
2717 <ref id="atoi" name="atoi">,
2718 <ref id="atol" name="atol">,
2719 <ref id="itoa" name="itoa">,
2720 <ref id="ltoa" name="ltoa">,
2721 <ref id="utoa" name="utoa">
2722 <tag/Example/None.
2723 </descrip>
2724 </quote>
2725
2726
2727 <sect1>utoa<label id="utoa"><p>
2728
2729 <quote>
2730 <descrip>
2731 <tag/Function/Convert an unsigned integer into a string.
2732 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2733 <tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
2734 <tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
2735 using <tt/radix/ as the base.
2736 <tag/Limits/<itemize>
2737 <item>There are no provisions to prevent a buffer overflow.
2738 <item>The function is non standard, so it is not available in strict ANSI mode.
2739 You should probably use <tt/sprintf/ instead.
2740 <item>The function is only available as fastcall function, so it may only be
2741 used in presence of a prototype.
2742 </itemize>
2743 <tag/Availability/cc65
2744 <tag/See also/
2745 <ref id="atoi" name="atoi">,
2746 <ref id="atol" name="atol">,
2747 <ref id="itoa" name="itoa">,
2748 <ref id="ltoa" name="ltoa">,
2749 <ref id="ultoa" name="ultoa">
2750 <tag/Example/None.
2751 </descrip>
2752 </quote>
2753
2754
2755 <sect1>wherex<label id="wherex"><p>
2756
2757 <quote>
2758 <descrip>
2759 <tag/Function/Return the current X position of the text mode cursor.
2760 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2761 <tag/Declaration/<tt/unsigned char wherex (void);/
2762 <tag/Description/The function returns the current X position of the text mode
2763 cursor. Zero is returned for the leftmost screen position.
2764 <tag/Availability/cc65
2765 <tag/See also/
2766 <ref id="gotox" name="gotox">,
2767 <ref id="gotoy" name="gotoy">,
2768 <ref id="gotoxy" name="gotoxy">,
2769 <ref id="wherey" name="wherey">
2770 <tag/Example/None.
2771 </descrip>
2772 </quote>
2773
2774
2775 <sect1>wherey<label id="wherey"><p>
2776
2777 <quote>
2778 <descrip>
2779 <tag/Function/Return the current Y position of the text mode cursor.
2780 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2781 <tag/Declaration/<tt/unsigned char wherey (void);/
2782 <tag/Description/The function returns the current Y position of the text mode
2783 cursor. Zero is returned for the uppermost screen position.
2784 <tag/Availability/cc65
2785 <tag/See also/
2786 <ref id="gotox" name="gotox">,
2787 <ref id="gotoy" name="gotoy">,
2788 <ref id="gotoxy" name="gotoxy">,
2789 <ref id="wherex" name="wherex">
2790 <tag/Example/None.
2791 </descrip>
2792 </quote>
2793
2794
2795 </article>
2796
2797