xref: /titanic_53/usr/src/cmd/sed/extern.h (revision 84441f85b19f6b8080883f30109e58e43c893709)
1*84441f85SGarrett D'Amore /*
2*84441f85SGarrett D'Amore  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
3*84441f85SGarrett D'Amore  * Copyright (c) 1992 Diomidis Spinellis.
4*84441f85SGarrett D'Amore  * Copyright (c) 1992, 1993
5*84441f85SGarrett D'Amore  *	The Regents of the University of California.  All rights reserved.
6*84441f85SGarrett D'Amore  *
7*84441f85SGarrett D'Amore  * This code is derived from software contributed to Berkeley by
8*84441f85SGarrett D'Amore  * Diomidis Spinellis of Imperial College, University of London.
9*84441f85SGarrett D'Amore  *
10*84441f85SGarrett D'Amore  * Redistribution and use in source and binary forms, with or without
11*84441f85SGarrett D'Amore  * modification, are permitted provided that the following conditions
12*84441f85SGarrett D'Amore  * are met:
13*84441f85SGarrett D'Amore  * 1. Redistributions of source code must retain the above copyright
14*84441f85SGarrett D'Amore  *    notice, this list of conditions and the following disclaimer.
15*84441f85SGarrett D'Amore  * 2. Redistributions in binary form must reproduce the above copyright
16*84441f85SGarrett D'Amore  *    notice, this list of conditions and the following disclaimer in the
17*84441f85SGarrett D'Amore  *    documentation and/or other materials provided with the distribution.
18*84441f85SGarrett D'Amore  * 4. Neither the name of the University nor the names of its contributors
19*84441f85SGarrett D'Amore  *    may be used to endorse or promote products derived from this software
20*84441f85SGarrett D'Amore  *    without specific prior written permission.
21*84441f85SGarrett D'Amore  *
22*84441f85SGarrett D'Amore  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23*84441f85SGarrett D'Amore  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24*84441f85SGarrett D'Amore  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25*84441f85SGarrett D'Amore  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26*84441f85SGarrett D'Amore  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27*84441f85SGarrett D'Amore  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28*84441f85SGarrett D'Amore  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29*84441f85SGarrett D'Amore  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30*84441f85SGarrett D'Amore  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31*84441f85SGarrett D'Amore  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32*84441f85SGarrett D'Amore  * SUCH DAMAGE.
33*84441f85SGarrett D'Amore  */
34*84441f85SGarrett D'Amore 
35*84441f85SGarrett D'Amore #ifndef	EXTERN_H
36*84441f85SGarrett D'Amore #define	EXTERN_H
37*84441f85SGarrett D'Amore 
38*84441f85SGarrett D'Amore extern struct s_command *prog;
39*84441f85SGarrett D'Amore extern struct s_appends *appends;
40*84441f85SGarrett D'Amore extern regmatch_t *match;
41*84441f85SGarrett D'Amore extern size_t maxnsub;
42*84441f85SGarrett D'Amore extern ulong_t linenum;
43*84441f85SGarrett D'Amore extern int appendnum;
44*84441f85SGarrett D'Amore extern int aflag, eflag, nflag;
45*84441f85SGarrett D'Amore extern const char *fname, *outfname;
46*84441f85SGarrett D'Amore extern FILE *infile, *outfile;
47*84441f85SGarrett D'Amore extern int rflags;	/* regex flags to use */
48*84441f85SGarrett D'Amore 
49*84441f85SGarrett D'Amore void	 cfclose(struct s_command *, struct s_command *);
50*84441f85SGarrett D'Amore void	 compile(void);
51*84441f85SGarrett D'Amore void	 cspace(SPACE *, const char *, size_t, enum e_spflag);
52*84441f85SGarrett D'Amore char	*cu_fgets(char *, int, int *);
53*84441f85SGarrett D'Amore int	 mf_fgets(SPACE *, enum e_spflag);
54*84441f85SGarrett D'Amore int	 lastline(void);
55*84441f85SGarrett D'Amore void	 process(void);
56*84441f85SGarrett D'Amore void	 resetstate(void);
57*84441f85SGarrett D'Amore char	*strregerror(int, regex_t *);
58*84441f85SGarrett D'Amore /*PRINTFLIKE1*/
59*84441f85SGarrett D'Amore void	fatal(const char *, ...);	/* output includes file and line # */
60*84441f85SGarrett D'Amore 
61*84441f85SGarrett D'Amore #ifdef	lint
62*84441f85SGarrett D'Amore #define	_(s)	s
63*84441f85SGarrett D'Amore #else
64*84441f85SGarrett D'Amore #define	_(s)	gettext(s)
65*84441f85SGarrett D'Amore #endif
66*84441f85SGarrett D'Amore 
67*84441f85SGarrett D'Amore #endif	/* EXTERN_H */
68