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