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