]> git.sur5r.net Git - cc65/blobdiff - doc/funcref.sgml
Added docs for all the tgi functions and improved Lynx documentation
[cc65] / doc / funcref.sgml
index 8d416680a65dad02610837e9308dbeb4aa18c541..2a84f718535c14522fb61b63768832a60ee8d261 100644 (file)
@@ -64,11 +64,23 @@ function.
 
 <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/atari.h/<label id="atari.h"><p>
 
+<sect1><tt/apple2enh.h/<label id="apple2enh.h"><p>
 
-<sect1><tt/atmos.h/<label id="atmos.h"><p>
+<itemize>
+<item>_dos_type
+<item><ref id="get_ostype" name="get_ostype">
+<item>rebootafterexit
+<item>textframe
+<item>textframexy
+<item><ref id="videomode" name="videomode">
+</itemize>
 
 
 <sect1><tt/assert.h/<label id="assert.h"><p>
@@ -78,21 +90,62 @@ function.
 </itemize>
 
 
+<sect1><tt/atari.h/<label id="atari.h"><p>
+
+<itemize>
+<item><ref id="get_ostype" name="get_ostype">
+</itemize>
+
+(incomplete)
+
+
+<sect1><tt/atmos.h/<label id="atmos.h"><p>
+
+(incomplete)
+
+
 <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="toggle_videomode" name="toggle_videomode">
 <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>
 
+(incomplete)
+
 
 <sect1><tt/c64.h/<label id="c64.h"><p>
 
+<itemize>
+<item><ref id="get_ostype" name="get_ostype">
+</itemize>
+
+
+<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/conio.h/<label id="conio.h"><p>
 
@@ -149,9 +202,13 @@ function.
 
 <sect1><tt/dbg.h/<label id="dbg.h"><p>
 
+(incomplete)
+
 
 <sect1><tt/dio.h/<label id="dio.h"><p>
 
+(incomplete)
+
 
 <sect1><tt/em.h/<label id="em.h"><p>
 
@@ -159,9 +216,11 @@ function.
 <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>
@@ -169,6 +228,8 @@ function.
 
 <sect1><tt/errno.h/<label id="errno.h"><p>
 
+(incomplete)
+
 
 <sect1><tt/fcntl.h/<label id="fcntl.h"><p>
 
@@ -181,9 +242,20 @@ function.
 
 <sect1><tt/geos.h/<label id="geos.h"><p>
 
+(incomplete)
+
 
 <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>
 
@@ -195,12 +267,45 @@ function.
 
 <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_load_driver" name="mouse_load_driver">
+<item><ref id="mouse_unload" name="mouse_unload">
+<item><ref id="mouse_install" name="mouse_install">
+<item><ref id="mouse_uninstall" name="mouse_uninstall">
+<item><ref id="mouse_hide" name="mouse_hide">
+<item><ref id="mouse_show" name="mouse_show">
+<item><ref id="mouse_setbox" name="mouse_setbox">
+<item><ref id="mouse_getbox" name="mouse_getbox">
+<item><ref id="mouse_move" name="mouse_move">
+<item><ref id="mouse_buttons" name="mouse_buttons">
+<item><ref id="mouse_pos" name="mouse_pos">
+<item><ref id="mouse_info" name="mouse_info">
+<item><ref id="mouse_ioctl" name="mouse_ioctl">
+</itemize>
+
+(incomplete)
+
 
 <sect1><tt/nes.h/<label id="nes.h"><p>
 
