]> git.sur5r.net Git - cc65/blobdiff - doc/funcref.sgml
Merge pull request #96 from groessler/something_to_pull
[cc65] / doc / funcref.sgml
index a0759c5c617ac3f54e2e28a57d568aaa7778b571..ba8fb8abc56793fc7bd1159ffb254f5dd30cca6a 100644 (file)
@@ -1,4 +1,4 @@
-<!doctype linuxdoc system>
+<!doctype linuxdoc system>      <!-- -*- text-mode -*- -->
 
 <article>
 <title>cc65 function reference
@@ -112,7 +112,10 @@ function.
 
 <sect1><tt/atmos.h/<label id="atmos.h"><p>
 
-(incomplete)
+<itemize>
+<item><ref id="atmos_load" name="atmos_load">
+<item><ref id="atmos_save" name="atmos_save">
+</itemize>
 
 
 <sect1><tt/c128.h/<label id="c128.h"><p>
@@ -138,6 +141,40 @@ function.
 </itemize>
 
 
+<sect1><tt/cbm.h/<label id="cbm.h"><p>
+
+<itemize>
+<item><ref id="cbm_k_acptr" name="cbm_k_acptr">
+<item><ref id="cbm_k_basin" name="cbm_k_basin">
+<item><ref id="cbm_k_bsout" name="cbm_k_bsout">
+<item><ref id="cbm_k_chkin" name="cbm_k_chkin">
+<item><ref id="cbm_k_ciout" name="cbm_k_ciout">
+<item><ref id="cbm_k_ckout" name="cbm_k_ckout">
+<item><ref id="cbm_k_clall" name="cbm_k_clall">
+<item><ref id="cbm_k_close" name="cbm_k_close">
+<item><ref id="cbm_k_clrch" name="cbm_k_clrch">
+<item><ref id="cbm_k_getin" name="cbm_k_getin">
+<item><ref id="cbm_k_iobase" name="cbm_k_iobase">
+<item><ref id="cbm_k_listen" name="cbm_k_listen">
+<item><ref id="cbm_k_load" name="cbm_k_load">
+<item><ref id="cbm_k_open" name="cbm_k_open">
+<item><ref id="cbm_k_readst" name="cbm_k_readst">
+<item><ref id="cbm_k_save" name="cbm_k_save">
+<item><ref id="cbm_k_setlfs" name="cbm_k_setlfs">
+<item><ref id="cbm_k_setnam" name="cbm_k_setnam">
+<item><ref id="cbm_k_unlsn" name="cbm_k_unlsn">
+<!-- <item><ref id="cbm_load" name="cbm_load"> -->
+<!-- <item><ref id="cbm_open" name="cbm_open"> -->
+<!-- <item><ref id="cbm_opendir" name="cbm_opendir"> -->
+<!-- <item><ref id="cbm_read" name="cbm_read"> -->
+<!-- <item><ref id="cbm_readdir" name="cbm_readdir"> -->
+<!-- <item><ref id="cbm_save" name="cbm_save"> -->
+<!-- <item><ref id="cbm_write" name="cbm_write"> -->
+</itemize>
+
+(incomplete)
+
+
 <sect1><tt/cbm510.h/<label id="cbm510.h"><p>
 
 <itemize>
@@ -243,6 +280,24 @@ function.
 Low-level disk I/O API.
 
 
+<sect1><tt/dirent.h/<label id="dirent.h"><p>
+
+<itemize>
+<item><ref id="_DE_ISDIR" name="_DE_ISDIR">
+<item><ref id="_DE_ISLBL" name="_DE_ISLBL">
+<item><ref id="_DE_ISLNK" name="_DE_ISLNK">
+<item><ref id="_DE_ISREG" name="_DE_ISREG">
+<item><ref id="closedir" name="closedir">
+<item><ref id="opendir" name="opendir">
+<item><ref id="readdir" name="readdir">
+<item><ref id="rewinddir" name="rewinddir">
+<item><ref id="seekdir" name="seekdir">
+<item><ref id="telldir" name="telldir">
+</itemize>
+
+(incomplete)
+
+
 <sect1><tt/em.h/<label id="em.h"><p>
 
 <itemize>
@@ -575,6 +630,7 @@ communication.
 <item><ref id="tgi_clear" name="tgi_clear">
 <item><ref id="tgi_done" name="tgi_done">
 <item><ref id="tgi_ellipse" name="tgi_ellipse">
+<item><ref id="tgi_free_vectorfont" name="tgi_free_vectorfont">
 <item><ref id="tgi_getaspectratio" name="tgi_getaspectratio">
 <item><ref id="tgi_getcolor" name="tgi_getcolor">
 <item><ref id="tgi_getcolorcount" name="tgi_getcolorcount">
@@ -587,15 +643,19 @@ communication.
 <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_gettextheight" name="tgi_gettextheight">
+<item><ref id="tgi_gettextwidth" name="tgi_gettextwidth">
 <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_install_vectorfont" name="tgi_install_vectorfont">
 <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_driver" name="tgi_load_driver">
