[m-rev.] for conceptual review: standardizing on one type naming convention

Zoltan Somogyi zs at csse.unimelb.edu.au
Wed Nov 29 16:15:01 AEDT 2006


The runtime had two different conventions for naming types. One convention,
used mostly in the debugger-related modules, added underscores between
capitalized words; example: MR_Label_Layout. The other convention, used
in most modules, used capitalized words without underscores (e.g. MR_TypeInfo).

This diff standardizes on the second convention. It has no algorithmic changes,
only renames of types.

runtime/*.[ch]:
trace/*.[ch]:
compiler/*.m:
library/*.m:
mdbcomp/*.m:
	Effect the change described above. The only substantive change is that
	runtime/mercury_stack_layout.h used to define *two* types for trace
	levels: MR_TraceLevel and MR_Trace_Level, and this diff standardizes
	on just one (they had equivalent definitions).

runtime/mercury_bootstrap.h:
	Add a #define from the old name to the new for all the changed type
	names that the installed compiler can put into .c files. We can delete
	these #defines some time after this diff has bootstrapped.

slice/.mgnuc_opts:
	Restore the --no-mercury-stdlib-dir option, without which the slice
	directory won't compile after this change (because it looks for type
	names in the installed runtime header files, which define the old
	versions of type names).

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/layout.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout.m,v
retrieving revision 1.30
diff -u -r1.30 layout.m
--- compiler/layout.m	24 Nov 2006 03:48:02 -0000	1.30
+++ compiler/layout.m	26 Nov 2006 11:08:27 -0000
@@ -53,7 +53,7 @@
     --->    string_with_0s(string).
 
 :- type layout_data
-    --->    label_layout_data(          % defines MR_Label_Layout
+    --->    label_layout_data(          % defines MR_LabelLayout
                 proc_label              :: proc_label,
                 label_num               :: int,
                 proc_layout_name        :: layout_name,
@@ -64,12 +64,12 @@
                 maybe_user_info         :: maybe(user_event_data),
                 maybe_var_info          :: maybe(label_var_info)
             )
-    ;       proc_layout_data(           % defines MR_Proc_Layout
+    ;       proc_layout_data(           % defines MR_ProcLayout
                 proc_layout_label       :: rtti_proc_label,
                 proc_layout_trav        :: proc_layout_stack_traversal,
                 proc_layout_more        :: maybe_proc_id_and_more
             )
-    ;       module_layout_data(         % defines MR_Module_Layout
+    ;       module_layout_data(         % defines MR_ModuleLayout
                 module_name             :: module_name,
                 string_table_size       :: int,
                 string_table            :: string_with_0s,
@@ -80,7 +80,7 @@
                 num_label_exec_count    :: int,
                 maybe_event_specs       :: maybe(string)
             )
-    ;       closure_proc_id_data(       % defines MR_Closure_Id
+    ;       closure_proc_id_data(       % defines MR_ClosureId
                 caller_proc_label       :: proc_label,
                 caller_closure_seq_no   :: int,
                 closure_proc_label      :: proc_label,
@@ -110,14 +110,14 @@
             ).
 
 :- type label_var_info
-    --->    label_var_info(             % part of MR_Label_Layout
+    --->    label_var_info(             % part of MR_LabelLayout
                 encoded_var_count       :: int,
                 locns_types             :: rval,
                 var_nums                :: rval,
                 type_params             :: rval
             ).
 
-:- type proc_layout_stack_traversal     % defines MR_Stack_Traversal
+:- type proc_layout_stack_traversal     % defines MR_StackTraversal
     --->    proc_layout_stack_traversal(
                 entry_label             :: maybe(label),
                                         % The proc entry label; will be `no'
@@ -157,7 +157,7 @@
                 maybe(proc_layout_exec_trace)
             ).
 
-:- type proc_layout_exec_trace          % defines MR_Exec_Trace
+:- type proc_layout_exec_trace          % defines MR_ExecTrace
     --->    proc_layout_exec_trace(
                 call_label_layout       :: layout_name,
                 proc_body_bytes         :: list(int),
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.77
diff -u -r1.77 layout_out.m
--- compiler/layout_out.m	24 Nov 2006 03:48:02 -0000	1.77
+++ compiler/layout_out.m	26 Nov 2006 11:08:27 -0000
@@ -407,7 +407,7 @@
         output_layout_name(proc_layout(ProcLabel, Kind), !IO)
     ;
         Data = proc_layout_exec_trace(ProcLabel),
-        io.write_string("static MR_STATIC_CODE_CONST MR_Exec_Trace\n\t", !IO),
+        io.write_string("static MR_STATIC_CODE_CONST MR_ExecTrace\n\t", !IO),
         output_layout_name(proc_layout_exec_trace(ProcLabel), !IO)
     ;
         Data = proc_layout_head_var_nums(ProcLabel),
@@ -432,16 +432,16 @@
         io.write_string("static const ", !IO),
         (
             ClosureProcLabel = ordinary_proc_label(_, _, _, _, _, _),
-            io.write_string("MR_User_Closure_Id\n", !IO)
+            io.write_string("MR_UserClosureId\n", !IO)
         ;
             ClosureProcLabel = special_proc_label(_, _, _, _, _, _),
-            io.write_string("MR_UCI_Closure_Id\n", !IO)
+            io.write_string("MR_UCIClosureId\n", !IO)
         ),
         output_layout_name(closure_proc_id(CallerProcLabel, SeqNo,
             ClosureProcLabel), !IO)
     ;
         Data = file_layout(ModuleName, FileNum),
-        io.write_string("static const MR_Module_File_Layout ", !IO),
+        io.write_string("static const MR_ModuleFileLayout ", !IO),
         output_layout_name(file_layout(ModuleName, FileNum), !IO)
     ;
         Data = file_layout_line_number_vector(ModuleName, FileNum),
@@ -451,7 +451,7 @@
         io.write_string("[]", !IO)
     ;
         Data = file_layout_label_layout_vector(ModuleName, FileNum),
-        io.write_string("static const MR_Label_Layout *", !IO),
+        io.write_string("static const MR_LabelLayout *", !IO),
         output_layout_name(
             file_layout_label_layout_vector(ModuleName, FileNum), !IO),
         io.write_string("[]", !IO)
@@ -462,7 +462,7 @@
         io.write_string("[]", !IO)
     ;
         Data = module_layout_file_vector(ModuleName),
-        io.write_string("static const MR_Module_File_Layout *", !IO),
+        io.write_string("static const MR_ModuleFileLayout *", !IO),
         output_layout_name(module_layout_file_vector(ModuleName), !IO),
         io.write_string("[]", !IO)
     ;
@@ -475,7 +475,7 @@
         io.write_string("]", !IO)
     ;
         Data = module_layout_proc_vector(ModuleName),
-        io.write_string("static const MR_Proc_Layout *", !IO),
+        io.write_string("static const MR_ProcLayout *", !IO),
         output_layout_name(module_layout_proc_vector(ModuleName), !IO),
         io.write_string("[]", !IO)
     ;
@@ -485,7 +485,7 @@
         io.write_string("[]", !IO)
     ;
         Data = module_layout(ModuleName),
-        io.write_string("static const MR_Module_Layout ", !IO),
+        io.write_string("static const MR_ModuleLayout ", !IO),
         output_layout_name(module_layout(ModuleName), !IO)
     ;
         Data = proc_static(RttiProcLabel),
@@ -498,7 +498,7 @@
         io.write_string("[]", !IO)
     ;
         Data = table_io_decl(RttiProcLabel),
-        io.write_string("static const MR_Table_Io_Decl ", !IO),
+        io.write_string("static const MR_TableIoDecl ", !IO),
         output_layout_name(table_io_decl(RttiProcLabel), !IO)
     ).
 
@@ -527,14 +527,14 @@
 
 :- func label_vars_to_type(label_vars) = string.
 
-label_vars_to_type(label_has_var_info) =    "MR_Label_Layout".
-label_vars_to_type(label_has_no_var_info) = "MR_Label_Layout_No_Var_Info".
+label_vars_to_type(label_has_var_info) =    "MR_LabelLayout".
+label_vars_to_type(label_has_no_var_info) = "MR_LabelLayoutNoVarInfo".
 
 :- func proc_layout_kind_to_type(proc_layout_kind) = string.
 
-proc_layout_kind_to_type(proc_layout_traversal) = "MR_Proc_Layout_Traversal".
-proc_layout_kind_to_type(proc_layout_proc_id(user)) = "MR_Proc_Layout_User".
-proc_layout_kind_to_type(proc_layout_proc_id(uci)) = "MR_Proc_Layout_UCI".
+proc_layout_kind_to_type(proc_layout_traversal) = "MR_ProcLayout_Traversal".
+proc_layout_kind_to_type(proc_layout_proc_id(user)) = "MR_ProcLayoutUser".
+proc_layout_kind_to_type(proc_layout_proc_id(uci)) = "MR_ProcLayoutUCI".
 
 %-----------------------------------------------------------------------------%
 
@@ -594,7 +594,7 @@
         io.write_string(UserEventName, !IO),
         io.write_string(""",\n", !IO),
         io.write_int(UserNumAttributes, !IO),
-        io.write_string(",\n(MR_Long_Lval *) ", !IO),
+        io.write_string(",\n(MR_LongLval *) ", !IO),
         output_rval_as_addr(UserLocnsRval, !IO),
         io.write_string(",\n(MR_TypeInfo *) ", !IO),
         output_rval_as_addr(UserTypesRval, !IO),
@@ -1001,7 +1001,7 @@
     ;
         unexpected(this_file, "output_layout_exec_trace: bad call layout")
     ),
-    io.write_string("),\n(const MR_Module_Layout *) &", !IO),
+    io.write_string("),\n(const MR_ModuleLayout *) &", !IO),
     ProcLabel = make_proc_label_from_rtti(RttiProcLabel),
     ModuleName = get_defining_module_name(ProcLabel),
     output_layout_name(module_layout(ModuleName), !IO),
@@ -1775,7 +1775,7 @@
     (
         CallSiteStatic = normal_call(Callee, TypeSubst, FileName, LineNumber,
             GoalPath),
-        io.write_string("MR_normal_call, (MR_Proc_Layout *)\n&", !IO),
+        io.write_string("MR_normal_call, (MR_ProcLayout *)\n&", !IO),
         CalleeProcLabel = make_proc_label_from_rtti(Callee),
         CalleeUserOrUci = proc_label_user_or_uci(CalleeProcLabel),
         output_layout_name(proc_layout(Callee,
@@ -1844,13 +1844,13 @@
 
     io.write_string("\n", !IO),
     output_layout_name_storage_type_name(LayoutName, yes, !IO),
-    io.write_string(" = {\n(const MR_Proc_Layout *) &", !IO),
+    io.write_string(" = {\n(const MR_ProcLayout *) &", !IO),
     output_layout_name(ProcLayoutName, !IO),
     io.write_string(",\n", !IO),
     io.write_int(NumPTIs, !IO),
     io.write_string(",\n(const MR_PseudoTypeInfo *) ", !IO),
     output_rval(PTIVectorRval, !IO),
-    io.write_string(",\n(const MR_Type_Param_Locns *) ", !IO),
+    io.write_string(",\n(const MR_TypeParamLocns *) ", !IO),
     output_rval(TypeParamsRval, !IO),
     io.write_string("\n};\n", !IO),
     decl_set_insert(decl_data_addr(layout_addr(LayoutName)), !DeclSet).
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.297
diff -u -r1.297 llds_out.m
--- compiler/llds_out.m	24 Nov 2006 03:48:03 -0000	1.297
+++ compiler/llds_out.m	26 Nov 2006 11:08:27 -0000
@@ -1007,7 +1007,7 @@
     io.write_string("(const MR_PseudoTypeInfo *) ", !IO),
     output_rval(PTIVectorRval, !IO),
     io.write_string(",\n", !IO),
-    io.write_string("(const MR_Type_Param_Locns *) ", !IO),
+    io.write_string("(const MR_TypeParamLocns *) ", !IO),
     output_rval(TypeParamsRval, !IO),
     io.write_string(",\n", !IO),
     io.write_string("{ 0 },\n", !IO),
Index: compiler/rtti.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.76
diff -u -r1.76 rtti.m
--- compiler/rtti.m	2 Oct 2006 05:21:22 -0000	1.76
+++ compiler/rtti.m	26 Nov 2006 11:08:29 -0000
@@ -2099,7 +2099,7 @@
 tabling_id_base_type(tabling_input_enum_params,  "Integer", yes).
 tabling_id_base_type(tabling_output_enum_params, "Integer", yes).
 tabling_id_base_type(tabling_ptis, "PseudoTypeInfo", yes).
-tabling_id_base_type(tabling_type_param_locns, "MR_Type_Param_Locns", yes).
+tabling_id_base_type(tabling_type_param_locns, "MR_TypeParamLocns", yes).
 tabling_id_base_type(tabling_root_node, "TableNode", no).
 tabling_id_base_type(tabling_call_stats,        "TableStepStats", yes).
 tabling_id_base_type(tabling_prev_call_stats,   "TableStepStats", yes).
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.125
diff -u -r1.125 stack_layout.m
--- compiler/stack_layout.m	24 Nov 2006 03:48:09 -0000	1.125
+++ compiler/stack_layout.m	26 Nov 2006 11:08:29 -0000
@@ -1591,7 +1591,7 @@
 :- pred locn_type_code(locn_type::in, int::out) is det.
 
 % The code of this predicate should be kept in sync with the enum type
-% MR_Long_Lval_Type in runtime/mercury_stack_layout.h. Note that the values
+% MR_LongLvalType in runtime/mercury_stack_layout.h. Note that the values
 % equal to 0 modulo 4 are reserved for representing constants.
 locn_type_code(lval_r_reg,           1).
 locn_type_code(lval_f_reg,           2).
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
Index: library/exception.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/exception.m,v
retrieving revision 1.117
diff -u -r1.117 exception.m
--- library/exception.m	11 Oct 2006 22:42:04 -0000	1.117
+++ library/exception.m	26 Nov 2006 11:11:28 -0000
@@ -1550,11 +1550,12 @@
     MR_Word *base_curfr)
 {
     const MR_Internal               *label;
-    const MR_Label_Layout           *return_label_layout;
+    const MR_LabelLayout            *return_label_layout;
 
     /*
-    ** Find the layout info for the stack frame pointed to by MR_succip
+    ** Find the layout info for the stack frame pointed to by MR_succip.
     */
+
     label = MR_lookup_internal_by_addr(success_pointer);
     if (label == NULL) {
         WARNING(""internal label not found\\n"");
@@ -1563,13 +1564,13 @@
     return_label_layout = label->i_layout;
 
     while (return_label_layout != NULL) {
-        const MR_Proc_Layout        *entry_layout;
+        const MR_ProcLayout         *entry_layout;
         MR_Code                     *MR_jumpaddr;
-        MR_Stack_Walk_Step_Result   result;
+        MR_StackWalkStepResult      result;
         const char                  *problem;
   #ifdef MR_DEEP_PROFILING
         MR_CallSiteDynamic          *csd;
-        const MR_Proc_Layout        *pl;
+        const MR_ProcLayout         *pl;
         MR_ProcStatic               *ps;
         MR_ProcStatic               *proc_static;
         int                         top_csd_slot;
@@ -1583,8 +1584,9 @@
   #endif
 
         /*
-        ** check if we've reached a frame with an exception handler
+        ** Check if we've reached a frame with an exception handler.
         */
+
         entry_layout = return_label_layout->MR_sll_entry;
         if (!MR_DETISM_DET_STACK(entry_layout->MR_sle_detism)
             && MR_redoip_slot(base_curfr) ==
@@ -2116,12 +2118,13 @@
 
 /*
 ** builtin_throw(Exception):
-**  Throw the specified exception.
-**  That means unwinding the nondet stack until we find a handler,
-**  unwinding all the other Mercury stacks, and then
-**  calling longjmp() to unwind the C stack.
-**  The longjmp() will branch to builtin_catch which will then
-**  call Handler(Exception, Result).
+**
+** Throw the specified exception.
+** That means unwinding the nondet stack until we find a handler,
+** unwinding all the other Mercury stacks, and then
+** calling longjmp() to unwind the C stack.
+** The longjmp() will branch to builtin_catch which will then
+** call Handler(Exception, Result).
 **
 ** On entry, we have Exception in MR_r1.
 */
@@ -2140,8 +2143,9 @@
     exception_event_number = MR_trace_event_number;
 
     /*
-    ** let the debugger and/or the deep profiler trace exception throwing
+    ** Let the debugger and/or the deep profiler trace exception throwing.
     */
+
 #ifdef  MR_DEEP_PROFILING
     walk_stack = MR_TRUE;
 #else
@@ -2171,6 +2175,7 @@
     ** are still on the nondet stack because they left choice points
     ** behind.
     */
+
     orig_curfr = MR_curfr;
     while (MR_redoip_slot(MR_curfr)
         != MR_ENTRY(MR_exception_handler_do_fail))
@@ -2280,9 +2285,8 @@
 {
     MR_Word * saved_solns_heap_ptr;
 
-    /* switch to the solutions heap */
-    if (MR_ENGINE(MR_eng_heap_zone) == MR_EXCEPTION_STRUCT->MR_excp_heap_zone)
-    {
+    /* Switch to the solutions heap. */
+    if (MR_ENGINE(MR_eng_heap_zone) == MR_EXCEPTION_STRUCT->MR_excp_heap_zone) {
         swap_heaps();
     }
 
@@ -2302,14 +2306,14 @@
         MR_EXCEPTION_STRUCT->MR_excp_heap_zone->MR_zone_top);
     MR_restore_transient_registers();
 
-    /* switch back to the ordinary heap */
+    /* Switch back to the ordinary heap. */
     swap_heaps();
 
-    /* reset the heap */
+    /* Reset the heap. */
     assert(MR_EXCEPTION_STRUCT->MR_excp_heap_ptr <= MR_hp);
     MR_hp_word = (MR_Word) MR_EXCEPTION_STRUCT->MR_excp_heap_ptr;
 
-    /* MR_deep_copy the exception back to the ordinary heap */
+    /* MR_deep_copy the exception back to the ordinary heap. */
     assert(MR_EXCEPTION_STRUCT->MR_excp_solns_heap_ptr <=
         MR_ENGINE(MR_eng_solutions_heap_zone)->MR_zone_top);
     MR_save_transient_registers();
@@ -2319,19 +2323,17 @@
         MR_ENGINE(MR_eng_solutions_heap_zone)->MR_zone_top);
     MR_restore_transient_registers();
 
-    /* reset the solutions heap */
-    assert(MR_EXCEPTION_STRUCT->MR_excp_solns_heap_ptr
-        <= saved_solns_heap_ptr);
+    /* Reset the solutions heap. */
+    assert(MR_EXCEPTION_STRUCT->MR_excp_solns_heap_ptr <= saved_solns_heap_ptr);
     assert(saved_solns_heap_ptr <= MR_sol_hp);
     if (catch_code_model == MR_MODEL_NON_HANDLER) {
         /*
-        ** If the code inside the try (catch) was nondet,
-        ** then its caller (which may be solutions/2) may
-        ** have put some more stuff on the solutions-heap
-        ** after the goal succeeded; the goal may have
-        ** only thrown after being re-entered on backtracking.
-        ** Thus we can only reset the solutions heap to
-        ** where it was before copying the exception object to it.
+        ** If the code inside the try (catch) was nondet, then its caller
+        ** (which may be solutions/2) may have put some more stuff on the
+        ** solutions-heap after the goal succeeded; the goal may have only thrown
+        ** after being re-entered on backtracking. Thus we can only reset the
+        ** solutions heap to where it was before copying the exception object
+        ** to it.
         */
         MR_sol_hp = saved_solns_heap_ptr;
     } else {
@@ -2354,8 +2356,7 @@
     MR_curfr_word = MR_succfr_slot_word(MR_curfr);
 
     /*
-    ** Now longjmp to the catch, which will invoke the handler
-    ** that we found.
+    ** Now longjmp to the catch, which will invoke the handler that we found.
     */
 
 #ifdef  MR_DEBUG_JMPBUFS
@@ -2412,7 +2413,7 @@
 MR_define_label(mercury__exception__builtin_throw_1_0_i1);
     MR_update_prof_current_proc(
         MR_LABEL(mercury__exception__builtin_throw_1_0));
-    /* we've just returned from mercury__do_call_closure_compact */
+    /* We've just returned from mercury__do_call_closure_compact. */
     MR_r2 = MR_r1;
     MR_r1 = MR_TRUE;
     MR_succip_word = MR_stackvar(1);
Index: library/profiling_builtin.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/profiling_builtin.m,v
retrieving revision 1.18
diff -u -r1.18 profiling_builtin.m
--- library/profiling_builtin.m	19 Apr 2006 05:17:54 -0000	1.18
+++ library/profiling_builtin.m	26 Nov 2006 11:12:39 -0000
@@ -239,7 +239,7 @@
 :- type proc_dynamic        ---> proc_dynamic(c_pointer).
 :- type call_site_dynamic   ---> call_site_dynamic(c_pointer).
 
-:- pragma foreign_type("C", proc_layout,    "MR_Proc_Layout *").
+:- pragma foreign_type("C", proc_layout,    "MR_ProcLayout *").
 :- pragma foreign_type("C", proc_dynamic,   "MR_ProcDynamic *").
 :- pragma foreign_type("C", call_site_dynamic,  "MR_CallSiteDynamic *").
 
@@ -618,7 +618,7 @@
   #ifdef MR_USE_ACTIVATION_COUNTS
     MR_CallSiteDynamic      *csd;
     MR_ProcDynamic          *pd;
-    const MR_Proc_Layout    *pl;
+    const MR_ProcLayout     *pl;
     MR_ProcStatic           *ps;
 
     MR_enter_instrumentation();
@@ -652,7 +652,7 @@
   #ifndef MR_USE_ACTIVATION_COUNTS
     MR_CallSiteDynamic      *csd;
     MR_ProcDynamic          *pd;
-    const MR_Proc_Layout    *pl;
+    const MR_ProcLayout     *pl;
     MR_ProcStatic           *ps;
 
     MR_enter_instrumentation();
@@ -684,7 +684,7 @@
   #ifdef MR_USE_ACTIVATION_COUNTS
     MR_CallSiteDynamic      *csd;
     MR_ProcDynamic          *pd;
-    const MR_Proc_Layout    *pl;
+    const MR_ProcLayout     *pl;
     MR_ProcStatic           *ps;
 
     MR_enter_instrumentation();
@@ -716,7 +716,7 @@
   #ifndef MR_USE_ACTIVATION_COUNTS
     MR_CallSiteDynamic      *csd;
     MR_ProcDynamic          *pd;
-    const MR_Proc_Layout    *pl;
+    const MR_ProcLayout     *pl;
     MR_ProcStatic           *ps;
 
     MR_enter_instrumentation();
@@ -747,7 +747,7 @@
   #ifdef MR_USE_ACTIVATION_COUNTS
     MR_CallSiteDynamic      *csd;
     MR_ProcDynamic          *pd;
-    const MR_Proc_Layout    *pl;
+    const MR_ProcLayout     *pl;
     MR_ProcStatic           *ps;
 
     MR_enter_instrumentation();
@@ -779,7 +779,7 @@
   #ifndef MR_USE_ACTIVATION_COUNTS
     MR_CallSiteDynamic      *csd;
     MR_ProcDynamic          *pd;
-    const MR_Proc_Layout    *pl;
+    const MR_ProcLayout     *pl;
     MR_ProcStatic           *ps;
 
     MR_enter_instrumentation();
cvs diff: Diffing mdbcomp
Index: mdbcomp/rtti_access.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/rtti_access.m,v
retrieving revision 1.7
diff -u -r1.7 rtti_access.m
--- mdbcomp/rtti_access.m	2 Oct 2006 05:21:38 -0000	1.7
+++ mdbcomp/rtti_access.m	26 Nov 2006 23:31:29 -0000
@@ -37,7 +37,7 @@
 :- pred get_context_from_label_layout(label_layout::in, string::out, int::out)
     is semidet.
 
-:- type proc_layout. 
+:- type proc_layout.
 
 :- func get_proc_label_from_layout(proc_layout) = proc_label.
 
@@ -70,11 +70,11 @@
 :- import_module require.
 :- import_module string.
 
-:- pragma foreign_type("C", label_layout, "const MR_Label_Layout *",
+:- pragma foreign_type("C", label_layout, "const MR_LabelLayout *",
     [can_pass_as_mercury_type, stable]).
 
     % stub only
-:- pragma foreign_type("Java", label_layout, "java.lang.Object", []). 
+:- pragma foreign_type("Java", label_layout, "java.lang.Object", []).
 
 :- pragma foreign_proc("C",
     get_proc_layout_from_label_layout(Label::in) = (ProcLayout::out),
@@ -90,17 +90,17 @@
     GoalPath = (MR_String) MR_label_goal_path(Label);
 ").
 
-get_goal_path_from_maybe_label(yes(Label)) 
+get_goal_path_from_maybe_label(yes(Label))
     = get_goal_path_from_label_layout(Label).
 get_goal_path_from_maybe_label(no) = "".
 
 :- pragma foreign_proc("C",
-    get_context_from_label_layout(Label::in, FileName::out, LineNo::out), 
+    get_context_from_label_layout(Label::in, FileName::out, LineNo::out),
     [will_not_call_mercury, thread_safe, promise_pure],
 "
     const char  *filename;
     int         line_no;
-    
+
     SUCCESS_INDICATOR = MR_find_context(Label, &filename, &line_no);
     LineNo = (MR_Integer) line_no;
     MR_TRACE_USE_HP(
@@ -109,7 +109,7 @@
 ").
 
 :- pragma foreign_proc("C",
-    get_port_from_label_layout(Label::in) = (Port::out), 
+    get_port_from_label_layout(Label::in) = (Port::out),
     [will_not_call_mercury, thread_safe, promise_pure],
 "
     Port = Label->MR_sll_port;
@@ -125,7 +125,7 @@
     ),
     PathPort = make_path_port(GoalPath, Port).
 
-:- pragma foreign_type("C", proc_layout, "const MR_Proc_Layout *",
+:- pragma foreign_type("C", proc_layout, "const MR_ProcLayout *",
     [can_pass_as_mercury_type, stable]).
 :- pragma foreign_type("Java", proc_layout, "java.lang.Object", []). %stub only
 
@@ -140,7 +140,7 @@
         ),
         SymDefModule = string_to_sym_name(DefModule),
         SymTypeModule = string_to_sym_name(TypeModule),
-        ProcLabel = special_proc_label(SymDefModule, SpecialId, 
+        ProcLabel = special_proc_label(SymDefModule, SpecialId,
             SymTypeModule, TypeName, TypeArity, ModeNum)
     ;
         proc_layout_get_non_uci_fields(Layout, PredOrFunc,
@@ -152,7 +152,7 @@
     ).
 
 get_proc_name(ordinary_proc_label(_, _, _, ProcName, _, _)) = ProcName.
-get_proc_name(special_proc_label(_, _, _, ProcName , _, _)) = ProcName. 
+get_proc_name(special_proc_label(_, _, _, ProcName , _, _)) = ProcName.
 
 :- pred proc_layout_is_uci(proc_layout::in) is semidet.
 
@@ -175,7 +175,7 @@
         DefModule::out, PredName::out, TypeArity::out, ModeNum::out),
     [will_not_call_mercury, thread_safe, promise_pure],
 "
-    const MR_UCI_Proc_Id    *proc_id;
+    const MR_UCIProcId  *proc_id;
 
     proc_id = &Layout->MR_sle_uci;
 
@@ -197,7 +197,7 @@
         Arity::out, ModeNum::out),
     [will_not_call_mercury, thread_safe, promise_pure],
 "
-    const MR_User_Proc_Id   *proc_id;
+    const MR_UserProcId *proc_id;
 
     proc_id = &Layout->MR_sle_user;
 
@@ -214,9 +214,9 @@
     find_initial_version_arg_num(Layout::in, OutArgNum::in, InArgNum::out),
     [will_not_call_mercury, thread_safe, promise_pure],
 "
-    const MR_Proc_Layout    *proc;
-    int         out_hlds_num;
-    const char      *out_name;
+    const MR_ProcLayout     *proc;
+    int                     out_hlds_num;
+    const char              *out_name;
 
     proc = Layout;
 
@@ -241,7 +241,7 @@
         int                     head_var_num;
         int                     call_var_num;
         int                     call_num_vars;
-        const MR_Label_Layout   *call_label;
+        const MR_LabelLayout    *call_label;
         MR_bool                 found;
 
         start_of_num = MR_find_start_of_num_suffix(out_name);
@@ -256,8 +256,8 @@
         num_matches = 0;
         in_arg_num = -1;
 
-        for (head_var_num = 0; head_var_num < proc->MR_sle_num_head_vars; 
-            head_var_num++) 
+        for (head_var_num = 0; head_var_num < proc->MR_sle_num_head_vars;
+            head_var_num++)
         {
             in_hlds_num = proc->MR_sle_head_var_nums[head_var_num];
             in_name = MR_hlds_var_name(proc, in_hlds_num);
@@ -269,14 +269,14 @@
             if (start_of_num < 0) {
                 continue;
             }
- 
+
             if (! (
                     (
                         /*
                         ** The names are exactly the same except
                         ** for the numerical suffix.
                         */
-                        start_of_num == out_base_name_len && 
+                        start_of_num == out_base_name_len &&
                         strneq(out_name, in_name, start_of_num)
                     )
                 ||
@@ -348,12 +348,12 @@
     get_all_modes_for_layout(Layout::in) = (Layouts::out),
     [will_not_call_mercury, thread_safe, promise_pure],
 "
-    const MR_Module_Layout  *module;
-    const MR_Proc_Layout    *proc;
+    const MR_ModuleLayout   *module;
+    const MR_ProcLayout     *proc;
     int                     i;
     MR_Word                 list;
     MR_bool                 match;
-    const MR_Proc_Layout    *selected_proc;
+    const MR_ProcLayout     *selected_proc;
 
     selected_proc = Layout;
 
@@ -372,8 +372,8 @@
         if (MR_PROC_LAYOUT_IS_UCI(selected_proc)
             && MR_PROC_LAYOUT_IS_UCI(proc))
         {
-            const MR_UCI_Proc_Id    *proc_id;
-            const MR_UCI_Proc_Id    *selected_proc_id;
+            const MR_UCIProcId  *proc_id;
+            const MR_UCIProcId  *selected_proc_id;
 
             proc_id = &proc->MR_sle_uci;
             selected_proc_id = &selected_proc->MR_sle_uci;
@@ -394,8 +394,8 @@
         } else if (!MR_PROC_LAYOUT_IS_UCI(selected_proc)
             && !MR_PROC_LAYOUT_IS_UCI(proc))
         {
-            const MR_User_Proc_Id   *proc_id;
-            const MR_User_Proc_Id   *selected_proc_id;
+            const MR_UserProcId *proc_id;
+            const MR_UserProcId *selected_proc_id;
 
             proc_id = &proc->MR_sle_user;
             selected_proc_id = &selected_proc->MR_sle_user;
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_accurate_gc.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_accurate_gc.c,v
retrieving revision 1.42
diff -u -r1.42 mercury_accurate_gc.c
--- runtime/mercury_accurate_gc.c	1 Nov 2006 05:30:33 -0000	1.42
+++ runtime/mercury_accurate_gc.c	26 Nov 2006 01:09:09 -0000
@@ -66,26 +66,26 @@
   static void   MR_LLDS_garbage_collect(MR_Code *saved_success,
                         MR_bool callee_model_semi, MR_Word *stack_pointer,
                         MR_Word *max_frame, MR_Word *current_frame);
-  static void   traverse_det_stack(const MR_Label_Layout *label_layout,
+  static void   traverse_det_stack(const MR_LabelLayout *label_layout,
                         MR_bool callee_model_semi,
                         MR_Word *stack_pointer, MR_Word *current_frame);
-  static void   traverse_nondet_stack(const MR_Label_Layout *label_layout,
+  static void   traverse_nondet_stack(const MR_LabelLayout *label_layout,
                         MR_bool callee_model_semi, MR_Word *stack_pointer,
                         MR_Word *max_frame, MR_Word *current_frame);
   static void   traverse_nondet_frame(void *user_data,
-                        const MR_Label_Layout *label_layout,
+                        const MR_LabelLayout *label_layout,
                         MR_Word *stack_pointer, MR_Word *current_frame);
   static MR_bool are_registers_live(MR_bool is_first_frame,
                         MR_bool callee_model_semi);
   static void   traverse_frame(MR_bool registers_live,
-                        const MR_Label_Layout *label_layout,
+                        const MR_LabelLayout *label_layout,
                         MR_Word *stack_pointer, MR_Word *current_frame);
   static void   resize_and_reset_redzone(MR_MemoryZone *old_heap,
                         MR_MemoryZone *new_heap);
-  static void   copy_long_value(MR_Long_Lval locn, MR_TypeInfo type_info, 
+  static void   copy_long_value(MR_LongLval locn, MR_TypeInfo type_info, 
                         MR_bool registers_live, MR_Word *stack_pointer,
                         MR_Word *current_frame);
-  static void   copy_short_value(MR_Short_Lval locn, MR_TypeInfo type_info,
+  static void   copy_short_value(MR_ShortLval locn, MR_TypeInfo type_info,
                         MR_bool registers_live, MR_Word *stack_pointer,
                         MR_Word *current_frame);
 
@@ -269,9 +269,9 @@
 MR_schedule_agc(MR_Code *pc_at_signal, MR_Word *sp_at_signal,
     MR_Word *curfr_at_signal)
 {
-    const MR_Proc_Layout    *proc_layout;
-    MR_Long_Lval_Type       type;
-    MR_Long_Lval            location;
+    const MR_ProcLayout     *proc_layout;
+    MR_LongLvalType         type;
+    MR_LongLval             location;
     MR_Entry                *entry_label = NULL;
     int                     number;
     MR_Determinism          determinism;
@@ -466,7 +466,7 @@
     MR_MemoryZone                   *old_heap, *new_heap;
     MR_Word                         *old_hp;
     MR_Internal                     *label;
-    const MR_Label_Layout           *label_layout;
+    const MR_LabelLayout            *label_layout;
 
     old_heap = MR_ENGINE(MR_eng_heap_zone);
     new_heap = MR_ENGINE(MR_eng_heap_zone2);
@@ -567,7 +567,7 @@
 ** frames.
 */
 static void
-traverse_det_stack(const MR_Label_Layout *label_layout,
+traverse_det_stack(const MR_LabelLayout *label_layout,
     MR_bool callee_model_semi, MR_Word *stack_pointer, MR_Word *current_frame)
 {
     /*
@@ -581,7 +581,7 @@
     ** For each stack frame ...
     */
     do {
-        const MR_Proc_Layout            *proc_layout;
+        const MR_ProcLayout             *proc_layout;
         MR_Stack_Walk_Step_Result       result;
         const char                      *problem;
 
@@ -632,13 +632,13 @@
 */ 
 
 struct first_frame_data {
-    const MR_Label_Layout   *first_frame_layout;
+    const MR_LabelLayout    *first_frame_layout;
     MR_Word                 *first_frame_curfr;
     MR_bool                 first_frame_callee_model_semi;
 };
     
 static void
-traverse_nondet_stack(const MR_Label_Layout *first_frame_layout,
+traverse_nondet_stack(const MR_LabelLayout *first_frame_layout,
     MR_bool callee_model_semi, MR_Word *stack_pointer,
     MR_Word *max_frame, MR_Word *current_frame)
 {
@@ -651,7 +651,7 @@
 }
 
 static void
-traverse_nondet_frame(void *user_data, const MR_Label_Layout *label_layout,
+traverse_nondet_frame(void *user_data, const MR_LabelLayout *label_layout,
     MR_Word *stack_pointer, MR_Word *current_frame)
 {   
     MR_bool                 is_first_frame;
@@ -677,17 +677,20 @@
 ** Traverse a stack frame (it could be either a det frame or a nondet frame).
 */
 static void
-traverse_frame(MR_bool registers_live, const MR_Label_Layout *label_layout,
+traverse_frame(MR_bool registers_live, const MR_LabelLayout *label_layout,
     MR_Word *stack_pointer, MR_Word *current_frame)
 {
-    int                             short_var_count, long_var_count;
+    int                             short_var_count;
+    int                             long_var_count;
     int                             i;
-    MR_MemoryList                   allocated_memory_cells = NULL;
+    MR_MemoryList                   allocated_memory_cells;
     MR_TypeInfoParams               type_params;
-    MR_Short_Lval                   locn;
+    MR_ShortLval                    locn;
     MR_PseudoTypeInfo               pseudo_type_info;
     MR_TypeInfo                     type_info;
 
+    allocated_memory_cells = NULL;
+
     if (MR_agc_debug) {
         /*
         ** XXX we used to print the label name here, but that's
@@ -760,7 +763,7 @@
 */
 
 static void
-copy_long_value(MR_Long_Lval locn, MR_TypeInfo type_info,
+copy_long_value(MR_LongLval locn, MR_TypeInfo type_info,
     MR_bool registers_live, MR_Word *stack_pointer, MR_Word *current_frame)
 {
     int     locn_num;
@@ -829,13 +832,13 @@
         break;
 
     default:
-        MR_fatal_error("Unknown MR_Long_Lval_Type in copy_long_value");
+        MR_fatal_error("Unknown MR_LongLvalType in copy_long_value");
         break;
     }
 }
 
 static void
-copy_short_value(MR_Short_Lval locn, MR_TypeInfo type_info,
+copy_short_value(MR_ShortLval locn, MR_TypeInfo type_info,
      MR_bool registers_live, MR_Word *stack_pointer, MR_Word *current_frame)
 {
     int     locn_num;
@@ -869,7 +872,7 @@
         break;
 
     default:
-        MR_fatal_error("Unknown MR_Short_Lval_Type in copy_short_value");
+        MR_fatal_error("Unknown MR_ShortLval_Type in copy_short_value");
         break;
     }
 }
Index: runtime/mercury_agc_debug.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_agc_debug.c,v
retrieving revision 1.27
diff -u -r1.27 mercury_agc_debug.c
--- runtime/mercury_agc_debug.c	16 Sep 2005 16:43:54 -0000	1.27
+++ runtime/mercury_agc_debug.c	26 Nov 2006 01:09:09 -0000
@@ -1,4 +1,7 @@
 /*
+** vim: ts=4 sw=4 expandtab
+*/
+/*
 ** Copyright (C) 1998-2005 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.
@@ -18,23 +21,24 @@
 /*
 ** Function prototypes.
 */
-static	void	dump_long_value(MR_Long_Lval locn, MR_MemoryZone *heap_zone,
-			MR_Word * stack_pointer, MR_Word *current_frame,
-			MR_bool do_regs);
-static	void	dump_short_value(MR_Short_Lval locn, MR_MemoryZone *heap_zone,
-			MR_Word * stack_pointer, MR_Word *current_frame,
-			MR_bool do_regs);
-static  void	dump_live_variables(const MR_Label_Layout *layout,
-			MR_MemoryZone *heap_zone, MR_bool top_frame,
-			MR_Word *stack_pointer, MR_Word *current_frame);
+static  void    MR_dump_long_value(MR_LongLval locn, MR_MemoryZone *heap_zone,
+                    MR_Word * stack_pointer, MR_Word *current_frame,
+                    MR_bool do_regs);
+static  void    MR_dump_short_value(MR_ShortLval locn, MR_MemoryZone *heap_zone,
+                    MR_Word * stack_pointer, MR_Word *current_frame,
+                    MR_bool do_regs);
+static  void    MR_dump_live_variables(const MR_LabelLayout *layout,
+                    MR_MemoryZone *heap_zone, MR_bool top_frame,
+                    MR_Word *stack_pointer, MR_Word *current_frame);
 
 /*---------------------------------------------------------------------------*/
 
 /*
 ** Currently this variable is never modified by the Mercury runtime code,
 ** but it can be modified manually in gdb.
-** XXX it would be nicer to set it based on a runtime option setting.
+** XXX It would be nicer to set it based on a runtime option setting.
 */
+
 #ifdef MR_DEBUG_AGC_PRINT_VARS
   static MR_bool MR_debug_agc_print_vars = MR_TRUE;
 #else
@@ -45,464 +49,445 @@
 MR_agc_dump_roots(MR_RootList roots)
 {
 #ifndef MR_HIGHLEVEL_CODE
-	MR_Word	saved_regs[MR_MAX_FAKE_REG];
+    MR_Word saved_regs[MR_MAX_FAKE_REG];
 #endif
 
-	fflush(NULL);
-	fprintf(stderr, "Dumping roots\n");
-
-  	if (MR_debug_agc_print_vars) {
-		while (roots != NULL) {
-
+    fflush(NULL);
+    fprintf(stderr, "Dumping roots\n");
 
+    if (MR_debug_agc_print_vars) {
+        while (roots != NULL) {
 #ifndef MR_HIGHLEVEL_CODE
-			/*
-			** Restore the registers, because we need to save them
-			** to a more permanent backing store (we are going to
-			** call Mercury soon, and we don't want it messing with
-			** the saved registers).
-			*/
-			MR_restore_registers();
-			MR_copy_regs_to_saved_regs(MR_MAX_FAKE_REG - 1,
-				saved_regs);
-
-			MR_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
-			MR_virtual_hp =
-				MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
+            /*
+            ** Restore the registers, because we need to save them to a more
+            ** permanent backing store (we are going to call Mercury soon,
+            ** and we don't want it messing with the saved registers).
+            */
+            MR_restore_registers();
+            MR_copy_regs_to_saved_regs(MR_MAX_FAKE_REG - 1, saved_regs);
+
+            MR_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
+            MR_virtual_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
 #endif /* !MR_HIGHLEVEL_CODE */
 
-			fflush(NULL);
-			MR_write_variable(roots->type_info, *roots->root);
-			fflush(NULL);
-			fprintf(stderr, "\n");
+            fflush(NULL);
+            MR_write_variable(roots->type_info, *roots->root);
+            fflush(NULL);
+            fprintf(stderr, "\n");
 
 #ifndef MR_HIGHLEVEL_CODE
-			MR_copy_saved_regs_to_regs(MR_MAX_FAKE_REG - 1,
-				saved_regs);
-			MR_save_registers();
+            MR_copy_saved_regs_to_regs(MR_MAX_FAKE_REG - 1, saved_regs);
+            MR_save_registers();
 #endif /* !MR_HIGHLEVEL_CODE */
-			roots = roots->next;
-		}
-	}
+            roots = roots->next;
+        }
+    }
 }
 
 #ifndef MR_HIGHLEVEL_CODE
 void
 MR_agc_dump_nondet_stack_frames(MR_Internal *label, MR_MemoryZone *heap_zone,
-	MR_Word *stack_pointer, MR_Word *current_frame, MR_Word *max_frame)
+    MR_Word *stack_pointer, MR_Word *current_frame, MR_Word *max_frame)
 {
-	MR_Code *success_ip;
-	int frame_size;
-	MR_bool registers_valid;
-
-	while (max_frame > MR_nondet_stack_trace_bottom) {
-
-		registers_valid = (max_frame == current_frame);
-
-		frame_size = max_frame - MR_prevfr_slot(max_frame);
-		if (frame_size == MR_NONDET_TEMP_SIZE) {
-			fprintf(stderr, "%p: nondet temp\n", max_frame);
-			fprintf(stderr, " redoip: ");
-			fflush(NULL);
-			MR_printlabel(stderr, MR_redoip_slot(max_frame));
-			fflush(NULL);
-			fprintf(stderr, " redofr: %p\n",
-				MR_redofr_slot(max_frame));
-
-			label = MR_lookup_internal_by_addr(MR_redoip_slot(
-					max_frame));
-
-			if (label && label->i_layout) {
-				dump_live_variables(label->i_layout, heap_zone,
-					registers_valid, stack_pointer,
-					MR_redofr_slot(max_frame));
-			}
-
-		} else if (frame_size == MR_DET_TEMP_SIZE) {
-			fprintf(stderr, "%p: nondet temp\n", max_frame);
-			fprintf(stderr, " redoip: ");
-			fflush(NULL);
-			MR_printlabel(stderr, MR_redoip_slot(max_frame));
-			fflush(NULL);
-			fprintf(stderr, " redofr: %p\n",
-				MR_redofr_slot(max_frame));
-			fprintf(stderr, " detfr:  %p\n",
-				MR_tmp_detfr_slot(max_frame));
-
-			label = MR_lookup_internal_by_addr(MR_redoip_slot(
-					max_frame));
-
-			if (label && label->i_layout) {
-				dump_live_variables(label->i_layout, heap_zone,
-					registers_valid,
-					MR_tmp_detfr_slot(max_frame),
-					max_frame);
-				/*
-				** XXX should max_frame above be
-				** MR_redoip_slot(max_frame) instead?
-				*/
-			}
-
-		} else {
-			fprintf(stderr, "%p: nondet ordinary\n", max_frame);
-			fprintf(stderr, " redoip: ");
-			fflush(NULL);
-			MR_printlabel(stderr, MR_redoip_slot(max_frame));
-			fflush(NULL);
-			fprintf(stderr, " redofr: %p\n",
-				MR_redofr_slot(max_frame));
-			fprintf(stderr, " succip: ");
-			fflush(NULL);
-			MR_printlabel(stderr, MR_succip_slot(max_frame));
-			fflush(NULL);
-			fprintf(stderr, " succfr: %p\n",
-				MR_succfr_slot(max_frame));
-
-			/* XXX ??? */
-			label = MR_lookup_internal_by_addr(MR_redoip_slot(
-					max_frame));
-
-			if (label && label->i_layout) {
-				dump_live_variables(label->i_layout, heap_zone,
-					registers_valid, stack_pointer,
-					MR_redofr_slot(max_frame));
-				fprintf(stderr, " this label: %s\n",
-					label->i_name);
-			}
-		}
+    MR_Code     *success_ip;
+    int         frame_size;
+    MR_bool     registers_valid;
+
+    while (max_frame > MR_nondet_stack_trace_bottom) {
+        registers_valid = (max_frame == current_frame);
+
+        frame_size = max_frame - MR_prevfr_slot(max_frame);
+        if (frame_size == MR_NONDET_TEMP_SIZE) {
+            fprintf(stderr, "%p: nondet temp\n", max_frame);
+            fprintf(stderr, " redoip: ");
+            fflush(NULL);
+            MR_printlabel(stderr, MR_redoip_slot(max_frame));
+            fflush(NULL);
+            fprintf(stderr, " redofr: %p\n", MR_redofr_slot(max_frame));
+
+            label = MR_lookup_internal_by_addr(MR_redoip_slot(max_frame));
+
+            if (label && label->i_layout) {
+                MR_dump_live_variables(label->i_layout, heap_zone,
+                    registers_valid, stack_pointer, MR_redofr_slot(max_frame));
+            }
+
+        } else if (frame_size == MR_DET_TEMP_SIZE) {
+            fprintf(stderr, "%p: nondet temp\n", max_frame);
+            fprintf(stderr, " redoip: ");
+            fflush(NULL);
+            MR_printlabel(stderr, MR_redoip_slot(max_frame));
+            fflush(NULL);
+            fprintf(stderr, " redofr: %p\n", MR_redofr_slot(max_frame));
+            fprintf(stderr, " detfr:  %p\n", MR_tmp_detfr_slot(max_frame));
+
+            label = MR_lookup_internal_by_addr(MR_redoip_slot(max_frame));
+
+            if (label && label->i_layout) {
+                MR_dump_live_variables(label->i_layout, heap_zone,
+                    registers_valid, MR_tmp_detfr_slot(max_frame), max_frame);
+                /*
+                ** XXX should max_frame above be
+                ** MR_redoip_slot(max_frame) instead?
+                */
+            }
+
+        } else {
+            fprintf(stderr, "%p: nondet ordinary\n", max_frame);
+            fprintf(stderr, " redoip: ");
+            fflush(NULL);
+            MR_printlabel(stderr, MR_redoip_slot(max_frame));
+            fflush(NULL);
+            fprintf(stderr, " redofr: %p\n", MR_redofr_slot(max_frame));
+            fprintf(stderr, " succip: ");
+            fflush(NULL);
+            MR_printlabel(stderr, MR_succip_slot(max_frame));
+            fflush(NULL);
+            fprintf(stderr, " succfr: %p\n", MR_succfr_slot(max_frame));
+
+            /* XXX ??? */
+            label = MR_lookup_internal_by_addr(MR_redoip_slot(max_frame));
+
+            if (label && label->i_layout) {
+                MR_dump_live_variables(label->i_layout, heap_zone,
+                    registers_valid, stack_pointer, MR_redofr_slot(max_frame));
+                fprintf(stderr, " this label: %s\n", label->i_name);
+            }
+        }
 
-		max_frame = MR_prevfr_slot(max_frame);
-	}
+        max_frame = MR_prevfr_slot(max_frame);
+    }
 
-    	/* XXX Lookup the address (redoip?) and dump the variables */
+    /* XXX Lookup the address (redoip?) and dump the variables */
 
-	fflush(NULL);
+    fflush(NULL);
 }
 
 void
 MR_agc_dump_stack_frames(MR_Internal *label, MR_MemoryZone *heap_zone,
-	MR_Word *stack_pointer, MR_Word *current_frame)
+    MR_Word *stack_pointer, MR_Word *current_frame)
 {
-	MR_Word			saved_regs[MR_MAX_FAKE_REG];
-	int			i, short_var_count, long_var_count;
-	MR_Word			*type_params;
-	MR_TypeInfo		type_info;
-	MR_Word			value;
-	const MR_Proc_Layout	*entry_layout;
-	const MR_Label_Layout	*layout;
-	const MR_Code		*success_ip;
-	MR_bool			top_frame = MR_TRUE;
-
-	layout = label->i_layout;
-	success_ip = label->i_addr;
-	entry_layout = layout->MR_sll_entry;
-
-	/*
-	** For each stack frame...
-	*/
-
-	while (MR_DETISM_DET_STACK(entry_layout->MR_sle_detism)) {
-		if (label->i_name != NULL) {
-			fprintf(stderr, "    label: %s\n", label->i_name);
-		} else {
-			fprintf(stderr, "    label: %p\n", label->i_addr);
-		}
-
-		if (success_ip == MR_stack_trace_bottom) {
-			break;
-		}
-
-		dump_live_variables(layout, heap_zone, top_frame,
-			stack_pointer, current_frame);
-		/*
-		** Move to the next stack frame.
-		*/
-		{
-			MR_Long_Lval            location;
-			MR_Long_Lval_Type            type;
-			int                     number;
-
-			location = entry_layout->MR_sle_succip_locn;
-			type = MR_LONG_LVAL_TYPE(location);
-			number = MR_LONG_LVAL_NUMBER(location);
-			if (type != MR_LONG_LVAL_TYPE_STACKVAR) {
-				MR_fatal_error("can only handle stackvars");
-			}
-
-			success_ip = (MR_Code *)
-				MR_based_stackvar(stack_pointer, number);
-			stack_pointer = stack_pointer -
-				entry_layout->MR_sle_stack_slots;
-			label = MR_lookup_internal_by_addr(success_ip);
-		}
-
-		top_frame = MR_FALSE;
-		layout = label->i_layout;
-
-		if (layout != NULL) {
-			entry_layout = layout->MR_sll_entry;
-		}
-	}
+    MR_Word                 saved_regs[MR_MAX_FAKE_REG];
+    int                     i;
+    int                     short_var_count;
+    int                     long_var_count;
+    MR_Word                 *type_params;
+    MR_TypeInfo             type_info;
+    MR_Word                 value;
+    const MR_ProcLayout     *entry_layout;
+    const MR_LabelLayout    *layout;
+    const MR_Code           *success_ip;
+    MR_bool                 top_frame;
+
+    layout = label->i_layout;
+    success_ip = label->i_addr;
+    entry_layout = layout->MR_sll_entry;
+
+    /*
+    ** For each stack frame...
+    */
+
+    top_frame = MR_TRUE;
+    while (MR_DETISM_DET_STACK(entry_layout->MR_sle_detism)) {
+        if (label->i_name != NULL) {
+            fprintf(stderr, "    label: %s\n", label->i_name);
+        } else {
+            fprintf(stderr, "    label: %p\n", label->i_addr);
+        }
+
+        if (success_ip == MR_stack_trace_bottom) {
+            break;
+        }
+
+        MR_dump_live_variables(layout, heap_zone, top_frame,
+            stack_pointer, current_frame);
+        /*
+        ** Move to the next stack frame.
+        */
+        {
+            MR_LongLval     location;
+            MR_LongLvalType type;
+            int             number;
+
+            location = entry_layout->MR_sle_succip_locn;
+            type = MR_LONG_LVAL_TYPE(location);
+            number = MR_LONG_LVAL_NUMBER(location);
+            if (type != MR_LONG_LVAL_TYPE_STACKVAR) {
+                MR_fatal_error("can only handle stackvars");
+            }
+
+            success_ip = (MR_Code *) MR_based_stackvar(stack_pointer, number);
+            stack_pointer = stack_pointer - entry_layout->MR_sle_stack_slots;
+            label = MR_lookup_internal_by_addr(success_ip);
+        }
+
+        top_frame = MR_FALSE;
+        layout = label->i_layout;
+
+        if (layout != NULL) {
+            entry_layout = layout->MR_sll_entry;
+        }
+    }
 }
 
 static void
-dump_live_variables(const MR_Label_Layout *label_layout,
-	MR_MemoryZone *heap_zone, MR_bool top_frame,
-	MR_Word *stack_pointer, MR_Word *current_frame)
+MR_dump_live_variables(const MR_LabelLayout *label_layout,
+    MR_MemoryZone *heap_zone, MR_bool top_frame,
+    MR_Word *stack_pointer, MR_Word *current_frame)
 {
-	int short_var_count, long_var_count, i;
-	MR_TypeInfo type_info;
-	MR_Word value;
-	MR_TypeInfoParams type_params;
-        MR_Word saved_regs[MR_MAX_FAKE_REG];
-        MR_Word *current_regs;
-
-	short_var_count = MR_short_desc_var_count(label_layout);
-	long_var_count = MR_long_desc_var_count(label_layout);
-
-	/*
-	** For the top stack frame, we should pass a pointer to
-	** a filled-in saved_regs instead of NULL. For other stack
-	** frames, passing NULL is fine, since output arguments are
-	** not live yet for any call except the top one.
-	*/
-	MR_restore_registers();
-	MR_copy_regs_to_saved_regs(MR_MAX_FAKE_REG - 1, saved_regs);
-	if (top_frame) {
-		current_regs = saved_regs;
-	} else {
-		current_regs = NULL;
-	}
-	type_params = MR_materialize_type_params_base(label_layout,
-		current_regs, stack_pointer, current_frame);
-
-	for (i = 0; i < long_var_count; i++) {
-		fprintf(stderr, "%-12s\t", "");
-		if (MR_PROC_LAYOUT_HAS_PROC_ID(label_layout->MR_sll_entry)) {
-			MR_print_proc_id(stderr, label_layout->MR_sll_entry);
-		}
-
-		dump_long_value(MR_long_desc_var_locn(label_layout, i),
-			heap_zone, stack_pointer, current_frame, top_frame);
-		fprintf(stderr, "\n");
-		fflush(NULL);
-
-		if (MR_debug_agc_print_vars) {
-			/*
-			** Call Mercury but use the debugging heap.
-			*/
-
-			MR_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
-			MR_virtual_hp =
-				MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
-
-			if (MR_get_type_and_value_base(label_layout, i,
-					current_regs, stack_pointer,
-					current_frame, type_params,
-					&type_info, &value)) {
-				printf("\t");
-				MR_write_variable(type_info, value);
-				printf("\n");
-			}
-
-			fflush(NULL);
-		}
-	}
-
-	for (; i < short_var_count; i++) {
-		fprintf(stderr, "%-12s\t", "");
-		if (MR_PROC_LAYOUT_HAS_PROC_ID(label_layout->MR_sll_entry)) {
-			MR_print_proc_id(stderr, label_layout->MR_sll_entry);
-		}
-
-		dump_short_value(MR_short_desc_var_locn(label_layout, i),
-			heap_zone, stack_pointer, current_frame, top_frame);
-		fprintf(stderr, "\n");
-		fflush(NULL);
-
-		if (MR_debug_agc_print_vars) {
-			/*
-			** Call Mercury but use the debugging heap.
-			*/
-
-			MR_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
-			MR_virtual_hp =
-				MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
-
-			if (MR_get_type_and_value_base(label_layout, i,
-					current_regs, stack_pointer,
-					current_frame, type_params,
-					&type_info, &value)) {
-				printf("\t");
-				MR_write_variable(type_info, value);
-				printf("\n");
-			}
-
-			fflush(NULL);
-		}
-	}
-
-
-	MR_copy_saved_regs_to_regs(MR_MAX_FAKE_REG - 1, saved_regs);
-	MR_save_registers();
-	MR_free(type_params);
+    int                 short_var_count;
+    int                 long_var_count;
+    int                 i;
+    MR_TypeInfo         type_info;
+    MR_Word             value;
+    MR_TypeInfoParams   type_params;
+    MR_Word             saved_regs[MR_MAX_FAKE_REG];
+    MR_Word             *current_regs;
+
+    short_var_count = MR_short_desc_var_count(label_layout);
+    long_var_count = MR_long_desc_var_count(label_layout);
+
+    /*
+    ** For the top stack frame, we should pass a pointer to a filled-in saved_regs
+    ** instead of NULL. For other stack frames, passing NULL is fine, since output
+    ** arguments are not live yet for any call except the top one.
+    */
+
+    MR_restore_registers();
+    MR_copy_regs_to_saved_regs(MR_MAX_FAKE_REG - 1, saved_regs);
+    if (top_frame) {
+        current_regs = saved_regs;
+    } else {
+        current_regs = NULL;
+    }
+    type_params = MR_materialize_type_params_base(label_layout,
+        current_regs, stack_pointer, current_frame);
+
+    for (i = 0; i < long_var_count; i++) {
+        fprintf(stderr, "%-12s\t", "");
+        if (MR_PROC_LAYOUT_HAS_PROC_ID(label_layout->MR_sll_entry)) {
+            MR_print_proc_id(stderr, label_layout->MR_sll_entry);
+        }
+
+        dump_long_value(MR_long_desc_var_locn(label_layout, i),
+            heap_zone, stack_pointer, current_frame, top_frame);
+        fprintf(stderr, "\n");
+        fflush(NULL);
+
+        if (MR_debug_agc_print_vars) {
+            /*
+            ** Call Mercury but use the debugging heap.
+            */
+
+            MR_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
+            MR_virtual_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
+
+            if (MR_get_type_and_value_base(label_layout, i,
+                    current_regs, stack_pointer, current_frame, type_params,
+                    &type_info, &value)) {
+                printf("\t");
+                MR_write_variable(type_info, value);
+                printf("\n");
+            }
+
+            fflush(NULL);
+        }
+    }
+
+    for (; i < short_var_count; i++) {
+        fprintf(stderr, "%-12s\t", "");
+        if (MR_PROC_LAYOUT_HAS_PROC_ID(label_layout->MR_sll_entry)) {
+            MR_print_proc_id(stderr, label_layout->MR_sll_entry);
+        }
+
+        dump_short_value(MR_short_desc_var_locn(label_layout, i),
+            heap_zone, stack_pointer, current_frame, top_frame);
+        fprintf(stderr, "\n");
+        fflush(NULL);
+
+        if (MR_debug_agc_print_vars) {
+            /*
+            ** Call Mercury but use the debugging heap.
+            */
+
+            MR_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
+            MR_virtual_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
+
+            if (MR_get_type_and_value_base(label_layout, i,
+                    current_regs, stack_pointer, current_frame, type_params,
+                    &type_info, &value)) {
+                printf("\t");
+                MR_write_variable(type_info, value);
+                printf("\n");
+            }
+
+            fflush(NULL);
+        }
+    }
+
+    MR_copy_saved_regs_to_regs(MR_MAX_FAKE_REG - 1, saved_regs);
+    MR_save_registers();
+    MR_free(type_params);
 }
 
 static void
-dump_long_value(MR_Long_Lval locn, MR_MemoryZone *heap_zone,
-	MR_Word *stack_pointer, MR_Word *current_frame, MR_bool do_regs)
+MR_dump_long_value(MR_LongLval locn, MR_MemoryZone *heap_zone,
+    MR_Word *stack_pointer, MR_Word *current_frame, MR_bool do_regs)
 {
-	int	locn_num;
-	MR_Word	value = 0;
-	int	difference;
-	MR_bool 	have_value = MR_FALSE;
-
-	locn_num = MR_LONG_LVAL_NUMBER(locn);
-	switch (MR_LONG_LVAL_TYPE(locn)) {
-		case MR_LONG_LVAL_TYPE_R:
-			if (do_regs) {
-				value = MR_virtual_reg_value(locn_num);
-				have_value = MR_TRUE;
-				fprintf(stderr, "r%d\t", locn_num);
-			} else {
-				fprintf(stderr, "r%d (invalid)\t", locn_num);
-			}
-			break;
-
-		case MR_LONG_LVAL_TYPE_F:
-			fprintf(stderr, "f%d\t", locn_num);
-			break;
-
-		case MR_LONG_LVAL_TYPE_STACKVAR:
-			value = MR_based_stackvar(stack_pointer, locn_num);
-			have_value = MR_TRUE;
-			fprintf(stderr, "stackvar%d", locn_num);
-			break;
-
-		case MR_LONG_LVAL_TYPE_FRAMEVAR:
-			value = MR_based_framevar(current_frame, locn_num);
-			have_value = MR_TRUE;
-			fprintf(stderr, "framevar%d", locn_num);
-			break;
-
-		case MR_LONG_LVAL_TYPE_SUCCIP:
-			fprintf(stderr, "succip");
-			break;
-
-		case MR_LONG_LVAL_TYPE_MAXFR:
-			fprintf(stderr, "maxfr");
-			break;
-
-		case MR_LONG_LVAL_TYPE_CURFR:
-			fprintf(stderr, "curfr");
-			break;
-
-		case MR_LONG_LVAL_TYPE_HP:
-			fprintf(stderr, "hp");
-			break;
-
-		case MR_LONG_LVAL_TYPE_SP:
-			fprintf(stderr, "sp");
-			break;
-
-		case MR_LONG_LVAL_TYPE_INDIRECT:
-			fprintf(stderr, "offset %d from ",
-				MR_LONG_LVAL_INDIRECT_OFFSET(locn_num));
-			/* XXX Tyson will have to complete this */
-			/* based on what he wants this function to do */
-
-		case MR_LONG_LVAL_TYPE_UNKNOWN:
-			fprintf(stderr, "unknown");
-			break;
-
-		default:
-			fprintf(stderr, "LONG DEFAULT");
-			break;
-	}
-	if (have_value) {
-		if (value >= (MR_Word) heap_zone->MR_zone_min &&
-				value < (MR_Word) heap_zone->MR_zone_hardmax) {
-			difference = (MR_Word *) value -
-				(MR_Word *) heap_zone->MR_zone_min;
-			fprintf(stderr, "\thp[%d]\t(%lx)", difference,
-				(long) value);
-		} else {
-			fprintf(stderr, "\t       \t(%lx)", (long) value);
-		}
-	}
+    intw    locn_num;
+    MR_Word value;
+    int     difference;
+    MR_bool have_value;
+
+    value = 0;
+    have_value = MR_FALSE;
+
+    locn_num = MR_LONG_LVAL_NUMBER(locn);
+    switch (MR_LONG_LVAL_TYPE(locn)) {
+        case MR_LONG_LVAL_TYPE_R:
+            if (do_regs) {
+                value = MR_virtual_reg_value(locn_num);
+                have_value = MR_TRUE;
+                fprintf(stderr, "r%d\t", locn_num);
+            } else {
+                fprintf(stderr, "r%d (invalid)\t", locn_num);
+            }
+            break;
+
+        case MR_LONG_LVAL_TYPE_F:
+            fprintf(stderr, "f%d\t", locn_num);
+            break;
+
+        case MR_LONG_LVAL_TYPE_STACKVAR:
+            value = MR_based_stackvar(stack_pointer, locn_num);
+            have_value = MR_TRUE;
+            fprintf(stderr, "stackvar%d", locn_num);
+            break;
+
+        case MR_LONG_LVAL_TYPE_FRAMEVAR:
+            value = MR_based_framevar(current_frame, locn_num);
+            have_value = MR_TRUE;
+            fprintf(stderr, "framevar%d", locn_num);
+            break;
+
+        case MR_LONG_LVAL_TYPE_SUCCIP:
+            fprintf(stderr, "succip");
+            break;
+
+        case MR_LONG_LVAL_TYPE_MAXFR:
+            fprintf(stderr, "maxfr");
+            break;
+
+        case MR_LONG_LVAL_TYPE_CURFR:
+            fprintf(stderr, "curfr");
+            break;
+
+        case MR_LONG_LVAL_TYPE_HP:
+            fprintf(stderr, "hp");
+            break;
+
+        case MR_LONG_LVAL_TYPE_SP:
+            fprintf(stderr, "sp");
+            break;
+
+        case MR_LONG_LVAL_TYPE_INDIRECT:
+            fprintf(stderr, "offset %d from ",
+                MR_LONG_LVAL_INDIRECT_OFFSET(locn_num));
+            /* XXX Tyson will have to complete this */
+            /* based on what he wants this function to do */
+
+        case MR_LONG_LVAL_TYPE_UNKNOWN:
+            fprintf(stderr, "unknown");
+            break;
+
+        default:
+            fprintf(stderr, "LONG DEFAULT");
+            break;
+    }
+    if (have_value) {
+        if (value >= (MR_Word) heap_zone->MR_zone_min &&
+                value < (MR_Word) heap_zone->MR_zone_hardmax)
+        {
+            difference = (MR_Word *) value - (MR_Word *) heap_zone->MR_zone_min;
+            fprintf(stderr, "\thp[%d]\t(%lx)", difference, (long) value);
+        } else {
+            fprintf(stderr, "\t       \t(%lx)", (long) value);
+        }
+    }
 }
 
 static void
-dump_short_value(MR_Short_Lval locn, MR_MemoryZone *heap_zone,
-	MR_Word *stack_pointer, MR_Word *current_frame, MR_bool do_regs)
+MR_dump_short_value(MR_ShortLval locn, MR_MemoryZone *heap_zone,
+    MR_Word *stack_pointer, MR_Word *current_frame, MR_bool do_regs)
 {
-	int	locn_num;
-	MR_Word	value = 0;
-	int	difference;
-	MR_bool 	have_value = MR_FALSE;
-
-	locn_num = (int) locn >> MR_SHORT_LVAL_TAGBITS;
-	switch (MR_SHORT_LVAL_TYPE(locn)) {
-		case MR_SHORT_LVAL_TYPE_R:
-			if (do_regs) {
-				value = MR_virtual_reg_value(locn_num);
-				have_value = MR_TRUE;
-				fprintf(stderr, "r%d\t", locn_num);
-			} else {
-				fprintf(stderr, "r%d (invalid)\t", locn_num);
-			}
-			break;
-
-		case MR_SHORT_LVAL_TYPE_STACKVAR:
-			value = MR_based_stackvar(stack_pointer, locn_num);
-			have_value = MR_TRUE;
-			fprintf(stderr, "stackvar%d", locn_num);
-			break;
-
-		case MR_SHORT_LVAL_TYPE_FRAMEVAR:
-			value = MR_based_framevar(current_frame, locn_num);
-			have_value = MR_TRUE;
-			fprintf(stderr, "framevar%d", locn_num);
-			break;
-
-		case MR_SHORT_LVAL_TYPE_SPECIAL:
-			switch (locn_num) {
-				case MR_LONG_LVAL_TYPE_SUCCIP:
-					fprintf(stderr, "succip");
-				break;
-				case MR_LONG_LVAL_TYPE_MAXFR:
-					fprintf(stderr, "succip");
-				break;
-				case MR_LONG_LVAL_TYPE_CURFR:
-					fprintf(stderr, "curfr");
-				break;
-				case MR_LONG_LVAL_TYPE_HP:
-					fprintf(stderr, "hp");
-				break;
-				case MR_LONG_LVAL_TYPE_SP:
-					fprintf(stderr, "sp");
-				break;
-				default:
-					fprintf(stderr, "SPECIAL DEFAULT");
-				break;
-			}
-			break;
-
-		default:
-			fprintf(stderr, "SHORT DEFAULT");
-			break;
-	}
-	if (have_value) {
-		if (value >= (MR_Word) heap_zone->MR_zone_min &&
-				value < (MR_Word) heap_zone->MR_zone_hardmax) {
-			difference = (MR_Word *) value -
-				(MR_Word *) heap_zone->MR_zone_min;
-			fprintf(stderr, "\thp[%d]\t(%lx)", difference,
-				(long) value);
-		} else {
-			fprintf(stderr, "\t       \t(%lx)", (long) value);
-		}
-	}
+    int     locn_num;
+    MR_Word value;
+    int     difference;
+    MR_bool have_value;
+
+    value = 0;
+    have_value = MR_FALSE;
+    locn_num = (int) locn >> MR_SHORT_LVAL_TAGBITS;
+    switch (MR_SHORT_LVAL_TYPE(locn)) {
+        case MR_SHORT_LVAL_TYPE_R:
+            if (do_regs) {
+                value = MR_virtual_reg_value(locn_num);
+                have_value = MR_TRUE;
+                fprintf(stderr, "r%d\t", locn_num);
+            } else {
+                fprintf(stderr, "r%d (invalid)\t", locn_num);
+            }
+            break;
+
+        case MR_SHORT_LVAL_TYPE_STACKVAR:
+            value = MR_based_stackvar(stack_pointer, locn_num);
+            have_value = MR_TRUE;
+            fprintf(stderr, "stackvar%d", locn_num);
+            break;
+
+        case MR_SHORT_LVAL_TYPE_FRAMEVAR:
+            value = MR_based_framevar(current_frame, locn_num);
+            have_value = MR_TRUE;
+            fprintf(stderr, "framevar%d", locn_num);
+            break;
+
+        case MR_SHORT_LVAL_TYPE_SPECIAL:
+            switch (locn_num) {
+                case MR_LONG_LVAL_TYPE_SUCCIP:
+                    fprintf(stderr, "succip");
+                    break;
+                case MR_LONG_LVAL_TYPE_MAXFR:
+                    fprintf(stderr, "succip");
+                    break;
+                case MR_LONG_LVAL_TYPE_CURFR:
+                    fprintf(stderr, "curfr");
+                    break;
+                case MR_LONG_LVAL_TYPE_HP:
+                    fprintf(stderr, "hp");
+                    break;
+                case MR_LONG_LVAL_TYPE_SP:
+                    fprintf(stderr, "sp");
+                    break;
+                default:
+                    fprintf(stderr, "SPECIAL DEFAULT");
+                    break;
+            }
+            break;
+
+        default:
+            fprintf(stderr, "SHORT DEFAULT");
+            break;
+    }
+    if (have_value) {
+        if (value >= (MR_Word) heap_zone->MR_zone_min &&
+                value < (MR_Word) heap_zone->MR_zone_hardmax)
+        {
+            difference = (MR_Word *) value - (MR_Word *) heap_zone->MR_zone_min;
+            fprintf(stderr, "\thp[%d]\t(%lx)", difference, (long) value);
+        } else {
+            fprintf(stderr, "\t       \t(%lx)", (long) value);
+        }
+    }
 }
 
 #endif /* !MR_HIGHLEVEL_CODE */
Index: runtime/mercury_bootstrap.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_bootstrap.h,v
retrieving revision 1.38
diff -u -r1.38 mercury_bootstrap.h
--- runtime/mercury_bootstrap.h	8 Jun 2006 08:19:59 -0000	1.38
+++ runtime/mercury_bootstrap.h	26 Nov 2006 23:32:57 -0000
@@ -12,11 +12,36 @@
 ** will go away eventually, so don't use them!
 */
 
-#define	MR_Table_Trie_Step	MR_TableTrieStep
-
 #ifndef	MERCURY_BOOTSTRAP_H
 #define	MERCURY_BOOTSTRAP_H
 
+#ifndef	MR_DISABLE_ALIASES
+#define	MR_Table_Trie_Step		MR_TableTrieStep
+#define	MR_Long_Lval_Type		MR_LongLvalType
+#define	MR_Long_Lval			MR_LongLval
+#define	MR_Short_Lval			MR_ShortLval
+#define	MR_Label_Layout_No_Var_Info	MR_LabelLayoutNoVarInfo
+#define	MR_Label_Layout			MR_LabelLayout
+#define	MR_Type_Param_Locns		MR_TypeParamLocns
+#define	MR_Table_Io_Decl		MR_TableIoDecl
+#define	MR_Table_Info			MR_TableInfo
+#define	MR_Stack_Traversal		MR_StackTraversal
+#define	MR_Exec_Trace			MR_ExecTrace
+#define	MR_Proc_Layout_User		MR_ProcLayoutUser
+#define	MR_Proc_Layout_UCI		MR_ProcLayoutUCI
+#define	MR_Proc_Layout			MR_ProcLayout
+#define	MR_Module_Layout		MR_ModuleLayout
+#define	MR_Trace_Level			MR_TraceLevel
+#define	MR_Module_File_Layout		MR_ModuleFileLayout
+#define	MR_Closure_Id			MR_ClosureId
+#define	MR_User_Closure_Id		MR_UserClosureId
+#define	MR_UCI_Closure_Id		MR_UCIClosureId
+#define	MR_Proc_Id			MR_ProcId
+#define	MR_Stack_Walk_Step_Result	MR_StackWalkStepResult
+#define	MR_Context_Position		MR_ContextPosition
+#define	MR_find_first_call_seq_or_event	MR_FindFirstCallSeqOrEvent
+#endif
+
 #define	MR_STATIC(l)		MR_ENTRY(l)
 #define	MR_GOTO_STATIC(l)	MR_GOTO_ENTRY(l)
 
@@ -27,12 +52,12 @@
 
 #ifndef MR_NO_BACKWARDS_COMPAT
 
-/* 
+/*
 ** For a long time the Mercury C types were defined as Char, Float,
 ** Integer, Word, etc.  There will doubtless be lots of C code in
-** libraries that relies upon these names.  
+** libraries that relies upon these names.
 **
-** People may have written code that relies upon these names, so  
+** People may have written code that relies upon these names, so
 ** if you remove these names you need to give warning (unlike some of
 ** the other changes in this file).
 */
@@ -117,7 +142,7 @@
 */
 #ifdef IN_GCC
   /*
-  ** We need to make sure that we pick up GCC's definition of bool, 
+  ** We need to make sure that we pick up GCC's definition of bool,
   ** to ensure that we don't define `bool' below.  Otherwise we get
   ** conflicts because some declarations use the <stdbool.h> definition
   ** of bool (an enum), and some use our definition (a #define for char)
Index: runtime/mercury_debug.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_debug.c,v
retrieving revision 1.27
diff -u -r1.27 mercury_debug.c
--- runtime/mercury_debug.c	1 Nov 2006 02:31:13 -0000	1.27
+++ runtime/mercury_debug.c	26 Nov 2006 01:09:09 -0000
@@ -1016,9 +1016,9 @@
         fprintf(fp, "\n");
     } else {
         const MR_ProcDynamic    *pd;
-        const MR_Proc_Layout    *pl;
+        const MR_ProcLayout     *pl;
         const MR_ProcStatic     *ps;
-        const MR_Proc_Id        *proc_id;
+        const MR_ProcId         *proc_id;
 
         fprintf(fp, ", depth %d,", csd->MR_csd_depth_count);
 
Index: runtime/mercury_deep_call_port_body.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_deep_call_port_body.h,v
retrieving revision 1.9
diff -u -r1.9 mercury_deep_call_port_body.h
--- runtime/mercury_deep_call_port_body.h	7 Nov 2006 04:05:09 -0000	1.9
+++ runtime/mercury_deep_call_port_body.h	26 Nov 2006 23:32:57 -0000
@@ -38,7 +38,7 @@
 #ifdef MR_DEEP_PROFILING
 {
     MR_CallSiteDynamic      *csd;
-    const MR_Proc_Layout    *pl;
+    const MR_ProcLayout     *pl;
     MR_ProcStatic           *ps;
 
   #ifdef MR_EXEC_TRACE
@@ -59,7 +59,7 @@
         fprintf(MR_deep_prof_log_file, "callport(%ld,%ld,%ld).\n",
             (long) MR_current_call_site_dynamic,
             (long) MR_next_call_site_dynamic,
-            (long) ((const MR_Proc_Layout *) ProcLayout)->MR_sle_proc_static);
+            (long) ((const MR_ProcLayout *) ProcLayout)->MR_sle_proc_static);
         fflush(MR_deep_prof_log_file);
     }
   #endif
@@ -91,7 +91,7 @@
     MR_next_call_site_dynamic = NULL;
   #endif
 
-    pl = (const MR_Proc_Layout *) ProcLayout;
+    pl = (const MR_ProcLayout *) ProcLayout;
     MR_deep_assert(csd, pl, NULL, pl != NULL);
     ps = pl->MR_sle_proc_static;
     MR_deep_assert(csd, pl, ps, ps != NULL);
Index: runtime/mercury_deep_leave_port_body.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_deep_leave_port_body.h,v
retrieving revision 1.8
diff -u -r1.8 mercury_deep_leave_port_body.h
--- runtime/mercury_deep_leave_port_body.h	7 Nov 2006 04:05:09 -0000	1.8
+++ runtime/mercury_deep_leave_port_body.h	26 Nov 2006 23:32:57 -0000
@@ -37,7 +37,7 @@
 #ifdef MR_DEEP_PROFILING
 {
     MR_CallSiteDynamic      *csd;
-    const MR_Proc_Layout    *pl;
+    const MR_ProcLayout     *pl;
     MR_ProcStatic           *ps;
 
   #ifdef MR_EXEC_TRACE
Index: runtime/mercury_deep_profiling.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_deep_profiling.c,v
retrieving revision 1.25
diff -u -r1.25 mercury_deep_profiling.c
--- runtime/mercury_deep_profiling.c	7 Nov 2006 03:39:30 -0000	1.25
+++ runtime/mercury_deep_profiling.c	26 Nov 2006 01:19:03 -0000
@@ -58,7 +58,7 @@
     -1
 };
 
-MR_Proc_Layout_User MR_main_parent_proc_layout =
+MR_ProcLayoutUser MR_main_parent_proc_layout =
 {
     { MR_do_not_reached, { MR_LONG_LVAL_TYPE_UNKNOWN }, -1, MR_DETISM_DET },
     { MR_PREDICATE, "Mercury runtime", "Mercury runtime",
@@ -74,7 +74,7 @@
 
 MR_ProcDynamic      MR_main_parent_proc_dynamic =
 {
-    (MR_Proc_Layout *) &MR_main_parent_proc_layout,
+    (MR_ProcLayout *) &MR_main_parent_proc_layout,
     &MR_main_parent_call_site_dynamics[0]
 };
 
@@ -151,7 +151,7 @@
 #endif
 
 void
-MR_deep_assert_failed(const MR_CallSiteDynamic *csd, const MR_Proc_Layout *pl,
+MR_deep_assert_failed(const MR_CallSiteDynamic *csd, const MR_ProcLayout *pl,
     const MR_ProcStatic *ps, const char *cond,
     const char *filename, int linenumber)
 {
@@ -315,7 +315,7 @@
 static  MR_ProfilingHashTable   *MR_create_hash_table(int size);
 
 static  MR_bool                 MR_insert_proc_layout(
-                                    const MR_Proc_Layout *pl, int *id,
+                                    const MR_ProcLayout *pl, int *id,
                                     MR_bool *already_written,
                                     MR_bool init_written);
 static  MR_bool                 MR_insert_proc_dynamic(
@@ -332,7 +332,7 @@
                                     MR_bool init_written);
 
 static  void                    MR_flag_written_proc_layout(
-                                    const MR_Proc_Layout *pl);
+                                    const MR_ProcLayout *pl);
 static  void                    MR_flag_written_proc_dynamic(
                                     const MR_ProcDynamic *pd);
 static  void                    MR_flag_written_call_site_static(
@@ -372,7 +372,7 @@
 {
     int                     i;
     MR_ProfilingHashNode    *n;
-    MR_Proc_Id              *pid;
+    MR_ProcId               *pid;
     int                     root_pd_id;
     FILE                    *fp;
     int                     ticks_per_sec;
@@ -659,15 +659,15 @@
 }
 
 void
-MR_write_out_user_proc_static(FILE *fp, const MR_Proc_Layout_User *proc_layout)
+MR_write_out_user_proc_static(FILE *fp, const MR_ProcLayoutUser *proc_layout)
 {
-    MR_write_out_proc_static(fp, (const MR_Proc_Layout *) proc_layout);
+    MR_write_out_proc_static(fp, (const MR_ProcLayout *) proc_layout);
 }
 
 void
-MR_write_out_uci_proc_static(FILE *fp, const MR_Proc_Layout_UCI *proc_layout)
+MR_write_out_uci_proc_static(FILE *fp, const MR_ProcLayoutUCI *proc_layout)
 {
-    MR_write_out_proc_static(fp, (const MR_Proc_Layout *) proc_layout);
+    MR_write_out_proc_static(fp, (const MR_ProcLayout *) proc_layout);
 }
 
 #ifdef  MR_DEEP_PROFILING_LOG
@@ -683,10 +683,10 @@
 #endif  /* MR_DEEP_PROFILING_LOG */
 
 void
-MR_write_out_proc_static(FILE *fp, const MR_Proc_Layout *proc_layout)
+MR_write_out_proc_static(FILE *fp, const MR_ProcLayout *proc_layout)
 {
     const MR_ProcStatic *ps;
-    const MR_Proc_Id    *procid;
+    const MR_ProcId     *procid;
     int                 ps_id;
     int                 css_id;
     MR_bool             already_written;
@@ -1087,7 +1087,7 @@
 MR_write_out_proc_dynamic(FILE *fp, const MR_ProcDynamic *pd)
 {
     const MR_ProcStatic     *ps;
-    const MR_Proc_Layout    *pl;
+    const MR_ProcLayout     *pl;
     int                     pd_id;
     int                     ps_id;
     MR_bool                 already_written;
@@ -1393,7 +1393,7 @@
                                     void write_func(FILE *fp, const void *));
 
 static MR_bool
-MR_insert_proc_layout(const MR_Proc_Layout *pl, int *id,
+MR_insert_proc_layout(const MR_ProcLayout *pl, int *id,
     MR_bool *already_written, MR_bool init_written)
 {
     return MR_hash_table_insert_INTERNAL(MR_proc_layout_table,
@@ -1425,7 +1425,7 @@
 }
 
 static void
-MR_flag_written_proc_layout(const MR_Proc_Layout *pl)
+MR_flag_written_proc_layout(const MR_ProcLayout *pl)
 {
     MR_hash_table_flag_written_INTERNAL(MR_proc_layout_table,
         (const void *) pl);
@@ -1582,10 +1582,10 @@
 static void
 MR_unwritten_pl_handler(FILE *fp, const void *pl)
 {
-    const MR_Proc_Layout    *proc_layout;
-    const MR_Proc_Id        *procid;
+    const MR_ProcLayout *proc_layout;
+    const MR_ProcId     *procid;
 
-    proc_layout = (const MR_Proc_Layout *) pl;
+    proc_layout = (const MR_ProcLayout *) pl;
 
     if (! MR_PROC_LAYOUT_HAS_PROC_ID(proc_layout)) {
         MR_fatal_error("MR_write_out_proc_layout_from_void: no proc_id\n");
Index: runtime/mercury_deep_profiling.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_deep_profiling.h,v
retrieving revision 1.16
diff -u -r1.16 mercury_deep_profiling.h
--- runtime/mercury_deep_profiling.h	7 Nov 2006 03:39:31 -0000	1.16
+++ runtime/mercury_deep_profiling.h	26 Nov 2006 23:32:57 -0000
@@ -57,7 +57,7 @@
 
 struct MR_CallSiteStatic_Struct {
     	MR_CallSite_Kind			MR_css_kind;
-	MR_Proc_Layout				*MR_css_callee_ptr_if_known;
+	MR_ProcLayout				*MR_css_callee_ptr_if_known;
 	MR_ConstString				MR_css_type_subst_if_known;
 	MR_ConstString				MR_css_file_name;
 	int					MR_css_line_number;
@@ -86,7 +86,7 @@
 };
 
 struct MR_ProcDynamic_Struct {
-	const MR_Proc_Layout			*MR_pd_proc_layout;
+	const MR_ProcLayout			*MR_pd_proc_layout;
 	MR_CallSiteDynamic			**MR_pd_call_site_ptr_ptrs;
 };
 
@@ -359,15 +359,15 @@
 #endif
 
 extern	void	MR_deep_assert_failed(const MR_CallSiteDynamic *csd,
-			const MR_Proc_Layout *pl, const MR_ProcStatic *ps,
+			const MR_ProcLayout *pl, const MR_ProcStatic *ps,
 			const char *cond, const char *filename,
 			int linenumber);
 extern	void	MR_setup_callback(void *entry);
 extern	void	MR_write_out_user_proc_static(FILE *fp,
-			const MR_Proc_Layout_User *ptr);
+			const MR_ProcLayoutUser *ptr);
 extern	void	MR_write_out_uci_proc_static(FILE *fp,
-			const MR_Proc_Layout_UCI *ptr);
-extern	void	MR_write_out_proc_static(FILE *fp, const MR_Proc_Layout *ptr);
+			const MR_ProcLayoutUCI *ptr);
+extern	void	MR_write_out_proc_static(FILE *fp, const MR_ProcLayout *ptr);
 extern	void	MR_write_out_profiling_tree(void);
 
 extern	void	MR_deep_prof_init(void);
Index: runtime/mercury_deep_profiling_hand.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_deep_profiling_hand.h,v
retrieving revision 1.7
diff -u -r1.7 mercury_deep_profiling_hand.h
--- runtime/mercury_deep_profiling_hand.h	29 Sep 2006 06:34:54 -0000	1.7
+++ runtime/mercury_deep_profiling_hand.h	26 Nov 2006 23:32:57 -0000
@@ -100,7 +100,7 @@
 		cmodule, cname, carity, cmode, line)			\
 	static const MR_CallSiteStatic					\
 	MR_call_sites_uci_name(module, name, type, arity, mode)[] = {	\
-		{ MR_normal_call, (MR_Proc_Layout *)			\
+		{ MR_normal_call, (MR_ProcLayout *)			\
 		&MR_proc_layout_user_name(cmodule, cname, carity, cmode),\
 		NULL, "", line, "" }					\
 	}
Index: runtime/mercury_deep_rec_depth_actions.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_deep_rec_depth_actions.h,v
retrieving revision 1.4
diff -u -r1.4 mercury_deep_rec_depth_actions.h
--- runtime/mercury_deep_rec_depth_actions.h	19 May 2004 03:59:44 -0000	1.4
+++ runtime/mercury_deep_rec_depth_actions.h	26 Nov 2006 23:32:57 -0000
@@ -16,7 +16,7 @@
 ** the following variables:
 ** 
 ** pd:	should point to the MR_ProcDynamic structure of the caller.
-** pl: 	should point to the MR_Proc_Layout structure of the caller.
+** pl: 	should point to the MR_ProcLayout structure of the caller.
 ** ps: 	should point to the MR_ProcStatic structure of the caller.
 */
 
Index: runtime/mercury_deep_rec_depth_body.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_deep_rec_depth_body.h,v
retrieving revision 1.5
diff -u -r1.5 mercury_deep_rec_depth_body.h
--- runtime/mercury_deep_rec_depth_body.h	19 May 2004 03:59:44 -0000	1.5
+++ runtime/mercury_deep_rec_depth_body.h	26 Nov 2006 23:32:57 -0000
@@ -29,7 +29,7 @@
   #ifdef MR_DEEP_PROFILING_TAIL_RECURSION
 	MR_CallSiteDynamic	*csd;
 	MR_ProcDynamic		*pd;
-	const MR_Proc_Layout	*pl;
+	const MR_ProcLayout	*pl;
 	MR_ProcStatic		*ps;
 
 	MR_enter_instrumentation();
Index: runtime/mercury_deep_redo_port_body.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_deep_redo_port_body.h,v
retrieving revision 1.7
diff -u -r1.7 mercury_deep_redo_port_body.h
--- runtime/mercury_deep_redo_port_body.h	7 Nov 2006 03:39:31 -0000	1.7
+++ runtime/mercury_deep_redo_port_body.h	26 Nov 2006 23:32:57 -0000
@@ -28,10 +28,10 @@
 
 #ifdef MR_DEEP_PROFILING
 {
-    MR_CallSiteDynamic  *csd;
+    MR_CallSiteDynamic      *csd;
     const MR_ProcDynamic    *pd;
-    const MR_Proc_Layout    *pl;
-    MR_ProcStatic       *ps;
+    const MR_ProcLayout     *pl;
+    MR_ProcStatic           *ps;
 
   #ifdef MR_EXEC_TRACE
     if (! MR_disable_deep_profiling_in_debugger) {
Index: runtime/mercury_goto.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_goto.h,v
retrieving revision 1.47
diff -u -r1.47 mercury_goto.h
--- runtime/mercury_goto.h	24 Nov 2006 03:48:17 -0000	1.47
+++ runtime/mercury_goto.h	26 Nov 2006 23:32:58 -0000
@@ -88,9 +88,9 @@
 	MR_PASTE2(mercury_data__user_event_layout__,label)
 
 #define MR_PROC_LAYOUT(label)						\
-	((const MR_Proc_Layout *) (MR_Word) &MR_PROC_LAYOUT_NAME(label))
+	((const MR_ProcLayout *) (MR_Word) &MR_PROC_LAYOUT_NAME(label))
 #define MR_LABEL_LAYOUT(label) 						\
-	((const MR_Label_Layout *) (MR_Word) &MR_LABEL_LAYOUT_NAME(label))
+	((const MR_LabelLayout *) (MR_Word) &MR_LABEL_LAYOUT_NAME(label))
 
 #define MR_PROC_LAYOUT1(label)						\
 	MR_PROC_LAYOUT(MR_add_prefix(label)),
Index: runtime/mercury_ho_call.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_ho_call.c,v
retrieving revision 1.78
diff -u -r1.78 mercury_ho_call.c
--- runtime/mercury_ho_call.c	24 Feb 2006 07:11:19 -0000	1.78
+++ runtime/mercury_ho_call.c	26 Nov 2006 01:19:42 -0000
@@ -64,7 +64,7 @@
         csd = MR_next_call_site_dynamic;                                      \
         pd = csd->MR_csd_callee_ptr;                                          \
         if (pd == NULL) {                                                     \
-            MR_new_proc_dynamic(pd, (MR_Proc_Layout *) &pl);                  \
+            MR_new_proc_dynamic(pd, (MR_ProcLayout *) &pl);                  \
             csd->MR_csd_callee_ptr = pd;                                      \
             maybe_incr_prof_call_builtin_new();                               \
         } else {                                                              \
@@ -797,8 +797,8 @@
 {
     MR_Closure_Layout   *x_layout;
     MR_Closure_Layout   *y_layout;
-    MR_Proc_Id          *x_proc_id;
-    MR_Proc_Id          *y_proc_id;
+    MR_ProcId           *x_proc_id;
+    MR_ProcId           *y_proc_id;
     MR_ConstString      x_module_name;
     MR_ConstString      y_module_name;
     MR_ConstString      x_pred_name;
@@ -924,7 +924,7 @@
     static  int                 closure_counter = 0;
     MR_Closure                  *closure;
     MR_Word                     closure_word;
-    MR_Closure_Id               *closure_id;
+    MR_ClosureId                *closure_id;
     MR_Closure_Dyn_Link_Layout  *closure_layout;
     char                        buf[80];
     int                         num_hidden_args;
@@ -941,9 +941,9 @@
     */
 
     /*
-    ** Construct the MR_Closure_Id.
+    ** Construct the MR_ClosureId.
     */
-    MR_incr_hp_type(closure_id, MR_Closure_Id);
+    MR_incr_hp_type(closure_id, MR_ClosureId);
     closure_id->MR_closure_proc_id.MR_proc_user.MR_user_pred_or_func =
         MR_PREDICATE;
     closure_id->MR_closure_proc_id.MR_proc_user.MR_user_decl_module =
Index: runtime/mercury_ho_call.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_ho_call.h,v
retrieving revision 1.13
diff -u -r1.13 mercury_ho_call.h
--- runtime/mercury_ho_call.h	24 Feb 2006 07:11:20 -0000	1.13
+++ runtime/mercury_ho_call.h	26 Nov 2006 23:32:58 -0000
@@ -21,7 +21,7 @@
 #ifndef	MERCURY_HO_CALL_H
 #define	MERCURY_HO_CALL_H
 
-#include "mercury_stack_layout.h"	/* for MR_Closure_Id etc */
+#include "mercury_stack_layout.h"	/* for MR_ClosureId etc */
 #include "mercury_type_info.h"		/* for MR_PseudoTypeInfo */
 #include "mercury_types.h"		    /* for MR_Closure */
 #ifndef	MR_HIGHLEVEL_CODE
@@ -37,7 +37,7 @@
 ** in any closure that calls that procedure. It is represented as a
 ** vector of words containing
 **
-**	a pointer to an MR_Closure_Id structure
+**	a pointer to an MR_ClosureId structure
 **	a pointer to information about the locations of typeinfos
 **		for the type parameters of the procedure
 **		(NULL if there are no type parameters)
@@ -62,7 +62,7 @@
 ** for argument j. (If we ever allow code to take the address of a procedure
 ** whose signature includes an existential type, we may have to rethink this.)
 **
-** The MR_Live_Lvals inside MR_Type_Param_Locns, which encode the locations
+** The MR_Live_Lvals inside MR_TypeParamLocns, which encode the locations
 ** of the typeinfos for the type variables in the signature of the procedure,
 ** assume that argument i is in register ri. While this will be true at the
 ** time of the call, code that wants to manipulate the closure as an
@@ -83,15 +83,15 @@
 */
 
 typedef struct MR_Closure_Layout_Struct {
-	MR_Closure_Id		    *MR_closure_id;
-	MR_Type_Param_Locns	    *MR_closure_type_params;
+	MR_ClosureId		    *MR_closure_id;
+	MR_TypeParamLocns	    *MR_closure_type_params;
 	MR_Integer		        MR_closure_num_all_args;
 	MR_PseudoTypeInfo	    MR_closure_arg_pseudo_type_info[MR_VARIABLE_SIZED];
 } MR_Closure_Layout;
 
 typedef struct MR_Closure_Dyn_Link_Layout_Struct {
-	MR_Closure_Id		    *MR_closure_dl_id;
-	MR_Type_Param_Locns	    *MR_closure_dl_type_params;
+	MR_ClosureId		    *MR_closure_dl_id;
+	MR_TypeParamLocns	    *MR_closure_dl_type_params;
 	MR_Integer		        MR_closure_dl_num_all_args;
 } MR_Closure_Dyn_Link_Layout;
 
Index: runtime/mercury_init.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_init.h,v
retrieving revision 1.49
diff -u -r1.49 mercury_init.h
--- runtime/mercury_init.h	9 Oct 2006 06:40:25 -0000	1.49
+++ runtime/mercury_init.h	26 Nov 2006 23:32:58 -0000
@@ -146,7 +146,7 @@
 
 /* in trace/mercury_trace_vars.h */
 extern	const char *MR_trace_browse_all_on_level(FILE *,
-			const MR_Label_Layout *, MR_Word *, MR_Word *,
+			const MR_LabelLayout *, MR_Word *, MR_Word *,
 			int, MR_bool);
 
 /* in trace/mercury_trace_external.h */
@@ -157,14 +157,14 @@
 extern	MR_String	ML_type_name(MR_Word);
 
 /* in runtime/mercury_trace_base.c */
-extern	MR_Code	*MR_trace_fake(const MR_Label_Layout *);
+extern	MR_Code	*MR_trace_fake(const MR_LabelLayout *);
 
 /* in trace/mercury_trace.c */
-extern	MR_Code	*MR_trace_real(const MR_Label_Layout *);
+extern	MR_Code	*MR_trace_real(const MR_LabelLayout *);
 extern	void	MR_trace_interrupt_handler(void);
 
 /* in trace/mercury_trace_tables.c */
-extern	void	MR_register_module_layout_real(const MR_Module_Layout *);
+extern	void	MR_register_module_layout_real(const MR_ModuleLayout *);
 
 /*---------------------------------------------------------------------------*/
 
Index: runtime/mercury_label.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_label.c,v
retrieving revision 1.25
diff -u -r1.25 mercury_label.c
--- runtime/mercury_label.c	14 Nov 2006 00:15:40 -0000	1.25
+++ runtime/mercury_label.c	26 Nov 2006 01:09:10 -0000
@@ -90,7 +90,7 @@
 
 void
 MR_insert_entry_label(const char *name, MR_Code *addr,
-    const MR_Proc_Layout *entry_layout)
+    const MR_ProcLayout *entry_layout)
 {
     MR_do_init_label_tables();
 
@@ -204,7 +204,7 @@
 
 void
 MR_insert_internal_label(const char *name, MR_Code *addr,
-    const MR_Label_Layout *label_layout)
+    const MR_LabelLayout *label_layout)
 {
     MR_Internal *internal;
     MR_Internal *prev_internal;
Index: runtime/mercury_label.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_label.h,v
retrieving revision 1.11
diff -u -r1.11 mercury_label.h
--- runtime/mercury_label.h	15 Nov 2002 04:50:39 -0000	1.11
+++ runtime/mercury_label.h	26 Nov 2006 23:32:58 -0000
@@ -16,7 +16,7 @@
 #define	MERCURY_LABEL_H
 
 #include "mercury_conf_param.h"	    /* for MR_NEED_ENTRY_LABEL_ARRAY etc */
-#include "mercury_types.h"	    /* for MR_Code, MR_Proc_Layout etc */
+#include "mercury_types.h"	    /* for MR_Code, MR_ProcLayout etc */
 #include "mercury_dlist.h"	    /* for MR_Dlist */
 
 /*
@@ -30,7 +30,7 @@
 
 typedef struct s_entry {
 	const MR_Code		*e_addr;
-	const MR_Proc_Layout	*e_layout;
+	const MR_ProcLayout	*e_layout;
 	const char		*e_name;
 } MR_Entry;
 
@@ -44,7 +44,7 @@
 
 typedef struct s_internal {
 	const MR_Code		*i_addr;
-	const MR_Label_Layout	*i_layout;
+	const MR_LabelLayout	*i_layout;
 	const char		*i_name;
 } MR_Internal;
 
@@ -52,7 +52,7 @@
 
 #ifdef	MR_NEED_ENTRY_LABEL_INFO
   extern void		MR_insert_entry_label(const char *name, MR_Code *addr,
-				const MR_Proc_Layout *entry_layout);
+				const MR_ProcLayout *entry_layout);
 #else
   #define MR_insert_entry_label(n, a, l)	/* nothing */
 #endif	/* not MR_NEED_ENTRY_LABEL_INFO */
@@ -63,7 +63,7 @@
 
 extern	void		MR_insert_internal_label(const char *name,
 				MR_Code *addr,
-				const MR_Label_Layout *label_layout);
+				const MR_LabelLayout *label_layout);
 extern	MR_Internal	*MR_lookup_internal_by_addr(const MR_Code *addr);
 extern	void		MR_process_all_internal_labels(void f(const void *));
 
Index: runtime/mercury_layout_util.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_layout_util.c,v
retrieving revision 1.39
diff -u -r1.39 mercury_layout_util.c
--- runtime/mercury_layout_util.c	29 Sep 2006 06:34:54 -0000	1.39
+++ runtime/mercury_layout_util.c	26 Nov 2006 01:21:56 -0000
@@ -18,11 +18,11 @@
 #include "mercury_stack_layout.h"
 #include "mercury_layout_util.h"
 
-static  MR_Word MR_lookup_closure_long_lval(MR_Long_Lval locn,
+static  MR_Word MR_lookup_closure_long_lval(MR_LongLval locn,
                     MR_Closure *closure, MR_bool *succeeded);
-static  MR_Word MR_lookup_typeclass_info_long_lval(MR_Long_Lval locn,
+static  MR_Word MR_lookup_typeclass_info_long_lval(MR_LongLval locn,
                     MR_Word typeclass_info, MR_bool *succeeded);
-static  MR_Word MR_lookup_answer_block_long_lval(MR_Long_Lval locn,
+static  MR_Word MR_lookup_answer_block_long_lval(MR_LongLval locn,
                     MR_Word *answer_block, int block_size, MR_bool *succeeded);
 
 void
@@ -74,7 +74,7 @@
 }
 
 MR_TypeInfoParams
-MR_materialize_type_params(const MR_Label_Layout *label_layout,
+MR_materialize_type_params(const MR_LabelLayout *label_layout,
     MR_Word *saved_regs)
 {
     return MR_materialize_type_params_base(label_layout, saved_regs,
@@ -82,10 +82,10 @@
 }
 
 MR_TypeInfoParams
-MR_materialize_type_params_base(const MR_Label_Layout *label_layout,
+MR_materialize_type_params_base(const MR_LabelLayout *label_layout,
     MR_Word *saved_regs, MR_Word *base_sp, MR_Word *base_curfr)
 {
-    const MR_Type_Param_Locns *tvar_locns;
+    const MR_TypeParamLocns *tvar_locns;
     
     tvar_locns = label_layout->MR_sll_tvars;
     if (tvar_locns != NULL) {
@@ -119,7 +119,7 @@
 MR_TypeInfoParams
 MR_materialize_closure_type_params(MR_Closure *closure)
 {
-    const MR_Type_Param_Locns *tvar_locns;
+    const MR_TypeParamLocns *tvar_locns;
 
     tvar_locns = closure->MR_closure_layout->MR_closure_type_params;
     if (tvar_locns != NULL) {
@@ -153,7 +153,7 @@
 MR_materialize_typeclass_info_type_params(MR_Word typeclass_info,
     MR_Closure_Layout *closure_layout)
 {
-    const MR_Type_Param_Locns *tvar_locns;
+    const MR_TypeParamLocns *tvar_locns;
 
     tvar_locns = closure_layout->MR_closure_type_params;
     if (tvar_locns != NULL) {
@@ -186,7 +186,7 @@
 }
 
 MR_TypeInfoParams
-MR_materialize_answer_block_type_params(const MR_Type_Param_Locns *tvar_locns,
+MR_materialize_answer_block_type_params(const MR_TypeParamLocns *tvar_locns,
     MR_Word *answer_block, int block_size)
 {
     if (tvar_locns != NULL) {
@@ -218,7 +218,7 @@
 }
 
 int
-MR_get_register_number_long(MR_Long_Lval locn)
+MR_get_register_number_long(MR_LongLval locn)
 {
     if (MR_LONG_LVAL_TYPE(locn) == MR_LONG_LVAL_TYPE_R) {
         return MR_LONG_LVAL_NUMBER(locn);
@@ -228,7 +228,7 @@
 }
 
 int
-MR_get_register_number_short(MR_Short_Lval locn)
+MR_get_register_number_short(MR_ShortLval locn)
 {
     if (MR_SHORT_LVAL_TYPE(locn) == MR_SHORT_LVAL_TYPE_R) {
         return locn >> MR_SHORT_LVAL_TAGBITS;
@@ -244,22 +244,22 @@
 #endif
 
 MR_Word
-MR_lookup_long_lval(MR_Long_Lval locn, MR_Word *saved_regs, MR_bool *succeeded)
+MR_lookup_long_lval(MR_LongLval locn, MR_Word *saved_regs, MR_bool *succeeded)
 {
     return MR_lookup_long_lval_base(locn, saved_regs,
         MR_saved_sp(saved_regs), MR_saved_curfr(saved_regs), succeeded);
 }
 
 static MR_Word
-MR_lookup_closure_long_lval(MR_Long_Lval locn, MR_Closure *closure,
+MR_lookup_closure_long_lval(MR_LongLval locn, MR_Closure *closure,
     MR_bool *succeeded)
 {
     int             locn_num;
     int             offset;
     MR_Word         value;
     MR_Word         baseaddr;
-    MR_Long_Lval    indirect_lval;
-    MR_Long_Lval    sublocn;
+    MR_LongLval     indirect_lval;
+    MR_LongLval     sublocn;
 
     *succeeded = MR_FALSE;
     value = 0;
@@ -368,15 +368,15 @@
 }
 
 static MR_Word
-MR_lookup_typeclass_info_long_lval(MR_Long_Lval locn, MR_Word typeclass_info,
+MR_lookup_typeclass_info_long_lval(MR_LongLval locn, MR_Word typeclass_info,
     MR_bool *succeeded)
 {
     int             locn_num;
     int             offset;
     MR_Word         value;
     MR_Word         baseaddr;
-    MR_Long_Lval    indirect_lval;
-    MR_Long_Lval    sublocn;
+    MR_LongLval     indirect_lval;
+    MR_LongLval     sublocn;
 
     *succeeded = MR_FALSE;
     value = 0;
@@ -488,15 +488,15 @@
 }
 
 static MR_Word
-MR_lookup_answer_block_long_lval(MR_Long_Lval locn, MR_Word *answer_block,
+MR_lookup_answer_block_long_lval(MR_LongLval locn, MR_Word *answer_block,
     int block_size, MR_bool *succeeded)
 {
     int             locn_num;
     int             offset;
     MR_Word         value;
     MR_Word         baseaddr;
-    MR_Long_Lval    indirect_lval;
-    MR_Long_Lval    sublocn;
+    MR_LongLval     indirect_lval;
+    MR_LongLval     sublocn;
 
     *succeeded = MR_FALSE;
     value = 0;
@@ -605,15 +605,15 @@
 }
 
 MR_Word
-MR_lookup_long_lval_base(MR_Long_Lval locn, MR_Word *saved_regs,
+MR_lookup_long_lval_base(MR_LongLval locn, MR_Word *saved_regs,
     MR_Word *base_sp, MR_Word *base_curfr, MR_bool *succeeded)
 {
     int             locn_num;
     int             offset;
     MR_Word         value;
     MR_Word         baseaddr;
-    MR_Long_Lval    indirect_lval;
-    MR_Long_Lval    sublocn;
+    MR_LongLval     indirect_lval;
+    MR_LongLval     sublocn;
 
     *succeeded = MR_FALSE;
     value = 0;
@@ -726,7 +726,7 @@
 }
 
 MR_Word
-MR_lookup_short_lval(MR_Short_Lval locn, MR_Word *saved_regs,
+MR_lookup_short_lval(MR_ShortLval locn, MR_Word *saved_regs,
     MR_bool *succeeded)
 {
     return MR_lookup_short_lval_base(locn, saved_regs,
@@ -734,7 +734,7 @@
 }
 
 MR_Word
-MR_lookup_short_lval_base(MR_Short_Lval locn, MR_Word *saved_regs,
+MR_lookup_short_lval_base(MR_ShortLval locn, MR_Word *saved_regs,
     MR_Word *base_sp, MR_Word *base_curfr, MR_bool *succeeded)
 {
     int     locn_num;
@@ -817,7 +817,7 @@
 }
 
 MR_bool
-MR_get_type_and_value(const MR_Label_Layout *label_layout, int i,
+MR_get_type_and_value(const MR_LabelLayout *label_layout, int i,
     MR_Word *saved_regs, MR_TypeInfo *type_params, MR_TypeInfo *type_info,
     MR_Word *value)
 {
@@ -827,14 +827,14 @@
 }
 
 MR_bool
-MR_get_type_and_value_base(const MR_Label_Layout *label_layout, int i,
+MR_get_type_and_value_base(const MR_LabelLayout *label_layout, int i,
     MR_Word *saved_regs, MR_Word *base_sp, MR_Word *base_curfr,
     MR_TypeInfo *type_params, MR_TypeInfo *type_info, MR_Word *value)
 {
     MR_PseudoTypeInfo   pseudo_type_info;
     MR_bool             succeeded;
-    MR_Long_Lval        long_locn;
-    MR_Short_Lval       short_locn;
+    MR_LongLval         long_locn;
+    MR_ShortLval        short_locn;
 
     pseudo_type_info = MR_var_pti(label_layout, i);
     *type_info = MR_create_type_info(type_params, pseudo_type_info);
@@ -861,7 +861,7 @@
 }
 
 MR_bool
-MR_get_type(const MR_Label_Layout *label_layout, int i, MR_Word *saved_regs,
+MR_get_type(const MR_LabelLayout *label_layout, int i, MR_Word *saved_regs,
     MR_TypeInfo *type_params, MR_TypeInfo *type_info)
 {
     return MR_get_type_base(label_layout, i, saved_regs,
@@ -870,7 +870,7 @@
 }
 
 MR_bool
-MR_get_type_base(const MR_Label_Layout *label_layout, int i,
+MR_get_type_base(const MR_LabelLayout *label_layout, int i,
     MR_Word *saved_regs, MR_Word *base_sp, MR_Word *base_curfr,
     MR_TypeInfo *type_params, MR_TypeInfo *type_info)
 {
@@ -892,7 +892,7 @@
 }
 
 void
-MR_generate_proc_name_from_layout(const MR_Proc_Layout *proc_layout,
+MR_generate_proc_name_from_layout(const MR_ProcLayout *proc_layout,
     MR_ConstString *proc_name_ptr, int *arity_ptr, MR_Word *is_func_ptr)
 {
     if (MR_PROC_LAYOUT_IS_UCI(proc_layout)) {
@@ -923,7 +923,7 @@
 }
 
 void
-MR_proc_id_arity_addedargs_predfunc(const MR_Proc_Layout *proc, int *arity_ptr,
+MR_proc_id_arity_addedargs_predfunc(const MR_ProcLayout *proc, int *arity_ptr,
     int *num_added_args_ptr, MR_PredFunc *pred_or_func_ptr)
 {
     if (MR_PROC_LAYOUT_IS_UCI(proc)) {
Index: runtime/mercury_layout_util.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_layout_util.h,v
retrieving revision 1.24
diff -u -r1.24 mercury_layout_util.h
--- runtime/mercury_layout_util.h	2 Nov 2005 14:02:10 -0000	1.24
+++ runtime/mercury_layout_util.h	26 Nov 2006 23:32:58 -0000
@@ -12,7 +12,7 @@
 
 #include "mercury_std.h"
 #include "mercury_types.h"          /* for MR_Word, etc. */
-#include "mercury_stack_layout.h"   /* for MR_Label_Layout, etc. */
+#include "mercury_stack_layout.h"   /* for MR_LabelLayout, etc. */
 #include "mercury_type_info.h"      /* for MR_TypeInfoParams, etc. */
 #include "mercury_ho_call.h"        /* for MR_Closure */
 
@@ -25,17 +25,17 @@
 extern  void    MR_copy_saved_regs_to_regs(int max_mr_num, MR_Word *saved_regs);
 
 /*
-** A MR_Label_Layout describes the variables that are live at a given
+** A MR_LabelLayout describes the variables that are live at a given
 ** program point. Some of the types of these variables may contain type
 ** variables. Since the values of those type variables are not known until
-** runtime, the MR_Label_Layout cannot include full typeinfos for the
+** runtime, the MR_LabelLayout cannot include full typeinfos for the
 ** variables. Instead, it contains pseudo-typeinfos, in which some parts
 ** of some typeinfo structures may contain an indication "this data is
 ** not available at compile time, but at runtime it will be in this location".
 **
-** MR_materialize_type_params takes as input a MR_Label_Layout structure.
+** MR_materialize_type_params takes as input a MR_LabelLayout structure.
 ** It returns a vector of typeinfos which has one entry for each
-** type variable in the MR_Label_Layout structure, with this typeinfo
+** type variable in the MR_LabelLayout structure, with this typeinfo
 ** being the value of the corresponding type variable.
 ** Since type variable numbers start at one, the element of this array at
 ** index zero will not have a type_info in it.  We store a dummy type_ctor_info
@@ -52,7 +52,7 @@
 ** is non-null.
 **
 ** MR_materialize_closure_type_params does much the same except that
-** it takes an MR_Closure rather than an MR_Label_Layout,
+** it takes an MR_Closure rather than an MR_LabelLayout,
 ** and it gets the type_infos from a closure using the closure_layout,
 ** rather than getting them from the registers/stacks using a label_layout.
 **
@@ -63,10 +63,10 @@
 */
 
 extern  MR_TypeInfoParams   MR_materialize_type_params(
-                                const MR_Label_Layout *label_layout,
+                                const MR_LabelLayout *label_layout,
                                 MR_Word *saved_regs);
 extern  MR_TypeInfoParams   MR_materialize_type_params_base(
-                                const MR_Label_Layout *label_layout,
+                                const MR_LabelLayout *label_layout,
                                 MR_Word *saved_regs,
                                 MR_Word *base_sp, MR_Word *base_curfr);
 extern  MR_TypeInfoParams   MR_materialize_closure_type_params(
@@ -75,7 +75,7 @@
                                 MR_Word typeclass_info,
                                 MR_Closure_Layout *closure_layout);
 extern  MR_TypeInfoParams   MR_materialize_answer_block_type_params(
-                                const MR_Type_Param_Locns *tvar_locns,
+                                const MR_TypeParamLocns *tvar_locns,
                                 MR_Word *answer_block, int block_size);
 
 /*
@@ -83,8 +83,8 @@
 ** If it does not, return -1.
 */
 
-extern  int MR_get_register_number_long(MR_Long_Lval locn);
-extern  int MR_get_register_number_short(MR_Short_Lval locn);
+extern  int MR_get_register_number_long(MR_LongLval locn);
+extern  int MR_get_register_number_short(MR_ShortLval locn);
 
 /*
 ** Given an location either in a long or short form, return the value
@@ -99,14 +99,14 @@
 ** non-null.
 */
 
-extern  MR_Word MR_lookup_long_lval(MR_Long_Lval locn,
+extern  MR_Word MR_lookup_long_lval(MR_LongLval locn,
                     MR_Word *saved_regs, MR_bool *succeeded);
-extern  MR_Word MR_lookup_long_lval_base(MR_Long_Lval locn,
+extern  MR_Word MR_lookup_long_lval_base(MR_LongLval locn,
                     MR_Word *saved_regs, MR_Word *base_sp,
                     MR_Word *base_curfr, MR_bool *succeeded);
-extern  MR_Word MR_lookup_short_lval(MR_Short_Lval locn,
+extern  MR_Word MR_lookup_short_lval(MR_ShortLval locn,
                     MR_Word *saved_regs, MR_bool *succeeded);
-extern  MR_Word MR_lookup_short_lval_base(MR_Short_Lval locn,
+extern  MR_Word MR_lookup_short_lval_base(MR_ShortLval locn,
                     MR_Word *saved_regs, MR_Word *base_sp,
                     MR_Word *base_curfr, MR_bool *succeeded);
 
@@ -135,18 +135,18 @@
 ** be allocated on the Mercury heap.
 */
 
-extern  MR_bool MR_get_type_and_value(const MR_Label_Layout *label_layout,
+extern  MR_bool MR_get_type_and_value(const MR_LabelLayout *label_layout,
                     int var, MR_Word *saved_regs, MR_TypeInfo *type_params,
                     MR_TypeInfo *type_info, MR_Word *value);
-extern  MR_bool MR_get_type_and_value_base(const MR_Label_Layout *label_layout,
+extern  MR_bool MR_get_type_and_value_base(const MR_LabelLayout *label_layout,
                     int var, MR_Word *saved_regs,
                     MR_Word *base_sp, MR_Word *base_curfr,
                     MR_TypeInfo *type_params, MR_TypeInfo *type_info,
                     MR_Word *value);
-extern  MR_bool MR_get_type(const MR_Label_Layout *label_layout, int var,
+extern  MR_bool MR_get_type(const MR_LabelLayout *label_layout, int var,
                     MR_Word *saved_regs, MR_TypeInfo *type_params,
                     MR_TypeInfo *type_info);
-extern  MR_bool MR_get_type_base(const MR_Label_Layout *label_layout, int var,
+extern  MR_bool MR_get_type_base(const MR_LabelLayout *label_layout, int var,
                     MR_Word *saved_regs, MR_Word *base_sp,
                     MR_Word *base_curfr, MR_TypeInfo *type_params,
                     MR_TypeInfo *type_info);
@@ -166,7 +166,7 @@
 ** in *is_func_ptr,
 */
 
-extern  void    MR_generate_proc_name_from_layout(const MR_Proc_Layout
+extern  void    MR_generate_proc_name_from_layout(const MR_ProcLayout
                     *proc_layout, MR_ConstString *proc_name_ptr,
                     int *arity_ptr, MR_Word *is_func_ptr);
 
@@ -177,7 +177,7 @@
 ** or a function.
 */
 
-extern  void    MR_proc_id_arity_addedargs_predfunc(const MR_Proc_Layout *proc,
+extern  void    MR_proc_id_arity_addedargs_predfunc(const MR_ProcLayout *proc,
                     int *arity_ptr, int *num_added_args_ptr,
                     MR_PredFunc *pred_or_func_ptr);
 
Index: runtime/mercury_minimal_model.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_minimal_model.c,v
retrieving revision 1.20
diff -u -r1.20 mercury_minimal_model.c
--- runtime/mercury_minimal_model.c	1 Nov 2006 02:31:14 -0000	1.20
+++ runtime/mercury_minimal_model.c	26 Nov 2006 01:22:34 -0000
@@ -44,7 +44,7 @@
 static  MR_Word *nearest_common_ancestor(MR_Word *fr1, MR_Word *fr2);
 static  void    save_state(MR_SavedState *saved_state, MR_Word *generator_fr,
                     const char *who, const char *what,
-                    const MR_Label_Layout *top_layout);
+                    const MR_LabelLayout *top_layout);
 static  void    restore_state(MR_SavedState *saved_state, const char *who,
                     const char *what);
 static  void    prune_right_branches(MR_SavedState *saved_state,
@@ -129,7 +129,7 @@
 */
 
 /* set by MR_trace_event, used by table_mm_setup */
-const MR_Proc_Layout          *MR_subgoal_debug_cur_proc = NULL;
+const MR_ProcLayout     *MR_subgoal_debug_cur_proc = NULL;
 
 struct MR_ConsumerDebug_Struct
 {
@@ -379,7 +379,7 @@
 }
 
 void
-MR_print_subgoal_debug(FILE *fp, const MR_Proc_Layout *proc,
+MR_print_subgoal_debug(FILE *fp, const MR_ProcLayout *proc,
     MR_SubgoalDebug *subgoal_debug)
 {
     if (subgoal_debug == NULL) {
@@ -390,7 +390,7 @@
 }
 
 void
-MR_print_subgoal(FILE *fp, const MR_Proc_Layout *proc, MR_Subgoal *subgoal)
+MR_print_subgoal(FILE *fp, const MR_ProcLayout *proc, MR_Subgoal *subgoal)
 {
     MR_SubgoalList  follower;
     MR_ConsumerList consumer;
@@ -458,7 +458,7 @@
 }
 
 void
-MR_print_consumer_debug(FILE *fp, const MR_Proc_Layout *proc,
+MR_print_consumer_debug(FILE *fp, const MR_ProcLayout *proc,
     MR_ConsumerDebug *consumer_debug)
 {
     if (consumer_debug == NULL) {
@@ -469,7 +469,7 @@
 }
 
 void
-MR_print_consumer(FILE *fp, const MR_Proc_Layout *proc, MR_Consumer *consumer)
+MR_print_consumer(FILE *fp, const MR_ProcLayout *proc, MR_Consumer *consumer)
 {
     if (consumer == NULL) {
         fprintf(fp, "NULL consumer\n");
@@ -878,7 +878,7 @@
 
 static void
 save_state(MR_SavedState *saved_state, MR_Word *generator_fr,
-    const char *who, const char *what, const MR_Label_Layout *top_layout)
+    const char *who, const char *what, const MR_LabelLayout *top_layout)
 {
     MR_Word     *common_ancestor_fr;
     MR_Word     *start_non;
@@ -1884,7 +1884,7 @@
     MR_save_transient_registers();
     save_state(&(consumer->MR_cns_saved_state), subgoal->MR_sg_generator_fr,
         "suspension", "consumer",
-        (const MR_Label_Layout *) &MR_LAYOUT_FROM_LABEL(SUSPEND_LABEL(Call)));
+        (const MR_LabelLayout *) &MR_LAYOUT_FROM_LABEL(SUSPEND_LABEL(Call)));
     MR_restore_transient_registers();
 
     MR_register_suspension(consumer);
Index: runtime/mercury_minimal_model.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_minimal_model.h,v
retrieving revision 1.13
diff -u -r1.13 mercury_minimal_model.h
--- runtime/mercury_minimal_model.h	10 Jun 2005 07:12:51 -0000	1.13
+++ runtime/mercury_minimal_model.h	26 Nov 2006 23:32:58 -0000
@@ -80,7 +80,7 @@
 
 #ifdef	MR_MINIMAL_MODEL_DEBUG
 	/* to make it possible to generate more detailed debugging output */
-	const MR_Label_Layout	*MR_ss_top_layout;
+	const MR_LabelLayout	*MR_ss_top_layout;
 #endif
 } MR_SavedState;
 
@@ -189,13 +189,13 @@
 	MR_Word			*MR_sg_generator_fr;
 	MR_Word			*MR_sg_deepest_nca_fr;
 #ifdef	MR_MINIMAL_MODEL_DEBUG
-	const MR_Proc_Layout	*MR_sg_proc_layout;
+	const MR_ProcLayout	*MR_sg_proc_layout;
 #endif
 };
 
 /*---------------------------------------------------------------------------*/
 
-extern	const MR_Proc_Layout	*MR_subgoal_debug_cur_proc;
+extern	const MR_ProcLayout	*MR_subgoal_debug_cur_proc;
 
 extern	void		MR_enter_consumer_debug(MR_Consumer *consumer);
 extern	MR_ConsumerDebug *MR_lookup_consumer_debug_addr(MR_Consumer *consumer);
@@ -213,14 +213,14 @@
 extern	const char	*MR_subgoal_status(MR_SubgoalStatus status);
 
 extern	void		MR_print_subgoal_debug(FILE *fp,
-				const MR_Proc_Layout *proc,
+				const MR_ProcLayout *proc,
 				MR_SubgoalDebug *subgoal_debug);
-extern	void		MR_print_subgoal(FILE *fp, const MR_Proc_Layout *proc,
+extern	void		MR_print_subgoal(FILE *fp, const MR_ProcLayout *proc,
 				MR_Subgoal *subgoal);
 extern	void		MR_print_consumer_debug(FILE *fp,
-				const MR_Proc_Layout *proc,
+				const MR_ProcLayout *proc,
 				MR_ConsumerDebug *consumer_debug);
-extern	void		MR_print_consumer(FILE *fp, const MR_Proc_Layout *proc,
+extern	void		MR_print_consumer(FILE *fp, const MR_ProcLayout *proc,
 				MR_Consumer *consumer);
 
 extern	MR_Subgoal	*MR_setup_subgoal(MR_TrieNode);
Index: runtime/mercury_ml_expand_body.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_ml_expand_body.h,v
retrieving revision 1.37
diff -u -r1.37 mercury_ml_expand_body.h
--- runtime/mercury_ml_expand_body.h	22 Aug 2006 02:33:45 -0000	1.37
+++ runtime/mercury_ml_expand_body.h	26 Nov 2006 23:32:58 -0000
@@ -119,7 +119,7 @@
 #include <stdio.h>
 #include "mercury_library_types.h" /* for MR_ArrayType */
 #include "mercury_layout_util.h"   /* for MR_materialize_closure_type_params */
-#include "mercury_ho_call.h"       /* for MR_Closure_Id etc */
+#include "mercury_ho_call.h"       /* for MR_ClosureId etc */
 
 #ifdef MR_DEEP_PROFILING
   #include  "mercury_deep_profiling.h"
@@ -757,9 +757,9 @@
             {
                 MR_Closure          *closure;
                 MR_Closure_Layout   *closure_layout;
-                MR_Proc_Id          *proc_id;
-                MR_User_Proc_Id     *user_proc_id;
-                MR_UCI_Proc_Id      *uci_proc_id;
+                MR_ProcId           *proc_id;
+                MR_UserProcId       *user_proc_id;
+                MR_UCIProcId        *uci_proc_id;
                 MR_ConstString      name;
                 int                 num_args;
                 int                 i;
Index: runtime/mercury_mm_own_stacks.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_mm_own_stacks.c,v
retrieving revision 1.6
diff -u -r1.6 mercury_mm_own_stacks.c
--- runtime/mercury_mm_own_stacks.c	2 Oct 2006 10:14:40 -0000	1.6
+++ runtime/mercury_mm_own_stacks.c	26 Nov 2006 01:23:28 -0000
@@ -40,7 +40,7 @@
 */
 
 /* set by MR_trace_event, used by table_nondet_setup */
-const MR_Proc_Layout          *MR_subgoal_debug_cur_proc = NULL;
+const MR_ProcLayout     *MR_subgoal_debug_cur_proc = NULL;
 
 struct MR_ConsDebug_Struct
 {
@@ -273,7 +273,7 @@
 }
 
 void
-MR_print_gen_debug(FILE *fp, const MR_Proc_Layout *proc,
+MR_print_gen_debug(FILE *fp, const MR_ProcLayout *proc,
     MR_GenDebug *gen_debug)
 {
     if (gen_debug == NULL) {
@@ -284,7 +284,7 @@
 }
 
 void
-MR_print_generator(FILE *fp, const MR_Proc_Layout *proc,
+MR_print_generator(FILE *fp, const MR_ProcLayout *proc,
     MR_Generator *generator)
 {
     MR_SubgoalList  follower;
@@ -351,7 +351,7 @@
 }
 
 void
-MR_print_cons_debug(FILE *fp, const MR_Proc_Layout *proc,
+MR_print_cons_debug(FILE *fp, const MR_ProcLayout *proc,
     MR_ConsDebug *cons_debug)
 {
     if (cons_debug == NULL) {
@@ -362,7 +362,7 @@
 }
 
 void
-MR_print_consumer(FILE *fp, const MR_Proc_Layout *proc, MR_Consumer *consumer)
+MR_print_consumer(FILE *fp, const MR_ProcLayout *proc, MR_Consumer *consumer)
 {
     if (consumer == NULL) {
         fprintf(fp, "NULL consumer\n");
Index: runtime/mercury_mm_own_stacks.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_mm_own_stacks.h,v
retrieving revision 1.4
diff -u -r1.4 mercury_mm_own_stacks.h
--- runtime/mercury_mm_own_stacks.h	18 Sep 2005 15:10:09 -0000	1.4
+++ runtime/mercury_mm_own_stacks.h	26 Nov 2006 23:32:58 -0000
@@ -54,7 +54,7 @@
 struct MR_Generator_Struct {
     MR_TrieNode             MR_gen_back_ptr;
     MR_Context              *MR_gen_context;
-    const MR_Proc_Layout    *MR_gen_proc_layout;
+    const MR_ProcLayout     *MR_gen_proc_layout;
     MR_String               *MR_gen_pred_id;
     MR_Generator            *MR_gen_leader;
     MR_Dlist                *MR_gen_led_generators;
@@ -91,7 +91,7 @@
 #define MR_table_mmos_get_answer_table(gen)                             \
                         &(gen)->MR_gen_answer_table;
 
-extern  const MR_Proc_Layout    *MR_subgoal_debug_cur_proc;
+extern  const MR_ProcLayout *MR_subgoal_debug_cur_proc;
 
 extern  void            MR_enter_cons_debug(MR_Consumer *consumer);
 extern  MR_ConsDebug    *MR_lookup_cons_debug_addr(MR_Consumer *consumer);
@@ -108,15 +108,15 @@
 extern  const char      *MR_gen_num_name(int gen_index);
 
 extern  void            MR_print_gen_debug(FILE *fp,
-                            const MR_Proc_Layout *proc,
+                            const MR_ProcLayout *proc,
                             MR_GenDebug *gen_debug);
 extern  void            MR_print_generator(FILE *fp,
-                            const MR_Proc_Layout *proc, MR_Generator *gen);
+                            const MR_ProcLayout *proc, MR_Generator *gen);
 extern  void            MR_print_cons_debug(FILE *fp,
-                            const MR_Proc_Layout *proc,
+                            const MR_ProcLayout *proc,
                             MR_ConsDebug *consumer_debug);
 extern  void            MR_print_consumer(FILE *fp,
-                            const MR_Proc_Layout *proc, MR_Consumer *consumer);
+                            const MR_ProcLayout *proc, MR_Consumer *consumer);
 
 extern  MR_ConsumerPtr  MR_table_mmos_setup_consumer(MR_GeneratorPtr generator,
                             MR_ConstString pred_id);
Index: runtime/mercury_proc_id.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_proc_id.h,v
retrieving revision 1.5
diff -u -r1.5 mercury_proc_id.h
--- runtime/mercury_proc_id.h	1 Sep 2005 07:36:27 -0000	1.5
+++ runtime/mercury_proc_id.h	26 Nov 2006 23:32:58 -0000
@@ -27,13 +27,14 @@
 
 /*
 ** This value should be distinct from any of the values in MR_PredFuncEnum.
-** It is used in MR_Proc_Id in the place where an MR_PredFunc field would be,
+** It is used in MR_ProcId in the place where an MR_PredFunc field would be,
 ** and indicates that no proc id exists.
 */
+
 #define MR_NO_PROC_ID -1
 
 /*
-** MR_Proc_Id is a union. The first alternative identifies ordinary
+** MR_ProcId is a union. The first alternative identifies ordinary
 ** procedures, while the second alternative identifies automatically generated
 ** unification, comparison, index and initialisation procedures.  The third
 ** alternative indicates that no proc id exists.  The meanings of the fields
@@ -43,8 +44,8 @@
 ** the macro MR_PROC_ID_IS_UCI, which will return true only if the proc id
 ** exists and the procedure is of the second type.
 **
-** The compiler generates MR_User_Proc_Id and MR_UCI_Proc_Id structures
-** in order to avoid having to initialize the MR_Proc_Id union through the
+** The compiler generates MR_UserProcId and MR_UCIProcId structures
+** in order to avoid having to initialize the MR_ProcId union through the
 ** inapplicable alternative, since the C standard in widespread use now
 ** doesn't support that.
 **
@@ -52,7 +53,7 @@
 ** browser/dl.m and besides all the places that refer to the C types below.
 */
 
-struct MR_User_Proc_Id_Struct {
+struct MR_UserProcId_Struct {
 	MR_PredFunc		MR_user_pred_or_func;
 	MR_ConstString		MR_user_decl_module;
 	MR_ConstString		MR_user_def_module;
@@ -61,7 +62,7 @@
 	MR_int_least16_t	MR_user_mode;
 };
 
-struct MR_UCI_Proc_Id_Struct {
+struct MR_UCIProcId_Struct {
 	MR_ConstString		MR_uci_type_name;
 	MR_ConstString		MR_uci_type_module;
 	MR_ConstString		MR_uci_def_module;
@@ -70,27 +71,25 @@
 	MR_int_least16_t	MR_uci_mode;
 };
 
-struct MR_No_Proc_Id_Struct {
+struct MR_NoProcId_Struct {
 	/*
-	** This field should align with the first field of
-	** MR_User_Proc_Id_Struct, which means that it should have the same
-	** size as MR_PredFunc.  Its value should always be equal to
-	** MR_NO_PROC_ID.
+	** This field should align with the first field of MR_UserProcId_Struct,
+	** which means that it should have the same size as MR_PredFunc.
+	** Its value should always be equal to MR_NO_PROC_ID.
 	*/
 	int			MR_no_proc_id_flag;
 };
 
-union MR_Proc_Id_Union {
-	MR_User_Proc_Id		MR_proc_user;
-	MR_UCI_Proc_Id		MR_proc_uci;
-	MR_No_Proc_Id		MR_proc_none;
+union MR_ProcId_Union {
+	MR_UserProcId		MR_proc_user;
+	MR_UCIProcId		MR_proc_uci;
+	MR_NoProcId		MR_proc_none;
 };
 
 #define MR_PROC_ID_EXISTS(proc_id)					\
 	((proc_id).MR_proc_none.MR_no_proc_id_flag != MR_NO_PROC_ID)
 
 #define	MR_PROC_ID_IS_UCI(proc_id)					\
-	((MR_Unsigned) (proc_id).MR_proc_user.MR_user_pred_or_func	\
-	 	> MR_FUNCTION)
+	((MR_Unsigned) (proc_id).MR_proc_user.MR_user_pred_or_func > MR_FUNCTION)
 
 #endif /* not MERCURY_PROC_ID_H */
Index: runtime/mercury_stack_layout.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_stack_layout.c,v
retrieving revision 1.1
diff -u -r1.1 mercury_stack_layout.c
--- runtime/mercury_stack_layout.c	3 Nov 2005 01:44:13 -0000	1.1
+++ runtime/mercury_stack_layout.c	26 Nov 2006 01:09:10 -0000
@@ -18,7 +18,7 @@
 #include "mercury_stack_layout.h"
 
 MR_ConstString
-MR_hlds_var_name(const MR_Proc_Layout *entry, int hlds_var_num)
+MR_hlds_var_name(const MR_ProcLayout *entry, int hlds_var_num)
 {
     const char  *string_table;
     MR_Integer  string_table_size;
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.102
diff -u -r1.102 mercury_stack_layout.h
--- runtime/mercury_stack_layout.h	24 Nov 2006 03:48:18 -0000	1.102
+++ runtime/mercury_stack_layout.h	26 Nov 2006 23:32:58 -0000
@@ -34,7 +34,7 @@
 #include "mercury_std.h"			/* for MR_VARIABLE_SIZED */
 #include "mercury_tags.h"
 #include "mercury_type_info.h"			/* for MR_PseudoTypeInfo */
-#include "mercury_proc_id.h"			/* for MR_Proc_Id */
+#include "mercury_proc_id.h"			/* for MR_ProcId */
 #include "mercury_goto.h"			/* for MR_PROC_LAYOUT etc */
 #include "mercury_tabling.h"			/* for MR_TableTrieStep etc */
 #include "mercury_bootstrap.h"			/* for MR_Table_Trie_Step */
@@ -83,18 +83,18 @@
 
 /*-------------------------------------------------------------------------*/
 /*
-** Definitions for MR_Long_Lval and MR_Short_Lval
+** Definitions for MR_LongLval and MR_ShortLval
 */
 
 /*
-** MR_Long_Lval is a MR_uint_least32_t which describes an location.
+** MR_LongLval is a MR_uint_least32_t which describes an location.
 ** This includes lvals such as stack slots, general registers, and special
 ** registers such as succip, hp, etc, as well as locations whose address is
 ** given as a typeinfo inside the type class info structure pointed to by an
 ** lval.
 **
-** What kind of location an MR_Long_Lval refers to is encoded using
-** a low tag with MR_LONG_LVAL_TAGBITS bits; the type MR_Long_Lval_Type
+** What kind of location an MR_LongLval refers to is encoded using
+** a low tag with MR_LONG_LVAL_TAGBITS bits; the type MR_LongLvalType
 ** describes the different tag values. The interpretation of the rest of
 ** the word depends on the location type:
 **
@@ -122,15 +122,15 @@
 ** the typeinfo inside a type class info (to be interpreted by
 ** MR_typeclass_info_type_info or the predicate
 ** private_builtin:type_info_from_typeclass_info, which calls it) and
-** (b) a MR_Long_Lval value giving the location of the pointer to the
-** type class info. This MR_Long_Lval value will *not* have an indirect
+** (b) a MR_LongLval value giving the location of the pointer to the
+** type class info. This MR_LongLval value will *not* have an indirect
 ** tag.
 **
 ** This data is generated in stack_layout.represent_locn_as_int,
 ** which must be kept in sync with the constants and macros defined here.
 */
 
-struct MR_Long_Lval_Struct {
+struct MR_LongLval_Struct {
 	MR_uint_least32_t	MR_long_lval;
 };
 
@@ -150,7 +150,7 @@
 	MR_LONG_LVAL_TYPE_CONS_3,
 	MR_LONG_LVAL_TYPE_INDIRECT,
 	MR_LONG_LVAL_TYPE_UNKNOWN
-} MR_Long_Lval_Type;
+} MR_LongLvalType;
 
 /* This must be in sync with stack_layout.long_lval_tag_bits */
 #define MR_LONG_LVAL_TAGBITS		4
@@ -158,7 +158,7 @@
 #define MR_LONG_LVAL_CONST_TAGBITS	2
 
 #define MR_LONG_LVAL_TYPE(Locn)						\
-	((MR_Long_Lval_Type)						\
+	((MR_LongLvalType)						\
 		((Locn).MR_long_lval & ((1 << MR_LONG_LVAL_TAGBITS) - 1)))
 
 #define MR_LONG_LVAL_NUMBER(Locn)					\
@@ -189,12 +189,12 @@
 	(((n) << MR_LONG_LVAL_TAGBITS) + MR_LONG_LVAL_TYPE_R)
 
 /*
-** MR_Short_Lval is a MR_uint_least8_t which describes an location. This
+** MR_ShortLval is a MR_uint_least8_t which describes an location. This
 ** includes lvals such as stack slots and general registers that have small
 ** numbers, and special registers such as succip, hp, etc.
 **
-** What kind of location an MR_Long_Lval refers to is encoded using
-** a low tag with 2 bits; the type MR_Short_Lval_Type describes
+** What kind of location an MR_LongLval refers to is encoded using
+** a low tag with 2 bits; the type MR_ShortLval_Type describes
 ** the different tag values. The interpretation of the rest of the word
 ** depends on the location type:
 **
@@ -202,41 +202,41 @@
 ** MR_r(Num)		 0	Num (register number)
 ** MR_stackvar(Num)	 1	Num (stack slot number)
 ** MR_framevar(Num)	 2	Num (stack slot number)
-** special reg		 3	MR_Long_Lval_Type
+** special reg		 3	MR_LongLvalType
 **
 ** This data is generated in stack_layout.represent_locn_as_byte,
 ** which must be kept in sync with the constants and macros defined here.
 */
 
-typedef MR_uint_least8_t	MR_Short_Lval;
+typedef MR_uint_least8_t	MR_ShortLval;
 
 typedef enum {
 	MR_SHORT_LVAL_TYPE_R,
 	MR_SHORT_LVAL_TYPE_STACKVAR,
 	MR_SHORT_LVAL_TYPE_FRAMEVAR,
 	MR_SHORT_LVAL_TYPE_SPECIAL
-} MR_Short_Lval_Type;
+} MR_ShortLval_Type;
 
 /* This must be in sync with stack_layout.short_lval_tag_bits */
 #define MR_SHORT_LVAL_TAGBITS	2
 
 #define MR_SHORT_LVAL_TYPE(Locn)					\
-	((MR_Short_Lval_Type)						\
+	((MR_ShortLval_Type)						\
 		(((MR_Word) Locn) & ((1 << MR_SHORT_LVAL_TAGBITS) - 1)))
 
 #define MR_SHORT_LVAL_NUMBER(Locn)					\
 	((int) ((MR_Word) Locn) >> MR_SHORT_LVAL_TAGBITS)
 
 #define	MR_SHORT_LVAL_STACKVAR(n)					\
-	((MR_Short_Lval) (((n) << MR_SHORT_LVAL_TAGBITS)		\
+	((MR_ShortLval) (((n) << MR_SHORT_LVAL_TAGBITS)		\
 		+ MR_SHORT_LVAL_TYPE_STACKVAR))
 
 #define	MR_SHORT_LVAL_FRAMEVAR(n)					\
-	((MR_Short_Lval) (((n) << MR_SHORT_LVAL_TAGBITS)		\
+	((MR_ShortLval) (((n) << MR_SHORT_LVAL_TAGBITS)		\
 		+ MR_SHORT_LVAL_TYPE_FRAMEVAR))
 
 #define	MR_SHORT_LVAL_R_REG(n)						\
-	((MR_Short_Lval) (((n) << MR_SHORT_LVAL_TAGBITS)		\
+	((MR_ShortLval) (((n) << MR_SHORT_LVAL_TAGBITS)		\
 		+ MR_SHORT_LVAL_TYPE_R))
 
 /*-------------------------------------------------------------------------*/
@@ -273,18 +273,18 @@
 	MR_uint_least16_t		MR_ue_port_number;
 	const char			*MR_ue_port_name;
 	MR_uint_least16_t		MR_ue_num_attrs;
-	MR_Long_Lval			*MR_ue_attr_locns;
+	MR_LongLval			*MR_ue_attr_locns;
 	MR_TypeInfo			*MR_ue_attr_types;
 	const char			**MR_ue_attr_names;
 };
 
 /*-------------------------------------------------------------------------*/
 /*
-** Definitions for MR_Label_Layout
+** Definitions for MR_LabelLayout
 */
 
 /*
-** An MR_Label_Layout structure describes the debugging and accurate gc
+** An MR_LabelLayout structure describes the debugging and accurate gc
 ** information available at a given label.
 **
 ** The MR_sll_entry field points to the proc layout structure of the procedure
@@ -292,7 +292,7 @@
 **
 ** The MR_sll_port field will contain a negative number if there is no
 ** execution tracing port associated with the label. If there is, the
-** field will contain a value of type MR_Trace_Port. For labels associated
+** field will contain a value of type MR_TracePort. For labels associated
 ** with events, this will be the port of the event. For return labels,
 ** this port will be exception (since exception events are associated with
 ** the return from the call that raised the exception).
@@ -320,18 +320,18 @@
 ** MR_has_valid_var_count macro will return true and the last three fields are
 ** meaningful; if it is not available, the macro will return false and the last
 ** three fields are not meaningful (i.e. you are looking at an
-** MR_Label_Layout_No_Var_Info structure).
+** MR_LabelLayoutNoVarInfo structure).
 **
 ** The format in which we store information about the values live at the label
 ** is somewhat complicated, due to our desire to make this information compact.
-** We can represent a location in one of two ways, as an 8-bit MR_Short_Lval
-** or as a 32-bit MR_Long_Lval. We prefer representing a location as an
-** MR_Short_Lval, but of course not all locations can be represented in
-** this way, so those other locations are represented as MR_Long_Lvals.
+** We can represent a location in one of two ways, as an 8-bit MR_ShortLval
+** or as a 32-bit MR_LongLval. We prefer representing a location as an
+** MR_ShortLval, but of course not all locations can be represented in
+** this way, so those other locations are represented as MR_LongLvals.
 **
 ** The MR_sll_var_count field, if it is valid, is encoded by the formula
 ** (#Long << MR_SHORT_COUNT_BITS + #Short), where #Short is the number
-** data items whose descriptions fit into an MR_Short_Lval and #Long is the
+** data items whose descriptions fit into an MR_ShortLval and #Long is the
 ** number of data items whose descriptions do not. (The number of distinct
 ** values that fit into 8 bits also fits into 8 bits, but since some
 ** locations hold the value of more than one variable at a time, not all
@@ -343,8 +343,8 @@
 ** elements, each of which is a pointer to a MR_PseudoTypeInfo giving the type
 ** of a live data item, with a small integer instead of a pointer representing
 ** a special kind of live data item (e.g. a saved succip or hp). The second
-** vector is an array of #Long MR_Long_Lvals, and the third is an array of
-** #Short MR_Short_Lvals, each of which describes a location. The
+** vector is an array of #Long MR_LongLvals, and the third is an array of
+** #Short MR_ShortLvals, each of which describes a location. The
 ** pseudotypeinfo pointed to by the slot at subscript i in the first vector
 ** describes the type of the data stored in slot i in the second vector if
 ** i < #Long, and the type of the data stored in slot i - #Long in the third
@@ -365,7 +365,7 @@
 **
 ** The types of the live variables may or may not have type variables in them.
 ** If they do not, the MR_sll_tvars field will be NULL. If they do, it will
-** point to an MR_Type_Param_Locns structure that gives the locations of the
+** point to an MR_TypeParamLocns structure that gives the locations of the
 ** typeinfos for those type variables. This structure gives the number of type
 ** variables and their locations, so that the code that needs the type
 ** parameters can materialize all the type parameters from their location
@@ -398,13 +398,13 @@
 ** are ground.
 */
 
-struct MR_Type_Param_Locns_Struct {
+struct MR_TypeParamLocns_Struct {
 	MR_uint_least32_t		MR_tp_param_count;
-	MR_Long_Lval			MR_tp_param_locns[MR_VARIABLE_SIZED];
+	MR_LongLval			MR_tp_param_locns[MR_VARIABLE_SIZED];
 };
 
-struct MR_Label_Layout_Struct {
-	const MR_Proc_Layout		*MR_sll_entry;
+struct MR_LabelLayout_Struct {
+	const MR_ProcLayout		*MR_sll_entry;
 	MR_int_least8_t			MR_sll_port;
 	MR_int_least8_t			MR_sll_hidden;
 	MR_uint_least16_t		MR_sll_label_num_in_module;
@@ -413,18 +413,18 @@
 	MR_Integer			MR_sll_var_count; /* >= 0 */
 	const void			*MR_sll_locns_types;
 	const MR_uint_least16_t		*MR_sll_var_nums;
-	const MR_Type_Param_Locns	*MR_sll_tvars;
+	const MR_TypeParamLocns	*MR_sll_tvars;
 };
 
-typedef	struct MR_Label_Layout_No_Var_Info_Struct {
-	const MR_Proc_Layout		*MR_sll_entry;
+typedef	struct MR_LabelLayoutNoVarInfo_Struct {
+	const MR_ProcLayout		*MR_sll_entry;
 	MR_int_least8_t			MR_sll_port;
 	MR_int_least8_t			MR_sll_hidden;
 	MR_uint_least16_t		MR_sll_label_num_in_module;
 	MR_uint_least32_t		MR_sll_goal_path;
 	const MR_UserEvent		*MR_sll_user_event;
 	MR_Integer			MR_sll_var_count; /* < 0 */
-} MR_Label_Layout_No_Var_Info;
+} MR_LabelLayoutNoVarInfo;
 
 #define	MR_label_goal_path(layout)					\
 	((MR_PROC_LAYOUT_HAS_EXEC_TRACE((layout)->MR_sll_entry)) ?	\
@@ -475,12 +475,12 @@
 	MR_PASTE2(mercury_data__label_layout__, label)
 
 #define	MR_LABEL_LAYOUT_REF(label)					\
-	((const MR_Label_Layout *) &MR_LAYOUT_FROM_LABEL(MR_add_prefix(label)))
+	((const MR_LabelLayout *) &MR_LAYOUT_FROM_LABEL(MR_add_prefix(label)))
 
 #define MR_MAKE_USER_INTERNAL_LAYOUT(module, name, arity, mode, label)	\
-	MR_Label_Layout_No_Var_Info					\
+	MR_LabelLayoutNoVarInfo					\
 	MR_label_layout_user_name(module, name, arity, mode, label) = {	\
-		(MR_Proc_Layout *) &					\
+		(MR_ProcLayout *) &					\
 			MR_proc_layout_user_name(module, name, arity, mode), \
 		0,							\
 		-1,							\
@@ -493,11 +493,11 @@
 /*
 ** These macros are used as shorthands in generated C source files.
 ** The first two arguments are the entry label name and the label number;
-** the others are the fields of MR_Label_Layouts.
+** the others are the fields of MR_LabelLayouts.
 */
 
 #define	MR_DEF_LL_GEN(e, ln, port, h, num, path, s, vc, lt, vn, tv)	\
-	static const MR_Label_Layout					\
+	static const MR_LabelLayout					\
 		MR_LABEL_LAYOUT_NAME(MR_label_name(MR_add_prefix(e), ln)) \
 	= {								\
 		MR_PROC_LAYOUT(MR_add_prefix(e)),			\
@@ -505,11 +505,11 @@
 		(h), (num), (path), (s), (vc),				\
 		((const void *) lt),					\
 		((const MR_uint_least16_t *) vn),			\
-		((const MR_Type_Param_Locns *) tv)			\
+		((const MR_TypeParamLocns *) tv)			\
 	}
 
 #define	MR_DEF_LLNVI_GEN(e, ln, port, s, h, num, path)			\
-	static const MR_Label_Layout_No_Var_Info			\
+	static const MR_LabelLayoutNoVarInfo			\
 		MR_LABEL_LAYOUT_NAME(MR_label_name(MR_add_prefix(e), ln)) \
 	= {								\
 		MR_PROC_LAYOUT(MR_add_prefix(e)),			\
@@ -604,12 +604,12 @@
 
 #define MR_DECL_LL(e, ln)						\
 	MR_declare_label(MR_label_name(MR_add_prefix(e), ln));		\
-	static const MR_Label_Layout					\
+	static const MR_LabelLayout					\
 		MR_LABEL_LAYOUT_NAME(MR_label_name(MR_add_prefix(e), ln)); \
 
 #define MR_DECL_LLNVI(e, ln)						\
 	MR_declare_label(MR_label_name(MR_add_prefix(e), ln));		\
-	static const MR_Label_Layout_No_Var_Info			\
+	static const MR_LabelLayoutNoVarInfo			\
 		MR_LABEL_LAYOUT_NAME(MR_label_name(MR_add_prefix(e), ln)); \
 
 #define MR_DECL_LL1(e, ln1)						\
@@ -689,16 +689,16 @@
 
 /*-------------------------------------------------------------------------*/
 /*
-** Definitions for MR_Proc_Layout
+** Definitions for MR_ProcLayout
 */
 
 /*
-** The MR_Table_Io_Decl structure.
+** The MR_TableIoDecl structure.
 **
 ** To enable declarative debugging of I/O actions, the compiler generates one
 ** of these structures for each I/O primitive. The compiler transforms the
 ** bodies of those primitives to create a block of memory and fill it in with
-** (1) a pointer to the primitive's MR_Table_Io_Decl structure and (2) the
+** (1) a pointer to the primitive's MR_TableIoDecl structure and (2) the
 ** values of the primitive's arguments (both input and output, but excluding
 ** the I/O states). The array of pseudo-typeinfos pointed to by the ptis field
 ** gives the types of these arguments, while the filtered_arity field gives
@@ -709,15 +709,15 @@
 ** to describe the I/O action to the user.
 */
 
-typedef struct MR_Table_Io_Decl_Struct {
-	const MR_Proc_Layout		*MR_table_io_decl_proc;
+typedef struct MR_TableIoDecl_Struct {
+	const MR_ProcLayout		*MR_table_io_decl_proc;
 	MR_Integer			MR_table_io_decl_filtered_arity;
 	const MR_PseudoTypeInfo		*MR_table_io_decl_ptis;
-	const MR_Type_Param_Locns	*MR_table_io_decl_type_params;
-} MR_Table_Io_Decl;
+	const MR_TypeParamLocns	*MR_table_io_decl_type_params;
+} MR_TableIoDecl;
 
 /*
-** MR_Table_Info: compiler generated information describing the tabling
+** MR_TableInfo: compiler generated information describing the tabling
 ** data structures used by a procedure.
 **
 ** For I/O tabled procedures, the information is in the io_decl field.
@@ -730,13 +730,13 @@
 
 typedef union {
 	const void			*MR_table_init;
-	const MR_Table_Io_Decl		*MR_table_io_decl;
+	const MR_TableIoDecl		*MR_table_io_decl;
 	const MR_Table_Gen		*MR_table_gen;
 	MR_ProcTableInfo		*MR_table_proc;
-} MR_Table_Info;
+} MR_TableInfo;
 
 /*
-** The MR_Stack_Traversal structure contains the following fields:
+** The MR_StackTraversal structure contains the following fields:
 **
 ** The code_addr field points to the start of the procedure's code.
 ** This allows the profiler to figure out which procedure a sampled program
@@ -753,18 +753,18 @@
 ** The detism field encodes the determinism of the procedure.
 */
 
-typedef struct MR_Stack_Traversal_Struct {
+typedef struct MR_StackTraversal_Struct {
 	MR_Code			*MR_trav_code_addr;
-	MR_Long_Lval		MR_trav_succip_locn;
+	MR_LongLval		MR_trav_succip_locn;
 	MR_int_least16_t	MR_trav_stack_slots;
 	MR_Determinism		MR_trav_detism;
-} MR_Stack_Traversal;
+} MR_StackTraversal;
 
 #define	MR_PROC_LAYOUT_IS_UCI(entry)			\
 	MR_PROC_ID_IS_UCI(entry->MR_sle_proc_id)
 
 /*
-** The MR_Exec_Trace structure contains the following fields.
+** The MR_ExecTrace structure contains the following fields.
 **
 ** The call_label field points to the label layout structure for the label
 ** associated with the call event at the entry to the procedure. The purpose
@@ -865,21 +865,21 @@
 
 typedef	MR_int_least8_t		MR_EvalMethodInt;
 
-typedef	enum {
-	MR_TRACELEVEL_NONE,
-	MR_TRACELEVEL_SHALLOW,
-	MR_TRACELEVEL_DEEP,
-	MR_TRACELEVEL_DECL_REP
+typedef enum {
+	MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_NONE),
+	MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_SHALLOW),
+	MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_DEEP),
+	MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_DECL_REP)
 } MR_TraceLevel;
 
 typedef	MR_int_least8_t		MR_TraceLevelInt;
 
-typedef	struct MR_Exec_Trace_Struct {
-	const MR_Label_Layout	*MR_exec_call_label;
-	const MR_Module_Layout	*MR_exec_module_layout;
+typedef	struct MR_ExecTrace_Struct {
+	const MR_LabelLayout	*MR_exec_call_label;
+	const MR_ModuleLayout	*MR_exec_module_layout;
 	const MR_uint_least8_t	*MR_exec_body_bytes;
 	MR_Word			MR_exec_unused;
-	MR_Table_Info		MR_exec_table_info;
+	MR_TableInfo		MR_exec_table_info;
 	const MR_uint_least16_t	*MR_exec_head_var_nums;
 	const MR_uint_least32_t	*MR_exec_used_var_names;
 	MR_uint_least16_t	MR_exec_num_head_vars;
@@ -893,7 +893,7 @@
 	MR_int_least8_t		MR_exec_maybe_call_table;
 	MR_TraceLevelInt	MR_exec_trace_level_CAST_ME;
 	MR_uint_least8_t	MR_exec_flags;
-} MR_Exec_Trace;
+} MR_ExecTrace;
 
 #define MR_compute_max_mr_num(max_mr_num, layout)			\
 	do {								\
@@ -908,78 +908,78 @@
 
 /*-------------------------------------------------------------------------*/
 /*
-** Definitions for MR_Proc_Layout
+** Definitions for MR_ProcLayout
 **
 ** Proc layout structures contain one, two or three substructures.
 **
-** - The first substructure is the MR_Stack_Traversal structure, which contains
+** - The first substructure is the MR_StackTraversal structure, which contains
 **   information that enables the stack to be traversed, e.g. for accurate gc.
 **   It is always present if proc layouts are present at all.
 **
-** - The second group is the MR_Proc_Id union, which identifies the
+** - The second group is the MR_ProcId union, which identifies the
 **   procedure in terms that are meaningful to both humans and machines.
 **   It will be generated only if the module is compiled with stack tracing,
-**   execution tracing or profiling. The MR_Proc_Id union has two alternatives,
+**   execution tracing or profiling. The MR_ProcId union has two alternatives,
 **   one for user-defined procedures and one for procedures of the compiler
 **   generated Unify, Index and Compare predicates.
 **
-** - The third group is the MR_Exec_Trace and MR_ProcStatic structures, which
+** - The third group is the MR_ExecTrace and MR_ProcStatic structures, which
 **   contain information specifically intended for the debugger and the deep
-**   profiler respectively. The MR_Exec_Trace structure will be generated
+**   profiler respectively. The MR_ExecTrace structure will be generated
 **   only if the module is compiled with execution tracing, while the
 **   MR_ProcStatic structure will be generated only if the module is compiled
 **   in a deep profiling grade.
 **
 ** The runtime system considers all proc layout structures to be of type
-** MR_Proc_Layout, but must use the macros defined below to check for the
+** MR_ProcLayout, but must use the macros defined below to check for the
 ** existence of each substructure before accessing the fields of that
 ** substructure. The macros are MR_PROC_LAYOUT_HAS_PROC_ID to check for the
-** MR_Proc_Id substructure, MR_PROC_LAYOUT_HAS_EXEC_TRACE to check for the
-** MR_Exec_Trace substructure, and MR_PROC_LAYOUT_HAS_PROC_STATIC to check for
+** MR_ProcId substructure, MR_PROC_LAYOUT_HAS_EXEC_TRACE to check for the
+** MR_ExecTrace substructure, and MR_PROC_LAYOUT_HAS_PROC_STATIC to check for
 ** the MR_ProcStatic substructure.
 **
 ** The reason why some substructures may be missing is to save space.
 ** If the options with which a module is compiled do not require execution
-** tracing, then the MR_Exec_Trace substructure will not present, and if the
-** options do not require procedure identification, then the MR_Proc_Id
+** tracing, then the MR_ExecTrace substructure will not present, and if the
+** options do not require procedure identification, then the MR_ProcId
 ** substructure will not be present either
 **
 ** The compiler itself generates proc layout structures using the following
 ** three types.
 **
 ** - When generating only stack traversal information, the compiler will
-**   generate proc layout structures of type MR_Proc_Layout_Traversal.
+**   generate proc layout structures of type MR_ProcLayout_Traversal.
 **
 ** - When generating stack traversal and procedure id information, plus
 **   possibly others, the compiler will generate proc layout structures of
-**   types MR_Proc_Layout_User and MR_Proc_Layout_UCI.
+**   types MR_ProcLayoutUser and MR_ProcLayoutUCI.
 */
 
-struct MR_Proc_Layout_Struct {
-	MR_Stack_Traversal			MR_sle_traversal;
-	MR_Proc_Id				MR_sle_proc_id;
-	MR_STATIC_CODE_CONST MR_Exec_Trace	*MR_sle_exec_trace;
+struct MR_ProcLayout_Struct {
+	MR_StackTraversal			MR_sle_traversal;
+	MR_ProcId				MR_sle_proc_id;
+	MR_STATIC_CODE_CONST MR_ExecTrace	*MR_sle_exec_trace;
 	MR_ProcStatic				*MR_sle_proc_static;
 };
 
-typedef	struct MR_Proc_Layout_User_Struct {
-	MR_Stack_Traversal			MR_user_traversal;
-	MR_User_Proc_Id				MR_user_id;
-	MR_STATIC_CODE_CONST MR_Exec_Trace	*MR_sle_exec_trace;
+typedef	struct MR_ProcLayoutUser_Struct {
+	MR_StackTraversal			MR_user_traversal;
+	MR_UserProcId				MR_user_id;
+	MR_STATIC_CODE_CONST MR_ExecTrace	*MR_sle_exec_trace;
 	MR_ProcStatic				*MR_sle_proc_static;
-} MR_Proc_Layout_User;
+} MR_ProcLayoutUser;
 
-typedef	struct MR_Proc_Layout_UCI_Struct {
-	MR_Stack_Traversal			MR_uci_traversal;
-	MR_UCI_Proc_Id				MR_uci_id;
-	MR_STATIC_CODE_CONST MR_Exec_Trace	*MR_sle_exec_trace;
+typedef	struct MR_ProcLayoutUCI_Struct {
+	MR_StackTraversal			MR_uci_traversal;
+	MR_UCIProcId				MR_uci_id;
+	MR_STATIC_CODE_CONST MR_ExecTrace	*MR_sle_exec_trace;
 	MR_ProcStatic				*MR_sle_proc_static;
-} MR_Proc_Layout_UCI;
+} MR_ProcLayoutUCI;
 
-typedef	struct MR_Proc_Layout_Traversal_Struct {
-	MR_Stack_Traversal	MR_trav_traversal;
+typedef	struct MR_ProcLayout_Traversal_Struct {
+	MR_StackTraversal	MR_trav_traversal;
 	MR_Word			MR_trav_no_proc_id;	/* will be -1 */
-} MR_Proc_Layout_Traversal;
+} MR_ProcLayout_Traversal;
 
 #define	MR_PROC_LAYOUT_HAS_PROC_ID(entry)			\
 		(MR_PROC_ID_EXISTS(entry->MR_sle_proc_id))
@@ -1036,7 +1036,7 @@
 ** in the procedure indicated by the first argument.
 */
 
-extern	MR_ConstString	MR_hlds_var_name(const MR_Proc_Layout *entry,
+extern	MR_ConstString	MR_hlds_var_name(const MR_ProcLayout *entry,
 				int hlds_var_num);
 
 /*
@@ -1081,7 +1081,7 @@
  #define	MR_MAKE_PROC_LAYOUT_ADDR(entry)		((MR_Code *) NULL)
  #define	MR_INIT_PROC_LAYOUT_ADDR(entry)				\
 		do {							\
-			((MR_Proc_Layout *) &				\
+			((MR_ProcLayout *) &				\
 			MR_PASTE2(mercury_data__proc_layout__, entry))	\
 				->MR_sle_code_addr = MR_ENTRY(entry);	\
 		} while (0)
@@ -1091,7 +1091,7 @@
 		pf, module, name, arity, mode, proc_static)		\
 	MR_declare_entry(MR_proc_entry_user_name(module, name,		\
 		arity, mode));						\
-	sc const MR_Proc_Layout_User					\
+	sc const MR_ProcLayoutUser					\
 	MR_proc_layout_user_name(module, name, arity, mode) = {		\
 		{							\
 			MR_MAKE_PROC_LAYOUT_ADDR(			\
@@ -1117,7 +1117,7 @@
 		module, name, type, arity, mode, proc_static)		\
 	MR_declare_entry(MR_proc_entry_uci_name(module, name,		\
 		type, arity, mode));					\
-	sc const MR_Proc_Layout_UCI					\
+	sc const MR_ProcLayoutUCI					\
 	MR_proc_layout_uci_name(module, name, type, arity, mode) = {	\
 		{							\
 			MR_MAKE_PROC_LAYOUT_ADDR(			\
@@ -1171,11 +1171,11 @@
 		succip_locn, pf, module, name, arity, mode, NULL)
 
 #define MR_DECLARE_UCI_PROC_STATIC_LAYOUTS(mod, n, a)                       \
-	const MR_Proc_Layout_UCI					\
+	const MR_ProcLayoutUCI					\
 		MR_proc_layout_uci_name(mod, __Unify__, n, a, 0);	\
-	const MR_Proc_Layout_UCI					\
+	const MR_ProcLayoutUCI					\
 		MR_proc_layout_uci_name(mod, __Compare__, n, a, 0);	\
-	const MR_Proc_Layout_UCI					\
+	const MR_ProcLayoutUCI					\
 		MR_proc_layout_uci_name(mod, __CompareRep__, n, a, 0);
 
 /*
@@ -1226,7 +1226,7 @@
 
 /*-------------------------------------------------------------------------*/
 /*
-** Definitions for MR_Module_Layout
+** Definitions for MR_ModuleLayout
 **
 ** The layout structure for a module contains the following fields.
 **
@@ -1253,7 +1253,7 @@
 ** require padding.) The labels are sorted on line number.
 **
 ** The MR_ml_trace_level field gives the trace level that the module was
-** compiled with. If the MR_Trace_Level enum is modified, then the
+** compiled with. If the MR_TraceLevel enum is modified, then the
 ** corresponding function in compiler/trace_params.m must also be updated.
 **
 ** The MR_ml_suppressed_events events field encodes the set of event types
@@ -1275,20 +1275,13 @@
 ** in the MR_ml_label_exec_count array.
 */
 
-typedef enum {
-	MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_NONE),
-	MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_SHALLOW),
-	MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_DEEP),
-	MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_DECL_REP)
-} MR_Trace_Level;
-
-typedef struct MR_Module_File_Layout_Struct {
+typedef struct MR_ModuleFileLayout_Struct {
 	MR_ConstString			MR_mfl_filename;
 	MR_Integer			MR_mfl_label_count;
 	/* the following fields point to arrays of size MR_mfl_label_count */
 	const MR_int_least16_t		*MR_mfl_label_lineno;
-	const MR_Label_Layout		**MR_mfl_label_layout;
-} MR_Module_File_Layout;
+	const MR_LabelLayout		**MR_mfl_label_layout;
+} MR_ModuleFileLayout;
 
 /*
 ** The version of the data structures in this file -- useful for bootstrapping.
@@ -1303,16 +1296,16 @@
 #define	MR_LAYOUT_VERSION		MR_LAYOUT_VERSION__USER_DEFINED
 #define	MR_LAYOUT_VERSION__USER_DEFINED	1
 
-struct MR_Module_Layout_Struct {
+struct MR_ModuleLayout_Struct {
 	MR_uint_least8_t                MR_ml_version_number;
 	MR_ConstString			MR_ml_name;
 	MR_Integer			MR_ml_string_table_size;
 	const char			*MR_ml_string_table;
 	MR_Integer			MR_ml_proc_count;
-	const MR_Proc_Layout		**MR_ml_procs;
+	const MR_ProcLayout		**MR_ml_procs;
 	MR_Integer			MR_ml_filename_count;
-	const MR_Module_File_Layout	**MR_ml_module_file_layout;
-	MR_Trace_Level			MR_ml_trace_level;
+	const MR_ModuleFileLayout	**MR_ml_module_file_layout;
+	MR_TraceLevel			MR_ml_trace_level;
 	MR_int_least32_t		MR_ml_suppressed_events;
 	MR_int_least32_t		MR_ml_num_label_exec_counts;
 	MR_Unsigned			*MR_ml_label_exec_count;
@@ -1321,35 +1314,35 @@
 
 /*-------------------------------------------------------------------------*/
 /*
-** Definitions for MR_Closure_Id
+** Definitions for MR_ClosureId
 **
-** Each closure contains an MR_Closure_Id structure. The proc_id field
+** Each closure contains an MR_ClosureId structure. The proc_id field
 ** identifies the procedure called by the closure. The other fields identify
 ** the context where the closure was created.
 **
-** The compiler generates closure id structures as either MR_User_Closure_Id
-** or MR_UCI_Closure_Id structures in order to avoid initializing the
-** MR_Proc_Id union through an inappropriate member.
+** The compiler generates closure id structures as either MR_UserClosureId
+** or MR_UCIClosureId structures in order to avoid initializing the
+** MR_ProcId union through an inappropriate member.
 */
 
-struct MR_Closure_Id_Struct {
-	MR_Proc_Id		MR_closure_proc_id;
+struct MR_ClosureId_Struct {
+	MR_ProcId		MR_closure_proc_id;
 	MR_ConstString		MR_closure_module_name;
 	MR_ConstString		MR_closure_file_name;
 	MR_Integer		MR_closure_line_number;
 	MR_ConstString		MR_closure_goal_path;
 };
 
-struct MR_User_Closure_Id_Struct {
-	MR_User_Proc_Id		MR_user_closure_proc_id;
+struct MR_UserClosureId_Struct {
+	MR_UserProcId		MR_user_closure_proc_id;
 	MR_ConstString		MR_user_closure_module_name;
 	MR_ConstString		MR_user_closure_file_name;
 	MR_Integer		MR_user_closure_line_number;
 	MR_ConstString		MR_user_closure_goal_path;
 };
 
-struct MR_UCI_Closure_Id_Struct {
-	MR_UCI_Proc_Id		MR_uci_closure_proc_id;
+struct MR_UCIClosureId_Struct {
+	MR_UCIProcId		MR_uci_closure_proc_id;
 	MR_ConstString		MR_uci_closure_module_name;
 	MR_ConstString		MR_uci_closure_file_name;
 	MR_Integer		MR_uci_closure_line_number;
Index: runtime/mercury_stack_trace.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_stack_trace.c,v
retrieving revision 1.75
diff -u -r1.75 mercury_stack_trace.c
--- runtime/mercury_stack_trace.c	1 Nov 2006 02:31:14 -0000	1.75
+++ runtime/mercury_stack_trace.c	26 Nov 2006 14:04:35 -0000
@@ -26,9 +26,9 @@
   #define snprintf	_snprintf
 #endif
 
-static  MR_Stack_Walk_Step_Result
+static  MR_StackWalkStepResult
                     MR_stack_walk_succip_layout(MR_Code *success,
-                        const MR_Label_Layout **return_label_layout,
+                        const MR_LabelLayout **return_label_layout,
                         MR_Word **base_sp_ptr, MR_Word **base_curfr_ptr,
                         const char **problem_ptr);
 
@@ -48,7 +48,7 @@
 
 typedef void        MR_Dump_Or_Traverse_Nondet_Frame_Func(void *user_data,
                         MR_Nondet_Frame_Category category, MR_Word *top_fr,
-                        const MR_Label_Layout *layout, MR_Word *base_sp,
+                        const MR_LabelLayout *layout, MR_Word *base_sp,
                         MR_Word *base_curfr, int level_number);
 
 static MR_Dump_Or_Traverse_Nondet_Frame_Func MR_dump_nondet_stack_frame;
@@ -58,7 +58,7 @@
                         MR_Dump_Or_Traverse_Nondet_Frame_Func *func,
                         void *func_data, int level_number, MR_Word *fr);
 static void         MR_init_nondet_branch_infos(MR_Word *base_maxfr,
-                    	const MR_Label_Layout *top_layout, MR_Word *base_sp,
+                    	const MR_LabelLayout *top_layout, MR_Word *base_sp,
                         MR_Word *base_curfr);
 static  MR_bool     MR_find_matching_branch(MR_Word *fr, int *branch_ptr);
 static  void        MR_record_temp_redoip(MR_Word *fr);
@@ -71,7 +71,7 @@
 static  void        MR_dump_stack_record_init(MR_bool include_trace_data,
                         MR_bool include_contexts);
 static  int         MR_dump_stack_record_frame(FILE *fp,
-                        const MR_Label_Layout *label_layout,
+                        const MR_LabelLayout *label_layout,
                         MR_Word *base_sp, MR_Word *base_curfr,
                         MR_Print_Stack_Record print_stack_record,
                         MR_bool at_line_limit);
@@ -79,7 +79,7 @@
                         MR_Print_Stack_Record print_stack_record);
 
 static  void        MR_print_proc_id_internal(FILE *fp,
-                        const MR_Proc_Layout *entry, MR_bool spec, 
+                        const MR_ProcLayout *entry, MR_bool spec,
                         MR_bool print_mode, MR_bool separate);
 
 static  void        MR_maybe_print_context(FILE *fp,
@@ -88,12 +88,12 @@
                         MR_bool print_parent, MR_bool verbose,
                         const char *filename, int lineno);
 
-static  MR_bool     MR_call_details_are_valid(const MR_Proc_Layout *entry, 
+static  MR_bool     MR_call_details_are_valid(const MR_ProcLayout *entry,
                         MR_Word *base_sp, MR_Word *base_curfr);
 static  MR_bool     MR_call_is_before_event_or_seq(
-                        MR_find_first_call_seq_or_event seq_or_event, 
-                        MR_Unsigned seq_no_or_event_no, 
-                        const MR_Proc_Layout *entry, MR_Word *base_sp, 
+                        MR_FindFirstCallSeqOrEvent seq_or_event,
+                        MR_Unsigned seq_no_or_event_no,
+                        const MR_ProcLayout *entry, MR_Word *base_sp,
                         MR_Word *base_curfr);
 
 /* see comments in mercury_stack_trace.h */
@@ -105,7 +105,7 @@
     MR_Word *current_frame, MR_bool include_trace_data)
 {
     const MR_Internal       *label;
-    const MR_Label_Layout   *layout;
+    const MR_LabelLayout    *layout;
     const char              *result;
     MR_bool                 stack_dump_available;
     char                    *env_suppress;
@@ -144,15 +144,15 @@
 }
 
 const char *
-MR_dump_stack_from_layout(FILE *fp, const MR_Label_Layout *label_layout,
+MR_dump_stack_from_layout(FILE *fp, const MR_LabelLayout *label_layout,
     MR_Word *det_stack_pointer, MR_Word *current_frame,
     MR_bool include_trace_data, MR_bool include_contexts,
     int frame_limit, int line_limit, MR_Print_Stack_Record print_stack_record)
 {
-    MR_Stack_Walk_Step_Result       result;
-    const MR_Proc_Layout            *entry_layout;
-    const MR_Label_Layout           *cur_label_layout;
-    const MR_Label_Layout           *prev_label_layout;
+    MR_StackWalkStepResult          result;
+    const MR_ProcLayout             *entry_layout;
+    const MR_LabelLayout            *cur_label_layout;
+    const MR_LabelLayout            *prev_label_layout;
     const char                      *problem;
     MR_Word                         *stack_trace_sp;
     MR_Word                         *stack_trace_curfr;
@@ -214,14 +214,14 @@
     return NULL;
 }
 
-const MR_Label_Layout *
-MR_find_nth_ancestor(const MR_Label_Layout *label_layout, int ancestor_level,
+const MR_LabelLayout *
+MR_find_nth_ancestor(const MR_LabelLayout *label_layout, int ancestor_level,
     MR_Word **stack_trace_sp, MR_Word **stack_trace_curfr,
     const char **problem)
 {
-    MR_Stack_Walk_Step_Result       result;
-    const MR_Label_Layout           *return_label_layout;
-    int                             i;
+    MR_StackWalkStepResult  result;
+    const MR_LabelLayout    *return_label_layout;
+    int                     i;
 
     if (ancestor_level < 0) {
         *problem = "no such stack frame";
@@ -249,14 +249,14 @@
     return label_layout;
 }
 
-MR_Stack_Walk_Step_Result
-MR_stack_walk_step(const MR_Proc_Layout *entry_layout,
-    const MR_Label_Layout **return_label_layout,
+MR_StackWalkStepResult
+MR_stack_walk_step(const MR_ProcLayout *entry_layout,
+    const MR_LabelLayout **return_label_layout,
     MR_Word **stack_trace_sp_ptr, MR_Word **stack_trace_curfr_ptr,
     const char **problem_ptr)
 {
-    MR_Long_Lval            location;
-    MR_Long_Lval_Type       type;
+    MR_LongLval             location;
+    MR_LongLvalType         type;
     int                     number;
     int                     determinism;
     MR_Code                 *success;
@@ -306,9 +306,9 @@
         stack_trace_sp_ptr, stack_trace_curfr_ptr, problem_ptr);
 }
 
-static MR_Stack_Walk_Step_Result
+static MR_StackWalkStepResult
 MR_stack_walk_succip_layout(MR_Code *success,
-    const MR_Label_Layout **return_label_layout,
+    const MR_LabelLayout **return_label_layout,
     MR_Word **stack_trace_sp_ptr, MR_Word **stack_trace_curfr_ptr,
     const char **problem_ptr)
 {
@@ -368,7 +368,7 @@
 void
 MR_dump_nondet_stack_from_layout(FILE *fp, MR_Word *limit_addr,
     int frame_limit, int line_limit,
-    MR_Word *base_maxfr, const MR_Label_Layout *top_layout,
+    MR_Word *base_maxfr, const MR_LabelLayout *top_layout,
     MR_Word *base_sp, MR_Word *base_curfr)
 {
     MR_fatal_error("MR_dump_nondet_stack_from_layout in high level grade");
@@ -431,7 +431,7 @@
 {
     MR_Word                 *branch_sp;
     MR_Word                 *branch_curfr;
-    const MR_Label_Layout   *branch_layout;
+    const MR_LabelLayout    *branch_layout;
     MR_Word                 *branch_topfr;
 } MR_Nondet_Branch_Info;
 
@@ -444,15 +444,15 @@
 void
 MR_dump_nondet_stack_from_layout(FILE *fp, MR_Word *limit_addr,
     int frame_limit, int line_limit, MR_Word *base_maxfr,
-    const MR_Label_Layout *top_layout, MR_Word *base_sp, MR_Word *base_curfr)
+    const MR_LabelLayout *top_layout, MR_Word *base_sp, MR_Word *base_curfr)
 {
     int                     frame_size;
     int                     level_number;
     MR_bool                 print_vars;
     const char              *problem;
     int                     branch;
-    const MR_Label_Layout   *label_layout;
-    const MR_Proc_Layout    *proc_layout;
+    const MR_LabelLayout    *label_layout;
+    const MR_ProcLayout     *proc_layout;
     int                     frames_traversed_so_far;
     int                     lines_dumped_so_far;
 
@@ -596,7 +596,7 @@
 
 static void
 MR_dump_nondet_stack_frame(void *fp, MR_Nondet_Frame_Category category,
-    MR_Word *top_fr, const MR_Label_Layout *top_layout, MR_Word *base_sp,
+    MR_Word *top_fr, const MR_LabelLayout *top_layout, MR_Word *base_sp,
     MR_Word *base_curfr, int level_number)
 {
     FILE *dump_fp = fp;
@@ -644,7 +644,7 @@
 
 void
 MR_traverse_nondet_stack_from_layout(MR_Word *base_maxfr,
-    const MR_Label_Layout *top_layout, MR_Word *base_sp, MR_Word *base_curfr,
+    const MR_LabelLayout *top_layout, MR_Word *base_sp, MR_Word *base_curfr,
     MR_Traverse_Nondet_Frame_Func *func, void *func_data)
 {
     int             frame_size;
@@ -696,7 +696,7 @@
 
 static void
 MR_traverse_nondet_stack_frame(void *info, MR_Nondet_Frame_Category category,
-    MR_Word *top_fr, const MR_Label_Layout *top_layout, MR_Word *base_sp,
+    MR_Word *top_fr, const MR_LabelLayout *top_layout, MR_Word *base_sp,
     MR_Word *base_curfr, int level_number)
 {
     MR_Traverse_Nondet_Frame_Func_Info *func_info = info;
@@ -707,11 +707,18 @@
 
 static void
 MR_init_nondet_branch_infos(MR_Word *base_maxfr,
-	const MR_Label_Layout *top_layout, MR_Word *base_sp, MR_Word *base_curfr)
+	const MR_LabelLayout *top_layout, MR_Word *base_sp, MR_Word *base_curfr)
 {
-    const MR_Label_Layout *label_layout = top_layout;
-    MR_Word *stack_pointer = base_sp;
-    MR_Word *current_frame = base_curfr;
+    const MR_LabelLayout        *label_layout;
+    const MR_ProcLayout         *proc_layout;
+    MR_Word                     *stack_pointer;
+    MR_Word                     *current_frame;
+    MR_StackWalkStepResult      result;
+    const char                  *problem;
+
+    label_layout = top_layout;
+    stack_pointer = base_sp;
+    current_frame = base_curfr;
 
     MR_nondet_branch_info_next = 0;
 
@@ -719,10 +726,6 @@
     ** Skip past any model_det frames.
     */
     do {
-        const MR_Proc_Layout            *proc_layout;
-        MR_Stack_Walk_Step_Result       result;
-        const char                      *problem;
-
         proc_layout = label_layout->MR_sll_entry;
         if (!MR_DETISM_DET_STACK(proc_layout->MR_sle_detism)) {
             break;
@@ -753,20 +756,20 @@
 MR_step_over_nondet_frame(MR_Dump_Or_Traverse_Nondet_Frame_Func *func,
     void *func_data, int level_number, MR_Word *fr)
 {
-    MR_Stack_Walk_Step_Result       result;
-    MR_Determinism                  determinism;
-    const MR_Internal               *internal;
-    int                             branch;
-    int                             last;
-    MR_Word                         *base_sp;
-    MR_Word                         *base_curfr;
-    MR_Word                         *topfr;
-    const MR_Label_Layout           *label_layout;
-    const MR_Proc_Layout            *proc_layout;
-    MR_Code                         *redoip;
-    MR_Code                         *success;
-    const char                      *problem;
-    MR_Nondet_Frame_Category        category;
+    MR_StackWalkStepResult      result;
+    MR_Determinism              determinism;
+    const MR_Internal           *internal;
+    int                         branch;
+    int                         last;
+    MR_Word                     *base_sp;
+    MR_Word                     *base_curfr;
+    MR_Word                     *topfr;
+    const MR_LabelLayout        *label_layout;
+    const MR_ProcLayout         *proc_layout;
+    MR_Code                     *redoip;
+    MR_Code                     *success;
+    const char                  *problem;
+    MR_Nondet_Frame_Category    category;
 
     if (MR_find_matching_branch(fr, &branch)) {
         base_sp = MR_nondet_branch_infos[branch].branch_sp;
@@ -880,13 +883,12 @@
         determinism = proc_layout->MR_sle_detism;
         if (MR_DETISM_DET_STACK(determinism)) {
             /*
-            ** We must have found the common ancestor of the
-            ** procedure call whose variables we just printed
-            ** and the call currently being executed. While this
-            ** common ancestor must include model_non code, this
-            ** may be inside a commit in a procedure that lives on
-            ** the det stack. If that is the case, the common
-            ** ancestor must not be put into MR_nondet_branch_info.
+            ** We must have found the common ancestor of the procedure call
+            ** whose variables we just printed and the call currently being
+            ** executed. While this common ancestor must include model_non code,
+            ** this may be inside a commit in a procedure that lives on the
+            ** det stack. If that is the case, the common ancestor must not be
+            ** put into MR_nondet_branch_info.
             */
 
             return NULL;
@@ -1036,7 +1038,7 @@
 
 /**************************************************************************/
 
-static  const MR_Proc_Layout    *prev_entry_layout;
+static  const MR_ProcLayout    *prev_entry_layout;
 static  int                     prev_entry_layout_count;
 static  int                     prev_entry_start_level;
 static  MR_Word                 *prev_entry_base_sp;
@@ -1061,11 +1063,11 @@
 }
 
 static int
-MR_dump_stack_record_frame(FILE *fp, const MR_Label_Layout *label_layout,
+MR_dump_stack_record_frame(FILE *fp, const MR_LabelLayout *label_layout,
     MR_Word *base_sp, MR_Word *base_curfr,
     MR_Print_Stack_Record print_stack_record, MR_bool at_line_limit)
 {
-    const MR_Proc_Layout    *entry_layout;
+    const MR_ProcLayout     *entry_layout;
     const char              *filename;
     int                     linenumber;
     MR_bool                 must_flush;
@@ -1080,16 +1082,13 @@
     }
 
     /*
-    ** We cannot merge two calls if they are to different
-    ** procedures.
+    ** We cannot merge two calls if they are to different procedures.
     **
-    ** We cannot merge two calls even to the same procedure
-    ** if we are printing trace data, since this will differ
-    ** between the calls.
+    ** We cannot merge two calls even to the same procedure if we are printing
+    ** trace data, since this will differ between the calls.
     **
-    ** Note that it is not possible for two calls to the same
-    ** procedure to differ on whether the procedure has trace
-    ** layout data or not.
+    ** Note that it is not possible for two calls to the same procedure to differ
+    ** on whether the procedure has trace layout data or not.
     */
     must_flush = (entry_layout != prev_entry_layout) || trace_data_enabled;
 
@@ -1135,7 +1134,7 @@
 }
 
 void
-MR_dump_stack_record_print(FILE *fp, const MR_Proc_Layout *entry_layout,
+MR_dump_stack_record_print(FILE *fp, const MR_ProcLayout *entry_layout,
     int count, int start_level, MR_Word *base_sp, MR_Word *base_curfr,
     const char *filename, int linenumber, const char *goal_path,
     MR_bool context_mismatch)
@@ -1174,12 +1173,12 @@
 }
 
 MR_bool
-MR_find_context(const MR_Label_Layout *label, const char **fileptr,
+MR_find_context(const MR_LabelLayout *label, const char **fileptr,
     int *lineptr)
 {
-    const MR_Proc_Layout            *proc;
-    const MR_Module_Layout          *module;
-    const MR_Module_File_Layout     *file_layout;
+    const MR_ProcLayout             *proc;
+    const MR_ModuleLayout           *module;
+    const MR_ModuleFileLayout       *file_layout;
     int                             i, j;
 
     proc = label->MR_sll_entry;
@@ -1204,7 +1203,7 @@
 
 void
 MR_maybe_print_call_trace_info(FILE *fp, MR_bool include_trace_data,
-    const MR_Proc_Layout *entry, MR_Word *base_sp, MR_Word *base_curfr)
+    const MR_ProcLayout *entry, MR_Word *base_sp, MR_Word *base_curfr)
 {
     if (include_trace_data) {
         MR_print_call_trace_info(fp, entry, base_sp, base_curfr);
@@ -1217,7 +1216,7 @@
 */
 
 void
-MR_print_call_trace_info(FILE *fp, const MR_Proc_Layout *entry,
+MR_print_call_trace_info(FILE *fp, const MR_ProcLayout *entry,
     MR_Word *base_sp, MR_Word *base_curfr)
 {
     MR_bool print_details;
@@ -1282,35 +1281,35 @@
 }
 
 void
-MR_print_proc_id(FILE *fp, const MR_Proc_Layout *entry)
+MR_print_proc_id(FILE *fp, const MR_ProcLayout *entry)
 {
     MR_print_proc_id_internal(fp, entry, MR_FALSE, MR_TRUE, MR_FALSE);
 }
 
 void
-MR_print_pred_id(FILE *fp, const MR_Proc_Layout *entry)
+MR_print_pred_id(FILE *fp, const MR_ProcLayout *entry)
 {
     MR_print_proc_id_internal(fp, entry, MR_FALSE, MR_FALSE, MR_FALSE);
 }
 
 void
-MR_print_proc_spec(FILE *fp, const MR_Proc_Layout *entry)
+MR_print_proc_spec(FILE *fp, const MR_ProcLayout *entry)
 {
     MR_print_proc_id_internal(fp, entry, MR_TRUE, MR_TRUE, MR_FALSE);
 }
 
 void
-MR_print_proc_separate(FILE *fp, const MR_Proc_Layout *entry)
+MR_print_proc_separate(FILE *fp, const MR_ProcLayout *entry)
 {
     MR_print_proc_id_internal(fp, entry, MR_TRUE, MR_TRUE, MR_TRUE);
 }
 
 static void
-MR_print_proc_id_internal(FILE *fp, const MR_Proc_Layout *entry, MR_bool spec,
+MR_print_proc_id_internal(FILE *fp, const MR_ProcLayout *entry, MR_bool spec,
     MR_bool print_mode, MR_bool separate)
 {
-    const MR_User_Proc_Id *user;
-    const MR_UCI_Proc_Id  *uci;
+    const MR_UserProcId *user;
+    const MR_UCIProcId  *uci;
 
     if (! MR_PROC_LAYOUT_HAS_PROC_ID(entry)) {
         MR_fatal_error("cannot print procedure id without layout");
@@ -1418,7 +1417,7 @@
 
 void
 MR_print_proc_id_trace_and_context(FILE *fp, MR_bool include_trace_data,
-    MR_Context_Position pos, const MR_Proc_Layout *entry, MR_Word *base_sp,
+    MR_ContextPosition pos, const MR_ProcLayout *entry, MR_Word *base_sp,
     MR_Word *base_curfr, const char *path, const char *filename, int lineno,
     MR_bool print_parent, const char *parent_filename, int parent_lineno,
     int indent)
@@ -1493,7 +1492,7 @@
             break;
 
         default:
-            MR_fatal_error("invalid MR_Context_Position");
+            MR_fatal_error("invalid MR_ContextPosition");
     }
 }
 
@@ -1519,7 +1518,7 @@
 }
 
 static  MR_bool
-MR_call_details_are_valid(const MR_Proc_Layout *entry, MR_Word *base_sp, 
+MR_call_details_are_valid(const MR_ProcLayout *entry, MR_Word *base_sp,
     MR_Word *base_curfr)
 {
     if (MR_PROC_LAYOUT_HAS_EXEC_TRACE(entry)) {
@@ -1545,13 +1544,13 @@
 }
 
 static MR_bool
-MR_call_is_before_event_or_seq(MR_find_first_call_seq_or_event seq_or_event, 
-    MR_Unsigned seq_no_or_event_no, 
-    const MR_Proc_Layout *entry, MR_Word *base_sp, MR_Word *base_curfr)
+MR_call_is_before_event_or_seq(MR_FindFirstCallSeqOrEvent seq_or_event,
+    MR_Unsigned seq_no_or_event_no,
+    const MR_ProcLayout *entry, MR_Word *base_sp, MR_Word *base_curfr)
 {
     MR_Unsigned     call_event_num;
     MR_Unsigned     call_seq_num;
-    
+
     if (MR_DETISM_DET_STACK(entry->MR_sle_detism)) {
         if (base_sp == NULL) {
             return MR_FALSE;
@@ -1575,7 +1574,7 @@
         } else if (seq_or_event == MR_FIND_FIRST_CALL_BEFORE_SEQ) {
             return call_seq_num <= seq_no_or_event_no;
         } else {
-            MR_fatal_error("Unknown MR_find_first_call_seq_or_event");
+            MR_fatal_error("Unknown MR_FindFirstCallSeqOrEvent");
         }
     } else {
         return MR_FALSE;
@@ -1584,16 +1583,15 @@
 
 int
 MR_find_first_call_less_eq_seq_or_event(
-    MR_find_first_call_seq_or_event seq_or_event, 
-    MR_Unsigned seq_no_or_event_no, 
-    const MR_Label_Layout *label_layout, MR_Word *det_stack_pointer, 
-    MR_Word *current_frame, const char **problem)
-{
-    MR_Stack_Walk_Step_Result       result;
-    const MR_Label_Layout           *cur_label_layout;
-    MR_Word                         *stack_trace_sp;
-    MR_Word                         *stack_trace_curfr;
-    int                             ancestor_level;
+    MR_FindFirstCallSeqOrEvent seq_or_event,
+    MR_Unsigned seq_no_or_event_no, const MR_LabelLayout *label_layout,
+    MR_Word *det_stack_pointer, MR_Word *current_frame, const char **problem)
+{
+    MR_StackWalkStepResult  result;
+    const MR_LabelLayout    *cur_label_layout;
+    MR_Word                 *stack_trace_sp;
+    MR_Word                 *stack_trace_curfr;
+    int                     ancestor_level;
 
     MR_do_init_modules();
 
@@ -1603,21 +1601,20 @@
     cur_label_layout = label_layout;
 
     ancestor_level = 0;
-
     while (cur_label_layout != NULL) {
 
-        if (MR_call_is_before_event_or_seq(seq_or_event, seq_no_or_event_no, 
+        if (MR_call_is_before_event_or_seq(seq_or_event, seq_no_or_event_no,
                 cur_label_layout->MR_sll_entry, stack_trace_sp,
                 stack_trace_curfr)) {
             return ancestor_level;
         }
 
-        result = MR_stack_walk_step(cur_label_layout->MR_sll_entry, 
+        result = MR_stack_walk_step(cur_label_layout->MR_sll_entry,
             &cur_label_layout, &stack_trace_sp, &stack_trace_curfr, problem);
-        
+
         if (result != MR_STEP_OK) {
             return -1;
-        } 
+        }
 
         ancestor_level++;
 
Index: runtime/mercury_stack_trace.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_stack_trace.h,v
retrieving revision 1.38
diff -u -r1.38 mercury_stack_trace.h
--- runtime/mercury_stack_trace.h	21 Jun 2005 03:12:03 -0000	1.38
+++ runtime/mercury_stack_trace.h	26 Nov 2006 23:32:58 -0000
@@ -62,7 +62,7 @@
 */
 
 typedef	void		(*MR_Print_Stack_Record)(FILE *fp,
-				const MR_Proc_Layout *proc_layout,
+				const MR_ProcLayout *proc_layout,
 				int count, int level,
 				MR_Word *base_sp, MR_Word * base_curfr,
 				const char *filename, int linenumber,
@@ -70,7 +70,7 @@
 				MR_bool context_mismatch);
 
 extern	const char	*MR_dump_stack_from_layout(FILE *fp,
-				const MR_Label_Layout *label_layout,
+				const MR_LabelLayout *label_layout,
 				MR_Word *det_stack_pointer,
 				MR_Word *current_frame,
 				MR_bool include_trace_data,
@@ -101,7 +101,7 @@
 
 extern	void	MR_dump_nondet_stack_from_layout(FILE *fp,
 			MR_Word *limit_addr, int frame_limit, int line_limit,
-			MR_Word *maxfr, const MR_Label_Layout *label_layout,
+			MR_Word *maxfr, const MR_LabelLayout *label_layout,
 			MR_Word *base_sp, MR_Word *base_curfr);
 
 /*
@@ -112,11 +112,11 @@
 */
 
 typedef void MR_Traverse_Nondet_Frame_Func(void *user_data,
-			const MR_Label_Layout *layout, MR_Word *base_sp,
+			const MR_LabelLayout *layout, MR_Word *base_sp,
 			MR_Word *base_curfr);
 
 extern	void	MR_traverse_nondet_stack_from_layout(
-			MR_Word *maxfr, const MR_Label_Layout *label_layout,
+			MR_Word *maxfr, const MR_LabelLayout *label_layout,
 			MR_Word *base_sp, MR_Word *base_curfr,
 			MR_Traverse_Nondet_Frame_Func *traverse_frame_func,
 			void *traverse_frame_func_data);
@@ -137,8 +137,8 @@
 ** and problem will point to an error message.
 */
 
-extern	const MR_Label_Layout *MR_find_nth_ancestor(
-			const MR_Label_Layout *label_layout,
+extern	const MR_LabelLayout *MR_find_nth_ancestor(
+			const MR_LabelLayout *label_layout,
 			int ancestor_level, MR_Word **stack_trace_sp,
 			MR_Word **stack_trace_curfr, const char **problem);
 
@@ -175,11 +175,11 @@
 	MR_STEP_ERROR_BEFORE,
 	MR_STEP_ERROR_AFTER,
 	MR_STEP_OK
-} MR_Stack_Walk_Step_Result;
+} MR_StackWalkStepResult;
 
-extern  MR_Stack_Walk_Step_Result
-		MR_stack_walk_step(const MR_Proc_Layout *entry_layout,
-			const MR_Label_Layout **return_label_layout,
+extern  MR_StackWalkStepResult
+		MR_stack_walk_step(const MR_ProcLayout *entry_layout,
+			const MR_LabelLayout **return_label_layout,
 			MR_Word **stack_trace_sp_ptr,
 			MR_Word **stack_trace_curfr_ptr,
 			const char **problem_ptr);
@@ -216,7 +216,7 @@
 ** otherwise, it returns MR_FALSE.
 */
 
-extern	MR_bool	MR_find_context(const MR_Label_Layout *label,
+extern	MR_bool	MR_find_context(const MR_LabelLayout *label,
 			const char **fileptr, int *lineptr);
 
 /*
@@ -232,12 +232,12 @@
 */
 
 extern	void	MR_print_call_trace_info(FILE *fp,
-			const MR_Proc_Layout *entry,
+			const MR_ProcLayout *entry,
 			MR_Word *base_sp, MR_Word *base_curfr);
 
 extern	void	MR_maybe_print_call_trace_info(FILE *fp,
 			MR_bool include_trace_data,
-			const MR_Proc_Layout *entry,
+			const MR_ProcLayout *entry,
 			MR_Word *base_sp, MR_Word *base_curfr);
 
 /*
@@ -247,21 +247,21 @@
 ** the caller can put something else after the procedure id on the same line.
 */
 
-extern	void	MR_print_proc_id(FILE *fp, const MR_Proc_Layout *entry);
+extern	void	MR_print_proc_id(FILE *fp, const MR_ProcLayout *entry);
 
 /*
 ** MR_print_pred_id prints everything that MR_print_proc_id does, except
 ** the mode number and determinism.
 */
 
-extern	void	MR_print_pred_id(FILE *fp, const MR_Proc_Layout *entry);
+extern	void	MR_print_pred_id(FILE *fp, const MR_ProcLayout *entry);
 
 /*
 ** MR_print_proc_spec prints a string that uniquely specifies the given
 ** procedure to the debugger.
 */
 
-extern	void	MR_print_proc_spec(FILE *fp, const MR_Proc_Layout *entry);
+extern	void	MR_print_proc_spec(FILE *fp, const MR_ProcLayout *entry);
 
 /*
 ** MR_print_proc_separate prints a string that uniquely specifies the given
@@ -269,7 +269,7 @@
 ** to allow the output to be processed by tools (e.g. awk scripts).
 */
 
-extern	void	MR_print_proc_separate(FILE *fp, const MR_Proc_Layout *entry);
+extern	void	MR_print_proc_separate(FILE *fp, const MR_ProcLayout *entry);
 
 /*
 ** MR_print_proc_id_trace_and_context prints an identification of the given
@@ -284,11 +284,11 @@
 	MR_CONTEXT_AFTER,
 	MR_CONTEXT_PREVLINE,
 	MR_CONTEXT_NEXTLINE
-} MR_Context_Position;
+} MR_ContextPosition;
 
 extern	void	MR_print_proc_id_trace_and_context(FILE *fp,
-			MR_bool include_trace_data, MR_Context_Position pos,
-			const MR_Proc_Layout *entry,
+			MR_bool include_trace_data, MR_ContextPosition pos,
+			const MR_ProcLayout *entry,
 			MR_Word *base_sp, MR_Word *base_curfr,
 			const char *path, const char *filename, int lineno,
 			MR_bool print_parent, const char *parent_filename,
@@ -299,7 +299,7 @@
 */
 
 extern	void	MR_dump_stack_record_print(FILE *fp,
-			const MR_Proc_Layout *entry_layout, int count,
+			const MR_ProcLayout *entry_layout, int count,
 			int start_level, MR_Word *base_sp, MR_Word *base_curfr,
 			const char *filename, int linenumber,
 			const char *goal_path, MR_bool context_mismatch);
@@ -316,12 +316,12 @@
 typedef	enum {
 	MR_FIND_FIRST_CALL_BEFORE_SEQ,
 	MR_FIND_FIRST_CALL_BEFORE_EVENT
-} MR_find_first_call_seq_or_event;
+} MR_FindFirstCallSeqOrEvent;
 
 extern	int	MR_find_first_call_less_eq_seq_or_event(
-			MR_find_first_call_seq_or_event seq_or_event,
+			MR_FindFirstCallSeqOrEvent seq_or_event,
 			MR_Unsigned seq_no_or_event_no,
-			const MR_Label_Layout *label_layout,
+			const MR_LabelLayout *label_layout,
 			MR_Word *det_stack_pointer, MR_Word *current_frame,
 			const char **problem);
 
Index: runtime/mercury_tabling.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_tabling.c,v
retrieving revision 1.71
diff -u -r1.71 mercury_tabling.c
--- runtime/mercury_tabling.c	8 Jun 2006 08:20:00 -0000	1.71
+++ runtime/mercury_tabling.c	26 Nov 2006 01:09:11 -0000
@@ -985,7 +985,7 @@
 }
 
 void
-MR_print_loopcheck_tip(FILE *fp, const MR_Proc_Layout *proc, MR_TrieNode table)
+MR_print_loopcheck_tip(FILE *fp, const MR_ProcLayout *proc, MR_TrieNode table)
 {
     switch (table->MR_loop_status) {
         case MR_LOOP_INACTIVE:
@@ -1000,7 +1000,7 @@
 }
 
 void
-MR_print_memo_tip(FILE *fp, const MR_Proc_Layout *proc, MR_TrieNode table)
+MR_print_memo_tip(FILE *fp, const MR_ProcLayout *proc, MR_TrieNode table)
 {
     switch (table->MR_memo_status) {
         case MR_MEMO_INACTIVE:
@@ -1024,7 +1024,7 @@
 }
 
 void
-MR_print_memo_non_record(FILE *fp, const MR_Proc_Layout *proc,
+MR_print_memo_non_record(FILE *fp, const MR_ProcLayout *proc,
     MR_MemoNonRecordPtr record)
 {
     MR_AnswerList   answer_list;
@@ -1065,7 +1065,7 @@
 }
 
 void
-MR_print_answerblock(FILE *fp, const MR_Proc_Layout *proc,
+MR_print_answerblock(FILE *fp, const MR_ProcLayout *proc,
     MR_Word *answer_block)
 {
     const MR_PseudoTypeInfo *ptis;
Index: runtime/mercury_tabling.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_tabling.h,v
retrieving revision 1.41
diff -u -r1.41 mercury_tabling.h
--- runtime/mercury_tabling.h	8 Jun 2006 08:20:00 -0000	1.41
+++ runtime/mercury_tabling.h	26 Nov 2006 23:32:58 -0000
@@ -180,7 +180,7 @@
 **
 ** To enable debugging (especially performance debugging) of tabled predicates,
 ** the compiler generates one of these structures for each tabled predicate
-** (except I/O primitives, for which it generates an MR_Table_Io_Decl
+** (except I/O primitives, for which it generates an MR_TableIoDecl
 ** structure).
 **
 ** Each argument of a tabled predicate is an input or an output. Inputs are put
@@ -295,7 +295,7 @@
 	const MR_TableTrieStep		*MR_pt_output_steps;
 	const MR_Integer		*MR_pt_output_enum_params;
 	const MR_PseudoTypeInfo		*MR_pt_ptis;
-	const MR_Type_Param_Locns	*MR_pt_type_params;
+	const MR_TypeParamLocns		*MR_pt_type_params;
 
 	MR_TableNode			MR_pt_tablenode;
 
@@ -326,7 +326,7 @@
 	const MR_TableTrieStep		*MR_table_gen_input_steps;
 	const MR_Integer		*MR_table_gen_enum_params;
 	const MR_PseudoTypeInfo		*MR_table_gen_ptis;
-	const MR_Type_Param_Locns	*MR_table_gen_type_params;
+	const MR_TypeParamLocns		*MR_table_gen_type_params;
 } MR_Table_Gen;
 
 /*---------------------------------------------------------------------------*/
@@ -490,11 +490,11 @@
 */
 
 extern	void		MR_print_loopcheck_tip(FILE *fp,
-				const MR_Proc_Layout *proc, MR_TrieNode table);
+				const MR_ProcLayout *proc, MR_TrieNode table);
 extern	void		MR_print_memo_tip(FILE *fp,
-				const MR_Proc_Layout *proc, MR_TrieNode table);
+				const MR_ProcLayout *proc, MR_TrieNode table);
 extern	void		MR_print_memo_non_record(FILE *fp,
-				const MR_Proc_Layout *proc,
+				const MR_ProcLayout *proc,
 				MR_MemoNonRecordPtr record);
 
 /*
@@ -502,7 +502,7 @@
 */
 
 extern	void		MR_print_answerblock(FILE *fp,
-				const MR_Proc_Layout *proc,
+				const MR_ProcLayout *proc,
 				MR_Word *answer_block);
 
 /*---------------------------------------------------------------------------*/
@@ -637,7 +637,7 @@
 #include "mercury_tabling_macros.h"
 #include "mercury_tabling_preds.h"
 
-#include "mercury_stack_layout.h"	/* for MR_Proc_Layout and */
-					/* MR_Type_Param_Locns */
+#include "mercury_stack_layout.h"	/* for MR_ProcLayout and */
+					/* MR_TypeParamLocns */
 
 #endif	/* not MERCURY_TABLING_H */
Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.78
diff -u -r1.78 mercury_trace_base.c
--- runtime/mercury_trace_base.c	28 Nov 2006 06:57:42 -0000	1.78
+++ runtime/mercury_trace_base.c	29 Nov 2006 04:57:54 -0000
@@ -59,7 +59,7 @@
 MR_bool             MR_debug_enabled = MR_FALSE;
 MR_bool             MR_trace_func_enabled = MR_FALSE;
 MR_Code             *(*volatile MR_selected_trace_func_ptr)(
-                        const MR_Label_Layout *);
+                        const MR_LabelLayout *);
 MR_Unsigned         MR_trace_call_seqno = 0;
 MR_Unsigned         MR_trace_call_depth = 0;
 MR_Unsigned         MR_trace_event_number = 0;
@@ -137,7 +137,7 @@
 */
 
 MR_Code *
-MR_trace(const MR_Label_Layout *layout)
+MR_trace(const MR_LabelLayout *layout)
 {
     if (! MR_trace_func_enabled) {
         return NULL;
@@ -147,7 +147,7 @@
 }
 
 MR_Code *
-MR_user_trace(const MR_Label_Layout *layout)
+MR_user_trace(const MR_LabelLayout *layout)
 {
     if (! MR_trace_func_enabled) {
         return NULL;
@@ -172,7 +172,7 @@
 }
 
 MR_Code *
-MR_trace_fake(const MR_Label_Layout *layout)
+MR_trace_fake(const MR_LabelLayout *layout)
 {
     MR_tracing_not_enabled();
     /*NOTREACHED*/
@@ -180,7 +180,7 @@
 }
 
 MR_Code *
-MR_trace_count(const MR_Label_Layout *label_layout)
+MR_trace_count(const MR_LabelLayout *label_layout)
 {
     MR_Unsigned     *exec_count;
 
@@ -188,10 +188,10 @@
 
 #ifdef  MR_TRACE_COUNT_DEBUG
     {
-        const MR_Label_Layout   *call_label_layout;
+        const MR_LabelLayout    *call_label_layout;
         MR_uint_least16_t       call_label_number;
-        const MR_Module_Layout  *module_layout;
-        const MR_Proc_Layout    *proc_layout;
+        const MR_ModuleLayout   *module_layout;
+        const MR_ProcLayout     *proc_layout;
 
         proc_layout = label_layout->MR_sll_entry;
         module_layout = proc_layout->MR_sle_module_layout;
@@ -222,10 +222,10 @@
 }
 
 MR_Unsigned *
-MR_trace_lookup_trace_count(const MR_Label_Layout *label_layout)
+MR_trace_lookup_trace_count(const MR_LabelLayout *label_layout)
 {
-    const MR_Module_Layout  *module_layout;
-    const MR_Proc_Layout    *proc_layout;
+    const MR_ModuleLayout   *module_layout;
+    const MR_ProcLayout     *proc_layout;
     MR_uint_least16_t       label_number;
 
     proc_layout = label_layout->MR_sll_entry;
@@ -244,16 +244,16 @@
 
 #define INIT_MODULE_TABLE_SIZE  10
 
-const MR_Module_Layout  **MR_module_infos;
+const MR_ModuleLayout   **MR_module_infos;
 unsigned                MR_module_info_next = 0;
 unsigned                MR_module_info_max  = 0;
 
 void
-MR_insert_module_info_into_module_table(const MR_Module_Layout *module)
+MR_insert_module_info_into_module_table(const MR_ModuleLayout *module)
 {
     int     slot;
 
-    MR_GC_ensure_room_for_next(MR_module_info, const MR_Module_Layout *,
+    MR_GC_ensure_room_for_next(MR_module_info, const MR_ModuleLayout *,
         INIT_MODULE_TABLE_SIZE);
     MR_prepare_insert_into_sorted(MR_module_infos, MR_module_info_next, slot,
         strcmp(MR_module_infos[slot]->MR_ml_name, module->MR_ml_name));
@@ -264,8 +264,8 @@
 static  void        MR_trace_write_quoted_atom(FILE *fp, const char *atom);
 static  void        MR_trace_write_string(FILE *fp, const char *atom);
 static  unsigned    MR_trace_write_label_exec_counts_for_file(FILE *fp,
-                        const MR_Module_Layout *module,
-                        const MR_Module_File_Layout *file,
+                        const MR_ModuleLayout *module,
+                        const MR_ModuleFileLayout *file,
                         const char *module_name,
                         MR_bool coverage_test);
 
@@ -457,8 +457,8 @@
 MR_trace_write_label_exec_counts(FILE *fp, const char *progname,
     MR_bool coverage_test)
 {
-    const MR_Module_Layout      *module;
-    const MR_Module_File_Layout *file;
+    const MR_ModuleLayout       *module;
+    const MR_ModuleFileLayout   *file;
     int                         num_modules;
     int                         num_files;
     int                         module_num;
@@ -500,14 +500,14 @@
 
 static unsigned
 MR_trace_write_label_exec_counts_for_file(FILE *fp,
-    const MR_Module_Layout *module, const MR_Module_File_Layout *file,
+    const MR_ModuleLayout *module, const MR_ModuleFileLayout *file,
     const char *module_name, MR_bool coverage_test)
 {
-    const MR_Label_Layout       *label;
-    const MR_Proc_Layout        *prev_proc;
-    const MR_Proc_Layout        *proc;
-    const MR_User_Proc_Id       *id;
-    MR_Trace_Port               port;
+    const MR_LabelLayout        *label;
+    const MR_ProcLayout         *prev_proc;
+    const MR_ProcLayout         *proc;
+    const MR_UserProcId         *id;
+    MR_TracePort                port;
     int                         num_labels;
     int                         label_num;
     int                         label_index;
@@ -612,7 +612,7 @@
     MR_do_init_modules_debugger();
 
     if (! done) {
-        MR_Trace_Port   port;
+        MR_TracePort    port;
 
         for (port = MR_PORT_CALL; port <= MR_PORT_NONE; port++) {
             MR_named_count_port[port] = PATH_ONLY;
@@ -995,8 +995,8 @@
 MR_trace_get_action(int action_number, MR_ConstString *proc_name_ptr,
     MR_Word *is_func_ptr, MR_Word *arg_list_ptr)
 {
-    const MR_Table_Io_Decl  *table_io_decl;
-    const MR_Proc_Layout    *proc_layout;
+    const MR_TableIoDecl    *table_io_decl;
+    const MR_ProcLayout     *proc_layout;
     MR_ConstString          proc_name;
     MR_Word                 is_func;
     MR_Word                 arg_list;
@@ -1024,7 +1024,7 @@
         return MR_FALSE;
     }
 
-    table_io_decl = (const MR_Table_Io_Decl *) answer_block[0];
+    table_io_decl = (const MR_TableIoDecl *) answer_block[0];
     proc_layout = table_io_decl->MR_table_io_decl_proc;
     filtered_arity = table_io_decl->MR_table_io_decl_filtered_arity;
 
@@ -1158,7 +1158,7 @@
 #define MR_IO_TABLE_STATS_HASH_TABLE_SIZE 1024
 
 typedef struct {
-    const MR_Proc_Layout    *MR_io_tabling_stats_proc;
+    const MR_ProcLayout     *MR_io_tabling_stats_proc;
     MR_Unsigned             MR_io_tabling_stats_count;
 } MR_IO_Table_Stats_Hash_Record;
 
@@ -1178,7 +1178,7 @@
 static MR_bool
 MR_equal_proc_layout(const void *proc1, const void *proc2)
 {
-    return (const MR_Proc_Layout *) proc1 == (const MR_Proc_Layout *) proc2;
+    return (const MR_ProcLayout *) proc1 == (const MR_ProcLayout *) proc2;
 }
 
 static MR_Hash_Table MR_io_tabling_stats_table = {
@@ -1222,8 +1222,8 @@
 void
 MR_io_tabling_stats(FILE *fp)
 {
-    const MR_Table_Io_Decl          *table_io_decl;
-    const MR_Proc_Layout            *proc_layout;
+    const MR_TableIoDecl            *table_io_decl;
+    const MR_ProcLayout             *proc_layout;
     MR_ConstString                  proc_name;
     int                             arity;
     MR_Word                         is_func;
@@ -1259,7 +1259,7 @@
             continue;
         }
 
-        table_io_decl = (const MR_Table_Io_Decl *) answer_block[0];
+        table_io_decl = (const MR_TableIoDecl *) answer_block[0];
         proc_layout = table_io_decl->MR_table_io_decl_proc;
 
         hash_record = MR_lookup_hash_table(hash_table, proc_layout);
@@ -1315,9 +1315,9 @@
 #define PROC_REP_TABLE_SIZE (1 << 16)   /* 64k */
 
 typedef struct {
-    const MR_Proc_Layout    *plr_layout;
+    const MR_ProcLayout     *plr_layout;
     MR_Word                 plr_rep;
-} MR_Proc_Layout_Rep;
+} MR_ProcLayout_Rep;
 
 static  void                MR_do_init_proc_rep_table(void);
 static  const void          *proc_layout_rep_key(const void *proc_layout);
@@ -1341,13 +1341,13 @@
 }
 
 void
-MR_insert_proc_rep(const MR_Proc_Layout *proc_layout, MR_Word proc_rep)
+MR_insert_proc_rep(const MR_ProcLayout *proc_layout, MR_Word proc_rep)
 {
-    MR_Proc_Layout_Rep  *layout_rep;
+    MR_ProcLayout_Rep  *layout_rep;
 
     MR_do_init_proc_rep_table();
 
-    layout_rep = MR_GC_NEW(MR_Proc_Layout_Rep);
+    layout_rep = MR_GC_NEW(MR_ProcLayout_Rep);
     layout_rep->plr_layout = proc_layout;
     layout_rep->plr_rep = proc_rep;
 
@@ -1362,9 +1362,9 @@
 }
 
 MR_Word
-MR_lookup_proc_rep(const MR_Proc_Layout *proc_layout)
+MR_lookup_proc_rep(const MR_ProcLayout *proc_layout)
 {
-    const MR_Proc_Layout_Rep  *layout_rep;
+    const MR_ProcLayout_Rep  *layout_rep;
 
     MR_do_init_proc_rep_table();
 
@@ -1392,9 +1392,9 @@
 static const void *
 proc_layout_rep_key(const void *pair)
 {
-    MR_Proc_Layout_Rep  *proc_layout_rep;
+    MR_ProcLayout_Rep   *proc_layout_rep;
 
-    proc_layout_rep = (MR_Proc_Layout_Rep *) pair;
+    proc_layout_rep = (MR_ProcLayout_Rep *) pair;
     if (proc_layout_rep == NULL) {
         return NULL;
     } else {
@@ -1411,8 +1411,7 @@
 static MR_bool
 equal_proc_layouts(const void *addr1, const void *addr2)
 {
-    return ((const MR_Proc_Layout *) addr1) ==
-        ((const MR_Proc_Layout *) addr2);
+    return ((const MR_ProcLayout *) addr1) == ((const MR_ProcLayout *) addr2);
 }
 
 /**************************************************************************/
@@ -1441,7 +1440,7 @@
     {
         MR_Code *MR_jumpaddr;
         MR_save_transient_registers();
-        MR_jumpaddr = MR_trace((const MR_Label_Layout *)
+        MR_jumpaddr = MR_trace((const MR_LabelLayout *)
             MR_redo_layout_framevar(MR_redofr_slot(MR_curfr)));
         MR_restore_transient_registers();
         if (MR_jumpaddr != NULL) {
@@ -1468,7 +1467,7 @@
         MR_Code *MR_jumpaddr;
 
         MR_save_transient_registers();
-        MR_jumpaddr = MR_trace((const MR_Label_Layout *)
+        MR_jumpaddr = MR_trace((const MR_LabelLayout *)
             MR_redo_layout_framevar(MR_redofr_slot(MR_curfr)));
         MR_restore_transient_registers();
         if (MR_jumpaddr != NULL) {
Index: runtime/mercury_trace_base.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_trace_base.h,v
retrieving revision 1.56
diff -u -r1.56 mercury_trace_base.h
--- runtime/mercury_trace_base.h	24 Nov 2006 03:48:18 -0000	1.56
+++ runtime/mercury_trace_base.h	26 Nov 2006 23:32:58 -0000
@@ -48,7 +48,7 @@
 	MR_PORT_PRAGMA_LATER,
 	MR_PORT_USER,
 	MR_PORT_NONE
-} MR_Trace_Port;
+} MR_TracePort;
 
 /*
 ** The following array says if a label inside a procedure is
@@ -98,11 +98,11 @@
 ** after the event. (NULL means it should continue as usual.)
 */
 
-extern	MR_Code	*MR_trace(const MR_Label_Layout *);
-extern	MR_Code	*MR_trace_fake(const MR_Label_Layout *);
-extern	MR_Code	*MR_trace_count(const MR_Label_Layout *);
+extern	MR_Code	*MR_trace(const MR_LabelLayout *);
+extern	MR_Code	*MR_trace_fake(const MR_LabelLayout *);
+extern	MR_Code	*MR_trace_count(const MR_LabelLayout *);
 
-extern	MR_Code	*MR_user_trace(const MR_Label_Layout *);
+extern	MR_Code	*MR_user_trace(const MR_LabelLayout *);
 
 /*
 ** These three variables implement a table of module layout structures,
@@ -111,12 +111,12 @@
 ** Insertions are handled by MR_insert_module_info_into_module_table.
 */
 
-extern	const MR_Module_Layout	**MR_module_infos;
+extern	const MR_ModuleLayout	**MR_module_infos;
 extern	unsigned		MR_module_info_next;
 extern	unsigned		MR_module_info_max;
 
 extern	void	MR_insert_module_info_into_module_table(
-			const MR_Module_Layout *module_layout);
+			const MR_ModuleLayout *module_layout);
 
 /*
 ** For every label reachable from the module table, write the id of the label
@@ -283,7 +283,7 @@
 */
 
 extern	MR_Code 	*(*volatile MR_selected_trace_func_ptr)(
-				const MR_Label_Layout *);
+				const MR_LabelLayout *);
 
 /*
 ** MR_trace_call_seqno counts distinct calls. The prologue of every
@@ -517,7 +517,7 @@
 */
 
 extern	MR_Unsigned *MR_trace_lookup_trace_count(
-	const MR_Label_Layout *label_layout);
+	const MR_LabelLayout *label_layout);
 
 /*
 ** If MR_TRACE_HISTOGRAM is defined, MR_trace maintains two arrays of integers,
@@ -566,9 +566,9 @@
 ** a zero return value means that the answer is "no".
 */
 
-extern	void	MR_insert_proc_rep(const MR_Proc_Layout *proc_layout,
+extern	void	MR_insert_proc_rep(const MR_ProcLayout *proc_layout,
 		MR_Word proc_rep);
-extern	MR_Word MR_lookup_proc_rep(const MR_Proc_Layout *proc_layout);
+extern	MR_Word MR_lookup_proc_rep(const MR_ProcLayout *proc_layout);
 
 #ifndef	MR_HIGHLEVEL_CODE
 
@@ -585,7 +585,7 @@
 	{								\
 		MR_Code *MR_jumpaddr;					\
 		MR_save_transient_registers();				\
-		MR_jumpaddr = MR_trace((const MR_Label_Layout *)	\
+		MR_jumpaddr = MR_trace((const MR_LabelLayout *)	\
 			&MR_LABEL_LAYOUT_NAME(MR_add_prefix(label)));	\
 		MR_restore_transient_registers();			\
 		if (MR_jumpaddr != NULL) MR_GOTO(MR_jumpaddr);		\
@@ -599,7 +599,7 @@
 	{								\
 		MR_Code *MR_jumpaddr;					\
 		MR_save_transient_registers();				\
-		MR_jumpaddr = MR_user_trace((const MR_Label_Layout *)	\
+		MR_jumpaddr = MR_user_trace((const MR_LabelLayout *)	\
 			&MR_LABEL_LAYOUT_NAME(MR_add_prefix(label)));	\
 		MR_restore_transient_registers();			\
 		if (MR_jumpaddr != NULL) MR_GOTO(MR_jumpaddr);		\
Index: runtime/mercury_types.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_types.h,v
retrieving revision 1.46
diff -u -r1.46 mercury_types.h
--- runtime/mercury_types.h	24 Nov 2006 03:48:19 -0000	1.46
+++ runtime/mercury_types.h	26 Nov 2006 23:32:58 -0000
@@ -208,16 +208,16 @@
 typedef struct MR_Closure_Struct                MR_Closure;
 typedef const MR_Closure                        *MR_ClosurePtr;
 
-typedef struct MR_Closure_Id_Struct             MR_Closure_Id;
-typedef struct MR_User_Closure_Id_Struct        MR_User_Closure_Id;
-typedef struct MR_UCI_Closure_Id_Struct         MR_UCI_Closure_Id;
-
-typedef struct MR_Type_Param_Locns_Struct       MR_Type_Param_Locns;
-
-typedef struct MR_User_Proc_Id_Struct           MR_User_Proc_Id;
-typedef struct MR_UCI_Proc_Id_Struct            MR_UCI_Proc_Id;
-typedef struct MR_No_Proc_Id_Struct             MR_No_Proc_Id;
-typedef union  MR_Proc_Id_Union                 MR_Proc_Id;
+typedef struct MR_ClosureId_Struct             MR_ClosureId;
+typedef struct MR_UserClosureId_Struct        MR_UserClosureId;
+typedef struct MR_UCIClosureId_Struct         MR_UCIClosureId;
+
+typedef struct MR_TypeParamLocns_Struct       MR_TypeParamLocns;
+
+typedef struct MR_UserProcId_Struct           MR_UserProcId;
+typedef struct MR_UCIProcId_Struct            MR_UCIProcId;
+typedef struct MR_NoProcId_Struct             MR_NoProcId;
+typedef union  MR_ProcId_Union                 MR_ProcId;
 
 typedef struct MR_CallSiteStatic_Struct         MR_CallSiteStatic;
 typedef struct MR_CallSiteDynamic_Struct        MR_CallSiteDynamic;
@@ -229,10 +229,10 @@
 
 typedef struct MR_CallSiteDynList_Struct        MR_CallSiteDynList;
 
-typedef struct MR_Long_Lval_Struct              MR_Long_Lval;
-typedef struct MR_Proc_Layout_Struct            MR_Proc_Layout;
-typedef struct MR_Module_Layout_Struct          MR_Module_Layout;
-typedef struct MR_Label_Layout_Struct           MR_Label_Layout;
+typedef struct MR_LongLval_Struct              MR_LongLval;
+typedef struct MR_ProcLayout_Struct            MR_ProcLayout;
+typedef struct MR_ModuleLayout_Struct          MR_ModuleLayout;
+typedef struct MR_LabelLayout_Struct           MR_LabelLayout;
 typedef struct MR_UserEvent_Struct              MR_UserEvent;
 
 typedef union MR_TableNode_Union                MR_TableNode;
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.172
diff -u -r1.172 mercury_wrapper.c
--- runtime/mercury_wrapper.c	7 Nov 2006 03:39:31 -0000	1.172
+++ runtime/mercury_wrapper.c	26 Nov 2006 01:09:11 -0000
@@ -384,7 +384,7 @@
 char        *(*MR_address_of_trace_getline)(const char *, FILE *, FILE *);
 char        *(*MR_address_of_trace_get_command)(const char *, FILE *, FILE *);
 const char  *(*MR_address_of_trace_browse_all_on_level)(FILE *,
-                const MR_Label_Layout *, MR_Word *, MR_Word *, int, MR_bool);
+                const MR_LabelLayout *, MR_Word *, MR_Word *, int, MR_bool);
 
 #ifdef  MR_USE_EXTERNAL_DEBUGGER
 void        (*MR_address_of_trace_init_external)(void);
@@ -427,11 +427,11 @@
 void        (*MR_DI_read_request_from_socket)(MR_Word, MR_Word *,
                 MR_Integer *);
 
-MR_Code     *(*MR_exec_trace_func_ptr)(const MR_Label_Layout *);
+MR_Code     *(*MR_exec_trace_func_ptr)(const MR_LabelLayout *);
 
 void        (*MR_address_of_trace_interrupt_handler)(void);
 
-void        (*MR_register_module_layout)(const MR_Module_Layout *);
+void        (*MR_register_module_layout)(const MR_ModuleLayout *);
 
 #ifdef  MR_RECORD_TERM_SIZES
 MR_ComplexityProc   *MR_complexity_procs;
Index: runtime/mercury_wrapper.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_wrapper.h,v
retrieving revision 1.77
diff -u -r1.77 mercury_wrapper.h
--- runtime/mercury_wrapper.h	1 Nov 2006 02:31:15 -0000	1.77
+++ runtime/mercury_wrapper.h	26 Nov 2006 23:32:58 -0000
@@ -15,7 +15,7 @@
 #include "mercury_regs.h"		/* needs to come first */
 #include <stddef.h>			/* for `size_t' */
 #include "mercury_std.h"		/* for `MR_bool' */
-#include "mercury_stack_layout.h"	/* for `MR_Label_Layout' etc */
+#include "mercury_stack_layout.h"	/* for `MR_LabelLayout' etc */
 #include "mercury_trace_base.h"		/* for `MR_trace_port' */
 #include "mercury_stacks.h"		/* for `MR_{Cut,Generator}StackFrame' */
 #include "mercury_type_info.h"		/* for `MR_TypeCtorInfo' */
@@ -131,7 +131,7 @@
 */
 
 extern	const char *	(*MR_address_of_trace_browse_all_on_level)(FILE *,
-				const MR_Label_Layout *, MR_Word *, MR_Word *,
+				const MR_LabelLayout *, MR_Word *, MR_Word *,
 				int, MR_bool);
 
 /*
@@ -152,7 +152,7 @@
 ** file.
 */
 
-extern	MR_Code		*(*MR_exec_trace_func_ptr)(const MR_Label_Layout *);
+extern	MR_Code		*(*MR_exec_trace_func_ptr)(const MR_LabelLayout *);
 
 /*
 ** If the init file was built with tracing enabled, then
@@ -168,7 +168,7 @@
 ** otherwise it is NULL.
 */
 
-extern	void		(*MR_register_module_layout)(const MR_Module_Layout *);
+extern	void		(*MR_register_module_layout)(const MR_ModuleLayout *);
 
 /*
 ** These global variables have their values defined in the program's _init.c
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
Index: slice/.mgnuc_opts
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/slice/.mgnuc_opts,v
retrieving revision 1.2
diff -u -r1.2 .mgnuc_opts
--- slice/.mgnuc_opts	22 Sep 2006 03:50:47 -0000	1.2
+++ slice/.mgnuc_opts	26 Nov 2006 23:52:19 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.99
diff -u -r1.99 mercury_trace.c
--- trace/mercury_trace.c	24 Nov 2006 03:48:26 -0000	1.99
+++ trace/mercury_trace.c	26 Nov 2006 23:06:06 -0000
@@ -56,7 +56,7 @@
 
 #include <stdio.h>
 
-MR_Trace_Cmd_Info   MR_trace_ctrl = {
+MR_TraceCmdInfo MR_trace_ctrl = {
     MR_CMD_GOTO,
     0,                      /* stop depth */
     0,                      /* stop event */
@@ -69,42 +69,42 @@
     NULL                    /* pointer to filter/4 for collect queries */
 };
 
-MR_Code             *MR_trace_real(const MR_Label_Layout *layout);
-static  MR_Code     *MR_trace_event(MR_Trace_Cmd_Info *cmd,
-                        MR_bool interactive, const MR_Label_Layout *layout,
-                        MR_Trace_Port port, MR_Unsigned seqno,
+MR_Code             *MR_trace_real(const MR_LabelLayout *layout);
+static  MR_Code     *MR_trace_event(MR_TraceCmdInfo *cmd,
+                        MR_bool interactive, const MR_LabelLayout *layout,
+                        MR_TracePort port, MR_Unsigned seqno,
                         MR_Unsigned depth);
-static  MR_bool     MR_in_traced_region(const MR_Proc_Layout *proc_layout,
+static  MR_bool     MR_in_traced_region(const MR_ProcLayout *proc_layout,
                         MR_Word *base_sp, MR_Word *base_curfr);
 static  MR_bool     MR_is_io_state(MR_TypeInfoParams type_params,
                         MR_PseudoTypeInfo pti);
-static  MR_bool     MR_find_saved_io_counter(const MR_Label_Layout *call_label,
+static  MR_bool     MR_find_saved_io_counter(const MR_LabelLayout *call_label,
                         MR_Word *base_sp, MR_Word *base_curfr,
                         MR_Unsigned *saved_io_counter_ptr);
 static  MR_bool     MR_retry_within_io_tabled_region(MR_bool all_actions_tabled,
                         MR_Unsigned retry_event_num, MR_Unsigned cur_event_num);
-static  const MR_Label_Layout
-                    *MR_unwind_stacks_for_retry(const MR_Label_Layout
+static  const MR_LabelLayout
+                    *MR_unwind_stacks_for_retry(const MR_LabelLayout
                         *top_layout, int ancestor_level, MR_Word **base_sp_ptr,
                         MR_Word **base_curfr_ptr, MR_Word **base_maxfr_ptr,
                         const char **problem);
-static  const char  *MR_undo_updates_of_maxfr(const MR_Proc_Layout
+static  const char  *MR_undo_updates_of_maxfr(const MR_ProcLayout
                         *level_layout, MR_Word *base_sp, MR_Word *base_curfr,
                         MR_Word **maxfr_ptr);
-static  MR_Word     MR_trace_find_input_arg(const MR_Label_Layout *label,
+static  MR_Word     MR_trace_find_input_arg(const MR_LabelLayout *label,
                         MR_Word *saved_regs, MR_Word *base_sp,
                         MR_Word *base_curfr, MR_uint_least16_t var_num,
                         MR_bool *succeeded);
 
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
-static  MR_Retry_Result
-                    MR_check_minimal_model_calls(MR_Event_Info *event_info,
+static  MR_RetryResult
+                    MR_check_minimal_model_calls(MR_EventInfo *event_info,
                         int ancestor_level, MR_Word *target_maxfr,
                         const char **problem);
 #endif
 
 static  void        MR_init_call_table_array(void);
-static  void        MR_maybe_record_call_table(const MR_Proc_Layout
+static  void        MR_maybe_record_call_table(const MR_ProcLayout
                         *level_layout, MR_Word *base_sp, MR_Word *base_curfr);
 static  void        MR_reset_call_table_array(void);
 static  void        MR_abandon_call_table_array(void);
@@ -126,7 +126,7 @@
 
 #if defined(MR_USE_MINIMAL_MODEL_STACK_COPY) && defined(MR_MINIMAL_MODEL_DEBUG)
   #define MR_TRACE_SETUP_MAYBE_SAVE_SUBGOAL_CUR_PROC                          \
-        if ((MR_Trace_Port) layout->MR_sll_port == MR_PORT_CALL) {            \
+        if ((MR_TracePort) layout->MR_sll_port == MR_PORT_CALL) {            \
             MR_subgoal_debug_cur_proc = layout->MR_sll_entry;                 \
         }
 #else
@@ -165,14 +165,14 @@
     } while (0)
 
 MR_Code *
-MR_trace_real(const MR_Label_Layout *layout)
+MR_trace_real(const MR_LabelLayout *layout)
 {
     MR_Integer          maybe_from_full;
     MR_Unsigned         seqno;
     MR_Unsigned         depth;
-    MR_Spy_Action       action;
+    MR_SpyAction        action;
     MR_bool             match;
-    MR_Trace_Port       port;
+    MR_TracePort        port;
 
     MR_TRACE_REAL_SETUP_CODE();
 
@@ -200,14 +200,14 @@
         case MR_CMD_COLLECT:
           {
 #ifdef MR_USE_EXTERNAL_DEBUGGER
-            MR_Event_Info   event_info;
+            MR_EventInfo    event_info;
             MR_Word         *saved_regs = event_info.MR_saved_regs;
             const char      *path;
             MR_bool         stop_collecting = MR_FALSE;
             int             lineno = 0;
 
             MR_compute_max_mr_num(event_info.MR_max_mr_num, layout);
-            port = (MR_Trace_Port) layout->MR_sll_port;
+            port = (MR_TracePort) layout->MR_sll_port;
             path = MR_label_goal_path(layout);
             MR_copy_regs_to_saved_regs(event_info.MR_max_mr_num, saved_regs);
             MR_trace_init_point_vars(layout, saved_regs, port, MR_FALSE);
@@ -231,7 +231,7 @@
 
         case MR_CMD_GOTO:
             if (MR_trace_event_number >= MR_trace_ctrl.MR_trace_stop_event) {
-                port = (MR_Trace_Port) layout->MR_sll_port;
+                port = (MR_TracePort) layout->MR_sll_port;
                 return MR_trace_event(&MR_trace_ctrl, MR_TRUE, layout, port,
                     seqno, depth);
             } else {
@@ -242,7 +242,7 @@
             if (MR_trace_ctrl.MR_trace_stop_depth != depth) {
                 goto check_stop_print;
             } else {
-                port = (MR_Trace_Port) layout->MR_sll_port;
+                port = (MR_TracePort) layout->MR_sll_port;
                 return MR_trace_event(&MR_trace_ctrl, MR_TRUE, layout, port,
                     seqno, depth);
             }
@@ -251,7 +251,7 @@
             if (MR_trace_ctrl.MR_trace_stop_depth != depth) {
                 goto check_stop_print;
             } else {
-                port = (MR_Trace_Port) layout->MR_sll_port;
+                port = (MR_TracePort) layout->MR_sll_port;
 
                 if (! MR_port_is_final(port)) {
                     goto check_stop_print;
@@ -265,7 +265,7 @@
             if (MR_trace_ctrl.MR_trace_stop_depth != depth) {
                 goto check_stop_print;
             } else {
-                port = (MR_Trace_Port) layout->MR_sll_port;
+                port = (MR_TracePort) layout->MR_sll_port;
 
                 if (port == MR_PORT_FAIL || port == MR_PORT_EXCEPTION) {
                     return MR_trace_event(&MR_trace_ctrl, MR_TRUE, layout,
@@ -276,7 +276,7 @@
             }
 
         case MR_CMD_RESUME_FORWARD:
-            port = (MR_Trace_Port) layout->MR_sll_port;
+            port = (MR_TracePort) layout->MR_sll_port;
             if (port != MR_PORT_REDO &&
                 port != MR_PORT_FAIL &&
                 port != MR_PORT_EXCEPTION)
@@ -288,7 +288,7 @@
             }
 
         case MR_CMD_EXCP:
-            port = (MR_Trace_Port) layout->MR_sll_port;
+            port = (MR_TracePort) layout->MR_sll_port;
             if (port == MR_PORT_EXCEPTION) {
                 return MR_trace_event(&MR_trace_ctrl, MR_TRUE, layout, port,
                     seqno, depth);
@@ -297,7 +297,7 @@
             }
 
         case MR_CMD_RETURN:
-            port = (MR_Trace_Port) layout->MR_sll_port;
+            port = (MR_TracePort) layout->MR_sll_port;
             if (port != MR_PORT_EXIT) {
                 return MR_trace_event(&MR_trace_ctrl, MR_TRUE, layout, port,
                     seqno, depth);
@@ -306,7 +306,7 @@
             }
 
         case MR_CMD_USER:
-            port = (MR_Trace_Port) layout->MR_sll_port;
+            port = (MR_TracePort) layout->MR_sll_port;
             if (port == MR_PORT_USER) {
                 return MR_trace_event(&MR_trace_ctrl, MR_TRUE, layout, port,
                     seqno, depth);
@@ -316,7 +316,7 @@
 
         case MR_CMD_MIN_DEPTH:
             if (MR_trace_ctrl.MR_trace_stop_depth <= depth) {
-                port = (MR_Trace_Port) layout->MR_sll_port;
+                port = (MR_TracePort) layout->MR_sll_port;
                 return MR_trace_event(&MR_trace_ctrl, MR_TRUE, layout, port,
                     seqno, depth);
             } else {
@@ -325,7 +325,7 @@
 
         case MR_CMD_MAX_DEPTH:
             if (MR_trace_ctrl.MR_trace_stop_depth >= depth) {
-                port = (MR_Trace_Port) layout->MR_sll_port;
+                port = (MR_TracePort) layout->MR_sll_port;
                 return MR_trace_event(&MR_trace_ctrl, MR_TRUE, layout, port,
                     seqno, depth);
             } else {
@@ -360,7 +360,7 @@
         ** that MR_trace_must_check is false.
         */
 
-        port = (MR_Trace_Port) layout->MR_sll_port;
+        port = (MR_TracePort) layout->MR_sll_port;
 
 #ifdef  MR_TRACE_CHECK_INTEGRITY
         if (MR_trace_ctrl.MR_trace_check_integrity) {
@@ -379,7 +379,7 @@
             ** here is only to find out if we want to stop.
             */
 
-            MR_Spy_Print_List   print_list;
+            MR_SpyPrintList print_list;
             match = MR_event_matches_spy_point(layout, port, &action,
                 &print_list);
         }
@@ -423,11 +423,11 @@
 */
 
 static MR_Code *
-MR_trace_interrupt(const MR_Label_Layout *layout)
+MR_trace_interrupt(const MR_LabelLayout *layout)
 {
     MR_Unsigned     seqno;
     MR_Unsigned     depth;
-    MR_Trace_Port   port;
+    MR_TracePort    port;
 
     /* restore the original MR_selected_trace_func_ptr value */
     MR_selected_trace_func_ptr = MR_trace_real;
@@ -447,7 +447,7 @@
         depth = (MR_Unsigned) MR_call_depth_framevar(MR_curfr);
     }
 
-    port = (MR_Trace_Port) layout->MR_sll_port;
+    port = (MR_TracePort) layout->MR_sll_port;
     MR_trace_event_number++;
     return MR_trace_event(&MR_trace_ctrl, MR_TRUE, layout, port, seqno, depth);
 }
@@ -475,7 +475,7 @@
 
 #define MR_TRACE_EVENT_DECL_AND_SETUP                                         \
     MR_Code         *jumpaddr;                                                \
-    MR_Event_Info   event_info;                                               \
+    MR_EventInfo    event_info;                                               \
     MR_Word         *saved_regs = event_info.MR_saved_regs;                   \
                                                                               \
     event_info.MR_event_number = MR_trace_event_number;                       \
@@ -515,8 +515,8 @@
     return jumpaddr;
 
 static MR_Code *
-MR_trace_event(MR_Trace_Cmd_Info *cmd, MR_bool interactive,
-    const MR_Label_Layout *layout, MR_Trace_Port port,
+MR_trace_event(MR_TraceCmdInfo *cmd, MR_bool interactive,
+    const MR_LabelLayout *layout, MR_TracePort port,
     MR_Unsigned seqno, MR_Unsigned depth)
 {
     MR_TRACE_EVENT_DECL_AND_SETUP
@@ -538,8 +538,8 @@
             ** if MR_USE_EXTERNAL_DEBUGGER is not defined.
             */
             {
-                MR_Spy_Action       action;         /* ignored */
-                MR_Spy_Print_List   print_list;
+                MR_SpyAction        action;         /* ignored */
+                MR_SpyPrintList     print_list;
 
                 (void) MR_event_matches_spy_point(layout, port, &action,
                     &print_list);
@@ -555,16 +555,16 @@
 }
 
 MR_Code *
-MR_trace_real_decl(const MR_Label_Layout *layout)
+MR_trace_real_decl(const MR_LabelLayout *layout)
 {
     MR_Integer          maybe_from_full;
     MR_Unsigned         seqno;
     MR_Unsigned         depth;
-    MR_Trace_Port       port;
+    MR_TracePort        port;
 
     MR_TRACE_REAL_SETUP_CODE();
 
-    port = (MR_Trace_Port) layout->MR_sll_port;
+    port = (MR_TracePort) layout->MR_sll_port;
 
     {
         MR_TRACE_EVENT_DECL_AND_SETUP
@@ -574,17 +574,17 @@
 }
 
 MR_Code *
-MR_trace_real_decl_implicit_subtree(const MR_Label_Layout *layout)
+MR_trace_real_decl_implicit_subtree(const MR_LabelLayout *layout)
 {
     MR_Integer          maybe_from_full;
     MR_Unsigned         seqno;
     MR_Unsigned         depth;
-    MR_Trace_Port       port;
+    MR_TracePort        port;
     MR_Unsigned         node_depth;
 
     MR_TRACE_REAL_SETUP_CODE();
 
-    port = (MR_Trace_Port) layout->MR_sll_port;
+    port = (MR_TracePort) layout->MR_sll_port;
 
     /*
     ** Note that we do not check for suppressed events or events from compiler
@@ -621,9 +621,9 @@
 /* The initial size of arrays of argument values. */
 #define MR_INIT_ARG_COUNT   20
 
-MR_Retry_Result
-MR_trace_retry(MR_Event_Info *event_info,
-    int ancestor_level, MR_Retry_Across_Io across_io,
+MR_RetryResult
+MR_trace_retry(MR_EventInfo *event_info,
+    int ancestor_level, MR_RetryAcrossIo across_io,
     MR_bool assume_all_io_is_tabled, const char *retry_interactive_message,
     MR_bool *unsafe_retry, const char **problem,
     FILE *in_fp, FILE *out_fp, MR_Code **jumpaddr)
@@ -631,10 +631,10 @@
     MR_Word                 *base_sp;
     MR_Word                 *base_curfr;
     MR_Word                 *base_maxfr;
-    const MR_Label_Layout   *top_layout;
-    const MR_Label_Layout   *return_label_layout;
-    const MR_Label_Layout   *call_label;
-    const MR_Proc_Layout    *level_layout;
+    const MR_LabelLayout    *top_layout;
+    const MR_LabelLayout    *return_label_layout;
+    const MR_LabelLayout    *call_label;
+    const MR_ProcLayout     *level_layout;
     MR_Word                 *args;
     int                     arg_max;
     int                     arg_num;
@@ -649,7 +649,7 @@
     MR_bool                 found_io_action_counter;
     MR_Unsigned             saved_io_action_counter;
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
-    MR_Retry_Result         result;
+    MR_RetryResult          result;
 #endif
 
 #ifdef  MR_DEEP_PROFILING
@@ -759,12 +759,12 @@
             }
 
             if (i < MR_long_desc_var_count(call_label)) {
-                MR_Long_Lval    long_locn;
+                MR_LongLval     long_locn;
 
                 long_locn.MR_long_lval = MR_long_desc_var_locn(call_label, i);
                 arg_num = MR_get_register_number_long(long_locn);
             } else {
-                MR_Short_Lval    short_locn;
+                MR_ShortLval    short_locn;
 
                 short_locn = MR_short_desc_var_locn(call_label, i);
                 arg_num = MR_get_register_number_short(short_locn);
@@ -935,7 +935,7 @@
     MR_trace_from_full = MR_TRUE;
 
     if (MR_DETISM_DET_STACK(level_layout->MR_sle_detism)) {
-        MR_Long_Lval    location;
+        MR_LongLval     location;
         MR_Word         *this_frame;
 
         location = level_layout->MR_sle_succip_locn;
@@ -1047,7 +1047,7 @@
 }
 
 static MR_bool
-MR_in_traced_region(const MR_Proc_Layout *proc_layout,
+MR_in_traced_region(const MR_ProcLayout *proc_layout,
     MR_Word *base_sp, MR_Word *base_curfr)
 {
     if (proc_layout->MR_sle_maybe_from_full <= 0) {
@@ -1086,10 +1086,10 @@
 }
 
 static MR_bool
-MR_find_saved_io_counter(const MR_Label_Layout *call_label,
+MR_find_saved_io_counter(const MR_LabelLayout *call_label,
     MR_Word *base_sp, MR_Word *base_curfr, MR_Unsigned *saved_io_counter_ptr)
 {
-    const MR_Proc_Layout    *level_layout;
+    const MR_ProcLayout     *level_layout;
     MR_Unsigned             saved_io_counter;
 
     level_layout = call_label->MR_sll_entry;
@@ -1152,14 +1152,14 @@
 ** to point to a string giving the reason for its failure.
 */
 
-static const MR_Label_Layout *
-MR_unwind_stacks_for_retry(const MR_Label_Layout *top_layout,
+static const MR_LabelLayout *
+MR_unwind_stacks_for_retry(const MR_LabelLayout *top_layout,
     int ancestor_level, MR_Word **base_sp_ptr, MR_Word **base_curfr_ptr,
     MR_Word **base_maxfr_ptr, const char **problem)
 {
-    MR_Stack_Walk_Step_Result   result;
-    const MR_Proc_Layout        *level_layout;
-    const MR_Label_Layout       *return_label_layout;
+    MR_StackWalkStepResult      result;
+    const MR_ProcLayout         *level_layout;
+    const MR_LabelLayout        *return_label_layout;
     int                         i;
 
     if (ancestor_level < 0) {
@@ -1254,7 +1254,7 @@
 }
 
 static const char *
-MR_undo_updates_of_maxfr(const MR_Proc_Layout *level_layout,
+MR_undo_updates_of_maxfr(const MR_ProcLayout *level_layout,
     MR_Word *level_sp, MR_Word *level_curfr, MR_Word **maxfr_ptr)
 {
     if (MR_DETISM_DET_STACK(level_layout->MR_sle_detism)) {
@@ -1289,7 +1289,7 @@
 }
 
 static MR_Word
-MR_trace_find_input_arg(const MR_Label_Layout *label_layout,
+MR_trace_find_input_arg(const MR_LabelLayout *label_layout,
     MR_Word *saved_regs, MR_Word *base_sp, MR_Word *base_curfr,
     MR_uint_least16_t var_num, MR_bool *succeeded)
 {
@@ -1303,14 +1303,14 @@
     for (i = 0; i < MR_all_desc_var_count(label_layout); i++) {
         if (var_num == label_layout->MR_sll_var_nums[i]) {
             if (i < MR_long_desc_var_count(label_layout)) {
-                MR_Long_Lval    long_locn;
+                MR_LongLval     long_locn;
 
                 long_locn.MR_long_lval =
                     MR_long_desc_var_locn(label_layout, i);
                 return MR_lookup_long_lval_base(long_locn,
                     saved_regs, base_sp, base_curfr, succeeded);
             } else {
-                MR_Short_Lval    short_locn;
+                MR_ShortLval    short_locn;
 
                 short_locn = MR_short_desc_var_locn(label_layout, i);
                 return MR_lookup_short_lval_base(short_locn,
@@ -1348,21 +1348,21 @@
     MR_Subgoal  *record_subgoal;
     MR_Subgoal  *record_leader;
     MR_bool     found_leader_generator;
-} MR_Minimal_Model_Record;
+} MR_MinimalModelRecord;
 
-static MR_Retry_Result
-MR_check_minimal_model_calls(MR_Event_Info *event_info, int ancestor_level,
+static MR_RetryResult
+MR_check_minimal_model_calls(MR_EventInfo *event_info, int ancestor_level,
     MR_Word *target_maxfr, const char **problem)
 {
-    const MR_Label_Layout   *label_layout;
-    const MR_Proc_Layout    *proc_layout;
+    const MR_LabelLayout    *label_layout;
+    const MR_ProcLayout     *proc_layout;
     MR_Word                 *top_maxfr;
     MR_Word                 *cur_maxfr;
     MR_Code                 *redoip;
     MR_TrieNode             trienode;
     MR_Subgoal              *subgoal;
     MR_Subgoal              *leader;
-    MR_Minimal_Model_Record *record_ptrs;
+    MR_MinimalModelRecord   *record_ptrs;
     int                     record_ptr_max;
     int                     record_ptr_next;
     int                     frame_size;
@@ -1450,7 +1450,7 @@
             leader = subgoal;
         }
 
-        MR_ensure_room_for_next(record_ptr, MR_Minimal_Model_Record,
+        MR_ensure_room_for_next(record_ptr, MR_MinimalModelRecord,
             INIT_RECORD_ARRAY_SIZE);
 
         record_ptrs[record_ptr_next].record_subgoal = subgoal;
@@ -1535,12 +1535,12 @@
 }
 
 static void
-MR_maybe_record_call_table(const MR_Proc_Layout *level_layout,
+MR_maybe_record_call_table(const MR_ProcLayout *level_layout,
     MR_Word *base_sp, MR_Word *base_curfr)
 {
-    MR_TrieNode             call_table;
-    MR_EvalMethod           eval_method;
-    const MR_User_Proc_Id   *user;
+    MR_TrieNode         call_table;
+    MR_EvalMethod       eval_method;
+    const MR_UserProcId *user;
 
     if (! MR_PROC_LAYOUT_HAS_EXEC_TRACE(level_layout)) {
         if (MR_PROC_LAYOUT_HAS_PROC_ID(level_layout)) {
Index: trace/mercury_trace.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace.h,v
retrieving revision 1.34
diff -u -r1.34 mercury_trace.h
--- trace/mercury_trace.h	24 Nov 2006 03:48:27 -0000	1.34
+++ trace/mercury_trace.h	26 Nov 2006 23:05:23 -0000
@@ -26,25 +26,25 @@
 
 #include "mercury_memory_zones.h"   /* for MR_MAX_FAKE_REG */
 #include "mercury_types.h"      /* for MR_Unsigned etc */
-#include "mercury_trace_base.h"     /* for MR_Trace_Port   */
+#include "mercury_trace_base.h"     /* for MR_TracePort   */
 #include "mercury_std.h"        /* for MR_bool            */
 
 /*
-** MR_Event_Info is used to hold the information for a trace event.  One
+** MR_EventInfo is used to hold the information for a trace event.  One
 ** of these is built by MR_trace_event and is passed (by reference)
 ** throughout the tracing system.
 */
 
-typedef struct MR_Event_Info_Struct {
+typedef struct MR_EventInfo_Struct {
     MR_Unsigned             MR_event_number;
     MR_Unsigned             MR_call_seqno;
     MR_Unsigned             MR_call_depth;
-    MR_Trace_Port           MR_trace_port;
-    const MR_Label_Layout   *MR_event_sll;
+    MR_TracePort            MR_trace_port;
+    const MR_LabelLayout    *MR_event_sll;
     const char              *MR_event_path;
     MR_Word                 MR_saved_regs[MR_MAX_FAKE_REG];
     int                     MR_max_mr_num;
-} MR_Event_Info;
+} MR_EventInfo;
 
 /*
 ** The above declarations are part of the interface between MR_trace_real
@@ -62,9 +62,9 @@
 ** MR_trace_real_decl for events which are in implicit subtrees.
 */
 
-extern  MR_Code *MR_trace_real_decl(const MR_Label_Layout *);
+extern  MR_Code *MR_trace_real_decl(const MR_LabelLayout *);
 
-extern  MR_Code *MR_trace_real_decl_implicit_subtree(const MR_Label_Layout *);
+extern  MR_Code *MR_trace_real_decl_implicit_subtree(const MR_LabelLayout *);
 
 /*
 ** Ideally, MR_trace_retry works by resetting the state of the stacks and
@@ -131,17 +131,17 @@
     MR_RETRY_IO_FORCE,
     MR_RETRY_IO_INTERACTIVE,
     MR_RETRY_IO_ONLY_IF_SAFE
-} MR_Retry_Across_Io;
+} MR_RetryAcrossIo;
 
 typedef enum {
     MR_RETRY_OK_DIRECT,
     MR_RETRY_OK_FINISH_FIRST,
     MR_RETRY_OK_FAIL_FIRST,
     MR_RETRY_ERROR
-} MR_Retry_Result;
+} MR_RetryResult;
 
-extern  MR_Retry_Result MR_trace_retry(MR_Event_Info *event_info,
-                            int ancestor_level, MR_Retry_Across_Io across_io,
+extern  MR_RetryResult  MR_trace_retry(MR_EventInfo *event_info,
+                            int ancestor_level, MR_RetryAcrossIo across_io,
                             MR_bool assume_all_io_is_tabled,
                             const char *retry_interactive_message,
                             MR_bool *unsafe_retry, const char **problem,
@@ -204,13 +204,13 @@
     MR_CMD_MIN_DEPTH,
     MR_CMD_MAX_DEPTH,
     MR_CMD_TO_END
-} MR_Trace_Cmd_Type;
+} MR_TraceCmdType;
 
 typedef enum {
     MR_PRINT_LEVEL_NONE,    /* no events at all                        */
     MR_PRINT_LEVEL_SOME,    /* events matching an active spy point     */
     MR_PRINT_LEVEL_ALL      /* all events                              */
-} MR_Trace_Print_Level;
+} MR_TracePrintLevel;
 
 /*
 ** Type of pointers to filter/4 procedures for collect request
@@ -222,7 +222,7 @@
                     MR_Integer, MR_Word, MR_Word *, MR_Char *);
 
 typedef struct {
-    MR_Trace_Cmd_Type       MR_trace_cmd;   
+    MR_TraceCmdType         MR_trace_cmd;   
                             /*
                             ** The MR_trace_stop_depth field is meaningful
                             ** if MR_trace_cmd is MR_CMD_NEXT or MR_CMD_FINISH.
@@ -233,7 +233,7 @@
                             ** if MR_trace_cmd is MR_CMD_GOTO  .
                             */
     MR_Unsigned             MR_trace_stop_event;
-    MR_Trace_Print_Level    MR_trace_print_level;
+    MR_TracePrintLevel      MR_trace_print_level;
     MR_bool                 MR_trace_strict;
 #ifdef  MR_TRACE_CHECK_INTEGRITY
     MR_bool                 MR_trace_check_integrity;
@@ -253,14 +253,14 @@
                             ** procedure during a collect request.
                             */
     MR_FilterFuncPtr        MR_filter_ptr;
-} MR_Trace_Cmd_Info;
+} MR_TraceCmdInfo;
 
 /*
 ** The data structure that tells MR_trace_real and MR_trace_real_decl
 ** what to do. Exported only for use by mercury_trace_declarative.c.
 */
 
-extern  MR_Trace_Cmd_Info       MR_trace_ctrl;
+extern  MR_TraceCmdInfo     MR_trace_ctrl;
 
 #ifdef  MR_TRACE_CHECK_INTEGRITY
   #define MR_init_trace_check_integrity(cmd)                            \
Index: trace/mercury_trace_alias.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_alias.c,v
retrieving revision 1.10
diff -u -r1.10 mercury_trace_alias.c
--- trace/mercury_trace_alias.c	4 Apr 2006 07:37:27 -0000	1.10
+++ trace/mercury_trace_alias.c	26 Nov 2006 23:05:23 -0000
@@ -34,7 +34,7 @@
                         MR_bool mdb_command_format);
 static  char        *MR_trace_get_alias_slot_name(int slot);
 static  MR_bool     MR_trace_filter_alias_completions(const char *word,
-                        MR_Completer_Data *data);
+                        MR_CompleterData *data);
 
 void
 MR_trace_add_alias(char *name, char **words, int word_count)
@@ -161,7 +161,7 @@
     fprintf(fp, "\n");
 }
 
-MR_Completer_List *
+MR_CompleterList *
 MR_trace_alias_completer(const char *word, size_t word_length)
 {
     /*
@@ -180,7 +180,7 @@
 }
 
 static MR_bool
-MR_trace_filter_alias_completions(const char *word, MR_Completer_Data *data)
+MR_trace_filter_alias_completions(const char *word, MR_CompleterData *data)
 {
     return (MR_strdiff(word, "EMPTY") && MR_strdiff(word, "NUMBER"));
 }
Index: trace/mercury_trace_alias.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_alias.h,v
retrieving revision 1.7
diff -u -r1.7 mercury_trace_alias.h
--- trace/mercury_trace_alias.h	4 Apr 2006 07:37:27 -0000	1.7
+++ trace/mercury_trace_alias.h	26 Nov 2006 23:05:23 -0000
@@ -83,7 +83,7 @@
                         int *word_count);
 
 /* A Readline completer for aliases. */ 
-extern  MR_Completer_List
+extern  MR_CompleterList
                     *MR_trace_alias_completer(const char *word,
                         size_t word_length);
 
Index: trace/mercury_trace_browse.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_browse.c,v
retrieving revision 1.41
diff -u -r1.41 mercury_trace_browse.c
--- trace/mercury_trace_browse.c	9 Oct 2006 06:40:28 -0000	1.41
+++ trace/mercury_trace_browse.c	26 Nov 2006 23:05:23 -0000
@@ -132,7 +132,7 @@
 }
 
 MR_bool
-MR_trace_is_portray_format(const char *str, MR_Browse_Format *format)
+MR_trace_is_portray_format(const char *str, MR_BrowseFormat *format)
 {
     *format = MR_BROWSE_DEFAULT_FORMAT;
 
@@ -154,7 +154,7 @@
 }
 
 void
-MR_trace_browse(MR_Word type_info, MR_Word value, MR_Browse_Format format)
+MR_trace_browse(MR_Word type_info, MR_Word value, MR_BrowseFormat format)
 {
     MercuryFile mdb_in;
     MercuryFile mdb_out;
@@ -195,7 +195,7 @@
 
 void
 MR_trace_browse_goal(MR_ConstString name, MR_Word arg_list, MR_Word is_func,
-    MR_Browse_Format format)
+    MR_BrowseFormat format)
 {
     MercuryFile mdb_in;
     MercuryFile mdb_out;
@@ -244,7 +244,7 @@
 
 void
 MR_trace_browse_external(MR_Word type_info, MR_Word value,
-        MR_Browse_Caller_Type caller, MR_Browse_Format format)
+        MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
     MR_trace_browse_ensure_init();
 
@@ -263,8 +263,8 @@
 #endif
 
 void
-MR_trace_print(MR_Word type_info, MR_Word value, MR_Browse_Caller_Type caller,
-    MR_Browse_Format format)
+MR_trace_print(MR_Word type_info, MR_Word value, MR_BrowseCallerType caller,
+    MR_BrowseFormat format)
 {
     MercuryFile mdb_out;
     MR_Word     browser_term;
@@ -293,7 +293,7 @@
 
 void
 MR_trace_print_goal(MR_ConstString name, MR_Word arg_list, MR_Word is_func,
-    MR_Browse_Caller_Type caller, MR_Browse_Format format)
+    MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
     MercuryFile mdb_out;
     MR_Word     browser_term;
@@ -361,7 +361,7 @@
 }
 
 void
-MR_trace_query(MR_Query_Type type, const char *options, int num_imports,
+MR_trace_query(MR_QueryType type, const char *options, int num_imports,
     char *imports[])
 {
     MR_ConstString  options_on_heap;
@@ -399,7 +399,7 @@
 #ifdef MR_USE_EXTERNAL_DEBUGGER
 
 void
-MR_trace_query_external(MR_Query_Type type, MR_String options, int num_imports,
+MR_trace_query_external(MR_QueryType type, MR_String options, int num_imports,
     MR_Word imports_list)
 {
     MR_TRACE_CALL_MERCURY(
Index: trace/mercury_trace_browse.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_browse.h,v
retrieving revision 1.25
diff -u -r1.25 mercury_trace_browse.h
--- trace/mercury_trace_browse.h	6 Apr 2006 06:14:40 -0000	1.25
+++ trace/mercury_trace_browse.h	26 Nov 2006 23:05:23 -0000
@@ -55,14 +55,14 @@
     MR_DEFINE_MERCURY_ENUM_CONST(MR_BROWSE_CALLER_PRINT),
     MR_DEFINE_MERCURY_ENUM_CONST(MR_BROWSE_CALLER_BROWSE),
     MR_DEFINE_MERCURY_ENUM_CONST(MR_BROWSE_CALLER_PRINT_ALL)
-} MR_Browse_Caller_Type;
+} MR_BrowseCallerType;
 
 typedef enum {
     MR_DEFINE_MERCURY_ENUM_CONST(MR_BROWSE_FORMAT_FLAT),
     MR_DEFINE_MERCURY_ENUM_CONST(MR_BROWSE_FORMAT_RAW_PRETTY),
     MR_DEFINE_MERCURY_ENUM_CONST(MR_BROWSE_FORMAT_VERBOSE),
     MR_DEFINE_MERCURY_ENUM_CONST(MR_BROWSE_FORMAT_PRETTY)
-} MR_Browse_Format;
+} MR_BrowseFormat;
 
 /*
 ** This value must be different from any of the MR_BROWSE_FORMAT_* values.
@@ -71,24 +71,24 @@
 #define MR_BROWSE_DEFAULT_FORMAT    -1
 
 /*
-** If *str represents a value of type MR_Browse_Format, set *format to that
+** If *str represents a value of type MR_BrowseFormat, set *format to that
 ** value.
 */
 
 extern  MR_bool     MR_trace_is_portray_format(const char *str,
-                        MR_Browse_Format *format);
+                        MR_BrowseFormat *format);
 
 /*
 ** Interactively browse a term.
 */
 
 extern  void        MR_trace_browse(MR_Word type_info, MR_Word value,
-                        MR_Browse_Format format);
+                        MR_BrowseFormat format);
 extern  void        MR_trace_browse_goal(MR_ConstString name, MR_Word arg_list,
-                        MR_Word is_func, MR_Browse_Format format);
+                        MR_Word is_func, MR_BrowseFormat format);
 #ifdef MR_USE_EXTERNAL_DEBUGGER
 extern  void        MR_trace_browse_external(MR_Word type_info, MR_Word value,
-                        MR_Browse_Caller_Type caller, MR_Browse_Format format);
+                        MR_BrowseCallerType caller, MR_BrowseFormat format);
 #endif
 
 /*
@@ -102,10 +102,10 @@
 */
 
 extern  void        MR_trace_print(MR_Word type_info, MR_Word value,
-                        MR_Browse_Caller_Type caller, MR_Browse_Format format);
+                        MR_BrowseCallerType caller, MR_BrowseFormat format);
 extern  void        MR_trace_print_goal(MR_ConstString name, MR_Word arg_list,
-                        MR_Word is_func, MR_Browse_Caller_Type caller,
-                        MR_Browse_Format format);
+                        MR_Word is_func, MR_BrowseCallerType caller,
+                        MR_BrowseFormat format);
 
 
 /*
@@ -132,13 +132,13 @@
     MR_DEFINE_MERCURY_ENUM_CONST(MR_NORMAL_QUERY),
     MR_DEFINE_MERCURY_ENUM_CONST(MR_CC_QUERY),
     MR_DEFINE_MERCURY_ENUM_CONST(MR_IO_QUERY)
-} MR_Query_Type;
+} MR_QueryType;
 
-extern  void        MR_trace_query(MR_Query_Type type, const char *options,
+extern  void        MR_trace_query(MR_QueryType type, const char *options,
                         int num_imports, /* const */ char *imports[]);
 
 #ifdef MR_USE_EXTERNAL_DEBUGGER
-extern  void        MR_trace_query_external(MR_Query_Type type,
+extern  void        MR_trace_query_external(MR_QueryType type,
                         MR_String options, int num_imports,
                         MR_Word imports_list);
 #endif
Index: trace/mercury_trace_cmd_backward.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_backward.c,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_backward.c
--- trace/mercury_trace_cmd_backward.c	4 Apr 2006 07:37:27 -0000	1.1
+++ trace/mercury_trace_cmd_backward.c	26 Nov 2006 23:05:23 -0000
@@ -41,21 +41,21 @@
     "Retry across I/O operations is not always safe.\n" \
     "Are you sure you want to do it? "
 
-static  MR_bool     MR_trace_options_retry(MR_Retry_Across_Io *across_io,
+static  MR_bool     MR_trace_options_retry(MR_RetryAcrossIo *across_io,
                         MR_bool *assume_all_io_is_tabled,
                         char ***words, int *word_count);
 
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_retry(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_retry(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int                 n;
     int                 ancestor_level;
-    MR_Retry_Across_Io  across_io;
+    MR_RetryAcrossIo    across_io;
     const char          *problem;
-    MR_Retry_Result     result;
+    MR_RetryResult      result;
     MR_bool             assume_all_io_is_tabled;
     MR_bool             unsafe_retry;
 
@@ -146,7 +146,7 @@
 };
 
 static MR_bool
-MR_trace_options_retry(MR_Retry_Across_Io *across_io,
+MR_trace_options_retry(MR_RetryAcrossIo *across_io,
     MR_bool *assume_all_io_is_tabled, char ***words, int *word_count)
 {
     int c;
Index: trace/mercury_trace_cmd_breakpoint.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_breakpoint.c,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_breakpoint.c
--- trace/mercury_trace_cmd_breakpoint.c	4 Apr 2006 07:37:27 -0000	1.1
+++ trace/mercury_trace_cmd_breakpoint.c	26 Nov 2006 23:07:14 -0000
@@ -37,26 +37,25 @@
         MR_MULTIMATCH_ASK, MR_MULTIMATCH_ALL, MR_MULTIMATCH_ONE
 } MR_MultiMatch;
 
-static  MR_Spy_Print_List
-                    MR_add_to_print_list_end(MR_Browse_Format format,
-                        char *word, MR_bool warn, 
-                        MR_Spy_Print_List print_list);
+static  MR_SpyPrintList
+                    MR_add_to_print_list_end(MR_BrowseFormat format,
+                        char *word, MR_bool warn, MR_SpyPrintList print_list);
 static  void        MR_maybe_print_spy_point(int slot, const char *problem);
 static  MR_bool     MR_parse_source_locn(char *word, const char **file,
                         int *line);
 
-static  MR_bool     MR_trace_options_when_action_multi_ignore(MR_Spy_When *when,
-                        MR_Spy_Action *action, MR_MultiMatch *multi_match,
-                        MR_Spy_Ignore_When *ignore_when, int *ignore_count,
-                        MR_Spy_Print_List *print_list,
+static  MR_bool     MR_trace_options_when_action_multi_ignore(MR_SpyWhen *when,
+                        MR_SpyAction *action, MR_MultiMatch *multi_match,
+                        MR_SpyIgnore_When *ignore_when, int *ignore_count,
+                        MR_SpyPrintList *print_list,
                         char ***words, int *word_count);
 static  MR_bool     MR_trace_options_condition(int *break_num,
                         MR_bool *require_var, MR_bool *require_path,
                         char ***words, int *word_count);
 static  MR_bool     MR_trace_options_ignore_count(
-                        MR_Spy_Ignore_When *ignore_when,
+                        MR_SpyIgnore_When *ignore_when,
                         int *ignore_count, char ***words, int *word_count);
-static  MR_bool     MR_trace_options_break_print(MR_Browse_Format *format,
+static  MR_bool     MR_trace_options_break_print(MR_BrowseFormat *format,
                         MR_bool *at_start, MR_bool *warn, char ***words,
                         int *word_count);
 static  MR_bool     MR_trace_options_register(MR_bool *verbose, char ***words,
@@ -65,17 +64,17 @@
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_break(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_break(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
-    const MR_Label_Layout   *layout;
-    MR_Proc_Spec            spec;
-    MR_Spy_When             when;
-    MR_Spy_Action           action;
+    const MR_LabelLayout    *layout;
+    MR_ProcSpec             spec;
+    MR_SpyWhen              when;
+    MR_SpyAction            action;
     MR_MultiMatch           multi_match;
-    MR_Spy_Ignore_When      ignore_when;
+    MR_SpyIgnore_When       ignore_when;
     int                     ignore_count;
-    MR_Spy_Print_List       print_list;
+    MR_SpyPrintList         print_list;
     const char              *file;
     int                     line;
     int                     breakline;
@@ -119,7 +118,7 @@
         ; /* the usage message has already been printed */
     } else if (word_count == 2 && MR_streq(words[1], "here")) {
         int             slot;
-        MR_Trace_Port   port;
+        MR_TracePort    port;
 
         port = event_info->MR_trace_port;
         if (ignore_count > 0 && ignore_when == MR_SPY_IGNORE_ENTRY &&
@@ -142,7 +141,7 @@
             ignore_count, layout->MR_sll_entry, layout, print_list, &problem);
         MR_maybe_print_spy_point(slot, problem);
     } else if (word_count == 2 && MR_parse_proc_spec(words[1], &spec)) {
-        MR_Matches_Info matches;
+        MR_MatchesInfo  matches;
         int             slot;
 
         MR_register_all_modules_and_procs(MR_mdb_out, MR_TRUE);
@@ -241,8 +240,8 @@
 }
 
 MR_Next
-MR_trace_cmd_condition(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_condition(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int             break_num;
     MR_bool         require_var;
@@ -250,13 +249,13 @@
     int             i;
     const char      *problem;
     MR_CTerm        term;
-    MR_Spy_Test     test;
+    MR_SpyTest      test;
     char            *what_str;
     char            *term_str;
     int             len;
     char            *rest;
-    MR_Spy_Cond     *cond;
-    MR_Var_Spec     var_spec;
+    MR_SpyCond      *cond;
+    MR_VarSpec      var_spec;
     char            *path;
 
     break_num = MR_most_recent_spy_point;
@@ -287,7 +286,7 @@
         return KEEP_INTERACTING;
     }
 
-    cond = MR_malloc(sizeof(MR_Spy_Cond));
+    cond = MR_malloc(sizeof(MR_SpyCond));
 
     what_str = MR_malloc(strlen(words[1]) + 1);
     strcpy(what_str, words[1]);
@@ -353,11 +352,11 @@
 }
 
 MR_Next
-MR_trace_cmd_ignore(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_ignore(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int                 n;
-    MR_Spy_Ignore_When  ignore_when;
+    MR_SpyIgnore_When   ignore_when;
     int                 ignore_count;
     const char          *problem;
 
@@ -411,15 +410,15 @@
 }
 
 MR_Next
-MR_trace_cmd_break_print(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_break_print(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int                 n;
     int                 i;
-    MR_Browse_Format    format;
+    MR_BrowseFormat     format;
     MR_bool             at_start;
     MR_bool             warn;
-    MR_Spy_Print_List   print_list;
+    MR_SpyPrintList     print_list;
 
     if (! MR_trace_options_break_print(&format, &at_start, &warn,
         &words, &word_count))
@@ -457,8 +456,8 @@
 }
 
 MR_Next
-MR_trace_cmd_enable(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_enable(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int n;
 
@@ -505,8 +504,8 @@
 }
 
 MR_Next
-MR_trace_cmd_disable(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_disable(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int n;
 
@@ -554,8 +553,8 @@
 }
 
 MR_Next
-MR_trace_cmd_delete(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_delete(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int n;
 
@@ -612,8 +611,8 @@
 }
 
 MR_Next
-MR_trace_cmd_register(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_register(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_bool verbose;
 
@@ -631,8 +630,8 @@
 }
 
 MR_Next
-MR_trace_cmd_modules(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_modules(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 1) {
         MR_register_all_modules_and_procs(MR_mdb_out, MR_TRUE);
@@ -645,8 +644,8 @@
 }
 
 MR_Next
-MR_trace_cmd_procedures(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_procedures(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         MR_register_all_modules_and_procs(MR_mdb_out, MR_TRUE);
@@ -660,15 +659,15 @@
 
 /****************************************************************************/
 
-static MR_Spy_Print_List
-MR_add_to_print_list_end(MR_Browse_Format format, char *word, MR_bool warn,
-    MR_Spy_Print_List print_list)
-{
-    MR_Spy_Print_List   list;
-    MR_Spy_Print_List   new_list;
-    MR_Spy_Print        new_node;
+static MR_SpyPrintList
+MR_add_to_print_list_end(MR_BrowseFormat format, char *word, MR_bool warn,
+    MR_SpyPrintList print_list)
+{
+    MR_SpyPrintList     list;
+    MR_SpyPrintList     new_list;
+    MR_SpyPrint         new_node;
 
-    new_node = MR_malloc(sizeof(struct MR_Spy_Print_Struct));
+    new_node = MR_malloc(sizeof(struct MR_SpyPrint_Struct));
     new_node->p_format = format;
     new_node->p_warn = warn;
     if (MR_streq(word, "*")) {
@@ -682,7 +681,7 @@
         new_node->p_name = MR_copy_string(word);
     }
 
-    new_list = MR_malloc(sizeof(struct MR_Spy_Print_List_Struct));
+    new_list = MR_malloc(sizeof(struct MR_SpyPrintList_Struct));
     new_list->pl_cur = new_node;
     new_list->pl_next = NULL;
 
@@ -762,15 +761,14 @@
 };
 
 static MR_bool
-MR_trace_options_when_action_multi_ignore(MR_Spy_When *when,
-    MR_Spy_Action *action, MR_MultiMatch *multi_match,
-    MR_Spy_Ignore_When*ignore_when, int *ignore_count,
-    MR_Spy_Print_List *print_list,
-    char ***words, int *word_count)
+MR_trace_options_when_action_multi_ignore(MR_SpyWhen *when,
+    MR_SpyAction *action, MR_MultiMatch *multi_match,
+    MR_SpyIgnore_When *ignore_when, int *ignore_count,
+    MR_SpyPrintList *print_list, char ***words, int *word_count)
 {
     int                 c;
-    MR_Spy_Print        node;
-    MR_Spy_Print_List   list;
+    MR_SpyPrint         node;
+    MR_SpyPrintList     list;
     MR_bool             warn;
 
     warn = MR_TRUE;
@@ -906,7 +904,7 @@
 };
 
 static MR_bool
-MR_trace_options_ignore_count(MR_Spy_Ignore_When *ignore_when,
+MR_trace_options_ignore_count(MR_SpyIgnore_When *ignore_when,
     int *ignore_count, char ***words, int *word_count)
 {
     int c;
@@ -956,7 +954,7 @@
 };
 
 static MR_bool
-MR_trace_options_break_print(MR_Browse_Format *format, MR_bool *at_start,
+MR_trace_options_break_print(MR_BrowseFormat *format, MR_bool *at_start,
     MR_bool *warn, char ***words, int *word_count)
 {
     int c;
Index: trace/mercury_trace_cmd_browsing.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_browsing.c,v
retrieving revision 1.3
diff -u -r1.3 mercury_trace_cmd_browsing.c
--- trace/mercury_trace_cmd_browsing.c	24 Nov 2006 03:48:27 -0000	1.3
+++ trace/mercury_trace_cmd_browsing.c	26 Nov 2006 23:08:02 -0000
@@ -42,21 +42,21 @@
 
 static  void        MR_trace_set_level_and_report(int ancestor_level,
                         MR_bool detailed, MR_bool print_optionals);
-static  const char  *MR_trace_browse_exception(MR_Event_Info *event_info,
-                        MR_Browser browser, MR_Browse_Caller_Type caller,
-                        MR_Browse_Format format);
-static  const char  *MR_trace_browse_proc_body(MR_Event_Info *event_info,
-                        MR_Browser browser, MR_Browse_Caller_Type caller,
-                        MR_Browse_Format format);
+static  const char  *MR_trace_browse_exception(MR_EventInfo *event_info,
+                        MR_Browser browser, MR_BrowseCallerType caller,
+                        MR_BrowseFormat format);
+static  const char  *MR_trace_browse_proc_body(MR_EventInfo *event_info,
+                        MR_Browser browser, MR_BrowseCallerType caller,
+                        MR_BrowseFormat format);
                         
 /* Functions to invoke the user's XML browser on terms or goals */
 static  void        MR_trace_browse_xml(MR_Word type_info, MR_Word value,
-                        MR_Browse_Caller_Type caller, MR_Browse_Format format);
+                        MR_BrowseCallerType caller, MR_BrowseFormat format);
 static  void        MR_trace_browse_goal_xml(MR_ConstString name,
                         MR_Word arg_list, MR_Word is_func,
-                        MR_Browse_Caller_Type caller, MR_Browse_Format format);
+                        MR_BrowseCallerType caller, MR_BrowseFormat format);
 
-static  void        MR_trace_cmd_stack_2(MR_Event_Info *event_info,
+static  void        MR_trace_cmd_stack_2(MR_EventInfo *event_info,
                         MR_bool detailed, int frame_limit, int line_limit);
 
 static  const char  *MR_trace_new_source_window(const char *window_cmd,
@@ -68,7 +68,7 @@
                         int *word_count);
 static  MR_bool     MR_trace_options_stack_trace(MR_bool *detailed,
                         int *frame_limit, char ***words, int *word_count);
-static  MR_bool     MR_trace_options_format(MR_Browse_Format *format,
+static  MR_bool     MR_trace_options_format(MR_BrowseFormat *format,
                         MR_bool *xml, char ***words, int *word_count);
 static  MR_bool     MR_trace_options_view(const char **window_cmd,
                         const char **server_cmd, const char **server_name,
@@ -83,8 +83,8 @@
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_level(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_level(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int n;
     MR_bool detailed;
@@ -102,8 +102,8 @@
 }
 
 MR_Next
-MR_trace_cmd_up(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_up(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int     n;
     MR_bool detailed;
@@ -125,8 +125,8 @@
 }
 
 MR_Next
-MR_trace_cmd_down(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_down(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int     n;
     MR_bool detailed;
@@ -148,8 +148,8 @@
 }
 
 MR_Next
-MR_trace_cmd_vars(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_vars(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 1) {
         const char  *problem;
@@ -167,8 +167,8 @@
 }
 
 MR_Next
-MR_trace_cmd_held_vars(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_held_vars(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 1) {
         MR_trace_list_held_vars(MR_mdb_out);
@@ -180,10 +180,10 @@
 }
 
 MR_Next
-MR_trace_cmd_print(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_print(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
-    MR_Browse_Format    format;
+    MR_BrowseFormat    format;
     MR_bool             xml;
     int                 n;
 
@@ -248,10 +248,10 @@
 }
 
 MR_Next
-MR_trace_cmd_browse(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_browse(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
-    MR_Browse_Format    format;
+    MR_BrowseFormat     format;
     MR_bool             xml;
     int                 n;
     MR_GoalBrowser      goal_browser;
@@ -321,8 +321,8 @@
 }
 
 MR_Next
-MR_trace_cmd_stack(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_stack(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_bool     detailed;
     int         frame_limit = 0;
@@ -349,8 +349,8 @@
 }
 
 MR_Next
-MR_trace_cmd_current(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_current(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 1) {
         MR_trace_event_print_internal_report(event_info);
@@ -362,8 +362,8 @@
 }
 
 MR_Next
-MR_trace_cmd_view(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_view(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     const char      *window_cmd = NULL;
     const char      *server_cmd = NULL;
@@ -399,8 +399,8 @@
 }
 
 MR_Next
-MR_trace_cmd_hold(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_hold(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     char        *event_var_name;
     char        *held_var_name;
@@ -451,8 +451,8 @@
 }
 
 MR_Next
-MR_trace_cmd_diff(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_diff(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int         start;
     int         max;
@@ -508,8 +508,8 @@
 }
 
 MR_Next
-MR_trace_cmd_dump(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_dump(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_bool         verbose = MR_FALSE;
     MR_Word         browser_term;
@@ -545,7 +545,7 @@
                 browser_term = MR_univ_to_browser_term(exception);
             }
         } else if (MR_streq(words[1], "proc_body")) {
-            const MR_Proc_Layout    *entry;
+            const MR_ProcLayout     *entry;
             MR_Word                 rep;
 
             entry = event_info->MR_event_sll->MR_sll_entry;
@@ -562,7 +562,7 @@
                     (MR_TypeInfo) ML_proc_rep_type(), rep);
             }
         } else {
-            MR_Var_Spec var_spec;
+            MR_VarSpec  var_spec;
             MR_TypeInfo type_info;
             MR_Word     value;
             const char  *name;
@@ -605,9 +605,9 @@
 
 MR_Next
 MR_trace_cmd_list(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
-    const MR_Proc_Layout    *entry_ptr;
+    const MR_ProcLayout     *entry_ptr;
     const char              *filename;
     int                     lineno;
     MR_Word                 *base_sp_ptr;
@@ -647,7 +647,7 @@
     MR_bool print_optionals)
 {
     const char              *problem;
-    const MR_Proc_Layout    *entry;
+    const MR_ProcLayout     *entry;
     MR_Word                 *base_sp;
     MR_Word                 *base_curfr;
     const char              *filename;
@@ -684,7 +684,7 @@
 
 void
 MR_trace_browse_internal(MR_Word type_info, MR_Word value,
-    MR_Browse_Caller_Type caller, MR_Browse_Format format)
+    MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
     switch (caller) {
 
@@ -706,7 +706,7 @@
 
 void
 MR_trace_browse_goal_internal(MR_ConstString name, MR_Word arg_list,
-    MR_Word is_func, MR_Browse_Caller_Type caller, MR_Browse_Format format)
+    MR_Word is_func, MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
     switch (caller) {
 
@@ -728,8 +728,8 @@
 }
 
 static const char *
-MR_trace_browse_exception(MR_Event_Info *event_info, MR_Browser browser,
-    MR_Browse_Caller_Type caller, MR_Browse_Format format)
+MR_trace_browse_exception(MR_EventInfo *event_info, MR_Browser browser,
+    MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
     MR_TypeInfo type_info;
     MR_Word     value;
@@ -752,10 +752,10 @@
 }
 
 static const char *
-MR_trace_browse_proc_body(MR_Event_Info *event_info, MR_Browser browser,
-    MR_Browse_Caller_Type caller, MR_Browse_Format format)
+MR_trace_browse_proc_body(MR_EventInfo *event_info, MR_Browser browser,
+    MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
-    const MR_Proc_Layout    *entry;
+    const MR_ProcLayout     *entry;
     MR_Word                 rep;
 
     entry = event_info->MR_event_sll->MR_sll_entry;
@@ -775,7 +775,7 @@
 
 static void
 MR_trace_browse_xml(MR_Word type_info, MR_Word value,
-    MR_Browse_Caller_Type caller, MR_Browse_Format format)
+    MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
     MR_Word     browser_term;
 
@@ -787,7 +787,7 @@
 
 static void
 MR_trace_browse_goal_xml(MR_ConstString name, MR_Word arg_list,
-    MR_Word is_func, MR_Browse_Caller_Type caller, MR_Browse_Format format)
+    MR_Word is_func, MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
     MR_Word     browser_term;
 
@@ -796,10 +796,10 @@
 }
 
 static void
-MR_trace_cmd_stack_2(MR_Event_Info *event_info, MR_bool detailed,
+MR_trace_cmd_stack_2(MR_EventInfo *event_info, MR_bool detailed,
     int frame_limit, int line_limit)
 {
-    const MR_Label_Layout   *layout;
+    const MR_LabelLayout    *layout;
     MR_Word                 *saved_regs;
     const char              *msg;
 
@@ -874,9 +874,9 @@
 }
 
 void
-MR_trace_maybe_sync_source_window(MR_Event_Info *event_info, MR_bool verbose)
+MR_trace_maybe_sync_source_window(MR_EventInfo *event_info, MR_bool verbose)
 {
-    const MR_Label_Layout   *parent;
+    const MR_LabelLayout    *parent;
     const char              *filename;
     int                     lineno;
     const char              *parent_filename;
@@ -1039,7 +1039,7 @@
 };
 
 static MR_bool
-MR_trace_options_format(MR_Browse_Format *format, MR_bool *xml, char ***words,
+MR_trace_options_format(MR_BrowseFormat *format, MR_bool *xml, char ***words,
     int *word_count)
 {
     int c;
Index: trace/mercury_trace_cmd_browsing.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_browsing.h,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_browsing.h
--- trace/mercury_trace_cmd_browsing.h	4 Apr 2006 07:37:28 -0000	1.1
+++ trace/mercury_trace_cmd_browsing.h	26 Nov 2006 23:05:23 -0000
@@ -35,15 +35,15 @@
 */
 
 extern  void                MR_trace_maybe_sync_source_window(
-                                MR_Event_Info *event_info, MR_bool verbose);
+                                MR_EventInfo *event_info, MR_bool verbose);
 
 extern  void                MR_trace_browse_internal(MR_Word type_info,
-                                MR_Word value, MR_Browse_Caller_Type caller,
-                                MR_Browse_Format format);
+                                MR_Word value, MR_BrowseCallerType caller,
+                                MR_BrowseFormat format);
 extern  void                MR_trace_browse_goal_internal(MR_ConstString name,
                                 MR_Word arg_list, MR_Word is_func,
-                                MR_Browse_Caller_Type caller,
-                                MR_Browse_Format format);
+                                MR_BrowseCallerType caller,
+                                MR_BrowseFormat format);
 
 extern  const char *const   MR_trace_print_cmd_args[];
 extern  const char *const   MR_trace_stack_cmd_args[];
Index: trace/mercury_trace_cmd_dd.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_dd.c,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_dd.c
--- trace/mercury_trace_cmd_dd.c	4 Apr 2006 07:37:28 -0000	1.1
+++ trace/mercury_trace_cmd_dd.c	26 Nov 2006 23:08:42 -0000
@@ -35,7 +35,7 @@
 
 static  MR_bool     MR_trace_options_dd(MR_bool *assume_all_io_is_tabled,
                         MR_Unsigned *default_depth, MR_Unsigned *num_nodes,
-                        MR_Decl_Search_Mode *search_mode,
+                        MR_DeclSearchMode *search_mode,
                         MR_bool *search_mode_was_set,
                         MR_bool *search_mode_requires_trace_counts,
                         char **pass_trace_counts_file,
@@ -46,10 +46,10 @@
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_dd(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_dd(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
-    MR_Decl_Search_Mode search_mode;
+    MR_DeclSearchMode   search_mode;
     MR_bool             search_mode_was_set = MR_FALSE;
     MR_bool             new_session = MR_TRUE;
     MR_bool             search_mode_requires_trace_counts = MR_FALSE;
@@ -59,7 +59,7 @@
     MR_bool             testing = MR_FALSE;
     MR_bool             debug = MR_FALSE;
     const char          *filename;
-    MR_Decl_Mode        decl_mode;
+    MR_DeclMode         decl_mode;
 
     MR_trace_decl_assume_all_io_is_tabled = MR_FALSE;
     MR_edt_default_depth_limit = MR_TRACE_DECL_INITIAL_DEPTH;
@@ -128,18 +128,18 @@
 }
 
 MR_Next
-MR_trace_cmd_trust(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_trust(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
-    MR_Proc_Spec        spec;
-    MR_Matches_Info     matches;
+    MR_ProcSpec         spec;
+    MR_MatchesInfo      matches;
 
     if (word_count == 2) {
         spec.MR_proc_module = NULL;
         spec.MR_proc_name   = NULL;
         spec.MR_proc_arity  = -1;
         spec.MR_proc_mode   = -1;
-        spec.MR_proc_prefix = (MR_Proc_Prefix) -1;
+        spec.MR_proc_prefix = (MR_ProcPrefix) -1;
 
         MR_register_all_modules_and_procs(MR_mdb_out, MR_TRUE);
 
@@ -221,8 +221,8 @@
 }
 
 MR_Next
-MR_trace_cmd_untrust(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_untrust(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int i;
 
@@ -237,8 +237,8 @@
 }
 
 MR_Next
-MR_trace_cmd_trusted(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_trusted(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 1) {
         MR_decl_print_all_trusted(MR_mdb_out, MR_FALSE);
@@ -278,7 +278,7 @@
 static MR_bool
 MR_trace_options_dd(MR_bool *assume_all_io_is_tabled,
     MR_Unsigned *default_depth, MR_Unsigned *num_nodes,
-    MR_Decl_Search_Mode *search_mode, MR_bool *search_mode_was_set,
+    MR_DeclSearchMode *search_mode, MR_bool *search_mode_was_set,
     MR_bool *search_mode_requires_trace_counts,
     char **pass_trace_counts_file, char **fail_trace_counts_file,
     MR_bool *new_session, MR_bool *testing,  MR_bool *debug,
Index: trace/mercury_trace_cmd_dd.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_dd.h,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_dd.h
--- trace/mercury_trace_cmd_dd.h	4 Apr 2006 07:37:28 -0000	1.1
+++ trace/mercury_trace_cmd_dd.h	26 Nov 2006 23:05:23 -0000
@@ -8,7 +8,7 @@
 */
 
 #include "mercury_imp.h"
-#include "mercury_stack_trace.h" /* for MR_Context_Position  */
+#include "mercury_stack_trace.h" /* for MR_ContextPosition  */
 
 #include "mercury_trace_cmds.h"
 
Index: trace/mercury_trace_cmd_developer.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_developer.c,v
retrieving revision 1.3
diff -u -r1.3 mercury_trace_cmd_developer.c
--- trace/mercury_trace_cmd_developer.c	20 Aug 2006 05:41:45 -0000	1.3
+++ trace/mercury_trace_cmd_developer.c	26 Nov 2006 23:09:55 -0000
@@ -37,11 +37,11 @@
 
 /****************************************************************************/
 
-static  void        MR_trace_cmd_nondet_stack_2(MR_Event_Info *event_info,
+static  void        MR_trace_cmd_nondet_stack_2(MR_EventInfo *event_info,
                         MR_bool detailed, int frame_limit, int line_limit);
 
-static  const MR_Proc_Layout
-                    *MR_find_single_matching_proc(MR_Proc_Spec *spec,
+static  const MR_ProcLayout
+                    *MR_find_single_matching_proc(MR_ProcSpec *spec,
                         MR_bool verbose);
 
 /*
@@ -49,7 +49,7 @@
 ** input arguments of tabled procedures. We use them to decode the call tables
 ** of such procedures.
 **
-** We use one MR_Call_Table_Arg structure for each input argument.
+** We use one MR_CallTableArg structure for each input argument.
 **
 ** The step field specifies what data structure the tabling system uses to
 ** implement the trie nodes at the level of the call table corresponding to
@@ -85,7 +85,7 @@
 ** value itself. (The contents of the cur_value field can be deduced from the
 ** contents of the other fields with use 2, but not with use 1.)
 **
-** The valid field in the MR_Call_Table_Arg structure gives the validity
+** The valid field in the MR_CallTableArg structure gives the validity
 ** of the values subfield of its arg_values field; if it is false, then the
 ** array is logically considered empty.
 */
@@ -123,7 +123,7 @@
     MR_TrieNode                 MR_cta_start_node;
     MR_bool                     MR_cta_valid;
     MR_TableArgValues           MR_cta_arg_values;
-} MR_Call_Table_Arg;
+} MR_CallTableArg;
 
 #define MR_cta_int_values       MR_cta_arg_values.MR_cta_values_int.\
                                     MR_ctai_values
@@ -163,15 +163,15 @@
 static  MR_bool     MR_trace_fill_in_int_table_arg_slot(
                         MR_TrieNode *table_cur_ptr,
                         int arg_num, MR_ConstString given_arg,
-                        MR_Call_Table_Arg *call_table_arg_ptr);
+                        MR_CallTableArg *call_table_arg_ptr);
 static  MR_bool     MR_trace_fill_in_float_table_arg_slot(
                         MR_TrieNode *table_cur_ptr,
                         int arg_num, MR_ConstString given_arg,
-                        MR_Call_Table_Arg *call_table_arg_ptr);
+                        MR_CallTableArg *call_table_arg_ptr);
 static  MR_bool     MR_trace_fill_in_string_table_arg_slot(
                         MR_TrieNode *table_cur_ptr,
                         int arg_num, MR_ConstString given_arg,
-                        MR_Call_Table_Arg *call_table_arg_ptr);
+                        MR_CallTableArg *call_table_arg_ptr);
 
 /*
 ** These functions fill in the data structure describing one input argument
@@ -181,33 +181,33 @@
 */
 
 static  MR_bool     MR_update_int_table_arg_slot(MR_TrieNode *table_cur_ptr,
-                        MR_Call_Table_Arg *call_table_arg_ptr);
+                        MR_CallTableArg *call_table_arg_ptr);
 static  MR_bool     MR_update_float_table_arg_slot(MR_TrieNode *table_cur_ptr,
-                        MR_Call_Table_Arg *call_table_arg_ptr);
+                        MR_CallTableArg *call_table_arg_ptr);
 static  MR_bool     MR_update_string_table_arg_slot(MR_TrieNode *table_cur_ptr,
-                        MR_Call_Table_Arg *call_table_arg_ptr);
+                        MR_CallTableArg *call_table_arg_ptr);
 
 /* Prints the given subgoal of the given procedure to MR_mdb_out. */
-static  void        MR_trace_cmd_table_print_tip(const MR_Proc_Layout *proc,
+static  void        MR_trace_cmd_table_print_tip(const MR_ProcLayout *proc,
                         int filtered_num_inputs,
-                        MR_Call_Table_Arg *call_table_args, MR_TrieNode table);
+                        MR_CallTableArg *call_table_args, MR_TrieNode table);
 
 /* Prints the given subgoal of the given procedure to MR_mdb_out. */
-static  void        MR_trace_print_subgoal(const MR_Proc_Layout *proc,
+static  void        MR_trace_print_subgoal(const MR_ProcLayout *proc,
                         MR_Subgoal *subgoal);
-static  void        MR_trace_print_subgoal_debug(const MR_Proc_Layout *proc,
+static  void        MR_trace_print_subgoal_debug(const MR_ProcLayout *proc,
                         MR_SubgoalDebug *subgoal_debug);
 
 /* Prints the given generator of the given procedure to MR_mdb_out. */
-static  void        MR_trace_print_generator(const MR_Proc_Layout *proc,
+static  void        MR_trace_print_generator(const MR_ProcLayout *proc,
                         MR_Generator *generator);
-static  void        MR_trace_print_generator_debug(const MR_Proc_Layout *proc,
+static  void        MR_trace_print_generator_debug(const MR_ProcLayout *proc,
                         MR_GenDebug *generator_debug);
 
 /* Prints the given consumer of the given procedure to MR_mdb_out. */
-static  void        MR_trace_print_consumer(const MR_Proc_Layout *proc,
+static  void        MR_trace_print_consumer(const MR_ProcLayout *proc,
                         MR_Consumer *consumer);
-static  void        MR_trace_print_consumer_debug(const MR_Proc_Layout *proc,
+static  void        MR_trace_print_consumer_debug(const MR_ProcLayout *proc,
                         MR_ConsumerDebug *consumer_debug);
 
 /* Prints the requested information inside the given MR_TypeCtorInfo. */
@@ -247,8 +247,8 @@
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_var_details(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_var_details(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int n;
 
@@ -268,8 +268,8 @@
 }
 
 MR_Next
-MR_trace_cmd_term_size(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_term_size(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int n;
 
@@ -294,8 +294,8 @@
 }
 
 MR_Next
-MR_trace_cmd_flag(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_flag(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     const char  *name;
     MR_bool     *flagptr;
@@ -377,8 +377,8 @@
 }
 
 MR_Next
-MR_trace_cmd_subgoal(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_subgoal(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
 
@@ -410,8 +410,8 @@
 }
 
 MR_Next
-MR_trace_cmd_consumer(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_consumer(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
 
@@ -443,8 +443,8 @@
 }
 
 MR_Next
-MR_trace_cmd_gen_stack(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_gen_stack(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
 
@@ -471,8 +471,8 @@
 }
 
 MR_Next
-MR_trace_cmd_cut_stack(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_cut_stack(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
 
@@ -499,8 +499,8 @@
 }
 
 MR_Next
-MR_trace_cmd_pneg_stack(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_pneg_stack(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
 
@@ -527,8 +527,8 @@
 }
 
 MR_Next
-MR_trace_cmd_mm_stacks(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_mm_stacks(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
 
@@ -559,8 +559,8 @@
 }
 
 MR_Next
-MR_trace_cmd_nondet_stack(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_nondet_stack(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_bool     detailed;
     int         frame_limit = 0;
@@ -588,8 +588,8 @@
 }
 
 MR_Next
-MR_trace_cmd_stack_regs(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_stack_regs(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_Word     *saved_regs;
 
@@ -605,8 +605,8 @@
 }
 
 MR_Next
-MR_trace_cmd_all_regs(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_all_regs(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_Word     *saved_regs;
 
@@ -629,8 +629,8 @@
 }
 
 MR_Next
-MR_trace_cmd_debug_vars(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_debug_vars(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 1) {
         MR_print_debug_vars(MR_mdb_out, event_info);
@@ -642,8 +642,8 @@
 }
 
 MR_Next
-MR_trace_cmd_stats(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_stats(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     char    *filename;
     FILE    *fp;
@@ -695,7 +695,7 @@
 
 MR_Next
 MR_trace_cmd_print_optionals(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2 && MR_streq(words[1], "off")) {
         MR_print_optionals = MR_FALSE;
@@ -715,7 +715,7 @@
 
 MR_Next
 MR_trace_cmd_unhide_events(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2 && MR_streq(words[1], "off")) {
         MR_trace_unhide_events = MR_FALSE;
@@ -736,11 +736,11 @@
 
 MR_Next
 MR_trace_cmd_table(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
-    MR_Call_Table_Arg       *call_table_args;
-    const MR_Proc_Layout    *proc;
-    MR_Proc_Spec            spec;
+    MR_CallTableArg         *call_table_args;
+    const MR_ProcLayout     *proc;
+    MR_ProcSpec             spec;
     MR_ProcTableInfo        *pt;
     MR_TrieNode             table_cur;
     int                     num_inputs;
@@ -804,7 +804,7 @@
         return KEEP_INTERACTING;
     }
 
-    call_table_args = MR_GC_NEW_ARRAY(MR_Call_Table_Arg, num_inputs);
+    call_table_args = MR_GC_NEW_ARRAY(MR_CallTableArg, num_inputs);
     if (call_table_args == NULL) {
         MR_fatal_error("MR_trace_cmd_table: "
             "couldn't allocate call_table_args");
@@ -1038,7 +1038,7 @@
 
 MR_Next
 MR_trace_cmd_type_ctor(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     const char      *module_name;
     const char      *name;
@@ -1076,7 +1076,7 @@
 
 MR_Next
 MR_trace_cmd_class_decl(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     const char              *module_name;
     const char              *name;
@@ -1115,7 +1115,7 @@
 
 MR_Next
 MR_trace_cmd_all_type_ctors(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_bool         print_rep;
     MR_bool         print_functors;
@@ -1173,7 +1173,7 @@
 
 MR_Next
 MR_trace_cmd_all_class_decls(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_bool                 print_methods;
     MR_bool                 print_instances;
@@ -1232,7 +1232,7 @@
 
 MR_Next
 MR_trace_cmd_all_procedures(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     const char      *filename;
     MR_bool         separate;
@@ -1276,7 +1276,7 @@
 
 MR_Next
 MR_trace_cmd_ambiguity(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     const char      *filename;
     MR_bool         print_procs;
@@ -1336,10 +1336,10 @@
 /****************************************************************************/
 
 static void
-MR_trace_cmd_nondet_stack_2(MR_Event_Info *event_info, MR_bool detailed,
+MR_trace_cmd_nondet_stack_2(MR_EventInfo *event_info, MR_bool detailed,
     int frame_limit, int line_limit)
 {
-    const MR_Label_Layout   *layout;
+    const MR_LabelLayout    *layout;
     MR_Word                 *saved_regs;
 
     layout = event_info->MR_event_sll;
@@ -1360,10 +1360,10 @@
     }
 }
 
-static const MR_Proc_Layout *
-MR_find_single_matching_proc(MR_Proc_Spec *spec, MR_bool verbose)
+static const MR_ProcLayout *
+MR_find_single_matching_proc(MR_ProcSpec *spec, MR_bool verbose)
 {
-    MR_Matches_Info     matches;
+    MR_MatchesInfo      matches;
     int                 n;
     int                 i;
 
@@ -1414,7 +1414,7 @@
 static MR_bool
 MR_trace_fill_in_int_table_arg_slot(MR_TrieNode *table_cur_ptr,
     int arg_num, MR_ConstString given_arg,
-    MR_Call_Table_Arg *call_table_arg_ptr)
+    MR_CallTableArg *call_table_arg_ptr)
 {
     MR_Integer  n;
     MR_TrieNode table_next;
@@ -1446,7 +1446,7 @@
 static MR_bool
 MR_trace_fill_in_float_table_arg_slot(MR_TrieNode *table_cur_ptr,
     int arg_num, MR_ConstString given_arg,
-    MR_Call_Table_Arg *call_table_arg_ptr)
+    MR_CallTableArg *call_table_arg_ptr)
 {
     MR_Float    f;
     MR_TrieNode table_next;
@@ -1478,7 +1478,7 @@
 static MR_bool
 MR_trace_fill_in_string_table_arg_slot(MR_TrieNode *table_cur_ptr,
     int arg_num, MR_ConstString given_arg,
-    MR_Call_Table_Arg *call_table_arg_ptr)
+    MR_CallTableArg *call_table_arg_ptr)
 {
     MR_ConstString  s;
     MR_TrieNode table_next;
@@ -1506,7 +1506,7 @@
 
 static MR_bool
 MR_update_int_table_arg_slot(MR_TrieNode *table_cur_ptr,
-    MR_Call_Table_Arg *call_table_arg_ptr)
+    MR_CallTableArg *call_table_arg_ptr)
 {
     MR_TrieNode table_next;
     MR_Integer  *values;
@@ -1557,11 +1557,11 @@
 
 static MR_bool
 MR_update_float_table_arg_slot(MR_TrieNode *table_cur_ptr,
-    MR_Call_Table_Arg *call_table_arg_ptr)
+    MR_CallTableArg *call_table_arg_ptr)
 {
     MR_TrieNode table_next;
     MR_Float    *values;
-    int     value_next;
+    int         value_next;
 
     if (call_table_arg_ptr->MR_cta_valid
         && call_table_arg_ptr->MR_cta_float_values != NULL)
@@ -1608,7 +1608,7 @@
 
 static MR_bool
 MR_update_string_table_arg_slot(MR_TrieNode *table_cur_ptr,
-    MR_Call_Table_Arg *call_table_arg_ptr)
+    MR_CallTableArg *call_table_arg_ptr)
 {
     MR_TrieNode     table_next;
     MR_ConstString  *values;
@@ -1659,8 +1659,8 @@
 }
 
 static void
-MR_trace_cmd_table_print_tip(const MR_Proc_Layout *proc,
-    int num_filtered_inputs, MR_Call_Table_Arg *call_table_args,
+MR_trace_cmd_table_print_tip(const MR_ProcLayout *proc,
+    int num_filtered_inputs, MR_CallTableArg *call_table_args,
     MR_TrieNode table)
 {
     int             i;
@@ -1757,7 +1757,7 @@
 }
 
 static void
-MR_trace_print_subgoal(const MR_Proc_Layout *proc, MR_Subgoal *subgoal)
+MR_trace_print_subgoal(const MR_ProcLayout *proc, MR_Subgoal *subgoal)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
     MR_print_subgoal(MR_mdb_out, proc, subgoal);
@@ -1767,7 +1767,7 @@
 }
 
 static void
-MR_trace_print_subgoal_debug(const MR_Proc_Layout *proc,
+MR_trace_print_subgoal_debug(const MR_ProcLayout *proc,
     MR_SubgoalDebug *subgoal_debug)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_STACK_COPY
@@ -1778,7 +1778,7 @@
 }
 
 static void
-MR_trace_print_generator(const MR_Proc_Layout *proc, MR_Generator *generator)
+MR_trace_print_generator(const MR_ProcLayout *proc, MR_Generator *generator)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_OWN_STACKS
     MR_print_generator(MR_mdb_out, proc, generator);
@@ -1788,7 +1788,7 @@
 }
 
 static void
-MR_trace_print_generator_debug(const MR_Proc_Layout *proc,
+MR_trace_print_generator_debug(const MR_ProcLayout *proc,
     MR_GenDebug *generator_debug)
 {
 #ifdef  MR_USE_MINIMAL_MODEL_OWN_STACKS
@@ -1799,7 +1799,7 @@
 }
 
 static void
-MR_trace_print_consumer(const MR_Proc_Layout *proc, MR_Consumer *consumer)
+MR_trace_print_consumer(const MR_ProcLayout *proc, MR_Consumer *consumer)
 {
 #if defined(MR_USE_MINIMAL_MODEL_STACK_COPY) \
         || defined(MR_USE_MINIMAL_MODEL_OWN_STACKS)
@@ -1810,7 +1810,7 @@
 }
 
 static void
-MR_trace_print_consumer_debug(const MR_Proc_Layout *proc,
+MR_trace_print_consumer_debug(const MR_ProcLayout *proc,
     MR_ConsumerDebug *consumer_debug)
 {
 #if defined(MR_USE_MINIMAL_MODEL_STACK_COPY)
Index: trace/mercury_trace_cmd_exp.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_exp.c,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_exp.c
--- trace/mercury_trace_cmd_exp.c	4 Apr 2006 07:37:28 -0000	1.1
+++ trace/mercury_trace_cmd_exp.c	26 Nov 2006 23:05:23 -0000
@@ -54,7 +54,7 @@
 
 MR_Next
 MR_trace_cmd_histogram_all(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
 #ifdef  MR_TRACE_HISTOGRAM
 
@@ -92,7 +92,7 @@
 
 MR_Next
 MR_trace_cmd_histogram_exp(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
 #ifdef  MR_TRACE_HISTOGRAM
 
@@ -130,7 +130,7 @@
 
 MR_Next
 MR_trace_cmd_clear_histogram(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
 #ifdef  MR_TRACE_HISTOGRAM
 
@@ -155,8 +155,8 @@
 }
 
 MR_Next
-MR_trace_cmd_dice(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_dice(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     char    *pass_trace_counts_file;
     char    *fail_trace_counts_file;
Index: trace/mercury_trace_cmd_forward.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_forward.c,v
retrieving revision 1.2
diff -u -r1.2 mercury_trace_cmd_forward.c
--- trace/mercury_trace_cmd_forward.c	24 Nov 2006 03:48:27 -0000	1.2
+++ trace/mercury_trace_cmd_forward.c	26 Nov 2006 23:10:23 -0000
@@ -31,14 +31,14 @@
 
 /****************************************************************************/
 
-static  MR_bool     MR_trace_options_movement_cmd(MR_Trace_Cmd_Info *cmd,
+static  MR_bool     MR_trace_options_movement_cmd(MR_TraceCmdInfo *cmd,
                         char ***words, int *word_count);
 
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_step(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_step(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int n;
 
@@ -63,8 +63,8 @@
 }
 
 MR_Next
-MR_trace_cmd_goto(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_goto(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_Unsigned n;
 
@@ -91,8 +91,8 @@
 }
 
 MR_Next
-MR_trace_cmd_next(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_next(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_Unsigned depth;
     int         stop_depth;
@@ -126,8 +126,8 @@
 }
 
 MR_Next
-MR_trace_cmd_finish(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_finish(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_Unsigned depth;
     int         stop_depth;
@@ -161,8 +161,8 @@
 }
 
 MR_Next
-MR_trace_cmd_fail(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_fail(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_Determinism  detism;
     MR_Unsigned     depth;
@@ -213,8 +213,8 @@
 }
 
 MR_Next
-MR_trace_cmd_exception(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_exception(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     cmd->MR_trace_strict = MR_TRUE;
     cmd->MR_trace_print_level = MR_default_print_level;
@@ -236,8 +236,8 @@
 }
 
 MR_Next
-MR_trace_cmd_return(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_return(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     cmd->MR_trace_strict = MR_TRUE;
     cmd->MR_trace_print_level = MR_default_print_level;
@@ -259,8 +259,8 @@
 }
 
 MR_Next
-MR_trace_cmd_user(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_user(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     cmd->MR_trace_strict = MR_TRUE;
     cmd->MR_trace_print_level = MR_default_print_level;
@@ -278,8 +278,8 @@
 }
 
 MR_Next
-MR_trace_cmd_forward(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_forward(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     cmd->MR_trace_strict = MR_TRUE;
     cmd->MR_trace_print_level = MR_default_print_level;
@@ -287,7 +287,7 @@
     if (! MR_trace_options_movement_cmd(cmd, &words, &word_count)) {
         ; /* the usage message has already been printed */
     } else if (word_count == 1) {
-        MR_Trace_Port   port;
+        MR_TracePort    port;
 
         port = event_info->MR_trace_port;
         if (port == MR_PORT_FAIL ||
@@ -307,8 +307,8 @@
 }
 
 MR_Next
-MR_trace_cmd_mindepth(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_mindepth(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int newdepth;
 
@@ -331,8 +331,8 @@
 }
 
 MR_Next
-MR_trace_cmd_maxdepth(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_maxdepth(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int newdepth;
 
@@ -355,17 +355,17 @@
 }
 
 MR_Next
-MR_trace_cmd_continue(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_continue(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     cmd->MR_trace_strict = MR_FALSE;
-    cmd->MR_trace_print_level = (MR_Trace_Cmd_Type) -1;
+    cmd->MR_trace_print_level = (MR_TraceCmdType) -1;
     MR_init_trace_check_integrity(cmd);
     if (! MR_trace_options_movement_cmd(cmd, &words, &word_count)) {
         ; /* the usage message has already been printed */
     } else if (word_count == 1) {
         cmd->MR_trace_cmd = MR_CMD_TO_END;
-        if (cmd->MR_trace_print_level == (MR_Trace_Cmd_Type) -1) {
+        if (cmd->MR_trace_print_level == (MR_TraceCmdType) -1) {
             /*
             ** The user did not specify the print level;
             ** select the intelligent default.
@@ -407,7 +407,7 @@
 };
 
 static MR_bool
-MR_trace_options_movement_cmd(MR_Trace_Cmd_Info *cmd,
+MR_trace_options_movement_cmd(MR_TraceCmdInfo *cmd,
     char ***words, int *word_count)
 {
     int c;
Index: trace/mercury_trace_cmd_help.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_help.c,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_help.c
--- trace/mercury_trace_cmd_help.c	4 Apr 2006 07:37:29 -0000	1.1
+++ trace/mercury_trace_cmd_help.c	26 Nov 2006 23:05:23 -0000
@@ -41,7 +41,7 @@
 
 MR_Next
 MR_trace_cmd_document_category(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int         slot;
     const char  *msg;
@@ -65,8 +65,8 @@
 }
 
 MR_Next
-MR_trace_cmd_document(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_document(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int         slot;
     const char  *msg;
@@ -91,8 +91,8 @@
 }
 
 MR_Next
-MR_trace_cmd_help(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_help(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 1) {
         MR_trace_help();
Index: trace/mercury_trace_cmd_misc.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_misc.c,v
retrieving revision 1.2
diff -u -r1.2 mercury_trace_cmd_misc.c
--- trace/mercury_trace_cmd_misc.c	13 Jun 2006 09:49:03 -0000	1.2
+++ trace/mercury_trace_cmd_misc.c	26 Nov 2006 23:05:23 -0000
@@ -43,8 +43,8 @@
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_source(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_source(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_bool ignore_errors;
     char    **args;
@@ -73,8 +73,8 @@
 }
 
 MR_Next
-MR_trace_cmd_save(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_save(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         FILE    *fp;
@@ -212,8 +212,8 @@
 }
 
 MR_Next
-MR_trace_cmd_quit(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_quit(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_bool confirmed;
 
Index: trace/mercury_trace_cmd_parameter.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_parameter.c,v
retrieving revision 1.4
diff -u -r1.4 mercury_trace_cmd_parameter.c
--- trace/mercury_trace_cmd_parameter.c	18 Aug 2006 05:56:23 -0000	1.4
+++ trace/mercury_trace_cmd_parameter.c	26 Nov 2006 23:10:54 -0000
@@ -22,7 +22,7 @@
 
 #include "mercury_std.h"
 #include "mercury_getopt.h"
-#include "mercury_stack_trace.h"    /* for MR_Context_Position  */
+#include "mercury_stack_trace.h"    /* for MR_ContextPosition  */
 #include "mercury_string.h"
 
 #include "mercury_trace.h"
@@ -41,7 +41,7 @@
 
 char                    *MR_mmc_options = NULL;
 
-MR_Trace_Print_Level    MR_default_print_level = MR_PRINT_LEVEL_SOME;
+MR_TracePrintLevel      MR_default_print_level = MR_PRINT_LEVEL_SOME;
 
 MR_bool                 MR_scroll_control = MR_TRUE;
 int                     MR_scroll_limit = 24;
@@ -56,7 +56,7 @@
 char                    *MR_dice_pass_trace_counts_file = NULL;
 char                    *MR_dice_fail_trace_counts_file = NULL;
 
-MR_Context_Position     MR_context_position = MR_CONTEXT_AFTER;
+MR_ContextPosition      MR_context_position = MR_CONTEXT_AFTER;
 
 MR_bool                 MR_print_goal_paths = MR_TRUE;
 
@@ -64,7 +64,7 @@
 
 int                     MR_num_context_lines = 2;
 
-MR_Spy_When             MR_default_breakpoint_scope = MR_SPY_INTERFACE;
+MR_SpyWhen              MR_default_breakpoint_scope = MR_SPY_INTERFACE;
 
 /****************************************************************************/
 
@@ -80,8 +80,8 @@
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_mmc_options(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_mmc_options(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     size_t len;
     size_t i;
@@ -106,8 +106,8 @@
 }
 
 MR_Next
-MR_trace_cmd_printlevel(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_printlevel(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         if (MR_streq(words[1], "none")) {
@@ -153,8 +153,8 @@
 }
 
 MR_Next
-MR_trace_cmd_scroll(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_scroll(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int n;
 
@@ -195,7 +195,7 @@
 
 MR_Next
 MR_trace_cmd_stack_default_limit(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int n;
 
@@ -249,8 +249,8 @@
 };
 
 MR_Next
-MR_trace_cmd_context(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_context(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         if (MR_streq(words[1], "none")) {
@@ -294,8 +294,8 @@
 }
 
 MR_Next
-MR_trace_cmd_goal_paths(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_goal_paths(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         if (MR_streq(words[1], "off")) {
@@ -338,8 +338,8 @@
 };
 
 MR_Next
-MR_trace_cmd_scope(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_scope(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         if (MR_streq(words[1], "all")) {
@@ -378,8 +378,8 @@
 }
 
 MR_Next
-MR_trace_cmd_echo(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_echo(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         if (MR_streq(words[1], "off")) {
@@ -418,7 +418,7 @@
 
 MR_Next
 MR_trace_cmd_list_context_lines(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int                 n;
 
@@ -436,8 +436,8 @@
 }
 
 MR_Next
-MR_trace_cmd_list_path(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_list_path(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count < 2) {
         MR_Word list;
@@ -478,7 +478,7 @@
 
 MR_Next
 MR_trace_cmd_push_list_dir(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int       i;
     MR_String aligned_word;
@@ -507,7 +507,7 @@
 
 MR_Next
 MR_trace_cmd_pop_list_dir(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count > 1) {
         MR_trace_usage_cur_cmd();
@@ -527,7 +527,7 @@
 
 MR_Next
 MR_trace_cmd_fail_trace_counts(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         if (MR_dice_fail_trace_counts_file != NULL) {
@@ -553,7 +553,7 @@
 
 MR_Next
 MR_trace_cmd_pass_trace_counts(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         if (MR_dice_pass_trace_counts_file != NULL) {
@@ -579,7 +579,7 @@
 
 MR_Next
 MR_trace_cmd_max_io_actions(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     int num_io_actions;
 
@@ -617,7 +617,7 @@
 
 MR_Next
 MR_trace_cmd_xml_browser_cmd(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         char    *copied_value;
@@ -655,7 +655,7 @@
 
 MR_Next
 MR_trace_cmd_xml_tmp_filename(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         char    *copied_value;
@@ -693,9 +693,9 @@
 
 MR_Next
 MR_trace_cmd_format(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
-    MR_Browse_Format    new_format;
+    MR_BrowseFormat    new_format;
     MR_Word             print;
     MR_Word             browse;
     MR_Word             print_all;
@@ -724,7 +724,7 @@
 
 MR_Next
 MR_trace_cmd_format_param(char **words, int word_count,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_Word             print;
     MR_Word             browse;
@@ -792,8 +792,8 @@
 }
 
 MR_Next
-MR_trace_cmd_alias(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_alias(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 1) {
         MR_trace_print_all_aliases(MR_mdb_out, MR_FALSE);
@@ -814,8 +814,8 @@
 }
 
 MR_Next
-MR_trace_cmd_unalias(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_unalias(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 2) {
         if (MR_trace_remove_alias(words[1])) {
Index: trace/mercury_trace_cmd_parameter.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_parameter.h,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_parameter.h
--- trace/mercury_trace_cmd_parameter.h	4 Apr 2006 07:37:29 -0000	1.1
+++ trace/mercury_trace_cmd_parameter.h	26 Nov 2006 23:11:07 -0000
@@ -12,7 +12,7 @@
 #include "mercury_stack_trace.h"    /* for MR_Context_Position  */
 
 #include "mercury_trace_cmds.h"
-#include "mercury_trace_spy.h"      /* for MR_Spy_When          */
+#include "mercury_trace_spy.h"      /* for MR_SpyWhen          */
 
 /*
 ** Options to pass to mmc when compiling queries.
@@ -25,7 +25,7 @@
 ** we don't stop.
 */
 
-extern  MR_Trace_Print_Level MR_default_print_level;
+extern  MR_TracePrintLevel MR_default_print_level;
 
 /*
 ** These variables say (a) whether the printing of event sequences will pause
@@ -80,7 +80,7 @@
 ** and if so, where.
 */
 
-extern  MR_Context_Position MR_context_position;
+extern  MR_ContextPosition  MR_context_position;
 
 /*
 ** MR_print_goal_paths specifies whether we print goal paths at events.
@@ -104,7 +104,7 @@
 
 extern  int                 MR_num_context_lines;
 
-extern  MR_Spy_When         MR_default_breakpoint_scope;
+extern  MR_SpyWhen          MR_default_breakpoint_scope;
 
 extern  MR_TraceCmdFunc     MR_trace_cmd_mmc_options;
 extern  MR_TraceCmdFunc     MR_trace_cmd_printlevel;
Index: trace/mercury_trace_cmd_queries.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_queries.c,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_queries.c
--- trace/mercury_trace_cmd_queries.c	4 Apr 2006 07:37:29 -0000	1.1
+++ trace/mercury_trace_cmd_queries.c	26 Nov 2006 23:05:23 -0000
@@ -32,24 +32,24 @@
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_query(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_query(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_trace_query(MR_NORMAL_QUERY, MR_mmc_options, word_count - 1, words + 1);
     return KEEP_INTERACTING;
 }
 
 MR_Next
-MR_trace_cmd_cc_query(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_cc_query(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_trace_query(MR_CC_QUERY, MR_mmc_options, word_count - 1, words + 1);
     return KEEP_INTERACTING;
 }
 
 MR_Next
-MR_trace_cmd_io_query(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_io_query(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_trace_query(MR_IO_QUERY, MR_mmc_options, word_count - 1, words + 1);
     return KEEP_INTERACTING;
Index: trace/mercury_trace_cmd_table_io.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_table_io.c,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmd_table_io.c
--- trace/mercury_trace_cmd_table_io.c	4 Apr 2006 07:37:30 -0000	1.1
+++ trace/mercury_trace_cmd_table_io.c	26 Nov 2006 23:05:23 -0000
@@ -35,8 +35,8 @@
 /****************************************************************************/
 
 MR_Next
-MR_trace_cmd_table_io(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_table_io(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     if (word_count == 1) {
         if (! MR_io_tabling_allowed) {
Index: trace/mercury_trace_cmds.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmds.h,v
retrieving revision 1.1
diff -u -r1.1 mercury_trace_cmds.h
--- trace/mercury_trace_cmds.h	4 Apr 2006 07:37:30 -0000	1.1
+++ trace/mercury_trace_cmds.h	26 Nov 2006 23:11:17 -0000
@@ -22,7 +22,7 @@
 } MR_Next;
 
 typedef MR_Next MR_TraceCmdFunc(char **words, int word_count,
-                    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info,
+                    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info,
                     MR_Code **jumpaddr);
 
 /*
@@ -52,7 +52,7 @@
     const char                  *MR_cmd_name;
     MR_TraceCmdFunc             *MR_cmd_function;
     const char *const           *MR_cmd_arg_strings;
-    const MR_Make_Completer     MR_cmd_arg_completer;
+    const MR_MakeCompleter      MR_cmd_arg_completer;
 } MR_Trace_Command_Info;
 
 #endif  /* MERCURY_TRACE_CMDS_H */
Index: trace/mercury_trace_completion.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_completion.c,v
retrieving revision 1.4
diff -u -r1.4 mercury_trace_completion.c
--- trace/mercury_trace_completion.c	10 Nov 2006 03:24:16 -0000	1.4
+++ trace/mercury_trace_completion.c	26 Nov 2006 23:13:57 -0000
@@ -40,16 +40,16 @@
 ** Complete on NULL terminated array of strings.
 ** The strings will not be `free'd.
 */
-static  MR_Completer_List   *MR_trace_string_array_completer(
+static  MR_CompleterList    *MR_trace_string_array_completer(
                                 const char *const *strings);
 
 static  char                *MR_trace_completer_list_next(const char *word,
-                                size_t word_len, MR_Completer_List **list);
+                                size_t word_len, MR_CompleterList **list);
 static  void                MR_trace_free_completer_list(
-                                MR_Completer_List *completer_list);
+                                MR_CompleterList *completer_list);
 
 static  char                *MR_prepend_string(char *completion,
-                                MR_Completer_Data *data);
+                                MR_CompleterData *data);
 
 /*---------------------------------------------------------------------------*/
 /*
@@ -66,7 +66,7 @@
 #ifdef MR_NO_USE_READLINE
     return NULL;
 #else
-    static MR_Completer_List    *completer_list;
+    static MR_CompleterList     *completer_list;
     static char                 *word;
     static size_t               word_len;
     char                        *completion;
@@ -119,8 +119,8 @@
             /* We're completing the command itself. */
             int                 num_digits;
             char                *digits;
-            MR_Completer_List   *command_completer;
-            MR_Completer_List   *alias_completer;
+            MR_CompleterList    *command_completer;
+            MR_CompleterList    *alias_completer;
 
             /*
             ** Strip off any number preceding the command
@@ -156,9 +156,9 @@
             int                 command_len;
             char                **words;
             int                 word_count;
-            MR_Make_Completer   command_completer;
+            MR_MakeCompleter    command_completer;
             const char *const   *command_fixed_args;
-            MR_Completer_List   *arg_completer;
+            MR_CompleterList    *arg_completer;
 
             command_len = command_end - command_start;
             if (command_len >= MR_MAX_COMMAND_NAME_LEN) {
@@ -218,7 +218,7 @@
 }
 
 static char *
-MR_prepend_string(char *string, MR_Completer_Data *data)
+MR_prepend_string(char *string, MR_CompleterData *data)
 {
     char    *string_to_prepend;
     int     string_to_prepend_len;
@@ -237,9 +237,9 @@
 
 static char *
 MR_trace_completer_list_next(const char *word, size_t word_len,
-    MR_Completer_List **list)
+    MR_CompleterList **list)
 {
-    MR_Completer_List   *current_completer;
+    MR_CompleterList    *current_completer;
     char                *result;
 
     if (list == NULL) {
@@ -265,9 +265,10 @@
 }
 
 static void
-MR_trace_free_completer_list(MR_Completer_List *completer_list)
+MR_trace_free_completer_list(MR_CompleterList *completer_list)
 {
-    MR_Completer_List *tmp_list;
+    MR_CompleterList    *tmp_list;
+
     while (completer_list != NULL) {
         tmp_list = completer_list;
         completer_list = completer_list->MR_completer_list_next;
@@ -280,7 +281,7 @@
 /*---------------------------------------------------------------------------*/
 /* No completions. */
 
-MR_Completer_List *
+MR_CompleterList *
 MR_trace_null_completer(const char *word, size_t word_len)
 {
     return NULL;
@@ -290,22 +291,22 @@
 /* Complete on the labels of a sorted array. */
 
 typedef struct {
-    MR_Get_Slot_Name    MR_sorted_array_get_slot_name;
-    int                 MR_sorted_array_current_offset;
-    int                 MR_sorted_array_size;
-} MR_Sorted_Array_Completer_Data;
+    MR_GetSlotName  MR_sorted_array_get_slot_name;
+    int             MR_sorted_array_current_offset;
+    int             MR_sorted_array_size;
+} MR_SortedArrayCompleterData;
 
 static  char    *MR_trace_sorted_array_completer_next(const char *word,
-                    size_t word_length, MR_Completer_Data *data);
+                    size_t word_length, MR_CompleterData *data);
 
-MR_Completer_List *
+MR_CompleterList *
 MR_trace_sorted_array_completer(const char *word, size_t word_length,
-    int array_size, MR_Get_Slot_Name get_slot_name)
+    int array_size, MR_GetSlotName get_slot_name)
 {
-    MR_Completer_List               *completer;
-    MR_bool                         found;
-    int                             slot;
-    MR_Sorted_Array_Completer_Data  *data;
+    MR_CompleterList            *completer;
+    MR_bool                     found;
+    int                         slot;
+    MR_SortedArrayCompleterData *data;
 
     /*
     ** Find the slot containing the first possible match, optimizing for the
@@ -320,13 +321,12 @@
     }
 
     if (found) {
-        data = MR_NEW(MR_Sorted_Array_Completer_Data);
+        data = MR_NEW(MR_SortedArrayCompleterData);
         data->MR_sorted_array_get_slot_name = get_slot_name;
         data->MR_sorted_array_current_offset = slot;
         data->MR_sorted_array_size = array_size;
-        completer = MR_new_completer_elem(
-            MR_trace_sorted_array_completer_next,
-            (MR_Completer_Data) data, MR_free_func);
+        completer = MR_new_completer_elem(MR_trace_sorted_array_completer_next,
+            (MR_CompleterData) data, MR_free_func);
     } else {
         completer = NULL;
     }
@@ -335,12 +335,12 @@
 
 static char *
 MR_trace_sorted_array_completer_next(const char *word,
-    size_t word_length, MR_Completer_Data *completer_data)
+    size_t word_length, MR_CompleterData *completer_data)
 {
-    MR_Sorted_Array_Completer_Data  *data;
-    char                            *completion;
+    MR_SortedArrayCompleterData *data;
+    char                        *completion;
 
-    data = (MR_Sorted_Array_Completer_Data *) *completer_data;
+    data = (MR_SortedArrayCompleterData *) *completer_data;
 
     if (data->MR_sorted_array_current_offset < data->MR_sorted_array_size) {
         completion = data->MR_sorted_array_get_slot_name(
@@ -359,34 +359,34 @@
 /*---------------------------------------------------------------------------*/
 /* Complete on the elements of an unsorted array of strings. */
 
-typedef struct MR_String_Array_Completer_Data_struct {
+typedef struct MR_StringArrayCompleterData_struct {
     char    **MR_string_array;
     int     MR_string_array_current_offset;
-} MR_String_Array_Completer_Data;
+} MR_StringArrayCompleterData;
 
 static  char    *MR_trace_string_array_completer_next(const char *word,
-                    size_t word_len, MR_Completer_Data *data);
+                    size_t word_len, MR_CompleterData *data);
 
-static MR_Completer_List *
+static MR_CompleterList *
 MR_trace_string_array_completer(const char *const *strings)
 {
-    MR_String_Array_Completer_Data  *data;
+    MR_StringArrayCompleterData *data;
 
-    data = MR_NEW(MR_String_Array_Completer_Data);
+    data = MR_NEW(MR_StringArrayCompleterData);
     data->MR_string_array = (char **) strings;
     data->MR_string_array_current_offset = 0;
     return MR_new_completer_elem(&MR_trace_string_array_completer_next,
-        (MR_Completer_Data) data, MR_free_func);
+        (MR_CompleterData) data, MR_free_func);
 }
 
 static char *
 MR_trace_string_array_completer_next(const char *word, size_t word_len,
-    MR_Completer_Data *data)
+    MR_CompleterData *data)
 {
-    MR_String_Array_Completer_Data  *completer_data;
-    char                            *result;
+    MR_StringArrayCompleterData *completer_data;
+    char                        *result;
 
-    completer_data = (MR_String_Array_Completer_Data *) *data;
+    completer_data = (MR_StringArrayCompleterData *) *data;
 
     while (1) {
         result = completer_data->MR_string_array[
@@ -406,18 +406,18 @@
 /* Use Readline's filename completer. */
 
 static  char    *MR_trace_filename_completer_next(const char *word,
-                    size_t word_len, MR_Completer_Data *);
+                    size_t word_len, MR_CompleterData *);
 
-MR_Completer_List *
+MR_CompleterList *
 MR_trace_filename_completer(const char *word, size_t word_len)
 {
     return MR_new_completer_elem(&MR_trace_filename_completer_next,
-        (MR_Completer_Data) 0, MR_trace_no_free);
+        (MR_CompleterData) 0, MR_trace_no_free);
 }
 
 static char *
 MR_trace_filename_completer_next(const char *word, size_t word_len,
-    MR_Completer_Data *data)
+    MR_CompleterData *data)
 {
 #ifdef MR_NO_USE_READLINE
     return NULL;
@@ -425,7 +425,7 @@
     MR_Integer  state;
 
     state = (MR_Integer) *data;
-    *data = (MR_Completer_Data) 1;
+    *data = (MR_CompleterData) 1;
     return filename_completion_function((char *) word, (int) state);
 #endif /* ! MR_NO_USE_READLINE */
 }
@@ -434,22 +434,22 @@
 /* Apply a filter to the output of a completer. */
 
 typedef struct {
-    MR_Completer_Filter     MR_filter_func;
-    MR_Completer_Data       MR_filter_data;
-    MR_Free_Completer_Data  MR_filter_free_data;
-    MR_Completer_List       *MR_filter_list;
+    MR_CompleterFilter      MR_filter_func;
+    MR_CompleterData        MR_filter_data;
+    MR_FreeCompleterData    MR_filter_free_data;
+    MR_CompleterList        *MR_filter_list;
 } MR_Filter_Completer_Data;
 
 static  char    *MR_trace_filter_completer_next(const char *word,
-                    size_t word_len, MR_Completer_Data *);
-static  void    MR_trace_free_filter_completer_data(MR_Completer_Data data);
+                    size_t word_len, MR_CompleterData *);
+static  void    MR_trace_free_filter_completer_data(MR_CompleterData data);
 
-MR_Completer_List *
-MR_trace_filter_completer(MR_Completer_Filter filter,
-    MR_Completer_Data filter_data, MR_Free_Completer_Data free_filter_data,
-    MR_Completer_List *list)
+MR_CompleterList *
+MR_trace_filter_completer(MR_CompleterFilter filter,
+    MR_CompleterData filter_data, MR_FreeCompleterData free_filter_data,
+    MR_CompleterList *list)
 {
-    MR_Filter_Completer_Data *data;
+    MR_Filter_Completer_Data    *data;
 
     data = MR_NEW(MR_Filter_Completer_Data);
     data->MR_filter_func = filter;
@@ -457,12 +457,12 @@
     data->MR_filter_free_data = free_filter_data;
     data->MR_filter_list = list;
     return MR_new_completer_elem(MR_trace_filter_completer_next,
-        (MR_Completer_Data) data, MR_trace_free_filter_completer_data);
+        (MR_CompleterData) data, MR_trace_free_filter_completer_data);
 }
 
 static char *
 MR_trace_filter_completer_next(const char *word, size_t word_len,
-    MR_Completer_Data *completer_data)
+    MR_CompleterData *completer_data)
 {
     MR_Filter_Completer_Data    *data;
     char                        *completion;
@@ -482,7 +482,7 @@
 }
 
 static void
-MR_trace_free_filter_completer_data(MR_Completer_Data completer_data)
+MR_trace_free_filter_completer_data(MR_CompleterData completer_data)
 {
     MR_Filter_Completer_Data    *data;
 
@@ -497,38 +497,38 @@
 
 typedef struct {
     MR_Completer_Map        MR_map_func;
-    MR_Completer_Data       MR_map_data;
-    MR_Free_Completer_Data  MR_map_free_data;
-    MR_Completer_List       *MR_map_list;
-} MR_Map_Completer_Data;
+    MR_CompleterData        MR_map_data;
+    MR_FreeCompleterData    MR_map_free_data;
+    MR_CompleterList        *MR_map_list;
+} MR_MapCompleterData;
 
 static  char    *MR_trace_map_completer_next(const char *word,
-                    size_t word_len, MR_Completer_Data *);
-static  void    MR_trace_free_map_completer_data(MR_Completer_Data data);
+                    size_t word_len, MR_CompleterData *);
+static  void    MR_trace_free_map_completer_data(MR_CompleterData data);
 
-MR_Completer_List *
-MR_trace_map_completer(MR_Completer_Map map, MR_Completer_Data map_data,
-    MR_Free_Completer_Data free_data, MR_Completer_List *list)
+MR_CompleterList *
+MR_trace_map_completer(MR_Completer_Map map, MR_CompleterData map_data,
+    MR_FreeCompleterData free_data, MR_CompleterList *list)
 {
-    MR_Map_Completer_Data *data;
+    MR_MapCompleterData *data;
 
-    data = MR_NEW(MR_Map_Completer_Data);
+    data = MR_NEW(MR_MapCompleterData);
     data->MR_map_func = map;
     data->MR_map_data = map_data;
     data->MR_map_free_data = free_data;
     data->MR_map_list = list;
     return MR_new_completer_elem(MR_trace_map_completer_next,
-        (MR_Completer_Data) data, MR_trace_free_map_completer_data);
+        (MR_CompleterData) data, MR_trace_free_map_completer_data);
 }
 
 static char *
 MR_trace_map_completer_next(const char *word, size_t word_len,
-    MR_Completer_Data *completer_data)
+    MR_CompleterData *completer_data)
 {
-    MR_Map_Completer_Data   *data;
-    char                    *completion;
+    MR_MapCompleterData *data;
+    char                *completion;
 
-    data = (MR_Map_Completer_Data *) *completer_data;
+    data = (MR_MapCompleterData *) *completer_data;
     completion = MR_trace_completer_list_next(word, word_len,
         &data->MR_map_list);
     if (completion == NULL) {
@@ -539,11 +539,11 @@
 }
 
 static void
-MR_trace_free_map_completer_data(MR_Completer_Data completer_data)
+MR_trace_free_map_completer_data(MR_CompleterData completer_data)
 {
-    MR_Map_Completer_Data   *data;
+    MR_MapCompleterData *data;
 
-    data = (MR_Map_Completer_Data *) completer_data;
+    data = (MR_MapCompleterData *) completer_data;
     data->MR_map_free_data(data->MR_map_data);
     MR_trace_free_completer_list(data->MR_map_list);
     MR_free(data);
@@ -551,12 +551,13 @@
 
 /*---------------------------------------------------------------------------*/
 
-MR_Completer_List *
-MR_new_completer_elem(MR_Completer completer, MR_Completer_Data data,
-    MR_Free_Completer_Data free_data)
+MR_CompleterList *
+MR_new_completer_elem(MR_Completer completer, MR_CompleterData data,
+    MR_FreeCompleterData free_data)
 {
-    MR_Completer_List *result;
-    result = MR_NEW(MR_Completer_List);
+    MR_CompleterList    *result;
+
+    result = MR_NEW(MR_CompleterList);
     result->MR_completer_func = completer;
     result->MR_completer_func_data = data;
     result->MR_free_completer_func_data = free_data;
@@ -565,6 +566,6 @@
 }
 
 void
-MR_trace_no_free(MR_Completer_Data data)
+MR_trace_no_free(MR_CompleterData data)
 {
 }
Index: trace/mercury_trace_completion.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_completion.h,v
retrieving revision 1.3
diff -u -r1.3 mercury_trace_completion.h
--- trace/mercury_trace_completion.h	10 Nov 2006 03:24:17 -0000	1.3
+++ trace/mercury_trace_completion.h	26 Nov 2006 23:14:44 -0000
@@ -37,69 +37,69 @@
 ** completions.
 */
 
-typedef void    *MR_Completer_Data;
+typedef void    *MR_CompleterData;
 typedef char    *(*MR_Completer)(const char *word, size_t word_len,
-                    MR_Completer_Data *data);
+                    MR_CompleterData *data);
 
 /* Release the memory held by the completer data. */
-typedef void    (*MR_Free_Completer_Data)(MR_Completer_Data data);
+typedef void    (*MR_FreeCompleterData)(MR_CompleterData data);
 
-typedef struct MR_Completer_List_Struct {
+typedef struct MR_CompleterList_Struct {
     MR_Completer                    MR_completer_func;
-    MR_Completer_Data               MR_completer_func_data;
-    MR_Free_Completer_Data          MR_free_completer_func_data;
-    struct MR_Completer_List_Struct *MR_completer_list_next;
-} MR_Completer_List;
+    MR_CompleterData                MR_completer_func_data;
+    MR_FreeCompleterData            MR_free_completer_func_data;
+    struct MR_CompleterList_Struct  *MR_completer_list_next;
+} MR_CompleterList;
 
-typedef MR_Completer_List   *(* MR_Make_Completer)(const char *word,
+typedef MR_CompleterList    *(* MR_MakeCompleter)(const char *word,
                                 size_t word_len);
 
 /* No completions. */
-extern  MR_Completer_List   *MR_trace_null_completer(const char *word,
+extern  MR_CompleterList    *MR_trace_null_completer(const char *word,
                                 size_t word_len);
 
 /* Use Readline's filename completer. */
-extern  MR_Completer_List   *MR_trace_filename_completer(const char *word,
+extern  MR_CompleterList    *MR_trace_filename_completer(const char *word,
                                 size_t word_len);
 
 /*
-** Construct a MR_Completer_List with the given arguments.
+** Construct a MR_CompleterList with the given arguments.
 ** The MR_completer_list_next field of the structure will be NULL.
 */
 
-extern  MR_Completer_List   *MR_new_completer_elem(MR_Completer completer,
-                                MR_Completer_Data data,
-                                MR_Free_Completer_Data free_data);
+extern  MR_CompleterList    *MR_new_completer_elem(MR_Completer completer,
+                                MR_CompleterData data,
+                                MR_FreeCompleterData free_data);
 
 /* Used where the completer data is not malloc'ed. */
-extern  void                MR_trace_no_free(MR_Completer_Data);
+extern  void                MR_trace_no_free(MR_CompleterData);
 
 /*
 ** Complete on the labels of the elements of a sorted array.
-** A function of type MR_Get_Slot_Name is used to get the label of the
+** A function of type MR_GetSlotName is used to get the label of the
 ** element at the given index in the array.
 */
 
-typedef char                *(*MR_Get_Slot_Name)(int slot);
+typedef char                *(*MR_GetSlotName)(int slot);
 
-extern  MR_Completer_List   *MR_trace_sorted_array_completer(const char *word,
+extern  MR_CompleterList    *MR_trace_sorted_array_completer(const char *word,
                                 size_t word_length, int array_size,
-                                MR_Get_Slot_Name get_slot_name);
+                                MR_GetSlotName get_slot_name);
 
 /*
 ** Apply a filter to the output of a completer.
-** Functions of type MR_Completer_Filter return MR_TRUE if the given
+** Functions of type MR_CompleterFilter return MR_TRUE if the given
 ** string should be included in the list of completions.
 */
 
-typedef MR_bool (*MR_Completer_Filter)(const char *completion,
-                    MR_Completer_Data *data);
+typedef MR_bool            (*MR_CompleterFilter)(const char *completion,
+                                MR_CompleterData *data);
 
-extern MR_Completer_List    *MR_trace_filter_completer(
-                                MR_Completer_Filter filter,
-                                MR_Completer_Data data,
-                                MR_Free_Completer_Data free_data,
-                                MR_Completer_List *list);
+extern MR_CompleterList     *MR_trace_filter_completer(
+                                MR_CompleterFilter filter,
+                                MR_CompleterData data,
+                                MR_FreeCompleterData free_data,
+                                MR_CompleterList *list);
 
 /*
 ** Apply a mapping function to the output of a completer.
@@ -108,10 +108,10 @@
 */
 
 typedef char                *(*MR_Completer_Map)(char *completion,
-                                MR_Completer_Data *data);
-extern MR_Completer_List    *MR_trace_map_completer(MR_Completer_Map map_func,
-                                MR_Completer_Data data,
-                                MR_Free_Completer_Data free_data,
-                                MR_Completer_List *list);
+                                MR_CompleterData *data);
+extern MR_CompleterList     *MR_trace_map_completer(MR_Completer_Map map_func,
+                                MR_CompleterData data,
+                                MR_FreeCompleterData free_data,
+                                MR_CompleterList *list);
 
 #endif /* MR_TRACE_COMPLETION_H */
Index: trace/mercury_trace_declarative.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.105
diff -u -r1.105 mercury_trace_declarative.c
--- trace/mercury_trace_declarative.c	24 Nov 2006 03:48:27 -0000	1.105
+++ trace/mercury_trace_declarative.c	27 Nov 2006 04:12:18 -0000
@@ -201,7 +201,7 @@
 ** take for a particular trace event.
 */
 
-static  MR_Decl_Mode        MR_decl_mode = MR_DECL_NODUMP;
+static  MR_DeclMode         MR_decl_mode = MR_DECL_NODUMP;
 
 /*
 ** If we are building a subtree then reaching this event will cause the
@@ -250,7 +250,7 @@
 ** the root of the new explicit subtree is returned.
 */
 
-static  MR_Trace_Node       MR_edt_return_node;
+static  MR_TraceNode        MR_edt_return_node;
 
 /*
 ** The time (in milliseconds since the start of the program) when collection of
@@ -328,7 +328,7 @@
 ** or NULL if the collection has just started.
 */
 
-static  MR_Trace_Node       MR_trace_current_node;
+static  MR_TraceNode        MR_trace_current_node;
 
 /*
 ** When in test mode, MR_trace_store_file points to an open file to
@@ -341,97 +341,97 @@
 
 /****************************************************************************/
 
-static    MR_Trace_Node     MR_trace_decl_call(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_exit(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_redo(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_fail(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_excp(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_switch(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_disj(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_cond(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_then(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_else(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_neg_enter(MR_Event_Info *event_info,
-                                MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_neg_success(
-                                MR_Event_Info *event_info, MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_decl_neg_failure(
-                                MR_Event_Info *event_info, MR_Trace_Node prev);
-static    MR_Trace_Node     MR_trace_matching_call(MR_Trace_Node node);
-static    MR_bool           MR_trace_first_disjunct(MR_Event_Info *event_info);
+static    MR_TraceNode      MR_trace_decl_call(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_exit(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_redo(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_fail(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_excp(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_switch(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_disj(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_cond(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_then(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_else(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_neg_enter(MR_EventInfo *event_info,
+                                MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_neg_success(
+                                MR_EventInfo *event_info, MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_decl_neg_failure(
+                                MR_EventInfo *event_info, MR_TraceNode prev);
+static    MR_TraceNode      MR_trace_matching_call(MR_TraceNode node);
+static    MR_bool           MR_trace_first_disjunct(MR_EventInfo *event_info);
 static    MR_bool           MR_trace_matching_cond(const char *path,
-                                MR_Trace_Node node);
+                                MR_TraceNode node);
 static    MR_bool           MR_trace_matching_neg(const char *path,
-                                MR_Trace_Node node);
+                                MR_TraceNode node);
 static    MR_bool           MR_trace_matching_disj(const char *path,
-                                MR_Trace_Node node);
+                                MR_TraceNode node);
 static    MR_bool           MR_trace_same_construct(const char *p1,
                                 const char *p2);
 static    MR_bool           MR_trace_single_component(const char *path);
 static    MR_Word           MR_decl_make_atom_args(
-                                const MR_Label_Layout *layout,
-                                MR_Word *saved_regs, MR_Trace_Port port);
-static    MR_Word           MR_decl_atom_args(const MR_Label_Layout *layout,
+                                const MR_LabelLayout *layout,
+                                MR_Word *saved_regs, MR_TracePort port);
+static    MR_Word           MR_decl_atom_args(const MR_LabelLayout *layout,
                                 MR_Word *saved_regs);
 static    const char        *MR_trace_start_collecting(MR_Unsigned event,
                                 MR_Unsigned seqno, MR_Unsigned maxdepth,
                                 MR_bool create_supertree,
-                                MR_Trace_Cmd_Info *cmd,
-                                MR_Event_Info *event_info,
+                                MR_TraceCmdInfo *cmd,
+                                MR_EventInfo *event_info,
                                 MR_Code **jumpaddr);
 static    MR_Code           *MR_trace_restart_decl_debug(
-                                MR_Trace_Node call_preceding,
+                                MR_TraceNode call_preceding,
                                 MR_Unsigned event,
                                 MR_Unsigned seqno,
                                 MR_bool create_supertree,
                                 MR_Unsigned depth_limit,
-                                MR_Trace_Cmd_Info *cmd,
-                                MR_Event_Info *event_info);
-static    MR_Code           *MR_decl_diagnosis(MR_Trace_Node root,
-                                MR_Trace_Cmd_Info *cmd,
-                                MR_Event_Info *event_info,
+                                MR_TraceCmdInfo *cmd,
+                                MR_EventInfo *event_info);
+static    MR_Code           *MR_decl_diagnosis(MR_TraceNode root,
+                                MR_TraceCmdInfo *cmd,
+                                MR_EventInfo *event_info,
                                 MR_bool new_tree);
 static    MR_Code           *MR_decl_go_to_selected_event(MR_Unsigned event,
-                                MR_Trace_Cmd_Info *cmd,
-                                MR_Event_Info *event_info);
+                                MR_TraceCmdInfo *cmd,
+                                MR_EventInfo *event_info);
 static    MR_Code           *MR_trace_decl_retry_supertree(
                                 MR_Unsigned max_distance,
-                                MR_Event_Info *event_info);
-static    MR_String         MR_trace_node_path(MR_Trace_Node node);
-static    MR_Trace_Port     MR_trace_node_port(MR_Trace_Node node);
-static    MR_Unsigned       MR_trace_node_seqno(MR_Trace_Node node);
-static    MR_Trace_Node     MR_trace_node_first_disj(MR_Trace_Node node);
-static    MR_Trace_Node     MR_trace_step_left_in_contour(MR_Trace_Node node);
-static    MR_Trace_Node     MR_trace_find_prev_contour(MR_Trace_Node node);
+                                MR_EventInfo *event_info);
+static    MR_String         MR_trace_node_path(MR_TraceNode node);
+static    MR_TracePort      MR_trace_node_port(MR_TraceNode node);
+static    MR_Unsigned       MR_trace_node_seqno(MR_TraceNode node);
+static    MR_TraceNode      MR_trace_node_first_disj(MR_TraceNode node);
+static    MR_TraceNode      MR_trace_step_left_in_contour(MR_TraceNode node);
+static    MR_TraceNode      MR_trace_find_prev_contour(MR_TraceNode node);
 static    void              MR_decl_checkpoint_event_imp(const char *str,
-                                MR_Event_Info *event_info);
+                                MR_EventInfo *event_info);
 static    void              MR_decl_checkpoint_loc(const char *str,
-                                MR_Trace_Node node);
+                                MR_TraceNode node);
 static    void              MR_decl_print_edt_stats(void);
 static    void              MR_decl_inc_constructed_nodes(void);
 static    void              MR_trace_edt_build_sanity_check(
-                                MR_Event_Info *event_info,
-                                const MR_Proc_Layout *entry);
-static    MR_bool           MR_trace_include_event(const MR_Proc_Layout *entry,
-                                MR_Event_Info *event_info,
+                                MR_EventInfo *event_info,
+                                const MR_ProcLayout *entry);
+static    MR_bool           MR_trace_include_event(const MR_ProcLayout *entry,
+                                MR_EventInfo *event_info,
                                 MR_Code **jumpaddr);
 static    MR_Unsigned       MR_trace_calculate_event_depth(
-                                MR_Event_Info *event_info);
-static    void              MR_trace_construct_node(MR_Event_Info *event_info);
+                                MR_EventInfo *event_info);
+static    void              MR_trace_construct_node(MR_EventInfo *event_info);
 static    void              MR_trace_count_event_in_implicit_subtree(
-                                MR_Event_Info *event_info, MR_Unsigned depth);
+                                MR_EventInfo *event_info, MR_Unsigned depth);
 static    void              MR_trace_maybe_update_implicit_tree_ideal_depth(
-                                MR_Unsigned depth, MR_Trace_Node call);
+                                MR_Unsigned depth, MR_TraceNode call);
 static    void              MR_trace_finish_progress(void);
 static    void              MR_trace_init_implicit_subtree_counters(
                                 MR_Unsigned size);
@@ -439,7 +439,7 @@
 static    void              MR_trace_free_implicit_subtree_counters(void);
 static    MR_Unsigned       MR_trace_calc_implicit_subtree_ideal_depth(void);
 static    void              MR_trace_maybe_update_suspicion_accumulator(
-                                const MR_Label_Layout *label_layout);
+                                const MR_LabelLayout *label_layout);
 
 MR_bool         MR_trace_decl_assume_all_io_is_tabled = MR_FALSE;
 
@@ -464,14 +464,14 @@
 */
 
 MR_Code *
-MR_trace_decl_debug(MR_Event_Info *event_info)
+MR_trace_decl_debug(MR_EventInfo *event_info)
 {
-    const MR_Proc_Layout    *entry;
+    const MR_ProcLayout     *entry;
     MR_Unsigned             depth;
     MR_Integer              trace_suppress;
     MR_Unsigned             node_depth;
     MR_Unsigned             call_seqno;
-    MR_Trace_Port           port;
+    MR_TracePort            port;
     MR_Code                 *jumpaddr;
 
     call_seqno = event_info->MR_call_seqno;
@@ -491,13 +491,13 @@
     MR_DD_CALC_NODE_DEPTH(port, node_depth, MR_edt_depth);
 
     if (node_depth == MR_edt_max_depth
-            && (port == MR_PORT_CALL || port == MR_PORT_REDO))    
-    {                                                         
-        /*                                                    
-        ** Reset the accumulators, since we are entering the  
-        ** top of an implicit subtree.                        
-        */                                                    
-        MR_trace_reset_implicit_subtree_counters();           
+        && (port == MR_PORT_CALL || port == MR_PORT_REDO))
+    {
+        /*
+        ** Reset the accumulators, since we are entering the
+        ** top of an implicit subtree.
+        */
+        MR_trace_reset_implicit_subtree_counters();
         MR_edt_implicit_subtree_counters[0]++;
         MR_edt_implicit_subtree_depth = 0;
         MR_selected_trace_func_ptr = MR_trace_real_decl_implicit_subtree;
@@ -505,8 +505,7 @@
 
     MR_trace_construct_node(event_info);
 
-    if (call_seqno == MR_edt_start_seqno && MR_port_is_final(port))
-    {
+    if (call_seqno == MR_edt_start_seqno && MR_port_is_final(port)) {
         MR_edt_return_node = MR_trace_current_node;
     }
 
@@ -532,8 +531,8 @@
 }
 
 static void
-MR_trace_edt_build_sanity_check(MR_Event_Info *event_info,
-    const MR_Proc_Layout *entry)
+MR_trace_edt_build_sanity_check(MR_EventInfo *event_info,
+    const MR_ProcLayout *entry)
 {
     if (event_info->MR_event_number > MR_edt_last_event
         && !MR_edt_building_supertree)
@@ -554,8 +553,8 @@
 }
 
 static MR_bool
-MR_trace_include_event(const MR_Proc_Layout *entry,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_include_event(const MR_ProcLayout *entry,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     /*
     ** Filter out events for compiler generated procedures.
@@ -592,8 +591,7 @@
                 MR_port_is_final(event_info->MR_trace_port))
             {
                 /*
-                ** We are exiting the subtree rooted at
-                ** MR_edt_start_seqno.
+                ** We are exiting the subtree rooted at MR_edt_start_seqno.
                 */
                 MR_edt_inside = MR_TRUE;
                 return MR_TRUE;
@@ -601,22 +599,18 @@
                 && MR_port_is_entry(event_info->MR_trace_port))
             {
                 /*
-                ** We are entering the top of the currently
-                ** materialized portion of the annotated trace.
-                ** Since we are building a supertree we must
-                ** retry to above the current event and start
-                ** building the new portion of the annotated
-                ** trace from there.
+                ** We are entering the top of the currently materialized portion
+                ** of the annotated trace. Since we are building a supertree
+                ** we must retry to above the current event and start building
+                ** the new portion of the annotated trace from there.
                 */
                 MR_edt_inside = MR_TRUE;
                 *jumpaddr = MR_trace_decl_retry_supertree(MR_edt_max_depth,
                     event_info);
                 /*
-                ** Reset the depth since we will now
-                ** be at the top of the supertree to be
-                ** materialized.  We set it to -1 since
-                ** the next call to MR_trace_decl_debug will
-                ** set it to 0.
+                ** Reset the depth since we will now be at the top of the
+                ** supertree to be materialized.  We set it to -1 since the
+                ** next call to MR_trace_decl_debug will set it to 0.
                 */
                 MR_edt_depth = -1;
                 return MR_FALSE;
@@ -631,11 +625,9 @@
         } else {
             if (event_info->MR_call_seqno == MR_edt_start_seqno) {
                 /*
-                ** The port must be either CALL or REDO;
-                ** we are leaving the supertree and entering
-                ** the existing explicit subtree.
-                ** We must still however add this node to the
-                ** generated EDT.
+                ** The port must be either CALL or REDO; we are leaving the
+                ** supertree and entering the existing explicit subtree.
+                ** We must still however add this node to the generated EDT.
                 */
                 MR_edt_inside = MR_FALSE;
                 return MR_TRUE;
@@ -663,8 +655,7 @@
                 return MR_TRUE;
             } else {
                 /*
-                ** Ignore this event---it is outside the
-                ** topmost call.
+                ** Ignore this event -- it is outside the topmost call.
                 */
                 MR_decl_checkpoint_filter(event_info);
                 *jumpaddr = NULL;
@@ -672,13 +663,14 @@
             }
         }
     }
+
     return MR_TRUE;
 }
 
 static void
-MR_trace_construct_node(MR_Event_Info *event_info)
+MR_trace_construct_node(MR_EventInfo *event_info)
 {
-    MR_Trace_Node       trace;
+    MR_TraceNode    trace;
 
     trace = MR_trace_current_node;
 
@@ -751,6 +743,7 @@
         default:
             MR_fatal_error("MR_trace_construct_node: unknown port");
     }
+
     MR_decl_checkpoint_alloc(trace);
     MR_decl_maybe_inc_constructed_nodes();
 
@@ -767,14 +760,14 @@
 
 static MR_Code *
 MR_trace_decl_retry_supertree(MR_Unsigned max_distance,
-    MR_Event_Info *event_info)
+    MR_EventInfo *event_info)
 {
     MR_Code             *jumpaddr;
     int                 retry_distance;
     const char          *problem;
-    MR_Retry_Result     retry_result;
+    MR_RetryResult      retry_result;
     MR_bool             unsafe_retry;
-    MR_Retry_Across_Io  retry_mode;
+    MR_RetryAcrossIo    retry_mode;
 
     if (max_distance >= event_info->MR_call_depth) {
         retry_distance = event_info->MR_call_depth - 1;
@@ -816,16 +809,16 @@
     return jumpaddr;
 }
 
-static MR_Trace_Node
-MR_trace_decl_call(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_call(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node               node;
+    MR_TraceNode                node;
     MR_Word                     atom_args;
     MR_bool                     at_depth_limit;
-    const MR_Label_Layout       *event_label_layout;
-    const MR_Proc_Layout        *event_proc_layout;
-    const MR_Label_Layout       *return_label_layout;
-    MR_Stack_Walk_Step_Result   result;
+    const MR_LabelLayout        *event_label_layout;
+    const MR_ProcLayout         *event_proc_layout;
+    const MR_LabelLayout        *return_label_layout;
+    MR_StackWalkStepResult      result;
     MR_ConstString              problem;
     MR_Word                     *base_sp;
     MR_Word                     *base_curfr;
@@ -853,13 +846,12 @@
 
     MR_TRACE_CALL_MERCURY(
         if (result == MR_STEP_OK && return_label_layout != NULL) {
-            maybe_return_label = MR_DD_make_yes_maybe_label(
-                return_label_layout);
+            maybe_return_label = MR_DD_make_yes_maybe_label(return_label_layout);
         } else {
             maybe_return_label = MR_DD_make_no_maybe_label();
         }
 
-        node = (MR_Trace_Node) MR_DD_construct_call_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_call_node((MR_Word) prev,
             atom_args, (MR_Word) event_info->MR_call_seqno,
             (MR_Word) event_info->MR_event_number,
             (MR_Word) at_depth_limit, maybe_return_label,
@@ -870,11 +862,11 @@
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_exit(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_exit(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node   node;
-    MR_Trace_Node   call;
+    MR_TraceNode    node;
+    MR_TraceNode    call;
     MR_Word         last_interface;
     MR_Word         atom_args;
 
@@ -893,7 +885,7 @@
         MR_trace_maybe_update_implicit_tree_ideal_depth(
             MR_edt_depth + 1, call);
         last_interface = MR_DD_call_node_get_last_interface((MR_Word) call);
-        node = (MR_Trace_Node) MR_DD_construct_exit_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_exit_node((MR_Word) prev,
             (MR_Word) call, last_interface, atom_args,
             (MR_Word) event_info->MR_event_number, event_info->MR_event_sll,
             MR_io_tabling_counter, MR_edt_suspicion_accumulator);
@@ -903,12 +895,12 @@
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_redo(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_redo(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node   node;
-    MR_Trace_Node   call;
-    MR_Trace_Node   next;
+    MR_TraceNode    node;
+    MR_TraceNode    call;
+    MR_TraceNode    next;
     MR_Word         last_interface;
 
     /*
@@ -934,7 +926,7 @@
 
     MR_TRACE_CALL_MERCURY(
         last_interface = MR_DD_call_node_get_last_interface((MR_Word) call);
-        node = (MR_Trace_Node) MR_DD_construct_redo_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_redo_node((MR_Word) prev,
             last_interface, (MR_Word) event_info->MR_event_number,
             event_info->MR_event_sll, MR_edt_suspicion_accumulator);
         MR_DD_call_node_set_last_interface((MR_Word) call, (MR_Word) node);
@@ -943,12 +935,12 @@
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_fail(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_fail(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node   node;
-    MR_Trace_Node   next;
-    MR_Trace_Node   call;
+    MR_TraceNode    node;
+    MR_TraceNode    next;
+    MR_TraceNode    call;
     MR_Word         redo;
 
     if (MR_trace_node_port(prev) == MR_PORT_CALL) {
@@ -972,7 +964,7 @@
         MR_trace_maybe_update_implicit_tree_ideal_depth(
             MR_edt_depth + 1, call);
         redo = MR_DD_call_node_get_last_interface((MR_Word) call);
-        node = (MR_Trace_Node) MR_DD_construct_fail_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_fail_node((MR_Word) prev,
             (MR_Word) call, (MR_Word) redo,
             (MR_Word) event_info->MR_event_number, event_info->MR_event_sll,
             MR_edt_suspicion_accumulator);
@@ -982,12 +974,12 @@
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_excp(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_excp(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node node;
-    MR_Trace_Node call;
-    MR_Word       last_interface;
+    MR_TraceNode    node;
+    MR_TraceNode    call;
+    MR_Word         last_interface;
 
     call = MR_trace_matching_call(prev);
     MR_decl_checkpoint_match(call);
@@ -1011,25 +1003,25 @@
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_cond(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_cond(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node        node;
+    MR_TraceNode    node;
 
     MR_TRACE_CALL_MERCURY(
-        node = (MR_Trace_Node) MR_DD_construct_cond_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_cond_node((MR_Word) prev,
             event_info->MR_event_sll);
     );
 
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_then(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_then(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node   node;
-    MR_Trace_Node   next;
-    MR_Trace_Node   cond;
+    MR_TraceNode    node;
+    MR_TraceNode    next;
+    MR_TraceNode    cond;
     const char      *path = event_info->MR_event_path;
 
     /*
@@ -1045,17 +1037,17 @@
 
     MR_TRACE_CALL_MERCURY(
         MR_DD_cond_node_set_status((MR_Word) cond, MR_TRACE_STATUS_SUCCEEDED);
-        node = (MR_Trace_Node) MR_DD_construct_then_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_then_node((MR_Word) prev,
             (MR_Word) cond, event_info->MR_event_sll);
     );
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_else(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_else(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node   node;
-    MR_Trace_Node   cond;
+    MR_TraceNode    node;
+    MR_TraceNode    cond;
     const char      *path = event_info->MR_event_path;
 
     /*
@@ -1064,7 +1056,7 @@
     if (MR_trace_matching_cond(path, prev)) {
         cond = prev;
     } else {
-        MR_Trace_Node        next;
+        MR_TraceNode    next;
 
         next = prev;
         while (!MR_trace_matching_cond(path, next)) {
@@ -1077,30 +1069,30 @@
 
     MR_TRACE_CALL_MERCURY(
         MR_DD_cond_node_set_status((MR_Word) cond, MR_TRACE_STATUS_FAILED);
-        node = (MR_Trace_Node) MR_DD_construct_else_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_else_node((MR_Word) prev,
             (MR_Word) cond, event_info->MR_event_sll);
     );
 
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_neg_enter(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_neg_enter(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node node;
+    MR_TraceNode    node;
 
     MR_TRACE_CALL_MERCURY(
-        node = (MR_Trace_Node) MR_DD_construct_neg_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_neg_node((MR_Word) prev,
             event_info->MR_event_sll);
     );
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_neg_success(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_neg_success(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node   node;
-    MR_Trace_Node   nege;
+    MR_TraceNode    node;
+    MR_TraceNode    nege;
     const char      *path = event_info->MR_event_path;
 
     /*
@@ -1109,7 +1101,7 @@
     if (MR_trace_matching_neg(path, prev)) {
         nege = MR_trace_current_node;
     } else {
-        MR_Trace_Node   next;
+        MR_TraceNode    next;
 
         next = prev;
         while (!MR_trace_matching_neg(path, next)) {
@@ -1122,18 +1114,18 @@
 
     MR_TRACE_CALL_MERCURY(
         MR_DD_neg_node_set_status((MR_Word) nege, MR_TRACE_STATUS_SUCCEEDED);
-        node = (MR_Trace_Node) MR_DD_construct_neg_succ_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_neg_succ_node((MR_Word) prev,
             (MR_Word) nege, event_info->MR_event_sll);
     );
 
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_neg_failure(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_neg_failure(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node   node;
-    MR_Trace_Node   next;
+    MR_TraceNode    node;
+    MR_TraceNode    next;
 
     /*
     ** Search through current contour for a matching NEGE event.
@@ -1147,40 +1139,40 @@
 
     MR_TRACE_CALL_MERCURY(
         MR_DD_neg_node_set_status((MR_Word) next, MR_TRACE_STATUS_FAILED);
-        node = (MR_Trace_Node) MR_DD_construct_neg_fail_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_neg_fail_node((MR_Word) prev,
             (MR_Word) next, event_info->MR_event_sll);
     );
 
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_switch(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_switch(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node   node;
+    MR_TraceNode    node;
 
     MR_TRACE_CALL_MERCURY(
-        node = (MR_Trace_Node) MR_DD_construct_switch_node((MR_Word) prev,
+        node = (MR_TraceNode) MR_DD_construct_switch_node((MR_Word) prev,
             event_info->MR_event_sll);
     );
 
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_decl_disj(MR_Event_Info *event_info, MR_Trace_Node prev)
+static MR_TraceNode
+MR_trace_decl_disj(MR_EventInfo *event_info, MR_TraceNode prev)
 {
-    MR_Trace_Node   node;
+    MR_TraceNode    node;
     const char      *path = event_info->MR_event_path;
 
     if (MR_trace_first_disjunct(event_info)) {
         MR_TRACE_CALL_MERCURY(
-            node = (MR_Trace_Node) MR_DD_construct_first_disj_node(
+            node = (MR_TraceNode) MR_DD_construct_first_disj_node(
                 (MR_Word) prev, event_info->MR_event_sll);
         );
     } else {
-        MR_Trace_Node   next;
-        MR_Trace_Node   first;
+        MR_TraceNode    next;
+        MR_TraceNode    first;
 
         /*
         ** Search through previous nodes for a matching DISJ event.
@@ -1196,12 +1188,12 @@
         ** Find the first disj event of this disjunction.
         */
         first = MR_trace_node_first_disj(next);
-        if (first == (MR_Trace_Node) NULL) {
+        if (first == (MR_TraceNode) NULL) {
             first = next;
         }
 
         MR_TRACE_CALL_MERCURY(
-            node = (MR_Trace_Node) MR_DD_construct_later_disj_node(
+            node = (MR_TraceNode) MR_DD_construct_later_disj_node(
                 MR_trace_node_store, (MR_Word) prev, event_info->MR_event_sll,
                 (MR_Word) first);
         );
@@ -1210,10 +1202,10 @@
     return node;
 }
 
-static MR_Trace_Node
-MR_trace_matching_call(MR_Trace_Node node)
+static MR_TraceNode
+MR_trace_matching_call(MR_TraceNode node)
 {
-    MR_Trace_Node   next;
+    MR_TraceNode    next;
 
     /*
     ** Search through contour for any CALL event.  Since there
@@ -1229,7 +1221,7 @@
 }
 
 static MR_bool
-MR_trace_first_disjunct(MR_Event_Info *event_info)
+MR_trace_first_disjunct(MR_EventInfo *event_info)
 {
     const char  *path;
 
@@ -1249,13 +1241,13 @@
 }
 
 static MR_bool
-MR_trace_matching_cond(const char *path, MR_Trace_Node node)
+MR_trace_matching_cond(const char *path, MR_TraceNode node)
 {
-    MR_Trace_Port   port;
+    MR_TracePort    port;
     const char      *node_path;
 
     MR_TRACE_CALL_MERCURY(
-        port = (MR_Trace_Port) MR_DD_trace_node_port(node);
+        port = (MR_TracePort) MR_DD_trace_node_port(node);
     );
 
     if (port != MR_PORT_COND) {
@@ -1267,13 +1259,13 @@
 }
 
 static MR_bool
-MR_trace_matching_neg(const char *path, MR_Trace_Node node)
+MR_trace_matching_neg(const char *path, MR_TraceNode node)
 {
-    MR_Trace_Port   port;
+    MR_TracePort    port;
     const char      *node_path;
 
     MR_TRACE_CALL_MERCURY(
-        port = (MR_Trace_Port) MR_DD_trace_node_port(node);
+        port = (MR_TracePort) MR_DD_trace_node_port(node);
     );
 
     if (port != MR_PORT_NEG_ENTER) {
@@ -1285,13 +1277,13 @@
 }
 
 static MR_bool
-MR_trace_matching_disj(const char *path, MR_Trace_Node node)
+MR_trace_matching_disj(const char *path, MR_TraceNode node)
 {
-    MR_Trace_Port   port;
+    MR_TracePort    port;
     const char      *node_path;
 
     MR_TRACE_CALL_MERCURY(
-        port = (MR_Trace_Port) MR_DD_trace_node_port(node);
+        port = (MR_TracePort) MR_DD_trace_node_port(node);
     );
 
     if (port == MR_PORT_DISJ) {
@@ -1306,11 +1298,12 @@
 MR_trace_same_construct(const char *p1, const char *p2)
 {
     /*
-    ** Checks if the two arguments represent goals in the same
-    ** construct.  If both strings are identical up to the last
-    ** component, return MR_TRUE, otherwise return MR_FALSE.
-    ** If the arguments point to identical strings, return MR_TRUE.
+    ** Checks if the two arguments represent goals in the same construct.
+    ** If both strings are identical up to the last component, return MR_TRUE,
+    ** otherwise return MR_FALSE. If the arguments point to identical strings,
+    ** return MR_TRUE.
     */
+
     while (*p1 == *p2) {
         if (*p1 == '\0' && *p2 == '\0') {
             return MR_TRUE;     /* They are identical. */
@@ -1346,8 +1339,8 @@
 }
 
 static MR_Word
-MR_decl_make_atom_args(const MR_Label_Layout *layout, MR_Word *saved_regs,
-    MR_Trace_Port port)
+MR_decl_make_atom_args(const MR_LabelLayout *layout, MR_Word *saved_regs,
+    MR_TracePort port)
 {
     MR_PredFunc             pred_or_func;
     int                     arity;
@@ -1355,7 +1348,7 @@
     int                     hv;   /* any head variable */
     int                     num_added_args;
     MR_TypeInfoParams       type_params;
-    const MR_Proc_Layout    *entry;
+    const MR_ProcLayout     *entry;
 
     entry = layout->MR_sll_entry;
     MR_trace_init_point_vars(layout, saved_regs, port, MR_TRUE);
@@ -1427,7 +1420,7 @@
 }
 
 void
-MR_trace_decl_set_fallback_search_mode(MR_Decl_Search_Mode search_mode)
+MR_trace_decl_set_fallback_search_mode(MR_DeclSearchMode search_mode)
 {
     MR_trace_decl_ensure_init();
     MR_TRACE_CALL_MERCURY(
@@ -1448,7 +1441,7 @@
 
 MR_bool
 MR_trace_is_valid_search_mode_string(const char *search_mode_string,
-    MR_Decl_Search_Mode *search_mode, 
+    MR_DeclSearchMode *search_mode,
     MR_bool *search_mode_requires_trace_counts)
 {
     MR_bool is_valid;
@@ -1458,13 +1451,13 @@
     MR_TRACE_CALL_MERCURY(
         if (MR_streq(search_mode_string, "top_down")
             || MR_streq(search_mode_string, "top-down")
-            || MR_streq(search_mode_string, "td")) 
+            || MR_streq(search_mode_string, "td"))
         {
             *search_mode = MR_DD_decl_top_down_search_mode();
             is_valid = MR_TRUE;
         } else if (MR_streq(search_mode_string, "divide_and_query")
             || MR_streq(search_mode_string, "divide-and-query")
-            || MR_streq(search_mode_string, "dq")) 
+            || MR_streq(search_mode_string, "dq"))
         {
             *search_mode = MR_DD_decl_divide_and_query_search_mode();
             is_valid = MR_TRUE;
@@ -1483,10 +1476,10 @@
     return is_valid;
 }
 
-MR_Decl_Search_Mode
+MR_DeclSearchMode
 MR_trace_get_default_search_mode(void)
 {
-    MR_Decl_Search_Mode    search_mode;
+    MR_DeclSearchMode   search_mode;
 
     MR_TRACE_CALL_MERCURY(
         search_mode = MR_DD_decl_top_down_search_mode();
@@ -1511,7 +1504,7 @@
 }
 
 void
-MR_decl_add_trusted_pred_or_func(const MR_Proc_Layout *entry)
+MR_decl_add_trusted_pred_or_func(const MR_ProcLayout *entry)
 {
     MR_trace_decl_ensure_init();
     MR_TRACE_CALL_MERCURY(
@@ -1564,15 +1557,15 @@
 }
 
 MR_bool
-MR_trace_start_decl_debug(MR_Decl_Mode mode, const char *outfile,
-    MR_bool new_session, MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info,
+MR_trace_start_decl_debug(MR_DeclMode mode, const char *outfile,
+    MR_bool new_session, MR_TraceCmdInfo *cmd, MR_EventInfo *event_info,
     MR_Code **jumpaddr)
 {
-    MR_Retry_Result         result;
-    const MR_Proc_Layout    *entry;
+    MR_RetryResult          result;
+    const MR_ProcLayout     *entry;
     FILE                    *out;
     const char              *message;
-    MR_Trace_Level          trace_level;
+    MR_TraceLevel           trace_level;
     static MR_bool          first_time = MR_TRUE;
 
     MR_edt_initial_event = event_info->MR_event_number;
@@ -1585,12 +1578,12 @@
     if (!new_session && !first_time) {
         MR_decl_mode = mode;
         MR_selected_trace_func_ptr = MR_trace_real_decl;
-        *jumpaddr = MR_decl_diagnosis((MR_Trace_Node) NULL, cmd,
+        *jumpaddr = MR_decl_diagnosis((MR_TraceNode) NULL, cmd,
             event_info, MR_FALSE);
         return MR_TRUE;
     }
 
-    MR_edt_return_node = (MR_Trace_Node) NULL;
+    MR_edt_return_node = (MR_TraceNode) NULL;
 
     if (!MR_port_is_final(event_info->MR_trace_port)) {
         fflush(MR_mdb_out);
@@ -1654,7 +1647,7 @@
     MR_decl_mode = mode;
     MR_selected_trace_func_ptr = MR_trace_real_decl;
     MR_trace_decl_ensure_init();
-    MR_trace_current_node = (MR_Trace_Node) NULL;
+    MR_trace_current_node = (MR_TraceNode) NULL;
     message = MR_trace_start_collecting(event_info->MR_event_number,
         event_info->MR_call_seqno, MR_edt_default_depth_limit,
         MR_FALSE, cmd, event_info, jumpaddr);
@@ -1672,14 +1665,14 @@
 }
 
 static MR_Code *
-MR_trace_restart_decl_debug(MR_Trace_Node call_preceding, MR_Unsigned event,
+MR_trace_restart_decl_debug(MR_TraceNode call_preceding, MR_Unsigned event,
     MR_Unsigned seqno, MR_bool create_supertree, MR_Unsigned depth_limit,
-    MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info)
+    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info)
 {
     const char  *message;
     MR_Code     *jumpaddr;
 
-    MR_edt_return_node = (MR_Trace_Node) NULL;
+    MR_edt_return_node = (MR_TraceNode) NULL;
 
     /*
     ** Set this to the preceding node, so the new explicit tree's parent is
@@ -1704,11 +1697,11 @@
 
 static const char *
 MR_trace_start_collecting(MR_Unsigned event, MR_Unsigned seqno,
-    MR_Unsigned maxdepth, MR_bool create_supertree, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+    MR_Unsigned maxdepth, MR_bool create_supertree, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     const char      *problem;
-    MR_Retry_Result retry_result;
+    MR_RetryResult  retry_result;
     int             retry_distance;
     MR_bool         unsafe_retry;
 
@@ -1805,8 +1798,8 @@
 }
 
 static MR_Code *
-MR_decl_diagnosis(MR_Trace_Node root, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_bool new_tree)
+MR_decl_diagnosis(MR_TraceNode root, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_bool new_tree)
 {
     MR_Word         response;
     MR_bool         bug_found;
@@ -1818,7 +1811,7 @@
     MR_Unsigned     symptom_event;
     MR_Unsigned     final_event;
     MR_Unsigned     topmost_seqno;
-    MR_Trace_Node   call_preceding;
+    MR_TraceNode    call_preceding;
     MercuryFile     stream;
     MR_Integer      requested_subtree_depth;
 
@@ -1883,7 +1876,7 @@
         require_subtree = MR_DD_diagnoser_require_subtree(response,
             (MR_Integer *) &final_event,
             (MR_Integer *) &topmost_seqno,
-            (MR_Trace_Node *) &call_preceding,
+            (MR_TraceNode *) &call_preceding,
             (MR_Integer *) &requested_subtree_depth);
         require_supertree = MR_DD_diagnoser_require_supertree(response,
             (MR_Integer *) &final_event,
@@ -1929,7 +1922,7 @@
         /*
         ** Front end requires a supertree to be made explicit.
         */
-        return MR_trace_restart_decl_debug((MR_Trace_Node) NULL, final_event,
+        return MR_trace_restart_decl_debug((MR_TraceNode) NULL, final_event,
             topmost_seqno, MR_TRUE, MR_edt_default_depth_limit, cmd,
             event_info);
     }
@@ -1939,11 +1932,11 @@
 }
 
 static MR_Code *
-MR_decl_go_to_selected_event(MR_Unsigned event, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info)
+MR_decl_go_to_selected_event(MR_Unsigned event, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info)
 {
     const char      *problem;
-    MR_Retry_Result retry_result;
+    MR_RetryResult  retry_result;
     MR_Code         *jumpaddr;
     int             ancestor_level;
     MR_bool         unsafe_retry;
@@ -2028,7 +2021,7 @@
 }
 
 static MR_String
-MR_trace_node_path(MR_Trace_Node node)
+MR_trace_node_path(MR_TraceNode node)
 {
     MR_String   path;
 
@@ -2040,20 +2033,20 @@
     return path;
 }
 
-static MR_Trace_Port
-MR_trace_node_port(MR_Trace_Node node)
+static MR_TracePort
+MR_trace_node_port(MR_TraceNode node)
 {
-    MR_Trace_Port   port;
+    MR_TracePort    port;
 
     MR_TRACE_CALL_MERCURY(
-        port = (MR_Trace_Port) MR_DD_trace_node_port((MR_Word) node);
+        port = (MR_TracePort) MR_DD_trace_node_port((MR_Word) node);
     );
 
     return port;
 }
 
 static MR_Unsigned
-MR_trace_node_seqno(MR_Trace_Node node)
+MR_trace_node_seqno(MR_TraceNode node)
 {
     MR_Unsigned seqno;
 
@@ -2069,10 +2062,10 @@
     return seqno;
 }
 
-static MR_Trace_Node
-MR_trace_node_first_disj(MR_Trace_Node node)
+static MR_TraceNode
+MR_trace_node_first_disj(MR_TraceNode node)
 {
-    MR_Trace_Node   first;
+    MR_TraceNode    first;
 
     MR_TRACE_CALL_MERCURY(
         if (!MR_DD_trace_node_first_disj((MR_Word) node, (MR_Word *) &first)) {
@@ -2083,32 +2076,32 @@
     return first;
 }
 
-static MR_Trace_Node
-MR_trace_step_left_in_contour(MR_Trace_Node node)
+static MR_TraceNode
+MR_trace_step_left_in_contour(MR_TraceNode node)
 {
-    MR_Trace_Node   next;
+    MR_TraceNode    next;
 
     MR_decl_checkpoint_step(node);
 
     MR_trace_node_store++;
     MR_TRACE_CALL_MERCURY(
-        next = (MR_Trace_Node) MR_DD_step_left_in_contour(MR_trace_node_store,
+        next = (MR_TraceNode) MR_DD_step_left_in_contour(MR_trace_node_store,
             node);
     );
 
     return next;
 }
 
-static MR_Trace_Node
-MR_trace_find_prev_contour(MR_Trace_Node node)
+static MR_TraceNode
+MR_trace_find_prev_contour(MR_TraceNode node)
 {
-    MR_Trace_Node   next;
+    MR_TraceNode    next;
 
     MR_decl_checkpoint_find(node);
 
     MR_trace_node_store++;
     MR_TRACE_CALL_MERCURY(
-        next = (MR_Trace_Node) MR_DD_find_prev_contour(MR_trace_node_store,
+        next = (MR_TraceNode) MR_DD_find_prev_contour(MR_trace_node_store,
             node);
     );
 
@@ -2194,7 +2187,7 @@
 
 static void
 MR_trace_maybe_update_implicit_tree_ideal_depth(MR_Unsigned current_depth,
-    MR_Trace_Node call)
+    MR_TraceNode call)
 {
     if (current_depth == MR_edt_max_depth) {
         MR_Unsigned    ideal_depth;
@@ -2220,7 +2213,7 @@
 
 static  void
 MR_trace_maybe_update_suspicion_accumulator(
-    const MR_Label_Layout *label_layout)
+    const MR_LabelLayout *label_layout)
 {
     if (MR_edt_update_suspicion_accumulator) {
         MR_Unsigned *label_suspicion;
@@ -2230,8 +2223,8 @@
     }
 }
 
-MR_bool    
-MR_trace_decl_init_suspicion_table(char *pass_trace_counts_file, 
+MR_bool
+MR_trace_decl_init_suspicion_table(char *pass_trace_counts_file,
     char *fail_trace_counts_file, MR_String *problem)
 {
     MR_String                   aligned_pass_trace_counts_file;
@@ -2245,9 +2238,9 @@
     int                         num_labels;
     int                         label_num;
     int                         label_index;
-    const MR_Module_Layout      *module;
-    const MR_Module_File_Layout *file;
-    const MR_Label_Layout       *label;
+    const MR_ModuleLayout       *module;
+    const MR_ModuleFileLayout   *file;
+    const MR_LabelLayout        *label;
     MR_Unsigned                 *table_cell;
     MR_Float                    f_suspicion;
 
@@ -2276,7 +2269,7 @@
     /*
     ** We have read in a valid dice, so we can go ahead and set up the
     ** suspicion table.  We use the execution count table to store the
-    ** suspicions of each label.  This is a good idea because 
+    ** suspicions of each label.  This is a good idea because
     ** (a) it is quick to look up a value in this table given a label, and
     ** (b) it is not used for counting events during an interactive mdb
     ** session.
@@ -2290,24 +2283,23 @@
         for (file_num = 0; file_num < num_files; file_num++) {
             file = module->MR_ml_module_file_layout[file_num];
             num_labels = file->MR_mfl_label_count;
-            
-            for (label_num = 0; label_num < num_labels; 
-                label_num++) 
+
+            for (label_num = 0; label_num < num_labels;
+                label_num++)
             {
                 label = file->MR_mfl_label_layout[label_num];
-                label_index = 
+                label_index =
                     label->MR_sll_label_num_in_module;
                 table_cell = &(module->MR_ml_label_exec_count[
                     label_index]);
                 MR_TRACE_CALL_MERCURY(
-                    f_suspicion = 
+                    f_suspicion =
                         MR_DD_get_suspicion_for_label_layout(dice, label);
                 );
                 /*
-                ** Instead of using a ratio between 0 and 1
-                ** we store an integer between 0 and 
-                ** MR_TRACE_DECL_MAX_SUSPICION, since this
-                ** is quicker and requires less storage space.
+                ** Instead of using a ratio between 0 and 1 we store an integer
+                ** between 0 and MR_TRACE_DECL_MAX_SUSPICION, since this is
+                ** quicker and requires less storage space.
                 */
                 *table_cell = (MR_Unsigned)
                     ((MR_Float) MR_TRACE_DECL_MAX_SUSPICION * f_suspicion);
@@ -2327,14 +2319,11 @@
     if (event_number != MR_edt_last_event &&
         MR_edt_progress_last_tick == 0 &&
         (MR_edt_start_time + MR_DECL_DISPLAY_PROGRESS_DELAY
-        < MR_get_user_cpu_milliseconds()))
+            < MR_get_user_cpu_milliseconds()))
     {
         fprintf(MR_mdb_out, MR_DECL_PROGRESS_MESSAGE_SUBTREE);
         fflush(MR_mdb_out);
-        /*
-        ** We count the initial progress message as the first
-        ** tick.
-        */
+        /* We count the initial progress message as the first tick. */
         MR_edt_progress_last_tick = 1;
     } else if (MR_edt_progress_last_tick > 0) {
         current_tick = (MR_Unsigned) ((
@@ -2356,22 +2345,21 @@
 MR_trace_show_progress_supertree(MR_Unsigned event_number)
 {
     /*
-    ** If we are building a supertree we don't know what the
-    ** final event will be, so we just show a tick every
-    ** MR_DECL_DISPLAY_PROGRESS_DELAY milliseconds, so at least
-    ** the user knows something is happening.
+    ** If we are building a supertree we don't know what the final event will be,
+    ** so we just show a tick every MR_DECL_DISPLAY_PROGRESS_DELAY milliseconds,
+    ** so at least the user knows something is happening.
     */
+
     if (MR_edt_progress_last_tick == 0 &&
         (MR_edt_start_time + MR_DECL_DISPLAY_PROGRESS_DELAY
-        < MR_get_user_cpu_milliseconds()))
+            < MR_get_user_cpu_milliseconds()))
     {
         fprintf(MR_mdb_out, MR_DECL_PROGRESS_MESSAGE_SUPERTREE);
         fflush(MR_mdb_out);
         MR_edt_progress_last_tick = 1;
     } else if ((MR_edt_start_time
-        + (MR_edt_progress_last_tick + 1)
-        * MR_DECL_DISPLAY_PROGRESS_DELAY)
-        < MR_get_user_cpu_milliseconds())
+        + (MR_edt_progress_last_tick + 1) * MR_DECL_DISPLAY_PROGRESS_DELAY)
+            < MR_get_user_cpu_milliseconds())
     {
         MR_edt_progress_last_tick++;
         fprintf(MR_mdb_out, MR_DECL_PROGRESS_TICK_STRING);
@@ -2393,7 +2381,7 @@
 #ifdef MR_DEBUG_DD_BACK_END
 
 static void
-MR_decl_checkpoint_event_imp(const char *str, MR_Event_Info *event_info)
+MR_decl_checkpoint_event_imp(const char *str, MR_EventInfo *event_info)
 {
     fprintf(MR_mdb_out, "DD %s %ld: #%ld %ld %s ",
         str,
@@ -2406,7 +2394,7 @@
 }
 
 static void
-MR_decl_checkpoint_loc(const char *str, MR_Trace_Node node)
+MR_decl_checkpoint_loc(const char *str, MR_TraceNode node)
 {
     MercuryFile mdb_out;
 
Index: trace/mercury_trace_declarative.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_declarative.h,v
retrieving revision 1.29
diff -u -r1.29 mercury_trace_declarative.h
--- trace/mercury_trace_declarative.h	8 Feb 2006 21:54:33 -0000	1.29
+++ trace/mercury_trace_declarative.h	26 Nov 2006 23:05:24 -0000
@@ -19,7 +19,7 @@
 ** MR_trace_decl_debug for each event.  
 */
 
-extern  MR_Code     *MR_trace_decl_debug(MR_Event_Info *event_info);
+extern  MR_Code     *MR_trace_decl_debug(MR_EventInfo *event_info);
 
 /*
 ** The following functions update the progress indicator when building a 
@@ -36,11 +36,11 @@
 ** being entered.
 */
 
-typedef enum { MR_DECL_NODUMP, MR_DECL_DUMP } MR_Decl_Mode;
+typedef enum { MR_DECL_NODUMP, MR_DECL_DUMP } MR_DeclMode;
 
-extern  MR_bool     MR_trace_start_decl_debug(MR_Decl_Mode mode, 
+extern  MR_bool     MR_trace_start_decl_debug(MR_DeclMode mode, 
                         const char *outfile, MR_bool new_session,
-                        MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info,
+                        MR_TraceCmdInfo *cmd, MR_EventInfo *event_info,
                         MR_Code **jumpaddr);
 
 /*
@@ -70,7 +70,7 @@
 
 extern  void        MR_decl_add_trusted_module(const char *module_name);
 extern  void        MR_decl_add_trusted_pred_or_func(
-                        const MR_Proc_Layout *entry);
+                        const MR_ProcLayout *entry);
 extern  void        MR_decl_trust_standard_library(void);
 extern  MR_bool     MR_decl_remove_trusted(int n);
 
@@ -79,10 +79,10 @@
 ** the analyser.
 */
 
-typedef MR_Word MR_Decl_Search_Mode;
+typedef MR_Word MR_DeclSearchMode;
 
 extern  void        MR_trace_decl_set_fallback_search_mode(
-                        MR_Decl_Search_Mode search_mode);
+                        MR_DeclSearchMode search_mode);
 
 /*
 ** This function checks to see if the supplied string is a valid
@@ -94,7 +94,7 @@
 
 extern	MR_bool	MR_trace_is_valid_search_mode_string(
                     const char *search_mode_string,
-                    MR_Decl_Search_Mode *search_mode,
+                    MR_DeclSearchMode *search_mode,
                     MR_bool *search_mode_requires_trace_counts);
 
 /*
@@ -102,7 +102,7 @@
 ** `dd' command is not given.
 */
 
-extern MR_Decl_Search_Mode MR_trace_get_default_search_mode(void);
+extern MR_DeclSearchMode MR_trace_get_default_search_mode(void);
 
 /*
 ** Prints a list of the trusted objects.  If mdb_command_format is true it
@@ -212,7 +212,7 @@
 ** values in the definitions in browser/declarative_execution.m.
 */
 
-typedef MR_Word MR_Trace_Node;
+typedef MR_Word MR_TraceNode;
 
 #define MR_TRACE_STATUS_SUCCEEDED    (MR_Word) 0
 #define MR_TRACE_STATUS_FAILED       (MR_Word) 1
Index: trace/mercury_trace_external.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_external.c,v
retrieving revision 1.81
diff -u -r1.81 mercury_trace_external.c
--- trace/mercury_trace_external.c	9 Oct 2006 06:40:28 -0000	1.81
+++ trace/mercury_trace_external.c	26 Nov 2006 23:22:12 -0000
@@ -212,11 +212,11 @@
 static void     MR_read_request_from_socket(MR_Word *debugger_request_ptr, 
                     MR_Integer *debugger_request_type_ptr);
     
-static MR_bool  MR_found_match(const MR_Label_Layout *layout,
-                    MR_Trace_Port port, MR_Unsigned seqno, MR_Unsigned depth,
+static MR_bool  MR_found_match(const MR_LabelLayout *layout,
+                    MR_TracePort port, MR_Unsigned seqno, MR_Unsigned depth,
                     /* XXX registers */ const char *path, MR_Word search_data);
-static void     MR_output_current_slots(const MR_Label_Layout *layout,
-                    MR_Trace_Port port, MR_Unsigned seqno,
+static void     MR_output_current_slots(const MR_LabelLayout *layout,
+                    MR_TracePort port, MR_Unsigned seqno,
                     MR_Unsigned depth, const char *path, int lineno);
 static void     MR_output_current_vars(MR_Word var_list, MR_Word string_list);
 static void     MR_output_current_nth_var(MR_Word var);
@@ -227,10 +227,10 @@
 static MR_Word  MR_trace_make_type_list(void);
 static MR_Word  MR_trace_make_nth_var(MR_Word debugger_request);
 static int      MR_get_var_number(MR_Word debugger_request);
-static void     MR_print_proc_id_to_socket(const MR_Proc_Layout *entry,
+static void     MR_print_proc_id_to_socket(const MR_ProcLayout *entry,
                     const char *extra, MR_Word *base_sp, MR_Word *base_curfr);
 static void     MR_dump_stack_record_print_to_socket(FILE *fp, 
-                    const MR_Proc_Layout *entry_layout, int count,
+                    const MR_ProcLayout *entry_layout, int count,
                     int start_level, MR_Word *base_sp, MR_Word *base_curfr,
                     const char *filename, int linenumber,
                     const char *goal_path, MR_bool context_mismatch);
@@ -243,7 +243,7 @@
                     MR_String *object_file_name_ptr);
 static void     MR_get_variable_name(MR_Word debugger_request,
                     MR_String *var_name_ptr);
-static void     MR_trace_browse_one_external(MR_Var_Spec which_var);
+static void     MR_trace_browse_one_external(MR_VarSpec which_var);
 static void     MR_send_collect_result(void);
 
 #if 0
@@ -510,7 +510,7 @@
 }
 
 MR_Code *
-MR_trace_event_external(MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info)
+MR_trace_event_external(MR_TraceCmdInfo *cmd, MR_EventInfo *event_info)
 {
     static MR_Word          search_data;
     static void             (*initialize_ptr)(MR_Word *);
@@ -526,15 +526,15 @@
     MR_Code                 *jumpaddr = NULL;
     const char              *message;
     MR_bool                 include_trace_data = MR_TRUE;
-    const MR_Label_Layout   *layout = event_info->MR_event_sll;
+    const MR_LabelLayout    *layout = event_info->MR_event_sll;
     MR_Unsigned             seqno = event_info->MR_call_seqno;
     MR_Unsigned             depth = event_info->MR_call_depth;
-    MR_Trace_Port           port = event_info->MR_trace_port;
+    MR_TracePort            port = event_info->MR_trace_port;
     const char              *path = event_info->MR_event_path;
     MR_Word                 *saved_regs = event_info->MR_saved_regs;
     MR_Integer              modules_list_length;
     MR_Word                 modules_list;
-    MR_Retry_Result         retry_result;
+    MR_RetryResult          retry_result;
     static MR_String        MR_object_file_name;
     int                     lineno = 0;
     MR_bool                 unsafe_retry;
@@ -746,7 +746,7 @@
             case MR_REQUEST_BROWSE:
                 {
                     char        *var_name;
-                    MR_Var_Spec var_spec;
+                    MR_VarSpec  var_spec;
 
                     if (MR_debug_socket) {
                         fprintf(stderr, "\nMercury runtime: "
@@ -897,8 +897,8 @@
 }
 
 static void
-MR_output_current_slots(const MR_Label_Layout *layout,
-    MR_Trace_Port port, MR_Unsigned seqno, MR_Unsigned depth,
+MR_output_current_slots(const MR_LabelLayout *layout,
+    MR_TracePort port, MR_Unsigned seqno, MR_Unsigned depth,
     const char *path, int lineno)
 {
     if (MR_PROC_LAYOUT_IS_UCI(layout->MR_sll_entry)) {
@@ -995,8 +995,8 @@
 }
  
 static MR_bool
-MR_found_match(const MR_Label_Layout *layout,
-    MR_Trace_Port port, MR_Unsigned seqno, MR_Unsigned depth,
+MR_found_match(const MR_LabelLayout *layout,
+    MR_TracePort port, MR_Unsigned seqno, MR_Unsigned depth,
     /* XXX live vars */
     const char *path, MR_Word search_data)
 {
@@ -1276,7 +1276,7 @@
 
 static void
 MR_dump_stack_record_print_to_socket(FILE *fp, 
-    const MR_Proc_Layout *entry_layout, int count, int start_level, 
+    const MR_ProcLayout *entry_layout, int count, int start_level, 
     MR_Word *base_sp, MR_Word *base_curfr,
     const char *filename, int linenumber,
     const char *goal_path, MR_bool context_mismatch)
@@ -1286,7 +1286,7 @@
 }
 
 static void
-MR_print_proc_id_to_socket(const MR_Proc_Layout *entry,
+MR_print_proc_id_to_socket(const MR_ProcLayout *entry,
     const char *extra, MR_Word *base_sp, MR_Word *base_curfr)
 {
     if (! MR_PROC_LAYOUT_HAS_PROC_ID(entry)) {
@@ -1425,7 +1425,7 @@
 */
 
 static void
-MR_trace_browse_one_external(MR_Var_Spec var_spec)
+MR_trace_browse_one_external(MR_VarSpec var_spec)
 {
     const char  *problem;
 
@@ -1444,7 +1444,7 @@
 */
 void
 MR_COLLECT_filter(MR_FilterFuncPtr filter_ptr, MR_Unsigned seqno, 
-    MR_Unsigned depth, MR_Trace_Port port, const MR_Label_Layout *layout, 
+    MR_Unsigned depth, MR_TracePort port, const MR_LabelLayout *layout, 
     const char *path, int lineno, MR_bool *stop_collecting)
 {
     MR_Char result;     
@@ -1493,11 +1493,11 @@
 */
 
 int
-MR_get_line_number(MR_Word *saved_regs, const MR_Label_Layout *layout, 
-    MR_Trace_Port port)
+MR_get_line_number(MR_Word *saved_regs, const MR_LabelLayout *layout, 
+    MR_TracePort port)
 {
     const char              *filename;
-    const MR_Label_Layout   *parent_layout;
+    const MR_LabelLayout    *parent_layout;
     const char              *problem; 
     int                     lineno = 0;
     MR_Word                 *base_sp;
Index: trace/mercury_trace_external.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_external.h,v
retrieving revision 1.13
diff -u -r1.13 mercury_trace_external.h
--- trace/mercury_trace_external.h	10 Nov 2006 03:24:17 -0000	1.13
+++ trace/mercury_trace_external.h	26 Nov 2006 23:05:24 -0000
@@ -10,7 +10,7 @@
 #ifndef MERCURY_TRACE_EXTERNAL_H
 #define MERCURY_TRACE_EXTERNAL_H
 
-#include "mercury_trace.h"          /* for MR_Trace_Cmd_Info, etc.  */
+#include "mercury_trace.h"          /* for MR_TraceCmdInfo, etc.  */
 #include "mercury_conf.h"           /* for MR_USE_EXTERNAL_DEBUGGER */
 #include "mercury_types.h"          /* for MR_Code                  */
 #include "mercury_library_types.h"  /* for MercuryFile              */
@@ -19,14 +19,14 @@
 
 extern  void    MR_trace_init_external(void);
 extern  void    MR_trace_final_external(void);
-extern  MR_Code *MR_trace_event_external(MR_Trace_Cmd_Info *cmd,
-                    MR_Event_Info *event_info);
+extern  MR_Code *MR_trace_event_external(MR_TraceCmdInfo *cmd,
+                    MR_EventInfo *event_info);
 extern  void    MR_COLLECT_filter(MR_FilterFuncPtr filter_ptr,
-                    MR_Unsigned seqno, MR_Unsigned depth, MR_Trace_Port port,
-                    const MR_Label_Layout *layout,
+                    MR_Unsigned seqno, MR_Unsigned depth, MR_TracePort port,
+                    const MR_LabelLayout *layout,
                     const char *path, int lineno, MR_bool *stop_collecting);
 extern  int     MR_get_line_number(MR_Word *saved_regs,
-                    const MR_Label_Layout *layout, MR_Trace_Port port);
+                    const MR_LabelLayout *layout, MR_TracePort port);
 
 /*
 ** External debugger socket streams.
Index: trace/mercury_trace_help.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_help.c,v
retrieving revision 1.26
diff -u -r1.26 mercury_trace_help.c
--- trace/mercury_trace_help.c	9 Oct 2006 06:40:29 -0000	1.26
+++ trace/mercury_trace_help.c	26 Nov 2006 23:05:24 -0000
@@ -228,7 +228,7 @@
     }
 }
 
-MR_Completer_List *
+MR_CompleterList *
 MR_trace_help_completer(const char *word, size_t word_len)
 {
     return MR_trace_sorted_array_completer(word, word_len,
Index: trace/mercury_trace_help.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_help.h,v
retrieving revision 1.4
diff -u -r1.4 mercury_trace_help.h
--- trace/mercury_trace_help.h	10 Nov 2006 03:24:17 -0000	1.4
+++ trace/mercury_trace_help.h	26 Nov 2006 23:22:23 -0000
@@ -52,7 +52,7 @@
                                 const char *item);
 
 /* A Readline completer for help topics. */
-extern  MR_Completer_List   *MR_trace_help_completer(const char *word,
+extern  MR_CompleterList    *MR_trace_help_completer(const char *word,
                                 size_t word_len);
 
 #endif  /* MERCURY_TRACE_HELP_H */
Index: trace/mercury_trace_hold_vars.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_hold_vars.c,v
retrieving revision 1.2
diff -u -r1.2 mercury_trace_hold_vars.c
--- trace/mercury_trace_hold_vars.c	6 Apr 2006 06:14:40 -0000	1.2
+++ trace/mercury_trace_hold_vars.c	26 Nov 2006 23:22:36 -0000
@@ -17,12 +17,12 @@
     const char  *MR_held_name;
     MR_TypeInfo MR_held_type;
     MR_Word     MR_held_value;
-} MR_Held_Var;
+} MR_HeldVar;
 
 /* The initial size of the held vars table. */
 #define MR_INIT_HELD_VARS   10
 
-static MR_Held_Var  *MR_held_vars;
+static MR_HeldVar   *MR_held_vars;
 static int          MR_held_var_max = 0;
 static int          MR_held_var_next = 0;
 
@@ -42,7 +42,7 @@
         typeinfo_type_word = ML_get_type_info_for_type_info();
     );
 
-    MR_ensure_room_for_next(MR_held_var, MR_Held_Var, MR_INIT_HELD_VARS);
+    MR_ensure_room_for_next(MR_held_var, MR_HeldVar, MR_INIT_HELD_VARS);
     MR_prepare_insert_into_sorted(MR_held_vars, MR_held_var_next, slot,
         strcmp(MR_held_vars[slot].MR_held_name, name));
     MR_held_vars[slot].MR_held_name = strdup(name);
Index: trace/mercury_trace_internal.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.227
diff -u -r1.227 mercury_trace_internal.c
--- trace/mercury_trace_internal.c	24 Nov 2006 03:48:28 -0000	1.227
+++ trace/mercury_trace_internal.c	26 Nov 2006 23:23:26 -0000
@@ -155,7 +155,7 @@
 ** The details of the source server, if any.
 */
 
-MR_Trace_Source_Server  MR_trace_source_server =
+MR_TraceSourceServer  MR_trace_source_server =
     { NULL, NULL, MR_FALSE };
 
 MR_bool             MR_trace_internal_interacting = MR_FALSE;
@@ -169,14 +169,14 @@
 static  void        MR_trace_internal_init_from_env(void);
 static  void        MR_trace_internal_init_from_local(void);
 static  void        MR_trace_internal_init_from_home_dir(void);
-static  MR_Next     MR_trace_debug_cmd(char *line, MR_Trace_Cmd_Info *cmd,
-                        MR_Event_Info *event_info, MR_Code **jumpaddr);
+static  MR_Next     MR_trace_debug_cmd(char *line, MR_TraceCmdInfo *cmd,
+                        MR_EventInfo *event_info, MR_Code **jumpaddr);
 
 static  MR_TraceCmdFunc     MR_trace_handle_cmd;
 
 static  void        MR_mdb_print_proc_id_and_nl(void *data,
-                        const MR_Proc_Layout *entry_layout);
-static  int         MR_trace_var_print_list(MR_Spy_Print_List print_list);
+                        const MR_ProcLayout *entry_layout);
+static  int         MR_trace_var_print_list(MR_SpyPrintList print_list);
 
 static  const char  *MR_trace_parse_line(char *line, char ***words,
                         int *word_max, int *word_count);
@@ -186,18 +186,18 @@
                         int *new_char_pos_ptr);
 static  MR_bool     MR_trace_continue_line(char *ptr, MR_bool *single_quoted,
                         MR_bool *double_quoted);
-static  MR_Code     *MR_trace_event_internal_report(MR_Trace_Cmd_Info *cmd,
-                        MR_Spy_Print_List print_list,
-                        MR_Event_Info *event_info);
+static  MR_Code     *MR_trace_event_internal_report(MR_TraceCmdInfo *cmd,
+                        MR_SpyPrintList print_list,
+                        MR_EventInfo *event_info);
 
 static  char        *MR_trace_command_completer_next(const char *word,
-                        size_t word_len, MR_Completer_Data *data);
+                        size_t word_len, MR_CompleterData *data);
 
 MR_SavedDebugState  MR_saved_debug_state;
 
 MR_Code *
-MR_trace_event_internal(MR_Trace_Cmd_Info *cmd, MR_bool interactive,
-    MR_Spy_Print_List print_list, MR_Event_Info *event_info)
+MR_trace_event_internal(MR_TraceCmdInfo *cmd, MR_bool interactive,
+    MR_SpyPrintList print_list, MR_EventInfo *event_info)
 {
     MR_Code     *jumpaddr;
     char        *line;
@@ -762,8 +762,8 @@
 */
 
 MR_Next
-MR_trace_cmd_shell(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_cmd_shell(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     char*       command_string;
     size_t      command_string_length;
@@ -787,7 +787,7 @@
 }
 
 static void
-MR_mdb_print_proc_id_and_nl(void *data, const MR_Proc_Layout *entry_layout)
+MR_mdb_print_proc_id_and_nl(void *data, const MR_ProcLayout *entry_layout)
 {
     FILE    *fp;
 
@@ -796,9 +796,9 @@
 }
 
 static int
-MR_trace_var_print_list(MR_Spy_Print_List print_list)
+MR_trace_var_print_list(MR_SpyPrintList print_list)
 {
-    MR_Spy_Print    node;
+    MR_SpyPrint    node;
     const char      *problem;
     char            *after_problem;
     int             count;
@@ -857,8 +857,8 @@
 }
 
 static MR_Next
-MR_trace_debug_cmd(char *line, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_debug_cmd(char *line, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     char        **words;
     char        **orig_words = NULL;
@@ -915,8 +915,8 @@
 */
 
 static MR_Next
-MR_trace_handle_cmd(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
-    MR_Event_Info *event_info, MR_Code **jumpaddr)
+MR_trace_handle_cmd(char **words, int word_count, MR_TraceCmdInfo *cmd,
+    MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     const MR_Trace_Command_Info *cmd_info;
 
@@ -1371,13 +1371,13 @@
 }
 
 static MR_Code *
-MR_trace_event_internal_report(MR_Trace_Cmd_Info *cmd,
-    MR_Spy_Print_List print_list, MR_Event_Info *event_info)
+MR_trace_event_internal_report(MR_TraceCmdInfo *cmd,
+    MR_SpyPrintList print_list, MR_EventInfo *event_info)
 {
-    char                *buf;
-    int                 i;
-    int                 len;
-    MR_Spy_Print_List   list;
+    char            *buf;
+    int             i;
+    int             len;
+    MR_SpyPrintList list;
 
     list = print_list;
     len = 0;
@@ -1440,9 +1440,9 @@
 }
 
 void
-MR_trace_event_print_internal_report(MR_Event_Info *event_info)
+MR_trace_event_print_internal_report(MR_EventInfo *event_info)
 {
-    const MR_Label_Layout   *parent;
+    const MR_LabelLayout    *parent;
     const char              *filename;
     const char              *parent_filename;
     int                     lineno;
@@ -1731,7 +1731,7 @@
 
 MR_bool
 MR_trace_command_completion_info(const char *word,
-    MR_Make_Completer *completer, const char *const **fixed_args)
+    MR_MakeCompleter *completer, const char *const **fixed_args)
 {
     const MR_Trace_Command_Info *command_info;
 
@@ -1759,16 +1759,16 @@
     return NULL;
 }
 
-MR_Completer_List *
+MR_CompleterList *
 MR_trace_command_completer(const char *word, size_t word_len)
 {
     return MR_new_completer_elem(&MR_trace_command_completer_next,
-        (MR_Completer_Data) 0, MR_trace_no_free);
+        (MR_CompleterData) 0, MR_trace_no_free);
 }
 
 static char *
 MR_trace_command_completer_next(const char *word, size_t word_len,
-    MR_Completer_Data *data)
+    MR_CompleterData *data)
 {
     MR_Integer command_index;
 
Index: trace/mercury_trace_internal.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_internal.h,v
retrieving revision 1.23
diff -u -r1.23 mercury_trace_internal.h
--- trace/mercury_trace_internal.h	13 Jun 2006 09:49:04 -0000	1.23
+++ trace/mercury_trace_internal.h	26 Nov 2006 23:05:24 -0000
@@ -13,21 +13,21 @@
 #include "mercury_types.h"              /* for MR_Code */
 #include "mercury_trace_base.h"         /* for MR_SavedDebugState */
 
-#include "mercury_trace.h"              /* for MR_Event_Info, etc. */
+#include "mercury_trace.h"              /* for MR_EventInfo, etc. */
 #include "mercury_std.h"                /* for MR_bool */
-#include "mercury_trace_cmds.h"         /* for MR_Spy_Print_List */
-#include "mercury_trace_completion.h"   /* for MR_Make_Completer */
-#include "mercury_trace_spy.h"          /* for MR_Spy_Print_List */
-#include "mercury_trace_source.h"       /* for MR_Trace_Source_Server */
+#include "mercury_trace_cmds.h"         /* for MR_SpyPrintList */
+#include "mercury_trace_completion.h"   /* for MR_MakeCompleter */
+#include "mercury_trace_spy.h"          /* for MR_SpyPrintList */
+#include "mercury_trace_source.h"       /* for MR_TraceSourceServer */
 
 #include <stdio.h>                      /* for FILE */
 
-extern  MR_Code     *MR_trace_event_internal(MR_Trace_Cmd_Info *cmd,
-                        MR_bool interactive, MR_Spy_Print_List print_list,
-                        MR_Event_Info *event_info);
+extern  MR_Code     *MR_trace_event_internal(MR_TraceCmdInfo *cmd,
+                        MR_bool interactive, MR_SpyPrintList print_list,
+                        MR_EventInfo *event_info);
 
 extern  void        MR_trace_event_print_internal_report(
-                        MR_Event_Info *event_info);
+                        MR_EventInfo *event_info);
 
 
 /*
@@ -75,7 +75,7 @@
 ** The details of the source server, if any.
 */
 
-extern  MR_Trace_Source_Server  MR_trace_source_server;
+extern  MR_TraceSourceServer  MR_trace_source_server;
 
 /*
 ** Source commands from the given file. Print an error message if the file
@@ -138,14 +138,14 @@
 */
 
 extern  MR_bool MR_trace_command_completion_info(const char *word,
-                    MR_Make_Completer *completer,
+                    MR_MakeCompleter *completer,
                     const char *const **fixed_args);
 
 /*
 ** A Readline completer for command names.
 */
 
-extern  MR_Completer_List
+extern  MR_CompleterList
                 *MR_trace_command_completer(const char *word, size_t word_len);
 
 #endif  /* MERCURY_TRACE_INTERNAL_H */
Index: trace/mercury_trace_source.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_source.c,v
retrieving revision 1.9
diff -u -r1.9 mercury_trace_source.c
--- trace/mercury_trace_source.c	28 Jan 2005 02:47:43 -0000	1.9
+++ trace/mercury_trace_source.c	26 Nov 2006 23:05:24 -0000
@@ -180,7 +180,7 @@
 }
 
 const char *
-MR_trace_source_open_server(MR_Trace_Source_Server *server,
+MR_trace_source_open_server(MR_TraceSourceServer *server,
     const char *window_cmd, int timeout, MR_bool verbose)
 {
     const char  *real_window_cmd;
@@ -318,7 +318,7 @@
 }
 
 const char *
-MR_trace_source_attach(MR_Trace_Source_Server *server, int timeout,
+MR_trace_source_attach(MR_TraceSourceServer *server, int timeout,
     MR_bool verbose)
 {
     const char  *real_server_cmd;
@@ -366,7 +366,7 @@
 }
 
 const char *
-MR_trace_source_sync(MR_Trace_Source_Server *server, const char *filename,
+MR_trace_source_sync(MR_TraceSourceServer *server, const char *filename,
     int lineno, const char *parent_filename, int parent_lineno,
     MR_bool verbose)
 {
@@ -504,7 +504,7 @@
 }
 
 const char *
-MR_trace_source_close(MR_Trace_Source_Server *server, MR_bool verbose)
+MR_trace_source_close(MR_TraceSourceServer *server, MR_bool verbose)
 {
     const char  *real_server_cmd;
     const char  *msg;
Index: trace/mercury_trace_source.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_source.h,v
retrieving revision 1.5
diff -u -r1.5 mercury_trace_source.h
--- trace/mercury_trace_source.h	10 Nov 2006 03:24:17 -0000	1.5
+++ trace/mercury_trace_source.h	26 Nov 2006 23:05:24 -0000
@@ -38,7 +38,7 @@
     char        *server_name;
     char        *server_cmd;
     MR_bool     split;
-} MR_Trace_Source_Server;
+} MR_TraceSourceServer;
 
 /*
 ** Start a server in a new window. The arguments are:
@@ -62,7 +62,7 @@
 ** describing the problem.
 */
 
-const char  *MR_trace_source_open_server(MR_Trace_Source_Server *server,
+const char  *MR_trace_source_open_server(MR_TraceSourceServer *server,
                 const char *window_cmd, int timeout, MR_bool verbose);
 
 /*
@@ -70,7 +70,7 @@
 ** otherwise it returns a string describing the problem.
 */
 
-const char  *MR_trace_source_attach(MR_Trace_Source_Server *server,
+const char  *MR_trace_source_attach(MR_TraceSourceServer *server,
                 int timeout, MR_bool verbose);
 
 /*
@@ -80,7 +80,7 @@
 ** and does nothing else; returns NULL if there were no problems.
 */
 
-const char  *MR_trace_source_sync(MR_Trace_Source_Server *server,
+const char  *MR_trace_source_sync(MR_TraceSourceServer *server,
                 const char *filename, int lineno, const char *parent_filename,
                 int parent_lineno, MR_bool verbose);
 
@@ -90,7 +90,7 @@
 ** modified the code in the source window, for example.
 */
 
-const char  *MR_trace_source_close(MR_Trace_Source_Server *server,
+const char  *MR_trace_source_close(MR_TraceSourceServer *server,
                 MR_bool verbose);
 
 #endif /* not MERCURY_TRACE_SOURCE_H */
Index: trace/mercury_trace_spy.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_spy.c,v
retrieving revision 1.28
diff -u -r1.28 mercury_trace_spy.c
--- trace/mercury_trace_spy.c	24 Nov 2006 03:48:29 -0000	1.28
+++ trace/mercury_trace_spy.c	26 Nov 2006 23:25:42 -0000
@@ -52,7 +52,7 @@
 ** free slot and how many slots are allocated.
 */
 
-MR_Spy_Point    **MR_spy_points;
+MR_SpyPoint    **MR_spy_points;
 int             MR_spy_point_next = 0;
 int             MR_spy_point_max  = 0;
 
@@ -70,11 +70,11 @@
 */
 
 typedef struct {
-    const MR_Proc_Layout    *spy_proc;
-    MR_Spy_Point            *spy_points;
-} MR_Spied_Proc;
+    const MR_ProcLayout     *spy_proc;
+    MR_SpyPoint            *spy_points;
+} MR_SpiedProc;
 
-static  MR_Spied_Proc       *MR_spied_procs;
+static  MR_SpiedProc       *MR_spied_procs;
 static  int                 MR_spied_proc_next = 0;
 static  int                 MR_spied_proc_max = 0;
 
@@ -89,11 +89,11 @@
 */
 
 typedef struct {
-    const MR_Label_Layout   *spy_label;
+    const MR_LabelLayout    *spy_label;
     int                     spy_point_num;
-} MR_Spied_Label;
+} MR_SpiedLabel;
 
-static  MR_Spied_Label      *MR_spied_labels;
+static  MR_SpiedLabel      *MR_spied_labels;
 static  int                 MR_spied_label_next = 0;
 static  int                 MR_spied_label_max = 0;
 
@@ -104,19 +104,19 @@
 
 static  int         MR_compare_addr(const void *address1,
                         const void *address2);
-static  int         MR_search_spy_table_for_proc(const MR_Proc_Layout *entry);
+static  int         MR_search_spy_table_for_proc(const MR_ProcLayout *entry);
 static  int         MR_search_spy_table_for_label(
-                        const MR_Label_Layout *label);
-static  MR_bool     MR_spy_cond_is_true(MR_Spy_Point *point,
-                        const MR_Label_Layout *label);
+                        const MR_LabelLayout *label);
+static  MR_bool     MR_spy_cond_is_true(MR_SpyPoint *point,
+                        const MR_LabelLayout *label);
 static  void        MR_add_line_spy_point_callback(
-                        const MR_Label_Layout *label, int spy_point_num);
+                        const MR_LabelLayout *label, int spy_point_num);
 static  int         MR_compare_spied_labels(const void *, const void *);
-static  void        MR_delete_spy_print_list(MR_Spy_Print_List print_list);
-static  void        MR_update_enabled_action(MR_Spy_Point *point,
-                        MR_Trace_Port port, MR_Spy_Action *action_ptr,
+static  void        MR_delete_spy_print_list(MR_SpyPrintList print_list);
+static  void        MR_update_enabled_action(MR_SpyPoint *point,
+                        MR_TracePort port, MR_SpyAction *action_ptr,
                         MR_bool *enabled_ptr);
-static  const char  *MR_ignore_when_to_string(MR_Spy_Ignore_When ignore_when);
+static  const char  *MR_ignore_when_to_string(MR_SpyIgnore_When ignore_when);
 
 /*
 ** Compare two addresses, and return an integer which is <0, 0, or >0
@@ -149,7 +149,7 @@
 */
 
 static int
-MR_search_spy_table_for_proc(const MR_Proc_Layout *entry)
+MR_search_spy_table_for_proc(const MR_ProcLayout *entry)
 {
     int     slot;
     MR_bool found;
@@ -169,7 +169,7 @@
 */
 
 static int
-MR_search_spy_table_for_label(const MR_Label_Layout *label)
+MR_search_spy_table_for_label(const MR_LabelLayout *label)
 {
     int     slot;
     MR_bool found;
@@ -184,15 +184,15 @@
 }
 
 MR_bool
-MR_event_matches_spy_point(const MR_Label_Layout *layout,
-    MR_Trace_Port port, MR_Spy_Action *action_ptr,
-    MR_Spy_Print_List *print_list)
+MR_event_matches_spy_point(const MR_LabelLayout *layout,
+    MR_TracePort port, MR_SpyAction *action_ptr,
+    MR_SpyPrintList *print_list)
 {
     int                     slot;
     MR_bool                 enabled;
-    MR_Spy_Point            *point;
-    MR_Spy_Action           action;
-    const MR_Label_Layout   *parent;
+    MR_SpyPoint            *point;
+    MR_SpyAction           action;
+    const MR_LabelLayout    *parent;
     const char              *problem;
     MR_Word                 *base_sp;
     MR_Word                 *base_curfr;
@@ -323,8 +323,8 @@
 }
 
 static void
-MR_update_enabled_action(MR_Spy_Point *point, MR_Trace_Port port,
-    MR_Spy_Action *action_ptr, MR_bool *enabled_ptr)
+MR_update_enabled_action(MR_SpyPoint *point, MR_TracePort port,
+    MR_SpyAction *action_ptr, MR_bool *enabled_ptr)
 {
     if (point->spy_enabled) {
         if (point->spy_ignore_count == 0) {
@@ -359,14 +359,14 @@
 }
 
 const char  *MR_spy_point_cond_problem = NULL;
-MR_Spy_Cond *MR_spy_point_cond_bad = NULL;
+MR_SpyCond *MR_spy_point_cond_bad = NULL;
 
 static MR_bool
-MR_spy_cond_is_true(MR_Spy_Point *point, const MR_Label_Layout *label_layout)
+MR_spy_cond_is_true(MR_SpyPoint *point, const MR_LabelLayout *label_layout)
 {
     int             max_mr_num;
     MR_Word         saved_regs[MR_MAX_FAKE_REG];
-    MR_Var_Spec     var_spec;
+    MR_VarSpec      var_spec;
     char            *path;
     const char      *problem;
     char            *bad_path;
@@ -379,7 +379,7 @@
     MR_Word         match;
     MR_bool         saved_trace_func_enabled;
     MR_bool         retval;
-    MR_Spy_Cond     *cond;
+    MR_SpyCond      *cond;
 
     if (point->spy_cond == NULL) {
         return MR_TRUE;
@@ -402,7 +402,7 @@
     /* This also saves the regs in MR_fake_regs. */
     MR_copy_regs_to_saved_regs(max_mr_num, saved_regs);
     MR_trace_init_point_vars(label_layout, saved_regs,
-        (MR_Trace_Port) label_layout->MR_sll_port, MR_FALSE);
+        (MR_TracePort) label_layout->MR_sll_port, MR_FALSE);
 
     problem = MR_lookup_unambiguous_var_spec(cond->cond_var_spec,
         &type_info, &value, &name);
@@ -488,12 +488,12 @@
     "Ignore count is not compatible with break point specification";
 
 int
-MR_add_proc_spy_point(MR_Spy_When when, MR_Spy_Action action,
-    MR_Spy_Ignore_When ignore_when, int ignore_count,
-    const MR_Proc_Layout *entry, const MR_Label_Layout *label,
-    MR_Spy_Print_List print_list, const char **problem)
+MR_add_proc_spy_point(MR_SpyWhen when, MR_SpyAction action,
+    MR_SpyIgnore_When ignore_when, int ignore_count,
+    const MR_ProcLayout *entry, const MR_LabelLayout *label,
+    MR_SpyPrintList print_list, const char **problem)
 {
-    MR_Spy_Point    *point;
+    MR_SpyPoint     *point;
     int             point_slot;
     int             proc_slot;
     int             i;
@@ -502,7 +502,7 @@
 
     proc_slot = MR_search_spy_table_for_proc(entry);
     if (proc_slot < 0) {
-        MR_ensure_room_for_next(MR_spied_proc, MR_Spied_Proc,
+        MR_ensure_room_for_next(MR_spied_proc, MR_SpiedProc,
             MR_INIT_SPIED_PROCS);
         MR_prepare_insert_into_sorted(MR_spied_procs,
             MR_spied_proc_next, proc_slot,
@@ -512,7 +512,7 @@
     }
 
     /* Insert the spy point at the head of the list for the proc. */
-    point = MR_NEW(MR_Spy_Point);
+    point = MR_NEW(MR_SpyPoint);
     point->spy_when    = when;
     point->spy_exists  = MR_TRUE;
     point->spy_enabled = MR_TRUE;
@@ -534,7 +534,7 @@
         }
     }
 
-    MR_ensure_room_for_next(MR_spy_point, MR_Spy_Point *, MR_INIT_SPY_POINTS);
+    MR_ensure_room_for_next(MR_spy_point, MR_SpyPoint *, MR_INIT_SPY_POINTS);
     point_slot = MR_spy_point_next;
     MR_spy_points[point_slot] = point;
     MR_spy_point_next++;
@@ -548,11 +548,11 @@
 static char MR_error_msg_buf[MR_ERROR_MSG_BUF_SIZE];
 
 int
-MR_add_line_spy_point(MR_Spy_Action action, MR_Spy_Ignore_When ignore_when,
+MR_add_line_spy_point(MR_SpyAction action, MR_SpyIgnore_When ignore_when,
     int ignore_count, const char *orig_filename, int linenumber,
-    MR_Spy_Print_List print_list, const char **problem)
+    MR_SpyPrintList print_list, const char **problem)
 {
-    MR_Spy_Point    *point;
+    MR_SpyPoint     *point;
     int             point_slot;
     int             old_size;
     int             new_size;
@@ -600,10 +600,10 @@
     ** We must make the table sorted again.
     */
 
-    qsort(MR_spied_labels, MR_spied_label_next, sizeof(MR_Spied_Label),
+    qsort(MR_spied_labels, MR_spied_label_next, sizeof(MR_SpiedLabel),
         MR_compare_spied_labels);
 
-    point = MR_NEW(MR_Spy_Point);
+    point = MR_NEW(MR_SpyPoint);
     point->spy_when       = MR_SPY_LINENO;
     point->spy_exists     = MR_TRUE;
     point->spy_enabled    = MR_TRUE;
@@ -615,7 +615,7 @@
     point->spy_filename   = filename;
     point->spy_linenumber = linenumber;
 
-    MR_ensure_room_for_next(MR_spy_point, MR_Spy_Point *, MR_INIT_SPY_POINTS);
+    MR_ensure_room_for_next(MR_spy_point, MR_SpyPoint *, MR_INIT_SPY_POINTS);
     MR_spy_points[point_slot] = point;
     MR_spy_point_next++;
 
@@ -624,11 +624,11 @@
 }
 
 static void
-MR_add_line_spy_point_callback(const MR_Label_Layout *label, int spy_point_num)
+MR_add_line_spy_point_callback(const MR_LabelLayout *label, int spy_point_num)
 {
     int spied_label_slot;
 
-    MR_ensure_room_for_next(MR_spied_label, MR_Spied_Label,
+    MR_ensure_room_for_next(MR_spied_label, MR_SpiedLabel,
         MR_INIT_SPIED_LABELS);
     spied_label_slot = MR_spied_label_next;
     MR_spied_labels[spied_label_slot].spy_label = label;
@@ -639,20 +639,20 @@
 static int
 MR_compare_spied_labels(const void *l1, const void *l2)
 {
-    const MR_Spied_Label    *label1;
-    const MR_Spied_Label    *label2;
+    const MR_SpiedLabel    *label1;
+    const MR_SpiedLabel    *label2;
 
-    label1 = (const MR_Spied_Label *) l1;
-    label2 = (const MR_Spied_Label *) l2;
+    label1 = (const MR_SpiedLabel *) l1;
+    label2 = (const MR_SpiedLabel *) l2;
 
     return (int) ((MR_Integer) label1->spy_label
         - (MR_Integer) label2->spy_label);
 }
 
 void
-MR_add_spy_point_print_list_start(int point_slot, MR_Spy_Print_List print_list)
+MR_add_spy_point_print_list_start(int point_slot, MR_SpyPrintList print_list)
 {
-    MR_Spy_Print_List   list;
+    MR_SpyPrintList list;
 
     list = print_list;
     if (list == NULL) {
@@ -670,9 +670,9 @@
 }
 
 void
-MR_add_spy_point_print_list_end(int point_slot, MR_Spy_Print_List print_list)
+MR_add_spy_point_print_list_end(int point_slot, MR_SpyPrintList print_list)
 {
-    MR_Spy_Print_List   list;
+    MR_SpyPrintList list;
 
     list = MR_spy_points[point_slot]->spy_print_list;
     if (list == NULL) {
@@ -697,7 +697,7 @@
 }
 
 const char *
-MR_ignore_spy_point(int point_slot, MR_Spy_Ignore_When ignore_when,
+MR_ignore_spy_point(int point_slot, MR_SpyIgnore_When ignore_when,
     int ignore_count)
 {
     switch (MR_spy_points[point_slot]->spy_when) {
@@ -722,7 +722,7 @@
 }
 
 static void
-MR_delete_spy_print_list(MR_Spy_Print_List print_list)
+MR_delete_spy_print_list(MR_SpyPrintList print_list)
 {
     if (print_list == NULL) {
         return;
@@ -741,9 +741,9 @@
 void
 MR_delete_spy_point(int point_table_slot)
 {
-    MR_Spy_Point    *point;
-    MR_Spy_Point    **cur_addr;
-    MR_Spy_Point    *cur;
+    MR_SpyPoint     *point;
+    MR_SpyPoint     **cur_addr;
+    MR_SpyPoint     *cur;
     int             proc_table_slot;
     int             i;
     int             label_slot;
@@ -823,8 +823,8 @@
 void
 MR_print_spy_point(FILE *fp, int spy_point_num, MR_bool verbose)
 {
-    MR_Spy_Point    *point;
-    MR_Spy_Cond     *cond;
+    MR_SpyPoint *point;
+    MR_SpyCond  *cond;
 
     point = MR_spy_points[spy_point_num];
     fprintf(fp, "%2d: %1s %-5s %9s ",
@@ -869,8 +869,8 @@
     }
 
     if (verbose && point->spy_print_list != NULL) {
-        MR_Spy_Print_List   list;
-        MR_Spy_Print        node;
+        MR_SpyPrintList list;
+        MR_SpyPrint     node;
 
         fprintf(fp, "%12s", "");
         for (list = point->spy_print_list; list != NULL; list = list->pl_next)
@@ -937,7 +937,7 @@
 }
 
 void
-MR_print_spy_cond(FILE *fp, MR_Spy_Cond *cond)
+MR_print_spy_cond(FILE *fp, MR_SpyCond *cond)
 {
     switch (cond->cond_var_spec.MR_var_spec_kind) {
         case MR_VAR_SPEC_NUMBER:
@@ -975,7 +975,7 @@
 }
 
 static const char *
-MR_ignore_when_to_string(MR_Spy_Ignore_When ignore_when)
+MR_ignore_when_to_string(MR_SpyIgnore_When ignore_when)
 {
     switch (ignore_when) {
         case MR_SPY_IGNORE_ENTRY:
@@ -992,9 +992,9 @@
 MR_bool
 MR_save_spy_points(FILE *fp, FILE *err_fp)
 {
-    MR_Spy_Point    *point;
-    int             i;
-    int             spy_point_num;
+    MR_SpyPoint *point;
+    int         i;
+    int         spy_point_num;
 
     spy_point_num = 0;
     for (i = 0; i < MR_spy_point_next; i++) {
@@ -1067,7 +1067,7 @@
         }
 
         if (point->spy_cond != NULL) {
-            MR_Spy_Cond *cond;
+            MR_SpyCond *cond;
 
             cond = point->spy_cond;
             fprintf(fp, "condition ");
@@ -1102,8 +1102,8 @@
         }
 
         if (point->spy_print_list != NULL) {
-            MR_Spy_Print_List   list;
-            MR_Spy_Print        node;
+            MR_SpyPrintList   list;
+            MR_SpyPrint        node;
 
             list = point->spy_print_list;
             for (; list != NULL; list = list->pl_next) {
Index: trace/mercury_trace_spy.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_spy.h,v
retrieving revision 1.12
diff -u -r1.12 mercury_trace_spy.h
--- trace/mercury_trace_spy.h	10 Nov 2006 03:24:17 -0000	1.12
+++ trace/mercury_trace_spy.h	26 Nov 2006 23:24:12 -0000
@@ -17,15 +17,15 @@
 #ifndef MERCURY_TRACE_SPY_H
 #define MERCURY_TRACE_SPY_H
 
-#include "mercury_stack_layout.h"   /* for MR_Proc_Layout etc */
+#include "mercury_stack_layout.h"   /* for MR_ProcLayout etc */
 #include "mercury_trace_term.h"     /* for MR_CTerm */
-#include "mercury_trace_base.h"     /* for MR_Trace_Port etc  */
-#include "mercury_trace_browse.h"   /* for MR_Browse_Format */
-#include "mercury_trace_vars.h"     /* for MR_Var_Spec */
+#include "mercury_trace_base.h"     /* for MR_TracePort etc  */
+#include "mercury_trace_browse.h"   /* for MR_BrowseFormat */
+#include "mercury_trace_vars.h"     /* for MR_VarSpec */
 
 typedef enum {
     MR_SPY_PRINT, MR_SPY_STOP
-} MR_Spy_Action;
+} MR_SpyAction;
 
 #define MR_spy_action_string(a)     ((a == MR_SPY_STOP) ? "stop" :      \
                                     (a == MR_SPY_PRINT) ? "print" :     \
@@ -37,68 +37,68 @@
     MR_SPY_ENTRY,
     MR_SPY_SPECIFIC,
     MR_SPY_LINENO
-} MR_Spy_When;
+} MR_SpyWhen;
 
 typedef enum {
     MR_SPY_DONT_IGNORE,
     MR_SPY_IGNORE_INTERFACE,
     MR_SPY_IGNORE_ENTRY
-} MR_Spy_Ignore_When;
+} MR_SpyIgnore_When;
 
 extern  const char                      *MR_spy_when_names[];
 
-typedef struct MR_Spy_Print_Struct      *MR_Spy_Print;
-typedef struct MR_Spy_Print_List_Struct *MR_Spy_Print_List;
+typedef struct MR_SpyPrint_Struct      *MR_SpyPrint;
+typedef struct MR_SpyPrintList_Struct *MR_SpyPrintList;
 
 typedef enum {
     MR_SPY_TEST_EQUAL, MR_SPY_TEST_NOT_EQUAL
-} MR_Spy_Test;
+} MR_SpyTest;
 
 typedef enum {
     MR_SPY_PRINT_GOAL,
     MR_SPY_PRINT_ALL,
     MR_SPY_PRINT_ONE,
-} MR_Spy_Print_What;
+} MR_SpyPrintWhat;
 
-struct MR_Spy_Print_Struct {
-    MR_Browse_Format    p_format;
-    MR_Spy_Print_What   p_what;
-    char                *p_name;    /* if MR_SPY_PRINT_ONE */
-    MR_bool             p_warn;
+struct MR_SpyPrint_Struct {
+    MR_BrowseFormat p_format;
+    MR_SpyPrintWhat p_what;
+    char            *p_name;    /* if MR_SPY_PRINT_ONE */
+    MR_bool         p_warn;
 };
 
-struct MR_Spy_Print_List_Struct {
-    MR_Spy_Print        pl_cur;
-    MR_Spy_Print_List   pl_next;
+struct MR_SpyPrintList_Struct {
+    MR_SpyPrint     pl_cur;
+    MR_SpyPrintList pl_next;
 };
 
-typedef struct MR_Spy_Point_Struct MR_Spy_Point;
+typedef struct MR_SpyPoint_Struct MR_SpyPoint;
 
 typedef struct {
-    MR_Var_Spec     cond_var_spec;
+    MR_VarSpec      cond_var_spec;
     char            *cond_path;
-    MR_Spy_Test     cond_test;
+    MR_SpyTest      cond_test;
     MR_CTerm        cond_term;
     MR_bool         cond_require_var;
     MR_bool         cond_require_path;
     char            *cond_what_string;
     char            *cond_term_string;
-} MR_Spy_Cond;
+} MR_SpyCond;
 
-struct MR_Spy_Point_Struct {
+struct MR_SpyPoint_Struct {
     MR_bool                 spy_exists;     /* MR_FALSE if deleted */
     MR_bool                 spy_enabled;
-    MR_Spy_When             spy_when;
-    MR_Spy_Action           spy_action;
-    MR_Spy_Ignore_When      spy_ignore_when;
+    MR_SpyWhen              spy_when;
+    MR_SpyAction            spy_action;
+    MR_SpyIgnore_When       spy_ignore_when;
     int                     spy_ignore_count;
-    MR_Spy_Cond             *spy_cond;
-    MR_Spy_Print_List       spy_print_list;
-    const MR_Proc_Layout    *spy_proc;      /* if not LINENO */
-    const MR_Label_Layout   *spy_label;     /* if SPECIFIC */
+    MR_SpyCond              *spy_cond;
+    MR_SpyPrintList         spy_print_list;
+    const MR_ProcLayout     *spy_proc;      /* if not LINENO */
+    const MR_LabelLayout    *spy_label;     /* if SPECIFIC */
     char                    *spy_filename;  /* if LINENO */
     int                     spy_linenumber; /* if LINENO */
-    MR_Spy_Point            *spy_next;      /* if not LINENO */
+    MR_SpyPoint             *spy_next;      /* if not LINENO */
 };
 
 /*
@@ -106,13 +106,13 @@
 ** and how many slots are allocated.
 */
 
-extern  MR_Spy_Point    **MR_spy_points;
+extern  MR_SpyPoint     **MR_spy_points;
 extern  int             MR_spy_point_next;
 extern  int             MR_spy_point_max;
 
 extern  int             MR_most_recent_spy_point;
 
-extern  MR_Spy_Cond     *MR_spy_point_cond_bad;
+extern  MR_SpyCond      *MR_spy_point_cond_bad;
 extern  const char      *MR_spy_point_cond_problem;
 
 /*
@@ -123,9 +123,9 @@
 */
 
 extern  MR_bool         MR_event_matches_spy_point(
-                            const MR_Label_Layout *layout, MR_Trace_Port port,
-                            MR_Spy_Action *action,
-                            MR_Spy_Print_List *print_list);
+                            const MR_LabelLayout *layout, MR_TracePort port,
+                            MR_SpyAction *action,
+                            MR_SpyPrintList *print_list);
 
 /*
 ** Add a new spy point on a procedure (as opposed to on a line number)
@@ -133,11 +133,11 @@
 ** *problem to point to an error message.
 */
 
-extern  int         MR_add_proc_spy_point(MR_Spy_When when,
-                        MR_Spy_Action action, MR_Spy_Ignore_When ignore_when,
-                        int ignore_count, const MR_Proc_Layout *entry,
-                        const MR_Label_Layout *label,
-                        MR_Spy_Print_List print_list, const char **problem);
+extern  int         MR_add_proc_spy_point(MR_SpyWhen when,
+                        MR_SpyAction action, MR_SpyIgnore_When ignore_when,
+                        int ignore_count, const MR_ProcLayout *entry,
+                        const MR_LabelLayout *label,
+                        MR_SpyPrintList print_list, const char **problem);
 
 /*
 ** Add a new spy point on a line number (as opposed to on a procedure)
@@ -145,10 +145,10 @@
 ** *problem to point to an error message.
 */
 
-extern  int         MR_add_line_spy_point(MR_Spy_Action action,
-                        MR_Spy_Ignore_When ignore_when, int ignore_count,
+extern  int         MR_add_line_spy_point(MR_SpyAction action,
+                        MR_SpyIgnore_When ignore_when, int ignore_count,
                         const char *filename, int linenumber,
-                        MR_Spy_Print_List print_list, const char **problem);
+                        MR_SpyPrintList print_list, const char **problem);
 
 /*
 ** Add the given set of things to be printed to the spy point's list,
@@ -156,9 +156,9 @@
 */
 
 extern  void        MR_add_spy_point_print_list_start(int point_slot,
-                        MR_Spy_Print_List print_list);
+                        MR_SpyPrintList print_list);
 extern  void        MR_add_spy_point_print_list_end(int point_slot,
-                        MR_Spy_Print_List print_list);
+                        MR_SpyPrintList print_list);
 
 /*
 ** Empty the set of things to be printed at the spy point.
@@ -173,7 +173,7 @@
 */
 
 extern  const char  *MR_ignore_spy_point(int point_slot,
-                        MR_Spy_Ignore_When ignore_when, int ignore_count);
+                        MR_SpyIgnore_When ignore_when, int ignore_count);
 
 /*
 ** Delete a spy point from the table.
@@ -192,7 +192,7 @@
 ** Print the given spy point condition in a user-friendly manner.
 */
 
-extern  void        MR_print_spy_cond(FILE *fp, MR_Spy_Cond *cond);
+extern  void        MR_print_spy_cond(FILE *fp, MR_SpyCond *cond);
 
 /*
 ** Print the set of current spy points (including those that are currently
Index: trace/mercury_trace_tables.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_tables.c,v
retrieving revision 1.44
diff -u -r1.44 mercury_trace_tables.c
--- trace/mercury_trace_tables.c	24 Nov 2006 03:48:29 -0000	1.44
+++ trace/mercury_trace_tables.c	26 Nov 2006 23:27:58 -0000
@@ -46,7 +46,7 @@
 typedef struct {
     const char          *MR_nick_name;
     MR_Dlist            *MR_nick_layouts;
-                        /* the list entries are MR_Module_Layouts */
+                        /* the list entries are MR_ModuleLayouts */
 } MR_Module_Nick;
 
 static  MR_Module_Nick  *MR_module_nicks;
@@ -57,19 +57,19 @@
 
 #define INIT_MODULE_TABLE_SIZE  10
 
-static  const MR_Module_Layout
+static  const MR_ModuleLayout
                         *MR_search_module_info_by_name(const char *name);
 static  MR_Dlist        *MR_search_module_info_by_nickname(const char *name);
-static  const MR_Module_Layout
+static  const MR_ModuleLayout
                         *MR_search_module_info_by_unique_name(FILE *fp,
                             const char *name);
 
-static  void            MR_insert_module_info(const MR_Module_Layout *module);
+static  void            MR_insert_module_info(const MR_ModuleLayout *module);
 static  void            MR_process_matching_procedures_in_module(
-                            const MR_Module_Layout *module, MR_Proc_Spec *spec,
-                            void f(void *, const MR_Proc_Layout *),
+                            const MR_ModuleLayout *module, MR_ProcSpec *spec,
+                            void f(void *, const MR_ProcLayout *),
                             void *data);
-static  void            MR_process_line_layouts(const MR_Module_File_Layout
+static  void            MR_process_line_layouts(const MR_ModuleFileLayout
                             *file_layout, int line,
                             MR_file_line_callback callback_func,
                             int callback_arg);
@@ -93,40 +93,37 @@
     MR_PredFunc MR_complete_pf;
 
                 /*
-                ** The word to complete, with `__'
-                ** translated into '.'.
+                ** The word to complete, with `__' translated into '.'.
                 */
     char        *MR_complete_name;
     int         MR_complete_name_len;
     MR_bool     MR_complete_name_is_qualified;
 
                 /*
-                ** Slot number of a module for which we should
-                ** return all procedures as completions, -1 if
-                ** there is none.
+                ** Slot number of a module for which we should return all
+                ** procedures as completions, -1 if there is none.
                 */
-    int     MR_unambiguous_matching_module;
+    int         MR_unambiguous_matching_module;
 
                 /*
-                ** Length of the part of the word to skip
-                ** when testing for module qualified completions
-                ** in the current module, zero if we shouldn't
-                ** test for module qualified completions in
-                ** the current module.
+                ** Length of the part of the word to skip when testing for module
+                ** qualified completions in the current module, zero if we
+                ** shouldn't test for module qualified completions in the
+                ** current module.
                 */
-    int     MR_complete_word_matches_module;
-    int     MR_complete_current_module;
-    int     MR_complete_current_proc;
-} MR_Proc_Completer_Data;
+    int         MR_complete_word_matches_module;
+    int         MR_complete_current_module;
+    int         MR_complete_current_proc;
+} MR_ProcCompleterData;
 
 static  char    *MR_trace_proc_spec_completer_next(const char *word,
-                    size_t word_len, MR_Completer_Data *completer_data);
+                    size_t word_len, MR_CompleterData *completer_data);
 static  void    MR_trace_proc_spec_completer_init_module(
-                    MR_Proc_Completer_Data *data);
-static  char    *MR_trace_complete_proc(MR_Proc_Completer_Data *data);
+                    MR_ProcCompleterData *data);
+static  char    *MR_trace_complete_proc(MR_ProcCompleterData *data);
 static  char    *MR_format_proc_spec_completion(MR_PredFunc pred_or_func,
                     const char *module, const char *name);
-static  void    MR_free_proc_completer_data(MR_Completer_Data completer_data);
+static  void    MR_free_proc_completer_data(MR_CompleterData completer_data);
 
 void
 MR_register_all_modules_and_procs(FILE *fp, MR_bool verbose)
@@ -159,7 +156,7 @@
 }
 
 void
-MR_register_module_layout_real(const MR_Module_Layout *module)
+MR_register_module_layout_real(const MR_ModuleLayout *module)
 {
     /*
     ** MR_register_module_layout_real should only be called from
@@ -187,7 +184,7 @@
     }
 }
 
-static const MR_Module_Layout *
+static const MR_ModuleLayout *
 MR_search_module_info_by_name(const char *name)
 {
     int     slot;
@@ -217,10 +214,10 @@
     }
 }
 
-static const MR_Module_Layout *
+static const MR_ModuleLayout *
 MR_search_module_info_by_unique_name(FILE *fp, const char *name)
 {
-    const MR_Module_Layout  *module;
+    const MR_ModuleLayout   *module;
     const MR_Dlist          *modules;
     const MR_Dlist          *element_ptr;
 
@@ -235,13 +232,13 @@
             fprintf(fp, "Module name `%s' is ambiguous.\n", name);
             fprintf(fp, "The matches are:\n");
             MR_for_dlist (element_ptr, modules) {
-                module = (const MR_Module_Layout *) MR_dlist_data(element_ptr);
+                module = (const MR_ModuleLayout *) MR_dlist_data(element_ptr);
                 fprintf(fp, "%s\n", module->MR_ml_name);
             }
 
             return NULL;
         } else {
-            module = (const MR_Module_Layout *) MR_dlist_first(modules);
+            module = (const MR_ModuleLayout *) MR_dlist_first(modules);
         }
     }
 
@@ -249,7 +246,7 @@
 }
 
 static void
-MR_insert_module_info(const MR_Module_Layout *module)
+MR_insert_module_info(const MR_ModuleLayout *module)
 {
     int         slot;
     MR_bool     found;
@@ -285,8 +282,9 @@
 MR_process_file_line_layouts(const char *file, int line,
     MR_file_line_callback callback_func, int callback_arg)
 {
-    int                         i, j;
-    const MR_Module_File_Layout *file_layout;
+    const MR_ModuleFileLayout   *file_layout;
+    int                         i;
+    int                         j;
 
     for (i = 0; i < MR_module_info_next; i++) {
         for (j = 0; j < MR_module_infos[i]->MR_ml_filename_count; j++) {
@@ -300,7 +298,7 @@
 }
 
 static void
-MR_process_line_layouts(const MR_Module_File_Layout *file_layout, int line,
+MR_process_line_layouts(const MR_ModuleFileLayout *file_layout, int line,
     MR_file_line_callback callback_func, int callback_arg)
 {
     int         k;
@@ -333,9 +331,10 @@
 MR_dump_module_tables(FILE *fp, MR_bool separate, MR_bool uci,
     char *module_name)
 {
-    int                     i, j;
-    const MR_Module_Layout  *module;
-    const MR_Proc_Layout    *proc;
+    const MR_ModuleLayout   *module;
+    const MR_ProcLayout     *proc;
+    int                     i;
+    int                     j;
 
     if (module_name != NULL) {
         module = MR_search_module_info_by_unique_name(fp, module_name);
@@ -379,9 +378,9 @@
 void
 MR_dump_module_procs(FILE *fp, const char *name)
 {
-    const MR_Module_Layout  *module;
-    int                     i;
+    const MR_ModuleLayout   *module;
     MR_ConstString          decl_module;
+    int                     i;
 
     module = MR_search_module_info_by_unique_name(fp, name);
     if (module == NULL) {
@@ -458,14 +457,14 @@
 static int
 MR_compare_proc_layout_by_name(const void *ptr1, const void *ptr2)
 {
-    const MR_Proc_Layout    **proc_addr1;
-    const MR_Proc_Layout    **proc_addr2;
-    const MR_Proc_Layout    *proc1;
-    const MR_Proc_Layout    *proc2;
+    const MR_ProcLayout     **proc_addr1;
+    const MR_ProcLayout     **proc_addr2;
+    const MR_ProcLayout     *proc1;
+    const MR_ProcLayout     *proc2;
     int                     result;
 
-    proc_addr1 = (const MR_Proc_Layout **) ptr1;
-    proc_addr2 = (const MR_Proc_Layout **) ptr2;
+    proc_addr1 = (const MR_ProcLayout **) ptr1;
+    proc_addr2 = (const MR_ProcLayout **) ptr2;
     proc1 = *proc_addr1;
     proc2 = *proc_addr2;
 
@@ -615,9 +614,9 @@
     int                         num_functors;
     int                         next_proc_num;
     int                         procs_in_module;
-    const MR_Module_Layout      *module;
-    const MR_Proc_Layout        **procs;
-    const MR_Proc_Layout        *cur_proc;
+    const MR_ModuleLayout       *module;
+    const MR_ProcLayout         **procs;
+    const MR_ProcLayout         *cur_proc;
     MR_TypeCtorInfo             *type_ctors;
     MR_TypeCtorInfo             type_ctor_info;
     MR_FunctorTypeCtor          *functors;
@@ -651,7 +650,7 @@
     ** procedures.
     */
 
-    procs = malloc(sizeof(const MR_Proc_Layout *) * num_procs);
+    procs = malloc(sizeof(const MR_ProcLayout *) * num_procs);
     if (procs == NULL) {
         fprintf(MR_mdb_err, "Error: could not allocate sufficient memory\n");
         return;
@@ -681,7 +680,7 @@
     }
 
     num_procs = next_proc_num;
-    qsort(procs, num_procs, sizeof(const MR_Proc_Layout *),
+    qsort(procs, num_procs, sizeof(const MR_ProcLayout *),
         MR_compare_proc_layout_by_name);
 
     if (print_procs) {
@@ -1020,7 +1019,7 @@
 }
 
 MR_bool
-MR_parse_proc_spec(char *str, MR_Proc_Spec *spec)
+MR_parse_proc_spec(char *str, MR_ProcSpec *spec)
 {
     char    *dash;
     char    *start;
@@ -1033,7 +1032,7 @@
     spec->MR_proc_name   = NULL;
     spec->MR_proc_arity  = -1;
     spec->MR_proc_mode   = -1;
-    spec->MR_proc_prefix = (MR_Proc_Prefix) -1;
+    spec->MR_proc_prefix = (MR_ProcPrefix) -1;
 
     len = strlen(str);
 
@@ -1199,21 +1198,21 @@
 #define MR_INIT_MATCH_PROC_SIZE     8
 
 static void
-MR_register_matches(void *data, const MR_Proc_Layout *entry)
+MR_register_matches(void *data, const MR_ProcLayout *entry)
 {
-    MR_Matches_Info *m;
+    MR_MatchesInfo *m;
 
-    m = (MR_Matches_Info *) data;
-    MR_ensure_room_for_next(m->match_proc, const MR_Proc_Layout *,
+    m = (MR_MatchesInfo *) data;
+    MR_ensure_room_for_next(m->match_proc, const MR_ProcLayout *,
         MR_INIT_MATCH_PROC_SIZE);
     m->match_procs[m->match_proc_next] = entry;
     m->match_proc_next++;
 }
 
-MR_Matches_Info
-MR_search_for_matching_procedures(MR_Proc_Spec *spec)
+MR_MatchesInfo
+MR_search_for_matching_procedures(MR_ProcSpec *spec)
 {
-    MR_Matches_Info m;
+    MR_MatchesInfo m;
 
     m.match_procs = NULL;
     m.match_proc_max = 0;
@@ -1228,16 +1227,16 @@
 */
 
 typedef struct {
-    const MR_Proc_Layout    *matching_entry;
+    const MR_ProcLayout     *matching_entry;
     MR_bool                 match_unique;
-} MR_Match_Info;
+} MR_MatchInfo;
 
 static void
-MR_register_match(void *data, const MR_Proc_Layout *entry)
+MR_register_match(void *data, const MR_ProcLayout *entry)
 {
-    MR_Match_Info   *m;
+    MR_MatchInfo   *m;
 
-    m = (MR_Match_Info *) data;
+    m = (MR_MatchInfo *) data;
     if (m->matching_entry == NULL) {
         m->matching_entry = entry;
     } else {
@@ -1245,10 +1244,10 @@
     }
 }
 
-const MR_Proc_Layout *
-MR_search_for_matching_procedure(MR_Proc_Spec *spec, MR_bool *unique)
+const MR_ProcLayout *
+MR_search_for_matching_procedure(MR_ProcSpec *spec, MR_bool *unique)
 {
-    MR_Match_Info   m;
+    MR_MatchInfo   m;
 
     m.matching_entry = NULL;
     m.match_unique = MR_TRUE;
@@ -1258,11 +1257,11 @@
 }
 
 void
-MR_process_matching_procedures(MR_Proc_Spec *spec,
-    void f(void *, const MR_Proc_Layout *), void *data)
+MR_process_matching_procedures(MR_ProcSpec *spec,
+    void f(void *, const MR_ProcLayout *), void *data)
 {
     if (spec->MR_proc_module != NULL) {
-        const MR_Module_Layout  *module;
+        const MR_ModuleLayout   *module;
 
         module = MR_search_module_info_by_name(spec->MR_proc_module);
         if (module != NULL) {
@@ -1273,7 +1272,7 @@
 
             modules = MR_search_module_info_by_nickname(spec->MR_proc_module);
             MR_for_dlist (element_ptr, modules) {
-                module = (const MR_Module_Layout *) MR_dlist_data(element_ptr);
+                module = (const MR_ModuleLayout *) MR_dlist_data(element_ptr);
                 MR_process_matching_procedures_in_module(module, spec, f,
                     data);
             }
@@ -1331,10 +1330,10 @@
     ))
 
 static void
-MR_process_matching_procedures_in_module(const MR_Module_Layout *module,
-    MR_Proc_Spec *spec, void f(void *, const MR_Proc_Layout *), void *data)
+MR_process_matching_procedures_in_module(const MR_ModuleLayout *module,
+    MR_ProcSpec *spec, void f(void *, const MR_ProcLayout *), void *data)
 {
-    const MR_Proc_Layout    *proc;
+    const MR_ProcLayout     *proc;
     int                     j;
 
     for (j = 0; j < module->MR_ml_proc_count; j++) {
@@ -1360,11 +1359,11 @@
 }
 
 void
-MR_filter_user_preds(MR_Matches_Info *matches)
+MR_filter_user_preds(MR_MatchesInfo *matches)
 {
+    const MR_ProcLayout     *entry;
     int                     filter_pos;
     int                     i;
-    const MR_Proc_Layout    *entry;
 
     filter_pos = 0;
     for(i = 0; i < matches->match_proc_next; i++) {
@@ -1379,7 +1378,7 @@
     matches->match_proc_next = filter_pos;
 }
 
-MR_Completer_List *
+MR_CompleterList *
 MR_trace_module_completer(const char *word, size_t word_len)
 {
     return MR_trace_sorted_array_completer(word, word_len, MR_module_info_next,
@@ -1392,16 +1391,16 @@
     return (char *) MR_module_infos[slot]->MR_ml_name;
 }
 
-MR_Completer_List *
+MR_CompleterList *
 MR_trace_proc_spec_completer(const char *word, size_t word_len)
 {
-    MR_Proc_Completer_Data  *data;
+    MR_ProcCompleterData    *data;
     int                     slot;
     MR_bool                 found;
 
     MR_register_all_modules_and_procs(MR_mdb_out, MR_FALSE);
 
-    data = MR_NEW(MR_Proc_Completer_Data);
+    data = MR_NEW(MR_ProcCompleterData);
 
     if (MR_strneq(word, "pred*", 5)) {
         data->MR_complete_pf = MR_PREDICATE;
@@ -1463,21 +1462,21 @@
     }
 
     return MR_new_completer_elem(MR_trace_proc_spec_completer_next,
-        (MR_Completer_Data) data, MR_free_proc_completer_data);
+        (MR_CompleterData) data, MR_free_proc_completer_data);
 }
 
 static char *
 MR_trace_proc_spec_completer_next(const char *dont_use_this_word,
-    size_t dont_use_this_len, MR_Completer_Data *completer_data)
+    size_t dont_use_this_len, MR_CompleterData *completer_data)
 {
-    MR_Proc_Completer_Data  *data;
+    MR_ProcCompleterData    *data;
     char                    *name;
     size_t                  name_len;
     const char              *module_name;
     int                     module_name_len;
     char                    *completion;
 
-    data = (MR_Proc_Completer_Data *) *completer_data;
+    data = (MR_ProcCompleterData *) *completer_data;
 
     name = data->MR_complete_name;
     name_len = data->MR_complete_name_len;
@@ -1486,8 +1485,7 @@
     if (data->MR_complete_current_module == -1 ||
         data->MR_complete_current_proc == -1 ||
         data->MR_complete_current_proc >=
-            MR_module_infos[data->MR_complete_current_module]
-            ->MR_ml_proc_count)
+            MR_module_infos[data->MR_complete_current_module]->MR_ml_proc_count)
     {
         /*
         ** Move on to the next module.
@@ -1533,7 +1531,7 @@
 */
 
 static void
-MR_trace_proc_spec_completer_init_module(MR_Proc_Completer_Data *data)
+MR_trace_proc_spec_completer_init_module(MR_ProcCompleterData *data)
 {
     char    *name;
     size_t  name_len;
@@ -1598,7 +1596,7 @@
 */
 
 static char *
-MR_trace_complete_proc(MR_Proc_Completer_Data *data)
+MR_trace_complete_proc(MR_ProcCompleterData *data)
 {
     char                    *completion;
     char                    *name;
@@ -1606,8 +1604,8 @@
     char                    *unqualified_name;
     int                     unqualified_name_len;
     char                    *complete_module;
-    const MR_Module_Layout  *module_layout;
-    const MR_Proc_Layout    *proc_layout;
+    const MR_ModuleLayout   *module_layout;
+    const MR_ProcLayout     *proc_layout;
 
     name = data->MR_complete_name;
     name_len = data->MR_complete_name_len;
@@ -1703,25 +1701,25 @@
 }
 
 static void
-MR_free_proc_completer_data(MR_Completer_Data completer_data)
+MR_free_proc_completer_data(MR_CompleterData completer_data)
 {
-    MR_Proc_Completer_Data *data;
+    MR_ProcCompleterData    *data;
 
-    data = (MR_Proc_Completer_Data *) completer_data;
+    data = (MR_ProcCompleterData *) completer_data;
 
     MR_free(data->MR_complete_name);
     MR_free(data);
 }
 
 void
-MR_print_proc_id_and_nl(FILE *fp, const MR_Proc_Layout *entry_layout)
+MR_print_proc_id_and_nl(FILE *fp, const MR_ProcLayout *entry_layout)
 {
     MR_print_proc_id(fp, entry_layout);
     fprintf(fp, "\n");
 }
 
 MR_ConstString
-MR_get_proc_decl_module(const MR_Proc_Layout *proc)
+MR_get_proc_decl_module(const MR_ProcLayout *proc)
 {
     if (MR_PROC_LAYOUT_IS_UCI(proc)) {
         return (&proc->MR_sle_uci)->MR_uci_type_module;
@@ -1731,7 +1729,7 @@
 }
 
 void
-MR_print_pred_id_and_nl(FILE *fp, const MR_Proc_Layout *entry_layout)
+MR_print_pred_id_and_nl(FILE *fp, const MR_ProcLayout *entry_layout)
 {
     MR_print_pred_id(fp, entry_layout);
     fprintf(fp, "\n");
@@ -1740,8 +1738,8 @@
 void
 MR_proc_layout_stats(FILE *fp)
 {
-    const MR_Module_Layout      *module_layout;
-    const MR_Proc_Layout        *proc_layout;
+    const MR_ModuleLayout       *module_layout;
+    const MR_ProcLayout         *proc_layout;
     int                         module_num, proc_num;
     MR_Determinism              detism;
     int                         total;
@@ -1782,13 +1780,13 @@
 void
 MR_label_layout_stats(FILE *fp)
 {
-    const MR_Module_Layout      *module_layout;
-    const MR_Module_File_Layout *file_layout;
-    const MR_Label_Layout       *label_layout;
+    const MR_ModuleLayout       *module_layout;
+    const MR_ModuleFileLayout   *file_layout;
+    const MR_LabelLayout        *label_layout;
     int                         module_num;
     int                         file_num;
     int                         label_num;
-    MR_Trace_Port               port;
+    MR_TracePort                port;
     int                         total;
     int                         histogram[MR_PORT_NUM_PORTS];
 
@@ -1804,8 +1802,7 @@
             file_num < module_layout->MR_ml_filename_count;
             file_num++)
         {
-            file_layout = module_layout->
-                MR_ml_module_file_layout[file_num];
+            file_layout = module_layout->MR_ml_module_file_layout[file_num];
 
             for (label_num = 0;
                 label_num < file_layout->MR_mfl_label_count;
@@ -1833,8 +1830,8 @@
 void
 MR_var_name_stats(FILE *fp)
 {
-    const MR_Module_Layout      *module_layout;
-    const MR_Proc_Layout        *proc_layout;
+    const MR_ModuleLayout       *module_layout;
+    const MR_ProcLayout         *proc_layout;
     const MR_uint_least32_t     *var_names;
     int                         module_num;
     int                         proc_num;
Index: trace/mercury_trace_tables.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_tables.h,v
retrieving revision 1.25
diff -u -r1.25 mercury_trace_tables.h
--- trace/mercury_trace_tables.h	24 Nov 2006 03:48:29 -0000	1.25
+++ trace/mercury_trace_tables.h	26 Nov 2006 23:28:36 -0000
@@ -38,7 +38,7 @@
 */
 
 extern  void        MR_register_module_layout_real(
-                        const MR_Module_Layout *module);
+                        const MR_ModuleLayout *module);
 
 /*
 ** Every module that generates user defined events has a specification of the
@@ -67,7 +67,7 @@
 ** with the supplied integer callback argument.
 */
 
-typedef void        (*MR_file_line_callback)(const MR_Label_Layout *, int);
+typedef void        (*MR_file_line_callback)(const MR_LabelLayout *, int);
 
 extern  void        MR_process_file_line_layouts(const char *file, int line,
                         MR_file_line_callback callback_func, int callback_arg);
@@ -137,15 +137,15 @@
     MR_PREFIX_COMP,
     MR_PREFIX_INDX,
     MR_PREFIX_INIT
-} MR_Proc_Prefix;
+} MR_ProcPrefix;
 
 typedef struct {
     const char          *MR_proc_module;
     const char          *MR_proc_name;
     int                 MR_proc_arity;
     int                 MR_proc_mode;
-    MR_Proc_Prefix      MR_proc_prefix;
-} MR_Proc_Spec;
+    MR_ProcPrefix      MR_proc_prefix;
+} MR_ProcSpec;
 
 /*
 ** Given a string containing the specification of a procedure in the form
@@ -153,13 +153,13 @@
 **  [`pred*'|`func*']module:name/arity-mode
 **
 ** in which some of the five components (but not the name) may be missing,
-** parse it into the more usable form of a MR_Proc_Spec. The original string
+** parse it into the more usable form of a MR_ProcSpec. The original string
 ** may be overwritten in the process.
 **
 ** Returns MR_TRUE if the string was correctly formed, and MR_FALSE otherwise.
 */
 
-extern  MR_bool MR_parse_proc_spec(char *str, MR_Proc_Spec *spec);
+extern  MR_bool MR_parse_proc_spec(char *str, MR_ProcSpec *spec);
 
 /*
 ** Search the tables for a procedure that matches the given specification.
@@ -170,8 +170,8 @@
 ** and set *unique to MR_FALSE.
 */
 
-extern  const MR_Proc_Layout    *MR_search_for_matching_procedure(
-                                    MR_Proc_Spec *spec, MR_bool *unique);
+extern  const MR_ProcLayout     *MR_search_for_matching_procedure(
+                                    MR_ProcSpec *spec, MR_bool *unique);
 
 /*
 ** Search the tables for procedures that matches the given specification.
@@ -182,18 +182,18 @@
 */
 
 typedef struct {
-    const MR_Proc_Layout    **match_procs;
+    const MR_ProcLayout     **match_procs;
     int                     match_proc_max;
     int                     match_proc_next;
-} MR_Matches_Info;
+} MR_MatchesInfo;
 
-extern  MR_Matches_Info MR_search_for_matching_procedures(MR_Proc_Spec *spec);
+extern  MR_MatchesInfo MR_search_for_matching_procedures(MR_ProcSpec *spec);
 
 /*
 ** Filter out UCI procs and keep only mode number 0.
 */
 
-extern  void            MR_filter_user_preds(MR_Matches_Info *matches);
+extern  void            MR_filter_user_preds(MR_MatchesInfo *matches);
 
 /*
 ** MR_process_matching_procedures(spec, f, data):
@@ -204,8 +204,8 @@
 ** information needed by the function `f'.
 */
 
-extern  void    MR_process_matching_procedures(MR_Proc_Spec *spec,
-                    void f(void *, const MR_Proc_Layout *), void *data);
+extern  void            MR_process_matching_procedures(MR_ProcSpec *spec,
+                            void f(void *, const MR_ProcLayout *), void *data);
 
 /*
 ** MR_print_proc_id_and_nl(fp, proc):
@@ -213,16 +213,18 @@
 ** Print the id of the procedure identified by proc, followed by a newline.
 */
 
-extern  void    MR_print_proc_id_and_nl(FILE *fp, const MR_Proc_Layout *proc);
+extern  void            MR_print_proc_id_and_nl(FILE *fp,
+                            const MR_ProcLayout *proc);
 
 /*
 ** MR_print_pred_id_and_nl(fp, proc):
 **
-** Print the id of the predicate/function identified by proc, 
+** Print the id of the predicate/function identified by proc,
 ** followed by a newline.
 */
 
-extern  void    MR_print_pred_id_and_nl(FILE *fp, const MR_Proc_Layout *proc);
+extern  void            MR_print_pred_id_and_nl(FILE *fp,
+                            const MR_ProcLayout *proc);
 
 /*
 ** MR_get_proc_decl_module(proc):
@@ -230,7 +232,7 @@
 ** Return the module name the procedure is declared in.
 */
 
-extern  MR_ConstString  MR_get_proc_decl_module(const MR_Proc_Layout *proc);
+extern  MR_ConstString  MR_get_proc_decl_module(const MR_ProcLayout *proc);
 
 /*
 ** MR_proc_layout_stats(fp):
@@ -238,7 +240,7 @@
 ** Prints statistics about the proc layout structures of the program.
 */
 
-extern  void    MR_proc_layout_stats(FILE *fp);
+extern  void            MR_proc_layout_stats(FILE *fp);
 
 /*
 ** MR_label_layout_stats(fp):
@@ -246,7 +248,7 @@
 ** Prints statistics about the label layout structures of the program.
 */
 
-extern  void    MR_label_layout_stats(FILE *fp);
+extern  void            MR_label_layout_stats(FILE *fp);
 
 /*
 ** MR_var_name_stats(fp):
@@ -255,13 +257,12 @@
 ** in the layout structures of the program.
 */
 
-extern  void    MR_var_name_stats(FILE *fp);
+extern  void            MR_var_name_stats(FILE *fp);
 
 /* A Readline completer for module names. */
-extern  MR_Completer_List   *MR_trace_module_completer(const char *, size_t);
+extern  MR_CompleterList    *MR_trace_module_completer(const char *, size_t);
 
 /* A Readline completer for procedure specifications. */
-extern  MR_Completer_List   *MR_trace_proc_spec_completer(const char *,
-                                size_t);
+extern  MR_CompleterList    *MR_trace_proc_spec_completer(const char *, size_t);
 
 #endif  /* not MERCURY_TRACE_TABLES_H */
Index: trace/mercury_trace_util.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_util.c,v
retrieving revision 1.21
diff -u -r1.21 mercury_trace_util.c
--- trace/mercury_trace_util.c	1 Nov 2006 02:31:19 -0000	1.21
+++ trace/mercury_trace_util.c	26 Nov 2006 23:28:52 -0000
@@ -173,7 +173,7 @@
 }
 
 void
-MR_print_debug_vars(FILE *fp, MR_Event_Info *event_info)
+MR_print_debug_vars(FILE *fp, MR_EventInfo *event_info)
 {
 #ifndef MR_HIGHLEVEL_CODE
     fprintf(fp, "from event info:\n");
@@ -190,9 +190,9 @@
 }
 
 MR_bool
-MR_trace_proc_layout_is_builtin_catch(const MR_Proc_Layout *layout)
+MR_trace_proc_layout_is_builtin_catch(const MR_ProcLayout *layout)
 {
-    const MR_User_Proc_Id   *user;
+    const MR_UserProcId *user;
 
     if (MR_PROC_LAYOUT_HAS_PROC_ID(layout)) {
         if (! MR_PROC_LAYOUT_IS_UCI(layout)) {
Index: trace/mercury_trace_util.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_util.h,v
retrieving revision 1.17
diff -u -r1.17 mercury_trace_util.h
--- trace/mercury_trace_util.h	10 Nov 2006 03:24:18 -0000	1.17
+++ trace/mercury_trace_util.h	26 Nov 2006 23:05:24 -0000
@@ -23,7 +23,7 @@
 #include "mercury_types.h"          /* for MR_Word etc */
 #include "mercury_library_types.h"  /* for MercuryFile */
 #include <stdio.h>                  /* for FILE        */
-#include "mercury_trace.h"          /* for MR_Event_Info */
+#include "mercury_trace.h"          /* for MR_EventInfo */
 
 /*
 ** MR_c_file_to_mercury_file is used to convert MR_mdb_in and MR_mdb_out
@@ -71,7 +71,7 @@
 extern  void    MR_print_tabling_regs(FILE *fp, MR_Word *saved_regs);
 extern  void    MR_print_succip_reg(FILE *fp, MR_Word *saved_regs);
 extern  void    MR_print_r_regs(FILE *fp, MR_Word *saved_regs);
-extern  void    MR_print_debug_vars(FILE *fp, MR_Event_Info *event_info);
+extern  void    MR_print_debug_vars(FILE *fp, MR_EventInfo *event_info);
 
 /*
 ** This function returns MR_TRUE if the layout is for exception.builtin_catch
@@ -80,7 +80,7 @@
 */
 
 extern  MR_bool MR_trace_proc_layout_is_builtin_catch(
-                    const MR_Proc_Layout *layout);
+                    const MR_ProcLayout *layout);
 
 /*
 ** MR_trace_call_system_display_error_on_failure executes the given command
Index: trace/mercury_trace_vars.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_vars.c,v
retrieving revision 1.70
diff -u -r1.70 mercury_trace_vars.c
--- trace/mercury_trace_vars.c	24 Nov 2006 03:48:29 -0000	1.70
+++ trace/mercury_trace_vars.c	26 Nov 2006 23:29:52 -0000
@@ -132,12 +132,12 @@
 */
 
 typedef struct {
-    const MR_Label_Layout   *MR_point_top_layout;
+    const MR_LabelLayout    *MR_point_top_layout;
     MR_Word                 *MR_point_top_saved_regs;
-    MR_Trace_Port           MR_point_top_port;
+    MR_TracePort            MR_point_top_port;
     const char              *MR_point_problem;
     int                     MR_point_level;
-    const MR_Proc_Layout    *MR_point_level_entry;
+    const MR_ProcLayout     *MR_point_level_entry;
     const char              *MR_point_level_filename;
     int                     MR_point_level_linenumber;
     MR_Word                 *MR_point_level_base_sp;
@@ -161,21 +161,21 @@
 static  int             MR_compare_slots_on_headvar_num(const void *p1,
                             const void *p2);
 static  const char      *MR_trace_browse_one_path(FILE *out,
-                            MR_bool print_var_name, MR_Var_Spec var_spec,
+                            MR_bool print_var_name, MR_VarSpec var_spec,
                             char *path, MR_Browser browser,
-                            MR_Browse_Caller_Type caller,
-                            MR_Browse_Format format, MR_bool must_be_unique);
+                            MR_BrowseCallerType caller,
+                            MR_BrowseFormat format, MR_bool must_be_unique);
 static  char            *MR_trace_browse_var(FILE *out, MR_bool print_var_name,
                             MR_TypeInfo type_info, MR_Word value,
                             const char *name, char *path,
-                            MR_Browser browser, MR_Browse_Caller_Type caller,
-                            MR_Browse_Format format);
-static  const char      *MR_lookup_var_spec(MR_Var_Spec var_spec,
+                            MR_Browser browser, MR_BrowseCallerType caller,
+                            MR_BrowseFormat format);
+static  const char      *MR_lookup_var_spec(MR_VarSpec var_spec,
                             MR_TypeInfo *type_info_ptr, MR_Word *value_ptr,
                             const char **name_ptr, int *var_index_ptr,
                             MR_bool *is_ambiguous_ptr);
 static  char            *MR_trace_var_completer_next(const char *word,
-                            size_t word_len, MR_Completer_Data *data);
+                            size_t word_len, MR_CompleterData *data);
 static  int             MR_trace_print_var_name(FILE *out,
                             MR_ValueDetails *var);
 static  const char      *MR_trace_printed_var_name(MR_ValueDetails *var);
@@ -304,8 +304,8 @@
 }
 
 void
-MR_trace_init_point_vars(const MR_Label_Layout *top_layout,
-    MR_Word *saved_regs, MR_Trace_Port port, MR_bool print_optionals)
+MR_trace_init_point_vars(const MR_LabelLayout *top_layout,
+    MR_Word *saved_regs, MR_TracePort port, MR_bool print_optionals)
 {
     MR_point.MR_point_top_layout = top_layout;
     MR_point.MR_point_top_saved_regs = saved_regs;
@@ -320,8 +320,8 @@
     const char              *problem;
     MR_Word                 *base_sp;
     MR_Word                 *base_curfr;
-    const MR_Label_Layout   *top_layout;
-    const MR_Label_Layout   *level_layout;
+    const MR_LabelLayout    *top_layout;
+    const MR_LabelLayout    *level_layout;
 
     problem = NULL;
     top_layout = MR_point.MR_point_top_layout;
@@ -344,11 +344,11 @@
 }
 
 const char *
-MR_trace_set_level_from_layout(const MR_Label_Layout *level_layout,
+MR_trace_set_level_from_layout(const MR_LabelLayout *level_layout,
     MR_Word *base_sp, MR_Word *base_curfr, int ancestor_level,
     MR_bool print_optionals)
 {
-    const MR_Proc_Layout    *entry;
+    const MR_ProcLayout     *entry;
     const MR_UserEvent      *user;
     MR_Word                 *valid_saved_regs;
     int                     var_count;
@@ -707,7 +707,7 @@
 }
 
 void
-MR_trace_current_level_details(const MR_Proc_Layout **entry_ptr,
+MR_trace_current_level_details(const MR_ProcLayout **entry_ptr,
     const char **filename_ptr, int *linenumber_ptr,
     MR_Word **base_sp_ptr, MR_Word **base_curfr_ptr)
 {
@@ -811,7 +811,7 @@
 }
 
 const char *
-MR_trace_return_hlds_var_info(int hlds_num, MR_TypeInfo *type_info_ptr, 
+MR_trace_return_hlds_var_info(int hlds_num, MR_TypeInfo *type_info_ptr,
     MR_Word *value_ptr)
 {
     MR_ValueDetails     *value;
@@ -920,7 +920,7 @@
 MR_static_type_info_arity_0(MR_unbound_typeinfo_struct, &unbound_ctor_name);
 
 void
-MR_convert_arg_to_var_spec(const char *word_spec, MR_Var_Spec *var_spec)
+MR_convert_arg_to_var_spec(const char *word_spec, MR_VarSpec *var_spec)
 {
     int n;
 
@@ -989,7 +989,7 @@
     MR_Word *arg_list_ptr,
     MR_bool *is_func_ptr)
 {
-    const MR_Proc_Layout    *proc_layout;
+    const MR_ProcLayout     *proc_layout;
     MR_ConstString          proc_name;
     MR_Word                 is_func;
     MR_Word                 arg_list;
@@ -1026,12 +1026,12 @@
     qsort(var_slot_array, next, sizeof(int), MR_compare_slots_on_headvar_num);
 
     MR_TRACE_USE_HP(
-
         /*
         ** Replace the slot numbers in the argument list with the argument
         ** values, adding entries for any unbound arguments (they will be
         ** printed as `_').
         */
+
         arg_list = MR_list_empty();
         i = next - 1;
         for (headvar_num = arity; headvar_num > 0; headvar_num--) {
@@ -1059,7 +1059,7 @@
 
 const char *
 MR_trace_browse_one_goal(FILE *out, MR_GoalBrowser browser,
-    MR_Browse_Caller_Type caller, MR_Browse_Format format)
+    MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
     const char  *functor;
     MR_Word     arg_list;
@@ -1077,7 +1077,7 @@
 
 const char *
 MR_trace_browse_action(FILE *out, int action_number, MR_GoalBrowser browser,
-    MR_Browse_Caller_Type caller, MR_Browse_Format format)
+    MR_BrowseCallerType caller, MR_BrowseFormat format)
 {
     MR_ConstString  proc_name;
     MR_Word         is_func;
@@ -1099,7 +1099,7 @@
 }
 
 const char *
-MR_trace_parse_var_path(char *word_spec, MR_Var_Spec *var_spec, char **path)
+MR_trace_parse_var_path(char *word_spec, MR_VarSpec *var_spec, char **path)
 {
     char    *s;
     char    *start;
@@ -1145,7 +1145,7 @@
 MR_trace_parse_lookup_var_path(char *word_spec, MR_TypeInfo *type_info_ptr,
     MR_Word *value_ptr, MR_bool *bad_subterm_ptr)
 {
-    MR_Var_Spec var_spec;
+    MR_VarSpec var_spec;
     MR_TypeInfo var_type_info;
     MR_Word     var_value;
     MR_TypeInfo sub_type_info;
@@ -1182,10 +1182,10 @@
 
 const char *
 MR_trace_parse_browse_one(FILE *out, MR_bool print_var_name, char *word_spec,
-    MR_Browser browser, MR_Browse_Caller_Type caller, MR_Browse_Format format,
+    MR_Browser browser, MR_BrowseCallerType caller, MR_BrowseFormat format,
     MR_bool must_be_unique)
 {
-    MR_Var_Spec var_spec;
+    MR_VarSpec  var_spec;
     char        *path;
     const char  *problem;
 
@@ -1199,8 +1199,8 @@
 }
 
 const char *
-MR_trace_browse_one(FILE *out, MR_bool print_var_name, MR_Var_Spec var_spec,
-    MR_Browser browser, MR_Browse_Caller_Type caller, MR_Browse_Format format,
+MR_trace_browse_one(FILE *out, MR_bool print_var_name, MR_VarSpec var_spec,
+    MR_Browser browser, MR_BrowseCallerType caller, MR_BrowseFormat format,
     MR_bool must_be_unique)
 {
     return MR_trace_browse_one_path(out, print_var_name, var_spec, NULL,
@@ -1208,7 +1208,7 @@
 }
 
 const char *
-MR_lookup_unambiguous_var_spec(MR_Var_Spec var_spec,
+MR_lookup_unambiguous_var_spec(MR_VarSpec var_spec,
     MR_TypeInfo *type_info_ptr, MR_Word *value_ptr, const char **name_ptr)
 {
     int         var_num;
@@ -1230,8 +1230,8 @@
 
 static const char *
 MR_trace_browse_one_path(FILE *out, MR_bool print_var_name,
-    MR_Var_Spec var_spec, char *path, MR_Browser browser,
-    MR_Browse_Caller_Type caller, MR_Browse_Format format,
+    MR_VarSpec var_spec, char *path, MR_Browser browser,
+    MR_BrowseCallerType caller, MR_BrowseFormat format,
     MR_bool must_be_unique)
 {
     int         var_num;
@@ -1297,7 +1297,7 @@
     int         var_num;
     MR_bool     is_ambiguous;
     const char  *problem;
-    MR_Var_Spec var_spec;
+    MR_VarSpec  var_spec;
     MR_TypeInfo type_info;
     MR_Word     value;
     const char  *name;
@@ -1377,7 +1377,7 @@
 }
 
 const char *
-MR_trace_browse_all(FILE *out, MR_Browser browser, MR_Browse_Format format)
+MR_trace_browse_all(FILE *out, MR_Browser browser, MR_BrowseFormat format)
 {
     int var_num;
 
@@ -1401,7 +1401,7 @@
 }
 
 const char *
-MR_trace_browse_all_on_level(FILE *out, const MR_Label_Layout *level_layout,
+MR_trace_browse_all_on_level(FILE *out, const MR_LabelLayout *level_layout,
     MR_Word *base_sp, MR_Word *base_curfr, int ancestor_level,
     MR_bool print_optionals)
 {
@@ -1489,8 +1489,8 @@
 static char *
 MR_trace_browse_var(FILE *out, MR_bool print_var_name,
     MR_TypeInfo var_type_info, MR_Word var_value, const char *name,
-    char *path, MR_Browser browser, MR_Browse_Caller_Type caller,
-    MR_Browse_Format format)
+    char *path, MR_Browser browser, MR_BrowseCallerType caller,
+    MR_BrowseFormat format)
 {
     MR_TypeInfo type_info;
     MR_Word     *value;
@@ -1554,7 +1554,7 @@
 */
 
 static const char *
-MR_lookup_var_spec(MR_Var_Spec var_spec, MR_TypeInfo *type_info_ptr,
+MR_lookup_var_spec(MR_VarSpec var_spec, MR_TypeInfo *type_info_ptr,
     MR_Word *value_ptr, const char **name_ptr, int *var_index_ptr,
     MR_bool *is_ambiguous_ptr)
 {
@@ -1654,16 +1654,16 @@
     return NULL;
 }
 
-MR_Completer_List *
+MR_CompleterList *
 MR_trace_var_completer(const char *word, size_t word_len)
 {
     return MR_new_completer_elem(&MR_trace_var_completer_next,
-        (MR_Completer_Data) 0, MR_trace_no_free);
+        (MR_CompleterData) 0, MR_trace_no_free);
 }
 
 static char *
 MR_trace_var_completer_next(const char *word, size_t word_len,
-    MR_Completer_Data *data)
+    MR_CompleterData *data)
 {
     MR_Integer slot;
     const char *var_name;
@@ -1684,7 +1684,7 @@
 
         slot++;
         if (MR_strneq(var_name, word, word_len)) {
-            *data = (MR_Completer_Data) slot;
+            *data = (MR_CompleterData) slot;
             return MR_copy_string(var_name);
         }
     }
@@ -1830,7 +1830,7 @@
 #define MR_INTEGRITY_ERROR_BUF_SIZE    512
 
 void
-MR_trace_check_integrity(const MR_Label_Layout *layout, MR_Trace_Port port)
+MR_trace_check_integrity(const MR_LabelLayout *layout, MR_TracePort port)
 {
     int             level;
     const char      *problem;
Index: trace/mercury_trace_vars.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_vars.h,v
retrieving revision 1.31
diff -u -r1.31 mercury_trace_vars.h
--- trace/mercury_trace_vars.h	24 Nov 2006 03:48:30 -0000	1.31
+++ trace/mercury_trace_vars.h	26 Nov 2006 23:30:23 -0000
@@ -52,58 +52,58 @@
 #define MERCURY_TRACE_VARS_H
 
 #include "mercury_types.h"              /* for MR_Word etc         */
-#include "mercury_stack_layout.h"       /* for MR_Label_Layout etc */
+#include "mercury_stack_layout.h"       /* for MR_LabelLayout etc */
 #include "mercury_type_info.h"          /* for MR_TypeInfo         */
-#include "mercury_trace_base.h"         /* for MR_Trace_Port       */
+#include "mercury_trace_base.h"         /* for MR_TracePort       */
 #include "mercury_trace_browse.h"       /* for MR_Browser          */
-#include "mercury_trace_completion.h"   /* for MR_Completer_List   */
+#include "mercury_trace_completion.h"   /* for MR_CompleterList   */
 #include <stdio.h>
 
 typedef void    (*MR_Browser)(MR_Word type_info, MR_Word value,
-                    MR_Browse_Caller_Type caller, MR_Browse_Format format);
+                    MR_BrowseCallerType caller, MR_BrowseFormat format);
 
 typedef void    (*MR_GoalBrowser)(MR_ConstString name, MR_Word arg_list,
-                    MR_Word is_func, MR_Browse_Caller_Type caller,
-                    MR_Browse_Format format);
+                    MR_Word is_func, MR_BrowseCallerType caller,
+                    MR_BrowseFormat format);
 
 typedef enum {
     MR_VAR_SPEC_NUMBER,
     MR_VAR_SPEC_NAME,
     MR_VAR_SPEC_HELD_NAME,
     MR_VAR_SPEC_ATTRIBUTE
-} MR_Var_Spec_Kind;
+} MR_VarSpecKind;
 
 typedef struct {
-    MR_Var_Spec_Kind    MR_var_spec_kind;
+    MR_VarSpecKind      MR_var_spec_kind;
     int                 MR_var_spec_number; /* valid if NUMBER */
     const char          *MR_var_spec_name;  /* valid if NAME, HELD_NAME */
                                             /* or ATTRIBUTE */
-} MR_Var_Spec;
+} MR_VarSpec;
 
 /*
-** This function converts a variable name or variable number to MR_Var_Spec
+** This function converts a variable name or variable number to MR_VarSpec
 ** format.
 */
 
 extern  void        MR_convert_arg_to_var_spec(const char *word_spec,
-                        MR_Var_Spec *var_spec);
+                        MR_VarSpec *var_spec);
 
 /*
 ** These functions are documented near the top of this file.
 */
 
-extern  void        MR_trace_init_point_vars(const MR_Label_Layout *top_layout,
-                        MR_Word *saved_regs, MR_Trace_Port port,
+extern  void        MR_trace_init_point_vars(const MR_LabelLayout *top_layout,
+                        MR_Word *saved_regs, MR_TracePort port,
                         MR_bool print_optionals);
 extern  const char  *MR_trace_set_level(int ancestor_level,
                         MR_bool print_optionals);
 extern  const char  *MR_trace_set_level_from_layout(
-                        const MR_Label_Layout *level_layout,
+                        const MR_LabelLayout *level_layout,
                         MR_Word *base_sp, MR_Word *base_curfr,
                         int ancestor_level, MR_bool print_optionals);
 extern  int         MR_trace_current_level(void);
 extern  void        MR_trace_current_level_details(
-                        const MR_Proc_Layout **entry_ptr,
+                        const MR_ProcLayout **entry_ptr,
                         const char **filename_ptr, int *linenumber_ptr,
                         MR_Word **base_sp_ptr, MR_Word **base_curfr_ptr);
 
@@ -165,8 +165,8 @@
 */
 
 extern  const char  *MR_trace_browse_one_goal(FILE *out,
-                        MR_GoalBrowser browser, MR_Browse_Caller_Type caller,
-                        MR_Browse_Format format);
+                        MR_GoalBrowser browser, MR_BrowseCallerType caller,
+                        MR_BrowseFormat format);
 
 /*
 ** Print I/O action <action_number> as a goal.
@@ -178,8 +178,8 @@
 */
 
 extern  const char  *MR_trace_browse_action(FILE *out, int action_number,
-                        MR_GoalBrowser browser, MR_Browse_Caller_Type caller,
-                        MR_Browse_Format format);
+                        MR_GoalBrowser browser, MR_BrowseCallerType caller,
+                        MR_BrowseFormat format);
 
 /*
 ** Parse the given word into a variable specification and the specification
@@ -190,7 +190,7 @@
 */
 
 extern  const char  *MR_trace_parse_var_path(char *word_spec,
-                        MR_Var_Spec *var_spec, char **path);
+                        MR_VarSpec *var_spec, char **path);
 
 /*
 ** Parse the given word into a variable specification and the specification
@@ -223,8 +223,8 @@
 
 extern  const char  *MR_trace_parse_browse_one(FILE *out,
                         MR_bool print_var_name, char *word_spec,
-                        MR_Browser browser, MR_Browse_Caller_Type caller,
-                        MR_Browse_Format format, MR_bool must_be_unique);
+                        MR_Browser browser, MR_BrowseCallerType caller,
+                        MR_BrowseFormat format, MR_bool must_be_unique);
 
 /*
 ** Print the (name and) value of the specified variable.
@@ -237,8 +237,8 @@
 */
 
 extern  const char  *MR_trace_browse_one(FILE *out, MR_bool print_var_name,
-                        MR_Var_Spec var_spec, MR_Browser browser,
-                        MR_Browse_Caller_Type caller, MR_Browse_Format format,
+                        MR_VarSpec var_spec, MR_Browser browser,
+                        MR_BrowseCallerType caller, MR_BrowseFormat format,
                         MR_bool must_be_unique);
 
 /*
@@ -251,7 +251,7 @@
 */
 
 extern  const char  *MR_trace_browse_all(FILE *out, MR_Browser browser,
-                        MR_Browse_Format format);
+                        MR_BrowseFormat format);
 
 
 /*
@@ -263,7 +263,7 @@
 */
 
 extern  const char  *MR_trace_browse_all_on_level(FILE *out,
-                        const MR_Label_Layout *level_layout,
+                        const MR_LabelLayout *level_layout,
                         MR_Word *base_sp, MR_Word *base_curfr,
                         int ancestor_level, MR_bool print_optionals);
 
@@ -275,7 +275,7 @@
 ** message if this is not possible.
 */
 
-extern  const char  *MR_lookup_unambiguous_var_spec(MR_Var_Spec var_spec,
+extern  const char  *MR_lookup_unambiguous_var_spec(MR_VarSpec var_spec,
                         MR_TypeInfo *type_info, MR_Word *value,
                         const char **name);
 
@@ -322,7 +322,7 @@
 ** A Readline completer for variable names.
 */
 
-extern  MR_Completer_List *MR_trace_var_completer(const char *word,
+extern  MR_CompleterList *MR_trace_var_completer(const char *word,
                         size_t word_len);
 
 #ifdef  MR_TRACE_CHECK_INTEGRITY
@@ -332,8 +332,8 @@
 ** references to terms with corrupted representations.
 */
 
-extern  void        MR_trace_check_integrity(const MR_Label_Layout *layout,
-                        MR_Trace_Port port);
+extern  void        MR_trace_check_integrity(const MR_LabelLayout *layout,
+                        MR_TracePort port);
 
 #endif  /* MR_TRACE_CHECK_INTEGRITY */
 
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list