Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Macros | Functions
rw_valcmp.h File Reference
#include <rw_testdefs.h>
Include dependency graph for rw_valcmp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CMP_NULTERM   1 /* the first 0 terminates processing */
 
#define CMP_RETOFF   2 /* return offset of the first mismatch */
 
#define CMP_NOCASE   4 /* case-insensitive character comparison */
 
#define CMP_FP   8 /* safe floating pointing comparison */
 

Functions

_TEST_EXPORT int rw_valcmp (const void *, const void *, _RWSTD_SIZE_T, _RWSTD_SIZE_T, _RWSTD_SIZE_T, int)
 
template<class T , class U >
int rw_valcmp (const T *buf1, const U *buf2, _RWSTD_SIZE_T nelems, int flags=0)
 
_TEST_EXPORT int rw_strncmp (const char *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX, int=CMP_NULTERM)
 
_TEST_EXPORT int rw_strncmp (const char *, const wchar_t *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX, int=CMP_NULTERM)
 
_TEST_EXPORT int rw_strncmp (const wchar_t *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX, int=CMP_NULTERM)
 
_TEST_EXPORT int rw_strncmp (const wchar_t *, const wchar_t *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX, int=CMP_NULTERM)
 
_TEST_EXPORT int rw_fltcmp (float x, float y)
 
_TEST_EXPORT int rw_dblcmp (double x, double y)
 
_TEST_EXPORT int rw_ldblcmp (long double x, long double y)
 
template<class T >
int rw_equal (T x, T y)
 
int rw_equal (float x, float y)
 
int rw_equal (double x, double y)
 
int rw_equal (long double x, long double y)
 

Macro Definition Documentation

◆ CMP_FP

#define CMP_FP   8 /* safe floating pointing comparison */

Definition at line 38 of file rw_valcmp.h.

◆ CMP_NOCASE

#define CMP_NOCASE   4 /* case-insensitive character comparison */

Definition at line 37 of file rw_valcmp.h.

◆ CMP_NULTERM

#define CMP_NULTERM   1 /* the first 0 terminates processing */

valcmp.h - declarations of the rw_valcmp() family of helper functions

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 1994-2006 Rogue Wave Software.

Definition at line 35 of file rw_valcmp.h.

◆ CMP_RETOFF

#define CMP_RETOFF   2 /* return offset of the first mismatch */

Definition at line 36 of file rw_valcmp.h.

Function Documentation

◆ rw_dblcmp()

_TEST_EXPORT int rw_dblcmp ( double  x,
double  y 
)
See also
rw_fltcmp.

Definition at line 753 of file valcmp.cpp.

◆ rw_equal() [1/4]

int rw_equal ( double  x,
double  y 
)
inline
See also
rw_equal.

Definition at line 169 of file rw_valcmp.h.

◆ rw_equal() [2/4]

int rw_equal ( float  x,
float  y 
)
inline
See also
rw_equal.

Definition at line 161 of file rw_valcmp.h.

◆ rw_equal() [3/4]

int rw_equal ( long double  x,
long double  y 
)
inline
See also
rw_equal.

Definition at line 179 of file rw_valcmp.h.

◆ rw_equal() [4/4]

template<class T >
int rw_equal ( T  x,
T  y 
)
inline

Compares two values of the same type for equality.

Parameters
xThe left hand side of the comparison.
yThe right hand side of the comparison.
Returns
Returns 1 if the the values are the same, 0 otherwise.

Definition at line 153 of file rw_valcmp.h.

◆ rw_fltcmp()

_TEST_EXPORT int rw_fltcmp ( float  x,
float  y 
)

Compares two floating point numbers for equality.

Parameters
xThe left hand side of the comparison.
yThe right hand side of the comparison.
Returns
Returns a negative value, 0, or a positive value, depending on whether the first number is less than, equal to, or greater than the second number. The magnitude of the returned value indicates the number of distinct values representable in the type of the number between the two arguments.

Definition at line 712 of file valcmp.cpp.

◆ rw_ldblcmp()

_TEST_EXPORT int rw_ldblcmp ( long double  x,
long double  y 
)
See also
rw_fltcmp.

Definition at line 816 of file valcmp.cpp.

◆ rw_strncmp() [1/4]

_TEST_EXPORT int rw_strncmp ( const char *  ,
const char *  ,
_RWSTD_SIZE_T  = _RWSTD_SIZE_MAX,
int  = CMP_NULTERM 
)

◆ rw_strncmp() [2/4]

_TEST_EXPORT int rw_strncmp ( const char *  ,
const wchar_t *  ,
_RWSTD_SIZE_T  = _RWSTD_SIZE_MAX,
int  = CMP_NULTERM 
)

◆ rw_strncmp() [3/4]

_TEST_EXPORT int rw_strncmp ( const wchar_t *  ,
const char *  ,
_RWSTD_SIZE_T  = _RWSTD_SIZE_MAX,
int  = CMP_NULTERM 
)

◆ rw_strncmp() [4/4]

_TEST_EXPORT int rw_strncmp ( const wchar_t *  ,
const wchar_t *  ,
_RWSTD_SIZE_T  = _RWSTD_SIZE_MAX,
int  = CMP_NULTERM 
)

◆ rw_valcmp() [1/2]

template<class T , class U >
int rw_valcmp ( const T *  buf1,
const U *  buf2,
_RWSTD_SIZE_T  nelems,
int  flags = 0 
)
inline

Compares the contents of two arrays of objects of integral types, possibly of different sizes, for equality, in a strncmp/memcmp way.

Parameters
buf1Pointer to an array of 0 or more objects of integral type.
buf2Pointer to an array of 0 or more objects of integral type.
nelemsThe maximum number of elements to compare.
flagsBitmap of flags that determine how the objects are compared.
Returns
Returns -1, 0, or +1, depending on whether the first array is less than, equal to, or greater than the second array.

Definition at line 61 of file rw_valcmp.h.

◆ rw_valcmp() [2/2]

_TEST_EXPORT int rw_valcmp ( const void *  ,
const void *  ,
_RWSTD_SIZE_T  ,
_RWSTD_SIZE_T  ,
_RWSTD_SIZE_T  ,
int   
)