]> git.sur5r.net Git - cc65/blob - doc/funcref.sgml
More functions
[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
68 <sect1><tt/atari.h/<label id="atari.h"><p>
69
70
71 <sect1><tt/atmos.h/<label id="atmos.h"><p>
72
73
74 <sect1><tt/assert.h/<label id="assert.h"><p>
75
76 <itemize>
77 <item><ref id="assert" name="assert">
78 </itemize>
79
80
81 <sect1><tt/c128.h/<label id="c128.h"><p>
82
83 <itemize>
84 <item><ref id="c64mode" name="c64mode">
85 <item><ref id="fast" name="fast">
86 <item><ref id="toggle_videomode" name="toggle_videomode">
87 <item><ref id="slow" name="slow">
88 </itemize>
89
90
91 <sect1><tt/c16.h/<label id="c16.h"><p>
92
93
94 <sect1><tt/c64.h/<label id="c64.h"><p>
95
96
97 <sect1><tt/conio.h/<label id="conio.h"><p>
98
99 <itemize>
100 <item><ref id="bgcolor" name="bgcolor">
101 <item><ref id="bordercolor" name="bordercolor">
102 <item><ref id="cclear" name="cclear">
103 <item><ref id="cclearxy" name="cclearxy">
104 <item><ref id="cgetc" name="cgetc">
105 <item><ref id="chline" name="chline">
106 <item><ref id="chlinexy" name="chlinexy">
107 <item><ref id="clrscr" name="clrscr">
108 <!-- <item><ref id="cprintf" name="cprintf"> -->
109 <!-- <item><ref id="cputc" name="cputc"> -->
110 <!-- <item><ref id="cputcxy" name="cputcxy"> -->
111 <!-- <item><ref id="cputs" name="cputs"> -->
112 <!-- <item><ref id="cputsxy" name="cputsxy"> -->
113 <item><ref id="cursor" name="cursor">
114 <item><ref id="cvline" name="cvline">
115 <item><ref id="cvlinexy" name="cvlinexy">
116 <item><ref id="gotox" name="gotox">
117 <item><ref id="gotoxy" name="gotoxy">
118 <item><ref id="gotoy" name="gotoy">
119 <item><ref id="kbhit" name="kbhit">
120 <item><ref id="revers" name="revers">
121 <item><ref id="screensize" name="screensize">
122 <item><ref id="textcolor" name="textcolor">
123 <!-- <item><ref id="vcprintf" name="vcprintf"> -->
124 <item><ref id="wherex" name="wherex">
125 <item><ref id="wherey" name="wherey">
126 </itemize>
127
128
129 <sect1><tt/ctype.h/<label id="ctype.h"><p>
130
131 <itemize>
132 <item><ref id="isalnum" name="isalnum">
133 <item><ref id="isalpha" name="isalpha">
134 <item><ref id="isascii" name="isascii">
135 <item><ref id="isblank" name="isblank">
136 <item><ref id="iscntrl" name="iscntrl">
137 <item><ref id="isdigit" name="isdigit">
138 <item><ref id="isgraph" name="isgraph">
139 <item><ref id="islower" name="islower">
140 <item><ref id="isprint" name="isprint">
141 <item><ref id="ispunct" name="ispunct">
142 <item><ref id="isspace" name="isspace">
143 <item><ref id="isupper" name="isupper">
144 <item><ref id="isxdigit" name="isxdigit">
145 <item><ref id="tolower" name="tolower">
146 <item><ref id="toupper" name="toupper">
147 </itemize>
148
149
150 <sect1><tt/dbg.h/<label id="dbg.h"><p>
151
152
153 <sect1><tt/dio.h/<label id="dio.h"><p>
154
155
156 <sect1><tt/em.h/<label id="em.h"><p>
157
158 <itemize>
159 <item><ref id="em_commit" name="em_commit">
160 <item><ref id="em_copyfrom" name="em_copyfrom">
161 <item><ref id="em_copyto" name="em_copyto">
162 <item><ref id="em_load_driver" name="em_load_driver">
163 <item><ref id="em_map" name="em_map">
164 <item><ref id="em_pagecount" name="em_pagecount">
165 <item><ref id="em_unload" name="em_unload">
166 <item><ref id="em_use" name="em_use">
167 </itemize>
168
169
170 <sect1><tt/errno.h/<label id="errno.h"><p>
171
172
173 <sect1><tt/fcntl.h/<label id="fcntl.h"><p>
174
175 <itemize>
176 <item><ref id="close" name="close">
177 <item><ref id="creat" name="creat">
178 <item><ref id="open" name="open">
179 </itemize>
180
181
182 <sect1><tt/geos.h/<label id="geos.h"><p>
183
184
185 <sect1><tt/joystick.h/<label id="joystick.h"><p>
186
187
188 <sect1><tt/locale.h/<label id="locale.h"><p>
189
190 <itemize>
191 <item><ref id="localeconv" name="localeconv">
192 <item><ref id="setlocale" name="setlocale">
193 </itemize>
194
195
196 <sect1><tt/modload.h/<label id="modload.h"><p>
197
198
199 <sect1><tt/nes.h/<label id="nes.h"><p>
200
201
202 <sect1><tt/o65.h/<label id="o65.h"><p>
203
204
205 <sect1><tt/peekpoke.h/<label id="peekpoke.h"><p>
206
207 <itemize>
208 <item><ref id="PEEK" name="PEEK">
209 <item><ref id="PEEKW" name="PEEKW">
210 <item><ref id="POKE" name="POKE">
211 <item><ref id="POKEW" name="POKEW">
212 </itemize>
213
214
215 <sect1><tt/pet.h/<label id="pet.h"><p>
216
217
218 <sect1><tt/plus4.h/<label id="plus4.h"><p>
219
220
221 <sect1><tt/serial.h/<label id="serial.h"><p>
222
223
224 <sect1><tt/setjmp.h/<label id="setjmp.h"><p>
225
226
227 <sect1><tt/signal.h/<label id="signal.h"><p>
228
229 <itemize>
230 <item><ref id="raise" name="raise">
231 <item><ref id="signal" name="signal">
232 </itemize>
233
234
235 <sect1><tt/stdarg.h/<label id="stdarg.h"><p>
236
237
238 <sect1><tt/stdbool.h/<label id="stdbool.h"><p>
239
240
241 <sect1><tt/stddef.h/<label id="stddef.h"><p>
242
243 <itemize>
244 <item><ref id="offsetof" name="offsetof">
245 </itemize>
246
247
248 <sect1><tt/stdio.h/<label id="stdio.h"><p>
249
250
251 <sect1><tt/stdlib.h/<label id="stdlib.h"><p>
252
253 <itemize>
254 <item><ref id="_heapadd" name="_heapadd">
255 <item><ref id="_heapmaxavail" name="_heapmaxavail">
256 <item><ref id="_heapmemavail" name="_heapmemavail">
257 <item><ref id="_randomize" name="_randomize">
258 <item><ref id="_swap" name="_swap">
259 <item><ref id="abort" name="abort">
260 <item><ref id="abs" name="abs">
261 <item><ref id="atexit" name="atexit">
262 <item><ref id="atoi" name="atoi">
263 <item><ref id="atol" name="atol">
264 <!-- <item><ref id="bsearch" name="bsearch"> -->
265 <item><ref id="calloc" name="calloc">
266 <!-- <item><ref id="div" name="div"> -->
267 <item><ref id="exit" name="exit">
268 <item><ref id="free" name="free">
269 <item><ref id="getenv" name="getenv">
270 <item><ref id="itoa" name="itoa">
271 <item><ref id="labs" name="labs">
272 <item><ref id="ltoa" name="ltoa">
273 <item><ref id="malloc" name="malloc">
274 <!-- <item><ref id="qsort" name="qsort"> -->
275 <item><ref id="rand" name="rand">
276 <item><ref id="realloc" name="realloc">
277 <item><ref id="srand" name="srand">
278 <item><ref id="ultoa" name="ultoa">
279 <item><ref id="utoa" name="utoa">
280 </itemize>
281
282
283 <sect1><tt/string.h/<label id="string.h"><p>
284
285 <itemize>
286 <!-- <item><ref id="_stroserror" name="_stroserror"> -->
287 <item><ref id="bzero" name="bzero">
288 <!-- <item><ref id="memchr" name="memchr"> -->
289 <item><ref id="memcpy" name="memcpy">
290 <item><ref id="memmove" name="memmove">
291 <item><ref id="memset" name="memset">
292 <item><ref id="strcasecmp" name="strcasecmp">
293 <item><ref id="strcat" name="strcat">
294 <item><ref id="strchr" name="strchr">
295 <item><ref id="strcmp" name="strcmp">
296 <item><ref id="strcoll" name="strcoll">
297 <item><ref id="strcpy" name="strcpy">
298 <!-- <item><ref id="strcspn" name="strcspn"> -->
299 <!-- <item><ref id="strdup" name="strdup"> -->
300 <!-- <item><ref id="strerror" name="strerror"> -->
301 <item><ref id="stricmp" name="stricmp">
302 <item><ref id="strlen" name="strlen">
303 <item><ref id="strlower" name="strlower">
304 <item><ref id="strlwr" name="strlwr">
305 <!-- <item><ref id="strncat" name="strncat"> -->
306 <!-- <item><ref id="strncmp" name="strncmp"> -->
307 <item><ref id="strncpy" name="strncpy">
308 <item><ref id="strrchr" name="strrchr">
309 <!-- <item><ref id="strspn" name="strspn"> -->
310 <!-- <item><ref id="strstr" name="strstr"> -->
311 <!-- <item><ref id="strtok" name="strtok"> -->
312 <!-- <item><ref id="strxfrm" name="strxfrm"> -->
313 <item><ref id="strupper" name="strupper">
314 <item><ref id="strupr" name="strupr">
315 </itemize>
316
317
318 <sect1><tt/tgi.h/<label id="tgi.h"><p>
319
320
321 <sect1><tt/time.h/<label id="time.h"><p>
322                            
323 <!--
324 <itemize>
325 <item><ref id="_systime" name="_systime">
326 <item><ref id="asctime" name="asctime">
327 <item><ref id="clock" name="clock">
328 <item><ref id="ctime" name="ctime">
329 <item><ref id="gmtime" name="gmtime">
330 <item><ref id="localtime" name="localtime">
331 <item><ref id="mktime" name="mktime">
332 <item><ref id="strftime" name="strftime">
333 <item><ref id="time" name="time">
334 </itemize>
335 -->    
336
337
338 <sect1><tt/unistd.h/<label id="unistd.h"><p>
339
340 <itemize>
341 <!-- <item><ref id="chdir" name="chdir"> -->
342 <!-- <item><ref id="getcwd" name="getcwd"> -->
343 <!-- <item><ref id="lseek" name="lseek"> -->
344 <!-- <item><ref id="mkdir" name="mkdir"> -->
345 <!-- <item><ref id="read" name="read"> -->
346 <!-- <item><ref id="rmdir" name="rmdir"> -->
347 <item><ref id="sleep" name="sleep">
348 <!-- <item><ref id="unlink" name="unlink"> -->
349 <!-- <item><ref id="write" name="write"> -->
350 </itemize>
351
352
353 <sect1><tt/vic20.h/<label id="vic20.h"><p>
354
355
356 <sect1><tt/zlib.h/<label id="zlib.h"><p>
357
358
359
360
361 <sect>Alphabetical function reference<p>
362
363 <sect1>_heapadd<label id="_heapadd"><p>
364
365 <quote>
366 <descrip>
367 <tag/Function/Add a block to the heap.
368 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
369 <tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
370 <tag/Description/The function adds a block of raw memory to the heap.
371 <tag/Limits/
372 <itemize>
373 <item>The minimum blocksize that can be added is 6 bytes; the function will
374 ignore blocks with smaller sizes.
375 </itemize>
376 <tag/Availability/cc65
377 <tag/See also/
378 <ref id="_heapmaxavail" name="_heapmaxavail">,
379 <ref id="_heapmemavail" name="_heapmemavail">,
380 <ref id="calloc" name="calloc">,
381 <ref id="free" name="free">,
382 <ref id="malloc" name="malloc">,
383 <ref id="realloc" name="realloc">
384 <tag/Example/None.
385 </descrip>
386 </quote>
387
388
389 <sect1>_heapmaxavail<label id="_heapmaxavail"><p>
390
391 <quote>
392 <descrip>
393 <tag/Function/Return the largest block that is available on the heap.
394 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
395 <tag/Declaration/<tt/size_t __fastcall__ _heapmaxavail (void);/
396 <tag/Description/The function returns the size of the largest block that may
397 be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
398 <tag/Availability/cc65
399 <tag/See also/
400 <ref id="_heapadd" name="_heapadd">,
401 <ref id="_heapmemavail" name="_heapmemavail">,
402 <ref id="calloc" name="calloc">,
403 <ref id="free" name="free">,
404 <ref id="malloc" name="malloc">,
405 <ref id="realloc" name="realloc">
406 <tag/Example/None.
407 </descrip>
408 </quote>
409
410
411 <sect1>_heapmemavail<label id="_heapmemavail"><p>
412
413 <quote>
414 <descrip>
415 <tag/Function/Return the total available space on the heap.
416 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
417 <tag/Declaration/<tt/size_t __fastcall__ _heapmemavail (void);/
418 <tag/Description/The function returns the total number of bytes available on
419 the heap.
420 <tag/Limits/
421 <itemize>
422 <item>This function is of less use than usually assumed, since the returned
423 heap space may be available but not in one block. So even if this function
424 says that several times more heap space is available than needed, <ref
425 id="malloc" name="malloc"> may still return <tt/NULL/.
426 </itemize>
427 <tag/Availability/cc65
428 <tag/See also/
429 <ref id="_heapadd" name="_heapadd">,
430 <ref id="_heapmaxavail" name="_heapmaxavail">,
431 <ref id="calloc" name="calloc">,
432 <ref id="free" name="free">,
433 <ref id="malloc" name="malloc">,
434 <ref id="realloc" name="realloc">
435 <tag/Example/None.
436 </descrip>
437 </quote>
438
439
440 <sect1>_randomize<label id="_randomize"><p>
441
442 <quote>
443 <descrip>
444 <tag/Function/Initialize the pseudo random number generator.
445 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
446 <tag/Declaration/<tt/void _randomize (void);/
447 <tag/Description/The function initializes the random number generator with
448 a seed derived from fast changing hardware events, so the seed itself can be
449 considered random to a certain degree.
450 <tag/Limits/<itemize>
451 <item>The randomness of the seed depends on the machine hardware.
452 </itemize>
453 <tag/Availability/cc65
454 <tag/See also/
455 <ref id="rand" name="rand">,
456 <ref id="srand" name="srand">
457 <tag/Example/None.
458 </descrip>
459 </quote>
460
461
462 <sect1>_swap<label id="_swap"><p>
463
464 <quote>
465 <descrip>
466 <tag/Function/Swap the contents of memory areas.
467 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
468 <tag/Declaration/<tt/void __fastcall__ _swap (void* p, void* q, size_t size);/
469 <tag/Description/<tt/_swap/ will swap (exchange) the contents of the two memory
470 areas pointed to by <tt/p/ and <tt/q/. Both memory areas are assumed to be
471 <tt/size/ bytes in size.
472 <tag/Limits/<itemize>
473 <item>The memory areas may not overlap, otherwise the results are undefined.
474 <item>The function is only available as fastcall function, so it may only be
475 used in presence of a prototype.
476 </itemize>
477 <tag/Availability/cc65
478 <tag/See also/
479 <ref id="memcpy" name="memcpy">,
480 <ref id="memmove" name="memmove">
481 <tag/Example/None.
482 </descrip>
483 </quote>
484
485
486 <sect1>_sys<label id="_sys"><p>
487
488 <quote>
489 <descrip>
490 <tag/Function/Call a subroutine passing register values.
491 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
492 <tag/Declaration/<tt/void __fastcall__ _sys (struct regs* r);/
493 <tag/Description/The function will call the subroutine at the address
494 specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
495 registers and the CPU flags are set to the values given in the <tt/regs/
496 structure. On return from the subroutine, the new values of the registers and
497 flags are stored back overwriting the old values.
498 <tag/Limits/<itemize>
499 <item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
500 when calling the subroutine (they are unchanged from their current values).
501 <item>The function is only available as fastcall function, so it may only be
502 used in presence of a prototype.
503 </itemize>
504 <tag/Availability/cc65
505 <tag/Example/None.
506 </descrip>
507 </quote>
508
509
510 <sect1>BRK<label id="BRK"><p>
511
512 <quote>
513 <descrip>
514 <tag/Function/Insert a 6502 BRK instrunction into the code.
515 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
516 <tag/Declaration/<tt/void BRK (void);/
517 <tag/Description/The function will insert a 6502 BRK instruction into the code
518 which may be used to trigger a debugger.
519 <tag/Limits/<itemize>
520 <item>The function is actually a macro.
521 <item>The inserted instruction may lead to unexpected results if no debugger
522 is present.
523 </itemize>
524 <tag/Availability/cc65
525 <tag/See also/
526 <ref id="CLI" name="CLI">,
527 <ref id="SEI" name="SEI">
528 <tag/Example/None.
529 </descrip>
530 </quote>
531
532
533 <sect1>CLI<label id="CLI"><p>
534
535 <quote>
536 <descrip>
537 <tag/Function/Insert a 6502 CLI instrunction into the code.
538 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
539 <tag/Declaration/<tt/void CLI (void);/
540 <tag/Description/The function will insert a 6502 CLI instruction into the code,
541 so interrupts are disabled. Note that non maskable interrupts cannot be
542 disabled.
543 <tag/Limits/<itemize>
544 <item>The function is actually a macro.
545 <item>Disabling interrupts may lead to unexpected results.
546 </itemize>
547 <tag/Availability/cc65
548 <tag/See also/
549 <ref id="BRK" name="BRK">,
550 <ref id="SEI" name="SEI">
551 <tag/Example/None.
552 </descrip>
553 </quote>
554
555
556 <sect1>PEEK<label id="PEEK"><p>
557
558 <quote>
559 <descrip>
560 <tag/Function/Read a byte from memory.
561 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
562 <tag/Declaration/<tt/unsigned char PEEK (unsigned addr);/
563 <tag/Description/The function will read the absolute memory given by <tt/addr/
564 and return the value read.
565 <tag/Limits/<itemize>
566 <item>The function is actually a macro.
567 <item>This function depends highly on the platform and environment.
568 </itemize>
569 <tag/Availability/cc65
570 <tag/See also/
571 <ref id="PEEKW" name="PEEKW">,
572 <ref id="POKE" name="POKE">
573 <tag/Example/None.
574 </descrip>
575 </quote>
576
577
578 <sect1>PEEKW<label id="PEEKW"><p>
579
580 <quote>
581 <descrip>
582 <tag/Function/Read a word (two bytes) from memory.
583 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
584 <tag/Declaration/<tt/unsigned PEEKW (unsigned addr);/
585 <tag/Description/The function will read the absolute memory given by <tt/addr/
586 and return the value read. The byte read from the higher address is the high
587 byte of the return value.
588 <tag/Limits/<itemize>
589 <item>The function is actually a macro.
590 <item>This function depends highly on the platform and environment.
591 <item>The order in which the two bytes are read is unspecified and may
592 depend of the address expression used.
593 </itemize>
594 <tag/Availability/cc65
595 <tag/See also/
596 <ref id="PEEK" name="PEEK">,
597 <ref id="POKE" name="POKE">
598 <tag/Example/None.
599 </descrip>
600 </quote>
601
602
603 <sect1>POKE<label id="POKE"><p>
604
605 <quote>
606 <descrip>
607 <tag/Function/Write a byte to memory.
608 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
609 <tag/Declaration/<tt/void POKE (unsigned addr, unsigned char val);/
610 <tag/Description/The function writes the value <tt/val/ to the absolute
611 memory address given by <tt/addr/.
612 <tag/Limits/<itemize>
613 <item>The function is actually a macro.
614 <item>This function depends highly on the platform and environment.
615 <item>Careless use will cause the program to act strange or may crash the
616 machine.
617 </itemize>
618 <tag/Availability/cc65
619 <tag/See also/
620 <ref id="PEEK" name="PEEK">,
621 <ref id="POKEW" name="POKEW">
622 <tag/Example/None.
623 </descrip>
624 </quote>
625
626
627 <sect1>POKEW<label id="POKEW"><p>
628
629 <quote>
630 <descrip>
631 <tag/Function/Write a word (two bytes) to memory.
632 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
633 <tag/Declaration/<tt/void POKEW (unsigned addr, unsigned val);/
634 <tag/Description/The function writes the value <tt/val/ to the absolute
635 memory address given by <tt/addr/. The low byte of <tt/val/ is written to
636 the <tt/addr/, the high byte is written to <tt/addr+1/.
637 <tag/Limits/<itemize>
638 <item>The function is actually a macro.
639 <item>This function depends highly on the platform and environment.
640 <item>Careless use will cause the program to act strange or may crash the
641 machine.
642 <item>The order in which the two bytes are written is unspecified and may
643 depend of the address expression used.
644 </itemize>
645 <tag/Availability/cc65
646 <tag/See also/
647 <ref id="PEEK" name="PEEK">,
648 <ref id="POKE" name="POKE">
649 <tag/Example/None.
650 </descrip>
651 </quote>
652
653
654 <sect1>SEI<label id="SEI"><p>
655
656 <quote>
657 <descrip>
658 <tag/Function/Insert a 6502 SEI instrunction into the code.
659 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
660 <tag/Declaration/<tt/void SEI (void);/
661 <tag/Description/The function will insert a 6502 SEI instruction into the code,
662 so interrupts are enabled. Enabling interrupts has no effects if they are
663 already enabled (the default).
664 <tag/Limits/<itemize>
665 <item>The function is actually a macro.
666 </itemize>
667 <tag/Availability/cc65
668 <tag/See also/
669 <ref id="BRK" name="BRK">,
670 <ref id="CLI" name="CLI">
671 <tag/Example/None.
672 </descrip>
673 </quote>
674
675
676 <sect1>abort<label id="abort"><p>
677
678 <quote>
679 <descrip>
680 <tag/Function/Terminates a program abnormally.
681 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
682 <tag/Declaration/<tt/void abort (void);/
683 <tag/Description/<tt/abort/ raises <tt/SIGABRT/, writes a termination message
684 on stderr, then terminates the program with an exit code of 3.
685 <tag/Availability/ISO 9899
686 <tag/See also/
687 <ref id="assert" name="assert">,
688 <ref id="exit" name="exit">,
689 <ref id="raise" name="raise">
690 <tag/Example/None.
691 </descrip>
692 </quote>
693
694
695 <sect1>abs<label id="abs"><p>
696
697 <quote>
698 <descrip>
699 <tag/Function/Returns the absolute value of an integer.
700 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
701 <tag/Declaration/<tt/int __fastcall__ abs (int v);/
702 <tag/Description/<tt/abs/ returns the absolute value of the argument passed to
703 the function.
704 <tag/Limits/<itemize>
705 <item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
706 <item>The function is only available as fastcall function, so it may only be
707 used in presence of a prototype.
708 </itemize>
709 <tag/Availability/ISO 9899
710 <tag/See also/
711 <ref id="labs" name="labs">
712 <tag/Example/None.
713 </descrip>
714 </quote>
715
716
717 <sect1>assert<label id="assert"><p>
718
719 <quote>
720 <descrip>
721 <tag/Function/Test a condition and possibly abort.
722 <tag/Header/<tt/<ref id="assert.h" name="assert.h">/
723 <tag/Declaration/<tt/void assert (int cond);/
724 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
725 statement. If the condition evaluates t zero (false), assert prints a message
726 on stderr and aborts the program.
727 <tag/Limits/<itemize>
728 <item>The function is actually a macro.
729 </itemize>
730 <tag/Availability/ISO 9899
731 <tag/See also/
732 <ref id="abort" name="abort">,
733 <ref id="exit" name="exit">
734 <tag/Example/None.
735 </descrip>
736 </quote>
737
738
739 <sect1>atexit<label id="atexit"><p>
740
741 <quote>
742 <descrip>
743 <tag/Function/Register an exit function.
744 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
745 <tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
746 <tag/Description/<tt/atexit/ registers the function pointed to by
747 <tt/exitfunc/ as an exit function. Exit functions are called when the program
748 terminates, they are called in LIFO order (the last function registered is
749 called first). <tt/atexit/ returns zero on success and a nonzero value on
750 failure.
751 <tag/Limits/<itemize>
752 <item>A maximum of 5 exit functions can be registered.
753 <item>There is no way to unregister an exit function.
754 <item>The function is only available as fastcall function, so it may only be
755 used in presence of a prototype.
756 </itemize>
757 <tag/Availability/ISO 9899
758 <tag/See also/
759 <ref id="abort" name="abort">,
760 <ref id="exit" name="exit">
761 <tag/Example/None.
762 </descrip>
763 </quote>
764
765
766 <sect1>atoi<label id="atoi"><p>
767
768 <quote>
769 <descrip>
770 <tag/Function/Convert a string to an integer.
771 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
772 <tag/Declaration/<tt/int __fastcall__ atoi (const char* s);/
773 <tag/Description/<tt/atoi/ converts the given string into an integer.
774 Conversion stops as soon as any invalid character is encountered.
775 <tag/Limits/<itemize>
776 <item>There is no way to detect any conversion errors.
777 <item>The function does not check for an numerical overflow when converting.
778 <item>The function is only available as fastcall function, so it may only be
779 used in presence of a prototype.
780 </itemize>
781 <tag/Availability/ISO 9899
782 <tag/See also/
783 <ref id="atol" name="atol">,
784 <ref id="itoa" name="itoa">,
785 <ref id="ltoa" name="ltoa">,
786 <ref id="ultoa" name="ultoa">,
787 <ref id="utoa" name="utoa">
788 <tag/Example/None.
789 </descrip>
790 </quote>
791
792
793 <sect1>atol<label id="atol"><p>
794
795 <quote>
796 <descrip>
797 <tag/Function/Convert a string to a long integer.
798 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
799 <tag/Declaration/<tt/long __fastcall__ atol (const char* s);/
800 <tag/Description/<tt/atol/ converts the given string into a long integer.
801 Conversion stops as soon as any invalid character is encountered.
802 <tag/Limits/<itemize>
803 <item>There is no way to detect any conversion errors.
804 <item>The function does not check for an numerical overflow when converting.
805 <item>The function is only available as fastcall function, so it may only be
806 used in presence of a prototype.
807 </itemize>
808 <tag/Availability/ISO 9899
809 <tag/See also/
810 <ref id="atoi" name="atoi">,
811 <ref id="itoa" name="itoa">,
812 <ref id="ltoa" name="ltoa">,
813 <ref id="ultoa" name="ultoa">,
814 <ref id="utoa" name="utoa">
815 <tag/Example/None.
816 </descrip>
817 </quote>
818
819
820 <sect1>bgcolor<label id="bgcolor"><p>
821
822 <quote>
823 <descrip>
824 <tag/Function/Set the background text color.
825 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
826 <tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
827 <tag/Description/The function will set a new background text color. It returns
828 the old (current) background color.
829 <tag/Limits/<itemize>
830 <item>Background colors are system dependent. The function may have no effect
831 on systems where the background color cannot be changed.
832 <item>The function is only available as fastcall function, so it may only be
833 used in presence of a prototype.
834 </itemize>
835 <tag/Availability/cc65
836 <tag/See also/
837 <ref id="bordercolor" name="bordercolor">,
838 <ref id="textcolor" name="textcolor">
839 <tag/Example/None.
840 </descrip>
841 </quote>
842
843
844 <sect1>bordercolor<label id="bordercolor"><p>
845
846 <quote>
847 <descrip>
848 <tag/Function/Set the border (frame) color.
849 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
850 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
851 <tag/Description/The function will set a new border color. It returns the old
852 (current) border color.
853 <tag/Limits/<itemize>
854 <item>Border colors are system dependent. The function may have no effect
855 on systems where the border color cannot be changed.
856 <item>The function is only available as fastcall function, so it may only
857 be used in presence of a prototype.
858 </itemize>
859 <tag/Availability/cc65
860 <tag/See also/
861 <ref id="bgcolor" name="bgcolor">,
862 <ref id="textcolor" name="textcolor">
863 <tag/Example/None.
864 </descrip>
865 </quote>
866
867
868 <sect1>bzero<label id="bzero"><p>
869
870 <quote>
871 <descrip>
872 <tag/Function/Fill a memory area with zeroes.
873 <tag/Header/<tt/<ref id="string.h" name="string.h">/
874 <tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
875 <tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
876 zero.
877 <tag/Limits/
878 <itemize>
879 <item>The function is non standard and therefore only available in non ANSI
880 mode. You should use <tt/<ref id="memset" name="memset">/ instead.
881 <item>The function is only available as fastcall function, so it may only
882 be used in presence of a prototype.
883 </itemize>
884 <tag/Availability/cc65
885 <tag/See also/
886 <ref id="_swap" name="_swap">,
887 <ref id="memcpy" name="memcpy">,
888 <ref id="memmove" name="memmove">,
889 <ref id="memset" name="memset">,
890 <tag/Example/None.
891 </descrip>
892 </quote>
893
894
895 <sect1>c64mode<label id="c64mode"><p>
896
897 <quote>
898 <descrip>
899 <tag/Function/Switch the C128 into C64 compatible mode.
900 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
901 <tag/Declaration/<tt/void c64mode (void);/
902 <tag/Description/The function will cause the machine to reboot into C64 mode.
903 <tag/Limits/<itemize>
904 <item>The function is specific to the C128.
905 <item>The function will not return to the caller.
906 </itemize>
907 <tag/Availability/C128
908 <tag/Example/None.
909 </descrip>
910 </quote>
911
912
913 <sect1>calloc<label id="calloc"><p>
914
915 <quote>
916 <descrip>
917 <tag/Function/Allocate and clear memory.
918 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
919 <tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
920 <tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
921 of size <tt/size/, clears the whole block with binary zeroes and returns a
922 pointer to it. On error (not enough memory available), <tt/calloc/ returns
923 <tt/NULL/.
924 <tag/Limits/
925 <itemize>
926 <item>Clearing the memory may not have the expected effect on all platforms:
927 pointers in the block may not be <tt/NULL/ and floating point variables may
928 not be zero (0.0). In other words: The "clearing" effect of this function
929 should be used with care for portable programs.
930 <item>The function is only available as fastcall function, so it may only
931 be used in presence of a prototype.
932 </itemize>
933 <tag/Availability/ISO 9899
934 <tag/See also/
935 <ref id="_heapadd" name="_heapadd">,
936 <ref id="_heapmaxavail" name="_heapmaxavail">,
937 <ref id="_heapmemavail" name="_heapmemavail">,
938 <ref id="free" name="free">,
939 <ref id="malloc" name="malloc">,
940 <ref id="realloc" name="realloc">
941 <tag/Example/None.
942 </descrip>
943 </quote>
944
945
946 <sect1>cclear<label id="cclear"><p>
947
948 <quote>
949 <descrip>
950 <tag/Function/Clear part of a line (write a given amount of spaces).
951 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
952 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
953 <tag/Description/The function clears part of a line by writing <tt/length/
954 spaces in the current text color.
955 <tag/Limits/<itemize>
956 <item>The function is only available as fastcall function, so it may
957 only be used in presence of a prototype.
958 </itemize>
959 <tag/Availability/cc65
960 <tag/See also/
961 <ref id="cclearxy" name="cclearxy">,
962 <ref id="clrscr" name="clrscr">
963 <tag/Example/None.
964 </descrip>
965 </quote>
966
967
968 <sect1>cclearxy<label id="cclearxy"><p>
969
970 <quote>
971 <descrip>
972 <tag/Function/Clear part of a line (write a given amount of spaces) starting
973 at a specific screen position.
974 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
975 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char length);/
976 <tag/Description/The function moves the cursor to a specific position, and
977 will then clear part of the line by writing <tt/length/ spaces in the current
978 text color.
979 <tag/Limits/<itemize>
980 <item>The function is only available as fastcall function, so it may
981 only be used in presence of a prototype.
982 </itemize>
983 <tag/Availability/cc65
984 <tag/See also/
985 <ref id="cclear" name="cclear">,
986 <ref id="clrscr" name="clrscr">
987 <tag/Example/None.
988 </descrip>
989 </quote>
990
991
992 <sect1>cgetc<label id="cgetc"><p>
993
994 <quote>
995 <descrip>
996 <tag/Function/Read a character from the keyboard.
997 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
998 <tag/Declaration/<tt/char cgetc (void);/
999 <tag/Description/The function reads a character from the keyboard. If there is
1000 no character available, <tt/cgetc/ waits until the user presses a key. If the
1001 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
1002 displayed while waiting.
1003 <tag/Limits/<itemize>
1004 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
1005 from this buffer and wait only if the buffer is empty.
1006 </itemize>
1007 <tag/Availability/cc65
1008 <tag/See also/
1009 <ref id="cursor" name="cursor">,
1010 <ref id="kbhit" name="kbhit">
1011 <tag/Example/None.
1012 </descrip>
1013 </quote>
1014
1015
1016 <sect1>chline<label id="chline"><p>
1017
1018 <quote>
1019 <descrip>
1020 <tag/Function/Output a horizontal line in text mode.
1021 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1022 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
1023 <tag/Description/The function outputs a horizontal line with the given length
1024 starting at the current cursor position.
1025 <tag/Limits/<itemize>
1026 <item>The character used to draw the horizontal line is system dependent.
1027 If available, a line drawing character is used. Drawing a line that is partially
1028 off screen leads to undefined behaviour.
1029 <item>The function is only available as fastcall function, so it may only be
1030 used in presence of a prototype.
1031 </itemize>
1032 <tag/Availability/cc65
1033 <tag/See also/
1034 <ref id="chlinexy" name="chlinexy">,
1035 <ref id="cvline" name="cvline">,
1036 <ref id="cvlinexy" name="cvlinexy">
1037 <tag/Example/None.
1038 </descrip>
1039 </quote>
1040
1041
1042 <sect1>chlinexy<label id="chlinexy"><p>
1043
1044 <quote>
1045 <descrip>
1046 <tag/Function/Output a horizontal line at a given position in text mode.
1047 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1048 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
1049 <tag/Description/The function outputs a horizontal line with the given length
1050 starting at a given position.
1051 <tag/Limits/<itemize>
1052 <item>The character used to draw the horizontal line is system dependent.
1053 If available, a line drawing character is used. Drawing a line that is partially
1054 off screen leads to undefined behaviour.
1055 <item>The function is only available as fastcall function, so it may only be
1056 used in presence of a prototype.
1057 </itemize>
1058 <tag/Availability/cc65
1059 <tag/See also/
1060 <ref id="chline" name="chline">,
1061 <ref id="cvline" name="cvline">,
1062 <ref id="cvlinexy" name="cvlinexy">
1063 <tag/Example/None.
1064 </descrip>
1065 </quote>
1066
1067
1068 <sect1>clrscr<label id="clrscr"><p>
1069
1070 <quote>
1071 <descrip>
1072 <tag/Function/Clear the text screen.
1073 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1074 <tag/Declaration/<tt/void clrscr (void);/
1075 <tag/Description/The function clears the text screen and moves the cursor to
1076 the upper left corner.
1077 <tag/Availability/cc65
1078 <tag/See also/
1079 <ref id="cclear" name="cclear">,
1080 <ref id="cclearxy" name="cclearxy">
1081 <tag/Example/None.
1082 </descrip>
1083 </quote>
1084
1085
1086 <sect1>close<label id="close"><p>
1087
1088 <quote>
1089 <descrip>
1090 <tag/Function/Close a file descriptor.
1091 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1092 <tag/Declaration/<tt/int __fastcall__ close (int fd);/
1093 <tag/Description/The function closes the given file descriptor. It returns zero
1094 on success and -1 on error. If an error occurs, the cause can be determined by
1095 reading the <tt/errno/ variable.
1096 <tag/Limits/<itemize>
1097 <item>The function is only available as fastcall function, so it may only
1098 be used in presence of a prototype.
1099 </itemize>
1100 <tag/Availability/POSIX
1101 <tag/See also/
1102 <ref id="creat" name="creat">,
1103 <ref id="open" name="open">
1104 <tag/Example/None.
1105 </descrip>
1106 </quote>
1107
1108
1109 <sect1>creat<label id="creat"><p>
1110
1111 <quote>
1112 <descrip>
1113 <tag/Function/Create a file.
1114 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1115 <tag/Declaration/<tt/int __fastcall__ creat (const char* name, unsigned mode);/
1116 <tag/Description/<tt/creat/ creates a new file and returns the file descriptor
1117 associated with it. On error, -1 is returned and an error code is stored in
1118 <tt/errno/.
1119 <tag/Limits/<itemize>
1120 <item><tt/creat/ is identical to calling <tt/<ref id="open" name="open">/ with
1121 <tt/flags/ equal to <tt/O_WRONLY | O_CREAT | O_TRUNC/.
1122 <item>The function is only available as fastcall function, so it may only
1123 be used in presence of a prototype.
1124 </itemize>
1125 <tag/Availability/POSIX
1126 <tag/See also/
1127 <ref id="close" name="close">,
1128 <ref id="open" name="open">
1129 <tag/Example/None.
1130 </descrip>
1131 </quote>
1132
1133
1134 <sect1>cursor<label id="cursor"><p>
1135
1136 <quote>
1137 <descrip>
1138 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
1139 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1140 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
1141 <tag/Description/If the argument to the function is non zero, a blinking cursor
1142 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
1143 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
1144 <tag/Limits/<itemize>
1145 <item>The function is only available as fastcall function, so it may only
1146 be used in presence of a prototype.
1147 </itemize>
1148 <tag/Availability/cc65
1149 <tag/See also/
1150 <ref id="cgetc" name="cgetc">,
1151 <ref id="kbhit" name="kbhit">
1152 <tag/Example/None.
1153 </descrip>
1154 </quote>
1155
1156
1157 <sect1>cvline<label id="cvline"><p>
1158
1159 <quote>
1160 <descrip>
1161 <tag/Function/Output a vertical line in text mode.
1162 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1163 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
1164 <tag/Description/The function outputs a vertical line with the given length
1165 starting at the current cursor position.
1166 <tag/Limits/<itemize>
1167 <item>The character used to draw the vertical line is system dependent.
1168 If available, a line drawing character is used. Drawing a line that is partially
1169 off screen leads to undefined behaviour.
1170 <item>The function is only available as fastcall function, so it may only be
1171 used in presence of a prototype.
1172 </itemize>
1173 <tag/Availability/cc65
1174 <tag/See also/
1175 <ref id="chline" name="chline">,
1176 <ref id="chlinexy" name="chlinexy">,
1177 <ref id="cvlinexy" name="cvlinexy">
1178 <tag/Example/None.
1179 </descrip>
1180 </quote>
1181
1182
1183 <sect1>cvlinexy<label id="cvlinexy"><p>
1184
1185 <quote>
1186 <descrip>
1187 <tag/Function/Output a vertical line at a given position in text mode.
1188 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1189 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
1190 <tag/Description/The function outputs a vertical line with the given length
1191 starting at a given position.
1192 <tag/Limits/<itemize>
1193 <item>The character used to draw the vertical line is system dependent.
1194 If available, a line drawing character is used. Drawing a line that is partially
1195 off screen leads to undefined behaviour.
1196 <item>The function is only available as fastcall function, so it may only be
1197 used in presence of a prototype.
1198 </itemize>
1199 <tag/Availability/cc65
1200 <tag/See also/
1201 <ref id="chline" name="chline">,
1202 <ref id="chlinexy" name="chlinexy">,
1203 <ref id="cvline" name="cvline">
1204 <tag/Example/None.
1205 </descrip>
1206 </quote>
1207
1208
1209 <sect1>em_commit<label id="em_commit"><p>
1210
1211 <quote>
1212 <descrip>
1213 <tag/Function/Commit changes into extended memory.
1214 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1215 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
1216 <tag/Description/Commit changes in the memory window to extended storage. If
1217 the contents of the memory window have been changed, these changes may be lost
1218 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
1219 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
1220 name="em_copyto">/ are called without calling <tt/em_commit/ first.
1221 <tag/Limits/<itemize>
1222 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
1223 memory window are discarded, it does just mean that the drivers is allowed
1224 to discard it.
1225 <item>The function is only available as fastcall function, so it may only be
1226 used in presence of a prototype.
1227 <item>The function produces undefined results if no extended memory driver is
1228 loaded.
1229 </itemize>
1230 <tag/Availability/cc65
1231 <tag/See also/
1232 <ref id="em_load_driver" name="em_load_driver">,
1233 <ref id="em_map" name="em_map">,
1234 <ref id="em_use" name="em_use">
1235 <tag/Example/None.
1236 </descrip>
1237 </quote>
1238
1239
1240 <sect1>em_copyfrom<label id="em_copyfrom"><p>
1241
1242 <quote>
1243 <descrip>
1244 <tag/Function/Copy from extended into normal memory.
1245 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1246 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
1247 <tag/Description/Copy data from extended memory into linear memory. Source and
1248 target addresses as well as the number of bytes to transfer are specified in
1249 the <tt/em_copy/ structure that is passed as a parameter.
1250 <tag/Limits/<itemize>
1251 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
1252 made any changes to the data in the window, call <tt/<ref id="em_commit"
1253 name="em_commit">/ first, or the changes are lost.
1254 <item>The function is only available as fastcall function, so it may only be
1255 used in presence of a prototype.
1256 <item>The function produces undefined results if no extended memory driver is
1257 loaded.
1258 </itemize>
1259 <tag/Availability/cc65
1260 <tag/See also/
1261 <ref id="em_commit" name="em_commit">,
1262 <ref id="em_copyto" name="em_copyto">,
1263 <ref id="em_load_driver" name="em_load_driver">
1264 <tag/Example/None.
1265 </descrip>
1266 </quote>
1267
1268
1269 <sect1>em_copyto<label id="em_copyto"><p>
1270
1271 <quote>
1272 <descrip>
1273 <tag/Function/Copy from normal into extended memory.
1274 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1275 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
1276 <tag/Description/Copy data from linear into extended memory. Source and
1277 target addresses as well as the number of bytes to transfer are specified in
1278 the <tt/em_copy/ structure that is passed as a parameter.
1279 <tag/Limits/<itemize>
1280 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
1281 made any changes to the data in the window, call <tt/<ref id="em_commit"
1282 name="em_commit">/ first, or the changes are lost.
1283 <item>The function is only available as fastcall function, so it may only be
1284 used in presence of a prototype.
1285 <item>The function produces undefined results if no extended memory driver is
1286 loaded.
1287 </itemize>
1288 <tag/Availability/cc65
1289 <tag/See also/
1290 <ref id="em_commit" name="em_commit">,
1291 <ref id="em_copyfrom" name="em_copyfrom">,
1292 <ref id="em_load_driver" name="em_load_driver">
1293 <tag/Example/None.
1294 </descrip>
1295 </quote>
1296
1297
1298 <sect1>em_load_driver<label id="em_load_driver"><p>
1299
1300 <quote>
1301 <descrip>
1302 <tag/Function/Load and initialize an extended memory driver.
1303 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1304 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
1305 <tag/Description/Load an extended memory driver into memory and initialize
1306 it. The function returns an error code that tells if all this has been
1307 successful.
1308 <tag/Limits/<itemize>
1309 <item>Not all drivers are able to detect if the supported hardware is really
1310 present.
1311 <item>The function is only available as fastcall function, so it may only be
1312 used in presence of a prototype.
1313 <item>The driver is loaded by name, so currently you must know the type of
1314 extended memory that should be supported. There is no autodetect capability.
1315 </itemize>
1316 <tag/Availability/cc65
1317 <tag/See also/
1318 <ref id="em_unload" name="em_unload">
1319 <tag/Example/None.
1320 </descrip>
1321 </quote>
1322
1323
1324 <sect1>em_map<label id="em_map"><p>
1325
1326 <quote>
1327 <descrip>
1328 <tag/Function/Make a page of extended memory accessible.
1329 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1330 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
1331 <tag/Description/The function maps one page of extended memory into linear
1332 memory and returns a pointer to the page frame. Depending on the hardware
1333 and driver, the data is either mapped into the address space or transfered
1334 into a buffer. If you don't need the actual contents of the page (for example
1335 because you're going to overwrite it completely, it is better to call
1336 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
1337 data if it is possible to avoid that.
1338 <tag/Limits/<itemize>
1339 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
1340 made any changes to the data in the window, call <tt/<ref id="em_commit"
1341 name="em_commit">/ first, or the changes are lost.
1342 <item>The function is only available as fastcall function, so it may only be
1343 used in presence of a prototype.
1344 <item>The function produces undefined results if no extended memory driver is
1345 loaded.
1346 </itemize>
1347 <tag/Availability/cc65
1348 <tag/See also/
1349 <ref id="em_commit" name="em_commit">,
1350 <ref id="em_load_driver" name="em_load_driver">,
1351 <ref id="em_use" name="em_use">
1352 <tag/Example/None.
1353 </descrip>
1354 </quote>
1355
1356
1357 <sect1>em_pagecount<label id="em_pagecount"><p>
1358
1359 <quote>
1360 <descrip>
1361 <tag/Function/Return the number of available extended memory pages.
1362 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1363 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
1364 <tag/Description/The function returns the size of the extended memory supported
1365 by the driver in 256 byte pages.
1366 <tag/Limits/<itemize>
1367 <item>The function returns zero if no extended memory driver is loaded.
1368 <item>The function may return zero if the supported hardware was not detected.
1369 </itemize>
1370 <tag/Availability/cc65
1371 <tag/See also/
1372 <ref id="em_load_driver" name="em_load_driver">
1373 <tag/Example/None.
1374 </descrip>
1375 </quote>
1376
1377
1378 <sect1>em_unload<label id="em_unload"><p>
1379
1380 <quote>
1381 <descrip>
1382 <tag/Function/Unload an extended memory driver.
1383 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1384 <tag/Declaration/<tt/void __fastcall__ em_unload (void);/
1385 <tag/Description/The function unloads a loaded extended memory driver and
1386 frees all memory allocated for the driver.
1387 <tag/Limits/<itemize>
1388 <item>The function does nothing if no driver is loaded.
1389 </itemize>
1390 <tag/Availability/cc65
1391 <tag/See also/
1392 <ref id="em_load_driver" name="em_load_driver">
1393 <tag/Example/None.
1394 </descrip>
1395 </quote>
1396
1397
1398 <sect1>em_use<label id="em_use"><p>
1399
1400 <quote>
1401 <descrip>
1402 <tag/Function/Prepare an extended memory page for use.
1403 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1404 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
1405 <tag/Description/The function maps one page of extended memory into linear
1406 memory and returns a pointer to the page frame. This function is similar to
1407 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
1408 actual memory window in the assumption that the existing data is wrong or
1409 will get overwritten.
1410 <tag/Limits/<itemize>
1411 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
1412 made any changes to the data in the window, call <tt/<ref id="em_commit"
1413 name="em_commit">/ first, or the changes are lost.
1414 <item>The function is only available as fastcall function, so it may only be
1415 used in presence of a prototype.
1416 <item>The function produces undefined results if no extended memory driver is
1417 loaded.
1418 </itemize>
1419 <tag/Availability/cc65
1420 <tag/See also/
1421 <ref id="em_commit" name="em_commit">,
1422 <ref id="em_load_driver" name="em_load_driver">,
1423 <ref id="em_map" name="em_map">
1424 <tag/Example/None.
1425 </descrip>
1426 </quote>
1427
1428
1429 <sect1>exit<label id="exit"><p>
1430
1431 <quote>
1432 <descrip>
1433 <tag/Function/Terminate the program.
1434 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1435 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
1436 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
1437 return code of the program. Before termination, all files are closed, buffered
1438 output is written and any functions registered with <tt/<ref id="atexit"
1439 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
1440 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
1441 name="stdlib.h">/.
1442 <tag/Limits/<itemize>
1443 <item>The function is only available as fastcall function, so it may only
1444 be used in presence of a prototype.
1445 <item>It depends on the host machine if the program return code can be
1446 evaluated or is ignored.
1447 </itemize>
1448 <tag/Availability/ISO 9899
1449 <tag/See also/
1450 <ref id="abort" name="abort">,
1451 <ref id="exit" name="exit">
1452 <tag/Example/None.
1453 </descrip>
1454 </quote>
1455
1456
1457 <sect1>fast<label id="fast"><p>
1458
1459 <quote>
1460 <descrip>
1461 <tag/Function/Switch the C128 into 2MHz mode.
1462 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1463 <tag/Declaration/<tt/void fast (void);/
1464 <tag/Description/The function will switch the clock of the C128 to 2MHz. This
1465 will nearly double the speed compared to slow mode.
1466 <tag/Limits/<itemize>
1467 <item>The function is specific to the C128.
1468 <item>2MHz clock will not work in 40 column mode.
1469 </itemize>
1470 <tag/Availability/C128
1471 <tag/See also/
1472 <ref id="slow" name="slow">,
1473 <ref id="toggle_videomode" name="toggle_videomode">
1474 <tag/Example/None.
1475 </descrip>
1476 </quote>
1477
1478
1479 <sect1>free<label id="free"><p>
1480
1481 <quote>
1482 <descrip>
1483 <tag/Function/Free a block of dynamic memory.
1484 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1485 <tag/Declaration/<tt/void __fastcall__ free (void* block);/
1486 <tag/Description/Free a block of dynamic memory previously allocated with
1487 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
1488 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
1489 pointer is <tt/NULL/, no action is performed.
1490 <tag/Limits/
1491 <itemize>
1492 <item>Passing an already free'd block to <tt/free/ again will cause undefined
1493 behaviour and may crash your program.
1494 <item>The function is only available as fastcall function, so it may only
1495 be used in presence of a prototype.
1496 </itemize>
1497 <tag/Availability/ISO 9899
1498 <tag/See also/
1499 <ref id="_heapadd" name="_heapadd">,
1500 <ref id="_heapmaxavail" name="_heapmaxavail">,
1501 <ref id="_heapmemavail" name="_heapmemavail">,
1502 <ref id="calloc" name="calloc">,
1503 <ref id="malloc" name="malloc">,
1504 <ref id="realloc" name="realloc">
1505 <tag/Example/None.
1506 </descrip>
1507 </quote>
1508
1509
1510 <sect1>getenv<label id="getenv"><p>
1511
1512 <quote>
1513 <descrip>
1514 <tag/Function/Return a value from the environment.
1515 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1516 <tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
1517 <tag/Description/The function searches the environment for an entry that
1518 matches <tt/name/ and returns its value. The environment consists of a list
1519 of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
1520 returns <tt/NULL/.
1521 <tag/Limits/<itemize>
1522 <item>What exactly is stored in the environment depends on the machine the
1523 program is running on.
1524 <item>The function is only available as fastcall function, so it may only
1525 be used in presence of a prototype.
1526 </itemize>
1527 <tag/Availability/ISO 9899
1528 <tag/Example/None.
1529 </descrip>
1530 </quote>
1531
1532
1533 <sect1>getcpu<label id="getcpu"><p>
1534
1535 <quote>
1536 <descrip>
1537 <tag/Function/Determine on which CPU the program is running.
1538 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
1539 <tag/Declaration/<tt/unsigned char getcpu (void);/
1540 <tag/Description/The function checks on which CPU the code is running. It
1541 returns one of the constants<itemize>
1542 <item><tt/CPU_6502/
1543 <item><tt/CPU_65C02/
1544 <item><tt/CPU_65816/
1545 </itemize>
1546 <tag/Limits/<itemize>
1547 <item>Other, more exotic CPU types are not disinguished.
1548 </itemize>
1549 <tag/Availability/cc65
1550 <tag/Example/None.
1551 </descrip>
1552 </quote>
1553
1554
1555 <sect1>gotox<label id="gotox"><p>
1556
1557 <quote>
1558 <descrip>
1559 <tag/Function/Move the text mode cursor to a new X position.
1560 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1561 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
1562 <tag/Description/The function moves the text mode cursor to the specified X
1563 position while leaving the Y position untouched. The leftmost position on the
1564 screen has the coordinate 0.
1565 <tag/Limits/<itemize>
1566 <item>The function is only available as fastcall function, so it may
1567 only be used in presence of a prototype.
1568 <item>Invalid values for the X position (out of screen coordinates) may
1569 lead to undefined behaviour.
1570 </itemize>
1571 <tag/Availability/cc65
1572 <tag/See also/
1573 <ref id="gotoy" name="gotoy">,
1574 <ref id="gotoxy" name="gotoxy">,
1575 <ref id="wherex" name="wherex">,
1576 <ref id="wherey" name="wherey">
1577 <tag/Example/None.
1578 </descrip>
1579 </quote>
1580
1581
1582 <sect1>gotoxy<label id="gotoxy"><p>
1583
1584 <quote>
1585 <descrip>
1586 <tag/Function/Move the text mode cursor to a new position.
1587 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1588 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
1589 <tag/Description/The function moves the text mode cursor to the specified
1590 position. The leftmost position on the screen has the X coordinate 0, the
1591 topmost line has the Y coordinate 0.
1592 <tag/Limits/<itemize>
1593 <item>The function is only available as fastcall function, so it may only be
1594 used in presence of a prototype.
1595 <item>Invalid values for any of both coordinates (out of screen positions) may
1596 lead to undefined behaviour.
1597 </itemize>
1598 <tag/Availability/cc65
1599 <tag/See also/
1600 <ref id="gotox" name="gotox">,
1601 <ref id="gotoy" name="gotoy">,
1602 <ref id="wherex" name="wherex">,
1603 <ref id="wherey" name="wherey">
1604 <tag/Example/None.
1605 </descrip>
1606 </quote>
1607
1608
1609 <sect1>gotoy<label id="gotoy"><p>
1610
1611 <quote>
1612 <descrip>
1613 <tag/Function/Move the text mode cursor to a new Y position.
1614 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1615 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
1616 <tag/Description/The function moves the text mode cursor to the specified Y
1617 position while leaving the X position untouched. The uppermost position on the
1618 screen has the coordinate 0.
1619 <tag/Limits/<itemize>
1620 <item>The function is only available as fastcall function, so it may
1621 only be used in presence of a prototype.
1622 <item>Invalid values for the Y position (out of screen coordinates) may lead
1623 to undefined behaviour.
1624 </itemize>
1625 <tag/Availability/cc65
1626 <tag/See also/
1627 <ref id="gotox" name="gotox">,
1628 <ref id="gotoxy" name="gotoxy">,
1629 <ref id="wherex" name="wherex">,
1630 <ref id="wherey" name="wherey">
1631 <tag/Example/None.
1632 </descrip>
1633 </quote>
1634
1635
1636 <sect1>isalnum<label id="isalnum"><p>
1637
1638 <quote>
1639 <descrip>
1640 <tag/Function/Check if a given character is a letter or digit.
1641 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1642 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
1643 <tag/Description/The function returns a value of zero if the given argument
1644 is a letter or digit. The return value is non zero if the character
1645 is anything else.
1646 <tag/Limits/<itemize>
1647 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1648 inline sequence generated by the macro will not work correctly for values
1649 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1650 this range. The non inline function may be accessed by <tt/#undef/'ing
1651 the macro.
1652 <item>When compiling without <tt/-Os/, the function is only available as
1653 fastcall function, so it may only be used in presence of a prototype.
1654 </itemize>
1655 <tag/Availability/ISO 9899
1656 <tag/See also/
1657 <ref id="isalpha" name="isalpha">,
1658 <ref id="isascii" name="isascii">,
1659 <ref id="isblank" name="isblank">,
1660 <ref id="iscntrl" name="iscntrl">,
1661 <ref id="isdigit" name="isdigit">,
1662 <ref id="isgraph" name="isgraph">,
1663 <ref id="islower" name="islower">,
1664 <ref id="isprint" name="isprint">,
1665 <ref id="ispunct" name="ispunct">,
1666 <ref id="isspace" name="isspace">,
1667 <ref id="isupper" name="isupper">,
1668 <ref id="isxdigit" name="isxdigit">
1669 <tag/Example/None.
1670 </descrip>
1671 </quote>
1672
1673
1674 <sect1>isalpha<label id="isalpha"><p>
1675
1676 <quote>
1677 <descrip>
1678 <tag/Function/Check if a given character is a letter.
1679 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1680 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
1681 <tag/Description/The function returns a value of zero if the given argument
1682 is a letter. The return value is non zero if the character is anything else.
1683 <tag/Limits/<itemize>
1684 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1685 inline sequence generated by the macro will not work correctly for values
1686 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1687 this range. The non inline function may be accessed by <tt/#undef/'ing the
1688 macro.
1689 <item>When compiling without <tt/-Os/, the function is only available as
1690 fastcall function, so it may only be used in presence of a prototype.
1691 </itemize>
1692 <tag/Availability/ISO 9899
1693 <tag/See also/
1694 <ref id="isalnum" name="isalnum">,
1695 <ref id="isascii" name="isascii">,
1696 <ref id="isblank" name="isblank">,
1697 <ref id="iscntrl" name="iscntrl">,
1698 <ref id="isdigit" name="isdigit">,
1699 <ref id="isgraph" name="isgraph">,
1700 <ref id="islower" name="islower">,
1701 <ref id="isprint" name="isprint">,
1702 <ref id="ispunct" name="ispunct">,
1703 <ref id="isspace" name="isspace">,
1704 <ref id="isupper" name="isupper">,
1705 <ref id="isxdigit" name="isxdigit">
1706 <tag/Example/None.
1707 </descrip>
1708 </quote>
1709
1710
1711 <sect1>isascii<label id="isascii"><p>
1712
1713 <quote>
1714 <descrip>
1715 <tag/Function/Check if a given character is in the ASCII (0..127) range.
1716 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1717 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
1718 <tag/Description/The function returns a value of zero if the given argument
1719 is in the range 0..127 (the range of valid ASCII characters) and a non zero
1720 value if not.
1721 <tag/Limits/<itemize>
1722 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1723 inline sequence generated by the macro will not work correctly for values
1724 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1725 this range. The non inline function may be accessed by <tt/#undef/'ing the
1726 macro.
1727 <item>When compiling without <tt/-Os/, the function is only available as
1728 fastcall function, so it may only be used in presence of a prototype.
1729 </itemize>
1730 <tag/Availability/ISO 9899
1731 <tag/See also/
1732 <ref id="isalnum" name="isalnum">,
1733 <ref id="isalpha" name="isalpha">,
1734 <ref id="isblank" name="isblank">,
1735 <ref id="iscntrl" name="iscntrl">,
1736 <ref id="isdigit" name="isdigit">,
1737 <ref id="isgraph" name="isgraph">,
1738 <ref id="islower" name="islower">,
1739 <ref id="isprint" name="isprint">,
1740 <ref id="ispunct" name="ispunct">,
1741 <ref id="isspace" name="isspace">,
1742 <ref id="isupper" name="isupper">,
1743 <ref id="isxdigit" name="isxdigit">
1744 <tag/Example/None.
1745 </descrip>
1746 </quote>
1747
1748
1749 <sect1>isblank<label id="isblank"><p>
1750
1751 <quote>
1752 <descrip>
1753 <tag/Function/Check if a given character is a space or tab.
1754 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1755 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
1756 <tag/Description/The function returns a value of zero if the given argument
1757 is a blank or space character. The return value is non zero if the character
1758 is anything else.
1759 <tag/Limits/<itemize>
1760 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1761 inline sequence generated by the macro will not work correctly for values
1762 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1763 this range. The non inline function may be accessed by <tt/#undef/'ing the
1764 macro.
1765 <item>When compiling without <tt/-Os/, the function is only available as
1766 fastcall function, so it may only be used in presence of a prototype.
1767 </itemize>
1768 <tag/Availability/cc65
1769 <tag/See also/
1770 <ref id="isalnum" name="isalnum">,
1771 <ref id="isalpha" name="isalpha">,
1772 <ref id="isascii" name="isascii">,
1773 <ref id="iscntrl" name="iscntrl">,
1774 <ref id="isdigit" name="isdigit">,
1775 <ref id="isgraph" name="isgraph">,
1776 <ref id="islower" name="islower">,
1777 <ref id="isprint" name="isprint">,
1778 <ref id="ispunct" name="ispunct">,
1779 <ref id="isspace" name="isspace">,
1780 <ref id="isupper" name="isupper">,
1781 <ref id="isxdigit" name="isxdigit">
1782 <tag/Example/None.
1783 </descrip>
1784 </quote>
1785
1786
1787 <sect1>iscntrl<label id="iscntrl"><p>
1788
1789 <quote>
1790 <descrip>
1791 <tag/Function/Check if a given character is a control character.
1792 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1793 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
1794 <tag/Description/The function returns a value of zero if the given argument
1795 is a control character. The return value is non zero if the character
1796 is anything else.
1797 <tag/Limits/<itemize>
1798 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1799 inline sequence generated by the macro will not work correctly for values
1800 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1801 this range. The non inline function may be accessed by <tt/#undef/'ing the
1802 macro.
1803 <item>When compiling without <tt/-Os/, the function is only available as
1804 fastcall function, so it may only be used in presence of a prototype.
1805 </itemize>
1806 <tag/Availability/ISO 9899
1807 <tag/See also/
1808 <ref id="isalnum" name="isalnum">,
1809 <ref id="isalpha" name="isalpha">,
1810 <ref id="isascii" name="isascii">,
1811 <ref id="isblank" name="isblank">,
1812 <ref id="isdigit" name="isdigit">,
1813 <ref id="isgraph" name="isgraph">,
1814 <ref id="islower" name="islower">,
1815 <ref id="isprint" name="isprint">,
1816 <ref id="ispunct" name="ispunct">,
1817 <ref id="isspace" name="isspace">,
1818 <ref id="isupper" name="isupper">,
1819 <ref id="isxdigit" name="isxdigit">
1820 <tag/Example/None.
1821 </descrip>
1822 </quote>
1823
1824
1825 <sect1>isdigit<label id="isdigit"><p>
1826
1827 <quote>
1828 <descrip>
1829 <tag/Function/Check if a given character is a digit.
1830 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1831 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
1832 <tag/Description/The function returns a value of zero if the given argument
1833 is a digit. The return value is non zero if the character is anything else.
1834 <tag/Limits/<itemize>
1835 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1836 inline sequence generated by the macro will not work correctly for values
1837 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1838 this range. The non inline function may be accessed by <tt/#undef/'ing the
1839 macro.
1840 <item>When compiling without <tt/-Os/, the function is only available as
1841 fastcall function, so it may only be used in presence of a prototype.
1842 </itemize>
1843 <tag/Availability/ISO 9899
1844 <tag/See also/
1845 <ref id="isalnum" name="isalnum">,
1846 <ref id="isalpha" name="isalpha">,
1847 <ref id="isascii" name="isascii">,
1848 <ref id="isblank" name="isblank">,
1849 <ref id="iscntrl" name="iscntrl">,
1850 <ref id="isgraph" name="isgraph">,
1851 <ref id="islower" name="islower">,
1852 <ref id="isprint" name="isprint">,
1853 <ref id="ispunct" name="ispunct">,
1854 <ref id="isspace" name="isspace">,
1855 <ref id="isupper" name="isupper">,
1856 <ref id="isxdigit" name="isxdigit">
1857 <tag/Example/None.
1858 </descrip>
1859 </quote>
1860
1861
1862 <sect1>isgraph<label id="isgraph"><p>
1863
1864 <quote>
1865 <descrip>
1866 <tag/Function/Check if a given character is a printable character (except
1867 space).
1868 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1869 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
1870 <tag/Description/The function returns a value of zero if the given argument
1871 is a printable character with the exception of space. The return value is non
1872 zero if the character is anything else.
1873 <tag/Limits/<itemize>
1874 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1875 inline sequence generated by the macro will not work correctly for values
1876 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1877 this range. The non inline function may be accessed by <tt/#undef/'ing the
1878 macro.
1879 <item>When compiling without <tt/-Os/, the function is only available as
1880 fastcall function, so it may only be used in presence of a prototype.
1881 </itemize>
1882 <tag/Availability/ISO 9899
1883 <tag/See also/
1884 <ref id="isalnum" name="isalnum">,
1885 <ref id="isalpha" name="isalpha">,
1886 <ref id="isascii" name="isascii">,
1887 <ref id="isblank" name="isblank">,
1888 <ref id="iscntrl" name="iscntrl">,
1889 <ref id="isdigit" name="isdigit">,
1890 <ref id="islower" name="islower">,
1891 <ref id="isprint" name="isprint">,
1892 <ref id="ispunct" name="ispunct">,
1893 <ref id="isspace" name="isspace">,
1894 <ref id="isupper" name="isupper">,
1895 <ref id="isxdigit" name="isxdigit">
1896 <tag/Example/None.
1897 </descrip>
1898 </quote>
1899
1900
1901 <sect1>islower<label id="islower"><p>
1902
1903 <quote>
1904 <descrip>
1905 <tag/Function/Check if a given character is a lower case letter.
1906 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1907 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
1908 <tag/Description/The function returns a value of zero if the given argument
1909 is a lower case letter. The return value is non zero if the character is
1910 anything else.
1911 <tag/Limits/<itemize>
1912 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1913 inline sequence generated by the macro will not work correctly for values
1914 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1915 this range. The non inline function may be accessed by <tt/#undef/'ing the
1916 macro.
1917 <item>When compiling without <tt/-Os/, the function is only available as
1918 fastcall function, so it may only be used in presence of a prototype.
1919 </itemize>
1920 <tag/Availability/ISO 9899
1921 <tag/See also/
1922 <ref id="isalnum" name="isalnum">,
1923 <ref id="isalpha" name="isalpha">,
1924 <ref id="isascii" name="isascii">,
1925 <ref id="isblank" name="isblank">,
1926 <ref id="iscntrl" name="iscntrl">,
1927 <ref id="isdigit" name="isdigit">,
1928 <ref id="isgraph" name="isgraph">,
1929 <ref id="isprint" name="isprint">,
1930 <ref id="ispunct" name="ispunct">,
1931 <ref id="isspace" name="isspace">,
1932 <ref id="isupper" name="isupper">,
1933 <ref id="isxdigit" name="isxdigit">
1934 <tag/Example/None.
1935 </descrip>
1936 </quote>
1937
1938
1939 <sect1>isprint<label id="isprint"><p>
1940
1941 <quote>
1942 <descrip>
1943 <tag/Function/Check if a given character is a printable character.
1944 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1945 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
1946 <tag/Description/The function returns a value of zero if the given argument
1947 is a printable character (this includes the space character). The return value
1948 is non zero if the character is anything else.
1949 <tag/Limits/<itemize>
1950 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1951 inline sequence generated by the macro will not work correctly for values
1952 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1953 this range. The non inline function may be accessed by <tt/#undef/'ing the
1954 macro.
1955 <item>When compiling without <tt/-Os/, the function is only available as
1956 fastcall function, so it may only be used in presence of a prototype.
1957 </itemize>
1958 <tag/Availability/ISO 9899
1959 <tag/See also/
1960 <ref id="isalnum" name="isalnum">,
1961 <ref id="isalpha" name="isalpha">,
1962 <ref id="isascii" name="isascii">,
1963 <ref id="isblank" name="isblank">,
1964 <ref id="iscntrl" name="iscntrl">,
1965 <ref id="isdigit" name="isdigit">,
1966 <ref id="isgraph" name="isgraph">,
1967 <ref id="islower" name="islower">,
1968 <ref id="ispunct" name="ispunct">,
1969 <ref id="isspace" name="isspace">,
1970 <ref id="isupper" name="isupper">,
1971 <ref id="isxdigit" name="isxdigit">
1972 <tag/Example/None.
1973 </descrip>
1974 </quote>
1975
1976
1977 <sect1>ispunct<label id="ispunct"><p>
1978
1979 <quote>
1980 <descrip>
1981 <tag/Function/Check if a given character is a printable character but not a
1982 space or an alphanumeric character.
1983 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1984 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
1985 <tag/Description/The function returns a value of zero if the given argument
1986 is a printable character, but not a space or anything alphanumeric. The return
1987 value is non zero if the character is anything else.
1988 <tag/Limits/<itemize>
1989 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1990 inline sequence generated by the macro will not work correctly for values
1991 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1992 this range. The non inline function may be accessed by <tt/#undef/'ing the
1993 macro.
1994 <item>When compiling without <tt/-Os/, the function is only available as
1995 fastcall function, so it may only be used in presence of a prototype.
1996 </itemize>
1997 <tag/Availability/ISO 9899
1998 <tag/See also/
1999 <ref id="isalnum" name="isalnum">,
2000 <ref id="isalpha" name="isalpha">,
2001 <ref id="isascii" name="isascii">,
2002 <ref id="isblank" name="isblank">,
2003 <ref id="iscntrl" name="iscntrl">,
2004 <ref id="isdigit" name="isdigit">,
2005 <ref id="isgraph" name="isgraph">,
2006 <ref id="islower" name="islower">,
2007 <ref id="isprint" name="isprint">,
2008 <ref id="isspace" name="isspace">,
2009 <ref id="isupper" name="isupper">,
2010 <ref id="isxdigit" name="isxdigit">
2011 <tag/Example/None.
2012 </descrip>
2013 </quote>
2014
2015
2016 <sect1>isspace<label id="isspace"><p>
2017
2018 <quote>
2019 <descrip>
2020 <tag/Function/Check if a given character is a a white-space character.
2021 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2022 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
2023 <tag/Description/The function returns a value of zero if the given argument
2024 is a white space character. The return value is non zero if the character is
2025 anything else. The standard white space characters are: space, formfeed ('\f'),
2026 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
2027 ('\v').
2028 <tag/Limits/<itemize>
2029 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2030 inline sequence generated by the macro will not work correctly for values
2031 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2032 this range. The non inline function may be accessed by <tt/#undef/'ing the
2033 macro.
2034 <item>When compiling without <tt/-Os/, the function is only available as
2035 fastcall function, so it may only be used in presence of a prototype.
2036 </itemize>
2037 <tag/Availability/ISO 9899
2038 <tag/See also/
2039 <ref id="isalnum" name="isalnum">,
2040 <ref id="isalpha" name="isalpha">,
2041 <ref id="isascii" name="isascii">,
2042 <ref id="isblank" name="isblank">,
2043 <ref id="iscntrl" name="iscntrl">,
2044 <ref id="isdigit" name="isdigit">,
2045 <ref id="isgraph" name="isgraph">,
2046 <ref id="islower" name="islower">,
2047 <ref id="isprint" name="isprint">,
2048 <ref id="ispunct" name="ispunct">,
2049 <ref id="isupper" name="isupper">,
2050 <ref id="isxdigit" name="isxdigit">
2051 <tag/Example/None.
2052 </descrip>
2053 </quote>
2054
2055
2056 <sect1>isupper<label id="isupper"><p>
2057
2058 <quote>
2059 <descrip>
2060 <tag/Function/Check if a given character is an upper case letter.
2061 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2062 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
2063 <tag/Description/The function returns a value of zero if the given argument
2064 is an upper case letter. The return value is non zero if the character is
2065 anything else.
2066 <tag/Limits/<itemize>
2067 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2068 inline sequence generated by the macro will not work correctly for values
2069 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2070 this range. The non inline function may be accessed by <tt/#undef/'ing the
2071 macro.
2072 <item>When compiling without <tt/-Os/, the function is only available as
2073 fastcall function, so it may only be used in presence of a prototype.
2074 </itemize>
2075 <tag/Availability/ISO 9899
2076 <tag/See also/
2077 <ref id="isalnum" name="isalnum">,
2078 <ref id="isalpha" name="isalpha">,
2079 <ref id="isascii" name="isascii">,
2080 <ref id="isblank" name="isblank">,
2081 <ref id="iscntrl" name="iscntrl">,
2082 <ref id="isdigit" name="isdigit">,
2083 <ref id="isgraph" name="isgraph">,
2084 <ref id="islower" name="islower">,
2085 <ref id="isprint" name="isprint">,
2086 <ref id="ispunct" name="ispunct">,
2087 <ref id="isspace" name="isspace">,
2088 <ref id="isxdigit" name="isxdigit">
2089 <tag/Example/None.
2090 </descrip>
2091 </quote>
2092
2093
2094 <sect1>isxdigit<label id="isxdigit"><p>
2095
2096 <quote>
2097 <descrip>
2098 <tag/Function/Check if a given character is a hexadecimal digit.
2099 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2100 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
2101 <tag/Description/The function returns a value of zero if the given argument
2102 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
2103 if the character is anything else.
2104 <tag/Limits/<itemize>
2105 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2106 inline sequence generated by the macro will not work correctly for values
2107 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2108 this range. The non inline function may be accessed by <tt/#undef/'ing the
2109 macro.
2110 <item>When compiling without <tt/-Os/, the function is only available as
2111 fastcall function, so it may only be used in presence of a prototype.
2112 </itemize>
2113 <tag/Availability/ISO 9899
2114 <tag/See also/
2115 <ref id="isalnum" name="isalnum">,
2116 <ref id="isalpha" name="isalpha">,
2117 <ref id="isascii" name="isascii">,
2118 <ref id="isblank" name="isblank">,
2119 <ref id="iscntrl" name="iscntrl">,
2120 <ref id="isdigit" name="isdigit">,
2121 <ref id="isgraph" name="isgraph">,
2122 <ref id="islower" name="islower">,
2123 <ref id="isprint" name="isprint">,
2124 <ref id="ispunct" name="ispunct">,
2125 <ref id="isspace" name="isspace">,
2126 <ref id="isupper" name="isupper">
2127 <tag/Example/None.
2128 </descrip>
2129 </quote>
2130
2131
2132 <sect1>itoa<label id="itoa"><p>
2133
2134 <quote>
2135 <descrip>
2136 <tag/Function/Convert an integer into a string.
2137 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2138 <tag/Declaration/<tt/char* __fastcall__ itoa (int val, char* buf, int radix);/
2139 <tag/Description/<tt/itoa/ converts the integer <tt/val/ into a string using
2140 <tt/radix/ as the base.
2141 <tag/Limits/<itemize>
2142 <item>There are no provisions to prevent a buffer overflow.
2143 <item>If <tt/val/ contains <tt/INT_MIN/, the behaviour is undefined.
2144 <item>The function is non standard, so it is not available in strict ANSI mode.
2145 You should probably use <tt/sprintf/ instead.
2146 <item>The function is only available as fastcall function, so it may only be
2147 used in presence of a prototype.
2148 </itemize>
2149 <tag/Availability/cc65
2150 <tag/See also/
2151 <ref id="atoi" name="atoi">,
2152 <ref id="atol" name="atol">,
2153 <ref id="ltoa" name="ltoa">,
2154 <ref id="ultoa" name="ultoa">,
2155 <ref id="utoa" name="utoa">
2156 <tag/Example/None.
2157 </descrip>
2158 </quote>
2159
2160
2161 <sect1>kbhit<label id="kbhit"><p>
2162
2163 <quote>
2164 <descrip>
2165 <tag/Function/Check if there's a key waiting in the keyboard buffer.
2166 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2167 <tag/Declaration/<tt/unsigned char kbhit (void);/
2168 <tag/Description/The function returns a value of zero if there is no character
2169 waiting to be read from the keyboard. It returns non zero otherwise.
2170 <tag/Limits/<itemize>
2171 <item>If the system does not support a keyboard buffer (most systems
2172 do), the function is rather useless.
2173 </itemize>
2174 <tag/Availability/cc65
2175 <tag/See also/
2176 <ref id="cgetc" name="cgetc">,
2177 <ref id="cursor" name="cursor">
2178 <tag/Example/None.
2179 </descrip>
2180 </quote>
2181
2182
2183 <sect1>labs<label id="labs"><p>
2184
2185 <quote>
2186 <descrip>
2187 <tag/Function/Returns the absolute value of a long integer.
2188 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2189 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
2190 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
2191 the function.
2192 <tag/Limits/<itemize>
2193 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
2194 <item>The function is only available as fastcall function, so it may only be
2195 used in presence of a prototype.
2196 </itemize>
2197 <tag/Availability/ISO 9899
2198 <tag/See also/
2199 <ref id="abs" name="abs">
2200 <tag/Example/None.
2201 </descrip>
2202 </quote>
2203
2204
2205 <sect1>ltoa<label id="ltoa"><p>
2206
2207 <quote>
2208 <descrip>
2209 <tag/Function/Convert a long integer into a string.
2210 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2211 <tag/Declaration/<tt/char* __fastcall__ ltoa (long val, char* buf, int radix);/
2212 <tag/Description/<tt/itoa/ converts the long integer <tt/val/ into a string
2213 using <tt/radix/ as the base.
2214 <tag/Limits/<itemize>
2215 <item>There are no provisions to prevent a buffer overflow.
2216 <item>If <tt/val/ contains <tt/LONG_MIN/, the behaviour is undefined.
2217 <item>The function is non standard, so it is not available in strict ANSI mode.
2218 You should probably use <tt/sprintf/ instead.
2219 <item>The function is only available as fastcall function, so it may only be
2220 used in presence of a prototype.
2221 </itemize>
2222 <tag/Availability/cc65
2223 <tag/See also/
2224 <ref id="atoi" name="atoi">,
2225 <ref id="atol" name="atol">,
2226 <ref id="itoa" name="itoa">,
2227 <ref id="ultoa" name="ultoa">,
2228 <ref id="utoa" name="utoa">
2229 <tag/Example/None.
2230 </descrip>
2231 </quote>
2232
2233
2234 <sect1>localeconv<label id="localeconv"><p>
2235
2236 <quote>
2237 <descrip>
2238 <tag/Function/Returns a pointer to the current locale structure.
2239 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
2240 <tag/Declaration/<tt/struct lconv* localeconv (void);/
2241 <tag/Description/<tt/localeconv/ returns a pointer to the current locale
2242 structure.
2243 <tag/Limits/<itemize>
2244 <item>cc65 supports only the "C" locale, so even after setting a new locale
2245 using <tt/<ref id="setlocale" name="setlocale">/, the structure returned will
2246 always be the same.
2247 </itemize>
2248 <tag/Availability/ISO 9899
2249 <tag/See also/
2250 <ref id="setlocale" name="setlocale">
2251 <tag/Example/None.
2252 </descrip>
2253 </quote>
2254
2255
2256 <sect1>malloc<label id="malloc"><p>
2257
2258 <quote>
2259 <descrip>
2260 <tag/Function/Allocate dynamic memory.
2261 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2262 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
2263 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
2264 pointer to the allocated memory block. On error (not enough memory available),
2265 <tt/malloc/ returns <tt/NULL/.
2266 <tag/Limits/
2267 <itemize>
2268 <item>The function is only available as fastcall function, so it may only
2269 be used in presence of a prototype.
2270 </itemize>
2271 <tag/Availability/ISO 9899
2272 <tag/See also/
2273 <ref id="_heapadd" name="_heapadd">,
2274 <ref id="_heapmaxavail" name="_heapmaxavail">,
2275 <ref id="_heapmemavail" name="_heapmemavail">,
2276 <ref id="calloc" name="calloc">,
2277 <ref id="free" name="free">,
2278 <ref id="realloc" name="realloc">
2279 <tag/Example/None.
2280 </descrip>
2281 </quote>
2282
2283
2284 <sect1>memcpy<label id="memcpy"><p>
2285
2286 <quote>
2287 <descrip>
2288 <tag/Function/Copy a memory area.
2289 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2290 <tag/Declaration/<tt/void* __fastcall__ memcpy (void* dest, const void* src, size_t count);/
2291 <tag/Description/<tt/memcpy/ copies <tt/count/ bytes from the memory area
2292 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
2293 <tt/dest/.
2294 <tag/Limits/
2295 <itemize>
2296 <item>The result is undefined if the memory areas do overlap. Use
2297 <tt/<ref id="memmove" name="memmove">/ to copy overlapping memory areas.
2298 <item>The function is only available as fastcall function, so it may only
2299 be used in presence of a prototype.
2300 </itemize>
2301 <tag/Availability/ISO 9899
2302 <tag/See also/
2303 <ref id="_swap" name="_swap">,
2304 <ref id="memmove" name="memmove">,
2305 <ref id="memset" name="memset">
2306 <tag/Example/None.
2307 </descrip>
2308 </quote>
2309
2310
2311 <sect1>memmove<label id="memmove"><p>
2312
2313 <quote>
2314 <descrip>
2315 <tag/Function/Copy a memory area.
2316 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2317 <tag/Declaration/<tt/void* __fastcall__ memmove (void* dest, const void* src, size_t count);/
2318 <tag/Description/<tt/memmove/ copies <tt/count/ bytes from the memory area
2319 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
2320 <tt/dest/.
2321 <tag/Limits/
2322 <itemize>
2323 <item>While <tt/memmove/ allows the memory areas to overlap, it has some
2324 additional overhead compared to <tt/<ref id="memcpy" name="memcpy">/.
2325 <item>The function is only available as fastcall function, so it may only
2326 be used in presence of a prototype.
2327 </itemize>
2328 <tag/Availability/ISO 9899
2329 <tag/See also/
2330 <ref id="_swap" name="_swap">,
2331 <ref id="memcpy" name="memcpy">,
2332 <ref id="memset" name="memset">
2333 <tag/Example/None.
2334 </descrip>
2335 </quote>
2336
2337
2338 <sect1>memset<label id="memset"><p>
2339
2340 <quote>
2341 <descrip>
2342 <tag/Function/Fill a memory area.
2343 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2344 <tag/Declaration/<tt/void* __fastcall__ memset (void* p, int val, size_t count);/
2345 <tag/Description/<tt/memset/ fills the memory area pointed to by <tt/p/ with
2346 the value <tt/val/. The function returns <tt/p/.
2347 <tag/Limits/
2348 <itemize>
2349 <item>The function is only available as fastcall function, so it may only
2350 be used in presence of a prototype.
2351 </itemize>
2352 <tag/Availability/ISO 9899
2353 <tag/See also/
2354 <ref id="_swap" name="_swap">,
2355 <ref id="bzero" name="bzero">,
2356 <ref id="memcpy" name="memcpy">,
2357 <ref id="memmove" name="memmove">
2358 <tag/Example/None.
2359 </descrip>
2360 </quote>
2361
2362
2363 <sect1>offsetof<label id="offsetof"><p>
2364
2365 <quote>
2366 <descrip>
2367 <tag/Function/Calculate the offset of a struct or union member.
2368 <tag/Header/<tt/<ref id="stddef.h" name="stddef.h">/
2369 <tag/Declaration/<tt/size_t offsetof (type, member);/
2370 <tag/Description/<tt/offsetof/ calculates the address offset of a <tt/struct/
2371 or <tt/union/ member.
2372 <tag/Limits/<itemize>
2373 <item>The function is actually a macro.
2374 </itemize>
2375 <tag/Availability/ISO 9899
2376 <tag/Example/None.
2377 </descrip>
2378 </quote>
2379
2380
2381 <sect1>open<label id="open"><p>
2382
2383 <quote>
2384 <descrip>
2385 <tag/Function/Open and possibly create a file.
2386 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
2387 <tag/Declaration/<tt/int open (const char* name, int flags, ...);/
2388 <tag/Description/<tt/open/ opens a file and returns the file descriptor
2389 associated with it. On error, -1 is returned and an error code is stored in
2390 <tt/errno/. Several flags may be passed to <tt/open/ that change the behaviour.
2391 <tag/Limits/<itemize>
2392 <item>POSIX specifies an additional <tt/mode/ argument that may be passed to
2393 open, which is used as the permission mask when a new file is created. While
2394 cc65 allows to pass this argument, it is ignored.
2395 </itemize>
2396 <tag/Availability/POSIX
2397 <tag/See also/
2398 <ref id="close" name="close">,
2399 <ref id="creat" name="creat">
2400 <tag/Example/None.
2401 </descrip>
2402 </quote>
2403
2404
2405 <sect1>raise<label id="raise"><p>
2406
2407 <quote>
2408 <descrip>
2409 <tag/Function/Send a signal to the executing program.
2410 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
2411 <tag/Declaration/<tt/int __fastcall__ raise (int sig);/
2412 <tag/Description/<tt/raise/ sends the given signal to the program. If the
2413 program has installed a signal handler for the signal, this signal handler
2414 will be executed. If no handler has been installed, the default action for
2415 the raised signal will be taken. The function returns zero on success,
2416 nonzero otherwise.
2417 <tag/Limits/<itemize>
2418 <item>The function is only available as fastcall function, so it may only
2419 be used in presence of a prototype.
2420 </itemize>
2421 <tag/Availability/ISO 9899
2422 <tag/See also/
2423 <ref id="abort" name="abort">,
2424 <ref id="signal" name="signal">
2425 <tag/Example/None.
2426 </descrip>
2427 </quote>
2428
2429
2430 <sect1>rand<label id="rand"><p>
2431
2432 <quote>
2433 <descrip>
2434 <tag/Function/Return a pseudo random number.
2435 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2436 <tag/Declaration/<tt/int rand (void);/
2437 <tag/Description/The function returns a pseudo random number
2438 between 0 and <tt/RAND_MAX/ (exclusive).
2439 <tag/Limits/<itemize>
2440 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
2441 flow of numbers is generated.
2442 <item>On startup, the function behaves as if <ref id="srand" name="srand">
2443 had been used with an argument of 1.
2444 </itemize>
2445 <tag/Availability/ISO 9899
2446 <tag/See also/
2447 <ref id="_randomize" name="_randomize">,
2448 <ref id="srand" name="srand">
2449 <tag/Example/None.
2450 </descrip>
2451 </quote>
2452
2453
2454 <sect1>realloc<label id="realloc"><p>
2455
2456 <quote>
2457 <descrip>
2458 <tag/Function/Change the size of an allocated memory block.
2459 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2460 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
2461 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
2462 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
2463 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
2464 behaves as if <tt/free/ had been called. On error (not enough memory
2465 available), <tt/realloc/ returns <tt/NULL/.
2466 <tag/Limits/
2467 <itemize>
2468 <item>The part of the memory block that is returned will have its contents
2469 unchanged.
2470 <item>This function is somewhat dangerous to use. Be careful to save the
2471 pointer you're passing somewhere else, otherwise
2472 <tscreen><verb>
2473         ptr = realloc (ptr, size);
2474 </verb></tscreen>
2475 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
2476 <item>The function is only available as fastcall function, so it may only
2477 be used in presence of a prototype.
2478 </itemize>
2479 <tag/Availability/ISO 9899
2480 <tag/See also/
2481 <ref id="_heapadd" name="_heapadd">,
2482 <ref id="_heapmaxavail" name="_heapmaxavail">,
2483 <ref id="_heapmemavail" name="_heapmemavail">,
2484 <ref id="calloc" name="calloc">,
2485 <ref id="free" name="free">,
2486 <ref id="realloc" name="realloc">
2487 <tag/Example/None.
2488 </descrip>
2489 </quote>
2490
2491
2492 <sect1>reset_brk<label id="reset_brk"><p>
2493
2494 <quote>
2495 <descrip>
2496 <tag/Function/Resets the break vector to its original value.
2497 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
2498 <tag/Declaration/<tt/void __fastcall__ reset_brk (void);/
2499 <tag/Description/<tt/reset_brk/ resets the break vector to the value it had
2500 before a call to <tt/set_brk/.
2501 <tag/Limits/
2502 <itemize>
2503 <item>Since <tt/<ref id="set_brk" name="set_brk">/ installs an exit handler,
2504 it is not strictly necessary to call this function as part of the cleanup when
2505 the program ends.
2506 </itemize>
2507 <tag/Availability/cc65
2508 <tag/See also/
2509 <ref id="set_brk" name="set_brk">
2510 <tag/Example/None.
2511 </descrip>
2512 </quote>
2513
2514
2515 <sect1>revers<label id="revers"><p>
2516
2517 <quote>
2518 <descrip>
2519 <tag/Function/Control revers character display.
2520 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2521 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
2522 <tag/Description/If the argument is non zero, the function enables reverse
2523 character display. If the argument is zero, reverse character display is
2524 switched off. The old value of the setting is returned.
2525 <tag/Limits/<itemize>
2526 <item>The function may not be supported by the hardware, in which case
2527 the call is ignored.
2528 <item>The function is only available as fastcall function, so it may only
2529 be used in presence of a prototype.
2530 </itemize>
2531 <tag/Availability/cc65
2532 <tag/See also/
2533 <ref id="textcolor" name="textcolor">
2534 <tag/Example/None.
2535 </descrip>
2536 </quote>
2537
2538
2539 <sect1>screensize<label id="screensize"><p>
2540
2541 <quote>
2542 <descrip>
2543 <tag/Function/Return the dimensions of the text mode screen.
2544 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2545 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
2546 <tag/Description/The function returns the dimensions of the text mode screen.
2547 <tag/Limits/<itemize>
2548 <item>The function is only available as fastcall function, so it may only
2549 be used in presence of a prototype.
2550 </itemize>
2551 <tag/Availability/cc65
2552 <tag/See also/
2553 <ref id="gotox" name="gotox">,
2554 <ref id="gotoxy" name="gotoxy">,
2555 <ref id="gotoy" name="gotoy">,
2556 <ref id="wherex" name="wherex">,
2557 <ref id="wherey" name="wherey">
2558 <tag/Example/None.
2559 </descrip>
2560 </quote>
2561
2562
2563 <sect1>set_brk<label id="set_brk"><p>
2564
2565 <quote>
2566 <descrip>
2567 <tag/Function/Set the break vector to a user function.
2568 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
2569 <tag/Declaration/<tt/void __fastcall__ set_brk (brk_handler func);/
2570 <tag/Description/<tt/set_brk/ allows a user program to handle breaks within the
2571 program code by letting the vector point to a user written C function. The
2572 runtime library installs a small stub that saves the registers into global
2573 variables that may be accessed (and changed) by the break handler.
2574 <tag/Limits/
2575 <itemize>
2576 <item>The function is only available as fastcall function, so it may only
2577 be used in presence of a prototype.
2578 <item>The stub saves the zero page registers used by the C runtime and switches
2579 to a small break handler stack. This means that it is safe to execute C code,
2580 even if C code was interrupted. Be careful however not to use too many local
2581 variables, and do not enable stack checks for the handler function or any other
2582 function called from it.
2583 <item>The <tt/brk_pc/ variable points to the <tt/BRK/ instruction. If you want
2584 the continue with the interrupted code, you have to adjust <tt/brk_pc/,
2585 otherwise the <tt/BRK/ instruction will get executed over and over again.
2586 <item>Since <tt/set_brk/ installs an exit handler, it is not strictly necessary
2587 to call <tt/<ref id="reset_brk" name="reset_brk">/ as part of the cleanup when
2588 the program terminates.
2589 </itemize>
2590 <tag/Availability/cc65
2591 <tag/See also/
2592 <ref id="reset_brk" name="reset_brk">
2593 <tag/Example/None.
2594 </descrip>
2595 </quote>
2596
2597
2598 <sect1>setlocale<label id="setlocale"><p>
2599
2600 <quote>
2601 <descrip>
2602 <tag/Function/Selects a locale.
2603 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
2604 <tag/Declaration/<tt/char* __fastcall__ setlocale (int category, const char* locale);/
2605 <tag/Description/<tt/setlocale/ sets or queries the program's locale.
2606 <tag/Limits/
2607 <itemize>
2608 <item>The function is only available as fastcall function, so it may only
2609 be used in presence of a prototype.
2610 <item>cc65 supports only the "C" locale, so calling this function to set a
2611 different locale has no effect.
2612 </itemize>
2613 <tag/Availability/ISO 9899
2614 <tag/See also/
2615 <ref id="localeconv" name="localeconv">,
2616 <ref id="strcoll" name="strcoll">
2617 <tag/Example/None.
2618 </descrip>
2619 </quote>
2620
2621
2622 <sect1>signal<label id="signal"><p>
2623
2624 <quote>
2625 <descrip>
2626 <tag/Function/Install a signal handler.
2627 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
2628 <tag/Declaration/<tt/__sigfunc __fastcall__ signal (int sig, __sigfunc func);/
2629 <tag/Description/<tt/signal/ installs a handler for the given signal. The
2630 handler may either be a user supplied function, or one of the predefined
2631 signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
2632 previous value if the signal , or the special function vector SIG_ERR in
2633 case of an error.
2634 <tag/Limits/<itemize>
2635 <item>The function is only available as fastcall function, so it may only
2636 be used in presence of a prototype.
2637 </itemize>
2638 <tag/Availability/ISO 9899
2639 <tag/See also/
2640 <ref id="abort" name="abort">,
2641 <ref id="raise" name="raise">
2642 <tag/Example/None.
2643 </descrip>
2644 </quote>
2645
2646
2647 <sect1>sleep<label id="sleep"><p>
2648
2649 <quote>
2650 <descrip>
2651 <tag/Function/Sleep for a specified amount of time.
2652 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
2653 <tag/Declaration/<tt/void __fastcall__ sleep (unsigned seconds);/
2654 <tag/Description/The function will return after the specified number of
2655 seconds have elapsed.
2656 <tag/Limits/<itemize>
2657 <item>The function is only available as fastcall function, so it may only
2658 be used in presence of a prototype.
2659 </itemize>
2660 <tag/Availability/POSIX
2661 <tag/Example/None.
2662 </descrip>
2663 </quote>
2664
2665
2666 <sect1>slow<label id="slow"><p>
2667
2668 <quote>
2669 <descrip>
2670 <tag/Function/Switch the C128 into 1MHz mode.
2671 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
2672 <tag/Declaration/<tt/void slow (void);/
2673 <tag/Description/The function will switch the clock of the C128 to 1MHz. This
2674 will halve the speed compared to fast mode.
2675 <tag/Limits/<itemize>
2676 <item>The function is specific to the C128.
2677 </itemize>
2678 <tag/Availability/C128
2679 <tag/See also/
2680 <ref id="fast" name="fast">,
2681 <ref id="toggle_videomode" name="toggle_videomode">
2682 <tag/Example/None.
2683 </descrip>
2684 </quote>
2685
2686
2687 <sect1>srand<label id="srand"><p>
2688
2689 <quote>
2690 <descrip>
2691 <tag/Function/Initialize the pseudo random number generator.
2692 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2693 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
2694 <tag/Description/The function initializes the random number generator using
2695 the given seed. On program startup, the generator behaves as if <tt/srand/ has
2696 been called with an argument of 1.
2697 <tag/Limits/<itemize>
2698 <item>The function is only available as fastcall function, so it may only
2699 be used in presence of a prototype.
2700 </itemize>
2701 <tag/Availability/ISO 9899
2702 <tag/See also/
2703 <ref id="_randomize" name="_randomize">,
2704 <ref id="rand" name="rand">
2705 <tag/Example/None.
2706 </descrip>
2707 </quote>
2708
2709
2710 <sect1>strcasecmp<label id="strcasecmp"><p>
2711
2712 <quote>
2713 <descrip>
2714 <tag/Function/Compare two strings case insensitive.
2715 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2716 <tag/Declaration/<tt/int __fastcall__ strcasecmp (const char* s1, const char* s2);/
2717 <tag/Description/The <tt/strcasecmp/ function compares the two strings passed
2718 as parameters without case sensitivity. It returns a value that is less than
2719 zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
2720 and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
2721 <tag/Limits/<itemize>
2722 <item>The function is only available as fastcall function, so it may only
2723 be used in presence of a prototype.
2724 <item>The function is not available in strict ANSI mode.
2725 </itemize>
2726 <tag/Availability/cc65
2727 <tag/See also/
2728 <ref id="strcmp" name="strcmp">,
2729 <ref id="strcoll" name="strcoll">,
2730 <ref id="stricmp" name="stricmp">
2731 <tag/Example/None.
2732 </descrip>
2733 </quote>
2734
2735
2736 <sect1>strcat<label id="strcat"><p>
2737
2738 <quote>
2739 <descrip>
2740 <tag/Function/Concatentate two strings.
2741 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2742 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
2743 <tag/Description/The <tt/strcat/ function appends a copy of the string
2744 pointed to by s2 (including the terminating null byte) to the end of the
2745 string pointed to by s1. The initial byte of s2 overwrites the null byte at
2746 the end of s1.
2747 <tag/Limits/<itemize>
2748 <item>The function is only available as fastcall function, so it may only
2749 be used in presence of a prototype.
2750 <item>If copying takes place between objects that overlap, the behavior
2751 is undefined.
2752 </itemize>
2753 <tag/Availability/ISO 9899
2754 <tag/See also/
2755 <ref id="strcpy" name="strcpy">
2756 <ref id="strncpy" name="strncpy">
2757 <tag/Example/None.
2758 </descrip>
2759 </quote>
2760
2761
2762 <sect1>strchr<label id="strchr"><p>
2763
2764 <quote>
2765 <descrip>
2766 <tag/Function/Search for a character in a string.
2767 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2768 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
2769 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
2770 (converted to a char) in the string pointed to by <tt/s/. The terminating null
2771 byte is considered to be part of the string. Upon completion, the function
2772 returns a pointer to the byte, or a null pointer if the byte was not found.
2773 <tag/Limits/<itemize>
2774 <item>The function is only available as fastcall function, so it may only
2775 be used in presence of a prototype.
2776 </itemize>
2777 <tag/Availability/ISO 9899
2778 <tag/See also/
2779 <ref id="strrchr" name="strrchr">
2780 <tag/Example/None.
2781 </descrip>
2782 </quote>
2783
2784
2785 <sect1>strcmp<label id="strcmp"><p>
2786
2787 <quote>
2788 <descrip>
2789 <tag/Function/Compare two strings.
2790 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2791 <tag/Declaration/<tt/int __fastcall__ strcmp (const char* s1, const char* s2);/
2792 <tag/Description/The <tt/strcmp/ function compares the two strings passed as
2793 parameters. It returns a value that is less than zero if <tt/s1/ is less than
2794 <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater than zero
2795 if <tt/s1/ is greater than <tt/s2/.
2796 <tag/Limits/<itemize>
2797 <item>The function is only available as fastcall function, so it may only
2798 be used in presence of a prototype.
2799 </itemize>
2800 <tag/Availability/ISO 9899
2801 <tag/See also/
2802 <ref id="strcasecmp" name="strcasecmp">,
2803 <ref id="strcoll" name="strcoll">,
2804 <ref id="stricmp" name="stricmp">
2805 <tag/Example/None.
2806 </descrip>
2807 </quote>
2808
2809
2810 <sect1>strcoll<label id="strcoll"><p>
2811
2812 <quote>
2813 <descrip>
2814 <tag/Function/Compare two strings.
2815 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2816 <tag/Declaration/<tt/int __fastcall__ strcoll (const char* s1, const char* s2);/
2817 <tag/Description/The <tt/strcoll/ function compares the two strings passed as
2818 parameters, according to the collating sequence set by <tt/<ref id="setlocale"
2819 name="setlocale">/. It returns a value that is less than zero if <tt/s1/ is
2820 less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater
2821 than zero if <tt/s1/ is greater than <tt/s2/.
2822 <tag/Limits/<itemize>
2823 <item>The function is only available as fastcall function, so it may only
2824 be used in presence of a prototype.
2825 </itemize>
2826 <tag/Availability/ISO 9899
2827 <tag/See also/
2828 <ref id="setlocale" name="setlocale">,
2829 <ref id="strcasecmp" name="strcasecmp">,
2830 <ref id="strcmp" name="strcmp">,
2831 <ref id="stricmp" name="stricmp">
2832 <tag/Example/None.
2833 </descrip>
2834 </quote>
2835
2836
2837 <sect1>strcpy<label id="strcpy"><p>
2838
2839 <quote>
2840 <descrip>
2841 <tag/Function/Copy a string.
2842 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2843 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
2844 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
2845 <tt/s2/ (including the terminating null byte) into the array pointed to by
2846 <tt/s1/. The function will always return <tt/s1/.
2847 <tag/Limits/<itemize>
2848 <item>The function is only available as fastcall function, so it may only
2849 be used in presence of a prototype.
2850 <item>If copying takes place between objects that overlap, the behavior
2851 is undefined.
2852 </itemize>
2853 <tag/Availability/ISO 9899
2854 <tag/See also/
2855 <ref id="strcat" name="strcat">
2856 <ref id="strncpy" name="strncpy">
2857 <tag/Example/
2858 <verb>
2859 #include <string.h>
2860
2861 static char hello[14];
2862
2863 strcpy (hello, "Hello world!\n");
2864 </verb>
2865 </descrip>
2866 </quote>
2867
2868
2869 <sect1>stricmp<label id="stricmp"><p>
2870
2871 <quote>
2872 <descrip>
2873 <tag/Function/Compare two strings case insensitive.
2874 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2875 <tag/Declaration/<tt/int __fastcall__ stricmp (const char* s1, const char* s2);/
2876 <tag/Description/The <tt/stricmp/ function compares the two strings passed as
2877 parameters without case sensitivity. It returns a value that is less than zero
2878 if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
2879 value greater than zero if <tt/s1/ is greater than <tt/s2/.
2880 <tag/Limits/<itemize>
2881 <item>The function is only available as fastcall function, so it may only
2882 be used in presence of a prototype.
2883 <item>The function is not available in strict ANSI mode.
2884 </itemize>
2885 <tag/Availability/cc65
2886 <tag/See also/
2887 <ref id="strcasecmp" name="strcasecmp">,
2888 <ref id="strcmp" name="strcmp">,
2889 <ref id="strcoll" name="strcoll">
2890 <tag/Example/None.
2891 </descrip>
2892 </quote>
2893
2894
2895 <sect1>strlen<label id="strlen"><p>
2896
2897 <quote>
2898 <descrip>
2899 <tag/Function/Return the length of a string.
2900 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2901 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
2902 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
2903 string to which s points, not including the terminating null byte.
2904 <tag/Limits/<itemize>
2905 <item>The function is only available as fastcall function, so it may only
2906 be used in presence of a prototype.
2907 <item>When compiling with <tt/-Os/ (inline known standard functions), the
2908 function does not work correctly for strings with more than 255 characters.
2909 </itemize>
2910 <tag/Availability/ISO 9899
2911 <tag/See also/
2912 <ref id="strcpy" name="strcpy">
2913 <tag/Example/None.
2914 </descrip>
2915 </quote>
2916
2917
2918 <sect1>strlower<label id="strlower"><p>
2919
2920 <quote>
2921 <descrip>
2922 <tag/Function/Make a string lower case.
2923 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2924 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
2925 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
2926 function to each character of a string. The function will always return <tt/s/.
2927 <tag/Limits/<itemize>
2928 <item>The function is only available as fastcall function, so it may only
2929 be used in presence of a prototype.
2930 <item>The function prototype is unavailable when compiling in strict ANSI mode.
2931 <item>An alias name for this function is <tt/strlwr/.
2932 </itemize>
2933 <tag/Availability/cc65
2934 <tag/See also/
2935 <ref id="strupper" name="strupper">
2936 <ref id="tolower" name="tolower">
2937 <tag/Example/None.
2938 </descrip>
2939 </quote>
2940
2941
2942 <sect1>strlwr<label id="strlwr"><p>
2943
2944 <quote>
2945 See <tt/strlower/.
2946 </quote>
2947
2948
2949 <sect1>strncpy<label id="strncpy"><p>
2950
2951 <quote>
2952 <descrip>
2953 <tag/Function/Copy part of a string.
2954 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2955 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
2956 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
2957 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
2958 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
2959 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
2960 written. The function will always return <tt/s1/.
2961 <tag/Limits/<itemize>
2962 <item>The function is only available as fastcall function, so it may only
2963 be used in presence of a prototype. If there is no null byte in the first <tt/n/
2964 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
2965 <item>If copying takes place between objects that overlap, the behavior is
2966 undefined.
2967 </itemize>
2968 <tag/Availability/ISO 9899
2969 <tag/See also/
2970 <ref id="strcat" name="strcat">
2971 <ref id="strcpy" name="strcpy">
2972 <tag/Example/
2973 <verb>
2974 #include <string.h>
2975
2976 static char hello[6];
2977
2978 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
2979 hello[5] = '\0';
2980 </verb>
2981 </descrip>
2982 </quote>
2983
2984
2985 <sect1>strrchr<label id="strrchr"><p>
2986
2987 <quote>
2988 <descrip>
2989 <tag/Function/Search for a character in a string.
2990 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2991 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
2992 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
2993 (converted to a char) in the string pointed to by <tt/s/. The terminating null
2994 byte is considered to be part of the string. Upon completion, the function
2995 returns a pointer to the byte, or a null pointer if the byte was not found.
2996 <tag/Limits/<itemize>
2997 <item>The function is only available as fastcall function, so it may only
2998 be used in presence of a prototype.
2999 </itemize>
3000 <tag/Availability/ISO 9899
3001 <tag/See also/
3002 <ref id="strchr" name="strchr">
3003 <tag/Example/None.
3004 </descrip>
3005 </quote>
3006
3007
3008 <sect1>strupper<label id="strupper"><p>
3009
3010 <quote>
3011 <descrip>
3012 <tag/Function/Make a string upper case.
3013 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3014 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
3015 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
3016 function to each character of a string. The function will always return <tt/s/.
3017 <tag/Limits/<itemize>
3018 <item>The function is only available as fastcall function, so it may only
3019 be used in presence of a prototype.
3020 <item>The function prototype is unavailable when compiling in strict ANSI mode.
3021 <item>An alias name for this function is <tt/strupr/.
3022 </itemize>
3023 <tag/Availability/cc65
3024 <tag/See also/
3025 <ref id="strlower" name="strlower">
3026 <ref id="toupper" name="toupper">
3027 <tag/Example/None.
3028 </descrip>
3029 </quote>
3030
3031
3032 <sect1>strupr<label id="strupr"><p>
3033
3034 <quote>
3035 See <tt/strupper/.
3036 </quote>
3037
3038
3039 <sect1>textcolor<label id="textcolor"><p>
3040
3041 <quote>
3042 <descrip>
3043 <tag/Function/Set the text color.
3044 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3045 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
3046 <tag/Description/The function will set a new text color. It returns the old
3047 (current) text color. Text output using any <tt/conio.h/ function will use
3048 the color set by this function.
3049 <tag/Limits/<itemize>
3050 <item>Text colors are system dependent. The function may have no effect
3051 on systems where the text color cannot be changed.
3052 <item>The function is only available as fastcall function, so it may only
3053 be used in presence of a prototype.
3054 </itemize>
3055 <tag/Availability/cc65
3056 <tag/See also/
3057 <ref id="bgcolor" name="bgcolor">,
3058 <ref id="bordercolor" name="bordercolor">
3059 <tag/Example/None.
3060 </descrip>
3061 </quote>
3062
3063
3064 <sect1>toggle_videomode<label id="toggle_videomode"><p>
3065
3066 <quote>
3067 <descrip>
3068 <tag/Function/Toggle between 40 and 80 column mode.
3069 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
3070 <tag/Declaration/<tt/void toggle_videomode (void);/
3071 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
3072 old mode (cursor position, color and so on) are saved and restored together
3073 with the mode.
3074 <tag/Limits/<itemize>
3075 <item>The function is specific to the C128.
3076 </itemize>
3077 <tag/Availability/C128
3078 <tag/See also/
3079 <ref id="fast" name="fast">,
3080 <ref id="slow" name="slow">
3081 <tag/Example/None.
3082 </descrip>
3083 </quote>
3084
3085
3086 <sect1>tolower<label id="tolower"><p>
3087
3088 <quote>
3089 <descrip>
3090 <tag/Function/Convert a character into its lower case representation.
3091 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
3092 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
3093 <tag/Description/The function returns the given character converted to lower
3094 case. If the given character is not a letter, it is returned unchanged.
3095 <tag/Limits/<itemize>
3096 <item>The function is only available as fastcall function, so it may
3097 only be used in presence of a prototype.
3098 </itemize>
3099 <tag/Availability/ISO 9899
3100 <tag/See also/
3101 <ref id="islower" name="islower">,
3102 <ref id="isupper" name="isupper">,
3103 <ref id="toupper" name="toupper">
3104 <tag/Example/None.
3105 </descrip>
3106 </quote>
3107
3108
3109 <sect1>toupper<label id="toupper"><p>
3110
3111 <quote>
3112 <descrip>
3113 <tag/Function/Convert a character into its upper case representation.
3114 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
3115 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
3116 <tag/Description/The function returns the given character converted to upper
3117 case. If the given character is not a letter, it is returned unchanged.
3118 <tag/Limits/<itemize>
3119 <item>The function is only available as fastcall function, so it may
3120 only be used in presence of a prototype.
3121 </itemize>
3122 <tag/Availability/ISO 9899
3123 <tag/See also/
3124 <ref id="islower" name="islower">,
3125 <ref id="isupper" name="isupper">,
3126 <ref id="tolower" name="tolower">
3127 <tag/Example/None.
3128 </descrip>
3129 </quote>
3130
3131
3132 <sect1>ultoa<label id="ultoa"><p>
3133
3134 <quote>
3135 <descrip>
3136 <tag/Function/Convert an unsigned long integer into a string.
3137 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3138 <tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
3139 <tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
3140 string using <tt/radix/ as the base.
3141 <tag/Limits/<itemize>
3142 <item>There are no provisions to prevent a buffer overflow.
3143 <item>The function is non standard, so it is not available in strict ANSI mode.
3144 You should probably use <tt/sprintf/ instead.
3145 <item>The function is only available as fastcall function, so it may only be
3146 used in presence of a prototype.
3147 </itemize>
3148 <tag/Availability/cc65
3149 <tag/See also/
3150 <ref id="atoi" name="atoi">,
3151 <ref id="atol" name="atol">,
3152 <ref id="itoa" name="itoa">,
3153 <ref id="ltoa" name="ltoa">,
3154 <ref id="utoa" name="utoa">
3155 <tag/Example/None.
3156 </descrip>
3157 </quote>
3158
3159
3160 <sect1>utoa<label id="utoa"><p>
3161
3162 <quote>
3163 <descrip>
3164 <tag/Function/Convert an unsigned integer into a string.
3165 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3166 <tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
3167 <tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
3168 using <tt/radix/ as the base.
3169 <tag/Limits/<itemize>
3170 <item>There are no provisions to prevent a buffer overflow.
3171 <item>The function is non standard, so it is not available in strict ANSI mode.
3172 You should probably use <tt/sprintf/ instead.
3173 <item>The function is only available as fastcall function, so it may only be
3174 used in presence of a prototype.
3175 </itemize>
3176 <tag/Availability/cc65
3177 <tag/See also/
3178 <ref id="atoi" name="atoi">,
3179 <ref id="atol" name="atol">,
3180 <ref id="itoa" name="itoa">,
3181 <ref id="ltoa" name="ltoa">,
3182 <ref id="ultoa" name="ultoa">
3183 <tag/Example/None.
3184 </descrip>
3185 </quote>
3186
3187
3188 <sect1>wherex<label id="wherex"><p>
3189
3190 <quote>
3191 <descrip>
3192 <tag/Function/Return the current X position of the text mode cursor.
3193 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3194 <tag/Declaration/<tt/unsigned char wherex (void);/
3195 <tag/Description/The function returns the current X position of the text mode
3196 cursor. Zero is returned for the leftmost screen position.
3197 <tag/Availability/cc65
3198 <tag/See also/
3199 <ref id="gotox" name="gotox">,
3200 <ref id="gotoy" name="gotoy">,
3201 <ref id="gotoxy" name="gotoxy">,
3202 <ref id="wherey" name="wherey">
3203 <tag/Example/None.
3204 </descrip>
3205 </quote>
3206
3207
3208 <sect1>wherey<label id="wherey"><p>
3209
3210 <quote>
3211 <descrip>
3212 <tag/Function/Return the current Y position of the text mode cursor.
3213 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3214 <tag/Declaration/<tt/unsigned char wherey (void);/
3215 <tag/Description/The function returns the current Y position of the text mode
3216 cursor. Zero is returned for the uppermost screen position.
3217 <tag/Availability/cc65
3218 <tag/See also/
3219 <ref id="gotox" name="gotox">,
3220 <ref id="gotoy" name="gotoy">,
3221 <ref id="gotoxy" name="gotoxy">,
3222 <ref id="wherex" name="wherex">
3223 <tag/Example/None.
3224 </descrip>
3225 </quote>
3226
3227
3228 </article>
3229
3230