1.1 --- a/templates/native/iconv.c Mon Mar 06 22:29:36 2017 +0100
1.2 +++ b/templates/native/iconv.c Tue Mar 07 00:28:18 2017 +0100
1.3 @@ -50,14 +50,12 @@
1.4
1.5 /* Character set conversion. */
1.6
1.7 -__attr __fn_native_iconv_iconv(__attr __args[])
1.8 +__attr __fn_native_iconv_iconv(__attr __self, __attr cd, __attr state)
1.9 {
1.10 - __attr * const cd = &__args[1];
1.11 - __attr * const state = &__args[2];
1.12 /* cd interpreted as iconv_t */
1.13 - iconv_t c = (iconv_t) cd->datavalue;
1.14 + iconv_t c = (iconv_t) cd.datavalue;
1.15 /* state.__data__ interpreted as list */
1.16 - __fragment *f = __load_via_object(state->value, __data__).seqvalue;
1.17 + __fragment *f = __load_via_object(state.value, __data__).seqvalue;
1.18
1.19 /* Obtain the string, start position, and remaining bytes from the state. */
1.20
1.21 @@ -123,11 +121,10 @@
1.22 return __builtins___none_None;
1.23 }
1.24
1.25 -__attr __fn_native_iconv_iconv_close(__attr __args[])
1.26 +__attr __fn_native_iconv_iconv_close(__attr __self, __attr cd)
1.27 {
1.28 - __attr * const cd = &__args[1];
1.29 /* cd interpreted as iconv_t */
1.30 - iconv_t c = (iconv_t) cd->datavalue;
1.31 + iconv_t c = (iconv_t) cd.datavalue;
1.32
1.33 errno = 0;
1.34
1.35 @@ -137,14 +134,12 @@
1.36 return __builtins___none_None;
1.37 }
1.38
1.39 -__attr __fn_native_iconv_iconv_open(__attr __args[])
1.40 +__attr __fn_native_iconv_iconv_open(__attr __self, __attr tocode, __attr fromcode)
1.41 {
1.42 - __attr * const tocode = &__args[1];
1.43 - __attr * const fromcode = &__args[2];
1.44 /* tocode.__data__ interpreted as string */
1.45 - char *t = __load_via_object(tocode->value, __data__).strvalue;
1.46 + char *t = __load_via_object(tocode.value, __data__).strvalue;
1.47 /* fromcode.__data__ interpreted as string */
1.48 - char *f = __load_via_object(fromcode->value, __data__).strvalue;
1.49 + char *f = __load_via_object(fromcode.value, __data__).strvalue;
1.50 iconv_t result;
1.51 __attr attr;
1.52
1.53 @@ -160,11 +155,10 @@
1.54 return attr;
1.55 }
1.56
1.57 -__attr __fn_native_iconv_iconv_reset(__attr __args[])
1.58 +__attr __fn_native_iconv_iconv_reset(__attr __self, __attr cd)
1.59 {
1.60 - __attr * const cd = &__args[1];
1.61 /* cd interpreted as iconv_t */
1.62 - iconv_t c = (iconv_t) cd->datavalue;
1.63 + iconv_t c = (iconv_t) cd.datavalue;
1.64
1.65 iconv(c, NULL, NULL, NULL, NULL);
1.66 return __builtins___none_None;