]> git.sur5r.net Git - cc65/blob - doc/funcref.sgml
Added mouse_ioctl to complete mouse.h
[cc65] / doc / funcref.sgml
1 <!doctype linuxdoc system>
2
3 <article>
4 <title>cc65 function reference
5 <author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
6 <date>07.11.2002
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 <htmlurl
27 url="library.html" name="cc65 Library Overview">.
28
29 <bf/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/Limits/Limits.
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="set_brk" name="set_brk">
62 </itemize>
63
64
65 <sect1><tt/apple2.h/<label id="apple2.h"><p>
66
67 <itemize>
68 <item><ref id="get_ostype" name="get_ostype">
69 </itemize>
70
71
72 <sect1><tt/apple2enh.h/<label id="apple2enh.h"><p>
73
74 (incomplete)
75
76
77 <sect1><tt/assert.h/<label id="assert.h"><p>
78
79 <itemize>
80 <item><ref id="assert" name="assert">
81 </itemize>
82
83
84 <sect1><tt/atari.h/<label id="atari.h"><p>
85
86 <itemize>
87 <item><ref id="get_ostype" name="get_ostype">
88 </itemize>
89
90 (incomplete)
91
92
93 <sect1><tt/atmos.h/<label id="atmos.h"><p>
94
95 (incomplete)
96
97
98 <sect1><tt/c128.h/<label id="c128.h"><p>
99
100 <itemize>
101 <item><ref id="c64mode" name="c64mode">
102 <item><ref id="fast" name="fast">
103 <item><ref id="toggle_videomode" name="toggle_videomode">
104 <item><ref id="slow" name="slow">
105 </itemize>
106
107
108 <sect1><tt/c16.h/<label id="c16.h"><p>
109
110 (incomplete)
111
112
113 <sect1><tt/c64.h/<label id="c64.h"><p>
114
115 <itemize>
116 <item><ref id="get_ostype" name="get_ostype">
117 </itemize>
118
119
120 <sect1><tt/cbm510.h/<label id="cbm510.h"><p>
121
122 <itemize>
123 <item><ref id="peekbsys" name="peekbsys">
124 <item><ref id="peekwsys" name="peekwsys">
125 <item><ref id="pokebsys" name="pokebsys">
126 <item><ref id="pokewsys" name="pokewsys">
127 </itemize>
128
129
130 <sect1><tt/cbm610.h/<label id="cbm610.h"><p>
131
132 <itemize>
133 <item><ref id="peekbsys" name="peekbsys">
134 <item><ref id="peekwsys" name="peekwsys">
135 <item><ref id="pokebsys" name="pokebsys">
136 <item><ref id="pokewsys" name="pokewsys">
137 </itemize>
138
139
140 <sect1><tt/conio.h/<label id="conio.h"><p>
141
142 <itemize>
143 <item><ref id="bgcolor" name="bgcolor">
144 <item><ref id="bordercolor" name="bordercolor">
145 <item><ref id="cclear" name="cclear">
146 <item><ref id="cclearxy" name="cclearxy">
147 <item><ref id="cgetc" name="cgetc">
148 <item><ref id="chline" name="chline">
149 <item><ref id="chlinexy" name="chlinexy">
150 <item><ref id="clrscr" name="clrscr">
151 <item><ref id="cprintf" name="cprintf">
152 <item><ref id="cputc" name="cputc">
153 <item><ref id="cputcxy" name="cputcxy">
154 <item><ref id="cputs" name="cputs">
155 <item><ref id="cputsxy" name="cputsxy">
156 <item><ref id="cursor" name="cursor">
157 <item><ref id="cvline" name="cvline">
158 <item><ref id="cvlinexy" name="cvlinexy">
159 <item><ref id="gotox" name="gotox">
160 <item><ref id="gotoxy" name="gotoxy">
161 <item><ref id="gotoy" name="gotoy">
162 <item><ref id="kbhit" name="kbhit">
163 <item><ref id="revers" name="revers">
164 <item><ref id="screensize" name="screensize">
165 <item><ref id="textcolor" name="textcolor">
166 <item><ref id="vcprintf" name="vcprintf">
167 <item><ref id="wherex" name="wherex">
168 <item><ref id="wherey" name="wherey">
169 </itemize>
170
171
172 <sect1><tt/ctype.h/<label id="ctype.h"><p>
173
174 <itemize>
175 <item><ref id="isalnum" name="isalnum">
176 <item><ref id="isalpha" name="isalpha">
177 <item><ref id="isascii" name="isascii">
178 <item><ref id="isblank" name="isblank">
179 <item><ref id="iscntrl" name="iscntrl">
180 <item><ref id="isdigit" name="isdigit">
181 <item><ref id="isgraph" name="isgraph">
182 <item><ref id="islower" name="islower">
183 <item><ref id="isprint" name="isprint">
184 <item><ref id="ispunct" name="ispunct">
185 <item><ref id="isspace" name="isspace">
186 <item><ref id="isupper" name="isupper">
187 <item><ref id="isxdigit" name="isxdigit">
188 <item><ref id="tolower" name="tolower">
189 <item><ref id="toupper" name="toupper">
190 </itemize>
191
192
193 <sect1><tt/dbg.h/<label id="dbg.h"><p>
194
195 (incomplete)
196
197
198 <sect1><tt/dio.h/<label id="dio.h"><p>
199
200 (incomplete)
201
202
203 <sect1><tt/em.h/<label id="em.h"><p>
204
205 <itemize>
206 <item><ref id="em_commit" name="em_commit">
207 <item><ref id="em_copyfrom" name="em_copyfrom">
208 <item><ref id="em_copyto" name="em_copyto">
209 <item><ref id="em_install" name="em_install">
210 <item><ref id="em_load_driver" name="em_load_driver">
211 <item><ref id="em_map" name="em_map">
212 <item><ref id="em_pagecount" name="em_pagecount">
213 <item><ref id="em_uninstall" name="em_uninstall">
214 <item><ref id="em_unload" name="em_unload">
215 <item><ref id="em_use" name="em_use">
216 </itemize>
217
218
219 <sect1><tt/errno.h/<label id="errno.h"><p>
220
221 (incomplete)
222
223
224 <sect1><tt/fcntl.h/<label id="fcntl.h"><p>
225
226 <itemize>
227 <item><ref id="close" name="close">
228 <item><ref id="creat" name="creat">
229 <item><ref id="open" name="open">
230 </itemize>
231
232
233 <sect1><tt/geos.h/<label id="geos.h"><p>
234
235 (incomplete)
236
237
238 <sect1><tt/joystick.h/<label id="joystick.h"><p>
239
240 <itemize>
241 <item><ref id="joy_count" name="joy_count">
242 <item><ref id="joy_install" name="joy_install">
243 <item><ref id="joy_load_driver" name="joy_load_driver">
244 <item><ref id="joy_read" name="joy_read">
245 <item><ref id="joy_uninstall" name="joy_uninstall">
246 <item><ref id="joy_unload" name="joy_unload">
247 </itemize>
248
249
250 <sect1><tt/locale.h/<label id="locale.h"><p>
251
252 <itemize>
253 <item><ref id="localeconv" name="localeconv">
254 <item><ref id="setlocale" name="setlocale">
255 </itemize>
256
257
258 <sect1><tt/modload.h/<label id="modload.h"><p>
259
260 <itemize>
261 <item><ref id="mod_load" name="mod_load">
262 <item><ref id="mod_free" name="mod_free">
263 </itemize>
264
265
266 <sect1><tt/mouse.h/<label id="mouse.h"><p>
267
268 <itemize>
269 <item><ref id="mouse_load_driver" name="mouse_load_driver">
270 <item><ref id="mouse_unload" name="mouse_unload">
271 <item><ref id="mouse_install" name="mouse_install">
272 <item><ref id="mouse_uninstall" name="mouse_uninstall">
273 <item><ref id="mouse_hide" name="mouse_hide">
274 <item><ref id="mouse_show" name="mouse_show">
275 <item><ref id="mouse_box" name="mouse_box">
276 <item><ref id="mouse_move" name="mouse_move">
277 <item><ref id="mouse_buttons" name="mouse_buttons">
278 <item><ref id="mouse_pos" name="mouse_pos">
279 <item><ref id="mouse_info" name="mouse_info">
280 <item><ref id="mouse_ioctl" name="mouse_ioctl">
281 </itemize>
282
283 (incomplete)
284
285
286 <sect1><tt/nes.h/<label id="nes.h"><p>
287
288 (incomplete)
289
290
291 <sect1><tt/o65.h/<label id="o65.h"><p>
292
293 The <tt/o65.h/ header file contains structure and constant definitions that
294 may be used when dealing with files in <htmlurl
295 url="http://www.6502.org/users/andre/o65/fileformat.html" name="o65 format">.
296 It does not declare any functions.
297
298
299 <sect1><tt/peekpoke.h/<label id="peekpoke.h"><p>
300
301 <itemize>
302 <item><ref id="PEEK" name="PEEK">
303 <item><ref id="PEEKW" name="PEEKW">
304 <item><ref id="POKE" name="POKE">
305 <item><ref id="POKEW" name="POKEW">
306 </itemize>
307
308
309 <sect1><tt/pet.h/<label id="pet.h"><p>
310
311 (incomplete)
312
313
314 <sect1><tt/plus4.h/<label id="plus4.h"><p>
315
316 (incomplete)
317
318
319 <sect1><tt/serial.h/<label id="serial.h"><p>
320
321 <!--
322 <itemize>
323 <item><ref id="ser_load_driver" name="ser_load_driver">
324 <item><ref id="ser_unload" name="ser_unload">
325 <item><ref id="ser_install" name="ser_install">
326 <item><ref id="ser_uninstall" name="ser_uninstall">
327 <item><ref id="ser_open" name="ser_open">
328 <item><ref id="ser_close" name="ser_close">
329 <item><ref id="ser_get" name="ser_get">
330 <item><ref id="ser_put" name="ser_put">
331 <item><ref id="ser_status" name="ser_status">
332 <item><ref id="ser_ioctl" name="ser_ioctl">
333 </itemize>
334 -->
335
336 (incomplete)
337
338
339 <sect1><tt/setjmp.h/<label id="setjmp.h"><p>
340
341 <itemize>
342 <item><ref id="setjmp" name="setjmp">
343 <item><ref id="longjmp" name="longjmp">
344 </itemize>
345
346
347 <sect1><tt/signal.h/<label id="signal.h"><p>
348
349 <itemize>
350 <item><ref id="raise" name="raise">
351 <item><ref id="signal" name="signal">
352 </itemize>
353
354
355 <sect1><tt/stdarg.h/<label id="stdarg.h"><p>
356
357 (incomplete)
358
359
360 <sect1><tt/stdbool.h/<label id="stdbool.h"><p>
361
362 (incomplete)
363
364
365 <sect1><tt/stddef.h/<label id="stddef.h"><p>
366
367 <itemize>
368 <item><ref id="offsetof" name="offsetof">
369 </itemize>
370
371
372 <sect1><tt/stdio.h/<label id="stdio.h"><p>
373
374 <itemize>
375 <item><ref id="clearerr" name="clearerr">
376 <!-- <item><ref id="fclose" name="fclose"> -->
377 <!-- <item><ref id="fdopen" name="fdopen"> -->
378 <item><ref id="feof" name="feof">
379 <item><ref id="ferror" name="ferror">
380 <!-- <item><ref id="fflush" name="fflush"> -->
381 <!-- <item><ref id="fgetc" name="fgetc"> -->
382 <!-- <item><ref id="fgetpos" name="fgetpos"> -->
383 <!-- <item><ref id="fgets" name="fgets"> -->
384 <item><ref id="fileno" name="fileno">
385 <!-- <item><ref id="flushall" name="flushall"> -->
386 <!-- <item><ref id="fopen" name="fopen"> -->
387 <!-- <item><ref id="fprintf" name="fprintf"> -->
388 <!-- <item><ref id="fputc" name="fputc"> -->
389 <!-- <item><ref id="fputs" name="fputs"> -->
390 <!-- <item><ref id="fread" name="fread"> -->
391 <!-- <item><ref id="freopen" name="freopen"> -->
392 <!-- <item><ref id="fscanf" name="fscanf"> -->
393 <!-- <item><ref id="fseek" name="fseek"> -->
394 <!-- <item><ref id="fsetpos" name="fsetpos"> -->
395 <!-- <item><ref id="ftell" name="ftell"> -->
396 <!-- <item><ref id="fwrite" name="fwrite"> -->
397 <!-- <item><ref id="getc" name="getc"> -->
398 <!-- <item><ref id="getchar" name="getchar"> -->
399 <!-- <item><ref id="gets" name="gets"> -->
400 <!-- <item><ref id="printf" name="printf"> -->
401 <!-- <item><ref id="putc" name="putc"> -->
402 <!-- <item><ref id="putchar" name="putchar"> -->
403 <!-- <item><ref id="puts" name="puts"> -->
404 <!-- <item><ref id="rename" name="rename"> -->
405 <!-- <item><ref id="rewind" name="rewind"> -->
406 <!-- <item><ref id="scanf" name="scanf"> -->
407 <!-- <item><ref id="sprintf" name="sprintf"> -->
408 <!-- <item><ref id="sscanf" name="sscanf"> -->
409 <!-- <item><ref id="vfprintf" name="vfprintf"> -->
410 <!-- <item><ref id="vfscanf" name="vfscanf"> -->
411 <!-- <item><ref id="vprintf" name="vprintf"> -->
412 <!-- <item><ref id="vscanf" name="vscanf"> -->
413 <!-- <item><ref id="vsprintf" name="vsprintf"> -->
414 <!-- <item><ref id="vsscanf" name="vsscanf"> -->
415 </itemize>
416
417 (incomplete)
418
419
420 <sect1><tt/stdlib.h/<label id="stdlib.h"><p>
421
422 <itemize>
423 <item><ref id="_heapadd" name="_heapadd">
424 <item><ref id="_heapblocksize" name="_heapblocksize">
425 <item><ref id="_heapmaxavail" name="_heapmaxavail">
426 <item><ref id="_heapmemavail" name="_heapmemavail">
427 <item><ref id="_poserror" name="_poserror">
428 <item><ref id="_randomize" name="_randomize">
429 <item><ref id="_swap" name="_swap">
430 <item><ref id="abort" name="abort">
431 <item><ref id="abs" name="abs">
432 <item><ref id="atexit" name="atexit">
433 <item><ref id="atoi" name="atoi">
434 <item><ref id="atol" name="atol">
435 <item><ref id="bsearch" name="bsearch">
436 <item><ref id="calloc" name="calloc">
437 <item><ref id="div" name="div">
438 <item><ref id="exit" name="exit">
439 <item><ref id="free" name="free">
440 <item><ref id="getenv" name="getenv">
441 <item><ref id="itoa" name="itoa">
442 <item><ref id="labs" name="labs">
443 <item><ref id="ltoa" name="ltoa">
444 <item><ref id="malloc" name="malloc">
445 <item><ref id="perror" name="perror">
446 <item><ref id="qsort" name="qsort">
447 <item><ref id="rand" name="rand">
448 <item><ref id="realloc" name="realloc">
449 <item><ref id="remove" name="remove">
450 <item><ref id="srand" name="srand">
451 <item><ref id="ultoa" name="ultoa">
452 <item><ref id="utoa" name="utoa">
453 </itemize>
454
455
456 <sect1><tt/string.h/<label id="string.h"><p>
457
458 <itemize>
459 <item><ref id="_stroserror" name="_stroserror">
460 <item><ref id="bzero" name="bzero">
461 <item><ref id="memchr" name="memchr">
462 <item><ref id="memcpy" name="memcpy">
463 <item><ref id="memmove" name="memmove">
464 <item><ref id="memset" name="memset">
465 <item><ref id="strcasecmp" name="strcasecmp">
466 <item><ref id="strcat" name="strcat">
467 <item><ref id="strchr" name="strchr">
468 <item><ref id="strcmp" name="strcmp">
469 <item><ref id="strcoll" name="strcoll">
470 <item><ref id="strcpy" name="strcpy">
471 <item><ref id="strcspn" name="strcspn">
472 <item><ref id="strdup" name="strdup">
473 <item><ref id="strerror" name="strerror">
474 <item><ref id="stricmp" name="stricmp">
475 <item><ref id="strlen" name="strlen">
476 <item><ref id="strlower" name="strlower">
477 <item><ref id="strlwr" name="strlwr">
478 <item><ref id="strncat" name="strncat">
479 <item><ref id="strncmp" name="strncmp">
480 <item><ref id="strncpy" name="strncpy">
481 <item><ref id="strrchr" name="strrchr">
482 <item><ref id="strspn" name="strspn">
483 <item><ref id="strstr" name="strstr">
484 <item><ref id="strtok" name="strtok">
485 <!-- <item><ref id="strxfrm" name="strxfrm"> -->
486 <item><ref id="strupper" name="strupper">
487 <item><ref id="strupr" name="strupr">
488 </itemize>
489
490 (incomplete)
491
492
493 <sect1><tt/tgi.h/<label id="tgi.h"><p>
494
495 (incomplete)
496
497
498 <sect1><tt/time.h/<label id="time.h"><p>
499
500 <itemize>
501 <!-- <item><ref id="_systime" name="_systime"> -->
502 <!-- <item><ref id="asctime" name="asctime"> -->
503 <!-- <item><ref id="clock" name="clock"> -->
504 <!-- <item><ref id="ctime" name="ctime"> -->
505 <!-- <item><ref id="gmtime" name="gmtime"> -->
506 <!-- <item><ref id="localtime" name="localtime"> -->
507 <!-- <item><ref id="mktime" name="mktime"> -->
508 <!-- <item><ref id="strftime" name="strftime"> -->
509 <item><ref id="time" name="time">
510 </itemize>
511
512 (incomplete)
513
514
515 <sect1><tt/unistd.h/<label id="unistd.h"><p>
516
517 <itemize>
518 <!-- <item><ref id="chdir" name="chdir"> -->
519 <!-- <item><ref id="getcwd" name="getcwd"> -->
520 <!-- <item><ref id="lseek" name="lseek"> -->
521 <!-- <item><ref id="mkdir" name="mkdir"> -->
522 <!-- <item><ref id="read" name="read"> -->
523 <!-- <item><ref id="rmdir" name="rmdir"> -->
524 <item><ref id="sleep" name="sleep">
525 <item><ref id="unlink" name="unlink">
526 <!-- <item><ref id="write" name="write"> -->
527 </itemize>
528
529 (incomplete)
530
531
532 <sect1><tt/vic20.h/<label id="vic20.h"><p>
533
534 (incomplete)
535
536
537 <sect1><tt/zlib.h/<label id="zlib.h"><p>
538
539 (incomplete)
540
541
542 <sect>Alphabetical function reference<p>
543
544 <sect1>_heapadd<label id="_heapadd"><p>
545
546 <quote>
547 <descrip>
548 <tag/Function/Add a block to the heap.
549 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
550 <tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
551 <tag/Description/The function adds a block of raw memory to the heap.
552 <tag/Limits/
553 <itemize>
554 <item>The minimum blocksize that can be added is 6 bytes; the function will
555 ignore smaller blocks.
556 </itemize>
557 <tag/Availability/cc65
558 <tag/See also/
559 <ref id="_heapblocksize" name="_heapblocksize">,
560 <ref id="_heapmaxavail" name="_heapmaxavail">,
561 <ref id="_heapmemavail" name="_heapmemavail">,
562 <ref id="calloc" name="calloc">,
563 <ref id="free" name="free">,
564 <ref id="malloc" name="malloc">,
565 <ref id="realloc" name="realloc">
566 <tag/Example/None.
567 </descrip>
568 </quote>
569
570
571 <sect1>_heapblocksize<label id="_heapblocksize"><p>
572
573 <quote>
574 <descrip>
575 <tag/Function/Return the size of an allocated block.
576 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
577 <tag/Declaration/<tt/size_t __fastcall__ _heapblocksize (const void* block);/
578 <tag/Description/The function returns the size of a block that must have
579 previously been allocated by <tt/<ref id="malloc" name="malloc">/, <tt/<ref
580 id="calloc" name="calloc">/ or <tt/<ref id="realloc" name="realloc">/.
581 <tag/Limits/
582 <itemize>
583 <item>Passing a pointer to a block that was is not the result of one of the
584 allocation functions, or that has been free'd will give unpredicable results.
585 </itemize>
586 <tag/Availability/cc65
587 <tag/See also/
588 <ref id="_heapadd" name="_heapadd">,
589 <ref id="_heapmaxavail" name="_heapmaxavail">,
590 <ref id="_heapmemavail" name="_heapmemavail">,
591 <ref id="calloc" name="calloc">,
592 <ref id="free" name="free">,
593 <ref id="malloc" name="malloc">,
594 <ref id="realloc" name="realloc">
595 <tag/Example/None.
596 </descrip>
597 </quote>
598
599
600 <sect1>_heapmaxavail<label id="_heapmaxavail"><p>
601
602 <quote>
603 <descrip>
604 <tag/Function/Return the largest block that is available on the heap.
605 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
606 <tag/Declaration/<tt/size_t __fastcall__ _heapmaxavail (void);/
607 <tag/Description/The function returns the size of the largest block that may
608 be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
609 <tag/Availability/cc65
610 <tag/See also/
611 <ref id="_heapadd" name="_heapadd">,
612 <ref id="_heapblocksize" name="_heapblocksize">,
613 <ref id="_heapmemavail" name="_heapmemavail">,
614 <ref id="calloc" name="calloc">,
615 <ref id="free" name="free">,
616 <ref id="malloc" name="malloc">,
617 <ref id="realloc" name="realloc">
618 <tag/Example/None.
619 </descrip>
620 </quote>
621
622
623 <sect1>_heapmemavail<label id="_heapmemavail"><p>
624
625 <quote>
626 <descrip>
627 <tag/Function/Return the total available space on the heap.
628 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
629 <tag/Declaration/<tt/size_t __fastcall__ _heapmemavail (void);/
630 <tag/Description/The function returns the total number of bytes available on
631 the heap.
632 <tag/Limits/
633 <itemize>
634 <item>This function is of less use than usually assumed, since the returned
635 heap space may be available but not in one block. So even if this function
636 says that several times more heap space is available than needed, <ref
637 id="malloc" name="malloc"> may still return <tt/NULL/.
638 </itemize>
639 <tag/Availability/cc65
640 <tag/See also/
641 <ref id="_heapadd" name="_heapadd">,
642 <ref id="_heapblocksize" name="_heapblocksize">,
643 <ref id="_heapmaxavail" name="_heapmaxavail">,
644 <ref id="calloc" name="calloc">,
645 <ref id="free" name="free">,
646 <ref id="malloc" name="malloc">,
647 <ref id="realloc" name="realloc">
648 <tag/Example/None.
649 </descrip>
650 </quote>
651
652
653 <sect1>_poserror<label id="_poserror"><p>
654
655 <quote>
656 <descrip>
657 <tag/Function/Print an error message for the error in <tt/_oserrno/.
658 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
659 <tag/Declaration/<tt/void __fastcall__ _poserror (const char* msg);/
660 <tag/Description/<tt/_poserror/ prints an error message to <tt/stderr/. If
661 <tt/msg/ is not <tt/NULL/ and not an empty string, it is printed followed by
662 a colon and a blank. Then the error message for the current contents of
663 <tt/_oserrno/ are printed followed by a newline. The message output is the
664 same as returned by <tt/<ref id="_stroserror" name="_stroserror">/ with an
665 argument of <tt/_oserrno/.
666 <tag/Limits/
667 <itemize>
668 <item>Since operating system specific error code are - you guessed it -
669 operating system specific, the value in <tt/_oserror/ and the message that is
670 printed depend on the cc65 target.
671 <item>The function is only available as fastcall function, so it may only
672 be used in presence of a prototype.
673 </itemize>
674 <tag/Availability/cc65
675 <tag/See also/
676 <ref id="_stroserror" name="_stroserror">,
677 <ref id="perror" name="perror">
678 <tag/Example/None.
679 </descrip>
680 </quote>
681
682
683 <sect1>_randomize<label id="_randomize"><p>
684
685 <quote>
686 <descrip>
687 <tag/Function/Initialize the pseudo random number generator.
688 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
689 <tag/Declaration/<tt/void _randomize (void);/
690 <tag/Description/The function initializes the random number generator with
691 a seed derived from fast changing hardware events, so the seed itself can be
692 considered random to a certain degree.
693 <tag/Limits/<itemize>
694 <item>The randomness of the seed depends on the machine hardware.
695 </itemize>
696 <tag/Availability/cc65
697 <tag/See also/
698 <ref id="rand" name="rand">,
699 <ref id="srand" name="srand">
700 <tag/Example/None.
701 </descrip>
702 </quote>
703
704
705 <sect1>_stroserror<label id="_stroserror"><p>
706
707 <quote>
708 <descrip>
709 <tag/Function/Return a string describing an OS specific error code.
710 <tag/Header/<tt/<ref id="string.h" name="string.h">/
711 <tag/Declaration/<tt/const char* __fastcall__ _stroserror (unsigned char errcode);/
712 <tag/Description/<tt/_stroserror/ will return a string describing the given
713 operating system specific error code.
714 <tag/Limits/<itemize>
715 <item>Since operating system specific error code are - you guessed it -
716 operating system specific, the parameter and the string returned depend on the
717 cc65 target.
718 <item>The function is only available as fastcall function, so it may only be
719 used in presence of a prototype.
720 </itemize>
721 <tag/Availability/cc65
722 <tag/See also/
723 <ref id="strerror" name="strerror">
724 <tag/Example/None.
725 </descrip>
726 </quote>
727
728
729 <sect1>_swap<label id="_swap"><p>
730
731 <quote>
732 <descrip>
733 <tag/Function/Swap the contents of memory areas.
734 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
735 <tag/Declaration/<tt/void __fastcall__ _swap (void* p, void* q, size_t size);/
736 <tag/Description/<tt/_swap/ will swap (exchange) the contents of the two memory
737 areas pointed to by <tt/p/ and <tt/q/. Both memory areas are assumed to be
738 <tt/size/ bytes in size.
739 <tag/Limits/<itemize>
740 <item>The memory areas may not overlap, otherwise the results are undefined.
741 <item>The function is only available as fastcall function, so it may only be
742 used in presence of a prototype.
743 </itemize>
744 <tag/Availability/cc65
745 <tag/See also/
746 <ref id="memcpy" name="memcpy">,
747 <ref id="memmove" name="memmove">
748 <tag/Example/None.
749 </descrip>
750 </quote>
751
752
753 <sect1>_sys<label id="_sys"><p>
754
755 <quote>
756 <descrip>
757 <tag/Function/Call a subroutine passing register values.
758 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
759 <tag/Declaration/<tt/void __fastcall__ _sys (struct regs* r);/
760 <tag/Description/The function will call the subroutine at the address
761 specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
762 registers and the CPU flags are set to the values given in the <tt/regs/
763 structure. On return from the subroutine, the new values of the registers and
764 flags are stored back overwriting the old values.
765 <tag/Limits/<itemize>
766 <item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
767 when calling the subroutine (they are unchanged from their current values).
768 <item>The function is only available as fastcall function, so it may only be
769 used in presence of a prototype.
770 </itemize>
771 <tag/Availability/cc65
772 <tag/Example/None.
773 </descrip>
774 </quote>
775
776
777 <sect1>BRK<label id="BRK"><p>
778
779 <quote>
780 <descrip>
781 <tag/Function/Insert a 6502 BRK instrunction into the code.
782 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
783 <tag/Declaration/<tt/void BRK (void);/
784 <tag/Description/The function will insert a 6502 BRK instruction into the code
785 which may be used to trigger a debugger.
786 <tag/Limits/<itemize>
787 <item>The function is actually a macro.
788 <item>The inserted instruction may lead to unexpected results if no debugger
789 is present.
790 </itemize>
791 <tag/Availability/cc65
792 <tag/See also/
793 <ref id="CLI" name="CLI">,
794 <ref id="SEI" name="SEI">
795 <tag/Example/None.
796 </descrip>
797 </quote>
798
799
800 <sect1>CLI<label id="CLI"><p>
801
802 <quote>
803 <descrip>
804 <tag/Function/Insert a 6502 CLI instrunction into the code.
805 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
806 <tag/Declaration/<tt/void CLI (void);/
807 <tag/Description/The function will insert a 6502 CLI instruction into the code,
808 so interrupts are disabled. Note that non maskable interrupts cannot be
809 disabled.
810 <tag/Limits/<itemize>
811 <item>The function is actually a macro.
812 <item>Disabling interrupts may lead to unexpected results.
813 </itemize>
814 <tag/Availability/cc65
815 <tag/See also/
816 <ref id="BRK" name="BRK">,
817 <ref id="SEI" name="SEI">
818 <tag/Example/None.
819 </descrip>
820 </quote>
821
822
823 <sect1>PEEK<label id="PEEK"><p>
824
825 <quote>
826 <descrip>
827 <tag/Function/Read a byte from memory.
828 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
829 <tag/Declaration/<tt/unsigned char PEEK (unsigned addr);/
830 <tag/Description/The function will read the absolute memory given by <tt/addr/
831 and return the value read.
832 <tag/Limits/<itemize>
833 <item>The function is actually a macro.
834 <item>This function depends highly on the platform and environment.
835 </itemize>
836 <tag/Availability/cc65
837 <tag/See also/
838 <ref id="PEEKW" name="PEEKW">,
839 <ref id="POKE" name="POKE">
840 <tag/Example/None.
841 </descrip>
842 </quote>
843
844
845 <sect1>PEEKW<label id="PEEKW"><p>
846
847 <quote>
848 <descrip>
849 <tag/Function/Read a word (two bytes) from memory.
850 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
851 <tag/Declaration/<tt/unsigned PEEKW (unsigned addr);/
852 <tag/Description/The function will read the absolute memory given by <tt/addr/
853 and return the value read. The byte read from the higher address is the high
854 byte of the return value.
855 <tag/Limits/<itemize>
856 <item>The function is actually a macro.
857 <item>This function depends highly on the platform and environment.
858 <item>The order in which the two bytes are read is unspecified and may
859 depend of the address expression used.
860 </itemize>
861 <tag/Availability/cc65
862 <tag/See also/
863 <ref id="PEEK" name="PEEK">,
864 <ref id="POKE" name="POKE">
865 <tag/Example/None.
866 </descrip>
867 </quote>
868
869
870 <sect1>POKE<label id="POKE"><p>
871
872 <quote>
873 <descrip>
874 <tag/Function/Write a byte to memory.
875 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
876 <tag/Declaration/<tt/void POKE (unsigned addr, unsigned char val);/
877 <tag/Description/The function writes the value <tt/val/ to the absolute
878 memory address given by <tt/addr/.
879 <tag/Limits/<itemize>
880 <item>The function is actually a macro.
881 <item>This function depends highly on the platform and environment.
882 <item>Careless use will cause the program to act strange or may crash the
883 machine.
884 </itemize>
885 <tag/Availability/cc65
886 <tag/See also/
887 <ref id="PEEK" name="PEEK">,
888 <ref id="POKEW" name="POKEW">
889 <tag/Example/None.
890 </descrip>
891 </quote>
892
893
894 <sect1>POKEW<label id="POKEW"><p>
895
896 <quote>
897 <descrip>
898 <tag/Function/Write a word (two bytes) to memory.
899 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
900 <tag/Declaration/<tt/void POKEW (unsigned addr, unsigned val);/
901 <tag/Description/The function writes the value <tt/val/ to the absolute
902 memory address given by <tt/addr/. The low byte of <tt/val/ is written to
903 the <tt/addr/, the high byte is written to <tt/addr+1/.
904 <tag/Limits/<itemize>
905 <item>The function is actually a macro.
906 <item>This function depends highly on the platform and environment.
907 <item>Careless use will cause the program to act strange or may crash the
908 machine.
909 <item>The order in which the two bytes are written is unspecified and may
910 depend of the address expression used.
911 </itemize>
912 <tag/Availability/cc65
913 <tag/See also/
914 <ref id="PEEK" name="PEEK">,
915 <ref id="POKE" name="POKE">
916 <tag/Example/None.
917 </descrip>
918 </quote>
919
920
921 <sect1>SEI<label id="SEI"><p>
922
923 <quote>
924 <descrip>
925 <tag/Function/Insert a 6502 SEI instrunction into the code.
926 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
927 <tag/Declaration/<tt/void SEI (void);/
928 <tag/Description/The function will insert a 6502 SEI instruction into the code,
929 so interrupts are enabled. Enabling interrupts has no effects if they are
930 already enabled (the default).
931 <tag/Limits/<itemize>
932 <item>The function is actually a macro.
933 </itemize>
934 <tag/Availability/cc65
935 <tag/See also/
936 <ref id="BRK" name="BRK">,
937 <ref id="CLI" name="CLI">
938 <tag/Example/None.
939 </descrip>
940 </quote>
941
942
943 <sect1>abort<label id="abort"><p>
944
945 <quote>
946 <descrip>
947 <tag/Function/Terminates a program abnormally.
948 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
949 <tag/Declaration/<tt/void abort (void);/
950 <tag/Description/<tt/abort/ raises <tt/SIGABRT/, writes a termination message
951 on stderr, then terminates the program with an exit code of 3.
952 <tag/Availability/ISO 9899
953 <tag/See also/
954 <ref id="assert" name="assert">,
955 <ref id="exit" name="exit">,
956 <ref id="raise" name="raise">
957 <tag/Example/None.
958 </descrip>
959 </quote>
960
961
962 <sect1>abs<label id="abs"><p>
963
964 <quote>
965 <descrip>
966 <tag/Function/Returns the absolute value of an integer.
967 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
968 <tag/Declaration/<tt/int __fastcall__ abs (int v);/
969 <tag/Description/<tt/abs/ returns the absolute value of the argument passed to
970 the function.
971 <tag/Limits/<itemize>
972 <item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
973 <item>The function is only available as fastcall function, so it may only be
974 used in presence of a prototype.
975 </itemize>
976 <tag/Availability/ISO 9899
977 <tag/See also/
978 <ref id="labs" name="labs">
979 <tag/Example/None.
980 </descrip>
981 </quote>
982
983
984 <sect1>assert<label id="assert"><p>
985
986 <quote>
987 <descrip>
988 <tag/Function/Test a condition and possibly abort.
989 <tag/Header/<tt/<ref id="assert.h" name="assert.h">/
990 <tag/Declaration/<tt/void assert (int cond);/
991 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
992 statement. If the condition evaluates t zero (false), assert prints a message
993 on stderr and aborts the program.
994 <tag/Limits/<itemize>
995 <item>The function is actually a macro.
996 </itemize>
997 <tag/Availability/ISO 9899
998 <tag/See also/
999 <ref id="abort" name="abort">,
1000 <ref id="exit" name="exit">
1001 <tag/Example/None.
1002 </descrip>
1003 </quote>
1004
1005
1006 <sect1>atexit<label id="atexit"><p>
1007
1008 <quote>
1009 <descrip>
1010 <tag/Function/Register an exit function.
1011 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1012 <tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
1013 <tag/Description/<tt/atexit/ registers the function pointed to by
1014 <tt/exitfunc/ as an exit function. Exit functions are called when the program
1015 terminates, they are called in LIFO order (the last function registered is
1016 called first). <tt/atexit/ returns zero on success and a nonzero value on
1017 failure.
1018 <tag/Limits/<itemize>
1019 <item>A maximum of 5 exit functions can be registered.
1020 <item>There is no way to unregister an exit function.
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/ISO 9899
1025 <tag/See also/
1026 <ref id="abort" name="abort">,
1027 <ref id="exit" name="exit">
1028 <tag/Example/None.
1029 </descrip>
1030 </quote>
1031
1032
1033 <sect1>atoi<label id="atoi"><p>
1034
1035 <quote>
1036 <descrip>
1037 <tag/Function/Convert a string to an integer.
1038 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1039 <tag/Declaration/<tt/int __fastcall__ atoi (const char* s);/
1040 <tag/Description/<tt/atoi/ converts the given string into an integer.
1041 Conversion stops as soon as any invalid character is encountered.
1042 <tag/Limits/<itemize>
1043 <item>There is no way to detect any conversion errors.
1044 <item>The function does not check for an numerical overflow when converting.
1045 <item>The function is only available as fastcall function, so it may only be
1046 used in presence of a prototype.
1047 </itemize>
1048 <tag/Availability/ISO 9899
1049 <tag/See also/
1050 <ref id="atol" name="atol">,
1051 <ref id="itoa" name="itoa">,
1052 <ref id="ltoa" name="ltoa">,
1053 <ref id="ultoa" name="ultoa">,
1054 <ref id="utoa" name="utoa">
1055 <tag/Example/None.
1056 </descrip>
1057 </quote>
1058
1059
1060 <sect1>atol<label id="atol"><p>
1061
1062 <quote>
1063 <descrip>
1064 <tag/Function/Convert a string to a long integer.
1065 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1066 <tag/Declaration/<tt/long __fastcall__ atol (const char* s);/
1067 <tag/Description/<tt/atol/ converts the given string into a long integer.
1068 Conversion stops as soon as any invalid character is encountered.
1069 <tag/Limits/<itemize>
1070 <item>There is no way to detect any conversion errors.
1071 <item>The function does not check for an numerical overflow when converting.
1072 <item>The function is only available as fastcall function, so it may only be
1073 used in presence of a prototype.
1074 </itemize>
1075 <tag/Availability/ISO 9899
1076 <tag/See also/
1077 <ref id="atoi" name="atoi">,
1078 <ref id="itoa" name="itoa">,
1079 <ref id="ltoa" name="ltoa">,
1080 <ref id="ultoa" name="ultoa">,
1081 <ref id="utoa" name="utoa">
1082 <tag/Example/None.
1083 </descrip>
1084 </quote>
1085
1086
1087 <sect1>bgcolor<label id="bgcolor"><p>
1088
1089 <quote>
1090 <descrip>
1091 <tag/Function/Set the background text color.
1092 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1093 <tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
1094 <tag/Description/The function will set a new background color and return the
1095 old (current) one. The background color is valid for the whole text output
1096 area of the screen, not just for new text.
1097 <tag/Limits/<itemize>
1098 <item>Background colors are system dependent. The function may have no effect
1099 on systems where the background color cannot be changed.
1100 <item>The function is only available as fastcall function, so it may only be
1101 used in presence of a prototype.
1102 </itemize>
1103 <tag/Availability/cc65
1104 <tag/See also/
1105 <ref id="bordercolor" name="bordercolor">,
1106 <ref id="textcolor" name="textcolor">
1107 <tag/Example/None.
1108 </descrip>
1109 </quote>
1110
1111
1112 <sect1>bordercolor<label id="bordercolor"><p>
1113
1114 <quote>
1115 <descrip>
1116 <tag/Function/Set the border (frame) color.
1117 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1118 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
1119 <tag/Description/The function will set a new border color. It returns the old
1120 (current) border color.
1121 <tag/Limits/<itemize>
1122 <item>Border colors are system dependent. The function may have no effect
1123 on systems where the border color cannot be changed.
1124 <item>The function is only available as fastcall function, so it may only
1125 be used in presence of a prototype.
1126 </itemize>
1127 <tag/Availability/cc65
1128 <tag/See also/
1129 <ref id="bgcolor" name="bgcolor">,
1130 <ref id="textcolor" name="textcolor">
1131 <tag/Example/None.
1132 </descrip>
1133 </quote>
1134
1135
1136 <sect1>bsearch<label id="bsearch"><p>
1137
1138 <quote>
1139 <descrip>
1140 <tag/Function/Do a binary search in a sorted array.
1141 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1142 <tag/Declaration/<tt/void* __fastcall__ bsearch (const void* key,
1143 const void* base, size_t n, size_t size,
1144 int (*cmp) (const void*, const void*));/
1145 <tag/Description/<tt/bsearch/ searches a sorted array for a member that
1146 matches the one pointed to by <tt/key/. <tt/base/ is the address of the array,
1147 <tt/n/ is the number of elements, <tt/size/ the size of an element and <tt/cmp/
1148 the function used to compare the members against the key. The function returns
1149 a pointer to the member found, or <tt/NULL/ if there was no match.
1150 <tag/Limits/
1151 <itemize>
1152 <item>The contents of the array must be sorted in ascending order according to
1153 the compare function given.
1154 <item>If there are multiple members that match the key, the function will
1155 return one of the members.
1156 <item>The function is only available as fastcall function, so it may only
1157 be used in presence of a prototype.
1158 </itemize>
1159 <tag/Availability/ISO 9899
1160 <tag/See also/
1161 <ref id="qsort" name="qsort">
1162 <tag/Example/None.
1163 </descrip>
1164 </quote>
1165
1166
1167 <sect1>bzero<label id="bzero"><p>
1168
1169 <quote>
1170 <descrip>
1171 <tag/Function/Fill a memory area with zeroes.
1172 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1173 <tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
1174 <tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
1175 zero.
1176 <tag/Limits/
1177 <itemize>
1178 <item>The function is non standard and therefore only available in non ANSI
1179 mode. You should use <tt/<ref id="memset" name="memset">/ instead.
1180 <item>The function is only available as fastcall function, so it may only
1181 be used in presence of a prototype.
1182 </itemize>
1183 <tag/Availability/cc65
1184 <tag/See also/
1185 <ref id="_swap" name="_swap">,
1186 <ref id="memcpy" name="memcpy">,
1187 <ref id="memmove" name="memmove">,
1188 <ref id="memset" name="memset">,
1189 <tag/Example/None.
1190 </descrip>
1191 </quote>
1192
1193
1194 <sect1>c64mode<label id="c64mode"><p>
1195
1196 <quote>
1197 <descrip>
1198 <tag/Function/Switch the C128 into C64 compatible mode.
1199 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1200 <tag/Declaration/<tt/void c64mode (void);/
1201 <tag/Description/The function will cause the machine to reboot into C64 mode.
1202 <tag/Limits/<itemize>
1203 <item>The function is specific to the C128.
1204 <item>The function will not return to the caller.
1205 </itemize>
1206 <tag/Availability/C128
1207 <tag/Example/None.
1208 </descrip>
1209 </quote>
1210
1211
1212 <sect1>calloc<label id="calloc"><p>
1213
1214 <quote>
1215 <descrip>
1216 <tag/Function/Allocate and clear memory.
1217 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1218 <tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
1219 <tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
1220 of size <tt/size/, clears the whole block with binary zeroes and returns a
1221 pointer to it. On error (not enough memory available), <tt/calloc/ returns
1222 <tt/NULL/.
1223 <tag/Limits/
1224 <itemize>
1225 <item>Clearing the memory may not have the expected effect on all platforms:
1226 pointers in the block may not be <tt/NULL/ and floating point variables may
1227 not be zero (0.0). In other words: The "clearing" effect of this function
1228 should be used with care for portable programs.
1229 <item>The function is only available as fastcall function, so it may only
1230 be used in presence of a prototype.
1231 </itemize>
1232 <tag/Availability/ISO 9899
1233 <tag/See also/
1234 <ref id="_heapadd" name="_heapadd">,
1235 <ref id="_heapblocksize" name="_heapblocksize">,
1236 <ref id="_heapmaxavail" name="_heapmaxavail">,
1237 <ref id="_heapmemavail" name="_heapmemavail">,
1238 <ref id="free" name="free">,
1239 <ref id="malloc" name="malloc">,
1240 <ref id="realloc" name="realloc">
1241 <tag/Example/None.
1242 </descrip>
1243 </quote>
1244
1245
1246 <sect1>cclear<label id="cclear"><p>
1247
1248 <quote>
1249 <descrip>
1250 <tag/Function/Clear part of a line (write a given number of spaces).
1251 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1252 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
1253 <tag/Description/The function clears part of a line by writing <tt/length/
1254 spaces in the current text color.
1255 <tag/Limits/<itemize>
1256 <item>The function is only available as fastcall function, so it may
1257 only be used in presence of a prototype.
1258 </itemize>
1259 <tag/Availability/cc65
1260 <tag/See also/
1261 <ref id="cclearxy" name="cclearxy">,
1262 <ref id="clrscr" name="clrscr">
1263 <tag/Example/None.
1264 </descrip>
1265 </quote>
1266
1267
1268 <sect1>cclearxy<label id="cclearxy"><p>
1269
1270 <quote>
1271 <descrip>
1272 <tag/Function/Clear part of a line (write a given number of spaces) starting
1273 at a specific screen position.
1274 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1275 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char x, unsigned char y, unsigned char length);/
1276 <tag/Description/The function moves the cursor to a specific position, and
1277 will then clear part of the line by writing <tt/length/ spaces in the current
1278 text color.
1279 <tag/Limits/<itemize>
1280 <item>The function is only available as fastcall function, so it may
1281 only be used in presence of a prototype.
1282 </itemize>
1283 <tag/Availability/cc65
1284 <tag/See also/
1285 <ref id="cclear" name="cclear">,
1286 <ref id="clrscr" name="clrscr">
1287 <tag/Example/None.
1288 </descrip>
1289 </quote>
1290
1291
1292 <sect1>cgetc<label id="cgetc"><p>
1293
1294 <quote>
1295 <descrip>
1296 <tag/Function/Read a character from the keyboard.
1297 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1298 <tag/Declaration/<tt/char cgetc (void);/
1299 <tag/Description/The function reads a character from the keyboard. If there is
1300 no character available, <tt/cgetc/ waits until the user presses a key. If the
1301 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
1302 displayed while waiting.
1303 <tag/Limits/<itemize>
1304 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
1305 from this buffer and wait only if the buffer is empty.
1306 </itemize>
1307 <tag/Availability/cc65
1308 <tag/See also/
1309 <ref id="cursor" name="cursor">,
1310 <ref id="kbhit" name="kbhit">
1311 <tag/Example/None.
1312 </descrip>
1313 </quote>
1314
1315
1316 <sect1>chline<label id="chline"><p>
1317
1318 <quote>
1319 <descrip>
1320 <tag/Function/Output a horizontal line in text mode.
1321 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1322 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
1323 <tag/Description/The function outputs a horizontal line with the given length
1324 starting at the current cursor position.
1325 <tag/Limits/<itemize>
1326 <item>The character used to draw the horizontal line is system dependent.
1327 If available, a line drawing character is used. Drawing a line that is partially
1328 off screen leads to undefined behaviour.
1329 <item>The function is only available as fastcall function, so it may only be
1330 used in presence of a prototype.
1331 </itemize>
1332 <tag/Availability/cc65
1333 <tag/See also/
1334 <ref id="chlinexy" name="chlinexy">,
1335 <ref id="cvline" name="cvline">,
1336 <ref id="cvlinexy" name="cvlinexy">
1337 <tag/Example/None.
1338 </descrip>
1339 </quote>
1340
1341
1342 <sect1>chlinexy<label id="chlinexy"><p>
1343
1344 <quote>
1345 <descrip>
1346 <tag/Function/Output a horizontal line at a given position in text mode.
1347 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1348 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
1349 <tag/Description/The function outputs a horizontal line with the given length
1350 starting at a given position.
1351 <tag/Limits/<itemize>
1352 <item>The character used to draw the horizontal line is system dependent.
1353 If available, a line drawing character is used. Drawing a line that is partially
1354 off screen leads to undefined behaviour.
1355 <item>The function is only available as fastcall function, so it may only be
1356 used in presence of a prototype.
1357 </itemize>
1358 <tag/Availability/cc65
1359 <tag/See also/
1360 <ref id="chline" name="chline">,
1361 <ref id="cvline" name="cvline">,
1362 <ref id="cvlinexy" name="cvlinexy">
1363 <tag/Example/None.
1364 </descrip>
1365 </quote>
1366
1367
1368 <sect1>clearerr<label id="clearerr"><p>
1369
1370 <quote>
1371 <descrip>
1372 <tag/Function/Clear error and end-of-file status of a stream.
1373 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
1374 <tag/Declaration/<tt/void __fastcall__ clearerr (FILE* f);/
1375 <tag/Description/<tt/clearerr/ clears the error and end-of-file status
1376 indicators for the stream <tt/f/.
1377 <tag/Limits/<itemize>
1378 <item>The function is only available as fastcall function, so it may only be
1379 used in presence of a prototype.
1380 </itemize>
1381 <tag/Availability/ISO 9899
1382 <tag/See also/
1383 <ref id="feof" name="feof">,
1384 <ref id="ferror" name="ferror">
1385 <tag/Example/None.
1386 </descrip>
1387 </quote>
1388
1389
1390 <sect1>clrscr<label id="clrscr"><p>
1391
1392 <quote>
1393 <descrip>
1394 <tag/Function/Clear the text screen.
1395 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1396 <tag/Declaration/<tt/void clrscr (void);/
1397 <tag/Description/The function clears the text screen and moves the cursor to
1398 the upper left corner.
1399 <tag/Availability/cc65
1400 <tag/See also/
1401 <ref id="cclear" name="cclear">,
1402 <ref id="cclearxy" name="cclearxy">
1403 <tag/Example/None.
1404 </descrip>
1405 </quote>
1406
1407
1408 <sect1>close<label id="close"><p>
1409
1410 <quote>
1411 <descrip>
1412 <tag/Function/Close a file descriptor.
1413 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1414 <tag/Declaration/<tt/int __fastcall__ close (int fd);/
1415 <tag/Description/The function closes the given file descriptor. It returns zero
1416 on success and -1 on error. If an error occurs, the cause can be determined by
1417 reading the <tt/errno/ variable.
1418 <tag/Limits/<itemize>
1419 <item>The function is only available as fastcall function, so it may only
1420 be used in presence of a prototype.
1421 </itemize>
1422 <tag/Availability/POSIX 1003.1
1423 <tag/See also/
1424 <ref id="creat" name="creat">,
1425 <ref id="open" name="open">
1426 <tag/Example/None.
1427 </descrip>
1428 </quote>
1429
1430
1431 <sect1>creat<label id="creat"><p>
1432
1433 <quote>
1434 <descrip>
1435 <tag/Function/Create a file.
1436 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1437 <tag/Declaration/<tt/int __fastcall__ creat (const char* name, unsigned mode);/
1438 <tag/Description/<tt/creat/ creates a new file and returns the file descriptor
1439 associated with it. On error, -1 is returned and an error code is stored in
1440 <tt/errno/.
1441 <tag/Limits/<itemize>
1442 <item><tt/creat/ is identical to calling <tt/<ref id="open" name="open">/ with
1443 <tt/flags/ equal to <tt/O_WRONLY | O_CREAT | O_TRUNC/.
1444 <item>The function is only available as fastcall function, so it may only
1445 be used in presence of a prototype.
1446 </itemize>
1447 <tag/Availability/POSIX 1003.1
1448 <tag/See also/
1449 <ref id="close" name="close">,
1450 <ref id="open" name="open">
1451 <tag/Example/None.
1452 </descrip>
1453 </quote>
1454
1455
1456 <sect1>cprintf<label id="cprintf"><p>
1457
1458 <quote>
1459 <descrip>
1460 <tag/Function/Formatted output to the console.
1461 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1462 <tag/Declaration/<tt/int cprintf (const char* format, ...);/
1463 <tag/Description/The arguments are converted to text where necessary and
1464 formatted according to the format string given. The resulting string is output
1465 to the console. <tt/cprintf/ supports the same format specifiers as
1466 <tt/printf/. <!-- <tt/<ref id="printf" name="printf">/. -->
1467 <tag/Limits/<itemize>
1468 <item>Like all other <tt/conio/ output functions, <tt/cprintf/ distinguishes
1469 between <tt/\r/ and <tt/\n/.
1470 </itemize>
1471 <tag/Availability/cc65
1472 <tag/See also/
1473 <ref id="cputc" name="cputc">,
1474 <ref id="cputcxy" name="cputcxy">,
1475 <ref id="cputs" name="cputs">,
1476 <ref id="cputsxy" name="cputsxy">,
1477 <ref id="vcprintf" name="vcprintf">
1478 <tag/Example/None.
1479 </descrip>
1480 </quote>
1481
1482
1483 <sect1>cputc<label id="cputc"><p>
1484
1485 <quote>
1486 <descrip>
1487 <tag/Function/Output a character directly to the console.
1488 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1489 <tag/Declaration/<tt/void __fastcall__ cputc (char c);/
1490 <tag/Description/Output one character to the console at the current cursor
1491 position.
1492 <tag/Limits/<itemize>
1493 <item>Like all other <tt/conio/ output functions, <tt/cputc/ distinguishes
1494 between <tt/\r/ and <tt/\n/.
1495 <item>The function is only available as fastcall function, so it may only
1496 be used in presence of a prototype.
1497 </itemize>
1498 <tag/Availability/cc65
1499 <tag/See also/
1500 <ref id="cprintf" name="cprintf">,
1501 <ref id="cputcxy" name="cputcxy">,
1502 <ref id="cputs" name="cputs">,
1503 <ref id="cputsxy" name="cputsxy">,
1504 <ref id="vcprintf" name="vcprintf">
1505 <tag/Example/None.
1506 </descrip>
1507 </quote>
1508
1509
1510 <sect1>cputcxy<label id="cputcxy"><p>
1511
1512 <quote>
1513 <descrip>
1514 <tag/Function/Output a character at a specific screen position.
1515 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1516 <tag/Declaration/<tt/void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);/
1517 <tag/Description/<tt/cputcxy/ moves the cursor to the given x/y position on
1518 the screen and outputs one character.
1519 <tag/Limits/<itemize>
1520 <item>Like all other <tt/conio/ output functions, <tt/cputcxy/ distinguishes
1521 between <tt/\r/ and <tt/\n/.
1522 <item>The function is only available as fastcall function, so it may only
1523 be used in presence of a prototype.
1524 </itemize>
1525 <tag/Availability/cc65
1526 <tag/See also/
1527 <ref id="cprintf" name="cprintf">,
1528 <ref id="cputc" name="cputc">,
1529 <ref id="cputs" name="cputs">,
1530 <ref id="cputsxy" name="cputsxy">,
1531 <ref id="vcprintf" name="vcprintf">
1532 <tag/Example/None.
1533 </descrip>
1534 </quote>
1535
1536
1537 <sect1>cputs<label id="cputs"><p>
1538
1539 <quote>
1540 <descrip>
1541 <tag/Function/Output a string directly to the console.
1542 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1543 <tag/Declaration/<tt/void __fastcall__ cputs (const char* s);/
1544 <tag/Description/The function outputs the given string on the console at the
1545 current cursor position.
1546 <tag/Limits/<itemize>
1547 <item>Like all other <tt/conio/ output functions, <tt/cputs/ distinguishes
1548 between <tt/\r/ and <tt/\n/.
1549 <item>The function is only available as fastcall function, so it may only
1550 be used in presence of a prototype.
1551 </itemize>
1552 <tag/Availability/cc65
1553 <tag/See also/
1554 <ref id="cprintf" name="cprintf">,
1555 <ref id="cputc" name="cputc">,
1556 <ref id="cputcxy" name="cputcxy">,
1557 <ref id="cputsxy" name="cputsxy">,
1558 <ref id="vcprintf" name="vcprintf">
1559 <tag/Example/None.
1560 </descrip>
1561 </quote>
1562
1563
1564 <sect1>cputsxy<label id="cputsxy"><p>
1565
1566 <quote>
1567 <descrip>
1568 <tag/Function/Output a string to the console at a given position.
1569 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1570 <tag/Declaration/<tt/void __fastcall__ cputsxy (unsigned char x, unsigned char y, const char* s);/
1571 <tag/Description/<tt/cputsxy/ moves the cursor to the given x/y position,
1572 and outputs the string <tt/s/.
1573 <tag/Limits/<itemize>
1574 <item>Like all other <tt/conio/ output functions, <tt/cputsxy/ distinguishes
1575 between <tt/\r/ and <tt/\n/.
1576 <item>The function is only available as fastcall function, so it may only
1577 be used in presence of a prototype.
1578 </itemize>
1579 <tag/Availability/cc65
1580 <tag/See also/
1581 <ref id="cprintf" name="cprintf">,
1582 <ref id="cputc" name="cputc">,
1583 <ref id="cputcxy" name="cputcxy">,
1584 <ref id="cputs" name="cputs">,
1585 <ref id="vcprintf" name="vcprintf">
1586 <tag/Example/None.
1587 </descrip>
1588 </quote>
1589
1590
1591 <sect1>cursor<label id="cursor"><p>
1592
1593 <quote>
1594 <descrip>
1595 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
1596 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1597 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
1598 <tag/Description/If the argument to the function is non zero, a blinking cursor
1599 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
1600 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
1601 <tag/Limits/<itemize>
1602 <item>The function is only available as fastcall function, so it may only
1603 be used in presence of a prototype.
1604 </itemize>
1605 <tag/Availability/cc65
1606 <tag/See also/
1607 <ref id="cgetc" name="cgetc">,
1608 <ref id="kbhit" name="kbhit">
1609 <tag/Example/None.
1610 </descrip>
1611 </quote>
1612
1613
1614 <sect1>cvline<label id="cvline"><p>
1615
1616 <quote>
1617 <descrip>
1618 <tag/Function/Output a vertical line in text mode.
1619 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1620 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
1621 <tag/Description/The function outputs a vertical line with the given length
1622 starting at the current cursor position.
1623 <tag/Limits/<itemize>
1624 <item>The character used to draw the vertical line is system dependent.
1625 If available, a line drawing character is used. Drawing a line that is partially
1626 off screen leads to undefined behaviour.
1627 <item>The function is only available as fastcall function, so it may only be
1628 used in presence of a prototype.
1629 </itemize>
1630 <tag/Availability/cc65
1631 <tag/See also/
1632 <ref id="chline" name="chline">,
1633 <ref id="chlinexy" name="chlinexy">,
1634 <ref id="cvlinexy" name="cvlinexy">
1635 <tag/Example/None.
1636 </descrip>
1637 </quote>
1638
1639
1640 <sect1>cvlinexy<label id="cvlinexy"><p>
1641
1642 <quote>
1643 <descrip>
1644 <tag/Function/Output a vertical line at a given position in text mode.
1645 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1646 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
1647 <tag/Description/The function outputs a vertical line with the given length
1648 starting at a given position.
1649 <tag/Limits/<itemize>
1650 <item>The character used to draw the vertical line is system dependent.
1651 If available, a line drawing character is used. Drawing a line that is partially
1652 off screen leads to undefined behaviour.
1653 <item>The function is only available as fastcall function, so it may only be
1654 used in presence of a prototype.
1655 </itemize>
1656 <tag/Availability/cc65
1657 <tag/See also/
1658 <ref id="chline" name="chline">,
1659 <ref id="chlinexy" name="chlinexy">,
1660 <ref id="cvline" name="cvline">
1661 <tag/Example/None.
1662 </descrip>
1663 </quote>
1664
1665
1666 <sect1>div<label id="div"><p>
1667
1668 <quote>
1669 <descrip>
1670 <tag/Function/Divide two ints and return quotient and remainder.
1671 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1672 <tag/Declaration/<tt/div_t __fastcall__ div (int numer, int denom);/
1673 <tag/Description/<tt/div/ divides <tt/numer/ by <tt/denom/ and returns the
1674 quotient and remainder in a <tt/div_t/ structure.
1675 <tag/Limits/
1676 <itemize>
1677 <item>The function is only available as fastcall function, so it may only
1678 be used in presence of a prototype.
1679 </itemize>
1680 <tag/Availability/ISO 9899
1681 <tag/See also/
1682 ldiv
1683 <tag/Example/None.
1684 </descrip>
1685 </quote>
1686
1687
1688 <sect1>em_commit<label id="em_commit"><p>
1689
1690 <quote>
1691 <descrip>
1692 <tag/Function/Commit changes into extended memory.
1693 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1694 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
1695 <tag/Description/Commit changes in the memory window to extended storage. If
1696 the contents of the memory window have been changed, these changes may be lost
1697 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
1698 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
1699 name="em_copyto">/ are called without calling <tt/em_commit/ first.
1700 <tag/Limits/<itemize>
1701 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
1702 memory window are discarded, it does just mean that the drivers is allowed
1703 to discard it.
1704 <item>The function is only available as fastcall function, so it may only be
1705 used in presence of a prototype.
1706 <item>The function produces undefined results if no extended memory driver is
1707 loaded.
1708 </itemize>
1709 <tag/Availability/cc65
1710 <tag/See also/
1711 <ref id="em_load_driver" name="em_load_driver">,
1712 <ref id="em_map" name="em_map">,
1713 <ref id="em_use" name="em_use">
1714 <tag/Example/None.
1715 </descrip>
1716 </quote>
1717
1718
1719 <sect1>em_copyfrom<label id="em_copyfrom"><p>
1720
1721 <quote>
1722 <descrip>
1723 <tag/Function/Copy from extended into normal memory.
1724 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1725 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
1726 <tag/Description/Copy data from extended memory into linear memory. Source and
1727 target addresses as well as the number of bytes to transfer are specified in
1728 the <tt/em_copy/ structure that is passed as a parameter.
1729 <tag/Limits/<itemize>
1730 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
1731 made any changes to the data in the window, call <tt/<ref id="em_commit"
1732 name="em_commit">/ first, or the changes are lost.
1733 <item>The function is only available as fastcall function, so it may only be
1734 used in presence of a prototype.
1735 <item>The function produces undefined results if no extended memory driver is
1736 loaded.
1737 </itemize>
1738 <tag/Availability/cc65
1739 <tag/See also/
1740 <ref id="em_commit" name="em_commit">,
1741 <ref id="em_copyto" name="em_copyto">,
1742 <ref id="em_load_driver" name="em_load_driver">
1743 <tag/Example/None.
1744 </descrip>
1745 </quote>
1746
1747
1748 <sect1>em_copyto<label id="em_copyto"><p>
1749
1750 <quote>
1751 <descrip>
1752 <tag/Function/Copy from normal into extended memory.
1753 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1754 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
1755 <tag/Description/Copy data from linear into extended memory. Source and
1756 target addresses as well as the number of bytes to transfer are specified in
1757 the <tt/em_copy/ structure that is passed as a parameter.
1758 <tag/Limits/<itemize>
1759 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
1760 made any changes to the data in the window, call <tt/<ref id="em_commit"
1761 name="em_commit">/ first, or the changes are lost.
1762 <item>The function is only available as fastcall function, so it may only be
1763 used in presence of a prototype.
1764 <item>The function produces undefined results if no extended memory driver is
1765 loaded.
1766 </itemize>
1767 <tag/Availability/cc65
1768 <tag/See also/
1769 <ref id="em_commit" name="em_commit">,
1770 <ref id="em_copyfrom" name="em_copyfrom">,
1771 <ref id="em_load_driver" name="em_load_driver">
1772 <tag/Example/None.
1773 </descrip>
1774 </quote>
1775
1776
1777 <sect1>em_install<label id="em_install"><p>
1778
1779 <quote>
1780 <descrip>
1781 <tag/Function/Install an already loaded extended memory driver.
1782 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1783 <tag/Declaration/<tt/unsigned char _fastcall__ em_install (void* driver);/
1784 <tag/Description/The function installs an already loaded extended memory driver
1785 and returns an error code. The function may be used to install a driver linked
1786 statically to the program.
1787 <tag/Limits/<itemize>
1788 <item>Not all drivers are able to detect if the supported hardware is really
1789 present.
1790 <item>The function is only available as fastcall function, so it may only be
1791 used in presence of a prototype.
1792 </itemize>
1793 <tag/Availability/cc65
1794 <tag/See also/
1795 <ref id="em_load_driver" name="em_load_driver">,
1796 <ref id="em_uninstall" name="em_uninstall">,
1797 <ref id="em_unload" name="em_unload">
1798 <tag/Example/None.
1799 </descrip>
1800 </quote>
1801
1802
1803 <sect1>em_load_driver<label id="em_load_driver"><p>
1804
1805 <quote>
1806 <descrip>
1807 <tag/Function/Load and initialize an extended memory driver.
1808 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1809 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
1810 <tag/Description/Load an extended memory driver into memory and initialize
1811 it. The function returns an error code that tells if all this has been
1812 successful.
1813 <tag/Limits/<itemize>
1814 <item>Not all drivers are able to detect if the supported hardware is really
1815 present.
1816 <item>The function is only available as fastcall function, so it may only be
1817 used in presence of a prototype.
1818 <item>The driver is loaded by name, so currently you must know the type of
1819 extended memory that should be supported. There is no autodetect capability.
1820 </itemize>
1821 <tag/Availability/cc65
1822 <tag/See also/
1823 <ref id="em_unload" name="em_unload">
1824 <tag/Example/None.
1825 </descrip>
1826 </quote>
1827
1828
1829 <sect1>em_map<label id="em_map"><p>
1830
1831 <quote>
1832 <descrip>
1833 <tag/Function/Make a page of extended memory accessible.
1834 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1835 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
1836 <tag/Description/The function maps one page of extended memory into linear
1837 memory and returns a pointer to the page frame. Depending on the hardware
1838 and driver, the data is either mapped into the address space or transfered
1839 into a buffer. If you don't need the actual contents of the page (for example
1840 because you're going to overwrite it completely, it is better to call
1841 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
1842 data if it is possible to avoid that.
1843 <tag/Limits/<itemize>
1844 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
1845 made any changes to the data in the window, call <tt/<ref id="em_commit"
1846 name="em_commit">/ first, or the changes are lost.
1847 <item>The function is only available as fastcall function, so it may only be
1848 used in presence of a prototype.
1849 <item>The function produces undefined results if no extended memory driver is
1850 loaded.
1851 </itemize>
1852 <tag/Availability/cc65
1853 <tag/See also/
1854 <ref id="em_commit" name="em_commit">,
1855 <ref id="em_load_driver" name="em_load_driver">,
1856 <ref id="em_use" name="em_use">
1857 <tag/Example/None.
1858 </descrip>
1859 </quote>
1860
1861
1862 <sect1>em_pagecount<label id="em_pagecount"><p>
1863
1864 <quote>
1865 <descrip>
1866 <tag/Function/Return the number of available extended memory pages.
1867 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1868 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
1869 <tag/Description/The function returns the size of the extended memory supported
1870 by the driver in 256 byte pages.
1871 <tag/Limits/<itemize>
1872 <item>The function returns zero if no extended memory driver is loaded.
1873 <item>The function may return zero if the supported hardware was not detected.
1874 </itemize>
1875 <tag/Availability/cc65
1876 <tag/See also/
1877 <ref id="em_load_driver" name="em_load_driver">
1878 <tag/Example/None.
1879 </descrip>
1880 </quote>
1881
1882
1883 <sect1>em_uninstall<label id="em_uninstall"><p>
1884
1885 <quote>
1886 <descrip>
1887 <tag/Function/Uninstall an already loaded extended memory driver.
1888 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1889 <tag/Declaration/<tt/unsigned char __fastcall__ em_install (void);/
1890 <tag/Description/The function uninstalls an already loaded extended memory
1891 driver but doesn't remove it from memory.
1892 <tag/Limits/<itemize>
1893 <item>If the driver has been loaded using <tt/<ref id="em_load_driver"
1894 name="em_load_driver">/, <tt/<ref id="em_unload" name="em_unload">/
1895 should be used instead of <tt/em_uninstall/ so the driver is also removed
1896 from memory.
1897 <item>The function is only available as fastcall function, so it may only be
1898 used in presence of a prototype.
1899 </itemize>
1900 <tag/Availability/cc65
1901 <tag/See also/
1902 <ref id="em_install" name="em_install">,
1903 <ref id="em_load_driver" name="em_load_driver">,
1904 <ref id="em_unload" name="em_unload">
1905 <tag/Example/None.
1906 </descrip>
1907 </quote>
1908
1909
1910 <sect1>em_unload<label id="em_unload"><p>
1911
1912 <quote>
1913 <descrip>
1914 <tag/Function/Unload an extended memory driver.
1915 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1916 <tag/Declaration/<tt/unsigned char __fastcall__ em_unload (void);/
1917 <tag/Description/The function unloads a loaded extended memory driver and
1918 frees all memory allocated for the driver.
1919 <tag/Limits/<itemize>
1920 <item>The function does nothing if no driver is loaded.
1921 </itemize>
1922 <tag/Availability/cc65
1923 <tag/See also/
1924 <ref id="em_load_driver" name="em_load_driver">
1925 <tag/Example/None.
1926 </descrip>
1927 </quote>
1928
1929
1930 <sect1>em_use<label id="em_use"><p>
1931
1932 <quote>
1933 <descrip>
1934 <tag/Function/Prepare an extended memory page for use.
1935 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1936 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
1937 <tag/Description/The function maps one page of extended memory into linear
1938 memory and returns a pointer to the page frame. This function is similar to
1939 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
1940 actual memory window in the assumption that the existing data is wrong or
1941 will get overwritten.
1942 <tag/Limits/<itemize>
1943 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
1944 made any changes to the data in the window, call <tt/<ref id="em_commit"
1945 name="em_commit">/ first, or the changes are lost.
1946 <item>The function is only available as fastcall function, so it may only be
1947 used in presence of a prototype.
1948 <item>The function produces undefined results if no extended memory driver is
1949 loaded.
1950 </itemize>
1951 <tag/Availability/cc65
1952 <tag/See also/
1953 <ref id="em_commit" name="em_commit">,
1954 <ref id="em_load_driver" name="em_load_driver">,
1955 <ref id="em_map" name="em_map">
1956 <tag/Example/None.
1957 </descrip>
1958 </quote>
1959
1960
1961 <sect1>exit<label id="exit"><p>
1962
1963 <quote>
1964 <descrip>
1965 <tag/Function/Terminate the program.
1966 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1967 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
1968 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
1969 return code of the program. Before termination, all files are closed, buffered
1970 output is written and any functions registered with <tt/<ref id="atexit"
1971 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
1972 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
1973 name="stdlib.h">/.
1974 <tag/Limits/<itemize>
1975 <item>The function is only available as fastcall function, so it may only
1976 be used in presence of a prototype.
1977 <item>It depends on the host machine if the program return code can be
1978 evaluated or is ignored.
1979 </itemize>
1980 <tag/Availability/ISO 9899
1981 <tag/See also/
1982 <ref id="abort" name="abort">,
1983 <ref id="exit" name="exit">
1984 <tag/Example/None.
1985 </descrip>
1986 </quote>
1987
1988
1989 <sect1>fast<label id="fast"><p>
1990
1991 <quote>
1992 <descrip>
1993 <tag/Function/Switch the C128 into 2MHz mode.
1994 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1995 <tag/Declaration/<tt/void fast (void);/
1996 <tag/Description/The function will switch the clock of the C128 to 2MHz. This
1997 will nearly double the speed compared to slow mode.
1998 <tag/Limits/<itemize>
1999 <item>The function is specific to the C128.
2000 <item>2MHz clock will not work in 40 column mode.
2001 </itemize>
2002 <tag/Availability/C128
2003 <tag/See also/
2004 <ref id="slow" name="slow">,
2005 <ref id="toggle_videomode" name="toggle_videomode">
2006 <tag/Example/None.
2007 </descrip>
2008 </quote>
2009
2010
2011 <sect1>feof<label id="feof"><p>
2012
2013 <quote>
2014 <descrip>
2015 <tag/Function/Return the end-of-file indicator of a stream.
2016 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
2017 <tag/Declaration/<tt/int __fastcall__ feof (FILE* f);/
2018 <tag/Description/<tt/feof/ tests the end-of-file indicator ofthe stream
2019 <tt/f/, and returns a non zero value if it is set.
2020 <tag/Limits/<itemize>
2021 <item>The indicator is set only after a read past the end of a file is
2022 attempted.
2023 <item>The function is only available as fastcall function, so it may only be
2024 used in presence of a prototype.
2025 </itemize>
2026 <tag/Availability/ISO 9899
2027 <tag/See also/
2028 <ref id="feof" name="clearerr">,
2029 <ref id="ferror" name="ferror">
2030 <tag/Example/None.
2031 </descrip>
2032 </quote>
2033
2034
2035 <sect1>ferror<label id="ferror"><p>
2036
2037 <quote>
2038 <descrip>
2039 <tag/Function/Return the error indicator of a stream.
2040 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
2041 <tag/Declaration/<tt/int __fastcall__ ferror (FILE* f);/
2042 <tag/Description/<tt/ferror/ tests the error indicator of the stream
2043 <tt/f/, and returns a non zero value if it is set.
2044 <tag/Limits/<itemize>
2045 <item>The function is only available as fastcall function, so it may only be
2046 used in presence of a prototype.
2047 </itemize>
2048 <tag/Availability/ISO 9899
2049 <tag/See also/
2050 <ref id="feof" name="clearerr">,
2051 <ref id="ferror" name="feof">
2052 <tag/Example/None.
2053 </descrip>
2054 </quote>
2055
2056
2057 <sect1>fileno<label id="fileno"><p>
2058
2059 <quote>
2060 <descrip>
2061 <tag/Function/Return the file handle used by a stream.
2062 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
2063 <tag/Declaration/<tt/int __fastcall__ fileno (FILE* f);/
2064 <tag/Description/The <tt/fileno/ function returns the file handle used
2065 internally by a C stream. This file handle (an integer) can be used as a
2066 handle for the POSIX input/output functions.
2067 <tag/Limits/<itemize>
2068 <item>The function is only available as fastcall function, so it may only be
2069 used in presence of a prototype.
2070 <item>Mixing C file I/O functions and POSIX file I/O functions for the same
2071 file may have unpredictable results.
2072 </itemize>
2073 <tag/Availability/POSIX 1003.1
2074 <tag/See also/
2075 <ref id="creat" name="creat">,
2076 <ref id="open" name="open"> <!-- , -->
2077 <!-- <ref id="read" name="read">, -->
2078 <!-- <ref id="write" name="write"> -->
2079 <tag/Example/None.
2080 </descrip>
2081 </quote>
2082
2083
2084 <sect1>free<label id="free"><p>
2085
2086 <quote>
2087 <descrip>
2088 <tag/Function/Free a block of dynamic memory.
2089 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2090 <tag/Declaration/<tt/void __fastcall__ free (void* block);/
2091 <tag/Description/Free a block of dynamic memory previously allocated with
2092 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
2093 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
2094 pointer is <tt/NULL/, no action is performed.
2095 <tag/Limits/
2096 <itemize>
2097 <item>Passing an already free'd block to <tt/free/ again will cause undefined
2098 behaviour and may crash your program.
2099 <item>The function is only available as fastcall function, so it may only
2100 be used in presence of a prototype.
2101 </itemize>
2102 <tag/Availability/ISO 9899
2103 <tag/See also/
2104 <ref id="_heapadd" name="_heapadd">,
2105 <ref id="_heapblocksize" name="_heapblocksize">,
2106 <ref id="_heapmaxavail" name="_heapmaxavail">,
2107 <ref id="_heapmemavail" name="_heapmemavail">,
2108 <ref id="calloc" name="calloc">,
2109 <ref id="malloc" name="malloc">,
2110 <ref id="realloc" name="realloc">
2111 <tag/Example/None.
2112 </descrip>
2113 </quote>
2114
2115
2116 <sect1>get_ostype<label id="get_ostype"><p>
2117
2118 <quote>
2119 <descrip>
2120 <tag/Function/The function returns the operating system, the program runs on.
2121 <tag/Header/<tt/<ref id="apple2.h" name="apple2.h">,
2122 <ref id="atari.h" name="atari.h">, <ref id="c64.h" name="c64.h">/
2123 <tag/Declaration/<tt/unsigned char get_ostype (void);/
2124 <tag/Description/<tt/get_ostype/ is machine dependent and does not exist for
2125 all supported targets. If it exists, it returns a number that identifies the
2126 operating system or machine type, the program runs on. The machine dependent
2127 header files define constants that can be used to check the return code.
2128 <tag/Limits/<itemize>
2129 <item>The function does not exist on all platforms.
2130 <item>The return codes are platform dependent.
2131 </itemize>
2132 <tag/Availability/cc65 (not all platforms)
2133 <tag/Example/None.
2134 </descrip>
2135 </quote>
2136
2137
2138 <sect1>getenv<label id="getenv"><p>
2139
2140 <quote>
2141 <descrip>
2142 <tag/Function/Return a value from the environment.
2143 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2144 <tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
2145 <tag/Description/The function searches the environment for an entry that
2146 matches <tt/name/ and returns its value. The environment consists of a list
2147 of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
2148 returns <tt/NULL/.
2149 <tag/Limits/<itemize>
2150 <item>What exactly is stored in the environment depends on the machine the
2151 program is running on.
2152 <item>The function is only available as fastcall function, so it may only
2153 be used in presence of a prototype.
2154 </itemize>
2155 <tag/Availability/ISO 9899
2156 <tag/Example/None.
2157 </descrip>
2158 </quote>
2159
2160
2161 <sect1>getcpu<label id="getcpu"><p>
2162
2163 <quote>
2164 <descrip>
2165 <tag/Function/Determine on which CPU the program is running.
2166 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
2167 <tag/Declaration/<tt/unsigned char getcpu (void);/
2168 <tag/Description/The function checks on which CPU the code is running. It
2169 returns one of the constants<itemize>
2170 <item><tt/CPU_6502/
2171 <item><tt/CPU_65C02/
2172 <item><tt/CPU_65816/
2173 </itemize>
2174 <tag/Limits/<itemize>
2175 <item>Other, more exotic CPU types are not disinguished.
2176 </itemize>
2177 <tag/Availability/cc65
2178 <tag/Example/None.
2179 </descrip>
2180 </quote>
2181
2182
2183 <sect1>gotox<label id="gotox"><p>
2184
2185 <quote>
2186 <descrip>
2187 <tag/Function/Move the text mode cursor to a new X position.
2188 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2189 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
2190 <tag/Description/The function moves the text mode cursor to the specified X
2191 position while leaving the Y position untouched. The leftmost position on the
2192 screen has the coordinate 0.
2193 <tag/Limits/<itemize>
2194 <item>The function is only available as fastcall function, so it may
2195 only be used in presence of a prototype.
2196 <item>Invalid values for the X position (out of screen coordinates) may
2197 lead to undefined behaviour.
2198 </itemize>
2199 <tag/Availability/cc65
2200 <tag/See also/
2201 <ref id="gotoy" name="gotoy">,
2202 <ref id="gotoxy" name="gotoxy">,
2203 <ref id="wherex" name="wherex">,
2204 <ref id="wherey" name="wherey">
2205 <tag/Example/None.
2206 </descrip>
2207 </quote>
2208
2209
2210 <sect1>gotoxy<label id="gotoxy"><p>
2211
2212 <quote>
2213 <descrip>
2214 <tag/Function/Move the text mode cursor to a new position.
2215 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2216 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
2217 <tag/Description/The function moves the text mode cursor to the specified
2218 position. The leftmost position on the screen has the X coordinate 0, the
2219 topmost line has the Y coordinate 0.
2220 <tag/Limits/<itemize>
2221 <item>The function is only available as fastcall function, so it may only be
2222 used in presence of a prototype.
2223 <item>Invalid values for any of both coordinates (out of screen positions) may
2224 lead to undefined behaviour.
2225 </itemize>
2226 <tag/Availability/cc65
2227 <tag/See also/
2228 <ref id="gotox" name="gotox">,
2229 <ref id="gotoy" name="gotoy">,
2230 <ref id="wherex" name="wherex">,
2231 <ref id="wherey" name="wherey">
2232 <tag/Example/None.
2233 </descrip>
2234 </quote>
2235
2236
2237 <sect1>gotoy<label id="gotoy"><p>
2238
2239 <quote>
2240 <descrip>
2241 <tag/Function/Move the text mode cursor to a new Y position.
2242 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2243 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
2244 <tag/Description/The function moves the text mode cursor to the specified Y
2245 position while leaving the X position untouched. The uppermost position on the
2246 screen has the coordinate 0.
2247 <tag/Limits/<itemize>
2248 <item>The function is only available as fastcall function, so it may
2249 only be used in presence of a prototype.
2250 <item>Invalid values for the Y position (out of screen coordinates) may lead
2251 to undefined behaviour.
2252 </itemize>
2253 <tag/Availability/cc65
2254 <tag/See also/
2255 <ref id="gotox" name="gotox">,
2256 <ref id="gotoxy" name="gotoxy">,
2257 <ref id="wherex" name="wherex">,
2258 <ref id="wherey" name="wherey">
2259 <tag/Example/None.
2260 </descrip>
2261 </quote>
2262
2263
2264 <sect1>isalnum<label id="isalnum"><p>
2265
2266 <quote>
2267 <descrip>
2268 <tag/Function/Check if a given character is a letter or digit.
2269 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2270 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
2271 <tag/Description/The function returns a value of zero if the given argument
2272 is a letter or digit. The return value is non zero if the character
2273 is anything else.
2274 <tag/Limits/<itemize>
2275 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2276 inline sequence generated by the macro will not work correctly for values
2277 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2278 this range. The non inline function may be accessed by <tt/#undef/'ing
2279 the macro.
2280 <item>When compiling without <tt/-Os/, the function is only available as
2281 fastcall function, so it may only be used in presence of a prototype.
2282 </itemize>
2283 <tag/Availability/ISO 9899
2284 <tag/See also/
2285 <ref id="isalpha" name="isalpha">,
2286 <ref id="isascii" name="isascii">,
2287 <ref id="isblank" name="isblank">,
2288 <ref id="iscntrl" name="iscntrl">,
2289 <ref id="isdigit" name="isdigit">,
2290 <ref id="isgraph" name="isgraph">,
2291 <ref id="islower" name="islower">,
2292 <ref id="isprint" name="isprint">,
2293 <ref id="ispunct" name="ispunct">,
2294 <ref id="isspace" name="isspace">,
2295 <ref id="isupper" name="isupper">,
2296 <ref id="isxdigit" name="isxdigit">
2297 <tag/Example/None.
2298 </descrip>
2299 </quote>
2300
2301
2302 <sect1>isalpha<label id="isalpha"><p>
2303
2304 <quote>
2305 <descrip>
2306 <tag/Function/Check if a given character is a letter.
2307 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2308 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
2309 <tag/Description/The function returns a value of zero if the given argument
2310 is a letter. The return value is non zero if the character is anything else.
2311 <tag/Limits/<itemize>
2312 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2313 inline sequence generated by the macro will not work correctly for values
2314 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2315 this range. The non inline function may be accessed by <tt/#undef/'ing the
2316 macro.
2317 <item>When compiling without <tt/-Os/, the function is only available as
2318 fastcall function, so it may only be used in presence of a prototype.
2319 </itemize>
2320 <tag/Availability/ISO 9899
2321 <tag/See also/
2322 <ref id="isalnum" name="isalnum">,
2323 <ref id="isascii" name="isascii">,
2324 <ref id="isblank" name="isblank">,
2325 <ref id="iscntrl" name="iscntrl">,
2326 <ref id="isdigit" name="isdigit">,
2327 <ref id="isgraph" name="isgraph">,
2328 <ref id="islower" name="islower">,
2329 <ref id="isprint" name="isprint">,
2330 <ref id="ispunct" name="ispunct">,
2331 <ref id="isspace" name="isspace">,
2332 <ref id="isupper" name="isupper">,
2333 <ref id="isxdigit" name="isxdigit">
2334 <tag/Example/None.
2335 </descrip>
2336 </quote>
2337
2338
2339 <sect1>isascii<label id="isascii"><p>
2340
2341 <quote>
2342 <descrip>
2343 <tag/Function/Check if a given character is in the ASCII (0..127) range.
2344 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2345 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
2346 <tag/Description/The function returns a value of zero if the given argument
2347 is in the range 0..127 (the range of valid ASCII characters) and a non zero
2348 value if not.
2349 <tag/Limits/<itemize>
2350 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2351 inline sequence generated by the macro will not work correctly for values
2352 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2353 this range. The non inline function may be accessed by <tt/#undef/'ing the
2354 macro.
2355 <item>When compiling without <tt/-Os/, the function is only available as
2356 fastcall function, so it may only be used in presence of a prototype.
2357 </itemize>
2358 <tag/Availability/ISO 9899
2359 <tag/See also/
2360 <ref id="isalnum" name="isalnum">,
2361 <ref id="isalpha" name="isalpha">,
2362 <ref id="isblank" name="isblank">,
2363 <ref id="iscntrl" name="iscntrl">,
2364 <ref id="isdigit" name="isdigit">,
2365 <ref id="isgraph" name="isgraph">,
2366 <ref id="islower" name="islower">,
2367 <ref id="isprint" name="isprint">,
2368 <ref id="ispunct" name="ispunct">,
2369 <ref id="isspace" name="isspace">,
2370 <ref id="isupper" name="isupper">,
2371 <ref id="isxdigit" name="isxdigit">
2372 <tag/Example/None.
2373 </descrip>
2374 </quote>
2375
2376
2377 <sect1>isblank<label id="isblank"><p>
2378
2379 <quote>
2380 <descrip>
2381 <tag/Function/Check if a given character is a space or tab.
2382 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2383 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
2384 <tag/Description/The function returns a value of zero if the given argument
2385 is a space or tab character. The return value is non zero if the character
2386 is anything else.
2387 <tag/Limits/<itemize>
2388 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2389 inline sequence generated by the macro will not work correctly for values
2390 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2391 this range. The non inline function may be accessed by <tt/#undef/'ing the
2392 macro.
2393 <item>When compiling without <tt/-Os/, the function is only available as
2394 fastcall function, so it may only be used in presence of a prototype.
2395 </itemize>
2396 <tag/Availability/cc65
2397 <tag/See also/
2398 <ref id="isalnum" name="isalnum">,
2399 <ref id="isalpha" name="isalpha">,
2400 <ref id="isascii" name="isascii">,
2401 <ref id="iscntrl" name="iscntrl">,
2402 <ref id="isdigit" name="isdigit">,
2403 <ref id="isgraph" name="isgraph">,
2404 <ref id="islower" name="islower">,
2405 <ref id="isprint" name="isprint">,
2406 <ref id="ispunct" name="ispunct">,
2407 <ref id="isspace" name="isspace">,
2408 <ref id="isupper" name="isupper">,
2409 <ref id="isxdigit" name="isxdigit">
2410 <tag/Example/None.
2411 </descrip>
2412 </quote>
2413
2414
2415 <sect1>iscntrl<label id="iscntrl"><p>
2416
2417 <quote>
2418 <descrip>
2419 <tag/Function/Check if a given character is a control character.
2420 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2421 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
2422 <tag/Description/The function returns a value of zero if the given argument
2423 is a control character. The return value is non zero if the character
2424 is anything else.
2425 <tag/Limits/<itemize>
2426 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2427 inline sequence generated by the macro will not work correctly for values
2428 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2429 this range. The non inline function may be accessed by <tt/#undef/'ing the
2430 macro.
2431 <item>When compiling without <tt/-Os/, the function is only available as
2432 fastcall function, so it may only be used in presence of a prototype.
2433 </itemize>
2434 <tag/Availability/ISO 9899
2435 <tag/See also/
2436 <ref id="isalnum" name="isalnum">,
2437 <ref id="isalpha" name="isalpha">,
2438 <ref id="isascii" name="isascii">,
2439 <ref id="isblank" name="isblank">,
2440 <ref id="isdigit" name="isdigit">,
2441 <ref id="isgraph" name="isgraph">,
2442 <ref id="islower" name="islower">,
2443 <ref id="isprint" name="isprint">,
2444 <ref id="ispunct" name="ispunct">,
2445 <ref id="isspace" name="isspace">,
2446 <ref id="isupper" name="isupper">,
2447 <ref id="isxdigit" name="isxdigit">
2448 <tag/Example/None.
2449 </descrip>
2450 </quote>
2451
2452
2453 <sect1>isdigit<label id="isdigit"><p>
2454
2455 <quote>
2456 <descrip>
2457 <tag/Function/Check if a given character is a digit.
2458 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2459 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
2460 <tag/Description/The function returns a value of zero if the given argument
2461 is a digit. The return value is non zero if the character is anything else.
2462 <tag/Limits/<itemize>
2463 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2464 inline sequence generated by the macro will not work correctly for values
2465 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2466 this range. The non inline function may be accessed by <tt/#undef/'ing the
2467 macro.
2468 <item>When compiling without <tt/-Os/, the function is only available as
2469 fastcall function, so it may only be used in presence of a prototype.
2470 </itemize>
2471 <tag/Availability/ISO 9899
2472 <tag/See also/
2473 <ref id="isalnum" name="isalnum">,
2474 <ref id="isalpha" name="isalpha">,
2475 <ref id="isascii" name="isascii">,
2476 <ref id="isblank" name="isblank">,
2477 <ref id="iscntrl" name="iscntrl">,
2478 <ref id="isgraph" name="isgraph">,
2479 <ref id="islower" name="islower">,
2480 <ref id="isprint" name="isprint">,
2481 <ref id="ispunct" name="ispunct">,
2482 <ref id="isspace" name="isspace">,
2483 <ref id="isupper" name="isupper">,
2484 <ref id="isxdigit" name="isxdigit">
2485 <tag/Example/None.
2486 </descrip>
2487 </quote>
2488
2489
2490 <sect1>isgraph<label id="isgraph"><p>
2491
2492 <quote>
2493 <descrip>
2494 <tag/Function/Check if a given character is a printable character (except
2495 space).
2496 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2497 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
2498 <tag/Description/The function returns a value of zero if the given argument
2499 is a printable character with the exception of space. The return value is non
2500 zero if the character is anything else.
2501 <tag/Limits/<itemize>
2502 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2503 inline sequence generated by the macro will not work correctly for values
2504 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2505 this range. The non inline function may be accessed by <tt/#undef/'ing the
2506 macro.
2507 <item>When compiling without <tt/-Os/, the function is only available as
2508 fastcall function, so it may only be used in presence of a prototype.
2509 </itemize>
2510 <tag/Availability/ISO 9899
2511 <tag/See also/
2512 <ref id="isalnum" name="isalnum">,
2513 <ref id="isalpha" name="isalpha">,
2514 <ref id="isascii" name="isascii">,
2515 <ref id="isblank" name="isblank">,
2516 <ref id="iscntrl" name="iscntrl">,
2517 <ref id="isdigit" name="isdigit">,
2518 <ref id="islower" name="islower">,
2519 <ref id="isprint" name="isprint">,
2520 <ref id="ispunct" name="ispunct">,
2521 <ref id="isspace" name="isspace">,
2522 <ref id="isupper" name="isupper">,
2523 <ref id="isxdigit" name="isxdigit">
2524 <tag/Example/None.
2525 </descrip>
2526 </quote>
2527
2528
2529 <sect1>islower<label id="islower"><p>
2530
2531 <quote>
2532 <descrip>
2533 <tag/Function/Check if a given character is a lower case letter.
2534 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2535 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
2536 <tag/Description/The function returns a value of zero if the given argument
2537 is a lower case letter. The return value is non zero if the character is
2538 anything else.
2539 <tag/Limits/<itemize>
2540 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2541 inline sequence generated by the macro will not work correctly for values
2542 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2543 this range. The non inline function may be accessed by <tt/#undef/'ing the
2544 macro.
2545 <item>When compiling without <tt/-Os/, the function is only available as
2546 fastcall function, so it may only be used in presence of a prototype.
2547 </itemize>
2548 <tag/Availability/ISO 9899
2549 <tag/See also/
2550 <ref id="isalnum" name="isalnum">,
2551 <ref id="isalpha" name="isalpha">,
2552 <ref id="isascii" name="isascii">,
2553 <ref id="isblank" name="isblank">,
2554 <ref id="iscntrl" name="iscntrl">,
2555 <ref id="isdigit" name="isdigit">,
2556 <ref id="isgraph" name="isgraph">,
2557 <ref id="isprint" name="isprint">,
2558 <ref id="ispunct" name="ispunct">,
2559 <ref id="isspace" name="isspace">,
2560 <ref id="isupper" name="isupper">,
2561 <ref id="isxdigit" name="isxdigit">
2562 <tag/Example/None.
2563 </descrip>
2564 </quote>
2565
2566
2567 <sect1>isprint<label id="isprint"><p>
2568
2569 <quote>
2570 <descrip>
2571 <tag/Function/Check if a given character is a printable character.
2572 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2573 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
2574 <tag/Description/The function returns a value of zero if the given argument
2575 is a printable character (this includes the space character). The return value
2576 is non zero if the character is anything else.
2577 <tag/Limits/<itemize>
2578 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2579 inline sequence generated by the macro will not work correctly for values
2580 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2581 this range. The non inline function may be accessed by <tt/#undef/'ing the
2582 macro.
2583 <item>When compiling without <tt/-Os/, the function is only available as
2584 fastcall function, so it may only be used in presence of a prototype.
2585 </itemize>
2586 <tag/Availability/ISO 9899
2587 <tag/See also/
2588 <ref id="isalnum" name="isalnum">,
2589 <ref id="isalpha" name="isalpha">,
2590 <ref id="isascii" name="isascii">,
2591 <ref id="isblank" name="isblank">,
2592 <ref id="iscntrl" name="iscntrl">,
2593 <ref id="isdigit" name="isdigit">,
2594 <ref id="isgraph" name="isgraph">,
2595 <ref id="islower" name="islower">,
2596 <ref id="ispunct" name="ispunct">,
2597 <ref id="isspace" name="isspace">,
2598 <ref id="isupper" name="isupper">,
2599 <ref id="isxdigit" name="isxdigit">
2600 <tag/Example/None.
2601 </descrip>
2602 </quote>
2603
2604
2605 <sect1>ispunct<label id="ispunct"><p>
2606
2607 <quote>
2608 <descrip>
2609 <tag/Function/Check if a given character is a printable character but not a
2610 space or an alphanumeric character.
2611 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2612 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
2613 <tag/Description/The function returns a value of zero if the given argument
2614 is a printable character, but not a space or anything alphanumeric. The return
2615 value is non zero if the character is anything else.
2616 <tag/Limits/<itemize>
2617 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2618 inline sequence generated by the macro will not work correctly for values
2619 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2620 this range. The non inline function may be accessed by <tt/#undef/'ing the
2621 macro.
2622 <item>When compiling without <tt/-Os/, the function is only available as
2623 fastcall function, so it may only be used in presence of a prototype.
2624 </itemize>
2625 <tag/Availability/ISO 9899
2626 <tag/See also/
2627 <ref id="isalnum" name="isalnum">,
2628 <ref id="isalpha" name="isalpha">,
2629 <ref id="isascii" name="isascii">,
2630 <ref id="isblank" name="isblank">,
2631 <ref id="iscntrl" name="iscntrl">,
2632 <ref id="isdigit" name="isdigit">,
2633 <ref id="isgraph" name="isgraph">,
2634 <ref id="islower" name="islower">,
2635 <ref id="isprint" name="isprint">,
2636 <ref id="isspace" name="isspace">,
2637 <ref id="isupper" name="isupper">,
2638 <ref id="isxdigit" name="isxdigit">
2639 <tag/Example/None.
2640 </descrip>
2641 </quote>
2642
2643
2644 <sect1>isspace<label id="isspace"><p>
2645
2646 <quote>
2647 <descrip>
2648 <tag/Function/Check if a given character is a a white-space character.
2649 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2650 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
2651 <tag/Description/The function returns a value of zero if the given argument
2652 is a white space character. The return value is non zero if the character is
2653 anything else. The standard white space characters are: space, formfeed ('\f'),
2654 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
2655 ('\v').
2656 <tag/Limits/<itemize>
2657 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2658 inline sequence generated by the macro will not work correctly for values
2659 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2660 this range. The non inline function may be accessed by <tt/#undef/'ing the
2661 macro.
2662 <item>When compiling without <tt/-Os/, the function is only available as
2663 fastcall function, so it may only be used in presence of a prototype.
2664 </itemize>
2665 <tag/Availability/ISO 9899
2666 <tag/See also/
2667 <ref id="isalnum" name="isalnum">,
2668 <ref id="isalpha" name="isalpha">,
2669 <ref id="isascii" name="isascii">,
2670 <ref id="isblank" name="isblank">,
2671 <ref id="iscntrl" name="iscntrl">,
2672 <ref id="isdigit" name="isdigit">,
2673 <ref id="isgraph" name="isgraph">,
2674 <ref id="islower" name="islower">,
2675 <ref id="isprint" name="isprint">,
2676 <ref id="ispunct" name="ispunct">,
2677 <ref id="isupper" name="isupper">,
2678 <ref id="isxdigit" name="isxdigit">
2679 <tag/Example/None.
2680 </descrip>
2681 </quote>
2682
2683
2684 <sect1>isupper<label id="isupper"><p>
2685
2686 <quote>
2687 <descrip>
2688 <tag/Function/Check if a given character is an upper case letter.
2689 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2690 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
2691 <tag/Description/The function returns a value of zero if the given argument
2692 is an upper case letter. The return value is non zero if the character is
2693 anything else.
2694 <tag/Limits/<itemize>
2695 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2696 inline sequence generated by the macro will not work correctly for values
2697 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2698 this range. The non inline function may be accessed by <tt/#undef/'ing the
2699 macro.
2700 <item>When compiling without <tt/-Os/, the function is only available as
2701 fastcall function, so it may only be used in presence of a prototype.
2702 </itemize>
2703 <tag/Availability/ISO 9899
2704 <tag/See also/
2705 <ref id="isalnum" name="isalnum">,
2706 <ref id="isalpha" name="isalpha">,
2707 <ref id="isascii" name="isascii">,
2708 <ref id="isblank" name="isblank">,
2709 <ref id="iscntrl" name="iscntrl">,
2710 <ref id="isdigit" name="isdigit">,
2711 <ref id="isgraph" name="isgraph">,
2712 <ref id="islower" name="islower">,
2713 <ref id="isprint" name="isprint">,
2714 <ref id="ispunct" name="ispunct">,
2715 <ref id="isspace" name="isspace">,
2716 <ref id="isxdigit" name="isxdigit">
2717 <tag/Example/None.
2718 </descrip>
2719 </quote>
2720
2721
2722 <sect1>isxdigit<label id="isxdigit"><p>
2723
2724 <quote>
2725 <descrip>
2726 <tag/Function/Check if a given character is a hexadecimal digit.
2727 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2728 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
2729 <tag/Description/The function returns a value of zero if the given argument
2730 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
2731 if the character is anything else.
2732 <tag/Limits/<itemize>
2733 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2734 inline sequence generated by the macro will not work correctly for values
2735 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2736 this range. The non inline function may be accessed by <tt/#undef/'ing the
2737 macro.
2738 <item>When compiling without <tt/-Os/, the function is only available as
2739 fastcall function, so it may only be used in presence of a prototype.
2740 </itemize>
2741 <tag/Availability/ISO 9899
2742 <tag/See also/
2743 <ref id="isalnum" name="isalnum">,
2744 <ref id="isalpha" name="isalpha">,
2745 <ref id="isascii" name="isascii">,
2746 <ref id="isblank" name="isblank">,
2747 <ref id="iscntrl" name="iscntrl">,
2748 <ref id="isdigit" name="isdigit">,
2749 <ref id="isgraph" name="isgraph">,
2750 <ref id="islower" name="islower">,
2751 <ref id="isprint" name="isprint">,
2752 <ref id="ispunct" name="ispunct">,
2753 <ref id="isspace" name="isspace">,
2754 <ref id="isupper" name="isupper">
2755 <tag/Example/None.
2756 </descrip>
2757 </quote>
2758
2759
2760 <sect1>itoa<label id="itoa"><p>
2761
2762 <quote>
2763 <descrip>
2764 <tag/Function/Convert an integer into a string.
2765 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2766 <tag/Declaration/<tt/char* __fastcall__ itoa (int val, char* buf, int radix);/
2767 <tag/Description/<tt/itoa/ converts the integer <tt/val/ into a string using
2768 <tt/radix/ as the base.
2769 <tag/Limits/<itemize>
2770 <item>There are no provisions to prevent a buffer overflow.
2771 <item>If <tt/val/ contains <tt/INT_MIN/, the behaviour is undefined.
2772 <item>The function is non standard, so it is not available in strict ANSI mode.
2773 You should probably use <tt/sprintf/ instead.
2774 <item>The function is only available as fastcall function, so it may only be
2775 used in presence of a prototype.
2776 </itemize>
2777 <tag/Availability/cc65
2778 <tag/See also/
2779 <ref id="atoi" name="atoi">,
2780 <ref id="atol" name="atol">,
2781 <ref id="ltoa" name="ltoa">,
2782 <ref id="ultoa" name="ultoa">,
2783 <ref id="utoa" name="utoa">
2784 <tag/Example/None.
2785 </descrip>
2786 </quote>
2787
2788
2789 <sect1>joy_count<label id="joy_count"><p>
2790
2791 <quote>
2792 <descrip>
2793 <tag/Function/Return the number of joysticks supported by the current driver.
2794 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2795 <tag/Declaration/<tt/unsigned char __fastcall__ joy_count (void);/
2796 <tag/Description/The function returns a the number of joysticks supported
2797 by the current joystick driver.
2798 <tag/Limits/<itemize>
2799 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
2800 name="joy_load_driver"> before calling this function.
2801 <item>The function returns the number of joysticks supported by the driver.
2802 There's no way to check for the number of actually connected joysticks.
2803 <item>The function is only available as fastcall function, so it may only be
2804 used in presence of a prototype.
2805 </itemize>
2806 <tag/Availability/cc65
2807 <tag/See also/
2808 <ref id="joy_load_driver" name="joy_load_driver">,
2809 <ref id="joy_read" name="joy_read">
2810 <tag/Example/None.
2811 </descrip>
2812 </quote>
2813
2814
2815 <sect1>joy_install<label id="joy_install"><p>
2816
2817 <quote>
2818 <descrip>
2819 <tag/Function/Install an already loaded driver and return an error code.
2820 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2821 <tag/Declaration/<tt/unsigned char __fastcall__ joy_install (void* driver);/
2822 <tag/Description/The function installs a driver that was already loaded into
2823 memory (or linked statically to the program). It returns an error code
2824 (<tt/JOY_ERR_OK/ in case of success).
2825 <tag/Limits/<itemize>
2826 <item>The function is only available as fastcall function, so it may only be
2827 used in presence of a prototype.
2828 </itemize>
2829 <tag/Availability/cc65
2830 <tag/See also/
2831 <ref id="joy_load_driver" name="joy_load_driver">,
2832 <ref id="joy_uninstall" name="joy_uninstall">,
2833 <ref id="joy_unload" name="joy_unload">
2834 <tag/Example/None.
2835 </descrip>
2836 </quote>
2837
2838
2839 <sect1>joy_load_driver<label id="joy_load_driver"><p>
2840
2841 <quote>
2842 <descrip>
2843 <tag/Function/Load a driver from disk and install it.
2844 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2845 <tag/Declaration/<tt/unsigned char __fastcall__ joy_load_driver (const char* driver);/
2846 <tag/Description/The function loads a driver with the given name from disk
2847 and installs it. An error code is returned, which is <tt/JOY_ERR_OK/ if the
2848 driver was successfully loaded and installed.
2849 <tag/Limits/<itemize>
2850 <item>The function is only available as fastcall function, so it may only be
2851 used in presence of a prototype.
2852 </itemize>
2853 <tag/Availability/cc65
2854 <tag/See also/
2855 <ref id="joy_install" name="joy_install">,
2856 <ref id="joy_uninstall" name="joy_uninstall">,
2857 <ref id="joy_unload" name="joy_unload">
2858 <tag/Example/None.
2859 </descrip>
2860 </quote>
2861
2862
2863 <sect1>joy_read<label id="joy_read"><p>
2864
2865 <quote>
2866 <descrip>
2867 <tag/Function/Read the status of a joystick.
2868 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2869 <tag/Declaration/<tt/unsigned char __fastcall__ joy_read (unsigned char joystick);/
2870 <tag/Description/The function reads the status bits for a joystick. The number
2871 of the joystick is passed as parameter. The result may be examined by using one
2872 of the <tt/JOY_xxx/ macros from <ref id="joystick.h" name="joystick.h">.
2873 <tag/Limits/<itemize>
2874 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
2875 name="joy_load_driver"> before calling this function.
2876 <item>The function is only available as fastcall function, so it may only be
2877 used in presence of a prototype.
2878 </itemize>
2879 <tag/Availability/cc65
2880 <tag/See also/
2881 <ref id="joy_count" name="joy_count">,
2882 <ref id="joy_load_driver" name="joy_load_driver">,
2883 <ref id="joy_unload" name="joy_unload">
2884 <tag/Example/None.
2885 </descrip>
2886 </quote>
2887
2888
2889 <sect1>joy_uninstall<label id="joy_uninstall"><p>
2890
2891 <quote>
2892 <descrip>
2893 <tag/Function/Uninstall the current joystick driver.
2894 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2895 <tag/Declaration/<tt/unsigned char __fastcall__ joy_uninstall (void);/
2896 <tag/Description/The function uninstalls the currently installed joystick
2897 driver. It does not remove the driver from memory. The function returns an
2898 error code, which is <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
2899 <tag/Limits/<itemize>
2900 <item>A joystick driver must be installed using <ref id="joy_install"
2901 name="joy_install"> before calling this function.
2902 <item>The function is only available as fastcall function, so it may only be
2903 used in presence of a prototype.
2904 </itemize>
2905 <tag/Availability/cc65
2906 <tag/See also/
2907 <ref id="joy_install" name="joy_install">,
2908 <ref id="joy_load_driver" name="joy_load_driver">,
2909 <ref id="joy_unload" name="joy_unload">
2910 <tag/Example/None.
2911 </descrip>
2912 </quote>
2913
2914
2915 <sect1>joy_unload<label id="joy_unload"><p>
2916
2917 <quote>
2918 <descrip>
2919 <tag/Function/Uninstall, then unload the current joystick driver.
2920 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2921 <tag/Declaration/<tt/unsigned char __fastcall__ joy_unload (void);/
2922 <tag/Description/The function uninstalls the currently installed joystick
2923 driver and removes it from memory. An error code is returned, which is
2924 <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
2925 <tag/Limits/<itemize>
2926 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
2927 name="joy_load_driver"> before calling this function.
2928 <item>The function is only available as fastcall function, so it may only be
2929 used in presence of a prototype.
2930 </itemize>
2931 <tag/Availability/cc65
2932 <tag/See also/
2933 <ref id="joy_load_driver" name="joy_load_driver">
2934 <tag/Example/None.
2935 </descrip>
2936 </quote>
2937
2938
2939 <sect1>kbhit<label id="kbhit"><p>
2940
2941 <quote>
2942 <descrip>
2943 <tag/Function/Check if there's a key waiting in the keyboard buffer.
2944 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2945 <tag/Declaration/<tt/unsigned char kbhit (void);/
2946 <tag/Description/The function returns a value of zero if there is no character
2947 waiting to be read from the keyboard. It returns non zero otherwise.
2948 <tag/Limits/<itemize>
2949 <item>If the system does not support a keyboard buffer (most systems
2950 do), the function is rather useless.
2951 </itemize>
2952 <tag/Availability/cc65
2953 <tag/See also/
2954 <ref id="cgetc" name="cgetc">,
2955 <ref id="cursor" name="cursor">
2956 <tag/Example/None.
2957 </descrip>
2958 </quote>
2959
2960
2961 <sect1>labs<label id="labs"><p>
2962
2963 <quote>
2964 <descrip>
2965 <tag/Function/Returns the absolute value of a long integer.
2966 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2967 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
2968 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
2969 the function.
2970 <tag/Limits/<itemize>
2971 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
2972 <item>The function is only available as fastcall function, so it may only be
2973 used in presence of a prototype.
2974 </itemize>
2975 <tag/Availability/ISO 9899
2976 <tag/See also/
2977 <ref id="abs" name="abs">
2978 <tag/Example/None.
2979 </descrip>
2980 </quote>
2981
2982
2983 <sect1>ltoa<label id="ltoa"><p>
2984
2985 <quote>
2986 <descrip>
2987 <tag/Function/Convert a long integer into a string.
2988 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2989 <tag/Declaration/<tt/char* __fastcall__ ltoa (long val, char* buf, int radix);/
2990 <tag/Description/<tt/itoa/ converts the long integer <tt/val/ into a string
2991 using <tt/radix/ as the base.
2992 <tag/Limits/<itemize>
2993 <item>There are no provisions to prevent a buffer overflow.
2994 <item>If <tt/val/ contains <tt/LONG_MIN/, the behaviour is undefined.
2995 <item>The function is non standard, so it is not available in strict ANSI mode.
2996 You should probably use <tt/sprintf/ instead.
2997 <item>The function is only available as fastcall function, so it may only be
2998 used in presence of a prototype.
2999 </itemize>
3000 <tag/Availability/cc65
3001 <tag/See also/
3002 <ref id="atoi" name="atoi">,
3003 <ref id="atol" name="atol">,
3004 <ref id="itoa" name="itoa">,
3005 <ref id="ultoa" name="ultoa">,
3006 <ref id="utoa" name="utoa">
3007 <tag/Example/None.
3008 </descrip>
3009 </quote>
3010
3011
3012 <sect1>localeconv<label id="localeconv"><p>
3013
3014 <quote>
3015 <descrip>
3016 <tag/Function/Returns a pointer to the current locale structure.
3017 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
3018 <tag/Declaration/<tt/struct lconv* localeconv (void);/
3019 <tag/Description/<tt/localeconv/ returns a pointer to the current locale
3020 structure.
3021 <tag/Limits/<itemize>
3022 <item>cc65 supports only the "C" locale, so even after setting a new locale
3023 using <tt/<ref id="setlocale" name="setlocale">/, the structure returned will
3024 always be the same.
3025 </itemize>
3026 <tag/Availability/ISO 9899
3027 <tag/See also/
3028 <ref id="setlocale" name="setlocale">
3029 <tag/Example/None.
3030 </descrip>
3031 </quote>
3032
3033
3034 <sect1>longjmp<label id="longjmp"><p>
3035
3036 <quote>
3037 <descrip>
3038 <tag/Function/Non local goto.
3039 <tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
3040 <tag/Declaration/<tt/void __fastcall__ longjmp (jmp_buf buf, int retval);/
3041 <tag/Description/The <tt/longjmp/ function restores a program context from the
3042 data in <tt/buf/, which must have been set by a preceeding call to
3043 <tt/<ref id="setjmp" name="setjmp">/. Program execution continues as if the
3044 call to <tt/<ref id="setjmp" name="setjmp">/ has just returned the value
3045 <tt/retval/.
3046 <tag/Limits/
3047 <itemize>
3048 <item>If the parameter <tt/retval/ is zero, the function will behave as if it
3049 was called with a value of one.
3050 <item>The function is only available as fastcall function, so it may only
3051 be used in presence of a prototype.
3052 </itemize>
3053 <tag/Availability/ISO 9899
3054 <tag/See also/
3055 <ref id="setjmp" name="setjmp">
3056 <tag/Example/None.
3057 </descrip>
3058 </quote>
3059
3060
3061 <sect1>malloc<label id="malloc"><p>
3062
3063 <quote>
3064 <descrip>
3065 <tag/Function/Allocate dynamic memory.
3066 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3067 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
3068 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
3069 pointer to the allocated memory block. On error (not enough memory available),
3070 <tt/malloc/ returns <tt/NULL/.
3071 <tag/Limits/
3072 <itemize>
3073 <item>The function is only available as fastcall function, so it may only
3074 be used in presence of a prototype.
3075 </itemize>
3076 <tag/Availability/ISO 9899
3077 <tag/See also/
3078 <ref id="_heapadd" name="_heapadd">,
3079 <ref id="_heapblocksize" name="_heapblocksize">,
3080 <ref id="_heapmaxavail" name="_heapmaxavail">,
3081 <ref id="_heapmemavail" name="_heapmemavail">,
3082 <ref id="calloc" name="calloc">,
3083 <ref id="free" name="free">,
3084 <ref id="realloc" name="realloc">,
3085 <ref id="strdup" name="strdup">
3086 <tag/Example/None.
3087 </descrip>
3088 </quote>
3089
3090
3091 <sect1>memchr<label id="memchr"><p>
3092
3093 <quote>
3094 <descrip>
3095 <tag/Function/Search for a character in a block of raw memory.
3096 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3097 <tag/Declaration/<tt/void* __fastcall__ strchr (const void* mem, int c, size_t count);/
3098 <tag/Description/The <tt/memchr/ function locates the first occurrence of <tt/c/
3099 (converted to a char) in the block of raw memory string pointed to by <tt/mem/
3100 that is of size <tt/count/. Upon completion, the function returns a pointer to
3101 the character found, or a null pointer if the character was not found.
3102 <tag/Limits/<itemize>
3103 <item>The function is only available as fastcall function, so it may only
3104 be used in presence of a prototype.
3105 </itemize>
3106 <tag/Availability/ISO 9899
3107 <tag/See also/
3108 <ref id="strchr" name="strchr">
3109 <tag/Example/None.
3110 </descrip>
3111 </quote>
3112
3113
3114 <sect1>memcpy<label id="memcpy"><p>
3115
3116 <quote>
3117 <descrip>
3118 <tag/Function/Copy a memory area.
3119 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3120 <tag/Declaration/<tt/void* __fastcall__ memcpy (void* dest, const void* src, size_t count);/
3121 <tag/Description/<tt/memcpy/ copies <tt/count/ bytes from the memory area
3122 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
3123 <tt/dest/.
3124 <tag/Limits/
3125 <itemize>
3126 <item>The result is undefined if the memory areas do overlap. Use
3127 <tt/<ref id="memmove" name="memmove">/ to copy overlapping memory areas.
3128 <item>The function is only available as fastcall function, so it may only
3129 be used in presence of a prototype.
3130 </itemize>
3131 <tag/Availability/ISO 9899
3132 <tag/See also/
3133 <ref id="_swap" name="_swap">,
3134 <ref id="memmove" name="memmove">,
3135 <ref id="memset" name="memset">
3136 <tag/Example/None.
3137 </descrip>
3138 </quote>
3139
3140
3141 <sect1>memmove<label id="memmove"><p>
3142
3143 <quote>
3144 <descrip>
3145 <tag/Function/Copy a memory area.
3146 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3147 <tag/Declaration/<tt/void* __fastcall__ memmove (void* dest, const void* src, size_t count);/
3148 <tag/Description/<tt/memmove/ copies <tt/count/ bytes from the memory area
3149 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
3150 <tt/dest/.
3151 <tag/Limits/
3152 <itemize>
3153 <item>While <tt/memmove/ allows the memory areas to overlap, it has some
3154 additional overhead compared to <tt/<ref id="memcpy" name="memcpy">/.
3155 <item>The function is only available as fastcall function, so it may only
3156 be used in presence of a prototype.
3157 </itemize>
3158 <tag/Availability/ISO 9899
3159 <tag/See also/
3160 <ref id="_swap" name="_swap">,
3161 <ref id="memcpy" name="memcpy">,
3162 <ref id="memset" name="memset">
3163 <tag/Example/None.
3164 </descrip>
3165 </quote>
3166
3167
3168 <sect1>memset<label id="memset"><p>
3169
3170 <quote>
3171 <descrip>
3172 <tag/Function/Fill a memory area.
3173 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3174 <tag/Declaration/<tt/void* __fastcall__ memset (void* p, int val, size_t count);/
3175 <tag/Description/<tt/memset/ fills the memory area pointed to by <tt/p/ with
3176 the value <tt/val/. The function returns <tt/p/.
3177 <tag/Limits/
3178 <itemize>
3179 <item>The function is only available as fastcall function, so it may only
3180 be used in presence of a prototype.
3181 </itemize>
3182 <tag/Availability/ISO 9899
3183 <tag/See also/
3184 <ref id="_swap" name="_swap">,
3185 <ref id="bzero" name="bzero">,
3186 <ref id="memcpy" name="memcpy">,
3187 <ref id="memmove" name="memmove">
3188 <tag/Example/None.
3189 </descrip>
3190 </quote>
3191
3192
3193 <sect1>mod_free<label id="mod_free"><p>
3194
3195 <quote>
3196 <descrip>
3197 <tag/Function/Free a relocatable module.
3198 <tag/Header/<tt/<ref id="modload.h" name="modload.h">/
3199 <tag/Declaration/<tt/void __fastcall__ mod_free (void* module);/
3200 <tag/Description/The function will free a module loaded into memory by use of
3201 the <tt/<ref id="mod_load" name="mod_load">/ function.
3202 <tag/Limits/<itemize>
3203 <item>The pointer passed as parameter is the pointer to the module memory,
3204 not the pointer to the control structure.
3205 </itemize>
3206 <tag/Availability/cc65
3207 <tag/See also/
3208 <ref id="mod_load" name="mod_load">
3209 <tag/Example/None.
3210 </descrip>
3211 </quote>
3212
3213
3214 <sect1>mod_load<label id="mod_load"><p>
3215
3216 <quote>
3217 <descrip>
3218 <tag/Function/Load a relocatable module.
3219 <tag/Header/<tt/<ref id="modload.h" name="modload.h">/
3220 <tag/Declaration/<tt/unsigned char mod_load (struct mod_ctrl* ctrl);/
3221 <tag/Description/The function will load a code module into memory and relocate
3222 it. The function will return an error code. If <tt/MLOAD_OK/ is returned, the
3223 outgoing fields in the passed <tt/mod_ctrl/ struct contain information about
3224 the module just loaded. Possible error codes are:
3225 <itemize>
3226 <item><tt/MLOAD_OK/ - Module load successful
3227 <item><tt/MLOAD_ERR_READ/ - Read error
3228 <item><tt/MLOAD_ERR_HDR/ - Header error
3229 <item><tt/MLOAD_ERR_OS/ - Wrong operating system
3230 <item><tt/MLOAD_ERR_FMT/ - Data format error
3231 <item><tt/MLOAD_ERR_MEM/ - Not enough memory
3232 </itemize>
3233 <tag/Limits/<itemize>
3234 <item>The <htmlurl url="ld65.html" name="ld65"> linker is needed to create
3235 relocatable o65 modules for use with this function.
3236 </itemize>
3237 <tag/Availability/cc65
3238 <tag/See also/
3239 <ref id="mod_free" name="mod_free">
3240 <tag/Example/None.
3241 </descrip>
3242 </quote>
3243
3244
3245 <sect1>mouse_box<label id="mouse_box"><p>
3246
3247 <quote>
3248 <descrip>
3249 <tag/Function/Specify a bounding box for the mouse cursor.
3250 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3251 <tag/Declaration/<tt/void __fastcall__ mouse_box (int minx, int miny,
3252 int maxx, int maxy);/
3253 <tag/Description/The function allows to set a bounding box for mouse movement.
3254 <tag/Limits/<itemize>
3255 <item>The function does not check if the mouse cursor is currently within the
3256 given rectangle. Placing the mouse cursor within the bounding box is the
3257 responsibility of the programmer.
3258 <item>While the bounding box may be larger than the actual screen size, the
3259 standard mouse cursor draw routines may fail to set the cursor to coordinates
3260 outside of the screen area. Depending on the platform, you may have to supply
3261 your own mouse cursor routines.
3262 <item>The function is only available as fastcall function, so it may only be
3263 used in presence of a prototype.
3264 </itemize>
3265 <tag/Availability/cc65
3266 <tag/See also/
3267 <ref id="mouse_move" name="mouse_move">
3268 <tag/Example/None.
3269 </descrip>
3270 </quote>
3271
3272
3273 <sect1>mouse_buttons<label id="mouse_buttons"><p>
3274
3275 <quote>
3276 <descrip>
3277 <tag/Function/Return a bit mask encoding the state of the mouse buttons.
3278 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3279 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_buttons (void);/
3280 <tag/Description/The function returns a bit mask that encodes the state of the
3281 mouse buttons. You may use the <tt/MOUSE_BTN_XXX/ flags to decode the function
3282 return value.
3283 <tag/Limits/<itemize>
3284 <item>The function is only available as fastcall function, so it may only be
3285 used in presence of a prototype.
3286 </itemize>
3287 <tag/Availability/cc65
3288 <tag/See also/
3289 <ref id="mouse_info" name="mouse_info">,
3290 <ref id="mouse_pos" name="mouse_pos">
3291 <tag/Example/None.
3292 </descrip>
3293 </quote>
3294
3295
3296 <sect1>mouse_geterrormsg<label id="mouse_geterrormsg"><p>
3297
3298 <quote>
3299 <descrip>
3300 <tag/Function/Return a readable error message for an error code.
3301 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3302 <tag/Declaration/<tt/const char* __fastcall__ mouse_geterrormsg (unsigned char
3303 code);/
3304 <tag/Description/The function returns an error message (in english) for the
3305 error code passed parameter.
3306 <tag/Limits/<itemize>
3307 <item>The function will return "Unknown error" for invalid error codes.
3308 <item>The function is only available as fastcall function, so it may only be
3309 used in presence of a prototype.
3310 </itemize>
3311 <tag/Availability/cc65
3312 <tag/See also/
3313 <ref id="mouse_load_driver" name="mouse_load_driver">,
3314 <ref id="mouse_uninstall" name="mouse_uninstall">,
3315 <ref id="mouse_unload" name="mouse_unload">
3316 <tag/Example/None.
3317 </descrip>
3318 </quote>
3319
3320
3321 <sect1>mouse_hide<label id="mouse_hide"><p>
3322
3323 <quote>
3324 <descrip>
3325 <tag/Function/Hide the mouse pointer.
3326 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3327 <tag/Declaration/<tt/void __fastcall__ mouse_hide (void);/
3328 <tag/Description/The function hides the mouse pointer. It manages a counter
3329 that is shared between <tt/<ref id="mouse_show" name="mouse_show">/ and
3330 <tt/mouse_hide/ so that every call call to <tt/mouse_hide/ must be followed by
3331 a call to <tt/<ref id="mouse_show" name="mouse_show">/ to make the mouse cursor
3332 visible.
3333 <tag/Limits/<itemize>
3334 <item>The function is only available as fastcall function, so it may only be
3335 used in presence of a prototype.
3336 </itemize>
3337 <tag/Availability/cc65
3338 <tag/See also/
3339 <ref id="mouse_show" name="mouse_show">
3340 <tag/Example/None.
3341 </descrip>
3342 </quote>
3343
3344
3345 <sect1>mouse_info<label id="mouse_info"><p>
3346
3347 <quote>
3348 <descrip>
3349 <tag/Function/Return the state of the mouse buttons and the position of the
3350 mouse.
3351 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3352 <tag/Declaration/<tt/void __fastcall__ mouse_info (struct mouse_info* info);/
3353 <tag/Description/The function returns the state of the mouse buttons and the
3354 position of the mouse in the <tt/mouse_info/ structure passed as parameter.
3355 <tag/Limits/<itemize>
3356 <item>The <tt/mouse_info/ struct is a superset of the <tt/mouse_pos/ struct,
3357 so if you just need the mouse position, call <tt/<ref id="mouse_pos"
3358 name="mouse_pos">/ instead.
3359 <item>The function is only available as fastcall function, so it may only be
3360 used in presence of a prototype.
3361 </itemize>
3362 <tag/Availability/cc65
3363 <tag/See also/
3364 <ref id="mouse_buttons" name="mouse_buttons">,
3365 <ref id="mouse_pos" name="mouse_pos">
3366 <tag/Example/None.
3367 </descrip>
3368 </quote>
3369
3370
3371 <sect1>mouse_install<label id="mouse_install"><p>
3372
3373 <quote>
3374 <descrip>
3375 <tag/Function/Install an already loaded mouse driver.
3376 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3377 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_install (const struct
3378 mouse_callbacks* c, void* driver);/
3379 <tag/Description/The function installs an already loaded mouse driver and
3380 returns an error code. The <tt/mouse_callbacks/ structure passed as first
3381 parameter contains pointers to routines needed to move or hide/show the mouse
3382 pointer. Defaults for these routines are supplied by the library, so if you
3383 can live with these defaults (which are platform specific), just pass a
3384 pointer to <tt/mouse_def_callbacks/. The function may be used to install a
3385 driver linked statically to the program.
3386 <tag/Limits/<itemize>
3387 <item>Not all drivers are able to detect if the supported hardware is really
3388 present.
3389 <item>After installing a driver, the mouse cursor is hidden.
3390 <item>The function is only available as fastcall function, so it may only be
3391 used in presence of a prototype.
3392 </itemize>
3393 <tag/Availability/cc65
3394 <tag/See also/
3395 <ref id="mouse_load_driver" name="mouse_load_driver">,
3396 <ref id="mouse_uninstall" name="mouse_uninstall">,
3397 <ref id="mouse_unload" name="mouse_unload">
3398 <tag/Example/None.
3399 </descrip>
3400 </quote>
3401
3402
3403 <sect1>mouse_ioctl<label id="mouse_ioctl"><p>
3404
3405 <quote>
3406 <descrip>
3407 <tag/Function/Call the driver specific ioctl function.
3408 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3409 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_ioctl (unsigned char code, void* data);/
3410 <tag/Description/The function calls the IOCTL entry in the mouse driver,
3411 which is driver specific. The <tt/code/ parameter will choose between
3412 different IOCTL functions, and the <tt/data/ depends on code. The
3413 function returns an error code. The purpose of this function is to allow
3414 for driver specific extensions. See the documentation for a specific mouse
3415 driver for supported ioctl calls.
3416 <tag/Limits/<itemize>
3417 <item>Calling this function is non portable, because each driver may
3418 implement different ioctl calls (or none at all).
3419 <item>The function is only available as fastcall function, so it may only be
3420 used in presence of a prototype.
3421 </itemize>
3422 <tag/Availability/cc65
3423 <tag/Example/None.
3424 </descrip>
3425 </quote>
3426
3427
3428 <sect1>mouse_load_driver<label id="mouse_load_driver"><p>
3429
3430 <quote>
3431 <descrip>
3432 <tag/Function/Load and initialize a mouse driver.
3433 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3434 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_load_driver (const struct
3435 mouse_callbacks* c, const char* driver);/
3436 <tag/Description/Load a mouse driver into memory and initialize it. The
3437 function returns an error code that tells if the call has been successful. The
3438 <tt/mouse_callbacks/ structure passed as first parameter contains pointers to
3439 routines needed to move or hide/show the mouse pointer. Defaults for these
3440 routines are supplied by the library, so if you can live with these defaults
3441 (which are platform specific), just pass a pointer to <tt/mouse_def_callbacks/.
3442 <tag/Limits/<itemize>
3443 <item>The driver is loaded by name, so currently you must know the type of
3444 mouse that should be supported. There is no autodetect capability.
3445 <item>Not all drivers are able to detect if the supported hardware is really
3446 present.
3447 <item>After installing a driver, the mouse cursor is hidden.
3448 <item>The function is only available as fastcall function, so it may only be
3449 used in presence of a prototype.
3450 </itemize>
3451 <tag/Availability/cc65
3452 <tag/See also/
3453 <ref id="mouse_install" name="mouse_install">,
3454 <ref id="mouse_uninstall" name="mouse_uninstall">,
3455 <ref id="mouse_unload" name="mouse_unload">
3456 <tag/Example/None.
3457 </descrip>
3458 </quote>
3459
3460
3461 <sect1>mouse_move<label id="mouse_move"><p>
3462
3463 <quote>
3464 <descrip>
3465 <tag/Function/Move the mouse cursor to a specific position.
3466 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3467 <tag/Declaration/<tt/void __fastcall__ mouse_move (int x, int y);/
3468 <tag/Description/The function updates the mouse position. If the mouse cursor
3469 is visible, it is shown at the new position.
3470 <tag/Limits/<itemize>
3471 <item>The function does not check if the new position is within the bounding
3472 box specified with <tt/<ref id="mouse_box" name="mouse_box">/.
3473 <item>The function is only available as fastcall function, so it may only be
3474 used in presence of a prototype.
3475 </itemize>
3476 <tag/Availability/cc65
3477 <tag/See also/
3478 <ref id="mouse_box" name="mouse_box">
3479 <tag/Example/None.
3480 </descrip>
3481 </quote>
3482
3483
3484 <sect1>mouse_pos<label id="mouse_pos"><p>
3485
3486 <quote>
3487 <descrip>
3488 <tag/Function/Return the position of the mouse.
3489 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3490 <tag/Declaration/<tt/void __fastcall__ mouse_pos (struct mouse_pos* pos);/
3491 <tag/Description/The function returns the position of the mouse in the
3492 <tt/mouse_pos/ structure passed as parameter.
3493 <tag/Limits/<itemize>
3494 <item>The <tt/mouse_pos/ struct is a subset of the <tt/mouse_info/ struct,
3495 so if you do also need the mouse buttons, call <tt/<ref id="mouse_info"
3496 name="mouse_info">/ instead.
3497 <item>The function is only available as fastcall function, so it may only be
3498 used in presence of a prototype.
3499 </itemize>
3500 <tag/Availability/cc65
3501 <tag/See also/
3502 <ref id="mouse_buttons" name="mouse_buttons">,
3503 <ref id="mouse_info" name="mouse_info">
3504 <tag/Example/None.
3505 </descrip>
3506 </quote>
3507
3508
3509 <sect1>mouse_show<label id="mouse_show"><p>
3510
3511 <quote>
3512 <descrip>
3513 <tag/Function/Show the mouse pointer.
3514 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3515 <tag/Declaration/<tt/void __fastcall__ mouse_show (void);/
3516 <tag/Description/The function shows the mouse pointer. It manages a counter
3517 that is shared between <tt/<ref id="mouse_hide" name="mouse_hide">/ and
3518 <tt/mouse_show/. The mouse cursor is visible if there was one more call to
3519 <tt/mouse_show/ than to <tt/<ref id="mouse_hide" name="mouse_hide">/.
3520 <tag/Limits/<itemize>
3521 <item>The function is only available as fastcall function, so it may only be
3522 used in presence of a prototype.
3523 </itemize>
3524 <tag/Availability/cc65
3525 <tag/See also/
3526 <ref id="mouse_hide" name="mouse_hide">
3527 <tag/Example/None.
3528 </descrip>
3529 </quote>
3530
3531
3532 <sect1>mouse_uninstall<label id="mouse_uninstall"><p>
3533
3534 <quote>
3535 <descrip>
3536 <tag/Function/Uninstall an already loaded mouse driver.
3537 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3538 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_install (void);/
3539 <tag/Description/The function uninstalls an already loaded mouse driver but
3540 don't removes it from memory.
3541 <tag/Limits/<itemize>
3542 <item>If the driver has been loaded using <tt/<ref id="mouse_load_driver"
3543 name="mouse_load_driver">/, <tt/<ref id="mouse_unload" name="mouse_unload">/
3544 should be used instead of <tt/mouse_uninstall/ so the driver is also removed
3545 from memory.
3546 <item>The function is only available as fastcall function, so it may only be
3547 used in presence of a prototype.
3548 </itemize>
3549 <tag/Availability/cc65
3550 <tag/See also/
3551 <ref id="mouse_install" name="mouse_install">,
3552 <ref id="mouse_load_driver" name="mouse_load_driver">,
3553 <ref id="mouse_unload" name="mouse_unload">
3554 <tag/Example/None.
3555 </descrip>
3556 </quote>
3557
3558
3559 <sect1>mouse_unload<label id="mouse_unload"><p>
3560
3561 <quote>
3562 <descrip>
3563 <tag/Function/Unload a mouse driver.
3564 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3565 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_unload (void);/
3566 <tag/Description/The function unloads a loaded mouse driver and frees all
3567 memory allocated for the driver.
3568 <tag/Limits/<itemize>
3569 <item>The function does nothing if no driver is loaded.
3570 </itemize>
3571 <tag/Availability/cc65
3572 <tag/See also/
3573 <ref id="mouse_install" name="mouse_install">,
3574 <ref id="mouse_load_driver" name="mouse_load_driver">,
3575 <ref id="mouse_uninstall" name="mouse_uninstall">
3576 <tag/Example/None.
3577 </descrip>
3578 </quote>
3579
3580
3581 <sect1>offsetof<label id="offsetof"><p>
3582
3583 <quote>
3584 <descrip>
3585 <tag/Function/Calculate the offset of a struct or union member.
3586 <tag/Header/<tt/<ref id="stddef.h" name="stddef.h">/
3587 <tag/Declaration/<tt/size_t offsetof (type, member);/
3588 <tag/Description/<tt/offsetof/ calculates the address offset of a <tt/struct/
3589 or <tt/union/ member.
3590 <tag/Limits/<itemize>
3591 <item>The function is actually a macro.
3592 </itemize>
3593 <tag/Availability/ISO 9899
3594 <tag/Example/None.
3595 </descrip>
3596 </quote>
3597
3598
3599 <sect1>open<label id="open"><p>
3600
3601 <quote>
3602 <descrip>
3603 <tag/Function/Open and possibly create a file.
3604 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
3605 <tag/Declaration/<tt/int open (const char* name, int flags, ...);/
3606 <tag/Description/<tt/open/ opens a file and returns the file descriptor
3607 associated with it. On error, -1 is returned and an error code is stored in
3608 <tt/errno/. Several flags may be passed to <tt/open/ that change the behaviour.
3609 <tag/Limits/<itemize>
3610 <item>POSIX specifies an additional <tt/mode/ argument that may be passed to
3611 open, which is used as the permission mask when a new file is created. While
3612 cc65 allows to pass this argument, it is ignored.
3613 </itemize>
3614 <tag/Availability/POSIX 1003.1
3615 <tag/See also/
3616 <ref id="close" name="close">,
3617 <ref id="creat" name="creat">
3618 <tag/Example/None.
3619 </descrip>
3620 </quote>
3621
3622
3623 <sect1>peekbsys<label id="peekbsys"><p>
3624
3625 <quote>
3626 <descrip>
3627 <tag/Function/Read one byte from a location in the system bank.
3628 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3629 <tt/<ref id="cbm510.h" name="cbm510.h">/
3630 <tag/Declaration/<tt/unsigned char __fastcall__ peekbsys (unsigned addr);/
3631 <tag/Description/<tt/peekbsys/ reads one byte from the given address in the
3632 system bank (bank 15) of the CBM PET-II machines and returns it.
3633 <tag/Limits/
3634 <itemize>
3635 <item>The function is only available as fastcall function, so it may only
3636 be used in presence of a prototype.
3637 <item>This function may be a macro depending on the compiler options. The
3638 actual function is accessible by #undef'ing the macro.
3639 </itemize>
3640 <tag/Availability/cc65
3641 <tag/See also/
3642 <ref id="PEEK" name="PEEK">,
3643 <ref id="PEEKW" name="PEEKW">,
3644 <ref id="peekwsys" name="peekwsys">,
3645 <ref id="pokebsys" name="pokebsys">,
3646 <ref id="pokewsys" name="pokewsys">
3647 <tag/Example/None.
3648 </descrip>
3649 </quote>
3650
3651
3652 <sect1>peekwsys<label id="peekwsys"><p>
3653
3654 <quote>
3655 <descrip>
3656 <tag/Function/Read one word from a location in the system bank.
3657 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3658 <tt/<ref id="cbm510.h" name="cbm510.h">/
3659 <tag/Declaration/<tt/unsigned __fastcall__ peekwsys (unsigned addr);/
3660 <tag/Description/<tt/peekwsys/ reads one word from the given address in the
3661 system bank (bank 15) of the CBM PET-II machines and returns it. Following
3662 the usual 6502 conventions, the low byte is read from <tt/addr/, and the
3663 high byte is read from <tt/addr+1/.
3664 <tag/Limits/
3665 <itemize>
3666 <item>The function is only available as fastcall function, so it may only
3667 be used in presence of a prototype.
3668 <item>The order in which the two bytes are read is undefined.
3669 </itemize>
3670 <tag/Availability/cc65
3671 <tag/See also/
3672 <ref id="PEEK" name="PEEK">,
3673 <ref id="PEEKW" name="PEEKW">,
3674 <ref id="peekbsys" name="peekbsys">,
3675 <ref id="pokebsys" name="pokebsys">,
3676 <ref id="pokewsys" name="pokewsys">
3677 <tag/Example/None.
3678 </descrip>
3679 </quote>
3680
3681
3682 <sect1>perror<label id="perror"><p>
3683
3684 <quote>
3685 <descrip>
3686 <tag/Function/Print an error message for the error in <tt/errno/.
3687 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
3688 <tag/Declaration/<tt/void __fastcall__ perror (const char* s);/
3689 <tag/Description/<tt/perror/ prints an error message to <tt/stderr/. If <tt/s/
3690 is not <tt/NULL/ and not an empty string, it is printed followed by a colon and
3691 a blank. Then the error message for the current contents of <tt/errno/ is
3692 printed followed by a newline. The message output is the same as returned by
3693 <tt/<ref id="strerror" name="strerror">/ with an argument of <tt/errno/.
3694 <tag/Limits/
3695 <itemize>
3696 <item>The function is only available as fastcall function, so it may only
3697 be used in presence of a prototype.
3698 </itemize>
3699 <tag/Availability/ISO 9899
3700 <tag/See also/
3701 <ref id="_poserror" name="_poserror">,
3702 <ref id="strerror" name="strerror">
3703 <tag/Example/None.
3704 </descrip>
3705 </quote>
3706
3707
3708 <sect1>pokebsys<label id="pokebsys"><p>
3709
3710 <quote>
3711 <descrip>
3712 <tag/Function/Write one byte to a location in the system bank.
3713 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3714 <tt/<ref id="cbm510.h" name="cbm510.h">/
3715 <tag/Declaration/<tt/void __fastcall__ pokebsys (unsigned addr, unsigned char val);/
3716 <tag/Description/<tt/pokebsys/ writes one byte to the given address in the
3717 system bank (bank 15) of the CBM PET-II machines.
3718 <tag/Limits/
3719 <itemize>
3720 <item>The function is only available as fastcall function, so it may only
3721 be used in presence of a prototype.
3722 </itemize>
3723 <tag/Availability/cc65
3724 <tag/See also/
3725 <ref id="POKE" name="POKE">,
3726 <ref id="POKEW" name="POKEW">,
3727 <ref id="peekbsys" name="peekbsys">,
3728 <ref id="peekwsys" name="peekwsys">,
3729 <ref id="pokewsys" name="pokewsys">
3730 <tag/Example/None.
3731 </descrip>
3732 </quote>
3733
3734
3735 <sect1>pokewsys<label id="pokewsys"><p>
3736
3737 <quote>
3738 <descrip>
3739 <tag/Function/Write one word to a location in the system bank.
3740 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3741 <tt/<ref id="cbm510.h" name="cbm510.h">/
3742 <tag/Declaration/<tt/void __fastcall__ pokewsys (unsigned addr, unsigned val);/
3743 <tag/Description/<tt/pokewsys/ writes one word to the given address in the
3744 system bank (bank 15) of the CBM PET-II machines. Following the usual 6502
3745 conventions, the low byte of <tt/val/ is written to <tt/addr/, and the
3746 high byte is written to <tt/addr+1/.
3747 <tag/Limits/
3748 <itemize>
3749 <item>The function is only available as fastcall function, so it may only
3750 be used in presence of a prototype.
3751 <item>The order in which the two bytes are written is undefined.
3752 </itemize>
3753 <tag/Availability/cc65
3754 <tag/See also/
3755 <ref id="POKE" name="POKE">,
3756 <ref id="POKEW" name="POKEW">,
3757 <ref id="peekbsys" name="peekbsys">,
3758 <ref id="peekwsys" name="peekwsys">,
3759 <ref id="pokebsys" name="pokebsys">
3760 <tag/Example/None.
3761 </descrip>
3762 </quote>
3763
3764
3765 <sect1>qsort<label id="qsort"><p>
3766
3767 <quote>
3768 <descrip>
3769 <tag/Function/Sort an array.
3770 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3771 <tag/Declaration/<tt/void __fastcall__ qsort (void* base, size_t count,
3772 size_t size, int (*compare) (const void*, const void*));/
3773 <tag/Description/<tt/qsort/ sorts an array according to a given compare
3774 function <tt/compare/. <tt/base/ is the address of the array, <tt/count/
3775 is the number of elements, <tt/size/ the size of an element and <tt/compare/
3776 the function used to compare the members.
3777 <tag/Limits/
3778 <itemize>
3779 <item>If there are multiple members with the same key, the order after calling
3780 the function is undefined.
3781 <item>The function is only available as fastcall function, so it may only
3782 be used in presence of a prototype.
3783 </itemize>
3784 <tag/Availability/ISO 9899
3785 <tag/See also/
3786 <ref id="bsearch" name="bsearch">
3787 <tag/Example/None.
3788 </descrip>
3789 </quote>
3790
3791
3792 <sect1>raise<label id="raise"><p>
3793
3794 <quote>
3795 <descrip>
3796 <tag/Function/Send a signal to the executing program.
3797 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
3798 <tag/Declaration/<tt/int __fastcall__ raise (int sig);/
3799 <tag/Description/<tt/raise/ sends the given signal to the program. If the
3800 program has installed a signal handler for the signal, this signal handler
3801 will be executed. If no handler has been installed, the default action for
3802 the raised signal will be taken. The function returns zero on success,
3803 nonzero otherwise.
3804 <tag/Limits/<itemize>
3805 <item>The function is only available as fastcall function, so it may only
3806 be used in presence of a prototype.
3807 </itemize>
3808 <tag/Availability/ISO 9899
3809 <tag/See also/
3810 <ref id="abort" name="abort">,
3811 <ref id="signal" name="signal">
3812 <tag/Example/None.
3813 </descrip>
3814 </quote>
3815
3816
3817 <sect1>rand<label id="rand"><p>
3818
3819 <quote>
3820 <descrip>
3821 <tag/Function/Return a pseudo random number.
3822 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3823 <tag/Declaration/<tt/int rand (void);/
3824 <tag/Description/The function returns a pseudo random number
3825 between 0 and <tt/RAND_MAX/ (exclusive).
3826 <tag/Limits/<itemize>
3827 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
3828 flow of numbers is generated.
3829 <item>On startup, the function behaves as if <ref id="srand" name="srand">
3830 had been used with an argument of 1.
3831 </itemize>
3832 <tag/Availability/ISO 9899
3833 <tag/See also/
3834 <ref id="_randomize" name="_randomize">,
3835 <ref id="srand" name="srand">
3836 <tag/Example/None.
3837 </descrip>
3838 </quote>
3839
3840
3841 <sect1>realloc<label id="realloc"><p>
3842
3843 <quote>
3844 <descrip>
3845 <tag/Function/Change the size of an allocated memory block.
3846 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3847 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
3848 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
3849 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
3850 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
3851 behaves as if <tt/free/ had been called. On error (not enough memory
3852 available), <tt/realloc/ returns <tt/NULL/.
3853 <tag/Limits/
3854 <itemize>
3855 <item>The part of the memory block that is returned will have its contents
3856 unchanged.
3857 <item>This function is somewhat dangerous to use. Be careful to save the
3858 pointer you're passing somewhere else, otherwise
3859 <tscreen><verb>
3860         ptr = realloc (ptr, size);
3861 </verb></tscreen>
3862 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
3863 <item>The function is only available as fastcall function, so it may only
3864 be used in presence of a prototype.
3865 </itemize>
3866 <tag/Availability/ISO 9899
3867 <tag/See also/
3868 <ref id="_heapadd" name="_heapadd">,
3869 <ref id="_heapblocksize" name="_heapblocksize">,
3870 <ref id="_heapmaxavail" name="_heapmaxavail">,
3871 <ref id="_heapmemavail" name="_heapmemavail">,
3872 <ref id="calloc" name="calloc">,
3873 <ref id="free" name="free">,
3874 <ref id="realloc" name="realloc">
3875 <tag/Example/None.
3876 </descrip>
3877 </quote>
3878
3879
3880 <sect1>remove<label id="remove"><p>
3881
3882 <quote>
3883 <descrip>
3884 <tag/Function/Delete a file.
3885 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
3886 <tag/Declaration/<tt/int __fastcall__ remove (const char* name);/
3887 <tag/Description/<tt/remove/ deletes the file with the given name. On success,
3888 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
3889 code describing the reason for the failure.
3890 <tag/Limits/
3891 <itemize>
3892 <item>This function is not available on all cc65 targets (depends on the
3893 availability of file I/O).
3894 <item>The function is only available as fastcall function, so it may only
3895 be used in presence of a prototype.
3896 </itemize>
3897 <tag/Availability/ISO 9899
3898 <tag/See also/
3899 <ref id="unlink" name="unlink">
3900 <tag/Example/
3901 #include &lt;stdio.h&gt;
3902
3903 #define FILENAME "helloworld"
3904
3905 if (remove (FILENAME) == 0) {
3906     printf ("We deleted %s successfully\n", FILENAME);
3907 } else {
3908     printf ("There was a problem deleting %s\n", FILENAME);
3909 }
3910 </descrip>
3911 </quote>
3912
3913
3914 <sect1>reset_brk<label id="reset_brk"><p>
3915
3916 <quote>
3917 <descrip>
3918 <tag/Function/Resets the break vector to its original value.
3919 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
3920 <tag/Declaration/<tt/void __fastcall__ reset_brk (void);/
3921 <tag/Description/<tt/reset_brk/ resets the break vector to the value it had
3922 before a call to <tt/set_brk/.
3923 <tag/Limits/
3924 <itemize>
3925 <item>Since <tt/<ref id="set_brk" name="set_brk">/ installs an exit handler,
3926 it is not strictly necessary to call this function as part of the cleanup when
3927 the program ends.
3928 </itemize>
3929 <tag/Availability/cc65
3930 <tag/See also/
3931 <ref id="set_brk" name="set_brk">
3932 <tag/Example/None.
3933 </descrip>
3934 </quote>
3935
3936
3937 <sect1>revers<label id="revers"><p>
3938
3939 <quote>
3940 <descrip>
3941 <tag/Function/Control revers character display.
3942 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3943 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
3944 <tag/Description/If the argument is non zero, the function enables reverse
3945 character display. If the argument is zero, reverse character display is
3946 switched off. The old value of the setting is returned.
3947 <tag/Limits/<itemize>
3948 <item>The function may not be supported by the hardware, in which case
3949 the call is ignored.
3950 <item>The function is only available as fastcall function, so it may only
3951 be used in presence of a prototype.
3952 </itemize>
3953 <tag/Availability/cc65
3954 <tag/See also/
3955 <ref id="textcolor" name="textcolor">
3956 <tag/Example/None.
3957 </descrip>
3958 </quote>
3959
3960
3961 <sect1>screensize<label id="screensize"><p>
3962
3963 <quote>
3964 <descrip>
3965 <tag/Function/Return the dimensions of the text mode screen.
3966 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3967 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
3968 <tag/Description/The function returns the dimensions of the text mode screen.
3969 <tag/Limits/<itemize>
3970 <item>The function is only available as fastcall function, so it may only
3971 be used in presence of a prototype.
3972 </itemize>
3973 <tag/Availability/cc65
3974 <tag/See also/
3975 <ref id="gotox" name="gotox">,
3976 <ref id="gotoxy" name="gotoxy">,
3977 <ref id="gotoy" name="gotoy">,
3978 <ref id="wherex" name="wherex">,
3979 <ref id="wherey" name="wherey">
3980 <tag/Example/None.
3981 </descrip>
3982 </quote>
3983
3984
3985 <sect1>set_brk<label id="set_brk"><p>
3986
3987 <quote>
3988 <descrip>
3989 <tag/Function/Set the break vector to a user function.
3990 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
3991 <tag/Declaration/<tt/void __fastcall__ set_brk (brk_handler func);/
3992 <tag/Description/<tt/set_brk/ allows a user program to handle breaks within the
3993 program code by letting the vector point to a user written C function. The
3994 runtime library installs a small stub that saves the registers into global
3995 variables that may be accessed (and changed) by the break handler.
3996 <tag/Limits/
3997 <itemize>
3998 <item>The function is only available as fastcall function, so it may only
3999 be used in presence of a prototype.
4000 <item>The stub saves the zero page registers used by the C runtime and switches
4001 to a small break handler stack. This means that it is safe to execute C code,
4002 even if C code was interrupted. Be careful however not to use too many local
4003 variables, and do not enable stack checks for the handler function or any other
4004 function called from it.
4005 <item>The <tt/brk_pc/ variable points to the <tt/BRK/ instruction. If you want
4006 the continue with the interrupted code, you have to adjust <tt/brk_pc/,
4007 otherwise the <tt/BRK/ instruction will get executed over and over again.
4008 <item>Since <tt/set_brk/ installs an exit handler, it is not strictly necessary
4009 to call <tt/<ref id="reset_brk" name="reset_brk">/ as part of the cleanup when
4010 the program terminates.
4011 </itemize>
4012 <tag/Availability/cc65
4013 <tag/See also/
4014 <ref id="reset_brk" name="reset_brk">
4015 <tag/Example/None.
4016 </descrip>
4017 </quote>
4018
4019
4020 <sect1>setjmp<label id="setjmp"><p>
4021
4022 <quote>
4023 <descrip>
4024 <tag/Function/Save the context for use with <tt/longjmp/.
4025 <tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
4026 <tag/Declaration/<tt/int __fastcall__ setjmp (jmp_buf buf);/
4027 <tag/Description/The <tt/setjmp/ function saves the current context in <tt/buf/
4028 for subsequent use by the <tt/<ref id="longjmp" name="longjmp">/ function and
4029 returns zero.
4030 <tag/Limits/
4031 <itemize>
4032 <item>The function is only available as fastcall function, so it may only
4033 be used in presence of a prototype.
4034 <item><tt/setjmp/ is actually a macro as required by the ISO standard.
4035 <item><tt/setjmp/ will not save the signal context.
4036 </itemize>
4037 <tag/Availability/ISO 9899
4038 <tag/See also/
4039 <ref id="longjmp" name="longjmp">
4040 <tag/Example/None.
4041 </descrip>
4042 </quote>
4043
4044
4045 <sect1>setlocale<label id="setlocale"><p>
4046
4047 <quote>
4048 <descrip>
4049 <tag/Function/Selects a locale.
4050 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
4051 <tag/Declaration/<tt/char* __fastcall__ setlocale (int category, const char* locale);/
4052 <tag/Description/<tt/setlocale/ sets or queries the program's locale.
4053 <tag/Limits/
4054 <itemize>
4055 <item>The function is only available as fastcall function, so it may only
4056 be used in presence of a prototype.
4057 <item>cc65 supports only the "C" locale, so calling this function to set a
4058 different locale has no effect.
4059 </itemize>
4060 <tag/Availability/ISO 9899
4061 <tag/See also/
4062 <ref id="localeconv" name="localeconv">,
4063 <ref id="strcoll" name="strcoll">
4064 <tag/Example/None.
4065 </descrip>
4066 </quote>
4067
4068
4069 <sect1>signal<label id="signal"><p>
4070
4071 <quote>
4072 <descrip>
4073 <tag/Function/Install a signal handler.
4074 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
4075 <tag/Declaration/<tt/__sigfunc __fastcall__ signal (int sig, __sigfunc func);/
4076 <tag/Description/<tt/signal/ installs a handler for the given signal. The
4077 handler may either be a user supplied function, or one of the predefined
4078 signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
4079 previous value if the signal , or the special function vector SIG_ERR in
4080 case of an error.
4081 <tag/Limits/<itemize>
4082 <item>The function is only available as fastcall function, so it may only
4083 be used in presence of a prototype.
4084 </itemize>
4085 <tag/Availability/ISO 9899
4086 <tag/See also/
4087 <ref id="abort" name="abort">,
4088 <ref id="raise" name="raise">
4089 <tag/Example/None.
4090 </descrip>
4091 </quote>
4092
4093
4094 <sect1>sleep<label id="sleep"><p>
4095
4096 <quote>
4097 <descrip>
4098 <tag/Function/Sleep for a specified amount of time.
4099 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
4100 <tag/Declaration/<tt/void __fastcall__ sleep (unsigned seconds);/
4101 <tag/Description/The function will return after the specified number of
4102 seconds have elapsed.
4103 <tag/Limits/<itemize>
4104 <item>The function is only available as fastcall function, so it may only
4105 be used in presence of a prototype.
4106 </itemize>
4107 <tag/Availability/POSIX 1003.1
4108 <tag/Example/None.
4109 </descrip>
4110 </quote>
4111
4112
4113 <sect1>slow<label id="slow"><p>
4114
4115 <quote>
4116 <descrip>
4117 <tag/Function/Switch the C128 into 1MHz mode.
4118 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
4119 <tag/Declaration/<tt/void slow (void);/
4120 <tag/Description/The function will switch the clock of the C128 to 1MHz. This
4121 will halve the speed compared to fast mode.
4122 <tag/Limits/<itemize>
4123 <item>The function is specific to the C128.
4124 </itemize>
4125 <tag/Availability/C128
4126 <tag/See also/
4127 <ref id="fast" name="fast">,
4128 <ref id="toggle_videomode" name="toggle_videomode">
4129 <tag/Example/None.
4130 </descrip>
4131 </quote>
4132
4133
4134 <sect1>srand<label id="srand"><p>
4135
4136 <quote>
4137 <descrip>
4138 <tag/Function/Initialize the pseudo random number generator.
4139 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4140 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
4141 <tag/Description/The function initializes the random number generator using
4142 the given seed. On program startup, the generator behaves as if <tt/srand/ has
4143 been called with an argument of 1.
4144 <tag/Limits/<itemize>
4145 <item>The function is only available as fastcall function, so it may only
4146 be used in presence of a prototype.
4147 </itemize>
4148 <tag/Availability/ISO 9899
4149 <tag/See also/
4150 <ref id="_randomize" name="_randomize">,
4151 <ref id="rand" name="rand">
4152 <tag/Example/None.
4153 </descrip>
4154 </quote>
4155
4156
4157 <sect1>strcasecmp<label id="strcasecmp"><p>
4158
4159 <quote>
4160 <descrip>
4161 <tag/Function/Compare two strings case insensitive.
4162 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4163 <tag/Declaration/<tt/int __fastcall__ strcasecmp (const char* s1, const char* s2);/
4164 <tag/Description/The <tt/strcasecmp/ function compares the two strings passed
4165 as parameters without case sensitivity. It returns a value that is less than
4166 zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
4167 and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
4168 <tag/Limits/<itemize>
4169 <item>The function is only available as fastcall function, so it may only
4170 be used in presence of a prototype.
4171 <item>The function is not available in strict ANSI mode.
4172 </itemize>
4173 <tag/Availability/cc65
4174 <tag/See also/
4175 <ref id="strcmp" name="strcmp">,
4176 <ref id="strcoll" name="strcoll">,
4177 <ref id="stricmp" name="stricmp">,
4178 <ref id="strncmp" name="strncmp">
4179 <tag/Example/None.
4180 </descrip>
4181 </quote>
4182
4183
4184 <sect1>strcat<label id="strcat"><p>
4185
4186 <quote>
4187 <descrip>
4188 <tag/Function/Concatentate two strings.
4189 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4190 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
4191 <tag/Description/The <tt/strcat/ function appends a copy of the string
4192 pointed to by s2 (including the terminating null byte) to the end of the
4193 string pointed to by s1. The initial byte of s2 overwrites the null byte at
4194 the end of s1.
4195 <tag/Limits/<itemize>
4196 <item>The function is only available as fastcall function, so it may only
4197 be used in presence of a prototype.
4198 <item>If copying takes place between objects that overlap, the behaviour
4199 is undefined.
4200 </itemize>
4201 <tag/Availability/ISO 9899
4202 <tag/See also/
4203 <ref id="strcpy" name="strcpy">,
4204 <ref id="strncat" name="strncat">,
4205 <ref id="strncpy" name="strncpy">
4206 <tag/Example/None.
4207 </descrip>
4208 </quote>
4209
4210
4211 <sect1>strchr<label id="strchr"><p>
4212
4213 <quote>
4214 <descrip>
4215 <tag/Function/Search for a character in a string.
4216 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4217 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
4218 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
4219 (converted to a char) in the string pointed to by <tt/s/. The terminating null
4220 byte is considered to be part of the string. Upon completion, the function
4221 returns a pointer to the byte, or a null pointer if the byte was not found.
4222 <tag/Limits/<itemize>
4223 <item>The function is only available as fastcall function, so it may only
4224 be used in presence of a prototype.
4225 </itemize>
4226 <tag/Availability/ISO 9899
4227 <tag/See also/
4228 <ref id="memchr" name="memchr">,
4229 <ref id="strrchr" name="strrchr">
4230 <tag/Example/None.
4231 </descrip>
4232 </quote>
4233
4234
4235 <sect1>strcmp<label id="strcmp"><p>
4236
4237 <quote>
4238 <descrip>
4239 <tag/Function/Compare two strings.
4240 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4241 <tag/Declaration/<tt/int __fastcall__ strcmp (const char* s1, const char* s2);/
4242 <tag/Description/The <tt/strcmp/ function compares the two strings passed as
4243 parameters. It returns a value that is less than zero if <tt/s1/ is less than
4244 <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater than zero
4245 if <tt/s1/ is greater than <tt/s2/.
4246 <tag/Limits/<itemize>
4247 <item>The function is only available as fastcall function, so it may only
4248 be used in presence of a prototype.
4249 </itemize>
4250 <tag/Availability/ISO 9899
4251 <tag/See also/
4252 <ref id="strcasecmp" name="strcasecmp">,
4253 <ref id="strcoll" name="strcoll">,
4254 <ref id="stricmp" name="stricmp">,
4255 <ref id="strncmp" name="strncmp">
4256 <tag/Example/None.
4257 </descrip>
4258 </quote>
4259
4260
4261 <sect1>strcoll<label id="strcoll"><p>
4262
4263 <quote>
4264 <descrip>
4265 <tag/Function/Compare two strings.
4266 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4267 <tag/Declaration/<tt/int __fastcall__ strcoll (const char* s1, const char* s2);/
4268 <tag/Description/The <tt/strcoll/ function compares the two strings passed as
4269 parameters, according to the collating sequence set by <tt/<ref id="setlocale"
4270 name="setlocale">/. It returns a value that is less than zero if <tt/s1/ is
4271 less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater
4272 than zero if <tt/s1/ is greater than <tt/s2/.
4273 <tag/Limits/<itemize>
4274 <item>The function is only available as fastcall function, so it may only
4275 be used in presence of a prototype.
4276 </itemize>
4277 <tag/Availability/ISO 9899
4278 <tag/See also/
4279 <ref id="setlocale" name="setlocale">,
4280 <ref id="strcasecmp" name="strcasecmp">,
4281 <ref id="strcmp" name="strcmp">,
4282 <ref id="stricmp" name="stricmp">,
4283 <ref id="strncmp" name="strncmp">
4284 <tag/Example/None.
4285 </descrip>
4286 </quote>
4287
4288
4289 <sect1>strcpy<label id="strcpy"><p>
4290
4291 <quote>
4292 <descrip>
4293 <tag/Function/Copy a string.
4294 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4295 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
4296 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
4297 <tt/s2/ (including the terminating null byte) into the array pointed to by
4298 <tt/s1/. The function will always return <tt/s1/.
4299 <tag/Limits/<itemize>
4300 <item>The function is only available as fastcall function, so it may only
4301 be used in presence of a prototype.
4302 <item>If copying takes place between objects that overlap, the behaviour
4303 is undefined.
4304 </itemize>
4305 <tag/Availability/ISO 9899
4306 <tag/See also/
4307 <ref id="strcat" name="strcat">,
4308 <ref id="strncat" name="strncat">,
4309 <ref id="strncpy" name="strncpy">
4310 <tag/Example/
4311 <verb>
4312 #include &lt;string.h&gt;
4313
4314 static char hello[14];
4315
4316 strcpy (hello, "Hello world!\n");
4317 </verb>
4318 </descrip>
4319 </quote>
4320
4321
4322 <sect1>strcspn<label id="strcspn"><p>
4323
4324 <quote>
4325 <descrip>
4326 <tag/Function/Compute the length of a substring.
4327 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4328 <tag/Declaration/<tt/size_t __fastcall__ strcspn (const char* s, const char* set);/
4329 <tag/Description/The <tt/strcspn/ function computes and returns the length of
4330 the substring pointed to by <tt/s/ which does <em>not</em> consist of
4331 characters contained in the string <tt/set/.
4332 <tag/Limits/<itemize>
4333 <item>The function is only available as fastcall function, so it may only
4334 be used in presence of a prototype.
4335 </itemize>
4336 <tag/Availability/ISO 9899
4337 <tag/See also/
4338 <ref id="strspn" name="strspn">,
4339 <ref id="strstr" name="strstr">,
4340 <ref id="strtok" name="strtok">
4341 <tag/Example/None.
4342 </descrip>
4343 </quote>
4344
4345
4346 <sect1>strdup<label id="strdup"><p>
4347
4348 <quote>
4349 <descrip>
4350 <tag/Function/Allocate a copy of a string on the heap.
4351 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4352 <tag/Declaration/<tt/char* __fastcall__ strdup (const char* s);/
4353 <tag/Description/<tt/strdup/ allocates a memory block on the heap, big enough
4354 to hold a copy of <tt/s/ including the terminating zero. If the allocation
4355 fails, <tt/NULL/ is returned, otherwise <tt/s/ is copied into the allocated
4356 memory block, and a pointer to the block is returned.
4357 <tag/Limits/<itemize>
4358 <item>The function is only available as fastcall function, so it may only
4359 be used in presence of a prototype.
4360 <item>It is up to the caller to free the allocated memory block.
4361 </itemize>
4362 <tag/Availability/ISO 9899
4363 <tag/See also/
4364 <ref id="free" name="free">,
4365 <ref id="malloc" name="malloc">
4366 <tag/Example/None.
4367 </descrip>
4368 </quote>
4369
4370
4371 <sect1>strerror<label id="strerror"><p>
4372
4373 <quote>
4374 <descrip>
4375 <tag/Function/Return a string describing an error code.
4376 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4377 <tag/Declaration/<tt/char* __fastcall__ strerror (int errcode);/
4378 <tag/Description/The <tt/strerror/ function returns a string describing the
4379 given error code. If an invalid error code is passed, the string "Unknown
4380 error" is returned, and <tt/errno/ is set to <tt/EINVAL/. In all other cases,
4381 <tt/errno/ is left untouched.
4382 <tag/Limits/<itemize>
4383 <item>The function is only available as fastcall function, so it may only
4384 be used in presence of a prototype.
4385 <item>While the return type of the function is a <tt/char*/, the returned
4386 string must not be modified by the caller!
4387 </itemize>
4388 <tag/Availability/ISO 9899
4389 <tag/See also/
4390 <ref id="_stroserror" name="_stroserror">
4391 <tag/Example/None.
4392 </descrip>
4393 </quote>
4394
4395
4396 <sect1>stricmp<label id="stricmp"><p>
4397
4398 <quote>
4399 <descrip>
4400 <tag/Function/Compare two strings case insensitive.
4401 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4402 <tag/Declaration/<tt/int __fastcall__ stricmp (const char* s1, const char* s2);/
4403 <tag/Description/The <tt/stricmp/ function compares the two strings passed as
4404 parameters without case sensitivity. It returns a value that is less than zero
4405 if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
4406 value greater than zero if <tt/s1/ is greater than <tt/s2/.
4407 <tag/Limits/<itemize>
4408 <item>The function is only available as fastcall function, so it may only
4409 be used in presence of a prototype.
4410 <item>The function is not available in strict ANSI mode.
4411 </itemize>
4412 <tag/Availability/cc65
4413 <tag/See also/
4414 <ref id="strcasecmp" name="strcasecmp">,
4415 <ref id="strcmp" name="strcmp">,
4416 <ref id="strcoll" name="strcoll">,
4417 <ref id="strncmp" name="strncmp">
4418 <tag/Example/None.
4419 </descrip>
4420 </quote>
4421
4422
4423 <sect1>strlen<label id="strlen"><p>
4424
4425 <quote>
4426 <descrip>
4427 <tag/Function/Return the length of a string.
4428 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4429 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
4430 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
4431 string to which s points, not including the terminating null byte.
4432 <tag/Limits/<itemize>
4433 <item>The function is only available as fastcall function, so it may only
4434 be used in presence of a prototype.
4435 <item>When compiling with <tt/-Os/ (inline known standard functions), the
4436 function does not work correctly for strings with more than 255 characters.
4437 </itemize>
4438 <tag/Availability/ISO 9899
4439 <tag/See also/
4440 <ref id="strcpy" name="strcpy">
4441 <tag/Example/None.
4442 </descrip>
4443 </quote>
4444
4445
4446 <sect1>strlower<label id="strlower"><p>
4447
4448 <quote>
4449 <descrip>
4450 <tag/Function/Make a string lower case.
4451 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4452 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
4453 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
4454 function to each character of a string. The function will always return <tt/s/.
4455 <tag/Limits/<itemize>
4456 <item>The function is only available as fastcall function, so it may only
4457 be used in presence of a prototype.
4458 <item>The function prototype is unavailable when compiling in strict ANSI mode.
4459 <item>An alias name for this function is <tt/strlwr/.
4460 </itemize>
4461 <tag/Availability/cc65
4462 <tag/See also/
4463 <ref id="strupper" name="strupper">,
4464 <ref id="tolower" name="tolower">
4465 <tag/Example/None.
4466 </descrip>
4467 </quote>
4468
4469
4470 <sect1>strlwr<label id="strlwr"><p>
4471
4472 <quote>
4473 See <tt/strlower/.
4474 </quote>
4475
4476
4477 <sect1>strncat<label id="strncat"><p>
4478
4479 <quote>
4480 <descrip>
4481 <tag/Function/Concatentate two strings.
4482 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4483 <tag/Declaration/<tt/char* __fastcall__ strncat (char* s1, const char* s2, size_t n);/
4484 <tag/Description/The <tt/strncat/ function appends not more than n characters
4485 of the string pointed to by s2 to the end of the string pointed to by s1. The
4486 terminating null character at the end of s1 is overwritten. A terminating null
4487 character is appended to the result, even if not all of s2 is appended to s1.
4488 <tag/Limits/<itemize>
4489 <item>The function is only available as fastcall function, so it may only
4490 be used in presence of a prototype.
4491 <item>If copying takes place between objects that overlap, the behaviour
4492 is undefined.
4493 </itemize>
4494 <tag/Availability/ISO 9899
4495 <tag/See also/
4496 <ref id="strcpy" name="strcpy">,
4497 <ref id="strncat" name="strncat">,
4498 <ref id="strncpy" name="strncpy">
4499 <tag/Example/None.
4500 </descrip>
4501 </quote>
4502
4503
4504 <sect1>strncmp<label id="strncmp"><p>
4505
4506 <quote>
4507 <descrip>
4508 <tag/Function/Compare two strings.
4509 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4510 <tag/Declaration/<tt/int __fastcall__ strncmp (const char* s1, const char* s2, size_t count);/
4511 <tag/Description/The <tt/strncmp/ function compares not more than <tt/count/
4512 characters of the two strings passed as parameters. It returns a value that is
4513 less than zero if the first <tt/count/ characters of <tt/s1/ are less than
4514 <tt/s2/, zero if they are identical, and a value greater than zero they are
4515 greater.
4516 <tag/Limits/<itemize>
4517 <item>The function is only available as fastcall function, so it may only
4518 be used in presence of a prototype.
4519 </itemize>
4520 <tag/Availability/ISO 9899
4521 <tag/See also/
4522 <ref id="strcasecmp" name="strcasecmp">,
4523 <ref id="strcmp" name="strcmp">,
4524 <ref id="strcoll" name="strcoll">,
4525 <ref id="stricmp" name="stricmp">
4526 <tag/Example/None.
4527 </descrip>
4528 </quote>
4529
4530
4531 <sect1>strncpy<label id="strncpy"><p>
4532
4533 <quote>
4534 <descrip>
4535 <tag/Function/Copy part of a string.
4536 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4537 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
4538 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
4539 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
4540 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
4541 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
4542 written. The function will always return <tt/s1/.
4543 <tag/Limits/<itemize>
4544 <item>The function is only available as fastcall function, so it may only
4545 be used in presence of a prototype. If there is no null byte in the first <tt/n/
4546 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
4547 <item>If copying takes place between objects that overlap, the behaviour is
4548 undefined.
4549 </itemize>
4550 <tag/Availability/ISO 9899
4551 <tag/See also/
4552 <ref id="strcat" name="strcat">,
4553 <ref id="strcpy" name="strcpy">,
4554 <ref id="strncat" name="strncat">
4555 <tag/Example/
4556 <verb>
4557 #include <string.h>
4558
4559 static char hello[6];
4560
4561 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
4562 hello[5] = '\0';
4563 </verb>
4564 </descrip>
4565 </quote>
4566
4567
4568 <sect1>strrchr<label id="strrchr"><p>
4569
4570 <quote>
4571 <descrip>
4572 <tag/Function/Search for a character in a string.
4573 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4574 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
4575 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
4576 (converted to a char) in the string pointed to by <tt/s/. The terminating null
4577 byte is considered to be part of the string. Upon completion, the function
4578 returns a pointer to the byte, or a null pointer if the byte was not found.
4579 <tag/Limits/<itemize>
4580 <item>The function is only available as fastcall function, so it may only
4581 be used in presence of a prototype.
4582 </itemize>
4583 <tag/Availability/ISO 9899
4584 <tag/See also/
4585 <ref id="strchr" name="strchr">
4586 <tag/Example/None.
4587 </descrip>
4588 </quote>
4589
4590
4591 <sect1>strspn<label id="strspn"><p>
4592
4593 <quote>
4594 <descrip>
4595 <tag/Function/Compute the length of a substring.
4596 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4597 <tag/Declaration/<tt/size_t __fastcall__ strspn (const char* s, const char* set);/
4598 <tag/Description/The <tt/strspn/ function computes and returns the length of
4599 the substring pointed to by <tt/s/ which does consist only of characters
4600 contained in the string <tt/set/.
4601 <tag/Limits/<itemize>
4602 <item>The function is only available as fastcall function, so it may only
4603 be used in presence of a prototype.
4604 </itemize>
4605 <tag/Availability/ISO 9899
4606 <tag/See also/
4607 <ref id="strcspn" name="strcspn">,
4608 <ref id="strstr" name="strstr">
4609 <tag/Example/None.
4610 </descrip>
4611 </quote>
4612
4613
4614 <sect1>strstr<label id="strstr"><p>
4615
4616 <quote>
4617 <descrip>
4618 <tag/Function/Find a substring.
4619 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4620 <tag/Declaration/<tt/char* __fastcall__ strstr (const char* str, const char* substr);/
4621 <tag/Description/<tt/strstr/ searches for the first occurance of the string
4622 <tt/substr/ within <tt/str/. If found, it returns a pointer to the copy,
4623 otherwise it returns <tt/NULL/.
4624 <tag/Limits/<itemize>
4625 <item>The function is only available as fastcall function, so it may only
4626 be used in presence of a prototype.
4627 </itemize>
4628 <tag/Availability/ISO 9899
4629 <tag/See also/
4630 <ref id="strcspn" name="strcspn">,
4631 <ref id="strspn" name="strspn">
4632 <tag/Example/None.
4633 </descrip>
4634 </quote>
4635
4636
4637 <sect1>strtok<label id="strtok"><p>
4638
4639 <quote>
4640 <descrip>
4641 <tag/Function/Break a string into tokens.
4642 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4643 <tag/Declaration/<tt/char* __fastcall__ strtok (char* s1, const char* s2);/
4644 <tag/Description/<tt/strtok/ will break the string s1 into a sequence of
4645 tokens, which are delimited by characters from the string s2. The first call
4646 to <tt/strtok/ will return a pointer to the first token in the string s1.
4647 Following calls must pass a <tt/NULL/ pointer as s1 in order to get the next
4648 token in the string. Different sets of delimiters may be used for the
4649 subsequent calls to <tt/strtok/.
4650 <tag/Limits/<itemize>
4651 <item>The function is only available as fastcall function, so it may only
4652 be used in presence of a prototype.
4653 <item><tt/strtok/ will modify the string s1.
4654 </itemize>
4655 <tag/Availability/ISO 9899
4656 <tag/See also/
4657 <ref id="strcspn" name="strcspn">,
4658 <!-- <ref id="strpbrk" name="strpbrk"> -->
4659 <tag/Example/None.
4660 </descrip>
4661 </quote>
4662
4663
4664 <sect1>strupper<label id="strupper"><p>
4665
4666 <quote>
4667 <descrip>
4668 <tag/Function/Make a string upper case.
4669 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4670 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
4671 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
4672 function to each character of a string. The function will always return <tt/s/.
4673 <tag/Limits/<itemize>
4674 <item>The function is only available as fastcall function, so it may only
4675 be used in presence of a prototype.
4676 <item>The function prototype is unavailable when compiling in strict ANSI mode.
4677 <item>An alias name for this function is <tt/strupr/.
4678 </itemize>
4679 <tag/Availability/cc65
4680 <tag/See also/
4681 <ref id="strlower" name="strlower">
4682 <ref id="toupper" name="toupper">
4683 <tag/Example/None.
4684 </descrip>
4685 </quote>
4686
4687
4688 <sect1>strupr<label id="strupr"><p>
4689
4690 <quote>
4691 See <tt/strupper/.
4692 </quote>
4693
4694
4695 <sect1>textcolor<label id="textcolor"><p>
4696
4697 <quote>
4698 <descrip>
4699 <tag/Function/Set the text color.
4700 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4701 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
4702 <tag/Description/The function will set a new text color. It returns the old
4703 (current) text color. Text output using any <tt/conio.h/ function will use
4704 the color set by this function.
4705 <tag/Limits/<itemize>
4706 <item>Text colors are system dependent. The function may have no effect
4707 on systems where the text color cannot be changed.
4708 <item>The function is only available as fastcall function, so it may only
4709 be used in presence of a prototype.
4710 </itemize>
4711 <tag/Availability/cc65
4712 <tag/See also/
4713 <ref id="bgcolor" name="bgcolor">,
4714 <ref id="bordercolor" name="bordercolor">
4715 <tag/Example/None.
4716 </descrip>
4717 </quote>
4718
4719
4720 <sect1>time<label id="time"><p>
4721
4722 <quote>
4723 <descrip>
4724 <tag/Function/Get the time.
4725 <tag/Header/<tt/<ref id="time.h" name="time.h">/
4726 <tag/Declaration/<tt/time_t __fastcall__ time (time_t* t);/
4727 <tag/Description/The function returns the time since the 1970-01-01 00:00:00
4728 measured in seconds. If the pointer <tt/t/ is not <tt/NULL/, the function
4729 result will also be stored there. If no time is available, <tt/(time_t)-1/ is
4730 returned and <tt/errno/ is set to <tt/ENOSYS/.
4731 <tag/Limits/<itemize>
4732 <item>The function is only available as fastcall function, so it may
4733 only be used in presence of a prototype.
4734 <item>Many platforms supported by cc65 do not have a realtime clock, so the
4735 returned value may not be valid.
4736 </itemize>
4737 <tag/Availability/ISO 9899
4738 <tag/Example/None.
4739 </descrip>
4740 </quote>
4741
4742
4743 <sect1>toggle_videomode<label id="toggle_videomode"><p>
4744
4745 <quote>
4746 <descrip>
4747 <tag/Function/Toggle between 40 and 80 column mode.
4748 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
4749 <tag/Declaration/<tt/void toggle_videomode (void);/
4750 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
4751 old mode (cursor position, color and so on) are saved and restored together
4752 with the mode.
4753 <tag/Limits/<itemize>
4754 <item>The function is specific to the C128.
4755 </itemize>
4756 <tag/Availability/C128
4757 <tag/See also/
4758 <ref id="fast" name="fast">,
4759 <ref id="slow" name="slow">
4760 <tag/Example/None.
4761 </descrip>
4762 </quote>
4763
4764
4765 <sect1>tolower<label id="tolower"><p>
4766
4767 <quote>
4768 <descrip>
4769 <tag/Function/Convert a character into its lower case representation.
4770 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4771 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
4772 <tag/Description/The function returns the given character converted to lower
4773 case. If the given character is not a letter, it is returned unchanged.
4774 <tag/Limits/<itemize>
4775 <item>The function is only available as fastcall function, so it may
4776 only be used in presence of a prototype.
4777 </itemize>
4778 <tag/Availability/ISO 9899
4779 <tag/See also/
4780 <ref id="islower" name="islower">,
4781 <ref id="isupper" name="isupper">,
4782 <ref id="toupper" name="toupper">
4783 <tag/Example/None.
4784 </descrip>
4785 </quote>
4786
4787
4788 <sect1>toupper<label id="toupper"><p>
4789
4790 <quote>
4791 <descrip>
4792 <tag/Function/Convert a character into its upper case representation.
4793 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4794 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
4795 <tag/Description/The function returns the given character converted to upper
4796 case. If the given character is not a letter, it is returned unchanged.
4797 <tag/Limits/<itemize>
4798 <item>The function is only available as fastcall function, so it may
4799 only be used in presence of a prototype.
4800 </itemize>
4801 <tag/Availability/ISO 9899
4802 <tag/See also/
4803 <ref id="islower" name="islower">,
4804 <ref id="isupper" name="isupper">,
4805 <ref id="tolower" name="tolower">
4806 <tag/Example/None.
4807 </descrip>
4808 </quote>
4809
4810
4811 <sect1>ultoa<label id="ultoa"><p>
4812
4813 <quote>
4814 <descrip>
4815 <tag/Function/Convert an unsigned long integer into a string.
4816 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4817 <tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
4818 <tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
4819 string using <tt/radix/ as the base.
4820 <tag/Limits/<itemize>
4821 <item>There are no provisions to prevent a buffer overflow.
4822 <item>The function is non standard, so it is not available in strict ANSI mode.
4823 You should probably use <tt/sprintf/ instead.
4824 <item>The function is only available as fastcall function, so it may only be
4825 used in presence of a prototype.
4826 </itemize>
4827 <tag/Availability/cc65
4828 <tag/See also/
4829 <ref id="atoi" name="atoi">,
4830 <ref id="atol" name="atol">,
4831 <ref id="itoa" name="itoa">,
4832 <ref id="ltoa" name="ltoa">,
4833 <ref id="utoa" name="utoa">
4834 <tag/Example/None.
4835 </descrip>
4836 </quote>
4837
4838
4839 <sect1>unlink<label id="unlink"><p>
4840
4841 <quote>
4842 <descrip>
4843 <tag/Function/Delete a file.
4844 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
4845 <tag/Declaration/<tt/int __fastcall__ unlink (const char* name);/
4846 <tag/Description/<tt/unlink/ deletes the file with the given name. On success,
4847 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
4848 code describing the reason for the failure.
4849 <tag/Limits/
4850 <itemize>
4851 <item>The use of this function is discouraged. Please use <tt/<ref id="remove"
4852 name="remove">/ instead, which is a native ANSI C function and does the same.
4853 <item>This function is not available on all cc65 targets (depends on the
4854 availability of file I/O).
4855 <item>The function is only available as fastcall function, so it may only
4856 be used in presence of a prototype.
4857 <item>Instead of <tt/unlink/, <tt/<ref id="remove" name="remove">/ should be
4858 used, which has the same semantics, but is more portable, because it conforms
4859 to the ISO C standard.
4860 </itemize>
4861 <tag/Availability/POSIX 1003.1
4862 <tag/See also/
4863 <ref id="remove" name="remove">
4864 <tag/Example/
4865 #include &lt;stdio.h&gt;
4866 #include &lt;unistd.h&gt;
4867
4868 #define FILENAME "helloworld"
4869
4870 if (unlink (FILENAME) == 0) {
4871     printf ("We deleted %s successfully\n", FILENAME);
4872 } else {
4873     printf ("There was a problem deleting %s\n", FILENAME);
4874 }
4875 </descrip>
4876 </quote>
4877
4878
4879 <sect1>utoa<label id="utoa"><p>
4880
4881 <quote>
4882 <descrip>
4883 <tag/Function/Convert an unsigned integer into a string.
4884 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4885 <tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
4886 <tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
4887 using <tt/radix/ as the base.
4888 <tag/Limits/<itemize>
4889 <item>There are no provisions to prevent a buffer overflow.
4890 <item>The function is non standard, so it is not available in strict ANSI mode.
4891 You should probably use <tt/sprintf/ instead.
4892 <item>The function is only available as fastcall function, so it may only be
4893 used in presence of a prototype.
4894 </itemize>
4895 <tag/Availability/cc65
4896 <tag/See also/
4897 <ref id="atoi" name="atoi">,
4898 <ref id="atol" name="atol">,
4899 <ref id="itoa" name="itoa">,
4900 <ref id="ltoa" name="ltoa">,
4901 <ref id="ultoa" name="ultoa">
4902 <tag/Example/None.
4903 </descrip>
4904 </quote>
4905
4906
4907 <sect1>vcprintf<label id="vcprintf"><p>
4908
4909 <quote>
4910 <descrip>
4911 <tag/Function/Formatted output to the console.
4912 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4913 <tag/Declaration/<tt/int __fastcall__ vcprintf (const char* format, va_list ap);/
4914 <tag/Description/The arguments specified as a <tt/va_list/ are converted to
4915 text where necessary and formatted according to the format string given. The
4916 resulting string is output to the console. <tt/vcprintf/ supports the same
4917 format specifiers as <tt/vprintf/. <!-- <tt/<ref id="vprintf" name="vprintf">/. -->
4918 <tag/Limits/<itemize>
4919 <item>Like all other <tt/conio/ output functions, <tt/vcprintf/ distinguishes
4920 between <tt/\r/ and <tt/\n/.
4921 <item>The function is only available as fastcall function, so it may only be
4922 used in presence of a prototype.
4923 </itemize>
4924 <tag/Availability/cc65
4925 <tag/See also/
4926 <ref id="cprintf" name="cprintf">,
4927 <ref id="cputc" name="cputc">,
4928 <ref id="cputcxy" name="cputcxy">,
4929 <ref id="cputs" name="cputs">,
4930 <ref id="cputsxy" name="cputsxy">
4931 <tag/Example/None.
4932 </descrip>
4933 </quote>
4934
4935
4936 <sect1>wherex<label id="wherex"><p>
4937
4938 <quote>
4939 <descrip>
4940 <tag/Function/Return the current X position of the text mode cursor.
4941 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4942 <tag/Declaration/<tt/unsigned char wherex (void);/
4943 <tag/Description/The function returns the current X position of the text mode
4944 cursor. Zero is returned for the leftmost screen position.
4945 <tag/Availability/cc65
4946 <tag/See also/
4947 <ref id="gotox" name="gotox">,
4948 <ref id="gotoy" name="gotoy">,
4949 <ref id="gotoxy" name="gotoxy">,
4950 <ref id="wherey" name="wherey">
4951 <tag/Example/None.
4952 </descrip>
4953 </quote>
4954
4955
4956 <sect1>wherey<label id="wherey"><p>
4957
4958 <quote>
4959 <descrip>
4960 <tag/Function/Return the current Y position of the text mode cursor.
4961 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4962 <tag/Declaration/<tt/unsigned char wherey (void);/
4963 <tag/Description/The function returns the current Y position of the text mode
4964 cursor. Zero is returned for the uppermost screen position.
4965 <tag/Availability/cc65
4966 <tag/See also/
4967 <ref id="gotox" name="gotox">,
4968 <ref id="gotoy" name="gotoy">,
4969 <ref id="gotoxy" name="gotoxy">,
4970 <ref id="wherex" name="wherex">
4971 <tag/Example/None.
4972 </descrip>
4973 </quote>
4974
4975
4976 </article>
4977
4978