+<item><ref id="tgi_load_vectorfont" name="tgi_load_vectorfont">
 <item><ref id="tgi_outtext" name="tgi_outtext">
 <item><ref id="tgi_outtextxy" name="tgi_outtextxy">
 <item><ref id="tgi_setaspectratio" name="tgi_setaspectratio">
@@ -604,9 +664,8 @@ communication.
 <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_gettextheight" name="tgi_gettextheight">
+<item><ref id="tgi_settextscale" name="tgi_settextscale">
 <item><ref id="tgi_settextstyle" name="tgi_settextstyle">
-<item><ref id="tgi_gettextwidth" name="tgi_gettextwidth">
 <item><ref id="tgi_uninstall" name="tgi_uninstall">
 <item><ref id="tgi_unload" name="tgi_unload">
 </itemize>
@@ -666,6 +725,105 @@ communication.
 
 <sect>Alphabetical function reference<p>
 
+<sect1>_DE_ISDIR<label id="_DE_ISDIR"><p>
+
+<quote>
+<descrip>
+<tag/Function/Determine if a directory entry specifies a directory.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/int _DE_ISDIR(unsigned char type);/
+<tag/Description/The function is called with the type of a directory entry
+taken from a <tt/struct dirent/ and returns true if the entry designates
+a directory.
+<tag/Limits/
+<itemize>
+<item>The function is actually a macro.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="_DE_ISLBL" name="_DE_ISLBL">,
+<ref id="_DE_ISLNK" name="_DE_ISLNK">,
+<ref id="_DE_ISREG" name="_DE_ISREG">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>_DE_ISLBL<label id="_DE_ISLBL"><p>
+
+<quote>
+<descrip>
+<tag/Function/Determine if a directory entry specifies a disk label.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/int _DE_ISLBL(unsigned char type);/
+<tag/Description/The function is called with the type of a directory entry
+taken from a <tt/struct dirent/ and returns true if the entry designates
+a disk label.
+<tag/Limits/
+<itemize>
+<item>The function is actually a macro.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="_DE_ISDIR" name="_DE_ISDIR">,
+<ref id="_DE_ISLNK" name="_DE_ISLNK">,
+<ref id="_DE_ISREG" name="_DE_ISREG">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>_DE_ISLNK<label id="_DE_ISLNK"><p>
+
+<quote>
+<descrip>
+<tag/Function/Determine if a directory entry specifies a link.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/int _DE_ISLNK(unsigned char type);/
+<tag/Description/The function is called with the type of a directory entry
+taken from a <tt/struct dirent/ and returns true if the entry designates
+a link.
+<tag/Limits/
+<itemize>
+<item>The function is actually a macro.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="_DE_ISDIR" name="_DE_ISDIR">,
+<ref id="_DE_ISLBL" name="_DE_ISLBL">,
+<ref id="_DE_ISREG" name="_DE_ISREG">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>_DE_ISREG<label id="_DE_ISREG"><p>
+
+<quote>
+<descrip>
+<tag/Function/Determine if a directory entry specifies a regular file.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/int _DE_ISREG(unsigned char type);/
+<tag/Description/The function is called with the type of a directory entry
+taken from a <tt/struct dirent/ and returns true if the entry designates
+a regular file.
+<tag/Limits/
+<itemize>
+<item>The function is actually a macro.
+<item>A "regular file" means anything with data in it. This might still mean
+that special processing is needed, when accessing the file. Relative files of
+the CBM systems are classified as being "regular" files, for example.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="_DE_ISDIR" name="_DE_ISDIR">,
+<ref id="_DE_ISLBL" name="_DE_ISLBL">,
+<ref id="_DE_ISLNK" name="_DE_ISLNK">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>_heapadd<label id="_heapadd"><p>
 
 <quote>
@@ -1156,6 +1314,40 @@ used in presence of a prototype.
 </quote>
 
 
+<sect1>atmos_load<label id="atmos_load"><p>
+
+<quote>
+<descrip>
+<tag/Function/Load Atmos tape.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_load(const char* name);/
+<tag/Description/<tt/atmos_load/ reads a memory block from tape.
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_save" name="atmos_save">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>atmos_save<label id="atmos_save"><p>
+
+<quote>
+<descrip>
+<tag/Function/Save Atmos tape.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_save(const char* name, const void* start, const void* end);/
+<tag/Description/<tt/atmos_save/ writes a memory block to tape.
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_load" name="atmos_load">
+<tag/Example/<verb>
+atmos_save("hires", 0xa000, 0xc000);
+</verb>
+</descrip>
+</quote>
+
+
 <sect1>atoi<label id="atoi"><p>
 
 <quote>
@@ -1245,125 +1437,616 @@ used in presence of a prototype.
 <tag/Description/The function will set a new border color. It returns the old
 (current) border color.
 <tag/Limits/<itemize>
