<!doctype linuxdoc system>

<article>
<title>cc65 function reference
<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">,<newline>
<url url="mailto:greg.king5@verizon.net" name="Greg King">

<abstract>
cc65 is a C compiler for 6502 based systems. This function reference describes
the C functions available in the standard library.
</abstract>

<!-- Table of contents -->
<toc>

<!-- Begin the document -->

<sect>Introduction<p>

cc65 is a C compiler for 6502-based systems. It implements a subset of the ISO
C standard plus additional functions specially crafted for 6502 systems or
just some of the supported machines. This function reference describes the
available functions together with any limitations.

For an overview about the available libraries, their purpose, and any
differences to the ISO standard, please have a look at the <url
url="library.html" name="cc65 Library Overview">.

<em/Note:/ Standard C functions are listed here, but not described in detail.
Because those functions behave identically on all standard-compliant systems,
they are described in any book covering standard C.

Each entry for a function contains a detailed description

<quote>
<descrip>
<tag/Function/Summary of what <bf/function/ does.
<tag/Header/The header file that contains the declaration.
<tag/Declaration/Describes the needed header files and declaration of the
function.
<tag/Description/Description of the function.
<tag/Notes/Notes on the function.
<tag/Availability/The availability of the function.
<tag/See also/Other related functions.
<tag/Example/A piece of actual code using the function.
</descrip>
</quote>


<sect>Functions by header file<p>

<sect1><tt/6502.h/<label id="6502.h"><p>

<itemize>
<item><ref id="BRK" name="BRK">
<item><ref id="CLI" name="CLI">
<item><ref id="SEI" name="SEI">
<item><ref id="_sys" name="_sys">
<item><ref id="getcpu" name="getcpu">
<item><ref id="reset_brk" name="reset_brk">
<item><ref id="reset_irq" name="reset_irq">
<item><ref id="set_brk" name="set_brk">
<item><ref id="set_irq" name="set_irq">
</itemize>


<sect1><tt/accelerator.h/<label id="accelerator.h"><p>

<itemize>
<item><ref id="detect_c128" name="detect_c128">
<item><ref id="detect_c64dtv" name="detect_c64dtv">
<item><ref id="detect_c65" name="detect_c65">
<item><ref id="detect_chameleon" name="detect_chameleon">
<item><ref id="detect_scpu" name="detect_scpu">
<item><ref id="detect_turbomaster" name="detect_turbomaster">
<item><ref id="get_c128_speed" name="get_c128_speed">
<item><ref id="get_c64dtv_speed" name="get_c64dtv_speed">
<item><ref id="get_c65_speed" name="get_c65_speed">
<item><ref id="get_chameleon_speed" name="get_chameleon_speed">
<item><ref id="get_scpu_speed" name="get_scpu_speed">
<item><ref id="get_turbomaster_speed" name="get_turbomaster_speed">
<item><ref id="set_c128_speed" name="set_c128_speed">
<item><ref id="set_c64dtv_speed" name="set_c64dtv_speed">
<item><ref id="set_c65_speed" name="set_c65_speed">
<item><ref id="set_chameleon_speed" name="set_chameleon_speed">
<item><ref id="set_scpu_speed" name="set_scpu_speed">
<item><ref id="set_turbomaster_speed" name="set_turbomaster_speed">
</itemize>


<sect1><tt/apple2.h/<label id="apple2.h"><p>

<itemize>
<item>_dos_type
<item><ref id="get_ostype" name="get_ostype">
<item>rebootafterexit
</itemize>


<sect1><tt/apple2enh.h/<label id="apple2enh.h"><p>

<itemize>
<item>_dos_type
<item><ref id="get_ostype" name="get_ostype">
<item>rebootafterexit
<item><ref id="videomode" name="videomode">
</itemize>


<sect1><tt/assert.h/<label id="assert.h"><p>

<itemize>
<item><ref id="assert" name="assert">
</itemize>


<sect1><tt/atari.h/<label id="atari.h"><p>

<itemize>
<!-- <item><ref id="_getcolor" name="_getcolor"> -->
<!-- <item><ref id="_getdefdev" name="_getdefdev"> -->
<!-- <item><ref id="_graphics" name="_graphics"> -->
<item><ref id="_is_cmdline_dos" name="_is_cmdline_dos">
<!-- <item><ref id="_rest_vecs" name="_rest_vecs"> -->
<!-- <item><ref id="_save_vecs" name="_save_vecs"> -->
<!-- <item><ref id="_scroll" name="_scroll"> -->
<!-- <item><ref id="_setcolor" name="_setcolor"> -->
<!-- <item><ref id="_setcolor_low" name="_setcolor_low"> -->
<item><ref id="_sound" name="_sound">
<item><ref id="get_ostype" name="get_ostype">
<!-- <item><ref id="get_tv" name="get_tv"> -->
</itemize>

(incomplete)


<sect1><tt/atmos.h/<label id="atmos.h"><p>

<itemize>
<item><ref id="atmos_explode" name="atmos_explode">
<item><ref id="atmos_load" name="atmos_load">
<item><ref id="atmos_ping" name="atmos_ping">
<item><ref id="atmos_save" name="atmos_save">
<item><ref id="atmos_shoot" name="atmos_shoot">
<item><ref id="atmos_tick" name="atmos_tick">
<item><ref id="atmos_tock" name="atmos_tock">
<item><ref id="atmos_zap" name="atmos_zap">
</itemize>


<sect1><tt/c128.h/<label id="c128.h"><p>

<itemize>
<item><ref id="c64mode" name="c64mode">
<item><ref id="fast" name="fast">
<item><ref id="isfast" name="isfast">
<item><ref id="slow" name="slow">
<item><ref id="toggle_videomode" name="toggle_videomode">
<item><ref id="videomode" name="videomode">
</itemize>


<sect1><tt/c16.h/<label id="c16.h"><p>

<itemize>
<item><ref id="fast" name="fast">
<item><ref id="isfast" name="isfast">
<item><ref id="slow" name="slow">
</itemize>

(incomplete)


<sect1><tt/c64.h/<label id="c64.h"><p>

<itemize>
<item><ref id="get_ostype" name="get_ostype">
</itemize>


<sect1><tt/cbm.h/<label id="cbm.h"><p>

<itemize>
<item><ref id="cbm_k_acptr" name="cbm_k_acptr">
<item><ref id="cbm_k_basin" name="cbm_k_basin">
<item><ref id="cbm_k_bsout" name="cbm_k_bsout">
<item><ref id="cbm_k_chkin" name="cbm_k_chkin">
<item><ref id="cbm_k_ciout" name="cbm_k_ciout">
<item><ref id="cbm_k_ckout" name="cbm_k_ckout">
<item><ref id="cbm_k_clall" name="cbm_k_clall">
<item><ref id="cbm_k_close" name="cbm_k_close">
<item><ref id="cbm_k_clrch" name="cbm_k_clrch">
<item><ref id="cbm_k_getin" name="cbm_k_getin">
<item><ref id="cbm_k_iobase" name="cbm_k_iobase">
<item><ref id="cbm_k_listen" name="cbm_k_listen">
<item><ref id="cbm_k_load" name="cbm_k_load">
<item><ref id="cbm_k_open" name="cbm_k_open">
<item><ref id="cbm_k_readst" name="cbm_k_readst">
<item><ref id="cbm_k_save" name="cbm_k_save">
<item><ref id="cbm_k_scnkey" name="cbm_k_scnkey">
<item><ref id="cbm_k_second" name="cbm_k_second">
<item><ref id="cbm_k_setlfs" name="cbm_k_setlfs">
<item><ref id="cbm_k_setnam" name="cbm_k_setnam">
<item><ref id="cbm_k_settim" name="cbm_k_settim">
<item><ref id="cbm_k_talk" name="cbm_k_talk">
<item><ref id="cbm_k_tksa" name="cbm_k_tksa">
<item><ref id="cbm_k_udtim" name="cbm_k_udtim">
<item><ref id="cbm_k_unlsn" name="cbm_k_unlsn">
<item><ref id="cbm_k_untlk" name="cbm_k_untlk">
<!-- <item><ref id="cbm_load" name="cbm_load"> -->
<!-- <item><ref id="cbm_open" name="cbm_open"> -->
<!-- <item><ref id="cbm_opendir" name="cbm_opendir"> -->
<!-- <item><ref id="cbm_read" name="cbm_read"> -->
<!-- <item><ref id="cbm_readdir" name="cbm_readdir"> -->
<!-- <item><ref id="cbm_save" name="cbm_save"> -->
<!-- <item><ref id="cbm_write" name="cbm_write"> -->
<!-- <item><ref id="get_tv" name="get_tv"> -->
<item><ref id="kbrepeat" name="kbrepeat">
<item><ref id="waitvsync" name="waitvsync">
</itemize>

(incomplete)


<sect1><tt/cbm510.h/<label id="cbm510.h"><p>

<itemize>
<item><ref id="peekbsys" name="peekbsys">
<item><ref id="peekwsys" name="peekwsys">
<item><ref id="pokebsys" name="pokebsys">
<item><ref id="pokewsys" name="pokewsys">
</itemize>


<sect1><tt/cbm610.h/<label id="cbm610.h"><p>

<itemize>
<item><ref id="peekbsys" name="peekbsys">
<item><ref id="peekwsys" name="peekwsys">
<item><ref id="pokebsys" name="pokebsys">
<item><ref id="pokewsys" name="pokewsys">
</itemize>


<sect1><tt/cc65.h/<label id="cc65.h"><p>

<itemize>

<!-- <item><ref id="_cos" name="_cos"> -->
<!-- <item><ref id="idiv32by16r16" name="idiv32by16r16"> -->
<!-- <item><ref id="imul16x16r32" name="imul16x16r32"> -->
<!-- <item><ref id="imul8x8r16" name="imul8x8r16"> -->
<!-- <item><ref id="_sin" name="_sin"> -->
<!-- <item><ref id="udiv32by16r16" name="udiv32by16r16"> -->
<!-- <item><ref id="umul16x16r32" name="umul16x16r32"> -->
<!-- <item><ref id="umul16x8r32" name="umul16x8r32"> -->
<!-- <item><ref id="umul8x8r16" name="umul8x8r16"> -->
<item><ref id="doesclrscrafterexit" name="doesclrscrafterexit">
<item><ref id="mul20" name="mul20">
<item><ref id="mul40" name="mul40">
</itemize>

(incomplete)


<sect1><tt/conio.h/<label id="conio.h"><p>

<itemize>
<item><ref id="bgcolor" name="bgcolor">
<item><ref id="bordercolor" name="bordercolor">
<item><ref id="cclear" name="cclear">
<item><ref id="cclearxy" name="cclearxy">
<item><ref id="cgetc" name="cgetc">
<item><ref id="chline" name="chline">
<item><ref id="chlinexy" name="chlinexy">
<item><ref id="clrscr" name="clrscr">
<item><ref id="cpeekc" name="cpeekc">
<item><ref id="cpeekcolor" name="cpeekcolor">
<item><ref id="cpeekrevers" name="cpeekrevers">
<item><ref id="cpeeks" name="cpeeks">
<item><ref id="cprintf" name="cprintf">
<item><ref id="cputc" name="cputc">
<item><ref id="cputcxy" name="cputcxy">
<item><ref id="cputs" name="cputs">
<item><ref id="cputsxy" name="cputsxy">
<item><ref id="cursor" name="cursor">
<item><ref id="cvline" name="cvline">
<item><ref id="cvlinexy" name="cvlinexy">
<item><ref id="gotox" name="gotox">
<item><ref id="gotoxy" name="gotoxy">
<item><ref id="gotoy" name="gotoy">
<item><ref id="kbhit" name="kbhit">
<item><ref id="revers" name="revers">
<item><ref id="screensize" name="screensize">
<item><ref id="textcolor" name="textcolor">
<item><ref id="vcprintf" name="vcprintf">
<item><ref id="wherex" name="wherex">
<item><ref id="wherey" name="wherey">
</itemize>


<sect1><tt/creativision.h/<label id="creativision.h"><p>

<itemize>
<item><ref id="bios_playsound" name="bios_playsound">
<item><ref id="psg_delay" name="psg_delay">
<item><ref id="psg_outb" name="psg_outb">
<item><ref id="psg_silence" name="psg_silence">
</itemize>


<sect1><tt/ctype.h/<label id="ctype.h"><p>

<itemize>
<item><ref id="isalnum" name="isalnum">
<item><ref id="isalpha" name="isalpha">
<item><ref id="isascii" name="isascii">
<item><ref id="isblank" name="isblank">
<item><ref id="iscntrl" name="iscntrl">
<item><ref id="isdigit" name="isdigit">
<item><ref id="isgraph" name="isgraph">
<item><ref id="islower" name="islower">
<item><ref id="isprint" name="isprint">
<item><ref id="ispunct" name="ispunct">
<item><ref id="isspace" name="isspace">
<item><ref id="isupper" name="isupper">
<item><ref id="isxdigit" name="isxdigit">
<item><ref id="tolower" name="tolower">
<item><ref id="toupper" name="toupper">
</itemize>


<sect1><tt/cx16.h/<label id="cx16.h"><p>

<itemize>
<!-- <item><ref id="get_numbanks" name="get_numbanks"> -->
<!-- <item><ref id="get_ostype" name="get_ostype"> -->
<!-- <item><ref id="get_tv" name="get_tv"> -->
<!-- <item><ref id="set_tv" name="set_tv"> -->
<item><ref id="videomode" name="videomode">
<!-- <item><ref id="vpeek" name="vpeek"> -->
<!-- <item><ref id="vpoke" name="vpoke"> -->
</itemize>

(incomplete)


<sect1><tt/dbg.h/<label id="dbg.h"><p>

<!-- <itemize> -->
<!-- <item><ref id="DbgInit" name="DbgInit"> -->
<!-- </itemize> -->

(incomplete)


<sect1><tt/device.h/<label id="device.h"><p>

<itemize>
<item><ref id="getcurrentdevice" name="getcurrentdevice">
<item><ref id="getdevicedir" name="getdevicedir">
<item><ref id="getfirstdevice" name="getfirstdevice">
<item><ref id="getnextdevice" name="getnextdevice">
</itemize>


<sect1><tt/dio.h/<label id="dio.h"><p>

<url url="dio.html" name="Low-level disk I/O API">.


<sect1><tt/dirent.h/<label id="dirent.h"><p>

<itemize>
<item><ref id="_DE_ISDIR" name="_DE_ISDIR">
<item><ref id="_DE_ISLBL" name="_DE_ISLBL">
<item><ref id="_DE_ISLNK" name="_DE_ISLNK">
<item><ref id="_DE_ISREG" name="_DE_ISREG">
<item><ref id="closedir" name="closedir">
<item><ref id="opendir" name="opendir">
<item><ref id="readdir" name="readdir">
<item><ref id="rewinddir" name="rewinddir">
<item><ref id="seekdir" name="seekdir">
<item><ref id="telldir" name="telldir">
</itemize>


<sect1><tt/em.h/<label id="em.h"><p>

This header file contains definitions for extended memory access,
see also <tt>testcode/lib/em-test.c</tt> and <tt>samples/multidemo.c</tt>.

<itemize>
<item><ref id="em_commit" name="em_commit">
<item><ref id="em_copyfrom" name="em_copyfrom">
<item><ref id="em_copyto" name="em_copyto">
<item><ref id="em_install" name="em_install">
<item><ref id="em_load_driver" name="em_load_driver">
<item><ref id="em_map" name="em_map">
<item><ref id="em_pagecount" name="em_pagecount">
<item><ref id="em_uninstall" name="em_uninstall">
<item><ref id="em_unload" name="em_unload">
<item><ref id="em_use" name="em_use">
</itemize>


<sect1><tt/errno.h/<label id="errno.h"><p>

<!-- <itemize> -->
<!-- <item><ref id="_directerrno" name="_directerrno"> -->
<!-- <item><ref id="_mappederrno" name="_mappederrno"> -->
<!-- <item><ref id="_osmaperrno" name="_osmaperrno"> -->
<!-- <item><ref id="_seterrno" name="_seterrno"> -->
<!-- </itemize> -->

(incomplete)


<sect1><tt/fcntl.h/<label id="fcntl.h"><p>

<itemize>
<item><ref id="close" name="close">
<item><ref id="creat" name="creat">
<item><ref id="open" name="open">
</itemize>


<sect1><tt/gamate.h/<label id="gamate.h"><p>

<itemize>
<!-- <item><ref id="get_tv" name="get_tv"> -->
<item><ref id="waitvsync" name="waitvsync">
</itemize>

(incomplete)


<sect1><tt/geos.h/<label id="geos.h"><p>

<url url="geos.html" name="GEOS API">.


<sect1><tt/joystick.h/<label id="joystick.h"><p>

<itemize>
<item><ref id="joy_count" name="joy_count">
<item><ref id="joy_install" name="joy_install">
<item><ref id="joy_load_driver" name="joy_load_driver">
<item><ref id="joy_read" name="joy_read">
<item><ref id="joy_uninstall" name="joy_uninstall">
<item><ref id="joy_unload" name="joy_unload">
</itemize>


<sect1><tt/locale.h/<label id="locale.h"><p>

<itemize>
<item><ref id="localeconv" name="localeconv">
<item><ref id="setlocale" name="setlocale">
</itemize>


<sect1><tt/lynx.h/<label id="lynx.h"><p>

<!-- <itemize> -->
<!-- <item><ref id="lynx_eeprom_erase" name="lynx_eeprom_erase"> -->
<!-- <item><ref id="lynx_eeprom_read" name="lynx_eeprom_read"> -->
<!-- <item><ref id="lynx_eeprom_write" name="lynx_eeprom_write"> -->
<!-- <item><ref id="lynx_eeread" name="lynx_eeread"> -->
<!-- <item><ref id="lynx_eewrite" name="lynx_eewrite"> -->
<!-- <item><ref id="lynx_exec" name="lynx_exec"> -->
<!-- <item><ref id="lynx_load" name="lynx_load"> -->
<!-- </itemize> -->

(incomplete)


<sect1><tt/lz4.h/<label id="lz4.h"><p>

<itemize>
<item><ref id="decompress_lz4" name="decompress_lz4">
</itemize>


<sect1><tt/modload.h/<label id="modload.h"><p>

<itemize>
<item><ref id="mod_load" name="mod_load">
<item><ref id="mod_free" name="mod_free">
</itemize>


<sect1><tt/mouse.h/<label id="mouse.h"><p>

<itemize>
<item><ref id="mouse_buttons" name="mouse_buttons">
<item><ref id="mouse_getbox" name="mouse_getbox">
<item><ref id="mouse_geterrormsg" name="mouse_geterrormsg">
<item><ref id="mouse_hide" name="mouse_hide">
<item><ref id="mouse_info" name="mouse_info">
<item><ref id="mouse_install" name="mouse_install">
<item><ref id="mouse_ioctl" name="mouse_ioctl">
<item><ref id="mouse_load_driver" name="mouse_load_driver">
<item><ref id="mouse_move" name="mouse_move">
<item><ref id="mouse_pos" name="mouse_pos">
<item><ref id="mouse_setbox" name="mouse_setbox">
<item><ref id="mouse_show" name="mouse_show">
<item><ref id="mouse_uninstall" name="mouse_uninstall">
<item><ref id="mouse_unload" name="mouse_unload">
</itemize>


<sect1><tt/nes.h/<label id="nes.h"><p>

<itemize>
<!-- <item><ref id="get_tv" name="get_tv"> -->
<item><ref id="waitvsync" name="waitvsync">
</itemize>

(incomplete)


<sect1><tt/o65.h/<label id="o65.h"><p>

The <tt/o65.h/ header file contains structure and constant definitions that
may be used when dealing with files in <url
url="http://www.6502.org/users/andre/o65/fileformat.html" name="the o65 format">.
It does not declare any functions.


<sect1><tt/pce.h/<label id="pce.h"><p>

<itemize>
<!-- <item><ref id="get_tv" name="get_tv"> -->
<item><ref id="waitvsync" name="waitvsync">
</itemize>

(incomplete)


<sect1><tt/peekpoke.h/<label id="peekpoke.h"><p>

<itemize>
<item><ref id="PEEK" name="PEEK">
<item><ref id="PEEKW" name="PEEKW">
<item><ref id="POKE" name="POKE">
<item><ref id="POKEW" name="POKEW">
</itemize>


<sect1><tt/pen.h/<label id="pen.h"><p>

<!-- <itemize> -->
<!-- <item><ref id="pen_adjust" name="pen_adjust"> -->
<!-- <item><ref id="pen_calibrate" name="pen_calibrate"> -->
<!-- </itemize> -->

(incomplete)


<sect1><tt/pet.h/<label id="pet.h"><p>

(incomplete)


<sect1><tt/plus4.h/<label id="plus4.h"><p>

<itemize>
<item><ref id="fast" name="fast">
<item><ref id="isfast" name="isfast">
<item><ref id="slow" name="slow">
</itemize>

(incomplete)


<sect1><tt/serial.h/<label id="serial.h"><p>

This header file contains definitions for initializing serial
communication, see also <tt>testcode/lib/ser-test.c</tt>.

<itemize>
<item><ref id="ser_close" name="ser_close">
<item><ref id="ser_get" name="ser_get">
<item><ref id="ser_install" name="ser_install">
<item><ref id="ser_ioctl" name="ser_ioctl">
<item><ref id="ser_load_driver" name="ser_load_driver">
<item><ref id="ser_open" name="ser_open">
<item><ref id="ser_put" name="ser_put">
<item><ref id="ser_status" name="ser_status">
<item><ref id="ser_uninstall" name="ser_uninstall">
<item><ref id="ser_unload" name="ser_unload">
</itemize>


<sect1><tt/setjmp.h/<label id="setjmp.h"><p>

<itemize>
<item><ref id="setjmp" name="setjmp">
<item><ref id="longjmp" name="longjmp">
</itemize>


<sect1><tt/signal.h/<label id="signal.h"><p>

<itemize>
<item><ref id="raise" name="raise">
<item><ref id="signal" name="signal">
</itemize>

<sect1><tt/stdarg.h/<label id="stdarg.h"><p>

(incomplete)


<sect1><tt/stdbool.h/<label id="stdbool.h"><p>

(incomplete)


<sect1><tt/stddef.h/<label id="stddef.h"><p>

<itemize>
<item><ref id="offsetof" name="offsetof">
</itemize>


<sect1><tt/stdio.h/<label id="stdio.h"><p>

<itemize>
<item><ref id="_poserror" name="_poserror">
<item><ref id="clearerr" name="clearerr">
<!-- <item><ref id="fclose" name="fclose"> -->
<!-- <item><ref id="fdopen" name="fdopen"> -->
<item><ref id="feof" name="feof">
<item><ref id="ferror" name="ferror">
<!-- <item><ref id="fflush" name="fflush"> -->
<!-- <item><ref id="fgetc" name="fgetc"> -->
<!-- <item><ref id="fgetpos" name="fgetpos"> -->
<!-- <item><ref id="fgets" name="fgets"> -->
<item><ref id="fileno" name="fileno">
<!-- <item><ref id="fopen" name="fopen"> -->
<!-- <item><ref id="fprintf" name="fprintf"> -->
<!-- <item><ref id="fputc" name="fputc"> -->
<!-- <item><ref id="fputs" name="fputs"> -->
<!-- <item><ref id="fread" name="fread"> -->
<!-- <item><ref id="freopen" name="freopen"> -->
<!-- <item><ref id="fscanf" name="fscanf"> -->
<!-- <item><ref id="fseek" name="fseek"> -->
<!-- <item><ref id="fsetpos" name="fsetpos"> -->
<!-- <item><ref id="ftell" name="ftell"> -->
<!-- <item><ref id="fwrite" name="fwrite"> -->
<!-- <item><ref id="getc" name="getc"> -->
<!-- <item><ref id="getchar" name="getchar"> -->
<!-- <item><ref id="gets" name="gets"> -->
<!-- <item><ref id="printf" name="printf"> -->
<!-- <item><ref id="putc" name="putc"> -->
<!-- <item><ref id="putchar" name="putchar"> -->
<!-- <item><ref id="puts" name="puts"> -->
<item><ref id="rename" name="rename">
<item><ref id="remove" name="remove">
<!-- <item><ref id="rewind" name="rewind"> -->
<!-- <item><ref id="scanf" name="scanf"> -->
<!-- <item><ref id="snprintf" name="snprintf"> -->
<!-- <item><ref id="sprintf" name="sprintf"> -->
<!-- <item><ref id="sscanf" name="sscanf"> -->
<!-- <item><ref id="vfprintf" name="vfprintf"> -->
<!-- <item><ref id="vfscanf" name="vfscanf"> -->
<!-- <item><ref id="vprintf" name="vprintf"> -->
<!-- <item><ref id="vscanf" name="vscanf"> -->
<!-- <item><ref id="vsnprintf" name="vsnprintf"> -->
<!-- <item><ref id="vsprintf" name="vsprintf"> -->
<!-- <item><ref id="vsscanf" name="vsscanf"> -->
</itemize>

(incomplete)


<sect1><tt/stdlib.h/<label id="stdlib.h"><p>

