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