-<item>Border colors are system dependent. The function may have no effect
-on systems where the border color cannot be changed.
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<item>Border colors are system dependent. The function may have no effect
+on systems where the border color cannot be changed.
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="bgcolor" name="bgcolor">,
+<ref id="textcolor" name="textcolor">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>bsearch<label id="bsearch"><p>
+
+<quote>
+<descrip>
+<tag/Function/Do a binary search in a sorted array.
+<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
+<tag/Declaration/<tt/void* __fastcall__ bsearch (const void* key,
+const void* base, size_t n, size_t size,
+int (*cmp) (const void*, const void*));/
+<tag/Description/<tt/bsearch/ searches a sorted array for a member that
+matches the one pointed to by <tt/key/. <tt/base/ is the address of the array,
+<tt/n/ is the number of elements, <tt/size/ the size of an element and <tt/cmp/
+the function used to compare the members against the key. The function returns
+a pointer to the member found, or <tt/NULL/ if there was no match.
+<tag/Limits/
+<itemize>
+<item>The contents of the array must be sorted in ascending order according to
+the compare function given.
+<item>If there are multiple members that match the key, the function will
+return one of the members.
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/ISO 9899
+<tag/See also/
+<ref id="qsort" name="qsort">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>bzero<label id="bzero"><p>
+
+<quote>
+<descrip>
+<tag/Function/Fill a memory area with zeroes.
+<tag/Header/<tt/<ref id="string.h" name="string.h">/
+<tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
+<tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
+zero.
+<tag/Limits/
+<itemize>
+<item>The function is non standard and therefore only available in non ANSI
+mode. You should use <tt/<ref id="memset" name="memset">/ instead.
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="_swap" name="_swap">,
+<ref id="memcpy" name="memcpy">,
+<ref id="memmove" name="memmove">,
+<ref id="memset" name="memset">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>c64mode<label id="c64mode"><p>
+
+<quote>
+<descrip>
+<tag/Function/Switch the C128 into C64 compatible mode.
+<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
+<tag/Declaration/<tt/void c64mode (void);/
+<tag/Description/The function will cause the machine to reboot into C64 mode.
+<tag/Limits/<itemize>
+<item>The function is specific to the C128.
+<item>The function will not return to the caller.
+</itemize>
+<tag/Availability/C128
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>calloc<label id="calloc"><p>
+
+<quote>
+<descrip>
+<tag/Function/Allocate and clear memory.
+<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
+<tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
+<tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
+of size <tt/size/, clears the whole block with binary zeroes and returns a
+pointer to it. On error (not enough memory available), <tt/calloc/ returns
+<tt/NULL/.
+<tag/Limits/
+<itemize>
+<item>Clearing the memory may not have the expected effect on all platforms:
+pointers in the block may not be <tt/NULL/ and floating point variables may
+not be zero (0.0). In other words: The "clearing" effect of this function
+should be used with care for portable programs.
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/ISO 9899
+<tag/See also/
+<ref id="_heapadd" name="_heapadd">,
+<ref id="_heapblocksize" name="_heapblocksize">,
+<ref id="_heapmaxavail" name="_heapmaxavail">,
+<ref id="_heapmemavail" name="_heapmemavail">,
+<ref id="free" name="free">,
+<ref id="malloc" name="malloc">,
+<ref id="realloc" name="realloc">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_acptr<label id="cbm_k_acptr"><p>
+
+<quote>
+<descrip>
+<tag/Function/Input byte from serial bus
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned char cbm_k_acptr (void);/
+<tag/Description/The function returns a byte of data, which it
+gets from the current TALKer on the serial bus.
+In order to receive the data, the device must have previously been
+sent a command to TALK and a secondary address if it needs one.
+<tag/Limits/<itemize>
+<item>
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cbm_k_talk" name="cbm_k_talk">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_basin<label id="cbm_k_basin"><p>
+
+<quote>
+<descrip>
+<tag/Function/Input a Character from the Current Device
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned char cbm_k_basin (void);/
+<tag/Description/The function returns a character from the current input device.
+Device must first have been OPENed and then designated as the input channel by the CHKIN routine.
+When this function is called, the next byte of data available from the device is returned.
+Exception is the routine for the keyboard device (which is the default input device).
+<tag/Limits/<itemize>
+<item>
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cbm_k_open" name="cbm_k_open">,
+<ref id="cbm_k_chkin" name="cbm_k_chkin">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_bsout<label id="cbm_k_bsout"><p>
+
+<quote>
+<descrip>
+<tag/Function/Output a byte
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void __fastcall__ cbm_k_bsout (unsigned char C);/
+<tag/Description/Function sends the character to the current output device.
+Unless a device has been OPENed and designated as the
+current output channel using the CHKOUT routine, the character is
+printed to the screen, which is the default output device.  If the
+cassette is the current device, outputting a byte will only add it to
+the buffer. No actual transmission of data will occur until the
+192-byte buffer is full.
+<tag/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="cbm_k_open" name="cbm_k_open">,
+<ref id="cbm_k_chkin" name="cbm_k_chkout">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_chkin<label id="cbm_k_chkin"><p>
+
+<quote>
+<descrip>
+<tag/Function/Designate a Logical File As the Current Input Channel
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ cbm_k_chkin (unsigned char FN);/
+<tag/Description/If you wish to
+get data from any device other than the keyboard, this function must be
+called after OPENing the device, before you can get a data byte with
+the cbm_k_basin or cbm_k_getin routine.  When called, the routine will designate
+the logical file whose file number was supplied as the
+current file, its device as the current device, and its secondary
+address as the current secondary address.  If the device on the
+channel is a serial device, which requires a TALK command and
+sometimes a secondary address, function will send them over the
+serial bus.
+<tag/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="cbm_k_open" name="cbm_k_open">,
+<ref id="cbm_k_basin" name="cbm_k_basin">,
+<ref id="cbm_k_getin" name="cbm_k_getin">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_ciout<label id="cbm_k_ciout"><p>
+
+<quote>
+<descrip>
+<tag/Function/Transmit a byte over the serial bus
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void __fastcall__ cbm_k_ciout (unsigned char C);/
+<tag/Description/Purpose of this function is to send a byte of data over
+the serial bus.  In order for the data to be received, the serial
+device must have first been commanded to LISTEN and been given a
+secondary address if necessary.  This routine always buffers the
+current character, and defers sending it until the next byte is
+buffered.  When the UNLISTEN command is sent, the last byte will be
+sent with an End or Identify (EOI).
+<tag/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="cbm_k_listen" name="cbm_k_listen">,
+<ref id="cbm_k_unlsn" name="cbm_k_unlsn">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_ckout<label id="cbm_k_ckout"><p>
+
+<quote>
+<descrip>
+<tag/Function/Designate a Logical File As the Current Output Channel
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ cbm_k_ckout (unsigned char FN);/
+<tag/Description/If you wish to
+output data to any device other than the screen, this routine must be
+called after OPENing the device, and before you output a data byte
+with the cbm_k_bsout() function.  When called, the function will designate the
+logical file whose file number was supplied as the current
+file, its device as the current device, and its secondary address as
+the current secondary address.  If the device on the channel uses the
+serial bus, and therefore requires a LISTEN command and possibly a
+secondary address, this information will be sent on the bus.
+<tag/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="cbm_k_bsout" name="cbm_k_bsout">,
+<ref id="cbm_k_listen" name="cbm_k_listen">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_clall<label id="cbm_k_clall"><p>
+
+<quote>
+<descrip>
+<tag/Function/Close All Logical I/O Files
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void cbm_k_clall (void);/
+<tag/Description/It closes all
+open files, by resetting the index into open files to
+zero and restores the default I/O devices.
+<tag/Limits/<itemize>
+<item>
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cbm_k_open" name="cbm_k_open">,
+<ref id="cbm_k_close" name="cbm_k_close">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_close<label id="cbm_k_close"><p>
+
+<quote>
+<descrip>
+<tag/Function/Close a Logical I/O File
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void __fastcall__ cbm_k_close (unsigned char FN);/
+<tag/Description/It is used to
+close a logical file after all I/O operations involving that file have
+been completed.
+<tag/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="cbm_k_open" name="cbm_k_open">,
+<ref id="cbm_k_clall" name="cbm_k_clall">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_clrch<label id="cbm_k_clrch"><p>
+
+<quote>
+<descrip>
+<tag/Function/Restore Current Input and Output Devices to the Default Devices
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void cbm_k_clrch (void);/
+<tag/Description/It sets the
+current input device to the keyboard, and the current output device to
+the screen.  Also, if the current input device was formerly a serial
+device, the routine sends it an UNTALK command on the serial bus, and
+if a serial device was formerly the current output device, the routine
+sends it an UNLISTEN command.
+<tag/Limits/<itemize>
+<item>
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cbm_k_chkin" name="cbm_k_chkin">,
+<ref id="cbm_k_ckout" name="cbm_k_ckout">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_getin<label id="cbm_k_getin"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get One Byte from the Input Device
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned char cbm_k_getin (void);/
+<tag/Description/Function gets a character from the current input device.
+<tag/Limits/<itemize>
+<item>
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cbm_k_basin" name="cbm_k_basin">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_iobase<label id="cbm_k_iobase"><p>
+
+<quote>
+<descrip>
+<tag/Function/Return Base Address of Memory-Mapped I/O Devices
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned cbm_k_iobase (void);/
+<tag/Description/This function returns the address of
+the memory section where the memory mapped I/O devices are located. This
+address can then be used with an offset to access the memory mapped I/O
+devices in the Commodore 64. The offset is the number of locations from
+the beginning of the page on which the I/O register you want is located.
+This function exists to provide compatibility between the Commodore 64,
+VIC-20, and future models of the Commodore 64. If the I/O locations for
+a program are set by a call to this function, they should
+still remain compatible with future versions of the Commodore 64, the
+KERNAL and BASIC.
+<tag/Limits/<itemize>
+<item>
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_listen<label id="cbm_k_listen"><p>
+
+<quote>
+<descrip>
+<tag/Function/Command a device on the serial bus to LISTEN
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void __fastcall__ cbm_k_listen (unsigned char dev);/
+<tag/Description/This function will command a device on the serial bus to
+receive data. The KERNAL routine will OR the supplied device number bit by bit
+to convert it to a listen address, then transmits this data as a command on
+the serial bus. The specified device will then go into listen mode, and
+be ready to accept information.
+<tag/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="cbm_k_unlsn" name="cbm_k_unlsn">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_load<label id="cbm_k_load"><p>
+
+<quote>
+<descrip>
+<tag/Function/Load RAM from a Device
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned int __fastcall__ cbm_k_load(unsigned char flag, unsigned addr);/
+<tag/Description/This function LOADs data bytes from any input device directly into the memory.
+It can also be used for a verify operation, comparing data from a device with the data already in
+memory, while leaving the data stored in RAM unchanged.
+The flag must be set to 0 for a LOAD operation, or 1 for a
+verify, If the input device is OPENed with a secondary address (SA) of 0
+the header information from the device is ignored. In this case, the starting address for the load must be supplied.
+If the device is addressed with a secondary address of 1, then the data is
+loaded into memory starting at the location specified by the header.
+Function returns the address of the highest RAM location loaded.
+Before this function can be called, the KERNAL SETLFS, and SETNAM
+routines must be called.
+<tag/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="cbm_k_save" name="cbm_k_save">,
+<ref id="cbm_k_setlfs" name="cbm_k_setlfs">,
+<ref id="cbm_k_setnam" name="cbm_k_setnam">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_open<label id="cbm_k_open"><p>
+
+<quote>
+<descrip>
+<tag/Function/Open a Logical I/O File
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned char cbm_k_open (void);/
+<tag/Description/This function assigns a logical file to a device, so that it can be used for
+Input/Output operations. In order to specify the logical file number,
+the device number, and the secondary address if any, the cbm_k_setlfs() function must first be called.
+Likewise, in order to designate the filename, the cbm_k_setnam() function must be used first.  After these two
+functions are called, cbm_k_open() is then called.
+<tag/Limits/<itemize>
+<item>
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cbm_k_close" name="cbm_k_close">,
+<ref id="cbm_k_setlfs" name="cbm_k_setlfs">,
+<ref id="cbm_k_setnam" name="cbm_k_setnam">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_readst<label id="cbm_k_readst"><p>
+
+<quote>
+<descrip>
+<tag/Function/Read status word
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned char cbm_k_readst (void);/
+<tag/Description/This function returns the current status of the I/O devices. It is usually called after new communication to an I/O device and gives information about device status, or errors that have occurred during the I/O operation.
+<tag/Limits/<itemize>
+<item>
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_save<label id="cbm_k_save"><p>
+
+<quote>
+<descrip>
+<tag/Function/Save RAM to a Device
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ cbm_k_save(unsigned int start, unsigned int end)/
+<tag/Description/This function saves a section of memory. The cbm_k_setlfs() and cbm_k_setnam() functions must be
+used before calling this function. However, a file name is not required to
+SAVE to device 1 (the Datassette(TM) recorder). Any attempt to save to
+other devices without using a file name results in an error. NOTE: Device 0 (the keyboard), device 2 (RS-232), and device 3 (the screen) cannot be SAVEd to. If the attempt is made, an error occurs, and the SAVE is stopped.
+<tag/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="bgcolor" name="bgcolor">,
-<ref id="textcolor" name="textcolor">
+<ref id="cbm_k_load" name="cbm_k_load">,
+<ref id="cbm_k_setlfs" name="cbm_k_setlfs">,
+<ref id="cbm_k_setnam" name="cbm_k_setnam">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>bsearch<label id="bsearch"><p>
+<sect1>cbm_k_setlfs<label id="cbm_k_setlfs"><p>
 
 <quote>
 <descrip>
-<tag/Function/Do a binary search in a sorted array.
-<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
-<tag/Declaration/<tt/void* __fastcall__ bsearch (const void* key,
-const void* base, size_t n, size_t size,
-int (*cmp) (const void*, const void*));/
-<tag/Description/<tt/bsearch/ searches a sorted array for a member that
-matches the one pointed to by <tt/key/. <tt/base/ is the address of the array,
-<tt/n/ is the number of elements, <tt/size/ the size of an element and <tt/cmp/
-the function used to compare the members against the key. The function returns
-a pointer to the member found, or <tt/NULL/ if there was no match.
-<tag/Limits/
-<itemize>
-<item>The contents of the array must be sorted in ascending order according to
-the compare function given.
-<item>If there are multiple members that match the key, the function will
-return one of the members.
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<tag/Function/Set up a logical file
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void __fastcall__ cbm_k_setlfs (unsigned char LFN, unsigned char DEV, unsigned char SA);/
+<tag/Description/This functions sets up the logical file by setting its number, device address,
+and secondary address.
+<tag/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="qsort" name="qsort">
+<ref id="cbm_k_setnam" name="cbm_k_setnam">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>bzero<label id="bzero"><p>
+<sect1>cbm_k_setnam<label id="cbm_k_setnam"><p>
 
 <quote>
 <descrip>
