* Updated preprocessor conditionals for the MPW compilers.
* Remove obsolete Mac code in util/*_comp.l.
extern YYSTYPE yylval;
int line_number = 1;
-/*
- * This is a hack required by Michael Hamel to get things
- * working on the Mac.
- */
-#if defined(applec) && !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER)
-#undef input
-#undef unput
-#define unput(c) { yytchar = (c); if (yytchar == 10) yylineno--; *yysptr++ = yytchar; }
-# ifndef YYNEWLINE
-# define YYNEWLINE 10
-# endif
-
-char
-input() /* Under MPW \n is chr(13)! Compensate for this. */
-{
- if (yysptr > yysbuf) return(*--yysptr);
- else {
- yytchar = getc(yyin);
- if (yytchar == '\n') {
- yylineno++;
- return(YYNEWLINE);
- }
- if (yytchar == EOF) return(0);
- else return(yytchar);
- }
-}
-#endif /* applec && !FLEX_SCANNER && !FLEXHACK_SCANNER */
%}
%%
#include "dlb.h"
#ifdef MAC
-# ifdef applec
+# if defined(__SC__) || defined(__MRC__)
# define MPWTOOL
#include <CursorCtl.h>
# else
static char map[4096];
static int map_cnt = 0;
-/*
- * This is a hack required by Michael Hamel to get things
- * working on the Mac.
- */
-#if defined(applec) && !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER)
-#undef input
-#undef unput
-#define unput(c) { yytchar = (c); if (yytchar == 10) yylineno--; *yysptr++ = yytchar; }
-# ifndef YYNEWLINE
-# define YYNEWLINE 10
-# endif
-
-char
-input() /* Under MPW \n is chr(13)! Compensate for this. */
-{
- if (yysptr > yysbuf) return(*--yysptr);
- else {
- yytchar = getc(yyin);
- if (yytchar == '\n') {
- yylineno++;
- return(YYNEWLINE);
- }
- if (yytchar == EOF) return(0);
- else return(yytchar);
- }
-}
-#endif /* applec && !FLEX_SCANNER && !FLEXHACK_SCANNER */
-
%}
%e 1500
%p 5000
* This file contains the main function for the parser
* and some useful functions needed by yacc
*/
+#define SPEC_LEV /* for MPW */
+/* although, why don't we move those special defined here.. and in dgn_main? */
#include "hack.h"
#include "date.h"
#endif
#ifdef MAC
-# ifdef applec
+# if defined(__SC__) || defined(__MRC__)
# define MPWTOOL
#include <CursorCtl.h>
# else
# define OMASK 0644
#endif
-#define NEWLINE 10 /* under Mac MPW C '\n' is 13 so don't use it. */
+#define NEWLINE '\n' /* changes to 13 for MPW */
#define ERR (-1)
Strcat(lbuf, filename);
Strcat(lbuf, LEV_EXT);
+#if defined(MAC) && (defined(__SC__) || defined(__MRC__))
+ fout = open(lbuf, O_WRONLY|O_CREAT|O_BINARY);
+#else
fout = open(lbuf, O_WRONLY|O_CREAT|O_BINARY, OMASK);
+#endif
if (fout < 0) return FALSE;
if (room_level) {
#endif
#ifdef MAC
-# ifdef applec /* Means the MPW compiler, I hope */
+# if defined(__SC__) || defined(__MRC__) /* MPW compilers */
# define MPWTOOL
#include <CursorCtl.h>
#include <string.h>
# define INCLUDE_TEMPLATE "..\\include\\%s"
# define SOURCE_TEMPLATE "..\\src\\%s"
# define DGN_TEMPLATE "..\\dat\\%s" /* where dungeon.pdf file goes */
-# define DATA_TEMPLATE "..\\dat\\%s"
+# if __SC__ || __MRC__
+# define DATA_TEMPLATE ":Dungeon:%s"
+# else
+# define DATA_TEMPLATE ":lib:%s"
+# endif /* __SC__ || __MRC__ */
# define DATA_IN_TEMPLATE "..\\dat\\%s"
# else /* OS2 */
# define INCLUDE_TEMPLATE "../include/%s"