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