ICU 73.2  73.2
usprep.h
Go to the documentation of this file.
00001 // © 2016 and later: Unicode, Inc. and others.
00002 // License & terms of use: http://www.unicode.org/copyright.html
00003 /*
00004  *******************************************************************************
00005  *
00006  *   Copyright (C) 2003-2014, International Business Machines
00007  *   Corporation and others.  All Rights Reserved.
00008  *
00009  *******************************************************************************
00010  *   file name:  usprep.h
00011  *   encoding:   UTF-8
00012  *   tab size:   8 (not used)
00013  *   indentation:4
00014  *
00015  *   created on: 2003jul2
00016  *   created by: Ram Viswanadha
00017  */
00018 
00019 #ifndef __USPREP_H__
00020 #define __USPREP_H__
00021 
00027 #include "unicode/utypes.h"
00028 
00029 #if U_SHOW_CPLUSPLUS_API
00030 #include "unicode/localpointer.h"
00031 #endif   // U_SHOW_CPLUSPLUS_API
00032 
00065 #if !UCONFIG_NO_IDNA
00066 
00067 #include "unicode/parseerr.h"
00068 
00073 typedef struct UStringPrepProfile UStringPrepProfile;
00074 
00075 
00082 #define USPREP_DEFAULT 0x0000
00083 
00090 #define USPREP_ALLOW_UNASSIGNED 0x0001
00091 
00098 typedef enum UStringPrepProfileType {
00103     USPREP_RFC3491_NAMEPREP,
00108         USPREP_RFC3530_NFS4_CS_PREP,
00113         USPREP_RFC3530_NFS4_CS_PREP_CI,
00118         USPREP_RFC3530_NFS4_CIS_PREP,
00123         USPREP_RFC3530_NFS4_MIXED_PREP_PREFIX,
00128         USPREP_RFC3530_NFS4_MIXED_PREP_SUFFIX,
00133         USPREP_RFC3722_ISCSI,
00138         USPREP_RFC3920_NODEPREP,
00143         USPREP_RFC3920_RESOURCEPREP,
00148         USPREP_RFC4011_MIB,
00153     USPREP_RFC4013_SASLPREP,
00158         USPREP_RFC4505_TRACE,
00163         USPREP_RFC4518_LDAP,
00169         USPREP_RFC4518_LDAP_CI
00170 } UStringPrepProfileType;
00171 
00187 U_CAPI UStringPrepProfile* U_EXPORT2
00188 usprep_open(const char* path, 
00189             const char* fileName,
00190             UErrorCode* status);
00191 
00203 U_CAPI UStringPrepProfile* U_EXPORT2
00204 usprep_openByType(UStringPrepProfileType type,
00205                                   UErrorCode* status);
00206 
00212 U_CAPI void U_EXPORT2
00213 usprep_close(UStringPrepProfile* profile);
00214 
00215 #if U_SHOW_CPLUSPLUS_API
00216 
00217 U_NAMESPACE_BEGIN
00218 
00228 U_DEFINE_LOCAL_OPEN_POINTER(LocalUStringPrepProfilePointer, UStringPrepProfile, usprep_close);
00229 
00230 U_NAMESPACE_END
00231 
00232 #endif
00233 
00263 U_CAPI int32_t U_EXPORT2
00264 usprep_prepare(   const UStringPrepProfile* prep,
00265                   const UChar* src, int32_t srcLength, 
00266                   UChar* dest, int32_t destCapacity,
00267                   int32_t options,
00268                   UParseError* parseError,
00269                   UErrorCode* status );
00270 
00271 
00272 #endif /* #if !UCONFIG_NO_IDNA */
00273 
00274 #endif