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