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