Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
strncasecmp(3) OSS Library Calls Reference Manual
NAME
strncasecmp - Compares two strings, ignoring case
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZSTFNSRL
G-series native OSS processes: /G/system/sysnn/zstfnsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <strings.h>
int strncasecmp(const char *s1,
const char *s2,
size_t n);
PARAMETERS
s1 Is a pointer to the first string to be compared.
s2 Is a pointer to the second string to be compared.
n Is the maximum number of bytes of the first string that strncasecmp( ) will com-
pare to the second string.
DESCRIPTION
The strncasecmp( ) function performs a case-insensitive comparison of the strings pointed to by
the s1 and s2 parameters. The strncasecmp() function is similar to the strcasecmp( ) function,
but compares, at most, the first n bytes of the two strings.
NOTES
The strncasecmp( ) function can be called by native processes only.
In the POSIX locale, this function first converts uppercase characters to lowercase, then per-
forms byte comparisons. Its behavior in other locales is undefined.
RETURN VALUES
If the first n bytes of the string pointed to by s1 is, ignoring case, greater than the first n bytes of
the string pointed to by s2, the strncasecmp() function returns an integer greater than 0 (zero).
If the first n bytes of the string pointed to by s1 is, ignoring case, less than the first n bytes of the
string pointed to by s2, strncasecmp( ) returns an integer less than 0 (zero). If the first n bytes of
the string pointed to by s1 is, ignoring case, equal to the first n bytes of the string pointed to by
s2, the strncasecmp( ) function returns 0 (zero).
ERRORS"
None. This function does not set errno.
RELATED INFORMATION
Functions: strcasecmp(3).
STANDARDS CONFORMANCE
The strncasecmp( ) function is defined in the XPG4 Version 2 specification.
6−156 Hewlett-Packard Company 527187-017