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