|
|
| version 1.1, 2015/04/14 21:42:53 | version 1.2, 2015/04/24 15:31:49 |
|---|---|
| Line 78 extern "C" | Line 78 extern "C" |
| #include "pa_config_includes.h" | #include "pa_config_includes.h" |
| enum punycode_status | enum punycode_status { |
| { | punycode_success = 0, |
| punycode_success = 0, | punycode_bad_input = 1, /* Input is invalid. */ |
| punycode_bad_input = 1, /* Input is invalid. */ | punycode_big_output = 2, /* Output would exceed the space provided. */ |
| punycode_big_output = 2, /* Output would exceed the space provided. */ | punycode_overflow = 3 /* Wider integers needed to process input. */ |
| punycode_overflow = 3 /* Wider integers needed to process input. */ | }; |
| }; | |
| typedef enum { | |
| typedef enum | PUNYCODE_SUCCESS = punycode_success, |
| { | PUNYCODE_BAD_INPUT = punycode_bad_input, |
| PUNYCODE_SUCCESS = punycode_success, | PUNYCODE_BIG_OUTPUT = punycode_big_output, |
| PUNYCODE_BAD_INPUT = punycode_bad_input, | PUNYCODE_OVERFLOW = punycode_overflow |
| PUNYCODE_BIG_OUTPUT = punycode_big_output, | } Punycode_status; |
| PUNYCODE_OVERFLOW = punycode_overflow | |
| } Punycode_status; | |
| const char *punycode_strerror (Punycode_status rc); | const char *punycode_strerror (Punycode_status rc); |
| /* punycode_uint needs to be unsigned and needs to be */ | /* punycode_uint needs to be unsigned and needs to be */ |
| /* at least 26 bits wide. */ | /* at least 26 bits wide. */ |
| typedef uint32_t punycode_uint; | typedef uint32_t punycode_uint; |
| int punycode_encode (size_t input_length, const punycode_uint input[], const unsigned char case_flags[], size_t * output_length, char output[]); | int punycode_encode (size_t input_length, const punycode_uint input[], const unsigned char case_flags[], size_t * output_length, char output[]); |
| /* | /* |
| punycode_encode() converts a sequence of code points (presumed to be | punycode_encode() converts a sequence of code points (presumed to be |
| Line 158 extern "C" | Line 156 extern "C" |
| and output might contain garbage. | and output might contain garbage. |
| */ | */ |
| int punycode_decode (size_t input_length, const char input[], size_t * output_length, punycode_uint output[], unsigned char case_flags[]); | int punycode_decode (size_t input_length, const char input[], size_t * output_length, punycode_uint output[], unsigned char case_flags[]); |
| /* | /* |
| punycode_decode() converts Punycode to a sequence of code points | punycode_decode() converts Punycode to a sequence of code points |