2N/A * 06:24:05 hyc Exp $ 2N/A * Copyright 1998-2008 The OpenLDAP Foundation. All rights reserved. 2N/A * Redistribution and use in source and binary forms, with or without 2N/A * modification, are permitted only as authorized by the OpenLDAP Public 2N/A * A copy of this license is available in file LICENSE in the top-level 2N/A * directory of the distribution or, alternatively, at 2N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 2N/A/* Solaris Kerberos */ 2N/A for (; 0 < n; ++u, --n) {
2N/A for (; 0 < n; ++u, --n) {
2N/A for (; 0 < n; ++u, --n) {
2N/A 0,
0x7f,
0x1f,
0x0f,
0x07,
0x03,
0x01};
2N/A * Should first check to see if string is already in proper normalized 2N/A * form. This is almost as time consuming as the normalization though. 2N/A /* finish off everything up to character before first non-ascii */ 2N/A /* convert character before first non-ascii to ucs-4 */ 2N/A /* s[i] is now first non-ascii character */ 2N/A /* s[i] is non-ascii */ 2N/A /* convert everything up to next ascii to ucs-4 */ 2N/A if ((s[i] &
0xc0) !=
0x80) {
2N/A /* normalize ucs of length p - ucs */ 2N/A /* Solaris Kerberos */ 2N/A /* Solaris Kerberos */ 2N/A /* convert ucs to utf-8 and store in out */ 2N/A * allocate more space if not enough room for 6 bytes and 2N/A /* Allocate more space in out if necessary */ 2N/A /* finish off everything up to char before next non-ascii */ 2N/A /* convert character before next non-ascii to ucs-4 */ 2N/A/* compare UTF8-strings, optionally ignore casing */ 2N/A/* slow, should be optimized */ 2N/A return l1 == 0 ? (
l2 == 0 ? 0 : -
1) :
1;
2N/A /* done unless next character in s1 or s2 is non-ascii */ 2N/A /* We have encountered non-ascii or strings equal up to len */ 2N/A /* set i to number of iterations */ 2N/A /* passed through loop at least once? */ 2N/A /* all ascii and equal up to len */ 2N/A /* rewind one char, and do normalized compare from there */ 2N/A * Should first check to see if strings are already in proper normalized 2N/A return l1 >
l2 ?
1 : -
1;
/* what to do??? */ 2N/A * XXYYZ: we convert to ucs4 even though -llunicode 2N/A * expects ucs2 in an ac_uint4 2N/A /* convert and normalize 1st string */ 2N/A return -
1;
/* what to do??? */ 2N/A return l1 >
l2 ?
1 : -
1;
/* what to do??? */ 2N/A /* Solaris Kerberos */ 2N/A /* convert and normalize 2nd string */ 2N/A return 1;
/* what to do??? */ 2N/A /* Solaris Kerberos */