-<tag/Function/Fill a memory area with zeroes.
-<tag/Header/<tt/<ref id="string.h" name="string.h">/
-<tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
-<tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
-zero.
-<tag/Limits/
-<itemize>
-<item>The function is non standard and therefore only available in non ANSI
-mode. You should use <tt/<ref id="memset" name="memset">/ instead.
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<tag/Function/Set Filename Parameters
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void __fastcall__ cbm_k_setnam (const char* Name);/
+<tag/Description/This function is used to set up the file name for the OPEN,
+SAVE, or LOAD operations.
+<tag/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="_swap" name="_swap">,
-<ref id="memcpy" name="memcpy">,
-<ref id="memmove" name="memmove">,
-<ref id="memset" name="memset">,
+<ref id="cbm_k_open" name="cbm_k_open">,
+<ref id="cbm_k_load" name="cbm_k_load">,
+<ref id="cbm_k_save" name="cbm_k_save">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>c64mode<label id="c64mode"><p>
+<sect1>cbm_k_talk<label id="cbm_k_talk"><p>
 
 <quote>
 <descrip>
-<tag/Function/Switch the C128 into C64 compatible mode.
-<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
-<tag/Declaration/<tt/void c64mode (void);/
-<tag/Description/The function will cause the machine to reboot into C64 mode.
+<tag/Function/Commands device to TALK
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void __fastcall__ cbm_k_talk (unsigned char dev);/
+<tag/Description/When called, it ORs the device number with the TALK code (64, $40) and sends it on the serial
+bus. This commands the device to TALK.
 <tag/Limits/<itemize>
