| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.4 Core Functions
stringprep_4i
- Function: int stringprep_4i (uint32_t * ucs4, size_t * len, size_t maxucs4len, Stringprep_profile_flags flags, const Stringprep_profile * profile)
ucs4: input/output array with string to prepare.
len: on input, length of input array with Unicode code points, on exit, length of output array with Unicode code points.
maxucs4len: maximum length of input/output array.
flags: a
Stringprep_profile_flagsvalue, or 0.profile: pointer to
Stringprep_profileto use.Prepare the input UCS-4 string according to the stringprep profile, and write back the result to the input string.
The input is not required to be zero terminated (
ucs4[len] = 0). The output will not be zero terminated unlessucs4[len] = 0. Instead, seestringprep_4zi()if your input is zero terminated or if you want the output to be.Since the stringprep operation can expand the string,
maxucs4lenindicate how large the buffer holding the string is. This function will not read or write to code points outside that size.The
flagsare one ofStringprep_profile_flagsvalues, or 0.The
profilecontain theStringprep_profileinstructions to perform. Your application can define new profiles, possibly re-using the generic stringprep tables that always will be part of the library, or use one of the currently supported profiles.Return value: Returns
STRINGPREP_OKiff successful, or anStringprep_rcerror code.
stringprep_4zi
- Function: int stringprep_4zi (uint32_t * ucs4, size_t maxucs4len, Stringprep_profile_flags flags, const Stringprep_profile * profile)
ucs4: input/output array with zero terminated string to prepare.
maxucs4len: maximum length of input/output array.
flags: a
Stringprep_profile_flagsvalue, or 0.profile: pointer to
Stringprep_profileto use.Prepare the input zero terminated UCS-4 string according to the stringprep profile, and write back the result to the input string.
Since the stringprep operation can expand the string,
maxucs4lenindicate how large the buffer holding the string is. This function will not read or write to code points outside that size.The
flagsare one ofStringprep_profile_flagsvalues, or 0.The
profilecontain theStringprep_profileinstructions to perform. Your application can define new profiles, possibly re-using the generic stringprep tables that always will be part of the library, or use one of the currently supported profiles.Return value: Returns
STRINGPREP_OKiff successful, or anStringprep_rcerror code.
stringprep
- Function: int stringprep (char * in, size_t maxlen, Stringprep_profile_flags flags, const Stringprep_profile * profile)
in: input/ouput array with string to prepare.
maxlen: maximum length of input/output array.
flags: a
Stringprep_profile_flagsvalue, or 0.profile: pointer to
Stringprep_profileto use.Prepare the input zero terminated UTF-8 string according to the stringprep profile, and write back the result to the input string.
Note that you must convert strings entered in the systems locale into UTF-8 before using this function, see
stringprep_locale_to_utf8().Since the stringprep operation can expand the string,
maxlenindicate how large the buffer holding the string is. This function will not read or write to characters outside that size.The
flagsare one ofStringprep_profile_flagsvalues, or 0.The
profilecontain theStringprep_profileinstructions to perform. Your application can define new profiles, possibly re-using the generic stringprep tables that always will be part of the library, or use one of the currently supported profiles.Return value: Returns
STRINGPREP_OKiff successful, or an error code.
stringprep_profile
- Function: int stringprep_profile (const char * in, char ** out, const char * profile, Stringprep_profile_flags flags)
in: input array with UTF-8 string to prepare.
out: output variable with pointer to newly allocate string.
profile: name of stringprep profile to use.
flags: a
Stringprep_profile_flagsvalue, or 0.Prepare the input zero terminated UTF-8 string according to the stringprep profile, and return the result in a newly allocated variable.
Note that you must convert strings entered in the systems locale into UTF-8 before using this function, see
stringprep_locale_to_utf8().The output
outvariable must be deallocated by the caller.The
flagsare one ofStringprep_profile_flagsvalues, or 0.The
profilespecifies the name of the stringprep profile to use. It must be one of the internally supported stringprep profiles.Return value: Returns
STRINGPREP_OKiff successful, or an error code.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on February 1, 2012 using texi2html 5.0.
