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