-<item>The function is specific to the C128.
-<item>The function will not return to the caller.
+<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/Availability/cc65
+<tag/See also/
+<ref id="cbm_k_acptr" name="cbm_k_acptr">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>calloc<label id="calloc"><p>
+<sect1>cbm_k_unlsn<label id="cbm_k_unlsn"><p>
 
 <quote>
 <descrip>
-<tag/Function/Allocate and clear memory.
-<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
-<tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
-<tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
-of size <tt/size/, clears the whole block with binary zeroes and returns a
-pointer to it. On error (not enough memory available), <tt/calloc/ returns
-<tt/NULL/.
-<tag/Limits/
-<itemize>
-<item>Clearing the memory may not have the expected effect on all platforms:
-pointers in the block may not be <tt/NULL/ and floating point variables may
-not be zero (0.0). In other words: The "clearing" effect of this function
-should be used with care for portable programs.
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<tag/Function/Send an UNLISTEN command
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void cbm_k_unlsn (void);/
+<tag/Description/This function commands all devices on the serial bus to
+stop receiving data from the host computer (i.e., UNLISTEN). Calling this
+function results in an UNLISTEN command being transmitted on the serial
+bus. Only devices previously commanded to LISTEN are affected. This
+function is normally used after the host computer is finished sending data
+to external devices. Sending the UNLISTEN commands the listening devices
+to get off the serial bus so it can be used for other purposes.
+<tag/Limits/<itemize>
+<item>
 </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="free" name="free">,
-<ref id="malloc" name="malloc">,
-<ref id="realloc" name="realloc">
+<ref id="cbm_k_listen" name="cbm_k_listen">
 <tag/Example/None.
 </descrip>
 </quote>
@@ -1578,6 +2261,29 @@ be used in presence of a prototype.
 </quote>
 
 
+<sect1>closedir<label id="closedir"><p>
+
+<quote>
+<descrip>
+<tag/Function/Close a directory.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/int __fastcall__ closedir (DIR* dir);/
+<tag/Description/The function closes the given directory descriptor. It returns
+zero on success and -1 on error. If an error occurs, the cause can be determined
+by reading the <tt/errno/ variable.
+<tag/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/See also/
+<ref id="opendir" name="opendir">,
+<ref id="readdir" name="readdir">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>creat<label id="creat"><p>
 
 <quote>
@@ -3863,6 +4569,29 @@ cc65 allows to pass this argument, it is ignored.
 </quote>
 
 
+<sect1>opendir<label id="opendir"><p>
+
+<quote>
+<descrip>
+<tag/Function/Open a directory.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/DIR* __fastcall__ opendir (const char* name);/
+<tag/Description/<tt/opendir/ opens a directory and returns the direcory
+descriptor associated with it. On error, NULL is returned and an error code is
+stored in <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/POSIX 1003.1
+<tag/See also/
+<ref id="closedir" name="closedir">,
+<ref id="readdir" name="readdir">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>peekbsys<label id="peekbsys"><p>
 
 <quote>
@@ -4081,6 +4810,45 @@ had been used with an argument of 1.
 </quote>
 
 
+<sect1>readdir<label id="readdir"><p>
+
+<quote>
+<descrip>
+<tag/Function/Read a directory.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/struct dirent* __fastcall__ readdir (DIR* dir);/
+<tag/Description/<tt/readdir/ reads the next directory entry from the directory
+stream pointed to by <tt/dir/. It stores the data in a <tt/dirent/ structure
+and returns a pointer to it. If the end of directory is reached, or an error
+occurs, NULL is returned. In case of errors, an error code is stored into
+<tt/errno/.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+<item>The returned pointer may point to a statically allocated instance of
+<tt/struct dirent/, so it may get overwritten by subsequent calls to
+<tt/readdir/.
+<item>On several platforms, namely the CBMs and the Atari, the disk drives get
+confused when opening/closing files between directory reads. So for example a
+program that reads the list of files on a disk, and after each call to
+<tt/readdir/, opens the file to process it, will fail.<newline>
+Possible solutions are reading the directory into memory before processing the
+file list, or to reset the directory by seeking to the correct position after
+opening/closing a file:
+<verb>
+        seekdir (DIR, telldir (DIR));
+</verb>
+Platforms known to work without problems are: Apple.
+</itemize>
+<tag/Availability/POSIX 1003.1
+<tag/See also/
+<ref id="closedir" name="closedir">,
+<ref id="opendir" name="opendir">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>realloc<label id="realloc"><p>
 
 <quote>
