wu :: forums
« wu :: forums - Locale aware memcmp function »

Welcome, Guest. Please Login or Register.
May 17th, 2024, 8:45pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: william wu, towr, Grimbal, Icarus, SMQ, ThudnBlunder, Eigenray)
   Locale aware memcmp function
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Locale aware memcmp function  (Read 779 times)
Margit
Junior Member
**





   


Gender: female
Posts: 54
Locale aware memcmp function  
« on: Feb 7th, 2007, 9:53am »
Quote Quote Modify Modify

As per subject.
How does one go about doing a memcmp
that is aware of the LC_COLLATE setting ?
Yes, I know there is strcoll, but the
things I am comparing have fixed widths
(not null-terminated) and may contain
null bytes.
It seems that there is no standard C library
function to do this.
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Locale aware memcmp function  
« Reply #1 on: Feb 7th, 2007, 10:45am »
Quote Quote Modify Modify

What is LC_COLLATE?
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Margit
Junior Member
**





   


Gender: female
Posts: 54
Re: Locale aware memcmp function  
« Reply #2 on: Feb 7th, 2007, 11:39am »
Quote Quote Modify Modify

On 'nix systems -
man locale
man setlocale
man strcoll
man memmp
IP Logged
Margit
Junior Member
**





   


Gender: female
Posts: 54
Re: Locale aware memcmp function  
« Reply #3 on: Feb 7th, 2007, 11:42am »
Quote Quote Modify Modify

Or if you are Win oriented -
http://msdn2.microsoft.com/zh-cn/library/x99tb11d(VS.80).aspx
 
IP Logged
Margit
Junior Member
**





   


Gender: female
Posts: 54
Re: Locale aware memcmp function  
« Reply #4 on: Feb 7th, 2007, 11:45am »
Quote Quote Modify Modify

> What is LC_COLLATE?
 
Don't you know what how to sort ? :-)
IP Logged
TenaliRaman
Uberpuzzler
*****



I am no special. I am only passionately curious.

   


Gender: male
Posts: 1001
Re: Locale aware memcmp function  
« Reply #5 on: Feb 7th, 2007, 10:24pm »
Quote Quote Modify Modify

How about this,
1. Copy the strcoll source to another function say "memcoll".
2. Remove the null termination condition from it.
 
-- AI
IP Logged

Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
TenaliRaman
Uberpuzzler
*****



I am no special. I am only passionately curious.

   


Gender: male
Posts: 1001
Re: Locale aware memcmp function  
« Reply #6 on: Feb 7th, 2007, 10:26pm »
Quote Quote Modify Modify

Well what do you know,
Google CodeSearch Memcoll
 
Hail, google codesearch  Roll Eyes
 
-- AI
« Last Edit: Feb 7th, 2007, 10:30pm by TenaliRaman » IP Logged

Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
Margit
Junior Member
**





   


Gender: female
Posts: 54
Re: Locale aware memcmp function  
« Reply #7 on: Feb 8th, 2007, 9:20am »
Quote Quote Modify Modify

That actually is busted and uses strcoll.
Other ideas ?
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board