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