@@ -4266,6 +5034,28 @@ be used in presence of a prototype.
 </quote>
 
 
+<sect1>rewinddir<label id="rewinddir"><p>
+
+<quote>
+<descrip>
+<tag/Function/Reset a directory stream.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/void __fastcall__ rewinddir (DIR* dir);/
+<tag/Description/<tt/rewinddir/ sets the position of the directory stream
+pointed to by <tt/dir/ to the start of the directory.
+<tag/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/See also/
+<ref id="seekdir" name="seekdir">,
+<ref id="telldir" name="telldir">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>screensize<label id="screensize"><p>
 
 <quote>
@@ -4290,26 +5080,43 @@ be used in presence of a prototype.
 </quote>
 
 
-<sect1>ser_close<label id="ser_close"><p>
+<sect1>seekdir<label id="seekdir"><p>
 
 <quote>
 <descrip>
-<tag/Function/Close the port and disable interrupts
-<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
-<tag/Declaration/<tt/unsigned char __fastcall__ ser_close (const struct ser_params* params);/
-<tag/Description/Open the port by setting the port parameters and enable interrupts.
+<tag/Function/Set the position of a directory stream.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/void __fastcall__ seekdir (DIR* dir, long offset);/
+<tag/Description/<tt/seekdir/ sets the position of the directory stream
+pointed to by <tt/dir/ to the value given in <tt/offset/, which should be a
+value returned by <tt/<ref id="telldir" name="telldir">/.
 <tag/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/See also/
+<ref id="rewinddir" name="rewinddir">,
+<ref id="telldir" name="telldir">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>ser_close<label id="ser_close"><p>
+
+<quote>
+<descrip>
+<tag/Function/Close the port and disable interrupts
+<tag/Header/<tt/<ref id="serial.h" name="serial.h">/
+<tag/Declaration/<tt/unsigned char ser_close (void);/
+<tag/Description/Close the port by clearing buffers and disable interrupts.
 <tag/Availability/cc65
 <tag/See also/Other serial functions.
 <tag/Example/
 <verb>
 #include <serial.h>
 
