X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Finform.c;h=a72d81ef6e7a62714000768c361e59771763e68b;hb=d8d68d0bd4c45af6f0dc69b4fc33d37d961aca85;hp=9b30ad3b8ff0d3610fa74c63dddeed3fff3d1b56;hpb=c881aa3386c00d7021ffabf2f66275d6c110c1c1;p=inform.git diff --git a/src/inform.c b/src/inform.c index 9b30ad3..a72d81e 100644 --- a/src/inform.c +++ b/src/inform.c @@ -195,6 +195,12 @@ static void select_target(int targ) /* 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) { @@ -1078,6 +1084,7 @@ extern void translate_temp_filename(int i) { 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"); @@ -1292,15 +1299,16 @@ One or more words can be supplied as \"commands\". These may be:\n\n\ ++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)":""); @@ -1317,6 +1325,7 @@ One or more words can be supplied as \"commands\". These may be:\n\n\ --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 @@ -1341,15 +1350,18 @@ One or more words can be supplied as \"commands\". These may be:\n\n\ 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); @@ -1364,10 +1376,11 @@ One or more words can be supplied as \"commands\". These may be:\n\n\ 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\ @@ -1447,6 +1460,7 @@ extern void switches(char *p, int cmode) 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; @@ -1462,9 +1476,7 @@ extern void switches(char *p, int cmode) 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; @@ -1857,6 +1869,15 @@ static int execute_dashdash_command(char *p, char *p2) 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, '=')) {