Path: blob/main/crypto/krb5/src/include/k5-unicode.h
34879 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/*2* Copyright (C) 2008 by the Massachusetts Institute of Technology,3* Cambridge, MA, USA. All Rights Reserved.4*5* This software is being provided to you, the LICENSEE, by the6* Massachusetts Institute of Technology (M.I.T.) under the following7* license. By obtaining, using and/or copying this software, you agree8* that you have read, understood, and will comply with these terms and9* conditions:10*11* Export of this software from the United States of America may12* require a specific license from the United States Government.13* It is the responsibility of any person or organization contemplating14* export to obtain such a license before exporting.15*16* WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute17* this software and its documentation for any purpose and without fee or18* royalty is hereby granted, provided that you agree to comply with the19* following copyright notice and statements, including the disclaimer, and20* that the same appear on ALL copies of the software and documentation,21* including modifications that you make for internal use or for22* distribution:23*24* THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS25* OR WARRANTIES, EXPRESS OR IMPLIED. By way of example, but not26* limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF27* MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF28* THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY29* PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.30*31* The name of the Massachusetts Institute of Technology or M.I.T. may NOT32* be used in advertising or publicity pertaining to distribution of the33* software. Title to copyright in this software and any associated34* documentation shall at all times remain with M.I.T., and USER agrees to35* preserve same.36*37* Furthermore if you modify this software you must label38* your software as modified software and not distribute it in such a39* fashion that it might be confused with the original M.I.T. software.40*/41/*42* Copyright 1998-2008 The OpenLDAP Foundation.43* All rights reserved.44*45* Redistribution and use in source and binary forms, with or without46* modification, are permitted only as authorized by the OpenLDAP47* Public License.48*49* A copy of this license is available in file LICENSE in the50* top-level directory of the distribution or, alternatively, at51* <https://www.OpenLDAP.org/license.html>.52*/53/*54* Copyright (C) 2000 Novell, Inc. All Rights Reserved.55*56* THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND TREATIES.57* USE, MODIFICATION, AND REDISTRIBUTION OF THIS WORK IS SUBJECT TO VERSION58* 2.0.1 OF THE OPENLDAP PUBLIC LICENSE, A COPY OF WHICH IS AVAILABLE AT59* HTTPS://WWW.OPENLDAP.ORG/LICENSE.HTML OR IN THE FILE "LICENSE" IN THE60* TOP-LEVEL DIRECTORY OF THE DISTRIBUTION. ANY USE OR EXPLOITATION OF THIS61* WORK OTHER THAN AS AUTHORIZED IN VERSION 2.0.1 OF THE OPENLDAP PUBLIC62* LICENSE, OR OTHER PRIOR WRITTEN CONSENT FROM NOVELL, COULD SUBJECT THE63* PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY.64*/6566/* This work is part of OpenLDAP Software <https://www.openldap.org/>. */6768#ifndef K5_UNICODE_H69#define K5_UNICODE_H7071#include "autoconf.h"7273#ifdef HAVE_SYS_TYPES_H74#include <sys/types.h>75#endif7677#ifdef HAVE_UNISTD_H78#include <unistd.h>79#endif8081#ifdef HAVE_STDLIB_H82#include <stdlib.h>83#endif8485#include "k5-utf8.h"8687typedef krb5_ucs4 krb5_unicode;8889#define KRB5_UTF8_NOCASEFOLD 0x0U90#define KRB5_UTF8_CASEFOLD 0x1U91#define KRB5_UTF8_ARG1NFC 0x2U92#define KRB5_UTF8_ARG2NFC 0x4U93#define KRB5_UTF8_APPROX 0x8U9495int krb5int_utf8_normcmp(96const krb5_data *,97const krb5_data *,98unsigned);99100krb5_boolean k5_utf8_validate(const krb5_data *data);101102#endif /* K5_UNICODE_H */103104105