[m-rev.] for review: add `terminates' attributes to foreign_procs in library
Julien Fischer
juliensf at students.cs.mu.OZ.AU
Thu Feb 19 20:02:47 AEDT 2004
Estimated hours taken: 0.5
Branches: main
Add `terminates' attributes to those foreign procs in the standard library
that make calls back to Mercury. My recent change to the termination analyser
means that they are now not considered to be terminating by default.
library/*.m:
Add `terminates' attributes to foreign procs that are
not considered to be terminating by default.
Julien.
Index: library/benchmarking.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/benchmarking.m,v
retrieving revision 1.58
diff -u -r1.58 benchmarking.m
--- library/benchmarking.m 11 Feb 2004 03:05:03 -0000 1.58
+++ library/benchmarking.m 13 Feb 2004 05:35:42 -0000
@@ -94,7 +94,7 @@
").
:- pragma foreign_proc("Java", report_stats,
- [may_call_mercury],
+ [may_call_mercury, terminates],
"
ML_report_stats();
").
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.101
diff -u -r1.101 builtin.m
--- library/builtin.m 20 Jan 2004 23:06:29 -0000 1.101
+++ library/builtin.m 13 Feb 2004 05:32:08 -0000
@@ -715,28 +715,28 @@
:- pragma foreign_proc("C#",
copy(X::ui, Y::uo),
- [may_call_mercury, thread_safe, promise_pure],
+ [may_call_mercury, thread_safe, promise_pure, terminates],
"
Y = deep_copy(X);
").
:- pragma foreign_proc("C#",
copy(X::in, Y::uo),
- [may_call_mercury, thread_safe, promise_pure],
+ [may_call_mercury, thread_safe, promise_pure, terminates],
"
Y = deep_copy(X);
").
:- pragma foreign_proc("Java",
copy(X::ui, Y::uo),
- [may_call_mercury, thread_safe, promise_pure],
+ [may_call_mercury, thread_safe, promise_pure, terminates],
"
Y = deep_copy(X);
").
:- pragma foreign_proc("Java",
copy(X::in, Y::uo),
- [may_call_mercury, thread_safe, promise_pure],
+ [may_call_mercury, thread_safe, promise_pure, terminates],
"
Y = deep_copy(X);
").
Index: library/dir.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/dir.m,v
retrieving revision 1.21
diff -u -r1.21 dir.m
--- library/dir.m 14 Jan 2004 03:31:14 -0000 1.21
+++ library/dir.m 13 Feb 2004 05:35:24 -0000
@@ -806,7 +806,8 @@
:- pragma foreign_proc("C#",
dir__make_directory(DirName::in, Res::out,
_IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
try {
// CreateDirectory doesn't fail if a file with the same
@@ -830,7 +831,8 @@
% Java has a similar library function java.io.File.mkdirs()
:- pragma foreign_proc("Java",
dir__make_directory(DirName::in, Res::out, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
try {
java.io.File dir = new java.io.File(DirName);
@@ -887,7 +889,8 @@
:- pragma foreign_proc("C",
dir__make_single_directory_2(ErrorIfExists::in, DirName::in,
Result::out, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
#if defined(MR_WIN32)
if (CreateDirectory(DirName, NULL)) {
@@ -921,7 +924,8 @@
:- pragma foreign_proc("C#",
dir__make_single_directory_2(ErrorIfExists::in, DirName::in,
Result::out, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
try {
// CreateDirectory doesn't fail if a file with the same
@@ -965,7 +969,8 @@
:- pragma foreign_proc("Java",
dir__make_single_directory_2(ErrorIfExists::in, DirName::in,
Result::out, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
try {
java.io.File newDir = new java.io.File(DirName);
@@ -1293,7 +1298,8 @@
:- pragma foreign_proc("C",
dir__open_2(DirName::in, Result::out, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
#if defined(MR_WIN32)
WIN32_FIND_DATA file_data;
@@ -1339,7 +1345,8 @@
:- pragma foreign_proc("C#",
dir__open_2(DirName::in, Result::out, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
try {
System.Collections.IEnumerator Dir =
@@ -1355,7 +1362,8 @@
:- pragma foreign_proc("Java",
dir__open_2(DirName::in, Result::out, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
try {
java.lang.String[] fileList =
Index: library/gc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/gc.m,v
retrieving revision 1.13
diff -u -r1.13 gc.m
--- library/gc.m 1 Nov 2003 05:30:44 -0000 1.13
+++ library/gc.m 13 Feb 2004 05:36:17 -0000
@@ -38,7 +38,9 @@
:- pragma no_inline(garbage_collect/0).
-:- pragma foreign_proc("C", garbage_collect, [may_call_mercury], "
+:- pragma foreign_proc("C", garbage_collect,
+ [may_call_mercury, terminates],
+"
#ifdef MR_CONSERVATIVE_GC
#ifndef MR_HIGHLEVEL_CODE
/* clear out the stacks and registers before garbage collecting */
Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.318
diff -u -r1.318 io.m
--- library/io.m 12 Feb 2004 05:14:38 -0000 1.318
+++ library/io.m 13 Feb 2004 05:41:54 -0000
@@ -2533,7 +2533,8 @@
:- pragma foreign_proc("C",
io__file_type_2(FollowSymLinks::in, FileName::in,
Result::out, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
#ifdef MR_HAVE_STAT
struct stat s;
@@ -2664,7 +2665,8 @@
:- pragma foreign_proc("C#",
io__file_type_2(_FollowSymLinks::in, FileName::in,
Result::out, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
try {
System.IO.FileAttributes attrs =
@@ -2697,7 +2699,8 @@
:- pragma foreign_proc("Java",
io__file_type_2(_FollowSymLinks::in, FileName::in,
Result::out, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
java.io.File file = new java.io.File(FileName);
@@ -2770,7 +2773,8 @@
:- pragma foreign_proc("C",
io__check_file_accessibility_2(FileName::in, AccessTypes::in,
Result::out, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
#if defined(MR_HAVE_ACCESS)
#ifdef F_OK
@@ -2821,7 +2825,8 @@
:- pragma foreign_proc("Java",
io__check_file_accessibility_2(FileName::in, AccessTypes::in,
Result::out, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
java.lang.String permissions = null;
@@ -2944,7 +2949,7 @@
:- pragma foreign_proc("C#",
have_dotnet_exec_permission(Result::out, _IO0::di, _IO::uo),
- [promise_pure, may_call_mercury, thread_safe],
+ [promise_pure, may_call_mercury, thread_safe, terminates],
"{
try {
// We need unrestricted permissions to execute
@@ -2976,7 +2981,8 @@
:- pragma foreign_proc("C#",
check_directory_accessibility_dotnet(FileName::in, CheckRead::in,
CheckWrite::in, Result::out, _IO0::di, _IO::uo),
- [promise_pure, may_call_mercury, tabled_for_io, thread_safe],
+ [promise_pure, may_call_mercury, tabled_for_io, thread_safe,
+ terminates],
"{
try {
if (CheckRead != 0) {
@@ -4455,7 +4461,8 @@
:- pragma foreign_proc("C",
io__may_delete_stream_info(MayDelete::out, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
MayDelete = !MR_trace_ever_enabled;
IO = IO0;
@@ -6190,7 +6197,7 @@
:- pragma foreign_proc("C",
io__putback_char(File::in, Character::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io],
+ [may_call_mercury, promise_pure, tabled_for_io, terminates],
"{
MercuryFilePtr mf = File;
if (Character == '\\n') {
@@ -6205,7 +6212,7 @@
:- pragma foreign_proc("C",
io__putback_byte(File::in, Character::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io],
+ [may_call_mercury, promise_pure, tabled_for_io, terminates],
"{
MercuryFilePtr mf = File;
/* XXX should work even if ungetc() fails */
@@ -6238,7 +6245,7 @@
:- pragma foreign_proc("C#",
io__putback_char(File::in, Character::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure],
+ [may_call_mercury, promise_pure, terminates],
"{
MR_MercuryFileStruct mf = File;
mercury_ungetc(mf, Character);
@@ -6246,7 +6253,7 @@
:- pragma foreign_proc("C#",
io__putback_byte(File::in, Byte::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure],
+ [may_call_mercury, promise_pure, terminates],
"{
MR_MercuryFileStruct mf = File;
if (mf.putback != -1) {
@@ -6272,14 +6279,14 @@
:- pragma foreign_proc("Java",
io__putback_char(File::in, Character::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure],
+ [may_call_mercury, promise_pure, terminates],
"
File.ungetc(Character);
").
:- pragma foreign_proc("Java",
io__putback_byte(File::in, Byte::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure],
+ [may_call_mercury, promise_pure, terminates],
"
File.ungetc(Byte);
").
@@ -6289,7 +6296,8 @@
:- pragma foreign_proc("C",
io__write_string(Message::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
mercury_print_string(mercury_current_text_output, Message);
MR_update_io(IO0, IO);
@@ -6297,7 +6305,8 @@
:- pragma foreign_proc("C",
io__write_char(Character::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
if (MR_PUTCH(*mercury_current_text_output, Character) < 0) {
mercury_output_error(mercury_current_text_output);
@@ -6310,7 +6319,8 @@
:- pragma foreign_proc("C",
io__write_int(Val::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
if (ML_fprintf(mercury_current_text_output, ""%ld"", (long) Val) < 0) {
mercury_output_error(mercury_current_text_output);
@@ -6320,7 +6330,8 @@
:- pragma foreign_proc("C",
io__write_float(Val::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
char buf[MR_SPRINTF_FLOAT_BUF_SIZE];
MR_sprintf_float(buf, Val);
@@ -6332,7 +6343,8 @@
:- pragma foreign_proc("C",
io__write_byte(Byte::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
/* call putc with a strictly non-negative byte-sized integer */
if (MR_PUTCH(*mercury_current_binary_output,
@@ -6345,7 +6357,8 @@
:- pragma foreign_proc("C",
io__write_bytes(Message::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
mercury_print_binary_string(mercury_current_binary_output, Message);
MR_update_io(IO0, IO);
@@ -6353,7 +6366,8 @@
:- pragma foreign_proc("C",
io__flush_output(IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
if (MR_FLUSH(*mercury_current_text_output) < 0) {
mercury_output_error(mercury_current_text_output);
@@ -6363,7 +6377,8 @@
:- pragma foreign_proc("C",
io__flush_binary_output(IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
if (MR_FLUSH(*mercury_current_binary_output) < 0) {
mercury_output_error(mercury_current_binary_output);
@@ -6373,14 +6388,16 @@
:- pragma foreign_proc("C#",
io__write_string(Message::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
mercury_print_string(mercury_current_text_output, Message);
").
:- pragma foreign_proc("C#",
io__write_char(Character::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
/* See mercury_output_string() for comments */
if (mercury_current_text_output.writer == null) {
@@ -6408,14 +6425,16 @@
:- pragma foreign_proc("C#",
io__write_int(Val::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
mercury_print_string(mercury_current_text_output, Val.ToString());
").
:- pragma foreign_proc("C#",
io__write_byte(Byte::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
mercury_current_binary_output.stream.WriteByte(
System.Convert.ToByte(Byte));
@@ -6423,74 +6442,85 @@
:- pragma foreign_proc("C#",
io__write_bytes(Message::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"{
mercury_print_binary_string(mercury_current_binary_output, Message);
}").
:- pragma foreign_proc("C#",
io__flush_output(_IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
mercury_current_text_output.stream.Flush();
").
:- pragma foreign_proc("C#",
io__flush_binary_output(_IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
mercury_current_binary_output.stream.Flush();
").
:- pragma foreign_proc("Java",
io__write_string(Message::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
System.out.print(Message);
").
:- pragma foreign_proc("Java",
io__write_char(Character::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
System.out.print(Character);
").
:- pragma foreign_proc("Java",
io__write_int(Val::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
System.out.print(Val);
").
:- pragma foreign_proc("Java",
io__write_float(Val::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
System.out.print(Val);
").
:- pragma foreign_proc("Java",
io__write_byte(Byte::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
mercury_current_binary_output.put((byte) Byte);
").
:- pragma foreign_proc("Java",
io__write_bytes(Message::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"{
mercury_current_binary_output.write(Message);
}").
:- pragma foreign_proc("Java",
io__flush_output(_IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
mercury_current_text_output.flush();
").
:- pragma foreign_proc("Java",
io__flush_binary_output(_IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
mercury_current_binary_output.flush();
").
@@ -6549,7 +6579,8 @@
:- pragma foreign_proc("C",
io__write_string(Stream::in, Message::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
mercury_print_string(Stream, Message);
MR_update_io(IO0, IO);
@@ -6557,7 +6588,8 @@
:- pragma foreign_proc("C",
io__write_char(Stream::in, Character::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
if (MR_PUTCH(*Stream, Character) < 0) {
mercury_output_error(Stream);
@@ -6570,7 +6602,8 @@
:- pragma foreign_proc("C",
io__write_int(Stream::in, Val::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
if (ML_fprintf(Stream, ""%ld"", (long) Val) < 0) {
mercury_output_error(Stream);
@@ -6580,7 +6613,8 @@
:- pragma foreign_proc("C",
io__write_float(Stream::in, Val::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
char buf[MR_SPRINTF_FLOAT_BUF_SIZE];
MR_sprintf_float(buf, Val);
@@ -6592,7 +6626,8 @@
:- pragma foreign_proc("C",
io__write_byte(Stream::in, Byte::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
/* call putc with a strictly non-negative byte-sized integer */
if (MR_PUTCH(*Stream, (int) ((unsigned char) Byte)) < 0) {
@@ -6603,7 +6638,8 @@
:- pragma foreign_proc("C",
io__write_bytes(Stream::in, Message::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
mercury_print_binary_string(Stream, Message);
MR_update_io(IO0, IO);
@@ -6611,7 +6647,8 @@
:- pragma foreign_proc("C",
io__flush_output(Stream::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
if (MR_FLUSH(*Stream) < 0) {
mercury_output_error(Stream);
@@ -6621,7 +6658,8 @@
:- pragma foreign_proc("C",
io__flush_binary_output(Stream::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"{
if (MR_FLUSH(*Stream) < 0) {
mercury_output_error(Stream);
@@ -6631,14 +6669,16 @@
:- pragma foreign_proc("C#",
io__write_string(Stream::in, Message::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"{
mercury_print_string(Stream, Message);
}").
:- pragma foreign_proc("C#",
io__write_char(Stream::in, Character::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"{
MR_MercuryFileStruct stream = Stream;
/* See mercury_output_string() for comments */
@@ -6665,105 +6705,120 @@
:- pragma foreign_proc("C#",
io__write_int(Stream::in, Val::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"{
mercury_print_string(Stream, Val.ToString());
}").
:- pragma foreign_proc("C#",
io__write_byte(Stream::in, Byte::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"{
Stream.stream.WriteByte(System.Convert.ToByte(Byte));
}").
:- pragma foreign_proc("C#",
io__write_bytes(Stream::in, Message::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"{
mercury_print_binary_string(Stream, Message);
}").
:- pragma foreign_proc("C#",
io__flush_output(Stream::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"{
Stream.stream.Flush();
}").
:- pragma foreign_proc("C#",
io__flush_binary_output(Stream::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"{
Stream.stream.Flush();
}").
:- pragma foreign_proc("Java",
io__seek_binary_2(Stream::in, Flag::in, Off::in, _IO0::di, _IO::uo),
- [will_not_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [will_not_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
Stream.seek(Flag, Off);
").
:- pragma foreign_proc("Java",
io__binary_stream_offset(Stream::in, Offset::out, _IO0::di, _IO::uo),
- [will_not_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [will_not_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
Offset = Stream.getOffset();
").
:- pragma foreign_proc("Java",
io__write_string(Stream::in, Message::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
Stream.write(Message);
").
:- pragma foreign_proc("Java",
io__write_char(Stream::in, Character::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
Stream.put(Character);
").
:- pragma foreign_proc("Java",
io__write_int(Stream::in, Val::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
Stream.write(java.lang.String.valueOf(Val));
").
:- pragma foreign_proc("Java",
io__write_float(Stream::in, Val::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
Stream.write(java.lang.String.valueOf(Val));
").
:- pragma foreign_proc("Java",
io__write_byte(Stream::in, Byte::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
Stream.put(Byte);
").
:- pragma foreign_proc("Java",
io__write_bytes(Stream::in, Message::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
Stream.write(Message);
").
:- pragma foreign_proc("Java",
io__flush_output(Stream::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
Stream.flush();
").
:- pragma foreign_proc("Java",
io__flush_binary_output(Stream::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, thread_safe, tabled_for_io],
+ [may_call_mercury, promise_pure, thread_safe, tabled_for_io,
+ terminates],
"
Stream.flush();
").
@@ -7412,7 +7467,8 @@
:- pragma foreign_proc("C",
io__close_stream(Stream::in, IO0::di, IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
mercury_close(Stream);
MR_update_io(IO0, IO);
@@ -7420,14 +7476,16 @@
:- pragma foreign_proc("C#",
io__close_stream(Stream::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
mercury_close(Stream);
").
:- pragma foreign_proc("Java",
io__close_stream(Stream::in, _IO0::di, _IO::uo),
- [may_call_mercury, promise_pure, tabled_for_io, thread_safe],
+ [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+ terminates],
"
Stream.close();
").
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list