Update to commit e2647ad952b4d7afc9a186429c181efbc4958786
[inform.git] / src / header.h
index 3faa6a45849413cca2b28404f26b1e35a245a5a8..652a0c8b83dc08336644380ccef03b35c8e8693e 100644 (file)
@@ -1,7 +1,10 @@
 /* ------------------------------------------------------------------------- */
 /*   Header file for Inform:  Z-machine ("Infocom" format) compiler          */
 /*                                                                           */
-/* Copyright (c) Graham Nelson 1993 - 2018                                   */
+/*                              Inform 6.35                                  */
+/*                                                                           */
+/*   This header file and the others making up the Inform source code are    */
+/*   copyright (c) Graham Nelson 1993 - 2020                                 */
 /*                                                                           */
 /* This file is part of Inform.                                              */
 /*                                                                           */
@@ -18,6 +21,9 @@
 /* You should have received a copy of the GNU General Public License         */
 /* along with Inform. If not, see https://gnu.org/licenses/                  */
 /*                                                                           */
+/*   For detailed documentation on how this program internally works, and    */
+/*   how to port it to a new environment, see the Technical Manual.          */
+/*                                                                           */
 /*   *** To compile this program in one of the existing ports, you must      */
 /*       at least change the machine definition (on the next page).          */
 /*       In most cases no other work will be needed. ***                     */
@@ -32,8 +38,9 @@
 /*                                                                           */
 /* ------------------------------------------------------------------------- */
 
-#define RELEASE_DATE "28th June 2018"
-#define RELEASE_NUMBER 1634
+/* For releases, set to the release date in the form "1st January 2000" */
+#define RELEASE_DATE "in development"
+#define RELEASE_NUMBER 1635
 #define GLULX_RELEASE_NUMBER 38
 #define MODULE_VERSION_NUMBER 1
 #define VNUMBER RELEASE_NUMBER
@@ -478,6 +485,7 @@ static int32 unique_task_id(void)
 #define Transcript_File "gametext"
 #endif
 #endif
+
 #ifndef Debugging_File
 #ifdef FILE_EXTENSIONS
 #define Debugging_File "gameinfo.dbg"
@@ -486,6 +494,10 @@ static int32 unique_task_id(void)
 #endif
 #endif
 
+#ifndef Default_Language
+#define Default_Language "english"
+#endif
+
 #ifdef FILE_EXTENSIONS
 #ifndef Source_Extension
 #define Source_Extension  ".inf"
@@ -1304,6 +1316,7 @@ typedef struct operator_s
 #define OBJECT_T              9
 #define CLASS_T               10
 #define FAKE_ACTION_T         11
+#define STATIC_ARRAY_T        12
 
 /* ------------------------------------------------------------------------- */
 /*   Statusline_flag values                                                  */
@@ -1479,6 +1492,7 @@ typedef struct operator_s
 #define FATALERROR_DK   33
 #define WARNING_DK      34
 #define TERMINATING_DK  35
+#define STATIC_DK       36
 
 /*  Index numbers into the keyword group "trace_keywords" (see "lexer.c")  */
 
@@ -1860,7 +1874,7 @@ typedef struct operator_s
 #define PROP_ZA                4
 #define CLASS_NUMBERS_ZA       5
 #define INDIVIDUAL_PROP_ZA     6
-#define DYNAMIC_ARRAY_ZA       7 /* Z-code only */
+#define DYNAMIC_ARRAY_ZA       7
 #define GRAMMAR_ZA             8
 #define ACTIONS_ZA             9
 #define PREACTIONS_ZA         10
@@ -1871,8 +1885,7 @@ typedef struct operator_s
 #define LINK_DATA_ZA          15
 
 #define SYMBOLS_ZA            16
-
-#define ARRAY_ZA              17 /* Glulx only */
+#define STATIC_ARRAY_ZA       17 /* Z-code only */
 #define GLOBALVAR_ZA          18 /* Glulx only */
 
 /* ------------------------------------------------------------------------- */
