ICU-3050 add documentation

X-SVN-Rev: 12949
This commit is contained in:
Ram Viswanadha 2003-08-26 23:49:04 +00:00
parent c005c5cb02
commit 16732b6d87
4 changed files with 21 additions and 21 deletions
icu4c/source/common

View file

@ -60,13 +60,13 @@ enum{
/* indexes[] value names */
enum {
_SPREP_INDEX_TRIE_SIZE = 0, /* number of bytes in normalization trie */
_SPREP_INDEX_TRIE_SIZE = 0, /* number of bytes in StringPrep trie */
_SPREP_INDEX_MAPPING_DATA_SIZE = 1, /* The array that contains the mapping */
_SPREP_NORM_CORRECTNS_LAST_UNI_VERSION = 2, /* The index of Unicode version of last entry in NormalizationCorrections.txt */
_SPREP_ONE_UCHAR_MAPPING_INDEX_START = 3, /* The starting index of 1 UChar mapping index in the mapping data array */
_SPREP_TWO_UCHARS_MAPPING_INDEX_START = 4, /* The starting index of 2 UChars mapping index in the mapping data array */
_SPREP_THREE_UCHARS_MAPPING_INDEX_START = 5,
_SPREP_FOUR_UCHARS_MAPPING_INDEX_START = 6,
_SPREP_THREE_UCHARS_MAPPING_INDEX_START = 5, /* The starting index of 3 UChars mapping index in the mapping data array */
_SPREP_FOUR_UCHARS_MAPPING_INDEX_START = 6, /* The starting index of 4 UChars mapping index in the mapping data array */
_SPREP_OPTIONS = 7, /* Bit set of options to turn on in the profile */
_SPREP_INDEX_TOP=16 /* changing this requires a new formatVersion */
};

View file

@ -262,7 +262,7 @@ uidna_IDNToUnicode( const UChar* src, int32_t srcLength,
UErrorCode* status);
/**
* Compare two strings for IDNs for equivalence.
* Compare two IDN strings for equivalence.
* This function splits the domain names into labels and compares them.
* According to IDN RFC, whenever two labels are compared, they are
* considered equal if and only if their ASCII forms (obtained by

View file

@ -22,12 +22,15 @@
#if !UCONFIG_NO_IDNA
#include "unicode/parseerr.h"
/**
* The StringPrep profile
* @draft ICU 2.8
*/
typedef struct UStringPrepProfile UStringPrepProfile;
/**
* Option to prohibit processing of unassigned codepoints in the input
* Option to prohibit processing of unassigned code points in the input
*
* @see usprep_prepare
* @draft ICU 2.8
@ -35,7 +38,7 @@ typedef struct UStringPrepProfile UStringPrepProfile;
#define USPREP_NONE 0x0000
/**
* Option to allow processing of unassigned codepoints in the input
* Option to allow processing of unassigned code points in the input
*
* @see usprep_prepare
* @draft ICU 2.8
@ -48,8 +51,8 @@ typedef struct UStringPrepProfile UStringPrepProfile;
* Creates a StringPrep profile from the data file.
*
* @param path string containing the full path pointing to the directory
* where the resources reside followed by the package name
* e.g. "/usr/resource/my_app/resources/guimessages" on a Unix system.
* where the profile reside followed by the package name
* e.g. "/usr/resource/my_app/profiles/mydata" on a Unix system.
* if NULL, ICU default data files will be used.
* @param fileName name of the profile file to be opened
* @param status ICU error code in/out parameter. Must not be NULL.
@ -75,25 +78,22 @@ usprep_close(UStringPrepProfile* profile);
/**
* Prepare the input stream for use. This operation maps, normalizes(NFKC),
* Prepare the input buffer for use in applications with the given profile. This operation maps, normalizes(NFKC),
* checks for prohited and BiDi characters in the order defined by RFC 3454
* depending on the options specified
* depending on the options specified in the profile.
*
* @param prep The profile to use
* @param src Pointer to UChar buffer containing the string to prepare
* @param srcLength Number of characters in the source string
* @param dest Pointer to the destination buffer to receive the output
* @param destCapacity The capacity of destination array
* @paran options A bit set of options:
* @param options A bit set of options:
*
* - USPREP_NONE Use default options, i.e., do not process unassigned code points
* and do not use STD3 ASCII rules
* If unassigned code points are found the operation fails with
* U_UNASSIGNED_ERROR error code.
* - USPREP_NONE Prohibit processing of unassigned code points in the input
*
* - USPREP_ALLOW_UNASSIGNED Treat the unassigned code points are in the input
* as normal Unicode code points.
*
* - USPREP_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations
* If this option is set, the unassigned code points are in the input
* are treated as normal Unicode code points.
* @param parseError Pointer to UParseError struct to receive information on position
* of error if an error is encountered. Can be NULL.
* @param status ICU in/out error code parameter.
@ -102,7 +102,6 @@ usprep_close(UStringPrepProfile* profile);
* U_INDEX_OUTOFBOUNDS_ERROR if src contains
* too many code points.
* U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
* @return Number of ASCII characters converted.
* @return The number of UChars in the destination buffer
* @draft ICU 2.8
*/

View file

@ -728,7 +728,8 @@ usprep_prepare( const UStringPrepProfile* profile,
type = getValues(result, value, isIndex);
if( type == USPREP_PROHIBITED ||
((result < _SPREP_TYPE_THRESHOLD) && (result&0x01))){
((result < _SPREP_TYPE_THRESHOLD) && (result & 0x01) /* first bit says it the code point is prohibited*/)
){
*status = U_STRINGPREP_PROHIBITED_ERROR;
uprv_syntaxError(b1, b2Index-U16_LENGTH(ch), b2Len, parseError);
goto CLEANUP;