1102050Stjr/*	$OpenBSD: extern.h,v 1.6 2003/06/03 02:56:20 millert Exp $	*/
2127835Stjr/*	$NetBSD: extern.h,v 1.4 1995/11/01 00:45:22 pk Exp $	*/
3102050Stjr
4102050Stjr/*-
5227753Stheraven * Copyright (c) 1991, 1993
6227753Stheraven *	The Regents of the University of California.  All rights reserved.
7227753Stheraven *
8227753Stheraven * Redistribution and use in source and binary forms, with or without
9227753Stheraven * modification, are permitted provided that the following conditions
10102050Stjr * are met:
11102050Stjr * 1. Redistributions of source code must retain the above copyright
12102050Stjr *    notice, this list of conditions and the following disclaimer.
13102050Stjr * 2. Redistributions in binary form must reproduce the above copyright
14102050Stjr *    notice, this list of conditions and the following disclaimer in the
15102050Stjr *    documentation and/or other materials provided with the distribution.
16102050Stjr * 3. Neither the name of the University nor the names of its contributors
17102050Stjr *    may be used to endorse or promote products derived from this software
18102050Stjr *    without specific prior written permission.
19102050Stjr *
20102050Stjr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21102050Stjr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22102050Stjr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23102050Stjr * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24102050Stjr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25102050Stjr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26102050Stjr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27102050Stjr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28102050Stjr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29102050Stjr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30102050Stjr * SUCH DAMAGE.
31102050Stjr *
32102050Stjr *	@(#)extern.h	8.1 (Berkeley) 6/6/93
33102050Stjr */
34102050Stjr
35102050Stjrtypedef struct {
36129153Stjr	enum { STRING1, STRING2 } which;
37102050Stjr	enum { EOS, INFINITE, NORMAL, RANGE, SEQUENCE, SET } state;
38102050Stjr	int	 cnt;			/* character count */
39227753Stheraven	int	 lastch;		/* last character */
40227753Stheraven	int	equiv[2];		/* equivalence set */
41227753Stheraven	int	*set;			/* set of characters */
42227753Stheraven	unsigned char	*str;		/* user's string */
43227753Stheraven} STR;
44227753Stheraven
45227753Stheraven#include <limits.h>
46227753Stheraven#define	NCHARS	(UCHAR_MAX + 1)		/* Number of possible characters. */
47227753Stheraven#define	OOBCH	(UCHAR_MAX + 1)		/* Out of band character value. */
48227753Stheraven
49121845Stjrint	 next(STR *);
50121845Stjr