<itemize>
<item><ref id="_heapadd" name="_heapadd">
<item><ref id="_heapblocksize" name="_heapblocksize">
<item><ref id="_heapmaxavail" name="_heapmaxavail">
<item><ref id="_heapmemavail" name="_heapmemavail">
<item><ref id="_randomize" name="_randomize">
<item><ref id="_swap" name="_swap">
<item><ref id="abort" name="abort">
<item><ref id="abs" name="abs">
<item><ref id="atexit" name="atexit">
<item><ref id="atoi" name="atoi">
<item><ref id="atol" name="atol">
<item><ref id="bsearch" name="bsearch">
<item><ref id="calloc" name="calloc">
<item><ref id="div" name="div">
<item><ref id="exit" name="exit">
<item><ref id="free" name="free">
<item><ref id="getenv" name="getenv">
<item><ref id="itoa" name="itoa">
<item><ref id="labs" name="labs">
<item><ref id="ltoa" name="ltoa">
<item><ref id="malloc" name="malloc">
<item><ref id="perror" name="perror">
<!-- <item><ref id="posix_memalign" name="posix_memalign"> -->
<!-- <item><ref id="putenv" name="putenv"> -->
<item><ref id="qsort" name="qsort">
<item><ref id="rand" name="rand">
<item><ref id="realloc" name="realloc">
<item><ref id="srand" name="srand">
<!-- <item><ref id="system" name="system"> -->
<item><ref id="ultoa" name="ultoa">
<item><ref id="utoa" name="utoa">
</itemize>

(incomplete)


<sect1><tt/string.h/<label id="string.h"><p>

<itemize>
<item><ref id="_stroserror" name="_stroserror">
<item><ref id="bzero" name="bzero">
<item><ref id="memchr" name="memchr">
<item><ref id="memcmp" name="memcmp">
<item><ref id="memcpy" name="memcpy">
<item><ref id="memmove" name="memmove">
<item><ref id="memset" name="memset">
<item><ref id="strcasecmp" name="strcasecmp">
<item><ref id="strcat" name="strcat">
<item><ref id="strchr" name="strchr">
<item><ref id="strcmp" name="strcmp">
<item><ref id="strcoll" name="strcoll">
<item><ref id="strcpy" name="strcpy">
<item><ref id="strcspn" name="strcspn">
<item><ref id="strdup" name="strdup">
<item><ref id="strerror" name="strerror">
<item><ref id="stricmp" name="stricmp">
<item><ref id="strlen" name="strlen">
<item><ref id="strlower" name="strlower">
<item><ref id="strlwr" name="strlwr">
<item><ref id="strncasecmp" name="strncasecmp">
<item><ref id="strncat" name="strncat">
<item><ref id="strncmp" name="strncmp">
<item><ref id="strncpy" name="strncpy">
<item><ref id="strnicmp" name="strnicmp">
<item><ref id="strpbrk" name="strpbrk">
<item><ref id="strqtok" name="strqtok">
<item><ref id="strrchr" name="strrchr">
<item><ref id="strspn" name="strspn">
<item><ref id="strstr" name="strstr">
<item><ref id="strtok" name="strtok">
<item><ref id="strxfrm" name="strxfrm">
<item><ref id="strupper" name="strupper">
<item><ref id="strupr" name="strupr">
</itemize>


<sect1><tt/sym1.h/<label id="sym1.h"><p>

<itemize>
<item><ref id="beep" name="beep">
<item><ref id="fdisp" name="fdisp">
<item><ref id="loadt" name="loadt">
<item><ref id="dumpt" name="dumpt">
</itemize>


<sect1><tt/telestrat.h/<label id="telestrat.h"><p>

<itemize>
<item><ref id="atmos_explode" name="explode">
<item><ref id="atmos_ping" name="ping">
<item><ref id="atmos_shoot" name="shoot">
<item><ref id="atmos_zap" name="zap">
<!-- <item><ref id="kbdclick1" name="kbdclick1"> -->
<!-- <item><ref id="oups" name="oups"> -->
</itemize>

(incomplete)


<sect1><tt/tgi.h/<label id="tgi.h"><p>

<url url="tgi.html" name="Tiny Graphics Interface">.


<sect1><tt/time.h/<label id="time.h"><p>

<itemize>
<!-- <item><ref id="asctime" name="asctime"> -->
<item><ref id="clock" name="clock">
<item><ref id="clock_getres" name="clock_getres">
<item><ref id="clock_gettime" name="clock_gettime">
<item><ref id="clock_settime" name="clock_settime">
<!-- <item><ref id="ctime" name="ctime"> -->
<!-- <item><ref id="gmtime" name="gmtime"> -->
<!-- <item><ref id="localtime" name="localtime"> -->
<!-- <item><ref id="mktime" name="mktime"> -->
<!-- <item><ref id="strftime" name="strftime"> -->
<item><ref id="time" name="time">
</itemize>

(incomplete)


<sect1><tt/unistd.h/<label id="unistd.h"><p>

<itemize>
<!-- <item><ref id="chdir" name="chdir"> -->
<item><ref id="exec" name="exec">
<item><ref id="getcwd" name="getcwd">
<item><ref id="getopt" name="getopt">
<!-- <item><ref id="lseek" name="lseek"> -->
<!-- <item><ref id="mkdir" name="mkdir"> -->
<!-- <item><ref id="read" name="read"> -->
<!-- <item><ref id="rmdir" name="rmdir"> -->
<item><ref id="sleep" name="sleep">
<item><ref id="unlink" name="unlink">
<!-- <item><ref id="write" name="write"> -->
</itemize>

(incomplete)


<sect1><tt/vic20.h/<label id="vic20.h"><p>

(incomplete)


<sect1><tt/zlib.h/<label id="zlib.h"><p>

<!-- <itemize> -->
<!-- <item><ref id="adler32" name="adler32"> -->
<!-- <item><ref id="crc32" name="crc32"> -->
<!-- <item><ref id="inflatemem" name="inflatemem"> -->
<!-- <item><ref id="uncompress" name="uncompress"> -->
<!-- </itemize> -->

(incomplete)


<sect>Alphabetical function reference<p>

<sect1>_DE_ISDIR<label id="_DE_ISDIR"><p>

<quote>
<descrip>
<tag/Function/Determine if a directory entry specifies a directory.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/int _DE_ISDIR(unsigned char type);/
<tag/Description/The function is called with the type of a directory entry
taken from a <tt/struct dirent/ and returns true if the entry designates
a directory.
<tag/Notes/<itemize>
<item>The function is actually a macro.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="_DE_ISLBL" name="_DE_ISLBL">,
<ref id="_DE_ISLNK" name="_DE_ISLNK">,
<ref id="_DE_ISREG" name="_DE_ISREG">
<tag/Example/None.
</descrip>
</quote>


<sect1>_DE_ISLBL<label id="_DE_ISLBL"><p>

<quote>
<descrip>
<tag/Function/Determine if a directory entry specifies a disk label.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/int _DE_ISLBL(unsigned char type);/
<tag/Description/The function is called with the type of a directory entry
taken from a <tt/struct dirent/ and returns true if the entry designates
a disk label.
<tag/Notes/<itemize>
<item>The function is actually a macro.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="_DE_ISDIR" name="_DE_ISDIR">,
<ref id="_DE_ISLNK" name="_DE_ISLNK">,
<ref id="_DE_ISREG" name="_DE_ISREG">
<tag/Example/None.
</descrip>
</quote>


<sect1>_DE_ISLNK<label id="_DE_ISLNK"><p>

<quote>
<descrip>
<tag/Function/Determine if a directory entry specifies a link.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/int _DE_ISLNK(unsigned char type);/
<tag/Description/The function is called with the type of a directory entry
taken from a <tt/struct dirent/ and returns true if the entry designates
a link.
<tag/Notes/<itemize>
<item>The function is actually a macro.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="_DE_ISDIR" name="_DE_ISDIR">,
<ref id="_DE_ISLBL" name="_DE_ISLBL">,
<ref id="_DE_ISREG" name="_DE_ISREG">
<tag/Example/None.
</descrip>
</quote>


<sect1>_DE_ISREG<label id="_DE_ISREG"><p>

<quote>
<descrip>
<tag/Function/Determine if a directory entry specifies a regular file.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/int _DE_ISREG(unsigned char type);/
<tag/Description/The function is called with the type of a directory entry
taken from a <tt/struct dirent/ and returns true if the entry designates
a regular file.
<tag/Notes/<itemize>
<item>The function is actually a macro.
<item>A "regular file" means anything with data in it. This might still mean
that special processing is needed, when accessing the file. Relative files of
the CBM systems are classified as being "regular" files, for example.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="_DE_ISDIR" name="_DE_ISDIR">,
<ref id="_DE_ISLBL" name="_DE_ISLBL">,
<ref id="_DE_ISLNK" name="_DE_ISLNK">
<tag/Example/None.
</descrip>
</quote>


<sect1>_heapadd<label id="_heapadd"><p>

<quote>
<descrip>
<tag/Function/Add a block to the heap.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
<tag/Description/The function adds a block of raw memory to the heap.
<tag/Notes/<itemize>
<item>The minimum blocksize that can be added is 6 bytes; the function will
ignore smaller blocks.
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="_heapblocksize" name="_heapblocksize">,
<ref id="_heapmaxavail" name="_heapmaxavail">,
<ref id="_heapmemavail" name="_heapmemavail">,
<ref id="calloc" name="calloc">,
<ref id="free" name="free">,
<ref id="malloc" name="malloc">,
<ref id="realloc" name="realloc">
<tag/Example/None.
</descrip>
</quote>


<sect1>_heapblocksize<label id="_heapblocksize"><p>

<quote>
<descrip>
<tag/Function/Return the size of an allocated block.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/size_t __fastcall__ _heapblocksize (const void* block);/
<tag/Description/The function returns the size of a block that must have
previously been allocated by <tt/<ref id="malloc" name="malloc">/, <tt/<ref
id="calloc" name="calloc">/ or <tt/<ref id="realloc" name="realloc">/.
<tag/Notes/<itemize>
<item>Passing a pointer to a block that was is not the result of one of the
allocation functions, or that has been free'd will give unpredicable results.
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="_heapadd" name="_heapadd">,
<ref id="_heapmaxavail" name="_heapmaxavail">,
<ref id="_heapmemavail" name="_heapmemavail">,
<ref id="calloc" name="calloc">,
<ref id="free" name="free">,
<ref id="malloc" name="malloc">,
<ref id="realloc" name="realloc">
<tag/Example/None.
</descrip>
</quote>


<sect1>_heapmaxavail<label id="_heapmaxavail"><p>

<quote>
<descrip>
<tag/Function/Return the largest block that is available on the heap.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/size_t _heapmaxavail (void);/
<tag/Description/The function returns the size of the largest block that may
be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
<tag/Availability/cc65
<tag/See also/
<ref id="_heapadd" name="_heapadd">,
<ref id="_heapblocksize" name="_heapblocksize">,
<ref id="_heapmemavail" name="_heapmemavail">,
<ref id="calloc" name="calloc">,
<ref id="free" name="free">,
<ref id="malloc" name="malloc">,
<ref id="realloc" name="realloc">
<tag/Example/None.
</descrip>
</quote>


<sect1>_heapmemavail<label id="_heapmemavail"><p>

<quote>
<descrip>
<tag/Function/Return the total available space on the heap.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/size_t _heapmemavail (void);/
<tag/Description/The function returns the total number of bytes available on
the heap.
<tag/Notes/<itemize>
<item>This function is of less use than usually assumed, since the returned
heap space may be available but not in one block. So even if this function
says that several times more heap space is available than needed, <ref
id="malloc" name="malloc"> may still return <tt/NULL/.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="_heapadd" name="_heapadd">,
<ref id="_heapblocksize" name="_heapblocksize">,
<ref id="_heapmaxavail" name="_heapmaxavail">,
<ref id="calloc" name="calloc">,
<ref id="free" name="free">,
<ref id="malloc" name="malloc">,
<ref id="realloc" name="realloc">
<tag/Example/None.
</descrip>
</quote>


<sect1>_is_cmdline_dos<label id="_is_cmdline_dos"><p>

<quote>
<descrip>
<tag/Function/Determines whether the underlying DOS supports command line arguments.
<tag/Header/<tt/<ref id="atari.h" name="atari.h">/
<tag/Declaration/<tt/unsigned char _is_cmdline_dos (void);/
<tag/Description/The function returns 0 if the DOS doesn't support command line arguments.
It returns 1 if it does.
<tag/Availability/cc65 (<tt/atari/ and <tt/atarixl/ platforms)
</descrip>
</quote>

<sect1>_poserror<label id="_poserror"><p>

<quote>
<descrip>
<tag/Function/Print an error message for the error in <tt/_oserror/.
<tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
<tag/Declaration/<tt/void __fastcall__ _poserror (const char* msg);/
<tag/Description/<tt/_poserror/ prints an error message to <tt/stderr/. If
<tt/msg/ is not <tt/NULL/ and not an empty string, it is printed followed by
a colon and a blank. Then the error message for the current contents of
<tt/_oserror/ are printed followed by a newline. The message output is the
same as returned by <tt/<ref id="_stroserror" name="_stroserror">/ with an
argument of <tt/_oserror/.
<tag/Notes/<itemize>
<item>Since operating system specific error code are - you guessed it -
operating system specific, the value in <tt/_oserror/ and the message that is
printed depends on the cc65 target.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="_stroserror" name="_stroserror">,
<ref id="perror" name="perror">
<tag/Example/None.
</descrip>
</quote>


<sect1>_randomize<label id="_randomize"><p>

<quote>
<descrip>
<tag/Function/Initialize the pseudo random number generator.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void _randomize (void);/
<tag/Description/The function initializes the random number generator with
a seed derived from fast changing hardware events, so the seed itself can be
considered random to a certain degree.
<tag/Notes/<itemize>
<item>The randomness of the seed depends on the machine hardware.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="rand" name="rand">,
<ref id="srand" name="srand">
<tag/Example/None.
</descrip>
</quote>

<sect1>_sound<label id="_sound"><p>
<quote>
<descrip>
<tag/Function/Use the speaker to produce sound in a specified voice. (Atari only)
<tag/Header/<tt/<ref id="atari.h" name="atari.h">/
<tag/Declaration/<tt/void __fastcall__ _sound (unsigned char voice, unsigned char pitch, unsigned char distortion, unsigned char volume);/
<tag/Description/The function produces a sound with the specified parameters using any of the 4 available oscillators (voices) controlled by the POKEY chip. Sound is non cpu-blocking and it keeps oscillating until program sends 0 in all the other parameters.

<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
<item>The function is specific to the Atari 8 bit.
<item> Voice can be any of 0-3 different sound channels.
<item> Pitch goes from 0-255 (about 125 Hz to 32 Khz).
<item> Distortion (0-14) uses poly dividers to reshape wave in order to create a noise effect. Use 10 for a "pure" square-wave sound.
<item>Volume (0-15) is the intensity for the wave.
<item>Extra bits in those parameters will be ignored.
<item>Parameters are the same as for the AtariBASIC SOUND statement.
</itemize>
<tag/Availability/cc65 (<tt/atari/ and <tt/atarixl/ platforms)
<tag/Example/
<verb>

#include <stdio.h>
int main(void)
{
    int i=0;
    unsigned char j;
    printf("playing sound \n");
    for (j=0; j<144; j++) {
      _sound(1,144-j,10,8);     //change the pitch for voice 1
      for (i=0; i<50; i++);     //pause for sound duration
    }
    _sound(1,0,0,0);  //use zero in other parameters to stop the sound
    return 0;
}

</verb>
</descrip>
</quote>

<sect1>_stroserror<label id="_stroserror"><p>

<quote>
<descrip>
<tag/Function/Return a string describing an OS specific error code.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/const char* __fastcall__ _stroserror (unsigned char errcode);/
<tag/Description/<tt/_stroserror/ will return a string describing the given
operating system specific error code.
<tag/Notes/<itemize>
<item>Since operating system specific error code are - you guessed it -
operating system specific, the parameter and the string returned depend on the
cc65 target.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="strerror" name="strerror">
<tag/Example/None.
</descrip>
</quote>


<sect1>_swap<label id="_swap"><p>

<quote>
<descrip>
<tag/Function/Swap the contents of memory areas.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void __fastcall__ _swap (void* p, void* q, size_t size);/
<tag/Description/<tt/_swap/ will swap (exchange) the contents of the two memory
areas pointed to by <tt/p/ and <tt/q/. Both memory areas are assumed to be
<tt/size/ bytes in size.
<tag/Notes/<itemize>
<item>The memory areas may not overlap, otherwise the results are undefined.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="memcpy" name="memcpy">,
<ref id="memmove" name="memmove">
<tag/Example/None.
</descrip>
</quote>


<sect1>_sys<label id="_sys"><p>

<quote>
<descrip>
<tag/Function/Call a subroutine passing register values.
<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
<tag/Declaration/<tt/void __fastcall__ _sys (struct regs* r);/
<tag/Description/The function will call the subroutine at the address
specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
registers and the CPU flags are set to the values given in the <tt/regs/
structure. On return from the subroutine, the new values of the registers and
flags are stored back overwriting the old values.
<tag/Notes/<itemize>
<item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
when calling the subroutine (they are unchanged from their current values).
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/Example/None.
</descrip>
</quote>


<sect1>BRK<label id="BRK"><p>

<quote>
<descrip>
<tag/Function/Insert a 6502 BRK instrunction into the code.
<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
<tag/Declaration/<tt/void BRK (void);/
<tag/Description/The function will insert a 6502 BRK instruction into the code
which may be used to trigger a debugger.
<tag/Notes/<itemize>
<item>The function is actually a macro.
<item>The inserted instruction may lead to unexpected results if no debugger
is present.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="CLI" name="CLI">,
<ref id="SEI" name="SEI">
<tag/Example/None.
</descrip>
</quote>


<sect1>CLI<label id="CLI"><p>

<quote>
<descrip>
<tag/Function/Insert a 6502 CLI instrunction into the code.
<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
<tag/Declaration/<tt/void CLI (void);/
<tag/Description/The function will insert a 6502 CLI instruction into the code,
so interrupts are enabled. Enabling interrupts has no effects if they are
already enabled (the default).
<tag/Notes/<itemize>
<item>The function is actually a macro.
<item>Disabling interrupts may lead to unexpected results.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="BRK" name="BRK">,
<ref id="SEI" name="SEI">
<tag/Example/None.
</descrip>
</quote>


<sect1>PEEK<label id="PEEK"><p>

<quote>
<descrip>
<tag/Function/Read a byte from memory.
<tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
<tag/Declaration/<tt/unsigned char PEEK (unsigned addr);/
<tag/Description/The function will read the absolute memory given by <tt/addr/
and return the value read.
<tag/Notes/<itemize>
<item>The function is actually a macro.
<item>This function depends highly on the platform and environment.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="PEEKW" name="PEEKW">,
<ref id="POKE" name="POKE">
<tag/Example/None.
</descrip>
</quote>


<sect1>PEEKW<label id="PEEKW"><p>

<quote>
<descrip>
<tag/Function/Read a word (two bytes) from memory.
<tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
<tag/Declaration/<tt/unsigned PEEKW (unsigned addr);/
<tag/Description/The function will read the absolute memory given by <tt/addr/
and return the value read. The byte read from the higher address is the high
byte of the return value.
<tag/Notes/<itemize>
<item>The function is actually a macro.
<item>This function depends highly on the platform and environment.
<item>The order in which the two bytes are read is unspecified and may
depend of the address expression used.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="PEEK" name="PEEK">,
<ref id="POKE" name="POKE">
<tag/Example/None.
</descrip>
</quote>


<sect1>POKE<label id="POKE"><p>

<quote>
<descrip>
<tag/Function/Write a byte to memory.
<tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
<tag/Declaration/<tt/void POKE (unsigned addr, unsigned char val);/
<tag/Description/The function writes the value <tt/val/ to the absolute
memory address given by <tt/addr/.
<tag/Notes/<itemize>
<item>The function is actually a macro.
<item>This function depends highly on the platform and environment.
<item>Careless use will cause the program to act strange or may crash the
machine.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="PEEK" name="PEEK">,
<ref id="POKEW" name="POKEW">
<tag/Example/None.
</descrip>
</quote>


<sect1>POKEW<label id="POKEW"><p>

<quote>
<descrip>
<tag/Function/Write a word (two bytes) to memory.
<tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
<tag/Declaration/<tt/void POKEW (unsigned addr, unsigned val);/
<tag/Description/The function writes the value <tt/val/ to the absolute
memory address given by <tt/addr/. The low byte of <tt/val/ is written to
the <tt/addr/, the high byte is written to <tt/addr+1/.
<tag/Notes/<itemize>
<item>The function is actually a macro.
<item>This function depends highly on the platform and environment.
<item>Careless use will cause the program to act strange or may crash the
machine.
<item>The order in which the two bytes are written is unspecified and may
depend of the address expression used.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="PEEK" name="PEEK">,
<ref id="POKE" name="POKE">
<tag/Example/None.
</descrip>
</quote>


<sect1>SEI<label id="SEI"><p>

<quote>
<descrip>
<tag/Function/Insert a 6502 SEI instrunction into the code.
<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
<tag/Declaration/<tt/void SEI (void);/
<tag/Description/The function will insert a 6502 SEI instruction into the code,
so interrupts are disabled. Note that non maskable interrupts cannot be
disabled.
<tag/Notes/<itemize>
<item>The function is actually a macro.
<item>Disabling interrupts may lead to unexpected results.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="BRK" name="BRK">,
<ref id="CLI" name="CLI">
<tag/Example/None.
</descrip>
</quote>


<sect1>abort<label id="abort"><p>

<quote>
<descrip>
<tag/Function/Terminate a program abnormally.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void abort (void);/
<tag/Description/<tt/abort()/ raises <tt/SIGABRT/, writes a termination message
on <tt/stderr/, then terminates the program with an exit code of 3.
<tag/Availability/ISO 9899
<tag/See also/
<ref id="assert" name="assert">,
<ref id="exit" name="exit">,
<ref id="signal" name="signal">
<tag/Example/None.
</descrip>
</quote>


<sect1>abs<label id="abs"><p>

<quote>
<descrip>
<tag/Function/Returns the absolute value of an integer.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/int __fastcall__ abs (int v);/
<tag/Description/<tt/abs/ returns the absolute value of the argument passed to
the function.
<tag/Notes/<itemize>
<item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="labs" name="labs">
<tag/Example/None.
</descrip>
</quote>


<sect1>assert<label id="assert"><p>

<quote>
<descrip>
<tag/Function/Test a condition, and possibly abort.
<tag/Header/<tt/<ref id="assert.h" name="assert.h">/
<tag/Declaration/<tt/void assert (int cond);/
<tag/Description/<tt/assert()/ is a macro that expands to an <tt/if/ statement.
If the condition evaluates to zero (false), <tt/assert()/ raises <tt/SIGABRT/,
prints a message on <tt/stderr/, then exits the program with an exit code of 2.
<tag/Notes/<itemize>
<item>The function is actually a macro.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="abort" name="abort">,
<ref id="exit" name="exit">,
<ref id="signal" name="signal">
<tag/Example/None.
</descrip>
</quote>


<sect1>atexit<label id="atexit"><p>

<quote>
<descrip>
<tag/Function/Register an exit function.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
<tag/Description/<tt/atexit/ registers the function pointed to by
<tt/exitfunc/ as an exit function. Exit functions are called when the program
terminates, they are called in LIFO order (the last function registered is
called first). <tt/atexit/ returns zero on success and a nonzero value on
failure.
<tag/Notes/<itemize>
<item>A maximum of 5 exit functions can be registered.
<item>There is no way to unregister an exit function.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="abort" name="abort">,
<ref id="exit" name="exit">
<tag/Example/None.
</descrip>
</quote>


<sect1>atmos_explode<label id="atmos_explode"><p>

<quote>
<descrip>
<tag/Function/Bomb sound effect.
<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
<tag/Declaration/<tt/void __fastcall__ atmos_explode(void);/
<tag/Description/<tt/atmos_explode/ plays the BASIC sound.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atmos_ping" name="atmos_ping">,
<ref id="atmos_shoot" name="atmos_shoot">,
<ref id="atmos_tick" name="atmos_tick">,
<ref id="atmos_tock" name="atmos_tock">,
<ref id="atmos_zap" name="atmos_zap">
<tag/Example/None.
</descrip>
</quote>


<sect1>atmos_load<label id="atmos_load"><p>

<quote>
<descrip>
<tag/Function/Load Atmos tape.
<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
<tag/Declaration/<tt/void __fastcall__ atmos_load(const char* name);/
<tag/Description/<tt/atmos_load/ reads a memory block from tape.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atmos_save" name="atmos_save">
<tag/Example/None.
</descrip>
</quote>


<sect1>atmos_ping<label id="atmos_ping"><p>

<quote>
<descrip>
<tag/Function/Bell or ricochet sound effect.
<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
<tag/Declaration/<tt/void __fastcall__ atmos_ping(void);/
<tag/Description/<tt/atmos_ping/ plays the BASIC sound.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atmos_explode" name="atmos_explode">,
<ref id="atmos_shoot" name="atmos_shoot">,
<ref id="atmos_tick" name="atmos_tick">,
<ref id="atmos_tock" name="atmos_tock">,
<ref id="atmos_zap" name="atmos_zap">
<tag/Example/None.
</descrip>
</quote>


<sect1>atmos_save<label id="atmos_save"><p>

<quote>
<descrip>
<tag/Function/Save Atmos tape.
<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
<tag/Declaration/<tt/void __fastcall__ atmos_save(const char* name, const void* start, const void* end);/
<tag/Description/<tt/atmos_save/ writes a memory block to tape.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atmos_load" name="atmos_load">
<tag/Example/<verb>
atmos_save("hires", 0xa000, 0xc000);
</verb>
</descrip>
</quote>


<sect1>atmos_shoot<label id="atmos_shoot"><p>

<quote>
<descrip>
<tag/Function/Pistol sound effect.
<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
<tag/Declaration/<tt/void __fastcall__ atmos_shoot(void);/
<tag/Description/<tt/atmos_shoot/ plays the BASIC sound.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atmos_explode" name="atmos_explode">,
<ref id="atmos_ping" name="atmos_ping">,
<ref id="atmos_tick" name="atmos_tick">,
<ref id="atmos_tock" name="atmos_tock">,
<ref id="atmos_zap" name="atmos_zap">
<tag/Example/None.
</descrip>
</quote>


<sect1>atmos_tick<label id="atmos_tick"><p>

