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