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