summaryrefslogtreecommitdiff
path: root/wm/tvtwm/patches/patch-ak
blob: d7b1c466ee0f4cb63763848229fdc815342b9f61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$NetBSD: patch-ak,v 1.2 2004/05/23 23:28:29 danw Exp $

Index: lex.l
===================================================================
RCS file: /home/siren/src/tvtwm/lex.l,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- lex.l	1999/08/08 05:46:53	1.1.1.1
+++ lex.l	1999/08/08 05:56:51	1.2
@@ -37,12 +37,34 @@
  ***********************************************************************/
 
 /* #include <stdio.h> */		/* lex already includes stdio.h */
+#include "twm.h"
 #include "gram.h"
 #include "parse.h"
 extern char *ProgramName;
 
 extern int ParseError;
 
+#if defined(__NetBSD__)
+#undef YY_INPUT
+#define YY_INPUT(buf,result,size) ((result) = doinput((buf),(size)))
+int
+doinput (buf, size)
+char *buf;
+int size;
+{
+        int c;
+
+        if (size == 0)
+                return (0);
+
+        if ((c = (*twmInputFunc)()) <= 0)
+                return (0);
+
+        buf[0] = c;
+        return (1);
+}
+#endif
+
 %}
 
 string				\"([^"]|\\.)*\"
@@ -94,7 +116,10 @@
 				}
 %%
 #ifndef yywrap
-yywrap() { return(1);}
+int yywrap() { return(1);}
+#endif
+#if defined(__NetBSD__) || defined(__APPLE__)
+int yylineno;
 #endif
 
 #undef unput