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