<quote>
<descrip>
<tag/Function/High-pitch click.
<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
<tag/Declaration/<tt/void __fastcall__ atmos_tick(void);/
<tag/Description/<tt/atmos_tick/ plays the system sound.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atmos_explode" name="atmos_explode">,
<ref id="atmos_ping" name="atmos_ping">,
<ref id="atmos_shoot" name="atmos_shoot">,
<ref id="atmos_tock" name="atmos_tock">,
<ref id="atmos_zap" name="atmos_zap">
<tag/Example/None.
</descrip>
</quote>


<sect1>atmos_tock<label id="atmos_tock"><p>

<quote>
<descrip>
<tag/Function/Low-pitch click.
<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
<tag/Declaration/<tt/void __fastcall__ atmos_tock(void);/
<tag/Description/<tt/atmos_tock/ plays the system sound.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atmos_explode" name="atmos_explode">,
<ref id="atmos_ping" name="atmos_ping">,
<ref id="atmos_shoot" name="atmos_shoot">,
<ref id="atmos_tick" name="atmos_tick">,
<ref id="atmos_zap" name="atmos_zap">
<tag/Example/None.
</descrip>
</quote>


<sect1>atmos_zap<label id="atmos_zap"><p>

<quote>
<descrip>
<tag/Function/Raygun sound effect.
<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
<tag/Declaration/<tt/void __fastcall__ atmos_zap(void);/
<tag/Description/<tt/atmos_zap/ plays the BASIC sound.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atmos_explode" name="atmos_explode">,
<ref id="atmos_ping" name="atmos_ping">,
<ref id="atmos_shoot" name="atmos_shoot">,
<ref id="atmos_tick" name="atmos_tick">,
<ref id="atmos_tock" name="atmos_tock">
<tag/Example/None.
</descrip>
</quote>


<sect1>atoi<label id="atoi"><p>

<quote>
<descrip>
<tag/Function/Convert a string to an integer.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/int __fastcall__ atoi (const char* s);/
<tag/Description/<tt/atoi/ converts the given string into an integer.
Conversion stops as soon as any invalid character is encountered.
<tag/Notes/<itemize>
<item>There is no way to detect any conversion errors.
<item>The function does not check for an numerical overflow when converting.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="atol" name="atol">,
<ref id="itoa" name="itoa">,
<ref id="ltoa" name="ltoa">,
<ref id="ultoa" name="ultoa">,
<ref id="utoa" name="utoa">
<tag/Example/None.
</descrip>
</quote>


<sect1>atol<label id="atol"><p>

<quote>
<descrip>
<tag/Function/Convert a string to a long integer.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/long __fastcall__ atol (const char* s);/
<tag/Description/<tt/atol/ converts the given string into a long integer.
Conversion stops as soon as any invalid character is encountered.
<tag/Notes/<itemize>
<item>There is no way to detect any conversion errors.
<item>The function does not check for an numerical overflow when converting.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="atoi" name="atoi">,
<ref id="itoa" name="itoa">,
<ref id="ltoa" name="ltoa">,
<ref id="ultoa" name="ultoa">,
<ref id="utoa" name="utoa">
<tag/Example/None.
</descrip>
</quote>


<sect1>beep<label id="beep"><p>

<quote>
<descrip>
<tag/Function/Beep sound.
<tag/Header/<tt/<ref id="sym1.h" name="sym1.h">/
<tag/Declaration/<tt/void beep(void);/
<tag/Description/<tt/beep/ makes a brief tone.
<tag/Notes/<itemize>
<item>The function is specific to the Sym-1.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="fdisp" name="fdisp">,
<ref id="loadt" name="loadt">,
<ref id="dumpt" name="dumpt">,
<tag/Example/None.
</descrip>
</quote>


<sect1>bgcolor<label id="bgcolor"><p>

<quote>
<descrip>
<tag/Function/Set the background text color.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
<tag/Description/The function will set a new background color and return the
old (current) one. The background color is valid for the whole text output
area of the screen, not just for new text.
<tag/Notes/<itemize>
<item>Background colors are system dependent. The function may have no effect
on systems where the background color cannot be changed.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="bordercolor" name="bordercolor">,
<ref id="textcolor" name="textcolor">
<tag/Example/None.
</descrip>
</quote>


<sect1>bios_playsound<label id="bios_playsound"><p>

<quote>
<descrip>
<tag/Function/Play a sequence of musical notes.
<tag/Header/<tt/<ref id="creativision.h" name="creativision.h">/
<tag/Declaration/<tt/void __fastcall__ bios_playsound (const void *a, unsigned char b);/
<tag/Description/The function plays chords based on a BASIC statement. Notes and
durations are defined in the BASIC manual, chapter 13 on pages 102 resp. 103.
<tag/Notes/<itemize>
<item>BASIC has a fixed tempo of 18.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="psg_delay" name="psg_delay">,
<ref id="psg_outb" name="psg_outb">
<tag/Example/<verb>
#include <creativision.h>
void main (void)
{
  static const unsigned char notes[] = {
    0x77, 0x4F, 0x37,
    0x4B, 0x05, 0xBB,
    0x4F, 0x27, 0x83,
    0x93, 0x9B, 0x93,
    0x17, 0x4F, 0x96,  // played backwards
    0xAB, 0x17, 0x4F,  // three-note chords
    0x0E               // tempo
  };
  bios_playsound (notes, sizeof notes);
}
</verb>
</descrip>
</quote>


<sect1>bordercolor<label id="bordercolor"><p>

<quote>
<descrip>
<tag/Function/Set the border (frame) color.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
<tag/Description/The function will set a new border color. It returns the old
(current) border color.
<tag/Notes/<itemize>
<item>Border colors are system dependent. The function may have no effect
on systems where the border color cannot be changed.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="bgcolor" name="bgcolor">,
<ref id="textcolor" name="textcolor">
<tag/Example/None.
</descrip>
</quote>


<sect1>bsearch<label id="bsearch"><p>

<quote>
<descrip>
<tag/Function/Do a binary search in a sorted array.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void* __fastcall__ bsearch (const void* key,
const void* base, size_t n, size_t size,
int __fastcall__ (* cmp) (const void*, const void*));/
<tag/Description/<tt/bsearch/ searches a sorted array for a member that
matches the one pointed to by <tt/key/. <tt/base/ is the address of the array,
<tt/n/ is the number of elements, <tt/size/ the size of an element and <tt/cmp/
the function used to compare the members against the key. The function returns
a pointer to the member found, or <tt/NULL/ if there was no match.
<tag/Notes/<itemize>
<item>The contents of the array must be sorted in ascending order according to
the compare function given.
<item>If there are multiple members that match the key, the function will
return one of the members.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The function to which <tt/cmp/ points must have the <tt/fastcall/ calling
convention.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="qsort" name="qsort">
<tag/Example/None.
</descrip>
</quote>


<sect1>bzero<label id="bzero"><p>

<quote>
<descrip>
<tag/Function/Fill a memory area with zeroes.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
<tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
zero.
<tag/Notes/<itemize>
<item>The function is non standard and therefore only available in non ANSI
mode. You should use <tt/<ref id="memset" name="memset">/ instead.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="_swap" name="_swap">,
<ref id="memcpy" name="memcpy">,
<ref id="memmove" name="memmove">,
<ref id="memset" name="memset">,
<tag/Example/None.
</descrip>
</quote>


<sect1>c64mode<label id="c64mode"><p>

<quote>
<descrip>
<tag/Function/Switch the C128 into C64 compatible mode.
<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
<tag/Declaration/<tt/void c64mode (void);/
<tag/Description/The function will cause the machine to reboot into C64 mode.
<tag/Notes/<itemize>
<item>The function is specific to the C128.
<item>The function will not return to the caller.
</itemize>
<tag/Availability/cc65
<tag/Example/None.
</descrip>
</quote>


<sect1>calloc<label id="calloc"><p>

<quote>
<descrip>
<tag/Function/Allocate and clear memory.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
<tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
of size <tt/size/, clears the whole block with binary zeroes and returns a
pointer to it. On error (not enough memory available), <tt/calloc/ returns
<tt/NULL/.
<tag/Notes/<itemize>
<item>Clearing the memory may not have the expected effect on all platforms:
pointers in the block may not be <tt/NULL/ and floating point variables may
not be zero (0.0). In other words: The "clearing" effect of this function
should be used with care for portable programs.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_heapadd" name="_heapadd">,
<ref id="_heapblocksize" name="_heapblocksize">,
<ref id="_heapmaxavail" name="_heapmaxavail">,
<ref id="_heapmemavail" name="_heapmemavail">,
<ref id="free" name="free">,
<ref id="malloc" name="malloc">,
<ref id="realloc" name="realloc">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_acptr<label id="cbm_k_acptr"><p>

<quote>
<descrip>
<tag/Function/Input byte from serial bus
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char cbm_k_acptr (void);/
<tag/Description/The function returns a byte of data, which it
gets from the current TALKer on the serial bus.
In order to receive the data, the device must have previously been
sent a command to TALK and a secondary address if it needs one.
<tag/Notes/<itemize>
<item>
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_talk" name="cbm_k_talk">,
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_basin<label id="cbm_k_basin"><p>

<quote>
<descrip>
<tag/Function/Input a Character from the Current Device
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char cbm_k_basin (void);/
<tag/Description/The function returns a character from the current input device.
Device must first have been OPENed and then designated as the input channel by the CHKIN routine.
When this function is called, the next byte of data available from the device is returned.
Exception is the routine for the keyboard device (which is the default input device).
<tag/Notes/<itemize>
<item>
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_open" name="cbm_k_open">,
<ref id="cbm_k_chkin" name="cbm_k_chkin">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_bsout<label id="cbm_k_bsout"><p>

<quote>
<descrip>
<tag/Function/Output a byte
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_bsout (unsigned char C);/
<tag/Description/Function sends the character to the current output device.
Unless a device has been OPENed and designated as the
current output channel using the CHKOUT routine, the character is
printed to the screen, which is the default output device.  If the
cassette is the current device, outputting a byte will only add it to
the buffer. No actual transmission of data will occur until the
192-byte buffer is full.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_open" name="cbm_k_open">,
<ref id="cbm_k_chkin" name="cbm_k_chkout">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_chkin<label id="cbm_k_chkin"><p>

<quote>
<descrip>
<tag/Function/Designate a Logical File As the Current Input Channel
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ cbm_k_chkin (unsigned char FN);/
<tag/Description/If you wish to
get data from any device other than the keyboard, this function must be
called after OPENing the device, before you can get a data byte with
the cbm_k_basin or cbm_k_getin routine.  When called, the routine will designate
the logical file whose file number was supplied as the
current file, its device as the current device, and its secondary
address as the current secondary address.  If the device on the
channel is a serial device, which requires a TALK command and
sometimes a secondary address, function will send them over the
serial bus.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_open" name="cbm_k_open">,
<ref id="cbm_k_basin" name="cbm_k_basin">,
<ref id="cbm_k_getin" name="cbm_k_getin">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_ciout<label id="cbm_k_ciout"><p>

<quote>
<descrip>
<tag/Function/Transmit a byte over the serial bus
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_ciout (unsigned char C);/
<tag/Description/Purpose of this function is to send a byte of data over
the serial bus.  In order for the data to be received, the serial
device must have first been commanded to LISTEN and been given a
secondary address if necessary.  This routine always buffers the
current character, and defers sending it until the next byte is
buffered.  When the UNLISTEN command is sent, the last byte will be
sent with an End or Identify (EOI).
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_listen" name="cbm_k_listen">,
<ref id="cbm_k_unlsn" name="cbm_k_unlsn">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_ckout<label id="cbm_k_ckout"><p>

<quote>
<descrip>
<tag/Function/Designate a Logical File As the Current Output Channel
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ cbm_k_ckout (unsigned char FN);/
<tag/Description/If you wish to
output data to any device other than the screen, this routine must be
called after OPENing the device, and before you output a data byte
with the cbm_k_bsout() function.  When called, the function will designate the
logical file whose file number was supplied as the current
file, its device as the current device, and its secondary address as
the current secondary address.  If the device on the channel uses the
serial bus, and therefore requires a LISTEN command and possibly a
secondary address, this information will be sent on the bus.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_bsout" name="cbm_k_bsout">,
<ref id="cbm_k_listen" name="cbm_k_listen">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_clall<label id="cbm_k_clall"><p>

<quote>
<descrip>
<tag/Function/Close All Logical I/O Files
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void cbm_k_clall (void);/
<tag/Description/It closes all
open files, by resetting the index into open files to
zero and restores the default I/O devices.
<tag/Notes/<itemize>
<item>
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_open" name="cbm_k_open">,
<ref id="cbm_k_close" name="cbm_k_close">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_close<label id="cbm_k_close"><p>

<quote>
<descrip>
<tag/Function/Close a Logical I/O File
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_close (unsigned char FN);/
<tag/Description/It is used to
close a logical file after all I/O operations involving that file have
been completed.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_open" name="cbm_k_open">,
<ref id="cbm_k_clall" name="cbm_k_clall">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_clrch<label id="cbm_k_clrch"><p>

<quote>
<descrip>
<tag/Function/Restore Current Input and Output Devices to the Default Devices
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void cbm_k_clrch (void);/
<tag/Description/It sets the
current input device to the keyboard, and the current output device to
the screen.  Also, if the current input device was formerly a serial
device, the routine sends it an UNTALK command on the serial bus, and
if a serial device was formerly the current output device, the routine
sends it an UNLISTEN command.
<tag/Notes/<itemize>
<item>
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_chkin" name="cbm_k_chkin">,
<ref id="cbm_k_ckout" name="cbm_k_ckout">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_getin<label id="cbm_k_getin"><p>

<quote>
<descrip>
<tag/Function/Get One Byte from the Input Device
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char cbm_k_getin (void);/
<tag/Description/Function gets a character from the current input device.
<tag/Notes/<itemize>
<item>
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_basin" name="cbm_k_basin">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_iobase<label id="cbm_k_iobase"><p>

<quote>
<descrip>
<tag/Function/Return Base Address of Memory-Mapped I/O Devices
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned cbm_k_iobase (void);/
<tag/Description/This function returns the address of
the memory section where the memory mapped I/O devices are located. This
address can then be used with an offset to access the memory mapped I/O
devices in the Commodore 64. The offset is the number of locations from
the beginning of the page on which the I/O register you want is located.
This function exists to provide compatibility between the Commodore 64,
VIC-20, and future models of the Commodore 64. If the I/O locations for
a program are set by a call to this function, they should
still remain compatible with future versions of the Commodore 64, the
KERNAL and BASIC.
<tag/Notes/<itemize>
<item>
</itemize>
<tag/Availability/cc65
<tag/See also/

<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_listen<label id="cbm_k_listen"><p>

<quote>
<descrip>
<tag/Function/Command a device on the serial bus to LISTEN
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_listen (unsigned char dev);/
<tag/Description/This function will command a device on the serial bus to
receive data. The KERNAL routine will OR the supplied device number bit by bit
to convert it to a listen address, then transmits this data as a command on
the serial bus. The specified device will then go into listen mode, and
be ready to accept information.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_unlsn" name="cbm_k_unlsn">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_load<label id="cbm_k_load"><p>

<quote>
<descrip>
<tag/Function/Load RAM from a Device
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned int __fastcall__ cbm_k_load(unsigned char flag, unsigned addr);/
<tag/Description/This function LOADs data bytes from any input device directly into the memory.
It can also be used for a verify operation, comparing data from a device with the data already in
memory, while leaving the data stored in RAM unchanged.
The flag must be set to 0 for a LOAD operation, or 1 for a
verify, If the input device is OPENed with a secondary address (SA) of 0
the header information from the device is ignored. In this case, the starting address for the load must be supplied.
If the device is addressed with a secondary address of 1, then the data is
loaded into memory starting at the location specified by the header.
Function returns the address of the highest RAM location loaded.
Before this function can be called, the KERNAL SETLFS, and SETNAM
routines must be called.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_save" name="cbm_k_save">,
<ref id="cbm_k_setlfs" name="cbm_k_setlfs">,
<ref id="cbm_k_setnam" name="cbm_k_setnam">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_open<label id="cbm_k_open"><p>

<quote>
<descrip>
<tag/Function/Open a Logical I/O File
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char cbm_k_open (void);/
<tag/Description/This function assigns a logical file to a device, so that it can be used for
Input/Output operations. In order to specify the logical file number,
the device number, and the secondary address if any, the cbm_k_setlfs() function must first be called.
Likewise, in order to designate the filename, the cbm_k_setnam() function must be used first.  After these two
functions are called, cbm_k_open() is then called.
<tag/Notes/<itemize>
<item>
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_close" name="cbm_k_close">,
<ref id="cbm_k_setlfs" name="cbm_k_setlfs">,
<ref id="cbm_k_setnam" name="cbm_k_setnam">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_readst<label id="cbm_k_readst"><p>

<quote>
<descrip>
<tag/Function/Read status word
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char cbm_k_readst (void);/
<tag/Description/This function returns the current status of the I/O devices. It is usually called after new communication to an I/O device and gives information about device status, or errors that have occurred during the I/O operation.
<tag/Notes/<itemize>
<item>
</itemize>
<tag/Availability/cc65
<tag/See also/

<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_save<label id="cbm_k_save"><p>

<quote>
<descrip>
<tag/Function/Save RAM to a Device
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ cbm_k_save(unsigned int start, unsigned int end)/
<tag/Description/This function saves a section of memory. The cbm_k_setlfs() and cbm_k_setnam() functions must be
used before calling this function. However, a file name is not required to
SAVE to device 1 (the Datassette(TM) recorder). Any attempt to save to
other devices without using a file name results in an error. NOTE: Device 0 (the keyboard), device 2 (RS-232), and device 3 (the screen) cannot be SAVEd to. If the attempt is made, an error occurs, and the SAVE is stopped.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_load" name="cbm_k_load">,
<ref id="cbm_k_setlfs" name="cbm_k_setlfs">,
<ref id="cbm_k_setnam" name="cbm_k_setnam">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_scnkey<label id="cbm_k_scnkey"><p>

<quote>
<descrip>
<tag/Function/Scan the keyboard matrix.
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void cbm_k_scnkey (void);/
<tag/Description/This function looks at the switches in the keyboard, to see
if any of them are being pressed.  If they are, then code numbers for them are
stored in RAM.  Other functions use those numbers to input text.  Normally,
the keyboard is scanned by the Kernal's Interrupt Service Routine.  But, if
you divert the "Jiffy interrupt" to a C-code ISR, then that ISR must call this
function, in order to provide input from the keyboard.
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_getin" name="cbm_k_getin">,
<ref id="cbm_k_udtim" name="cbm_k_udtim">,
<ref id="cgetc" name="cgetc">,
<!-- <ref id="getc" name="getc"> -->
<!-- <ref id="getchar" name="getchar"> -->
<tag/Example/None.
</descrip>
</quote>


<sect1>cmb_k_second<label id="cbm_k_second"><p>

<quote>
<descrip>
<tag/Function/Send secondary address for LISTEN.
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_second (unsigned char addr);/
<tag/Description/This function is used to send a secondary address to an I/O
device after a call to LISTEN is made, and the device is commanded to LISTEN.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
<item>The function can only be called after a call to LISTEN.
<item>The function will not work after a TALK.
<item>When a secondary address is to be sent to a device on the serial bus,
the address must first be ORed with $60.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_listen" name="cbm_k_listen">
<tag/Exampe/None.
</descrip>
</quote>


<sect1>cbm_k_setlfs<label id="cbm_k_setlfs"><p>

<quote>
<descrip>
<tag/Function/Set up a logical file
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_setlfs (unsigned char LFN, unsigned char DEV, unsigned char SA);/
<tag/Description/This functions sets up the logical file by setting its number, device address,
and secondary address.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_load" name="cbm_k_load">,
<ref id="cbm_k_open" name="cbm_k_open">,
<ref id="cbm_k_save" name="cbm_k_save">,
<ref id="cbm_k_setnam" name="cbm_k_setnam">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_setnam<label id="cbm_k_setnam"><p>

<quote>
<descrip>
<tag/Function/Set Filename Parameters
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_setnam (const char* Name);/
<tag/Description/This function is used to set up the file name for the OPEN,
SAVE, or LOAD operations.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_load" name="cbm_k_load">,
<ref id="cbm_k_open" name="cbm_k_open">,
<ref id="cbm_k_save" name="cbm_k_save">,
<ref id="cbm_k_setlfs" name="cbm_k_setlfs">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_settim<label id="cbm_k_settim"><p>

<quote>
<descrip>
<tag/Function/Set the Jiffy clock.
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_settim (unsigned long timer);/
<tag/Description/This function changes the Jiffy clock to a different value.
That clock counts sixtieths of a second.  It is used by the library's
<tt/clock()/ function.  The Jiffy clock is updated by the Kernal's Interrupt
Service Routine.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; therefore, it may
be used only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_udtim" name="cbm_k_udtim">,
<ref id="clock" name="clock">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_talk<label id="cbm_k_talk"><p>

<quote>
<descrip>
<tag/Function/Commands device to TALK
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_talk (unsigned char dev);/
<tag/Description/When called, it ORs the device number with the TALK code (64, $40) and sends it on the serial
bus. This commands the device to TALK.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_acptr" name="cbm_k_acptr">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_tksa<label id="cbm_k_tksa"><p>

<quote>
<descrip>
<tag/Function/Send TALK secondary address to serial bus
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void __fastcall__ cbm_k_tksa (unsigned char addr);/
<tag/Description/This function transmits a secondary address on the serial bus for a TALK device.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
<item>The function can only be called after a call to TALK.
<item>The function will not work after a LISTEN.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_talk" name="cbm_k_talk">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_udtim<label id="cbm_k_udtim"><p>

<quote>
<descrip>
<tag/Function/Update the Jiffy clock.
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void cbm_k_udtim (void);/
<tag/Description/This function adds one count to the Jiffy clock.  That clock
counts sixtieths of a second.  It is used by the library's <tt/clock()/
function.  Normally, the Jiffy clock is updated by the Kernal's Interrupt
Service Routine.  But, if you divert the "Jiffy interrupt" to a C-code ISR,
then that ISR must call this function, in order to keep the clock valid.
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_scnkey" name="cbm_k_scnkey">,
<ref id="cbm_k_settim" name="cbm_k_settim">,
<ref id="clock" name="clock">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_unlsn<label id="cbm_k_unlsn"><p>

<quote>
<descrip>
<tag/Function/Send an UNLISTEN command
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void cbm_k_unlsn (void);/
<tag/Description/This function commands all devices on the serial bus to
stop receiving data from the host computer (i.e., UNLISTEN). Calling this
function results in an UNLISTEN command being transmitted on the serial
bus. Only devices previously commanded to LISTEN are affected. This
function is normally used after the host computer is finished sending data
to external devices. Sending the UNLISTEN commands the listening devices
to get off the serial bus so it can be used for other purposes.
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_listen" name="cbm_k_listen">
<tag/Example/None.
</descrip>
</quote>


<sect1>cbm_k_untlk<label id="cbm_k_untlk"><p>

<quote>
<descrip>
<tag/Function/Send an UNTALK command
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/void cbm_k_untlk (void);/
<tag/Description/This function commands all devices on the serial bus to
stop sending data to the host computer (i.e., UNTALK). Calling this
function results in an UNTALK command being transmitted on the serial
bus. Only devices previously commanded to TALK are affected. This
function is normally used after the host computer is finished listening to data
from an external device. Sending the UNTALK commands the sending devices
to get off the serial bus so it can be used for other purposes.
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_talk" name="cbm_k_talk">
<tag/Example/None.
</descrip>
</quote>


<sect1>cclear<label id="cclear"><p>

<quote>
<descrip>
<tag/Function/Clear part of a line (write a given number of spaces).
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
<tag/Description/The function clears part of a line by writing <tt/length/
spaces in the current text color.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cclearxy" name="cclearxy">,
<ref id="clrscr" name="clrscr">
<tag/Example/None.
</descrip>
</quote>


<sect1>cclearxy<label id="cclearxy"><p>

<quote>
<descrip>
<tag/Function/Clear part of a line (write a given number of spaces) starting
at a specific screen position.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char x, unsigned char y, unsigned char length);/
<tag/Description/The function moves the cursor to a specific position, and
will then clear part of the line by writing <tt/length/ spaces in the current
text color.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cclear" name="cclear">,
<ref id="clrscr" name="clrscr">
<tag/Example/None.
</descrip>
</quote>


<sect1>cgetc<label id="cgetc"><p>

<quote>
<descrip>
<tag/Function/Read a character from the keyboard.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/char cgetc (void);/
<tag/Description/The function reads a character from the keyboard. If there is
no character available, <tt/cgetc()/ waits until the user presses a key. If the
cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
displayed while waiting.
<tag/Notes/<itemize>
<item>If the system supports a keyboard buffer, <tt/cgetc()/ will fetch a key
from that buffer; and, wait only if the buffer is empty.
<item>The keyboard must be scanned periodically, in order for this function to
see anything that you type.  (See the description of <tt/cbm_k_scnkey()/.)
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cbm_k_scnkey" name="cbm_k_scnkey">,
<ref id="cursor" name="cursor">,
<ref id="kbhit" name="kbhit">
<tag/Example/None.
</descrip>
</quote>


<sect1>chline<label id="chline"><p>

<quote>
<descrip>
<tag/Function/Output a horizontal line in text mode.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
<tag/Description/The function outputs a horizontal line with the given length
starting at the current cursor position.
<tag/Notes/<itemize>
<item>The character used to draw the horizontal line is system dependent.
If available, a line drawing character is used. Drawing a line that is partially
off screen leads to undefined behaviour.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="chlinexy" name="chlinexy">,
<ref id="cvline" name="cvline">,
<ref id="cvlinexy" name="cvlinexy">
<tag/Example/None.
</descrip>
</quote>


