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