+(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 <htmlurl
+url="http://www.6502.org/users/andre/o65/fileformat.html" name="o65 format">.
+It does not declare any functions.
+
 
 <sect1><tt/peekpoke.h/<label id="peekpoke.h"><p>
 
@@ -214,15 +319,41 @@ function.
 
 <sect1><tt/pet.h/<label id="pet.h"><p>
 
+(incomplete)
+
 
 <sect1><tt/plus4.h/<label id="plus4.h"><p>
 
+(incomplete)
+
 
 <sect1><tt/serial.h/<label id="serial.h"><p>
 
+<!--
+<itemize>
+<item><ref id="ser_load_driver" name="ser_load_driver">
+<item><ref id="ser_unload" name="ser_unload">
+<item><ref id="ser_install" name="ser_install">
+<item><ref id="ser_uninstall" name="ser_uninstall">
+<item><ref id="ser_open" name="ser_open">
+<item><ref id="ser_close" name="ser_close">
+<item><ref id="ser_get" name="ser_get">
+<item><ref id="ser_put" name="ser_put">
+<item><ref id="ser_status" name="ser_status">
+<item><ref id="ser_ioctl" name="ser_ioctl">
+</itemize>
+-->
+
+(incomplete)
+
 
 <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>
 
@@ -234,9 +365,13 @@ function.
 
 <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>
 
@@ -247,43 +382,22 @@ function.
 
 <sect1><tt/stdio.h/<label id="stdio.h"><p>
 
-
-<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="_poserror" name="_poserror">
-<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="clearerr" name="clearerr"> -->
-<item><ref id="div" name="div">
-<item><ref id="exit" name="exit">
+<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="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="flushall" name="flushall"> -->
+<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="free" name="free">
 <!-- <item><ref id="freopen" name="freopen"> -->
 <!-- <item><ref id="fscanf" name="fscanf"> -->
 <!-- <item><ref id="fseek" name="fseek"> -->
@@ -293,39 +407,66 @@ function.
 <!-- <item><ref id="getc" name="getc"> -->
 <!-- <item><ref id="getchar" name="getchar"> -->
 <!-- <item><ref id="gets" name="gets"> -->
-<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="printf" name="printf"> -->
 <!-- <item><ref id="putc" name="putc"> -->
 <!-- <item><ref id="putchar" name="putchar"> -->
 <!-- <item><ref id="puts" name="puts"> -->
-<item><ref id="qsort" name="qsort">
-<item><ref id="rand" name="rand">
-<item><ref id="realloc" name="realloc">
+<item><ref id="rename" name="rename">
 <item><ref id="remove" name="remove">
-<!-- <item><ref id="rename" name="rename"> -->
 <!-- <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="srand" name="srand">
 <!-- <item><ref id="sscanf" name="sscanf"> -->
-<item><ref id="ultoa" name="ultoa">
-<item><ref id="utoa" name="utoa">
 <!-- <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="_poserror" name="_poserror">
+<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="qsort" name="qsort">
+<item><ref id="rand" name="rand">
+<item><ref id="realloc" name="realloc">
+<item><ref id="srand" name="srand">
+<item><ref id="ultoa" name="ultoa">
+<item><ref id="utoa" name="utoa">
+</itemize>
 
-<sect1><tt/string.h/<label id="string.h"><p>
 
+<sect1><tt/string.h/<label id="string.h"><p>
+           
 <itemize>
 <item><ref id="_stroserror" name="_stroserror">
 <item><ref id="bzero" name="bzero">
@@ -346,37 +487,78 @@ function.
 <item><ref id="strlen" name="strlen">
 <item><ref id="strlower" name="strlower">
 <item><ref id="strlwr" name="strlwr">
-<!-- <item><ref id="strncat" name="strncat"> -->
-<!-- <item><ref id="strncmp" name="strncmp"> -->
+<item><ref id="strncat" name="strncat">
+<item><ref id="strncmp" name="strncmp">
 <item><ref id="strncpy" name="strncpy">
 <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="strtok" name="strtok">
+<item><ref id="strxfrm" name="strxfrm">
 <item><ref id="strupper" name="strupper">
 <item><ref id="strupr" name="strupr">
 </itemize>
 
+(incomplete)
+
 
 <sect1><tt/tgi.h/<label id="tgi.h"><p>
 
+<itemize>
+<item><ref id="tgi_bar" name="tgi_bar">
+<item><ref id="tgi_circle" name="tgi_circle">
+<item><ref id="tgi_clear" name="tgi_clear">
+<item><ref id="tgi_getcolor" name="tgi_getcolor">
+<item><ref id="tgi_getcolorcount" name="tgi_getcolorcount">
+<item><ref id="tgi_getdefpalette" name="tgi_getdefpalette">
+<item><ref id="tgi_done" name="tgi_done">
+<item><ref id="tgi_geterror" name="tgi_geterror">
+<item><ref id="tgi_geterrormsg" name="tgi_geterrormsg">
+<item><ref id="tgi_getmaxcolor" name="tgi_getmaxcolor">
+<item><ref id="tgi_getmaxx" name="tgi_getmaxx">
+<item><ref id="tgi_getmaxy" name="tgi_getmaxy">
+<item><ref id="tgi_getpagecount" name="tgi_getpagecount">
+<item><ref id="tgi_getpalette" name="tgi_getpalette">
+<item><ref id="tgi_getpixel" name="tgi_getpixel">
+<item><ref id="tgi_getxres" name="tgi_getxres">
+<item><ref id="tgi_getyres" name="tgi_getyres">
+<item><ref id="tgi_gotoxy" name="tgi_gotoxy">
+<item><ref id="tgi_init" name="tgi_init">
+<item><ref id="tgi_install" name="tgi_install">
+<item><ref id="tgi_ioctl" name="tgi_ioctl">
+<item><ref id="tgi_line" name="tgi_line">
+<item><ref id="tgi_lineto" name="tgi_lineto">
+<item><ref id="tgi_load" name="tgi_load">
+<item><ref id="tgi_load_driver" name="tgi_load_driver">
+<item><ref id="tgi_outtext" name="tgi_outtext">
+<item><ref id="tgi_outtextxy" name="tgi_outtextxy">
+<item><ref id="tgi_setcolor" name="tgi_setcolor">
+<item><ref id="tgi_setdrawpage" name="tgi_setdrawpage">
+<item><ref id="tgi_setpalette" name="tgi_setpalette">
+<item><ref id="tgi_setpixel" name="tgi_setpixel">
+<item><ref id="tgi_setviewpage" name="tgi_setviewpage">
+<item><ref id="tgi_textheight" name="tgi_textheight">
+<item><ref id="tgi_textstyle" name="tgi_textstyle">
+<item><ref id="tgi_textwidth" name="tgi_textwidth">
+<item><ref id="tgi_uninstall" name="tgi_uninstall">
+<item><ref id="tgi_unload" name="tgi_unload">
+</itemize>
 
 <sect1><tt/time.h/<label id="time.h"><p>
 
-<!--
 <itemize>
-<item><ref id="_systime" name="_systime">
-<item><ref id="asctime" name="asctime">
-<item><ref id="clock" name="clock">
-<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="_systime" name="_systime"> -->
+<!-- <item><ref id="asctime" name="asctime"> -->
+<!-- <item><ref id="clock" name="clock"> -->
+<!-- <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>
@@ -393,13 +575,17 @@ function.
 <!-- <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>
 
+<sect1><tt/zlib.h/<label id="zlib.h"><p>
 
+(incomplete)
 
 
 <sect>Alphabetical function reference<p>
@@ -415,7 +601,7 @@ function.
 <tag/Limits/
 <itemize>
 <item>The minimum blocksize that can be added is 6 bytes; the function will
-ignore blocks with smaller sizes.
+ignore smaller blocks.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -443,7 +629,7 @@ previously been allocated by <tt/<ref id="malloc" name="malloc">/, <tt/<ref
 id="calloc" name="calloc">/ or <tt/<ref id="realloc" name="realloc">/.
 <tag/Limits/
 <itemize>
-<item>Passing a pointer to a block that was is not the result of one of the 
+<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.
 </itemize>
 <tag/Availability/cc65
@@ -668,8 +854,8 @@ is present.
 <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 disabled. Note that non maskable interrupts cannot be
-disabled.
+so interrupts are enabled. Enabling interrupts has no effects if they are
+already enabled (the default).
 <tag/Limits/<itemize>
 <item>The function is actually a macro.
 <item>Disabling interrupts may lead to unexpected results.
@@ -789,10 +975,11 @@ depend of the address expression used.
 <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 enabled. Enabling interrupts has no effects if they are
-already enabled (the default).
+so interrupts are disabled. Note that non maskable interrupts cannot be
+disabled.
 <tag/Limits/<itemize>
 <item>The function is actually a macro.
+<item>Disabling interrupts may lead to unexpected results.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -954,8 +1141,9 @@ used in presence of a prototype.
 <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 text color. It returns
-the old (current) background 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/Limits/<itemize>
 <item>Background colors are system dependent. The function may have no effect
 on systems where the background color cannot be changed.
@@ -1227,6 +1415,28 @@ used in presence of a prototype.
 </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/Limits/<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>clrscr<label id="clrscr"><p>
 
 <quote>
@@ -1259,7 +1469,7 @@ reading the <tt/errno/ variable.
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
-<tag/Availability/POSIX
+<tag/Availability/POSIX 1003.1
 <tag/See also/
 <ref id="creat" name="creat">,
 <ref id="open" name="open">
@@ -1284,7 +1494,7 @@ associated with it. On error, -1 is returned and an error code is stored in
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
-<tag/Availability/POSIX
+<tag/Availability/POSIX 1003.1
 <tag/See also/
 <ref id="close" name="close">,
 <ref id="open" name="open">
@@ -1614,6 +1824,32 @@ loaded.
 </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 (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/Limits/<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>
@@ -1651,7 +1887,7 @@ extended memory that should be supported. There is no autodetect capability.
 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 transfered
 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
+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/Limits/<itemize>
@@ -1694,13 +1930,40 @@ by the driver in 256 byte pages.
 </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 __fastcall__ em_install (void);/
+<tag/Description/The function uninstalls an already loaded extended memory
+driver but doesn't remove it from memory.
+<tag/Limits/<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.
+<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_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/void __fastcall__ em_unload (void);/
+<tag/Declaration/<tt/unsigned char __fastcall__ em_unload (void);/
 <tag/Description/The function unloads a loaded extended memory driver and
 frees all memory allocated for the driver.
 <tag/Limits/<itemize>
@@ -1789,7 +2052,81 @@ will nearly double the speed compared to slow mode.
 <tag/Availability/C128
 <tag/See also/
 <ref id="slow" name="slow">,
-<ref id="toggle_videomode" name="toggle_videomode">
+<ref id="toggle_videomode" name="toggle_videomode">,
+<ref id="videomode" name="videomode">
+<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 ofthe stream
+<tt/f/, and returns a non zero value if it is set.
+<tag/Limits/<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/Limits/<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/Limits/<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>
@@ -1827,17 +2164,39 @@ be used in presence of a prototype.
 </quote>
 
 
-<sect1>getenv<label id="getenv"><p>
+<sect1>get_ostype<label id="get_ostype"><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/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/Limits/<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>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/Limits/<itemize>
 <item>What exactly is stored in the environment depends on the machine the
 program is running on.
@@ -2478,6 +2837,156 @@ used in presence of a prototype.
 </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 __fastcall__ joy_count (void);/
+<tag/Description/The function returns a the number of joysticks supported
+by the current joystick driver.
+<tag/Limits/<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.
+<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_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 (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/Limits/<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/Limits/<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/Limits/<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 __fastcall__ 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/Limits/<itemize>
+<item>A joystick driver must be installed using <ref id="joy_install"
+name="joy_install"> 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_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 __fastcall__ 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/Limits/<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_load_driver" name="joy_load_driver">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>kbhit<label id="kbhit"><p>
 
 <quote>
@@ -2573,6 +3082,33 @@ always be the same.
 </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 preceeding 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/Limits/
+<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>
@@ -2705,910 +3241,2434 @@ be used in presence of a prototype.
 </quote>
 
 
-<sect1>offsetof<label id="offsetof"><p>
+<sect1>mod_free<label id="mod_free"><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/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/Limits/<itemize>
-<item>The function is actually a macro.
+<item>The pointer passed as parameter is the pointer to the module memory,
+not the pointer to the control structure.
 </itemize>
-<tag/Availability/ISO 9899
+<tag/Availability/cc65
+<tag/See also/
+<ref id="mod_load" name="mod_load">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>open<label id="open"><p>
+<sect1>mod_load<label id="mod_load"><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/Function/Load a relocatable module.
+<tag/Header/<tt/<ref id="modload.h" name="modload.h">/
+<tag/Declaration/<tt/unsigned char 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/Limits/<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.
+<item>The <htmlurl url="ld65.html" name="ld65"> linker is needed to create
+relocatable o65 modules for use with this function.
 </itemize>
-<tag/Availability/POSIX
+<tag/Availability/cc65
 <tag/See also/
-<ref id="close" name="close">,
-<ref id="creat" name="creat">
+<ref id="mod_free" name="mod_free">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>perror<label id="perror"><p>
+<sect1>mouse_setbox<label id="mouse_setbox"><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/Limits/
-<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<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/Limits/<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/ISO 9899
+<tag/Availability/cc65
 <tag/See also/
-<ref id="_poserror" name="_poserror">,
-<ref id="strerror" name="strerror">,
+<ref id="mouse_getbox" name="mouse_getbox">,
+<ref id="mouse_move" name="mouse_move">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>qsort<label id="qsort"><p>
+<sect1>mouse_getbox<label id="mouse_getbox"><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 (*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/Limits/
-<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.
+<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/Limits/<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/Availability/cc65
 <tag/See also/
-<ref id="bsearch" name="bsearch">
+<ref id="mouse_move" name="mouse_move">,
+<ref id="mouse_setbox" name="mouse_setbox">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>raise<label id="raise"><p>
+<sect1>mouse_buttons<label id="mouse_buttons"><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,
-nonzero otherwise.
+<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 __fastcall__ 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/Limits/<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 only available as fastcall function, so it may only be
+used in presence of a prototype.
 </itemize>
-<tag/Availability/ISO 9899
+<tag/Availability/cc65
 <tag/See also/
-<ref id="abort" name="abort">,
-<ref id="signal" name="signal">
+<ref id="mouse_info" name="mouse_info">,
+<ref id="mouse_pos" name="mouse_pos">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>rand<label id="rand"><p>
+<sect1>mouse_geterrormsg<label id="mouse_geterrormsg"><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/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/Limits/<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.
+<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/ISO 9899
+<tag/Availability/cc65
 <tag/See also/
-<ref id="_randomize" name="_randomize">,
-<ref id="srand" name="srand">
+<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>realloc<label id="realloc"><p>
+<sect1>mouse_hide<label id="mouse_hide"><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/Limits/
-<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 loose 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.
+<tag/Function/Hide the mouse pointer.
+<tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
+<tag/Declaration/<tt/void __fastcall__ 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/Limits/<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/Availability/cc65
 <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="mouse_show" name="mouse_show">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>remove<label id="remove"><p>
+<sect1>mouse_info<label id="mouse_info"><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/Limits/
+<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/Limits/<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/Limits/<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/Limits/<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/Limits/<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/Limits/<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/Limits/<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 __fastcall__ 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/Limits/<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_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 __fastcall__ mouse_install (void);/
+<tag/Description/The function uninstalls an already loaded mouse driver but
+don't removes it from memory.
+<tag/Limits/<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.
+<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_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 __fastcall__ mouse_unload (void);/
+<tag/Description/The function unloads a loaded mouse driver and frees all
+memory allocated for the driver.
+<tag/Limits/<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>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/Limits/<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/Limits/<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>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/Limits/
 <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.
+<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/Limits/
+<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/Limits/
+<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/Limits/
+<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/Limits/
+<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>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 (*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/Limits/
+<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.
+</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,
+nonzero otherwise.
+<tag/Limits/<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="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/Limits/<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>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/Limits/
+<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 loose 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/Limits/
+<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/Limits/
+<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 __fastcall__ 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/Limits/
+<itemize>
+<item>Since <tt/<ref id="set_brk" name="set_brk">/ installs an exit handler,
+it is not strictly necessary to call this function as part of the cleanup when
+the program ends.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="set_brk" name="set_brk">
+<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/Limits/<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>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/Limits/<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>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/Limits/
+<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>Since <tt/set_brk/ installs an exit handler, it is not strictly necessary
+to call <tt/<ref id="reset_brk" name="reset_brk">/ as part of the cleanup when
+the program terminates.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="reset_brk" name="reset_brk">
+<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/Limits/
+<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/Limits/
+<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/Limits/<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="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/Limits/<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 C128 into 1MHz mode.
+<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
+<tag/Declaration/<tt/void slow (void);/
+<tag/Description/The function will switch the clock of the C128 to 1MHz. This
+will halve the speed compared to fast mode.
+<tag/Limits/<itemize>
+<item>The function is specific to the C128.
+</itemize>
+<tag/Availability/C128
+<tag/See also/
+<ref id="fast" name="fast">,
+<ref id="toggle_videomode" name="toggle_videomode">,
+<ref id="videomode" name="videomode">
+<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/Limits/<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/Limits/<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/Concatentate 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/Limits/<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/Limits/<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/Limits/<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/Limits/<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/Limits/<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/Limits/<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="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/Limits/<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/Limits/<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/Limits/<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/Limits/<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/Limits/<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>strncat<label id="strncat"><p>
+
+<quote>
+<descrip>
+<tag/Function/Concatentate 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/Limits/<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/Limits/<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__ strcpy (char* s1, const char* s2, size_t n);/
+<tag/Description/The <tt/strncpy/ function copies not more than 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 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 will always return <tt/s1/.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype. If there is no null byte in the first <tt/n/
+bytes of the array pointed to by <tt/s2/, the result is 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="strcat" name="strcat">,
+<ref id="strcpy" name="strcpy">,
+<ref id="strncat" name="strncat">
+<tag/Example/
+<verb>
+#include <string.h>
+
+static char hello[6];
+
+strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
+hello[5] = '\0';
+</verb>
+</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/Limits/<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/Limits/<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="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 occurance of the string
+<tt/substr/ within <tt/str/. If found, it returns a pointer to the copy,
+otherwise it returns <tt/NULL/.
+<tag/Limits/<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 s1 into a sequence of
+tokens, which are delimited by characters from the string s2. The first call
+to <tt/strtok/ will return a pointer to the first token in the string s1.
+Following calls must pass a <tt/NULL/ pointer as 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/Limits/<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 s1.
+</itemize>
+<tag/Availability/ISO 9899
+<tag/See also/
+<ref id="strcspn" name="strcspn">,
+<!-- <ref id="strpbrk" name="strpbrk"> -->
+<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/Limits/<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 charcter 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/Limits/<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>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/Limits/<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>tgi_bar<label id="tgi_bar"><p>
+
+<quote>
+<descrip>
+<tag/Function/The function fills a rectangle on the drawpage with the current
+color.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_bar (int x1, int y1, int x2, int y2);/
+<tag/Description/The function fills a rectangle on the drawpage with the current
+color.
+<tag/Limits/<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 tgi function
+<tag/Example/<verb>
+tgi_setcolor(COLOR_GREEN);
+tgi_bar(10, 10, 100, 60);
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_circle<label id="tgi_circle"><p>
+
+<quote>
+<descrip>
+<tag/Function/The function draws a circle in the current color.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_circle (int x, int y, unsigned char radius);/
+<tag/Description/The function draws a circle in the current color.
+<tag/Limits/<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 tgi functions
+<tag/Example/<verb>
+tgi_setcolor(COLOR_BLACK);
+tgi_circle(50, 40, 40);
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_clear<label id="tgi_clear"><p>
+
+<quote>
+<descrip>
+<tag/Function/Clear the screen
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_clear (void);/
+<tag/Description/Clear the screen
+<tag/Limits/<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 tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_done<label id="tgi_done"><p>
+
+<quote>
+<descrip>
+<tag/Function/End graphics mode, switch back to text mode.
+Will NOT uninstall or unload the driver! 
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_done (void);/
+<tag/Description/End graphics mode, switch back to text mode.
+Will NOT uninstall or unload the driver! 
+<tag/Limits/<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 tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getcolor<label id="tgi_getcolor"><p>
+
+<quote>
+<descrip>
+<tag/Function/Return the current drawing color.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_getcolor (void);/
+<tag/Description/The actual color is an index to a palette. During tgi_init
+you will get a default palette. The number of colors depend on the platform.
+All platforms recognize at least COLOR_BLACK and COLOR_WHITE. But some
+platforms have many more predefined colors. If you paint using COLOR_GREEN
+and then you change the green of the palette to blue using tgi_setpalette then
+after this painting in COLOR_GREEN will actually be blue.
+<tag/Limits/<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 tgi functions
+<tag/Example/<verb>
+color = tgi_getcolor();
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_getcolorcount<label id="tgi_getcolorcount"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the number of available colors.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_getcolorcount (void);/
+<tag/Description/Tgi platforms use indexed color palettes. This function
+returns the number of entries we can use in the palette.
+<tag/Limits/<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="unlink" name="unlink">
-<tag/Example/
-#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);
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/<verb>
+if (tgi_getcolorcount() == 2) {
+  printf("Only monochrome graphics is supported\n");
 }
+</verb>
 </descrip>
 </quote>
 
-
-<sect1>reset_brk<label id="reset_brk"><p>
+<sect1>tgi_getdefpalette<label id="tgi_getdefpalette"><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 __fastcall__ 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/Limits/
-<itemize>
-<item>Since <tt/<ref id="set_brk" name="set_brk">/ installs an exit handler,
-it is not strictly necessary to call this function as part of the cleanup when
-the program ends.
+<tag/Function/Get the palette installed by default.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/const unsigned char* __fastcall__ tgi_getdefpalette (void);/
+<tag/Description/The tgi driver has a default palette that is active at startup.
+The named colors COLOR_BLACK, COLOR_WHITE, COLOR_RED... need this palette to
+work correctly.
+<tag/Limits/<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="set_brk" name="set_brk">
+<tag/See also/Other tgi functions
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>revers<label id="revers"><p>
+<sect1>tgi_geterror<label id="tgi_geterror"><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/Function/Return the error code for the last operation.
+This will also clear the error.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_geterror (void);/
+<tag/Description/Return the error code for the last operation.
+This will also clear the error.
 <tag/Limits/<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/See also/Other tgi functions
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>screensize<label id="screensize"><p>
+<sect1>tgi_geterrormsg<label id="tgi_geterrormsg"><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/Function/Get an error message describing the error.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/const char* __fastcall__ tgi_geterrormsg (unsigned char code);/
+<tag/Description/Get an error message describing the error.
 <tag/Limits/<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/See also/Other tgi functions
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>set_brk<label id="set_brk"><p>
+<sect1>tgi_getmaxcolor<label id="tgi_getmaxcolor"><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/Limits/
-<itemize>
+<tag/Function/Get the highest index of the palette.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_getmaxcolor (void);/
+<tag/Description/Get the highest index of the palette.
+<tag/Limits/<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>Since <tt/set_brk/ installs an exit handler, it is not strictly necessary
-to call <tt/<ref id="reset_brk" name="reset_brk">/ as part of the cleanup when
-the program terminates.
 </itemize>
 <tag/Availability/cc65
-<tag/See also/
-<ref id="reset_brk" name="reset_brk">
+<tag/See also/Other tgi functions
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>setlocale<label id="setlocale"><p>
+<sect1>tgi_getmaxx<label id="tgi_getmaxx"><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/Limits/
-<itemize>
+<tag/Function/Get the maximum x coordinate that can be used on this screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getmaxx (void);/
+<tag/Description/Get the maximum x coordinate that can be used on this screen.
+<tag/Limits/<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">
+<tag/Availability/cc65
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>signal<label id="signal"><p>
+<sect1>tgi_getmaxy<label id="tgi_getmaxy"><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/Function/Get the maximum y coordinate that can be used on this screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getmaxy (void);/
+<tag/Description/Get the maximum y coordinate that can be used on this screen.
 <tag/Limits/<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="raise" name="raise">
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>sleep<label id="sleep"><p>
+<sect1>tgi_getpagecount<label id="tgi_getpagecount"><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/Function/Return the number of screen pages available.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getpagecount (void);/
+<tag/Description/Return the number of screen pages available.
 <tag/Limits/<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
+<tag/Availability/cc65
+<tag/See also/
+<ref id="tgi_setdrawpage" name="tgi_setdrawpage">,
+<ref id="tgi_setviewpage" name="tgi_setviewpage">
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>slow<label id="slow"><p>
+<sect1>tgi_getpalette<label id="tgi_getpalette"><p>
 
 <quote>
 <descrip>
-<tag/Function/Switch the C128 into 1MHz mode.
-<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
-<tag/Declaration/<tt/void slow (void);/
-<tag/Description/The function will switch the clock of the C128 to 1MHz. This
-will halve the speed compared to fast mode.
+<tag/Function/Get the palette installed.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/const unsigned char* __fastcall__ tgi_getpalette (void);/
+<tag/Description/Get the palette installed.
 <tag/Limits/<itemize>
-<item>The function is specific to the C128.
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
 </itemize>
-<tag/Availability/C128
-<tag/See also/
-<ref id="fast" name="fast">,
-<ref id="toggle_videomode" name="toggle_videomode">
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>srand<label id="srand"><p>
+<sect1>tgi_getpixel<label id="tgi_getpixel"><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/Function/Get the color of a pixel from the viewpage.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_getpixel (int x, int y);/
+<tag/Description/Get the color of a pixel from the viewpage.
 <tag/Limits/<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/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strcasecmp<label id="strcasecmp"><p>
+<sect1>tgi_getxres<label id="tgi_getxres"><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/Function/Get number of horisontal pixels on the screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getxres (void);/
+<tag/Description/Get number of horisontal pixels on the screen.
+This is same as tgi_maxx()+1.
 <tag/Limits/<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">
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strcat<label id="strcat"><p>
+<sect1>tgi_getyres<label id="tgi_getyres"><p>
 
 <quote>
 <descrip>
-<tag/Function/Concatentate 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/Function/Get number of vertical pixels on the screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getyres (void);/
+<tag/Description/Get number of vertical pixels on the screen.
+This is same as tgi_maxy()+1.
 <tag/Limits/<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 behavior
-is undefined.
 </itemize>
-<tag/Availability/ISO 9899
-<tag/See also/
-<ref id="strcpy" name="strcpy">
-<ref id="strncpy" name="strncpy">
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strchr<label id="strchr"><p>
+<sect1>tgi_gotoxy<label id="tgi_gotoxy"><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/Function/Set graphics cursor at x, y.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_gotoxy (int x, int y);/
+<tag/Description/Set graphics cursor at x, y.
 <tag/Limits/<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/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strcmp<label id="strcmp"><p>
+<sect1>tgi_init<label id="tgi_init"><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/Function/Initialize the already loaded graphics driver.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_init (void);/
+<tag/Description/The tgi_init function will set the default palette to the
+hardware and clear the screen.
 <tag/Limits/<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/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/<verb>
+extern char lynxtgi[]; //Include the driver statically instead of loading it.
+tgi_install(&amp;lynxtgi);
+tgi_init(); //Set up the default palette and clear the screen.
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_install<label id="tgi_install"><p>
+
+<quote>
+<descrip>
+<tag/Function/Install an already loaded driver and return an error code.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_install (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/TGI_ERR_OK/ in case of success).
+<tag/Limits/<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="strcasecmp" name="strcasecmp">,
-<ref id="strcoll" name="strcoll">,
-<ref id="stricmp" name="stricmp">
-<tag/Example/None.
+<ref id="tgi_load_driver" name="tgi_load_driver">,
+<ref id="tgi_uninstall" name="tgi_uninstall">,
+<ref id="tgi_unload" name="tgi_unload">
+<tag/Example/<verb>
+extern char lynxtgi[]; //Include the driver statically instead of loading it.
+
+tgi_install(&amp;lynxtgi);
+tgi_init(); //Set up the default palette and clear the screen.
+</verb>
 </descrip>
 </quote>
 
+<sect1>tgi_ioctl<label id="tgi_ioctl"><p>
 
-<sect1>strcoll<label id="strcoll"><p>
+<quote>
+<descrip>
+<tag/Function/Platform dependent code extensions.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_ioctl (unsigned char code, unsigned val);/
+<tag/Description/Some platforms have extra display hardware that is not
+supported by standard tgi functions. You can extend the driver to support
+this extra hardware using tgi_ioctl functions.
+<tag/Limits/<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 tgi functions.
+<tag/Example/<verb>
+#define tgi_sprite(spr) tgi_ioctl(0, (unsigned)(spr))
+#define tgi_flip() tgi_ioctl(1, 0)
+#define tgi_setbgcolor(bgcol) tgi_ioctl(2, (unsigned)(bgcol))
+#define tgi_setframerate(rate) tgi_ioctl(3, (unsigned)(rate))
+#define tgi_busy() tgi_ioctl(4, 0)
+#define tgi_updatedisplay() tgi_ioctl(4, 1)
+if (!tgi_busy()) {
+  tgi_sprite(&amp;background);
+  tgi_setcolor(COLOR_BLUE);
+  tgi_outttextxy(20,40,"Hello World");
+  tgi_updatedisplay();
+}
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_line<label id="tgi_line"><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/Function/Draw a line in the current drawing color.
+The graphics cursor will be set to x2/y2 by this call.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_line (int x1, int y1, int x2, int y2);/
+<tag/Description/Draw a line in the current drawing color.
+The graphics cursor will be set to x2/y2 by this call.
+<tag/Limits/<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 tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_lineto<label id="tgi_lineto"><p>
+
+<quote>
+<descrip>
+<tag/Function/Draw a line in the current drawing color from the graphics
+cursor to the new end point. The graphics cursor will be updated to x2/y2.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_lineto (int x2, int y2);/
+<tag/Description/Draw a line in the current drawing color from the graphics
+cursor to the new end point. The graphics cursor will be updated to x2/y2.
 <tag/Limits/<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">
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strcpy<label id="strcpy"><p>
+<sect1>tgi_load<label id="tgi_load"><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/Function/Load and install the matching driver for the given mode.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_load (unsigned char mode);/
+<tag/Description/Load and install the matching driver for the given mode.
+Will just load the driver and check if loading was successul.
+Will not switch to graphics mode.
 <tag/Limits/<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 behavior
-is undefined.
 </itemize>
-<tag/Availability/ISO 9899
-<tag/See also/
-<ref id="strcat" name="strcat">,
-<ref id="strncpy" name="strncpy">
-<tag/Example/
-<verb>
-#include &lt;string.h&gt;
-
-static char hello[14];
-
-strcpy (hello, "Hello world!\n");
-</verb>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strcspn<label id="strcspn"><p>
+<sect1>tgi_load_driver<label id="tgi_load_driver"><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/Function/Load and install the given driver. This function is identical
+to tgi_load with the only difference that the name of the driver is specified
+explicitly.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_load_driver (const char *name);/
+<tag/Description/Load and install the driver by name.
+Will just load the driver and check if loading was successul.
+Will not switch to graphics mode.
 <tag/Limits/<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="strspn" name="strspn">,
-<ref id="strstr" name="strstr">
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strdup<label id="strdup"><p>
+<sect1>tgi_outtext<label id="tgi_outtext"><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/Function/Output text at the current graphics cursor position.
+The graphics cursor is moved to the end of the text.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_outtext (const char* s);/
+<tag/Description/Output text at the current graphics cursor position.
+The graphics cursor is moved to the end of the text.
 <tag/Limits/<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/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strerror<label id="strerror"><p>
+<sect1>tgi_outtextxy<label id="tgi_outtextxy"><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/Function/Output text at the given cursor position.
+The graphics cursor is moved to the end of the text.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_outtextxy (int x, int y, const char* s);/
+<tag/Description/Output text at the given cursor position.
+The graphics cursor is moved to the end of the text.
 <tag/Limits/<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/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>stricmp<label id="stricmp"><p>
+<sect1>tgi_setcolor<label id="tgi_setcolor"><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/Function/Set color to be used in future draw operations.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setcolor (unsigned char color);/
+<tag/Description/Set color to be used in future draw operations.
 <tag/Limits/<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">
-<tag/Example/None.
+<tag/See also/Other tgi functions.
+<tag/Example/<verb>
+tgi_setcolor(COLOR_BLACK);
+tgi_bar(0,0,30,30);
+tgi_setcolor(COLOR_WHITE);
+tgi_bar(10,10,20,20);
+</verb>
 </descrip>
 </quote>
 
-
-<sect1>strlen<label id="strlen"><p>
+<sect1>tgi_setdrawpage<label id="tgi_setdrawpage"><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/Function/Set the page for drawing.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setdrawpage (unsigned char page);/
+<tag/Description/If the drawpage and the viewpage are the same then all drawing
+is seen immediately as it is drawn. For double buffered games you can set the
+drawpage to a different page than the viewpage. This lets you draw the next
+screen in the background and when the screen is ready you display it.
 <tag/Limits/<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.
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/<verb>
+tgi_setdrawpage(1);
+tgi_outtextxy(10, 10, "Hello World");
+tgi_setviewpage(1); // Show page 1
+tgi_setdrawpage(0);
+tgi_outtextxy(10, 10, "Creating next frame");
+...
+tgi_setviewpage(0); // Show page 0
+</verb>
 </descrip>
 </quote>
 
-
-<sect1>strlower<label id="strlower"><p>
+<sect1>tgi_setpalette<label id="tgi_setpalette"><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/Function/Set the palette (not available with all drivers/hardware).
+Palette is a pointer to as many entries as there are colors.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setpalette (const unsigned char* palette);/
+<tag/Description/Set the palette (not available with all drivers/hardware).
+Palette is a pointer to as many entries as there are colors.
 <tag/Limits/<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/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strlwr<label id="strlwr"><p>
+<sect1>tgi_setpixel<label id="tgi_setpixel"><p>
 
 <quote>
-See <tt/strlower/.
+<descrip>
+<tag/Function/Plot a pixel on the drawpage with the current color.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setpixel (int x, int y);/
+<tag/Description/Plot a pixel on the drawpage with the current color.
+<tag/Limits/<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 tgi functions.
+<tag/Example/None.
+</descrip>
 </quote>
 
-
-<sect1>strncpy<label id="strncpy"><p>
+<sect1>tgi_setviewpage<label id="tgi_setviewpage"><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__ strcpy (char* s1, const char* s2, size_t n);/
-<tag/Description/The <tt/strncpy/ function copies not more than 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 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 will always return <tt/s1/.
+<tag/Function/Set page to be visible on screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setviewpage (unsigned char page);/
+<tag/Description/If the drawpage and the viewpage are the same then all drawing
+is seen immediately as it is drawn. For double buffered games you can set the
+drawpage to a different page than the viewpage. This lets you draw the next
+screen in the background and when the screen is ready you display it.
 <tag/Limits/<itemize>
 <item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype. If there is no null byte in the first <tt/n/
-bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
-<item>If copying takes place between objects that overlap, the behavior is
-undefined.
+be used in presence of a prototype.
 </itemize>
-<tag/Availability/ISO 9899
-<tag/See also/
-<ref id="strcat" name="strcat">
-<ref id="strcpy" name="strcpy">
-<tag/Example/
-<verb>
-#include <string.h>
-
-static char hello[6];
-
-strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
-hello[5] = '\0';
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/<verb>
+tgi_setdrawpage(1);
+tgi_outtextxy(10, 10, "Hello World");
+tgi_setviewpage(1); // Show page 1
+tgi_setdrawpage(0);
+tgi_outtextxy(10, 10, "Creating next frame");
+...
+tgi_setviewpage(0); // Show page 0
 </verb>
 </descrip>
 </quote>
 
-
-<sect1>strrchr<label id="strrchr"><p>
+<sect1>tgi_textheight<label id="tgi_textheight"><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/Function/Calculate the height of the text in pixels according to
+the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_textheight (const char* s);/
+<tag/Description/Calculate the height of the text in pixels according to
+the current text style.
 <tag/Limits/<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/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strspn<label id="strspn"><p>
+<sect1>tgi_textstyle<label id="tgi_textstyle"><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/Function/Set the style for text output.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_textstyle (unsigned char magx, unsigned char magy, unsigned char dir);/
+<tag/Description/Set the style for text output.
 <tag/Limits/<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="strstr" name="strstr">
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strstr<label id="strstr"><p>
+<sect1>tgi_textwidth<label id="tgi_textwidth"><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 occurance of the string
-<tt/substr/ within <tt/str/. If found, it returns a pointer to the copy,
-otherwise it returns <tt/NULL/.
+<tag/Function/Calculate the width of the text in pixels according to the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_textwidth (const char* s);/
+<tag/Function/Calculate the width of the text in pixels according to the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Description/Calculate the width of the text in pixels according to the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
 <tag/Limits/<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/Availability/cc65
+<tag/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strupper<label id="strupper"><p>
+<sect1>tgi_uninstall<label id="tgi_uninstall"><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/Function/Uninstall the currently loaded driver but do not unload it.
+Will call tgi_done if necessary.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_uninstall (void);/
+<tag/Description/Uninstall the currently loaded driver but do not unload it.
+Will call tgi_done if necessary.
 <tag/Limits/<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/See also/Other tgi functions.
 <tag/Example/None.
 </descrip>
 </quote>
 
-
-<sect1>strupr<label id="strupr"><p>
+<sect1>tgi_unload<label id="tgi_unload"><p>
 
 <quote>
-See <tt/strupper/.
+<descrip>
+<tag/Function/Uninstall, then unload the currently loaded driver.
+Will call tgi_done if necessary.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_unload (void);/
+<tag/Description/Uninstall, then unload the currently loaded driver.
+Will call tgi_done if necessary.
+<tag/Limits/<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 tgi functions.
+<tag/Example/None.
+</descrip>
 </quote>
 
-
-<sect1>textcolor<label id="textcolor"><p>
+<sect1>time<label id="time"><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/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 <tt/errno/ is set to <tt/ENOSYS/.
 <tag/Limits/<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.
+<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/cc65
-<tag/See also/
-<ref id="bgcolor" name="bgcolor">,
-<ref id="bordercolor" name="bordercolor">
+<tag/Availability/ISO 9899
 <tag/Example/None.
 </descrip>
 </quote>
@@ -3626,11 +5686,14 @@ old mode (cursor position, color and so on) are saved and restored together
 with the mode.
 <tag/Limits/<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="slow" name="slow">
+<ref id="slow" name="slow">,
+<ref id="videomode" name="videomode">
 <tag/Example/None.
 </descrip>
 </quote>
@@ -3728,11 +5791,15 @@ name="remove">/ instead, which is a native ANSI C function and does the same.
 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
+<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;
 
@@ -3743,6 +5810,7 @@ if (unlink (FILENAME) == 0) {
 } else {
     printf ("There was a problem deleting %s\n", FILENAME);
 }
+</verb>
 </descrip>
 </quote>
 
@@ -3804,6 +5872,34 @@ used in presence of a prototype.
 </quote>
 
 
+<sect1>videomode<label id="videomode"><p>
+
+<quote>
+<descrip>
+<tag/Function/Switch to either 40 or 80 column mode.
+<tag/Header/<tt/<ref id="apple2enh.h" name="apple2enh.h">,
+<ref id="c128.h" name="c128.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ videomode (unsigned Mode);/
+<tag/Description/Switch to 40 or 80 column mode depending on the argument. If
+the requested mode is already active, nothing happens. The old mode is returned
+from the call.
+<tag/Limits/<itemize>
+<item>The function is specific to the C128 and enhanced Apple //e.
+<item>This function replaces <ref id="toggle_videomode"
+name="toggle_videomode">.
+<item>The function is only available as fastcall function, so it may only be
+used in presence of a prototype.
+</itemize>
+<tag/Availability/C128 and enhanced Apple //e
+<tag/See also/
+<ref id="fast" name="fast">,
+<ref id="slow" name="slow">,
+<ref id="toggle_videomode" name="toggle_videomode">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>wherex<label id="wherex"><p>
 
 <quote>
@@ -3845,5 +5941,3 @@ cursor. Zero is returned for the uppermost screen position.
 
 
 </article>
-
-