cfad47cfa3/tads3/vmpredef.h

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
1
/* $Header: d:/cvsroot/tads/tads3/VMPREDEF.H,v 1.2 1999/05/17 02:52:28 MJRoberts Exp $ */
2
3
/* 
4
 *   Copyright (c) 1998, 2002 Michael J. Roberts.  All Rights Reserved.
5
 *   
6
 *   Please see the accompanying license file, LICENSE.TXT, for information
7
 *   on using and copying this software.  
8
 */
9
/*
10
Name
11
  vmpredef.h - pre-defined objects and properties
12
Function
13
  Defines a global structure containing the pre-defined objects
14
  and properties.  These values are provided by the load image file's
15
  predefined value symbol table; at load time, we cache these values
16
  for quick access.
17
Notes
18
  
19
Modified
20
  12/09/98 MJRoberts  - Creation
21
*/
22
23
#ifndef VMPREDEF_H
24
#define VMPREDEF_H
25
26
#include "t3std.h"
27
#include "vmtype.h"
28
29
/*
30
 *   some special import names - these are exports that we might need to
31
 *   synthesize, so we need to know their names in the image loader code as
32
 *   well as in the imports table 
33
 */
34
#define VM_IMPORT_NAME_LASTPROPOBJ   "*LastPropObj"
35
#define VM_IMPORT_NAME_RTERRMSG      "exceptionMessage"
36
#define VM_IMPORT_NAME_CONSTSTR      "*ConstStrObj"
37
#define VM_IMPORT_NAME_CONSTLST      "*ConstLstObj"
38
39
/*
40
 *   pre-defined values 
41
 */
42
struct CVmPredef
43
{
44
    /* initialize */
45
    CVmPredef()
46
    {
47
        /* 
48
         *   the pre-defined variables are all undefined initially
49
         */
50
        reset();
51
    }
52
53
    /*
54
     *   Reset the predef variables to their initial undefined values 
55
     */
56
    void reset()
57
    {
58
        /* 
59
         *   include the import list to generate initializations for the
60
         *   predef variables 
61
         */
62
#define VM_IMPORT_OBJ(sym, mem) mem = VM_INVALID_OBJ;
63
#define VM_NOIMPORT_OBJ(sym, mem) VM_IMPORT_OBJ(sym, mem)
64
65
#define VM_IMPORT_PROP(sym, mem) mem = VM_INVALID_PROP;
66
#define VM_NOIMPORT_PROP(sym, mem) VM_IMPORT_PROP(sym, mem)
67
68
#define VM_IMPORT_FUNC(sym, mem) mem = 0;
69
70
#include "vmimport.h"
71
    }
72
73
    /*
74
     *   Now include the import list to generate the actual member variables
75
     *   for the imported symbols.  During image file load, the loader will
76
     *   set these members to the actual values imported from the image
77
     *   file.  
78
     */
79
#define VM_IMPORT_OBJ(sym, mem) vm_obj_id_t mem;
80
#define VM_NOIMPORT_OBJ(sym, mem) VM_IMPORT_OBJ(sym, mem)
81
82
#define VM_IMPORT_PROP(sym, mem) vm_prop_id_t mem;
83
#define VM_NOIMPORT_PROP(sym, mem) VM_IMPORT_PROP(sym, mem)
84
85
#define VM_IMPORT_FUNC(sym, mem) pool_ofs_t mem;
86
87
#include "vmimport.h"
88
};
89
90
#endif /* VMPREDEF_H */
91