]> git.sur5r.net Git - cc65/blobdiff - doc/funcref.sgml
Fixed several address size issues
[cc65] / doc / funcref.sgml
index 6659fd790c1e2dd934673b8adc54d6e840ade847..faf27dfbe2c50bc815abedd30669051cdbd9ff65 100644 (file)
@@ -187,6 +187,11 @@ function.
 
 <sect1><tt/locale.h/<label id="locale.h"><p>
 
+<itemize>
+<item><ref id="localeconv" name="localeconv">
+<item><ref id="setlocale" name="setlocale">
+</itemize>
+
 
 <sect1><tt/modload.h/<label id="modload.h"><p>
 
@@ -256,9 +261,9 @@ function.
 <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="bsearch" name="bsearch">
 <item><ref id="calloc" name="calloc">
-<!-- <item><ref id="div" name="div"> -->
+<item><ref id="div" name="div">
 <item><ref id="exit" name="exit">
 <item><ref id="free" name="free">
 <item><ref id="getenv" name="getenv">
@@ -266,7 +271,7 @@ function.
 <item><ref id="labs" name="labs">
 <item><ref id="ltoa" name="ltoa">
 <item><ref id="malloc" name="malloc">
-<!-- <item><ref id="qsort" name="qsort"> -->
+<item><ref id="qsort" name="qsort">
 <item><ref id="rand" name="rand">
 <item><ref id="realloc" name="realloc">
 <item><ref id="srand" name="srand">
@@ -284,16 +289,16 @@ function.
 <item><ref id="memcpy" name="memcpy">
 <item><ref id="memmove" name="memmove">
 <item><ref id="memset" name="memset">
-<!-- <item><ref id="strcasecmp" name="strcasecmp"> -->
+<item><ref id="strcasecmp" name="strcasecmp">
 <item><ref id="strcat" name="strcat">
 <item><ref id="strchr" name="strchr">
-<!-- <item><ref id="strcmp" name="strcmp"> -->
-<!-- <item><ref id="strcoll" name="strcoll"> -->
+<item><ref id="strcmp" name="strcmp">
+<item><ref id="strcoll" name="strcoll">
 <item><ref id="strcpy" name="strcpy">
 <!-- <item><ref id="strcspn" name="strcspn"> -->
 <!-- <item><ref id="strdup" name="strdup"> -->
 <!-- <item><ref id="strerror" name="strerror"> -->
-<!-- <item><ref id="stricmp" name="stricmp"> -->
+<item><ref id="stricmp" name="stricmp">
 <item><ref id="strlen" name="strlen">
 <item><ref id="strlower" name="strlower">
 <item><ref id="strlwr" name="strlwr">
@@ -315,6 +320,20 @@ function.
 
 <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="time" name="time">
+</itemize>
+-->
+
 
 <sect1><tt/unistd.h/<label id="unistd.h"><p>
 
@@ -846,6 +865,37 @@ be used in presence of a prototype.
 </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>
@@ -1187,6 +1237,28 @@ used in presence of a prototype.
 </quote>
 
 
+<sect1>div<label id="div"><p>
+
+<quote>
+<descrip>
+<tag/Function/Divide two ints and return quotient and remainder.
+<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
+<tag/Declaration/<tt/div_t __fastcall__ div (int numer, int denom);/
+<tag/Description/<tt/div/ divides <tt/numer/ by <tt/denom/ and returns the
+quotient and remainder in a <tt/div_t/ structure.
+<tag/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/
+ldiv
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>em_commit<label id="em_commit"><p>
 
 <quote>
@@ -1735,7 +1807,7 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
 <tag/Description/The function returns a value of zero if the given argument
-is a blank or space character. The return value is non zero if the character
+is a space or tab character. The return value is non zero if the character
 is anything else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
@@ -2212,6 +2284,28 @@ used in presence of a prototype.
 </quote>
 
 
+<sect1>localeconv<label id="localeconv"><p>
+
+<quote>
+<descrip>
+<tag/Function/Returns a pointer to the current locale structure.
+<tag/Header/<tt/<ref id="locale.h" name="locale.h">/
+<tag/Declaration/<tt/struct lconv* localeconv (void);/
+<tag/Description/<tt/localeconv/ returns a pointer to the current locale
+structure.
+<tag/Limits/<itemize>
+<item>cc65 supports only the "C" locale, so even after setting a new locale
+using <tt/<ref id="setlocale" name="setlocale">/, the structure returned will
+always be the same.
+</itemize>
+<tag/Availability/ISO 9899
+<tag/See also/
+<ref id="setlocale" name="setlocale">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>malloc<label id="malloc"><p>
 
 <quote>
@@ -2361,6 +2455,33 @@ cc65 allows to pass this argument, it is ignored.
 </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>
@@ -2554,6 +2675,30 @@ the program terminates.
 </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">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>signal<label id="signal"><p>
 
 <quote>
@@ -2642,6 +2787,32 @@ be used in presence of a prototype.
 </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">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>strcat<label id="strcat"><p>
 
 <quote>
@@ -2691,6 +2862,58 @@ be used in presence of a prototype.
 </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">
+<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">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>strcpy<label id="strcpy"><p>
 
 <quote>
@@ -2723,6 +2946,32 @@ strcpy (hello, "Hello world!\n");
 </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">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>strlen<label id="strlen"><p>
 
 <quote>