]> git.sur5r.net Git - cc65/blobdiff - doc/funcref.sgml
No need to import __oserror.
[cc65] / doc / funcref.sgml
index adbd7eeaa408d2c1d81e256c7ec4ac974044097c..409eefc877dc1e4d528ccb2d8d8d4854f877022d 100644 (file)
@@ -383,6 +383,7 @@ It does not declare any functions.
 <sect1><tt/stdio.h/<label id="stdio.h"><p>
 
 <itemize>
+<item><ref id="_poserror" name="_poserror">
 <item><ref id="clearerr" name="clearerr">
 <!-- <item><ref id="fclose" name="fclose"> -->
 <!-- <item><ref id="fdopen" name="fdopen"> -->
@@ -437,7 +438,6 @@ It does not declare any functions.
 <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">
@@ -704,21 +704,21 @@ id="malloc" name="malloc"> may still return <tt/NULL/.
 <sect1>_poserror<label id="_poserror"><p>
 
 <quote>
-<descrip>
-<tag/Function/Print an error message for the error in <tt/_oserrno/.
+<descrip>                                                 
+<tag/Function/Print an error message for the error in <tt/_oserror/.
 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
 <tag/Declaration/<tt/void __fastcall__ _poserror (const char* msg);/
 <tag/Description/<tt/_poserror/ prints an error message to <tt/stderr/. If
 <tt/msg/ is not <tt/NULL/ and not an empty string, it is printed followed by
 a colon and a blank. Then the error message for the current contents of
-<tt/_oserrno/ are printed followed by a newline. The message output is the
+<tt/_oserror/ are printed followed by a newline. The message output is the
 same as returned by <tt/<ref id="_stroserror" name="_stroserror">/ with an
-argument of <tt/_oserrno/.
+argument of <tt/_oserror/.
 <tag/Limits/
 <itemize>
 <item>Since operating system specific error code are - you guessed it -
 operating system specific, the value in <tt/_oserror/ and the message that is
-printed depend on the cc65 target.
+printed depends on the cc65 target.
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -2321,9 +2321,9 @@ to undefined behaviour.
 <tag/Function/Check if a given character is a letter or digit.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is a letter or digit. The return value is non zero if the character
-is anything else.
+<tag/Description/The function returns a non zero value if the given argument
+is a letter or digit. The return value is zero if the character is anything
+else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2359,8 +2359,8 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is a letter.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is a letter. The return value is non zero if the character is anything else.
+<tag/Description/The function returns a non zero value if the given argument
+is a letter. The return value is zero if the character is anything else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2396,9 +2396,8 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is in the ASCII (0..127) range.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is in the range 0..127 (the range of valid ASCII characters) and a non zero
-value if not.
+<tag/Description/The function returns a non zero value if the given argument
+is in the range 0..127 (the range of valid ASCII characters) and zero if not.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2434,9 +2433,9 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is a space or tab.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is a space or tab character. The return value is non zero if the character
-is anything else.
+<tag/Description/The function returns a non zero value if the given argument
+is a space or tab character. The return value is zero if the character is
+anything else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2472,9 +2471,9 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is a control character.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is a control character. The return value is non zero if the character
-is anything else.
+<tag/Description/The function returns a non zero value if the given argument
+is a control character. The return value is zero if the character is anything
+else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2510,8 +2509,8 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is a digit.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is a digit. The return value is non zero if the character is anything else.
+<tag/Description/The function returns a non zero value if the given argument
+is a digit. The return value is zero if the character is anything else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2548,9 +2547,9 @@ fastcall function, so it may only be used in presence of a prototype.
 space).
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is a printable character with the exception of space. The return value is non
-zero if the character is anything else.
+<tag/Description/The function returns a non zero value if the given argument
+is a printable character with the exception of space. The return value is zero
+if the character is anything else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2586,9 +2585,9 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is a lower case letter.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is a lower case letter. The return value is non zero if the character is
-anything else.
+<tag/Description/The function returns a non zero value if the given argument
+is a lower case letter. The return value is zero if the character is anything
+else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2624,9 +2623,9 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is a printable character.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
-<tag/Description/The function returns a value of zero if the given argument
+<tag/Description/The function returns a non zero value if the given argument
 is a printable character (this includes the space character). The return value
-is non zero if the character is anything else.
+is zero if the character is anything else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2663,9 +2662,9 @@ fastcall function, so it may only be used in presence of a prototype.
 space or an alphanumeric character.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
-<tag/Description/The function returns a value of zero if the given argument
+<tag/Description/The function returns a non zero value if the given argument
 is a printable character, but not a space or anything alphanumeric. The return
-value is non zero if the character is anything else.
+value is zero if the character is anything else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2701,8 +2700,8 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is a a white-space character.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is a white space character. The return value is non zero if the character is
+<tag/Description/The function returns a non zero value if the given argument
+is a white space character. The return value is zero if the character is
 anything else. The standard white space characters are: space, formfeed ('\f'),
 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
 ('\v').
@@ -2741,9 +2740,9 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is an upper case letter.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is an upper case letter. The return value is non zero if the character is
-anything else.
+<tag/Description/The function returns a non zero value if the given argument
+is an upper case letter. The return value is zero if the character is anything
+else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -2779,9 +2778,9 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Function/Check if a given character is a hexadecimal digit.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
-<tag/Description/The function returns a value of zero if the given argument
-is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
-if the character is anything else.
+<tag/Description/The function returns a non zero value if the given argument
+is a hexadecimal digit (0..9, a..f and A..F). The return value is zero if the
+character is anything else.
 <tag/Limits/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
@@ -5307,10 +5306,14 @@ be used in presence of a prototype.
 <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.
+hardware.
 <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/tgi_init/ will not clear the screen. This allows switching between
+text and graphics mode on platforms that have separate memory areas for the
+screens. If you want the screen cleared, call <tt/<ref id="tgi_clear"
+name="tgi_clear">/ after <tt/tgi_init/.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/Other tgi functions.
@@ -5357,7 +5360,7 @@ tgi_init(); //Set up the default palette and clear the screen.
 <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/Declaration/<tt/unsigned __fastcall__ tgi_ioctl (unsigned char code, void* data);/
 <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.
@@ -5369,12 +5372,12 @@ be used in presence of a prototype.
 <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)
+#define tgi_sprite(spr) tgi_ioctl(0, (void*)(spr))
+#define tgi_flip() tgi_ioctl(1, (void*)0)
+#define tgi_setbgcolor(bgcol) tgi_ioctl(2, (void*)(bgcol))
+#define tgi_setframerate(rate) tgi_ioctl(3, (void*)(rate))
+#define tgi_busy() tgi_ioctl(4, (void*)0)
+#define tgi_updatedisplay() tgi_ioctl(4, (void*)1)
 if (!tgi_busy()) {
   tgi_sprite(&amp;background);
   tgi_setcolor(TGI_COLOR_BLUE);
@@ -5522,7 +5525,7 @@ be used in presence of a prototype.
 <tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
 <tag/Declaration/<tt/void __fastcall__ tgi_pie slice (int x, int y,
 unsigned char rx, unsigned char ry, unsigned sa, unsigned ea);/
-<tag/Description/The function draws an elliptic pie slice with center at x/y 
+<tag/Description/The function draws an elliptic pie slice with center at x/y
 and radii rx/ry using the current drawing color. The pie slice covers the angle
 between sa and ea (startangle and endangle), which must be in the range
 0..360.