]> git.sur5r.net Git - cc65/blob - doc/funcref.sgml
Fixed the order of some functions.
[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_scpu_speed<label id="get_scpu_speed"><p>
3686
3687 <quote>
3688 <descrip>
3689 <tag/Function/Get the current speed of the C64/C128 SuperCPU cartridge.
3690 <tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
3691 <tag/Declaration/<tt/unsigned char get_scpu_speed (void);/
3692 <tag/Description/The function returns the current speed of the SuperCPU cartridge.
3693 <tag/Notes/<itemize>
3694 <item>The function is specific to the C128 and C64.
3695 <item>The function does not check for the presence of the 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_scpu" name="detect_scpu">,
3701 <ref id="set_scpu_speed" name="set_scpu_speed">,
3702 <tag/Example/None.
3703 </descrip>
3704 </quote>
3705
3706
3707 <sect1>get_turbomaster_speed<label id="get_turbomaster_speed"><p>
3708
3709 <quote>
3710 <descrip>
3711 <tag/Function/Get the current speed of the C64 Turbo Master cartridge.
3712 <tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
3713 <tag/Declaration/<tt/unsigned char get_turbomaster_speed (void);/
3714 <tag/Description/The function returns the current speed of the C64 Turbo Master cartridge.
3715 <tag/Notes/<itemize>
3716 <item>The function is specific to the C64.
3717 <item>The function does not check for the presence of the C64 Turbo Master 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_turbomaster" name="detect_turbomaster">,
3723 <ref id="set_turbomaster_speed" name="set_turbomaster_speed">,
3724 <tag/Example/None.
3725 </descrip>
3726 </quote>
3727
3728 <sect1>getcpu<label id="getcpu"><p>
3729
3730 <quote>
3731 <descrip>
3732 <tag/Function/Determine on which CPU the program is running.
3733 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
3734 <tag/Declaration/<tt/unsigned char getcpu (void);/
3735 <tag/Description/The function checks on which CPU the code is running. It
3736 returns one of the constants<itemize>
3737 <item><tt/CPU_6502/
3738 <item><tt/CPU_65C02/
3739 <item><tt/CPU_65816/
3740 <item><tt/CPU_4510/
3741 <item><tt/CPU_65SC02/
3742 <item><tt/CPU_65CE02/
3743 <item><tt/CPU_HUC6280/
3744 <item><tt/CPU_2A0x/
3745 </itemize>
3746 <tag/Notes/<itemize>
3747 <item>Other, more exotic CPU types are not disinguished.
3748 </itemize>
3749 <tag/Availability/cc65
3750 <tag/Example/None.
3751 </descrip>
3752 </quote>
3753
3754
3755 <sect1>getcurrentdevice<label id="getcurrentdevice"><p>
3756
3757 <quote>
3758 <descrip>
3759 <tag/Function/Get current device.
3760 <tag/Header/<tt/<ref id="device.h" name="device.h">/
3761 <tag/Declaration/<tt/unsigned char getcurrentdevice (void);/
3762 <tag/Description/The function returns the current device.
3763 It allows to access the current device with the <ref id="dio.h"
3764 name="Low-level disk I/O API"> or <ref id="cbm.h" name="cbm_* I/O
3765 functions"> requiring a 'device' parameter.
3766 <tag/Availability/cc65
3767 <tag/See also/
3768 <ref id="getdevicedir" name="getdevicedir">,
3769 <ref id="getfirstdevice" name="getfirstdevice">,
3770 <ref id="getnextdevice" name="getnextdevice">
3771 <tag/Example/<verb>
3772 dio_open (getcurrentdevice ());
3773 </verb>
3774 </descrip>
3775 </quote>
3776
3777
3778 <sect1>getcwd<label id="getcwd"><p>
3779
3780 <quote>
3781 <descrip>
3782 <tag/Function/Get current working directory.
3783 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
3784 <tag/Declaration/<tt/char* __fastcall__ getcwd (char* buf, size_t size);/
3785 <tag/Description/The function will return the current working directory.
3786 <tag/Notes/<itemize>
3787 <item>The function is only available as fastcall function, so it may only
3788 be used in presence of a prototype.
3789 </itemize>
3790 <tag/Availability/POSIX 1003.1
3791 <tag/Example/None.
3792 </descrip>
3793 </quote>
3794
3795
3796 <sect1>getdevicedir<label id="getdevicedir"><p>
3797
3798 <quote>
3799 <descrip>
3800 <tag/Function/Get device directory.
3801 <tag/Header/<tt/<ref id="device.h" name="device.h">/
3802 <tag/Declaration/<tt/char* __fastcall__ getdevicedir (unsigned char device, char* buf, size_t size);/
3803 <tag/Description/The function returns the directory representing <tt/device/.
3804 It allows to access the device on filesystem level by calling chdir() with
3805 the directory returned.
3806 <tag/Notes/<itemize>
3807 <item>Calling getdevicedir() <em/does/ check for a (formatted) disk in a
3808 floppy-disk-type device and returns NULL if that check fails.
3809 <item>The function is only available as fastcall function, so it may only
3810 be used in presence of a prototype.
3811 </itemize>
3812 <tag/Availability/cc65
3813 <tag/See also/
3814 <ref id="getcwd" name="getcwd">,
3815 <ref id="getcurrentdevice" name="getcurrentdevice">,
3816 <ref id="getfirstdevice" name="getfirstdevice">,
3817 <ref id="getnextdevice" name="getnextdevice">
3818 <tag/Example/<verb>
3819 chdir (getdevicedir (device, buf, sizeof buf));
3820 </verb>
3821 cf. <tt/samples/enumdevdir.c/
3822 </descrip>
3823 </quote>
3824
3825
3826 <sect1>getenv<label id="getenv"><p>
3827
3828 <quote>
3829 <descrip>
3830 <tag/Function/Return a value from the environment.
3831 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3832 <tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
3833 <tag/Description/The function searches the environment for an entry that
3834 matches <tt/name/ and returns its value. The environment consists of a list
3835 of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
3836 returns <tt/NULL/.
3837 <tag/Notes/<itemize>
3838 <item>What exactly is stored in the environment depends on the machine the
3839 program is running on.
3840 <item>The function is only available as fastcall function, so it may only
3841 be used in presence of a prototype.
3842 </itemize>
3843 <tag/Availability/ISO 9899
3844 <tag/Example/None.
3845 </descrip>
3846 </quote>
3847
3848
3849 <sect1>getfirstdevice<label id="getfirstdevice"><p>
3850
3851 <quote>
3852 <descrip>
3853 <tag/Function/Get first device.
3854 <tag/Header/<tt/<ref id="device.h" name="device.h">/
3855 <tag/Declaration/<tt/unsigned char getfirstdevice (void);/
3856 <tag/Description/The function returns the first device.
3857 The constant <tt/INVALID_DEVICE/ indicates no device.
3858 <tag/Notes/<itemize>
3859 <item>Calling getfirstdevice() does <em/not/ turn on the motor of a
3860 drive-type device and does <em/not/ check for a disk in the drive.
3861 </itemize>
3862 <tag/Availability/cc65
3863 <tag/See also/
3864 <ref id="getcurrentdevice" name="getcurrentdevice">,
3865 <ref id="getdevicedir" name="getdevicedir">,
3866 <ref id="getnextdevice" name="getnextdevice">
3867 <tag/Example/<verb>
3868 unsigned char dev = getfirstdevice ();
3869 while (dev != INVALID_DEVICE) {
3870         printf ("%d\n", dev);
3871         dev = getnextdevice (dev);
3872         }
3873 </verb>
3874 </descrip>
3875 </quote>
3876
3877
3878 <sect1>getnextdevice<label id="getnextdevice"><p>
3879
3880 <quote>
3881 <descrip>
3882 <tag/Function/Get next device.
3883 <tag/Header/<tt/<ref id="device.h" name="device.h">/
3884 <tag/Declaration/<tt/unsigned char __fastcall__ getnextdevice (unsigned char device);/
3885 <tag/Description/The function returns the next device after <tt/device/.
3886 The constant <tt/INVALID_DEVICE/ indicates no further device.
3887 <tag/Notes/<itemize>
3888 <item>Calling getnextdevice() does <em/not/ turn on the motor of a
3889 drive-type device and does <em/not/ check for a disk in the drive.
3890 <item>The function is only available as fastcall function, so it may only
3891 be used in presence of a prototype.
3892 </itemize>
3893 <tag/Availability/cc65
3894 <tag/See also/
3895 <ref id="getcurrentdevice" name="getcurrentdevice">,
3896 <ref id="getdevicedir" name="getdevicedir">,
3897 <ref id="getfirstdevice" name="getfirstdevice">
3898 <tag/Example/<verb>
3899 unsigned char dev = getfirstdevice ();
3900 while (dev != INVALID_DEVICE) {
3901         printf ("%d\n", dev);
3902         dev = getnextdevice (dev);
3903         }
3904 </verb>
3905 </descrip>
3906 </quote>
3907
3908
3909 <sect1>getopt<label id="getopt"><p>
3910
3911 <quote>
3912 <descrip>
3913 <tag/Function/Parse command line options.
3914 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
3915 <tag/Declaration/<tt/int __fastcall__ getopt (int argc, char* const* argv,
3916 const char* optstring);/
3917 <tag/Description/The function parses command line arguments, <tt/argc/ and
3918 <tt/argv/ are the argument count and array passed to <tt/main/. <tt/optstring/
3919 is a string that contains command line option characters. If a character in
3920 <tt/optstring/ is followed by a colon, the option requires an argument. An
3921 option on the command line is recognized if it is one of the option characters
3922 preceeded by a '-'.
3923 <tt/getopt/ must be called repeatedly. It will return each option character
3924 found on the command line and <tt/EOF/ (-1) if there is no other option. An
3925 option argument is placed in <tt/optarg/, the index of the next element on the
3926 command line to be processed is placed in <tt/optind/.
3927 <tag/Notes/<itemize>
3928 <item>The implementation will not reorder options. A non option on the command
3929 line will terminate option processing. All remaining arguments are not
3930 recognized as options, even if the start with a '-' character.
3931 <item>The function is only available as fastcall function, so it may only
3932 be used in presence of a prototype.
3933 </itemize>
3934 <tag/Availability/POSIX.2
3935 <tag/Example/None.
3936 </descrip>
3937 </quote>
3938
3939
3940 <sect1>gotox<label id="gotox"><p>
3941
3942 <quote>
3943 <descrip>
3944 <tag/Function/Move the text mode cursor to a new X position.
3945 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3946 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
3947 <tag/Description/The function moves the text mode cursor to the specified X
3948 position while leaving the Y position untouched. The leftmost position on the
3949 screen has the coordinate 0.
3950 <tag/Notes/<itemize>
3951 <item>The function is only available as fastcall function, so it may
3952 only be used in presence of a prototype.
3953 <item>Invalid values for the X position (out of screen coordinates) may
3954 lead to undefined behaviour.
3955 </itemize>
3956 <tag/Availability/cc65
3957 <tag/See also/
3958 <ref id="gotoy" name="gotoy">,
3959 <ref id="gotoxy" name="gotoxy">,
3960 <ref id="wherex" name="wherex">,
3961 <ref id="wherey" name="wherey">
3962 <tag/Example/None.
3963 </descrip>
3964 </quote>
3965
3966
3967 <sect1>gotoxy<label id="gotoxy"><p>
3968
3969 <quote>
3970 <descrip>
3971 <tag/Function/Move the text mode cursor to a new position.
3972 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3973 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
3974 <tag/Description/The function moves the text mode cursor to the specified
3975 position. The leftmost position on the screen has the X coordinate 0, the
3976 topmost line has the Y coordinate 0.
3977 <tag/Notes/<itemize>
3978 <item>The function is only available as fastcall function, so it may only be
3979 used in presence of a prototype.
3980 <item>Invalid values for any of both coordinates (out of screen positions) may
3981 lead to undefined behaviour.
3982 </itemize>
3983 <tag/Availability/cc65
3984 <tag/See also/
3985 <ref id="gotox" name="gotox">,
3986 <ref id="gotoy" name="gotoy">,
3987 <ref id="wherex" name="wherex">,
3988 <ref id="wherey" name="wherey">
3989 <tag/Example/None.
3990 </descrip>
3991 </quote>
3992
3993
3994 <sect1>gotoy<label id="gotoy"><p>
3995
3996 <quote>
3997 <descrip>
3998 <tag/Function/Move the text mode cursor to a new Y position.
3999 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4000 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
4001 <tag/Description/The function moves the text mode cursor to the specified Y
4002 position while leaving the X position untouched. The uppermost position on the
4003 screen has the coordinate 0.
4004 <tag/Notes/<itemize>
4005 <item>The function is only available as fastcall function, so it may
4006 only be used in presence of a prototype.
4007 <item>Invalid values for the Y position (out of screen coordinates) may lead
4008 to undefined behaviour.
4009 </itemize>
4010 <tag/Availability/cc65
4011 <tag/See also/
4012 <ref id="gotox" name="gotox">,
4013 <ref id="gotoxy" name="gotoxy">,
4014 <ref id="wherex" name="wherex">,
4015 <ref id="wherey" name="wherey">
4016 <tag/Example/None.
4017 </descrip>
4018 </quote>
4019
4020
4021 <sect1>isalnum<label id="isalnum"><p>
4022
4023 <quote>
4024 <descrip>
4025 <tag/Function/Check if a given character is a letter or digit.
4026 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4027 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
4028 <tag/Description/The function returns a non zero value if the given argument
4029 is a letter or digit. The return value is zero if the character is anything
4030 else.
4031 <tag/Notes/<itemize>
4032 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4033 inline sequence generated by the macro will not work correctly for values
4034 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4035 this range. The non inline function may be accessed by <tt/#undef/'ing
4036 the macro.
4037 <item>When compiling without <tt/-Os/, the function is only available as
4038 fastcall function, so it may only be used in presence of a prototype.
4039 </itemize>
4040 <tag/Availability/ISO 9899
4041 <tag/See also/
4042 <ref id="isalpha" name="isalpha">,
4043 <ref id="isascii" name="isascii">,
4044 <ref id="isblank" name="isblank">,
4045 <ref id="iscntrl" name="iscntrl">,
4046 <ref id="isdigit" name="isdigit">,
4047 <ref id="isgraph" name="isgraph">,
4048 <ref id="islower" name="islower">,
4049 <ref id="isprint" name="isprint">,
4050 <ref id="ispunct" name="ispunct">,
4051 <ref id="isspace" name="isspace">,
4052 <ref id="isupper" name="isupper">,
4053 <ref id="isxdigit" name="isxdigit">
4054 <tag/Example/None.
4055 </descrip>
4056 </quote>
4057
4058
4059 <sect1>isalpha<label id="isalpha"><p>
4060
4061 <quote>
4062 <descrip>
4063 <tag/Function/Check if a given character is a letter.
4064 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4065 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
4066 <tag/Description/The function returns a non zero value if the given argument
4067 is a letter. The return value is zero if the character is anything else.
4068 <tag/Notes/<itemize>
4069 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4070 inline sequence generated by the macro will not work correctly for values
4071 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4072 this range. The non inline function may be accessed by <tt/#undef/'ing the
4073 macro.
4074 <item>When compiling without <tt/-Os/, the function is only available as
4075 fastcall function, so it may only be used in presence of a prototype.
4076 </itemize>
4077 <tag/Availability/ISO 9899
4078 <tag/See also/
4079 <ref id="isalnum" name="isalnum">,
4080 <ref id="isascii" name="isascii">,
4081 <ref id="isblank" name="isblank">,
4082 <ref id="iscntrl" name="iscntrl">,
4083 <ref id="isdigit" name="isdigit">,
4084 <ref id="isgraph" name="isgraph">,
4085 <ref id="islower" name="islower">,
4086 <ref id="isprint" name="isprint">,
4087 <ref id="ispunct" name="ispunct">,
4088 <ref id="isspace" name="isspace">,
4089 <ref id="isupper" name="isupper">,
4090 <ref id="isxdigit" name="isxdigit">
4091 <tag/Example/None.
4092 </descrip>
4093 </quote>
4094
4095
4096 <sect1>isascii<label id="isascii"><p>
4097
4098 <quote>
4099 <descrip>
4100 <tag/Function/Check if a given character is in the ASCII (0..127) range.
4101 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4102 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
4103 <tag/Description/The function returns a non zero value if the given argument
4104 is in the range 0..127 (the range of valid ASCII characters) and zero if not.
4105 <tag/Notes/<itemize>
4106 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4107 inline sequence generated by the macro will not work correctly for values
4108 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4109 this range. The non inline function may be accessed by <tt/#undef/'ing the
4110 macro.
4111 <item>When compiling without <tt/-Os/, the function is only available as
4112 fastcall function, so it may only be used in presence of a prototype.
4113 </itemize>
4114 <tag/Availability/ISO 9899
4115 <tag/See also/
4116 <ref id="isalnum" name="isalnum">,
4117 <ref id="isalpha" name="isalpha">,
4118 <ref id="isblank" name="isblank">,
4119 <ref id="iscntrl" name="iscntrl">,
4120 <ref id="isdigit" name="isdigit">,
4121 <ref id="isgraph" name="isgraph">,
4122 <ref id="islower" name="islower">,
4123 <ref id="isprint" name="isprint">,
4124 <ref id="ispunct" name="ispunct">,
4125 <ref id="isspace" name="isspace">,
4126 <ref id="isupper" name="isupper">,
4127 <ref id="isxdigit" name="isxdigit">
4128 <tag/Example/None.
4129 </descrip>
4130 </quote>
4131
4132
4133 <sect1>isblank<label id="isblank"><p>
4134
4135 <quote>
4136 <descrip>
4137 <tag/Function/Check if a given character is a space or tab.
4138 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4139 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
4140 <tag/Description/The function returns a non zero value if the given argument
4141 is a space or tab character. The return value is zero if the character is
4142 anything else.
4143 <tag/Notes/<itemize>
4144 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4145 inline sequence generated by the macro will not work correctly for values
4146 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4147 this range. The non inline function may be accessed by <tt/#undef/'ing the
4148 macro.
4149 <item>When compiling without <tt/-Os/, the function is only available as
4150 fastcall function, so it may only be used in presence of a prototype.
4151 </itemize>
4152 <tag/Availability/ISO 9899
4153 <tag/See also/
4154 <ref id="isalnum" name="isalnum">,
4155 <ref id="isalpha" name="isalpha">,
4156 <ref id="isascii" name="isascii">,
4157 <ref id="iscntrl" name="iscntrl">,
4158 <ref id="isdigit" name="isdigit">,
4159 <ref id="isgraph" name="isgraph">,
4160 <ref id="islower" name="islower">,
4161 <ref id="isprint" name="isprint">,
4162 <ref id="ispunct" name="ispunct">,
4163 <ref id="isspace" name="isspace">,
4164 <ref id="isupper" name="isupper">,
4165 <ref id="isxdigit" name="isxdigit">
4166 <tag/Example/None.
4167 </descrip>
4168 </quote>
4169
4170
4171 <sect1>iscntrl<label id="iscntrl"><p>
4172
4173 <quote>
4174 <descrip>
4175 <tag/Function/Check if a given character is a control character.
4176 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4177 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
4178 <tag/Description/The function returns a non zero value if the given argument
4179 is a control character. The return value is zero if the character is anything
4180 else.
4181 <tag/Notes/<itemize>
4182 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4183 inline sequence generated by the macro will not work correctly for values
4184 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4185 this range. The non inline function may be accessed by <tt/#undef/'ing the
4186 macro.
4187 <item>When compiling without <tt/-Os/, the function is only available as
4188 fastcall function, so it may only be used in presence of a prototype.
4189 </itemize>
4190 <tag/Availability/ISO 9899
4191 <tag/See also/
4192 <ref id="isalnum" name="isalnum">,
4193 <ref id="isalpha" name="isalpha">,
4194 <ref id="isascii" name="isascii">,
4195 <ref id="isblank" name="isblank">,
4196 <ref id="isdigit" name="isdigit">,
4197 <ref id="isgraph" name="isgraph">,
4198 <ref id="islower" name="islower">,
4199 <ref id="isprint" name="isprint">,
4200 <ref id="ispunct" name="ispunct">,
4201 <ref id="isspace" name="isspace">,
4202 <ref id="isupper" name="isupper">,
4203 <ref id="isxdigit" name="isxdigit">
4204 <tag/Example/None.
4205 </descrip>
4206 </quote>
4207
4208
4209 <sect1>isdigit<label id="isdigit"><p>
4210
4211 <quote>
4212 <descrip>
4213 <tag/Function/Check if a given character is a digit.
4214 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4215 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
4216 <tag/Description/The function returns a non zero value if the given argument
4217 is a digit. The return value is zero if the character is anything else.
4218 <tag/Notes/<itemize>
4219 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4220 inline sequence generated by the macro will not work correctly for values
4221 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4222 this range. The non inline function may be accessed by <tt/#undef/'ing the
4223 macro.
4224 <item>When compiling without <tt/-Os/, the function is only available as
4225 fastcall function, so it may only be used in presence of a prototype.
4226 </itemize>
4227 <tag/Availability/ISO 9899
4228 <tag/See also/
4229 <ref id="isalnum" name="isalnum">,
4230 <ref id="isalpha" name="isalpha">,
4231 <ref id="isascii" name="isascii">,
4232 <ref id="isblank" name="isblank">,
4233 <ref id="iscntrl" name="iscntrl">,
4234 <ref id="isgraph" name="isgraph">,
4235 <ref id="islower" name="islower">,
4236 <ref id="isprint" name="isprint">,
4237 <ref id="ispunct" name="ispunct">,
4238 <ref id="isspace" name="isspace">,
4239 <ref id="isupper" name="isupper">,
4240 <ref id="isxdigit" name="isxdigit">
4241 <tag/Example/None.
4242 </descrip>
4243 </quote>
4244
4245
4246 <sect1>isfast<label id="isfast"><p>
4247
4248 <quote>
4249 <descrip>
4250 <tag/Function/Check if the CPU is in fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
4251 <tag/Header/<tt/<ref id="c128.h" name="c128.h">,
4252 <ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
4253 <tag/Declaration/<tt/unsigned char isfast (void);/
4254 <tag/Description/The function returns a 1 if the CPU is in fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
4255 <tag/Notes/<itemize>
4256 <item>The function is specific to the C128, C16 and Plus4.
4257 </itemize>
4258 <tag/Availability/cc65 (not all platforms)
4259 <tag/See also/
4260 <ref id="fast" name="fast">,
4261 <ref id="slow" name="slow">,
4262 <tag/Example/None.
4263 </descrip>
4264 </quote>
4265
4266
4267 <sect1>isgraph<label id="isgraph"><p>
4268
4269 <quote>
4270 <descrip>
4271 <tag/Function/Check if a given character is a printable character (except
4272 space).
4273 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4274 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
4275 <tag/Description/The function returns a non zero value if the given argument
4276 is a printable character with the exception of space. The return value is zero
4277 if the character is anything else.
4278 <tag/Notes/<itemize>
4279 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4280 inline sequence generated by the macro will not work correctly for values
4281 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4282 this range. The non inline function may be accessed by <tt/#undef/'ing the
4283 macro.
4284 <item>When compiling without <tt/-Os/, the function is only available as
4285 fastcall function, so it may only be used in presence of a prototype.
4286 </itemize>
4287 <tag/Availability/ISO 9899
4288 <tag/See also/
4289 <ref id="isalnum" name="isalnum">,
4290 <ref id="isalpha" name="isalpha">,
4291 <ref id="isascii" name="isascii">,
4292 <ref id="isblank" name="isblank">,
4293 <ref id="iscntrl" name="iscntrl">,
4294 <ref id="isdigit" name="isdigit">,
4295 <ref id="islower" name="islower">,
4296 <ref id="isprint" name="isprint">,
4297 <ref id="ispunct" name="ispunct">,
4298 <ref id="isspace" name="isspace">,
4299 <ref id="isupper" name="isupper">,
4300 <ref id="isxdigit" name="isxdigit">
4301 <tag/Example/None.
4302 </descrip>
4303 </quote>
4304
4305
4306 <sect1>islower<label id="islower"><p>
4307
4308 <quote>
4309 <descrip>
4310 <tag/Function/Check if a given character is a lower case letter.
4311 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4312 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
4313 <tag/Description/The function returns a non zero value if the given argument
4314 is a lower case letter. The return value is zero if the character is anything
4315 else.
4316 <tag/Notes/<itemize>
4317 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4318 inline sequence generated by the macro will not work correctly for values
4319 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4320 this range. The non inline function may be accessed by <tt/#undef/'ing the
4321 macro.
4322 <item>When compiling without <tt/-Os/, the function is only available as
4323 fastcall function, so it may only be used in presence of a prototype.
4324 </itemize>
4325 <tag/Availability/ISO 9899
4326 <tag/See also/
4327 <ref id="isalnum" name="isalnum">,
4328 <ref id="isalpha" name="isalpha">,
4329 <ref id="isascii" name="isascii">,
4330 <ref id="isblank" name="isblank">,
4331 <ref id="iscntrl" name="iscntrl">,
4332 <ref id="isdigit" name="isdigit">,
4333 <ref id="isgraph" name="isgraph">,
4334 <ref id="isprint" name="isprint">,
4335 <ref id="ispunct" name="ispunct">,
4336 <ref id="isspace" name="isspace">,
4337 <ref id="isupper" name="isupper">,
4338 <ref id="isxdigit" name="isxdigit">
4339 <tag/Example/None.
4340 </descrip>
4341 </quote>
4342
4343
4344 <sect1>isprint<label id="isprint"><p>
4345
4346 <quote>
4347 <descrip>
4348 <tag/Function/Check if a given character is a printable character.
4349 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4350 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
4351 <tag/Description/The function returns a non zero value if the given argument
4352 is a printable character (this includes the space character). The return value
4353 is zero if the character is anything else.
4354 <tag/Notes/<itemize>
4355 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4356 inline sequence generated by the macro will not work correctly for values
4357 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4358 this range. The non inline function may be accessed by <tt/#undef/'ing the
4359 macro.
4360 <item>When compiling without <tt/-Os/, the function is only available as
4361 fastcall function, so it may only be used in presence of a prototype.
4362 </itemize>
4363 <tag/Availability/ISO 9899
4364 <tag/See also/
4365 <ref id="isalnum" name="isalnum">,
4366 <ref id="isalpha" name="isalpha">,
4367 <ref id="isascii" name="isascii">,
4368 <ref id="isblank" name="isblank">,
4369 <ref id="iscntrl" name="iscntrl">,
4370 <ref id="isdigit" name="isdigit">,
4371 <ref id="isgraph" name="isgraph">,
4372 <ref id="islower" name="islower">,
4373 <ref id="ispunct" name="ispunct">,
4374 <ref id="isspace" name="isspace">,
4375 <ref id="isupper" name="isupper">,
4376 <ref id="isxdigit" name="isxdigit">
4377 <tag/Example/None.
4378 </descrip>
4379 </quote>
4380
4381
4382 <sect1>ispunct<label id="ispunct"><p>
4383
4384 <quote>
4385 <descrip>
4386 <tag/Function/Check if a given character is a printable character but not a
4387 space or an alphanumeric character.
4388 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4389 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
4390 <tag/Description/The function returns a non zero value if the given argument
4391 is a printable character, but not a space or anything alphanumeric. The return
4392 value is zero if the character is anything else.
4393 <tag/Notes/<itemize>
4394 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4395 inline sequence generated by the macro will not work correctly for values
4396 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4397 this range. The non inline function may be accessed by <tt/#undef/'ing the
4398 macro.
4399 <item>When compiling without <tt/-Os/, the function is only available as
4400 fastcall function, so it may only be used in presence of a prototype.
4401 </itemize>
4402 <tag/Availability/ISO 9899
4403 <tag/See also/
4404 <ref id="isalnum" name="isalnum">,
4405 <ref id="isalpha" name="isalpha">,
4406 <ref id="isascii" name="isascii">,
4407 <ref id="isblank" name="isblank">,
4408 <ref id="iscntrl" name="iscntrl">,
4409 <ref id="isdigit" name="isdigit">,
4410 <ref id="isgraph" name="isgraph">,
4411 <ref id="islower" name="islower">,
4412 <ref id="isprint" name="isprint">,
4413 <ref id="isspace" name="isspace">,
4414 <ref id="isupper" name="isupper">,
4415 <ref id="isxdigit" name="isxdigit">
4416 <tag/Example/None.
4417 </descrip>
4418 </quote>
4419
4420
4421 <sect1>isspace<label id="isspace"><p>
4422
4423 <quote>
4424 <descrip>
4425 <tag/Function/Check if a given character is a white-space character.
4426 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4427 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
4428 <tag/Description/The function returns a non zero value if the given argument
4429 is a white space character. The return value is zero if the character is
4430 anything else. The standard white space characters are: space, formfeed ('\f'),
4431 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
4432 ('\v').
4433 <tag/Notes/<itemize>
4434 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4435 inline sequence generated by the macro will not work correctly for values
4436 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4437 this range. The non inline function may be accessed by <tt/#undef/'ing the
4438 macro.
4439 <item>When compiling without <tt/-Os/, the function is only available as
4440 fastcall function, so it may only be used in presence of a prototype.
4441 </itemize>
4442 <tag/Availability/ISO 9899
4443 <tag/See also/
4444 <ref id="isalnum" name="isalnum">,
4445 <ref id="isalpha" name="isalpha">,
4446 <ref id="isascii" name="isascii">,
4447 <ref id="isblank" name="isblank">,
4448 <ref id="iscntrl" name="iscntrl">,
4449 <ref id="isdigit" name="isdigit">,
4450 <ref id="isgraph" name="isgraph">,
4451 <ref id="islower" name="islower">,
4452 <ref id="isprint" name="isprint">,
4453 <ref id="ispunct" name="ispunct">,
4454 <ref id="isupper" name="isupper">,
4455 <ref id="isxdigit" name="isxdigit">
4456 <tag/Example/None.
4457 </descrip>
4458 </quote>
4459
4460
4461 <sect1>isupper<label id="isupper"><p>
4462
4463 <quote>
4464 <descrip>
4465 <tag/Function/Check if a given character is an upper case letter.
4466 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4467 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
4468 <tag/Description/The function returns a non zero value if the given argument
4469 is an upper case letter. The return value is zero if the character is anything
4470 else.
4471 <tag/Notes/<itemize>
4472 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4473 inline sequence generated by the macro will not work correctly for values
4474 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4475 this range. The non inline function may be accessed by <tt/#undef/'ing the
4476 macro.
4477 <item>When compiling without <tt/-Os/, the function is only available as
4478 fastcall function, so it may only be used in presence of a prototype.
4479 </itemize>
4480 <tag/Availability/ISO 9899
4481 <tag/See also/
4482 <ref id="isalnum" name="isalnum">,
4483 <ref id="isalpha" name="isalpha">,
4484 <ref id="isascii" name="isascii">,
4485 <ref id="isblank" name="isblank">,
4486 <ref id="iscntrl" name="iscntrl">,
4487 <ref id="isdigit" name="isdigit">,
4488 <ref id="isgraph" name="isgraph">,
4489 <ref id="islower" name="islower">,
4490 <ref id="isprint" name="isprint">,
4491 <ref id="ispunct" name="ispunct">,
4492 <ref id="isspace" name="isspace">,
4493 <ref id="isxdigit" name="isxdigit">
4494 <tag/Example/None.
4495 </descrip>
4496 </quote>
4497
4498
4499 <sect1>isxdigit<label id="isxdigit"><p>
4500
4501 <quote>
4502 <descrip>
4503 <tag/Function/Check if a given character is a hexadecimal digit.
4504 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4505 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
4506 <tag/Description/The function returns a non zero value if the given argument
4507 is a hexadecimal digit (0..9, a..f and A..F). The return value is zero if the
4508 character is anything else.
4509 <tag/Notes/<itemize>
4510 <item>When compiling with <tt/-Os/ the function is actually a macro. The
4511 inline sequence generated by the macro will not work correctly for values
4512 outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
4513 this range. The non inline function may be accessed by <tt/#undef/'ing the
4514 macro.
4515 <item>When compiling without <tt/-Os/, the function is only available as
4516 fastcall function, so it may only be used in presence of a prototype.
4517 </itemize>
4518 <tag/Availability/ISO 9899
4519 <tag/See also/
4520 <ref id="isalnum" name="isalnum">,
4521 <ref id="isalpha" name="isalpha">,
4522 <ref id="isascii" name="isascii">,
4523 <ref id="isblank" name="isblank">,
4524 <ref id="iscntrl" name="iscntrl">,
4525 <ref id="isdigit" name="isdigit">,
4526 <ref id="isgraph" name="isgraph">,
4527 <ref id="islower" name="islower">,
4528 <ref id="isprint" name="isprint">,
4529 <ref id="ispunct" name="ispunct">,
4530 <ref id="isspace" name="isspace">,
4531 <ref id="isupper" name="isupper">
4532 <tag/Example/None.
4533 </descrip>
4534 </quote>
4535
4536
4537 <sect1>itoa<label id="itoa"><p>
4538
4539 <quote>
4540 <descrip>
4541 <tag/Function/Convert an integer into a string.
4542 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4543 <tag/Declaration/<tt/char* __fastcall__ itoa (int val, char* buf, int radix);/
4544 <tag/Description/<tt/itoa/ converts the integer <tt/val/ into a string using
4545 <tt/radix/ as the base.
4546 <tag/Notes/<itemize>
4547 <item>There are no provisions to prevent a buffer overflow.
4548 <item>If <tt/val/ contains <tt/INT_MIN/, the behaviour is undefined.
4549 <item>The function is non standard, so it is not available in strict ANSI mode.
4550 You should probably use <tt/sprintf/ instead.
4551 <item>The function is only available as fastcall function, so it may only be
4552 used in presence of a prototype.
4553 </itemize>
4554 <tag/Availability/cc65
4555 <tag/See also/
4556 <ref id="atoi" name="atoi">,
4557 <ref id="atol" name="atol">,
4558 <ref id="ltoa" name="ltoa">,
4559 <ref id="ultoa" name="ultoa">,
4560 <ref id="utoa" name="utoa">
4561 <tag/Example/None.
4562 </descrip>
4563 </quote>
4564
4565
4566 <sect1>joy_count<label id="joy_count"><p>
4567
4568 <quote>
4569 <descrip>
4570 <tag/Function/Return the number of joysticks supported by the current driver.
4571 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
4572 <tag/Declaration/<tt/unsigned char joy_count (void);/
4573 <tag/Description/The function returns a the number of joysticks supported
4574 by the current joystick driver.
4575 <tag/Notes/<itemize>
4576 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
4577 name="joy_load_driver"> before calling this function.
4578 <item>The function returns the number of joysticks supported by the driver.
4579 There's no way to check for the number of actually connected joysticks.
4580 </itemize>
4581 <tag/Availability/cc65
4582 <tag/See also/
4583 <ref id="joy_load_driver" name="joy_load_driver">,
4584 <ref id="joy_read" name="joy_read">
4585 <tag/Example/None.
4586 </descrip>
4587 </quote>
4588
4589
4590 <sect1>joy_install<label id="joy_install"><p>
4591
4592 <quote>
4593 <descrip>
4594 <tag/Function/Install an already loaded driver and return an error code.
4595 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
4596 <tag/Declaration/<tt/unsigned char __fastcall__ joy_install (void* driver);/
4597 <tag/Description/The function installs a driver that was already loaded into
4598 memory (or linked statically to the program). It returns an error code
4599 (<tt/JOY_ERR_OK/ in case of success).
4600 <tag/Notes/<itemize>
4601 <item>The function is only available as fastcall function, so it may only be
4602 used in presence of a prototype.
4603 </itemize>
4604 <tag/Availability/cc65
4605 <tag/See also/
4606 <ref id="joy_load_driver" name="joy_load_driver">,
4607 <ref id="joy_uninstall" name="joy_uninstall">,
4608 <ref id="joy_unload" name="joy_unload">
4609 <tag/Example/None.
4610 </descrip>
4611 </quote>
4612
4613
4614 <sect1>joy_load_driver<label id="joy_load_driver"><p>
4615
4616 <quote>
4617 <descrip>
4618 <tag/Function/Load a driver from disk and install it.
4619 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
4620 <tag/Declaration/<tt/unsigned char __fastcall__ joy_load_driver (const char* driver);/
4621 <tag/Description/The function loads a driver with the given name from disk
4622 and installs it. An error code is returned, which is <tt/JOY_ERR_OK/ if the
4623 driver was successfully loaded and installed.
4624 <tag/Notes/<itemize>
4625 <item>The function is only available as fastcall function, so it may only be
4626 used in presence of a prototype.
4627 </itemize>
4628 <tag/Availability/cc65
4629 <tag/See also/
4630 <ref id="joy_install" name="joy_install">,
4631 <ref id="joy_uninstall" name="joy_uninstall">,
4632 <ref id="joy_unload" name="joy_unload">
4633 <tag/Example/None.
4634 </descrip>
4635 </quote>
4636
4637
4638 <sect1>joy_read<label id="joy_read"><p>
4639
4640 <quote>
4641 <descrip>
4642 <tag/Function/Read the status of a joystick.
4643 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
4644 <tag/Declaration/<tt/unsigned char __fastcall__ joy_read (unsigned char joystick);/
4645 <tag/Description/The function reads the status bits for a joystick. The number
4646 of the joystick is passed as parameter. The result may be examined by using one
4647 of the <tt/JOY_xxx/ macros from <ref id="joystick.h" name="joystick.h">.
4648 <tag/Notes/<itemize>
4649 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
4650 name="joy_load_driver"> before calling this function.
4651 <item>The function is only available as fastcall function, so it may only be
4652 used in presence of a prototype.
4653 </itemize>
4654 <tag/Availability/cc65
4655 <tag/See also/
4656 <ref id="joy_count" name="joy_count">,
4657 <ref id="joy_load_driver" name="joy_load_driver">,
4658 <ref id="joy_unload" name="joy_unload">
4659 <tag/Example/None.
4660 </descrip>
4661 </quote>
4662
4663
4664 <sect1>joy_uninstall<label id="joy_uninstall"><p>
4665
4666 <quote>
4667 <descrip>
4668 <tag/Function/Uninstall the current joystick driver.
4669 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
4670 <tag/Declaration/<tt/unsigned char joy_uninstall (void);/
4671 <tag/Description/The function uninstalls the currently installed joystick
4672 driver. It does not remove the driver from memory. The function returns an
4673 error code, which is <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
4674 <tag/Notes/<itemize>
4675 <item>A joystick driver must be installed using <ref id="joy_install"
4676 name="joy_install"> before calling this function.
4677 </itemize>
4678 <tag/Availability/cc65
4679 <tag/See also/
4680 <ref id="joy_install" name="joy_install">,
4681 <ref id="joy_load_driver" name="joy_load_driver">,
4682 <ref id="joy_unload" name="joy_unload">
4683 <tag/Example/None.
4684 </descrip>
4685 </quote>
4686
4687
4688 <sect1>joy_unload<label id="joy_unload"><p>
4689
4690 <quote>
4691 <descrip>
4692 <tag/Function/Uninstall, then unload the current joystick driver.
4693 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
4694 <tag/Declaration/<tt/unsigned char joy_unload (void);/
4695 <tag/Description/The function uninstalls the currently installed joystick
4696 driver and removes it from memory. An error code is returned, which is
4697 <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
4698 <tag/Notes/<itemize>
4699 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
4700 name="joy_load_driver"> before calling this function.
4701 </itemize>
4702 <tag/Availability/cc65
4703 <tag/See also/
4704 <ref id="joy_load_driver" name="joy_load_driver">
4705 <tag/Example/None.
4706 </descrip>
4707 </quote>
4708
4709
4710 <sect1>kbhit<label id="kbhit"><p>
4711
4712 <quote>
4713 <descrip>
4714 <tag/Function/Check if there's a key waiting in the keyboard buffer.
4715 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4716 <tag/Declaration/<tt/unsigned char kbhit (void);/
4717 <tag/Description/The function returns a value of zero if there is no character
4718 waiting to be read from the keyboard. It returns non zero otherwise.
4719 <tag/Notes/<itemize>
4720 <item>If the system does not support a keyboard buffer (most systems
4721 do), the function is rather useless.
4722 </itemize>
4723 <tag/Availability/cc65
4724 <tag/See also/
4725 <ref id="cgetc" name="cgetc">,
4726 <ref id="cursor" name="cursor">
4727 <tag/Example/None.
4728 </descrip>
4729 </quote>
4730
4731
4732 <sect1>kbrepeat<label id="kbrepeat"><p>
4733
4734 <quote>
4735 <descrip>
4736 <tag/Function/Set the keyboard repeat mode.
4737 <tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
4738 <tag/Declaration/<tt/unsigned char __fastcall__ kbrepeat (unsigned char mode);/
4739 <tag/Description/This function changes which keys have automatic repeat when
4740 being held down for a certain time. Possible values are <tt/KBREPEAT_CURSOR/
4741 (repeat only cursor-related keys), <tt/KBREPEAT_NONE/ (no repeat for any
4742 keys), and <tt/KBREPEAT_ALL/ (repeat all keys). The old mode is returned, so
4743 it can be restored later.
4744 <tag/Notes/<itemize>
4745 <item>The function is available only as a fastcall function; so, it may be used
4746 only in the presence of a prototype.
4747 </itemize>
4748 <tag/Availability/cc65
4749 <tag/Example/None.
4750 </descrip>
4751 </quote>
4752
4753
4754 <sect1>labs<label id="labs"><p>
4755
4756 <quote>
4757 <descrip>
4758 <tag/Function/Returns the absolute value of a long integer.
4759 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4760 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
4761 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
4762 the function.
4763 <tag/Notes/<itemize>
4764 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
4765 <item>The function is only available as fastcall function, so it may only be
4766 used in presence of a prototype.
4767 </itemize>
4768 <tag/Availability/ISO 9899
4769 <tag/See also/
4770 <ref id="abs" name="abs">
4771 <tag/Example/None.
4772 </descrip>
4773 </quote>
4774
4775
4776 <sect1>ltoa<label id="ltoa"><p>
4777
4778 <quote>
4779 <descrip>
4780 <tag/Function/Convert a long integer into a string.
4781 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4782 <tag/Declaration/<tt/char* __fastcall__ ltoa (long val, char* buf, int radix);/
4783 <tag/Description/<tt/itoa/ converts the long integer <tt/val/ into a string
4784 using <tt/radix/ as the base.
4785 <tag/Notes/<itemize>
4786 <item>There are no provisions to prevent a buffer overflow.
4787 <item>If <tt/val/ contains <tt/LONG_MIN/, the behaviour is undefined.
4788 <item>The function is non standard, so it is not available in strict ANSI mode.
4789 You should probably use <tt/sprintf/ instead.
4790 <item>The function is only available as fastcall function, so it may only be
4791 used in presence of a prototype.
4792 </itemize>
4793 <tag/Availability/cc65
4794 <tag/See also/
4795 <ref id="atoi" name="atoi">,
4796 <ref id="atol" name="atol">,
4797 <ref id="itoa" name="itoa">,
4798 <ref id="ultoa" name="ultoa">,
4799 <ref id="utoa" name="utoa">
4800 <tag/Example/None.
4801 </descrip>
4802 </quote>
4803
4804
4805 <sect1>localeconv<label id="localeconv"><p>
4806
4807 <quote>
4808 <descrip>
4809 <tag/Function/Returns a pointer to the current locale structure.
4810 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
4811 <tag/Declaration/<tt/struct lconv* localeconv (void);/
4812 <tag/Description/<tt/localeconv/ returns a pointer to the current locale
4813 structure.
4814 <tag/Notes/<itemize>
4815 <item>cc65 supports only the "C" locale, so even after setting a new locale
4816 using <tt/<ref id="setlocale" name="setlocale">/, the structure returned will
4817 always be the same.
4818 </itemize>
4819 <tag/Availability/ISO 9899
4820 <tag/See also/
4821 <ref id="setlocale" name="setlocale">
4822 <tag/Example/None.
4823 </descrip>
4824 </quote>
4825
4826
4827 <sect1>longjmp<label id="longjmp"><p>
4828
4829 <quote>
4830 <descrip>
4831 <tag/Function/Non local goto.
4832 <tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
4833 <tag/Declaration/<tt/void __fastcall__ longjmp (jmp_buf buf, int retval);/
4834 <tag/Description/The <tt/longjmp/ function restores a program context from the
4835 data in <tt/buf/, which must have been set by a preceeding call to
4836 <tt/<ref id="setjmp" name="setjmp">/. Program execution continues as if the
4837 call to <tt/<ref id="setjmp" name="setjmp">/ has just returned the value
4838 <tt/retval/.
4839 <tag/Notes/<itemize>
4840 <item>If the parameter <tt/retval/ is zero, the function will behave as if it
4841 was called with a value of one.
4842 <item>The function is only available as fastcall function, so it may only
4843 be used in presence of a prototype.
4844 </itemize>
4845 <tag/Availability/ISO 9899
4846 <tag/See also/
4847 <ref id="setjmp" name="setjmp">
4848 <tag/Example/None.
4849 </descrip>
4850 </quote>
4851
4852
4853 <sect1>malloc<label id="malloc"><p>
4854
4855 <quote>
4856 <descrip>
4857 <tag/Function/Allocate dynamic memory.
4858 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4859 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
4860 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
4861 pointer to the allocated memory block. On error (not enough memory available),
4862 <tt/malloc/ returns <tt/NULL/.
4863 <tag/Notes/<itemize>
4864 <item>The function is only available as fastcall function, so it may only
4865 be used in presence of a prototype.
4866 </itemize>
4867 <tag/Availability/ISO 9899
4868 <tag/See also/
4869 <ref id="_heapadd" name="_heapadd">,
4870 <ref id="_heapblocksize" name="_heapblocksize">,
4871 <ref id="_heapmaxavail" name="_heapmaxavail">,
4872 <ref id="_heapmemavail" name="_heapmemavail">,
4873 <ref id="calloc" name="calloc">,
4874 <ref id="free" name="free">,
4875 <ref id="realloc" name="realloc">,
4876 <ref id="strdup" name="strdup">
4877 <tag/Example/None.
4878 </descrip>
4879 </quote>
4880
4881
4882 <sect1>memchr<label id="memchr"><p>
4883
4884 <quote>
4885 <descrip>
4886 <tag/Function/Search for a character in a block of raw memory.
4887 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4888 <tag/Declaration/<tt/void* __fastcall__ strchr (const void* mem, int c, size_t count);/
4889 <tag/Description/The <tt/memchr/ function locates the first occurrence of <tt/c/
4890 (converted to a char) in the block of raw memory string pointed to by <tt/mem/
4891 that is of size <tt/count/. Upon completion, the function returns a pointer to
4892 the character found, or a null pointer if the character was not found.
4893 <tag/Notes/<itemize>
4894 <item>The function is only available as fastcall function, so it may only
4895 be used in presence of a prototype.
4896 </itemize>
4897 <tag/Availability/ISO 9899
4898 <tag/See also/
4899 <ref id="strchr" name="strchr">
4900 <tag/Example/None.
4901 </descrip>
4902 </quote>
4903
4904
4905 <sect1>memcmp<label id="memcmp"><p>
4906
4907 <quote>
4908 <descrip>
4909 <tag/Function/Compare two memory areas.
4910 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4911 <tag/Declaration/<tt/int __fastcall__ memcmp (const void* p1, const void* p2, size_t count);/
4912 <tag/Description/<tt/memcmp/ compares <tt/count/ bytes from the memory area
4913 pointed to by <tt/p1/ into the memory area pointed to by <tt/p2/. It returns a value that is less than
4914 zero if <tt/p1/ is less than <tt/p2/, zero if <tt/p1/ is the same as <tt/p2/,
4915 and a value greater than zero if <tt/p1/ is greater than <tt/p2/.
4916 <tag/Notes/<itemize>
4917 <item>The function is only available as fastcall function, so it may only
4918 be used in presence of a prototype.
4919 </itemize>
4920 <tag/Availability/ISO 9899
4921 <tag/See also/
4922 <ref id="strcmp" name="strcmp">,
4923 <ref id="memmove" name="memmove">,
4924 <ref id="memset" name="memset">
4925 <tag/Example/None.
4926 </descrip>
4927 </quote>
4928
4929
4930 <sect1>memcpy<label id="memcpy"><p>
4931
4932 <quote>
4933 <descrip>
4934 <tag/Function/Copy a memory area.
4935 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4936 <tag/Declaration/<tt/void* __fastcall__ memcpy (void* dest, const void* src, size_t count);/
4937 <tag/Description/<tt/memcpy/ copies <tt/count/ bytes from the memory area
4938 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
4939 <tt/dest/.
4940 <tag/Notes/<itemize>
4941 <item>The result is undefined if the memory areas do overlap. Use
4942 <tt/<ref id="memmove" name="memmove">/ to copy overlapping memory areas.
4943 <item>The function is only available as fastcall function, so it may only
4944 be used in presence of a prototype.
4945 </itemize>
4946 <tag/Availability/ISO 9899
4947 <tag/See also/
4948 <ref id="_swap" name="_swap">,
4949 <ref id="memmove" name="memmove">,
4950 <ref id="memset" name="memset">
4951 <tag/Example/None.
4952 </descrip>
4953 </quote>
4954
4955
4956 <sect1>memmove<label id="memmove"><p>
4957
4958 <quote>
4959 <descrip>
4960 <tag/Function/Copy a memory area.
4961 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4962 <tag/Declaration/<tt/void* __fastcall__ memmove (void* dest, const void* src, size_t count);/
4963 <tag/Description/<tt/memmove/ copies <tt/count/ bytes from the memory area
4964 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
4965 <tt/dest/.
4966 <tag/Notes/<itemize>
4967 <item>While <tt/memmove/ allows the memory areas to overlap, it has some
4968 additional overhead compared to <tt/<ref id="memcpy" name="memcpy">/.
4969 <item>The function is only available as fastcall function, so it may only
4970 be used in presence of a prototype.
4971 </itemize>
4972 <tag/Availability/ISO 9899
4973 <tag/See also/
4974 <ref id="_swap" name="_swap">,
4975 <ref id="memcpy" name="memcpy">,
4976 <ref id="memset" name="memset">
4977 <tag/Example/None.
4978 </descrip>
4979 </quote>
4980
4981
4982 <sect1>memset<label id="memset"><p>
4983
4984 <quote>
4985 <descrip>
4986 <tag/Function/Fill a memory area.
4987 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4988 <tag/Declaration/<tt/void* __fastcall__ memset (void* p, int val, size_t count);/
4989 <tag/Description/<tt/memset/ fills the memory area pointed to by <tt/p/ with
4990 the value <tt/val/. The function returns <tt/p/.
4991 <tag/Notes/<itemize>
4992 <item>The function is only available as fastcall function, so it may only
4993 be used in presence of a prototype.
4994 </itemize>
4995 <tag/Availability/ISO 9899
4996 <tag/See also/
4997 <ref id="_swap" name="_swap">,
4998 <ref id="bzero" name="bzero">,
4999 <ref id="memcpy" name="memcpy">,
5000 <ref id="memmove" name="memmove">
5001 <tag/Example/None.
5002 </descrip>
5003 </quote>
5004
5005
5006 <sect1>mod_free<label id="mod_free"><p>
5007
5008 <quote>
5009 <descrip>
5010 <tag/Function/Free a relocatable module.
5011 <tag/Header/<tt/<ref id="modload.h" name="modload.h">/
5012 <tag/Declaration/<tt/void __fastcall__ mod_free (void* module);/
5013 <tag/Description/The function will free a module loaded into memory by use of
5014 the <tt/<ref id="mod_load" name="mod_load">/ function.
5015 <tag/Notes/<itemize>
5016 <item>The pointer passed as parameter is the pointer to the module memory,
5017 not the pointer to the control structure.
5018 <item>The function is available only as a fastcall function; so, it may be used
5019 only in the presence of a prototype.
5020 </itemize>
5021 <tag/Availability/cc65
5022 <tag/See also/
5023 <ref id="mod_load" name="mod_load">
5024 <tag/Example/None.
5025 </descrip>
5026 </quote>
5027
5028
5029 <sect1>mod_load<label id="mod_load"><p>
5030
5031 <quote>
5032 <descrip>
5033 <tag/Function/Load a relocatable module.
5034 <tag/Header/<tt/<ref id="modload.h" name="modload.h">/
5035 <tag/Declaration/<tt/unsigned char __fastcall__ mod_load (struct mod_ctrl* ctrl);/
5036 <tag/Description/The function will load a code module into memory and relocate
5037 it. The function will return an error code. If <tt/MLOAD_OK/ is returned, the
5038 outgoing fields in the passed <tt/mod_ctrl/ struct contain information about
5039 the module just loaded. Possible error codes are:
5040 <itemize>
5041 <item><tt/MLOAD_OK/ - Module load successful
5042 <item><tt/MLOAD_ERR_READ/ - Read error
5043 <item><tt/MLOAD_ERR_HDR/ - Header error
5044 <item><tt/MLOAD_ERR_OS/ - Wrong operating system
5045 <item><tt/MLOAD_ERR_FMT/ - Data format error
5046 <item><tt/MLOAD_ERR_MEM/ - Not enough memory
5047 </itemize>
5048 <tag/Notes/<itemize>
5049 <item>The <htmlurl url="ld65.html" name="ld65"> linker is needed to create
5050 relocatable o65 modules for use with this function.
5051 <item>The function is available only as a fastcall function; so, it may be used
5052 only in the presence of a prototype.
5053 </itemize>
5054 <tag/Availability/cc65
5055 <tag/See also/
5056 <ref id="mod_free" name="mod_free">
5057 <tag/Example/None.
5058 </descrip>
5059 </quote>
5060
5061
5062 <sect1>mouse_setbox<label id="mouse_setbox"><p>
5063
5064 <quote>
5065 <descrip>
5066 <tag/Function/Specify a bounding box for the mouse cursor.
5067 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5068 <tag/Declaration/<tt/void __fastcall__ mouse_setbox (const struct mouse_box* box);/
5069 <tag/Description/The function allows to set a bounding box for mouse movement.
5070 <tag/Notes/<itemize>
5071 <item>The function does not check if the mouse cursor is currently within the
5072 given rectangle. Placing the mouse cursor within the bounding box is the
5073 responsibility of the programmer.
5074 <item>While the bounding box may be larger than the actual screen size, the
5075 standard mouse cursor draw routines may fail to set the cursor to coordinates
5076 outside of the screen area. Depending on the platform, you may have to supply
5077 your own mouse cursor routines.
5078 <item>The function is only available as fastcall function, so it may only be
5079 used in presence of a prototype.
5080 </itemize>
5081 <tag/Availability/cc65
5082 <tag/See also/
5083 <ref id="mouse_getbox" name="mouse_getbox">,
5084 <ref id="mouse_move" name="mouse_move">
5085 <tag/Example/None.
5086 </descrip>
5087 </quote>
5088
5089
5090 <sect1>mouse_getbox<label id="mouse_getbox"><p>
5091
5092 <quote>
5093 <descrip>
5094 <tag/Function/Return the current bounding box for the mouse cursor.
5095 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5096 <tag/Declaration/<tt/void __fastcall__ mouse_getbox (struct mouse_box* box);/
5097 <tag/Description/The function queries the current bounding box for mouse
5098 movement.
5099 <tag/Notes/<itemize>
5100 <item>The function is only available as fastcall function, so it may only be
5101 used in presence of a prototype.
5102 </itemize>
5103 <tag/Availability/cc65
5104 <tag/See also/
5105 <ref id="mouse_move" name="mouse_move">,
5106 <ref id="mouse_setbox" name="mouse_setbox">
5107 <tag/Example/None.
5108 </descrip>
5109 </quote>
5110
5111
5112 <sect1>mouse_buttons<label id="mouse_buttons"><p>
5113
5114 <quote>
5115 <descrip>
5116 <tag/Function/Return a bit mask encoding the state of the mouse buttons.
5117 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5118 <tag/Declaration/<tt/unsigned char mouse_buttons (void);/
5119 <tag/Description/The function returns a bit mask that encodes the state of the
5120 mouse buttons. You may use the <tt/MOUSE_BTN_XXX/ flags to decode the function
5121 return value.
5122 <tag/Availability/cc65
5123 <tag/See also/
5124 <ref id="mouse_info" name="mouse_info">,
5125 <ref id="mouse_pos" name="mouse_pos">
5126 <tag/Example/None.
5127 </descrip>
5128 </quote>
5129
5130
5131 <sect1>mouse_geterrormsg<label id="mouse_geterrormsg"><p>
5132
5133 <quote>
5134 <descrip>
5135 <tag/Function/Return a readable error message for an error code.
5136 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5137 <tag/Declaration/<tt/const char* __fastcall__ mouse_geterrormsg (unsigned char
5138 code);/
5139 <tag/Description/The function returns an error message (in english) for the
5140 error code passed parameter.
5141 <tag/Notes/<itemize>
5142 <item>The function will return "Unknown error" for invalid error codes.
5143 <item>The function is only available as fastcall function, so it may only be
5144 used in presence of a prototype.
5145 </itemize>
5146 <tag/Availability/cc65
5147 <tag/See also/
5148 <ref id="mouse_load_driver" name="mouse_load_driver">,
5149 <ref id="mouse_uninstall" name="mouse_uninstall">,
5150 <ref id="mouse_unload" name="mouse_unload">
5151 <tag/Example/None.
5152 </descrip>
5153 </quote>
5154
5155
5156 <sect1>mouse_hide<label id="mouse_hide"><p>
5157
5158 <quote>
5159 <descrip>
5160 <tag/Function/Hide the mouse pointer.
5161 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5162 <tag/Declaration/<tt/void mouse_hide (void);/
5163 <tag/Description/The function hides the mouse pointer. It manages a counter
5164 that is shared between <tt/<ref id="mouse_show" name="mouse_show">/ and
5165 <tt/mouse_hide/ so that every call call to <tt/mouse_hide/ must be followed by
5166 a call to <tt/<ref id="mouse_show" name="mouse_show">/ to make the mouse cursor
5167 visible.
5168 <tag/Availability/cc65
5169 <tag/See also/
5170 <ref id="mouse_show" name="mouse_show">
5171 <tag/Example/None.
5172 </descrip>
5173 </quote>
5174
5175
5176 <sect1>mouse_info<label id="mouse_info"><p>
5177
5178 <quote>
5179 <descrip>
5180 <tag/Function/Return the state of the mouse buttons and the position of the
5181 mouse.
5182 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5183 <tag/Declaration/<tt/void __fastcall__ mouse_info (struct mouse_info* info);/
5184 <tag/Description/The function returns the state of the mouse buttons and the
5185 position of the mouse in the <tt/mouse_info/ structure passed as parameter.
5186 <tag/Notes/<itemize>
5187 <item>The <tt/mouse_info/ struct is a superset of the <tt/mouse_pos/ struct,
5188 so if you just need the mouse position, call <tt/<ref id="mouse_pos"
5189 name="mouse_pos">/ instead.
5190 <item>The function is only available as fastcall function, so it may only be
5191 used in presence of a prototype.
5192 </itemize>
5193 <tag/Availability/cc65
5194 <tag/See also/
5195 <ref id="mouse_buttons" name="mouse_buttons">,
5196 <ref id="mouse_pos" name="mouse_pos">
5197 <tag/Example/None.
5198 </descrip>
5199 </quote>
5200
5201
5202 <sect1>mouse_install<label id="mouse_install"><p>
5203
5204 <quote>
5205 <descrip>
5206 <tag/Function/Install an already loaded mouse driver.
5207 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5208 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_install (const struct
5209 mouse_callbacks* c, void* driver);/
5210 <tag/Description/The function installs an already loaded mouse driver and
5211 returns an error code. The <tt/mouse_callbacks/ structure passed as first
5212 parameter contains pointers to routines needed to move or hide/show the mouse
5213 pointer. Defaults for these routines are supplied by the library, so if you
5214 can live with these defaults (which are platform specific), just pass a
5215 pointer to <tt/mouse_def_callbacks/. The function may be used to install a
5216 driver linked statically to the program.
5217 <tag/Notes/<itemize>
5218 <item>Not all drivers are able to detect if the supported hardware is really
5219 present.
5220 <item>After installing a driver, the mouse cursor is hidden.
5221 <item>The function is only available as fastcall function, so it may only be
5222 used in presence of a prototype.
5223 </itemize>
5224 <tag/Availability/cc65
5225 <tag/See also/
5226 <ref id="mouse_load_driver" name="mouse_load_driver">,
5227 <ref id="mouse_uninstall" name="mouse_uninstall">,
5228 <ref id="mouse_unload" name="mouse_unload">
5229 <tag/Example/None.
5230 </descrip>
5231 </quote>
5232
5233
5234 <sect1>mouse_ioctl<label id="mouse_ioctl"><p>
5235
5236 <quote>
5237 <descrip>
5238 <tag/Function/Call the driver specific ioctl function.
5239 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5240 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_ioctl (unsigned char code, void* data);/
5241 <tag/Description/The function calls the IOCTL entry in the mouse driver,
5242 which is driver specific. The <tt/code/ parameter will choose between
5243 different IOCTL functions, and the <tt/data/ depends on code. The
5244 function returns an error code. The purpose of this function is to allow
5245 for driver specific extensions. See the documentation for a specific mouse
5246 driver for supported ioctl calls.
5247 <tag/Notes/<itemize>
5248 <item>Calling this function is non portable, because each driver may
5249 implement different ioctl calls (or none at all).
5250 <item>The function is only available as fastcall function, so it may only be
5251 used in presence of a prototype.
5252 </itemize>
5253 <tag/Availability/cc65
5254 <tag/Example/None.
5255 </descrip>
5256 </quote>
5257
5258
5259 <sect1>mouse_load_driver<label id="mouse_load_driver"><p>
5260
5261 <quote>
5262 <descrip>
5263 <tag/Function/Load and initialize a mouse driver.
5264 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5265 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_load_driver (const struct
5266 mouse_callbacks* c, const char* driver);/
5267 <tag/Description/Load a mouse driver into memory and initialize it. The
5268 function returns an error code that tells if the call has been successful. The
5269 <tt/mouse_callbacks/ structure passed as first parameter contains pointers to
5270 routines needed to move or hide/show the mouse pointer. Defaults for these
5271 routines are supplied by the library, so if you can live with these defaults
5272 (which are platform specific), just pass a pointer to <tt/mouse_def_callbacks/.
5273 <tag/Notes/<itemize>
5274 <item>The driver is loaded by name, so currently you must know the type of
5275 mouse that should be supported. There is no autodetect capability.
5276 <item>Not all drivers are able to detect if the supported hardware is really
5277 present.
5278 <item>After installing a driver, the mouse cursor is hidden.
5279 <item>The function is only available as fastcall function, so it may only be
5280 used in presence of a prototype.
5281 </itemize>
5282 <tag/Availability/cc65
5283 <tag/See also/
5284 <ref id="mouse_install" name="mouse_install">,
5285 <ref id="mouse_uninstall" name="mouse_uninstall">,
5286 <ref id="mouse_unload" name="mouse_unload">
5287 <tag/Example/None.
5288 </descrip>
5289 </quote>
5290
5291
5292 <sect1>mouse_move<label id="mouse_move"><p>
5293
5294 <quote>
5295 <descrip>
5296 <tag/Function/Move the mouse cursor to a specific position.
5297 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5298 <tag/Declaration/<tt/void __fastcall__ mouse_move (int x, int y);/
5299 <tag/Description/The function updates the mouse position. If the mouse cursor
5300 is visible, it is shown at the new position.
5301 <tag/Notes/<itemize>
5302 <item>The function does not check if the new position is within the bounding
5303 box specified with <tt/<ref id="mouse_setbox" name="mouse_setbox">/.
5304 <item>The function is only available as fastcall function, so it may only be
5305 used in presence of a prototype.
5306 </itemize>
5307 <tag/Availability/cc65
5308 <tag/See also/
5309 <ref id="mouse_getbox" name="mouse_getbox">,
5310 <ref id="mouse_setbox" name="mouse_setbox">
5311 <tag/Example/None.
5312 </descrip>
5313 </quote>
5314
5315
5316 <sect1>mouse_pos<label id="mouse_pos"><p>
5317
5318 <quote>
5319 <descrip>
5320 <tag/Function/Return the position of the mouse.
5321 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5322 <tag/Declaration/<tt/void __fastcall__ mouse_pos (struct mouse_pos* pos);/
5323 <tag/Description/The function returns the position of the mouse in the
5324 <tt/mouse_pos/ structure passed as parameter.
5325 <tag/Notes/<itemize>
5326 <item>The <tt/mouse_pos/ struct is a subset of the <tt/mouse_info/ struct,
5327 so if you do also need the mouse buttons, call <tt/<ref id="mouse_info"
5328 name="mouse_info">/ instead.
5329 <item>The function is only available as fastcall function, so it may only be
5330 used in presence of a prototype.
5331 </itemize>
5332 <tag/Availability/cc65
5333 <tag/See also/
5334 <ref id="mouse_buttons" name="mouse_buttons">,
5335 <ref id="mouse_info" name="mouse_info">
5336 <tag/Example/None.
5337 </descrip>
5338 </quote>
5339
5340
5341 <sect1>mouse_show<label id="mouse_show"><p>
5342
5343 <quote>
5344 <descrip>
5345 <tag/Function/Show the mouse pointer.
5346 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5347 <tag/Declaration/<tt/void mouse_show (void);/
5348 <tag/Description/The function shows the mouse pointer. It manages a counter
5349 that is shared between <tt/<ref id="mouse_hide" name="mouse_hide">/ and
5350 <tt/mouse_show/. The mouse cursor is visible if there was one more call to
5351 <tt/mouse_show/ than to <tt/<ref id="mouse_hide" name="mouse_hide">/.
5352 <tag/Availability/cc65
5353 <tag/See also/
5354 <ref id="mouse_hide" name="mouse_hide">
5355 <tag/Example/None.
5356 </descrip>
5357 </quote>
5358
5359
5360 <sect1>mouse_uninstall<label id="mouse_uninstall"><p>
5361
5362 <quote>
5363 <descrip>
5364 <tag/Function/Uninstall an already loaded mouse driver.
5365 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5366 <tag/Declaration/<tt/unsigned char mouse_uninstall (void);/
5367 <tag/Description/The function uninstalls an already loaded mouse driver but
5368 don't removes it from memory.
5369 <tag/Notes/<itemize>
5370 <item>If the driver has been loaded using <tt/<ref id="mouse_load_driver"
5371 name="mouse_load_driver">/, <tt/<ref id="mouse_unload" name="mouse_unload">/
5372 should be used instead of <tt/mouse_uninstall/ so the driver is also removed
5373 from memory.
5374 </itemize>
5375 <tag/Availability/cc65
5376 <tag/See also/
5377 <ref id="mouse_install" name="mouse_install">,
5378 <ref id="mouse_load_driver" name="mouse_load_driver">,
5379 <ref id="mouse_unload" name="mouse_unload">
5380 <tag/Example/None.
5381 </descrip>
5382 </quote>
5383
5384
5385 <sect1>mouse_unload<label id="mouse_unload"><p>
5386
5387 <quote>
5388 <descrip>
5389 <tag/Function/Unload a mouse driver.
5390 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
5391 <tag/Declaration/<tt/unsigned char mouse_unload (void);/
5392 <tag/Description/The function unloads a loaded mouse driver and frees all
5393 memory allocated for the driver.
5394 <tag/Notes/<itemize>
5395 <item>The function does nothing if no driver is loaded.
5396 </itemize>
5397 <tag/Availability/cc65
5398 <tag/See also/
5399 <ref id="mouse_install" name="mouse_install">,
5400 <ref id="mouse_load_driver" name="mouse_load_driver">,
5401 <ref id="mouse_uninstall" name="mouse_uninstall">
5402 <tag/Example/None.
5403 </descrip>
5404 </quote>
5405
5406
5407 <sect1>offsetof<label id="offsetof"><p>
5408
5409 <quote>
5410 <descrip>
5411 <tag/Function/Calculate the offset of a struct or union member.
5412 <tag/Header/<tt/<ref id="stddef.h" name="stddef.h">/
5413 <tag/Declaration/<tt/size_t offsetof (type, member);/
5414 <tag/Description/<tt/offsetof/ calculates the address offset of a <tt/struct/
5415 or <tt/union/ member.
5416 <tag/Notes/<itemize>
5417 <item>The function is actually a macro.
5418 </itemize>
5419 <tag/Availability/ISO 9899
5420 <tag/Example/None.
5421 </descrip>
5422 </quote>
5423
5424
5425 <sect1>open<label id="open"><p>
5426
5427 <quote>
5428 <descrip>
5429 <tag/Function/Open and possibly create a file.
5430 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
5431 <tag/Declaration/<tt/int open (const char* name, int flags, ...);/
5432 <tag/Description/<tt/open/ opens a file and returns the file descriptor
5433 associated with it. On error, -1 is returned and an error code is stored in
5434 <tt/errno/. Several flags may be passed to <tt/open/ that change the behaviour.
5435 <tag/Notes/<itemize>
5436 <item>POSIX specifies an additional <tt/mode/ argument that may be passed to
5437 open, which is used as the permission mask when a new file is created. While
5438 cc65 allows to pass this argument, it is ignored.
5439 </itemize>
5440 <tag/Availability/POSIX 1003.1
5441 <tag/See also/
5442 <ref id="close" name="close">,
5443 <ref id="creat" name="creat">
5444 <tag/Example/None.
5445 </descrip>
5446 </quote>
5447
5448
5449 <sect1>opendir<label id="opendir"><p>
5450
5451 <quote>
5452 <descrip>
5453 <tag/Function/Open a directory.
5454 <tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
5455 <tag/Declaration/<tt/DIR* __fastcall__ opendir (const char* name);/
5456 <tag/Description/<tt/opendir/ opens a directory and returns the direcory
5457 descriptor associated with it. On error, NULL is returned and an error code is
5458 stored in <tt/errno/.
5459 <tag/Notes/<itemize>
5460 <item>The function is only available as fastcall function, so it may only
5461 be used in presence of a prototype.
5462 </itemize>
5463 <tag/Availability/POSIX 1003.1
5464 <tag/See also/
5465 <ref id="closedir" name="closedir">,
5466 <ref id="readdir" name="readdir">
5467 <tag/Example/None.
5468 </descrip>
5469 </quote>
5470
5471
5472 <sect1>peekbsys<label id="peekbsys"><p>
5473
5474 <quote>
5475 <descrip>
5476 <tag/Function/Read one byte from a location in the system bank.
5477 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
5478 <tt/<ref id="cbm510.h" name="cbm510.h">/
5479 <tag/Declaration/<tt/unsigned char __fastcall__ peekbsys (unsigned addr);/
5480 <tag/Description/<tt/peekbsys/ reads one byte from the given address in the
5481 system bank (bank 15) of the CBM PET-II machines and returns it.
5482 <tag/Notes/<itemize>
5483 <item>The function is only available as fastcall function, so it may only
5484 be used in presence of a prototype.
5485 <item>This function may be a macro depending on the compiler options. The
5486 actual function is accessible by #undef'ing the macro.
5487 </itemize>
5488 <tag/Availability/cc65
5489 <tag/See also/
5490 <ref id="PEEK" name="PEEK">,
5491 <ref id="PEEKW" name="PEEKW">,
5492 <ref id="peekwsys" name="peekwsys">,
5493 <ref id="pokebsys" name="pokebsys">,
5494 <ref id="pokewsys" name="pokewsys">
5495 <tag/Example/None.
5496 </descrip>
5497 </quote>
5498
5499
5500 <sect1>peekwsys<label id="peekwsys"><p>
5501
5502 <quote>
5503 <descrip>
5504 <tag/Function/Read one word from a location in the system bank.
5505 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
5506 <tt/<ref id="cbm510.h" name="cbm510.h">/
5507 <tag/Declaration/<tt/unsigned __fastcall__ peekwsys (unsigned addr);/
5508 <tag/Description/<tt/peekwsys/ reads one word from the given address in the
5509 system bank (bank 15) of the CBM PET-II machines and returns it. Following
5510 the usual 6502 conventions, the low byte is read from <tt/addr/, and the
5511 high byte is read from <tt/addr+1/.
5512 <tag/Notes/<itemize>
5513 <item>The function is only available as fastcall function, so it may only
5514 be used in presence of a prototype.
5515 <item>The order in which the two bytes are read is undefined.
5516 </itemize>
5517 <tag/Availability/cc65
5518 <tag/See also/
5519 <ref id="PEEK" name="PEEK">,
5520 <ref id="PEEKW" name="PEEKW">,
5521 <ref id="peekbsys" name="peekbsys">,
5522 <ref id="pokebsys" name="pokebsys">,
5523 <ref id="pokewsys" name="pokewsys">
5524 <tag/Example/None.
5525 </descrip>
5526 </quote>
5527
5528
5529 <sect1>perror<label id="perror"><p>
5530
5531 <quote>
5532 <descrip>
5533 <tag/Function/Print an error message for the error in <tt/errno/.
5534 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
5535 <tag/Declaration/<tt/void __fastcall__ perror (const char* s);/
5536 <tag/Description/<tt/perror/ prints an error message to <tt/stderr/. If <tt/s/
5537 is not <tt/NULL/ and not an empty string, it is printed followed by a colon and
5538 a blank. Then the error message for the current contents of <tt/errno/ is
5539 printed followed by a newline. The message output is the same as returned by
5540 <tt/<ref id="strerror" name="strerror">/ with an argument of <tt/errno/.
5541 <tag/Notes/<itemize>
5542 <item>The function is only available as fastcall function, so it may only
5543 be used in presence of a prototype.
5544 </itemize>
5545 <tag/Availability/ISO 9899
5546 <tag/See also/
5547 <ref id="_poserror" name="_poserror">,
5548 <ref id="strerror" name="strerror">
5549 <tag/Example/None.
5550 </descrip>
5551 </quote>
5552
5553
5554 <sect1>pokebsys<label id="pokebsys"><p>
5555
5556 <quote>
5557 <descrip>
5558 <tag/Function/Write one byte to a location in the system bank.
5559 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
5560 <tt/<ref id="cbm510.h" name="cbm510.h">/
5561 <tag/Declaration/<tt/void __fastcall__ pokebsys (unsigned addr, unsigned char val);/
5562 <tag/Description/<tt/pokebsys/ writes one byte to the given address in the
5563 system bank (bank 15) of the CBM PET-II machines.
5564 <tag/Notes/<itemize>
5565 <item>The function is only available as fastcall function, so it may only
5566 be used in presence of a prototype.
5567 </itemize>
5568 <tag/Availability/cc65
5569 <tag/See also/
5570 <ref id="POKE" name="POKE">,
5571 <ref id="POKEW" name="POKEW">,
5572 <ref id="peekbsys" name="peekbsys">,
5573 <ref id="peekwsys" name="peekwsys">,
5574 <ref id="pokewsys" name="pokewsys">
5575 <tag/Example/None.
5576 </descrip>
5577 </quote>
5578
5579
5580 <sect1>pokewsys<label id="pokewsys"><p>
5581
5582 <quote>
5583 <descrip>
5584 <tag/Function/Write one word to a location in the system bank.
5585 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
5586 <tt/<ref id="cbm510.h" name="cbm510.h">/
5587 <tag/Declaration/<tt/void __fastcall__ pokewsys (unsigned addr, unsigned val);/
5588 <tag/Description/<tt/pokewsys/ writes one word to the given address in the
5589 system bank (bank 15) of the CBM PET-II machines. Following the usual 6502
5590 conventions, the low byte of <tt/val/ is written to <tt/addr/, and the
5591 high byte is written to <tt/addr+1/.
5592 <tag/Notes/<itemize>
5593 <item>The function is only available as fastcall function, so it may only
5594 be used in presence of a prototype.
5595 <item>The order in which the two bytes are written is undefined.
5596 </itemize>
5597 <tag/Availability/cc65
5598 <tag/See also/
5599 <ref id="POKE" name="POKE">,
5600 <ref id="POKEW" name="POKEW">,
5601 <ref id="peekbsys" name="peekbsys">,
5602 <ref id="peekwsys" name="peekwsys">,
5603 <ref id="pokebsys" name="pokebsys">
5604 <tag/Example/None.
5605 </descrip>
5606 </quote>
5607
5608
5609 <sect1>qsort<label id="qsort"><p>
5610
5611 <quote>
5612 <descrip>
5613 <tag/Function/Sort an array.
5614 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
5615 <tag/Declaration/<tt/void __fastcall__ qsort (void* base, size_t count,
5616 size_t size, int __fastcall__ (* compare) (const void*, const void*));/
5617 <tag/Description/<tt/qsort/ sorts an array according to a given compare
5618 function <tt/compare/. <tt/base/ is the address of the array, <tt/count/
5619 is the number of elements, <tt/size/ the size of an element and <tt/compare/
5620 the function used to compare the members.
5621 <tag/Notes/<itemize>
5622 <item>If there are multiple members with the same key, the order after calling
5623 the function is undefined.
5624 <item>The function is only available as fastcall function, so it may only
5625 be used in presence of a prototype.
5626 <item>The function to which <tt/compare/ points must have the <tt/fastcall/
5627 calling convention.
5628 </itemize>
5629 <tag/Availability/ISO 9899
5630 <tag/See also/
5631 <ref id="bsearch" name="bsearch">
5632 <tag/Example/None.
5633 </descrip>
5634 </quote>
5635
5636
5637 <sect1>raise<label id="raise"><p>
5638
5639 <quote>
5640 <descrip>
5641 <tag/Function/Send a signal to the executing program.
5642 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
5643 <tag/Declaration/<tt/int __fastcall__ raise (int sig);/
5644 <tag/Description/<tt/raise/ sends the given signal to the program. If the
5645 program has installed a signal handler for the signal, this signal handler
5646 will be executed. If no handler has been installed, the default action for
5647 the raised signal will be taken. The function returns zero on success,
5648 nonzero otherwise.
5649 <tag/Notes/<itemize>
5650 <item>The function is only available as fastcall function, so it may only
5651 be used in presence of a prototype.
5652 </itemize>
5653 <tag/Availability/ISO 9899
5654 <tag/See also/
5655 <ref id="abort" name="abort">,
5656 <ref id="signal" name="signal">
5657 <tag/Example/None.
5658 </descrip>
5659 </quote>
5660
5661
5662 <sect1>rand<label id="rand"><p>
5663
5664 <quote>
5665 <descrip>
5666 <tag/Function/Return a pseudo random number.
5667 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
5668 <tag/Declaration/<tt/int rand (void);/
5669 <tag/Description/The function returns a pseudo random number
5670 between 0 and <tt/RAND_MAX/ (exclusive).
5671 <tag/Notes/<itemize>
5672 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
5673 flow of numbers is generated.
5674 <item>On startup, the function behaves as if <ref id="srand" name="srand">
5675 had been used with an argument of 1.
5676 </itemize>
5677 <tag/Availability/ISO 9899
5678 <tag/See also/
5679 <ref id="_randomize" name="_randomize">,
5680 <ref id="srand" name="srand">
5681 <tag/Example/None.
5682 </descrip>
5683 </quote>
5684
5685
5686 <sect1>readdir<label id="readdir"><p>
5687
5688 <quote>
5689 <descrip>
5690 <tag/Function/Read a directory.
5691 <tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
5692 <tag/Declaration/<tt/struct dirent* __fastcall__ readdir (DIR* dir);/
5693 <tag/Description/<tt/readdir/ reads the next directory entry from the directory
5694 stream pointed to by <tt/dir/. It stores the data in a <tt/dirent/ structure
5695 and returns a pointer to it. If the end of directory is reached, or an error
5696 occurs, NULL is returned. In case of errors, an error code is stored into
5697 <tt/errno/.
5698 <tag/Notes/<itemize>
5699 <item>The function is only available as fastcall function, so it may only
5700 be used in presence of a prototype.
5701 <item>The returned pointer may point to a statically allocated instance of
5702 <tt/struct dirent/, so it may get overwritten by subsequent calls to
5703 <tt/readdir/.
5704 <item>On several platforms, namely the CBMs and the Atari, the disk drives get
5705 confused when opening/closing files between directory reads. So for example a
5706 program that reads the list of files on a disk, and after each call to
5707 <tt/readdir/, opens the file to process it, will fail.<newline>
5708 Possible solutions are reading the directory into memory before processing the
5709 file list, or to reset the directory by seeking to the correct position after
5710 opening/closing a file:
5711 <verb>
5712         seekdir (DIR, telldir (DIR));
5713 </verb>
5714 Platforms known to work without problems are: Apple.
5715 </itemize>
5716 <tag/Availability/POSIX 1003.1
5717 <tag/See also/
5718 <ref id="closedir" name="closedir">,
5719 <ref id="opendir" name="opendir">
5720 <tag/Example/None.
5721 </descrip>
5722 </quote>
5723
5724
5725 <sect1>realloc<label id="realloc"><p>
5726
5727 <quote>
5728 <descrip>
5729 <tag/Function/Change the size of an allocated memory block.
5730 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
5731 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
5732 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
5733 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
5734 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
5735 behaves as if <tt/free/ had been called. On error (not enough memory
5736 available), <tt/realloc/ returns <tt/NULL/.
5737 <tag/Notes/<itemize>
5738 <item>The part of the memory block that is returned will have its contents
5739 unchanged.
5740 <item>This function is somewhat dangerous to use. Be careful to save the
5741 pointer you're passing somewhere else, otherwise
5742 <tscreen><verb>
5743         ptr = realloc (ptr, size);
5744 </verb></tscreen>
5745 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
5746 <item>The function is only available as fastcall function, so it may only
5747 be used in presence of a prototype.
5748 </itemize>
5749 <tag/Availability/ISO 9899
5750 <tag/See also/
5751 <ref id="_heapadd" name="_heapadd">,
5752 <ref id="_heapblocksize" name="_heapblocksize">,
5753 <ref id="_heapmaxavail" name="_heapmaxavail">,
5754 <ref id="_heapmemavail" name="_heapmemavail">,
5755 <ref id="calloc" name="calloc">,
5756 <ref id="free" name="free">,
5757 <ref id="realloc" name="realloc">
5758 <tag/Example/None.
5759 </descrip>
5760 </quote>
5761
5762
5763 <sect1>remove<label id="remove"><p>
5764
5765 <quote>
5766 <descrip>
5767 <tag/Function/Delete a file.
5768 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
5769 <tag/Declaration/<tt/int __fastcall__ remove (const char* name);/
5770 <tag/Description/<tt/remove/ deletes the file with the given name. On success,
5771 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
5772 code describing the reason for the failure.
5773 <tag/Notes/<itemize>
5774 <item>This function is not available on all cc65 targets (depends on the
5775 availability of file I/O).
5776 <item>The function is only available as fastcall function, so it may only
5777 be used in presence of a prototype.
5778 </itemize>
5779 <tag/Availability/ISO 9899
5780 <tag/See also/
5781 <ref id="rename" name="rename">,
5782 <ref id="unlink" name="unlink">
5783 <tag/Example/
5784 <verb>
5785 #include &lt;stdio.h&gt;
5786
5787 #define FILENAME "helloworld"
5788
5789 if (remove (FILENAME) == 0) {
5790     printf ("We deleted %s successfully\n", FILENAME);
5791 } else {
5792     printf ("There was a problem deleting %s\n", FILENAME);
5793 }
5794 </verb>
5795 </descrip>
5796 </quote>
5797
5798
5799 <sect1>rename<label id="rename"><p>
5800
5801 <quote>
5802 <descrip>
5803 <tag/Function/Rename a file.
5804 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
5805 <tag/Declaration/<tt/int __fastcall__ rename (const char* oldname, const char* newname);/
5806 <tag/Description/<tt/rename/ renames a file (gives it a new name). On success,
5807 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
5808 code describing the reason for the failure.
5809 <tag/Notes/<itemize>
5810 <item>This function is not available on all cc65 targets (depends on the
5811 capabilities of the storage devices).
5812 <item>The function is only available as fastcall function, so it may only
5813 be used in presence of a prototype.
5814 </itemize>
5815 <tag/Availability/ISO 9899
5816 <tag/See also/
5817 <ref id="remove" name="remove">
5818 <tag/Example/
5819 <verb>
5820 #include &lt;stdio.h&gt;
5821
5822 #define OLDNAME "textfile.txt"
5823 #define NEWNAME "textfile.bak"
5824
5825 if (rename (OLDNAME, NEWNAME) == 0) {
5826     printf ("Renamed %s to %s\n", OLDNAME, NEWNAME);
5827 } else {
5828     printf ("Error renaming %s to %s\n", OLDNAME, NEWNAME);
5829 }
5830 </verb>
5831 </descrip>
5832 </quote>
5833
5834
5835 <sect1>reset_brk<label id="reset_brk"><p>
5836
5837 <quote>
5838 <descrip>
5839 <tag/Function/Resets the break vector to its original value.
5840 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
5841 <tag/Declaration/<tt/void reset_brk (void);/
5842 <tag/Description/<tt/reset_brk/ resets the break vector to the value it had
5843 before a call to <tt/set_brk/.
5844 <tag/Notes/<itemize>
5845 <item>The break vector is reset on program termination, so it's not strictly
5846 necessary to call this function as a part of your clean-up when exitting the program.
5847 </itemize>
5848 <tag/Availability/cc65
5849 <tag/See also/
5850 <ref id="reset_irq" name="reset_irq">,
5851 <ref id="set_brk" name="set_brk">,
5852 <ref id="set_irq" name="set_irq">
5853 <tag/Example/None.
5854 </descrip>
5855 </quote>
5856
5857
5858 <sect1>reset_irq<label id="reset_irq"><p>
5859
5860 <quote>
5861 <descrip>
5862 <tag/Function/Resets the C level interrupt request vector.
5863 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
5864 <tag/Declaration/<tt/void reset_irq (void);/
5865 <tag/Description/<tt/reset_irq/ resets the C level interrupt request vector.
5866 <tag/Notes/<itemize>
5867 <item>The interrupt vector is reset on program termination, so it's not strictly
5868 necessary to call this function as a part of your clean-up when exitting the program.
5869 </itemize>
5870 <tag/Availability/cc65
5871 <tag/See also/
5872 <ref id="reset_brk" name="reset_brk">,
5873 <ref id="set_brk" name="set_brk">,
5874 <ref id="set_irq" name="set_irq">
5875 <tag/Example/None.
5876 </descrip>
5877 </quote>
5878
5879
5880 <sect1>revers<label id="revers"><p>
5881
5882 <quote>
5883 <descrip>
5884 <tag/Function/Control revers character display.
5885 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
5886 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
5887 <tag/Description/If the argument is non zero, the function enables reverse
5888 character display. If the argument is zero, reverse character display is
5889 switched off. The old value of the setting is returned.
5890 <tag/Notes/<itemize>
5891 <item>The function may not be supported by the hardware, in which case
5892 the call is ignored.
5893 <item>The function is only available as fastcall function, so it may only
5894 be used in presence of a prototype.
5895 </itemize>
5896 <tag/Availability/cc65
5897 <tag/See also/
5898 <ref id="textcolor" name="textcolor">
5899 <tag/Example/None.
5900 </descrip>
5901 </quote>
5902
5903
5904 <sect1>rewinddir<label id="rewinddir"><p>
5905
5906 <quote>
5907 <descrip>
5908 <tag/Function/Reset a directory stream.
5909 <tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
5910 <tag/Declaration/<tt/void __fastcall__ rewinddir (DIR* dir);/
5911 <tag/Description/<tt/rewinddir/ sets the position of the directory stream
5912 pointed to by <tt/dir/ to the start of the directory.
5913 <tag/Notes/<itemize>
5914 <item>The function is only available as fastcall function, so it may only
5915 be used in presence of a prototype.
5916 </itemize>
5917 <tag/Availability/POSIX 1003.1
5918 <tag/See also/
5919 <ref id="seekdir" name="seekdir">,
5920 <ref id="telldir" name="telldir">
5921 <tag/Example/None.
5922 </descrip>
5923 </quote>
5924
5925
5926 <sect1>screensize<label id="screensize"><p>
5927
5928 <quote>
5929 <descrip>
5930 <tag/Function/Return the dimensions of the text mode screen.
5931 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
5932 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
5933 <tag/Description/The function returns the dimensions of the text mode screen.
5934 <tag/Notes/<itemize>
5935 <item>The function is only available as fastcall function, so it may only
5936 be used in presence of a prototype.
5937 </itemize>
5938 <tag/Availability/cc65
5939 <tag/See also/
5940 <ref id="gotox" name="gotox">,
5941 <ref id="gotoxy" name="gotoxy">,
5942 <ref id="gotoy" name="gotoy">,
5943 <ref id="wherex" name="wherex">,
5944 <ref id="wherey" name="wherey">
5945 <tag/Example/None.
5946 </descrip>
5947 </quote>
5948
5949
5950 <sect1>seekdir<label id="seekdir"><p>
5951
5952 <quote>
5953 <descrip>
5954 <tag/Function/Set the position of a directory stream.
5955 <tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
5956 <tag/Declaration/<tt/void __fastcall__ seekdir (DIR* dir, long offset);/
5957 <tag/Description/<tt/seekdir/ sets the position of the directory stream
5958 pointed to by <tt/dir/ to the value given in <tt/offset/, which should be a
5959 value returned by <tt/<ref id="telldir" name="telldir">/.
5960 <tag/Notes/<itemize>
5961 <item>The function is only available as fastcall function, so it may only
5962 be used in presence of a prototype.
5963 </itemize>
5964 <tag/Availability/POSIX 1003.1
5965 <tag/See also/
5966 <ref id="rewinddir" name="rewinddir">,
5967 <ref id="telldir" name="telldir">
5968 <tag/Example/None.
5969 </descrip>
5970 </quote>
5971
5972
5973 <sect1>ser_close<label id="ser_close"><p>
5974
5975 <quote>
5976 <descrip>
5977 <tag/Function/Close the port and disable interrupts
5978 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
5979 <tag/Declaration/<tt/unsigned char ser_close (void);/
5980 <tag/Description/Close the port by clearing buffers and disable interrupts.
5981 <tag/Availability/cc65
5982 <tag/See also/Other serial functions.
5983 <tag/Example/
5984 <verb>
5985 #include <serial.h>
5986
5987 static void initialize(){
5988   struct ser_params params = {
5989     SER_BAUD_9600,
5990     SER_BITS_8,
5991     SER_STOP_1,
5992     SER_PAR_MARK,
5993     SER_HS_NONE
5994   };
5995   ser_install(lynx_comlynx); // This will activate the ComLynx
5996   CLI();
5997   ser_open(&amp;params);
5998 }
5999 </verb>
6000 </descrip>
6001 </quote>
6002
6003
6004 <sect1>ser_get<label id="ser_get"><p>
6005
6006 <quote>
6007 <descrip>
6008 <tag/Function/Read a character from serial port.
6009 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
6010 <tag/Declaration/<tt/unsigned char __fastcall__ ser_get (char* b);/
6011 <tag/Description/Get a character from the serial port. If no characters are
6012 available, the function will return SER_ERR_NO_DATA, so this is not a fatal
6013 error.
6014 <tag/Notes/<itemize>
6015 <item>The function is only available as fastcall function, so it may only
6016 be used in presence of a prototype.
6017 </itemize>
6018 <tag/Availability/cc65
6019 <tag/See also/Other serial functions.
6020 <tag/Example/
6021 Wait for a character to be available from a serial port.
6022 <verb>
6023 char ch;
6024 while (ser_get(&amp;ch) == SER_ERR_NO_DATA)
6025   ;
6026 </verb>
6027 </descrip>
6028 </quote>
6029
6030
6031 <sect1>ser_install<label id="ser_install"><p>
6032
6033 <quote>
6034 <descrip>
6035 <tag/Function/Install an already loaded driver and return an error code.
6036 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
6037 <tag/Declaration/<tt/unsigned char __fastcall__ ser_install (void* driver);/
6038 <tag/Description/The function installs a driver that was already loaded into
6039 memory (or linked statically to the program). It returns an error code
6040 (<tt/SER_ERR_OK/ in case of success).
6041 <tag/Notes/<itemize>
6042 <item>The function is only available as fastcall function, so it may only be
6043 used in presence of a prototype.
6044 </itemize>
6045 <tag/Availability/cc65
6046 <tag/See also/
6047 <ref id="ser_load_driver" name="ser_load_driver">,
6048 <ref id="ser_uninstall" name="ser_uninstall">,
6049 <ref id="ser_unload" name="ser_unload">
6050 <tag/Example/<verb>
6051 ser_install(lynx_comlynx); //Include the driver statically instead of loading it.
6052 </verb>
6053 </descrip>
6054 </quote>
6055
6056
6057 <sect1>ser_ioctl<label id="ser_ioctl"><p>
6058
6059 <quote>
6060 <descrip>
6061 <tag/Function/Platform dependent code extensions.
6062 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
6063 <tag/Declaration/<tt/unsigned __fastcall__ ser_ioctl (unsigned char code, void* data);/
6064 <tag/Description/Some platforms have extra serial functions that are not
6065 supported by standard serial driver functions. You can extend the driver to support
6066 this extra functionality bt using ser_ioctl functions.
6067 <tag/Notes/<itemize>
6068 <item>The function is only available as fastcall function, so it may only
6069 be used in presence of a prototype.
6070 <item>These functions are not easily portable to other cc65 platforms.
6071 </itemize>
6072 <tag/Availability/cc65
6073 <tag/See also/Other serial functions.
6074 <tag/Example/None
6075 </descrip>
6076 </quote>
6077
6078 <sect1>ser_load_driver<label id="ser_load_driver"><p>
6079
6080 <quote>
6081 <descrip>
6082 <tag/Function/Load and install a serial driver.
6083 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
6084 <tag/Declaration/<tt/unsigned char __fastcall__ ser_load_driver (const char *name);/
6085 <tag/Description/Load and install the driver by name.
6086 Will just load the driver and check if loading was successful.
6087 <tag/Notes/<itemize>
6088 <item>The function is only available as fastcall function, so it may only
6089 be used in presence of a prototype.
6090 </itemize>
6091 <tag/Availability/cc65
6092 <tag/See also/Other serial functions.
6093 <tag/Example/None.
6094 </descrip>
6095 </quote>
6096
6097
6098 <sect1>ser_open<label id="ser_open"><p>
6099
6100 <quote>
6101 <descrip>
6102 <tag/Function/Open the port by setting the port parameters and enable interrupts
6103 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
6104 <tag/Declaration/<tt/unsigned char __fastcall__ ser_open (const struct ser_params* params);/
6105 <tag/Description/Open the port by setting the port parameters and enable interrupts.
6106 <tag/Notes/<itemize>
6107 <item>The function is only available as fastcall function, so it may only
6108 be used in presence of a prototype.
6109 </itemize>
6110 <tag/Availability/cc65
6111 <tag/See also/Other serial functions.
6112 <tag/Example/
6113 <verb>
6114 #include <serial.h>
6115
6116 static void initialize(){
6117   struct ser_params params = {
6118     SER_BAUD_9600,
6119     SER_BITS_8,
6120     SER_STOP_1,
6121     SER_PAR_MARK,
6122     SER_HS_NONE
6123   };
6124   ser_install(lynx_comlynx); // This will activate the ComLynx
6125   CLI();
6126   ser_open(&amp;params);
6127 }
6128 </verb>
6129 </descrip>
6130 </quote>
6131
6132
6133 <sect1>ser_put<label id="ser_put"><p>
6134
6135 <quote>
6136 <descrip>
6137 <tag/Function/Write a character to a serial port.
6138 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
6139 <tag/Declaration/<tt/unsigned char __fastcall__ ser_put (char b);/
6140 <tag/Description/Send a character via the serial port. There is a transmit
6141 buffer, but transmitting is not done via interrupt. The function returns
6142 SER_ERR_OVERFLOW if there is no space left in the transmit buffer.
6143 <tag/Notes/<itemize>
6144 <item>The function is only available as fastcall function, so it may only
6145 be used in presence of a prototype.
6146 </itemize>
6147 <tag/Availability/cc65
6148 <tag/See also/Other serial functions.
6149 <tag/Example/
6150 <verb>
6151 ser_put('A');
6152 </verb>
6153 </descrip>
6154 </quote>
6155
6156
6157 <sect1>ser_status<label id="ser_status"><p>
6158
6159 <quote>
6160 <descrip>
6161 <tag/Function/Return the serial port status.
6162 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
6163 <tag/Declaration/<tt/unsigned char __fastcall__ ser_status (unsigned char* status);/
6164 <tag/Description/Return the serial port status.
6165 <tag/Notes/<itemize>
6166 <item>The function is only available as fastcall function, so it may only
6167 be used in presence of a prototype.
6168 </itemize>
6169 <tag/Availability/cc65
6170 <tag/See also/Other serial functions.
6171 <tag/Example/None
6172 </descrip>
6173 </quote>
6174
6175
6176 <sect1>ser_uninstall<label id="ser_uninstall"><p>
6177
6178 <quote>
6179 <descrip>
6180 <tag/Function/Uninstall the currently loaded driver but do not unload it.
6181 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
6182 <tag/Declaration/<tt/unsigned char ser_uninstall (void);/
6183 <tag/Description/Uninstall the currently loaded driver but do not unload it.
6184 <tag/Availability/cc65
6185 <tag/See also/Other serial functions.
6186 <tag/Example/None.
6187 </descrip>
6188 </quote>
6189
6190 <sect1>ser_unload<label id="ser_unload"><p>
6191
6192 <quote>
6193 <descrip>
6194 <tag/Function/Uninstall, then unload the currently loaded driver.
6195 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
6196 <tag/Declaration/<tt/unsigned char ser_unload (void);/
6197 <tag/Description/Uninstall, then unload the currently loaded driver.
6198 <tag/Availability/cc65
6199 <tag/See also/Other serial functions.
6200 <tag/Example/None.
6201 </descrip>
6202 </quote>
6203
6204
6205 <sect1>set_brk<label id="set_brk"><p>
6206
6207 <quote>
6208 <descrip>
6209 <tag/Function/Set the break vector to a user function.
6210 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
6211 <tag/Declaration/<tt/void __fastcall__ set_brk (brk_handler func);/
6212 <tag/Description/<tt/set_brk/ allows a user program to handle breaks within the
6213 program code by letting the vector point to a user written C function. The
6214 runtime library installs a small stub that saves the registers into global
6215 variables that may be accessed (and changed) by the break handler.
6216 <tag/Notes/<itemize>
6217 <item>The function is only available as fastcall function, so it may only
6218 be used in presence of a prototype.
6219 <item>The stub saves the zero page registers used by the C runtime and switches
6220 to a small break handler stack. This means that it is safe to execute C code,
6221 even if C code was interrupted. Be careful however not to use too many local
6222 variables, and do not enable stack checks for the handler function or any other
6223 function called from it.
6224 <item>The <tt/brk_pc/ variable points to the <tt/BRK/ instruction. If you want
6225 the continue with the interrupted code, you have to adjust <tt/brk_pc/,
6226 otherwise the <tt/BRK/ instruction will get executed over and over again.
6227 <item>The break vector is reset on program termination, so it's not strictly
6228 necessary to call <tt/<ref id="reset_brk" name="reset_brk">/ as a part of your
6229 clean-up when exitting the program.
6230 </itemize>
6231 <tag/Availability/cc65
6232 <tag/See also/
6233 <ref id="reset_brk" name="reset_brk">
6234 <tag/Example/None.
6235 </descrip>
6236 </quote>
6237
6238
6239 <sect1>set_irq<label id="set_irq"><p>
6240
6241 <quote>
6242 <descrip>
6243 <tag/Function/Set the C level interrupt request vector to the given address.
6244 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
6245 <tag/Declaration/<tt/void __fastcall__ set_irq (irq_handler f, void *stack_addr, size_t stack_size);/
6246 <tag/Description/<tt/set_irq/ allows a user program to handle interrupt requests
6247 (IRQs) within the program code by letting the vector point to a user written C
6248 function. The runtime library installs a small stub that saves the zero page
6249 registers used by the C runtime before calling the handler function and restores
6250 them after the handler function returns. Additionally the stub temporarily switches
6251 the C runtime stack to the stack area provided as parameter. If the handler function
6252 was set up to handle a "private", "exclusive" interrupt request source it must
6253 return the value <tt/IRQ_HANDLED/ if and only if it has verified that the current
6254 interrupt request actually stems from that source. In all other cases it must return
6255 the value <tt/IRQ_NOT_HANDLED/.
6256 <tag/Notes/<itemize>
6257 <item>The function is only available as fastcall function, so it may only
6258 be used in presence of a prototype.
6259 <item>The stub saves the registers and zero page locations used by the C runtime
6260 and switches to the provided stack area. As a consequence, there is some
6261 runtime overhead, but it it is safe to execute C code, even if other C code
6262 was interrupted. Be careful however not to call C library functions, and do not
6263 enable stack checks for the handler function or any other function called from
6264 it.
6265 <item>The interrupt vector is reset on program termination, so it's not strictly
6266 necessary to call <tt/<ref id="reset_irq" name="reset_irq">/ as a part of your
6267 clean-up when exitting the program.
6268 </itemize>
6269 <tag/Availability/cc65
6270 <tag/See also/
6271 <ref id="reset_brk" name="reset_brk">,
6272 <ref id="reset_irq" name="reset_irq">,
6273 <ref id="set_brk" name="set_brk">
6274 <tag/Example/None.
6275 </descrip>
6276 </quote>
6277
6278
6279 <sect1>set_c128_speed<label id="set_c128_speed"><p>
6280
6281 <quote>
6282 <descrip>
6283 <tag/Function/Set the current speed of a C128 CPU.
6284 <tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
6285 <tag/Declaration/<tt/unsigned char __fastcall__ set_c128_speed (unsigned char speed);/
6286 <tag/Description/The function returns the speed after trying to set the speed of the C128 CPU.
6287 <tag/Notes/<itemize>
6288 <item>The function is specific to the C64 and C128.
6289 <item>The function does not check if the C128 CPU is the current CPU.
6290 <item>See the accelerator.h header for the speed definitions.
6291 </itemize>
6292 <tag/Availability/cc65 (not all platforms)
6293 <tag/See also/
6294 <ref id="detect_c128" name="detect_c128">,
6295 <ref id="get_c128_speed" name="get_c128_speed">,
6296 <tag/Example/None.
6297 </descrip>
6298 </quote>
6299
6300
6301 <sect1>set_c64dtv_speed<label id="set_c64dtv_speed"><p>
6302
6303 <quote>
6304 <descrip>
6305 <tag/Function/Set the current speed of the C64DTV.
6306 <tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
6307 <tag/Declaration/<tt/unsigned char __fastcall__ set_c64dtv_speed (unsigned char speed);/
6308 <tag/Description/The function returns the speed after trying to set the speed of the C64DTV.
6309 <tag/Notes/<itemize>
6310 <item>The function is specific to the C64.
6311 <item>The function does not check for the presence of the C64DTV.
6312 <item>See the accelerator.h header for the speed definitions.
6313 </itemize>
6314 <tag/Availability/cc65 (not all platforms)
6315 <tag/See also/
6316 <ref id="detect_c64dtv" name="detect_c64dtv">,
6317 <ref id="get_c64dtv_speed" name="get_c64dtv_speed">,
6318 <tag/Example/None.
6319 </descrip>
6320 </quote>
6321
6322
6323 <sect1>set_c65_speed<label id="set_c65_speed"><p>
6324
6325 <quote>
6326 <descrip>
6327 <tag/Function/Set the current speed of the C65/C64DX in C64 mode.
6328 <tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
6329 <tag/Declaration/<tt/unsigned char __fastcall__ set_c65_speed (unsigned char speed);/
6330 <tag/Description/The function returns the speed after trying to set the speed of the C65/C64DX in C64 mode.
6331 <tag/Notes/<itemize>
6332 <item>The function is specific to the C64.
6333 <item>The function does not check for the presence of a C65/C64DX in C64 mode.
6334 <item>See the accelerator.h header for the speed definitions.
6335 </itemize>
6336 <tag/Availability/cc65 (not all platforms)
6337 <tag/See also/
6338 <ref id="detect_c65" name="detect_c65">,
6339 <ref id="get_c65_speed" name="get_c65_speed">,
6340 <tag/Example/None.
6341 </descrip>
6342 </quote>
6343
6344
6345 <sect1>set_chameleon_speed<label id="set_chameleon_speed"><p>
6346
6347 <quote>
6348 <descrip>
6349 <tag/Function/Set the current speed of the C64 Chameleon cartridge.
6350 <tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
6351 <tag/Declaration/<tt/unsigned char __fastcall__ set_chameleon_speed (unsigned char speed);/
6352 <tag/Description/The function returns the speed after trying to set the speed of the C64 Chameleon cartridge.
6353 <tag/Notes/<itemize>
6354 <item>The function is specific to the C64.
6355 <item>The function does not check for the presence of the C64 Chameleon cartridge.
6356 <item>See the accelerator.h header for the speed definitions.
6357 </itemize>
6358 <tag/Availability/cc65 (not all platforms)
6359 <tag/See also/
6360 <ref id="detect_chameleon" name="detect_chameleon">,
6361 <ref id="get_chameleon_speed" name="get_chameleon_speed">,
6362 <tag/Example/None.
6363 </descrip>
6364 </quote>
6365
6366
6367 <sect1>set_turbomaster_speed<label id="set_turbomaster_speed"><p>
6368
6369 <quote>
6370 <descrip>
6371 <tag/Function/Set the current speed of the C64 Turbo Master cartridge.
6372 <tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
6373 <tag/Declaration/<tt/unsigned char __fastcall__ set_turbomaster_speed (unsigned char speed);/
6374 <tag/Description/The function returns the speed after trying to set the speed of the C64 Turbo Master cartridge.
6375 <tag/Notes/<itemize>
6376 <item>The function is specific to the C64.
6377 <item>The function does not check for the presence of the C64 Turbo Master cartridge.
6378 <item>See the accelerator.h header for the speed definitions.
6379 </itemize>
6380 <tag/Availability/cc65 (not all platforms)
6381 <tag/See also/
6382 <ref id="detect_turbomaster" name="detect_turbomaster">,
6383 <ref id="get_turbomaster_speed" name="get_turbomaster_speed">,
6384 <tag/Example/None.
6385 </descrip>
6386 </quote>
6387
6388
6389 <sect1>set_scpu_speed<label id="set_scpu_speed"><p>
6390
6391 <quote>
6392 <descrip>
6393 <tag/Function/Set the current speed of the C64/C128 SuperCPU cartridge.
6394 <tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
6395 <tag/Declaration/<tt/unsigned char __fastcall__ set_scpu_speed (unsigned char speed);/
6396 <tag/Description/The function returns the speed after trying to set the speed of the SuperCPU cartridge.
6397 <tag/Notes/<itemize>
6398 <item>The function is specific to the C128 and C64.
6399 <item>The function does not check for the presence of the cartridge.
6400 <item>See the accelerator.h header for the speed definitions.
6401 </itemize>
6402 <tag/Availability/cc65 (not all platforms)
6403 <tag/See also/
6404 <ref id="detect_scpu" name="detect_scpu">,
6405 <ref id="get_scpu_speed" name="get_scpu_speed">,
6406 <tag/Example/None.
6407 </descrip>
6408 </quote>
6409
6410
6411 <sect1>setjmp<label id="setjmp"><p>
6412
6413 <quote>
6414 <descrip>
6415 <tag/Function/Save the context for use with <tt/longjmp/.
6416 <tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
6417 <tag/Declaration/<tt/int __fastcall__ setjmp (jmp_buf buf);/
6418 <tag/Description/The <tt/setjmp/ function saves the current context in <tt/buf/
6419 for subsequent use by the <tt/<ref id="longjmp" name="longjmp">/ function and
6420 returns zero.
6421 <tag/Notes/<itemize>
6422 <item>The function is only available as fastcall function, so it may only
6423 be used in presence of a prototype.
6424 <item><tt/setjmp/ is actually a macro as required by the ISO standard.
6425 <item><tt/setjmp/ will not save the signal context.
6426 </itemize>
6427 <tag/Availability/ISO 9899
6428 <tag/See also/
6429 <ref id="longjmp" name="longjmp">
6430 <tag/Example/None.
6431 </descrip>
6432 </quote>
6433
6434
6435 <sect1>setlocale<label id="setlocale"><p>
6436
6437 <quote>
6438 <descrip>
6439 <tag/Function/Selects a locale.
6440 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
6441 <tag/Declaration/<tt/char* __fastcall__ setlocale (int category, const char* locale);/
6442 <tag/Description/<tt/setlocale/ sets or queries the program's locale.
6443 <tag/Notes/<itemize>
6444 <item>The function is only available as fastcall function, so it may only
6445 be used in presence of a prototype.
6446 <item>cc65 supports only the "C" locale, so calling this function to set a
6447 different locale has no effect.
6448 </itemize>
6449 <tag/Availability/ISO 9899
6450 <tag/See also/
6451 <ref id="localeconv" name="localeconv">,
6452 <ref id="strcoll" name="strcoll">
6453 <ref id="strxfrm" name="strxfrm">
6454 <tag/Example/None.
6455 </descrip>
6456 </quote>
6457
6458
6459 <sect1>signal<label id="signal"><p>
6460
6461 <quote>
6462 <descrip>
6463 <tag/Function/Install a signal handler.
6464 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
6465 <tag/Declaration/<tt/__sigfunc __fastcall__ signal (int sig, __sigfunc func);/
6466 <tag/Description/<tt/signal/ installs a handler for the given signal. The
6467 handler may either be a user supplied function, or one of the predefined
6468 signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
6469 previous value if the signal , or the special function vector SIG_ERR in
6470 case of an error.
6471 <tag/Notes/<itemize>
6472 <item>The function is only available as fastcall function, so it may only
6473 be used in presence of a prototype.
6474 </itemize>
6475 <tag/Availability/ISO 9899
6476 <tag/See also/
6477 <ref id="abort" name="abort">,
6478 <ref id="raise" name="raise">
6479 <tag/Example/None.
6480 </descrip>
6481 </quote>
6482
6483
6484 <sect1>sleep<label id="sleep"><p>
6485
6486 <quote>
6487 <descrip>
6488 <tag/Function/Sleep for a specified amount of time.
6489 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
6490 <tag/Declaration/<tt/void __fastcall__ sleep (unsigned seconds);/
6491 <tag/Description/The function will return after the specified number of
6492 seconds have elapsed.
6493 <tag/Notes/<itemize>
6494 <item>The function is only available as fastcall function, so it may only
6495 be used in presence of a prototype.
6496 </itemize>
6497 <tag/Availability/POSIX 1003.1
6498 <tag/Example/None.
6499 </descrip>
6500 </quote>
6501
6502
6503 <sect1>slow<label id="slow"><p>
6504
6505 <quote>
6506 <descrip>
6507 <tag/Function/Switch the CPU into slow mode (C128: 1MHz mode, C16/Plus4: single clock mode).
6508 <tag/Header/<tt/<ref id="c128.h" name="c128.h">,
6509 <ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
6510 <tag/Declaration/<tt/void slow (void);/
6511 <tag/Description/The function will switch the clock of the CPU to slow mode. for the C128
6512 target it means switching the CPU into 1MHz mode. for the C16/Plus4 target it means
6513 switching the CPU into single clock mode.
6514 <tag/Notes/<itemize>
6515 <item>The function is specific to the C128, C16 and Plus4.
6516 </itemize>
6517 <tag/Availability/cc65 (not all platforms)
6518 <tag/See also/
6519 <ref id="fast" name="fast">,
6520 <ref id="isfast" name="isfast">,
6521 <tag/Example/None.
6522 </descrip>
6523 </quote>
6524
6525
6526 <sect1>srand<label id="srand"><p>
6527
6528 <quote>
6529 <descrip>
6530 <tag/Function/Initialize the pseudo random number generator.
6531 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
6532 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
6533 <tag/Description/The function initializes the random number generator using
6534 the given seed. On program startup, the generator behaves as if <tt/srand/ has
6535 been called with an argument of 1.
6536 <tag/Notes/<itemize>
6537 <item>The function is only available as fastcall function, so it may only
6538 be used in presence of a prototype.
6539 </itemize>
6540 <tag/Availability/ISO 9899
6541 <tag/See also/
6542 <ref id="_randomize" name="_randomize">,
6543 <ref id="rand" name="rand">
6544 <tag/Example/None.
6545 </descrip>
6546 </quote>
6547
6548
6549 <sect1>strcasecmp<label id="strcasecmp"><p>
6550
6551 <quote>
6552 <descrip>
6553 <tag/Function/Compare two strings case insensitive.
6554 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6555 <tag/Declaration/<tt/int __fastcall__ strcasecmp (const char* s1, const char* s2);/
6556 <tag/Description/The <tt/strcasecmp/ function compares the two strings passed
6557 as parameters without case sensitivity. It returns a value that is less than
6558 zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
6559 and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
6560 <tag/Notes/<itemize>
6561 <item>The function is only available as fastcall function, so it may only
6562 be used in presence of a prototype.
6563 <item>The function is not available in strict ANSI mode.
6564 </itemize>
6565 <tag/Availability/cc65
6566 <tag/See also/
6567 <ref id="strcmp" name="strcmp">,
6568 <ref id="strcoll" name="strcoll">,
6569 <ref id="stricmp" name="stricmp">,
6570 <ref id="strncmp" name="strncmp">,
6571 <ref id="strxfrm" name="strxfrm">
6572 <tag/Example/None.
6573 </descrip>
6574 </quote>
6575
6576
6577 <sect1>strcat<label id="strcat"><p>
6578
6579 <quote>
6580 <descrip>
6581 <tag/Function/Concatentate two strings.
6582 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6583 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
6584 <tag/Description/The <tt/strcat/ function appends a copy of the string
6585 pointed to by s2 (including the terminating null byte) to the end of the
6586 string pointed to by s1. The initial byte of s2 overwrites the null byte at
6587 the end of s1.
6588 <tag/Notes/<itemize>
6589 <item>The function is only available as fastcall function, so it may only
6590 be used in presence of a prototype.
6591 <item>If copying takes place between objects that overlap, the behaviour
6592 is undefined.
6593 </itemize>
6594 <tag/Availability/ISO 9899
6595 <tag/See also/
6596 <ref id="strcpy" name="strcpy">,
6597 <ref id="strncat" name="strncat">,
6598 <ref id="strncpy" name="strncpy">
6599 <tag/Example/None.
6600 </descrip>
6601 </quote>
6602
6603
6604 <sect1>strchr<label id="strchr"><p>
6605
6606 <quote>
6607 <descrip>
6608 <tag/Function/Search for a character in a string.
6609 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6610 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
6611 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
6612 (converted to a char) in the string pointed to by <tt/s/. The terminating null
6613 byte is considered to be part of the string. Upon completion, the function
6614 returns a pointer to the byte, or a null pointer if the byte was not found.
6615 <tag/Notes/<itemize>
6616 <item>The function is only available as fastcall function, so it may only
6617 be used in presence of a prototype.
6618 </itemize>
6619 <tag/Availability/ISO 9899
6620 <tag/See also/
6621 <ref id="memchr" name="memchr">,
6622 <ref id="strrchr" name="strrchr">
6623 <tag/Example/None.
6624 </descrip>
6625 </quote>
6626
6627
6628 <sect1>strcmp<label id="strcmp"><p>
6629
6630 <quote>
6631 <descrip>
6632 <tag/Function/Compare two strings.
6633 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6634 <tag/Declaration/<tt/int __fastcall__ strcmp (const char* s1, const char* s2);/
6635 <tag/Description/The <tt/strcmp/ function compares the two strings passed as
6636 parameters. It returns a value that is less than zero if <tt/s1/ is less than
6637 <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater than zero
6638 if <tt/s1/ is greater than <tt/s2/.
6639 <tag/Notes/<itemize>
6640 <item>The function is only available as fastcall function, so it may only
6641 be used in presence of a prototype.
6642 </itemize>
6643 <tag/Availability/ISO 9899
6644 <tag/See also/
6645 <ref id="strcasecmp" name="strcasecmp">,
6646 <ref id="strcoll" name="strcoll">,
6647 <ref id="stricmp" name="stricmp">,
6648 <ref id="strncmp" name="strncmp">
6649 <ref id="strxfrm" name="strxfrm">
6650 <tag/Example/None.
6651 </descrip>
6652 </quote>
6653
6654
6655 <sect1>strcoll<label id="strcoll"><p>
6656
6657 <quote>
6658 <descrip>
6659 <tag/Function/Compare two strings.
6660 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6661 <tag/Declaration/<tt/int __fastcall__ strcoll (const char* s1, const char* s2);/
6662 <tag/Description/The <tt/strcoll/ function compares the two strings passed as
6663 parameters, according to the collating sequence set by <tt/<ref id="setlocale"
6664 name="setlocale">/. It returns a value that is less than zero if <tt/s1/ is
6665 less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater
6666 than zero if <tt/s1/ is greater than <tt/s2/.
6667 <tag/Notes/<itemize>
6668 <item>The function is only available as fastcall function, so it may only
6669 be used in presence of a prototype.
6670 </itemize>
6671 <tag/Availability/ISO 9899
6672 <tag/See also/
6673 <ref id="setlocale" name="setlocale">,
6674 <ref id="strcasecmp" name="strcasecmp">,
6675 <ref id="strcmp" name="strcmp">,
6676 <ref id="stricmp" name="stricmp">,
6677 <ref id="strncmp" name="strncmp">,
6678 <ref id="strxfrm" name="strxfrm">
6679 <tag/Example/None.
6680 </descrip>
6681 </quote>
6682
6683
6684 <sect1>strcpy<label id="strcpy"><p>
6685
6686 <quote>
6687 <descrip>
6688 <tag/Function/Copy a string.
6689 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6690 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
6691 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
6692 <tt/s2/ (including the terminating null byte) into the array pointed to by
6693 <tt/s1/. The function will always return <tt/s1/.
6694 <tag/Notes/<itemize>
6695 <item>The function is only available as fastcall function, so it may only
6696 be used in presence of a prototype.
6697 <item>If copying takes place between objects that overlap, the behaviour
6698 is undefined.
6699 </itemize>
6700 <tag/Availability/ISO 9899
6701 <tag/See also/
6702 <ref id="strcat" name="strcat">,
6703 <ref id="strncat" name="strncat">,
6704 <ref id="strncpy" name="strncpy">
6705 <tag/Example/
6706 <verb>
6707 #include &lt;string.h&gt;
6708
6709 static char hello[14];
6710
6711 strcpy (hello, "Hello world!\n");
6712 </verb>
6713 </descrip>
6714 </quote>
6715
6716
6717 <sect1>strcspn<label id="strcspn"><p>
6718
6719 <quote>
6720 <descrip>
6721 <tag/Function/Compute the length of a substring.
6722 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6723 <tag/Declaration/<tt/size_t __fastcall__ strcspn (const char* s, const char* set);/
6724 <tag/Description/The <tt/strcspn/ function computes and returns the length of
6725 the substring pointed to by <tt/s/ which does <em>not</em> consist of
6726 characters contained in the string <tt/set/.
6727 <tag/Notes/<itemize>
6728 <item>The function is only available as fastcall function, so it may only
6729 be used in presence of a prototype.
6730 </itemize>
6731 <tag/Availability/ISO 9899
6732 <tag/See also/
6733 <ref id="strqtok" name="strqtok">,
6734 <ref id="strspn" name="strspn">,
6735 <ref id="strstr" name="strstr">,
6736 <ref id="strtok" name="strtok">
6737 <tag/Example/None.
6738 </descrip>
6739 </quote>
6740
6741
6742 <sect1>strdup<label id="strdup"><p>
6743
6744 <quote>
6745 <descrip>
6746 <tag/Function/Allocate a copy of a string on the heap.
6747 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6748 <tag/Declaration/<tt/char* __fastcall__ strdup (const char* s);/
6749 <tag/Description/<tt/strdup/ allocates a memory block on the heap, big enough
6750 to hold a copy of <tt/s/ including the terminating zero. If the allocation
6751 fails, <tt/NULL/ is returned, otherwise <tt/s/ is copied into the allocated
6752 memory block, and a pointer to the block is returned.
6753 <tag/Notes/<itemize>
6754 <item>The function is only available as fastcall function, so it may only
6755 be used in presence of a prototype.
6756 <item>It is up to the caller to free the allocated memory block.
6757 </itemize>
6758 <tag/Availability/ISO 9899
6759 <tag/See also/
6760 <ref id="free" name="free">,
6761 <ref id="malloc" name="malloc">
6762 <tag/Example/None.
6763 </descrip>
6764 </quote>
6765
6766
6767 <sect1>strerror<label id="strerror"><p>
6768
6769 <quote>
6770 <descrip>
6771 <tag/Function/Return a string describing an error code.
6772 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6773 <tag/Declaration/<tt/char* __fastcall__ strerror (int errcode);/
6774 <tag/Description/The <tt/strerror/ function returns a string describing the
6775 given error code. If an invalid error code is passed, the string "Unknown
6776 error" is returned, and <tt/errno/ is set to <tt/EINVAL/. In all other cases,
6777 <tt/errno/ is left untouched.
6778 <tag/Notes/<itemize>
6779 <item>The function is only available as fastcall function, so it may only
6780 be used in presence of a prototype.
6781 <item>While the return type of the function is a <tt/char*/, the returned
6782 string must not be modified by the caller!
6783 </itemize>
6784 <tag/Availability/ISO 9899
6785 <tag/See also/
6786 <ref id="_stroserror" name="_stroserror">
6787 <tag/Example/None.
6788 </descrip>
6789 </quote>
6790
6791
6792 <sect1>stricmp<label id="stricmp"><p>
6793
6794 <quote>
6795 <descrip>
6796 <tag/Function/Compare two strings case insensitive.
6797 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6798 <tag/Declaration/<tt/int __fastcall__ stricmp (const char* s1, const char* s2);/
6799 <tag/Description/The <tt/stricmp/ function compares the two strings passed as
6800 parameters without case sensitivity. It returns a value that is less than zero
6801 if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
6802 value greater than zero if <tt/s1/ is greater than <tt/s2/.
6803 <tag/Notes/<itemize>
6804 <item>The function is only available as fastcall function, so it may only
6805 be used in presence of a prototype.
6806 <item>The function is not available in strict ANSI mode.
6807 </itemize>
6808 <tag/Availability/cc65
6809 <tag/See also/
6810 <ref id="strcasecmp" name="strcasecmp">,
6811 <ref id="strcmp" name="strcmp">,
6812 <ref id="strcoll" name="strcoll">,
6813 <ref id="strncmp" name="strncmp">,
6814 <ref id="strxfrm" name="strxfrm">
6815 <tag/Example/None.
6816 </descrip>
6817 </quote>
6818
6819
6820 <sect1>strlen<label id="strlen"><p>
6821
6822 <quote>
6823 <descrip>
6824 <tag/Function/Return the length of a string.
6825 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6826 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
6827 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
6828 string to which s points, not including the terminating null byte.
6829 <tag/Notes/<itemize>
6830 <item>The function is only available as fastcall function, so it may only
6831 be used in presence of a prototype.
6832 <item>When compiling with <tt/-Os/ (inline known standard functions), the
6833 function does not work correctly for strings with more than 255 characters.
6834 </itemize>
6835 <tag/Availability/ISO 9899
6836 <tag/See also/
6837 <ref id="strcpy" name="strcpy">
6838 <tag/Example/None.
6839 </descrip>
6840 </quote>
6841
6842
6843 <sect1>strlower<label id="strlower"><p>
6844
6845 <quote>
6846 <descrip>
6847 <tag/Function/Make a string lower case.
6848 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6849 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
6850 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
6851 function to each character of a string. The function will always return <tt/s/.
6852 <tag/Notes/<itemize>
6853 <item>The function is only available as fastcall function, so it may only
6854 be used in presence of a prototype.
6855 <item>The function prototype is unavailable when compiling in strict ANSI mode.
6856 <item>An alias name for this function is <tt/strlwr/.
6857 </itemize>
6858 <tag/Availability/cc65
6859 <tag/See also/
6860 <ref id="strupper" name="strupper">,
6861 <ref id="tolower" name="tolower">
6862 <tag/Example/None.
6863 </descrip>
6864 </quote>
6865
6866
6867 <sect1>strlwr<label id="strlwr"><p>
6868
6869 <quote>
6870 See <tt/strlower/.
6871 </quote>
6872
6873
6874 <sect1>strncasecmp<label id="strncasecmp"><p>
6875
6876 <quote>
6877 <descrip>
6878 <tag/Function/Compare two strings case insensitive.
6879 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6880 <tag/Declaration/<tt/int __fastcall__ strncasecmp (const char* s1, const char* s2, size_t count);/
6881 <tag/Description/The <tt/strncasecmp/ function compares the two strings passed
6882 as parameters without case sensitivity. It returns a value that is less than
6883 zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
6884 and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
6885 <tag/Notes/<itemize>
6886 <item>The function is only available as fastcall function, so it may only
6887 be used in presence of a prototype.
6888 <item>The function is not available in strict ANSI mode.
6889 </itemize>
6890 <tag/Availability/cc65
6891 <tag/See also/
6892 <ref id="strcmp" name="strcmp">,
6893 <ref id="strcoll" name="strcoll">,
6894 <ref id="stricmp" name="stricmp">,
6895 <ref id="strncmp" name="strncmp">,
6896 <ref id="strxfrm" name="strxfrm">
6897 <tag/Example/None.
6898 </descrip>
6899 </quote>
6900
6901
6902 <sect1>strncat<label id="strncat"><p>
6903
6904 <quote>
6905 <descrip>
6906 <tag/Function/Concatentate two strings.
6907 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6908 <tag/Declaration/<tt/char* __fastcall__ strncat (char* s1, const char* s2, size_t n);/
6909 <tag/Description/The <tt/strncat/ function appends not more than n characters
6910 of the string pointed to by s2 to the end of the string pointed to by s1. The
6911 terminating null character at the end of s1 is overwritten. A terminating null
6912 character is appended to the result, even if not all of s2 is appended to s1.
6913 <tag/Notes/<itemize>
6914 <item>The function is only available as fastcall function, so it may only
6915 be used in presence of a prototype.
6916 <item>If copying takes place between objects that overlap, the behaviour
6917 is undefined.
6918 </itemize>
6919 <tag/Availability/ISO 9899
6920 <tag/See also/
6921 <ref id="strcpy" name="strcpy">,
6922 <ref id="strncat" name="strncat">,
6923 <ref id="strncpy" name="strncpy">
6924 <tag/Example/None.
6925 </descrip>
6926 </quote>
6927
6928
6929 <sect1>strncmp<label id="strncmp"><p>
6930
6931 <quote>
6932 <descrip>
6933 <tag/Function/Compare two strings.
6934 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6935 <tag/Declaration/<tt/int __fastcall__ strncmp (const char* s1, const char* s2, size_t count);/
6936 <tag/Description/The <tt/strncmp/ function compares not more than <tt/count/
6937 characters of the two strings passed as parameters. It returns a value that is
6938 less than zero if the first <tt/count/ characters of <tt/s1/ are less than
6939 <tt/s2/, zero if they are identical, and a value greater than zero they are
6940 greater.
6941 <tag/Notes/<itemize>
6942 <item>The function is only available as fastcall function, so it may only
6943 be used in presence of a prototype.
6944 </itemize>
6945 <tag/Availability/ISO 9899
6946 <tag/See also/
6947 <ref id="strcasecmp" name="strcasecmp">,
6948 <ref id="strcmp" name="strcmp">,
6949 <ref id="strcoll" name="strcoll">,
6950 <ref id="stricmp" name="stricmp">,
6951 <ref id="strxfrm" name="strxfrm">
6952 <tag/Example/None.
6953 </descrip>
6954 </quote>
6955
6956
6957 <sect1>strncpy<label id="strncpy"><p>
6958
6959 <quote>
6960 <descrip>
6961 <tag/Function/Copy part of a string.
6962 <tag/Header/<tt/<ref id="string.h" name="string.h">/
6963 <tag/Declaration/<tt/char* __fastcall__ strncpy (char* s1, const char* s2, size_t n);/
6964 <tag/Description/The <tt/strncpy/ function copies not more than <tt/n/ bytes from
6965 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
6966 pointed to by <tt/s2/ is a string that is shorter than <tt/n/ bytes, null bytes are
6967 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
6968 written. The function always will return <tt/s1/.
6969 <tag/Notes/<itemize>
6970 <item>The function is available only as a fastcall function; so, it may be used
6971 only in the presence of a prototype.
6972 <item>If there is no null byte in the first <tt/n/ bytes of the array pointed
6973 to by <tt/s2/, the result is <em/not/ null-terminated!
6974 <item>If copying takes place between objects that overlap, the behaviour is
6975 undefined.
6976 </itemize>
6977 <tag/Availability/ISO 9899
6978 <tag/See also/
6979 <ref id="memcpy" name="memcpy">,
6980 <ref id="strcat" name="strcat">,
6981 <ref id="strcpy" name="strcpy">,
6982 <ref id="strncat" name="strncat">
6983 <tag/Example/
6984 <verb>
6985 #include <string.h>
6986
6987 static char hello[6];
6988
6989 strncpy (hello, "Hello world!\n", sizeof hello - 1)[5] = '\0';
6990 </verb>
6991 </descrip>
6992 </quote>
6993
6994
6995 <sect1>strnicmp<label id="strnicmp"><p>
6996
6997 <quote>
6998 <descrip>
6999 <tag/Function/Compare two strings case insensitive.
7000 <tag/Header/<tt/<ref id="string.h" name="string.h">/
7001 <tag/Declaration/<tt/int __fastcall__ strnicmp (const char* s1, const char* s2, size_t count);/
7002 <tag/Description/The <tt/strnicmp/ function compares the two strings passed as
7003 parameters without case sensitivity. It returns a value that is less than zero
7004 if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
7005 value greater than zero if <tt/s1/ is greater than <tt/s2/.
7006 <tag/Notes/<itemize>
7007 <item>The function is only available as fastcall function, so it may only
7008 be used in presence of a prototype.
7009 <item>The function is not available in strict ANSI mode.
7010 </itemize>
7011 <tag/Availability/cc65
7012 <tag/See also/
7013 <ref id="strcasecmp" name="strcasecmp">,
7014 <ref id="strcmp" name="strcmp">,
7015 <ref id="strcoll" name="strcoll">,
7016 <ref id="strncmp" name="strncmp">,
7017 <ref id="strxfrm" name="strxfrm">
7018 <tag/Example/None.
7019 </descrip>
7020 </quote>
7021
7022
7023 <sect1>strqtok<label id="strqtok"><p>
7024
7025 <quote>
7026 <descrip>
7027 <tag/Function/Break a string into tokens.
7028 <tag/Header/<tt/<ref id="string.h" name="string.h">/
7029 <tag/Declaration/<tt/char* __fastcall__ strqtok (char* s1, const char* s2);/
7030 <tag/Description/<tt/strqtok()/ will break the string <tt/s1/ into a sequence of
7031 tokens, which are delimited by either quotation marks or characters from the
7032 string <tt/s2/. Tokens inside quotation marks may contain characters from <tt/s2/
7033 (they aren't delimiters there). The first call to <tt/strqtok()/ will return a
7034 pointer to the first token in the string <tt/s1/. The following calls must pass
7035 a <tt/NULL/ pointer as <tt/s1/, in order to get the next token in the string.
7036 Different sets of delimiters may be used for the subsequent calls to <tt/strqtok()/.
7037 <tag/Notes/<itemize>
7038 <item>The function is available only as a fastcall function; so, it may be used
7039 only in the presence of a prototype.
7040 <item><tt/strqtok()/ will modify the string <tt/s1/.
7041 <item>The function will forget where it is in the <tt/s1/ string if it is given
7042 a second <tt/s1/ string before it finishes the first one.
7043 </itemize>
7044 <tag/Availability/cc65
7045 <tag/See also/
7046 <ref id="strcspn" name="strcspn">,
7047 <!-- <ref id="strpbrk" name="strpbrk">, -->
7048 <ref id="strspn" name="strspn">,
7049 <ref id="strtok" name="strtok">
7050 <tag/Example/None.
7051 </descrip>
7052 </quote>
7053
7054
7055 <sect1>strrchr<label id="strrchr"><p>
7056
7057 <quote>
7058 <descrip>
7059 <tag/Function/Search for a character in a string.
7060 <tag/Header/<tt/<ref id="string.h" name="string.h">/
7061 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
7062 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
7063 (converted to a char) in the string pointed to by <tt/s/. The terminating null
7064 byte is considered to be part of the string. Upon completion, the function
7065 returns a pointer to the byte, or a null pointer if the byte was not found.
7066 <tag/Notes/<itemize>
7067 <item>The function is only available as fastcall function, so it may only
7068 be used in presence of a prototype.
7069 </itemize>
7070 <tag/Availability/ISO 9899
7071 <tag/See also/
7072 <ref id="strchr" name="strchr">
7073 <tag/Example/None.
7074 </descrip>
7075 </quote>
7076
7077
7078 <sect1>strspn<label id="strspn"><p>
7079
7080 <quote>
7081 <descrip>
7082 <tag/Function/Compute the length of a substring.
7083 <tag/Header/<tt/<ref id="string.h" name="string.h">/
7084 <tag/Declaration/<tt/size_t __fastcall__ strspn (const char* s, const char* set);/
7085 <tag/Description/The <tt/strspn/ function computes and returns the length of
7086 the substring pointed to by <tt/s/ which does consist only of characters
7087 contained in the string <tt/set/.
7088 <tag/Notes/<itemize>
7089 <item>The function is only available as fastcall function, so it may only
7090 be used in presence of a prototype.
7091 </itemize>
7092 <tag/Availability/ISO 9899
7093 <tag/See also/
7094 <ref id="strcspn" name="strcspn">,
7095 <ref id="strstr" name="strstr">
7096 <tag/Example/None.
7097 </descrip>
7098 </quote>
7099
7100
7101 <sect1>strstr<label id="strstr"><p>
7102
7103 <quote>
7104 <descrip>
7105 <tag/Function/Find a substring.
7106 <tag/Header/<tt/<ref id="string.h" name="string.h">/
7107 <tag/Declaration/<tt/char* __fastcall__ strstr (const char* str, const char* substr);/
7108 <tag/Description/<tt/strstr/ searches for the first occurance of the string
7109 <tt/substr/ within <tt/str/. If found, it returns a pointer to the copy,
7110 otherwise it returns <tt/NULL/.
7111 <tag/Notes/<itemize>
7112 <item>The function is only available as fastcall function, so it may only
7113 be used in presence of a prototype.
7114 </itemize>
7115 <tag/Availability/ISO 9899
7116 <tag/See also/
7117 <ref id="strcspn" name="strcspn">,
7118 <ref id="strspn" name="strspn">
7119 <tag/Example/None.
7120 </descrip>
7121 </quote>
7122
7123
7124 <sect1>strtok<label id="strtok"><p>
7125
7126 <quote>
7127 <descrip>
7128 <tag/Function/Break a string into tokens.
7129 <tag/Header/<tt/<ref id="string.h" name="string.h">/
7130 <tag/Declaration/<tt/char* __fastcall__ strtok (char* s1, const char* s2);/
7131 <tag/Description/<tt/strtok()/ will break the string <tt/s1/ into a sequence of
7132 tokens, which are delimited by characters from the string <tt/s2/. The first call
7133 to <tt/strtok()/ will return a pointer to the first token in the string <tt/s1/.
7134 The following calls must pass a <tt/NULL/ pointer as <tt/s1/, in order to get
7135 the next token in the string. Different sets of delimiters may be used for the
7136 subsequent calls to <tt/strtok()/.
7137 <tag/Notes/<itemize>
7138 <item>The function is only available as fastcall function, so it may only
7139 be used in presence of a prototype.
7140 <item><tt/strtok()/ will modify the string <tt/s1/.
7141 <item>The function will forget where it is in the <tt/s1/ string if it is given
7142 a second <tt/s1/ string before it finishes the first one.
7143 </itemize>
7144 <tag/Availability/ISO 9899
7145 <tag/See also/
7146 <ref id="strcspn" name="strcspn">,
7147 <!-- <ref id="strpbrk" name="strpbrk">, -->
7148 <ref id="strqtok" name="strqtok">,
7149 <ref id="strspn" name="strspn">
7150 <tag/Example/None.
7151 </descrip>
7152 </quote>
7153
7154
7155 <sect1>strxfrm<label id="strxfrm"><p>
7156
7157 <quote>
7158 <descrip>
7159 <tag/Function/Transform a string.
7160 <tag/Header/<tt/<ref id="string.h" name="string.h">/
7161 <tag/Declaration/<tt/size_t __fastcall__ strxfrm (char* s1, const char* s2, size_t n);/
7162 <tag/Description/The <tt/strxfrm/ function transforms the string pointed to by
7163 s2 and places the resulting string into the string pointed to by s1. The
7164 transformation is such that if the <tt/strcmp/ function is applied to two
7165 transformed strings, it returns a value greater than, equal to, or less than
7166 zero, corresponding to the result of the <tt/strcoll/ function applied to the
7167 same two original strings. No more than n characters are placed into the
7168 resulting array pointed to by s1, including the terminating null character.
7169 <tag/Notes/<itemize>
7170 <item><tt/s1/ and <tt/s2/ must not point to the same memory area, otherwise
7171 the behaviour is undefined.
7172 <item>If <tt/n/ is zero, <tt/s1/ may be a NULL pointer.
7173 <item>The function is only available as fastcall function, so it may only
7174 be used in presence of a prototype.
7175 <item>Since cc65 doesn't support different charcter sets, <tt/strxfrm/ will
7176 just copy s2 to s1 using <tt><ref id="strncpy" name="strncpy"></tt>.
7177 </itemize>
7178 <tag/Availability/ISO 9899
7179 <tag/See also/
7180 <ref id="strcmp" name="strcmp">,
7181 <ref id="strcoll" name="strcoll">,
7182 <ref id="strncpy" name="strncpy">
7183 <tag/Example/None.
7184 </descrip>
7185 </quote>
7186
7187
7188 <sect1>strupper<label id="strupper"><p>
7189
7190 <quote>
7191 <descrip>
7192 <tag/Function/Make a string upper case.
7193 <tag/Header/<tt/<ref id="string.h" name="string.h">/
7194 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
7195 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
7196 function to each character of a string. The function will always return <tt/s/.
7197 <tag/Notes/<itemize>
7198 <item>The function is only available as fastcall function, so it may only
7199 be used in presence of a prototype.
7200 <item>The function prototype is unavailable when compiling in strict ANSI mode.
7201 <item>An alias name for this function is <tt/strupr/.
7202 </itemize>
7203 <tag/Availability/cc65
7204 <tag/See also/
7205 <ref id="strlower" name="strlower">
7206 <ref id="toupper" name="toupper">
7207 <tag/Example/None.
7208 </descrip>
7209 </quote>
7210
7211
7212 <sect1>strupr<label id="strupr"><p>
7213
7214 <quote>
7215 See <tt/strupper/.
7216 </quote>
7217
7218
7219 <sect1>telldir<label id="telldir"><p>
7220
7221 <quote>
7222 <descrip>
7223 <tag/Function/Return the current position of a directory stream.
7224 <tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
7225 <tag/Declaration/<tt/long __fastcall__ telldir (DIR* dir);/
7226 <tag/Description/<tt/telldir/ returns the current position of a directory
7227 stream. The return value may be used in subsequent calls to
7228 <tt/<ref id="seekdir" name="seekdir">/.
7229 <tag/Notes/<itemize>
7230 <item>The function is only available as fastcall function, so it may only
7231 be used in presence of a prototype.
7232 </itemize>
7233 <tag/Availability/POSIX 1003.1
7234 <tag/See also/
7235 <ref id="seekdir" name="seekdir">,
7236 <ref id="telldir" name="telldir">
7237 <tag/Example/None.
7238 </descrip>
7239 </quote>
7240
7241
7242 <sect1>textcolor<label id="textcolor"><p>
7243
7244 <quote>
7245 <descrip>
7246 <tag/Function/Set the text color.
7247 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
7248 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
7249 <tag/Description/The function will set a new text color. It returns the old
7250 (current) text color. Text output using any <tt/conio.h/ function will use
7251 the color set by this function.
7252 <tag/Notes/<itemize>
7253 <item>Text colors are system dependent. The function may have no effect
7254 on systems where the text color cannot be changed.
7255 <item>The function is only available as fastcall function, so it may only
7256 be used in presence of a prototype.
7257 </itemize>
7258 <tag/Availability/cc65
7259 <tag/See also/
7260 <ref id="bgcolor" name="bgcolor">,
7261 <ref id="bordercolor" name="bordercolor">
7262 <tag/Example/None.
7263 </descrip>
7264 </quote>
7265
7266
7267 <sect1>time<label id="time"><p>
7268
7269 <quote>
7270 <descrip>
7271 <tag/Function/Get the time.
7272 <tag/Header/<tt/<ref id="time.h" name="time.h">/
7273 <tag/Declaration/<tt/time_t __fastcall__ time (time_t* t);/
7274 <tag/Description/The function returns the time since the 1970-01-01 00:00:00
7275 measured in seconds. If the pointer <tt/t/ is not <tt/NULL/, the function
7276 result will also be stored there. If no time is available, <tt/(time_t)-1/ is
7277 returned and <tt/errno/ is set to <tt/ENOSYS/.
7278 <tag/Notes/<itemize>
7279 <item>The function is only available as fastcall function, so it may
7280 only be used in presence of a prototype.
7281 <item>Many platforms supported by cc65 do not have a realtime clock, so the
7282 returned value may not be valid.
7283 </itemize>
7284 <tag/Availability/ISO 9899
7285 <tag/See also/
7286 <ref id="clock" name="clock">
7287 <tag/Example/None.
7288 </descrip>
7289 </quote>
7290
7291
7292 <sect1>toggle_videomode<label id="toggle_videomode"><p>
7293
7294 <quote>
7295 <descrip>
7296 <tag/Function/Toggle between 40 and 80 column mode.
7297 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
7298 <tag/Declaration/<tt/void toggle_videomode (void);/
7299 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
7300 old mode (cursor position, color and so on) are saved and restored together
7301 with the mode.
7302 <tag/Notes/<itemize>
7303 <item>The function is specific to the C128.
7304 <item>This function is deprecated. Please use <ref id="videomode"
7305 name="videomode"> instead!
7306 </itemize>
7307 <tag/Availability/C128
7308 <tag/See also/
7309 <ref id="fast" name="fast">,
7310 <ref id="isfast" name="isfast">,
7311 <ref id="slow" name="slow">,
7312 <ref id="videomode" name="videomode">
7313 <tag/Example/None.
7314 </descrip>
7315 </quote>
7316
7317
7318 <sect1>tolower<label id="tolower"><p>
7319
7320 <quote>
7321 <descrip>
7322 <tag/Function/Convert a character into its lower case representation.
7323 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
7324 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
7325 <tag/Description/The function returns the given character converted to lower
7326 case. If the given character is not a letter, it is returned unchanged.
7327 <tag/Notes/<itemize>
7328 <item>The function is only available as fastcall function, so it may
7329 only be used in presence of a prototype.
7330 </itemize>
7331 <tag/Availability/ISO 9899
7332 <tag/See also/
7333 <ref id="islower" name="islower">,
7334 <ref id="isupper" name="isupper">,
7335 <ref id="toupper" name="toupper">
7336 <tag/Example/None.
7337 </descrip>
7338 </quote>
7339
7340
7341 <sect1>toupper<label id="toupper"><p>
7342
7343 <quote>
7344 <descrip>
7345 <tag/Function/Convert a character into its upper case representation.
7346 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
7347 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
7348 <tag/Description/The function returns the given character converted to upper
7349 case. If the given character is not a letter, it is returned unchanged.
7350 <tag/Notes/<itemize>
7351 <item>The function is only available as fastcall function, so it may
7352 only be used in presence of a prototype.
7353 </itemize>
7354 <tag/Availability/ISO 9899
7355 <tag/See also/
7356 <ref id="islower" name="islower">,
7357 <ref id="isupper" name="isupper">,
7358 <ref id="tolower" name="tolower">
7359 <tag/Example/None.
7360 </descrip>
7361 </quote>
7362
7363
7364 <sect1>ultoa<label id="ultoa"><p>
7365
7366 <quote>
7367 <descrip>
7368 <tag/Function/Convert an unsigned long integer into a string.
7369 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
7370 <tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
7371 <tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
7372 string using <tt/radix/ as the base.
7373 <tag/Notes/<itemize>
7374 <item>There are no provisions to prevent a buffer overflow.
7375 <item>The function is non standard, so it is not available in strict ANSI mode.
7376 You should probably use <tt/sprintf/ instead.
7377 <item>The function is only available as fastcall function, so it may only be
7378 used in presence of a prototype.
7379 </itemize>
7380 <tag/Availability/cc65
7381 <tag/See also/
7382 <ref id="atoi" name="atoi">,
7383 <ref id="atol" name="atol">,
7384 <ref id="itoa" name="itoa">,
7385 <ref id="ltoa" name="ltoa">,
7386 <ref id="utoa" name="utoa">
7387 <tag/Example/None.
7388 </descrip>
7389 </quote>
7390
7391
7392 <sect1>unlink<label id="unlink"><p>
7393
7394 <quote>
7395 <descrip>
7396 <tag/Function/Delete a file.
7397 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
7398 <tag/Declaration/<tt/int __fastcall__ unlink (const char* name);/
7399 <tag/Description/<tt/unlink/ deletes the file with the given name. On success,
7400 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
7401 code describing the reason for the failure.
7402 <tag/Notes/<itemize>
7403 <item>The use of this function is discouraged. Please use <tt/<ref id="remove"
7404 name="remove">/ instead, which is a native ANSI C function and does the same.
7405 <item>This function is not available on all cc65 targets (depends on the
7406 availability of file I/O).
7407 <item>The function is only available as fastcall function, so it may only
7408 be used in presence of a prototype.
7409 <item>Instead of <tt/unlink/, <tt/<ref id="remove" name="remove">/ should be
7410 used, which has the same semantics, but is more portable, because it conforms
7411 to the ISO C standard.
7412 </itemize>
7413 <tag/Availability/POSIX 1003.1
7414 <tag/See also/
7415 <ref id="remove" name="remove">
7416 <tag/Example/
7417 <verb>
7418 #include &lt;stdio.h&gt;
7419 #include &lt;unistd.h&gt;
7420
7421 #define FILENAME "helloworld"
7422
7423 if (unlink (FILENAME) == 0) {
7424     printf ("We deleted %s successfully\n", FILENAME);
7425 } else {
7426     printf ("There was a problem deleting %s\n", FILENAME);
7427 }
7428 </verb>
7429 </descrip>
7430 </quote>
7431
7432
7433 <sect1>utoa<label id="utoa"><p>
7434
7435 <quote>
7436 <descrip>
7437 <tag/Function/Convert an unsigned integer into a string.
7438 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
7439 <tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
7440 <tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
7441 using <tt/radix/ as the base.
7442 <tag/Notes/<itemize>
7443 <item>There are no provisions to prevent a buffer overflow.
7444 <item>The function is non standard, so it is not available in strict ANSI mode.
7445 You should probably use <tt/sprintf/ instead.
7446 <item>The function is only available as fastcall function, so it may only be
7447 used in presence of a prototype.
7448 </itemize>
7449 <tag/Availability/cc65
7450 <tag/See also/
7451 <ref id="atoi" name="atoi">,
7452 <ref id="atol" name="atol">,
7453 <ref id="itoa" name="itoa">,
7454 <ref id="ltoa" name="ltoa">,
7455 <ref id="ultoa" name="ultoa">
7456 <tag/Example/None.
7457 </descrip>
7458 </quote>
7459
7460
7461 <sect1>vcprintf<label id="vcprintf"><p>
7462
7463 <quote>
7464 <descrip>
7465 <tag/Function/Formatted output to the console.
7466 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
7467 <tag/Declaration/<tt/int __fastcall__ vcprintf (const char* format, va_list ap);/
7468 <tag/Description/The arguments specified as a <tt/va_list/ are converted to
7469 text where necessary and formatted according to the format string given. The
7470 resulting string is output to the console. <tt/vcprintf/ supports the same
7471 format specifiers as <tt/vprintf/. <!-- <tt/<ref id="vprintf" name="vprintf">/. -->
7472 <tag/Notes/<itemize>
7473 <item>Like all other <tt/conio/ output functions, <tt/vcprintf/ distinguishes
7474 between <tt/\r/ and <tt/\n/.
7475 <item>The function is only available as fastcall function, so it may only be
7476 used in presence of a prototype.
7477 </itemize>
7478 <tag/Availability/cc65
7479 <tag/See also/
7480 <ref id="cprintf" name="cprintf">,
7481 <ref id="cputc" name="cputc">,
7482 <ref id="cputcxy" name="cputcxy">,
7483 <ref id="cputs" name="cputs">,
7484 <ref id="cputsxy" name="cputsxy">
7485 <tag/Example/None.
7486 </descrip>
7487 </quote>
7488
7489
7490 <sect1>videomode<label id="videomode"><p>
7491
7492 <quote>
7493 <descrip>
7494 <tag/Function/Switch to either 40 or 80 column mode.
7495 <tag/Header/<tt/<ref id="apple2enh.h" name="apple2enh.h">,
7496 <ref id="c128.h" name="c128.h">/
7497 <tag/Declaration/<tt/unsigned __fastcall__ videomode (unsigned Mode);/
7498 <tag/Description/Switch to 40 or 80 column mode depending on the argument. If
7499 the requested mode is already active, nothing happens. The old mode is returned
7500 from the call.
7501 <tag/Notes/<itemize>
7502 <item>The function is specific to the C128 and enhanced Apple //e.
7503 <item>This function replaces <ref id="toggle_videomode"
7504 name="toggle_videomode">.
7505 <item>The function is only available as fastcall function, so it may only be
7506 used in presence of a prototype.
7507 </itemize>
7508 <tag/Availability/C128 and enhanced Apple //e
7509 <tag/See also/
7510 <ref id="fast" name="fast">,
7511 <ref id="isfast" name="isfast">,
7512 <ref id="slow" name="slow">,
7513 <ref id="toggle_videomode" name="toggle_videomode">
7514 <tag/Example/None.
7515 </descrip>
7516 </quote>
7517
7518
7519 <sect1>waitvsync<label id="waitvsync"><p>
7520
7521 <quote>
7522 <descrip>
7523 <tag/Function/Wait until the start of the next frame.
7524 <tag/Header/
7525 <tt/<ref id="cbm.h" name="cbm.h">/,
7526 <tt/<ref id="gamate.h" name="gamate.h">/,
7527 <tt/<ref id="nes.h" name="nes.h">/,
7528 <tt/<ref id="pce.h" name="pce.h">/
7529 <tag/Declaration/<tt/void waitvsync (void);/
7530 <tag/Description/Wait for vertical sync to reduce flickering.
7531 <tag/Availability/Platforms above
7532 <tag/Example/None.
7533 </descrip>
7534 </quote>
7535
7536
7537 <sect1>wherex<label id="wherex"><p>
7538
7539 <quote>
7540 <descrip>
7541 <tag/Function/Return the current X position of the text mode cursor.
7542 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
7543 <tag/Declaration/<tt/unsigned char wherex (void);/
7544 <tag/Description/The function returns the current X position of the text mode
7545 cursor. Zero is returned for the leftmost screen position.
7546 <tag/Availability/cc65
7547 <tag/See also/
7548 <ref id="gotox" name="gotox">,
7549 <ref id="gotoy" name="gotoy">,
7550 <ref id="gotoxy" name="gotoxy">,
7551 <ref id="wherey" name="wherey">
7552 <tag/Example/None.
7553 </descrip>
7554 </quote>
7555
7556
7557 <sect1>wherey<label id="wherey"><p>
7558
7559 <quote>
7560 <descrip>
7561 <tag/Function/Return the current Y position of the text mode cursor.
7562 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
7563 <tag/Declaration/<tt/unsigned char wherey (void);/
7564 <tag/Description/The function returns the current Y position of the text mode
7565 cursor. Zero is returned for the uppermost screen position.
7566 <tag/Availability/cc65
7567 <tag/See also/
7568 <ref id="gotox" name="gotox">,
7569 <ref id="gotoy" name="gotoy">,
7570 <ref id="gotoxy" name="gotoxy">,
7571 <ref id="wherex" name="wherex">
7572 <tag/Example/None.
7573 </descrip>
7574 </quote>
7575
7576
7577 </article>