<sect1>chlinexy<label id="chlinexy"><p>

<quote>
<descrip>
<tag/Function/Output a horizontal line at a given position in text mode.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
<tag/Description/The function outputs a horizontal line with the given length
starting at a given position.
<tag/Notes/<itemize>
<item>The character used to draw the horizontal line is system dependent.
If available, a line drawing character is used. Drawing a line that is partially
off screen leads to undefined behaviour.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="chline" name="chline">,
<ref id="cvline" name="cvline">,
<ref id="cvlinexy" name="cvlinexy">
<tag/Example/None.
</descrip>
</quote>


<sect1>clearerr<label id="clearerr"><p>

<quote>
<descrip>
<tag/Function/Clear error and end-of-file status of a stream.
<tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
<tag/Declaration/<tt/void __fastcall__ clearerr (FILE* f);/
<tag/Description/<tt/clearerr/ clears the error and end-of-file status
indicators for the stream <tt/f/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="feof" name="feof">,
<ref id="ferror" name="ferror">
<tag/Example/None.
</descrip>
</quote>


<sect1>clock<label id="clock"><p>

<quote>
<descrip>
<tag/Function/Determine the processor time used.
<tag/Header/<tt/<ref id="time.h" name="time.h">/
<tag/Declaration/<tt/clock_t clock (void);/
<tag/Description/The <tt/clock/ function returns an approximaton of processor
time used by the program. The time is returned in implementation-defined
units. It can be converted to seconds by dividing by the value of the macro
<tt/CLOCKS_PER_SEC/.
<tag/Notes/<itemize>
<item>Since the machines that cc65-generated programs run on cannot run multiple
processes, the function actually will return the time since some
implementation-defined point in the past.
<item>The Jiffy clock must be "running", in order for this function to return
changing values.  (See the description of <tt/cbm_k_udtim()/.)
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="cbm_k_settim" name="cbm_k_settim">,
<ref id="cbm_k_udtim" name="cbm_k_udtim">,
<ref id="time" name="time">
<tag/Example/None.
</descrip>
</quote>


<sect1>clock_getres<label id="clock_getres"><p>

<quote>
<descrip>
<tag/Function/Determine the realtime clock resolution.
<tag/Header/<tt/<ref id="time.h" name="time.h">/
<tag/Declaration/<tt/int __fastcall__ clock_getres (clockid_t clock_id, struct timespec *res);/
<tag/Description/The <tt/clock_getres/ function finds the resolution (precision)
of the realtime clock. <tt/clock_id/ has to be <tt/CLOCK_REALTIME/. If <tt/res/
is not <tt/NULL/, the resolution of the realtime clock is stored in the location
pointed to by <tt/res/. If <tt/res/ is <tt/NULL/, the clock resolution is not returned.
If the <tt/tp/ argument of <tt/<ref id="clock_settime" name="clock_settime">/ is not
a multiple of <tt/res/, then the value is truncated to a multiple of <tt/res/. On
success, zero is returned. On error, -1 is returned and <tt/errno/ is set to an
error code describing the reason for the failure.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>Depending on the target either the <tt/tv_sec/ or the <tt/tv_nsec/
field of the <tt/struct timespec/ returned is zero.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="clock_gettime" name="clock_gettime">,
<ref id="clock_settime" name="clock_settime">
<tag/Example/None.
</descrip>
</quote>


<sect1>clock_gettime<label id="clock_gettime"><p>

<quote>
<descrip>
<tag/Function/Get the time from the realtime clock.
<tag/Header/<tt/<ref id="time.h" name="time.h">/
<tag/Declaration/<tt/int __fastcall__ clock_gettime (clockid_t clock_id, struct timespec *tp);/
<tag/Description/The <tt/clock_gettime/ function retrieves the time since the 1970-01-01 00:00:00
measured in nanoseconds. <tt/clock_id/ has to be <tt/CLOCK_REALTIME/. On success, zero is
returned. On error, -1 is returned and <tt/errno/ is set to an error code describing the
reason for the failure.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>Many platforms supported by cc65 do not have a realtime clock, so the
retrieved value may not be valid. See also the platform-specific information.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="clock_getres" name="clock_getres">,
<ref id="clock_settime" name="clock_settime">,
<ref id="time" name="time">
<tag/Example/None.
</descrip>
</quote>


<sect1>clock_settime<label id="clock_settime"><p>

<quote>
<descrip>
<tag/Function/Set the time on the realtime clock.
<tag/Header/<tt/<ref id="time.h" name="time.h">/
<tag/Declaration/<tt/int __fastcall__ clock_settime (clockid_t clock_id, const struct timespec *tp);/
<tag/Description/The <tt/clock_settime/ function sets the time since the 1970-01-01 00:00:00
measured in nanoseconds. <tt/clock_id/ has to be <tt/CLOCK_REALTIME/. On success, zero is
returned. On error, -1 is returned and <tt/errno/ is set to an error code describing the
reason for the failure.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>Many platforms supported by cc65 do not have a realtime clock, so
setting the time may not work. See also the platform-specific information.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="clock_getres" name="clock_getres">,
<ref id="clock_gettime" name="clock_gettime">
<tag/Example/None.
</descrip>
</quote>


<sect1>clrscr<label id="clrscr"><p>

<quote>
<descrip>
<tag/Function/Clear the text screen.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void clrscr (void);/
<tag/Description/The function clears the text screen and moves the cursor to
the upper left corner.
<tag/Availability/cc65
<tag/See also/
<ref id="cclear" name="cclear">,
<ref id="cclearxy" name="cclearxy">
<tag/Example/None.
</descrip>
</quote>


<sect1>close<label id="close"><p>

<quote>
<descrip>
<tag/Function/Close a file descriptor.
<tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
<tag/Declaration/<tt/int __fastcall__ close (int fd);/
<tag/Description/The function closes the given file descriptor. It returns zero
on success and -1 on error. If an error occurs, the cause can be determined by
reading the <tt/errno/ variable.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="creat" name="creat">,
<ref id="open" name="open">
<tag/Example/None.
</descrip>
</quote>


<sect1>closedir<label id="closedir"><p>

<quote>
<descrip>
<tag/Function/Close a directory.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/int __fastcall__ closedir (DIR* dir);/
<tag/Description/The function closes the given directory descriptor. It returns
zero on success and -1 on error. If an error occurs, the cause can be determined
by reading the <tt/errno/ variable.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="opendir" name="opendir">,
<ref id="readdir" name="readdir">
<tag/Example/None.
</descrip>
</quote>


<sect1>cpeekc<label id="cpeekc"><p>

<quote>
<descrip>
<tag/Function/Get a character from the display memory.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/char cpeekc (void);/
<tag/Description/The function gets the character that's at the current location
of the cursor in the display screen RAM.  That character is converted, if
needed, into the encoding that can be passed to <tt/cputc()/.
<tag/Notes/<itemize>
<item>Conio peek functions don't have <tt/cpeek...xy()/ versions.  That was
done to make it obvious that peeking doesn't move the cursor in any way.  Your
program must place the cursor where it wants to peek before it calls any of
those functions.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cpeekcolor" name="cpeekcolor">,
<ref id="cpeekrevers" name="cpeekrevers">,
<ref id="cpeeks" name="cpeeks">,
<ref id="cputc" name="cputc">
<tag/Example/None.
</descrip>
</quote>


<sect1>cpeekcolor<label id="cpeekcolor"><p>

<quote>
<descrip>
<tag/Function/Get a color from the display memory.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char cpeekcolor (void);/
<tag/Description/The function gets the color number that's at the current
location of the cursor in the display screen RAM.  That number can be passed to
<tt/textcolor()/.
<tag/Notes/<itemize>
<item>Conio peek functions don't have <tt/cpeek...xy()/ versions.  That was
done to make it obvious that peeking doesn't move the cursor in any way.  Your
program must place the cursor where it wants to peek before it calls any of
those functions.
<item>On the cx16 (Commander X16) target, this function returns two values: the
background color, in the high nybble, and the text color, in the low nybble.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cpeekc" name="cpeekc">,
<ref id="cpeekrevers" name="cpeekrevers">,
<ref id="cpeeks" name="cpeeks">,
<ref id="cputc" name="cputc">,
<ref id="textcolor" name="textcolor">
<tag/Example/None.
</descrip>
</quote>


<sect1>cpeekrevers<label id="cpeekrevers"><p>

<quote>
<descrip>
<tag/Function/Get a reverse-character attribute from the display memory.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char cpeekrevers (void);/
<tag/Description/The function gets the "reverse-mode" attribute of the
character that's at the current location of the cursor in the display screen
RAM.  It returns a boolean value (0/1) that can be passed to <tt/revers()/.
<tag/Notes/<itemize>
<item>Conio peek functions don't have <tt/cpeek...xy()/ versions.  That was
done to make it obvious that peeking doesn't move the cursor in any way.  Your
program must place the cursor where it wants to peek before it calls any of
those functions.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cpeekc" name="cpeekc">,
<ref id="cpeekcolor" name="cpeekcolor">,
<ref id="cpeeks" name="cpeeks">,
<ref id="cputc" name="cputc">,
<ref id="revers" name="revers">
<tag/Example/None.
</descrip>
</quote>


<sect1>cpeeks<label id="cpeeks"><p>

<quote>
<descrip>
<tag/Function/Get a string from the display memory.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ cpeeks (char* s, unsigned length);/
<tag/Description/The function gets a fixed-length string ('\0'-terminated) of
characters that start at the current location of the cursor in the display
screen RAM.  Those characters are converted, if needed, into the encoding that
can be passed to <tt/cputs()/.  The first argument must point to a RAM area
that's large enough to hold "length + 1" bytes.
<tag/Notes/<itemize>
<item>Conio peek functions don't have <tt/cpeek...xy()/ versions.  That was
done to make it obvious that peeking doesn't move the cursor in any way.  Your
program must place the cursor where it wants to peek before it calls any of
those functions.
<item>The function is available as only a fastcall function;
so, it may be used only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cpeekc" name="cpeekc">,
<ref id="cpeekcolor" name="cpeekcolor">,
<ref id="cpeekrevers" name="cpeekrevers">,
<ref id="cputc" name="cputc">,
<ref id="cputs" name="cputs">
<tag/Example/None.
</descrip>
</quote>


<sect1>creat<label id="creat"><p>

<quote>
<descrip>
<tag/Function/Create a file.
<tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
<tag/Declaration/<tt/int __fastcall__ creat (const char* name, unsigned mode);/
<tag/Description/<tt/creat/ creates a new file and returns the file descriptor
associated with it. On error, -1 is returned and an error code is stored in
<tt/errno/.
<tag/Notes/<itemize>
<item><tt/creat/ is identical to calling <tt/<ref id="open" name="open">/ with
<tt/flags/ equal to <tt/O_WRONLY | O_CREAT | O_TRUNC/.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="close" name="close">,
<ref id="open" name="open">
<tag/Example/None.
</descrip>
</quote>


<sect1>cprintf<label id="cprintf"><p>

<quote>
<descrip>
<tag/Function/Formatted output to the console.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/int cprintf (const char* format, ...);/
<tag/Description/The arguments are converted to text where necessary and
formatted according to the format string given. The resulting string is output
to the console. <tt/cprintf/ supports the same format specifiers as
<tt/printf/. <!-- <tt/<ref id="printf" name="printf">/. -->
<tag/Notes/<itemize>
<item>Like all other <tt/conio/ output functions, <tt/cprintf/ distinguishes
between <tt/\r/ and <tt/\n/.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cputc" name="cputc">,
<ref id="cputcxy" name="cputcxy">,
<ref id="cputs" name="cputs">,
<ref id="cputsxy" name="cputsxy">,
<ref id="vcprintf" name="vcprintf">
<tag/Example/None.
</descrip>
</quote>


<sect1>cputc<label id="cputc"><p>

<quote>
<descrip>
<tag/Function/Output a character directly to the console.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ cputc (char c);/
<tag/Description/Output one character to the console at the current cursor
position.
<tag/Notes/<itemize>
<item>Like all other <tt/conio/ output functions, <tt/cputc/ distinguishes
between <tt/\r/ and <tt/\n/.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cprintf" name="cprintf">,
<ref id="cputcxy" name="cputcxy">,
<ref id="cputs" name="cputs">,
<ref id="cputsxy" name="cputsxy">,
<ref id="vcprintf" name="vcprintf">
<tag/Example/None.
</descrip>
</quote>


<sect1>cputcxy<label id="cputcxy"><p>

<quote>
<descrip>
<tag/Function/Output a character at a specific screen position.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);/
<tag/Description/<tt/cputcxy/ moves the cursor to the given x/y position on
the screen and outputs one character.
<tag/Notes/<itemize>
<item>Like all other <tt/conio/ output functions, <tt/cputcxy/ distinguishes
between <tt/\r/ and <tt/\n/.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cprintf" name="cprintf">,
<ref id="cputc" name="cputc">,
<ref id="cputs" name="cputs">,
<ref id="cputsxy" name="cputsxy">,
<ref id="vcprintf" name="vcprintf">
<tag/Example/None.
</descrip>
</quote>


<sect1>cputs<label id="cputs"><p>

<quote>
<descrip>
<tag/Function/Output a string directly to the console.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ cputs (const char* s);/
<tag/Description/The function outputs the given string on the console at the
current cursor position.
<tag/Notes/<itemize>
<item>Like all other <tt/conio/ output functions, <tt/cputs/ distinguishes
between <tt/\r/ and <tt/\n/.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cprintf" name="cprintf">,
<ref id="cputc" name="cputc">,
<ref id="cputcxy" name="cputcxy">,
<ref id="cputsxy" name="cputsxy">,
<ref id="vcprintf" name="vcprintf">
<tag/Example/None.
</descrip>
</quote>


<sect1>cputsxy<label id="cputsxy"><p>

<quote>
<descrip>
<tag/Function/Output a string to the console at a given position.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ cputsxy (unsigned char x, unsigned char y, const char* s);/
<tag/Description/<tt/cputsxy/ moves the cursor to the given x/y position,
and outputs the string <tt/s/.
<tag/Notes/<itemize>
<item>Like all other <tt/conio/ output functions, <tt/cputsxy/ distinguishes
between <tt/\r/ and <tt/\n/.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cprintf" name="cprintf">,
<ref id="cputc" name="cputc">,
<ref id="cputcxy" name="cputcxy">,
<ref id="cputs" name="cputs">,
<ref id="vcprintf" name="vcprintf">
<tag/Example/None.
</descrip>
</quote>


<sect1>cursor<label id="cursor"><p>

<quote>
<descrip>
<tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
<tag/Description/If the argument to the function is non zero, a blinking cursor
will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cgetc" name="cgetc">,
<ref id="kbhit" name="kbhit">
<tag/Example/None.
</descrip>
</quote>


<sect1>cvline<label id="cvline"><p>

<quote>
<descrip>
<tag/Function/Output a vertical line in text mode.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
<tag/Description/The function outputs a vertical line with the given length
starting at the current cursor position.
<tag/Notes/<itemize>
<item>The character used to draw the vertical line is system dependent.
If available, a line drawing character is used. Drawing a line that is partially
off screen leads to undefined behaviour.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="chline" name="chline">,
<ref id="chlinexy" name="chlinexy">,
<ref id="cvlinexy" name="cvlinexy">
<tag/Example/None.
</descrip>
</quote>


<sect1>cvlinexy<label id="cvlinexy"><p>

<quote>
<descrip>
<tag/Function/Output a vertical line at a given position in text mode.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
<tag/Description/The function outputs a vertical line with the given length
starting at a given position.
<tag/Notes/<itemize>
<item>The character used to draw the vertical line is system dependent.
If available, a line drawing character is used. Drawing a line that is partially
off screen leads to undefined behaviour.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="chline" name="chline">,
<ref id="chlinexy" name="chlinexy">,
<ref id="cvline" name="cvline">
<tag/Example/None.
</descrip>
</quote>


<sect1>decompress_lz4<label id="decompress_lz4"><p>

<quote>
<descrip>
<tag/Function/Uncompress a LZ4-compressed buffer.
<tag/Header/<tt/<ref id="lz4.h" name="lz4.h">/
<tag/Declaration/<tt/void decompress_lz4 (const unsigned char* src, unsigned char* const dst, const unsigned short uncompressed_size);/
<tag/Description/<tt/decompress_lz4/ uncompresses a LZ4-compressed buffer.
<tag/Notes/<itemize>
<item>Use LZ4_compress_HC with compression level 16 for best compression.
</itemize>
<tag/Availability/cc65
<tag/Example/None.
</descrip>
</quote>


<sect1>detect_c128<label id="detect_c128"><p>

<quote>
<descrip>
<tag/Function/Check if a C128 CPU is the current CPU.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char detect_c128 (void);/
<tag/Description/The function returns a 1 if a C128 CPU is the current CPU.
<tag/Notes/<itemize>
<item>The function is specific to the C64 and C128.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="get_c128_speed" name="get_c128_speed">,
<ref id="set_c128_speed" name="set_c128_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>detect_c64dtv<label id="detect_c64dtv"><p>

<quote>
<descrip>
<tag/Function/Check for the presence of the C64DTV.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char detect_c64dtv (void);/
<tag/Description/The function returns a 1 if a C64DTV has been detected.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="get_c64dtv_speed" name="get_c64dtv_speed">,
<ref id="set_c64dtv_speed" name="set_c64dtv_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>detect_c65<label id="detect_c65"><p>

<quote>
<descrip>
<tag/Function/Check for the presence of a C65/C64DX in C64 mode.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char detect_c65 (void);/
<tag/Description/The function returns a 1 if a C65/C64DX in C64 mode has been detected.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="get_c65_speed" name="get_c65_speed">,
<ref id="set_c65_speed" name="set_c65_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>detect_chameleon<label id="detect_chameleon"><p>

<quote>
<descrip>
<tag/Function/Check for the presence of the C64 Chameleon cartridge.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char detect_chameleon (void);/
<tag/Description/The function returns a 1 if a C64 Chameleon cartridge has been detected.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="get_chameleon_speed" name="get_chameleon_speed">,
<ref id="set_chameleon_speed" name="set_chameleon_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>detect_scpu<label id="detect_scpu"><p>

<quote>
<descrip>
<tag/Function/Check for the presence of the C64/C128 SuperCPU cartridge.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char detect_scpu (void);/
<tag/Description/The function returns a 1 if a SuperCPU cartridge has been detected.
<tag/Notes/<itemize>
<item>The function is specific to the C128 and C64.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="get_scpu_speed" name="get_scpu_speed">,
<ref id="set_scpu_speed" name="set_scpu_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>detect_turbomaster<label id="detect_turbomaster"><p>

<quote>
<descrip>
<tag/Function/Check for the presence of the C64 Turbo Master cartridge.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char detect_turbomaster (void);/
<tag/Description/The function returns a 1 if a C64 Turbo Master cartridge has been detected.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="get_turbomaster_speed" name="get_turbomaster_speed">,
<ref id="set_turbomaster_speed" name="set_turbomaster_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>div<label id="div"><p>

<quote>
<descrip>
<tag/Function/Divide two ints and return quotient and remainder.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/div_t __fastcall__ div (int numer, int denom);/
<tag/Description/<tt/div/ divides <tt/numer/ by <tt/denom/ and returns the
quotient and remainder in a <tt/div_t/ structure.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
ldiv
<tag/Example/None.
</descrip>
</quote>


<sect1>doesclrscrafterexit<label id="doesclrscrafterexit"><p>

<quote>
<descrip>
<tag/Function/Determines whether the screen is going to be cleared after program exit.
<tag/Header/<tt/<ref id="cc65.h" name="cc65.h">/
<tag/Declaration/<tt/unsigned char doesclrscrafterexit (void);/
<tag/Description/The function returns zero if the screen won't be cleared immediately after
program termination. It returns a non-zero value if it will.
<tag/Notes/<itemize>
<item>Some systems, maybe depending on configuration, immediately clear the screen
after a program exits. Therefore it might be difficult to read
the last messages printed by the program prior to its exit. This function can be used
to decide if a delay or wait for a key press should be executed when then program
exits.
</itemize>
<tag/Availability/cc65
<tag/Example/<verb>
/* Hello World */
#include &lt;stdio.h&gt;
#include &lt;unistd.h&gt;
#include &lt;cc65.h&gt;
int main(void)
{
    printf("Hello World\n");
    if (doesclrscrafterexit())
        sleep(5);
    return 0;
}
</verb>
</descrip>
</quote>


<sect1>dumpt<label id="dumpt"><p>

<quote>
<descrip>
<tag/Function/Dump memory to tape.
<tag/Header/<tt/<ref id="sym1.h" name="sym1.h">/
<tag/Declaration/<tt/int __fastcall__ dumpt (unsigned char id, const void* start, const void* end);/
<tag/Description/<tt/dumpt/ saves memory onto data tape.
<tag/Notes/<itemize>
<item>The function is specific to the Sym-1.
<item>The return value is status.  Non-zero status indicates an error.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="beep" name="beep">,
<ref id="fdisp" name="fdisp">,
<ref id="loadt" name="loadt">,
<tag/Example/None.
</descrip>
</quote>


<sect1>em_commit<label id="em_commit"><p>

<quote>
<descrip>
<tag/Function/Commit changes into extended memory.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/void em_commit (void);/
<tag/Description/Commit changes in the memory window to extended storage. If
the contents of the memory window have been changed, these changes may be lost
if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
<tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
name="em_copyto">/ are called without calling <tt/em_commit/ first.
<tag/Notes/<itemize>
<item>Calling <tt/em_commit/ does not necessarily mean that changes to the
memory window are discarded, it does just mean that the drivers is allowed
to discard it.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
<item>The function produces undefined results if no extended memory driver is
loaded.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_load_driver" name="em_load_driver">,
<ref id="em_map" name="em_map">,
<ref id="em_use" name="em_use">
<tag/Example/None.
</descrip>
</quote>


<sect1>em_copyfrom<label id="em_copyfrom"><p>

<quote>
<descrip>
<tag/Function/Copy from extended into normal memory.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
<tag/Description/Copy data from extended memory into linear memory. Source and
target addresses as well as the number of bytes to transfer are specified in
the <tt/em_copy/ structure that is passed as a parameter.
<tag/Notes/<itemize>
<item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
made any changes to the data in the window, call <tt/<ref id="em_commit"
name="em_commit">/ first, or the changes are lost.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
<item>The function produces undefined results if no extended memory driver is
loaded.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_commit" name="em_commit">,
<ref id="em_copyto" name="em_copyto">,
<ref id="em_load_driver" name="em_load_driver">
<tag/Example/None.
</descrip>
</quote>


<sect1>em_copyto<label id="em_copyto"><p>

<quote>
<descrip>
<tag/Function/Copy from normal into extended memory.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
<tag/Description/Copy data from linear into extended memory. Source and
target addresses as well as the number of bytes to transfer are specified in
the <tt/em_copy/ structure that is passed as a parameter.
<tag/Notes/<itemize>
<item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
made any changes to the data in the window, call <tt/<ref id="em_commit"
name="em_commit">/ first, or the changes are lost.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
<item>The function produces undefined results if no extended memory driver is
loaded.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_commit" name="em_commit">,
<ref id="em_copyfrom" name="em_copyfrom">,
<ref id="em_load_driver" name="em_load_driver">
<tag/Example/None.
</descrip>
</quote>


<sect1>em_install<label id="em_install"><p>

<quote>
<descrip>
<tag/Function/Install an already loaded extended memory driver.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/unsigned char _fastcall__ em_install (const void* driver);/
<tag/Description/The function installs an already loaded extended memory driver
and returns an error code. The function may be used to install a driver linked
statically to the program.
<tag/Notes/<itemize>
<item>Not all drivers are able to detect if the supported hardware is really
present.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_load_driver" name="em_load_driver">,
<ref id="em_uninstall" name="em_uninstall">,
<ref id="em_unload" name="em_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>em_load_driver<label id="em_load_driver"><p>

<quote>
<descrip>
<tag/Function/Load and initialize an extended memory driver.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ em_load_driver (const char* name);/
<tag/Description/Load an extended memory driver into memory and initialize
it. The function returns an error code that tells if all this has been
successful.
<tag/Notes/<itemize>
<item>Not all drivers are able to detect if the supported hardware is really
present.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
<item>The driver is loaded by name, so currently you must know the type of
extended memory that should be supported. There is no autodetect capability.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_unload" name="em_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>em_map<label id="em_map"><p>

<quote>
<descrip>
<tag/Function/Make a page of extended memory accessible.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
<tag/Description/The function maps one page of extended memory into linear
memory and returns a pointer to the page frame. Depending on the hardware
and driver, the data is either mapped into the address space or transferred
into a buffer. If you don't need the actual contents of the page (for example
because you're going to overwrite it completely), it is better to call
<tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
data if it is possible to avoid that.
<tag/Notes/<itemize>
<item>Calling <tt/em_map/ will invalidate the memory window, so if you
made any changes to the data in the window, call <tt/<ref id="em_commit"
name="em_commit">/ first, or the changes are lost.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
<item>The function produces undefined results if no extended memory driver is
loaded.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_commit" name="em_commit">,
<ref id="em_load_driver" name="em_load_driver">,
<ref id="em_use" name="em_use">
<tag/Example/None.
</descrip>
</quote>


<sect1>em_pagecount<label id="em_pagecount"><p>

<quote>
<descrip>
<tag/Function/Return the number of available extended memory pages.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/unsigned em_pagecount (void);/
<tag/Description/The function returns the size of the extended memory supported
by the driver in 256 byte pages.
<tag/Notes/<itemize>
<item>The function returns zero if no extended memory driver is loaded.
<item>The function may return zero if the supported hardware was not detected.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_load_driver" name="em_load_driver">
<tag/Example/None.
</descrip>
</quote>


<sect1>em_uninstall<label id="em_uninstall"><p>

