| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- UTF-8 string comparison function
#include <sys/u8_textprep.h>intu8_strcmp(const char *s1,const char *s2,size_tn,intflag,size_tversion,int *errnum);
Pointers to null-terminated UTF-8 strings
The maximum number of bytes to be compared. If 0, the comparison is performed until either or both of the strings are examined to the string terminating null byte.
The possible comparison options constructed by a bit-wise-inclusive-OR of the following values:
Perform case-sensitive string comparison. This is the default.
Perform case-insensitive string comparison based on Unicode upper case converted results ofs1 ands2.
Perform case-insensitive string comparison based on Unicode lower case converted results ofs1 ands2.
Perform string comparison afters1 ands2 have been normalized by using Unicode Normalization Form D.
Perform string comparison afters1 ands2 have been normalized by using Unicode Normalization Form C.
Perform string comparison afters1 ands2 have been normalized by using Unicode Normalization Form KD.
Perform string comparison afters1 ands2 have been normalized by using Unicode Normalization Form KC.
Only one case-sensitive or case-insensitive option is allowed. Only one Unicode Normalization option is allowed.
The version of Unicode data that should be used during comparison. The following values are supported:
Use Unicode 3.2.0 data during comparison.
Use Unicode 5.0.0 data during comparison.
Use the latest Unicode version data available, which is Unicode 5.0.0.
A non-zero value indicates that an error has occurred during comparison. The following values are supported:
The specified option values are conflicting and cannot be supported.
There was an illegal character ats1,s2, or both.
There was an incomplete character ats1,s2, or both.
The specified Unicode version value is not supported.
Theu8_stcmp() function internally processes UTF-8 strings pointed to bys1 ands2 based on the corresponding version of the Unicode Standard and otherinput arguments and compares the result strings in byte-by-byte, machine ordering.
When multiple comparison options are specified, Unicode Normalization is performed after case-sensitiveor case-insensitive processing is performed.
Theu8_strcmp() function returns an integer greater than, equal to, or lessthan 0 if the string pointed to bys1 is greater than,equal to, or less than the string pointed to bys2, respectively.
Whenu8_strcmp() detects an illegal or incomplete character, such character causes thefunction to seterrnum to indicate the error. Afterward, the comparison isstill performed on the resultant strings and a value based on byte-by-bytecomparison is always returned.
Example 1 Perform simple default string comparison.
#include <sys/u8_textprep.h>intdocmp_default(const char *u1, const char *u2) { int result; int errnum; result = u8_strcmp(u1, u2, 0, 0, U8_UNICODE_LATEST, &errnum); if (errnum == EILSEQ) return (-1); if (errnum == EINVAL) return (-2); if (errnum == EBADF) return (-3); if (errnum == ERANGE) return (-4);Example 2 Perform upper case based case-insensitive comparison with Unicode 3.2.0 date.
#include <sys/u8_textprep.h>intdocmp_caseinsensitive_u320(const char *u1, const char *u2) { int result; int errnum; result = u8_strcmp(u1, u2, 0, U8_STRCMP_CI_UPPER, U8_UNICODE_320, &errnum); if (errnum == EILSEQ) return (-1); if (errnum == EINVAL) return (-2); if (errnum == EBADF) return (-3); if (errnum == ERANGE) return (-4); return (result);}Example 3 Perform Unicode Normalization Form D.
Perform Unicode Normalization Form D and upper case based case-insensitive comparison withUnicode 3.2.0 date.
#include <sys/u8_textprep.h>intdocmp_nfd_caseinsensitive_u320(const char *u1, const char *u2) { int result; int errnum; result = u8_strcmp(u1, u2, 0, (U8_STRCMP_NFD|U8_STRCMP_CI_UPPER), U8_UNICODE_320, &errnum); if (errnum == EILSEQ) return (-1); if (errnum == EINVAL) return (-2); if (errnum == EBADF) return (-3); if (errnum == ERANGE) return (-4); return (result);}Seeattributes(5) for descriptions of the following attributes:
|
u8_textprep_str(3C),u8_validate(3C),attributes(5),u8_strcmp(9F),u8_textprep_str(9F),u8_validate(9F)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |