sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * FUNCTION sl@0: * <>---compare two memory areas sl@0: * INDEX sl@0: * memcmp sl@0: * ANSI_SYNOPSIS sl@0: * #include sl@0: * int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>); sl@0: * TRAD_SYNOPSIS sl@0: * #include sl@0: * int memcmp(<[s1]>, <[s2]>, <[n]>) sl@0: * void *<[s1]>; sl@0: * void *<[s2]>; sl@0: * size_t <[n]>; sl@0: * This function compares not more than <[n]> characters of the sl@0: * object pointed to by <[s1]> with the object pointed to by <[s2]>. sl@0: * RETURNS sl@0: * The function returns an integer greater than, equal to or sl@0: * less than zero according to whether the object pointed to by sl@0: * <[s1]> is greater than, equal to or less than the object sl@0: * pointed to by <[s2]>. sl@0: * PORTABILITY sl@0: * <> is ANSI C. sl@0: * <> requires no supporting OS subroutines. sl@0: * QUICKREF sl@0: * memcmp ansi pure sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include sl@0: /** sl@0: Compare two buffers. sl@0: Compares the fisrt num bytes of two memory blocks pointed by m1 and m1. sl@0: @return a value indicating the relationship between the buffers sl@0: @param m1 Pointer to buffer. sl@0: @param m2 Pointer to buffer. sl@0: @param n Number of bytes to compare. sl@0: */ sl@0: sl@0: IMPORT_C signed int memcompare(const unsigned char*, signed int, const unsigned char*, signed int); sl@0: sl@0: sl@0: EXPORT_C int sl@0: memcmp (const void* m1, const void* m2, size_t n) sl@0: { sl@0: return memcompare((const unsigned char*)m1, n, (const unsigned char*)m2, n); sl@0: }