Files
mercury/runtime/mercury_construct.h
Simon Taylor b7c4a317e9 Add MR_ prefixes to the remaining non-prefixed symbols.
Estimated hours taken: 4
Branches: main

Add MR_ prefixes to the remaining non-prefixed symbols.

This change will require all workspaces to be updated
The compiler will start generating references to MR_TRUE,
MR_bool, etc., which are not defined in the old runtime
header files.

runtime/mercury_std.h:
	Add MR_ prefixes to bool, TRUE, FALSE, max, min,
	streq, strdiff, strtest, strntest, strneq, strndiff,
	strntest, NO_RETURN.

	Delete a commented out definition of `reg'.

runtime/mercury_tags.h:
	Add an MR_ prefix to TAGBITS.

configure.in:
runtime/mercury_goto.h:
runtime/machdeps/i386_regs.h/mercury_goto.h:
	Add an MR_ prefix to PIC.

runtime/mercury_conf_param.h:
	Allow non-prefixed PIC and HIGHTAGS to be defined on
	the command line.

runtime/mercury_bootstrap.h:
	Add backwards compatibility definitions.

RESERVED_MACRO_NAMES:
	Remove the renamed macros.

compiler/export.m:
compiler/ml_code_gen.m:
	Use MR_bool rather than MR_Bool (MR_Bool is
	meant to be for references to the Mercury type
	bool__bool).

runtime/mercury_types.h:
	Add a comment the MR_Bool is for references to
	bool__bool.

*/*.c:
*/*.h:
*/*.m:
	Add MR_ prefixes.
2002-02-18 07:01:33 +00:00

81 lines
2.2 KiB
C

/*
** Copyright (C) 2002 The University of Melbourne.
** This file may only be copied under the terms of the GNU Library General
** Public License - see the file COPYING.LIB in the Mercury distribution.
*/
/*
** mercury_construct.h
**
** This module provides utility functions for constructing terms, for use by
** the standard library.
*/
#ifndef MERCURY_CONSTRUCT_H
#define MERCURY_CONSTRUCT_H
#include "mercury_types.h"
#include "mercury_type_info.h"
#include "mercury_stack_layout.h"
typedef struct MR_Construct_Info_Struct {
MR_ConstString functor_name;
MR_Integer arity;
const MR_PseudoTypeInfo *arg_pseudo_type_infos;
const MR_ConstString *arg_names;
MR_TypeCtorRep type_ctor_rep;
union {
const MR_EnumFunctorDesc *enum_functor_desc;
const MR_NotagFunctorDesc *notag_functor_desc;
const MR_DuFunctorDesc *du_functor_desc;
} functor_info;
} MR_Construct_Info;
/*
** MR_get_num_functors:
**
** Get the number of functors for a type. If it isn't a
** discriminated union, return -1.
**
** You need to save and restore transient registers around
** calls to this function.
*/
extern int MR_get_num_functors(MR_TypeInfo type_info);
/*
** MR_get_functors_check_range:
**
** Check that functor_number is in range, and get the functor
** info if it is. Return MR_FALSE if it is out of range, or
** if MR_get_functor_info returns MR_FALSE, otherwise return MR_TRUE.
**
** You need to save and restore transient registers around
** calls to this function.
*/
extern MR_bool MR_get_functors_check_range(int functor_number,
MR_TypeInfo type_info,
MR_Construct_Info *construct_info);
/*
** MR_typecheck_arguments:
**
** Given a list of univs (`arg_list'), and a vector of
** type_infos (`arg_vector'), checks that they are all of the
** same type; if so, returns MR_TRUE, otherwise returns MR_FALSE;
** `arg_vector' may contain type variables, these
** will be filled in by the type arguments of `type_info'.
**
** Assumes the length of the list has already been checked.
**
** You need to save and restore transient registers around
** calls to this function.
*/
extern MR_bool MR_typecheck_arguments(MR_TypeInfo type_info,
int arity, MR_Word arg_list,
const MR_PseudoTypeInfo *arg_pseudo_type_infos);
#endif /* MERCURY_CONSTRUCT_H */