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