<quote>
<descrip>
<tag/Function/Uninstall an already loaded extended memory driver.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/unsigned char em_uninstall (void);/
<tag/Description/The function uninstalls an already loaded extended memory
driver but doesn't remove it from memory.
<tag/Notes/<itemize>
<item>If the driver has been loaded using <tt/<ref id="em_load_driver"
name="em_load_driver">/, <tt/<ref id="em_unload" name="em_unload">/
should be used instead of <tt/em_uninstall/ so the driver is also removed
from memory.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_install" name="em_install">,
<ref id="em_load_driver" name="em_load_driver">,
<ref id="em_unload" name="em_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>em_unload<label id="em_unload"><p>

<quote>
<descrip>
<tag/Function/Unload an extended memory driver.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/unsigned char em_unload (void);/
<tag/Description/The function unloads a loaded extended memory driver and
frees all memory allocated for the driver.
<tag/Notes/<itemize>
<item>The function does nothing if no driver is loaded.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_load_driver" name="em_load_driver">
<tag/Example/None.
</descrip>
</quote>


<sect1>em_use<label id="em_use"><p>

<quote>
<descrip>
<tag/Function/Prepare an extended memory page for use.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
<tag/Description/The function maps one page of extended memory into linear
memory and returns a pointer to the page frame. This function is similar to
<tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
actual memory window in the assumption that the existing data is wrong or
will get overwritten.
<tag/Notes/<itemize>
<item>Calling <tt/em_use/ will invalidate the memory window, so if you
made any changes to the data in the window, call <tt/<ref id="em_commit"
name="em_commit">/ first, or the changes are lost.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
<item>The function produces undefined results if no extended memory driver is
loaded.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="em_commit" name="em_commit">,
<ref id="em_load_driver" name="em_load_driver">,
<ref id="em_map" name="em_map">
<tag/Example/None.
</descrip>
</quote>


<sect1>exit<label id="exit"><p>

<quote>
<descrip>
<tag/Function/Terminate the program.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void __fastcall__ exit (int status);/
<tag/Description/<tt/exit/ terminates the program. The argument specifies the
return code of the program. Before termination, all files are closed, buffered
output is written and any functions registered with <tt/<ref id="atexit"
name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
<tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
name="stdlib.h">/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>It depends on the host machine if the program return code can be
evaluated or is ignored.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="abort" name="abort">,
<ref id="exit" name="exit">
<tag/Example/None.
</descrip>
</quote>


<sect1>exec<label id="exec"><p>

<quote>
<descrip>
<tag/Function/Execute a program file.
<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
<tag/Declaration/<tt/int __fastcall__ exec (const char* progname, const char* cmdline);/
<tag/Description/<tt/exec/ replaces the currently running program by a new one.
Calling <tt/exec()/ is identical to calling <tt/<ref id="exit" name="exit()">/,
then loading and starting the program named in the first argument, passing
the command line specified as second argument. Instead of an empty string,
a <tt/NULL/ pointer may be passed as second parameter.
On success, the function does not return. On failure, -1 is returned and
<tt/errno/ contains an error code.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>On most platforms, the function needs to copy a small stub loader to
some memory area outside the program space. This may collide with other
programs. See the platform specific docs on this.
<item>Because it is necessary to terminate the running program before the
memory can be reused to load the new one, there is a high chance that the
function may not be able to return on errors.
<item>The command line is passed to the new program in the same way as cc65
programs expect the command line. If the new program is not a cc65 generated
program, it may not be able to read it.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="exit" name="exit">
<tag/Example/None.
</descrip>
</quote>


<sect1>fast<label id="fast"><p>

<quote>
<descrip>
<tag/Function/Switch the CPU into fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
<tag/Header/<tt/<ref id="c128.h" name="c128.h">,
<ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
<tag/Declaration/<tt/void fast (void);/
<tag/Description/The function will switch the clock of the CPU to fast mode. For the C128
target it means switching the CPU into 2MHz mode. For the C16/Plus4 target it means
switching the CPU into double clock mode.
<tag/Notes/<itemize>
<item>The function is specific to the C128, C16 and Plus4.
<item>On the C128 the 2MHz clock will not work in 40 column mode.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="isfast" name="isfast">,
<ref id="slow" name="slow">,
<tag/Example/None.
</descrip>
</quote>


<sect1>fdisp<label id="fdisp"><p>

<quote>
<descrip>
<tag/Function/Flash front-panel display.
<tag/Header/<tt/<ref id="sym1.h" name="sym1.h">/
<tag/Declaration/<tt/void fdisp(void);/
<tag/Description/<tt/fdisp/ flashes front-panel display.
<tag/Notes/<itemize>
<item>The function is specific to the Sym-1.
<item>The front-panel display buffer must be loaded prior to calling fdisp.  See the DISPLAY struct definition in sym1.h.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="beep" name="beep">,
<ref id="loadt" name="loadt">,
<ref id="dumpt" name="dumpt">,
<tag/Example/None.
</descrip>
</quote>


<sect1>feof<label id="feof"><p>

<quote>
<descrip>
<tag/Function/Return the end-of-file indicator of a stream.
<tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
<tag/Declaration/<tt/int __fastcall__ feof (FILE* f);/
<tag/Description/<tt/feof/ tests the end-of-file indicator of the stream
<tt/f/, and returns a non zero value if it is set.
<tag/Notes/<itemize>
<item>The indicator is set only after a read past the end of a file is
attempted.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="feof" name="clearerr">,
<ref id="ferror" name="ferror">
<tag/Example/None.
</descrip>
</quote>


<sect1>ferror<label id="ferror"><p>

<quote>
<descrip>
<tag/Function/Return the error indicator of a stream.
<tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
<tag/Declaration/<tt/int __fastcall__ ferror (FILE* f);/
<tag/Description/<tt/ferror/ tests the error indicator of the stream
<tt/f/, and returns a non zero value if it is set.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="feof" name="clearerr">,
<ref id="ferror" name="feof">
<tag/Example/None.
</descrip>
</quote>


<sect1>fileno<label id="fileno"><p>

<quote>
<descrip>
<tag/Function/Return the file handle used by a stream.
<tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
<tag/Declaration/<tt/int __fastcall__ fileno (FILE* f);/
<tag/Description/The <tt/fileno/ function returns the file handle used
internally by a C stream. This file handle (an integer) can be used as a
handle for the POSIX input/output functions.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
<item>Mixing C file I/O functions and POSIX file I/O functions for the same
file may have unpredictable results.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="creat" name="creat">,
<ref id="open" name="open"> <!-- , -->
<!-- <ref id="read" name="read">, -->
<!-- <ref id="write" name="write"> -->
<tag/Example/None.
</descrip>
</quote>


<sect1>free<label id="free"><p>

<quote>
<descrip>
<tag/Function/Free a block of dynamic memory.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void __fastcall__ free (void* block);/
<tag/Description/Free a block of dynamic memory previously allocated with
<tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
pointer is <tt/NULL/, no action is performed.
<tag/Notes/<itemize>
<item>Passing an already free'd block to <tt/free/ again will cause undefined
behaviour and may crash your program.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_heapadd" name="_heapadd">,
<ref id="_heapblocksize" name="_heapblocksize">,
<ref id="_heapmaxavail" name="_heapmaxavail">,
<ref id="_heapmemavail" name="_heapmemavail">,
<ref id="calloc" name="calloc">,
<ref id="malloc" name="malloc">,
<ref id="realloc" name="realloc">
<tag/Example/None.
</descrip>
</quote>


<sect1>get_ostype<label id="get_ostype"><p>

<quote>
<descrip>
<tag/Function/The function returns the operating system, the program runs on.
<tag/Header/<tt/<ref id="apple2.h" name="apple2.h">,
<ref id="atari.h" name="atari.h">, <ref id="c64.h" name="c64.h">/
<tag/Declaration/<tt/unsigned char get_ostype (void);/
<tag/Description/<tt/get_ostype/ is machine dependent and does not exist for
all supported targets. If it exists, it returns a number that identifies the
operating system or machine type, the program runs on. The machine dependent
header files define constants that can be used to check the return code.
<tag/Notes/<itemize>
<item>The function does not exist on all platforms.
<item>The return codes are platform dependent.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/Example/None.
</descrip>
</quote>


<sect1>get_c128_speed<label id="get_c128_speed"><p>

<quote>
<descrip>
<tag/Function/Get the current speed of the C128 CPU.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char get_c128_speed (void);/
<tag/Description/The function returns the current speed of the C128 CPU.
<tag/Notes/<itemize>
<item>The function is specific to the C64 and C128.
<item>The function does not check if the C128 CPU is the current CPU.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_c128" name="detect_c128">,
<ref id="set_c128_speed" name="set_c128_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>get_c64dtv_speed<label id="get_c64dtv_speed"><p>

<quote>
<descrip>
<tag/Function/Get the current speed of the C64DTV.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char get_c64dtv_speed (void);/
<tag/Description/The function returns the current speed of the C64DTV.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
<item>The function does not check for the presence of the C64DTV.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_c64dtv" name="detect_c64dtv">,
<ref id="set_c64dtv_speed" name="set_c64dtv_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>get_c65_speed<label id="get_c65_speed"><p>

<quote>
<descrip>
<tag/Function/Get the current speed of the C65/C64DX in C64 mode.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char get_c65_speed (void);/
<tag/Description/The function returns the current speed of the C65/C64DX in C64 mode.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
<item>The function does not check for the presence of a C65/C64DX in C64 mode.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_c65" name="detect_c65">,
<ref id="set_c65_speed" name="set_c65_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>get_chameleon_speed<label id="get_chameleon_speed"><p>

<quote>
<descrip>
<tag/Function/Get the current speed of the C64 Chameleon cartridge.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char get_chameleon_speed (void);/
<tag/Description/The function returns the current speed of the C64 Chameleon cartridge.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
<item>The function does not check for the presence of the C64 Chameleon cartridge.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_chameleon" name="detect_chameleon">,
<ref id="set_chameleon_speed" name="set_chameleon_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>get_scpu_speed<label id="get_scpu_speed"><p>

<quote>
<descrip>
<tag/Function/Get the current speed of the C64/C128 SuperCPU cartridge.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char get_scpu_speed (void);/
<tag/Description/The function returns the current speed of the SuperCPU cartridge.
<tag/Notes/<itemize>
<item>The function is specific to the C128 and C64.
<item>The function does not check for the presence of the cartridge.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_scpu" name="detect_scpu">,
<ref id="set_scpu_speed" name="set_scpu_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>get_turbomaster_speed<label id="get_turbomaster_speed"><p>

<quote>
<descrip>
<tag/Function/Get the current speed of the C64 Turbo Master cartridge.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char get_turbomaster_speed (void);/
<tag/Description/The function returns the current speed of the C64 Turbo Master cartridge.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
<item>The function does not check for the presence of the C64 Turbo Master cartridge.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_turbomaster" name="detect_turbomaster">,
<ref id="set_turbomaster_speed" name="set_turbomaster_speed">,
<tag/Example/None.
</descrip>
</quote>

<sect1>getcpu<label id="getcpu"><p>

<quote>
<descrip>
<tag/Function/Determine on which CPU the program is running.
<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
<tag/Declaration/<tt/unsigned char getcpu (void);/
<tag/Description/The function checks on which CPU the code is running. It
returns one of the constants<itemize>
<item><tt/CPU_6502/
<item><tt/CPU_65C02/
<item><tt/CPU_65816/
<item><tt/CPU_4510/
<item><tt/CPU_65SC02/
<item><tt/CPU_65CE02/
<item><tt/CPU_HUC6280/
<item><tt/CPU_2A0x/
</itemize>
<tag/Notes/<itemize>
<item>Other, more exotic CPU types are not disinguished.
</itemize>
<tag/Availability/cc65
<tag/Example/None.
</descrip>
</quote>


<sect1>getcurrentdevice<label id="getcurrentdevice"><p>

<quote>
<descrip>
<tag/Function/Get current device.
<tag/Header/<tt/<ref id="device.h" name="device.h">/
<tag/Declaration/<tt/unsigned char getcurrentdevice (void);/
<tag/Description/The function returns the current device.
It allows to access the current device with the <ref id="dio.h"
name="Low-level disk I/O API"> or <ref id="cbm.h" name="cbm_* I/O
functions"> requiring a 'device' parameter.
<tag/Availability/cc65
<tag/See also/
<ref id="getdevicedir" name="getdevicedir">,
<ref id="getfirstdevice" name="getfirstdevice">,
<ref id="getnextdevice" name="getnextdevice">
<tag/Example/<verb>
dio_open (getcurrentdevice ());
</verb>
</descrip>
</quote>


<sect1>getcwd<label id="getcwd"><p>

<quote>
<descrip>
<tag/Function/Get current working directory.
<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
<tag/Declaration/<tt/char* __fastcall__ getcwd (char* buf, size_t size);/
<tag/Description/The function will return the current working directory.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/Example/None.
</descrip>
</quote>


<sect1>getdevicedir<label id="getdevicedir"><p>

<quote>
<descrip>
<tag/Function/Get device directory.
<tag/Header/<tt/<ref id="device.h" name="device.h">/
<tag/Declaration/<tt/char* __fastcall__ getdevicedir (unsigned char device, char* buf, size_t size);/
<tag/Description/The function returns the directory representing <tt/device/.
It allows to access the device on filesystem level by calling chdir() with
the directory returned.
<tag/Notes/<itemize>
<item>Calling getdevicedir() <em/does/ check for a (formatted) disk in a
floppy-disk-type device and returns NULL if that check fails.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="getcwd" name="getcwd">,
<ref id="getcurrentdevice" name="getcurrentdevice">,
<ref id="getfirstdevice" name="getfirstdevice">,
<ref id="getnextdevice" name="getnextdevice">
<tag/Example/<verb>
chdir (getdevicedir (device, buf, sizeof buf));
</verb>
cf. <tt/samples&sol;enumdevdir.c/
</descrip>
</quote>


<sect1>getenv<label id="getenv"><p>

<quote>
<descrip>
<tag/Function/Return a value from the environment.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
<tag/Description/The function searches the environment for an entry that
matches <tt/name/ and returns its value. The environment consists of a list
of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
returns <tt/NULL/.
<tag/Notes/<itemize>
<item>What exactly is stored in the environment depends on the machine the
program is running on.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/Example/None.
</descrip>
</quote>


<sect1>getfirstdevice<label id="getfirstdevice"><p>

<quote>
<descrip>
<tag/Function/Get first device.
<tag/Header/<tt/<ref id="device.h" name="device.h">/
<tag/Declaration/<tt/unsigned char getfirstdevice (void);/
<tag/Description/The function returns the first device.
The constant <tt/INVALID_DEVICE/ indicates no device.
<tag/Notes/<itemize>
<item>Calling getfirstdevice() does <em/not/ turn on the motor of a
drive-type device and does <em/not/ check for a disk in the drive.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="getcurrentdevice" name="getcurrentdevice">,
<ref id="getdevicedir" name="getdevicedir">,
<ref id="getnextdevice" name="getnextdevice">
<tag/Example/<verb>
unsigned char dev = getfirstdevice ();
while (dev != INVALID_DEVICE) {
        printf ("%d\n", dev);
        dev = getnextdevice (dev);
        }
</verb>
</descrip>
</quote>


<sect1>getnextdevice<label id="getnextdevice"><p>

<quote>
<descrip>
<tag/Function/Get next device.
<tag/Header/<tt/<ref id="device.h" name="device.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ getnextdevice (unsigned char device);/
<tag/Description/The function returns the next device after <tt/device/.
The constant <tt/INVALID_DEVICE/ indicates no further device.
<tag/Notes/<itemize>
<item>Calling getnextdevice() does <em/not/ turn on the motor of a
drive-type device and does <em/not/ check for a disk in the drive.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="getcurrentdevice" name="getcurrentdevice">,
<ref id="getdevicedir" name="getdevicedir">,
<ref id="getfirstdevice" name="getfirstdevice">
<tag/Example/<verb>
unsigned char dev = getfirstdevice ();
while (dev != INVALID_DEVICE) {
        printf ("%d\n", dev);
        dev = getnextdevice (dev);
        }
</verb>
</descrip>
</quote>


<sect1>getopt<label id="getopt"><p>

<quote>
<descrip>
<tag/Function/Parse command line options.
<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
<tag/Declaration/<tt/int __fastcall__ getopt (int argc, char* const* argv,
const char* optstring);/
<tag/Description/The function parses command line arguments, <tt/argc/ and
<tt/argv/ are the argument count and array passed to <tt/main/. <tt/optstring/
is a string that contains command line option characters. If a character in
<tt/optstring/ is followed by a colon, the option requires an argument. An
option on the command line is recognized if it is one of the option characters
preceded by a '-'.
<tt/getopt/ must be called repeatedly. It will return each option character
found on the command line and <tt/EOF/ (-1) if there is no other option. An
option argument is placed in <tt/optarg/, the index of the next element on the
command line to be processed is placed in <tt/optind/.
<tag/Notes/<itemize>
<item>The implementation will not reorder options. A non option on the command
line will terminate option processing. All remaining arguments are not
recognized as options, even if the start with a '-' character.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX.2
<tag/Example/None.
</descrip>
</quote>


<sect1>gotox<label id="gotox"><p>

<quote>
<descrip>
<tag/Function/Move the text mode cursor to a new X position.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
<tag/Description/The function moves the text mode cursor to the specified X
position while leaving the Y position untouched. The leftmost position on the
screen has the coordinate 0.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
<item>Invalid values for the X position (out of screen coordinates) may
lead to undefined behaviour.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="gotoy" name="gotoy">,
<ref id="gotoxy" name="gotoxy">,
<ref id="wherex" name="wherex">,
<ref id="wherey" name="wherey">
<tag/Example/None.
</descrip>
</quote>


<sect1>gotoxy<label id="gotoxy"><p>

<quote>
<descrip>
<tag/Function/Move the text mode cursor to a new position.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
<tag/Description/The function moves the text mode cursor to the specified
position. The leftmost position on the screen has the X coordinate 0, the
topmost line has the Y coordinate 0.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
<item>Invalid values for any of both coordinates (out of screen positions) may
lead to undefined behaviour.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="gotox" name="gotox">,
<ref id="gotoy" name="gotoy">,
<ref id="wherex" name="wherex">,
<ref id="wherey" name="wherey">
<tag/Example/None.
</descrip>
</quote>


<sect1>gotoy<label id="gotoy"><p>

<quote>
<descrip>
<tag/Function/Move the text mode cursor to a new Y position.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
<tag/Description/The function moves the text mode cursor to the specified Y
position while leaving the X position untouched. The uppermost position on the
screen has the coordinate 0.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
<item>Invalid values for the Y position (out of screen coordinates) may lead
to undefined behaviour.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="gotox" name="gotox">,
<ref id="gotoxy" name="gotoxy">,
<ref id="wherex" name="wherex">,
<ref id="wherey" name="wherey">
<tag/Example/None.
</descrip>
</quote>


