/* "inform" : The top level of Inform: switches, pathnames, filenaming */
/* conventions, ICL (Inform Command Line) files, main */
/* */
-/* Copyright (c) Graham Nelson 1993 - 2020 */
-/* */
-/* This file is part of Inform. */
+/* Part of Inform 6.35 */
+/* copyright (c) Graham Nelson 1993 - 2021 */
/* */
/* Inform is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
-/* along with Inform. If not, see https://gnu.org/licenses/ */
+/* along with Inform. If not, see https://gnu.org/licenses/ *
/* */
/* ------------------------------------------------------------------------- */
/* MAX_NUM_ATTR_BYTES can be increased in header.h without fear. */
}
+ if (MAX_ADJECTIVES > 255) {
+ MAX_ADJECTIVES = 255;
+ warning("MAX_ADJECTIVES cannot exceed 255; resetting to 255");
+ /* Only used under Grammar__Version 1, which is obsolete. */
+ }
+
/* Set up a few more variables that depend on the above values */
if (!targ) {
DICT_ENTRY_FLAG_POS = (4+DICT_WORD_BYTES);
}
}
+
+ if (!targ) {
+ /* Z-machine */
+ /* The Z-machine's 96 abbreviations are used for these two purposes.
+ Make sure they are set consistently. If exactly one has been
+ set non-default, set the other to match. */
+ if (MAX_DYNAMIC_STRINGS == 32 && MAX_ABBREVS != 64) {
+ MAX_DYNAMIC_STRINGS = 96 - MAX_ABBREVS;
+ }
+ if (MAX_ABBREVS == 64 && MAX_DYNAMIC_STRINGS != 32) {
+ MAX_ABBREVS = 96 - MAX_DYNAMIC_STRINGS;
+ }
+ if (MAX_ABBREVS + MAX_DYNAMIC_STRINGS != 96
+ || MAX_ABBREVS < 0
+ || MAX_DYNAMIC_STRINGS < 0) {
+ warning("MAX_ABBREVS plus MAX_DYNAMIC_STRINGS must be 96 in Z-code; resetting both");
+ MAX_DYNAMIC_STRINGS = 32;
+ MAX_ABBREVS = 64;
+ }
+ }
+ else {
+ if (MAX_DYNAMIC_STRINGS > 100) {
+ MAX_DYNAMIC_STRINGS = 100;
+ warning("MAX_DYNAMIC_STRINGS cannot exceed 100; resetting to 100");
+ /* This is because they are specified in text literals like "@00",
+ with two digits. */
+ }
+ }
}
/* ------------------------------------------------------------------------- */
{ case 1: p=Temp1_Name; break;
case 2: p=Temp2_Name; break;
case 3: p=Temp3_Name; break;
+ default: return;
}
if (strlen(Temporary_Path)+strlen(Temporary_File)+6 >= PATHLEN) {
printf ("Temporary_Path is too long.\n");
printf(
"\nThis program is a compiler of Infocom format (also called \"Z-machine\")\n\
story files, as well as \"Glulx\" story files:\n\
-Copyright (c) Graham Nelson 1993 - 2020.\n\n");
+Copyright (c) Graham Nelson 1993 - 2021.\n\n");
/* For people typing just "inform", a summary only: */
++dir add this directory to Include_Path\n\
+PATH=dir change the PATH to this directory\n\
++PATH=dir add this directory to the PATH\n\n\
- $... one of the following memory commands:\n");
+ $... one of the following configuration commands:\n");
printf(
-" $list list current memory allocation settings\n\
+" $list list current settings\n\
$huge make standard \"huge game\" settings %s\n\
$large make standard \"large game\" settings %s\n\
$small make standard \"small game\" settings %s\n\
$?SETTING explain briefly what SETTING is for\n\
- $SETTING=number change SETTING to given number\n\n",
+ $SETTING=number change SETTING to given number\n\
+ $#SYMBOL=number define SYMBOL as a constant in the story\n\n",
(DEFAULT_MEMORY_SIZE==HUGE_SIZE)?"(default)":"",
(DEFAULT_MEMORY_SIZE==LARGE_SIZE)?"(default)":"",
(DEFAULT_MEMORY_SIZE==SMALL_SIZE)?"(default)":"");
--size huge, --size large, --size small\n\
--helpopt SETTING\n\
--opt SETTING=number\n\
+ --define SETTING=number\n\
--config filename (setup file)\n\n");
#ifndef PROMPT_INPUT
- printf("For example: \"inform -dexs $huge curses\".\n\n");
+ printf("For example: \"inform -dexs $huge curses\".\n");
#endif
return;
printf("\
f frequencies mode: show how useful abbreviations are\n\
- g traces calls to functions (except in the library)\n\
- g2 traces calls to all functions\n\
- h print this information\n");
+ g traces calls to all game functions\n\
+ g2 traces calls to all game and library functions\n\
+ g3 traces calls to all functions (including veneer)\n\
+ h print general help information\n\
+ h1 print help information on filenames and path options\n\
+ h2 print help information on switches (this page)\n");
printf("\
i ignore default switches set within the file\n\
j list objects as constructed\n\
- k output Infix debugging information to \"%s\" (and switch -D on)\n\
- l list every statement run through Inform\n\
+ k output debugging information to \"%s\"\n\
+ l list every statement run through Inform (not implemented)\n\
m say how much memory has been allocated\n\
n print numbers of properties, attributes and actions\n",
Debugging_Name);
printf("\
u work out most useful abbreviations (very very slowly)\n\
- v3 compile to version-3 (\"Standard\") story file\n\
- v4 compile to version-4 (\"Plus\") story file\n\
- v5 compile to version-5 (\"Advanced\") story file: the default\n\
- v6 compile to version-6 (graphical) story file\n\
+ v3 compile to version-3 (\"Standard\"/\"ZIP\") story file\n\
+ v4 compile to version-4 (\"Plus\"/\"EZIP\") story file\n\
+ v5 compile to version-5 (\"Advanced\"/\"XZIP\") story file: the default\n\
+ v6 compile to version-6 (graphical/\"YZIP\") story file\n\
+ v7 compile to version-7 (expanded \"Advanced\") story file\n\
v8 compile to version-8 (expanded \"Advanced\") story file\n\
w disable warning messages\n\
x print # for every 100 lines compiled\n\
case 'g': switch(p[i+1])
{ case '1': trace_fns_setting=1; s=2; break;
case '2': trace_fns_setting=2; s=2; break;
+ case '3': trace_fns_setting=3; s=2; break;
default: trace_fns_setting=1; break;
}
break;
case 'k': if (cmode == 0)
error("The switch '-k' can't be set with 'Switches'");
else
- { debugfile_switch = state;
- if (state) define_DEBUG_switch = TRUE;
- }
+ debugfile_switch = state;
break;
case 'l': listing_switch = state; break;
case 'm': memout_switch = state; break;
strcpy(cli_buff, "$?");
strcpyupper(cli_buff+2, p2, CMD_BUF_SIZE-2);
}
+ else if (!strcmp(p, "define")) {
+ consumed2 = TRUE;
+ if (!p2) {
+ printf("--define must be followed by \"symbol=number\"\n");
+ return consumed2;
+ }
+ strcpy(cli_buff, "$#");
+ strcpyupper(cli_buff+2, p2, CMD_BUF_SIZE-2);
+ }
else if (!strcmp(p, "path")) {
consumed2 = TRUE;
if (!p2 || !strchr(p2, '=')) {
for (i=1, cli_files_specified=0; i<argc; i++)
if (argv[i][0] == '-' && argv[i][1] == '-') {
char *nextarg = NULL;
+ int consumed2;
if (i+1 < argc) nextarg = argv[i+1];
- int consumed2 = execute_dashdash_command(argv[i]+2, nextarg);
+ consumed2 = execute_dashdash_command(argv[i]+2, nextarg);
if (consumed2 && i+1 < argc) {
i++;
}