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