CPP builtins
[m6w6/ext-psi] / tests / idn / idn.psi
1 #ifdef __linux__
2 lib "crypt";
3 #endif
4
5 #include <stdlib.h>
6
7 lib "idn";
8 #include <idna.h>
9
10 function idn\utf8_to_ascii(string $host, string &$result, int $flags = 0) : int {
11 let output = &NULL;
12 let input = strval($host);
13 let flags = intval($flags);
14 set $result = to_string(*output);
15 return to_int(idna_to_ascii_8z);
16 free free(*output);
17 }
18
19 function idn\strerror(int $rc) : string {
20 return to_string(idna_strerror);
21 let rc = intval($rc);
22 }