![]() |
![]() |
![]() |
GNU Libidn API Reference Manual | |
---|---|---|---|---|
#define IDNA_API #define STRINGPREP_VERSION enum Stringprep_rc; enum Stringprep_profile_flags; enum Stringprep_profile_steps; #define STRINGPREP_MAX_MAP_CHARS typedef Stringprep_table_element; typedef Stringprep_profile; typedef Stringprep_profiles; #define stringprep_nameprep (in, maxlen) #define stringprep_nameprep_no_unassigned (in, maxlen) #define stringprep_plain (in, maxlen) #define stringprep_kerberos5 (in, maxlen) #define stringprep_xmpp_nodeprep (in, maxlen) #define stringprep_xmpp_resourceprep (in, maxlen) #define stringprep_iscsi (in, maxlen)
# define STRINGPREP_VERSION "1.11"
String defined via CPP denoting the header file version number.
Used together with stringprep_check_version()
to verify header file
and run-time library consistency.
typedef enum { STRINGPREP_OK = 0, /* Stringprep errors. */ STRINGPREP_CONTAINS_UNASSIGNED = 1, STRINGPREP_CONTAINS_PROHIBITED = 2, STRINGPREP_BIDI_BOTH_L_AND_RAL = 3, STRINGPREP_BIDI_LEADTRAIL_NOT_RAL = 4, STRINGPREP_BIDI_CONTAINS_PROHIBITED = 5, /* Error in calling application. */ STRINGPREP_TOO_SMALL_BUFFER = 100, STRINGPREP_PROFILE_ERROR = 101, STRINGPREP_FLAG_ERROR = 102, STRINGPREP_UNKNOWN_PROFILE = 103, /* Internal errors. */ STRINGPREP_NFKC_FAILED = 200, STRINGPREP_MALLOC_ERROR = 201 } Stringprep_rc;
Enumerated return codes of stringprep()
, stringprep_profile()
functions (and macros using those functions). The value 0 is
guaranteed to always correspond to success.
Successful operation. This value is guaranteed to always be zero, the remaining ones are only guaranteed to hold non-zero values, for logical comparison purposes. | |
String contain unassigned Unicode code points, which is forbidden by the profile. | |
String contain code points prohibited by the profile. | |
String contain code points with conflicting bidirection category. | |
Leading and trailing character in string not of proper bidirectional category. | |
Contains prohibited code points detected by bidirectional code. | |
Buffer handed to function was too small. This usually indicate a problem in the calling application. | |
The stringprep profile was inconsistent. This usually indicate an internal error in the library. | |
The supplied flag conflicted with profile. This usually indicate a problem in the calling application. | |
The supplied profile name was not known to the library. | |
The Unicode NFKC operation failed. This usually indicate an internal error in the library. | |
The malloc() was out of memory. This is
usually a fatal error.
|
typedef enum { STRINGPREP_NO_NFKC = 1, STRINGPREP_NO_BIDI = 2, STRINGPREP_NO_UNASSIGNED = 4 } Stringprep_profile_flags;
Stringprep profile flags.
Disable the NFKC normalization, as well as selecting the non-NFKC case folding tables. Usually the profile specifies BIDI and NFKC settings, and applications should not override it unless in special situations. | |
Disable the BIDI step. Usually the profile specifies BIDI and NFKC settings, and applications should not override it unless in special situations. | |
Make the library return with an error if string contains unassigned characters according to profile. |
typedef enum { STRINGPREP_NFKC = 1, STRINGPREP_BIDI = 2, STRINGPREP_MAP_TABLE = 3, STRINGPREP_UNASSIGNED_TABLE = 4, STRINGPREP_PROHIBIT_TABLE = 5, STRINGPREP_BIDI_PROHIBIT_TABLE = 6, STRINGPREP_BIDI_RAL_TABLE = 7, STRINGPREP_BIDI_L_TABLE = 8 } Stringprep_profile_steps;
Various steps in the stringprep algorithm. You really want to study the source code to understand this one. Only useful if you want to add another profile.
# define STRINGPREP_MAX_MAP_CHARS 4
Maximum number of code points that can replace a single code point, during stringprep mapping.
#define stringprep_nameprep(in, maxlen)
Prepare the input UTF-8 string according to the nameprep profile.
The AllowUnassigned flag is true, use
stringprep_nameprep_no_unassigned()
if you want a false
AllowUnassigned. Returns 0 iff successful, or an error code.
|
input/ouput array with string to prepare. |
|
maximum length of input/output array. |
#define stringprep_nameprep_no_unassigned(in, maxlen)
Prepare the input UTF-8 string according to the nameprep profile.
The AllowUnassigned flag is false, use stringprep_nameprep()
for
true AllowUnassigned. Returns 0 iff successful, or an error code.
|
input/ouput array with string to prepare. |
|
maximum length of input/output array. |
#define stringprep_plain(in, maxlen)
Prepare the input UTF-8 string according to the draft SASL ANONYMOUS profile. Returns 0 iff successful, or an error code.
|
input/ouput array with string to prepare. |
|
maximum length of input/output array. |
#define stringprep_xmpp_nodeprep(in, maxlen)
Prepare the input UTF-8 string according to the draft XMPP node identifier profile. Returns 0 iff successful, or an error code.
|
input/ouput array with string to prepare. |
|
maximum length of input/output array. |
#define stringprep_xmpp_resourceprep(in, maxlen)
Prepare the input UTF-8 string according to the draft XMPP resource identifier profile. Returns 0 iff successful, or an error code.
|
input/ouput array with string to prepare. |
|
maximum length of input/output array. |