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