7f08f73fef
-- The OpenGL Utility Toolkit, a window system independent toolkit for writing OpenGL programs. It implements a simple windowing application programming interface (API) for OpenGL. GLUT is designed for constructing small to medium sized OpenGL programs. While GLUT is well-suited to learning OpenGL and developing simple OpenGL applications, GLUT is not a full-featured toolkit so large applications requiring sophisticated user interfaces are better off using native window system toolkits like Motif. WWW: http://reality.sgi.com/opengl/glut3/glut3.html Submitted by Dan Weeks <danimal@danimal.org>
267 lines
6.6 KiB
Plaintext
267 lines
6.6 KiB
Plaintext
$OpenBSD: patch-lib_glut_strokelex_l,v 1.1.1.1 2001/06/20 18:55:24 lebel Exp $
|
|
--- lib/glut/strokelex.l.orig Fri Aug 7 20:09:09 1998
|
|
+++ lib/glut/strokelex.l Wed Jun 20 12:11:38 2001
|
|
@@ -1,131 +1,131 @@
|
|
-%{
|
|
-/* $XConsortium: lex.l,v 5.4 91/08/26 10:55:26 gildea Exp $ */
|
|
-
|
|
-/*****************************************************************
|
|
-Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
|
|
-
|
|
- All Rights Reserved
|
|
-
|
|
-Permission to use, copy, modify, and distribute this software and its
|
|
-documentation for any purpose and without fee is hereby granted,
|
|
-provided that the above copyright notice appear in all copies and that
|
|
-both that copyright notice and this permission notice appear in
|
|
-supporting documentation, and that the names of Sun Microsystems,
|
|
-the X Consortium, and MIT not be used in advertising or publicity
|
|
-pertaining to distribution of the software without specific, written
|
|
-prior permission.
|
|
-
|
|
-SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
|
|
-SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
|
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
-SOFTWARE.
|
|
-
|
|
-******************************************************************/
|
|
-
|
|
-
|
|
-#include <stdlib.h>
|
|
-#include <ctype.h>
|
|
-#include <math.h>
|
|
-#include "strokegen.h"
|
|
-
|
|
-#if defined(ISC) && defined(SYSV) && defined(SYSV386) && __STDC__
|
|
-extern double atof(char *);
|
|
-#endif
|
|
-
|
|
-#ifdef FLEX_SCANNER
|
|
-int yylineno;
|
|
-#endif
|
|
-
|
|
-%}
|
|
-%%
|
|
-\'[^']*\' |
|
|
-\"[^"]*\" return string(yytext, yyleng);
|
|
-#.* ;
|
|
-[ ,;\t\n]* /* natural dilimters */ ;
|
|
-
|
|
-[a-zA-Z][a-zA-Z0-9_.]* {
|
|
- int token;
|
|
- if (token = res_words(yytext))
|
|
- return token;
|
|
- return string(yytext, yyleng);
|
|
- }
|
|
-
|
|
-[+-]?[0-9]+\.?[0-9]*[eE][+-]?[0-9]+ |
|
|
-[+-]?[0-9]+\.[0-9]* |
|
|
-\.[0-9]+ {
|
|
- yylval.dval = atof(yytext);
|
|
- return REAL;
|
|
- }
|
|
-[+-]?[0-9]+#[0-9]+ {
|
|
- return INTEGER;
|
|
- }
|
|
-[+-]?[0-9]+ {
|
|
- yylval.ival = atoi(yytext);
|
|
- return INTEGER;
|
|
- }
|
|
-[()] ;
|
|
-%%
|
|
-
|
|
-int
|
|
-res_words(str)
|
|
-char str[];
|
|
-{
|
|
- static struct res_strct {
|
|
- char *word;
|
|
- int token;
|
|
- } res_table[] = {
|
|
- {"BOTTOM", BOTTOM},
|
|
- {"CENTER", CENTER},
|
|
- {"PROPERTIES", PROPERTIES},
|
|
- {"CLOSE", CLOSE},
|
|
- {"FONTNAME", FONTNAME},
|
|
- {"INDEX", INDEX},
|
|
- {"MAGIC", MAGIC},
|
|
- {"OPEN", OPEN},
|
|
- {"RIGHT", RIGHT},
|
|
- {"STROKE", STROKE},
|
|
- {"TOP", TOP},
|
|
- {"VERTICES", VERTICES},
|
|
- {"BEARING", BEARING},
|
|
- {"L_SPACE", L_SPACE},
|
|
- {"WIDTH", WIDTH},
|
|
- {"R_SPACE", R_SPACE},
|
|
- {"NUM_CH", NUM_CH},
|
|
- {0, 0}
|
|
- };
|
|
-
|
|
- {
|
|
- register struct res_strct *reserved;
|
|
-
|
|
- reserved = res_table;
|
|
-
|
|
- do
|
|
- if (!strcmp(str, reserved->word))
|
|
- break;
|
|
- while ((++reserved)->word != 0);
|
|
- return reserved->token;
|
|
- }
|
|
-}
|
|
-
|
|
-int
|
|
-string(str, n)
|
|
-char *str;
|
|
-int n;
|
|
-{
|
|
- if (*str == '\"' || *str == '\'')
|
|
- {
|
|
- str++;
|
|
- n -= 2; /* one for EOL, one for end quote */
|
|
- }
|
|
- if ((yylval.cval = (char *)malloc(n+1)) != NULL)
|
|
- {
|
|
- strncpy(yylval.cval, str, n);
|
|
- yylval.cval[n] = '\0';
|
|
- return STRING;
|
|
- }
|
|
- else
|
|
- return 0;
|
|
-}
|
|
+%{
|
|
+/* $XConsortium: lex.l,v 5.4 91/08/26 10:55:26 gildea Exp $ */
|
|
+
|
|
+/*****************************************************************
|
|
+Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
|
|
+
|
|
+ All Rights Reserved
|
|
+
|
|
+Permission to use, copy, modify, and distribute this software and its
|
|
+documentation for any purpose and without fee is hereby granted,
|
|
+provided that the above copyright notice appear in all copies and that
|
|
+both that copyright notice and this permission notice appear in
|
|
+supporting documentation, and that the names of Sun Microsystems,
|
|
+the X Consortium, and MIT not be used in advertising or publicity
|
|
+pertaining to distribution of the software without specific, written
|
|
+prior permission.
|
|
+
|
|
+SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
|
|
+SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
|
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
+SOFTWARE.
|
|
+
|
|
+******************************************************************/
|
|
+
|
|
+
|
|
+#include <stdlib.h>
|
|
+#include <ctype.h>
|
|
+#include <math.h>
|
|
+#include "strokegen.h"
|
|
+
|
|
+#if defined(ISC) && defined(SYSV) && defined(SYSV386) && __STDC__
|
|
+extern double atof(char *);
|
|
+#endif
|
|
+
|
|
+#ifdef FLEX_SCANNER
|
|
+int yylineno;
|
|
+#endif
|
|
+
|
|
+%}
|
|
+%%
|
|
+\'[^']*\' |
|
|
+\"[^"]*\" return string(yytext, yyleng);
|
|
+#.* ;
|
|
+[ ,;\t\n]* /* natural dilimters */ ;
|
|
+
|
|
+[a-zA-Z][a-zA-Z0-9_.]* {
|
|
+ int token;
|
|
+ if (token = res_words(yytext))
|
|
+ return token;
|
|
+ return string(yytext, yyleng);
|
|
+ }
|
|
+
|
|
+[+-]?[0-9]+\.?[0-9]*[eE][+-]?[0-9]+ |
|
|
+[+-]?[0-9]+\.[0-9]* |
|
|
+\.[0-9]+ {
|
|
+ yylval.dval = atof(yytext);
|
|
+ return REAL;
|
|
+ }
|
|
+[+-]?[0-9]+#[0-9]+ {
|
|
+ return INTEGER;
|
|
+ }
|
|
+[+-]?[0-9]+ {
|
|
+ yylval.ival = atoi(yytext);
|
|
+ return INTEGER;
|
|
+ }
|
|
+[()] ;
|
|
+%%
|
|
+
|
|
+int
|
|
+res_words(str)
|
|
+char str[];
|
|
+{
|
|
+ static struct res_strct {
|
|
+ char *word;
|
|
+ int token;
|
|
+ } res_table[] = {
|
|
+ {"BOTTOM", BOTTOM},
|
|
+ {"CENTER", CENTER},
|
|
+ {"PROPERTIES", PROPERTIES},
|
|
+ {"CLOSE", CLOSE},
|
|
+ {"FONTNAME", FONTNAME},
|
|
+ {"INDEX", INDEX},
|
|
+ {"MAGIC", MAGIC},
|
|
+ {"OPEN", OPEN},
|
|
+ {"RIGHT", RIGHT},
|
|
+ {"STROKE", STROKE},
|
|
+ {"TOP", TOP},
|
|
+ {"VERTICES", VERTICES},
|
|
+ {"BEARING", BEARING},
|
|
+ {"L_SPACE", L_SPACE},
|
|
+ {"WIDTH", WIDTH},
|
|
+ {"R_SPACE", R_SPACE},
|
|
+ {"NUM_CH", NUM_CH},
|
|
+ {0, 0}
|
|
+ };
|
|
+
|
|
+ {
|
|
+ register struct res_strct *reserved;
|
|
+
|
|
+ reserved = res_table;
|
|
+
|
|
+ do
|
|
+ if (!strncmp(str, reserved->word, sizeof(str)))
|
|
+ break;
|
|
+ while ((++reserved)->word != 0);
|
|
+ return reserved->token;
|
|
+ }
|
|
+}
|
|
+
|
|
+int
|
|
+string(str, n)
|
|
+char *str;
|
|
+int n;
|
|
+{
|
|
+ if (*str == '\"' || *str == '\'')
|
|
+ {
|
|
+ str++;
|
|
+ n -= 2; /* one for EOL, one for end quote */
|
|
+ }
|
|
+ if ((yylval.cval = (char *)malloc(n+1)) != NULL)
|
|
+ {
|
|
+ strncpy(yylval.cval, str, n);
|
|
+ yylval.cval[n] = '\0';
|
|
+ return STRING;
|
|
+ }
|
|
+ else
|
|
+ return 0;
|
|
+}
|