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