punycode

punycode

Synopsis

#define             IDNAPI
enum                Punycode_status;
const char *        punycode_strerror                   (Punycode_status rc);
typedef             punycode_uint;
int                 punycode_encode                     (size_t input_length,
                                                         const punycode_uint input[],
                                                         unsigned char case_flags[],
                                                         size_t *output_length,
                                                         char output[]);
int                 punycode_decode                     (size_t input_length,
                                                         const char input[],
                                                         size_t *output_length,
                                                         punycode_uint output[],
                                                         unsigned char case_flags[]);

Description

Details

IDNAPI

#define             IDNAPI


enum Punycode_status

  typedef enum
  {
    PUNYCODE_SUCCESS = punycode_success,
    PUNYCODE_BAD_INPUT = punycode_bad_input,
    PUNYCODE_BIG_OUTPUT = punycode_big_output,
    PUNYCODE_OVERFLOW = punycode_overflow
  } Punycode_status;

Enumerated return codes of punycode_encode() and punycode_decode(). The value 0 is guaranteed to always correspond to success.

PUNYCODE_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.

PUNYCODE_BAD_INPUT

Input is invalid.

PUNYCODE_BIG_OUTPUT

Output would exceed the space provided.

PUNYCODE_OVERFLOW

Input needs wider integers to process.

punycode_strerror ()

const char *        punycode_strerror                   (Punycode_status rc);

rc :

Returns :


punycode_uint

  typedef uint32_t punycode_uint;

Unicode code point data type, this is always a 32 bit unsigned integer.


punycode_encode ()

int                 punycode_encode                     (size_t input_length,
                                                         const punycode_uint input[],
                                                         unsigned char case_flags[],
                                                         size_t *output_length,
                                                         char output[]);

input_length :

input :

case_flags :

output_length :

output :

Returns :


punycode_decode ()

int                 punycode_decode                     (size_t input_length,
                                                         const char input[],
                                                         size_t *output_length,
                                                         punycode_uint output[],
                                                         unsigned char case_flags[]);

input_length :

input :

output_length :

output :

case_flags :

Returns :