]> git.sur5r.net Git - cc65/blob - doc/funcref.sgml
New function videomode() for the C128. Marked toggle_videomode as deprecated.
[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/apple2.h/<label id="apple2.h"><p>
66
67 <itemize>
68 <item>_dos_type
69 <item><ref id="get_ostype" name="get_ostype">
70 </itemize>
71
72
73 <sect1><tt/apple2enh.h/<label id="apple2enh.h"><p>
74
75 <itemize>
76 <item>_dos_type
77 <item>_textframe
78 <item>_textframexy
79 <item><ref id="get_ostype" name="get_ostype">
80 </itemize>
81
82
83 <sect1><tt/assert.h/<label id="assert.h"><p>
84
85 <itemize>
86 <item><ref id="assert" name="assert">
87 </itemize>
88
89
90 <sect1><tt/atari.h/<label id="atari.h"><p>
91
92 <itemize>
93 <item><ref id="get_ostype" name="get_ostype">
94 </itemize>
95
96 (incomplete)
97
98
99 <sect1><tt/atmos.h/<label id="atmos.h"><p>
100
101 (incomplete)
102
103
104 <sect1><tt/c128.h/<label id="c128.h"><p>
105
106 <itemize>
107 <item><ref id="c64mode" name="c64mode">
108 <item><ref id="fast" name="fast">
109 <item><ref id="slow" name="slow">
110 <item><ref id="toggle_videomode" name="toggle_videomode">
111 <item><ref id="videomode" name="videomode">
112 </itemize>
113
114
115 <sect1><tt/c16.h/<label id="c16.h"><p>
116
117 (incomplete)
118
119
120 <sect1><tt/c64.h/<label id="c64.h"><p>
121
122 <itemize>
123 <item><ref id="get_ostype" name="get_ostype">
124 </itemize>
125
126
127 <sect1><tt/cbm510.h/<label id="cbm510.h"><p>
128
129 <itemize>
130 <item><ref id="peekbsys" name="peekbsys">
131 <item><ref id="peekwsys" name="peekwsys">
132 <item><ref id="pokebsys" name="pokebsys">
133 <item><ref id="pokewsys" name="pokewsys">
134 </itemize>
135
136
137 <sect1><tt/cbm610.h/<label id="cbm610.h"><p>
138
139 <itemize>
140 <item><ref id="peekbsys" name="peekbsys">
141 <item><ref id="peekwsys" name="peekwsys">
142 <item><ref id="pokebsys" name="pokebsys">
143 <item><ref id="pokewsys" name="pokewsys">
144 </itemize>
145
146
147 <sect1><tt/conio.h/<label id="conio.h"><p>
148
149 <itemize>
150 <item><ref id="bgcolor" name="bgcolor">
151 <item><ref id="bordercolor" name="bordercolor">
152 <item><ref id="cclear" name="cclear">
153 <item><ref id="cclearxy" name="cclearxy">
154 <item><ref id="cgetc" name="cgetc">
155 <item><ref id="chline" name="chline">
156 <item><ref id="chlinexy" name="chlinexy">
157 <item><ref id="clrscr" name="clrscr">
158 <item><ref id="cprintf" name="cprintf">
159 <item><ref id="cputc" name="cputc">
160 <item><ref id="cputcxy" name="cputcxy">
161 <item><ref id="cputs" name="cputs">
162 <item><ref id="cputsxy" name="cputsxy">
163 <item><ref id="cursor" name="cursor">
164 <item><ref id="cvline" name="cvline">
165 <item><ref id="cvlinexy" name="cvlinexy">
166 <item><ref id="gotox" name="gotox">
167 <item><ref id="gotoxy" name="gotoxy">
168 <item><ref id="gotoy" name="gotoy">
169 <item><ref id="kbhit" name="kbhit">
170 <item><ref id="revers" name="revers">
171 <item><ref id="screensize" name="screensize">
172 <item><ref id="textcolor" name="textcolor">
173 <item><ref id="vcprintf" name="vcprintf">
174 <item><ref id="wherex" name="wherex">
175 <item><ref id="wherey" name="wherey">
176 </itemize>
177
178
179 <sect1><tt/ctype.h/<label id="ctype.h"><p>
180
181 <itemize>
182 <item><ref id="isalnum" name="isalnum">
183 <item><ref id="isalpha" name="isalpha">
184 <item><ref id="isascii" name="isascii">
185 <item><ref id="isblank" name="isblank">
186 <item><ref id="iscntrl" name="iscntrl">
187 <item><ref id="isdigit" name="isdigit">
188 <item><ref id="isgraph" name="isgraph">
189 <item><ref id="islower" name="islower">
190 <item><ref id="isprint" name="isprint">
191 <item><ref id="ispunct" name="ispunct">
192 <item><ref id="isspace" name="isspace">
193 <item><ref id="isupper" name="isupper">
194 <item><ref id="isxdigit" name="isxdigit">
195 <item><ref id="tolower" name="tolower">
196 <item><ref id="toupper" name="toupper">
197 </itemize>
198
199
200 <sect1><tt/dbg.h/<label id="dbg.h"><p>
201
202 (incomplete)
203
204
205 <sect1><tt/dio.h/<label id="dio.h"><p>
206
207 (incomplete)
208
209
210 <sect1><tt/em.h/<label id="em.h"><p>
211
212 <itemize>
213 <item><ref id="em_commit" name="em_commit">
214 <item><ref id="em_copyfrom" name="em_copyfrom">
215 <item><ref id="em_copyto" name="em_copyto">
216 <item><ref id="em_install" name="em_install">
217 <item><ref id="em_load_driver" name="em_load_driver">
218 <item><ref id="em_map" name="em_map">
219 <item><ref id="em_pagecount" name="em_pagecount">
220 <item><ref id="em_uninstall" name="em_uninstall">
221 <item><ref id="em_unload" name="em_unload">
222 <item><ref id="em_use" name="em_use">
223 </itemize>
224
225
226 <sect1><tt/errno.h/<label id="errno.h"><p>
227
228 (incomplete)
229
230
231 <sect1><tt/fcntl.h/<label id="fcntl.h"><p>
232
233 <itemize>
234 <item><ref id="close" name="close">
235 <item><ref id="creat" name="creat">
236 <item><ref id="open" name="open">
237 </itemize>
238
239
240 <sect1><tt/geos.h/<label id="geos.h"><p>
241
242 (incomplete)
243
244
245 <sect1><tt/joystick.h/<label id="joystick.h"><p>
246
247 <itemize>
248 <item><ref id="joy_count" name="joy_count">
249 <item><ref id="joy_install" name="joy_install">
250 <item><ref id="joy_load_driver" name="joy_load_driver">
251 <item><ref id="joy_read" name="joy_read">
252 <item><ref id="joy_uninstall" name="joy_uninstall">
253 <item><ref id="joy_unload" name="joy_unload">
254 </itemize>
255
256
257 <sect1><tt/locale.h/<label id="locale.h"><p>
258
259 <itemize>
260 <item><ref id="localeconv" name="localeconv">
261 <item><ref id="setlocale" name="setlocale">
262 </itemize>
263
264
265 <sect1><tt/modload.h/<label id="modload.h"><p>
266
267 <itemize>
268 <item><ref id="mod_load" name="mod_load">
269 <item><ref id="mod_free" name="mod_free">
270 </itemize>
271
272
273 <sect1><tt/mouse.h/<label id="mouse.h"><p>
274
275 <itemize>
276 <item><ref id="mouse_load_driver" name="mouse_load_driver">
277 <item><ref id="mouse_unload" name="mouse_unload">
278 <item><ref id="mouse_install" name="mouse_install">
279 <item><ref id="mouse_uninstall" name="mouse_uninstall">
280 <item><ref id="mouse_hide" name="mouse_hide">
281 <item><ref id="mouse_show" name="mouse_show">
282 <item><ref id="mouse_box" name="mouse_box">
283 <item><ref id="mouse_move" name="mouse_move">
284 <item><ref id="mouse_buttons" name="mouse_buttons">
285 <item><ref id="mouse_pos" name="mouse_pos">
286 <item><ref id="mouse_info" name="mouse_info">
287 <item><ref id="mouse_ioctl" name="mouse_ioctl">
288 </itemize>
289
290 (incomplete)
291
292
293 <sect1><tt/nes.h/<label id="nes.h"><p>
294
295 (incomplete)
296
297
298 <sect1><tt/o65.h/<label id="o65.h"><p>
299
300 The <tt/o65.h/ header file contains structure and constant definitions that
301 may be used when dealing with files in <htmlurl
302 url="http://www.6502.org/users/andre/o65/fileformat.html" name="o65 format">.
303 It does not declare any functions.
304
305
306 <sect1><tt/peekpoke.h/<label id="peekpoke.h"><p>
307
308 <itemize>
309 <item><ref id="PEEK" name="PEEK">
310 <item><ref id="PEEKW" name="PEEKW">
311 <item><ref id="POKE" name="POKE">
312 <item><ref id="POKEW" name="POKEW">
313 </itemize>
314
315
316 <sect1><tt/pet.h/<label id="pet.h"><p>
317
318 (incomplete)
319
320
321 <sect1><tt/plus4.h/<label id="plus4.h"><p>
322
323 (incomplete)
324
325
326 <sect1><tt/serial.h/<label id="serial.h"><p>
327
328 <!--
329 <itemize>
330 <item><ref id="ser_load_driver" name="ser_load_driver">
331 <item><ref id="ser_unload" name="ser_unload">
332 <item><ref id="ser_install" name="ser_install">
333 <item><ref id="ser_uninstall" name="ser_uninstall">
334 <item><ref id="ser_open" name="ser_open">
335 <item><ref id="ser_close" name="ser_close">
336 <item><ref id="ser_get" name="ser_get">
337 <item><ref id="ser_put" name="ser_put">
338 <item><ref id="ser_status" name="ser_status">
339 <item><ref id="ser_ioctl" name="ser_ioctl">
340 </itemize>
341 -->
342
343 (incomplete)
344
345
346 <sect1><tt/setjmp.h/<label id="setjmp.h"><p>
347
348 <itemize>
349 <item><ref id="setjmp" name="setjmp">
350 <item><ref id="longjmp" name="longjmp">
351 </itemize>
352
353
354 <sect1><tt/signal.h/<label id="signal.h"><p>
355
356 <itemize>
357 <item><ref id="raise" name="raise">
358 <item><ref id="signal" name="signal">
359 </itemize>
360
361
362 <sect1><tt/stdarg.h/<label id="stdarg.h"><p>
363
364 (incomplete)
365
366
367 <sect1><tt/stdbool.h/<label id="stdbool.h"><p>
368
369 (incomplete)
370
371
372 <sect1><tt/stddef.h/<label id="stddef.h"><p>
373
374 <itemize>
375 <item><ref id="offsetof" name="offsetof">
376 </itemize>
377
378
379 <sect1><tt/stdio.h/<label id="stdio.h"><p>
380
381 <itemize>
382 <item><ref id="clearerr" name="clearerr">
383 <!-- <item><ref id="fclose" name="fclose"> -->
384 <!-- <item><ref id="fdopen" name="fdopen"> -->
385 <item><ref id="feof" name="feof">
386 <item><ref id="ferror" name="ferror">
387 <!-- <item><ref id="fflush" name="fflush"> -->
388 <!-- <item><ref id="fgetc" name="fgetc"> -->
389 <!-- <item><ref id="fgetpos" name="fgetpos"> -->
390 <!-- <item><ref id="fgets" name="fgets"> -->
391 <item><ref id="fileno" name="fileno">
392 <!-- <item><ref id="fopen" name="fopen"> -->
393 <!-- <item><ref id="fprintf" name="fprintf"> -->
394 <!-- <item><ref id="fputc" name="fputc"> -->
395 <!-- <item><ref id="fputs" name="fputs"> -->
396 <!-- <item><ref id="fread" name="fread"> -->
397 <!-- <item><ref id="freopen" name="freopen"> -->
398 <!-- <item><ref id="fscanf" name="fscanf"> -->
399 <!-- <item><ref id="fseek" name="fseek"> -->
400 <!-- <item><ref id="fsetpos" name="fsetpos"> -->
401 <!-- <item><ref id="ftell" name="ftell"> -->
402 <!-- <item><ref id="fwrite" name="fwrite"> -->
403 <!-- <item><ref id="getc" name="getc"> -->
404 <!-- <item><ref id="getchar" name="getchar"> -->
405 <!-- <item><ref id="gets" name="gets"> -->
406 <!-- <item><ref id="printf" name="printf"> -->
407 <!-- <item><ref id="putc" name="putc"> -->
408 <!-- <item><ref id="putchar" name="putchar"> -->
409 <!-- <item><ref id="puts" name="puts"> -->
410 <item><ref id="rename" name="rename">
411 <item><ref id="remove" name="remove">
412 <!-- <item><ref id="rewind" name="rewind"> -->
413 <!-- <item><ref id="scanf" name="scanf"> -->
414 <!-- <item><ref id="sprintf" name="sprintf"> -->
415 <!-- <item><ref id="sscanf" name="sscanf"> -->
416 <!-- <item><ref id="vfprintf" name="vfprintf"> -->
417 <!-- <item><ref id="vfscanf" name="vfscanf"> -->
418 <!-- <item><ref id="vprintf" name="vprintf"> -->
419 <!-- <item><ref id="vscanf" name="vscanf"> -->
420 <!-- <item><ref id="vsprintf" name="vsprintf"> -->
421 <!-- <item><ref id="vsscanf" name="vsscanf"> -->
422 </itemize>
423
424 (incomplete)
425
426
427 <sect1><tt/stdlib.h/<label id="stdlib.h"><p>
428
429 <itemize>
430 <item><ref id="_heapadd" name="_heapadd">
431 <item><ref id="_heapblocksize" name="_heapblocksize">
432 <item><ref id="_heapmaxavail" name="_heapmaxavail">
433 <item><ref id="_heapmemavail" name="_heapmemavail">
434 <item><ref id="_poserror" name="_poserror">
435 <item><ref id="_randomize" name="_randomize">
436 <item><ref id="_swap" name="_swap">
437 <item><ref id="abort" name="abort">
438 <item><ref id="abs" name="abs">
439 <item><ref id="atexit" name="atexit">
440 <item><ref id="atoi" name="atoi">
441 <item><ref id="atol" name="atol">
442 <item><ref id="bsearch" name="bsearch">
443 <item><ref id="calloc" name="calloc">
444 <item><ref id="div" name="div">
445 <item><ref id="exit" name="exit">
446 <item><ref id="free" name="free">
447 <item><ref id="getenv" name="getenv">
448 <item><ref id="itoa" name="itoa">
449 <item><ref id="labs" name="labs">
450 <item><ref id="ltoa" name="ltoa">
451 <item><ref id="malloc" name="malloc">
452 <item><ref id="perror" name="perror">
453 <item><ref id="qsort" name="qsort">
454 <item><ref id="rand" name="rand">
455 <item><ref id="realloc" name="realloc">
456 <item><ref id="srand" name="srand">
457 <item><ref id="ultoa" name="ultoa">
458 <item><ref id="utoa" name="utoa">
459 </itemize>
460
461
462 <sect1><tt/string.h/<label id="string.h"><p>
463
464 <itemize>
465 <item><ref id="_stroserror" name="_stroserror">
466 <item><ref id="bzero" name="bzero">
467 <item><ref id="memchr" name="memchr">
468 <item><ref id="memcpy" name="memcpy">
469 <item><ref id="memmove" name="memmove">
470 <item><ref id="memset" name="memset">
471 <item><ref id="strcasecmp" name="strcasecmp">
472 <item><ref id="strcat" name="strcat">
473 <item><ref id="strchr" name="strchr">
474 <item><ref id="strcmp" name="strcmp">
475 <item><ref id="strcoll" name="strcoll">
476 <item><ref id="strcpy" name="strcpy">
477 <item><ref id="strcspn" name="strcspn">
478 <item><ref id="strdup" name="strdup">
479 <item><ref id="strerror" name="strerror">
480 <item><ref id="stricmp" name="stricmp">
481 <item><ref id="strlen" name="strlen">
482 <item><ref id="strlower" name="strlower">
483 <item><ref id="strlwr" name="strlwr">
484 <item><ref id="strncat" name="strncat">
485 <item><ref id="strncmp" name="strncmp">
486 <item><ref id="strncpy" name="strncpy">
487 <item><ref id="strrchr" name="strrchr">
488 <item><ref id="strspn" name="strspn">
489 <item><ref id="strstr" name="strstr">
490 <item><ref id="strtok" name="strtok">
491 <item><ref id="strxfrm" name="strxfrm">
492 <item><ref id="strupper" name="strupper">
493 <item><ref id="strupr" name="strupr">
494 </itemize>
495
496 (incomplete)
497
498
499 <sect1><tt/tgi.h/<label id="tgi.h"><p>
500
501 (incomplete)
502
503
504 <sect1><tt/time.h/<label id="time.h"><p>
505
506 <itemize>
507 <!-- <item><ref id="_systime" name="_systime"> -->
508 <!-- <item><ref id="asctime" name="asctime"> -->
509 <!-- <item><ref id="clock" name="clock"> -->
510 <!-- <item><ref id="ctime" name="ctime"> -->
511 <!-- <item><ref id="gmtime" name="gmtime"> -->
512 <!-- <item><ref id="localtime" name="localtime"> -->
513 <!-- <item><ref id="mktime" name="mktime"> -->
514 <!-- <item><ref id="strftime" name="strftime"> -->
515 <item><ref id="time" name="time">
516 </itemize>
517
518 (incomplete)
519
520
521 <sect1><tt/unistd.h/<label id="unistd.h"><p>
522
523 <itemize>
524 <!-- <item><ref id="chdir" name="chdir"> -->
525 <!-- <item><ref id="getcwd" name="getcwd"> -->
526 <!-- <item><ref id="lseek" name="lseek"> -->
527 <!-- <item><ref id="mkdir" name="mkdir"> -->
528 <!-- <item><ref id="read" name="read"> -->
529 <!-- <item><ref id="rmdir" name="rmdir"> -->
530 <item><ref id="sleep" name="sleep">
531 <item><ref id="unlink" name="unlink">
532 <!-- <item><ref id="write" name="write"> -->
533 </itemize>
534
535 (incomplete)
536
537
538 <sect1><tt/vic20.h/<label id="vic20.h"><p>
539
540 (incomplete)
541
542
543 <sect1><tt/zlib.h/<label id="zlib.h"><p>
544
545 (incomplete)
546
547
548 <sect>Alphabetical function reference<p>
549
550 <sect1>_heapadd<label id="_heapadd"><p>
551
552 <quote>
553 <descrip>
554 <tag/Function/Add a block to the heap.
555 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
556 <tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
557 <tag/Description/The function adds a block of raw memory to the heap.
558 <tag/Limits/
559 <itemize>
560 <item>The minimum blocksize that can be added is 6 bytes; the function will
561 ignore smaller blocks.
562 </itemize>
563 <tag/Availability/cc65
564 <tag/See also/
565 <ref id="_heapblocksize" name="_heapblocksize">,
566 <ref id="_heapmaxavail" name="_heapmaxavail">,
567 <ref id="_heapmemavail" name="_heapmemavail">,
568 <ref id="calloc" name="calloc">,
569 <ref id="free" name="free">,
570 <ref id="malloc" name="malloc">,
571 <ref id="realloc" name="realloc">
572 <tag/Example/None.
573 </descrip>
574 </quote>
575
576
577 <sect1>_heapblocksize<label id="_heapblocksize"><p>
578
579 <quote>
580 <descrip>
581 <tag/Function/Return the size of an allocated block.
582 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
583 <tag/Declaration/<tt/size_t __fastcall__ _heapblocksize (const void* block);/
584 <tag/Description/The function returns the size of a block that must have
585 previously been allocated by <tt/<ref id="malloc" name="malloc">/, <tt/<ref
586 id="calloc" name="calloc">/ or <tt/<ref id="realloc" name="realloc">/.
587 <tag/Limits/
588 <itemize>
589 <item>Passing a pointer to a block that was is not the result of one of the
590 allocation functions, or that has been free'd will give unpredicable results.
591 </itemize>
592 <tag/Availability/cc65
593 <tag/See also/
594 <ref id="_heapadd" name="_heapadd">,
595 <ref id="_heapmaxavail" name="_heapmaxavail">,
596 <ref id="_heapmemavail" name="_heapmemavail">,
597 <ref id="calloc" name="calloc">,
598 <ref id="free" name="free">,
599 <ref id="malloc" name="malloc">,
600 <ref id="realloc" name="realloc">
601 <tag/Example/None.
602 </descrip>
603 </quote>
604
605
606 <sect1>_heapmaxavail<label id="_heapmaxavail"><p>
607
608 <quote>
609 <descrip>
610 <tag/Function/Return the largest block that is available on the heap.
611 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
612 <tag/Declaration/<tt/size_t __fastcall__ _heapmaxavail (void);/
613 <tag/Description/The function returns the size of the largest block that may
614 be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
615 <tag/Availability/cc65
616 <tag/See also/
617 <ref id="_heapadd" name="_heapadd">,
618 <ref id="_heapblocksize" name="_heapblocksize">,
619 <ref id="_heapmemavail" name="_heapmemavail">,
620 <ref id="calloc" name="calloc">,
621 <ref id="free" name="free">,
622 <ref id="malloc" name="malloc">,
623 <ref id="realloc" name="realloc">
624 <tag/Example/None.
625 </descrip>
626 </quote>
627
628
629 <sect1>_heapmemavail<label id="_heapmemavail"><p>
630
631 <quote>
632 <descrip>
633 <tag/Function/Return the total available space on the heap.
634 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
635 <tag/Declaration/<tt/size_t __fastcall__ _heapmemavail (void);/
636 <tag/Description/The function returns the total number of bytes available on
637 the heap.
638 <tag/Limits/
639 <itemize>
640 <item>This function is of less use than usually assumed, since the returned
641 heap space may be available but not in one block. So even if this function
642 says that several times more heap space is available than needed, <ref
643 id="malloc" name="malloc"> may still return <tt/NULL/.
644 </itemize>
645 <tag/Availability/cc65
646 <tag/See also/
647 <ref id="_heapadd" name="_heapadd">,
648 <ref id="_heapblocksize" name="_heapblocksize">,
649 <ref id="_heapmaxavail" name="_heapmaxavail">,
650 <ref id="calloc" name="calloc">,
651 <ref id="free" name="free">,
652 <ref id="malloc" name="malloc">,
653 <ref id="realloc" name="realloc">
654 <tag/Example/None.
655 </descrip>
656 </quote>
657
658
659 <sect1>_poserror<label id="_poserror"><p>
660
661 <quote>
662 <descrip>
663 <tag/Function/Print an error message for the error in <tt/_oserrno/.
664 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
665 <tag/Declaration/<tt/void __fastcall__ _poserror (const char* msg);/
666 <tag/Description/<tt/_poserror/ prints an error message to <tt/stderr/. If
667 <tt/msg/ is not <tt/NULL/ and not an empty string, it is printed followed by
668 a colon and a blank. Then the error message for the current contents of
669 <tt/_oserrno/ are printed followed by a newline. The message output is the
670 same as returned by <tt/<ref id="_stroserror" name="_stroserror">/ with an
671 argument of <tt/_oserrno/.
672 <tag/Limits/
673 <itemize>
674 <item>Since operating system specific error code are - you guessed it -
675 operating system specific, the value in <tt/_oserror/ and the message that is
676 printed depend on the cc65 target.
677 <item>The function is only available as fastcall function, so it may only
678 be used in presence of a prototype.
679 </itemize>
680 <tag/Availability/cc65
681 <tag/See also/
682 <ref id="_stroserror" name="_stroserror">,
683 <ref id="perror" name="perror">
684 <tag/Example/None.
685 </descrip>
686 </quote>
687
688
689 <sect1>_randomize<label id="_randomize"><p>
690
691 <quote>
692 <descrip>
693 <tag/Function/Initialize the pseudo random number generator.
694 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
695 <tag/Declaration/<tt/void _randomize (void);/
696 <tag/Description/The function initializes the random number generator with
697 a seed derived from fast changing hardware events, so the seed itself can be
698 considered random to a certain degree.
699 <tag/Limits/<itemize>
700 <item>The randomness of the seed depends on the machine hardware.
701 </itemize>
702 <tag/Availability/cc65
703 <tag/See also/
704 <ref id="rand" name="rand">,
705 <ref id="srand" name="srand">
706 <tag/Example/None.
707 </descrip>
708 </quote>
709
710
711 <sect1>_stroserror<label id="_stroserror"><p>
712
713 <quote>
714 <descrip>
715 <tag/Function/Return a string describing an OS specific error code.
716 <tag/Header/<tt/<ref id="string.h" name="string.h">/
717 <tag/Declaration/<tt/const char* __fastcall__ _stroserror (unsigned char errcode);/
718 <tag/Description/<tt/_stroserror/ will return a string describing the given
719 operating system specific error code.
720 <tag/Limits/<itemize>
721 <item>Since operating system specific error code are - you guessed it -
722 operating system specific, the parameter and the string returned depend on the
723 cc65 target.
724 <item>The function is only available as fastcall function, so it may only be
725 used in presence of a prototype.
726 </itemize>
727 <tag/Availability/cc65
728 <tag/See also/
729 <ref id="strerror" name="strerror">
730 <tag/Example/None.
731 </descrip>
732 </quote>
733
734
735 <sect1>_swap<label id="_swap"><p>
736
737 <quote>
738 <descrip>
739 <tag/Function/Swap the contents of memory areas.
740 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
741 <tag/Declaration/<tt/void __fastcall__ _swap (void* p, void* q, size_t size);/
742 <tag/Description/<tt/_swap/ will swap (exchange) the contents of the two memory
743 areas pointed to by <tt/p/ and <tt/q/. Both memory areas are assumed to be
744 <tt/size/ bytes in size.
745 <tag/Limits/<itemize>
746 <item>The memory areas may not overlap, otherwise the results are undefined.
747 <item>The function is only available as fastcall function, so it may only be
748 used in presence of a prototype.
749 </itemize>
750 <tag/Availability/cc65
751 <tag/See also/
752 <ref id="memcpy" name="memcpy">,
753 <ref id="memmove" name="memmove">
754 <tag/Example/None.
755 </descrip>
756 </quote>
757
758
759 <sect1>_sys<label id="_sys"><p>
760
761 <quote>
762 <descrip>
763 <tag/Function/Call a subroutine passing register values.
764 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
765 <tag/Declaration/<tt/void __fastcall__ _sys (struct regs* r);/
766 <tag/Description/The function will call the subroutine at the address
767 specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
768 registers and the CPU flags are set to the values given in the <tt/regs/
769 structure. On return from the subroutine, the new values of the registers and
770 flags are stored back overwriting the old values.
771 <tag/Limits/<itemize>
772 <item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
773 when calling the subroutine (they are unchanged from their current values).
774 <item>The function is only available as fastcall function, so it may only be
775 used in presence of a prototype.
776 </itemize>
777 <tag/Availability/cc65
778 <tag/Example/None.
779 </descrip>
780 </quote>
781
782
783 <sect1>BRK<label id="BRK"><p>
784
785 <quote>
786 <descrip>
787 <tag/Function/Insert a 6502 BRK instrunction into the code.
788 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
789 <tag/Declaration/<tt/void BRK (void);/
790 <tag/Description/The function will insert a 6502 BRK instruction into the code
791 which may be used to trigger a debugger.
792 <tag/Limits/<itemize>
793 <item>The function is actually a macro.
794 <item>The inserted instruction may lead to unexpected results if no debugger
795 is present.
796 </itemize>
797 <tag/Availability/cc65
798 <tag/See also/
799 <ref id="CLI" name="CLI">,
800 <ref id="SEI" name="SEI">
801 <tag/Example/None.
802 </descrip>
803 </quote>
804
805
806 <sect1>CLI<label id="CLI"><p>
807
808 <quote>
809 <descrip>
810 <tag/Function/Insert a 6502 CLI instrunction into the code.
811 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
812 <tag/Declaration/<tt/void CLI (void);/
813 <tag/Description/The function will insert a 6502 CLI instruction into the code,
814 so interrupts are enabled. Enabling interrupts has no effects if they are
815 already enabled (the default).
816 <tag/Limits/<itemize>
817 <item>The function is actually a macro.
818 <item>Disabling interrupts may lead to unexpected results.
819 </itemize>
820 <tag/Availability/cc65
821 <tag/See also/
822 <ref id="BRK" name="BRK">,
823 <ref id="SEI" name="SEI">
824 <tag/Example/None.
825 </descrip>
826 </quote>
827
828
829 <sect1>PEEK<label id="PEEK"><p>
830
831 <quote>
832 <descrip>
833 <tag/Function/Read a byte from memory.
834 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
835 <tag/Declaration/<tt/unsigned char PEEK (unsigned addr);/
836 <tag/Description/The function will read the absolute memory given by <tt/addr/
837 and return the value read.
838 <tag/Limits/<itemize>
839 <item>The function is actually a macro.
840 <item>This function depends highly on the platform and environment.
841 </itemize>
842 <tag/Availability/cc65
843 <tag/See also/
844 <ref id="PEEKW" name="PEEKW">,
845 <ref id="POKE" name="POKE">
846 <tag/Example/None.
847 </descrip>
848 </quote>
849
850
851 <sect1>PEEKW<label id="PEEKW"><p>
852
853 <quote>
854 <descrip>
855 <tag/Function/Read a word (two bytes) from memory.
856 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
857 <tag/Declaration/<tt/unsigned PEEKW (unsigned addr);/
858 <tag/Description/The function will read the absolute memory given by <tt/addr/
859 and return the value read. The byte read from the higher address is the high
860 byte of the return value.
861 <tag/Limits/<itemize>
862 <item>The function is actually a macro.
863 <item>This function depends highly on the platform and environment.
864 <item>The order in which the two bytes are read is unspecified and may
865 depend of the address expression used.
866 </itemize>
867 <tag/Availability/cc65
868 <tag/See also/
869 <ref id="PEEK" name="PEEK">,
870 <ref id="POKE" name="POKE">
871 <tag/Example/None.
872 </descrip>
873 </quote>
874
875
876 <sect1>POKE<label id="POKE"><p>
877
878 <quote>
879 <descrip>
880 <tag/Function/Write a byte to memory.
881 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
882 <tag/Declaration/<tt/void POKE (unsigned addr, unsigned char val);/
883 <tag/Description/The function writes the value <tt/val/ to the absolute
884 memory address given by <tt/addr/.
885 <tag/Limits/<itemize>
886 <item>The function is actually a macro.
887 <item>This function depends highly on the platform and environment.
888 <item>Careless use will cause the program to act strange or may crash the
889 machine.
890 </itemize>
891 <tag/Availability/cc65
892 <tag/See also/
893 <ref id="PEEK" name="PEEK">,
894 <ref id="POKEW" name="POKEW">
895 <tag/Example/None.
896 </descrip>
897 </quote>
898
899
900 <sect1>POKEW<label id="POKEW"><p>
901
902 <quote>
903 <descrip>
904 <tag/Function/Write a word (two bytes) to memory.
905 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
906 <tag/Declaration/<tt/void POKEW (unsigned addr, unsigned val);/
907 <tag/Description/The function writes the value <tt/val/ to the absolute
908 memory address given by <tt/addr/. The low byte of <tt/val/ is written to
909 the <tt/addr/, the high byte is written to <tt/addr+1/.
910 <tag/Limits/<itemize>
911 <item>The function is actually a macro.
912 <item>This function depends highly on the platform and environment.
913 <item>Careless use will cause the program to act strange or may crash the
914 machine.
915 <item>The order in which the two bytes are written is unspecified and may
916 depend of the address expression used.
917 </itemize>
918 <tag/Availability/cc65
919 <tag/See also/
920 <ref id="PEEK" name="PEEK">,
921 <ref id="POKE" name="POKE">
922 <tag/Example/None.
923 </descrip>
924 </quote>
925
926
927 <sect1>SEI<label id="SEI"><p>
928
929 <quote>
930 <descrip>
931 <tag/Function/Insert a 6502 SEI instrunction into the code.
932 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
933 <tag/Declaration/<tt/void SEI (void);/
934 <tag/Description/The function will insert a 6502 SEI instruction into the code,
935 so interrupts are disabled. Note that non maskable interrupts cannot be
936 disabled.
937 <tag/Limits/<itemize>
938 <item>The function is actually a macro.
939 <item>Disabling interrupts may lead to unexpected results.
940 </itemize>
941 <tag/Availability/cc65
942 <tag/See also/
943 <ref id="BRK" name="BRK">,
944 <ref id="CLI" name="CLI">
945 <tag/Example/None.
946 </descrip>
947 </quote>
948
949
950 <sect1>abort<label id="abort"><p>
951
952 <quote>
953 <descrip>
954 <tag/Function/Terminates a program abnormally.
955 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
956 <tag/Declaration/<tt/void abort (void);/
957 <tag/Description/<tt/abort/ raises <tt/SIGABRT/, writes a termination message
958 on stderr, then terminates the program with an exit code of 3.
959 <tag/Availability/ISO 9899
960 <tag/See also/
961 <ref id="assert" name="assert">,
962 <ref id="exit" name="exit">,
963 <ref id="raise" name="raise">
964 <tag/Example/None.
965 </descrip>
966 </quote>
967
968
969 <sect1>abs<label id="abs"><p>
970
971 <quote>
972 <descrip>
973 <tag/Function/Returns the absolute value of an integer.
974 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
975 <tag/Declaration/<tt/int __fastcall__ abs (int v);/
976 <tag/Description/<tt/abs/ returns the absolute value of the argument passed to
977 the function.
978 <tag/Limits/<itemize>
979 <item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
980 <item>The function is only available as fastcall function, so it may only be
981 used in presence of a prototype.
982 </itemize>
983 <tag/Availability/ISO 9899
984 <tag/See also/
985 <ref id="labs" name="labs">
986 <tag/Example/None.
987 </descrip>
988 </quote>
989
990
991 <sect1>assert<label id="assert"><p>
992
993 <quote>
994 <descrip>
995 <tag/Function/Test a condition and possibly abort.
996 <tag/Header/<tt/<ref id="assert.h" name="assert.h">/
997 <tag/Declaration/<tt/void assert (int cond);/
998 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
999 statement. If the condition evaluates t zero (false), assert prints a message
1000 on stderr and aborts the program.
1001 <tag/Limits/<itemize>
1002 <item>The function is actually a macro.
1003 </itemize>
1004 <tag/Availability/ISO 9899
1005 <tag/See also/
1006 <ref id="abort" name="abort">,
1007 <ref id="exit" name="exit">
1008 <tag/Example/None.
1009 </descrip>
1010 </quote>
1011
1012
1013 <sect1>atexit<label id="atexit"><p>
1014
1015 <quote>
1016 <descrip>
1017 <tag/Function/Register an exit function.
1018 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1019 <tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
1020 <tag/Description/<tt/atexit/ registers the function pointed to by
1021 <tt/exitfunc/ as an exit function. Exit functions are called when the program
1022 terminates, they are called in LIFO order (the last function registered is
1023 called first). <tt/atexit/ returns zero on success and a nonzero value on
1024 failure.
1025 <tag/Limits/<itemize>
1026 <item>A maximum of 5 exit functions can be registered.
1027 <item>There is no way to unregister an exit function.
1028 <item>The function is only available as fastcall function, so it may only be
1029 used in presence of a prototype.
1030 </itemize>
1031 <tag/Availability/ISO 9899
1032 <tag/See also/
1033 <ref id="abort" name="abort">,
1034 <ref id="exit" name="exit">
1035 <tag/Example/None.
1036 </descrip>
1037 </quote>
1038
1039
1040 <sect1>atoi<label id="atoi"><p>
1041
1042 <quote>
1043 <descrip>
1044 <tag/Function/Convert a string to an integer.
1045 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1046 <tag/Declaration/<tt/int __fastcall__ atoi (const char* s);/
1047 <tag/Description/<tt/atoi/ converts the given string into an integer.
1048 Conversion stops as soon as any invalid character is encountered.
1049 <tag/Limits/<itemize>
1050 <item>There is no way to detect any conversion errors.
1051 <item>The function does not check for an numerical overflow when converting.
1052 <item>The function is only available as fastcall function, so it may only be
1053 used in presence of a prototype.
1054 </itemize>
1055 <tag/Availability/ISO 9899
1056 <tag/See also/
1057 <ref id="atol" name="atol">,
1058 <ref id="itoa" name="itoa">,
1059 <ref id="ltoa" name="ltoa">,
1060 <ref id="ultoa" name="ultoa">,
1061 <ref id="utoa" name="utoa">
1062 <tag/Example/None.
1063 </descrip>
1064 </quote>
1065
1066
1067 <sect1>atol<label id="atol"><p>
1068
1069 <quote>
1070 <descrip>
1071 <tag/Function/Convert a string to a long integer.
1072 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1073 <tag/Declaration/<tt/long __fastcall__ atol (const char* s);/
1074 <tag/Description/<tt/atol/ converts the given string into a long integer.
1075 Conversion stops as soon as any invalid character is encountered.
1076 <tag/Limits/<itemize>
1077 <item>There is no way to detect any conversion errors.
1078 <item>The function does not check for an numerical overflow when converting.
1079 <item>The function is only available as fastcall function, so it may only be
1080 used in presence of a prototype.
1081 </itemize>
1082 <tag/Availability/ISO 9899
1083 <tag/See also/
1084 <ref id="atoi" name="atoi">,
1085 <ref id="itoa" name="itoa">,
1086 <ref id="ltoa" name="ltoa">,
1087 <ref id="ultoa" name="ultoa">,
1088 <ref id="utoa" name="utoa">
1089 <tag/Example/None.
1090 </descrip>
1091 </quote>
1092
1093
1094 <sect1>bgcolor<label id="bgcolor"><p>
1095
1096 <quote>
1097 <descrip>
1098 <tag/Function/Set the background text color.
1099 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1100 <tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
1101 <tag/Description/The function will set a new background color and return the
1102 old (current) one. The background color is valid for the whole text output
1103 area of the screen, not just for new text.
1104 <tag/Limits/<itemize>
1105 <item>Background colors are system dependent. The function may have no effect
1106 on systems where the background color cannot be changed.
1107 <item>The function is only available as fastcall function, so it may only be
1108 used in presence of a prototype.
1109 </itemize>
1110 <tag/Availability/cc65
1111 <tag/See also/
1112 <ref id="bordercolor" name="bordercolor">,
1113 <ref id="textcolor" name="textcolor">
1114 <tag/Example/None.
1115 </descrip>
1116 </quote>
1117
1118
1119 <sect1>bordercolor<label id="bordercolor"><p>
1120
1121 <quote>
1122 <descrip>
1123 <tag/Function/Set the border (frame) color.
1124 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1125 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
1126 <tag/Description/The function will set a new border color. It returns the old
1127 (current) border color.
1128 <tag/Limits/<itemize>
1129 <item>Border colors are system dependent. The function may have no effect
1130 on systems where the border color cannot be changed.
1131 <item>The function is only available as fastcall function, so it may only
1132 be used in presence of a prototype.
1133 </itemize>
1134 <tag/Availability/cc65
1135 <tag/See also/
1136 <ref id="bgcolor" name="bgcolor">,
1137 <ref id="textcolor" name="textcolor">
1138 <tag/Example/None.
1139 </descrip>
1140 </quote>
1141
1142
1143 <sect1>bsearch<label id="bsearch"><p>
1144
1145 <quote>
1146 <descrip>
1147 <tag/Function/Do a binary search in a sorted array.
1148 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1149 <tag/Declaration/<tt/void* __fastcall__ bsearch (const void* key,
1150 const void* base, size_t n, size_t size,
1151 int (*cmp) (const void*, const void*));/
1152 <tag/Description/<tt/bsearch/ searches a sorted array for a member that
1153 matches the one pointed to by <tt/key/. <tt/base/ is the address of the array,
1154 <tt/n/ is the number of elements, <tt/size/ the size of an element and <tt/cmp/
1155 the function used to compare the members against the key. The function returns
1156 a pointer to the member found, or <tt/NULL/ if there was no match.
1157 <tag/Limits/
1158 <itemize>
1159 <item>The contents of the array must be sorted in ascending order according to
1160 the compare function given.
1161 <item>If there are multiple members that match the key, the function will
1162 return one of the members.
1163 <item>The function is only available as fastcall function, so it may only
1164 be used in presence of a prototype.
1165 </itemize>
1166 <tag/Availability/ISO 9899
1167 <tag/See also/
1168 <ref id="qsort" name="qsort">
1169 <tag/Example/None.
1170 </descrip>
1171 </quote>
1172
1173
1174 <sect1>bzero<label id="bzero"><p>
1175
1176 <quote>
1177 <descrip>
1178 <tag/Function/Fill a memory area with zeroes.
1179 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1180 <tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
1181 <tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
1182 zero.
1183 <tag/Limits/
1184 <itemize>
1185 <item>The function is non standard and therefore only available in non ANSI
1186 mode. You should use <tt/<ref id="memset" name="memset">/ instead.
1187 <item>The function is only available as fastcall function, so it may only
1188 be used in presence of a prototype.
1189 </itemize>
1190 <tag/Availability/cc65
1191 <tag/See also/
1192 <ref id="_swap" name="_swap">,
1193 <ref id="memcpy" name="memcpy">,
1194 <ref id="memmove" name="memmove">,
1195 <ref id="memset" name="memset">,
1196 <tag/Example/None.
1197 </descrip>
1198 </quote>
1199
1200
1201 <sect1>c64mode<label id="c64mode"><p>
1202
1203 <quote>
1204 <descrip>
1205 <tag/Function/Switch the C128 into C64 compatible mode.
1206 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1207 <tag/Declaration/<tt/void c64mode (void);/
1208 <tag/Description/The function will cause the machine to reboot into C64 mode.
1209 <tag/Limits/<itemize>
1210 <item>The function is specific to the C128.
1211 <item>The function will not return to the caller.
1212 </itemize>
1213 <tag/Availability/C128
1214 <tag/Example/None.
1215 </descrip>
1216 </quote>
1217
1218
1219 <sect1>calloc<label id="calloc"><p>
1220
1221 <quote>
1222 <descrip>
1223 <tag/Function/Allocate and clear memory.
1224 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1225 <tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
1226 <tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
1227 of size <tt/size/, clears the whole block with binary zeroes and returns a
1228 pointer to it. On error (not enough memory available), <tt/calloc/ returns
1229 <tt/NULL/.
1230 <tag/Limits/
1231 <itemize>
1232 <item>Clearing the memory may not have the expected effect on all platforms:
1233 pointers in the block may not be <tt/NULL/ and floating point variables may
1234 not be zero (0.0). In other words: The "clearing" effect of this function
1235 should be used with care for portable programs.
1236 <item>The function is only available as fastcall function, so it may only
1237 be used in presence of a prototype.
1238 </itemize>
1239 <tag/Availability/ISO 9899
1240 <tag/See also/
1241 <ref id="_heapadd" name="_heapadd">,
1242 <ref id="_heapblocksize" name="_heapblocksize">,
1243 <ref id="_heapmaxavail" name="_heapmaxavail">,
1244 <ref id="_heapmemavail" name="_heapmemavail">,
1245 <ref id="free" name="free">,
1246 <ref id="malloc" name="malloc">,
1247 <ref id="realloc" name="realloc">
1248 <tag/Example/None.
1249 </descrip>
1250 </quote>
1251
1252
1253 <sect1>cclear<label id="cclear"><p>
1254
1255 <quote>
1256 <descrip>
1257 <tag/Function/Clear part of a line (write a given number of spaces).
1258 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1259 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
1260 <tag/Description/The function clears part of a line by writing <tt/length/
1261 spaces in the current text color.
1262 <tag/Limits/<itemize>
1263 <item>The function is only available as fastcall function, so it may
1264 only be used in presence of a prototype.
1265 </itemize>
1266 <tag/Availability/cc65
1267 <tag/See also/
1268 <ref id="cclearxy" name="cclearxy">,
1269 <ref id="clrscr" name="clrscr">
1270 <tag/Example/None.
1271 </descrip>
1272 </quote>
1273
1274
1275 <sect1>cclearxy<label id="cclearxy"><p>
1276
1277 <quote>
1278 <descrip>
1279 <tag/Function/Clear part of a line (write a given number of spaces) starting
1280 at a specific screen position.
1281 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1282 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char x, unsigned char y, unsigned char length);/
1283 <tag/Description/The function moves the cursor to a specific position, and
1284 will then clear part of the line by writing <tt/length/ spaces in the current
1285 text color.
1286 <tag/Limits/<itemize>
1287 <item>The function is only available as fastcall function, so it may
1288 only be used in presence of a prototype.
1289 </itemize>
1290 <tag/Availability/cc65
1291 <tag/See also/
1292 <ref id="cclear" name="cclear">,
1293 <ref id="clrscr" name="clrscr">
1294 <tag/Example/None.
1295 </descrip>
1296 </quote>
1297
1298
1299 <sect1>cgetc<label id="cgetc"><p>
1300
1301 <quote>
1302 <descrip>
1303 <tag/Function/Read a character from the keyboard.
1304 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1305 <tag/Declaration/<tt/char cgetc (void);/
1306 <tag/Description/The function reads a character from the keyboard. If there is
1307 no character available, <tt/cgetc/ waits until the user presses a key. If the
1308 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
1309 displayed while waiting.
1310 <tag/Limits/<itemize>
1311 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
1312 from this buffer and wait only if the buffer is empty.
1313 </itemize>
1314 <tag/Availability/cc65
1315 <tag/See also/
1316 <ref id="cursor" name="cursor">,
1317 <ref id="kbhit" name="kbhit">
1318 <tag/Example/None.
1319 </descrip>
1320 </quote>
1321
1322
1323 <sect1>chline<label id="chline"><p>
1324
1325 <quote>
1326 <descrip>
1327 <tag/Function/Output a horizontal line in text mode.
1328 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1329 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
1330 <tag/Description/The function outputs a horizontal line with the given length
1331 starting at the current cursor position.
1332 <tag/Limits/<itemize>
1333 <item>The character used to draw the horizontal line is system dependent.
1334 If available, a line drawing character is used. Drawing a line that is partially
1335 off screen leads to undefined behaviour.
1336 <item>The function is only available as fastcall function, so it may only be
1337 used in presence of a prototype.
1338 </itemize>
1339 <tag/Availability/cc65
1340 <tag/See also/
1341 <ref id="chlinexy" name="chlinexy">,
1342 <ref id="cvline" name="cvline">,
1343 <ref id="cvlinexy" name="cvlinexy">
1344 <tag/Example/None.
1345 </descrip>
1346 </quote>
1347
1348
1349 <sect1>chlinexy<label id="chlinexy"><p>
1350
1351 <quote>
1352 <descrip>
1353 <tag/Function/Output a horizontal line at a given position in text mode.
1354 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1355 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
1356 <tag/Description/The function outputs a horizontal line with the given length
1357 starting at a given position.
1358 <tag/Limits/<itemize>
1359 <item>The character used to draw the horizontal line is system dependent.
1360 If available, a line drawing character is used. Drawing a line that is partially
1361 off screen leads to undefined behaviour.
1362 <item>The function is only available as fastcall function, so it may only be
1363 used in presence of a prototype.
1364 </itemize>
1365 <tag/Availability/cc65
1366 <tag/See also/
1367 <ref id="chline" name="chline">,
1368 <ref id="cvline" name="cvline">,
1369 <ref id="cvlinexy" name="cvlinexy">
1370 <tag/Example/None.
1371 </descrip>
1372 </quote>
1373
1374
1375 <sect1>clearerr<label id="clearerr"><p>
1376
1377 <quote>
1378 <descrip>
1379 <tag/Function/Clear error and end-of-file status of a stream.
1380 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
1381 <tag/Declaration/<tt/void __fastcall__ clearerr (FILE* f);/
1382 <tag/Description/<tt/clearerr/ clears the error and end-of-file status
1383 indicators for the stream <tt/f/.
1384 <tag/Limits/<itemize>
1385 <item>The function is only available as fastcall function, so it may only be
1386 used in presence of a prototype.
1387 </itemize>
1388 <tag/Availability/ISO 9899
1389 <tag/See also/
1390 <ref id="feof" name="feof">,
1391 <ref id="ferror" name="ferror">
1392 <tag/Example/None.
1393 </descrip>
1394 </quote>
1395
1396
1397 <sect1>clrscr<label id="clrscr"><p>
1398
1399 <quote>
1400 <descrip>
1401 <tag/Function/Clear the text screen.
1402 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1403 <tag/Declaration/<tt/void clrscr (void);/
1404 <tag/Description/The function clears the text screen and moves the cursor to
1405 the upper left corner.
1406 <tag/Availability/cc65
1407 <tag/See also/
1408 <ref id="cclear" name="cclear">,
1409 <ref id="cclearxy" name="cclearxy">
1410 <tag/Example/None.
1411 </descrip>
1412 </quote>
1413
1414
1415 <sect1>close<label id="close"><p>
1416
1417 <quote>
1418 <descrip>
1419 <tag/Function/Close a file descriptor.
1420 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1421 <tag/Declaration/<tt/int __fastcall__ close (int fd);/
1422 <tag/Description/The function closes the given file descriptor. It returns zero
1423 on success and -1 on error. If an error occurs, the cause can be determined by
1424 reading the <tt/errno/ variable.
1425 <tag/Limits/<itemize>
1426 <item>The function is only available as fastcall function, so it may only
1427 be used in presence of a prototype.
1428 </itemize>
1429 <tag/Availability/POSIX 1003.1
1430 <tag/See also/
1431 <ref id="creat" name="creat">,
1432 <ref id="open" name="open">
1433 <tag/Example/None.
1434 </descrip>
1435 </quote>
1436
1437
1438 <sect1>creat<label id="creat"><p>
1439
1440 <quote>
1441 <descrip>
1442 <tag/Function/Create a file.
1443 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1444 <tag/Declaration/<tt/int __fastcall__ creat (const char* name, unsigned mode);/
1445 <tag/Description/<tt/creat/ creates a new file and returns the file descriptor
1446 associated with it. On error, -1 is returned and an error code is stored in
1447 <tt/errno/.
1448 <tag/Limits/<itemize>
1449 <item><tt/creat/ is identical to calling <tt/<ref id="open" name="open">/ with
1450 <tt/flags/ equal to <tt/O_WRONLY | O_CREAT | O_TRUNC/.
1451 <item>The function is only available as fastcall function, so it may only
1452 be used in presence of a prototype.
1453 </itemize>
1454 <tag/Availability/POSIX 1003.1
1455 <tag/See also/
1456 <ref id="close" name="close">,
1457 <ref id="open" name="open">
1458 <tag/Example/None.
1459 </descrip>
1460 </quote>
1461
1462
1463 <sect1>cprintf<label id="cprintf"><p>
1464
1465 <quote>
1466 <descrip>
1467 <tag/Function/Formatted output to the console.
1468 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1469 <tag/Declaration/<tt/int cprintf (const char* format, ...);/
1470 <tag/Description/The arguments are converted to text where necessary and
1471 formatted according to the format string given. The resulting string is output
1472 to the console. <tt/cprintf/ supports the same format specifiers as
1473 <tt/printf/. <!-- <tt/<ref id="printf" name="printf">/. -->
1474 <tag/Limits/<itemize>
1475 <item>Like all other <tt/conio/ output functions, <tt/cprintf/ distinguishes
1476 between <tt/\r/ and <tt/\n/.
1477 </itemize>
1478 <tag/Availability/cc65
1479 <tag/See also/
1480 <ref id="cputc" name="cputc">,
1481 <ref id="cputcxy" name="cputcxy">,
1482 <ref id="cputs" name="cputs">,
1483 <ref id="cputsxy" name="cputsxy">,
1484 <ref id="vcprintf" name="vcprintf">
1485 <tag/Example/None.
1486 </descrip>
1487 </quote>
1488
1489
1490 <sect1>cputc<label id="cputc"><p>
1491
1492 <quote>
1493 <descrip>
1494 <tag/Function/Output a character directly to the console.
1495 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1496 <tag/Declaration/<tt/void __fastcall__ cputc (char c);/
1497 <tag/Description/Output one character to the console at the current cursor
1498 position.
1499 <tag/Limits/<itemize>
1500 <item>Like all other <tt/conio/ output functions, <tt/cputc/ distinguishes
1501 between <tt/\r/ and <tt/\n/.
1502 <item>The function is only available as fastcall function, so it may only
1503 be used in presence of a prototype.
1504 </itemize>
1505 <tag/Availability/cc65
1506 <tag/See also/
1507 <ref id="cprintf" name="cprintf">,
1508 <ref id="cputcxy" name="cputcxy">,
1509 <ref id="cputs" name="cputs">,
1510 <ref id="cputsxy" name="cputsxy">,
1511 <ref id="vcprintf" name="vcprintf">
1512 <tag/Example/None.
1513 </descrip>
1514 </quote>
1515
1516
1517 <sect1>cputcxy<label id="cputcxy"><p>
1518
1519 <quote>
1520 <descrip>
1521 <tag/Function/Output a character at a specific screen position.
1522 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1523 <tag/Declaration/<tt/void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);/
1524 <tag/Description/<tt/cputcxy/ moves the cursor to the given x/y position on
1525 the screen and outputs one character.
1526 <tag/Limits/<itemize>
1527 <item>Like all other <tt/conio/ output functions, <tt/cputcxy/ distinguishes
1528 between <tt/\r/ and <tt/\n/.
1529 <item>The function is only available as fastcall function, so it may only
1530 be used in presence of a prototype.
1531 </itemize>
1532 <tag/Availability/cc65
1533 <tag/See also/
1534 <ref id="cprintf" name="cprintf">,
1535 <ref id="cputc" name="cputc">,
1536 <ref id="cputs" name="cputs">,
1537 <ref id="cputsxy" name="cputsxy">,
1538 <ref id="vcprintf" name="vcprintf">
1539 <tag/Example/None.
1540 </descrip>
1541 </quote>
1542
1543
1544 <sect1>cputs<label id="cputs"><p>
1545
1546 <quote>
1547 <descrip>
1548 <tag/Function/Output a string directly to the console.
1549 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1550 <tag/Declaration/<tt/void __fastcall__ cputs (const char* s);/
1551 <tag/Description/The function outputs the given string on the console at the
1552 current cursor position.
1553 <tag/Limits/<itemize>
1554 <item>Like all other <tt/conio/ output functions, <tt/cputs/ distinguishes
1555 between <tt/\r/ and <tt/\n/.
1556 <item>The function is only available as fastcall function, so it may only
1557 be used in presence of a prototype.
1558 </itemize>
1559 <tag/Availability/cc65
1560 <tag/See also/
1561 <ref id="cprintf" name="cprintf">,
1562 <ref id="cputc" name="cputc">,
1563 <ref id="cputcxy" name="cputcxy">,
1564 <ref id="cputsxy" name="cputsxy">,
1565 <ref id="vcprintf" name="vcprintf">
1566 <tag/Example/None.
1567 </descrip>
1568 </quote>
1569
1570
1571 <sect1>cputsxy<label id="cputsxy"><p>
1572
1573 <quote>
1574 <descrip>
1575 <tag/Function/Output a string to the console at a given position.
1576 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1577 <tag/Declaration/<tt/void __fastcall__ cputsxy (unsigned char x, unsigned char y, const char* s);/
1578 <tag/Description/<tt/cputsxy/ moves the cursor to the given x/y position,
1579 and outputs the string <tt/s/.
1580 <tag/Limits/<itemize>
1581 <item>Like all other <tt/conio/ output functions, <tt/cputsxy/ distinguishes
1582 between <tt/\r/ and <tt/\n/.
1583 <item>The function is only available as fastcall function, so it may only
1584 be used in presence of a prototype.
1585 </itemize>
1586 <tag/Availability/cc65
1587 <tag/See also/
1588 <ref id="cprintf" name="cprintf">,
1589 <ref id="cputc" name="cputc">,
1590 <ref id="cputcxy" name="cputcxy">,
1591 <ref id="cputs" name="cputs">,
1592 <ref id="vcprintf" name="vcprintf">
1593 <tag/Example/None.
1594 </descrip>
1595 </quote>
1596
1597
1598 <sect1>cursor<label id="cursor"><p>
1599
1600 <quote>
1601 <descrip>
1602 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
1603 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1604 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
1605 <tag/Description/If the argument to the function is non zero, a blinking cursor
1606 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
1607 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
1608 <tag/Limits/<itemize>
1609 <item>The function is only available as fastcall function, so it may only
1610 be used in presence of a prototype.
1611 </itemize>
1612 <tag/Availability/cc65
1613 <tag/See also/
1614 <ref id="cgetc" name="cgetc">,
1615 <ref id="kbhit" name="kbhit">
1616 <tag/Example/None.
1617 </descrip>
1618 </quote>
1619
1620
1621 <sect1>cvline<label id="cvline"><p>
1622
1623 <quote>
1624 <descrip>
1625 <tag/Function/Output a vertical line in text mode.
1626 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1627 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
1628 <tag/Description/The function outputs a vertical line with the given length
1629 starting at the current cursor position.
1630 <tag/Limits/<itemize>
1631 <item>The character used to draw the vertical line is system dependent.
1632 If available, a line drawing character is used. Drawing a line that is partially
1633 off screen leads to undefined behaviour.
1634 <item>The function is only available as fastcall function, so it may only be
1635 used in presence of a prototype.
1636 </itemize>
1637 <tag/Availability/cc65
1638 <tag/See also/
1639 <ref id="chline" name="chline">,
1640 <ref id="chlinexy" name="chlinexy">,
1641 <ref id="cvlinexy" name="cvlinexy">
1642 <tag/Example/None.
1643 </descrip>
1644 </quote>
1645
1646
1647 <sect1>cvlinexy<label id="cvlinexy"><p>
1648
1649 <quote>
1650 <descrip>
1651 <tag/Function/Output a vertical line at a given position in text mode.
1652 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1653 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
1654 <tag/Description/The function outputs a vertical line with the given length
1655 starting at a given position.
1656 <tag/Limits/<itemize>
1657 <item>The character used to draw the vertical line is system dependent.
1658 If available, a line drawing character is used. Drawing a line that is partially
1659 off screen leads to undefined behaviour.
1660 <item>The function is only available as fastcall function, so it may only be
1661 used in presence of a prototype.
1662 </itemize>
1663 <tag/Availability/cc65
1664 <tag/See also/
1665 <ref id="chline" name="chline">,
1666 <ref id="chlinexy" name="chlinexy">,
1667 <ref id="cvline" name="cvline">
1668 <tag/Example/None.
1669 </descrip>
1670 </quote>
1671
1672
1673 <sect1>div<label id="div"><p>
1674
1675 <quote>
1676 <descrip>
1677 <tag/Function/Divide two ints and return quotient and remainder.
1678 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1679 <tag/Declaration/<tt/div_t __fastcall__ div (int numer, int denom);/
1680 <tag/Description/<tt/div/ divides <tt/numer/ by <tt/denom/ and returns the
1681 quotient and remainder in a <tt/div_t/ structure.
1682 <tag/Limits/
1683 <itemize>
1684 <item>The function is only available as fastcall function, so it may only
1685 be used in presence of a prototype.
1686 </itemize>
1687 <tag/Availability/ISO 9899
1688 <tag/See also/
1689 ldiv
1690 <tag/Example/None.
1691 </descrip>
1692 </quote>
1693
1694
1695 <sect1>em_commit<label id="em_commit"><p>
1696
1697 <quote>
1698 <descrip>
1699 <tag/Function/Commit changes into extended memory.
1700 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1701 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
1702 <tag/Description/Commit changes in the memory window to extended storage. If
1703 the contents of the memory window have been changed, these changes may be lost
1704 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
1705 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
1706 name="em_copyto">/ are called without calling <tt/em_commit/ first.
1707 <tag/Limits/<itemize>
1708 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
1709 memory window are discarded, it does just mean that the drivers is allowed
1710 to discard it.
1711 <item>The function is only available as fastcall function, so it may only be
1712 used in presence of a prototype.
1713 <item>The function produces undefined results if no extended memory driver is
1714 loaded.
1715 </itemize>
1716 <tag/Availability/cc65
1717 <tag/See also/
1718 <ref id="em_load_driver" name="em_load_driver">,
1719 <ref id="em_map" name="em_map">,
1720 <ref id="em_use" name="em_use">
1721 <tag/Example/None.
1722 </descrip>
1723 </quote>
1724
1725
1726 <sect1>em_copyfrom<label id="em_copyfrom"><p>
1727
1728 <quote>
1729 <descrip>
1730 <tag/Function/Copy from extended into normal memory.
1731 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1732 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
1733 <tag/Description/Copy data from extended memory into linear memory. Source and
1734 target addresses as well as the number of bytes to transfer are specified in
1735 the <tt/em_copy/ structure that is passed as a parameter.
1736 <tag/Limits/<itemize>
1737 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
1738 made any changes to the data in the window, call <tt/<ref id="em_commit"
1739 name="em_commit">/ first, or the changes are lost.
1740 <item>The function is only available as fastcall function, so it may only be
1741 used in presence of a prototype.
1742 <item>The function produces undefined results if no extended memory driver is
1743 loaded.
1744 </itemize>
1745 <tag/Availability/cc65
1746 <tag/See also/
1747 <ref id="em_commit" name="em_commit">,
1748 <ref id="em_copyto" name="em_copyto">,
1749 <ref id="em_load_driver" name="em_load_driver">
1750 <tag/Example/None.
1751 </descrip>
1752 </quote>
1753
1754
1755 <sect1>em_copyto<label id="em_copyto"><p>
1756
1757 <quote>
1758 <descrip>
1759 <tag/Function/Copy from normal into extended memory.
1760 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1761 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
1762 <tag/Description/Copy data from linear into extended memory. Source and
1763 target addresses as well as the number of bytes to transfer are specified in
1764 the <tt/em_copy/ structure that is passed as a parameter.
1765 <tag/Limits/<itemize>
1766 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
1767 made any changes to the data in the window, call <tt/<ref id="em_commit"
1768 name="em_commit">/ first, or the changes are lost.
1769 <item>The function is only available as fastcall function, so it may only be
1770 used in presence of a prototype.
1771 <item>The function produces undefined results if no extended memory driver is
1772 loaded.
1773 </itemize>
1774 <tag/Availability/cc65
1775 <tag/See also/
1776 <ref id="em_commit" name="em_commit">,
1777 <ref id="em_copyfrom" name="em_copyfrom">,
1778 <ref id="em_load_driver" name="em_load_driver">
1779 <tag/Example/None.
1780 </descrip>
1781 </quote>
1782
1783
1784 <sect1>em_install<label id="em_install"><p>
1785
1786 <quote>
1787 <descrip>
1788 <tag/Function/Install an already loaded extended memory driver.
1789 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1790 <tag/Declaration/<tt/unsigned char _fastcall__ em_install (void* driver);/
1791 <tag/Description/The function installs an already loaded extended memory driver
1792 and returns an error code. The function may be used to install a driver linked
1793 statically to the program.
1794 <tag/Limits/<itemize>
1795 <item>Not all drivers are able to detect if the supported hardware is really
1796 present.
1797 <item>The function is only available as fastcall function, so it may only be
1798 used in presence of a prototype.
1799 </itemize>
1800 <tag/Availability/cc65
1801 <tag/See also/
1802 <ref id="em_load_driver" name="em_load_driver">,
1803 <ref id="em_uninstall" name="em_uninstall">,
1804 <ref id="em_unload" name="em_unload">
1805 <tag/Example/None.
1806 </descrip>
1807 </quote>
1808
1809
1810 <sect1>em_load_driver<label id="em_load_driver"><p>
1811
1812 <quote>
1813 <descrip>
1814 <tag/Function/Load and initialize an extended memory driver.
1815 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1816 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
1817 <tag/Description/Load an extended memory driver into memory and initialize
1818 it. The function returns an error code that tells if all this has been
1819 successful.
1820 <tag/Limits/<itemize>
1821 <item>Not all drivers are able to detect if the supported hardware is really
1822 present.
1823 <item>The function is only available as fastcall function, so it may only be
1824 used in presence of a prototype.
1825 <item>The driver is loaded by name, so currently you must know the type of
1826 extended memory that should be supported. There is no autodetect capability.
1827 </itemize>
1828 <tag/Availability/cc65
1829 <tag/See also/
1830 <ref id="em_unload" name="em_unload">
1831 <tag/Example/None.
1832 </descrip>
1833 </quote>
1834
1835
1836 <sect1>em_map<label id="em_map"><p>
1837
1838 <quote>
1839 <descrip>
1840 <tag/Function/Make a page of extended memory accessible.
1841 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1842 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
1843 <tag/Description/The function maps one page of extended memory into linear
1844 memory and returns a pointer to the page frame. Depending on the hardware
1845 and driver, the data is either mapped into the address space or transfered
1846 into a buffer. If you don't need the actual contents of the page (for example
1847 because you're going to overwrite it completely, it is better to call
1848 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
1849 data if it is possible to avoid that.
1850 <tag/Limits/<itemize>
1851 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
1852 made any changes to the data in the window, call <tt/<ref id="em_commit"
1853 name="em_commit">/ first, or the changes are lost.
1854 <item>The function is only available as fastcall function, so it may only be
1855 used in presence of a prototype.
1856 <item>The function produces undefined results if no extended memory driver is
1857 loaded.
1858 </itemize>
1859 <tag/Availability/cc65
1860 <tag/See also/
1861 <ref id="em_commit" name="em_commit">,
1862 <ref id="em_load_driver" name="em_load_driver">,
1863 <ref id="em_use" name="em_use">
1864 <tag/Example/None.
1865 </descrip>
1866 </quote>
1867
1868
1869 <sect1>em_pagecount<label id="em_pagecount"><p>
1870
1871 <quote>
1872 <descrip>
1873 <tag/Function/Return the number of available extended memory pages.
1874 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1875 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
1876 <tag/Description/The function returns the size of the extended memory supported
1877 by the driver in 256 byte pages.
1878 <tag/Limits/<itemize>
1879 <item>The function returns zero if no extended memory driver is loaded.
1880 <item>The function may return zero if the supported hardware was not detected.
1881 </itemize>
1882 <tag/Availability/cc65
1883 <tag/See also/
1884 <ref id="em_load_driver" name="em_load_driver">
1885 <tag/Example/None.
1886 </descrip>
1887 </quote>
1888
1889
1890 <sect1>em_uninstall<label id="em_uninstall"><p>
1891
1892 <quote>
1893 <descrip>
1894 <tag/Function/Uninstall an already loaded extended memory driver.
1895 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1896 <tag/Declaration/<tt/unsigned char __fastcall__ em_install (void);/
1897 <tag/Description/The function uninstalls an already loaded extended memory
1898 driver but doesn't remove it from memory.
1899 <tag/Limits/<itemize>
1900 <item>If the driver has been loaded using <tt/<ref id="em_load_driver"
1901 name="em_load_driver">/, <tt/<ref id="em_unload" name="em_unload">/
1902 should be used instead of <tt/em_uninstall/ so the driver is also removed
1903 from memory.
1904 <item>The function is only available as fastcall function, so it may only be
1905 used in presence of a prototype.
1906 </itemize>
1907 <tag/Availability/cc65
1908 <tag/See also/
1909 <ref id="em_install" name="em_install">,
1910 <ref id="em_load_driver" name="em_load_driver">,
1911 <ref id="em_unload" name="em_unload">
1912 <tag/Example/None.
1913 </descrip>
1914 </quote>
1915
1916
1917 <sect1>em_unload<label id="em_unload"><p>
1918
1919 <quote>
1920 <descrip>
1921 <tag/Function/Unload an extended memory driver.
1922 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1923 <tag/Declaration/<tt/unsigned char __fastcall__ em_unload (void);/
1924 <tag/Description/The function unloads a loaded extended memory driver and
1925 frees all memory allocated for the driver.
1926 <tag/Limits/<itemize>
1927 <item>The function does nothing if no driver is loaded.
1928 </itemize>
1929 <tag/Availability/cc65
1930 <tag/See also/
1931 <ref id="em_load_driver" name="em_load_driver">
1932 <tag/Example/None.
1933 </descrip>
1934 </quote>
1935
1936
1937 <sect1>em_use<label id="em_use"><p>
1938
1939 <quote>
1940 <descrip>
1941 <tag/Function/Prepare an extended memory page for use.
1942 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1943 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
1944 <tag/Description/The function maps one page of extended memory into linear
1945 memory and returns a pointer to the page frame. This function is similar to
1946 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
1947 actual memory window in the assumption that the existing data is wrong or
1948 will get overwritten.
1949 <tag/Limits/<itemize>
1950 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
1951 made any changes to the data in the window, call <tt/<ref id="em_commit"
1952 name="em_commit">/ first, or the changes are lost.
1953 <item>The function is only available as fastcall function, so it may only be
1954 used in presence of a prototype.
1955 <item>The function produces undefined results if no extended memory driver is
1956 loaded.
1957 </itemize>
1958 <tag/Availability/cc65
1959 <tag/See also/
1960 <ref id="em_commit" name="em_commit">,
1961 <ref id="em_load_driver" name="em_load_driver">,
1962 <ref id="em_map" name="em_map">
1963 <tag/Example/None.
1964 </descrip>
1965 </quote>
1966
1967
1968 <sect1>exit<label id="exit"><p>
1969
1970 <quote>
1971 <descrip>
1972 <tag/Function/Terminate the program.
1973 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1974 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
1975 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
1976 return code of the program. Before termination, all files are closed, buffered
1977 output is written and any functions registered with <tt/<ref id="atexit"
1978 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
1979 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
1980 name="stdlib.h">/.
1981 <tag/Limits/<itemize>
1982 <item>The function is only available as fastcall function, so it may only
1983 be used in presence of a prototype.
1984 <item>It depends on the host machine if the program return code can be
1985 evaluated or is ignored.
1986 </itemize>
1987 <tag/Availability/ISO 9899
1988 <tag/See also/
1989 <ref id="abort" name="abort">,
1990 <ref id="exit" name="exit">
1991 <tag/Example/None.
1992 </descrip>
1993 </quote>
1994
1995
1996 <sect1>fast<label id="fast"><p>
1997
1998 <quote>
1999 <descrip>
2000 <tag/Function/Switch the C128 into 2MHz mode.
2001 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
2002 <tag/Declaration/<tt/void fast (void);/
2003 <tag/Description/The function will switch the clock of the C128 to 2MHz. This
2004 will nearly double the speed compared to slow mode.
2005 <tag/Limits/<itemize>
2006 <item>The function is specific to the C128.
2007 <item>2MHz clock will not work in 40 column mode.
2008 </itemize>
2009 <tag/Availability/C128
2010 <tag/See also/
2011 <ref id="slow" name="slow">,
2012 <ref id="toggle_videomode" name="toggle_videomode">,
2013 <ref id="videomode" name="videomode">
2014 <tag/Example/None.
2015 </descrip>
2016 </quote>
2017
2018
2019 <sect1>feof<label id="feof"><p>
2020
2021 <quote>
2022 <descrip>
2023 <tag/Function/Return the end-of-file indicator of a stream.
2024 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
2025 <tag/Declaration/<tt/int __fastcall__ feof (FILE* f);/
2026 <tag/Description/<tt/feof/ tests the end-of-file indicator ofthe stream
2027 <tt/f/, and returns a non zero value if it is set.
2028 <tag/Limits/<itemize>
2029 <item>The indicator is set only after a read past the end of a file is
2030 attempted.
2031 <item>The function is only available as fastcall function, so it may only be
2032 used in presence of a prototype.
2033 </itemize>
2034 <tag/Availability/ISO 9899
2035 <tag/See also/
2036 <ref id="feof" name="clearerr">,
2037 <ref id="ferror" name="ferror">
2038 <tag/Example/None.
2039 </descrip>
2040 </quote>
2041
2042
2043 <sect1>ferror<label id="ferror"><p>
2044
2045 <quote>
2046 <descrip>
2047 <tag/Function/Return the error indicator of a stream.
2048 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
2049 <tag/Declaration/<tt/int __fastcall__ ferror (FILE* f);/
2050 <tag/Description/<tt/ferror/ tests the error indicator of the stream
2051 <tt/f/, and returns a non zero value if it is set.
2052 <tag/Limits/<itemize>
2053 <item>The function is only available as fastcall function, so it may only be
2054 used in presence of a prototype.
2055 </itemize>
2056 <tag/Availability/ISO 9899
2057 <tag/See also/
2058 <ref id="feof" name="clearerr">,
2059 <ref id="ferror" name="feof">
2060 <tag/Example/None.
2061 </descrip>
2062 </quote>
2063
2064
2065 <sect1>fileno<label id="fileno"><p>
2066
2067 <quote>
2068 <descrip>
2069 <tag/Function/Return the file handle used by a stream.
2070 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
2071 <tag/Declaration/<tt/int __fastcall__ fileno (FILE* f);/
2072 <tag/Description/The <tt/fileno/ function returns the file handle used
2073 internally by a C stream. This file handle (an integer) can be used as a
2074 handle for the POSIX input/output functions.
2075 <tag/Limits/<itemize>
2076 <item>The function is only available as fastcall function, so it may only be
2077 used in presence of a prototype.
2078 <item>Mixing C file I/O functions and POSIX file I/O functions for the same
2079 file may have unpredictable results.
2080 </itemize>
2081 <tag/Availability/POSIX 1003.1
2082 <tag/See also/
2083 <ref id="creat" name="creat">,
2084 <ref id="open" name="open"> <!-- , -->
2085 <!-- <ref id="read" name="read">, -->
2086 <!-- <ref id="write" name="write"> -->
2087 <tag/Example/None.
2088 </descrip>
2089 </quote>
2090
2091
2092 <sect1>free<label id="free"><p>
2093
2094 <quote>
2095 <descrip>
2096 <tag/Function/Free a block of dynamic memory.
2097 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2098 <tag/Declaration/<tt/void __fastcall__ free (void* block);/
2099 <tag/Description/Free a block of dynamic memory previously allocated with
2100 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
2101 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
2102 pointer is <tt/NULL/, no action is performed.
2103 <tag/Limits/
2104 <itemize>
2105 <item>Passing an already free'd block to <tt/free/ again will cause undefined
2106 behaviour and may crash your program.
2107 <item>The function is only available as fastcall function, so it may only
2108 be used in presence of a prototype.
2109 </itemize>
2110 <tag/Availability/ISO 9899
2111 <tag/See also/
2112 <ref id="_heapadd" name="_heapadd">,
2113 <ref id="_heapblocksize" name="_heapblocksize">,
2114 <ref id="_heapmaxavail" name="_heapmaxavail">,
2115 <ref id="_heapmemavail" name="_heapmemavail">,
2116 <ref id="calloc" name="calloc">,
2117 <ref id="malloc" name="malloc">,
2118 <ref id="realloc" name="realloc">
2119 <tag/Example/None.
2120 </descrip>
2121 </quote>
2122
2123
2124 <sect1>get_ostype<label id="get_ostype"><p>
2125
2126 <quote>
2127 <descrip>
2128 <tag/Function/The function returns the operating system, the program runs on.
2129 <tag/Header/<tt/<ref id="apple2.h" name="apple2.h">,
2130 <ref id="atari.h" name="atari.h">, <ref id="c64.h" name="c64.h">/
2131 <tag/Declaration/<tt/unsigned char get_ostype (void);/
2132 <tag/Description/<tt/get_ostype/ is machine dependent and does not exist for
2133 all supported targets. If it exists, it returns a number that identifies the
2134 operating system or machine type, the program runs on. The machine dependent
2135 header files define constants that can be used to check the return code.
2136 <tag/Limits/<itemize>
2137 <item>The function does not exist on all platforms.
2138 <item>The return codes are platform dependent.
2139 </itemize>
2140 <tag/Availability/cc65 (not all platforms)
2141 <tag/Example/None.
2142 </descrip>
2143 </quote>
2144
2145
2146 <sect1>getenv<label id="getenv"><p>
2147
2148 <quote>
2149 <descrip>
2150 <tag/Function/Return a value from the environment.
2151 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2152 <tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
2153 <tag/Description/The function searches the environment for an entry that
2154 matches <tt/name/ and returns its value. The environment consists of a list
2155 of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
2156 returns <tt/NULL/.
2157 <tag/Limits/<itemize>
2158 <item>What exactly is stored in the environment depends on the machine the
2159 program is running on.
2160 <item>The function is only available as fastcall function, so it may only
2161 be used in presence of a prototype.
2162 </itemize>
2163 <tag/Availability/ISO 9899
2164 <tag/Example/None.
2165 </descrip>
2166 </quote>
2167
2168
2169 <sect1>getcpu<label id="getcpu"><p>
2170
2171 <quote>
2172 <descrip>
2173 <tag/Function/Determine on which CPU the program is running.
2174 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
2175 <tag/Declaration/<tt/unsigned char getcpu (void);/
2176 <tag/Description/The function checks on which CPU the code is running. It
2177 returns one of the constants<itemize>
2178 <item><tt/CPU_6502/
2179 <item><tt/CPU_65C02/
2180 <item><tt/CPU_65816/
2181 </itemize>
2182 <tag/Limits/<itemize>
2183 <item>Other, more exotic CPU types are not disinguished.
2184 </itemize>
2185 <tag/Availability/cc65
2186 <tag/Example/None.
2187 </descrip>
2188 </quote>
2189
2190
2191 <sect1>gotox<label id="gotox"><p>
2192
2193 <quote>
2194 <descrip>
2195 <tag/Function/Move the text mode cursor to a new X position.
2196 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2197 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
2198 <tag/Description/The function moves the text mode cursor to the specified X
2199 position while leaving the Y position untouched. The leftmost position on the
2200 screen has the coordinate 0.
2201 <tag/Limits/<itemize>
2202 <item>The function is only available as fastcall function, so it may
2203 only be used in presence of a prototype.
2204 <item>Invalid values for the X position (out of screen coordinates) may
2205 lead to undefined behaviour.
2206 </itemize>
2207 <tag/Availability/cc65
2208 <tag/See also/
2209 <ref id="gotoy" name="gotoy">,
2210 <ref id="gotoxy" name="gotoxy">,
2211 <ref id="wherex" name="wherex">,
2212 <ref id="wherey" name="wherey">
2213 <tag/Example/None.
2214 </descrip>
2215 </quote>
2216
2217
2218 <sect1>gotoxy<label id="gotoxy"><p>
2219
2220 <quote>
2221 <descrip>
2222 <tag/Function/Move the text mode cursor to a new position.
2223 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2224 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
2225 <tag/Description/The function moves the text mode cursor to the specified
2226 position. The leftmost position on the screen has the X coordinate 0, the
2227 topmost line has the Y coordinate 0.
2228 <tag/Limits/<itemize>
2229 <item>The function is only available as fastcall function, so it may only be
2230 used in presence of a prototype.
2231 <item>Invalid values for any of both coordinates (out of screen positions) may
2232 lead to undefined behaviour.
2233 </itemize>
2234 <tag/Availability/cc65
2235 <tag/See also/
2236 <ref id="gotox" name="gotox">,
2237 <ref id="gotoy" name="gotoy">,
2238 <ref id="wherex" name="wherex">,
2239 <ref id="wherey" name="wherey">
2240 <tag/Example/None.
2241 </descrip>
2242 </quote>
2243
2244
2245 <sect1>gotoy<label id="gotoy"><p>
2246
2247 <quote>
2248 <descrip>
2249 <tag/Function/Move the text mode cursor to a new Y position.
2250 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2251 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
2252 <tag/Description/The function moves the text mode cursor to the specified Y
2253 position while leaving the X position untouched. The uppermost position on the
2254 screen has the coordinate 0.
2255 <tag/Limits/<itemize>
2256 <item>The function is only available as fastcall function, so it may
2257 only be used in presence of a prototype.
2258 <item>Invalid values for the Y position (out of screen coordinates) may lead
2259 to undefined behaviour.
2260 </itemize>
2261 <tag/Availability/cc65
2262 <tag/See also/
2263 <ref id="gotox" name="gotox">,
2264 <ref id="gotoxy" name="gotoxy">,
2265 <ref id="wherex" name="wherex">,
2266 <ref id="wherey" name="wherey">
2267 <tag/Example/None.
2268 </descrip>
2269 </quote>
2270
2271
2272 <sect1>isalnum<label id="isalnum"><p>
2273
2274 <quote>
2275 <descrip>
2276 <tag/Function/Check if a given character is a letter or digit.
2277 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2278 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
2279 <tag/Description/The function returns a value of zero if the given argument
2280 is a letter or digit. The return value is non zero if the character
2281 is anything else.
2282 <tag/Limits/<itemize>
2283 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2284 inline sequence generated by the macro will not work correctly for values
2285 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2286 this range. The non inline function may be accessed by <tt/#undef/'ing
2287 the macro.
2288 <item>When compiling without <tt/-Os/, the function is only available as
2289 fastcall function, so it may only be used in presence of a prototype.
2290 </itemize>
2291 <tag/Availability/ISO 9899
2292 <tag/See also/
2293 <ref id="isalpha" name="isalpha">,
2294 <ref id="isascii" name="isascii">,
2295 <ref id="isblank" name="isblank">,
2296 <ref id="iscntrl" name="iscntrl">,
2297 <ref id="isdigit" name="isdigit">,
2298 <ref id="isgraph" name="isgraph">,
2299 <ref id="islower" name="islower">,
2300 <ref id="isprint" name="isprint">,
2301 <ref id="ispunct" name="ispunct">,
2302 <ref id="isspace" name="isspace">,
2303 <ref id="isupper" name="isupper">,
2304 <ref id="isxdigit" name="isxdigit">
2305 <tag/Example/None.
2306 </descrip>
2307 </quote>
2308
2309
2310 <sect1>isalpha<label id="isalpha"><p>
2311
2312 <quote>
2313 <descrip>
2314 <tag/Function/Check if a given character is a letter.
2315 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2316 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
2317 <tag/Description/The function returns a value of zero if the given argument
2318 is a letter. The return value is non zero if the character is anything else.
2319 <tag/Limits/<itemize>
2320 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2321 inline sequence generated by the macro will not work correctly for values
2322 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2323 this range. The non inline function may be accessed by <tt/#undef/'ing the
2324 macro.
2325 <item>When compiling without <tt/-Os/, the function is only available as
2326 fastcall function, so it may only be used in presence of a prototype.
2327 </itemize>
2328 <tag/Availability/ISO 9899
2329 <tag/See also/
2330 <ref id="isalnum" name="isalnum">,
2331 <ref id="isascii" name="isascii">,
2332 <ref id="isblank" name="isblank">,
2333 <ref id="iscntrl" name="iscntrl">,
2334 <ref id="isdigit" name="isdigit">,
2335 <ref id="isgraph" name="isgraph">,
2336 <ref id="islower" name="islower">,
2337 <ref id="isprint" name="isprint">,
2338 <ref id="ispunct" name="ispunct">,
2339 <ref id="isspace" name="isspace">,
2340 <ref id="isupper" name="isupper">,
2341 <ref id="isxdigit" name="isxdigit">
2342 <tag/Example/None.
2343 </descrip>
2344 </quote>
2345
2346
2347 <sect1>isascii<label id="isascii"><p>
2348
2349 <quote>
2350 <descrip>
2351 <tag/Function/Check if a given character is in the ASCII (0..127) range.
2352 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2353 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
2354 <tag/Description/The function returns a value of zero if the given argument
2355 is in the range 0..127 (the range of valid ASCII characters) and a non zero
2356 value if not.
2357 <tag/Limits/<itemize>
2358 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2359 inline sequence generated by the macro will not work correctly for values
2360 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2361 this range. The non inline function may be accessed by <tt/#undef/'ing the
2362 macro.
2363 <item>When compiling without <tt/-Os/, the function is only available as
2364 fastcall function, so it may only be used in presence of a prototype.
2365 </itemize>
2366 <tag/Availability/ISO 9899
2367 <tag/See also/
2368 <ref id="isalnum" name="isalnum">,
2369 <ref id="isalpha" name="isalpha">,
2370 <ref id="isblank" name="isblank">,
2371 <ref id="iscntrl" name="iscntrl">,
2372 <ref id="isdigit" name="isdigit">,
2373 <ref id="isgraph" name="isgraph">,
2374 <ref id="islower" name="islower">,
2375 <ref id="isprint" name="isprint">,
2376 <ref id="ispunct" name="ispunct">,
2377 <ref id="isspace" name="isspace">,
2378 <ref id="isupper" name="isupper">,
2379 <ref id="isxdigit" name="isxdigit">
2380 <tag/Example/None.
2381 </descrip>
2382 </quote>
2383
2384
2385 <sect1>isblank<label id="isblank"><p>
2386
2387 <quote>
2388 <descrip>
2389 <tag/Function/Check if a given character is a space or tab.
2390 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2391 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
2392 <tag/Description/The function returns a value of zero if the given argument
2393 is a space or tab character. The return value is non zero if the character
2394 is anything else.
2395 <tag/Limits/<itemize>
2396 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2397 inline sequence generated by the macro will not work correctly for values
2398 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2399 this range. The non inline function may be accessed by <tt/#undef/'ing the
2400 macro.
2401 <item>When compiling without <tt/-Os/, the function is only available as
2402 fastcall function, so it may only be used in presence of a prototype.
2403 </itemize>
2404 <tag/Availability/cc65
2405 <tag/See also/
2406 <ref id="isalnum" name="isalnum">,
2407 <ref id="isalpha" name="isalpha">,
2408 <ref id="isascii" name="isascii">,
2409 <ref id="iscntrl" name="iscntrl">,
2410 <ref id="isdigit" name="isdigit">,
2411 <ref id="isgraph" name="isgraph">,
2412 <ref id="islower" name="islower">,
2413 <ref id="isprint" name="isprint">,
2414 <ref id="ispunct" name="ispunct">,
2415 <ref id="isspace" name="isspace">,
2416 <ref id="isupper" name="isupper">,
2417 <ref id="isxdigit" name="isxdigit">
2418 <tag/Example/None.
2419 </descrip>
2420 </quote>
2421
2422
2423 <sect1>iscntrl<label id="iscntrl"><p>
2424
2425 <quote>
2426 <descrip>
2427 <tag/Function/Check if a given character is a control character.
2428 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2429 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
2430 <tag/Description/The function returns a value of zero if the given argument
2431 is a control character. The return value is non zero if the character
2432 is anything else.
2433 <tag/Limits/<itemize>
2434 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2435 inline sequence generated by the macro will not work correctly for values
2436 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2437 this range. The non inline function may be accessed by <tt/#undef/'ing the
2438 macro.
2439 <item>When compiling without <tt/-Os/, the function is only available as
2440 fastcall function, so it may only be used in presence of a prototype.
2441 </itemize>
2442 <tag/Availability/ISO 9899
2443 <tag/See also/
2444 <ref id="isalnum" name="isalnum">,
2445 <ref id="isalpha" name="isalpha">,
2446 <ref id="isascii" name="isascii">,
2447 <ref id="isblank" name="isblank">,
2448 <ref id="isdigit" name="isdigit">,
2449 <ref id="isgraph" name="isgraph">,
2450 <ref id="islower" name="islower">,
2451 <ref id="isprint" name="isprint">,
2452 <ref id="ispunct" name="ispunct">,
2453 <ref id="isspace" name="isspace">,
2454 <ref id="isupper" name="isupper">,
2455 <ref id="isxdigit" name="isxdigit">
2456 <tag/Example/None.
2457 </descrip>
2458 </quote>
2459
2460
2461 <sect1>isdigit<label id="isdigit"><p>
2462
2463 <quote>
2464 <descrip>
2465 <tag/Function/Check if a given character is a digit.
2466 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2467 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
2468 <tag/Description/The function returns a value of zero if the given argument
2469 is a digit. The return value is non zero if the character is anything else.
2470 <tag/Limits/<itemize>
2471 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2472 inline sequence generated by the macro will not work correctly for values
2473 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2474 this range. The non inline function may be accessed by <tt/#undef/'ing the
2475 macro.
2476 <item>When compiling without <tt/-Os/, the function is only available as
2477 fastcall function, so it may only be used in presence of a prototype.
2478 </itemize>
2479 <tag/Availability/ISO 9899
2480 <tag/See also/
2481 <ref id="isalnum" name="isalnum">,
2482 <ref id="isalpha" name="isalpha">,
2483 <ref id="isascii" name="isascii">,
2484 <ref id="isblank" name="isblank">,
2485 <ref id="iscntrl" name="iscntrl">,
2486 <ref id="isgraph" name="isgraph">,
2487 <ref id="islower" name="islower">,
2488 <ref id="isprint" name="isprint">,
2489 <ref id="ispunct" name="ispunct">,
2490 <ref id="isspace" name="isspace">,
2491 <ref id="isupper" name="isupper">,
2492 <ref id="isxdigit" name="isxdigit">
2493 <tag/Example/None.
2494 </descrip>
2495 </quote>
2496
2497
2498 <sect1>isgraph<label id="isgraph"><p>
2499
2500 <quote>
2501 <descrip>
2502 <tag/Function/Check if a given character is a printable character (except
2503 space).
2504 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2505 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
2506 <tag/Description/The function returns a value of zero if the given argument
2507 is a printable character with the exception of space. The return value is non
2508 zero if the character is anything else.
2509 <tag/Limits/<itemize>
2510 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2511 inline sequence generated by the macro will not work correctly for values
2512 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2513 this range. The non inline function may be accessed by <tt/#undef/'ing the
2514 macro.
2515 <item>When compiling without <tt/-Os/, the function is only available as
2516 fastcall function, so it may only be used in presence of a prototype.
2517 </itemize>
2518 <tag/Availability/ISO 9899
2519 <tag/See also/
2520 <ref id="isalnum" name="isalnum">,
2521 <ref id="isalpha" name="isalpha">,
2522 <ref id="isascii" name="isascii">,
2523 <ref id="isblank" name="isblank">,
2524 <ref id="iscntrl" name="iscntrl">,
2525 <ref id="isdigit" name="isdigit">,
2526 <ref id="islower" name="islower">,
2527 <ref id="isprint" name="isprint">,
2528 <ref id="ispunct" name="ispunct">,
2529 <ref id="isspace" name="isspace">,
2530 <ref id="isupper" name="isupper">,
2531 <ref id="isxdigit" name="isxdigit">
2532 <tag/Example/None.
2533 </descrip>
2534 </quote>
2535
2536
2537 <sect1>islower<label id="islower"><p>
2538
2539 <quote>
2540 <descrip>
2541 <tag/Function/Check if a given character is a lower case letter.
2542 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2543 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
2544 <tag/Description/The function returns a value of zero if the given argument
2545 is a lower case letter. The return value is non zero if the character is
2546 anything else.
2547 <tag/Limits/<itemize>
2548 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2549 inline sequence generated by the macro will not work correctly for values
2550 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2551 this range. The non inline function may be accessed by <tt/#undef/'ing the
2552 macro.
2553 <item>When compiling without <tt/-Os/, the function is only available as
2554 fastcall function, so it may only be used in presence of a prototype.
2555 </itemize>
2556 <tag/Availability/ISO 9899
2557 <tag/See also/
2558 <ref id="isalnum" name="isalnum">,
2559 <ref id="isalpha" name="isalpha">,
2560 <ref id="isascii" name="isascii">,
2561 <ref id="isblank" name="isblank">,
2562 <ref id="iscntrl" name="iscntrl">,
2563 <ref id="isdigit" name="isdigit">,
2564 <ref id="isgraph" name="isgraph">,
2565 <ref id="isprint" name="isprint">,
2566 <ref id="ispunct" name="ispunct">,
2567 <ref id="isspace" name="isspace">,
2568 <ref id="isupper" name="isupper">,
2569 <ref id="isxdigit" name="isxdigit">
2570 <tag/Example/None.
2571 </descrip>
2572 </quote>
2573
2574
2575 <sect1>isprint<label id="isprint"><p>
2576
2577 <quote>
2578 <descrip>
2579 <tag/Function/Check if a given character is a printable character.
2580 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2581 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
2582 <tag/Description/The function returns a value of zero if the given argument
2583 is a printable character (this includes the space character). The return value
2584 is non zero if the character is anything else.
2585 <tag/Limits/<itemize>
2586 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2587 inline sequence generated by the macro will not work correctly for values
2588 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2589 this range. The non inline function may be accessed by <tt/#undef/'ing the
2590 macro.
2591 <item>When compiling without <tt/-Os/, the function is only available as
2592 fastcall function, so it may only be used in presence of a prototype.
2593 </itemize>
2594 <tag/Availability/ISO 9899
2595 <tag/See also/
2596 <ref id="isalnum" name="isalnum">,
2597 <ref id="isalpha" name="isalpha">,
2598 <ref id="isascii" name="isascii">,
2599 <ref id="isblank" name="isblank">,
2600 <ref id="iscntrl" name="iscntrl">,
2601 <ref id="isdigit" name="isdigit">,
2602 <ref id="isgraph" name="isgraph">,
2603 <ref id="islower" name="islower">,
2604 <ref id="ispunct" name="ispunct">,
2605 <ref id="isspace" name="isspace">,
2606 <ref id="isupper" name="isupper">,
2607 <ref id="isxdigit" name="isxdigit">
2608 <tag/Example/None.
2609 </descrip>
2610 </quote>
2611
2612
2613 <sect1>ispunct<label id="ispunct"><p>
2614
2615 <quote>
2616 <descrip>
2617 <tag/Function/Check if a given character is a printable character but not a
2618 space or an alphanumeric character.
2619 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2620 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
2621 <tag/Description/The function returns a value of zero if the given argument
2622 is a printable character, but not a space or anything alphanumeric. The return
2623 value is non zero if the character is anything else.
2624 <tag/Limits/<itemize>
2625 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2626 inline sequence generated by the macro will not work correctly for values
2627 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2628 this range. The non inline function may be accessed by <tt/#undef/'ing the
2629 macro.
2630 <item>When compiling without <tt/-Os/, the function is only available as
2631 fastcall function, so it may only be used in presence of a prototype.
2632 </itemize>
2633 <tag/Availability/ISO 9899
2634 <tag/See also/
2635 <ref id="isalnum" name="isalnum">,
2636 <ref id="isalpha" name="isalpha">,
2637 <ref id="isascii" name="isascii">,
2638 <ref id="isblank" name="isblank">,
2639 <ref id="iscntrl" name="iscntrl">,
2640 <ref id="isdigit" name="isdigit">,
2641 <ref id="isgraph" name="isgraph">,
2642 <ref id="islower" name="islower">,
2643 <ref id="isprint" name="isprint">,
2644 <ref id="isspace" name="isspace">,
2645 <ref id="isupper" name="isupper">,
2646 <ref id="isxdigit" name="isxdigit">
2647 <tag/Example/None.
2648 </descrip>
2649 </quote>
2650
2651
2652 <sect1>isspace<label id="isspace"><p>
2653
2654 <quote>
2655 <descrip>
2656 <tag/Function/Check if a given character is a a white-space character.
2657 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2658 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
2659 <tag/Description/The function returns a value of zero if the given argument
2660 is a white space character. The return value is non zero if the character is
2661 anything else. The standard white space characters are: space, formfeed ('\f'),
2662 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
2663 ('\v').
2664 <tag/Limits/<itemize>
2665 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2666 inline sequence generated by the macro will not work correctly for values
2667 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2668 this range. The non inline function may be accessed by <tt/#undef/'ing the
2669 macro.
2670 <item>When compiling without <tt/-Os/, the function is only available as
2671 fastcall function, so it may only be used in presence of a prototype.
2672 </itemize>
2673 <tag/Availability/ISO 9899
2674 <tag/See also/
2675 <ref id="isalnum" name="isalnum">,
2676 <ref id="isalpha" name="isalpha">,
2677 <ref id="isascii" name="isascii">,
2678 <ref id="isblank" name="isblank">,
2679 <ref id="iscntrl" name="iscntrl">,
2680 <ref id="isdigit" name="isdigit">,
2681 <ref id="isgraph" name="isgraph">,
2682 <ref id="islower" name="islower">,
2683 <ref id="isprint" name="isprint">,
2684 <ref id="ispunct" name="ispunct">,
2685 <ref id="isupper" name="isupper">,
2686 <ref id="isxdigit" name="isxdigit">
2687 <tag/Example/None.
2688 </descrip>
2689 </quote>
2690
2691
2692 <sect1>isupper<label id="isupper"><p>
2693
2694 <quote>
2695 <descrip>
2696 <tag/Function/Check if a given character is an upper case letter.
2697 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2698 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
2699 <tag/Description/The function returns a value of zero if the given argument
2700 is an upper case letter. The return value is non zero if the character is
2701 anything else.
2702 <tag/Limits/<itemize>
2703 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2704 inline sequence generated by the macro will not work correctly for values
2705 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2706 this range. The non inline function may be accessed by <tt/#undef/'ing the
2707 macro.
2708 <item>When compiling without <tt/-Os/, the function is only available as
2709 fastcall function, so it may only be used in presence of a prototype.
2710 </itemize>
2711 <tag/Availability/ISO 9899
2712 <tag/See also/
2713 <ref id="isalnum" name="isalnum">,
2714 <ref id="isalpha" name="isalpha">,
2715 <ref id="isascii" name="isascii">,
2716 <ref id="isblank" name="isblank">,
2717 <ref id="iscntrl" name="iscntrl">,
2718 <ref id="isdigit" name="isdigit">,
2719 <ref id="isgraph" name="isgraph">,
2720 <ref id="islower" name="islower">,
2721 <ref id="isprint" name="isprint">,
2722 <ref id="ispunct" name="ispunct">,
2723 <ref id="isspace" name="isspace">,
2724 <ref id="isxdigit" name="isxdigit">
2725 <tag/Example/None.
2726 </descrip>
2727 </quote>
2728
2729
2730 <sect1>isxdigit<label id="isxdigit"><p>
2731
2732 <quote>
2733 <descrip>
2734 <tag/Function/Check if a given character is a hexadecimal digit.
2735 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2736 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
2737 <tag/Description/The function returns a value of zero if the given argument
2738 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
2739 if the character is anything else.
2740 <tag/Limits/<itemize>
2741 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2742 inline sequence generated by the macro will not work correctly for values
2743 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2744 this range. The non inline function may be accessed by <tt/#undef/'ing the
2745 macro.
2746 <item>When compiling without <tt/-Os/, the function is only available as
2747 fastcall function, so it may only be used in presence of a prototype.
2748 </itemize>
2749 <tag/Availability/ISO 9899
2750 <tag/See also/
2751 <ref id="isalnum" name="isalnum">,
2752 <ref id="isalpha" name="isalpha">,
2753 <ref id="isascii" name="isascii">,
2754 <ref id="isblank" name="isblank">,
2755 <ref id="iscntrl" name="iscntrl">,
2756 <ref id="isdigit" name="isdigit">,
2757 <ref id="isgraph" name="isgraph">,
2758 <ref id="islower" name="islower">,
2759 <ref id="isprint" name="isprint">,
2760 <ref id="ispunct" name="ispunct">,
2761 <ref id="isspace" name="isspace">,
2762 <ref id="isupper" name="isupper">
2763 <tag/Example/None.
2764 </descrip>
2765 </quote>
2766
2767
2768 <sect1>itoa<label id="itoa"><p>
2769
2770 <quote>
2771 <descrip>
2772 <tag/Function/Convert an integer into a string.
2773 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2774 <tag/Declaration/<tt/char* __fastcall__ itoa (int val, char* buf, int radix);/
2775 <tag/Description/<tt/itoa/ converts the integer <tt/val/ into a string using
2776 <tt/radix/ as the base.
2777 <tag/Limits/<itemize>
2778 <item>There are no provisions to prevent a buffer overflow.
2779 <item>If <tt/val/ contains <tt/INT_MIN/, the behaviour is undefined.
2780 <item>The function is non standard, so it is not available in strict ANSI mode.
2781 You should probably use <tt/sprintf/ instead.
2782 <item>The function is only available as fastcall function, so it may only be
2783 used in presence of a prototype.
2784 </itemize>
2785 <tag/Availability/cc65
2786 <tag/See also/
2787 <ref id="atoi" name="atoi">,
2788 <ref id="atol" name="atol">,
2789 <ref id="ltoa" name="ltoa">,
2790 <ref id="ultoa" name="ultoa">,
2791 <ref id="utoa" name="utoa">
2792 <tag/Example/None.
2793 </descrip>
2794 </quote>
2795
2796
2797 <sect1>joy_count<label id="joy_count"><p>
2798
2799 <quote>
2800 <descrip>
2801 <tag/Function/Return the number of joysticks supported by the current driver.
2802 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2803 <tag/Declaration/<tt/unsigned char __fastcall__ joy_count (void);/
2804 <tag/Description/The function returns a the number of joysticks supported
2805 by the current joystick driver.
2806 <tag/Limits/<itemize>
2807 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
2808 name="joy_load_driver"> before calling this function.
2809 <item>The function returns the number of joysticks supported by the driver.
2810 There's no way to check for the number of actually connected joysticks.
2811 <item>The function is only available as fastcall function, so it may only be
2812 used in presence of a prototype.
2813 </itemize>
2814 <tag/Availability/cc65
2815 <tag/See also/
2816 <ref id="joy_load_driver" name="joy_load_driver">,
2817 <ref id="joy_read" name="joy_read">
2818 <tag/Example/None.
2819 </descrip>
2820 </quote>
2821
2822
2823 <sect1>joy_install<label id="joy_install"><p>
2824
2825 <quote>
2826 <descrip>
2827 <tag/Function/Install an already loaded driver and return an error code.
2828 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2829 <tag/Declaration/<tt/unsigned char __fastcall__ joy_install (void* driver);/
2830 <tag/Description/The function installs a driver that was already loaded into
2831 memory (or linked statically to the program). It returns an error code
2832 (<tt/JOY_ERR_OK/ in case of success).
2833 <tag/Limits/<itemize>
2834 <item>The function is only available as fastcall function, so it may only be
2835 used in presence of a prototype.
2836 </itemize>
2837 <tag/Availability/cc65
2838 <tag/See also/
2839 <ref id="joy_load_driver" name="joy_load_driver">,
2840 <ref id="joy_uninstall" name="joy_uninstall">,
2841 <ref id="joy_unload" name="joy_unload">
2842 <tag/Example/None.
2843 </descrip>
2844 </quote>
2845
2846
2847 <sect1>joy_load_driver<label id="joy_load_driver"><p>
2848
2849 <quote>
2850 <descrip>
2851 <tag/Function/Load a driver from disk and install it.
2852 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2853 <tag/Declaration/<tt/unsigned char __fastcall__ joy_load_driver (const char* driver);/
2854 <tag/Description/The function loads a driver with the given name from disk
2855 and installs it. An error code is returned, which is <tt/JOY_ERR_OK/ if the
2856 driver was successfully loaded and installed.
2857 <tag/Limits/<itemize>
2858 <item>The function is only available as fastcall function, so it may only be
2859 used in presence of a prototype.
2860 </itemize>
2861 <tag/Availability/cc65
2862 <tag/See also/
2863 <ref id="joy_install" name="joy_install">,
2864 <ref id="joy_uninstall" name="joy_uninstall">,
2865 <ref id="joy_unload" name="joy_unload">
2866 <tag/Example/None.
2867 </descrip>
2868 </quote>
2869
2870
2871 <sect1>joy_read<label id="joy_read"><p>
2872
2873 <quote>
2874 <descrip>
2875 <tag/Function/Read the status of a joystick.
2876 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2877 <tag/Declaration/<tt/unsigned char __fastcall__ joy_read (unsigned char joystick);/
2878 <tag/Description/The function reads the status bits for a joystick. The number
2879 of the joystick is passed as parameter. The result may be examined by using one
2880 of the <tt/JOY_xxx/ macros from <ref id="joystick.h" name="joystick.h">.
2881 <tag/Limits/<itemize>
2882 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
2883 name="joy_load_driver"> before calling this function.
2884 <item>The function is only available as fastcall function, so it may only be
2885 used in presence of a prototype.
2886 </itemize>
2887 <tag/Availability/cc65
2888 <tag/See also/
2889 <ref id="joy_count" name="joy_count">,
2890 <ref id="joy_load_driver" name="joy_load_driver">,
2891 <ref id="joy_unload" name="joy_unload">
2892 <tag/Example/None.
2893 </descrip>
2894 </quote>
2895
2896
2897 <sect1>joy_uninstall<label id="joy_uninstall"><p>
2898
2899 <quote>
2900 <descrip>
2901 <tag/Function/Uninstall the current joystick driver.
2902 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2903 <tag/Declaration/<tt/unsigned char __fastcall__ joy_uninstall (void);/
2904 <tag/Description/The function uninstalls the currently installed joystick
2905 driver. It does not remove the driver from memory. The function returns an
2906 error code, which is <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
2907 <tag/Limits/<itemize>
2908 <item>A joystick driver must be installed using <ref id="joy_install"
2909 name="joy_install"> before calling this function.
2910 <item>The function is only available as fastcall function, so it may only be
2911 used in presence of a prototype.
2912 </itemize>
2913 <tag/Availability/cc65
2914 <tag/See also/
2915 <ref id="joy_install" name="joy_install">,
2916 <ref id="joy_load_driver" name="joy_load_driver">,
2917 <ref id="joy_unload" name="joy_unload">
2918 <tag/Example/None.
2919 </descrip>
2920 </quote>
2921
2922
2923 <sect1>joy_unload<label id="joy_unload"><p>
2924
2925 <quote>
2926 <descrip>
2927 <tag/Function/Uninstall, then unload the current joystick driver.
2928 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2929 <tag/Declaration/<tt/unsigned char __fastcall__ joy_unload (void);/
2930 <tag/Description/The function uninstalls the currently installed joystick
2931 driver and removes it from memory. An error code is returned, which is
2932 <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
2933 <tag/Limits/<itemize>
2934 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
2935 name="joy_load_driver"> before calling this function.
2936 <item>The function is only available as fastcall function, so it may only be
2937 used in presence of a prototype.
2938 </itemize>
2939 <tag/Availability/cc65
2940 <tag/See also/
2941 <ref id="joy_load_driver" name="joy_load_driver">
2942 <tag/Example/None.
2943 </descrip>
2944 </quote>
2945
2946
2947 <sect1>kbhit<label id="kbhit"><p>
2948
2949 <quote>
2950 <descrip>
2951 <tag/Function/Check if there's a key waiting in the keyboard buffer.
2952 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2953 <tag/Declaration/<tt/unsigned char kbhit (void);/
2954 <tag/Description/The function returns a value of zero if there is no character
2955 waiting to be read from the keyboard. It returns non zero otherwise.
2956 <tag/Limits/<itemize>
2957 <item>If the system does not support a keyboard buffer (most systems
2958 do), the function is rather useless.
2959 </itemize>
2960 <tag/Availability/cc65
2961 <tag/See also/
2962 <ref id="cgetc" name="cgetc">,
2963 <ref id="cursor" name="cursor">
2964 <tag/Example/None.
2965 </descrip>
2966 </quote>
2967
2968
2969 <sect1>labs<label id="labs"><p>
2970
2971 <quote>
2972 <descrip>
2973 <tag/Function/Returns the absolute value of a long integer.
2974 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2975 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
2976 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
2977 the function.
2978 <tag/Limits/<itemize>
2979 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
2980 <item>The function is only available as fastcall function, so it may only be
2981 used in presence of a prototype.
2982 </itemize>
2983 <tag/Availability/ISO 9899
2984 <tag/See also/
2985 <ref id="abs" name="abs">
2986 <tag/Example/None.
2987 </descrip>
2988 </quote>
2989
2990
2991 <sect1>ltoa<label id="ltoa"><p>
2992
2993 <quote>
2994 <descrip>
2995 <tag/Function/Convert a long integer into a string.
2996 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2997 <tag/Declaration/<tt/char* __fastcall__ ltoa (long val, char* buf, int radix);/
2998 <tag/Description/<tt/itoa/ converts the long integer <tt/val/ into a string
2999 using <tt/radix/ as the base.
3000 <tag/Limits/<itemize>
3001 <item>There are no provisions to prevent a buffer overflow.
3002 <item>If <tt/val/ contains <tt/LONG_MIN/, the behaviour is undefined.
3003 <item>The function is non standard, so it is not available in strict ANSI mode.
3004 You should probably use <tt/sprintf/ instead.
3005 <item>The function is only available as fastcall function, so it may only be
3006 used in presence of a prototype.
3007 </itemize>
3008 <tag/Availability/cc65
3009 <tag/See also/
3010 <ref id="atoi" name="atoi">,
3011 <ref id="atol" name="atol">,
3012 <ref id="itoa" name="itoa">,
3013 <ref id="ultoa" name="ultoa">,
3014 <ref id="utoa" name="utoa">
3015 <tag/Example/None.
3016 </descrip>
3017 </quote>
3018
3019
3020 <sect1>localeconv<label id="localeconv"><p>
3021
3022 <quote>
3023 <descrip>
3024 <tag/Function/Returns a pointer to the current locale structure.
3025 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
3026 <tag/Declaration/<tt/struct lconv* localeconv (void);/
3027 <tag/Description/<tt/localeconv/ returns a pointer to the current locale
3028 structure.
3029 <tag/Limits/<itemize>
3030 <item>cc65 supports only the "C" locale, so even after setting a new locale
3031 using <tt/<ref id="setlocale" name="setlocale">/, the structure returned will
3032 always be the same.
3033 </itemize>
3034 <tag/Availability/ISO 9899
3035 <tag/See also/
3036 <ref id="setlocale" name="setlocale">
3037 <tag/Example/None.
3038 </descrip>
3039 </quote>
3040
3041
3042 <sect1>longjmp<label id="longjmp"><p>
3043
3044 <quote>
3045 <descrip>
3046 <tag/Function/Non local goto.
3047 <tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
3048 <tag/Declaration/<tt/void __fastcall__ longjmp (jmp_buf buf, int retval);/
3049 <tag/Description/The <tt/longjmp/ function restores a program context from the
3050 data in <tt/buf/, which must have been set by a preceeding call to
3051 <tt/<ref id="setjmp" name="setjmp">/. Program execution continues as if the
3052 call to <tt/<ref id="setjmp" name="setjmp">/ has just returned the value
3053 <tt/retval/.
3054 <tag/Limits/
3055 <itemize>
3056 <item>If the parameter <tt/retval/ is zero, the function will behave as if it
3057 was called with a value of one.
3058 <item>The function is only available as fastcall function, so it may only
3059 be used in presence of a prototype.
3060 </itemize>
3061 <tag/Availability/ISO 9899
3062 <tag/See also/
3063 <ref id="setjmp" name="setjmp">
3064 <tag/Example/None.
3065 </descrip>
3066 </quote>
3067
3068
3069 <sect1>malloc<label id="malloc"><p>
3070
3071 <quote>
3072 <descrip>
3073 <tag/Function/Allocate dynamic memory.
3074 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3075 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
3076 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
3077 pointer to the allocated memory block. On error (not enough memory available),
3078 <tt/malloc/ returns <tt/NULL/.
3079 <tag/Limits/
3080 <itemize>
3081 <item>The function is only available as fastcall function, so it may only
3082 be used in presence of a prototype.
3083 </itemize>
3084 <tag/Availability/ISO 9899
3085 <tag/See also/
3086 <ref id="_heapadd" name="_heapadd">,
3087 <ref id="_heapblocksize" name="_heapblocksize">,
3088 <ref id="_heapmaxavail" name="_heapmaxavail">,
3089 <ref id="_heapmemavail" name="_heapmemavail">,
3090 <ref id="calloc" name="calloc">,
3091 <ref id="free" name="free">,
3092 <ref id="realloc" name="realloc">,
3093 <ref id="strdup" name="strdup">
3094 <tag/Example/None.
3095 </descrip>
3096 </quote>
3097
3098
3099 <sect1>memchr<label id="memchr"><p>
3100
3101 <quote>
3102 <descrip>
3103 <tag/Function/Search for a character in a block of raw memory.
3104 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3105 <tag/Declaration/<tt/void* __fastcall__ strchr (const void* mem, int c, size_t count);/
3106 <tag/Description/The <tt/memchr/ function locates the first occurrence of <tt/c/
3107 (converted to a char) in the block of raw memory string pointed to by <tt/mem/
3108 that is of size <tt/count/. Upon completion, the function returns a pointer to
3109 the character found, or a null pointer if the character was not found.
3110 <tag/Limits/<itemize>
3111 <item>The function is only available as fastcall function, so it may only
3112 be used in presence of a prototype.
3113 </itemize>
3114 <tag/Availability/ISO 9899
3115 <tag/See also/
3116 <ref id="strchr" name="strchr">
3117 <tag/Example/None.
3118 </descrip>
3119 </quote>
3120
3121
3122 <sect1>memcpy<label id="memcpy"><p>
3123
3124 <quote>
3125 <descrip>
3126 <tag/Function/Copy a memory area.
3127 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3128 <tag/Declaration/<tt/void* __fastcall__ memcpy (void* dest, const void* src, size_t count);/
3129 <tag/Description/<tt/memcpy/ copies <tt/count/ bytes from the memory area
3130 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
3131 <tt/dest/.
3132 <tag/Limits/
3133 <itemize>
3134 <item>The result is undefined if the memory areas do overlap. Use
3135 <tt/<ref id="memmove" name="memmove">/ to copy overlapping memory areas.
3136 <item>The function is only available as fastcall function, so it may only
3137 be used in presence of a prototype.
3138 </itemize>
3139 <tag/Availability/ISO 9899
3140 <tag/See also/
3141 <ref id="_swap" name="_swap">,
3142 <ref id="memmove" name="memmove">,
3143 <ref id="memset" name="memset">
3144 <tag/Example/None.
3145 </descrip>
3146 </quote>
3147
3148
3149 <sect1>memmove<label id="memmove"><p>
3150
3151 <quote>
3152 <descrip>
3153 <tag/Function/Copy a memory area.
3154 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3155 <tag/Declaration/<tt/void* __fastcall__ memmove (void* dest, const void* src, size_t count);/
3156 <tag/Description/<tt/memmove/ copies <tt/count/ bytes from the memory area
3157 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
3158 <tt/dest/.
3159 <tag/Limits/
3160 <itemize>
3161 <item>While <tt/memmove/ allows the memory areas to overlap, it has some
3162 additional overhead compared to <tt/<ref id="memcpy" name="memcpy">/.
3163 <item>The function is only available as fastcall function, so it may only
3164 be used in presence of a prototype.
3165 </itemize>
3166 <tag/Availability/ISO 9899
3167 <tag/See also/
3168 <ref id="_swap" name="_swap">,
3169 <ref id="memcpy" name="memcpy">,
3170 <ref id="memset" name="memset">
3171 <tag/Example/None.
3172 </descrip>
3173 </quote>
3174
3175
3176 <sect1>memset<label id="memset"><p>
3177
3178 <quote>
3179 <descrip>
3180 <tag/Function/Fill a memory area.
3181 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3182 <tag/Declaration/<tt/void* __fastcall__ memset (void* p, int val, size_t count);/
3183 <tag/Description/<tt/memset/ fills the memory area pointed to by <tt/p/ with
3184 the value <tt/val/. The function returns <tt/p/.
3185 <tag/Limits/
3186 <itemize>
3187 <item>The function is only available as fastcall function, so it may only
3188 be used in presence of a prototype.
3189 </itemize>
3190 <tag/Availability/ISO 9899
3191 <tag/See also/
3192 <ref id="_swap" name="_swap">,
3193 <ref id="bzero" name="bzero">,
3194 <ref id="memcpy" name="memcpy">,
3195 <ref id="memmove" name="memmove">
3196 <tag/Example/None.
3197 </descrip>
3198 </quote>
3199
3200
3201 <sect1>mod_free<label id="mod_free"><p>
3202
3203 <quote>
3204 <descrip>
3205 <tag/Function/Free a relocatable module.
3206 <tag/Header/<tt/<ref id="modload.h" name="modload.h">/
3207 <tag/Declaration/<tt/void __fastcall__ mod_free (void* module);/
3208 <tag/Description/The function will free a module loaded into memory by use of
3209 the <tt/<ref id="mod_load" name="mod_load">/ function.
3210 <tag/Limits/<itemize>
3211 <item>The pointer passed as parameter is the pointer to the module memory,
3212 not the pointer to the control structure.
3213 </itemize>
3214 <tag/Availability/cc65
3215 <tag/See also/
3216 <ref id="mod_load" name="mod_load">
3217 <tag/Example/None.
3218 </descrip>
3219 </quote>
3220
3221
3222 <sect1>mod_load<label id="mod_load"><p>
3223
3224 <quote>
3225 <descrip>
3226 <tag/Function/Load a relocatable module.
3227 <tag/Header/<tt/<ref id="modload.h" name="modload.h">/
3228 <tag/Declaration/<tt/unsigned char mod_load (struct mod_ctrl* ctrl);/
3229 <tag/Description/The function will load a code module into memory and relocate
3230 it. The function will return an error code. If <tt/MLOAD_OK/ is returned, the
3231 outgoing fields in the passed <tt/mod_ctrl/ struct contain information about
3232 the module just loaded. Possible error codes are:
3233 <itemize>
3234 <item><tt/MLOAD_OK/ - Module load successful
3235 <item><tt/MLOAD_ERR_READ/ - Read error
3236 <item><tt/MLOAD_ERR_HDR/ - Header error
3237 <item><tt/MLOAD_ERR_OS/ - Wrong operating system
3238 <item><tt/MLOAD_ERR_FMT/ - Data format error
3239 <item><tt/MLOAD_ERR_MEM/ - Not enough memory
3240 </itemize>
3241 <tag/Limits/<itemize>
3242 <item>The <htmlurl url="ld65.html" name="ld65"> linker is needed to create
3243 relocatable o65 modules for use with this function.
3244 </itemize>
3245 <tag/Availability/cc65
3246 <tag/See also/
3247 <ref id="mod_free" name="mod_free">
3248 <tag/Example/None.
3249 </descrip>
3250 </quote>
3251
3252
3253 <sect1>mouse_box<label id="mouse_box"><p>
3254
3255 <quote>
3256 <descrip>
3257 <tag/Function/Specify a bounding box for the mouse cursor.
3258 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3259 <tag/Declaration/<tt/void __fastcall__ mouse_box (int minx, int miny,
3260 int maxx, int maxy);/
3261 <tag/Description/The function allows to set a bounding box for mouse movement.
3262 <tag/Limits/<itemize>
3263 <item>The function does not check if the mouse cursor is currently within the
3264 given rectangle. Placing the mouse cursor within the bounding box is the
3265 responsibility of the programmer.
3266 <item>While the bounding box may be larger than the actual screen size, the
3267 standard mouse cursor draw routines may fail to set the cursor to coordinates
3268 outside of the screen area. Depending on the platform, you may have to supply
3269 your own mouse cursor routines.
3270 <item>The function is only available as fastcall function, so it may only be
3271 used in presence of a prototype.
3272 </itemize>
3273 <tag/Availability/cc65
3274 <tag/See also/
3275 <ref id="mouse_move" name="mouse_move">
3276 <tag/Example/None.
3277 </descrip>
3278 </quote>
3279
3280
3281 <sect1>mouse_buttons<label id="mouse_buttons"><p>
3282
3283 <quote>
3284 <descrip>
3285 <tag/Function/Return a bit mask encoding the state of the mouse buttons.
3286 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3287 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_buttons (void);/
3288 <tag/Description/The function returns a bit mask that encodes the state of the
3289 mouse buttons. You may use the <tt/MOUSE_BTN_XXX/ flags to decode the function
3290 return value.
3291 <tag/Limits/<itemize>
3292 <item>The function is only available as fastcall function, so it may only be
3293 used in presence of a prototype.
3294 </itemize>
3295 <tag/Availability/cc65
3296 <tag/See also/
3297 <ref id="mouse_info" name="mouse_info">,
3298 <ref id="mouse_pos" name="mouse_pos">
3299 <tag/Example/None.
3300 </descrip>
3301 </quote>
3302
3303
3304 <sect1>mouse_geterrormsg<label id="mouse_geterrormsg"><p>
3305
3306 <quote>
3307 <descrip>
3308 <tag/Function/Return a readable error message for an error code.
3309 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3310 <tag/Declaration/<tt/const char* __fastcall__ mouse_geterrormsg (unsigned char
3311 code);/
3312 <tag/Description/The function returns an error message (in english) for the
3313 error code passed parameter.
3314 <tag/Limits/<itemize>
3315 <item>The function will return "Unknown error" for invalid error codes.
3316 <item>The function is only available as fastcall function, so it may only be
3317 used in presence of a prototype.
3318 </itemize>
3319 <tag/Availability/cc65
3320 <tag/See also/
3321 <ref id="mouse_load_driver" name="mouse_load_driver">,
3322 <ref id="mouse_uninstall" name="mouse_uninstall">,
3323 <ref id="mouse_unload" name="mouse_unload">
3324 <tag/Example/None.
3325 </descrip>
3326 </quote>
3327
3328
3329 <sect1>mouse_hide<label id="mouse_hide"><p>
3330
3331 <quote>
3332 <descrip>
3333 <tag/Function/Hide the mouse pointer.
3334 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3335 <tag/Declaration/<tt/void __fastcall__ mouse_hide (void);/
3336 <tag/Description/The function hides the mouse pointer. It manages a counter
3337 that is shared between <tt/<ref id="mouse_show" name="mouse_show">/ and
3338 <tt/mouse_hide/ so that every call call to <tt/mouse_hide/ must be followed by
3339 a call to <tt/<ref id="mouse_show" name="mouse_show">/ to make the mouse cursor
3340 visible.
3341 <tag/Limits/<itemize>
3342 <item>The function is only available as fastcall function, so it may only be
3343 used in presence of a prototype.
3344 </itemize>
3345 <tag/Availability/cc65
3346 <tag/See also/
3347 <ref id="mouse_show" name="mouse_show">
3348 <tag/Example/None.
3349 </descrip>
3350 </quote>
3351
3352
3353 <sect1>mouse_info<label id="mouse_info"><p>
3354
3355 <quote>
3356 <descrip>
3357 <tag/Function/Return the state of the mouse buttons and the position of the
3358 mouse.
3359 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3360 <tag/Declaration/<tt/void __fastcall__ mouse_info (struct mouse_info* info);/
3361 <tag/Description/The function returns the state of the mouse buttons and the
3362 position of the mouse in the <tt/mouse_info/ structure passed as parameter.
3363 <tag/Limits/<itemize>
3364 <item>The <tt/mouse_info/ struct is a superset of the <tt/mouse_pos/ struct,
3365 so if you just need the mouse position, call <tt/<ref id="mouse_pos"
3366 name="mouse_pos">/ instead.
3367 <item>The function is only available as fastcall function, so it may only be
3368 used in presence of a prototype.
3369 </itemize>
3370 <tag/Availability/cc65
3371 <tag/See also/
3372 <ref id="mouse_buttons" name="mouse_buttons">,
3373 <ref id="mouse_pos" name="mouse_pos">
3374 <tag/Example/None.
3375 </descrip>
3376 </quote>
3377
3378
3379 <sect1>mouse_install<label id="mouse_install"><p>
3380
3381 <quote>
3382 <descrip>
3383 <tag/Function/Install an already loaded mouse driver.
3384 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3385 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_install (const struct
3386 mouse_callbacks* c, void* driver);/
3387 <tag/Description/The function installs an already loaded mouse driver and
3388 returns an error code. The <tt/mouse_callbacks/ structure passed as first
3389 parameter contains pointers to routines needed to move or hide/show the mouse
3390 pointer. Defaults for these routines are supplied by the library, so if you
3391 can live with these defaults (which are platform specific), just pass a
3392 pointer to <tt/mouse_def_callbacks/. The function may be used to install a
3393 driver linked statically to the program.
3394 <tag/Limits/<itemize>
3395 <item>Not all drivers are able to detect if the supported hardware is really
3396 present.
3397 <item>After installing a driver, the mouse cursor is hidden.
3398 <item>The function is only available as fastcall function, so it may only be
3399 used in presence of a prototype.
3400 </itemize>
3401 <tag/Availability/cc65
3402 <tag/See also/
3403 <ref id="mouse_load_driver" name="mouse_load_driver">,
3404 <ref id="mouse_uninstall" name="mouse_uninstall">,
3405 <ref id="mouse_unload" name="mouse_unload">
3406 <tag/Example/None.
3407 </descrip>
3408 </quote>
3409
3410
3411 <sect1>mouse_ioctl<label id="mouse_ioctl"><p>
3412
3413 <quote>
3414 <descrip>
3415 <tag/Function/Call the driver specific ioctl function.
3416 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3417 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_ioctl (unsigned char code, void* data);/
3418 <tag/Description/The function calls the IOCTL entry in the mouse driver,
3419 which is driver specific. The <tt/code/ parameter will choose between
3420 different IOCTL functions, and the <tt/data/ depends on code. The
3421 function returns an error code. The purpose of this function is to allow
3422 for driver specific extensions. See the documentation for a specific mouse
3423 driver for supported ioctl calls.
3424 <tag/Limits/<itemize>
3425 <item>Calling this function is non portable, because each driver may
3426 implement different ioctl calls (or none at all).
3427 <item>The function is only available as fastcall function, so it may only be
3428 used in presence of a prototype.
3429 </itemize>
3430 <tag/Availability/cc65
3431 <tag/Example/None.
3432 </descrip>
3433 </quote>
3434
3435
3436 <sect1>mouse_load_driver<label id="mouse_load_driver"><p>
3437
3438 <quote>
3439 <descrip>
3440 <tag/Function/Load and initialize a mouse driver.
3441 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3442 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_load_driver (const struct
3443 mouse_callbacks* c, const char* driver);/
3444 <tag/Description/Load a mouse driver into memory and initialize it. The
3445 function returns an error code that tells if the call has been successful. The
3446 <tt/mouse_callbacks/ structure passed as first parameter contains pointers to
3447 routines needed to move or hide/show the mouse pointer. Defaults for these
3448 routines are supplied by the library, so if you can live with these defaults
3449 (which are platform specific), just pass a pointer to <tt/mouse_def_callbacks/.
3450 <tag/Limits/<itemize>
3451 <item>The driver is loaded by name, so currently you must know the type of
3452 mouse that should be supported. There is no autodetect capability.
3453 <item>Not all drivers are able to detect if the supported hardware is really
3454 present.
3455 <item>After installing a driver, the mouse cursor is hidden.
3456 <item>The function is only available as fastcall function, so it may only be
3457 used in presence of a prototype.
3458 </itemize>
3459 <tag/Availability/cc65
3460 <tag/See also/
3461 <ref id="mouse_install" name="mouse_install">,
3462 <ref id="mouse_uninstall" name="mouse_uninstall">,
3463 <ref id="mouse_unload" name="mouse_unload">
3464 <tag/Example/None.
3465 </descrip>
3466 </quote>
3467
3468
3469 <sect1>mouse_move<label id="mouse_move"><p>
3470
3471 <quote>
3472 <descrip>
3473 <tag/Function/Move the mouse cursor to a specific position.
3474 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3475 <tag/Declaration/<tt/void __fastcall__ mouse_move (int x, int y);/
3476 <tag/Description/The function updates the mouse position. If the mouse cursor
3477 is visible, it is shown at the new position.
3478 <tag/Limits/<itemize>
3479 <item>The function does not check if the new position is within the bounding
3480 box specified with <tt/<ref id="mouse_box" name="mouse_box">/.
3481 <item>The function is only available as fastcall function, so it may only be
3482 used in presence of a prototype.
3483 </itemize>
3484 <tag/Availability/cc65
3485 <tag/See also/
3486 <ref id="mouse_box" name="mouse_box">
3487 <tag/Example/None.
3488 </descrip>
3489 </quote>
3490
3491
3492 <sect1>mouse_pos<label id="mouse_pos"><p>
3493
3494 <quote>
3495 <descrip>
3496 <tag/Function/Return the position of the mouse.
3497 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3498 <tag/Declaration/<tt/void __fastcall__ mouse_pos (struct mouse_pos* pos);/
3499 <tag/Description/The function returns the position of the mouse in the
3500 <tt/mouse_pos/ structure passed as parameter.
3501 <tag/Limits/<itemize>
3502 <item>The <tt/mouse_pos/ struct is a subset of the <tt/mouse_info/ struct,
3503 so if you do also need the mouse buttons, call <tt/<ref id="mouse_info"
3504 name="mouse_info">/ instead.
3505 <item>The function is only available as fastcall function, so it may only be
3506 used in presence of a prototype.
3507 </itemize>
3508 <tag/Availability/cc65
3509 <tag/See also/
3510 <ref id="mouse_buttons" name="mouse_buttons">,
3511 <ref id="mouse_info" name="mouse_info">
3512 <tag/Example/None.
3513 </descrip>
3514 </quote>
3515
3516
3517 <sect1>mouse_show<label id="mouse_show"><p>
3518
3519 <quote>
3520 <descrip>
3521 <tag/Function/Show the mouse pointer.
3522 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3523 <tag/Declaration/<tt/void __fastcall__ mouse_show (void);/
3524 <tag/Description/The function shows the mouse pointer. It manages a counter
3525 that is shared between <tt/<ref id="mouse_hide" name="mouse_hide">/ and
3526 <tt/mouse_show/. The mouse cursor is visible if there was one more call to
3527 <tt/mouse_show/ than to <tt/<ref id="mouse_hide" name="mouse_hide">/.
3528 <tag/Limits/<itemize>
3529 <item>The function is only available as fastcall function, so it may only be
3530 used in presence of a prototype.
3531 </itemize>
3532 <tag/Availability/cc65
3533 <tag/See also/
3534 <ref id="mouse_hide" name="mouse_hide">
3535 <tag/Example/None.
3536 </descrip>
3537 </quote>
3538
3539
3540 <sect1>mouse_uninstall<label id="mouse_uninstall"><p>
3541
3542 <quote>
3543 <descrip>
3544 <tag/Function/Uninstall an already loaded mouse driver.
3545 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3546 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_install (void);/
3547 <tag/Description/The function uninstalls an already loaded mouse driver but
3548 don't removes it from memory.
3549 <tag/Limits/<itemize>
3550 <item>If the driver has been loaded using <tt/<ref id="mouse_load_driver"
3551 name="mouse_load_driver">/, <tt/<ref id="mouse_unload" name="mouse_unload">/
3552 should be used instead of <tt/mouse_uninstall/ so the driver is also removed
3553 from memory.
3554 <item>The function is only available as fastcall function, so it may only be
3555 used in presence of a prototype.
3556 </itemize>
3557 <tag/Availability/cc65
3558 <tag/See also/
3559 <ref id="mouse_install" name="mouse_install">,
3560 <ref id="mouse_load_driver" name="mouse_load_driver">,
3561 <ref id="mouse_unload" name="mouse_unload">
3562 <tag/Example/None.
3563 </descrip>
3564 </quote>
3565
3566
3567 <sect1>mouse_unload<label id="mouse_unload"><p>
3568
3569 <quote>
3570 <descrip>
3571 <tag/Function/Unload a mouse driver.
3572 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3573 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_unload (void);/
3574 <tag/Description/The function unloads a loaded mouse driver and frees all
3575 memory allocated for the driver.
3576 <tag/Limits/<itemize>
3577 <item>The function does nothing if no driver is loaded.
3578 </itemize>
3579 <tag/Availability/cc65
3580 <tag/See also/
3581 <ref id="mouse_install" name="mouse_install">,
3582 <ref id="mouse_load_driver" name="mouse_load_driver">,
3583 <ref id="mouse_uninstall" name="mouse_uninstall">
3584 <tag/Example/None.
3585 </descrip>
3586 </quote>
3587
3588
3589 <sect1>offsetof<label id="offsetof"><p>
3590
3591 <quote>
3592 <descrip>
3593 <tag/Function/Calculate the offset of a struct or union member.
3594 <tag/Header/<tt/<ref id="stddef.h" name="stddef.h">/
3595 <tag/Declaration/<tt/size_t offsetof (type, member);/
3596 <tag/Description/<tt/offsetof/ calculates the address offset of a <tt/struct/
3597 or <tt/union/ member.
3598 <tag/Limits/<itemize>
3599 <item>The function is actually a macro.
3600 </itemize>
3601 <tag/Availability/ISO 9899
3602 <tag/Example/None.
3603 </descrip>
3604 </quote>
3605
3606
3607 <sect1>open<label id="open"><p>
3608
3609 <quote>
3610 <descrip>
3611 <tag/Function/Open and possibly create a file.
3612 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
3613 <tag/Declaration/<tt/int open (const char* name, int flags, ...);/
3614 <tag/Description/<tt/open/ opens a file and returns the file descriptor
3615 associated with it. On error, -1 is returned and an error code is stored in
3616 <tt/errno/. Several flags may be passed to <tt/open/ that change the behaviour.
3617 <tag/Limits/<itemize>
3618 <item>POSIX specifies an additional <tt/mode/ argument that may be passed to
3619 open, which is used as the permission mask when a new file is created. While
3620 cc65 allows to pass this argument, it is ignored.
3621 </itemize>
3622 <tag/Availability/POSIX 1003.1
3623 <tag/See also/
3624 <ref id="close" name="close">,
3625 <ref id="creat" name="creat">
3626 <tag/Example/None.
3627 </descrip>
3628 </quote>
3629
3630
3631 <sect1>peekbsys<label id="peekbsys"><p>
3632
3633 <quote>
3634 <descrip>
3635 <tag/Function/Read one byte from a location in the system bank.
3636 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3637 <tt/<ref id="cbm510.h" name="cbm510.h">/
3638 <tag/Declaration/<tt/unsigned char __fastcall__ peekbsys (unsigned addr);/
3639 <tag/Description/<tt/peekbsys/ reads one byte from the given address in the
3640 system bank (bank 15) of the CBM PET-II machines and returns it.
3641 <tag/Limits/
3642 <itemize>
3643 <item>The function is only available as fastcall function, so it may only
3644 be used in presence of a prototype.
3645 <item>This function may be a macro depending on the compiler options. The
3646 actual function is accessible by #undef'ing the macro.
3647 </itemize>
3648 <tag/Availability/cc65
3649 <tag/See also/
3650 <ref id="PEEK" name="PEEK">,
3651 <ref id="PEEKW" name="PEEKW">,
3652 <ref id="peekwsys" name="peekwsys">,
3653 <ref id="pokebsys" name="pokebsys">,
3654 <ref id="pokewsys" name="pokewsys">
3655 <tag/Example/None.
3656 </descrip>
3657 </quote>
3658
3659
3660 <sect1>peekwsys<label id="peekwsys"><p>
3661
3662 <quote>
3663 <descrip>
3664 <tag/Function/Read one word from a location in the system bank.
3665 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3666 <tt/<ref id="cbm510.h" name="cbm510.h">/
3667 <tag/Declaration/<tt/unsigned __fastcall__ peekwsys (unsigned addr);/
3668 <tag/Description/<tt/peekwsys/ reads one word from the given address in the
3669 system bank (bank 15) of the CBM PET-II machines and returns it. Following
3670 the usual 6502 conventions, the low byte is read from <tt/addr/, and the
3671 high byte is read from <tt/addr+1/.
3672 <tag/Limits/
3673 <itemize>
3674 <item>The function is only available as fastcall function, so it may only
3675 be used in presence of a prototype.
3676 <item>The order in which the two bytes are read is undefined.
3677 </itemize>
3678 <tag/Availability/cc65
3679 <tag/See also/
3680 <ref id="PEEK" name="PEEK">,
3681 <ref id="PEEKW" name="PEEKW">,
3682 <ref id="peekbsys" name="peekbsys">,
3683 <ref id="pokebsys" name="pokebsys">,
3684 <ref id="pokewsys" name="pokewsys">
3685 <tag/Example/None.
3686 </descrip>
3687 </quote>
3688
3689
3690 <sect1>perror<label id="perror"><p>
3691
3692 <quote>
3693 <descrip>
3694 <tag/Function/Print an error message for the error in <tt/errno/.
3695 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
3696 <tag/Declaration/<tt/void __fastcall__ perror (const char* s);/
3697 <tag/Description/<tt/perror/ prints an error message to <tt/stderr/. If <tt/s/
3698 is not <tt/NULL/ and not an empty string, it is printed followed by a colon and
3699 a blank. Then the error message for the current contents of <tt/errno/ is
3700 printed followed by a newline. The message output is the same as returned by
3701 <tt/<ref id="strerror" name="strerror">/ with an argument of <tt/errno/.
3702 <tag/Limits/
3703 <itemize>
3704 <item>The function is only available as fastcall function, so it may only
3705 be used in presence of a prototype.
3706 </itemize>
3707 <tag/Availability/ISO 9899
3708 <tag/See also/
3709 <ref id="_poserror" name="_poserror">,
3710 <ref id="strerror" name="strerror">
3711 <tag/Example/None.
3712 </descrip>
3713 </quote>
3714
3715
3716 <sect1>pokebsys<label id="pokebsys"><p>
3717
3718 <quote>
3719 <descrip>
3720 <tag/Function/Write one byte to a location in the system bank.
3721 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3722 <tt/<ref id="cbm510.h" name="cbm510.h">/
3723 <tag/Declaration/<tt/void __fastcall__ pokebsys (unsigned addr, unsigned char val);/
3724 <tag/Description/<tt/pokebsys/ writes one byte to the given address in the
3725 system bank (bank 15) of the CBM PET-II machines.
3726 <tag/Limits/
3727 <itemize>
3728 <item>The function is only available as fastcall function, so it may only
3729 be used in presence of a prototype.
3730 </itemize>
3731 <tag/Availability/cc65
3732 <tag/See also/
3733 <ref id="POKE" name="POKE">,
3734 <ref id="POKEW" name="POKEW">,
3735 <ref id="peekbsys" name="peekbsys">,
3736 <ref id="peekwsys" name="peekwsys">,
3737 <ref id="pokewsys" name="pokewsys">
3738 <tag/Example/None.
3739 </descrip>
3740 </quote>
3741
3742
3743 <sect1>pokewsys<label id="pokewsys"><p>
3744
3745 <quote>
3746 <descrip>
3747 <tag/Function/Write one word to a location in the system bank.
3748 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3749 <tt/<ref id="cbm510.h" name="cbm510.h">/
3750 <tag/Declaration/<tt/void __fastcall__ pokewsys (unsigned addr, unsigned val);/
3751 <tag/Description/<tt/pokewsys/ writes one word to the given address in the
3752 system bank (bank 15) of the CBM PET-II machines. Following the usual 6502
3753 conventions, the low byte of <tt/val/ is written to <tt/addr/, and the
3754 high byte is written to <tt/addr+1/.
3755 <tag/Limits/
3756 <itemize>
3757 <item>The function is only available as fastcall function, so it may only
3758 be used in presence of a prototype.
3759 <item>The order in which the two bytes are written is undefined.
3760 </itemize>
3761 <tag/Availability/cc65
3762 <tag/See also/
3763 <ref id="POKE" name="POKE">,
3764 <ref id="POKEW" name="POKEW">,
3765 <ref id="peekbsys" name="peekbsys">,
3766 <ref id="peekwsys" name="peekwsys">,
3767 <ref id="pokebsys" name="pokebsys">
3768 <tag/Example/None.
3769 </descrip>
3770 </quote>
3771
3772
3773 <sect1>qsort<label id="qsort"><p>
3774
3775 <quote>
3776 <descrip>
3777 <tag/Function/Sort an array.
3778 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3779 <tag/Declaration/<tt/void __fastcall__ qsort (void* base, size_t count,
3780 size_t size, int (*compare) (const void*, const void*));/
3781 <tag/Description/<tt/qsort/ sorts an array according to a given compare
3782 function <tt/compare/. <tt/base/ is the address of the array, <tt/count/
3783 is the number of elements, <tt/size/ the size of an element and <tt/compare/
3784 the function used to compare the members.
3785 <tag/Limits/
3786 <itemize>
3787 <item>If there are multiple members with the same key, the order after calling
3788 the function is undefined.
3789 <item>The function is only available as fastcall function, so it may only
3790 be used in presence of a prototype.
3791 </itemize>
3792 <tag/Availability/ISO 9899
3793 <tag/See also/
3794 <ref id="bsearch" name="bsearch">
3795 <tag/Example/None.
3796 </descrip>
3797 </quote>
3798
3799
3800 <sect1>raise<label id="raise"><p>
3801
3802 <quote>
3803 <descrip>
3804 <tag/Function/Send a signal to the executing program.
3805 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
3806 <tag/Declaration/<tt/int __fastcall__ raise (int sig);/
3807 <tag/Description/<tt/raise/ sends the given signal to the program. If the
3808 program has installed a signal handler for the signal, this signal handler
3809 will be executed. If no handler has been installed, the default action for
3810 the raised signal will be taken. The function returns zero on success,
3811 nonzero otherwise.
3812 <tag/Limits/<itemize>
3813 <item>The function is only available as fastcall function, so it may only
3814 be used in presence of a prototype.
3815 </itemize>
3816 <tag/Availability/ISO 9899
3817 <tag/See also/
3818 <ref id="abort" name="abort">,
3819 <ref id="signal" name="signal">
3820 <tag/Example/None.
3821 </descrip>
3822 </quote>
3823
3824
3825 <sect1>rand<label id="rand"><p>
3826
3827 <quote>
3828 <descrip>
3829 <tag/Function/Return a pseudo random number.
3830 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3831 <tag/Declaration/<tt/int rand (void);/
3832 <tag/Description/The function returns a pseudo random number
3833 between 0 and <tt/RAND_MAX/ (exclusive).
3834 <tag/Limits/<itemize>
3835 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
3836 flow of numbers is generated.
3837 <item>On startup, the function behaves as if <ref id="srand" name="srand">
3838 had been used with an argument of 1.
3839 </itemize>
3840 <tag/Availability/ISO 9899
3841 <tag/See also/
3842 <ref id="_randomize" name="_randomize">,
3843 <ref id="srand" name="srand">
3844 <tag/Example/None.
3845 </descrip>
3846 </quote>
3847
3848
3849 <sect1>realloc<label id="realloc"><p>
3850
3851 <quote>
3852 <descrip>
3853 <tag/Function/Change the size of an allocated memory block.
3854 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3855 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
3856 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
3857 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
3858 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
3859 behaves as if <tt/free/ had been called. On error (not enough memory
3860 available), <tt/realloc/ returns <tt/NULL/.
3861 <tag/Limits/
3862 <itemize>
3863 <item>The part of the memory block that is returned will have its contents
3864 unchanged.
3865 <item>This function is somewhat dangerous to use. Be careful to save the
3866 pointer you're passing somewhere else, otherwise
3867 <tscreen><verb>
3868         ptr = realloc (ptr, size);
3869 </verb></tscreen>
3870 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
3871 <item>The function is only available as fastcall function, so it may only
3872 be used in presence of a prototype.
3873 </itemize>
3874 <tag/Availability/ISO 9899
3875 <tag/See also/
3876 <ref id="_heapadd" name="_heapadd">,
3877 <ref id="_heapblocksize" name="_heapblocksize">,
3878 <ref id="_heapmaxavail" name="_heapmaxavail">,
3879 <ref id="_heapmemavail" name="_heapmemavail">,
3880 <ref id="calloc" name="calloc">,
3881 <ref id="free" name="free">,
3882 <ref id="realloc" name="realloc">
3883 <tag/Example/None.
3884 </descrip>
3885 </quote>
3886
3887
3888 <sect1>remove<label id="remove"><p>
3889
3890 <quote>
3891 <descrip>
3892 <tag/Function/Delete a file.
3893 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
3894 <tag/Declaration/<tt/int __fastcall__ remove (const char* name);/
3895 <tag/Description/<tt/remove/ deletes the file with the given name. On success,
3896 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
3897 code describing the reason for the failure.
3898 <tag/Limits/
3899 <itemize>
3900 <item>This function is not available on all cc65 targets (depends on the
3901 availability of file I/O).
3902 <item>The function is only available as fastcall function, so it may only
3903 be used in presence of a prototype.
3904 </itemize>
3905 <tag/Availability/ISO 9899
3906 <tag/See also/
3907 <ref id="rename" name="rename">,
3908 <ref id="unlink" name="unlink">
3909 <tag/Example/
3910 <verb>
3911 #include &lt;stdio.h&gt;
3912
3913 #define FILENAME "helloworld"
3914
3915 if (remove (FILENAME) == 0) {
3916     printf ("We deleted %s successfully\n", FILENAME);
3917 } else {
3918     printf ("There was a problem deleting %s\n", FILENAME);
3919 }
3920 </verb>
3921 </descrip>
3922 </quote>
3923
3924
3925 <sect1>rename<label id="rename"><p>
3926
3927 <quote>
3928 <descrip>
3929 <tag/Function/Rename a file.
3930 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
3931 <tag/Declaration/<tt/int __fastcall__ rename (const char* oldname, const char* newname);/
3932 <tag/Description/<tt/rename/ renames a file (gives it a new name). On success,
3933 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
3934 code describing the reason for the failure.
3935 <tag/Limits/
3936 <itemize>
3937 <item>This function is not available on all cc65 targets (depends on the
3938 capabilities of the storage devices).
3939 <item>The function is only available as fastcall function, so it may only
3940 be used in presence of a prototype.
3941 </itemize>
3942 <tag/Availability/ISO 9899
3943 <tag/See also/
3944 <ref id="remove" name="remove">
3945 <tag/Example/
3946 <verb>
3947 #include &lt;stdio.h&gt;
3948
3949 #define OLDNAME "textfile.txt"
3950 #define NEWNAME "textfile.bak"
3951
3952 if (rename (OLDNAME, NEWNAME) == 0) {
3953     printf ("Renamed %s to %s\n", OLDNAME, NEWNAME);
3954 } else {
3955     printf ("Error renaming %s to %s\n", OLDNAME, NEWNAME);
3956 }
3957 </verb>
3958 </descrip>
3959 </quote>
3960
3961
3962 <sect1>reset_brk<label id="reset_brk"><p>
3963
3964 <quote>
3965 <descrip>
3966 <tag/Function/Resets the break vector to its original value.
3967 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
3968 <tag/Declaration/<tt/void __fastcall__ reset_brk (void);/
3969 <tag/Description/<tt/reset_brk/ resets the break vector to the value it had
3970 before a call to <tt/set_brk/.
3971 <tag/Limits/
3972 <itemize>
3973 <item>Since <tt/<ref id="set_brk" name="set_brk">/ installs an exit handler,
3974 it is not strictly necessary to call this function as part of the cleanup when
3975 the program ends.
3976 </itemize>
3977 <tag/Availability/cc65
3978 <tag/See also/
3979 <ref id="set_brk" name="set_brk">
3980 <tag/Example/None.
3981 </descrip>
3982 </quote>
3983
3984
3985 <sect1>revers<label id="revers"><p>
3986
3987 <quote>
3988 <descrip>
3989 <tag/Function/Control revers character display.
3990 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3991 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
3992 <tag/Description/If the argument is non zero, the function enables reverse
3993 character display. If the argument is zero, reverse character display is
3994 switched off. The old value of the setting is returned.
3995 <tag/Limits/<itemize>
3996 <item>The function may not be supported by the hardware, in which case
3997 the call is ignored.
3998 <item>The function is only available as fastcall function, so it may only
3999 be used in presence of a prototype.
4000 </itemize>
4001 <tag/Availability/cc65
4002 <tag/See also/
4003 <ref id="textcolor" name="textcolor">
4004 <tag/Example/None.
4005 </descrip>
4006 </quote>
4007
4008
4009 <sect1>screensize<label id="screensize"><p>
4010
4011 <quote>
4012 <descrip>
4013 <tag/Function/Return the dimensions of the text mode screen.
4014 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4015 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
4016 <tag/Description/The function returns the dimensions of the text mode screen.
4017 <tag/Limits/<itemize>
4018 <item>The function is only available as fastcall function, so it may only
4019 be used in presence of a prototype.
4020 </itemize>
4021 <tag/Availability/cc65
4022 <tag/See also/
4023 <ref id="gotox" name="gotox">,
4024 <ref id="gotoxy" name="gotoxy">,
4025 <ref id="gotoy" name="gotoy">,
4026 <ref id="wherex" name="wherex">,
4027 <ref id="wherey" name="wherey">
4028 <tag/Example/None.
4029 </descrip>
4030 </quote>
4031
4032
4033 <sect1>set_brk<label id="set_brk"><p>
4034
4035 <quote>
4036 <descrip>
4037 <tag/Function/Set the break vector to a user function.
4038 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
4039 <tag/Declaration/<tt/void __fastcall__ set_brk (brk_handler func);/
4040 <tag/Description/<tt/set_brk/ allows a user program to handle breaks within the
4041 program code by letting the vector point to a user written C function. The
4042 runtime library installs a small stub that saves the registers into global
4043 variables that may be accessed (and changed) by the break handler.
4044 <tag/Limits/
4045 <itemize>
4046 <item>The function is only available as fastcall function, so it may only
4047 be used in presence of a prototype.
4048 <item>The stub saves the zero page registers used by the C runtime and switches
4049 to a small break handler stack. This means that it is safe to execute C code,
4050 even if C code was interrupted. Be careful however not to use too many local
4051 variables, and do not enable stack checks for the handler function or any other
4052 function called from it.
4053 <item>The <tt/brk_pc/ variable points to the <tt/BRK/ instruction. If you want
4054 the continue with the interrupted code, you have to adjust <tt/brk_pc/,
4055 otherwise the <tt/BRK/ instruction will get executed over and over again.
4056 <item>Since <tt/set_brk/ installs an exit handler, it is not strictly necessary
4057 to call <tt/<ref id="reset_brk" name="reset_brk">/ as part of the cleanup when
4058 the program terminates.
4059 </itemize>
4060 <tag/Availability/cc65
4061 <tag/See also/
4062 <ref id="reset_brk" name="reset_brk">
4063 <tag/Example/None.
4064 </descrip>
4065 </quote>
4066
4067
4068 <sect1>setjmp<label id="setjmp"><p>
4069
4070 <quote>
4071 <descrip>
4072 <tag/Function/Save the context for use with <tt/longjmp/.
4073 <tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
4074 <tag/Declaration/<tt/int __fastcall__ setjmp (jmp_buf buf);/
4075 <tag/Description/The <tt/setjmp/ function saves the current context in <tt/buf/
4076 for subsequent use by the <tt/<ref id="longjmp" name="longjmp">/ function and
4077 returns zero.
4078 <tag/Limits/
4079 <itemize>
4080 <item>The function is only available as fastcall function, so it may only
4081 be used in presence of a prototype.
4082 <item><tt/setjmp/ is actually a macro as required by the ISO standard.
4083 <item><tt/setjmp/ will not save the signal context.
4084 </itemize>
4085 <tag/Availability/ISO 9899
4086 <tag/See also/
4087 <ref id="longjmp" name="longjmp">
4088 <tag/Example/None.
4089 </descrip>
4090 </quote>
4091
4092
4093 <sect1>setlocale<label id="setlocale"><p>
4094
4095 <quote>
4096 <descrip>
4097 <tag/Function/Selects a locale.
4098 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
4099 <tag/Declaration/<tt/char* __fastcall__ setlocale (int category, const char* locale);/
4100 <tag/Description/<tt/setlocale/ sets or queries the program's locale.
4101 <tag/Limits/
4102 <itemize>
4103 <item>The function is only available as fastcall function, so it may only
4104 be used in presence of a prototype.
4105 <item>cc65 supports only the "C" locale, so calling this function to set a
4106 different locale has no effect.
4107 </itemize>
4108 <tag/Availability/ISO 9899
4109 <tag/See also/
4110 <ref id="localeconv" name="localeconv">,
4111 <ref id="strcoll" name="strcoll">
4112 <ref id="strxfrm" name="strxfrm">
4113 <tag/Example/None.
4114 </descrip>
4115 </quote>
4116
4117
4118 <sect1>signal<label id="signal"><p>
4119
4120 <quote>
4121 <descrip>
4122 <tag/Function/Install a signal handler.
4123 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
4124 <tag/Declaration/<tt/__sigfunc __fastcall__ signal (int sig, __sigfunc func);/
4125 <tag/Description/<tt/signal/ installs a handler for the given signal. The
4126 handler may either be a user supplied function, or one of the predefined
4127 signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
4128 previous value if the signal , or the special function vector SIG_ERR in
4129 case of an error.
4130 <tag/Limits/<itemize>
4131 <item>The function is only available as fastcall function, so it may only
4132 be used in presence of a prototype.
4133 </itemize>
4134 <tag/Availability/ISO 9899
4135 <tag/See also/
4136 <ref id="abort" name="abort">,
4137 <ref id="raise" name="raise">
4138 <tag/Example/None.
4139 </descrip>
4140 </quote>
4141
4142
4143 <sect1>sleep<label id="sleep"><p>
4144
4145 <quote>
4146 <descrip>
4147 <tag/Function/Sleep for a specified amount of time.
4148 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
4149 <tag/Declaration/<tt/void __fastcall__ sleep (unsigned seconds);/
4150 <tag/Description/The function will return after the specified number of
4151 seconds have elapsed.
4152 <tag/Limits/<itemize>
4153 <item>The function is only available as fastcall function, so it may only
4154 be used in presence of a prototype.
4155 </itemize>
4156 <tag/Availability/POSIX 1003.1
4157 <tag/Example/None.
4158 </descrip>
4159 </quote>
4160
4161
4162 <sect1>slow<label id="slow"><p>
4163
4164 <quote>
4165 <descrip>
4166 <tag/Function/Switch the C128 into 1MHz mode.
4167 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
4168 <tag/Declaration/<tt/void slow (void);/
4169 <tag/Description/The function will switch the clock of the C128 to 1MHz. This
4170 will halve the speed compared to fast mode.
4171 <tag/Limits/<itemize>
4172 <item>The function is specific to the C128.
4173 </itemize>
4174 <tag/Availability/C128
4175 <tag/See also/
4176 <ref id="fast" name="fast">,
4177 <ref id="toggle_videomode" name="toggle_videomode">,
4178 <ref id="videomode" name="videomode">
4179 <tag/Example/None.
4180 </descrip>
4181 </quote>
4182
4183
4184 <sect1>srand<label id="srand"><p>
4185
4186 <quote>
4187 <descrip>
4188 <tag/Function/Initialize the pseudo random number generator.
4189 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4190 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
4191 <tag/Description/The function initializes the random number generator using
4192 the given seed. On program startup, the generator behaves as if <tt/srand/ has
4193 been called with an argument of 1.
4194 <tag/Limits/<itemize>
4195 <item>The function is only available as fastcall function, so it may only
4196 be used in presence of a prototype.
4197 </itemize>
4198 <tag/Availability/ISO 9899
4199 <tag/See also/
4200 <ref id="_randomize" name="_randomize">,
4201 <ref id="rand" name="rand">
4202 <tag/Example/None.
4203 </descrip>
4204 </quote>
4205
4206
4207 <sect1>strcasecmp<label id="strcasecmp"><p>
4208
4209 <quote>
4210 <descrip>
4211 <tag/Function/Compare two strings case insensitive.
4212 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4213 <tag/Declaration/<tt/int __fastcall__ strcasecmp (const char* s1, const char* s2);/
4214 <tag/Description/The <tt/strcasecmp/ function compares the two strings passed
4215 as parameters without case sensitivity. It returns a value that is less than
4216 zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
4217 and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
4218 <tag/Limits/<itemize>
4219 <item>The function is only available as fastcall function, so it may only
4220 be used in presence of a prototype.
4221 <item>The function is not available in strict ANSI mode.
4222 </itemize>
4223 <tag/Availability/cc65
4224 <tag/See also/
4225 <ref id="strcmp" name="strcmp">,
4226 <ref id="strcoll" name="strcoll">,
4227 <ref id="stricmp" name="stricmp">,
4228 <ref id="strncmp" name="strncmp">
4229 <ref id="strxfrm" name="strxfrm">
4230 <tag/Example/None.
4231 </descrip>
4232 </quote>
4233
4234
4235 <sect1>strcat<label id="strcat"><p>
4236
4237 <quote>
4238 <descrip>
4239 <tag/Function/Concatentate two strings.
4240 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4241 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
4242 <tag/Description/The <tt/strcat/ function appends a copy of the string
4243 pointed to by s2 (including the terminating null byte) to the end of the
4244 string pointed to by s1. The initial byte of s2 overwrites the null byte at
4245 the end of s1.
4246 <tag/Limits/<itemize>
4247 <item>The function is only available as fastcall function, so it may only
4248 be used in presence of a prototype.
4249 <item>If copying takes place between objects that overlap, the behaviour
4250 is undefined.
4251 </itemize>
4252 <tag/Availability/ISO 9899
4253 <tag/See also/
4254 <ref id="strcpy" name="strcpy">,
4255 <ref id="strncat" name="strncat">,
4256 <ref id="strncpy" name="strncpy">
4257 <tag/Example/None.
4258 </descrip>
4259 </quote>
4260
4261
4262 <sect1>strchr<label id="strchr"><p>
4263
4264 <quote>
4265 <descrip>
4266 <tag/Function/Search for a character in a string.
4267 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4268 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
4269 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
4270 (converted to a char) in the string pointed to by <tt/s/. The terminating null
4271 byte is considered to be part of the string. Upon completion, the function
4272 returns a pointer to the byte, or a null pointer if the byte was not found.
4273 <tag/Limits/<itemize>
4274 <item>The function is only available as fastcall function, so it may only
4275 be used in presence of a prototype.
4276 </itemize>
4277 <tag/Availability/ISO 9899
4278 <tag/See also/
4279 <ref id="memchr" name="memchr">,
4280 <ref id="strrchr" name="strrchr">
4281 <tag/Example/None.
4282 </descrip>
4283 </quote>
4284
4285
4286 <sect1>strcmp<label id="strcmp"><p>
4287
4288 <quote>
4289 <descrip>
4290 <tag/Function/Compare two strings.
4291 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4292 <tag/Declaration/<tt/int __fastcall__ strcmp (const char* s1, const char* s2);/
4293 <tag/Description/The <tt/strcmp/ function compares the two strings passed as
4294 parameters. It returns a value that is less than zero if <tt/s1/ is less than
4295 <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater than zero
4296 if <tt/s1/ is greater than <tt/s2/.
4297 <tag/Limits/<itemize>
4298 <item>The function is only available as fastcall function, so it may only
4299 be used in presence of a prototype.
4300 </itemize>
4301 <tag/Availability/ISO 9899
4302 <tag/See also/
4303 <ref id="strcasecmp" name="strcasecmp">,
4304 <ref id="strcoll" name="strcoll">,
4305 <ref id="stricmp" name="stricmp">,
4306 <ref id="strncmp" name="strncmp">
4307 <ref id="strxfrm" name="strxfrm">
4308 <tag/Example/None.
4309 </descrip>
4310 </quote>
4311
4312
4313 <sect1>strcoll<label id="strcoll"><p>
4314
4315 <quote>
4316 <descrip>
4317 <tag/Function/Compare two strings.
4318 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4319 <tag/Declaration/<tt/int __fastcall__ strcoll (const char* s1, const char* s2);/
4320 <tag/Description/The <tt/strcoll/ function compares the two strings passed as
4321 parameters, according to the collating sequence set by <tt/<ref id="setlocale"
4322 name="setlocale">/. It returns a value that is less than zero if <tt/s1/ is
4323 less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater
4324 than zero if <tt/s1/ is greater than <tt/s2/.
4325 <tag/Limits/<itemize>
4326 <item>The function is only available as fastcall function, so it may only
4327 be used in presence of a prototype.
4328 </itemize>
4329 <tag/Availability/ISO 9899
4330 <tag/See also/
4331 <ref id="setlocale" name="setlocale">,
4332 <ref id="strcasecmp" name="strcasecmp">,
4333 <ref id="strcmp" name="strcmp">,
4334 <ref id="stricmp" name="stricmp">,
4335 <ref id="strncmp" name="strncmp">
4336 <ref id="strxfrm" name="strxfrm">
4337 <tag/Example/None.
4338 </descrip>
4339 </quote>
4340
4341
4342 <sect1>strcpy<label id="strcpy"><p>
4343
4344 <quote>
4345 <descrip>
4346 <tag/Function/Copy a string.
4347 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4348 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
4349 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
4350 <tt/s2/ (including the terminating null byte) into the array pointed to by
4351 <tt/s1/. The function will always return <tt/s1/.
4352 <tag/Limits/<itemize>
4353 <item>The function is only available as fastcall function, so it may only
4354 be used in presence of a prototype.
4355 <item>If copying takes place between objects that overlap, the behaviour
4356 is undefined.
4357 </itemize>
4358 <tag/Availability/ISO 9899
4359 <tag/See also/
4360 <ref id="strcat" name="strcat">,
4361 <ref id="strncat" name="strncat">,
4362 <ref id="strncpy" name="strncpy">
4363 <tag/Example/
4364 <verb>
4365 #include &lt;string.h&gt;
4366
4367 static char hello[14];
4368
4369 strcpy (hello, "Hello world!\n");
4370 </verb>
4371 </descrip>
4372 </quote>
4373
4374
4375 <sect1>strcspn<label id="strcspn"><p>
4376
4377 <quote>
4378 <descrip>
4379 <tag/Function/Compute the length of a substring.
4380 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4381 <tag/Declaration/<tt/size_t __fastcall__ strcspn (const char* s, const char* set);/
4382 <tag/Description/The <tt/strcspn/ function computes and returns the length of
4383 the substring pointed to by <tt/s/ which does <em>not</em> consist of
4384 characters contained in the string <tt/set/.
4385 <tag/Limits/<itemize>
4386 <item>The function is only available as fastcall function, so it may only
4387 be used in presence of a prototype.
4388 </itemize>
4389 <tag/Availability/ISO 9899
4390 <tag/See also/
4391 <ref id="strspn" name="strspn">,
4392 <ref id="strstr" name="strstr">,
4393 <ref id="strtok" name="strtok">
4394 <tag/Example/None.
4395 </descrip>
4396 </quote>
4397
4398
4399 <sect1>strdup<label id="strdup"><p>
4400
4401 <quote>
4402 <descrip>
4403 <tag/Function/Allocate a copy of a string on the heap.
4404 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4405 <tag/Declaration/<tt/char* __fastcall__ strdup (const char* s);/
4406 <tag/Description/<tt/strdup/ allocates a memory block on the heap, big enough
4407 to hold a copy of <tt/s/ including the terminating zero. If the allocation
4408 fails, <tt/NULL/ is returned, otherwise <tt/s/ is copied into the allocated
4409 memory block, and a pointer to the block is returned.
4410 <tag/Limits/<itemize>
4411 <item>The function is only available as fastcall function, so it may only
4412 be used in presence of a prototype.
4413 <item>It is up to the caller to free the allocated memory block.
4414 </itemize>
4415 <tag/Availability/ISO 9899
4416 <tag/See also/
4417 <ref id="free" name="free">,
4418 <ref id="malloc" name="malloc">
4419 <tag/Example/None.
4420 </descrip>
4421 </quote>
4422
4423
4424 <sect1>strerror<label id="strerror"><p>
4425
4426 <quote>
4427 <descrip>
4428 <tag/Function/Return a string describing an error code.
4429 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4430 <tag/Declaration/<tt/char* __fastcall__ strerror (int errcode);/
4431 <tag/Description/The <tt/strerror/ function returns a string describing the
4432 given error code. If an invalid error code is passed, the string "Unknown
4433 error" is returned, and <tt/errno/ is set to <tt/EINVAL/. In all other cases,
4434 <tt/errno/ is left untouched.
4435 <tag/Limits/<itemize>
4436 <item>The function is only available as fastcall function, so it may only
4437 be used in presence of a prototype.
4438 <item>While the return type of the function is a <tt/char*/, the returned
4439 string must not be modified by the caller!
4440 </itemize>
4441 <tag/Availability/ISO 9899
4442 <tag/See also/
4443 <ref id="_stroserror" name="_stroserror">
4444 <tag/Example/None.
4445 </descrip>
4446 </quote>
4447
4448
4449 <sect1>stricmp<label id="stricmp"><p>
4450
4451 <quote>
4452 <descrip>
4453 <tag/Function/Compare two strings case insensitive.
4454 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4455 <tag/Declaration/<tt/int __fastcall__ stricmp (const char* s1, const char* s2);/
4456 <tag/Description/The <tt/stricmp/ function compares the two strings passed as
4457 parameters without case sensitivity. It returns a value that is less than zero
4458 if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
4459 value greater than zero if <tt/s1/ is greater than <tt/s2/.
4460 <tag/Limits/<itemize>
4461 <item>The function is only available as fastcall function, so it may only
4462 be used in presence of a prototype.
4463 <item>The function is not available in strict ANSI mode.
4464 </itemize>
4465 <tag/Availability/cc65
4466 <tag/See also/
4467 <ref id="strcasecmp" name="strcasecmp">,
4468 <ref id="strcmp" name="strcmp">,
4469 <ref id="strcoll" name="strcoll">,
4470 <ref id="strncmp" name="strncmp">
4471 <ref id="strxfrm" name="strxfrm">
4472 <tag/Example/None.
4473 </descrip>
4474 </quote>
4475
4476
4477 <sect1>strlen<label id="strlen"><p>
4478
4479 <quote>
4480 <descrip>
4481 <tag/Function/Return the length of a string.
4482 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4483 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
4484 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
4485 string to which s points, not including the terminating null byte.
4486 <tag/Limits/<itemize>
4487 <item>The function is only available as fastcall function, so it may only
4488 be used in presence of a prototype.
4489 <item>When compiling with <tt/-Os/ (inline known standard functions), the
4490 function does not work correctly for strings with more than 255 characters.
4491 </itemize>
4492 <tag/Availability/ISO 9899
4493 <tag/See also/
4494 <ref id="strcpy" name="strcpy">
4495 <tag/Example/None.
4496 </descrip>
4497 </quote>
4498
4499
4500 <sect1>strlower<label id="strlower"><p>
4501
4502 <quote>
4503 <descrip>
4504 <tag/Function/Make a string lower case.
4505 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4506 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
4507 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
4508 function to each character of a string. The function will always return <tt/s/.
4509 <tag/Limits/<itemize>
4510 <item>The function is only available as fastcall function, so it may only
4511 be used in presence of a prototype.
4512 <item>The function prototype is unavailable when compiling in strict ANSI mode.
4513 <item>An alias name for this function is <tt/strlwr/.
4514 </itemize>
4515 <tag/Availability/cc65
4516 <tag/See also/
4517 <ref id="strupper" name="strupper">,
4518 <ref id="tolower" name="tolower">
4519 <tag/Example/None.
4520 </descrip>
4521 </quote>
4522
4523
4524 <sect1>strlwr<label id="strlwr"><p>
4525
4526 <quote>
4527 See <tt/strlower/.
4528 </quote>
4529
4530
4531 <sect1>strncat<label id="strncat"><p>
4532
4533 <quote>
4534 <descrip>
4535 <tag/Function/Concatentate two strings.
4536 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4537 <tag/Declaration/<tt/char* __fastcall__ strncat (char* s1, const char* s2, size_t n);/
4538 <tag/Description/The <tt/strncat/ function appends not more than n characters
4539 of the string pointed to by s2 to the end of the string pointed to by s1. The
4540 terminating null character at the end of s1 is overwritten. A terminating null
4541 character is appended to the result, even if not all of s2 is appended to s1.
4542 <tag/Limits/<itemize>
4543 <item>The function is only available as fastcall function, so it may only
4544 be used in presence of a prototype.
4545 <item>If copying takes place between objects that overlap, the behaviour
4546 is undefined.
4547 </itemize>
4548 <tag/Availability/ISO 9899
4549 <tag/See also/
4550 <ref id="strcpy" name="strcpy">,
4551 <ref id="strncat" name="strncat">,
4552 <ref id="strncpy" name="strncpy">
4553 <tag/Example/None.
4554 </descrip>
4555 </quote>
4556
4557
4558 <sect1>strncmp<label id="strncmp"><p>
4559
4560 <quote>
4561 <descrip>
4562 <tag/Function/Compare two strings.
4563 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4564 <tag/Declaration/<tt/int __fastcall__ strncmp (const char* s1, const char* s2, size_t count);/
4565 <tag/Description/The <tt/strncmp/ function compares not more than <tt/count/
4566 characters of the two strings passed as parameters. It returns a value that is
4567 less than zero if the first <tt/count/ characters of <tt/s1/ are less than
4568 <tt/s2/, zero if they are identical, and a value greater than zero they are
4569 greater.
4570 <tag/Limits/<itemize>
4571 <item>The function is only available as fastcall function, so it may only
4572 be used in presence of a prototype.
4573 </itemize>
4574 <tag/Availability/ISO 9899
4575 <tag/See also/
4576 <ref id="strcasecmp" name="strcasecmp">,
4577 <ref id="strcmp" name="strcmp">,
4578 <ref id="strcoll" name="strcoll">,
4579 <ref id="stricmp" name="stricmp">
4580 <ref id="strxfrm" name="strxfrm">
4581 <tag/Example/None.
4582 </descrip>
4583 </quote>
4584
4585
4586 <sect1>strncpy<label id="strncpy"><p>
4587
4588 <quote>
4589 <descrip>
4590 <tag/Function/Copy part of a string.
4591 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4592 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
4593 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
4594 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
4595 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
4596 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
4597 written. The function will always return <tt/s1/.
4598 <tag/Limits/<itemize>
4599 <item>The function is only available as fastcall function, so it may only
4600 be used in presence of a prototype. If there is no null byte in the first <tt/n/
4601 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
4602 <item>If copying takes place between objects that overlap, the behaviour is
4603 undefined.
4604 </itemize>
4605 <tag/Availability/ISO 9899
4606 <tag/See also/
4607 <ref id="strcat" name="strcat">,
4608 <ref id="strcpy" name="strcpy">,
4609 <ref id="strncat" name="strncat">
4610 <tag/Example/
4611 <verb>
4612 #include <string.h>
4613
4614 static char hello[6];
4615
4616 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
4617 hello[5] = '\0';
4618 </verb>
4619 </descrip>
4620 </quote>
4621
4622
4623 <sect1>strrchr<label id="strrchr"><p>
4624
4625 <quote>
4626 <descrip>
4627 <tag/Function/Search for a character in a string.
4628 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4629 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
4630 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
4631 (converted to a char) in the string pointed to by <tt/s/. The terminating null
4632 byte is considered to be part of the string. Upon completion, the function
4633 returns a pointer to the byte, or a null pointer if the byte was not found.
4634 <tag/Limits/<itemize>
4635 <item>The function is only available as fastcall function, so it may only
4636 be used in presence of a prototype.
4637 </itemize>
4638 <tag/Availability/ISO 9899
4639 <tag/See also/
4640 <ref id="strchr" name="strchr">
4641 <tag/Example/None.
4642 </descrip>
4643 </quote>
4644
4645
4646 <sect1>strspn<label id="strspn"><p>
4647
4648 <quote>
4649 <descrip>
4650 <tag/Function/Compute the length of a substring.
4651 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4652 <tag/Declaration/<tt/size_t __fastcall__ strspn (const char* s, const char* set);/
4653 <tag/Description/The <tt/strspn/ function computes and returns the length of
4654 the substring pointed to by <tt/s/ which does consist only of characters
4655 contained in the string <tt/set/.
4656 <tag/Limits/<itemize>
4657 <item>The function is only available as fastcall function, so it may only
4658 be used in presence of a prototype.
4659 </itemize>
4660 <tag/Availability/ISO 9899
4661 <tag/See also/
4662 <ref id="strcspn" name="strcspn">,
4663 <ref id="strstr" name="strstr">
4664 <tag/Example/None.
4665 </descrip>
4666 </quote>
4667
4668
4669 <sect1>strstr<label id="strstr"><p>
4670
4671 <quote>
4672 <descrip>
4673 <tag/Function/Find a substring.
4674 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4675 <tag/Declaration/<tt/char* __fastcall__ strstr (const char* str, const char* substr);/
4676 <tag/Description/<tt/strstr/ searches for the first occurance of the string
4677 <tt/substr/ within <tt/str/. If found, it returns a pointer to the copy,
4678 otherwise it returns <tt/NULL/.
4679 <tag/Limits/<itemize>
4680 <item>The function is only available as fastcall function, so it may only
4681 be used in presence of a prototype.
4682 </itemize>
4683 <tag/Availability/ISO 9899
4684 <tag/See also/
4685 <ref id="strcspn" name="strcspn">,
4686 <ref id="strspn" name="strspn">
4687 <tag/Example/None.
4688 </descrip>
4689 </quote>
4690
4691
4692 <sect1>strtok<label id="strtok"><p>
4693
4694 <quote>
4695 <descrip>
4696 <tag/Function/Break a string into tokens.
4697 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4698 <tag/Declaration/<tt/char* __fastcall__ strtok (char* s1, const char* s2);/
4699 <tag/Description/<tt/strtok/ will break the string s1 into a sequence of
4700 tokens, which are delimited by characters from the string s2. The first call
4701 to <tt/strtok/ will return a pointer to the first token in the string s1.
4702 Following calls must pass a <tt/NULL/ pointer as s1 in order to get the next
4703 token in the string. Different sets of delimiters may be used for the
4704 subsequent calls to <tt/strtok/.
4705 <tag/Limits/<itemize>
4706 <item>The function is only available as fastcall function, so it may only
4707 be used in presence of a prototype.
4708 <item><tt/strtok/ will modify the string s1.
4709 </itemize>
4710 <tag/Availability/ISO 9899
4711 <tag/See also/
4712 <ref id="strcspn" name="strcspn">,
4713 <!-- <ref id="strpbrk" name="strpbrk"> -->
4714 <tag/Example/None.
4715 </descrip>
4716 </quote>
4717
4718
4719 <sect1>strxfrm<label id="strxfrm"><p>
4720
4721 <quote>
4722 <descrip>
4723 <tag/Function/Transform a string.
4724 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4725 <tag/Declaration/<tt/size_t __fastcall__ strxfrm (char* s1, const char* s2, size_t n);/
4726 <tag/Description/The <tt/strxfrm/ function transforms the string pointed to by
4727 s2 and places the resulting string into the string pointed to by s1. The
4728 transformation is such that if the <tt/strcmp/ function is applied to two
4729 transformed strings, it returns a value greater than, equal to, or less than
4730 zero, corresponding to the result of the <tt/strcoll/ function applied to the
4731 same two original strings. No more than n characters are placed into the
4732 resulting array pointed to by s1, including the terminating null character.
4733 <tag/Limits/<itemize>
4734 <item><tt/s1/ and <tt/s2/ must not point to the same memory area, otherwise
4735 the behaviour is undefined.
4736 <item>If <tt/n/ is zero, <tt/s1/ may be a NULL pointer.
4737 <item>The function is only available as fastcall function, so it may only
4738 be used in presence of a prototype.
4739 <item>Since cc65 doesn't support different charcter sets, <tt/strxfrm/ will
4740 just copy s2 to s1 using <tt><ref id="strncpy" name="strncpy"></tt>.
4741 </itemize>
4742 <tag/Availability/ISO 9899
4743 <tag/See also/
4744 <ref id="strcmp" name="strcmp">,
4745 <ref id="strcoll" name="strcoll">,
4746 <ref id="strncpy" name="strncpy">,
4747 <tag/Example/None.
4748 </descrip>
4749 </quote>
4750
4751
4752 <sect1>strupper<label id="strupper"><p>
4753
4754 <quote>
4755 <descrip>
4756 <tag/Function/Make a string upper case.
4757 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4758 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
4759 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
4760 function to each character of a string. The function will always return <tt/s/.
4761 <tag/Limits/<itemize>
4762 <item>The function is only available as fastcall function, so it may only
4763 be used in presence of a prototype.
4764 <item>The function prototype is unavailable when compiling in strict ANSI mode.
4765 <item>An alias name for this function is <tt/strupr/.
4766 </itemize>
4767 <tag/Availability/cc65
4768 <tag/See also/
4769 <ref id="strlower" name="strlower">
4770 <ref id="toupper" name="toupper">
4771 <tag/Example/None.
4772 </descrip>
4773 </quote>
4774
4775
4776 <sect1>strupr<label id="strupr"><p>
4777
4778 <quote>
4779 See <tt/strupper/.
4780 </quote>
4781
4782
4783 <sect1>textcolor<label id="textcolor"><p>
4784
4785 <quote>
4786 <descrip>
4787 <tag/Function/Set the text color.
4788 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4789 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
4790 <tag/Description/The function will set a new text color. It returns the old
4791 (current) text color. Text output using any <tt/conio.h/ function will use
4792 the color set by this function.
4793 <tag/Limits/<itemize>
4794 <item>Text colors are system dependent. The function may have no effect
4795 on systems where the text color cannot be changed.
4796 <item>The function is only available as fastcall function, so it may only
4797 be used in presence of a prototype.
4798 </itemize>
4799 <tag/Availability/cc65
4800 <tag/See also/
4801 <ref id="bgcolor" name="bgcolor">,
4802 <ref id="bordercolor" name="bordercolor">
4803 <tag/Example/None.
4804 </descrip>
4805 </quote>
4806
4807
4808 <sect1>time<label id="time"><p>
4809
4810 <quote>
4811 <descrip>
4812 <tag/Function/Get the time.
4813 <tag/Header/<tt/<ref id="time.h" name="time.h">/
4814 <tag/Declaration/<tt/time_t __fastcall__ time (time_t* t);/
4815 <tag/Description/The function returns the time since the 1970-01-01 00:00:00
4816 measured in seconds. If the pointer <tt/t/ is not <tt/NULL/, the function
4817 result will also be stored there. If no time is available, <tt/(time_t)-1/ is
4818 returned and <tt/errno/ is set to <tt/ENOSYS/.
4819 <tag/Limits/<itemize>
4820 <item>The function is only available as fastcall function, so it may
4821 only be used in presence of a prototype.
4822 <item>Many platforms supported by cc65 do not have a realtime clock, so the
4823 returned value may not be valid.
4824 </itemize>
4825 <tag/Availability/ISO 9899
4826 <tag/Example/None.
4827 </descrip>
4828 </quote>
4829
4830
4831 <sect1>toggle_videomode<label id="toggle_videomode"><p>
4832
4833 <quote>
4834 <descrip>
4835 <tag/Function/Toggle between 40 and 80 column mode.
4836 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
4837 <tag/Declaration/<tt/void toggle_videomode (void);/
4838 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
4839 old mode (cursor position, color and so on) are saved and restored together
4840 with the mode.
4841 <tag/Limits/<itemize>
4842 <item>The function is specific to the C128.
4843 <item>This function is deprecated. Please use <ref id="videomode"
4844 name="videomode"> instead!
4845 </itemize>
4846 <tag/Availability/C128
4847 <tag/See also/
4848 <ref id="fast" name="fast">,
4849 <ref id="slow" name="slow">,
4850 <ref id="videomode" name="videomode">
4851 <tag/Example/None.
4852 </descrip>
4853 </quote>
4854
4855
4856 <sect1>tolower<label id="tolower"><p>
4857
4858 <quote>
4859 <descrip>
4860 <tag/Function/Convert a character into its lower case representation.
4861 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4862 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
4863 <tag/Description/The function returns the given character converted to lower
4864 case. If the given character is not a letter, it is returned unchanged.
4865 <tag/Limits/<itemize>
4866 <item>The function is only available as fastcall function, so it may
4867 only be used in presence of a prototype.
4868 </itemize>
4869 <tag/Availability/ISO 9899
4870 <tag/See also/
4871 <ref id="islower" name="islower">,
4872 <ref id="isupper" name="isupper">,
4873 <ref id="toupper" name="toupper">
4874 <tag/Example/None.
4875 </descrip>
4876 </quote>
4877
4878
4879 <sect1>toupper<label id="toupper"><p>
4880
4881 <quote>
4882 <descrip>
4883 <tag/Function/Convert a character into its upper case representation.
4884 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4885 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
4886 <tag/Description/The function returns the given character converted to upper
4887 case. If the given character is not a letter, it is returned unchanged.
4888 <tag/Limits/<itemize>
4889 <item>The function is only available as fastcall function, so it may
4890 only be used in presence of a prototype.
4891 </itemize>
4892 <tag/Availability/ISO 9899
4893 <tag/See also/
4894 <ref id="islower" name="islower">,
4895 <ref id="isupper" name="isupper">,
4896 <ref id="tolower" name="tolower">
4897 <tag/Example/None.
4898 </descrip>
4899 </quote>
4900
4901
4902 <sect1>ultoa<label id="ultoa"><p>
4903
4904 <quote>
4905 <descrip>
4906 <tag/Function/Convert an unsigned long integer into a string.
4907 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4908 <tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
4909 <tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
4910 string using <tt/radix/ as the base.
4911 <tag/Limits/<itemize>
4912 <item>There are no provisions to prevent a buffer overflow.
4913 <item>The function is non standard, so it is not available in strict ANSI mode.
4914 You should probably use <tt/sprintf/ instead.
4915 <item>The function is only available as fastcall function, so it may only be
4916 used in presence of a prototype.
4917 </itemize>
4918 <tag/Availability/cc65
4919 <tag/See also/
4920 <ref id="atoi" name="atoi">,
4921 <ref id="atol" name="atol">,
4922 <ref id="itoa" name="itoa">,
4923 <ref id="ltoa" name="ltoa">,
4924 <ref id="utoa" name="utoa">
4925 <tag/Example/None.
4926 </descrip>
4927 </quote>
4928
4929
4930 <sect1>unlink<label id="unlink"><p>
4931
4932 <quote>
4933 <descrip>
4934 <tag/Function/Delete a file.
4935 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
4936 <tag/Declaration/<tt/int __fastcall__ unlink (const char* name);/
4937 <tag/Description/<tt/unlink/ deletes the file with the given name. On success,
4938 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
4939 code describing the reason for the failure.
4940 <tag/Limits/
4941 <itemize>
4942 <item>The use of this function is discouraged. Please use <tt/<ref id="remove"
4943 name="remove">/ instead, which is a native ANSI C function and does the same.
4944 <item>This function is not available on all cc65 targets (depends on the
4945 availability of file I/O).
4946 <item>The function is only available as fastcall function, so it may only
4947 be used in presence of a prototype.
4948 <item>Instead of <tt/unlink/, <tt/<ref id="remove" name="remove">/ should be
4949 used, which has the same semantics, but is more portable, because it conforms
4950 to the ISO C standard.
4951 </itemize>
4952 <tag/Availability/POSIX 1003.1
4953 <tag/See also/
4954 <ref id="remove" name="remove">
4955 <tag/Example/
4956 <verb>
4957 #include &lt;stdio.h&gt;
4958 #include &lt;unistd.h&gt;
4959
4960 #define FILENAME "helloworld"
4961
4962 if (unlink (FILENAME) == 0) {
4963     printf ("We deleted %s successfully\n", FILENAME);
4964 } else {
4965     printf ("There was a problem deleting %s\n", FILENAME);
4966 }
4967 </verb>
4968 </descrip>
4969 </quote>
4970
4971
4972 <sect1>utoa<label id="utoa"><p>
4973
4974 <quote>
4975 <descrip>
4976 <tag/Function/Convert an unsigned integer into a string.
4977 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4978 <tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
4979 <tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
4980 using <tt/radix/ as the base.
4981 <tag/Limits/<itemize>
4982 <item>There are no provisions to prevent a buffer overflow.
4983 <item>The function is non standard, so it is not available in strict ANSI mode.
4984 You should probably use <tt/sprintf/ instead.
4985 <item>The function is only available as fastcall function, so it may only be
4986 used in presence of a prototype.
4987 </itemize>
4988 <tag/Availability/cc65
4989 <tag/See also/
4990 <ref id="atoi" name="atoi">,
4991 <ref id="atol" name="atol">,
4992 <ref id="itoa" name="itoa">,
4993 <ref id="ltoa" name="ltoa">,
4994 <ref id="ultoa" name="ultoa">
4995 <tag/Example/None.
4996 </descrip>
4997 </quote>
4998
4999
5000 <sect1>vcprintf<label id="vcprintf"><p>
5001
5002 <quote>
5003 <descrip>
5004 <tag/Function/Formatted output to the console.
5005 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
5006 <tag/Declaration/<tt/int __fastcall__ vcprintf (const char* format, va_list ap);/
5007 <tag/Description/The arguments specified as a <tt/va_list/ are converted to
5008 text where necessary and formatted according to the format string given. The
5009 resulting string is output to the console. <tt/vcprintf/ supports the same
5010 format specifiers as <tt/vprintf/. <!-- <tt/<ref id="vprintf" name="vprintf">/. -->
5011 <tag/Limits/<itemize>
5012 <item>Like all other <tt/conio/ output functions, <tt/vcprintf/ distinguishes
5013 between <tt/\r/ and <tt/\n/.
5014 <item>The function is only available as fastcall function, so it may only be
5015 used in presence of a prototype.
5016 </itemize>
5017 <tag/Availability/cc65
5018 <tag/See also/
5019 <ref id="cprintf" name="cprintf">,
5020 <ref id="cputc" name="cputc">,
5021 <ref id="cputcxy" name="cputcxy">,
5022 <ref id="cputs" name="cputs">,
5023 <ref id="cputsxy" name="cputsxy">
5024 <tag/Example/None.
5025 </descrip>
5026 </quote>
5027
5028
5029 <sect1>videomode<label id="videomode"><p>
5030
5031 <quote>
5032 <descrip>
5033 <tag/Function/Switch to either 40 or 80 column mode.
5034 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
5035 <tag/Declaration/<tt/unsigned char __fastcall__ videomode (unsigned char Mode);/
5036 <tag/Description/Switch to 40 or 80 column mode depending on the argument. If
5037 the requested mode is already active, nothing happens. The old mode is returned
5038 from the call.
5039 <tag/Limits/<itemize>
5040 <item>The function is specific to the C128.
5041 <item>This function is replaces <ref id="toggle_videomode"
5042 name="toggle_videomode">.
5043 <item>The function is only available as fastcall function, so it may only be
5044 used in presence of a prototype.
5045 </itemize>
5046 <tag/Availability/C128
5047 <tag/See also/
5048 <ref id="fast" name="fast">,
5049 <ref id="slow" name="slow">,
5050 <ref id="toggle_videomode" name="toggle_videomode">
5051 <tag/Example/None.
5052 </descrip>
5053 </quote>
5054
5055
5056 <sect1>wherex<label id="wherex"><p>
5057
5058 <quote>
5059 <descrip>
5060 <tag/Function/Return the current X position of the text mode cursor.
5061 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
5062 <tag/Declaration/<tt/unsigned char wherex (void);/
5063 <tag/Description/The function returns the current X position of the text mode
5064 cursor. Zero is returned for the leftmost screen position.
5065 <tag/Availability/cc65
5066 <tag/See also/
5067 <ref id="gotox" name="gotox">,
5068 <ref id="gotoy" name="gotoy">,
5069 <ref id="gotoxy" name="gotoxy">,
5070 <ref id="wherey" name="wherey">
5071 <tag/Example/None.
5072 </descrip>
5073 </quote>
5074
5075
5076 <sect1>wherey<label id="wherey"><p>
5077
5078 <quote>
5079 <descrip>
5080 <tag/Function/Return the current Y position of the text mode cursor.
5081 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
5082 <tag/Declaration/<tt/unsigned char wherey (void);/
5083 <tag/Description/The function returns the current Y position of the text mode
5084 cursor. Zero is returned for the uppermost screen position.
5085 <tag/Availability/cc65
5086 <tag/See also/
5087 <ref id="gotox" name="gotox">,
5088 <ref id="gotoy" name="gotoy">,
5089 <ref id="gotoxy" name="gotoxy">,
5090 <ref id="wherex" name="wherex">
5091 <tag/Example/None.
5092 </descrip>
5093 </quote>
5094
5095
5096 </article>