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