On 11/17/10 15:14, Vitaly Perov wrote:
On Monday 15 November 2010 17:16:32 Piotr Caban wrote:
On 11/15/10 14:53, Vitaly Perov wrote:
This function should be implemented without memory allocations.

Why? I don't think it is possible to implement it without any memory
allocations.

I mean without copying the strings.

Using strcoll doesn't make much sense (here and in MSVCRT_strcoll
implementation). If a broken/partial implementation is needed by an
application using strncmp should be ok.
Do you suggest implementing a stub, which just call linux strcoll()?
I think that we shouldn't use linux strcoll at all. It will not do what is needed. The default locale (on startup) of all c applications is "C", in this locale strcoll behaves exactly the same as strcmp.

If a partial implementation is needed by an application I would suggest something like this:
int strncoll(char *str1, char *str2, int count)
{
   /* FIXME: handle collates */
   return strncmp(str1, str2, count);
}

Cheers,
Piotr


Reply via email to