pr29.h: GNU Libidn API Reference Manual

## pr29.h

pr29.h — PR29-related functions

## Functions

const char * | pr29_strerror ()
int | pr29_4 ()
int | pr29_4z ()
int | pr29_8z ()

## Types and Values

#define | IDNAPI
enum | Pr29_rc

## Description

PR29-related functions.

## Functions

### pr29_strerror ()

    const char *
    pr29_strerror (Pr29_rc rc);

Convert a return code integer to a text string. This string can be used to output a diagnostic message to the user.

PR29_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. PR29_PROBLEM: A problem sequence was encountered. PR29_STRINGPREP_ERROR: The character set conversion failed (only for `pr29_8z()`).

#### Parameters

rc | an Pr29_rc return code. |

#### Returns

Returns a pointer to a statically allocated string containing a description of the error with the return code `rc` .

### pr29_4 ()

    int
    pr29_4 (const uint32_t *in,
            size_t len);

Check the input to see if it may be normalized into different strings by different NFKC implementations, due to an anomaly in the NFKC specifications.

#### Parameters

in | input array with unicode code points. |
len | length of input array with unicode code points. |

#### Returns

Returns the Pr29_rc value `PR29_SUCCESS` on success, and `PR29_PROBLEM` if the input sequence is a "problem sequence" (i.e., may be normalized into different strings by different implementations).

### pr29_4z ()

    int
    pr29_4z (const uint32_t *in);

Check the input to see if it may be normalized into different strings by different NFKC implementations, due to an anomaly in the NFKC specifications.

#### Parameters

in | zero terminated array of Unicode code points. |

#### Returns

Returns the Pr29_rc value `PR29_SUCCESS` on success, and `PR29_PROBLEM` if the input sequence is a "problem sequence" (i.e., may be normalized into different strings by different implementations).

### pr29_8z ()

    int
    pr29_8z (const char *in);

Check the input to see if it may be normalized into different strings by different NFKC implementations, due to an anomaly in the NFKC specifications.

#### Parameters

in | zero terminated input UTF-8 string. |

#### Returns

Returns the Pr29_rc value `PR29_SUCCESS` on success, and `PR29_PROBLEM` if the input sequence is a "problem sequence" (i.e., may be normalized into different strings by different implementations), or `PR29_STRINGPREP_ERROR` if there was a problem converting the string from UTF-8 to UCS-4.

## Types and Values

### IDNAPI

    #define             IDNAPI

Symbol holding shared library API visibility decorator.

This is used internally by the library header file and should never be used or modified by the application.

https://www.gnu.org/software/gnulib/manual/html_node/Exported-Symbols-of-Shared-Libraries.html

### enum Pr29_rc

Enumerated return codes for `pr29_4()`, `pr29_4z()`, `pr29_8z()`. The value 0 is guaranteed to always correspond to success.

#### Members

PR29_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. |
PR29_PROBLEM | A problem sequence was encountered. |
PR29_STRINGPREP_ERROR | The character set conversion failed (only for `pr29_8z()`). |