1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/LCHAR/MEMCMP.C Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,63 @@
1.4 +/*
1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* FUNCTION
1.19 +* <<memcmp>>---compare two memory areas
1.20 +* INDEX
1.21 +* memcmp
1.22 +* ANSI_SYNOPSIS
1.23 +* #include <string.h>
1.24 +* int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
1.25 +* TRAD_SYNOPSIS
1.26 +* #include <string.h>
1.27 +* int memcmp(<[s1]>, <[s2]>, <[n]>)
1.28 +* void *<[s1]>;
1.29 +* void *<[s2]>;
1.30 +* size_t <[n]>;
1.31 +* This function compares not more than <[n]> characters of the
1.32 +* object pointed to by <[s1]> with the object pointed to by <[s2]>.
1.33 +* RETURNS
1.34 +* The function returns an integer greater than, equal to or
1.35 +* less than zero according to whether the object pointed to by
1.36 +* <[s1]> is greater than, equal to or less than the object
1.37 +* pointed to by <[s2]>.
1.38 +* PORTABILITY
1.39 +* <<memcmp>> is ANSI C.
1.40 +* <<memcmp>> requires no supporting OS subroutines.
1.41 +* QUICKREF
1.42 +* memcmp ansi pure
1.43 +*
1.44 +*
1.45 +*/
1.46 +
1.47 +
1.48 +
1.49 +#include <string.h>
1.50 +/**
1.51 +Compare two buffers.
1.52 +Compares the fisrt num bytes of two memory blocks pointed by m1 and m1.
1.53 +@return a value indicating the relationship between the buffers
1.54 +@param m1 Pointer to buffer.
1.55 +@param m2 Pointer to buffer.
1.56 +@param n Number of bytes to compare.
1.57 +*/
1.58 +
1.59 +IMPORT_C signed int memcompare(const unsigned char*, signed int, const unsigned char*, signed int);
1.60 +
1.61 +
1.62 +EXPORT_C int
1.63 +memcmp (const void* m1, const void* m2, size_t n)
1.64 +{
1.65 + return memcompare((const unsigned char*)m1, n, (const unsigned char*)m2, n);
1.66 +}