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