1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-25 13:29:41 +00:00

Made strxfrm fastcall, added docs.

git-svn-id: svn://svn.cc65.org/cc65/trunk@3895 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2008-08-27 20:02:48 +00:00
parent 7877d9c326
commit 0ec5268baa
3 changed files with 47 additions and 9 deletions

View File

@ -388,7 +388,6 @@ It does not declare any functions.
<!-- <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="fopen" name="fopen"> -->
<!-- <item><ref id="fprintf" name="fprintf"> -->
<!-- <item><ref id="fputc" name="fputc"> -->
@ -488,7 +487,7 @@ It does not declare any functions.
<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="strxfrm" name="strxfrm">
<item><ref id="strupper" name="strupper">
<item><ref id="strupr" name="strupr">
</itemize>
@ -812,7 +811,7 @@ is present.
<tag/Declaration/<tt/void CLI (void);/
<tag/Description/The function will insert a 6502 CLI instruction into the code,
so interrupts are enabled. Enabling interrupts has no effects if they are
already enabled (the default).
already enabled (the default).
<tag/Limits/<itemize>
<item>The function is actually a macro.
<item>Disabling interrupts may lead to unexpected results.
@ -4068,6 +4067,7 @@ different locale has no effect.
<tag/See also/
<ref id="localeconv" name="localeconv">,
<ref id="strcoll" name="strcoll">
<ref id="strxfrm" name="strxfrm">
<tag/Example/None.
</descrip>
</quote>
@ -4183,6 +4183,7 @@ be used in presence of a prototype.
<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>
@ -4260,6 +4261,7 @@ be used in presence of a prototype.
<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>
@ -4288,6 +4290,7 @@ be used in presence of a prototype.
<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>
@ -4422,6 +4425,7 @@ be used in presence of a prototype.
<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>
@ -4530,6 +4534,7 @@ be used in presence of a prototype.
<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>
@ -4668,6 +4673,39 @@ be used in presence of a prototype.
</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>

View File

@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 1998-2005, Ullrich von Bassewitz */
/* merstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* (C) 1998-2008 Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@ -57,7 +57,7 @@ char* __fastcall__ strrchr (const char* s, int c);
size_t __fastcall__ strspn (const char* s1, const char* s2);
char* __fastcall__ strstr (const char* str, const char* substr);
char* __fastcall__ strtok (char* s1, const char* s2);
size_t strxfrm (char* s1, const char* s2, size_t count);
size_t __fastcall__ strxfrm (char* s1, const char* s2, size_t count);
void* __fastcall__ memchr (const void* mem, int c, size_t count);
int __fastcall__ memcmp (const void* p1, const void* p2, size_t count);
void* __fastcall__ memcpy (void* dest, const void* src, size_t count);

View File

@ -10,7 +10,7 @@
size_t strxfrm (char* dest, const char* src, size_t count)
size_t __fastcall__ strxfrm (char* dest, const char* src, size_t count)
{
strncpy (dest, src, count);
return strlen (src);