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