]> 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>bsearch<label id="bsearch"><p>
869
870 <quote>
871 <descrip>
872 <tag/Function/Do a binary search in a sorted array.
873 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
874 <tag/Declaration/<tt/void* __fastcall__ bsearch (const void* key,
875 const void* base, size_t n, size_t size,
876 int (*cmp) (const void*, const void*));/
877 <tag/Description/<tt/bsearch/ searches a sorted array for a member that
878 matches the one pointed to by <tt/key/. <tt/base/ is the address of the array,
879 <tt/n/ is the number of elements, <tt/size/ the size of an element and <tt/cmp/
880 the function used to compare the members against the key. The function returns
881 a pointer to the member found, or <tt/NULL/ if there was no match.
882 <tag/Limits/
883 <itemize>
884 <item>The contents of the array must be sorted in ascending order according to
885 the compare function given.
886 <item>If there are multiple members that match the key, the function will
887 return one of the members.
888 <item>The function is only available as fastcall function, so it may only
889 be used in presence of a prototype.
890 </itemize>
891 <tag/Availability/ISO 9899
892 <tag/See also/
893 <ref id="qsort" name="qsort">
894 <tag/Example/None.
895 </descrip>
896 </quote>
897
898
899 <sect1>bzero<label id="bzero"><p>
900
901 <quote>
902 <descrip>
903 <tag/Function/Fill a memory area with zeroes.
904 <tag/Header/<tt/<ref id="string.h" name="string.h">/
905 <tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
906 <tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
907 zero.
908 <tag/Limits/
909 <itemize>
910 <item>The function is non standard and therefore only available in non ANSI
911 mode. You should use <tt/<ref id="memset" name="memset">/ instead.
912 <item>The function is only available as fastcall function, so it may only
913 be used in presence of a prototype.
914 </itemize>
915 <tag/Availability/cc65
916 <tag/See also/
917 <ref id="_swap" name="_swap">,
918 <ref id="memcpy" name="memcpy">,
919 <ref id="memmove" name="memmove">,
920 <ref id="memset" name="memset">,
921 <tag/Example/None.
922 </descrip>
923 </quote>
924
925
926 <sect1>c64mode<label id="c64mode"><p>
927
928 <quote>
929 <descrip>
930 <tag/Function/Switch the C128 into C64 compatible mode.
931 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
932 <tag/Declaration/<tt/void c64mode (void);/
933 <tag/Description/The function will cause the machine to reboot into C64 mode.
934 <tag/Limits/<itemize>
935 <item>The function is specific to the C128.
936 <item>The function will not return to the caller.
937 </itemize>
938 <tag/Availability/C128
939 <tag/Example/None.
940 </descrip>
941 </quote>
942
943
944 <sect1>calloc<label id="calloc"><p>
945
946 <quote>
947 <descrip>
948 <tag/Function/Allocate and clear memory.
949 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
950 <tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
951 <tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
952 of size <tt/size/, clears the whole block with binary zeroes and returns a
953 pointer to it. On error (not enough memory available), <tt/calloc/ returns
954 <tt/NULL/.
955 <tag/Limits/
956 <itemize>
957 <item>Clearing the memory may not have the expected effect on all platforms:
958 pointers in the block may not be <tt/NULL/ and floating point variables may
959 not be zero (0.0). In other words: The "clearing" effect of this function
960 should be used with care for portable programs.
961 <item>The function is only available as fastcall function, so it may only
962 be used in presence of a prototype.
963 </itemize>
964 <tag/Availability/ISO 9899
965 <tag/See also/
966 <ref id="_heapadd" name="_heapadd">,
967 <ref id="_heapmaxavail" name="_heapmaxavail">,
968 <ref id="_heapmemavail" name="_heapmemavail">,
969 <ref id="free" name="free">,
970 <ref id="malloc" name="malloc">,
971 <ref id="realloc" name="realloc">
972 <tag/Example/None.
973 </descrip>
974 </quote>
975
976
977 <sect1>cclear<label id="cclear"><p>
978
979 <quote>
980 <descrip>
981 <tag/Function/Clear part of a line (write a given amount of spaces).
982 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
983 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
984 <tag/Description/The function clears part of a line by writing <tt/length/
985 spaces in the current text color.
986 <tag/Limits/<itemize>
987 <item>The function is only available as fastcall function, so it may
988 only be used in presence of a prototype.
989 </itemize>
990 <tag/Availability/cc65
991 <tag/See also/
992 <ref id="cclearxy" name="cclearxy">,
993 <ref id="clrscr" name="clrscr">
994 <tag/Example/None.
995 </descrip>
996 </quote>
997
998
999 <sect1>cclearxy<label id="cclearxy"><p>
1000
1001 <quote>
1002 <descrip>
1003 <tag/Function/Clear part of a line (write a given amount of spaces) starting
1004 at a specific screen position.
1005 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1006 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char length);/
1007 <tag/Description/The function moves the cursor to a specific position, and
1008 will then clear part of the line by writing <tt/length/ spaces in the current
1009 text color.
1010 <tag/Limits/<itemize>
1011 <item>The function is only available as fastcall function, so it may
1012 only be used in presence of a prototype.
1013 </itemize>
1014 <tag/Availability/cc65
1015 <tag/See also/
1016 <ref id="cclear" name="cclear">,
1017 <ref id="clrscr" name="clrscr">
1018 <tag/Example/None.
1019 </descrip>
1020 </quote>
1021
1022
1023 <sect1>cgetc<label id="cgetc"><p>
1024
1025 <quote>
1026 <descrip>
1027 <tag/Function/Read a character from the keyboard.
1028 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1029 <tag/Declaration/<tt/char cgetc (void);/
1030 <tag/Description/The function reads a character from the keyboard. If there is
1031 no character available, <tt/cgetc/ waits until the user presses a key. If the
1032 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
1033 displayed while waiting.
1034 <tag/Limits/<itemize>
1035 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
1036 from this buffer and wait only if the buffer is empty.
1037 </itemize>
1038 <tag/Availability/cc65
1039 <tag/See also/
1040 <ref id="cursor" name="cursor">,
1041 <ref id="kbhit" name="kbhit">
1042 <tag/Example/None.
1043 </descrip>
1044 </quote>
1045
1046
1047 <sect1>chline<label id="chline"><p>
1048
1049 <quote>
1050 <descrip>
1051 <tag/Function/Output a horizontal line in text mode.
1052 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1053 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
1054 <tag/Description/The function outputs a horizontal line with the given length
1055 starting at the current cursor position.
1056 <tag/Limits/<itemize>
1057 <item>The character used to draw the horizontal line is system dependent.
1058 If available, a line drawing character is used. Drawing a line that is partially
1059 off screen leads to undefined behaviour.
1060 <item>The function is only available as fastcall function, so it may only be
1061 used in presence of a prototype.
1062 </itemize>
1063 <tag/Availability/cc65
1064 <tag/See also/
1065 <ref id="chlinexy" name="chlinexy">,
1066 <ref id="cvline" name="cvline">,
1067 <ref id="cvlinexy" name="cvlinexy">
1068 <tag/Example/None.
1069 </descrip>
1070 </quote>
1071
1072
1073 <sect1>chlinexy<label id="chlinexy"><p>
1074
1075 <quote>
1076 <descrip>
1077 <tag/Function/Output a horizontal line at a given position in text mode.
1078 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1079 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
1080 <tag/Description/The function outputs a horizontal line with the given length
1081 starting at a given position.
1082 <tag/Limits/<itemize>
1083 <item>The character used to draw the horizontal line is system dependent.
1084 If available, a line drawing character is used. Drawing a line that is partially
1085 off screen leads to undefined behaviour.
1086 <item>The function is only available as fastcall function, so it may only be
1087 used in presence of a prototype.
1088 </itemize>
1089 <tag/Availability/cc65
1090 <tag/See also/
1091 <ref id="chline" name="chline">,
1092 <ref id="cvline" name="cvline">,
1093 <ref id="cvlinexy" name="cvlinexy">
1094 <tag/Example/None.
1095 </descrip>
1096 </quote>
1097
1098
1099 <sect1>clrscr<label id="clrscr"><p>
1100
1101 <quote>
1102 <descrip>
1103 <tag/Function/Clear the text screen.
1104 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1105 <tag/Declaration/<tt/void clrscr (void);/
1106 <tag/Description/The function clears the text screen and moves the cursor to
1107 the upper left corner.
1108 <tag/Availability/cc65
1109 <tag/See also/
1110 <ref id="cclear" name="cclear">,
1111 <ref id="cclearxy" name="cclearxy">
1112 <tag/Example/None.
1113 </descrip>
1114 </quote>
1115
1116
1117 <sect1>close<label id="close"><p>
1118
1119 <quote>
1120 <descrip>
1121 <tag/Function/Close a file descriptor.
1122 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1123 <tag/Declaration/<tt/int __fastcall__ close (int fd);/
1124 <tag/Description/The function closes the given file descriptor. It returns zero
1125 on success and -1 on error. If an error occurs, the cause can be determined by
1126 reading the <tt/errno/ variable.
1127 <tag/Limits/<itemize>
1128 <item>The function is only available as fastcall function, so it may only
1129 be used in presence of a prototype.
1130 </itemize>
1131 <tag/Availability/POSIX
1132 <tag/See also/
1133 <ref id="creat" name="creat">,
1134 <ref id="open" name="open">
1135 <tag/Example/None.
1136 </descrip>
1137 </quote>
1138
1139
1140 <sect1>creat<label id="creat"><p>
1141
1142 <quote>
1143 <descrip>
1144 <tag/Function/Create a file.
1145 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1146 <tag/Declaration/<tt/int __fastcall__ creat (const char* name, unsigned mode);/
1147 <tag/Description/<tt/creat/ creates a new file and returns the file descriptor
1148 associated with it. On error, -1 is returned and an error code is stored in
1149 <tt/errno/.
1150 <tag/Limits/<itemize>
1151 <item><tt/creat/ is identical to calling <tt/<ref id="open" name="open">/ with
1152 <tt/flags/ equal to <tt/O_WRONLY | O_CREAT | O_TRUNC/.
1153 <item>The function is only available as fastcall function, so it may only
1154 be used in presence of a prototype.
1155 </itemize>
1156 <tag/Availability/POSIX
1157 <tag/See also/
1158 <ref id="close" name="close">,
1159 <ref id="open" name="open">
1160 <tag/Example/None.
1161 </descrip>
1162 </quote>
1163
1164
1165 <sect1>cursor<label id="cursor"><p>
1166
1167 <quote>
1168 <descrip>
1169 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
1170 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1171 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
1172 <tag/Description/If the argument to the function is non zero, a blinking cursor
1173 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
1174 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
1175 <tag/Limits/<itemize>
1176 <item>The function is only available as fastcall function, so it may only
1177 be used in presence of a prototype.
1178 </itemize>
1179 <tag/Availability/cc65
1180 <tag/See also/
1181 <ref id="cgetc" name="cgetc">,
1182 <ref id="kbhit" name="kbhit">
1183 <tag/Example/None.
1184 </descrip>
1185 </quote>
1186
1187
1188 <sect1>cvline<label id="cvline"><p>
1189
1190 <quote>
1191 <descrip>
1192 <tag/Function/Output a vertical line in text mode.
1193 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1194 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
1195 <tag/Description/The function outputs a vertical line with the given length
1196 starting at the current cursor position.
1197 <tag/Limits/<itemize>
1198 <item>The character used to draw the vertical line is system dependent.
1199 If available, a line drawing character is used. Drawing a line that is partially
1200 off screen leads to undefined behaviour.
1201 <item>The function is only available as fastcall function, so it may only be
1202 used in presence of a prototype.
1203 </itemize>
1204 <tag/Availability/cc65
1205 <tag/See also/
1206 <ref id="chline" name="chline">,
1207 <ref id="chlinexy" name="chlinexy">,
1208 <ref id="cvlinexy" name="cvlinexy">
1209 <tag/Example/None.
1210 </descrip>
1211 </quote>
1212
1213
1214 <sect1>cvlinexy<label id="cvlinexy"><p>
1215
1216 <quote>
1217 <descrip>
1218 <tag/Function/Output a vertical line at a given position in text mode.
1219 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1220 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
1221 <tag/Description/The function outputs a vertical line with the given length
1222 starting at a given position.
1223 <tag/Limits/<itemize>
1224 <item>The character used to draw the vertical line is system dependent.
1225 If available, a line drawing character is used. Drawing a line that is partially
1226 off screen leads to undefined behaviour.
1227 <item>The function is only available as fastcall function, so it may only be
1228 used in presence of a prototype.
1229 </itemize>
1230 <tag/Availability/cc65
1231 <tag/See also/
1232 <ref id="chline" name="chline">,
1233 <ref id="chlinexy" name="chlinexy">,
1234 <ref id="cvline" name="cvline">
1235 <tag/Example/None.
1236 </descrip>
1237 </quote>
1238
1239
1240 <sect1>div<label id="div"><p>
1241
1242 <quote>
1243 <descrip>
1244 <tag/Function/Divide two ints and return quotient and remainder.
1245 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1246 <tag/Declaration/<tt/div_t __fastcall__ div (int numer, int denom);/
1247 <tag/Description/<tt/div/ divides <tt/numer/ by <tt/denom/ and returns the
1248 quotient and remainder in a <tt/div_t/ structure.
1249 <tag/Limits/
1250 <itemize>
1251 <item>The function is only available as fastcall function, so it may only
1252 be used in presence of a prototype.
1253 </itemize>
1254 <tag/Availability/ISO 9899
1255 <tag/See also/
1256 ldiv
1257 <tag/Example/None.
1258 </descrip>
1259 </quote>
1260
1261
1262 <sect1>em_commit<label id="em_commit"><p>
1263
1264 <quote>
1265 <descrip>
1266 <tag/Function/Commit changes into extended memory.
1267 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1268 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
1269 <tag/Description/Commit changes in the memory window to extended storage. If
1270 the contents of the memory window have been changed, these changes may be lost
1271 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
1272 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
1273 name="em_copyto">/ are called without calling <tt/em_commit/ first.
1274 <tag/Limits/<itemize>
1275 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
1276 memory window are discarded, it does just mean that the drivers is allowed
1277 to discard it.
1278 <item>The function is only available as fastcall function, so it may only be
1279 used in presence of a prototype.
1280 <item>The function produces undefined results if no extended memory driver is
1281 loaded.
1282 </itemize>
1283 <tag/Availability/cc65
1284 <tag/See also/
1285 <ref id="em_load_driver" name="em_load_driver">,
1286 <ref id="em_map" name="em_map">,
1287 <ref id="em_use" name="em_use">
1288 <tag/Example/None.
1289 </descrip>
1290 </quote>
1291
1292
1293 <sect1>em_copyfrom<label id="em_copyfrom"><p>
1294
1295 <quote>
1296 <descrip>
1297 <tag/Function/Copy from extended into normal memory.
1298 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1299 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
1300 <tag/Description/Copy data from extended memory into linear memory. Source and
1301 target addresses as well as the number of bytes to transfer are specified in
1302 the <tt/em_copy/ structure that is passed as a parameter.
1303 <tag/Limits/<itemize>
1304 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
1305 made any changes to the data in the window, call <tt/<ref id="em_commit"
1306 name="em_commit">/ first, or the changes are lost.
1307 <item>The function is only available as fastcall function, so it may only be
1308 used in presence of a prototype.
1309 <item>The function produces undefined results if no extended memory driver is
1310 loaded.
1311 </itemize>
1312 <tag/Availability/cc65
1313 <tag/See also/
1314 <ref id="em_commit" name="em_commit">,
1315 <ref id="em_copyto" name="em_copyto">,
1316 <ref id="em_load_driver" name="em_load_driver">
1317 <tag/Example/None.
1318 </descrip>
1319 </quote>
1320
1321
1322 <sect1>em_copyto<label id="em_copyto"><p>
1323
1324 <quote>
1325 <descrip>
1326 <tag/Function/Copy from normal into extended memory.
1327 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1328 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
1329 <tag/Description/Copy data from linear into extended memory. Source and
1330 target addresses as well as the number of bytes to transfer are specified in
1331 the <tt/em_copy/ structure that is passed as a parameter.
1332 <tag/Limits/<itemize>
1333 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
1334 made any changes to the data in the window, call <tt/<ref id="em_commit"
1335 name="em_commit">/ first, or the changes are lost.
1336 <item>The function is only available as fastcall function, so it may only be
1337 used in presence of a prototype.
1338 <item>The function produces undefined results if no extended memory driver is
1339 loaded.
1340 </itemize>
1341 <tag/Availability/cc65
1342 <tag/See also/
1343 <ref id="em_commit" name="em_commit">,
1344 <ref id="em_copyfrom" name="em_copyfrom">,
1345 <ref id="em_load_driver" name="em_load_driver">
1346 <tag/Example/None.
1347 </descrip>
1348 </quote>
1349
1350
1351 <sect1>em_load_driver<label id="em_load_driver"><p>
1352
1353 <quote>
1354 <descrip>
1355 <tag/Function/Load and initialize an extended memory driver.
1356 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1357 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
1358 <tag/Description/Load an extended memory driver into memory and initialize
1359 it. The function returns an error code that tells if all this has been
1360 successful.
1361 <tag/Limits/<itemize>
1362 <item>Not all drivers are able to detect if the supported hardware is really
1363 present.
1364 <item>The function is only available as fastcall function, so it may only be
1365 used in presence of a prototype.
1366 <item>The driver is loaded by name, so currently you must know the type of
1367 extended memory that should be supported. There is no autodetect capability.
1368 </itemize>
1369 <tag/Availability/cc65
1370 <tag/See also/
1371 <ref id="em_unload" name="em_unload">
1372 <tag/Example/None.
1373 </descrip>
1374 </quote>
1375
1376
1377 <sect1>em_map<label id="em_map"><p>
1378
1379 <quote>
1380 <descrip>
1381 <tag/Function/Make a page of extended memory accessible.
1382 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1383 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
1384 <tag/Description/The function maps one page of extended memory into linear
1385 memory and returns a pointer to the page frame. Depending on the hardware
1386 and driver, the data is either mapped into the address space or transfered
1387 into a buffer. If you don't need the actual contents of the page (for example
1388 because you're going to overwrite it completely, it is better to call
1389 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
1390 data if it is possible to avoid that.
1391 <tag/Limits/<itemize>
1392 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
1393 made any changes to the data in the window, call <tt/<ref id="em_commit"
1394 name="em_commit">/ first, or the changes are lost.
1395 <item>The function is only available as fastcall function, so it may only be
1396 used in presence of a prototype.
1397 <item>The function produces undefined results if no extended memory driver is
1398 loaded.
1399 </itemize>
1400 <tag/Availability/cc65
1401 <tag/See also/
1402 <ref id="em_commit" name="em_commit">,
1403 <ref id="em_load_driver" name="em_load_driver">,
1404 <ref id="em_use" name="em_use">
1405 <tag/Example/None.
1406 </descrip>
1407 </quote>
1408
1409
1410 <sect1>em_pagecount<label id="em_pagecount"><p>
1411
1412 <quote>
1413 <descrip>
1414 <tag/Function/Return the number of available extended memory pages.
1415 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1416 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
1417 <tag/Description/The function returns the size of the extended memory supported
1418 by the driver in 256 byte pages.
1419 <tag/Limits/<itemize>
1420 <item>The function returns zero if no extended memory driver is loaded.
1421 <item>The function may return zero if the supported hardware was not detected.
1422 </itemize>
1423 <tag/Availability/cc65
1424 <tag/See also/
1425 <ref id="em_load_driver" name="em_load_driver">
1426 <tag/Example/None.
1427 </descrip>
1428 </quote>
1429
1430
1431 <sect1>em_unload<label id="em_unload"><p>
1432
1433 <quote>
1434 <descrip>
1435 <tag/Function/Unload an extended memory driver.
1436 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1437 <tag/Declaration/<tt/void __fastcall__ em_unload (void);/
1438 <tag/Description/The function unloads a loaded extended memory driver and
1439 frees all memory allocated for the driver.
1440 <tag/Limits/<itemize>
1441 <item>The function does nothing if no driver is loaded.
1442 </itemize>
1443 <tag/Availability/cc65
1444 <tag/See also/
1445 <ref id="em_load_driver" name="em_load_driver">
1446 <tag/Example/None.
1447 </descrip>
1448 </quote>
1449
1450
1451 <sect1>em_use<label id="em_use"><p>
1452
1453 <quote>
1454 <descrip>
1455 <tag/Function/Prepare an extended memory page for use.
1456 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1457 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
1458 <tag/Description/The function maps one page of extended memory into linear
1459 memory and returns a pointer to the page frame. This function is similar to
1460 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
1461 actual memory window in the assumption that the existing data is wrong or
1462 will get overwritten.
1463 <tag/Limits/<itemize>
1464 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
1465 made any changes to the data in the window, call <tt/<ref id="em_commit"
1466 name="em_commit">/ first, or the changes are lost.
1467 <item>The function is only available as fastcall function, so it may only be
1468 used in presence of a prototype.
1469 <item>The function produces undefined results if no extended memory driver is
1470 loaded.
1471 </itemize>
1472 <tag/Availability/cc65
1473 <tag/See also/
1474 <ref id="em_commit" name="em_commit">,
1475 <ref id="em_load_driver" name="em_load_driver">,
1476 <ref id="em_map" name="em_map">
1477 <tag/Example/None.
1478 </descrip>
1479 </quote>
1480
1481
1482 <sect1>exit<label id="exit"><p>
1483
1484 <quote>
1485 <descrip>
1486 <tag/Function/Terminate the program.
1487 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1488 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
1489 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
1490 return code of the program. Before termination, all files are closed, buffered
1491 output is written and any functions registered with <tt/<ref id="atexit"
1492 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
1493 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
1494 name="stdlib.h">/.
1495 <tag/Limits/<itemize>
1496 <item>The function is only available as fastcall function, so it may only
1497 be used in presence of a prototype.
1498 <item>It depends on the host machine if the program return code can be
1499 evaluated or is ignored.
1500 </itemize>
1501 <tag/Availability/ISO 9899
1502 <tag/See also/
1503 <ref id="abort" name="abort">,
1504 <ref id="exit" name="exit">
1505 <tag/Example/None.
1506 </descrip>
1507 </quote>
1508
1509
1510 <sect1>fast<label id="fast"><p>
1511
1512 <quote>
1513 <descrip>
1514 <tag/Function/Switch the C128 into 2MHz mode.
1515 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1516 <tag/Declaration/<tt/void fast (void);/
1517 <tag/Description/The function will switch the clock of the C128 to 2MHz. This
1518 will nearly double the speed compared to slow mode.
1519 <tag/Limits/<itemize>
1520 <item>The function is specific to the C128.
1521 <item>2MHz clock will not work in 40 column mode.
1522 </itemize>
1523 <tag/Availability/C128
1524 <tag/See also/
1525 <ref id="slow" name="slow">,
1526 <ref id="toggle_videomode" name="toggle_videomode">
1527 <tag/Example/None.
1528 </descrip>
1529 </quote>
1530
1531
1532 <sect1>free<label id="free"><p>
1533
1534 <quote>
1535 <descrip>
1536 <tag/Function/Free a block of dynamic memory.
1537 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1538 <tag/Declaration/<tt/void __fastcall__ free (void* block);/
1539 <tag/Description/Free a block of dynamic memory previously allocated with
1540 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
1541 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
1542 pointer is <tt/NULL/, no action is performed.
1543 <tag/Limits/
1544 <itemize>
1545 <item>Passing an already free'd block to <tt/free/ again will cause undefined
1546 behaviour and may crash your program.
1547 <item>The function is only available as fastcall function, so it may only
1548 be used in presence of a prototype.
1549 </itemize>
1550 <tag/Availability/ISO 9899
1551 <tag/See also/
1552 <ref id="_heapadd" name="_heapadd">,
1553 <ref id="_heapmaxavail" name="_heapmaxavail">,
1554 <ref id="_heapmemavail" name="_heapmemavail">,
1555 <ref id="calloc" name="calloc">,
1556 <ref id="malloc" name="malloc">,
1557 <ref id="realloc" name="realloc">
1558 <tag/Example/None.
1559 </descrip>
1560 </quote>
1561
1562
1563 <sect1>getenv<label id="getenv"><p>
1564
1565 <quote>
1566 <descrip>
1567 <tag/Function/Return a value from the environment.
1568 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1569 <tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
1570 <tag/Description/The function searches the environment for an entry that
1571 matches <tt/name/ and returns its value. The environment consists of a list
1572 of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
1573 returns <tt/NULL/.
1574 <tag/Limits/<itemize>
1575 <item>What exactly is stored in the environment depends on the machine the
1576 program is running on.
1577 <item>The function is only available as fastcall function, so it may only
1578 be used in presence of a prototype.
1579 </itemize>
1580 <tag/Availability/ISO 9899
1581 <tag/Example/None.
1582 </descrip>
1583 </quote>
1584
1585
1586 <sect1>getcpu<label id="getcpu"><p>
1587
1588 <quote>
1589 <descrip>
1590 <tag/Function/Determine on which CPU the program is running.
1591 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
1592 <tag/Declaration/<tt/unsigned char getcpu (void);/
1593 <tag/Description/The function checks on which CPU the code is running. It
1594 returns one of the constants<itemize>
1595 <item><tt/CPU_6502/
1596 <item><tt/CPU_65C02/
1597 <item><tt/CPU_65816/
1598 </itemize>
1599 <tag/Limits/<itemize>
1600 <item>Other, more exotic CPU types are not disinguished.
1601 </itemize>
1602 <tag/Availability/cc65
1603 <tag/Example/None.
1604 </descrip>
1605 </quote>
1606
1607
1608 <sect1>gotox<label id="gotox"><p>
1609
1610 <quote>
1611 <descrip>
1612 <tag/Function/Move the text mode cursor to a new X position.
1613 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1614 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
1615 <tag/Description/The function moves the text mode cursor to the specified X
1616 position while leaving the Y position untouched. The leftmost position on the
1617 screen has the coordinate 0.
1618 <tag/Limits/<itemize>
1619 <item>The function is only available as fastcall function, so it may
1620 only be used in presence of a prototype.
1621 <item>Invalid values for the X position (out of screen coordinates) may
1622 lead to undefined behaviour.
1623 </itemize>
1624 <tag/Availability/cc65
1625 <tag/See also/
1626 <ref id="gotoy" name="gotoy">,
1627 <ref id="gotoxy" name="gotoxy">,
1628 <ref id="wherex" name="wherex">,
1629 <ref id="wherey" name="wherey">
1630 <tag/Example/None.
1631 </descrip>
1632 </quote>
1633
1634
1635 <sect1>gotoxy<label id="gotoxy"><p>
1636
1637 <quote>
1638 <descrip>
1639 <tag/Function/Move the text mode cursor to a new position.
1640 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1641 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
1642 <tag/Description/The function moves the text mode cursor to the specified
1643 position. The leftmost position on the screen has the X coordinate 0, the
1644 topmost line has the Y coordinate 0.
1645 <tag/Limits/<itemize>
1646 <item>The function is only available as fastcall function, so it may only be
1647 used in presence of a prototype.
1648 <item>Invalid values for any of both coordinates (out of screen positions) may
1649 lead to undefined behaviour.
1650 </itemize>
1651 <tag/Availability/cc65
1652 <tag/See also/
1653 <ref id="gotox" name="gotox">,
1654 <ref id="gotoy" name="gotoy">,
1655 <ref id="wherex" name="wherex">,
1656 <ref id="wherey" name="wherey">
1657 <tag/Example/None.
1658 </descrip>
1659 </quote>
1660
1661
1662 <sect1>gotoy<label id="gotoy"><p>
1663
1664 <quote>
1665 <descrip>
1666 <tag/Function/Move the text mode cursor to a new Y position.
1667 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1668 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
1669 <tag/Description/The function moves the text mode cursor to the specified Y
1670 position while leaving the X position untouched. The uppermost position on the
1671 screen has the coordinate 0.
1672 <tag/Limits/<itemize>
1673 <item>The function is only available as fastcall function, so it may
1674 only be used in presence of a prototype.
1675 <item>Invalid values for the Y position (out of screen coordinates) may lead
1676 to undefined behaviour.
1677 </itemize>
1678 <tag/Availability/cc65
1679 <tag/See also/
1680 <ref id="gotox" name="gotox">,
1681 <ref id="gotoxy" name="gotoxy">,
1682 <ref id="wherex" name="wherex">,
1683 <ref id="wherey" name="wherey">
1684 <tag/Example/None.
1685 </descrip>
1686 </quote>
1687
1688
1689 <sect1>isalnum<label id="isalnum"><p>
1690
1691 <quote>
1692 <descrip>
1693 <tag/Function/Check if a given character is a letter or digit.
1694 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1695 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
1696 <tag/Description/The function returns a value of zero if the given argument
1697 is a letter or digit. The return value is non zero if the character
1698 is anything else.
1699 <tag/Limits/<itemize>
1700 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1701 inline sequence generated by the macro will not work correctly for values
1702 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1703 this range. The non inline function may be accessed by <tt/#undef/'ing
1704 the macro.
1705 <item>When compiling without <tt/-Os/, the function is only available as
1706 fastcall function, so it may only be used in presence of a prototype.
1707 </itemize>
1708 <tag/Availability/ISO 9899
1709 <tag/See also/
1710 <ref id="isalpha" name="isalpha">,
1711 <ref id="isascii" name="isascii">,
1712 <ref id="isblank" name="isblank">,
1713 <ref id="iscntrl" name="iscntrl">,
1714 <ref id="isdigit" name="isdigit">,
1715 <ref id="isgraph" name="isgraph">,
1716 <ref id="islower" name="islower">,
1717 <ref id="isprint" name="isprint">,
1718 <ref id="ispunct" name="ispunct">,
1719 <ref id="isspace" name="isspace">,
1720 <ref id="isupper" name="isupper">,
1721 <ref id="isxdigit" name="isxdigit">
1722 <tag/Example/None.
1723 </descrip>
1724 </quote>
1725
1726
1727 <sect1>isalpha<label id="isalpha"><p>
1728
1729 <quote>
1730 <descrip>
1731 <tag/Function/Check if a given character is a letter.
1732 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1733 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
1734 <tag/Description/The function returns a value of zero if the given argument
1735 is a letter. The return value is non zero if the character is anything else.
1736 <tag/Limits/<itemize>
1737 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1738 inline sequence generated by the macro will not work correctly for values
1739 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1740 this range. The non inline function may be accessed by <tt/#undef/'ing the
1741 macro.
1742 <item>When compiling without <tt/-Os/, the function is only available as
1743 fastcall function, so it may only be used in presence of a prototype.
1744 </itemize>
1745 <tag/Availability/ISO 9899
1746 <tag/See also/
1747 <ref id="isalnum" name="isalnum">,
1748 <ref id="isascii" name="isascii">,
1749 <ref id="isblank" name="isblank">,
1750 <ref id="iscntrl" name="iscntrl">,
1751 <ref id="isdigit" name="isdigit">,
1752 <ref id="isgraph" name="isgraph">,
1753 <ref id="islower" name="islower">,
1754 <ref id="isprint" name="isprint">,
1755 <ref id="ispunct" name="ispunct">,
1756 <ref id="isspace" name="isspace">,
1757 <ref id="isupper" name="isupper">,
1758 <ref id="isxdigit" name="isxdigit">
1759 <tag/Example/None.
1760 </descrip>
1761 </quote>
1762
1763
1764 <sect1>isascii<label id="isascii"><p>
1765
1766 <quote>
1767 <descrip>
1768 <tag/Function/Check if a given character is in the ASCII (0..127) range.
1769 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1770 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
1771 <tag/Description/The function returns a value of zero if the given argument
1772 is in the range 0..127 (the range of valid ASCII characters) and a non zero
1773 value if not.
1774 <tag/Limits/<itemize>
1775 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1776 inline sequence generated by the macro will not work correctly for values
1777 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1778 this range. The non inline function may be accessed by <tt/#undef/'ing the
1779 macro.
1780 <item>When compiling without <tt/-Os/, the function is only available as
1781 fastcall function, so it may only be used in presence of a prototype.
1782 </itemize>
1783 <tag/Availability/ISO 9899
1784 <tag/See also/
1785 <ref id="isalnum" name="isalnum">,
1786 <ref id="isalpha" name="isalpha">,
1787 <ref id="isblank" name="isblank">,
1788 <ref id="iscntrl" name="iscntrl">,
1789 <ref id="isdigit" name="isdigit">,
1790 <ref id="isgraph" name="isgraph">,
1791 <ref id="islower" name="islower">,
1792 <ref id="isprint" name="isprint">,
1793 <ref id="ispunct" name="ispunct">,
1794 <ref id="isspace" name="isspace">,
1795 <ref id="isupper" name="isupper">,
1796 <ref id="isxdigit" name="isxdigit">
1797 <tag/Example/None.
1798 </descrip>
1799 </quote>
1800
1801
1802 <sect1>isblank<label id="isblank"><p>
1803
1804 <quote>
1805 <descrip>
1806 <tag/Function/Check if a given character is a space or tab.
1807 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1808 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
1809 <tag/Description/The function returns a value of zero if the given argument
1810 is a space or tab character. The return value is non zero if the character
1811 is anything else.
1812 <tag/Limits/<itemize>
1813 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1814 inline sequence generated by the macro will not work correctly for values
1815 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1816 this range. The non inline function may be accessed by <tt/#undef/'ing the
1817 macro.
1818 <item>When compiling without <tt/-Os/, the function is only available as
1819 fastcall function, so it may only be used in presence of a prototype.
1820 </itemize>
1821 <tag/Availability/cc65
1822 <tag/See also/
1823 <ref id="isalnum" name="isalnum">,
1824 <ref id="isalpha" name="isalpha">,
1825 <ref id="isascii" name="isascii">,
1826 <ref id="iscntrl" name="iscntrl">,
1827 <ref id="isdigit" name="isdigit">,
1828 <ref id="isgraph" name="isgraph">,
1829 <ref id="islower" name="islower">,
1830 <ref id="isprint" name="isprint">,
1831 <ref id="ispunct" name="ispunct">,
1832 <ref id="isspace" name="isspace">,
1833 <ref id="isupper" name="isupper">,
1834 <ref id="isxdigit" name="isxdigit">
1835 <tag/Example/None.
1836 </descrip>
1837 </quote>
1838
1839
1840 <sect1>iscntrl<label id="iscntrl"><p>
1841
1842 <quote>
1843 <descrip>
1844 <tag/Function/Check if a given character is a control character.
1845 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1846 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
1847 <tag/Description/The function returns a value of zero if the given argument
1848 is a control character. The return value is non zero if the character
1849 is anything else.
1850 <tag/Limits/<itemize>
1851 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1852 inline sequence generated by the macro will not work correctly for values
1853 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1854 this range. The non inline function may be accessed by <tt/#undef/'ing the
1855 macro.
1856 <item>When compiling without <tt/-Os/, the function is only available as
1857 fastcall function, so it may only be used in presence of a prototype.
1858 </itemize>
1859 <tag/Availability/ISO 9899
1860 <tag/See also/
1861 <ref id="isalnum" name="isalnum">,
1862 <ref id="isalpha" name="isalpha">,
1863 <ref id="isascii" name="isascii">,
1864 <ref id="isblank" name="isblank">,
1865 <ref id="isdigit" name="isdigit">,
1866 <ref id="isgraph" name="isgraph">,
1867 <ref id="islower" name="islower">,
1868 <ref id="isprint" name="isprint">,
1869 <ref id="ispunct" name="ispunct">,
1870 <ref id="isspace" name="isspace">,
1871 <ref id="isupper" name="isupper">,
1872 <ref id="isxdigit" name="isxdigit">
1873 <tag/Example/None.
1874 </descrip>
1875 </quote>
1876
1877
1878 <sect1>isdigit<label id="isdigit"><p>
1879
1880 <quote>
1881 <descrip>
1882 <tag/Function/Check if a given character is a digit.
1883 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1884 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
1885 <tag/Description/The function returns a value of zero if the given argument
1886 is a digit. The return value is non zero if the character is anything else.
1887 <tag/Limits/<itemize>
1888 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1889 inline sequence generated by the macro will not work correctly for values
1890 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1891 this range. The non inline function may be accessed by <tt/#undef/'ing the
1892 macro.
1893 <item>When compiling without <tt/-Os/, the function is only available as
1894 fastcall function, so it may only be used in presence of a prototype.
1895 </itemize>
1896 <tag/Availability/ISO 9899
1897 <tag/See also/
1898 <ref id="isalnum" name="isalnum">,
1899 <ref id="isalpha" name="isalpha">,
1900 <ref id="isascii" name="isascii">,
1901 <ref id="isblank" name="isblank">,
1902 <ref id="iscntrl" name="iscntrl">,
1903 <ref id="isgraph" name="isgraph">,
1904 <ref id="islower" name="islower">,
1905 <ref id="isprint" name="isprint">,
1906 <ref id="ispunct" name="ispunct">,
1907 <ref id="isspace" name="isspace">,
1908 <ref id="isupper" name="isupper">,
1909 <ref id="isxdigit" name="isxdigit">
1910 <tag/Example/None.
1911 </descrip>
1912 </quote>
1913
1914
1915 <sect1>isgraph<label id="isgraph"><p>
1916
1917 <quote>
1918 <descrip>
1919 <tag/Function/Check if a given character is a printable character (except
1920 space).
1921 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1922 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
1923 <tag/Description/The function returns a value of zero if the given argument
1924 is a printable character with the exception of space. The return value is non
1925 zero if the character is anything else.
1926 <tag/Limits/<itemize>
1927 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1928 inline sequence generated by the macro will not work correctly for values
1929 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1930 this range. The non inline function may be accessed by <tt/#undef/'ing the
1931 macro.
1932 <item>When compiling without <tt/-Os/, the function is only available as
1933 fastcall function, so it may only be used in presence of a prototype.
1934 </itemize>
1935 <tag/Availability/ISO 9899
1936 <tag/See also/
1937 <ref id="isalnum" name="isalnum">,
1938 <ref id="isalpha" name="isalpha">,
1939 <ref id="isascii" name="isascii">,
1940 <ref id="isblank" name="isblank">,
1941 <ref id="iscntrl" name="iscntrl">,
1942 <ref id="isdigit" name="isdigit">,
1943 <ref id="islower" name="islower">,
1944 <ref id="isprint" name="isprint">,
1945 <ref id="ispunct" name="ispunct">,
1946 <ref id="isspace" name="isspace">,
1947 <ref id="isupper" name="isupper">,
1948 <ref id="isxdigit" name="isxdigit">
1949 <tag/Example/None.
1950 </descrip>
1951 </quote>
1952
1953
1954 <sect1>islower<label id="islower"><p>
1955
1956 <quote>
1957 <descrip>
1958 <tag/Function/Check if a given character is a lower case letter.
1959 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1960 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
1961 <tag/Description/The function returns a value of zero if the given argument
1962 is a lower case letter. The return value is non zero if the character is
1963 anything else.
1964 <tag/Limits/<itemize>
1965 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1966 inline sequence generated by the macro will not work correctly for values
1967 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1968 this range. The non inline function may be accessed by <tt/#undef/'ing the
1969 macro.
1970 <item>When compiling without <tt/-Os/, the function is only available as
1971 fastcall function, so it may only be used in presence of a prototype.
1972 </itemize>
1973 <tag/Availability/ISO 9899
1974 <tag/See also/
1975 <ref id="isalnum" name="isalnum">,
1976 <ref id="isalpha" name="isalpha">,
1977 <ref id="isascii" name="isascii">,
1978 <ref id="isblank" name="isblank">,
1979 <ref id="iscntrl" name="iscntrl">,
1980 <ref id="isdigit" name="isdigit">,
1981 <ref id="isgraph" name="isgraph">,
1982 <ref id="isprint" name="isprint">,
1983 <ref id="ispunct" name="ispunct">,
1984 <ref id="isspace" name="isspace">,
1985 <ref id="isupper" name="isupper">,
1986 <ref id="isxdigit" name="isxdigit">
1987 <tag/Example/None.
1988 </descrip>
1989 </quote>
1990
1991
1992 <sect1>isprint<label id="isprint"><p>
1993
1994 <quote>
1995 <descrip>
1996 <tag/Function/Check if a given character is a printable character.
1997 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1998 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
1999 <tag/Description/The function returns a value of zero if the given argument
2000 is a printable character (this includes the space character). The return value
2001 is non zero if the character is anything else.
2002 <tag/Limits/<itemize>
2003 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2004 inline sequence generated by the macro will not work correctly for values
2005 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2006 this range. The non inline function may be accessed by <tt/#undef/'ing the
2007 macro.
2008 <item>When compiling without <tt/-Os/, the function is only available as
2009 fastcall function, so it may only be used in presence of a prototype.
2010 </itemize>
2011 <tag/Availability/ISO 9899
2012 <tag/See also/
2013 <ref id="isalnum" name="isalnum">,
2014 <ref id="isalpha" name="isalpha">,
2015 <ref id="isascii" name="isascii">,
2016 <ref id="isblank" name="isblank">,
2017 <ref id="iscntrl" name="iscntrl">,
2018 <ref id="isdigit" name="isdigit">,
2019 <ref id="isgraph" name="isgraph">,
2020 <ref id="islower" name="islower">,
2021 <ref id="ispunct" name="ispunct">,
2022 <ref id="isspace" name="isspace">,
2023 <ref id="isupper" name="isupper">,
2024 <ref id="isxdigit" name="isxdigit">
2025 <tag/Example/None.
2026 </descrip>
2027 </quote>
2028
2029
2030 <sect1>ispunct<label id="ispunct"><p>
2031
2032 <quote>
2033 <descrip>
2034 <tag/Function/Check if a given character is a printable character but not a
2035 space or an alphanumeric character.
2036 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2037 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
2038 <tag/Description/The function returns a value of zero if the given argument
2039 is a printable character, but not a space or anything alphanumeric. The return
2040 value is non zero if the character is anything else.
2041 <tag/Limits/<itemize>
2042 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2043 inline sequence generated by the macro will not work correctly for values
2044 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2045 this range. The non inline function may be accessed by <tt/#undef/'ing the
2046 macro.
2047 <item>When compiling without <tt/-Os/, the function is only available as
2048 fastcall function, so it may only be used in presence of a prototype.
2049 </itemize>
2050 <tag/Availability/ISO 9899
2051 <tag/See also/
2052 <ref id="isalnum" name="isalnum">,
2053 <ref id="isalpha" name="isalpha">,
2054 <ref id="isascii" name="isascii">,
2055 <ref id="isblank" name="isblank">,
2056 <ref id="iscntrl" name="iscntrl">,
2057 <ref id="isdigit" name="isdigit">,
2058 <ref id="isgraph" name="isgraph">,
2059 <ref id="islower" name="islower">,
2060 <ref id="isprint" name="isprint">,
2061 <ref id="isspace" name="isspace">,
2062 <ref id="isupper" name="isupper">,
2063 <ref id="isxdigit" name="isxdigit">
2064 <tag/Example/None.
2065 </descrip>
2066 </quote>
2067
2068
2069 <sect1>isspace<label id="isspace"><p>
2070
2071 <quote>
2072 <descrip>
2073 <tag/Function/Check if a given character is a a white-space character.
2074 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2075 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
2076 <tag/Description/The function returns a value of zero if the given argument
2077 is a white space character. The return value is non zero if the character is
2078 anything else. The standard white space characters are: space, formfeed ('\f'),
2079 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
2080 ('\v').
2081 <tag/Limits/<itemize>
2082 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2083 inline sequence generated by the macro will not work correctly for values
2084 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2085 this range. The non inline function may be accessed by <tt/#undef/'ing the
2086 macro.
2087 <item>When compiling without <tt/-Os/, the function is only available as
2088 fastcall function, so it may only be used in presence of a prototype.
2089 </itemize>
2090 <tag/Availability/ISO 9899
2091 <tag/See also/
2092 <ref id="isalnum" name="isalnum">,
2093 <ref id="isalpha" name="isalpha">,
2094 <ref id="isascii" name="isascii">,
2095 <ref id="isblank" name="isblank">,
2096 <ref id="iscntrl" name="iscntrl">,
2097 <ref id="isdigit" name="isdigit">,
2098 <ref id="isgraph" name="isgraph">,
2099 <ref id="islower" name="islower">,
2100 <ref id="isprint" name="isprint">,
2101 <ref id="ispunct" name="ispunct">,
2102 <ref id="isupper" name="isupper">,
2103 <ref id="isxdigit" name="isxdigit">
2104 <tag/Example/None.
2105 </descrip>
2106 </quote>
2107
2108
2109 <sect1>isupper<label id="isupper"><p>
2110
2111 <quote>
2112 <descrip>
2113 <tag/Function/Check if a given character is an upper case letter.
2114 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2115 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
2116 <tag/Description/The function returns a value of zero if the given argument
2117 is an upper case letter. The return value is non zero if the character is
2118 anything else.
2119 <tag/Limits/<itemize>
2120 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2121 inline sequence generated by the macro will not work correctly for values
2122 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2123 this range. The non inline function may be accessed by <tt/#undef/'ing the
2124 macro.
2125 <item>When compiling without <tt/-Os/, the function is only available as
2126 fastcall function, so it may only be used in presence of a prototype.
2127 </itemize>
2128 <tag/Availability/ISO 9899
2129 <tag/See also/
2130 <ref id="isalnum" name="isalnum">,
2131 <ref id="isalpha" name="isalpha">,
2132 <ref id="isascii" name="isascii">,
2133 <ref id="isblank" name="isblank">,
2134 <ref id="iscntrl" name="iscntrl">,
2135 <ref id="isdigit" name="isdigit">,
2136 <ref id="isgraph" name="isgraph">,
2137 <ref id="islower" name="islower">,
2138 <ref id="isprint" name="isprint">,
2139 <ref id="ispunct" name="ispunct">,
2140 <ref id="isspace" name="isspace">,
2141 <ref id="isxdigit" name="isxdigit">
2142 <tag/Example/None.
2143 </descrip>
2144 </quote>
2145
2146
2147 <sect1>isxdigit<label id="isxdigit"><p>
2148
2149 <quote>
2150 <descrip>
2151 <tag/Function/Check if a given character is a hexadecimal digit.
2152 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2153 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
2154 <tag/Description/The function returns a value of zero if the given argument
2155 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
2156 if the character is anything else.
2157 <tag/Limits/<itemize>
2158 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2159 inline sequence generated by the macro will not work correctly for values
2160 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2161 this range. The non inline function may be accessed by <tt/#undef/'ing the
2162 macro.
2163 <item>When compiling without <tt/-Os/, the function is only available as
2164 fastcall function, so it may only be used in presence of a prototype.
2165 </itemize>
2166 <tag/Availability/ISO 9899
2167 <tag/See also/
2168 <ref id="isalnum" name="isalnum">,
2169 <ref id="isalpha" name="isalpha">,
2170 <ref id="isascii" name="isascii">,
2171 <ref id="isblank" name="isblank">,
2172 <ref id="iscntrl" name="iscntrl">,
2173 <ref id="isdigit" name="isdigit">,
2174 <ref id="isgraph" name="isgraph">,
2175 <ref id="islower" name="islower">,
2176 <ref id="isprint" name="isprint">,
2177 <ref id="ispunct" name="ispunct">,
2178 <ref id="isspace" name="isspace">,
2179 <ref id="isupper" name="isupper">
2180 <tag/Example/None.
2181 </descrip>
2182 </quote>
2183
2184
2185 <sect1>itoa<label id="itoa"><p>
2186
2187 <quote>
2188 <descrip>
2189 <tag/Function/Convert an integer into a string.
2190 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2191 <tag/Declaration/<tt/char* __fastcall__ itoa (int val, char* buf, int radix);/
2192 <tag/Description/<tt/itoa/ converts the integer <tt/val/ into a string using
2193 <tt/radix/ as the base.
2194 <tag/Limits/<itemize>
2195 <item>There are no provisions to prevent a buffer overflow.
2196 <item>If <tt/val/ contains <tt/INT_MIN/, the behaviour is undefined.
2197 <item>The function is non standard, so it is not available in strict ANSI mode.
2198 You should probably use <tt/sprintf/ instead.
2199 <item>The function is only available as fastcall function, so it may only be
2200 used in presence of a prototype.
2201 </itemize>
2202 <tag/Availability/cc65
2203 <tag/See also/
2204 <ref id="atoi" name="atoi">,
2205 <ref id="atol" name="atol">,
2206 <ref id="ltoa" name="ltoa">,
2207 <ref id="ultoa" name="ultoa">,
2208 <ref id="utoa" name="utoa">
2209 <tag/Example/None.
2210 </descrip>
2211 </quote>
2212
2213
2214 <sect1>kbhit<label id="kbhit"><p>
2215
2216 <quote>
2217 <descrip>
2218 <tag/Function/Check if there's a key waiting in the keyboard buffer.
2219 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2220 <tag/Declaration/<tt/unsigned char kbhit (void);/
2221 <tag/Description/The function returns a value of zero if there is no character
2222 waiting to be read from the keyboard. It returns non zero otherwise.
2223 <tag/Limits/<itemize>
2224 <item>If the system does not support a keyboard buffer (most systems
2225 do), the function is rather useless.
2226 </itemize>
2227 <tag/Availability/cc65
2228 <tag/See also/
2229 <ref id="cgetc" name="cgetc">,
2230 <ref id="cursor" name="cursor">
2231 <tag/Example/None.
2232 </descrip>
2233 </quote>
2234
2235
2236 <sect1>labs<label id="labs"><p>
2237
2238 <quote>
2239 <descrip>
2240 <tag/Function/Returns the absolute value of a long integer.
2241 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2242 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
2243 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
2244 the function.
2245 <tag/Limits/<itemize>
2246 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
2247 <item>The function is only available as fastcall function, so it may only be
2248 used in presence of a prototype.
2249 </itemize>
2250 <tag/Availability/ISO 9899
2251 <tag/See also/
2252 <ref id="abs" name="abs">
2253 <tag/Example/None.
2254 </descrip>
2255 </quote>
2256
2257
2258 <sect1>ltoa<label id="ltoa"><p>
2259
2260 <quote>
2261 <descrip>
2262 <tag/Function/Convert a long integer into a string.
2263 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2264 <tag/Declaration/<tt/char* __fastcall__ ltoa (long val, char* buf, int radix);/
2265 <tag/Description/<tt/itoa/ converts the long integer <tt/val/ into a string
2266 using <tt/radix/ as the base.
2267 <tag/Limits/<itemize>
2268 <item>There are no provisions to prevent a buffer overflow.
2269 <item>If <tt/val/ contains <tt/LONG_MIN/, the behaviour is undefined.
2270 <item>The function is non standard, so it is not available in strict ANSI mode.
2271 You should probably use <tt/sprintf/ instead.
2272 <item>The function is only available as fastcall function, so it may only be
2273 used in presence of a prototype.
2274 </itemize>
2275 <tag/Availability/cc65
2276 <tag/See also/
2277 <ref id="atoi" name="atoi">,
2278 <ref id="atol" name="atol">,
2279 <ref id="itoa" name="itoa">,
2280 <ref id="ultoa" name="ultoa">,
2281 <ref id="utoa" name="utoa">
2282 <tag/Example/None.
2283 </descrip>
2284 </quote>
2285
2286
2287 <sect1>localeconv<label id="localeconv"><p>
2288
2289 <quote>
2290 <descrip>
2291 <tag/Function/Returns a pointer to the current locale structure.
2292 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
2293 <tag/Declaration/<tt/struct lconv* localeconv (void);/
2294 <tag/Description/<tt/localeconv/ returns a pointer to the current locale
2295 structure.
2296 <tag/Limits/<itemize>
2297 <item>cc65 supports only the "C" locale, so even after setting a new locale
2298 using <tt/<ref id="setlocale" name="setlocale">/, the structure returned will
2299 always be the same.
2300 </itemize>
2301 <tag/Availability/ISO 9899
2302 <tag/See also/
2303 <ref id="setlocale" name="setlocale">
2304 <tag/Example/None.
2305 </descrip>
2306 </quote>
2307
2308
2309 <sect1>malloc<label id="malloc"><p>
2310
2311 <quote>
2312 <descrip>
2313 <tag/Function/Allocate dynamic memory.
2314 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2315 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
2316 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
2317 pointer to the allocated memory block. On error (not enough memory available),
2318 <tt/malloc/ returns <tt/NULL/.
2319 <tag/Limits/
2320 <itemize>
2321 <item>The function is only available as fastcall function, so it may only
2322 be used in presence of a prototype.
2323 </itemize>
2324 <tag/Availability/ISO 9899
2325 <tag/See also/
2326 <ref id="_heapadd" name="_heapadd">,
2327 <ref id="_heapmaxavail" name="_heapmaxavail">,
2328 <ref id="_heapmemavail" name="_heapmemavail">,
2329 <ref id="calloc" name="calloc">,
2330 <ref id="free" name="free">,
2331 <ref id="realloc" name="realloc">
2332 <tag/Example/None.
2333 </descrip>
2334 </quote>
2335
2336
2337 <sect1>memcpy<label id="memcpy"><p>
2338
2339 <quote>
2340 <descrip>
2341 <tag/Function/Copy a memory area.
2342 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2343 <tag/Declaration/<tt/void* __fastcall__ memcpy (void* dest, const void* src, size_t count);/
2344 <tag/Description/<tt/memcpy/ copies <tt/count/ bytes from the memory area
2345 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
2346 <tt/dest/.
2347 <tag/Limits/
2348 <itemize>
2349 <item>The result is undefined if the memory areas do overlap. Use
2350 <tt/<ref id="memmove" name="memmove">/ to copy overlapping memory areas.
2351 <item>The function is only available as fastcall function, so it may only
2352 be used in presence of a prototype.
2353 </itemize>
2354 <tag/Availability/ISO 9899
2355 <tag/See also/
2356 <ref id="_swap" name="_swap">,
2357 <ref id="memmove" name="memmove">,
2358 <ref id="memset" name="memset">
2359 <tag/Example/None.
2360 </descrip>
2361 </quote>
2362
2363
2364 <sect1>memmove<label id="memmove"><p>
2365
2366 <quote>
2367 <descrip>
2368 <tag/Function/Copy a memory area.
2369 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2370 <tag/Declaration/<tt/void* __fastcall__ memmove (void* dest, const void* src, size_t count);/
2371 <tag/Description/<tt/memmove/ copies <tt/count/ bytes from the memory area
2372 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
2373 <tt/dest/.
2374 <tag/Limits/
2375 <itemize>
2376 <item>While <tt/memmove/ allows the memory areas to overlap, it has some
2377 additional overhead compared to <tt/<ref id="memcpy" name="memcpy">/.
2378 <item>The function is only available as fastcall function, so it may only
2379 be used in presence of a prototype.
2380 </itemize>
2381 <tag/Availability/ISO 9899
2382 <tag/See also/
2383 <ref id="_swap" name="_swap">,
2384 <ref id="memcpy" name="memcpy">,
2385 <ref id="memset" name="memset">
2386 <tag/Example/None.
2387 </descrip>
2388 </quote>
2389
2390
2391 <sect1>memset<label id="memset"><p>
2392
2393 <quote>
2394 <descrip>
2395 <tag/Function/Fill a memory area.
2396 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2397 <tag/Declaration/<tt/void* __fastcall__ memset (void* p, int val, size_t count);/
2398 <tag/Description/<tt/memset/ fills the memory area pointed to by <tt/p/ with
2399 the value <tt/val/. The function returns <tt/p/.
2400 <tag/Limits/
2401 <itemize>
2402 <item>The function is only available as fastcall function, so it may only
2403 be used in presence of a prototype.
2404 </itemize>
2405 <tag/Availability/ISO 9899
2406 <tag/See also/
2407 <ref id="_swap" name="_swap">,
2408 <ref id="bzero" name="bzero">,
2409 <ref id="memcpy" name="memcpy">,
2410 <ref id="memmove" name="memmove">
2411 <tag/Example/None.
2412 </descrip>
2413 </quote>
2414
2415
2416 <sect1>offsetof<label id="offsetof"><p>
2417
2418 <quote>
2419 <descrip>
2420 <tag/Function/Calculate the offset of a struct or union member.
2421 <tag/Header/<tt/<ref id="stddef.h" name="stddef.h">/
2422 <tag/Declaration/<tt/size_t offsetof (type, member);/
2423 <tag/Description/<tt/offsetof/ calculates the address offset of a <tt/struct/
2424 or <tt/union/ member.
2425 <tag/Limits/<itemize>
2426 <item>The function is actually a macro.
2427 </itemize>
2428 <tag/Availability/ISO 9899
2429 <tag/Example/None.
2430 </descrip>
2431 </quote>
2432
2433
2434 <sect1>open<label id="open"><p>
2435
2436 <quote>
2437 <descrip>
2438 <tag/Function/Open and possibly create a file.
2439 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
2440 <tag/Declaration/<tt/int open (const char* name, int flags, ...);/
2441 <tag/Description/<tt/open/ opens a file and returns the file descriptor
2442 associated with it. On error, -1 is returned and an error code is stored in
2443 <tt/errno/. Several flags may be passed to <tt/open/ that change the behaviour.
2444 <tag/Limits/<itemize>
2445 <item>POSIX specifies an additional <tt/mode/ argument that may be passed to
2446 open, which is used as the permission mask when a new file is created. While
2447 cc65 allows to pass this argument, it is ignored.
2448 </itemize>
2449 <tag/Availability/POSIX
2450 <tag/See also/
2451 <ref id="close" name="close">,
2452 <ref id="creat" name="creat">
2453 <tag/Example/None.
2454 </descrip>
2455 </quote>
2456
2457
2458 <sect1>qsort<label id="qsort"><p>
2459
2460 <quote>
2461 <descrip>
2462 <tag/Function/Sort an array.
2463 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2464 <tag/Declaration/<tt/void __fastcall__ qsort (void* base, size_t count,
2465 size_t size, int (*compare) (const void*, const void*));/
2466 <tag/Description/<tt/qsort/ sorts an array according to a given compare
2467 function <tt/compare/. <tt/base/ is the address of the array, <tt/count/
2468 is the number of elements, <tt/size/ the size of an element and <tt/compare/
2469 the function used to compare the members.
2470 <tag/Limits/
2471 <itemize>
2472 <item>If there are multiple members with the same key, the order after calling
2473 the function is undefined.
2474 <item>The function is only available as fastcall function, so it may only
2475 be used in presence of a prototype.
2476 </itemize>
2477 <tag/Availability/ISO 9899
2478 <tag/See also/
2479 <ref id="bsearch" name="bsearch">
2480 <tag/Example/None.
2481 </descrip>
2482 </quote>
2483
2484
2485 <sect1>raise<label id="raise"><p>
2486
2487 <quote>
2488 <descrip>
2489 <tag/Function/Send a signal to the executing program.
2490 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
2491 <tag/Declaration/<tt/int __fastcall__ raise (int sig);/
2492 <tag/Description/<tt/raise/ sends the given signal to the program. If the
2493 program has installed a signal handler for the signal, this signal handler
2494 will be executed. If no handler has been installed, the default action for
2495 the raised signal will be taken. The function returns zero on success,
2496 nonzero otherwise.
2497 <tag/Limits/<itemize>
2498 <item>The function is only available as fastcall function, so it may only
2499 be used in presence of a prototype.
2500 </itemize>
2501 <tag/Availability/ISO 9899
2502 <tag/See also/
2503 <ref id="abort" name="abort">,
2504 <ref id="signal" name="signal">
2505 <tag/Example/None.
2506 </descrip>
2507 </quote>
2508
2509
2510 <sect1>rand<label id="rand"><p>
2511
2512 <quote>
2513 <descrip>
2514 <tag/Function/Return a pseudo random number.
2515 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2516 <tag/Declaration/<tt/int rand (void);/
2517 <tag/Description/The function returns a pseudo random number
2518 between 0 and <tt/RAND_MAX/ (exclusive).
2519 <tag/Limits/<itemize>
2520 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
2521 flow of numbers is generated.
2522 <item>On startup, the function behaves as if <ref id="srand" name="srand">
2523 had been used with an argument of 1.
2524 </itemize>
2525 <tag/Availability/ISO 9899
2526 <tag/See also/
2527 <ref id="_randomize" name="_randomize">,
2528 <ref id="srand" name="srand">
2529 <tag/Example/None.
2530 </descrip>
2531 </quote>
2532
2533
2534 <sect1>realloc<label id="realloc"><p>
2535
2536 <quote>
2537 <descrip>
2538 <tag/Function/Change the size of an allocated memory block.
2539 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2540 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
2541 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
2542 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
2543 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
2544 behaves as if <tt/free/ had been called. On error (not enough memory
2545 available), <tt/realloc/ returns <tt/NULL/.
2546 <tag/Limits/
2547 <itemize>
2548 <item>The part of the memory block that is returned will have its contents
2549 unchanged.
2550 <item>This function is somewhat dangerous to use. Be careful to save the
2551 pointer you're passing somewhere else, otherwise
2552 <tscreen><verb>
2553         ptr = realloc (ptr, size);
2554 </verb></tscreen>
2555 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
2556 <item>The function is only available as fastcall function, so it may only
2557 be used in presence of a prototype.
2558 </itemize>
2559 <tag/Availability/ISO 9899
2560 <tag/See also/
2561 <ref id="_heapadd" name="_heapadd">,
2562 <ref id="_heapmaxavail" name="_heapmaxavail">,
2563 <ref id="_heapmemavail" name="_heapmemavail">,
2564 <ref id="calloc" name="calloc">,
2565 <ref id="free" name="free">,
2566 <ref id="realloc" name="realloc">
2567 <tag/Example/None.
2568 </descrip>
2569 </quote>
2570
2571
2572 <sect1>reset_brk<label id="reset_brk"><p>
2573
2574 <quote>
2575 <descrip>
2576 <tag/Function/Resets the break vector to its original value.
2577 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
2578 <tag/Declaration/<tt/void __fastcall__ reset_brk (void);/
2579 <tag/Description/<tt/reset_brk/ resets the break vector to the value it had
2580 before a call to <tt/set_brk/.
2581 <tag/Limits/
2582 <itemize>
2583 <item>Since <tt/<ref id="set_brk" name="set_brk">/ installs an exit handler,
2584 it is not strictly necessary to call this function as part of the cleanup when
2585 the program ends.
2586 </itemize>
2587 <tag/Availability/cc65
2588 <tag/See also/
2589 <ref id="set_brk" name="set_brk">
2590 <tag/Example/None.
2591 </descrip>
2592 </quote>
2593
2594
2595 <sect1>revers<label id="revers"><p>
2596
2597 <quote>
2598 <descrip>
2599 <tag/Function/Control revers character display.
2600 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2601 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
2602 <tag/Description/If the argument is non zero, the function enables reverse
2603 character display. If the argument is zero, reverse character display is
2604 switched off. The old value of the setting is returned.
2605 <tag/Limits/<itemize>
2606 <item>The function may not be supported by the hardware, in which case
2607 the call is ignored.
2608 <item>The function is only available as fastcall function, so it may only
2609 be used in presence of a prototype.
2610 </itemize>
2611 <tag/Availability/cc65
2612 <tag/See also/
2613 <ref id="textcolor" name="textcolor">
2614 <tag/Example/None.
2615 </descrip>
2616 </quote>
2617
2618
2619 <sect1>screensize<label id="screensize"><p>
2620
2621 <quote>
2622 <descrip>
2623 <tag/Function/Return the dimensions of the text mode screen.
2624 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2625 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
2626 <tag/Description/The function returns the dimensions of the text mode screen.
2627 <tag/Limits/<itemize>
2628 <item>The function is only available as fastcall function, so it may only
2629 be used in presence of a prototype.
2630 </itemize>
2631 <tag/Availability/cc65
2632 <tag/See also/
2633 <ref id="gotox" name="gotox">,
2634 <ref id="gotoxy" name="gotoxy">,
2635 <ref id="gotoy" name="gotoy">,
2636 <ref id="wherex" name="wherex">,
2637 <ref id="wherey" name="wherey">
2638 <tag/Example/None.
2639 </descrip>
2640 </quote>
2641
2642
2643 <sect1>set_brk<label id="set_brk"><p>
2644
2645 <quote>
2646 <descrip>
2647 <tag/Function/Set the break vector to a user function.
2648 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
2649 <tag/Declaration/<tt/void __fastcall__ set_brk (brk_handler func);/
2650 <tag/Description/<tt/set_brk/ allows a user program to handle breaks within the
2651 program code by letting the vector point to a user written C function. The
2652 runtime library installs a small stub that saves the registers into global
2653 variables that may be accessed (and changed) by the break handler.
2654 <tag/Limits/
2655 <itemize>
2656 <item>The function is only available as fastcall function, so it may only
2657 be used in presence of a prototype.
2658 <item>The stub saves the zero page registers used by the C runtime and switches
2659 to a small break handler stack. This means that it is safe to execute C code,
2660 even if C code was interrupted. Be careful however not to use too many local
2661 variables, and do not enable stack checks for the handler function or any other
2662 function called from it.
2663 <item>The <tt/brk_pc/ variable points to the <tt/BRK/ instruction. If you want
2664 the continue with the interrupted code, you have to adjust <tt/brk_pc/,
2665 otherwise the <tt/BRK/ instruction will get executed over and over again.
2666 <item>Since <tt/set_brk/ installs an exit handler, it is not strictly necessary
2667 to call <tt/<ref id="reset_brk" name="reset_brk">/ as part of the cleanup when
2668 the program terminates.
2669 </itemize>
2670 <tag/Availability/cc65
2671 <tag/See also/
2672 <ref id="reset_brk" name="reset_brk">
2673 <tag/Example/None.
2674 </descrip>
2675 </quote>
2676
2677
2678 <sect1>setlocale<label id="setlocale"><p>
2679
2680 <quote>
2681 <descrip>
2682 <tag/Function/Selects a locale.
2683 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
2684 <tag/Declaration/<tt/char* __fastcall__ setlocale (int category, const char* locale);/
2685 <tag/Description/<tt/setlocale/ sets or queries the program's locale.
2686 <tag/Limits/
2687 <itemize>
2688 <item>The function is only available as fastcall function, so it may only
2689 be used in presence of a prototype.
2690 <item>cc65 supports only the "C" locale, so calling this function to set a
2691 different locale has no effect.
2692 </itemize>
2693 <tag/Availability/ISO 9899
2694 <tag/See also/
2695 <ref id="localeconv" name="localeconv">,
2696 <ref id="strcoll" name="strcoll">
2697 <tag/Example/None.
2698 </descrip>
2699 </quote>
2700
2701
2702 <sect1>signal<label id="signal"><p>
2703
2704 <quote>
2705 <descrip>
2706 <tag/Function/Install a signal handler.
2707 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
2708 <tag/Declaration/<tt/__sigfunc __fastcall__ signal (int sig, __sigfunc func);/
2709 <tag/Description/<tt/signal/ installs a handler for the given signal. The
2710 handler may either be a user supplied function, or one of the predefined
2711 signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
2712 previous value if the signal , or the special function vector SIG_ERR in
2713 case of an error.
2714 <tag/Limits/<itemize>
2715 <item>The function is only available as fastcall function, so it may only
2716 be used in presence of a prototype.
2717 </itemize>
2718 <tag/Availability/ISO 9899
2719 <tag/See also/
2720 <ref id="abort" name="abort">,
2721 <ref id="raise" name="raise">
2722 <tag/Example/None.
2723 </descrip>
2724 </quote>
2725
2726
2727 <sect1>sleep<label id="sleep"><p>
2728
2729 <quote>
2730 <descrip>
2731 <tag/Function/Sleep for a specified amount of time.
2732 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
2733 <tag/Declaration/<tt/void __fastcall__ sleep (unsigned seconds);/
2734 <tag/Description/The function will return after the specified number of
2735 seconds have elapsed.
2736 <tag/Limits/<itemize>
2737 <item>The function is only available as fastcall function, so it may only
2738 be used in presence of a prototype.
2739 </itemize>
2740 <tag/Availability/POSIX
2741 <tag/Example/None.
2742 </descrip>
2743 </quote>
2744
2745
2746 <sect1>slow<label id="slow"><p>
2747
2748 <quote>
2749 <descrip>
2750 <tag/Function/Switch the C128 into 1MHz mode.
2751 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
2752 <tag/Declaration/<tt/void slow (void);/
2753 <tag/Description/The function will switch the clock of the C128 to 1MHz. This
2754 will halve the speed compared to fast mode.
2755 <tag/Limits/<itemize>
2756 <item>The function is specific to the C128.
2757 </itemize>
2758 <tag/Availability/C128
2759 <tag/See also/
2760 <ref id="fast" name="fast">,
2761 <ref id="toggle_videomode" name="toggle_videomode">
2762 <tag/Example/None.
2763 </descrip>
2764 </quote>
2765
2766
2767 <sect1>srand<label id="srand"><p>
2768
2769 <quote>
2770 <descrip>
2771 <tag/Function/Initialize the pseudo random number generator.
2772 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2773 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
2774 <tag/Description/The function initializes the random number generator using
2775 the given seed. On program startup, the generator behaves as if <tt/srand/ has
2776 been called with an argument of 1.
2777 <tag/Limits/<itemize>
2778 <item>The function is only available as fastcall function, so it may only
2779 be used in presence of a prototype.
2780 </itemize>
2781 <tag/Availability/ISO 9899
2782 <tag/See also/
2783 <ref id="_randomize" name="_randomize">,
2784 <ref id="rand" name="rand">
2785 <tag/Example/None.
2786 </descrip>
2787 </quote>
2788
2789
2790 <sect1>strcasecmp<label id="strcasecmp"><p>
2791
2792 <quote>
2793 <descrip>
2794 <tag/Function/Compare two strings case insensitive.
2795 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2796 <tag/Declaration/<tt/int __fastcall__ strcasecmp (const char* s1, const char* s2);/
2797 <tag/Description/The <tt/strcasecmp/ function compares the two strings passed
2798 as parameters without case sensitivity. It returns a value that is less than
2799 zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
2800 and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
2801 <tag/Limits/<itemize>
2802 <item>The function is only available as fastcall function, so it may only
2803 be used in presence of a prototype.
2804 <item>The function is not available in strict ANSI mode.
2805 </itemize>
2806 <tag/Availability/cc65
2807 <tag/See also/
2808 <ref id="strcmp" name="strcmp">,
2809 <ref id="strcoll" name="strcoll">,
2810 <ref id="stricmp" name="stricmp">
2811 <tag/Example/None.
2812 </descrip>
2813 </quote>
2814
2815
2816 <sect1>strcat<label id="strcat"><p>
2817
2818 <quote>
2819 <descrip>
2820 <tag/Function/Concatentate two strings.
2821 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2822 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
2823 <tag/Description/The <tt/strcat/ function appends a copy of the string
2824 pointed to by s2 (including the terminating null byte) to the end of the
2825 string pointed to by s1. The initial byte of s2 overwrites the null byte at
2826 the end of s1.
2827 <tag/Limits/<itemize>
2828 <item>The function is only available as fastcall function, so it may only
2829 be used in presence of a prototype.
2830 <item>If copying takes place between objects that overlap, the behavior
2831 is undefined.
2832 </itemize>
2833 <tag/Availability/ISO 9899
2834 <tag/See also/
2835 <ref id="strcpy" name="strcpy">
2836 <ref id="strncpy" name="strncpy">
2837 <tag/Example/None.
2838 </descrip>
2839 </quote>
2840
2841
2842 <sect1>strchr<label id="strchr"><p>
2843
2844 <quote>
2845 <descrip>
2846 <tag/Function/Search for a character in a string.
2847 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2848 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
2849 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
2850 (converted to a char) in the string pointed to by <tt/s/. The terminating null
2851 byte is considered to be part of the string. Upon completion, the function
2852 returns a pointer to the byte, or a null pointer if the byte was not found.
2853 <tag/Limits/<itemize>
2854 <item>The function is only available as fastcall function, so it may only
2855 be used in presence of a prototype.
2856 </itemize>
2857 <tag/Availability/ISO 9899
2858 <tag/See also/
2859 <ref id="strrchr" name="strrchr">
2860 <tag/Example/None.
2861 </descrip>
2862 </quote>
2863
2864
2865 <sect1>strcmp<label id="strcmp"><p>
2866
2867 <quote>
2868 <descrip>
2869 <tag/Function/Compare two strings.
2870 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2871 <tag/Declaration/<tt/int __fastcall__ strcmp (const char* s1, const char* s2);/
2872 <tag/Description/The <tt/strcmp/ function compares the two strings passed as
2873 parameters. It returns a value that is less than zero if <tt/s1/ is less than
2874 <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater than zero
2875 if <tt/s1/ is greater than <tt/s2/.
2876 <tag/Limits/<itemize>
2877 <item>The function is only available as fastcall function, so it may only
2878 be used in presence of a prototype.
2879 </itemize>
2880 <tag/Availability/ISO 9899
2881 <tag/See also/
2882 <ref id="strcasecmp" name="strcasecmp">,
2883 <ref id="strcoll" name="strcoll">,
2884 <ref id="stricmp" name="stricmp">
2885 <tag/Example/None.
2886 </descrip>
2887 </quote>
2888
2889
2890 <sect1>strcoll<label id="strcoll"><p>
2891
2892 <quote>
2893 <descrip>
2894 <tag/Function/Compare two strings.
2895 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2896 <tag/Declaration/<tt/int __fastcall__ strcoll (const char* s1, const char* s2);/
2897 <tag/Description/The <tt/strcoll/ function compares the two strings passed as
2898 parameters, according to the collating sequence set by <tt/<ref id="setlocale"
2899 name="setlocale">/. It returns a value that is less than zero if <tt/s1/ is
2900 less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater
2901 than zero if <tt/s1/ is greater than <tt/s2/.
2902 <tag/Limits/<itemize>
2903 <item>The function is only available as fastcall function, so it may only
2904 be used in presence of a prototype.
2905 </itemize>
2906 <tag/Availability/ISO 9899
2907 <tag/See also/
2908 <ref id="setlocale" name="setlocale">,
2909 <ref id="strcasecmp" name="strcasecmp">,
2910 <ref id="strcmp" name="strcmp">,
2911 <ref id="stricmp" name="stricmp">
2912 <tag/Example/None.
2913 </descrip>
2914 </quote>
2915
2916
2917 <sect1>strcpy<label id="strcpy"><p>
2918
2919 <quote>
2920 <descrip>
2921 <tag/Function/Copy a string.
2922 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2923 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
2924 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
2925 <tt/s2/ (including the terminating null byte) into the array pointed to by
2926 <tt/s1/. The function will always return <tt/s1/.
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>If copying takes place between objects that overlap, the behavior
2931 is undefined.
2932 </itemize>
2933 <tag/Availability/ISO 9899
2934 <tag/See also/
2935 <ref id="strcat" name="strcat">
2936 <ref id="strncpy" name="strncpy">
2937 <tag/Example/
2938 <verb>
2939 #include <string.h>
2940
2941 static char hello[14];
2942
2943 strcpy (hello, "Hello world!\n");
2944 </verb>
2945 </descrip>
2946 </quote>
2947
2948
2949 <sect1>stricmp<label id="stricmp"><p>
2950
2951 <quote>
2952 <descrip>
2953 <tag/Function/Compare two strings case insensitive.
2954 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2955 <tag/Declaration/<tt/int __fastcall__ stricmp (const char* s1, const char* s2);/
2956 <tag/Description/The <tt/stricmp/ function compares the two strings passed as
2957 parameters without case sensitivity. It returns a value that is less than zero
2958 if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
2959 value greater than zero if <tt/s1/ is greater than <tt/s2/.
2960 <tag/Limits/<itemize>
2961 <item>The function is only available as fastcall function, so it may only
2962 be used in presence of a prototype.
2963 <item>The function is not available in strict ANSI mode.
2964 </itemize>
2965 <tag/Availability/cc65
2966 <tag/See also/
2967 <ref id="strcasecmp" name="strcasecmp">,
2968 <ref id="strcmp" name="strcmp">,
2969 <ref id="strcoll" name="strcoll">
2970 <tag/Example/None.
2971 </descrip>
2972 </quote>
2973
2974
2975 <sect1>strlen<label id="strlen"><p>
2976
2977 <quote>
2978 <descrip>
2979 <tag/Function/Return the length of a string.
2980 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2981 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
2982 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
2983 string to which s points, not including the terminating null byte.
2984 <tag/Limits/<itemize>
2985 <item>The function is only available as fastcall function, so it may only
2986 be used in presence of a prototype.
2987 <item>When compiling with <tt/-Os/ (inline known standard functions), the
2988 function does not work correctly for strings with more than 255 characters.
2989 </itemize>
2990 <tag/Availability/ISO 9899
2991 <tag/See also/
2992 <ref id="strcpy" name="strcpy">
2993 <tag/Example/None.
2994 </descrip>
2995 </quote>
2996
2997
2998 <sect1>strlower<label id="strlower"><p>
2999
3000 <quote>
3001 <descrip>
3002 <tag/Function/Make a string lower case.
3003 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3004 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
3005 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
3006 function to each character of a string. The function will always return <tt/s/.
3007 <tag/Limits/<itemize>
3008 <item>The function is only available as fastcall function, so it may only
3009 be used in presence of a prototype.
3010 <item>The function prototype is unavailable when compiling in strict ANSI mode.
3011 <item>An alias name for this function is <tt/strlwr/.
3012 </itemize>
3013 <tag/Availability/cc65
3014 <tag/See also/
3015 <ref id="strupper" name="strupper">
3016 <ref id="tolower" name="tolower">
3017 <tag/Example/None.
3018 </descrip>
3019 </quote>
3020
3021
3022 <sect1>strlwr<label id="strlwr"><p>
3023
3024 <quote>
3025 See <tt/strlower/.
3026 </quote>
3027
3028
3029 <sect1>strncpy<label id="strncpy"><p>
3030
3031 <quote>
3032 <descrip>
3033 <tag/Function/Copy part of a string.
3034 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3035 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
3036 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
3037 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
3038 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
3039 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
3040 written. The function will always return <tt/s1/.
3041 <tag/Limits/<itemize>
3042 <item>The function is only available as fastcall function, so it may only
3043 be used in presence of a prototype. If there is no null byte in the first <tt/n/
3044 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
3045 <item>If copying takes place between objects that overlap, the behavior is
3046 undefined.
3047 </itemize>
3048 <tag/Availability/ISO 9899
3049 <tag/See also/
3050 <ref id="strcat" name="strcat">
3051 <ref id="strcpy" name="strcpy">
3052 <tag/Example/
3053 <verb>
3054 #include <string.h>
3055
3056 static char hello[6];
3057
3058 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
3059 hello[5] = '\0';
3060 </verb>
3061 </descrip>
3062 </quote>
3063
3064
3065 <sect1>strrchr<label id="strrchr"><p>
3066
3067 <quote>
3068 <descrip>
3069 <tag/Function/Search for a character in a string.
3070 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3071 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
3072 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
3073 (converted to a char) in the string pointed to by <tt/s/. The terminating null
3074 byte is considered to be part of the string. Upon completion, the function
3075 returns a pointer to the byte, or a null pointer if the byte was not found.
3076 <tag/Limits/<itemize>
3077 <item>The function is only available as fastcall function, so it may only
3078 be used in presence of a prototype.
3079 </itemize>
3080 <tag/Availability/ISO 9899
3081 <tag/See also/
3082 <ref id="strchr" name="strchr">
3083 <tag/Example/None.
3084 </descrip>
3085 </quote>
3086
3087
3088 <sect1>strupper<label id="strupper"><p>
3089
3090 <quote>
3091 <descrip>
3092 <tag/Function/Make a string upper case.
3093 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3094 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
3095 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
3096 function to each character of a string. The function will always return <tt/s/.
3097 <tag/Limits/<itemize>
3098 <item>The function is only available as fastcall function, so it may only
3099 be used in presence of a prototype.
3100 <item>The function prototype is unavailable when compiling in strict ANSI mode.
3101 <item>An alias name for this function is <tt/strupr/.
3102 </itemize>
3103 <tag/Availability/cc65
3104 <tag/See also/
3105 <ref id="strlower" name="strlower">
3106 <ref id="toupper" name="toupper">
3107 <tag/Example/None.
3108 </descrip>
3109 </quote>
3110
3111
3112 <sect1>strupr<label id="strupr"><p>
3113
3114 <quote>
3115 See <tt/strupper/.
3116 </quote>
3117
3118
3119 <sect1>textcolor<label id="textcolor"><p>
3120
3121 <quote>
3122 <descrip>
3123 <tag/Function/Set the text color.
3124 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3125 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
3126 <tag/Description/The function will set a new text color. It returns the old
3127 (current) text color. Text output using any <tt/conio.h/ function will use
3128 the color set by this function.
3129 <tag/Limits/<itemize>
3130 <item>Text colors are system dependent. The function may have no effect
3131 on systems where the text color cannot be changed.
3132 <item>The function is only available as fastcall function, so it may only
3133 be used in presence of a prototype.
3134 </itemize>
3135 <tag/Availability/cc65
3136 <tag/See also/
3137 <ref id="bgcolor" name="bgcolor">,
3138 <ref id="bordercolor" name="bordercolor">
3139 <tag/Example/None.
3140 </descrip>
3141 </quote>
3142
3143
3144 <sect1>toggle_videomode<label id="toggle_videomode"><p>
3145
3146 <quote>
3147 <descrip>
3148 <tag/Function/Toggle between 40 and 80 column mode.
3149 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
3150 <tag/Declaration/<tt/void toggle_videomode (void);/
3151 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
3152 old mode (cursor position, color and so on) are saved and restored together
3153 with the mode.
3154 <tag/Limits/<itemize>
3155 <item>The function is specific to the C128.
3156 </itemize>
3157 <tag/Availability/C128
3158 <tag/See also/
3159 <ref id="fast" name="fast">,
3160 <ref id="slow" name="slow">
3161 <tag/Example/None.
3162 </descrip>
3163 </quote>
3164
3165
3166 <sect1>tolower<label id="tolower"><p>
3167
3168 <quote>
3169 <descrip>
3170 <tag/Function/Convert a character into its lower case representation.
3171 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
3172 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
3173 <tag/Description/The function returns the given character converted to lower
3174 case. If the given character is not a letter, it is returned unchanged.
3175 <tag/Limits/<itemize>
3176 <item>The function is only available as fastcall function, so it may
3177 only be used in presence of a prototype.
3178 </itemize>
3179 <tag/Availability/ISO 9899
3180 <tag/See also/
3181 <ref id="islower" name="islower">,
3182 <ref id="isupper" name="isupper">,
3183 <ref id="toupper" name="toupper">
3184 <tag/Example/None.
3185 </descrip>
3186 </quote>
3187
3188
3189 <sect1>toupper<label id="toupper"><p>
3190
3191 <quote>
3192 <descrip>
3193 <tag/Function/Convert a character into its upper case representation.
3194 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
3195 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
3196 <tag/Description/The function returns the given character converted to upper
3197 case. If the given character is not a letter, it is returned unchanged.
3198 <tag/Limits/<itemize>
3199 <item>The function is only available as fastcall function, so it may
3200 only be used in presence of a prototype.
3201 </itemize>
3202 <tag/Availability/ISO 9899
3203 <tag/See also/
3204 <ref id="islower" name="islower">,
3205 <ref id="isupper" name="isupper">,
3206 <ref id="tolower" name="tolower">
3207 <tag/Example/None.
3208 </descrip>
3209 </quote>
3210
3211
3212 <sect1>ultoa<label id="ultoa"><p>
3213
3214 <quote>
3215 <descrip>
3216 <tag/Function/Convert an unsigned long integer into a string.
3217 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3218 <tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
3219 <tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
3220 string using <tt/radix/ as the base.
3221 <tag/Limits/<itemize>
3222 <item>There are no provisions to prevent a buffer overflow.
3223 <item>The function is non standard, so it is not available in strict ANSI mode.
3224 You should probably use <tt/sprintf/ instead.
3225 <item>The function is only available as fastcall function, so it may only be
3226 used in presence of a prototype.
3227 </itemize>
3228 <tag/Availability/cc65
3229 <tag/See also/
3230 <ref id="atoi" name="atoi">,
3231 <ref id="atol" name="atol">,
3232 <ref id="itoa" name="itoa">,
3233 <ref id="ltoa" name="ltoa">,
3234 <ref id="utoa" name="utoa">
3235 <tag/Example/None.
3236 </descrip>
3237 </quote>
3238
3239
3240 <sect1>utoa<label id="utoa"><p>
3241
3242 <quote>
3243 <descrip>
3244 <tag/Function/Convert an unsigned integer into a string.
3245 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3246 <tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
3247 <tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
3248 using <tt/radix/ as the base.
3249 <tag/Limits/<itemize>
3250 <item>There are no provisions to prevent a buffer overflow.
3251 <item>The function is non standard, so it is not available in strict ANSI mode.
3252 You should probably use <tt/sprintf/ instead.
3253 <item>The function is only available as fastcall function, so it may only be
3254 used in presence of a prototype.
3255 </itemize>
3256 <tag/Availability/cc65
3257 <tag/See also/
3258 <ref id="atoi" name="atoi">,
3259 <ref id="atol" name="atol">,
3260 <ref id="itoa" name="itoa">,
3261 <ref id="ltoa" name="ltoa">,
3262 <ref id="ultoa" name="ultoa">
3263 <tag/Example/None.
3264 </descrip>
3265 </quote>
3266
3267
3268 <sect1>wherex<label id="wherex"><p>
3269
3270 <quote>
3271 <descrip>
3272 <tag/Function/Return the current X position of the text mode cursor.
3273 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3274 <tag/Declaration/<tt/unsigned char wherex (void);/
3275 <tag/Description/The function returns the current X position of the text mode
3276 cursor. Zero is returned for the leftmost screen position.
3277 <tag/Availability/cc65
3278 <tag/See also/
3279 <ref id="gotox" name="gotox">,
3280 <ref id="gotoy" name="gotoy">,
3281 <ref id="gotoxy" name="gotoxy">,
3282 <ref id="wherey" name="wherey">
3283 <tag/Example/None.
3284 </descrip>
3285 </quote>
3286
3287
3288 <sect1>wherey<label id="wherey"><p>
3289
3290 <quote>
3291 <descrip>
3292 <tag/Function/Return the current Y position of the text mode cursor.
3293 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3294 <tag/Declaration/<tt/unsigned char wherey (void);/
3295 <tag/Description/The function returns the current Y position of the text mode
3296 cursor. Zero is returned for the uppermost screen position.
3297 <tag/Availability/cc65
3298 <tag/See also/
3299 <ref id="gotox" name="gotox">,
3300 <ref id="gotoy" name="gotoy">,
3301 <ref id="gotoxy" name="gotoxy">,
3302 <ref id="wherex" name="wherex">
3303 <tag/Example/None.
3304 </descrip>
3305 </quote>
3306
3307
3308 </article>
3309
3310