\r
// MACROS ------------------------------------------------------------------\r
\r
-#define VERSION_TEXT "1.37"\r
+#define VERSION_TEXT "1.53"\r
#define COPYRIGHT_YEARS_TEXT "1995"\r
\r
// TYPES -------------------------------------------------------------------\r
fprintf(stderr, "ZDoom changes and language extensions by Randy Heit\n");\r
fprintf(stderr, "Further changes by Brad Carney\n");\r
fprintf(stderr, "Even more changes by James Bentler\n");\r
+ fprintf(stderr, "Some additions by Michael \"Necromage\" Weber\n");\r
fprintf(stderr, "Error reporting improvements and limit expansion by Ty Halderman\n");\r
+ fprintf(stderr, "Include paths added by Pascal vd Heiden\n");\r
}\r
\r
//==========================================================================\r
//\r
// ProcessArgs\r
//\r
+// Pascal 12/11/08\r
+// Allowing space after options (option parameter as the next argument)\r
+//\r
//==========================================================================\r
\r
static void ProcessArgs(void)\r
{\r
- int i;\r
- int count;\r
+ int i = 1;\r
+ int count = 0;\r
char *text;\r
char option;\r
-\r
- count = 0;\r
- for(i = 1; i < ArgCount; i++)\r
+ \r
+ while(i < ArgCount)\r
{\r
text = ArgVector[i];\r
+ \r
if(*text == '-')\r
{\r
+ // Option\r
text++;\r
if(*text == 0)\r
{\r
option = toupper(*text++);\r
switch(option)\r
{\r
+ case 'I':\r
+ if((i + 1) < ArgCount)\r
+ {\r
+ TK_AddIncludePath(ArgVector[++i]);\r
+ }\r
+ break;\r
+ \r
case 'D':\r
acs_DebugMode = YES;\r
acs_VerboseMode = YES;\r
OpenDebugFile(text);\r
}\r
break;\r
+ \r
case 'H':\r
pc_NoShrink = TRUE;\r
pc_HexenCase = TRUE;\r
+ pc_EnforceHexen = toupper(*text) != 'H';\r
+ pc_WarnNotHexen = toupper(*text) == 'H';\r
break;\r
+ \r
default:\r
DisplayUsage();\r
break;\r
}\r
- continue;\r
}\r
- count++;\r
- switch(count)\r
+ else\r
{\r
- case 1:\r
- strcpy(acs_SourceFileName, text);\r
- MS_SuggestFileExt(acs_SourceFileName, ".acs");\r
- break;\r
- case 2:\r
- strcpy(ObjectFileName, text);\r
- MS_SuggestFileExt(ObjectFileName, ".o");\r
- break;\r
- default:\r
- DisplayUsage();\r
- break;\r
+ // Input/output file\r
+ count++;\r
+ switch(count)\r
+ {\r
+ case 1:\r
+ strcpy(acs_SourceFileName, text);\r
+ MS_SuggestFileExt(acs_SourceFileName, ".acs");\r
+ break;\r
+ \r
+ case 2:\r
+ strcpy(ObjectFileName, text);\r
+ MS_SuggestFileExt(ObjectFileName, ".o");\r
+ break;\r
+ \r
+ default:\r
+ DisplayUsage();\r
+ break;\r
+ }\r
}\r
+ \r
+ // Next arg\r
+ i++;\r
}\r
+ \r
if(count == 0)\r
{\r
DisplayUsage();\r
}\r
+\r
+ TK_AddIncludePath(".");\r
+#ifdef unix\r
+ TK_AddIncludePath("/usr/local/share/acc/");\r
+#endif\r
+ TK_AddProgramIncludePath(ArgVector[0]);\r
+ \r
if(count == 1)\r
{\r
strcpy(ObjectFileName, acs_SourceFileName);\r
static void DisplayUsage(void)\r
{\r
puts("\nUsage: ACC [options] source[.acs] [object[.o]]\n");\r
- puts("-d[file] Output debugging information");\r
- puts("-h Create pcode compatible with Hexen and old ZDooms");\r
+ puts("-i [path] Add include path to find include files");\r
+ puts("-d[file] Output debugging information");\r
+ puts("-h Create pcode compatible with Hexen and old ZDooms");\r
+ puts("-hh Like -h, but use of new features is only a warning");\r
exit(1);\r
}\r
\r