Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2650 lines
79 KiB

  1. /*
  2. * Created by CSD YACC (IBM PC) from "newdef.y" */
  3. # define T_FALIAS 257
  4. # define T_KCLASS 258
  5. # define T_KNAME 259
  6. # define T_KLIBRARY 260
  7. # define T_KBASE 261
  8. # define T_KDEVICE 262
  9. # define T_KPHYSICAL 263
  10. # define T_KVIRTUAL 264
  11. # define T_ID 265
  12. # define T_NUMBER 266
  13. # define T_KDESCRIPTION 267
  14. # define T_KHEAPSIZE 268
  15. # define T_KSTACKSIZE 269
  16. # define T_KMAXVAL 270
  17. # define T_KCODE 271
  18. # define T_KCONSTANT 272
  19. # define T_FDISCARDABLE 273
  20. # define T_FNONDISCARDABLE 274
  21. # define T_FEXEC 275
  22. # define T_FFIXED 276
  23. # define T_FMOVABLE 277
  24. # define T_FSWAPPABLE 278
  25. # define T_FSHARED 279
  26. # define T_FMIXED 280
  27. # define T_FNONSHARED 281
  28. # define T_FPRELOAD 282
  29. # define T_FINVALID 283
  30. # define T_FLOADONCALL 284
  31. # define T_FRESIDENT 285
  32. # define T_FPERM 286
  33. # define T_FCONTIG 287
  34. # define T_FDYNAMIC 288
  35. # define T_FNONPERM 289
  36. # define T_KDATA 290
  37. # define T_FNONE 291
  38. # define T_FSINGLE 292
  39. # define T_FMULTIPLE 293
  40. # define T_KSEGMENTS 294
  41. # define T_KOBJECTS 295
  42. # define T_KSECTIONS 296
  43. # define T_KSTUB 297
  44. # define T_KEXPORTS 298
  45. # define T_KEXETYPE 299
  46. # define T_KSUBSYSTEM 300
  47. # define T_FDOS 301
  48. # define T_FOS2 302
  49. # define T_FUNKNOWN 303
  50. # define T_FWINDOWS 304
  51. # define T_FDEV386 305
  52. # define T_FMACINTOSH 306
  53. # define T_FWINDOWSNT 307
  54. # define T_FWINDOWSCHAR 308
  55. # define T_FPOSIX 309
  56. # define T_FNT 310
  57. # define T_FUNIX 311
  58. # define T_KIMPORTS 312
  59. # define T_KNODATA 313
  60. # define T_KOLD 314
  61. # define T_KCONFORM 315
  62. # define T_KNONCONFORM 316
  63. # define T_KEXPANDDOWN 317
  64. # define T_KNOEXPANDDOWN 318
  65. # define T_EQ 319
  66. # define T_AT 320
  67. # define T_KRESIDENTNAME 321
  68. # define T_KNONAME 322
  69. # define T_STRING 323
  70. # define T_DOT 324
  71. # define T_COLON 325
  72. # define T_COMA 326
  73. # define T_ERROR 327
  74. # define T_FHUGE 328
  75. # define T_FIOPL 329
  76. # define T_FNOIOPL 330
  77. # define T_PROTMODE 331
  78. # define T_FEXECREAD 332
  79. # define T_FRDWR 333
  80. # define T_FRDONLY 334
  81. # define T_FINITGLOB 335
  82. # define T_FINITINST 336
  83. # define T_FTERMINST 337
  84. # define T_FWINAPI 338
  85. # define T_FWINCOMPAT 339
  86. # define T_FNOTWINCOMPAT 340
  87. # define T_FPRIVATE 341
  88. # define T_FNEWFILES 342
  89. # define T_REALMODE 343
  90. # define T_FUNCTIONS 344
  91. # define T_APPLOADER 345
  92. # define T_OVL 346
  93. # define T_KVERSION 347
  94. # line 83
  95. /* SCCSID = %W% %E% */
  96. #include <minlit.h>
  97. #include <bndtrn.h>
  98. #include <bndrel.h>
  99. #include <lnkio.h>
  100. #include <newexe.h>
  101. #if EXE386
  102. #include <exe386.h>
  103. #endif
  104. #include <lnkmsg.h>
  105. #include <extern.h>
  106. #include <string.h>
  107. #include <impexp.h>
  108. #define YYS_WD(x) (x)._wd /* Access macro */
  109. #define YYS_BP(x) (x)._bp /* Access macro */
  110. #define INCLUDE_DIR 0xffff /* Include directive for the lexer */
  111. #define MAX_NEST 7
  112. #define IO_BUF_SIZE 512
  113. /*
  114. * FUNCTION PROTOTYPES
  115. */
  116. LOCAL int NEAR lookup(void);
  117. LOCAL int NEAR yylex(void);
  118. LOCAL void NEAR yyerror(char *str);
  119. LOCAL void NEAR ProcNamTab(long lfa,unsigned short cb,unsigned short fres);
  120. LOCAL void NEAR NewProc(char *szName);
  121. #if NOT EXE386
  122. LOCAL void NEAR SetExpOrds(void);
  123. #endif
  124. LOCAL void NEAR NewDescription(unsigned char *sbDesc);
  125. LOCAL APROPIMPPTR NEAR GetImport(unsigned char *sb);
  126. #if EXE386
  127. LOCAL void NEAR NewModule(unsigned char *sbModnam, unsigned char *defaultExt);
  128. LOCAL void NEAR DefaultModule(unsigned char *defaultExt);
  129. #else
  130. LOCAL void NEAR NewModule(unsigned char *sbModnam);
  131. LOCAL void NEAR DefaultModule(void);
  132. #endif
  133. #if AUTOVM
  134. BYTE FAR * NEAR FetchSym1(RBTYPE rb, WORD Dirty);
  135. #define FETCHSYM FetchSym1
  136. #define PROPSYMLOOKUP EnterName
  137. #else
  138. #define FETCHSYM FetchSym
  139. #define PROPSYMLOOKUP EnterName
  140. #endif
  141. int yylineno = -1; /* Line number */
  142. LOCAL FTYPE fFileNameExpected;
  143. LOCAL FTYPE fMixed;
  144. LOCAL FTYPE fNoExeVer;
  145. LOCAL FTYPE fHeapSize;
  146. LOCAL BYTE *sbOldver; /* Old version of the .EXE */
  147. LOCAL FTYPE vfAutodata;
  148. LOCAL FTYPE vfShrattr;
  149. LOCAL BYTE cDigits;
  150. #if EXE386
  151. LOCAL DWORD offmask; /* Seg flag bits to turn off */
  152. LOCAL BYTE fUserVersion = 0;
  153. LOCAL WORD expOtherFlags = 0;
  154. LOCAL BYTE moduleEXE[] = "\007A:\\.exe";
  155. LOCAL BYTE moduleDLL[] = "\007A:\\.dll";
  156. #else
  157. LOCAL WORD offmask; /* Seg flag bits to turn off */
  158. #endif
  159. #if OVERLAYS
  160. LOCAL WORD iOvl = NOTIOVL; // Overlay assigned to functions
  161. #endif
  162. LOCAL char *szSegName; // Segment assigned to functions
  163. LOCAL WORD nameFlags; /* Flags associated with exported name */
  164. LOCAL BSTYPE includeDisp[MAX_NEST];
  165. // Include file stack
  166. LOCAL short curLevel; // Current include nesting level
  167. // Zero means main .DEF file
  168. LOCAL char *keywds[] = /* Keyword array */
  169. {
  170. "ALIAS", (char *) T_FALIAS,
  171. "APPLOADER", (char *) T_APPLOADER,
  172. "BASE", (char *) T_KBASE,
  173. "CLASS", (char *) T_KCLASS,
  174. "CODE", (char *) T_KCODE,
  175. "CONFORMING", (char *) T_KCONFORM,
  176. "CONSTANT", (char *) T_KCONSTANT,
  177. "CONTIGUOUS", (char *) T_FCONTIG,
  178. "DATA", (char *) T_KDATA,
  179. "DESCRIPTION", (char *) T_KDESCRIPTION,
  180. "DEV386", (char *) T_FDEV386,
  181. "DEVICE", (char *) T_KDEVICE,
  182. "DISCARDABLE", (char *) T_FDISCARDABLE,
  183. "DOS", (char *) T_FDOS,
  184. "DYNAMIC", (char *) T_FDYNAMIC,
  185. "EXECUTE-ONLY", (char *) T_FEXEC,
  186. "EXECUTEONLY", (char *) T_FEXEC,
  187. "EXECUTEREAD", (char *) T_FEXECREAD,
  188. "EXETYPE", (char *) T_KEXETYPE,
  189. "EXPANDDOWN", (char *) T_KEXPANDDOWN,
  190. "EXPORTS", (char *) T_KEXPORTS,
  191. "FIXED", (char *) T_FFIXED,
  192. "FUNCTIONS", (char *) T_FUNCTIONS,
  193. "HEAPSIZE", (char *) T_KHEAPSIZE,
  194. "HUGE", (char *) T_FHUGE,
  195. "IMPORTS", (char *) T_KIMPORTS,
  196. "IMPURE", (char *) T_FNONSHARED,
  197. "INCLUDE", (char *) INCLUDE_DIR,
  198. "INITGLOBAL", (char *) T_FINITGLOB,
  199. "INITINSTANCE", (char *) T_FINITINST,
  200. "INVALID", (char *) T_FINVALID,
  201. "IOPL", (char *) T_FIOPL,
  202. "LIBRARY", (char *) T_KLIBRARY,
  203. "LOADONCALL", (char *) T_FLOADONCALL,
  204. "LONGNAMES", (char *) T_FNEWFILES,
  205. "MACINTOSH", (char *) T_FMACINTOSH,
  206. "MAXVAL", (char *) T_KMAXVAL,
  207. "MIXED1632", (char *) T_FMIXED,
  208. "MOVABLE", (char *) T_FMOVABLE,
  209. "MOVEABLE", (char *) T_FMOVABLE,
  210. "MULTIPLE", (char *) T_FMULTIPLE,
  211. "NAME", (char *) T_KNAME,
  212. "NEWFILES", (char *) T_FNEWFILES,
  213. "NODATA", (char *) T_KNODATA,
  214. "NOEXPANDDOWN", (char *) T_KNOEXPANDDOWN,
  215. "NOIOPL", (char *) T_FNOIOPL,
  216. "NONAME", (char *) T_KNONAME,
  217. "NONCONFORMING", (char *) T_KNONCONFORM,
  218. "NONDISCARDABLE", (char *) T_FNONDISCARDABLE,
  219. "NONE", (char *) T_FNONE,
  220. "NONPERMANENT", (char *) T_FNONPERM,
  221. "NONSHARED", (char *) T_FNONSHARED,
  222. "NOTWINDOWCOMPAT", (char *) T_FNOTWINCOMPAT,
  223. "NT", (char *) T_FNT,
  224. "OBJECTS", (char *) T_KOBJECTS,
  225. "OLD", (char *) T_KOLD,
  226. "OS2", (char *) T_FOS2,
  227. "OVERLAY", (char *) T_OVL,
  228. "OVL", (char *) T_OVL,
  229. "PERMANENT", (char *) T_FPERM,
  230. "PHYSICAL", (char *) T_KPHYSICAL,
  231. "POSIX", (char *) T_FPOSIX,
  232. "PRELOAD", (char *) T_FPRELOAD,
  233. "PRIVATE", (char *) T_FPRIVATE,
  234. "PRIVATELIB", (char *) T_FPRIVATE,
  235. "PROTMODE", (char *) T_PROTMODE,
  236. "PURE", (char *) T_FSHARED,
  237. "READONLY", (char *) T_FRDONLY,
  238. "READWRITE", (char *) T_FRDWR,
  239. "REALMODE", (char *) T_REALMODE,
  240. "RESIDENT", (char *) T_FRESIDENT,
  241. "RESIDENTNAME", (char *) T_KRESIDENTNAME,
  242. "SECTIONS", (char *) T_KSECTIONS,
  243. "SEGMENTS", (char *) T_KSEGMENTS,
  244. "SHARED", (char *) T_FSHARED,
  245. "SINGLE", (char *) T_FSINGLE,
  246. "STACKSIZE", (char *) T_KSTACKSIZE,
  247. "STUB", (char *) T_KSTUB,
  248. "SUBSYSTEM", (char *) T_KSUBSYSTEM,
  249. "SWAPPABLE", (char *) T_FSWAPPABLE,
  250. "TERMINSTANCE", (char *) T_FTERMINST,
  251. "UNIX", (char *) T_FUNIX,
  252. "UNKNOWN", (char *) T_FUNKNOWN,
  253. "VERSION", (char *) T_KVERSION,
  254. "VIRTUAL", (char *) T_KVIRTUAL,
  255. "WINDOWAPI", (char *) T_FWINAPI,
  256. "WINDOWCOMPAT", (char *) T_FWINCOMPAT,
  257. "WINDOWS", (char *) T_FWINDOWS,
  258. "WINDOWSCHAR", (char *) T_FWINDOWSCHAR,
  259. "WINDOWSNT", (char *) T_FWINDOWSNT,
  260. NULL
  261. };
  262. # line 259
  263. #define UNION 1
  264. typedef union
  265. {
  266. #if EXE386
  267. DWORD _wd;
  268. #else
  269. WORD _wd;
  270. #endif
  271. BYTE *_bp;
  272. } YYSTYPE;
  273. #define yyclearin yychar = -1
  274. #define yyerrok yyerrflag = 0
  275. #ifndef YYMAXDEPTH
  276. #define YYMAXDEPTH 150
  277. #endif
  278. YYSTYPE yylval, yyval;
  279. # define YYERRCODE 256
  280. #line 1256
  281. LOCAL int NEAR GetChar(void)
  282. {
  283. int c; /* A character */
  284. c = GetTxtChr(bsInput);
  285. if ((c == EOF || c == CTRL_Z) && curLevel > 0)
  286. {
  287. free(bsInput->_base);
  288. fclose(bsInput);
  289. bsInput = includeDisp[curLevel];
  290. curLevel--;
  291. c = GetChar();
  292. }
  293. return(c);
  294. }
  295. LOCAL int NEAR lookup() /* Keyword lookup */
  296. {
  297. char **pcp; /* Pointer to character pointer */
  298. int i; /* Comparison value */
  299. for(pcp = keywds; *pcp != NULL; pcp += 2)
  300. { /* Look through keyword table */
  301. /* If found, return token type */
  302. if(!(i = _stricmp(&bufg[1],*pcp)))
  303. {
  304. YYS_WD(yylval) = 0;
  305. return((int) (__int64) pcp[1]);
  306. }
  307. if(i < 0) break; /* Break if we've gone too far */
  308. }
  309. return(T_ID); /* Just your basic identifier */
  310. }
  311. LOCAL int NEAR yylex() /* Lexical analyzer */
  312. {
  313. int c; /* A character */
  314. int StrBegChr; /* What kind of quotte found at the begin of string */
  315. #if EXE386
  316. DWORD x; /* Numeric token value */
  317. #else
  318. WORD x; /* Numeric token value */
  319. #endif
  320. int state; /* State variable */
  321. BYTE *cp; /* Character pointer */
  322. BYTE *sz; /* Zero-terminated string */
  323. static int lastc = 0; /* Previous character */
  324. char *fileBuf;
  325. FTYPE fFileNameSave;
  326. static int NameLineNo;
  327. state = 0; /* Assume we're not in a comment */
  328. c = '\0';
  329. /* Loop to skip white space */
  330. for(;;)
  331. {
  332. lastc = c;
  333. if (((c = GetChar()) == EOF) || c == '\032' || c == '\377')
  334. return(EOF); /* Get a character */
  335. if (c == ';')
  336. state = TRUE; /* If comment, set flag */
  337. else if(c == '\n') /* If end of line */
  338. {
  339. state = FALSE; /* End of comment */
  340. if(!curLevel)
  341. ++yylineno; /* Increment line number count */
  342. }
  343. else if (state == FALSE && c != ' ' && c != '\t' && c != '\r')
  344. break; /* Break on non-white space */
  345. }
  346. /* Handle one-character tokens */
  347. switch(c)
  348. {
  349. case '.': /* Name separator */
  350. if (fFileNameExpected)
  351. break;
  352. return(T_DOT);
  353. case '@': /* Ordinal specifier */
  354. /*
  355. * Require that whitespace precede '@' if introducing an
  356. * ordinal, to allow '@' in identifiers.
  357. */
  358. if (lastc == ' ' || lastc == '\t' || lastc == '\r')
  359. return(T_AT);
  360. break;
  361. case '=': /* Name assignment */
  362. return(T_EQ);
  363. case ':':
  364. return(T_COLON);
  365. case ',':
  366. return(T_COMA);
  367. }
  368. /* See if token is a number */
  369. if (c >= '0' && c <= '9' && !fFileNameExpected)
  370. { /* If token is a number */
  371. x = c - '0'; /* Get first digit */
  372. c = GetChar(); /* Get next character */
  373. if(x == 0) /* If octal or hex */
  374. {
  375. if(c == 'x' || c == 'X') /* If it is an 'x' */
  376. {
  377. state = 16; /* Base is hexadecimal */
  378. c = GetChar(); /* Get next character */
  379. }
  380. else state = 8; /* Else octal */
  381. cDigits = 0;
  382. }
  383. else
  384. {
  385. state = 10; /* Else decimal */
  386. cDigits = 1;
  387. }
  388. for(;;)
  389. {
  390. if(c >= '0' && c <= '9' && c < (state + '0')) c -= '0';
  391. else if(state == 16 && c >= 'A' && c <= 'F') c -= 'A' - 10;
  392. else if(state == 16 && c >= 'a' && c <= 'f') c -= 'a' - 10;
  393. else break;
  394. cDigits++;
  395. x = x*state + c;
  396. c = (BYTE) GetChar();
  397. }
  398. ungetc(c,bsInput);
  399. YYS_WD(yylval) = x;
  400. return(T_NUMBER);
  401. }
  402. /* See if token is a string */
  403. if (c == '\'' || c == '"') /* If token is a string */
  404. {
  405. StrBegChr = c;
  406. sz = &bufg[1]; /* Initialize */
  407. for(state = 0; state != 2;) /* State machine loop */
  408. {
  409. if ((c = GetChar()) == EOF)
  410. return(EOF); /* Check for EOF */
  411. if (sz >= &bufg[sizeof(bufg)])
  412. Fatal(ER_dflinemax, sizeof(bufg));
  413. switch(state) /* Transitions */
  414. {
  415. case 0: /* Inside quote */
  416. if ((c == '\'' || c == '"') && c == StrBegChr)
  417. state = 1; /* Change state if quote found */
  418. else
  419. *sz++ = (BYTE) c; /* Else save character */
  420. break;
  421. case 1: /* Inside quote with quote */
  422. if ((c == '\'' || c == '"'))
  423. { /* If consecutive quotes */
  424. *sz++ = (BYTE) c; /* Quote inside string */
  425. state = 0; /* Back to state 0 */
  426. }
  427. else
  428. state = 2; /* Else end of string */
  429. break;
  430. }
  431. }
  432. ungetc(c,bsInput); /* Put back last character */
  433. *sz = '\0'; /* Null-terminate the string */
  434. x = (WORD)(sz - &bufg[1]);
  435. if (x >= SBLEN) /* Set length of string */
  436. {
  437. bufg[0] = 0xff;
  438. bufg[0x100] = '\0';
  439. OutWarn(ER_dfnamemax, &bufg[1]);
  440. }
  441. else
  442. bufg[0] = (BYTE) x;
  443. YYS_BP(yylval) = bufg; /* Save ptr. to identifier */
  444. return(T_STRING); /* String found */
  445. }
  446. /* Assume we have identifier */
  447. sz = &bufg[1]; /* Initialize */
  448. if (fFileNameExpected && NameLineNo && NameLineNo != yylineno)
  449. {
  450. NameLineNo = 0; /* To avoid interference with INCLUDE */
  451. fFileNameExpected = FALSE;
  452. }
  453. for(;;) /* Loop to get i.d.'s */
  454. {
  455. if (fFileNameExpected)
  456. cp = " \t\r\n\f";
  457. else
  458. cp = " \t\r\n:.=';\032";
  459. while (*cp && *cp != (BYTE) c)
  460. ++cp; /* Check for end of identifier */
  461. if(*cp) break; /* Break if end of identifier found */
  462. if (sz >= &bufg[sizeof(bufg)])
  463. Fatal(ER_dflinemax, sizeof(bufg));
  464. *sz++ = (BYTE) c; /* Save the character */
  465. if ((c = GetChar()) == EOF)
  466. break; /* Get next character */
  467. }
  468. ungetc(c,bsInput); /* Put character back */
  469. *sz = '\0'; /* Null-terminate the string */
  470. x = (WORD)(sz - &bufg[1]);
  471. if (x >= SBLEN) /* Set length of string */
  472. {
  473. bufg[0] = 0xff;
  474. bufg[0x100] = '\0';
  475. OutWarn(ER_dfnamemax, &bufg[1]);
  476. }
  477. else
  478. bufg[0] = (BYTE) x;
  479. YYS_BP(yylval) = bufg; /* Save ptr. to identifier */
  480. state = lookup();
  481. if (state == T_KNAME || state == T_KLIBRARY)
  482. {
  483. fFileNameExpected = TRUE;
  484. NameLineNo = yylineno;
  485. }
  486. if (state == INCLUDE_DIR)
  487. {
  488. // Process include directive
  489. fFileNameSave = fFileNameExpected;
  490. fFileNameExpected = (FTYPE) TRUE;
  491. state = yylex();
  492. fFileNameExpected = fFileNameSave;
  493. if (state == T_ID || state == T_STRING)
  494. {
  495. if (curLevel < MAX_NEST - 1)
  496. {
  497. curLevel++;
  498. includeDisp[curLevel] = bsInput;
  499. // Because LINK uses customized version of stdio
  500. // for every file we have not only open the file
  501. // but also allocate i/o buffer.
  502. bsInput = fopen(&bufg[1], RDBIN);
  503. if (bsInput == NULL)
  504. Fatal(ER_badinclopen, &bufg[1], strerror(errno));
  505. fileBuf = GetMem(IO_BUF_SIZE);
  506. #if OSMSDOS
  507. setvbuf(bsInput, fileBuf, _IOFBF, IO_BUF_SIZE);
  508. #endif
  509. return(yylex());
  510. }
  511. else
  512. Fatal(ER_toomanyincl);
  513. }
  514. else
  515. Fatal(ER_badinclname);
  516. }
  517. else
  518. return(state);
  519. }
  520. LOCAL void NEAR yyerror(str)
  521. char *str;
  522. {
  523. Fatal(ER_dfsyntax, str);
  524. }
  525. #if NOT EXE386
  526. /*** AppLoader - define aplication specific loader
  527. *
  528. * Purpose:
  529. * Define application specific loader. Feature available only under
  530. * Windows. Linker will create logical segment LOADER_<name> where
  531. * <name> is specified in APPLOADER statement. The LOADER_<name>
  532. * segment forms separate physical segment, which is placed by the linker
  533. * as the first segment in the .EXE file. Whithin the loader segment,
  534. * the linker will create an EXTDEF of the name <name>.
  535. *
  536. * Input:
  537. * - sbName - pointer to lenght prefixed loader name
  538. *
  539. * Output:
  540. * No explicit value is returned. As a side effect the SEGDEF and
  541. * EXTDEF definitions are entered into linker symbol table.
  542. *
  543. * Exceptions:
  544. * None.
  545. *
  546. * Notes:
  547. * None.
  548. *
  549. *************************************************************************/
  550. LOCAL void NEAR AppLoader(char *sbName)
  551. {
  552. APROPSNPTR apropSn;
  553. APROPUNDEFPTR apropUndef;
  554. SBTYPE segName;
  555. WORD strLen;
  556. // Create loader segment name
  557. strcpy(&segName[1], "LOADER_");
  558. strcat(&segName[1], &sbName[1]);
  559. strLen = (WORD)strlen(&segName[1]);
  560. if (strLen >= SBLEN)
  561. {
  562. segName[0] = SBLEN - 1;
  563. segName[SBLEN] = '\0';
  564. OutWarn(ER_dfnamemax, &segName[1]);
  565. }
  566. else
  567. segName[0] = (BYTE) strLen;
  568. // Define loader logical segment and remember its GSN
  569. apropSn = GenSeg(segName, "\004CODE", GRNIL, (FTYPE) TRUE);
  570. gsnAppLoader = apropSn->as_gsn;
  571. apropSn->as_flags = dfCode | NSMOVE | NSPRELOAD;
  572. MARKVP();
  573. // Define EXTDEF
  574. apropUndef = (APROPUNDEFPTR ) PROPSYMLOOKUP(sbName, ATTRUND, TRUE);
  575. vpropAppLoader = vrprop;
  576. apropUndef->au_flags |= STRONGEXT;
  577. apropUndef->au_len = -1L;
  578. MARKVP();
  579. free(sbName);
  580. }
  581. #endif
  582. /*** NewProc - fill in the COMDAT descriptor for ordered procedure
  583. *
  584. * Purpose:
  585. * Fill in the linkers symbol table COMDAT descriptor. This function
  586. * is called for new descriptors generated by FUNCTIONS list in the .DEF
  587. * file. All COMDAT descriptors entered by this function form one
  588. * list linked via ac_order field. The head of this list is global
  589. * variable procOrder;
  590. *
  591. * Input:
  592. * szName - pointer to procedure name
  593. * iOvl - overlay number - global variable
  594. * szSegName - segment name - global variable
  595. *
  596. * Output:
  597. * No explicit value is returned. As a side effect symbol table entry
  598. * is updated.
  599. *
  600. * Exceptions:
  601. * Procedure already known - warning
  602. *
  603. * Notes:
  604. * None.
  605. *
  606. *************************************************************************/
  607. LOCAL void NEAR NewProc(char *szName)
  608. {
  609. RBTYPE vrComdat; // Virtual pointer to COMDAT symbol table entry
  610. APROPCOMDATPTR apropComdat; // Real pointer to COMDAT symbol table descriptor
  611. static RBTYPE lastProc; // Last procedure on the list
  612. APROPSNPTR apropSn;
  613. apropComdat = (APROPCOMDATPTR ) PROPSYMLOOKUP(szName, ATTRCOMDAT, FALSE);
  614. if ((apropComdat != NULL) && (apropComdat->ac_flags & ORDER_BIT))
  615. OutWarn(ER_duporder, &szName[1]);
  616. else
  617. {
  618. apropComdat = (APROPCOMDATPTR ) PROPSYMLOOKUP(szName, ATTRCOMDAT, TRUE);
  619. vrComdat = vrprop;
  620. // Fill in the COMDAT descriptor
  621. apropComdat->ac_flags = ORDER_BIT;
  622. #if OVERLAYS
  623. apropComdat->ac_iOvl = iOvl;
  624. // Set the maximum overlay index
  625. if (iOvl != NOTIOVL)
  626. {
  627. fOverlays = (FTYPE) TRUE;
  628. fNewExe = FALSE;
  629. if (iOvl >= iovMac)
  630. iovMac = iOvl + 1;
  631. }
  632. #endif
  633. if (szSegName != NULL)
  634. {
  635. apropSn = GenSeg(szSegName, "\004CODE", GRNIL, (FTYPE) TRUE);
  636. apropSn->as_flags = dfCode;
  637. // Allocate COMDAT in the segment
  638. apropComdat->ac_gsn = apropSn->as_gsn;
  639. apropComdat->ac_selAlloc = PICK_FIRST | EXPLICIT;
  640. AttachComdat(vrComdat, apropSn->as_gsn);
  641. }
  642. else
  643. apropComdat->ac_selAlloc = ALLOC_UNKNOWN;
  644. MARKVP(); // Page has been changed
  645. // Attach this COMDAT to the ordered procedure list
  646. if (procOrder == VNIL)
  647. procOrder = vrComdat;
  648. else
  649. {
  650. apropComdat = (APROPCOMDATPTR ) FETCHSYM(lastProc, TRUE);
  651. apropComdat->ac_order = vrComdat;
  652. }
  653. lastProc = vrComdat;
  654. }
  655. free(szName);
  656. }
  657. LOCAL void NEAR ProcNamTab(lfa,cb,fres)
  658. long lfa; /* Table starting address */
  659. WORD cb; /* Length of table */
  660. WORD fres; /* Resident name flag */
  661. {
  662. SBTYPE sbExport; /* Exported symbol name */
  663. WORD ordExport; /* Export ordinal */
  664. APROPEXPPTR exp; /* Export symbol table entry */
  665. fseek(bsInput,lfa,0); /* Seek to start of table */
  666. for(cbRec = cb; cbRec != 0; ) /* Loop through table */
  667. {
  668. sbExport[0] = (BYTE) getc(bsInput);/* Get length of name */
  669. fread(&sbExport[1], sizeof(char), B2W(sbExport[0]), bsInput);
  670. /* Get export name */
  671. ordExport = getc(bsInput) | (getc(bsInput) << BYTELN);
  672. if (ordExport == 0) continue;
  673. /* Skip if no ordinal assigned */
  674. exp = (APROPEXPPTR ) PROPSYMLOOKUP(sbExport, ATTREXP, FALSE);
  675. /* Look the export up */
  676. if(exp == PROPNIL || exp->ax_ord != 0) continue;
  677. /* Must exist and be unassigned */
  678. exp->ax_ord = ordExport; /* Assign ordinal */
  679. if (fres)
  680. exp->ax_nameflags |= RES_NAME;
  681. /* Set flag if from resident table */
  682. MARKVP(); /* Page has been changed */
  683. }
  684. }
  685. #if NOT EXE386
  686. LOCAL void NEAR SetExpOrds(void)/* Set export ordinals */
  687. {
  688. struct exe_hdr ehdr; /* Old .EXE header */
  689. struct new_exe hdr; /* New .EXE header */
  690. long lfahdr; /* File offset of header */
  691. if((bsInput = LinkOpenExe(sbOldver)) == NULL)
  692. { /* If old version can't be opened */
  693. /* Error message and return */
  694. OutWarn(ER_oldopn);
  695. return;
  696. }
  697. SETRAW(bsInput); /* Dec 20 hack */
  698. xread(&ehdr,CBEXEHDR,1,bsInput); /* Read old header */
  699. if(E_MAGIC(ehdr) == EMAGIC) /* If old header found */
  700. {
  701. if(E_LFARLC(ehdr) != sizeof(struct exe_hdr))
  702. { /* If no new .EXE in this file */
  703. /* Error message and return */
  704. OutWarn(ER_oldbad);
  705. return;
  706. }
  707. lfahdr = E_LFANEW(ehdr); /* Get file address of new header */
  708. }
  709. else lfahdr = 0L; /* Else no old header */
  710. fseek(bsInput,lfahdr,0); /* Seek to new header */
  711. xread(&hdr,CBNEWEXE,1,bsInput); /* Read the header */
  712. if(NE_MAGIC(hdr) == NEMAGIC) /* If correct magic number */
  713. {
  714. ProcNamTab(lfahdr+NE_RESTAB(hdr),(WORD)(NE_MODTAB(hdr) - NE_RESTAB(hdr)),(WORD)TRUE);
  715. /* Process Resident Name table */
  716. ProcNamTab(NE_NRESTAB(hdr),NE_CBNRESTAB(hdr),FALSE);
  717. /* Process Non-resident Name table */
  718. }
  719. else OutWarn(ER_oldbad);
  720. fclose(bsInput); /* Close old file */
  721. }
  722. #endif
  723. LOCAL void NEAR NewDescription(BYTE *sbDesc)
  724. {
  725. #if NOT EXE386
  726. if (NonResidentName.byteMac > 3)
  727. Fatal(ER_dfdesc); /* Should be first time */
  728. AddName(&NonResidentName, sbDesc, 0);
  729. /* Description 1st in non-res table */
  730. #endif
  731. }
  732. #if EXE386
  733. LOCAL void NEAR NewModule(BYTE *sbModnam, BYTE *defaultExt)
  734. #else
  735. LOCAL void NEAR NewModule(BYTE *sbModnam)
  736. #endif
  737. {
  738. WORD length; /* Length of symbol */
  739. #if EXE386
  740. SBTYPE sbModule;
  741. BYTE *pName;
  742. #endif
  743. if(rhteModule != RHTENIL) Fatal(ER_dfname);
  744. /* Check for redefinition */
  745. PROPSYMLOOKUP(sbModnam, ATTRNIL, TRUE);
  746. /* Create hash table entry */
  747. rhteModule = vrhte; /* Save virtual hash table address */
  748. #if EXE386
  749. memcpy(sbModule, sbModnam, sbModnam[0] + 1);
  750. if (sbModule[sbModule[0]] == '.')
  751. {
  752. sbModule[sbModule[0]] = '\0';
  753. length = sbModule[0];
  754. pName = &sbModule[1];
  755. }
  756. else
  757. {
  758. UpdateFileParts(sbModule, defaultExt);
  759. length = sbModule[0] - 2;
  760. pName = &sbModule[4];
  761. }
  762. if (TargetOs == NE_WINDOWS)
  763. SbUcase(sbModule); /* Make upper case */
  764. vmmove(length, pName, AREAEXPNAME, TRUE);
  765. /* Module name 1st in Export Name Table */
  766. cbExpName = length;
  767. #else
  768. if (TargetOs == NE_WINDOWS)
  769. SbUcase(sbModnam); /* Make upper case */
  770. AddName(&ResidentName, sbModnam, 0);/* Module name 1st in resident table */
  771. #endif
  772. fFileNameExpected = (FTYPE) FALSE;
  773. }
  774. void NewExport(sbEntry,sbInternal,ordno,flags)
  775. BYTE *sbEntry; /* Entry name */
  776. BYTE *sbInternal; /* Internal name */
  777. WORD ordno; /* Ordinal number */
  778. WORD flags; /* Flag byte */
  779. {
  780. APROPEXPPTR export; /* Export record */
  781. APROPUNDEFPTR undef; /* Undefined symbol */
  782. APROPNAMEPTR PubName; /* Defined name */
  783. BYTE *sb; /* Internal name */
  784. BYTE ParWrds; /* # of parameter words */
  785. RBTYPE rbSymdef; /* Virtual addr of symbol definition */
  786. #if EXE386
  787. RBTYPE vExport; /* Virtual pointer to export descriptor */
  788. APROPNAMEPTR public; /* Matching public symbol */
  789. #endif
  790. #if DEBUG
  791. fprintf(stdout,"\r\nEXPORT: ");
  792. OutSb(stdout,sbEntry);
  793. NEWLINE(stdout);
  794. if(sbInternal != NULL)
  795. {
  796. fprintf(stdout,"INTERNAL NAME: ");
  797. OutSb(stdout,sbInternal);
  798. NEWLINE(stdout);
  799. }
  800. fprintf(stdout, " ordno %u, flags %u ", (unsigned)ordno, (unsigned)flags);
  801. fflush(stdout);
  802. #endif
  803. sb = (sbInternal != NULL)? sbInternal: sbEntry;
  804. /* Get pointer to internal name */
  805. PubName = (APROPNAMEPTR ) PROPSYMLOOKUP(sb, ATTRPNM, FALSE);
  806. #if NOT EXE386
  807. if(PubName != PROPNIL && !fDrivePass)
  808. /* If internal name already exists as a public symbol
  809. * and we are parsing definition file, issue
  810. * export internal name conflict warning.
  811. */
  812. OutWarn(ER_expcon,sbEntry+1,sb+1);
  813. else /* Else if no conflict */
  814. {
  815. #endif
  816. if (PubName == PROPNIL) /* If no matching name exists */
  817. undef = (APROPUNDEFPTR ) PROPSYMLOOKUP(sb,ATTRUND, TRUE);
  818. /* Make undefined symbol entry */
  819. #if TCE
  820. #if TCE_DEBUG
  821. fprintf(stdout, "\r\nNewExport adds UNDEF %s ", 1+GetPropName(undef));
  822. #endif
  823. undef->au_fAlive = TRUE; /* all exports are potential entry points */
  824. #endif
  825. rbSymdef = vrprop; /* Save virtual address */
  826. if (PubName == PROPNIL) /* If this is a new symbol */
  827. undef->au_len = -1L; /* Make no type assumptions */
  828. export = (APROPEXPPTR ) PROPSYMLOOKUP(sbEntry,ATTREXP, TRUE);
  829. /* Create export record */
  830. #if EXE386
  831. vExport = vrprop;
  832. #endif
  833. if(vfCreated) /* If this is a new entry */
  834. {
  835. export->ax_symdef = rbSymdef;
  836. /* Save virt addr of symbol def */
  837. export->ax_ord = ordno;
  838. /* Save ordinal number */
  839. if (nameFlags & RES_NAME)
  840. export->ax_nameflags |= RES_NAME;
  841. /* Remember if resident */
  842. else if (nameFlags & NO_NAME)
  843. export->ax_nameflags |= NO_NAME;
  844. /* Remember to discard name */
  845. export->ax_flags = (BYTE) flags;
  846. /* Save flags */
  847. ++expMac; /* One more exported symbol */
  848. }
  849. else
  850. {
  851. if (!fDrivePass) /* Else if parsing definition file */
  852. /* multiple definitions */
  853. OutWarn(ER_expmul,sbEntry + 1);
  854. /* Output error message */
  855. else
  856. { /* We were called for EXPDEF object */
  857. /* record, so we merge information */
  858. ParWrds = (BYTE) (export->ax_flags & 0xf8);
  859. if (ParWrds && (ParWrds != (BYTE) (flags & 0xf8)))
  860. Fatal(ER_badiopl);
  861. /* If the iopl_parmwords field in the */
  862. /* .DEF file is not 0 and does not match */
  863. /* value in the EXPDEF exactly issue error */
  864. else if (!ParWrds)
  865. { /* Else set value from EXPDEF record */
  866. ParWrds = (BYTE) (flags & 0xf8);
  867. export->ax_flags |= ParWrds;
  868. }
  869. }
  870. }
  871. #if EXE386
  872. if (PubName != NULL)
  873. {
  874. if (expOtherFlags & 0x1)
  875. {
  876. export->ax_nameflags |= CONSTANT;
  877. expOtherFlags = 0;
  878. }
  879. }
  880. #endif
  881. #if NOT EXE386
  882. }
  883. #endif
  884. if(!(flags & 0x8000))
  885. {
  886. free(sbEntry); /* Free space */
  887. if(sbInternal != NULL) free(sbInternal);
  888. }
  889. /* Free space */
  890. nameFlags = 0;
  891. }
  892. LOCAL APROPIMPPTR NEAR GetImport(sb) /* Get name in Imported Names Table */
  893. BYTE *sb; /* Length-prefixed names */
  894. {
  895. APROPIMPPTR import; /* Pointer to imported name */
  896. #if EXE386
  897. DWORD cbTemp; /* Temporary value */
  898. #else
  899. WORD cbTemp; /* Temporary value */
  900. #endif
  901. RBTYPE rprop; /* Property cell virtual address */
  902. import = (APROPIMPPTR ) PROPSYMLOOKUP(sb,ATTRIMP, TRUE);
  903. /* Look up module name */
  904. if(vfCreated) /* If no offset assigned yet */
  905. {
  906. rprop = vrprop; /* Save the virtual address */
  907. /*
  908. * WARNING: We must store name in virtual memory now, otherwise
  909. * if an EXTDEF was seen first, fIgnoreCase is false, and the
  910. * cases do not match between the imported name and the EXTDEF,
  911. * then the name will not go in the table exactly as given.
  912. */
  913. import = (APROPIMPPTR) FETCHSYM(rprop,TRUE);
  914. /* Retrieve from symbol table */
  915. import->am_offset = AddImportedName(sb);
  916. /* Save offset */
  917. }
  918. return(import); /* Return offset in table */
  919. }
  920. #if NOT EXE386
  921. void NewImport(sbEntry,ordEntry,sbModule,sbInternal)
  922. BYTE *sbEntry; /* Entry point name */
  923. WORD ordEntry; /* Entry point ordinal */
  924. BYTE *sbModule; /* Module name */
  925. BYTE *sbInternal; /* Internal name */
  926. {
  927. APROPNAMEPTR public; /* Public symbol */
  928. APROPIMPPTR import; /* Imported symbol */
  929. BYTE *sb; /* Symbol pointer */
  930. WORD module; /* Module name offset */
  931. FTYPE flags; /* Import flags */
  932. WORD modoff; /* module name offset */
  933. WORD entry; /* Entry name offset */
  934. BYTE *cp; /* Char pointer */
  935. RBTYPE rpropundef; /* Address of undefined symbol */
  936. char buf[32]; /* Buffer for error sgring */
  937. #if DEBUG
  938. fprintf(stderr,"\r\nIMPORT: ");
  939. OutSb(stderr,sbModule);
  940. fputc('.',stderr);
  941. if(!ordEntry)
  942. {
  943. OutSb(stderr,sbEntry);
  944. }
  945. else fprintf(stderr,"%u",ordEntry);
  946. if(sbInternal != sbEntry)
  947. {
  948. fprintf(stderr," ALIAS: ");
  949. OutSb(stderr,sbInternal);
  950. }
  951. fprintf(stdout," ordEntry %u ", (unsigned)ordEntry);
  952. fflush(stdout);
  953. #endif
  954. if((public = (APROPNAMEPTR ) PROPSYMLOOKUP(sbInternal, ATTRUND, FALSE)) !=
  955. PROPNIL && !fDrivePass) /* If internal names conflict */
  956. {
  957. if(sbEntry != NULL)
  958. sb = sbEntry;
  959. else
  960. {
  961. sprintf(buf + 1,"%u",ordEntry);
  962. sb = buf;
  963. }
  964. OutWarn(ER_impcon,sbModule + 1,sb + 1,sbInternal + 1);
  965. }
  966. else /* Else if no conflicts */
  967. {
  968. rpropundef = vrprop; /* Save virtual address of extern */
  969. flags = FIMPORT; /* We have an imported symbol */
  970. if (TargetOs == NE_WINDOWS)
  971. SbUcase(sbModule); /* Force module name to upper case */
  972. import = GetImport(sbModule); /* Get pointer to import record */
  973. if((module = import->am_mod) == 0)
  974. {
  975. // If not in Module Reference Table
  976. import->am_mod = WordArrayPut(&ModuleRefTable, import->am_offset) + 1;
  977. /* Save offset of name in table */
  978. module = import->am_mod;
  979. }
  980. if(vrhte == rhteModule) /* If importing from this module */
  981. {
  982. if(sbEntry != NULL)
  983. sb = sbEntry;
  984. else
  985. {
  986. sprintf(buf+1,"%u",ordEntry);
  987. sb = buf;
  988. }
  989. if (TargetOs == NE_OS2)
  990. OutWarn(ER_impself,sbModule + 1,sb + 1,sbInternal + 1);
  991. else
  992. OutError(ER_impself,sbModule + 1,sb + 1,sbInternal + 1);
  993. }
  994. if(sbEntry == NULL) /* If entry by ordinal */
  995. {
  996. flags |= FIMPORD; /* Set flag bit */
  997. entry = ordEntry; /* Get ordinal number */
  998. }
  999. else /* Else if import by name */
  1000. {
  1001. if(fIgnoreCase) SbUcase(sbEntry);
  1002. /* Upper case the name if flag set */
  1003. import = GetImport(sbEntry);
  1004. entry = import->am_offset;
  1005. /* Get offset of name in table */
  1006. }
  1007. if(public == PROPNIL) /* If no undefined symbol */
  1008. {
  1009. public = (APROPNAMEPTR )
  1010. PROPSYMLOOKUP(sbInternal,ATTRPNM, TRUE);
  1011. /* Make a public symbol */
  1012. if(!vfCreated) /* If not new */
  1013. /* Output error message */
  1014. OutWarn(ER_impmul,sbInternal + 1);
  1015. else ++pubMac; /* Else increment public count */
  1016. }
  1017. else /* Else if symbol is undefined */
  1018. {
  1019. public = (APROPNAMEPTR ) FETCHSYM(rpropundef,TRUE);
  1020. /* Look up external symbol */
  1021. ++pubMac; /* Increment public symbol count */
  1022. }
  1023. flags |= FPRINT; /* Symbol is printable */
  1024. public->an_attr = ATTRPNM; /* This is a public symbol */
  1025. public->an_gsn = SNNIL; /* Not a segment member */
  1026. public->an_ra = 0; /* No known offset */
  1027. public->an_ggr = GRNIL; /* Not a group member */
  1028. public->an_flags = flags; /* Set flags */
  1029. public->an_entry = entry; /* Save entry specification */
  1030. public->an_module = module; /* Save Module Reference Table index */
  1031. #if SYMDEB AND FALSE
  1032. if (fSymdeb) /* If debugger support on */
  1033. {
  1034. if (flags & FIMPORD)
  1035. import = GetImport(sbInternal);
  1036. else /* Add internal name to Imported Name Table */
  1037. import = GetImport(sbEntry);
  1038. import->am_public = public;
  1039. /* Remember public symbol */
  1040. if (cbImpSeg < LXIVK-1)
  1041. cbImpSeg += sizeof(CVIMP);
  1042. }
  1043. #endif
  1044. }
  1045. }
  1046. #endif
  1047. #if OVERLAYS
  1048. extern void NEAR GetName(AHTEPTR ahte, BYTE *pBuf);
  1049. #endif
  1050. /*** NewSeg - new segment definition
  1051. *
  1052. * Purpose:
  1053. * Create new segment definition based on the module definition
  1054. * file segment description. Check for duplicate definitions and
  1055. * overlay index inconsistency between attached COMDATs (if any)
  1056. * and segment itself.
  1057. *
  1058. * Input:
  1059. * sbName - segment name
  1060. * sbClass - segment class
  1061. * iOvl - segment overlay index
  1062. * flags - segment attributes
  1063. *
  1064. * Output:
  1065. * No explicit value is returned. The segment descriptor in
  1066. * symbol table is created or updated.
  1067. *
  1068. * Exceptions:
  1069. * Multiple segment definitions - warning and continue
  1070. * Change in overlay index - warning and continue
  1071. *
  1072. * Notes:
  1073. * None.
  1074. *
  1075. *************************************************************************/
  1076. void NEAR NewSeg(BYTE *sbName, BYTE *sbClass, WORD iOvl,
  1077. #if EXE386
  1078. DWORD flags)
  1079. #else
  1080. WORD flags)
  1081. #endif
  1082. {
  1083. APROPSNPTR apropSn; // Pointer to segment descriptor
  1084. #if OVERLAYS
  1085. RBTYPE vrComdat; // Virtual pointer to COMDAT descriptor
  1086. APROPCOMDATPTR apropComdat; // Symbol table entry for COMDAT symbol
  1087. SBTYPE sbComdat; // Name buffer
  1088. #endif
  1089. // Set segment attributes based on the class
  1090. if (SbSuffix(sbClass,"\004CODE",TRUE))
  1091. flags |= dfCode & ~offmask;
  1092. else
  1093. flags |= dfData & ~offmask;
  1094. #if O68K
  1095. if (f68k)
  1096. flags |= NS32BIT;
  1097. #endif
  1098. #if OVERLAYS
  1099. if (iOvl != NOTIOVL)
  1100. {
  1101. fOverlays = (FTYPE) TRUE;
  1102. fNewExe = FALSE;
  1103. if (iOvl >= iovMac) // Set the maximum overlay index
  1104. iovMac = iOvl + 1;
  1105. }
  1106. #endif
  1107. // Generate new segment definition
  1108. apropSn = GenSeg(sbName, sbClass, GRNIL, (FTYPE) TRUE);
  1109. if (vfCreated)
  1110. {
  1111. apropSn->as_flags = (WORD) flags;
  1112. // Save flags
  1113. mpgsndra[apropSn->as_gsn] = 0; // Initialize
  1114. #if OVERLAYS
  1115. apropSn->as_iov = iOvl; // Save overlay index
  1116. if (fOverlays)
  1117. CheckOvl(apropSn, iOvl);
  1118. #endif
  1119. apropSn->as_fExtra |= (BYTE) FROM_DEF_FILE;
  1120. // Remember defined in def file
  1121. if (fMixed)
  1122. {
  1123. apropSn->as_fExtra |= (BYTE) MIXED1632;
  1124. fMixed = (FTYPE) FALSE;
  1125. }
  1126. }
  1127. else
  1128. {
  1129. apropSn = CheckClass(apropSn, apropSn->as_rCla);
  1130. // Check if previous definition had the same class
  1131. OutWarn(ER_segdup,sbName + 1); // Warn about multiple definition
  1132. #if OVERLAYS
  1133. if (fOverlays && apropSn->as_iov != iOvl)
  1134. {
  1135. if (apropSn->as_iov != NOTIOVL)
  1136. OutWarn(ER_badsegovl, 1 + GetPropName(apropSn), apropSn->as_iov, iOvl);
  1137. apropSn->as_iov = iOvl; // Save new overlay index
  1138. CheckOvl(apropSn, iOvl);
  1139. // Check if segment has any COMDATs and if it has
  1140. // then check theirs overlay numbers
  1141. for (vrComdat = apropSn->as_ComDat;
  1142. vrComdat != VNIL;
  1143. vrComdat = apropComdat->ac_sameSeg)
  1144. {
  1145. apropComdat = (APROPCOMDATPTR ) FetchSym(vrComdat, FALSE);
  1146. if (apropComdat->ac_iOvl != NOTIOVL && apropComdat->ac_iOvl != iOvl)
  1147. {
  1148. GetName((AHTEPTR) apropComdat, sbComdat);
  1149. OutWarn(ER_badcomdatovl, &sbComdat[1], apropComdat->ac_iOvl, iOvl);
  1150. }
  1151. apropComdat->ac_iOvl = iOvl;
  1152. }
  1153. }
  1154. #endif
  1155. }
  1156. free(sbClass); // Free class name
  1157. free(sbName); // Free segment name
  1158. offmask = 0;
  1159. // Unless packing limit already set, disable default code packing
  1160. if (!fPackSet)
  1161. {
  1162. fPackSet = (FTYPE) TRUE; // Remember packLim was set
  1163. packLim = 0L;
  1164. }
  1165. }
  1166. /*
  1167. * Assign module name to be default, which is run file name.
  1168. *
  1169. * SIDE EFFECTS
  1170. * Assigns rhteModule
  1171. */
  1172. #if EXE386
  1173. LOCAL void NEAR DefaultModule (unsigned char *defaultExt)
  1174. #else
  1175. LOCAL void NEAR DefaultModule (void)
  1176. #endif
  1177. {
  1178. SBTYPE sbModname; /* Module name */
  1179. AHTEPTR ahte; /* Pointer to hash table entry */
  1180. #if OSXENIX
  1181. int i;
  1182. #endif
  1183. ahte = (AHTEPTR ) FETCHSYM(rhteRunfile,FALSE);
  1184. /* Get executable file name */
  1185. #if OSMSDOS
  1186. memcpy(sbModname,GetFarSb(ahte->cch),B2W(ahte->cch[0]) + 1);
  1187. /* Copy file name */
  1188. #if EXE386
  1189. NewModule(sbModname, defaultExt); /* Use run file name as module name */
  1190. #else
  1191. UpdateFileParts(sbModname,"\005A:\\.X");
  1192. /* Force path, ext with known length */
  1193. sbModname[0] -= 2; /* Remove extension from name */
  1194. sbModname[3] = (BYTE) (sbModname[0] - 3);
  1195. /* Remove path and drive from name */
  1196. NewModule(&sbModname[3]); /* Use run file name as module name */
  1197. #endif
  1198. #endif
  1199. #if OSXENIX
  1200. for(i = B2W(ahte->cch[0]); i > 0 && ahte->cch[i] != '/'; i--)
  1201. sbModname[0] = B2W(ahte->cch[0]) - i;
  1202. memcpy(sbModname+1,&GetFarSb(ahte->cch)[i+1],B2W(sbModname[0]));
  1203. for(i = B2W(ahte->cch[0]); i > 1 && sbModname[i] != '.'; i--);
  1204. if(i > 1)
  1205. sbModname[0] = i - 1;
  1206. NewModule(sbModname); /* Use run file name as module name */
  1207. #endif
  1208. }
  1209. void ParseDeffile(void)
  1210. {
  1211. SBTYPE sbDeffile; /* Definitions file name */
  1212. AHTEPTR ahte; /* Pointer to hash table entry */
  1213. #if OSMSDOS
  1214. char buf[512]; /* File buffer */
  1215. #endif
  1216. if(rhteDeffile == RHTENIL) /* If no definitions file */
  1217. #if EXE386
  1218. DefaultModule(moduleEXE);
  1219. #else
  1220. DefaultModule();
  1221. #endif
  1222. else /* Else if there is a file to parse */
  1223. {
  1224. #if ODOS3EXE
  1225. fNewExe = (FTYPE) TRUE; /* Def file forces new-format exe */
  1226. #endif
  1227. ahte = (AHTEPTR ) FETCHSYM(rhteDeffile,FALSE);
  1228. /* Fetch file name */
  1229. memcpy(sbDeffile,GetFarSb(ahte->cch),B2W(ahte->cch[0]) + 1);
  1230. /* Copy file name */
  1231. sbDeffile[B2W(sbDeffile[0]) + 1] = '\0';
  1232. /* Null-terminate the name */
  1233. if((bsInput = fopen(&sbDeffile[1],RDTXT)) == NULL)
  1234. { /* If open fails */
  1235. Fatal(ER_opndf, &sbDeffile[1]);/* Fatal error */
  1236. }
  1237. #if OSMSDOS
  1238. setvbuf(bsInput,buf,_IOFBF,sizeof(buf));
  1239. #endif
  1240. includeDisp[0] = bsInput; // Initialize include stack
  1241. sbOldver = NULL; /* Assume no old version */
  1242. yylineno = 1;
  1243. fFileNameExpected = (FTYPE) FALSE;
  1244. // HACK ALERT !!!
  1245. // Don't allocate to much page buffers
  1246. yyparse(); /* Parse the definitions file */
  1247. yylineno = -1;
  1248. fclose(bsInput); /* Close the definitions file */
  1249. #if NOT EXE386
  1250. if(sbOldver != NULL) /* If old version given */
  1251. {
  1252. SetExpOrds(); /* Use old version to set ordinals */
  1253. free(sbOldver); /* Release the space */
  1254. }
  1255. #endif
  1256. }
  1257. #if OSMSDOS
  1258. #endif /* OSMSDOS */
  1259. #if NOT EXE386
  1260. if (NonResidentName.byteMac == 0)
  1261. {
  1262. ahte = (AHTEPTR ) FETCHSYM(rhteRunfile,FALSE);
  1263. /* Get executable file name */
  1264. memcpy(sbDeffile,GetFarSb(ahte->cch),B2W(ahte->cch[0]) + 1);
  1265. /* Copy file name */
  1266. #if OSXENIX
  1267. SbUcase(sbDeffile); /* For identical executables */
  1268. #endif
  1269. if ((vFlags & NENOTP) && TargetOs == NE_OS2)
  1270. UpdateFileParts(sbDeffile, sbDotDll);
  1271. else
  1272. UpdateFileParts(sbDeffile, sbDotExe);
  1273. NewDescription(sbDeffile); /* Use run file name as description */
  1274. }
  1275. #endif
  1276. }
  1277. short yyexca[] ={
  1278. -1, 1,
  1279. 0, -1,
  1280. -2, 0,
  1281. };
  1282. # define YYNPROD 183
  1283. # define YYLAST 408
  1284. short yyact[]={
  1285. 10, 13, 14, 176, 27, 49, 53, 54, 129, 226,
  1286. 174, 50, 43, 44, 45, 46, 53, 54, 203, 161,
  1287. 190, 41, 209, 28, 181, 60, 177, 29, 30, 31,
  1288. 12, 32, 34, 35, 220, 221, 179, 59, 58, 192,
  1289. 41, 41, 189, 41, 41, 33, 148, 11, 206, 152,
  1290. 153, 154, 155, 156, 159, 183, 223, 61, 157, 158,
  1291. 217, 121, 119, 122, 15, 81, 120, 123, 124, 138,
  1292. 4, 5, 219, 139, 6, 7, 16, 36, 17, 42,
  1293. 37, 89, 90, 87, 74, 75, 79, 69, 82, 70,
  1294. 76, 71, 77, 80, 84, 85, 86, 83, 42, 42,
  1295. 215, 42, 42, 213, 212, 207, 196, 164, 56, 55,
  1296. 49, 53, 54, 167, 145, 222, 50, 43, 44, 45,
  1297. 46, 68, 96, 91, 92, 104, 105, 81, 199, 185,
  1298. 162, 67, 147, 166, 107, 48, 78, 72, 73, 115,
  1299. 88, 103, 102, 100, 101, 128, 74, 75, 79, 69,
  1300. 82, 70, 76, 71, 77, 80, 84, 85, 86, 83,
  1301. 95, 97, 98, 99, 94, 112, 66, 137, 8, 187,
  1302. 106, 52, 38, 184, 160, 125, 118, 126, 151, 117,
  1303. 114, 218, 225, 130, 216, 111, 40, 104, 105, 81,
  1304. 26, 134, 136, 25, 131, 24, 23, 22, 78, 72,
  1305. 73, 109, 110, 103, 102, 89, 90, 87, 74, 75,
  1306. 79, 69, 82, 70, 76, 71, 77, 80, 84, 85,
  1307. 86, 83, 108, 132, 9, 95, 127, 39, 47, 21,
  1308. 20, 140, 141, 57, 19, 18, 63, 62, 51, 3,
  1309. 64, 143, 2, 1, 143, 143, 175, 91, 92, 150,
  1310. 211, 163, 198, 197, 149, 113, 116, 205, 142, 178,
  1311. 78, 72, 73, 57, 88, 169, 204, 93, 171, 170,
  1312. 173, 172, 65, 165, 144, 0, 168, 146, 133, 135,
  1313. 0, 0, 182, 0, 0, 0, 0, 0, 0, 0,
  1314. 0, 0, 0, 0, 0, 0, 0, 201, 202, 191,
  1315. 0, 0, 193, 0, 194, 0, 195, 200, 0, 0,
  1316. 0, 0, 0, 0, 210, 0, 0, 0, 0, 0,
  1317. 201, 202, 0, 0, 0, 224, 0, 214, 0, 0,
  1318. 200, 0, 0, 0, 113, 0, 0, 116, 0, 0,
  1319. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1320. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1321. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1322. 0, 180, 0, 0, 0, 0, 0, 0, 0, 0,
  1323. 0, 0, 0, 186, 188, 0, 0, 0, 0, 0,
  1324. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1325. 0, 0, 0, 0, 208, 0, 0, 186 };
  1326. short yypact[]={
  1327. -189,-1000,-267,-267,-221,-225,-153,-154,-267,-1000,
  1328. -285,-286,-266,-1000,-1000,-1000,-1000,-222,-1000,-1000,
  1329. -1000,-1000,-1000,-1000,-1000,-1000,-1000, -68,-130,-222,
  1330. -222,-222,-222,-222,-1000,-241,-1000,-1000,-267,-326,
  1331. -334,-1000,-1000,-1000,-1000,-1000,-1000,-330,-334,-1000,
  1332. -1000,-320,-1000,-1000,-1000,-225,-225,-1000,-1000,-1000,
  1333. -1000,-1000,-197,-197,-1000, -68,-1000,-1000,-1000,-1000,
  1334. -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
  1335. -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
  1336. -1000,-1000,-1000,-130,-1000,-1000,-1000,-1000,-1000,-1000,
  1337. -1000,-1000,-1000,-1000,-1000,-1000,-222,-1000,-144,-222,
  1338. -222,-222,-1000,-273,-222,-1000,-273,-252,-1000,-1000,
  1339. -1000,-1000,-1000,-1000,-1000,-306,-159,-334,-148,-1000,
  1340. -334,-148,-1000,-330,-148,-330,-148,-1000,-316,-1000,
  1341. -1000,-1000,-1000,-1000,-343,-297,-1000,-284,-222,-1000,
  1342. -300,-159,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-223,
  1343. -222,-224,-1000,-304,-1000,-148,-1000,-280,-148,-1000,
  1344. -148,-1000,-148,-1000,-160,-192,-307,-1000,-265,-161,
  1345. -1000,-244,-1000,-1000,-222,-1000,-1000,-1000,-1000,-1000,
  1346. -162,-1000,-163,-1000,-1000,-1000,-1000,-1000,-192,-1000,
  1347. -1000,-1000,-1000,-166,-212,-194,-1000,-287,-216,-216,
  1348. -1000,-1000,-1000,-1000,-1000,-1000,-332,-1000,-1000,-1000,
  1349. -1000,-1000,-1000,-1000,-1000,-1000,-1000 };
  1350. short yypgo[]={
  1351. 0, 222, 132, 274, 272, 166, 267, 164, 266, 259,
  1352. 257, 253, 128, 252, 131, 122, 121, 251, 250, 246,
  1353. 115, 243, 242, 168, 239, 186, 145, 133, 135, 238,
  1354. 171, 224, 237, 167, 236, 235, 234, 230, 229, 197,
  1355. 196, 195, 193, 190, 170, 134, 185, 165, 184, 182,
  1356. 181, 180, 139, 179, 178, 130, 177, 176, 175, 174,
  1357. 173, 169, 129 };
  1358. short yyr1[]={
  1359. 0, 21, 21, 24, 21, 22, 22, 22, 22, 22,
  1360. 22, 22, 22, 28, 28, 28, 28, 29, 29, 30,
  1361. 30, 27, 27, 25, 25, 25, 25, 25, 26, 26,
  1362. 23, 23, 31, 31, 31, 31, 32, 31, 34, 31,
  1363. 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
  1364. 31, 31, 33, 33, 33, 35, 4, 4, 5, 5,
  1365. 16, 16, 16, 16, 16, 16, 36, 6, 6, 7,
  1366. 7, 7, 7, 7, 7, 7, 15, 15, 15, 15,
  1367. 37, 37, 37, 37, 37, 37, 44, 44, 45, 3,
  1368. 3, 19, 19, 12, 12, 12, 13, 13, 11, 11,
  1369. 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
  1370. 14, 14, 14, 14, 14, 14, 14, 14, 38, 38,
  1371. 46, 46, 47, 2, 2, 9, 9, 9, 9, 8,
  1372. 10, 10, 50, 50, 48, 48, 49, 49, 39, 39,
  1373. 51, 51, 52, 52, 1, 1, 20, 20, 53, 40,
  1374. 54, 54, 54, 54, 54, 54, 54, 54, 54, 55,
  1375. 55, 17, 17, 18, 18, 56, 43, 41, 57, 57,
  1376. 57, 57, 57, 57, 58, 42, 59, 59, 61, 61,
  1377. 60, 60, 62 };
  1378. short yyr2[]={
  1379. 0, 2, 1, 0, 2, 5, 4, 5, 4, 5,
  1380. 4, 5, 4, 1, 1, 1, 0, 2, 1, 1,
  1381. 1, 3, 0, 1, 1, 1, 1, 0, 1, 0,
  1382. 2, 1, 2, 2, 2, 2, 0, 3, 0, 3,
  1383. 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
  1384. 1, 1, 3, 1, 1, 2, 2, 1, 1, 1,
  1385. 1, 1, 1, 1, 1, 1, 2, 2, 1, 1,
  1386. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1387. 2, 1, 2, 1, 2, 1, 2, 1, 4, 2,
  1388. 0, 3, 0, 1, 1, 1, 2, 1, 1, 0,
  1389. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1390. 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
  1391. 2, 1, 6, 2, 0, 3, 3, 2, 0, 2,
  1392. 1, 0, 1, 0, 1, 0, 1, 0, 2, 1,
  1393. 2, 1, 5, 5, 1, 1, 1, 0, 0, 4,
  1394. 1, 1, 1, 1, 1, 1, 1, 2, 1, 3,
  1395. 1, 1, 0, 1, 0, 0, 3, 2, 1, 1,
  1396. 1, 1, 1, 1, 0, 4, 2, 0, 1, 1,
  1397. 2, 1, 1 };
  1398. short yychk[]={
  1399. -1000, -21, -22, -24, 259, 260, 263, 264, -23, -31,
  1400. 267, 314, 297, 268, 269, 331, 343, 345, -35, -36,
  1401. -37, -38, -39, -40, -41, -42, -43, 271, 290, 294,
  1402. 295, 296, 298, 312, 299, 300, 344, 347, -23, -1,
  1403. -25, 265, 323, 338, 339, 340, 341, -1, -28, 335,
  1404. 341, -29, -30, 336, 337, 262, 262, -31, 323, 323,
  1405. 291, 323, -32, -34, -1, -4, -5, -14, -16, 279,
  1406. 281, 283, 329, 330, 276, 277, 282, 284, 328, 278,
  1407. 285, 257, 280, 289, 286, 287, 288, 275, 332, 273,
  1408. 274, 315, 316, -6, -7, -14, -15, 291, 292, 293,
  1409. 273, 274, 334, 333, 317, 318, -44, -45, -1, -44,
  1410. -44, -46, -47, -1, -51, -52, -1, -53, -57, 303,
  1411. 307, 302, 304, 308, 309, -58, -56, -25, -26, 342,
  1412. -28, -26, -30, -1, -28, -1, -28, -33, 266, 270,
  1413. -33, -5, -7, -45, -3, 258, -47, -2, 319, -52,
  1414. -2, -54, 301, 302, 303, 304, 305, 310, 311, 306,
  1415. -59, 325, -55, -17, 266, -26, -27, 261, -26, -27,
  1416. -28, -27, -28, -27, 326, -19, 346, 323, -9, 320,
  1417. -1, 324, -55, 278, -60, -62, -1, -61, -1, 266,
  1418. 324, -27, 319, -27, -27, -27, 266, -11, -13, -12,
  1419. -14, -16, -15, 325, -8, -10, 313, 266, -1, 266,
  1420. -62, -18, 266, 266, -12, 266, -48, 272, -50, 266,
  1421. 321, 322, -20, 272, -20, -49, 341 };
  1422. short yydef[]={
  1423. 3, -2, 2, 0, 27, 16, 0, 0, 1, 31,
  1424. 0, 0, 0, 36, 38, 40, 41, 0, 43, 44,
  1425. 45, 46, 47, 48, 49, 50, 51, 0, 0, 81,
  1426. 83, 85, 119, 139, 148, 0, 174, 165, 4, 27,
  1427. 29, 144, 145, 23, 24, 25, 26, 16, 29, 13,
  1428. 14, 15, 18, 19, 20, 16, 16, 30, 32, 33,
  1429. 34, 35, 0, 0, 42, 55, 57, 58, 59, 100,
  1430. 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
  1431. 111, 112, 113, 114, 115, 116, 117, 60, 61, 62,
  1432. 63, 64, 65, 66, 68, 69, 70, 71, 72, 73,
  1433. 74, 75, 76, 77, 78, 79, 80, 87, 90, 82,
  1434. 84, 118, 121, 124, 138, 141, 124, 0, 167, 168,
  1435. 169, 170, 171, 172, 173, 177, 162, 29, 22, 28,
  1436. 29, 22, 17, 16, 22, 16, 22, 37, 53, 54,
  1437. 39, 56, 67, 86, 92, 0, 120, 128, 0, 140,
  1438. 0, 162, 150, 151, 152, 153, 154, 155, 156, 158,
  1439. 0, 0, 166, 160, 161, 22, 6, 0, 22, 8,
  1440. 22, 10, 22, 12, 0, 99, 0, 89, 131, 0,
  1441. 123, 0, 149, 157, 175, 181, 182, 176, 178, 179,
  1442. 164, 5, 0, 7, 9, 11, 52, 88, 98, 97,
  1443. 93, 94, 95, 0, 135, 133, 130, 127, 147, 147,
  1444. 180, 159, 163, 21, 96, 91, 137, 134, 129, 132,
  1445. 125, 126, 142, 146, 143, 122, 136 };
  1446. # define YYFLAG -1000
  1447. # define YYERROR goto yyerrlab
  1448. # define YYACCEPT return(0)
  1449. # define YYABORT return(1)
  1450. #ifdef YYDEBUG /* RRR - 10/9/85 */
  1451. #define yyprintf(a, b, c) printf(a, b, c)
  1452. #else
  1453. #define yyprintf(a, b, c)
  1454. #endif
  1455. /* parser for yacc output */
  1456. YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
  1457. int yychar = -1; /* current input token number */
  1458. int yynerrs = 0; /* number of errors */
  1459. short yyerrflag = 0; /* error recovery flag */
  1460. int NEAR yyparse(void)
  1461. {
  1462. short yys[YYMAXDEPTH];
  1463. short yyj, yym;
  1464. register YYSTYPE *yypvt;
  1465. register short yystate, *yyps, yyn;
  1466. register YYSTYPE *yypv;
  1467. register short *yyxi;
  1468. yystate = 0;
  1469. yychar = -1;
  1470. yynerrs = 0;
  1471. yyerrflag = 0;
  1472. yyps= &yys[-1];
  1473. yypv= &yyv[-1];
  1474. yystack: /* put a state and value onto the stack */
  1475. yyprintf( "state %d, char 0%o\n", yystate, yychar );
  1476. if( ++yyps> &yys[YYMAXDEPTH] )
  1477. {
  1478. yyerror( "yacc stack overflow" );
  1479. return(1);
  1480. }
  1481. *yyps = yystate;
  1482. ++yypv;
  1483. *yypv = yyval;
  1484. yynewstate:
  1485. yyn = yypact[yystate];
  1486. if( yyn<= YYFLAG ) goto yydefault; /* simple state */
  1487. if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
  1488. if( (yyn += (short)yychar)<0 || yyn >= YYLAST ) goto yydefault;
  1489. if( yychk[ yyn=yyact[ yyn ] ] == yychar )
  1490. {
  1491. /* valid shift */
  1492. yychar = -1;
  1493. yyval = yylval;
  1494. yystate = yyn;
  1495. if( yyerrflag > 0 ) --yyerrflag;
  1496. goto yystack;
  1497. }
  1498. yydefault:
  1499. /* default state action */
  1500. if( (yyn=yydef[yystate]) == -2 )
  1501. {
  1502. if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
  1503. /* look through exception table */
  1504. for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
  1505. for(yyxi+=2; *yyxi >= 0; yyxi+=2)
  1506. {
  1507. if( *yyxi == yychar ) break;
  1508. }
  1509. if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */
  1510. }
  1511. if( yyn == 0 )
  1512. {
  1513. /* error */
  1514. /* error ... attempt to resume parsing */
  1515. switch( yyerrflag )
  1516. {
  1517. case 0: /* brand new error */
  1518. yyerror( "syntax error" );
  1519. ++yynerrs;
  1520. case 1:
  1521. case 2: /* incompletely recovered error ... try again */
  1522. yyerrflag = 3;
  1523. /* find a state where "error" is a legal shift action */
  1524. while ( yyps >= yys )
  1525. {
  1526. yyn = yypact[*yyps] + YYERRCODE;
  1527. if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE )
  1528. {
  1529. yystate = yyact[yyn]; /* simulate a shift of "error" */
  1530. goto yystack;
  1531. }
  1532. yyn = yypact[*yyps];
  1533. /* the current yyps has no shift onn "error", pop stack */
  1534. yyprintf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
  1535. --yyps;
  1536. --yypv;
  1537. }
  1538. /* there is no state on the stack with an error shift ... abort */
  1539. yyabort:
  1540. return(1);
  1541. case 3: /* no shift yet; clobber input char */
  1542. yyprintf( "error recovery discards char %d\n", yychar, 0 );
  1543. if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
  1544. yychar = -1;
  1545. goto yynewstate; /* try again in the same state */
  1546. }
  1547. }
  1548. /* reduction by production yyn */
  1549. yyprintf("reduce %d\n",yyn, 0);
  1550. yyps -= yyr2[yyn];
  1551. yypvt = yypv;
  1552. yypv -= yyr2[yyn];
  1553. yyval = yypv[1];
  1554. yym=yyn;
  1555. /* consult goto table to find next state */
  1556. yyn = yyr1[yyn];
  1557. yyj = yypgo[yyn] + *yyps + 1;
  1558. if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
  1559. switch(yym)
  1560. {
  1561. case 3:
  1562. # line 298
  1563. {
  1564. #if EXE386
  1565. DefaultModule(moduleEXE);
  1566. #else
  1567. DefaultModule();
  1568. #endif
  1569. } break;
  1570. case 5:
  1571. # line 309
  1572. {
  1573. #if EXE386
  1574. NewModule(yypvt[-3]._bp, moduleEXE);
  1575. #else
  1576. NewModule(yypvt[-3]._bp);
  1577. #endif
  1578. } break;
  1579. case 6:
  1580. # line 317
  1581. {
  1582. #if EXE386
  1583. DefaultModule(moduleEXE);
  1584. #else
  1585. DefaultModule();
  1586. #endif
  1587. } break;
  1588. case 7:
  1589. # line 325
  1590. {
  1591. #if EXE386
  1592. SetDLL(vFlags);
  1593. NewModule(yypvt[-3]._bp, moduleDLL);
  1594. #else
  1595. vFlags = NENOTP | (vFlags & ~NEINST) | NESOLO;
  1596. dfData |= NSSHARED;
  1597. NewModule(yypvt[-3]._bp);
  1598. #endif
  1599. } break;
  1600. case 8:
  1601. # line 336
  1602. {
  1603. #if EXE386
  1604. SetDLL(vFlags);
  1605. DefaultModule(moduleDLL);
  1606. #else
  1607. vFlags = NENOTP | (vFlags & ~NEINST) | NESOLO;
  1608. dfData |= NSSHARED;
  1609. DefaultModule();
  1610. #endif
  1611. } break;
  1612. case 9:
  1613. # line 347
  1614. {
  1615. #if EXE386
  1616. SetDLL(vFlags);
  1617. NewModule(yypvt[-2]._bp, moduleDLL);
  1618. #endif
  1619. } break;
  1620. case 10:
  1621. # line 354
  1622. {
  1623. #if EXE386
  1624. SetDLL(vFlags);
  1625. DefaultModule(moduleDLL);
  1626. #endif
  1627. } break;
  1628. case 11:
  1629. # line 361
  1630. {
  1631. #if EXE386
  1632. SetDLL(vFlags);
  1633. NewModule(yypvt[-2]._bp, moduleDLL);
  1634. #endif
  1635. } break;
  1636. case 12:
  1637. # line 368
  1638. {
  1639. #if EXE386
  1640. SetDLL(vFlags);
  1641. DefaultModule(moduleDLL);
  1642. #endif
  1643. } break;
  1644. case 13:
  1645. # line 377
  1646. {
  1647. #if EXE386
  1648. dllFlags &= ~E32_PROCINIT;
  1649. #else
  1650. vFlags &= ~NEPPLI;
  1651. #endif
  1652. } break;
  1653. case 14:
  1654. # line 385
  1655. {
  1656. vFlags |= NEPRIVLIB;
  1657. } break;
  1658. case 19:
  1659. # line 397
  1660. {
  1661. #if EXE386
  1662. SetINSTINIT(dllFlags);
  1663. #else
  1664. vFlags |= NEPPLI;
  1665. #endif
  1666. } break;
  1667. case 20:
  1668. # line 405
  1669. {
  1670. #if EXE386
  1671. SetINSTTERM(dllFlags);
  1672. #endif
  1673. } break;
  1674. case 21:
  1675. # line 413
  1676. {
  1677. #if EXE386
  1678. virtBase = yypvt[-0]._wd;
  1679. virtBase = RoundTo64k(virtBase);
  1680. #endif
  1681. } break;
  1682. case 22:
  1683. # line 420
  1684. {
  1685. } break;
  1686. case 23:
  1687. # line 425
  1688. {
  1689. #if EXE386
  1690. SetGUI(TargetSubsys);
  1691. #else
  1692. vFlags |= NEWINAPI;
  1693. #endif
  1694. } break;
  1695. case 24:
  1696. # line 433
  1697. {
  1698. #if EXE386
  1699. SetGUICOMPAT(TargetSubsys);
  1700. #else
  1701. vFlags |= NEWINCOMPAT;
  1702. #endif
  1703. } break;
  1704. case 25:
  1705. # line 441
  1706. {
  1707. #if EXE386
  1708. SetNOTGUI(TargetSubsys);
  1709. #else
  1710. vFlags |= NENOTWINCOMPAT;
  1711. #endif
  1712. } break;
  1713. case 26:
  1714. # line 450
  1715. {
  1716. vFlags |= NEPRIVLIB;
  1717. } break;
  1718. case 27:
  1719. # line 454
  1720. {
  1721. } break;
  1722. case 28:
  1723. # line 458
  1724. {
  1725. #if NOT EXE386
  1726. vFlagsOthers |= NENEWFILES;
  1727. #endif
  1728. } break;
  1729. case 29:
  1730. # line 464
  1731. {
  1732. } break;
  1733. case 32:
  1734. # line 472
  1735. {
  1736. NewDescription(yypvt[-0]._bp);
  1737. } break;
  1738. case 33:
  1739. # line 476
  1740. {
  1741. if(sbOldver == NULL) sbOldver = _strdup(bufg);
  1742. } break;
  1743. case 34:
  1744. # line 480
  1745. {
  1746. if(rhteStub == RHTENIL) fStub = (FTYPE) FALSE;
  1747. } break;
  1748. case 35:
  1749. # line 484
  1750. {
  1751. if(fStub && rhteStub == RHTENIL)
  1752. {
  1753. PROPSYMLOOKUP(yypvt[-0]._bp,ATTRNIL, TRUE);
  1754. rhteStub = vrhte;
  1755. }
  1756. } break;
  1757. case 36:
  1758. # line 492
  1759. {
  1760. fHeapSize = (FTYPE) TRUE;
  1761. } break;
  1762. case 38:
  1763. # line 497
  1764. {
  1765. fHeapSize = (FTYPE) FALSE;
  1766. } break;
  1767. case 40:
  1768. # line 502
  1769. {
  1770. #if NOT EXE386
  1771. vFlags |= NEPROT;
  1772. #endif
  1773. } break;
  1774. case 41:
  1775. # line 508
  1776. {
  1777. fRealMode = (FTYPE) TRUE;
  1778. vFlags &= ~NEPROT;
  1779. } break;
  1780. case 42:
  1781. # line 513
  1782. {
  1783. #if NOT EXE386
  1784. AppLoader(yypvt[-0]._bp);
  1785. #endif
  1786. } break;
  1787. case 52:
  1788. # line 530
  1789. {
  1790. if (fHeapSize)
  1791. {
  1792. cbHeap = yypvt[-2]._wd;
  1793. #if EXE386
  1794. cbHeapCommit = yypvt[-0]._wd;
  1795. #endif
  1796. }
  1797. else
  1798. {
  1799. if(cbStack)
  1800. OutWarn(ER_stackdb, yypvt[-2]._wd);
  1801. cbStack = yypvt[-2]._wd;
  1802. #if EXE386
  1803. cbStackCommit = yypvt[-0]._wd;
  1804. #endif
  1805. }
  1806. } break;
  1807. case 53:
  1808. # line 549
  1809. {
  1810. if (fHeapSize)
  1811. {
  1812. cbHeap = yypvt[-0]._wd;
  1813. #if EXE386
  1814. cbHeapCommit = cbHeap;
  1815. #endif
  1816. }
  1817. else
  1818. {
  1819. if(cbStack)
  1820. OutWarn(ER_stackdb, yypvt[-0]._wd);
  1821. cbStack = yypvt[-0]._wd;
  1822. #if EXE386
  1823. cbStackCommit = cbStack;
  1824. #endif
  1825. }
  1826. } break;
  1827. case 54:
  1828. # line 568
  1829. {
  1830. if (fHeapSize)
  1831. fHeapMax = (FTYPE) TRUE;
  1832. } break;
  1833. case 55:
  1834. # line 575
  1835. {
  1836. // Set dfCode to specified flags; for any unspecified attributes
  1837. // use the defaults. Then reset offmask.
  1838. dfCode = yypvt[-0]._wd | (dfCode & ~offmask);
  1839. offmask = 0;
  1840. vfShrattr = (FTYPE) FALSE; /* Reset for DATA */
  1841. } break;
  1842. case 56:
  1843. # line 585
  1844. {
  1845. yyval._wd |= yypvt[-0]._wd;
  1846. } break;
  1847. case 60:
  1848. # line 594
  1849. {
  1850. #if EXE386
  1851. yyval._wd = OBJ_EXEC;
  1852. #else
  1853. yyval._wd = NSEXRD;
  1854. #endif
  1855. } break;
  1856. case 62:
  1857. # line 603
  1858. {
  1859. #if EXE386
  1860. offmask |= OBJ_RESIDENT;
  1861. #else
  1862. yyval._wd = NSDISCARD | NSMOVE;
  1863. #endif
  1864. } break;
  1865. case 63:
  1866. # line 611
  1867. {
  1868. #if EXE386
  1869. #else
  1870. offmask |= NSDISCARD;
  1871. #endif
  1872. } break;
  1873. case 64:
  1874. # line 618
  1875. {
  1876. #if EXE386
  1877. #else
  1878. yyval._wd = NSCONFORM;
  1879. #endif
  1880. } break;
  1881. case 65:
  1882. # line 625
  1883. {
  1884. #if EXE386
  1885. #else
  1886. offmask |= NSCONFORM;
  1887. #endif
  1888. } break;
  1889. case 66:
  1890. # line 633
  1891. {
  1892. // Set dfData to specified flags; for any unspecified
  1893. // attribute use the defaults. Then reset offmask.
  1894. #if EXE386
  1895. dfData = (yypvt[-0]._wd | (dfData & ~offmask));
  1896. #else
  1897. dfData = yypvt[-0]._wd | (dfData & ~offmask);
  1898. #endif
  1899. offmask = 0;
  1900. #if NOT EXE386
  1901. if (vfShrattr && !vfAutodata)
  1902. {
  1903. // If share-attribute and no autodata attribute, share-
  1904. // attribute controls autodata.
  1905. if (yypvt[-0]._wd & NSSHARED)
  1906. vFlags = (vFlags & ~NEINST) | NESOLO;
  1907. else
  1908. vFlags = (vFlags & ~NESOLO) | NEINST;
  1909. }
  1910. else if(!vfShrattr)
  1911. {
  1912. // Else if no share-attribute, autodata attribute
  1913. // controls share-attribute.
  1914. if (vFlags & NESOLO)
  1915. dfData |= NSSHARED;
  1916. else if(vFlags & NEINST)
  1917. dfData &= ~NSSHARED;
  1918. }
  1919. #endif
  1920. } break;
  1921. case 67:
  1922. # line 669
  1923. {
  1924. yyval._wd |= yypvt[-0]._wd;
  1925. } break;
  1926. case 71:
  1927. # line 677
  1928. {
  1929. #if NOT EXE386
  1930. vFlags &= ~(NESOLO | NEINST);
  1931. #endif
  1932. } break;
  1933. case 72:
  1934. # line 683
  1935. {
  1936. #if NOT EXE386
  1937. vFlags = (vFlags & ~NEINST) | NESOLO;
  1938. #endif
  1939. vfAutodata = (FTYPE) TRUE;
  1940. } break;
  1941. case 73:
  1942. # line 690
  1943. {
  1944. #if NOT EXE386
  1945. vFlags = (vFlags & ~NESOLO) | NEINST;
  1946. #endif
  1947. vfAutodata = (FTYPE) TRUE;
  1948. } break;
  1949. case 74:
  1950. # line 697
  1951. {
  1952. #if NOT EXE386
  1953. // This ONLY for compatibility with JDA IBM LINK
  1954. yyval._wd = NSDISCARD | NSMOVE;
  1955. #endif
  1956. } break;
  1957. case 75:
  1958. # line 704
  1959. {
  1960. #if NOT EXE386
  1961. // This ONLY for compatibility with JDA IBM LINK
  1962. offmask |= NSDISCARD;
  1963. #endif
  1964. } break;
  1965. case 76:
  1966. # line 712
  1967. {
  1968. #if EXE386
  1969. yyval._wd = OBJ_READ;
  1970. offmask |= OBJ_WRITE;
  1971. #else
  1972. yyval._wd = NSEXRD;
  1973. #endif
  1974. } break;
  1975. case 78:
  1976. # line 722
  1977. {
  1978. #if FALSE AND NOT EXE386
  1979. yyval._wd = NSEXPDOWN;
  1980. #endif
  1981. } break;
  1982. case 79:
  1983. # line 728
  1984. {
  1985. #if FALSE AND NOT EXE386
  1986. offmask |= NSEXPDOWN;
  1987. #endif
  1988. } break;
  1989. case 88:
  1990. # line 746
  1991. {
  1992. NewSeg(yypvt[-3]._bp, yypvt[-2]._bp, yypvt[-1]._wd, yypvt[-0]._wd);
  1993. } break;
  1994. case 89:
  1995. # line 751
  1996. {
  1997. yyval._bp = _strdup(yypvt[-0]._bp);
  1998. } break;
  1999. case 90:
  2000. # line 755
  2001. {
  2002. yyval._bp = _strdup("\004CODE");
  2003. } break;
  2004. case 91:
  2005. # line 760
  2006. {
  2007. yyval._wd = yypvt[-0]._wd;
  2008. } break;
  2009. case 92:
  2010. # line 764
  2011. {
  2012. #if OVERLAYS
  2013. yyval._wd = NOTIOVL;
  2014. #endif
  2015. } break;
  2016. case 96:
  2017. # line 776
  2018. {
  2019. yyval._wd |= yypvt[-0]._wd;
  2020. } break;
  2021. case 98:
  2022. # line 782
  2023. {
  2024. yyval._wd = yypvt[-0]._wd;
  2025. } break;
  2026. case 99:
  2027. # line 786
  2028. {
  2029. yyval._wd = 0;
  2030. } break;
  2031. case 100:
  2032. # line 791
  2033. {
  2034. #if EXE386
  2035. yyval._wd = OBJ_SHARED;
  2036. #else
  2037. yyval._wd = NSSHARED;
  2038. #endif
  2039. vfShrattr = (FTYPE) TRUE;
  2040. } break;
  2041. case 101:
  2042. # line 800
  2043. {
  2044. vfShrattr = (FTYPE) TRUE;
  2045. #if EXE386
  2046. offmask |= OBJ_SHARED;
  2047. #else
  2048. offmask |= NSSHARED;
  2049. #endif
  2050. } break;
  2051. case 102:
  2052. # line 809
  2053. {
  2054. #if EXE386
  2055. #endif
  2056. } break;
  2057. case 103:
  2058. # line 814
  2059. {
  2060. #if EXE386
  2061. #else
  2062. yyval._wd = (2 << SHIFTDPL) | NSMOVE;
  2063. offmask |= NSDPL;
  2064. #endif
  2065. } break;
  2066. case 104:
  2067. # line 822
  2068. {
  2069. #if EXE386
  2070. #else
  2071. yyval._wd = (3 << SHIFTDPL);
  2072. #endif
  2073. } break;
  2074. case 105:
  2075. # line 829
  2076. {
  2077. #if NOT EXE386
  2078. offmask |= NSMOVE | NSDISCARD;
  2079. #endif
  2080. } break;
  2081. case 106:
  2082. # line 835
  2083. {
  2084. #if NOT EXE386
  2085. yyval._wd = NSMOVE;
  2086. #endif
  2087. } break;
  2088. case 107:
  2089. # line 841
  2090. {
  2091. #if NOT EXE386
  2092. yyval._wd = NSPRELOAD;
  2093. #endif
  2094. } break;
  2095. case 108:
  2096. # line 847
  2097. {
  2098. #if NOT EXE386
  2099. offmask |= NSPRELOAD;
  2100. #endif
  2101. } break;
  2102. case 109:
  2103. # line 853
  2104. {
  2105. } break;
  2106. case 110:
  2107. # line 856
  2108. {
  2109. } break;
  2110. case 111:
  2111. # line 859
  2112. {
  2113. } break;
  2114. case 112:
  2115. # line 862
  2116. {
  2117. } break;
  2118. case 113:
  2119. # line 865
  2120. {
  2121. } break;
  2122. case 114:
  2123. # line 868
  2124. {
  2125. } break;
  2126. case 115:
  2127. # line 871
  2128. {
  2129. } break;
  2130. case 116:
  2131. # line 874
  2132. {
  2133. } break;
  2134. case 117:
  2135. # line 877
  2136. {
  2137. } break;
  2138. case 122:
  2139. # line 887
  2140. {
  2141. NewExport(yypvt[-5]._bp,yypvt[-4]._bp,yypvt[-3]._wd,yypvt[-2]._wd);
  2142. } break;
  2143. case 123:
  2144. # line 892
  2145. {
  2146. yyval._bp = yypvt[-0]._bp;
  2147. } break;
  2148. case 124:
  2149. # line 896
  2150. {
  2151. yyval._bp = NULL;
  2152. } break;
  2153. case 125:
  2154. # line 901
  2155. {
  2156. yyval._wd = yypvt[-1]._wd;
  2157. nameFlags |= RES_NAME;
  2158. } break;
  2159. case 126:
  2160. # line 906
  2161. {
  2162. yyval._wd = yypvt[-1]._wd;
  2163. nameFlags |= NO_NAME;
  2164. } break;
  2165. case 127:
  2166. # line 911
  2167. {
  2168. yyval._wd = yypvt[-0]._wd;
  2169. } break;
  2170. case 128:
  2171. # line 915
  2172. {
  2173. yyval._wd = 0;
  2174. } break;
  2175. case 129:
  2176. # line 920
  2177. {
  2178. yyval._wd = yypvt[-1]._wd | 1;
  2179. } break;
  2180. case 130:
  2181. # line 925
  2182. {
  2183. /* return 0 */
  2184. } break;
  2185. case 131:
  2186. # line 929
  2187. {
  2188. yyval._wd = 2;
  2189. } break;
  2190. case 132:
  2191. # line 934
  2192. {
  2193. } break;
  2194. case 133:
  2195. # line 937
  2196. {
  2197. } break;
  2198. case 134:
  2199. # line 941
  2200. {
  2201. #if EXE386
  2202. expOtherFlags |= 0x1;
  2203. #endif
  2204. } break;
  2205. case 135:
  2206. # line 947
  2207. {
  2208. } break;
  2209. case 142:
  2210. # line 969
  2211. {
  2212. if(yypvt[-3]._bp != NULL)
  2213. {
  2214. #if EXE386
  2215. NewImport(yypvt[-1]._bp,0,yypvt[-3]._bp,yypvt[-4]._bp,yypvt[-0]._wd);
  2216. #else
  2217. NewImport(yypvt[-1]._bp,0,yypvt[-3]._bp,yypvt[-4]._bp);
  2218. #endif
  2219. free(yypvt[-3]._bp);
  2220. }
  2221. else
  2222. #if EXE386
  2223. NewImport(yypvt[-1]._bp,0,yypvt[-4]._bp,yypvt[-1]._bp,yypvt[-0]._wd);
  2224. #else
  2225. NewImport(yypvt[-1]._bp,0,yypvt[-4]._bp,yypvt[-1]._bp);
  2226. #endif
  2227. free(yypvt[-4]._bp);
  2228. free(yypvt[-1]._bp);
  2229. } break;
  2230. case 143:
  2231. # line 989
  2232. {
  2233. if (yypvt[-3]._bp == NULL)
  2234. Fatal(ER_dfimport);
  2235. #if EXE386
  2236. NewImport(NULL,yypvt[-1]._wd,yypvt[-3]._bp,yypvt[-4]._bp,yypvt[-0]._wd);
  2237. #else
  2238. NewImport(NULL,yypvt[-1]._wd,yypvt[-3]._bp,yypvt[-4]._bp);
  2239. #endif
  2240. free(yypvt[-4]._bp);
  2241. free(yypvt[-3]._bp);
  2242. } break;
  2243. case 144:
  2244. # line 1003
  2245. {
  2246. yyval._bp = _strdup(bufg);
  2247. } break;
  2248. case 145:
  2249. # line 1007
  2250. {
  2251. yyval._bp = _strdup(bufg);
  2252. } break;
  2253. case 146:
  2254. # line 1013
  2255. {
  2256. yyval._wd = 1;
  2257. } break;
  2258. case 147:
  2259. # line 1017
  2260. {
  2261. yyval._wd = 0;
  2262. } break;
  2263. case 148:
  2264. # line 1023
  2265. {
  2266. #if EXE386
  2267. fUserVersion = (FTYPE) FALSE;
  2268. #endif
  2269. } break;
  2270. case 150:
  2271. # line 1032
  2272. {
  2273. TargetOs = NE_DOS;
  2274. #if ODOS3EXE
  2275. fNewExe = FALSE;
  2276. #endif
  2277. } break;
  2278. case 151:
  2279. # line 1039
  2280. {
  2281. TargetOs = NE_OS2;
  2282. } break;
  2283. case 152:
  2284. # line 1043
  2285. {
  2286. TargetOs = NE_UNKNOWN;
  2287. } break;
  2288. case 153:
  2289. # line 1047
  2290. {
  2291. #if EXE386
  2292. TargetSubsys = E32_SSWINGUI;
  2293. #endif
  2294. TargetOs = NE_WINDOWS;// PROTMODE is default for WINDOWS
  2295. fRealMode = (FTYPE) FALSE;
  2296. #if NOT EXE386
  2297. vFlags |= NEPROT;
  2298. #endif
  2299. } break;
  2300. case 154:
  2301. # line 1058
  2302. {
  2303. TargetOs = NE_DEV386;
  2304. } break;
  2305. case 155:
  2306. # line 1062
  2307. {
  2308. #if EXE386
  2309. TargetSubsys = E32_SSWINGUI;
  2310. #endif
  2311. } break;
  2312. case 156:
  2313. # line 1068
  2314. {
  2315. #if EXE386
  2316. TargetSubsys = E32_SSPOSIXCHAR;
  2317. #endif
  2318. } break;
  2319. case 157:
  2320. # line 1074
  2321. {
  2322. #if O68K
  2323. iMacType = MAC_SWAP;
  2324. f68k = fTBigEndian = fNewExe = (FTYPE) TRUE;
  2325. /* If we are packing code to the default value, change the
  2326. default. */
  2327. if (fPackSet && packLim == LXIVK - 36)
  2328. packLim = LXIVK / 2;
  2329. #endif
  2330. } break;
  2331. case 158:
  2332. # line 1086
  2333. {
  2334. #if O68K
  2335. iMacType = MAC_NOSWAP;
  2336. f68k = fTBigEndian = fNewExe = (FTYPE) TRUE;
  2337. /* If we are packing code to the default value, change the
  2338. default. */
  2339. if (fPackSet && packLim == LXIVK - 36)
  2340. packLim = LXIVK / 2;
  2341. #endif
  2342. } break;
  2343. case 159:
  2344. # line 1100
  2345. {
  2346. #if EXE386
  2347. if (fUserVersion)
  2348. {
  2349. UserMajorVer = (BYTE) yypvt[-2]._wd;
  2350. UserMinorVer = (BYTE) yypvt[-0]._wd;
  2351. }
  2352. else
  2353. #endif
  2354. {
  2355. ExeMajorVer = (BYTE) yypvt[-2]._wd;
  2356. ExeMinorVer = (BYTE) yypvt[-0]._wd;
  2357. }
  2358. } break;
  2359. case 160:
  2360. # line 1115
  2361. {
  2362. #if EXE386
  2363. if (fUserVersion)
  2364. {
  2365. UserMajorVer = (BYTE) yypvt[-0]._wd;
  2366. UserMinorVer = 0;
  2367. }
  2368. else
  2369. #endif
  2370. {
  2371. ExeMajorVer = (BYTE) yypvt[-0]._wd;
  2372. if(fNoExeVer)
  2373. ExeMinorVer = DEF_EXETYPE_WINDOWS_MINOR;
  2374. else
  2375. ExeMinorVer = 0;
  2376. }
  2377. } break;
  2378. case 161:
  2379. # line 1135
  2380. {
  2381. yyval._wd = yypvt[-0]._wd;
  2382. } break;
  2383. case 162:
  2384. # line 1139
  2385. {
  2386. yyval._wd = ExeMajorVer;
  2387. fNoExeVer = TRUE;
  2388. } break;
  2389. case 163:
  2390. # line 1146
  2391. {
  2392. if (cDigits >= 2)
  2393. yyval._wd = yypvt[-0]._wd;
  2394. else
  2395. yyval._wd = 10 * yypvt[-0]._wd;
  2396. } break;
  2397. case 164:
  2398. # line 1153
  2399. {
  2400. yyval._wd = ExeMinorVer;
  2401. } break;
  2402. case 165:
  2403. # line 1159
  2404. {
  2405. #if EXE386
  2406. fUserVersion = (FTYPE) TRUE;
  2407. #endif
  2408. } break;
  2409. case 168:
  2410. # line 1171
  2411. {
  2412. #if EXE386
  2413. TargetSubsys = E32_SSUNKNOWN;
  2414. #endif
  2415. } break;
  2416. case 169:
  2417. # line 1177
  2418. {
  2419. #if EXE386
  2420. TargetSubsys = E32_SSNATIVE;
  2421. #endif
  2422. } break;
  2423. case 170:
  2424. # line 1183
  2425. {
  2426. #if EXE386
  2427. TargetSubsys = E32_SSOS2CHAR;
  2428. #endif
  2429. } break;
  2430. case 171:
  2431. # line 1189
  2432. {
  2433. #if EXE386
  2434. TargetSubsys = E32_SSWINGUI;
  2435. #endif
  2436. } break;
  2437. case 172:
  2438. # line 1195
  2439. {
  2440. #if EXE386
  2441. TargetSubsys = E32_SSWINCHAR;
  2442. #endif
  2443. } break;
  2444. case 173:
  2445. # line 1201
  2446. {
  2447. #if EXE386
  2448. TargetSubsys = E32_SSPOSIXCHAR;
  2449. #endif
  2450. } break;
  2451. case 174:
  2452. # line 1210
  2453. {
  2454. if (szSegName != NULL)
  2455. {
  2456. free(szSegName);
  2457. szSegName = NULL;
  2458. }
  2459. #if OVERLAYS
  2460. iOvl = NOTIOVL;
  2461. #endif
  2462. } break;
  2463. case 178:
  2464. # line 1228
  2465. {
  2466. if (szSegName == NULL)
  2467. szSegName = yypvt[-0]._bp;
  2468. #if OVERLAYS
  2469. iOvl = NOTIOVL;
  2470. #endif
  2471. } break;
  2472. case 179:
  2473. # line 1236
  2474. {
  2475. #if OVERLAYS
  2476. iOvl = yypvt[-0]._wd;
  2477. fOverlays = (FTYPE) TRUE;
  2478. fNewExe = FALSE;
  2479. TargetOs = NE_DOS;
  2480. #endif
  2481. } break;
  2482. case 182:
  2483. # line 1251
  2484. {
  2485. NewProc(yypvt[-0]._bp);
  2486. } break;/* End of actions */
  2487. }
  2488. goto yystack; /* stack new state and value */
  2489. }