for review: More runtime header reorganisation

Andrew Bromage bromage at cs.mu.OZ.AU
Mon Jul 27 14:55:03 AEST 1998


G'day all.

Tyson or Fergus, could you please review this?

Thnaks.

Cheers,
Andrew Bromage

Estimated hours taken: 0.5

Another minor reorganisation for compatibility with FreeBSD headers.

mercury_type_info.h:
        Move MR_ArrayType into mercury_library_types.h.

mercury_types.h:
        Move MercuryFile into mercury_library_types.h.

mercury_library_types.h:
        New file, intended for the declaration of C types which are
        really the province of the library rather than the runtime, but
        which the runtime still needs.

mercury_imp.h:
        Import mercury_library_types.h.


Index: mercury_imp.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_imp.h,v
retrieving revision 1.10
diff -u -r1.10 mercury_imp.h
--- mercury_imp.h	1998/07/26 08:38:35	1.10
+++ mercury_imp.h	1998/07/27 04:38:58
@@ -42,6 +42,7 @@
 #include	"mercury_debug.h"
 
 #include	"mercury_types.h"
+#include	"mercury_library_types.h"
 #include	"mercury_string.h"
 #include	"mercury_float.h"
 #include	"mercury_stack_trace.h"
Index: mercury_type_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.10
diff -u -r1.10 mercury_type_info.h
--- mercury_type_info.h	1998/07/22 07:53:32	1.10
+++ mercury_type_info.h	1998/07/27 04:38:58
@@ -767,19 +767,6 @@
 
 /*---------------------------------------------------------------------------*/
 
-/*
-** definitions for accessing the representation of the
-** Mercury `array' type
-*/
-
-typedef struct {
-	Integer size;
-	Word elements[1]; /* really this is variable-length */
-} MR_ArrayType;
-
-#define MR_make_array(sz) ((MR_ArrayType *) make_many(Word, (sz) + 1))
-
-
 Word * MR_create_type_info(Word *, Word *);
 int MR_compare_type_info(Word, Word);
 Word MR_collapse_equivalences(Word);
Index: mercury_types.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_types.h,v
retrieving revision 1.12
diff -u -r1.12 mercury_types.h
--- mercury_types.h	1998/07/13 22:44:14	1.12
+++ mercury_types.h	1998/07/27 04:38:58
@@ -13,7 +13,6 @@
 #define MERCURY_TYPES_H
 
 #include "mercury_conf.h"
-#include <stdio.h>	/* for `FILE' */
 
 /* 
 ** Note that we require sizeof(Word) == sizeof(Integer) == sizeof(Code*);
@@ -61,18 +60,6 @@
 
 /* spinlocks -- see mercury_spinlock.h */
 typedef Word	SpinLock;
-
-/*
-** The C `MercuryFile' type is used for the Mercury `io__stream' type
-** in library/io.m.
-** Mercury files are not quite the same as C stdio FILEs,
-** because we keep track of a little bit more information.
-*/
-
-typedef struct mercury_file {
-	FILE *file;
-	int line_number;
-} MercuryFile;
 
 /*
 ** semidet predicates indicate success or failure by leaving nonzero or zero
New File: mercury_library_types.h
===================================================================
/*
** Copyright (C) 1995-1998 The University of Melbourne.
** This file may only be copied under the terms of the GNU Library General
** Public License - see the file COPYING.LIB in the Mercury distribution.
*/

/*
** mercury_library_types.h - definitions of some basic types used by the
** Mercury library.
*/

#ifndef MERCURY_LIBRARY_TYPES_H
#define MERCURY_LIBRARY_TYPES_H

#include <stdio.h>	/* for `FILE' */

/*
** The C `MercuryFile' type is used for the Mercury `io__stream' type
** in library/io.m.
** Mercury files are not quite the same as C stdio FILEs,
** because we keep track of a little bit more information.
*/

typedef struct mercury_file {
	FILE *file;
	int line_number;
} MercuryFile;

/*
** definitions for accessing the representation of the
** Mercury `array' type
*/

typedef struct {
	Integer size;
	Word elements[1]; /* really this is variable-length */
} MR_ArrayType;

#define MR_make_array(sz) ((MR_ArrayType *) make_many(Word, (sz) + 1))

#endif /* not MERCURY_LIBRARY_TYPES_H */




More information about the developers mailing list