1.1 --- a/templates/native/io.c Thu Nov 04 23:44:29 2021 +0100
1.2 +++ b/templates/native/io.c Tue Aug 29 01:46:23 2023 +0200
1.3 @@ -1,6 +1,6 @@
1.4 /* Native functions for input/output.
1.5
1.6 -Copyright (C) 2016, 2017, 2021 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2016, 2017, 2021, 2023 Paul Boddie <paul@boddie.org.uk>
1.8
1.9 This program is free software; you can redistribute it and/or modify it under
1.10 the terms of the GNU General Public License as published by the Free Software
1.11 @@ -31,7 +31,7 @@
1.12
1.13 /* Input/output. */
1.14
1.15 -__attr __fn_native_io_fclose(__attr __self, __attr fp)
1.16 +__attr __fn_native_io_fclose(__attr __result, __attr __self, __attr fp)
1.17 {
1.18 /* fp interpreted as FILE reference */
1.19 FILE *f = (FILE *) fp.datavalue;
1.20 @@ -43,7 +43,7 @@
1.21 return __builtins___none_None;
1.22 }
1.23
1.24 -__attr __fn_native_io_fflush(__attr __self, __attr fp)
1.25 +__attr __fn_native_io_fflush(__attr __result, __attr __self, __attr fp)
1.26 {
1.27 /* fp interpreted as FILE reference */
1.28 FILE *f = (FILE *) fp.datavalue;
1.29 @@ -55,7 +55,7 @@
1.30 return __builtins___none_None;
1.31 }
1.32
1.33 -__attr __fn_native_io_fopen(__attr __self, __attr filename, __attr mode)
1.34 +__attr __fn_native_io_fopen(__attr __result, __attr __self, __attr filename, __attr mode)
1.35 {
1.36 /* filename.__data__ interpreted as string */
1.37 char *fn = __load_via_object(__VALUE(filename), __data__).strvalue;
1.38 @@ -85,7 +85,7 @@
1.39 return __builtins___none_None;
1.40 }
1.41
1.42 -__attr __fn_native_io_fdopen(__attr __self, __attr fd, __attr mode)
1.43 +__attr __fn_native_io_fdopen(__attr __result, __attr __self, __attr fd, __attr mode)
1.44 {
1.45 /* fd interpreted as int */
1.46 int i = __TOINT(fd);
1.47 @@ -115,7 +115,7 @@
1.48 return __builtins___none_None;
1.49 }
1.50
1.51 -__attr __fn_native_io_fread(__attr __self, __attr fp, __attr size)
1.52 +__attr __fn_native_io_fread(__attr __result, __attr __self, __attr fp, __attr size)
1.53 {
1.54 /* fp interpreted as FILE reference */
1.55 FILE *f = (FILE *) fp.datavalue;
1.56 @@ -143,7 +143,7 @@
1.57 return __new_str(s, have_read);
1.58 }
1.59
1.60 -__attr __fn_native_io_fwrite(__attr __self, __attr fp, __attr str)
1.61 +__attr __fn_native_io_fwrite(__attr __result, __attr __self, __attr fp, __attr str)
1.62 {
1.63 /* fp interpreted as FILE reference */
1.64 FILE *f = (FILE *) fp.datavalue;
1.65 @@ -165,7 +165,7 @@
1.66 return __builtins___none_None;
1.67 }
1.68
1.69 -__attr __fn_native_io_close(__attr __self, __attr fd)
1.70 +__attr __fn_native_io_close(__attr __result, __attr __self, __attr fd)
1.71 {
1.72 /* fd interpreted as int */
1.73 int i = __TOINT(fd);
1.74 @@ -177,7 +177,7 @@
1.75 return __builtins___none_None;
1.76 }
1.77
1.78 -__attr __fn_native_io_read(__attr __self, __attr fd, __attr n)
1.79 +__attr __fn_native_io_read(__attr __result, __attr __self, __attr fd, __attr n)
1.80 {
1.81 /* fd interpreted as int */
1.82 int i = __TOINT(fd);
1.83 @@ -200,7 +200,7 @@
1.84 return __new_str(s, have_read);
1.85 }
1.86
1.87 -__attr __fn_native_io_write(__attr __self, __attr fd, __attr str)
1.88 +__attr __fn_native_io_write(__attr __result, __attr __self, __attr fd, __attr str)
1.89 {
1.90 /* fd interpreted as int */
1.91 int i = __TOINT(fd);