@@ -1888,7 +1901,7 @@ typedef struct operator_s
 #define INCON_MV               3     /* "Hardware" constant (table address) */
 #define IROUTINE_MV            4     /* Call to internal routine */
 #define VROUTINE_MV            5     /* Call to veneer routine */
-#define ARRAY_MV               6     /* Ref to internal array address */
+#define ARRAY_MV               6     /* Ref to internal dynam array address */
 #define NO_OBJS_MV             7     /* Ref to number of game objects */
 #define INHERIT_MV             8     /* Inherited property value */
 #define INHERIT_INDIV_MV       9     /* Inherited indiv property value */
@@ -1904,8 +1917,9 @@ typedef struct operator_s
 #define INDIVPT_MV            14     /* Individual prop table address */
 #define ACTION_MV             15     /* Action number */
 #define OBJECT_MV             16     /* Ref to internal object number */
+#define STATIC_ARRAY_MV       17     /* Ref to internal static array address */
 
-#define LARGEST_BPATCH_MV     16     /* Larger marker values are never written
+#define LARGEST_BPATCH_MV     17     /* Larger marker values are never written
                                         to backpatch tables */
 
 /* Value indicating an imported symbol record: */
@@ -2060,17 +2074,19 @@ extern void verbs_free_arrays(void);
 extern int no_globals, no_arrays;
 extern int dynamic_array_area_size;
 extern int *dynamic_array_area;
+extern int static_array_area_size;
+extern int *static_array_area;
 extern int32 *global_initial_value;
 extern int32 *array_symbols;
-extern int  *array_sizes, *array_types;
+extern int  *array_sizes, *array_types, *array_locs;
 
 extern void make_global(int array_flag, int name_only);
 extern void set_variable_value(int i, int32 v);
 extern void check_globals(void);
 extern int32 begin_table_array(void);
 extern int32 begin_word_array(void);
-extern void array_entry(int32 i, assembly_operand VAL);
-extern void finish_array(int32 i);
+extern void array_entry(int32 i, int is_static, assembly_operand VAL);
+extern void finish_array(int32 i, int is_static);
 
 /* ------------------------------------------------------------------------- */
 /*   Extern definitions for "asm"                                            */
@@ -2196,8 +2212,10 @@ extern void parse_assembly(void);
 /*   Extern definitions for "bpatch"                                         */
 /* ------------------------------------------------------------------------- */
 
-extern memory_block zcode_backpatch_table, zmachine_backpatch_table;
-extern int32 zcode_backpatch_size, zmachine_backpatch_size;
+extern memory_block zcode_backpatch_table, staticarray_backpatch_table,
+    zmachine_backpatch_table;
+extern int32 zcode_backpatch_size, staticarray_backpatch_size,
+    zmachine_backpatch_size;
 extern int   backpatch_marker, backpatch_error_flag;
 
 extern int32 backpatch_value(int32 value);
@@ -2266,6 +2284,7 @@ extern void error_named(char *s1, char *s2);
 extern void error_numbered(char *s1, int val);
 extern void error_named_at(char *s1, char *s2, brief_location report_line);
 extern void ebf_error(char *s1, char *s2);
+extern void ebf_symbol_error(char *s1, char *name, char *type, brief_location report_line);
 extern void char_error(char *s, int ch);
 extern void unicode_char_error(char *s, int32 uni);
 extern void no_such_label(char *lname);
@@ -2679,7 +2698,8 @@ extern int32
     action_names_offset,    fake_action_names_offset,
     routine_names_offset,   routines_array_offset, routine_flags_array_offset,
     global_names_offset,    global_flags_array_offset,
-    array_flags_array_offset, constant_names_offset, constants_array_offset;
+    array_flags_array_offset, constant_names_offset, constants_array_offset,
+    static_arrays_offset;
 extern int32
     arrays_offset, object_tree_offset, grammar_table_offset,
     abbreviations_offset;    /* For Glulx */