<sect1>isalnum<label id="isalnum"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a letter or digit.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a letter or digit. The return value is zero if the character is anything
else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>isalpha<label id="isalpha"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a letter.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a letter. The return value is zero if the character is anything else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>isascii<label id="isascii"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is in the ASCII (0..127) range.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isascii (int c);/
<tag/Description/The function returns a non zero value if the given argument
is in the range 0..127 (the range of valid ASCII characters), and zero if not.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>isblank<label id="isblank"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a space or tab.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isblank (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a space or tab character. The return value is zero if the character is
anything else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>iscntrl<label id="iscntrl"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a control character.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a control character. The return value is zero if the character is anything
else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>isdigit<label id="isdigit"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a digit.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a digit. The return value is zero if the character is anything else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>isfast<label id="isfast"><p>

<quote>
<descrip>
<tag/Function/Check if the CPU is in fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
<tag/Header/<tt/<ref id="c128.h" name="c128.h">,
<ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
<tag/Declaration/<tt/unsigned char isfast (void);/
<tag/Description/The function returns a 1 if the CPU is in fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
<tag/Notes/<itemize>
<item>The function is specific to the C128, C16 and Plus4.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="fast" name="fast">,
<ref id="slow" name="slow">,
<tag/Example/None.
</descrip>
</quote>


<sect1>isgraph<label id="isgraph"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a printable character (except
space).
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a printable character with the exception of space. The return value is zero
if the character is anything else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>islower<label id="islower"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a lower case letter.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ islower (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a lower case letter. The return value is zero if the character is anything
else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>isprint<label id="isprint"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a printable character.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isprint (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a printable character (this includes the space character). The return value
is zero if the character is anything else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>ispunct<label id="ispunct"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a printable character but not a
space or an alphanumeric character.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a printable character, but not a space or anything alphanumeric. The return
value is zero if the character is anything else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>isspace<label id="isspace"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a white-space character.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isspace (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a white space character. The return value is zero if the character is
anything else. The standard white space characters are: space, formfeed ('\f'),
newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
('\v').
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isupper" name="isupper">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>isupper<label id="isupper"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is an upper case letter.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isupper (int c);/
<tag/Description/The function returns a non zero value if the given argument
is an upper case letter. The return value is zero if the character is anything
else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isxdigit" name="isxdigit">
<tag/Example/None.
</descrip>
</quote>


<sect1>isxdigit<label id="isxdigit"><p>

<quote>
<descrip>
<tag/Function/Check if a given character is a hexadecimal digit.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
<tag/Description/The function returns a non zero value if the given argument
is a hexadecimal digit (0..9, a..f and A..F). The return value is zero if the
character is anything else.
<tag/Notes/<itemize>
<item>When compiling without <tt/-Os/, the function is only available as
fastcall function, so it may only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="isalnum" name="isalnum">,
<ref id="isalpha" name="isalpha">,
<ref id="isascii" name="isascii">,
<ref id="isblank" name="isblank">,
<ref id="iscntrl" name="iscntrl">,
<ref id="isdigit" name="isdigit">,
<ref id="isgraph" name="isgraph">,
<ref id="islower" name="islower">,
<ref id="isprint" name="isprint">,
<ref id="ispunct" name="ispunct">,
<ref id="isspace" name="isspace">,
<ref id="isupper" name="isupper">
<tag/Example/None.
</descrip>
</quote>


<sect1>itoa<label id="itoa"><p>

<quote>
<descrip>
<tag/Function/Convert an integer into a string.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/char* __fastcall__ itoa (int val, char* buf, int radix);/
<tag/Description/<tt/itoa/ converts the integer <tt/val/ into a string using
<tt/radix/ as the base.
<tag/Notes/<itemize>
<item>There are no provisions to prevent a buffer overflow.
<item>If <tt/val/ contains <tt/INT_MIN/, the behaviour is undefined.
<item>The function is non standard, so it is not available in strict ANSI mode.
You should probably use <tt/sprintf/ instead.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atoi" name="atoi">,
<ref id="atol" name="atol">,
<ref id="ltoa" name="ltoa">,
<ref id="ultoa" name="ultoa">,
<ref id="utoa" name="utoa">
<tag/Example/None.
</descrip>
</quote>


<sect1>joy_count<label id="joy_count"><p>

<quote>
<descrip>
<tag/Function/Return the number of joysticks supported by the current driver.
<tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
<tag/Declaration/<tt/unsigned char joy_count (void);/
<tag/Description/The function returns a the number of joysticks supported
by the current joystick driver.
<tag/Notes/<itemize>
<item>A joystick driver must be loaded using <ref id="joy_load_driver"
name="joy_load_driver"> before calling this function.
<item>The function returns the number of joysticks supported by the driver.
There's no way to check for the number of actually connected joysticks.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="joy_load_driver" name="joy_load_driver">,
<ref id="joy_read" name="joy_read">
<tag/Example/None.
</descrip>
</quote>


<sect1>joy_install<label id="joy_install"><p>

<quote>
<descrip>
<tag/Function/Install an already loaded driver and return an error code.
<tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ joy_install (const void* driver);/
<tag/Description/The function installs a driver that was already loaded into
memory (or linked statically to the program). It returns an error code
(<tt/JOY_ERR_OK/ in case of success).
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="joy_load_driver" name="joy_load_driver">,
<ref id="joy_uninstall" name="joy_uninstall">,
<ref id="joy_unload" name="joy_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>joy_load_driver<label id="joy_load_driver"><p>

<quote>
<descrip>
<tag/Function/Load a driver from disk and install it.
<tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ joy_load_driver (const char* driver);/
<tag/Description/The function loads a driver with the given name from disk
and installs it. An error code is returned, which is <tt/JOY_ERR_OK/ if the
driver was successfully loaded and installed.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="joy_install" name="joy_install">,
<ref id="joy_uninstall" name="joy_uninstall">,
<ref id="joy_unload" name="joy_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>joy_read<label id="joy_read"><p>

<quote>
<descrip>
<tag/Function/Read the status of a joystick.
<tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ joy_read (unsigned char joystick);/
<tag/Description/The function reads the status bits for a joystick. The number
of the joystick is passed as parameter. The result may be examined by using one
of the <tt/JOY_xxx/ macros from <ref id="joystick.h" name="joystick.h">.
<tag/Notes/<itemize>
<item>A joystick driver must be loaded using <ref id="joy_load_driver"
name="joy_load_driver"> before calling this function.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="joy_count" name="joy_count">,
<ref id="joy_load_driver" name="joy_load_driver">,
<ref id="joy_unload" name="joy_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>joy_uninstall<label id="joy_uninstall"><p>

<quote>
<descrip>
<tag/Function/Uninstall the current joystick driver.
<tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
<tag/Declaration/<tt/unsigned char joy_uninstall (void);/
<tag/Description/The function uninstalls the currently installed joystick
driver. It does not remove the driver from memory. The function returns an
error code, which is <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
<tag/Notes/<itemize>
<item>A joystick driver must be installed using <ref id="joy_install"
name="joy_install"> before calling this function.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="joy_install" name="joy_install">,
<ref id="joy_load_driver" name="joy_load_driver">,
<ref id="joy_unload" name="joy_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>joy_unload<label id="joy_unload"><p>

<quote>
<descrip>
<tag/Function/Uninstall, then unload the current joystick driver.
<tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
<tag/Declaration/<tt/unsigned char joy_unload (void);/
<tag/Description/The function uninstalls the currently installed joystick
driver and removes it from memory. An error code is returned, which is
<tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
<tag/Notes/<itemize>
<item>A joystick driver must be loaded using <ref id="joy_load_driver"
name="joy_load_driver"> before calling this function.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="joy_load_driver" name="joy_load_driver">
<tag/Example/None.
</descrip>
</quote>


<sect1>kbhit<label id="kbhit"><p>

<quote>
<descrip>
<tag/Function/Check if there's a key waiting in the keyboard buffer.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char kbhit (void);/
<tag/Description/The function returns a value of zero if there is no character
waiting to be read from the keyboard. It returns non zero otherwise.
<tag/Notes/<itemize>
<item>If the system does not support a keyboard buffer (most systems
do), the function is rather useless.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cgetc" name="cgetc">,
<ref id="cursor" name="cursor">
<tag/Example/None.
</descrip>
</quote>


<sect1>kbrepeat<label id="kbrepeat"><p>

<quote>
<descrip>
<tag/Function/Set the keyboard repeat mode.
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ kbrepeat (unsigned char mode);/
<tag/Description/This function changes which keys have automatic repeat when
being held down for a certain time. Possible values are <tt/KBREPEAT_CURSOR/
(repeat only cursor-related keys), <tt/KBREPEAT_NONE/ (no repeat for any
keys), and <tt/KBREPEAT_ALL/ (repeat all keys). The old mode is returned, so
it can be restored later.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/Example/None.
</descrip>
</quote>


<sect1>labs<label id="labs"><p>

<quote>
<descrip>
<tag/Function/Returns the absolute value of a long integer.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/long __fastcall__ labs (long v);/
<tag/Description/<tt/labs/ returns the absolute value of the argument passed to
the function.
<tag/Notes/<itemize>
<item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="abs" name="abs">
<tag/Example/None.
</descrip>
</quote>


<sect1>loadt<label id="loadt"><p>

<quote>
<descrip>
<tag/Function/Load memory from tape.
<tag/Header/<tt/<ref id="sym1.h" name="sym1.h">/
<tag/Declaration/<tt/int __fastcall__ loadt (unsigned char id);/
<tag/Description/<tt/loadt/ loads memory from data tape.
<tag/Notes/<itemize>
<item>The function is specific to the Sym-1.
<item>The return value is status.  Non-zero status indicates an error.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="beep" name="beep">,
<ref id="fdisp" name="fdisp">,
<ref id="dumpt" name="dumpt">,
<tag/Example/None.
</descrip>
</quote>


<sect1>ltoa<label id="ltoa"><p>

<quote>
<descrip>
<tag/Function/Convert a long integer into a string.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/char* __fastcall__ ltoa (long val, char* buf, int radix);/
<tag/Description/<tt/itoa/ converts the long integer <tt/val/ into a string
using <tt/radix/ as the base.
<tag/Notes/<itemize>
<item>There are no provisions to prevent a buffer overflow.
<item>If <tt/val/ contains <tt/LONG_MIN/, the behaviour is undefined.
<item>The function is non standard, so it is not available in strict ANSI mode.
You should probably use <tt/sprintf/ instead.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atoi" name="atoi">,
<ref id="atol" name="atol">,
<ref id="itoa" name="itoa">,
<ref id="ultoa" name="ultoa">,
<ref id="utoa" name="utoa">
<tag/Example/None.
</descrip>
</quote>


<sect1>localeconv<label id="localeconv"><p>

<quote>
<descrip>
<tag/Function/Returns a pointer to the current locale structure.
<tag/Header/<tt/<ref id="locale.h" name="locale.h">/
<tag/Declaration/<tt/struct lconv* localeconv (void);/
<tag/Description/<tt/localeconv/ returns a pointer to the current locale
structure.
<tag/Notes/<itemize>
<item>cc65 supports only the "C" locale, so even after setting a new locale
using <tt/<ref id="setlocale" name="setlocale">/, the structure returned will
always be the same.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="setlocale" name="setlocale">
<tag/Example/None.
</descrip>
</quote>


<sect1>longjmp<label id="longjmp"><p>

<quote>
<descrip>
<tag/Function/Non local goto.
<tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
<tag/Declaration/<tt/void __fastcall__ longjmp (jmp_buf buf, int retval);/
<tag/Description/The <tt/longjmp/ function restores a program context from the
data in <tt/buf/, which must have been set by a preceding call to
<tt/<ref id="setjmp" name="setjmp">/. Program execution continues as if the
call to <tt/<ref id="setjmp" name="setjmp">/ has just returned the value
<tt/retval/.
<tag/Notes/<itemize>
<item>If the parameter <tt/retval/ is zero, the function will behave as if it
was called with a value of one.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="setjmp" name="setjmp">
<tag/Example/None.
</descrip>
</quote>


<sect1>malloc<label id="malloc"><p>

<quote>
<descrip>
<tag/Function/Allocate dynamic memory.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
<tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
pointer to the allocated memory block. On error (not enough memory available),
<tt/malloc/ returns <tt/NULL/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_heapadd" name="_heapadd">,
<ref id="_heapblocksize" name="_heapblocksize">,
<ref id="_heapmaxavail" name="_heapmaxavail">,
<ref id="_heapmemavail" name="_heapmemavail">,
<ref id="calloc" name="calloc">,
<ref id="free" name="free">,
<ref id="realloc" name="realloc">,
<ref id="strdup" name="strdup">
<tag/Example/None.
</descrip>
</quote>


<sect1>memchr<label id="memchr"><p>

<quote>
<descrip>
<tag/Function/Search for a character in a block of raw memory.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/void* __fastcall__ strchr (const void* mem, int c, size_t count);/
<tag/Description/The <tt/memchr/ function locates the first occurrence of <tt/c/
(converted to a char) in the block of raw memory string pointed to by <tt/mem/
that is of size <tt/count/. Upon completion, the function returns a pointer to
the character found, or a null pointer if the character was not found.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strchr" name="strchr">
<tag/Example/None.
</descrip>
</quote>


<sect1>memcmp<label id="memcmp"><p>

<quote>
<descrip>
<tag/Function/Compare two memory areas.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/int __fastcall__ memcmp (const void* p1, const void* p2, size_t count);/
<tag/Description/<tt/memcmp/ compares <tt/count/ bytes from the memory area
pointed to by <tt/p1/ into the memory area pointed to by <tt/p2/. It returns a value that is less than
zero if <tt/p1/ is less than <tt/p2/, zero if <tt/p1/ is the same as <tt/p2/,
and a value greater than zero if <tt/p1/ is greater than <tt/p2/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcmp" name="strcmp">,
<ref id="memmove" name="memmove">,
<ref id="memset" name="memset">
<tag/Example/None.
</descrip>
</quote>


<sect1>memcpy<label id="memcpy"><p>

<quote>
<descrip>
<tag/Function/Copy a memory area.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/void* __fastcall__ memcpy (void* dest, const void* src, size_t count);/
<tag/Description/<tt/memcpy/ copies <tt/count/ bytes from the memory area
pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
<tt/dest/.
<tag/Notes/<itemize>
<item>The result is undefined if the memory areas do overlap. Use
<tt/<ref id="memmove" name="memmove">/ to copy overlapping memory areas.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_swap" name="_swap">,
<ref id="memmove" name="memmove">,
<ref id="memset" name="memset">
<tag/Example/None.
</descrip>
</quote>


<sect1>memmove<label id="memmove"><p>

<quote>
<descrip>
<tag/Function/Copy a memory area.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/void* __fastcall__ memmove (void* dest, const void* src, size_t count);/
<tag/Description/<tt/memmove/ copies <tt/count/ bytes from the memory area
pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
<tt/dest/.
<tag/Notes/<itemize>
<item>While <tt/memmove/ allows the memory areas to overlap, it has some
additional overhead compared to <tt/<ref id="memcpy" name="memcpy">/.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_swap" name="_swap">,
<ref id="memcpy" name="memcpy">,
<ref id="memset" name="memset">
<tag/Example/None.
</descrip>
</quote>


<sect1>memset<label id="memset"><p>

<quote>
<descrip>
<tag/Function/Fill a memory area.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/void* __fastcall__ memset (void* p, int val, size_t count);/
<tag/Description/<tt/memset/ fills the memory area pointed to by <tt/p/ with
the value <tt/val/. The function returns <tt/p/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_swap" name="_swap">,
<ref id="bzero" name="bzero">,
<ref id="memcpy" name="memcpy">,
<ref id="memmove" name="memmove">
<tag/Example/None.
</descrip>
</quote>


<sect1>mod_free<label id="mod_free"><p>

<quote>
<descrip>
<tag/Function/Free a relocatable module.
<tag/Header/<tt/<ref id="modload.h" name="modload.h">/
<tag/Declaration/<tt/void __fastcall__ mod_free (void* module);/
<tag/Description/The function will free a module loaded into memory by use of
the <tt/<ref id="mod_load" name="mod_load">/ function.
<tag/Notes/<itemize>
<item>The pointer passed as parameter is the pointer to the module memory,
not the pointer to the control structure.
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mod_load" name="mod_load">
<tag/Example/None.
</descrip>
</quote>


<sect1>mod_load<label id="mod_load"><p>

<quote>
<descrip>
<tag/Function/Load a relocatable module.
<tag/Header/<tt/<ref id="modload.h" name="modload.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ mod_load (struct mod_ctrl* ctrl);/
<tag/Description/The function will load a code module into memory and relocate
it. The function will return an error code. If <tt/MLOAD_OK/ is returned, the
outgoing fields in the passed <tt/mod_ctrl/ struct contain information about
the module just loaded. Possible error codes are:
<itemize>
<item><tt/MLOAD_OK/ - Module load successful
<item><tt/MLOAD_ERR_READ/ - Read error
<item><tt/MLOAD_ERR_HDR/ - Header error
<item><tt/MLOAD_ERR_OS/ - Wrong operating system
<item><tt/MLOAD_ERR_FMT/ - Data format error
<item><tt/MLOAD_ERR_MEM/ - Not enough memory
</itemize>
<tag/Notes/<itemize>
<item>The <url url="ld65.html" name="ld65 linker"> is needed to create
relocatable o65 modules for use with this function.
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mod_free" name="mod_free">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_setbox<label id="mouse_setbox"><p>

<quote>
<descrip>
<tag/Function/Specify a bounding box for the mouse cursor.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/void __fastcall__ mouse_setbox (const struct mouse_box* box);/
<tag/Description/The function allows to set a bounding box for mouse movement.
<tag/Notes/<itemize>
<item>The function does not check if the mouse cursor is currently within the
given rectangle. Placing the mouse cursor within the bounding box is the
responsibility of the programmer.
<item>While the bounding box may be larger than the actual screen size, the
standard mouse cursor draw routines may fail to set the cursor to coordinates
outside of the screen area. Depending on the platform, you may have to supply
your own mouse cursor routines.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_getbox" name="mouse_getbox">,
<ref id="mouse_move" name="mouse_move">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_getbox<label id="mouse_getbox"><p>

<quote>
<descrip>
<tag/Function/Return the current bounding box for the mouse cursor.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/void __fastcall__ mouse_getbox (struct mouse_box* box);/
<tag/Description/The function queries the current bounding box for mouse
movement.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_move" name="mouse_move">,
<ref id="mouse_setbox" name="mouse_setbox">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_buttons<label id="mouse_buttons"><p>

<quote>
<descrip>
<tag/Function/Return a bit mask encoding the state of the mouse buttons.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/unsigned char mouse_buttons (void);/
<tag/Description/The function returns a bit mask that encodes the state of the
mouse buttons. You may use the <tt/MOUSE_BTN_XXX/ flags to decode the function
return value.
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_info" name="mouse_info">,
<ref id="mouse_pos" name="mouse_pos">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_geterrormsg<label id="mouse_geterrormsg"><p>

<quote>
<descrip>
<tag/Function/Return a readable error message for an error code.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/const char* __fastcall__ mouse_geterrormsg (unsigned char
code);/
<tag/Description/The function returns an error message (in english) for the
error code passed parameter.
<tag/Notes/<itemize>
<item>The function will return "Unknown error" for invalid error codes.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_load_driver" name="mouse_load_driver">,
<ref id="mouse_uninstall" name="mouse_uninstall">,
<ref id="mouse_unload" name="mouse_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_hide<label id="mouse_hide"><p>

<quote>
<descrip>
<tag/Function/Hide the mouse pointer.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/void mouse_hide (void);/
<tag/Description/The function hides the mouse pointer. It manages a counter
that is shared between <tt/<ref id="mouse_show" name="mouse_show">/ and
<tt/mouse_hide/ so that every call call to <tt/mouse_hide/ must be followed by
a call to <tt/<ref id="mouse_show" name="mouse_show">/ to make the mouse cursor
visible.
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_show" name="mouse_show">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_info<label id="mouse_info"><p>

<quote>
<descrip>
<tag/Function/Return the state of the mouse buttons and the position of the
mouse.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/void __fastcall__ mouse_info (struct mouse_info* info);/
<tag/Description/The function returns the state of the mouse buttons and the
position of the mouse in the <tt/mouse_info/ structure passed as parameter.
<tag/Notes/<itemize>
<item>The <tt/mouse_info/ struct is a superset of the <tt/mouse_pos/ struct,
so if you just need the mouse position, call <tt/<ref id="mouse_pos"
name="mouse_pos">/ instead.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_buttons" name="mouse_buttons">,
<ref id="mouse_pos" name="mouse_pos">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_install<label id="mouse_install"><p>

<quote>
<descrip>
<tag/Function/Install an already loaded mouse driver.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ mouse_install (const struct
mouse_callbacks* c, void* driver);/
<tag/Description/The function installs an already loaded mouse driver and
returns an error code. The <tt/mouse_callbacks/ structure passed as first
parameter contains pointers to routines needed to move or hide/show the mouse
pointer. Defaults for these routines are supplied by the library, so if you
can live with these defaults (which are platform specific), just pass a
pointer to <tt/mouse_def_callbacks/. The function may be used to install a
driver linked statically to the program.
<tag/Notes/<itemize>
<item>Not all drivers are able to detect if the supported hardware is really
present.
<item>After installing a driver, the mouse cursor is hidden.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_load_driver" name="mouse_load_driver">,
<ref id="mouse_uninstall" name="mouse_uninstall">,
<ref id="mouse_unload" name="mouse_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_ioctl<label id="mouse_ioctl"><p>

<quote>
<descrip>
<tag/Function/Call the driver specific ioctl function.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ mouse_ioctl (unsigned char code, void* data);/
<tag/Description/The function calls the IOCTL entry in the mouse driver,
which is driver specific. The <tt/code/ parameter will choose between
different IOCTL functions, and the <tt/data/ depends on code. The
function returns an error code. The purpose of this function is to allow
for driver specific extensions. See the documentation for a specific mouse
driver for supported ioctl calls.
<tag/Notes/<itemize>
<item>Calling this function is non portable, because each driver may
implement different ioctl calls (or none at all).
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_load_driver<label id="mouse_load_driver"><p>

<quote>
<descrip>
<tag/Function/Load and initialize a mouse driver.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ mouse_load_driver (const struct
mouse_callbacks* c, const char* driver);/
<tag/Description/Load a mouse driver into memory and initialize it. The
function returns an error code that tells if the call has been successful. The
<tt/mouse_callbacks/ structure passed as first parameter contains pointers to
routines needed to move or hide/show the mouse pointer. Defaults for these
routines are supplied by the library, so if you can live with these defaults
(which are platform specific), just pass a pointer to <tt/mouse_def_callbacks/.
<tag/Notes/<itemize>
<item>The driver is loaded by name, so currently you must know the type of
mouse that should be supported. There is no autodetect capability.
<item>Not all drivers are able to detect if the supported hardware is really
present.
<item>After installing a driver, the mouse cursor is hidden.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_install" name="mouse_install">,
<ref id="mouse_uninstall" name="mouse_uninstall">,
<ref id="mouse_unload" name="mouse_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_move<label id="mouse_move"><p>

<quote>
<descrip>
<tag/Function/Move the mouse cursor to a specific position.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/void __fastcall__ mouse_move (int x, int y);/
<tag/Description/The function updates the mouse position. If the mouse cursor
is visible, it is shown at the new position.
<tag/Notes/<itemize>
<item>The function does not check if the new position is within the bounding
box specified with <tt/<ref id="mouse_setbox" name="mouse_setbox">/.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_getbox" name="mouse_getbox">,
<ref id="mouse_setbox" name="mouse_setbox">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_pos<label id="mouse_pos"><p>

<quote>
<descrip>
<tag/Function/Return the position of the mouse.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/void __fastcall__ mouse_pos (struct mouse_pos* pos);/
<tag/Description/The function returns the position of the mouse in the
<tt/mouse_pos/ structure passed as parameter.
<tag/Notes/<itemize>
<item>The <tt/mouse_pos/ struct is a subset of the <tt/mouse_info/ struct,
so if you do also need the mouse buttons, call <tt/<ref id="mouse_info"
name="mouse_info">/ instead.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_buttons" name="mouse_buttons">,
<ref id="mouse_info" name="mouse_info">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_show<label id="mouse_show"><p>

<quote>
<descrip>
<tag/Function/Show the mouse pointer.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/void mouse_show (void);/
<tag/Description/The function shows the mouse pointer. It manages a counter
that is shared between <tt/<ref id="mouse_hide" name="mouse_hide">/ and
<tt/mouse_show/. The mouse cursor is visible if there was one more call to
<tt/mouse_show/ than to <tt/<ref id="mouse_hide" name="mouse_hide">/.
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_hide" name="mouse_hide">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_uninstall<label id="mouse_uninstall"><p>

<quote>
<descrip>
<tag/Function/Uninstall an already loaded mouse driver.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/unsigned char mouse_uninstall (void);/
<tag/Description/The function uninstalls an already loaded mouse driver but
don't removes it from memory.
<tag/Notes/<itemize>
<item>If the driver has been loaded using <tt/<ref id="mouse_load_driver"
name="mouse_load_driver">/, <tt/<ref id="mouse_unload" name="mouse_unload">/
should be used instead of <tt/mouse_uninstall/ so the driver is also removed
from memory.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_install" name="mouse_install">,
<ref id="mouse_load_driver" name="mouse_load_driver">,
<ref id="mouse_unload" name="mouse_unload">
<tag/Example/None.
</descrip>
</quote>


<sect1>mouse_unload<label id="mouse_unload"><p>

<quote>
<descrip>
<tag/Function/Unload a mouse driver.
<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
<tag/Declaration/<tt/unsigned char mouse_unload (void);/
<tag/Description/The function unloads a loaded mouse driver and frees all
memory allocated for the driver.
<tag/Notes/<itemize>
<item>The function does nothing if no driver is loaded.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="mouse_install" name="mouse_install">,
<ref id="mouse_load_driver" name="mouse_load_driver">,
<ref id="mouse_uninstall" name="mouse_uninstall">
<tag/Example/None.
</descrip>
</quote>

<sect1>mul20<label id="mul20"><p>

<quote>
<descrip>
<tag/Function/Multiplies argument by 20.
<tag/Header/<tt/<ref id="cc65.h" name="cc65.h">/
<tag/Declaration/<tt/unsigned int __fastcall__ mul20 (unsigned char value);/
<tag/Description/Speed optimized function to multiply an 8 bit unsigned value by 20 to get a 16 bit result.
<tag/Availability/cc65
</descrip>
</quote>

<sect1>mul40<label id="mul40"><p>

<quote>
<descrip>
<tag/Function/Multiplies argument by 40.
<tag/Header/<tt/<ref id="cc65.h" name="cc65.h">/
<tag/Declaration/<tt/unsigned int __fastcall__ mul40 (unsigned char value);/
<tag/Description/Speed optimized function to multiply an 8 bit unsigned value by 40 to get a 16 bit result.
<tag/Availability/cc65
</descrip>
</quote>

<sect1>offsetof<label id="offsetof"><p>

<quote>
<descrip>
<tag/Function/Calculate the offset of a struct or union member.
<tag/Header/<tt/<ref id="stddef.h" name="stddef.h">/
<tag/Declaration/<tt/size_t offsetof (type, member);/
<tag/Description/<tt/offsetof/ calculates the address offset of a <tt/struct/
or <tt/union/ member.
<tag/Notes/<itemize>
<item>The function is actually a macro.
</itemize>
<tag/Availability/ISO 9899
<tag/Example/None.
</descrip>
</quote>


<sect1>open<label id="open"><p>

<quote>
<descrip>
<tag/Function/Open and possibly create a file.
<tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
<tag/Declaration/<tt/int open (const char* name, int flags, ...);/
<tag/Description/<tt/open/ opens a file and returns the file descriptor
associated with it. On error, -1 is returned and an error code is stored in
<tt/errno/. Several flags may be passed to <tt/open/ that change the behaviour.
<tag/Notes/<itemize>
<item>POSIX specifies an additional <tt/mode/ argument that may be passed to
open, which is used as the permission mask when a new file is created. While
cc65 allows to pass this argument, it is ignored.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="close" name="close">,
<ref id="creat" name="creat">
<tag/Example/None.
</descrip>
</quote>


<sect1>opendir<label id="opendir"><p>

<quote>
<descrip>
<tag/Function/Open a directory.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/DIR* __fastcall__ opendir (const char* name);/
<tag/Description/<tt/opendir/ opens a directory and returns the directory
descriptor associated with it. On error, NULL is returned and an error code is
stored in <tt/errno/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="closedir" name="closedir">,
<ref id="readdir" name="readdir">
<tag/Example/None.
</descrip>
</quote>


<sect1>peekbsys<label id="peekbsys"><p>

<quote>
<descrip>
<tag/Function/Read one byte from a location in the system bank.
<tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
<tt/<ref id="cbm510.h" name="cbm510.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ peekbsys (unsigned addr);/
<tag/Description/<tt/peekbsys/ reads one byte from the given address in the
system bank (bank 15) of the CBM PET-II machines and returns it.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>This function may be a macro depending on the compiler options. The
actual function is accessible by #undef'ing the macro.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="PEEK" name="PEEK">,
<ref id="PEEKW" name="PEEKW">,
<ref id="peekwsys" name="peekwsys">,
<ref id="pokebsys" name="pokebsys">,
<ref id="pokewsys" name="pokewsys">
<tag/Example/None.
</descrip>
</quote>


<sect1>peekwsys<label id="peekwsys"><p>

<quote>
<descrip>
<tag/Function/Read one word from a location in the system bank.
<tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
<tt/<ref id="cbm510.h" name="cbm510.h">/
<tag/Declaration/<tt/unsigned __fastcall__ peekwsys (unsigned addr);/
<tag/Description/<tt/peekwsys/ reads one word from the given address in the
system bank (bank 15) of the CBM PET-II machines and returns it. Following
the usual 6502 conventions, the low byte is read from <tt/addr/, and the
high byte is read from <tt/addr+1/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The order in which the two bytes are read is undefined.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="PEEK" name="PEEK">,
<ref id="PEEKW" name="PEEKW">,
<ref id="peekbsys" name="peekbsys">,
<ref id="pokebsys" name="pokebsys">,
<ref id="pokewsys" name="pokewsys">
<tag/Example/None.
</descrip>
</quote>


<sect1>perror<label id="perror"><p>

<quote>
<descrip>
<tag/Function/Print an error message for the error in <tt/errno/.
<tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
<tag/Declaration/<tt/void __fastcall__ perror (const char* s);/
<tag/Description/<tt/perror/ prints an error message to <tt/stderr/. If <tt/s/
is not <tt/NULL/ and not an empty string, it is printed followed by a colon and
a blank. Then the error message for the current contents of <tt/errno/ is
printed followed by a newline. The message output is the same as returned by
<tt/<ref id="strerror" name="strerror">/ with an argument of <tt/errno/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_poserror" name="_poserror">,
<ref id="strerror" name="strerror">
<tag/Example/None.
</descrip>
</quote>


<sect1>pokebsys<label id="pokebsys"><p>

<quote>
<descrip>
<tag/Function/Write one byte to a location in the system bank.
<tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
<tt/<ref id="cbm510.h" name="cbm510.h">/
<tag/Declaration/<tt/void __fastcall__ pokebsys (unsigned addr, unsigned char val);/
<tag/Description/<tt/pokebsys/ writes one byte to the given address in the
system bank (bank 15) of the CBM PET-II machines.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="POKE" name="POKE">,
<ref id="POKEW" name="POKEW">,
<ref id="peekbsys" name="peekbsys">,
<ref id="peekwsys" name="peekwsys">,
<ref id="pokewsys" name="pokewsys">
<tag/Example/None.
</descrip>
</quote>


<sect1>pokewsys<label id="pokewsys"><p>

<quote>
<descrip>
<tag/Function/Write one word to a location in the system bank.
<tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
<tt/<ref id="cbm510.h" name="cbm510.h">/
<tag/Declaration/<tt/void __fastcall__ pokewsys (unsigned addr, unsigned val);/
<tag/Description/<tt/pokewsys/ writes one word to the given address in the
system bank (bank 15) of the CBM PET-II machines. Following the usual 6502
conventions, the low byte of <tt/val/ is written to <tt/addr/, and the
high byte is written to <tt/addr+1/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The order in which the two bytes are written is undefined.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="POKE" name="POKE">,
<ref id="POKEW" name="POKEW">,
<ref id="peekbsys" name="peekbsys">,
<ref id="peekwsys" name="peekwsys">,
<ref id="pokebsys" name="pokebsys">
<tag/Example/None.
</descrip>
</quote>


<sect1>psg_delay<label id="psg_delay"><p>

<quote>
<descrip>
<tag/Function/Delay for a short period of time.
<tag/Header/<tt/<ref id="creativision.h" name="creativision.h">/
<tag/Declaration/<tt/void __fastcall__ psg_delay (unsigned char b);/
<tag/Description/The function specifies how long each note or pause between
notes should last.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="psg_outb" name="psg_outb">,
<ref id="psg_silence" name="psg_silence">
<tag/Example/None.
</descrip>
</quote>


<sect1>psg_outb<label id="psg_outb"><p>

<quote>
<descrip>
<tag/Function/Output a byte to the PSG.
<tag/Header/<tt/<ref id="creativision.h" name="creativision.h">/
<tag/Declaration/<tt/void __fastcall__ psg_outb (unsigned char b);/
<tag/Description/The function sends a byte to the Programmable Sound
Generator, then waits for the PSG to acknowledge.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="psg_delay" name="psg_delay">,
<ref id="psg_silence" name="psg_silence">
<tag/Example/<verb>
#include <creativision.h>
void main (void)
{
  psg_outb (0x80); // Latch frequency
  psg_outb (0x07); // Frequency byte 2
  psg_outb (0x90); // Channel 0 full volume
  psg_delay (100);
  psg_silence ();
}
</verb>
</descrip>
</quote>


<sect1>psg_silence<label id="psg_silence"><p>

<quote>
<descrip>
<tag/Function/Set volume off on each PSG channel.
<tag/Header/<tt/<ref id="creativision.h" name="creativision.h">/
<tag/Declaration/<tt/void psg_silence (void);/
<tag/Description/The function resets the Programmable Sound Generator,
then sends $9F, $BF, $DF, $FF to the PSG.
<tag/Availability/cc65
<tag/See also/
<ref id="psg_delay" name="psg_delay">,
<ref id="psg_outb" name="psg_outb">
<tag/Example/None.
</descrip>
</quote>


<sect1>qsort<label id="qsort"><p>

<quote>
<descrip>
<tag/Function/Sort an array.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void __fastcall__ qsort (void* base, size_t count,
size_t size, int __fastcall__ (* compare) (const void*, const void*));/
<tag/Description/<tt/qsort/ sorts an array according to a given compare
function <tt/compare/. <tt/base/ is the address of the array, <tt/count/
is the number of elements, <tt/size/ the size of an element and <tt/compare/
the function used to compare the members.
<tag/Notes/<itemize>
<item>If there are multiple members with the same key, the order after calling
the function is undefined.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The function to which <tt/compare/ points must have the <tt/fastcall/
calling convention.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="bsearch" name="bsearch">
<tag/Example/None.
</descrip>
</quote>


<sect1>raise<label id="raise"><p>

<quote>
<descrip>
<tag/Function/Send a signal to the executing program.
<tag/Header/<tt/<ref id="signal.h" name="signal.h">/
<tag/Declaration/<tt/int __fastcall__ raise (int sig);/
<tag/Description/<tt/raise()/ sends the given signal to the program. If the
program has installed a signal handler for the signal, this signal handler
will be executed. If no handler has been installed, the default action for
the raised signal will be taken. The function returns zero on success,
non-zero otherwise.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function,
so it may be used only in the presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="abort" name="abort">,
<ref id="assert" name="assert">,
<ref id="signal" name="signal">
<tag/Example/None.
</descrip>
</quote>


<sect1>rand<label id="rand"><p>

<quote>
<descrip>
<tag/Function/Return a pseudo random number.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/int rand (void);/
<tag/Description/The function returns a pseudo random number
between 0 and <tt/RAND_MAX/ (exclusive).
<tag/Notes/<itemize>
<item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
flow of numbers is generated.
<item>On startup, the function behaves as if <ref id="srand" name="srand">
had been used with an argument of 1.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_randomize" name="_randomize">,
<ref id="srand" name="srand">
<tag/Example/None.
</descrip>
</quote>


<sect1>readdir<label id="readdir"><p>

<quote>
<descrip>
<tag/Function/Read a directory.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/struct dirent* __fastcall__ readdir (DIR* dir);/
<tag/Description/<tt/readdir/ reads the next directory entry from the directory
stream pointed to by <tt/dir/. It stores the data in a <tt/dirent/ structure
and returns a pointer to it. If the end of directory is reached, or an error
occurs, NULL is returned. In case of errors, an error code is stored into
<tt/errno/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The returned pointer may point to a statically allocated instance of
<tt/struct dirent/, so it may get overwritten by subsequent calls to
<tt/readdir/.
<item>On several platforms, namely the CBMs and the Atari, the disk drives get
confused when opening/closing files between directory reads. So for example a
program that reads the list of files on a disk, and after each call to
<tt/readdir/, opens the file to process it, will fail.<newline>
Possible solutions are reading the directory into memory before processing the
file list, or to reset the directory by seeking to the correct position after
opening/closing a file:
<verb>
        seekdir (DIR, telldir (DIR));
</verb>
Platforms known to work without problems are: Apple.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="closedir" name="closedir">,
<ref id="opendir" name="opendir">
<tag/Example/None.
</descrip>
</quote>


<sect1>realloc<label id="realloc"><p>

<quote>
<descrip>
<tag/Function/Change the size of an allocated memory block.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
<tag/Description/<tt/realloc/ changes the size of the memory block pointed to
by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
behaves as if <tt/free/ had been called. On error (not enough memory
available), <tt/realloc/ returns <tt/NULL/.
<tag/Notes/<itemize>
<item>The part of the memory block that is returned will have its contents
unchanged.
<item>This function is somewhat dangerous to use. Be careful to save the
pointer you're passing somewhere else, otherwise
<tscreen><verb>
        ptr = realloc (ptr, size);
</verb></tscreen>
will lose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_heapadd" name="_heapadd">,
<ref id="_heapblocksize" name="_heapblocksize">,
<ref id="_heapmaxavail" name="_heapmaxavail">,
<ref id="_heapmemavail" name="_heapmemavail">,
<ref id="calloc" name="calloc">,
<ref id="free" name="free">,
<ref id="realloc" name="realloc">
<tag/Example/None.
</descrip>
</quote>


<sect1>remove<label id="remove"><p>

<quote>
<descrip>
<tag/Function/Delete a file.
<tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
<tag/Declaration/<tt/int __fastcall__ remove (const char* name);/
<tag/Description/<tt/remove/ deletes the file with the given name. On success,
zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
code describing the reason for the failure.
<tag/Notes/<itemize>
<item>This function is not available on all cc65 targets (depends on the
availability of file I/O).
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="rename" name="rename">,
<ref id="unlink" name="unlink">
<tag/Example/
<verb>
#include &lt;stdio.h&gt;

#define FILENAME "helloworld"

if (remove (FILENAME) == 0) {
    printf ("We deleted %s successfully\n", FILENAME);
} else {
    printf ("There was a problem deleting %s\n", FILENAME);
}
</verb>
</descrip>
</quote>


<sect1>rename<label id="rename"><p>

<quote>
<descrip>
<tag/Function/Rename a file.
<tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
<tag/Declaration/<tt/int __fastcall__ rename (const char* oldname, const char* newname);/
<tag/Description/<tt/rename/ renames a file (gives it a new name). On success,
zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
code describing the reason for the failure.
<tag/Notes/<itemize>
<item>This function is not available on all cc65 targets (depends on the
capabilities of the storage devices).
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="remove" name="remove">
<tag/Example/
<verb>
#include &lt;stdio.h&gt;

#define OLDNAME "textfile.txt"
#define NEWNAME "textfile.bak"

if (rename (OLDNAME, NEWNAME) == 0) {
    printf ("Renamed %s to %s\n", OLDNAME, NEWNAME);
} else {
    printf ("Error renaming %s to %s\n", OLDNAME, NEWNAME);
}
</verb>
</descrip>
</quote>


<sect1>reset_brk<label id="reset_brk"><p>

<quote>
<descrip>
<tag/Function/Resets the break vector to its original value.
<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
<tag/Declaration/<tt/void reset_brk (void);/
<tag/Description/<tt/reset_brk/ resets the break vector to the value it had
before a call to <tt/set_brk/.
<tag/Notes/<itemize>
<item>The break vector is reset on program termination, so it's not strictly
necessary to call this function as a part of your clean-up when exiting the program.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="reset_irq" name="reset_irq">,
<ref id="set_brk" name="set_brk">,
<ref id="set_irq" name="set_irq">
<tag/Example/None.
</descrip>
</quote>


<sect1>reset_irq<label id="reset_irq"><p>

<quote>
<descrip>
<tag/Function/Resets the C level interrupt request vector.
<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
<tag/Declaration/<tt/void reset_irq (void);/
<tag/Description/<tt/reset_irq/ resets the C level interrupt request vector.
<tag/Notes/<itemize>
<item>The interrupt vector is reset on program termination, so it's not strictly
necessary to call this function as a part of your clean-up when exiting the program.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="reset_brk" name="reset_brk">,
<ref id="set_brk" name="set_brk">,
<ref id="set_irq" name="set_irq">
<tag/Example/None.
</descrip>
</quote>


<sect1>revers<label id="revers"><p>

<quote>
<descrip>
<tag/Function/Control revers character display.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
<tag/Description/If the argument is non zero, the function enables reverse
character display. If the argument is zero, reverse character display is
switched off. The old value of the setting is returned.
<tag/Notes/<itemize>
<item>The function may not be supported by the hardware, in which case
the call is ignored.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="textcolor" name="textcolor">
<tag/Example/None.
</descrip>
</quote>


<sect1>rewinddir<label id="rewinddir"><p>

<quote>
<descrip>
<tag/Function/Reset a directory stream.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/void __fastcall__ rewinddir (DIR* dir);/
<tag/Description/<tt/rewinddir/ sets the position of the directory stream
pointed to by <tt/dir/ to the start of the directory.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="seekdir" name="seekdir">,
<ref id="telldir" name="telldir">
<tag/Example/None.
</descrip>
</quote>


<sect1>screensize<label id="screensize"><p>

<quote>
<descrip>
<tag/Function/Return the dimensions of the text mode screen.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
<tag/Description/The function returns the dimensions of the text mode screen.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="gotox" name="gotox">,
<ref id="gotoxy" name="gotoxy">,
<ref id="gotoy" name="gotoy">,
<ref id="wherex" name="wherex">,
<ref id="wherey" name="wherey">
<tag/Example/None.
</descrip>
</quote>


<sect1>seekdir<label id="seekdir"><p>

<quote>
<descrip>
<tag/Function/Set the position of a directory stream.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/void __fastcall__ seekdir (DIR* dir, long offset);/
<tag/Description/<tt/seekdir/ sets the position of the directory stream
pointed to by <tt/dir/ to the value given in <tt/offset/, which should be a
value returned by <tt/<ref id="telldir" name="telldir">/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="rewinddir" name="rewinddir">,
<ref id="telldir" name="telldir">
<tag/Example/None.
</descrip>
</quote>


<sect1>ser_close<label id="ser_close"><p>

<quote>
<descrip>
<tag/Function/Close the port and disable interrupts
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned char ser_close (void);/
<tag/Description/Close the port by clearing buffers and disable interrupts.
<tag/Availability/cc65
<tag/See also/Other serial functions.
<tag/Example/
<verb>
#include <serial.h>

static void initialize(){
  struct ser_params params = {
    SER_BAUD_9600,
    SER_BITS_8,
    SER_STOP_1,
    SER_PAR_MARK,
    SER_HS_NONE
  };
  ser_install(lynx_comlynx); // This will activate the ComLynx
  CLI();
  ser_open(&amp;params);
}
</verb>
</descrip>
</quote>


<sect1>ser_get<label id="ser_get"><p>

<quote>
<descrip>
<tag/Function/Read a character from serial port.
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ ser_get (char* b);/
<tag/Description/Get a character from the serial port. If no characters are
available, the function will return SER_ERR_NO_DATA, so this is not a fatal
error.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/Other serial functions.
<tag/Example/
Wait for a character to be available from a serial port.
<verb>
char ch;
while (ser_get(&amp;ch) == SER_ERR_NO_DATA)
  ;
</verb>
</descrip>
</quote>


<sect1>ser_install<label id="ser_install"><p>

<quote>
<descrip>
<tag/Function/Install an already loaded driver and return an error code.
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ ser_install (const void* driver);/
<tag/Description/The function installs a driver that was already loaded into
memory (or linked statically to the program). It returns an error code
(<tt/SER_ERR_OK/ in case of success).
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="ser_load_driver" name="ser_load_driver">,
<ref id="ser_uninstall" name="ser_uninstall">,
<ref id="ser_unload" name="ser_unload">
<tag/Example/<verb>
ser_install(lynx_comlynx); //Include the driver statically instead of loading it.
</verb>
</descrip>
</quote>


<sect1>ser_ioctl<label id="ser_ioctl"><p>

<quote>
<descrip>
<tag/Function/Platform dependent code extensions.
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned __fastcall__ ser_ioctl (unsigned char code, void* data);/
<tag/Description/Some platforms have extra serial functions that are not
supported by standard serial driver functions. You can extend the driver to support
this extra functionality bt using ser_ioctl functions.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>These functions are not easily portable to other cc65 platforms.
</itemize>
<tag/Availability/cc65
<tag/See also/Other serial functions.
<tag/Example/None
</descrip>
</quote>

<sect1>ser_load_driver<label id="ser_load_driver"><p>

<quote>
<descrip>
<tag/Function/Load and install a serial driver.
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ ser_load_driver (const char *name);/
<tag/Description/Load and install the driver by name.
Will just load the driver and check if loading was successful.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/Other serial functions.
<tag/Example/None.
</descrip>
</quote>


<sect1>ser_open<label id="ser_open"><p>

<quote>
<descrip>
<tag/Function/Open the port by setting the port parameters and enable interrupts
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ ser_open (const struct ser_params* params);/
<tag/Description/Open the port by setting the port parameters and enable interrupts.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/Other serial functions.
<tag/Example/
<verb>
#include <serial.h>

static void initialize(){
  struct ser_params params = {
    SER_BAUD_9600,
    SER_BITS_8,
    SER_STOP_1,
    SER_PAR_MARK,
    SER_HS_NONE
  };
  ser_install(lynx_comlynx); // This will activate the ComLynx
  CLI();
  ser_open(&amp;params);
}
</verb>
</descrip>
</quote>


<sect1>ser_put<label id="ser_put"><p>

<quote>
<descrip>
<tag/Function/Write a character to a serial port.
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ ser_put (char b);/
<tag/Description/Send a character via the serial port. There is a transmit
buffer, but transmitting is not done via interrupt. The function returns
SER_ERR_OVERFLOW if there is no space left in the transmit buffer.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/Other serial functions.
<tag/Example/
<verb>
ser_put('A');
</verb>
</descrip>
</quote>


<sect1>ser_status<label id="ser_status"><p>

<quote>
<descrip>
<tag/Function/Return the serial port status.
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ ser_status (unsigned char* status);/
<tag/Description/Return the serial port status.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/Other serial functions.
<tag/Example/None
</descrip>
</quote>


<sect1>ser_uninstall<label id="ser_uninstall"><p>

<quote>
<descrip>
<tag/Function/Uninstall the currently loaded driver but do not unload it.
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned char ser_uninstall (void);/
<tag/Description/Uninstall the currently loaded driver but do not unload it.
<tag/Availability/cc65
<tag/See also/Other serial functions.
<tag/Example/None.
</descrip>
</quote>

<sect1>ser_unload<label id="ser_unload"><p>

<quote>
<descrip>
<tag/Function/Uninstall, then unload the currently loaded driver.
<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
<tag/Declaration/<tt/unsigned char ser_unload (void);/
<tag/Description/Uninstall, then unload the currently loaded driver.
<tag/Availability/cc65
<tag/See also/Other serial functions.
<tag/Example/None.
</descrip>
</quote>


<sect1>set_brk<label id="set_brk"><p>

<quote>
<descrip>
<tag/Function/Set the break vector to a user function.
<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
<tag/Declaration/<tt/void __fastcall__ set_brk (brk_handler func);/
<tag/Description/<tt/set_brk/ allows a user program to handle breaks within the
program code by letting the vector point to a user written C function. The
runtime library installs a small stub that saves the registers into global
variables that may be accessed (and changed) by the break handler.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The stub saves the zero page registers used by the C runtime and switches
to a small break handler stack. This means that it is safe to execute C code,
even if C code was interrupted. Be careful however not to use too many local
variables, and do not enable stack checks for the handler function or any other
function called from it.
<item>The <tt/brk_pc/ variable points to the <tt/BRK/ instruction. If you want
the continue with the interrupted code, you have to adjust <tt/brk_pc/,
otherwise the <tt/BRK/ instruction will get executed over and over again.
<item>The break vector is reset on program termination, so it's not strictly
necessary to call <tt/<ref id="reset_brk" name="reset_brk">/ as a part of your
clean-up when exiting the program.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="reset_brk" name="reset_brk">
<tag/Example/None.
</descrip>
</quote>


<sect1>set_irq<label id="set_irq"><p>

<quote>
<descrip>
<tag/Function/Set the C level interrupt request vector to the given address.
<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
<tag/Declaration/<tt/void __fastcall__ set_irq (irq_handler f, void *stack_addr, size_t stack_size);/
<tag/Description/<tt/set_irq/ allows a user program to handle interrupt requests
(IRQs) within the program code by letting the vector point to a user written C
function. The runtime library installs a small stub that saves the zero page
registers used by the C runtime before calling the handler function and restores
them after the handler function returns. Additionally the stub temporarily switches
the C runtime stack to the stack area provided as parameter. If the handler function
was set up to handle a "private", "exclusive" interrupt request source it must
return the value <tt/IRQ_HANDLED/ if and only if it has verified that the current
interrupt request actually stems from that source. In all other cases it must return
the value <tt/IRQ_NOT_HANDLED/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The stub saves the registers and zero page locations used by the C runtime
and switches to the provided stack area. As a consequence, there is some
runtime overhead, but it it is safe to execute C code, even if other C code
was interrupted. Be careful however not to call C library functions, and do not
enable stack checks for the handler function or any other function called from
it.
<item>The interrupt vector is reset on program termination, so it's not strictly
necessary to call <tt/<ref id="reset_irq" name="reset_irq">/ as a part of your
clean-up when exiting the program.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="reset_brk" name="reset_brk">,
<ref id="reset_irq" name="reset_irq">,
<ref id="set_brk" name="set_brk">
<tag/Example/None.
</descrip>
</quote>


<sect1>set_c128_speed<label id="set_c128_speed"><p>

<quote>
<descrip>
<tag/Function/Set the current speed of a C128 CPU.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ set_c128_speed (unsigned char speed);/
<tag/Description/The function returns the speed after trying to set the speed of the C128 CPU.
<tag/Notes/<itemize>
<item>The function is specific to the C64 and C128.
<item>The function does not check if the C128 CPU is the current CPU.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_c128" name="detect_c128">,
<ref id="get_c128_speed" name="get_c128_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>set_c64dtv_speed<label id="set_c64dtv_speed"><p>

<quote>
<descrip>
<tag/Function/Set the current speed of the C64DTV.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ set_c64dtv_speed (unsigned char speed);/
<tag/Description/The function returns the speed after trying to set the speed of the C64DTV.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
<item>The function does not check for the presence of the C64DTV.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_c64dtv" name="detect_c64dtv">,
<ref id="get_c64dtv_speed" name="get_c64dtv_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>set_c65_speed<label id="set_c65_speed"><p>

<quote>
<descrip>
<tag/Function/Set the current speed of the C65/C64DX in C64 mode.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ set_c65_speed (unsigned char speed);/
<tag/Description/The function returns the speed after trying to set the speed of the C65/C64DX in C64 mode.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
<item>The function does not check for the presence of a C65/C64DX in C64 mode.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_c65" name="detect_c65">,
<ref id="get_c65_speed" name="get_c65_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>set_chameleon_speed<label id="set_chameleon_speed"><p>

<quote>
<descrip>
<tag/Function/Set the current speed of the C64 Chameleon cartridge.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ set_chameleon_speed (unsigned char speed);/
<tag/Description/The function returns the speed after trying to set the speed of the C64 Chameleon cartridge.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
<item>The function does not check for the presence of the C64 Chameleon cartridge.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_chameleon" name="detect_chameleon">,
<ref id="get_chameleon_speed" name="get_chameleon_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>set_scpu_speed<label id="set_scpu_speed"><p>

<quote>
<descrip>
<tag/Function/Set the current speed of the C64/C128 SuperCPU cartridge.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ set_scpu_speed (unsigned char speed);/
<tag/Description/The function returns the speed after trying to set the speed of the SuperCPU cartridge.
<tag/Notes/<itemize>
<item>The function is specific to the C128 and C64.
<item>The function does not check for the presence of the cartridge.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_scpu" name="detect_scpu">,
<ref id="get_scpu_speed" name="get_scpu_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>set_turbomaster_speed<label id="set_turbomaster_speed"><p>

<quote>
<descrip>
<tag/Function/Set the current speed of the C64 Turbo Master cartridge.
<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ set_turbomaster_speed (unsigned char speed);/
<tag/Description/The function returns the speed after trying to set the speed of the C64 Turbo Master cartridge.
<tag/Notes/<itemize>
<item>The function is specific to the C64.
<item>The function does not check for the presence of the C64 Turbo Master cartridge.
<item>See the accelerator.h header for the speed definitions.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="detect_turbomaster" name="detect_turbomaster">,
<ref id="get_turbomaster_speed" name="get_turbomaster_speed">,
<tag/Example/None.
</descrip>
</quote>


<sect1>setjmp<label id="setjmp"><p>

<quote>
<descrip>
<tag/Function/Save the context for use with <tt/longjmp/.
<tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
<tag/Declaration/<tt/int __fastcall__ setjmp (jmp_buf buf);/
<tag/Description/The <tt/setjmp/ function saves the current context in <tt/buf/
for subsequent use by the <tt/<ref id="longjmp" name="longjmp">/ function and
returns zero.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item><tt/setjmp/ is actually a macro as required by the ISO standard.
<item><tt/setjmp/ will not save the signal context.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="longjmp" name="longjmp">
<tag/Example/None.
</descrip>
</quote>


<sect1>setlocale<label id="setlocale"><p>

<quote>
<descrip>
<tag/Function/Selects a locale.
<tag/Header/<tt/<ref id="locale.h" name="locale.h">/
<tag/Declaration/<tt/char* __fastcall__ setlocale (int category, const char* locale);/
<tag/Description/<tt/setlocale/ sets or queries the program's locale.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>cc65 supports only the "C" locale, so calling this function to set a
different locale has no effect.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="localeconv" name="localeconv">,
<ref id="strcoll" name="strcoll">
<ref id="strxfrm" name="strxfrm">
<tag/Example/None.
</descrip>
</quote>


<sect1>signal<label id="signal"><p>

<quote>
<descrip>
<tag/Function/Install a signal handler.
<tag/Header/<tt/<ref id="signal.h" name="signal.h">/
<tag/Declaration/<tt/__sigfunc __fastcall__ signal (int sig, __sigfunc func);/
<tag/Description/<tt/signal/ installs a handler for the given signal. The
handler may either be a user supplied function, or one of the predefined
signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
previous value if the signal , or the special function vector SIG_ERR in
case of an error.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="abort" name="abort">,
<ref id="assert" name="assert">,
<ref id="raise" name="raise">
<tag/Example/None.
</descrip>
</quote>


<sect1>sleep<label id="sleep"><p>

<quote>
<descrip>
<tag/Function/Sleep for a specified amount of time.
<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
<tag/Declaration/<tt/void __fastcall__ sleep (unsigned seconds);/
<tag/Description/The function will return after the specified number of
seconds have elapsed.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/Example/None.
</descrip>
</quote>


<sect1>slow<label id="slow"><p>

<quote>
<descrip>
<tag/Function/Switch the CPU into slow mode (C128: 1MHz mode, C16/Plus4: single clock mode).
<tag/Header/<tt/<ref id="c128.h" name="c128.h">,
<ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
<tag/Declaration/<tt/void slow (void);/
<tag/Description/The function will switch the clock of the CPU to slow mode. for the C128
target it means switching the CPU into 1MHz mode. for the C16/Plus4 target it means
switching the CPU into single clock mode.
<tag/Notes/<itemize>
<item>The function is specific to the C128, C16 and Plus4.
</itemize>
<tag/Availability/cc65 (not all platforms)
<tag/See also/
<ref id="fast" name="fast">,
<ref id="isfast" name="isfast">,
<tag/Example/None.
</descrip>
</quote>

<sect1>srand<label id="srand"><p>

<quote>
<descrip>
<tag/Function/Initialize the pseudo random number generator.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
<tag/Description/The function initializes the random number generator using
the given seed. On program startup, the generator behaves as if <tt/srand/ has
been called with an argument of 1.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_randomize" name="_randomize">,
<ref id="rand" name="rand">
<tag/Example/None.
</descrip>
</quote>


<sect1>strcasecmp<label id="strcasecmp"><p>

<quote>
<descrip>
<tag/Function/Compare two strings case insensitive.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/int __fastcall__ strcasecmp (const char* s1, const char* s2);/
<tag/Description/The <tt/strcasecmp/ function compares the two strings passed
as parameters without case sensitivity. It returns a value that is less than
zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The function is not available in strict ANSI mode.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="strcmp" name="strcmp">,
<ref id="strcoll" name="strcoll">,
<ref id="stricmp" name="stricmp">,
<ref id="strncmp" name="strncmp">,
<ref id="strxfrm" name="strxfrm">
<tag/Example/None.
</descrip>
</quote>


<sect1>strcat<label id="strcat"><p>

<quote>
<descrip>
<tag/Function/Concatenate two strings.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
<tag/Description/The <tt/strcat/ function appends a copy of the string
pointed to by s2 (including the terminating null byte) to the end of the
string pointed to by s1. The initial byte of s2 overwrites the null byte at
the end of s1.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>If copying takes place between objects that overlap, the behaviour
is undefined.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcpy" name="strcpy">,
<ref id="strncat" name="strncat">,
<ref id="strncpy" name="strncpy">
<tag/Example/None.
</descrip>
</quote>


<sect1>strchr<label id="strchr"><p>

<quote>
<descrip>
<tag/Function/Search for a character in a string.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
<tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
(converted to a char) in the string pointed to by <tt/s/. The terminating null
byte is considered to be part of the string. Upon completion, the function
returns a pointer to the byte, or a null pointer if the byte was not found.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="memchr" name="memchr">,
<ref id="strrchr" name="strrchr">
<tag/Example/None.
</descrip>
</quote>


<sect1>strcmp<label id="strcmp"><p>

<quote>
<descrip>
<tag/Function/Compare two strings.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/int __fastcall__ strcmp (const char* s1, const char* s2);/
<tag/Description/The <tt/strcmp/ function compares the two strings passed as
parameters. It returns a value that is less than zero if <tt/s1/ is less than
<tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater than zero
if <tt/s1/ is greater than <tt/s2/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcasecmp" name="strcasecmp">,
<ref id="strcoll" name="strcoll">,
<ref id="stricmp" name="stricmp">,
<ref id="strncmp" name="strncmp">
<ref id="strxfrm" name="strxfrm">
<tag/Example/None.
</descrip>
</quote>


<sect1>strcoll<label id="strcoll"><p>

<quote>
<descrip>
<tag/Function/Compare two strings.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/int __fastcall__ strcoll (const char* s1, const char* s2);/
<tag/Description/The <tt/strcoll/ function compares the two strings passed as
parameters, according to the collating sequence set by <tt/<ref id="setlocale"
name="setlocale">/. It returns a value that is less than zero if <tt/s1/ is
less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater
than zero if <tt/s1/ is greater than <tt/s2/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="setlocale" name="setlocale">,
<ref id="strcasecmp" name="strcasecmp">,
<ref id="strcmp" name="strcmp">,
<ref id="stricmp" name="stricmp">,
<ref id="strncmp" name="strncmp">,
<ref id="strxfrm" name="strxfrm">
<tag/Example/None.
</descrip>
</quote>


<sect1>strcpy<label id="strcpy"><p>

<quote>
<descrip>
<tag/Function/Copy a string.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
<tag/Description/The <tt/strcpy/ function copies the string pointed to by
<tt/s2/ (including the terminating null byte) into the array pointed to by
<tt/s1/. The function will always return <tt/s1/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>If copying takes place between objects that overlap, the behaviour
is undefined.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcat" name="strcat">,
<ref id="strncat" name="strncat">,
<ref id="strncpy" name="strncpy">
<tag/Example/
<verb>
#include &lt;string.h&gt;

static char hello[14];

strcpy (hello, "Hello world!\n");
</verb>
</descrip>
</quote>


<sect1>strcspn<label id="strcspn"><p>

<quote>
<descrip>
<tag/Function/Compute the length of a substring.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/size_t __fastcall__ strcspn (const char* s, const char* set);/
<tag/Description/The <tt/strcspn/ function computes and returns the length of
the substring pointed to by <tt/s/ which does <em>not</em> consist of
characters contained in the string <tt/set/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strpbrk" name="strpbrk">,
<ref id="strqtok" name="strqtok">,
<ref id="strspn" name="strspn">,
<ref id="strstr" name="strstr">,
<ref id="strtok" name="strtok">
<tag/Example/None.
</descrip>
</quote>


<sect1>strdup<label id="strdup"><p>

<quote>
<descrip>
<tag/Function/Allocate a copy of a string on the heap.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strdup (const char* s);/
<tag/Description/<tt/strdup/ allocates a memory block on the heap, big enough
to hold a copy of <tt/s/ including the terminating zero. If the allocation
fails, <tt/NULL/ is returned, otherwise <tt/s/ is copied into the allocated
memory block, and a pointer to the block is returned.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>It is up to the caller to free the allocated memory block.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="free" name="free">,
<ref id="malloc" name="malloc">
<tag/Example/None.
</descrip>
</quote>


<sect1>strerror<label id="strerror"><p>

<quote>
<descrip>
<tag/Function/Return a string describing an error code.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strerror (int errcode);/
<tag/Description/The <tt/strerror/ function returns a string describing the
given error code. If an invalid error code is passed, the string "Unknown
error" is returned, and <tt/errno/ is set to <tt/EINVAL/. In all other cases,
<tt/errno/ is left untouched.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>While the return type of the function is a <tt/char*/, the returned
string must not be modified by the caller!
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="_stroserror" name="_stroserror">
<tag/Example/None.
</descrip>
</quote>


<sect1>stricmp<label id="stricmp"><p>

<quote>
<descrip>
<tag/Function/Compare two strings case insensitive.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/int __fastcall__ stricmp (const char* s1, const char* s2);/
<tag/Description/The <tt/stricmp/ function compares the two strings passed as
parameters without case sensitivity. It returns a value that is less than zero
if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
value greater than zero if <tt/s1/ is greater than <tt/s2/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The function is not available in strict ANSI mode.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="strcasecmp" name="strcasecmp">,
<ref id="strcmp" name="strcmp">,
<ref id="strcoll" name="strcoll">,
<ref id="strncmp" name="strncmp">,
<ref id="strxfrm" name="strxfrm">
<tag/Example/None.
</descrip>
</quote>


<sect1>strlen<label id="strlen"><p>

<quote>
<descrip>
<tag/Function/Return the length of a string.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
<tag/Description/The <tt/strlen/ function computes the number of bytes in the
string to which s points, not including the terminating null byte.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>When compiling with <tt/-Os/ (inline known standard functions), the
function does not work correctly for strings with more than 255 characters.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcpy" name="strcpy">
<tag/Example/None.
</descrip>
</quote>


<sect1>strlower<label id="strlower"><p>

<quote>
<descrip>
<tag/Function/Make a string lower case.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
<tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
function to each character of a string. The function will always return <tt/s/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The function prototype is unavailable when compiling in strict ANSI mode.
<item>An alias name for this function is <tt/strlwr/.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="strupper" name="strupper">,
<ref id="tolower" name="tolower">
<tag/Example/None.
</descrip>
</quote>


<sect1>strlwr<label id="strlwr"><p>

<quote>
See <tt/strlower/.
</quote>


<sect1>strncasecmp<label id="strncasecmp"><p>

<quote>
<descrip>
<tag/Function/Compare two strings case insensitive.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/int __fastcall__ strncasecmp (const char* s1, const char* s2, size_t count);/
<tag/Description/The <tt/strncasecmp/ function compares the two strings passed
as parameters without case sensitivity. It returns a value that is less than
zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The function is not available in strict ANSI mode.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="strcmp" name="strcmp">,
<ref id="strcoll" name="strcoll">,
<ref id="stricmp" name="stricmp">,
<ref id="strncmp" name="strncmp">,
<ref id="strxfrm" name="strxfrm">
<tag/Example/None.
</descrip>
</quote>


<sect1>strncat<label id="strncat"><p>

<quote>
<descrip>
<tag/Function/Concatenate two strings.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strncat (char* s1, const char* s2, size_t n);/
<tag/Description/The <tt/strncat/ function appends not more than n characters
of the string pointed to by s2 to the end of the string pointed to by s1. The
terminating null character at the end of s1 is overwritten. A terminating null
character is appended to the result, even if not all of s2 is appended to s1.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>If copying takes place between objects that overlap, the behaviour
is undefined.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcpy" name="strcpy">,
<ref id="strncat" name="strncat">,
<ref id="strncpy" name="strncpy">
<tag/Example/None.
</descrip>
</quote>


<sect1>strncmp<label id="strncmp"><p>

<quote>
<descrip>
<tag/Function/Compare two strings.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/int __fastcall__ strncmp (const char* s1, const char* s2, size_t count);/
<tag/Description/The <tt/strncmp/ function compares not more than <tt/count/
characters of the two strings passed as parameters. It returns a value that is
less than zero if the first <tt/count/ characters of <tt/s1/ are less than
<tt/s2/, zero if they are identical, and a value greater than zero they are
greater.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcasecmp" name="strcasecmp">,
<ref id="strcmp" name="strcmp">,
<ref id="strcoll" name="strcoll">,
<ref id="stricmp" name="stricmp">,
<ref id="strxfrm" name="strxfrm">
<tag/Example/None.
</descrip>
</quote>


<sect1>strncpy<label id="strncpy"><p>

<quote>
<descrip>
<tag/Function/Copy part of a string.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strncpy (char* s1, const char* s2, size_t n);/
<tag/Description/The <tt/strncpy/ function copies not more than <tt/n/ bytes from
the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
pointed to by <tt/s2/ is a string that is shorter than <tt/n/ bytes, null bytes are
appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
written. The function always will return <tt/s1/.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
<item>If there is no null byte in the first <tt/n/ bytes of the array pointed
to by <tt/s2/, the result is <em/not/ null-terminated!
<item>If copying takes place between objects that overlap, the behaviour is
undefined.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="memcpy" name="memcpy">,
<ref id="strcat" name="strcat">,
<ref id="strcpy" name="strcpy">,
<ref id="strncat" name="strncat">
<tag/Example/
<verb>
#include <string.h>

static char hello[6];

strncpy (hello, "Hello world!\n", sizeof hello - 1)[5] = '\0';
</verb>
</descrip>
</quote>


<sect1>strnicmp<label id="strnicmp"><p>

<quote>
<descrip>
<tag/Function/Compare two strings case insensitive.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/int __fastcall__ strnicmp (const char* s1, const char* s2, size_t count);/
<tag/Description/The <tt/strnicmp/ function compares the two strings passed as
parameters without case sensitivity. It returns a value that is less than zero
if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
value greater than zero if <tt/s1/ is greater than <tt/s2/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The function is not available in strict ANSI mode.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="strcasecmp" name="strcasecmp">,
<ref id="strcmp" name="strcmp">,
<ref id="strcoll" name="strcoll">,
<ref id="strncmp" name="strncmp">,
<ref id="strxfrm" name="strxfrm">
<tag/Example/None.
</descrip>
</quote>


<sect1>strpbrk<label id="strpbrk"><p>

<quote>
<descrip>
<tag/Function/Find a character in a string, from a set of characters.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strpbrk (const char* str, const char* set);/
<tag/Description/<tt/strpbrk()/ searches within <tt/str/ for the first
occurrence of any character from <tt/set/.  It returns a pointer to that
character if found; otherwise, it returns <tt/NULL/.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function;
so, it should be used only in the presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strchr" name="strchr">,
<ref id="strcspn" name="strcspn">,
<ref id="strqtok" name="strqtok">,
<ref id="strspn" name="strspn">,
<ref id="strtok" name="strtok">
<tag/Example/None.
</descrip>
</quote>


<sect1>strqtok<label id="strqtok"><p>

<quote>
<descrip>
<tag/Function/Break a string into tokens.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strqtok (char* s1, const char* s2);/
<tag/Description/<tt/strqtok()/ will break the string <tt/s1/ into a sequence of
tokens, which are delimited by either quotation marks or characters from the
string <tt/s2/. Tokens inside quotation marks may contain characters from <tt/s2/
(they aren't delimiters there). The first call to <tt/strqtok()/ will return a
pointer to the first token in the string <tt/s1/. The following calls must pass
a <tt/NULL/ pointer as <tt/s1/, in order to get the next token in the string.
Different sets of delimiters may be used for the subsequent calls to <tt/strqtok()/.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
<item><tt/strqtok()/ will modify the string <tt/s1/.
<item>The function will forget where it is in the <tt/s1/ string if it is given
a second <tt/s1/ string before it finishes the first one.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="strcspn" name="strcspn">,
<ref id="strpbrk" name="strpbrk">,
<ref id="strspn" name="strspn">,
<ref id="strtok" name="strtok">
<tag/Example/None.
</descrip>
</quote>


<sect1>strrchr<label id="strrchr"><p>

<quote>
<descrip>
<tag/Function/Search for a character in a string.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
<tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
(converted to a char) in the string pointed to by <tt/s/. The terminating null
byte is considered to be part of the string. Upon completion, the function
returns a pointer to the byte, or a null pointer if the byte was not found.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strchr" name="strchr">
<tag/Example/None.
</descrip>
</quote>


<sect1>strspn<label id="strspn"><p>

<quote>
<descrip>
<tag/Function/Compute the length of a substring.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/size_t __fastcall__ strspn (const char* s, const char* set);/
<tag/Description/The <tt/strspn/ function computes and returns the length of
the substring pointed to by <tt/s/ which does consist only of characters
contained in the string <tt/set/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcspn" name="strcspn">,
<ref id="strpbrk" name="strpbrk">,
<ref id="strstr" name="strstr">
<tag/Example/None.
</descrip>
</quote>


<sect1>strstr<label id="strstr"><p>

<quote>
<descrip>
<tag/Function/Find a substring.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strstr (const char* str, const char* substr);/
<tag/Description/<tt/strstr/ searches for the first occurrence of the string
<tt/substr/ within <tt/str/. If found, it returns a pointer to the copy,
otherwise it returns <tt/NULL/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcspn" name="strcspn">,
<ref id="strspn" name="strspn">
<tag/Example/None.
</descrip>
</quote>


<sect1>strtok<label id="strtok"><p>

<quote>
<descrip>
<tag/Function/Break a string into tokens.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strtok (char* s1, const char* s2);/
<tag/Description/<tt/strtok()/ will break the string <tt/s1/ into a sequence of
tokens, which are delimited by characters from the string <tt/s2/. The first call
to <tt/strtok()/ will return a pointer to the first token in the string <tt/s1/.
The following calls must pass a <tt/NULL/ pointer as <tt/s1/, in order to get
the next token in the string. Different sets of delimiters may be used for the
subsequent calls to <tt/strtok()/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item><tt/strtok()/ will modify the string <tt/s1/.
<item>The function will forget where it is in the <tt/s1/ string if it is given
a second <tt/s1/ string before it finishes the first one.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcspn" name="strcspn">,
<ref id="strpbrk" name="strpbrk">,
<ref id="strqtok" name="strqtok">,
<ref id="strspn" name="strspn">
<tag/Example/None.
</descrip>
</quote>


<sect1>strxfrm<label id="strxfrm"><p>

<quote>
<descrip>
<tag/Function/Transform a string.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/size_t __fastcall__ strxfrm (char* s1, const char* s2, size_t n);/
<tag/Description/The <tt/strxfrm/ function transforms the string pointed to by
s2 and places the resulting string into the string pointed to by s1. The
transformation is such that if the <tt/strcmp/ function is applied to two
transformed strings, it returns a value greater than, equal to, or less than
zero, corresponding to the result of the <tt/strcoll/ function applied to the
same two original strings. No more than n characters are placed into the
resulting array pointed to by s1, including the terminating null character.
<tag/Notes/<itemize>
<item><tt/s1/ and <tt/s2/ must not point to the same memory area, otherwise
the behaviour is undefined.
<item>If <tt/n/ is zero, <tt/s1/ may be a NULL pointer.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>Since cc65 doesn't support different character sets, <tt/strxfrm/ will
just copy s2 to s1 using <tt><ref id="strncpy" name="strncpy"></tt>.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="strcmp" name="strcmp">,
<ref id="strcoll" name="strcoll">,
<ref id="strncpy" name="strncpy">
<tag/Example/None.
</descrip>
</quote>


<sect1>strupper<label id="strupper"><p>

<quote>
<descrip>
<tag/Function/Make a string upper case.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
<tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
function to each character of a string. The function will always return <tt/s/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>The function prototype is unavailable when compiling in strict ANSI mode.
<item>An alias name for this function is <tt/strupr/.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="strlower" name="strlower">
<ref id="toupper" name="toupper">
<tag/Example/None.
</descrip>
</quote>


<sect1>strupr<label id="strupr"><p>

<quote>
See <tt/strupper/.
</quote>


<sect1>telldir<label id="telldir"><p>

<quote>
<descrip>
<tag/Function/Return the current position of a directory stream.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/long __fastcall__ telldir (DIR* dir);/
<tag/Description/<tt/telldir/ returns the current position of a directory
stream. The return value may be used in subsequent calls to
<tt/<ref id="seekdir" name="seekdir">/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="seekdir" name="seekdir">,
<ref id="telldir" name="telldir">
<tag/Example/None.
</descrip>
</quote>


<sect1>textcolor<label id="textcolor"><p>

<quote>
<descrip>
<tag/Function/Set the text color.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
<tag/Description/The function will set a new text color. It returns the old
(current) text color. Text output using any <tt/conio.h/ function will use
the color set by this function.
<tag/Notes/<itemize>
<item>Text colors are system dependent. The function may have no effect
on systems where the text color cannot be changed.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="bgcolor" name="bgcolor">,
<ref id="bordercolor" name="bordercolor">
<tag/Example/None.
</descrip>
</quote>


<sect1>time<label id="time"><p>

<quote>
<descrip>
<tag/Function/Get the time.
<tag/Header/<tt/<ref id="time.h" name="time.h">/
<tag/Declaration/<tt/time_t __fastcall__ time (time_t* t);/
<tag/Description/The function returns the time since the 1970-01-01 00:00:00
measured in seconds. If the pointer <tt/t/ is not <tt/NULL/, the function
result will also be stored there. If no time is available, <tt/(time_t)-1/ is
returned and an error code is stored in <tt/errno/.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
<item>Many platforms supported by cc65 do not have a realtime clock, so the
returned value may not be valid.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="clock" name="clock">,
<ref id="clock_gettime" name="clock_gettime">
<tag/Example/None.
</descrip>
</quote>


<sect1>toggle_videomode<label id="toggle_videomode"><p>

<quote>
<descrip>
<tag/Function/Toggle between 40 and 80 column mode.
<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
<tag/Declaration/<tt/void toggle_videomode (void);/
<tag/Description/Toggle between 40 and 80 column mode. The settings for the
old mode (cursor position, color and so on) are saved and restored together
with the mode.
<tag/Notes/<itemize>
<item>The function is specific to the C128.
<item>This function is deprecated. Please use <ref id="videomode"
name="videomode"> instead!
</itemize>
<tag/Availability/C128
<tag/See also/
<ref id="fast" name="fast">,
<ref id="isfast" name="isfast">,
<ref id="slow" name="slow">,
<ref id="videomode" name="videomode">
<tag/Example/None.
</descrip>
</quote>


<sect1>tolower<label id="tolower"><p>

<quote>
<descrip>
<tag/Function/Convert a character into its lower case representation.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ tolower (int c);/
<tag/Description/The function returns the given character converted to lower
case. If the given character is not a letter, it is returned unchanged.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="islower" name="islower">,
<ref id="isupper" name="isupper">,
<ref id="toupper" name="toupper">
<tag/Example/None.
</descrip>
</quote>


<sect1>toupper<label id="toupper"><p>

<quote>
<descrip>
<tag/Function/Convert a character into its upper case representation.
<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
<tag/Declaration/<tt/int __fastcall__ toupper (int c);/
<tag/Description/The function returns the given character converted to upper
case. If the given character is not a letter, it is returned unchanged.
<tag/Notes/<itemize>
<item>The function is only available as fastcall function, so it may
only be used in presence of a prototype.
</itemize>
<tag/Availability/ISO 9899
<tag/See also/
<ref id="islower" name="islower">,
<ref id="isupper" name="isupper">,
<ref id="tolower" name="tolower">
<tag/Example/None.
</descrip>
</quote>


<sect1>ultoa<label id="ultoa"><p>

<quote>
<descrip>
<tag/Function/Convert an unsigned long integer into a string.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
<tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
string using <tt/radix/ as the base.
<tag/Notes/<itemize>
<item>There are no provisions to prevent a buffer overflow.
<item>The function is non standard, so it is not available in strict ANSI mode.
You should probably use <tt/sprintf/ instead.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atoi" name="atoi">,
<ref id="atol" name="atol">,
<ref id="itoa" name="itoa">,
<ref id="ltoa" name="ltoa">,
<ref id="utoa" name="utoa">
<tag/Example/None.
</descrip>
</quote>


<sect1>unlink<label id="unlink"><p>

<quote>
<descrip>
<tag/Function/Delete a file.
<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
<tag/Declaration/<tt/int __fastcall__ unlink (const char* name);/
<tag/Description/<tt/unlink/ deletes the file with the given name. On success,
zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
code describing the reason for the failure.
<tag/Notes/<itemize>
<item>The use of this function is discouraged. Please use <tt/<ref id="remove"
name="remove">/ instead, which is a native ANSI C function and does the same.
<item>This function is not available on all cc65 targets (depends on the
availability of file I/O).
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>Instead of <tt/unlink/, <tt/<ref id="remove" name="remove">/ should be
used, which has the same semantics, but is more portable, because it conforms
to the ISO C standard.
</itemize>
<tag/Availability/POSIX 1003.1
<tag/See also/
<ref id="remove" name="remove">
<tag/Example/
<verb>
#include &lt;stdio.h&gt;
#include &lt;unistd.h&gt;

#define FILENAME "helloworld"

if (unlink (FILENAME) == 0) {
    printf ("We deleted %s successfully\n", FILENAME);
} else {
    printf ("There was a problem deleting %s\n", FILENAME);
}
</verb>
</descrip>
</quote>


<sect1>utoa<label id="utoa"><p>

<quote>
<descrip>
<tag/Function/Convert an unsigned integer into a string.
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
<tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
<tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
using <tt/radix/ as the base.
<tag/Notes/<itemize>
<item>There are no provisions to prevent a buffer overflow.
<item>The function is non standard, so it is not available in strict ANSI mode.
You should probably use <tt/sprintf/ instead.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="atoi" name="atoi">,
<ref id="atol" name="atol">,
<ref id="itoa" name="itoa">,
<ref id="ltoa" name="ltoa">,
<ref id="ultoa" name="ultoa">
<tag/Example/None.
</descrip>
</quote>


<sect1>vcprintf<label id="vcprintf"><p>

<quote>
<descrip>
<tag/Function/Formatted output to the console.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/int __fastcall__ vcprintf (const char* format, va_list ap);/
<tag/Description/The arguments specified as a <tt/va_list/ are converted to
text where necessary and formatted according to the format string given. The
resulting string is output to the console. <tt/vcprintf/ supports the same
format specifiers as <tt/vprintf/. <!-- <tt/<ref id="vprintf" name="vprintf">/. -->
<tag/Notes/<itemize>
<item>Like all other <tt/conio/ output functions, <tt/vcprintf/ distinguishes
between <tt/\r/ and <tt/\n/.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cprintf" name="cprintf">,
<ref id="cputc" name="cputc">,
<ref id="cputcxy" name="cputcxy">,
<ref id="cputs" name="cputs">,
<ref id="cputsxy" name="cputsxy">
<tag/Example/None.
</descrip>
</quote>


<sect1>videomode<label id="videomode"><p>

<quote>
<descrip>
<tag/Function/Switch to either 40- or 80-column text mode, or a standard
graphics mode.
<tag/Header/<tt/
<ref id="apple2enh.h" name="apple2enh.h">,
<ref id="c128.h" name="c128.h">,
<ref id="cx16.h" name="cx16.h">/
<tag/Declaration/
<tt>unsigned __fastcall__ videomode (unsigned Mode); /* for apple2enh and c128 */</tt><newline>
<tt>signed char __fastcall__ videomode (signed char Mode); /* for cx16 */</tt>
<tag/Description/Switch to a 40- or 80-column text or graphics mode, depending
on the argument. If the requested mode is already active, nothing happens. The
old mode is returned from the call.
<tag/Notes/<itemize>
<item>The function is specific to the Commodore 128, the enhanced Apple //e,
and the Commander X16.
<item>This function replaces <ref id="toggle_videomode"
name="toggle_videomode">.
<item>The function is available as only a fastcall function, so it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/C128, enhanced Apple //e, and CX16
<tag/See also/
<ref id="fast" name="fast">,
<ref id="isfast" name="isfast">,
<!-- <ref id="set_tv" name="set_tv">, -->
<ref id="slow" name="slow">,
<ref id="toggle_videomode" name="toggle_videomode">
<tag/Example/None.
</descrip>
</quote>


<sect1>waitvsync<label id="waitvsync"><p>

<quote>
<descrip>
<tag/Function/Wait until the start of the next video frame.
<tag/Header/<tt/
<ref id="cbm.h" name="cbm.h">,
<ref id="gamate.h" name="gamate.h">,
<ref id="nes.h" name="nes.h">,
<ref id="pce.h" name="pce.h">/
<tag/Declaration/<tt/void waitvsync (void);/
<tag/Description/Wait for vertical sync, to reduce flickering.
<tag/Availability/Platforms served by the headers above
<tag/Example/None.
</descrip>
</quote>


<sect1>wherex<label id="wherex"><p>

<quote>
<descrip>
<tag/Function/Return the current X position of the text mode cursor.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char wherex (void);/
<tag/Description/The function returns the current X position of the text mode
cursor. Zero is returned for the leftmost screen position.
<tag/Availability/cc65
<tag/See also/
<ref id="gotox" name="gotox">,
<ref id="gotoy" name="gotoy">,
<ref id="gotoxy" name="gotoxy">,
<ref id="wherey" name="wherey">
<tag/Example/None.
</descrip>
</quote>


<sect1>wherey<label id="wherey"><p>

<quote>
<descrip>
<tag/Function/Return the current Y position of the text mode cursor.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/unsigned char wherey (void);/
<tag/Description/The function returns the current Y position of the text mode
cursor. Zero is returned for the uppermost screen position.
<tag/Availability/cc65
<tag/See also/
<ref id="gotox" name="gotox">,
<ref id="gotoy" name="gotoy">,
<ref id="gotoxy" name="gotoxy">,
<ref id="wherex" name="wherex">
<tag/Example/None.
</descrip>
</quote>


</article>
