1 /* rtcScanner.h
2 
3    Copyright (C) 1999 Free Software Foundation, Inc.
4 
5    Author:  Stefan Boehringer (stefan.boehringer@uni-bochum.de)
6    Date: Dec 1999
7 
8    This file is part of the GNUstep GUI Library.
9 
10    This library is free software; you can redistribute it and/or
11    modify it under the terms of the GNU Lesser General Public
12    License as published by the Free Software Foundation; either
13    version 2 of the License, or (at your option) any later version.
14 
15    This library is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
18    Lesser General Public License for more details.
19 
20    You should have received a copy of the GNU Lesser General Public
21    License along with this library; see the file COPYING.LIB.
22    If not, see <http://www.gnu.org/licenses/> or write to the
23    Free Software Foundation, 51 Franklin Street, Fifth Floor,
24    Boston, MA 02110-1301, USA.
25 */
26 
27 #ifndef rtfScanner_h_INCLUDE
28 #define rtfScanner_h_INCLUDE
29 
30 #include	<objc/objc.h>
31 
32 #if !defined(YES)
33 	typedef	char	BOOL;
34 	enum { NO, YES };
35 #endif
36 
37 typedef enum { NoError, LEXoutOfMemory, LEXsyntaxError } GSLexError;
38 
39 typedef struct _RTFscannerCtxt {
40 	int	(*lgetchar)(void *);
41 	char	pushbackBuffer[4];	// gaurantee 4 chars of pushback
42 	int	pushbackCount;
43 	int	streamPosition;
44 	int	streamLineNumber;
45 	void	*customContext;
46 } RTFscannerCtxt;
47 
48 typedef struct {
49 	BOOL	isEmpty;
50 	int	parameter;
51 	int	token;
52 	const char	*name;
53 } RTFcmd;
54 
55 typedef enum {
56 	GSRTFfamilyNil, GSRTFfamilyRoman, GSRTFfamilySwiss,
57 	GSRTFfamilyModern, GSRTFfamilyScript, GSRTFfamilyDecor,
58 	GSRTFfamilyTech
59 } RTFfontFamily;
60 
61 
62 void	lexInitContext(RTFscannerCtxt *lctxt, void *customContext, int (*getcharFunction)());
63 
64 /*	external symbols from the grammer	*/
65 /*int	GSRTFparse(void *ctxt, RTFscannerCtxt *lctxt);*/
66 int	GSRTFparse(void *ctxt, void *lctxt);
67 
68 #endif
69 
70