-extern char comlynx[];
-
 static void initialize(){
   struct ser_params params = {
     SER_BAUD_9600,
@@ -4318,7 +5125,7 @@ static void initialize(){
     SER_PAR_MARK,
     SER_HS_NONE
   };
-  ser_install(&amp;comlynx); // This will activate the ComLynx
+  ser_install(lynx_comlynx); // This will activate the ComLynx
   CLI();
   ser_open(&amp;params);
 }
@@ -4374,9 +5181,7 @@ used in presence of a prototype.
 <ref id="ser_uninstall" name="ser_uninstall">,
 <ref id="ser_unload" name="ser_unload">
 <tag/Example/<verb>
-extern char lynxser[]; //Include the driver statically instead of loading it.
-
-ser_install(&amp;lynxser);
+ser_install(lynx_comlynx); //Include the driver statically instead of loading it.
 </verb>
 </descrip>
 </quote>
@@ -4409,7 +5214,7 @@ be used in presence of a prototype.
 <descrip>
 <tag/Function/Load and install a serial driver.
 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
-<tag/Declaration/<tt/void __fastcall__ ser_load_driver (const char *name);/
+<tag/Declaration/<tt/unsigned char __fastcall__ ser_load_driver (const char *name);/
 <tag/Description/Load and install the driver by name.
 Will just load the driver and check if loading was successful.
 <tag/Limits/<itemize>
@@ -4441,8 +5246,6 @@ be used in presence of a prototype.
 <verb>
 #include <serial.h>
 
-extern char comlynx[];
-
 static void initialize(){
   struct ser_params params = {
     SER_BAUD_9600,
@@ -4451,7 +5254,7 @@ static void initialize(){
     SER_PAR_MARK,
     SER_HS_NONE
   };
-  ser_install(&amp;comlynx); // This will activate the ComLynx
+  ser_install(lynx_comlynx); // This will activate the ComLynx
   CLI();
   ser_open(&amp;params);
 }
@@ -4490,7 +5293,7 @@ ser_put('A');
 <descrip>
 <tag/Function/Return the serial port status.
 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
-<tag/Declaration/<tt/unsigned char __fastcall__ ser_put (unsigned char* status);/
+<tag/Declaration/<tt/unsigned char __fastcall__ ser_status (unsigned char* status);/
 <tag/Description/Return the serial port status.
 <tag/Limits/<itemize>
 <item>The function is only available as fastcall function, so it may only
@@ -4509,7 +5312,7 @@ be used in presence of a prototype.
 <descrip>
 <tag/Function/Uninstall the currently loaded driver but do not unload it.
 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
-<tag/Declaration/<tt/void ser_uninstall (void);/
+<tag/Declaration/<tt/unsigned char ser_uninstall (void);/
 <tag/Description/Uninstall the currently loaded driver but do not unload it.
 <tag/Availability/cc65
 <tag/See also/Other serial functions.
@@ -4523,12 +5326,8 @@ be used in presence of a prototype.
 <descrip>
 <tag/Function/Uninstall, then unload the currently loaded driver.
 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
-<tag/Declaration/<tt/void __fastcall__ ser_unload (void);/
+<tag/Declaration/<tt/unsigned char ser_unload (void);/
 <tag/Description/Uninstall, then unload the currently loaded 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 serial functions.
 <tag/Example/None.
@@ -5327,6 +6126,29 @@ See <tt/strupper/.
 </quote>
 
 
+<sect1>telldir<label id="telldir"><p>
+
+<quote>
+<descrip>
+<tag/Function/Return the current position of a directory stream.
+<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
+<tag/Declaration/<tt/long __fastcall__ telldir (DIR* dir);/
+<tag/Description/<tt/telldir/ returns the current position of a directory
+stream. The return value may be used in subsequent calls to
+<tt/<ref id="seekdir" name="seekdir">/.
+<tag/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/See also/
+<ref id="seekdir" name="seekdir">,
+<ref id="telldir" name="telldir">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>textcolor<label id="textcolor"><p>
 
 <quote>
@@ -5497,6 +6319,27 @@ tgi_ellipse (50, 40, 40, 20);
 </quote>
 
 
+<sect1>tgi_free_vectorfont<label id="tgi_free_vectorfont"><p>
+
+<quote>
+<descrip>
+<tag/Function/Free a vector font that was previously loaded into memory.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_free_vectorfont (const tgi_vectorfont* font);/
+<tag/Description/Free a vector font that was previously loaded into memory.
+<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="tgi_load_vectorfont" name="tgi_load_vectorfont">,
+<ref id="tgi_install_vectorfont" name="tgi_install_vectorfont">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>tgi_getaspectratio<label id="tgi_getaspectratio"><p>
 
 <quote> <descrip> <tag/Function/Return the pixel aspect ratio.
@@ -5787,8 +6630,7 @@ name="tgi_clear">/ after <tt/tgi_init/.
 <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_install(tgi_static_stddrv); //Include the driver statically instead of loading it.
 tgi_init(); //Set up the default palette and clear the screen.
 </verb>
 </descrip>
@@ -5815,15 +6657,37 @@ used in presence of a prototype.
 <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_install(tgi_static_stddrv); //Include the driver statically instead of loading it.
 tgi_init(); //Set up the default palette and clear the screen.
 </verb>
 </descrip>
 </quote>
 
 
+<sect1>tgi_install_vectorfont<label id="tgi_install_vectorfont"><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/void __fastcall__ tgi_install_vectorfont (const tgi_vectorfont* font);/
+<tag/Description/
+Install a vector font for use. More than one vector font can be loaded,
+but only one can be active. This function is used to tell which one. Call
+with a NULL pointer to uninstall the currently installed font.
+<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="tgi_load_vectorfont" name="tgi_load_vectorfont">,
+<ref id="tgi_free_vectorfont" name="tgi_free_vectorfont">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>tgi_ioctl<label id="tgi_ioctl"><p>
 
 <quote>
@@ -5922,6 +6786,30 @@ be used in presence of a prototype.
 </quote>
 
 
+<sect1>tgi_load_vectorfont<label id="tgi_load_vectorfont"><p>
+
+<quote>
+<descrip>
+<tag/Function/Load the given vector font.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/const tgi_vectorfont* __fastcall__ tgi_load_vectorfont (const char* name);/
+<tag/Description/
+Load a vector font into memory and return it. In case of errors, NULL is
+returned and an error is set, which can be retrieved using tgi_geterror.
+To use the font, it has to be installed using tgi_install_vectorfont.
+<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="tgi_install_vectorfont" name="tgi_install_vectorfont">,
+<ref id="tgi_free_vectorfont" name="tgi_free_vectorfont">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>tgi_outtext<label id="tgi_outtext"><p>
 
 <quote>
@@ -6167,20 +7055,42 @@ be used in presence of a prototype.
 </descrip>
 </quote>
 
+<sect1>tgi_settextscale<label id="tgi_settextscale"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the scaling for text output.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_settextscale (unsigned width, unsigned height);/
+<tag/Description/
+Set the scaling for text output. The scaling factors for width and height
+are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
+<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="tgi_settextstyle" name="tgi_settextstyle">
+<tag/Example/None.
+</descrip>
+</quote>
+
 <sect1>tgi_settextstyle<label id="tgi_settextstyle"><p>
 
 <quote>
 <descrip>
 <tag/Function/Set the style for text output.
 <tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_settextstyle (unsigned char magx, unsigned char magy, unsigned char dir);/
+<tag/Declaration/<tt/void __fastcall__ tgi_settextstyle (unsigned char magx, unsigned char magy, unsigned char dir, unsigned char font);/
 <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/cc65
-<tag/See also/Other tgi functions.
+<tag/See also/
+<ref id="tgi_settextscale" name="tgi_settextscale">
 <tag/Example/None.
 </descrip>
 </quote>
@@ -6192,10 +7102,7 @@ be used in presence of a prototype.
 <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_gettextwidth (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.