xref: /minix3/usr.bin/sed/extern.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: extern.h,v 1.20 2015/03/12 12:40:41 christos Exp $	*/
2f789fee2SBen Gras 
3f789fee2SBen Gras /*-
4*0a6a1f1dSLionel Sambuc  * Copyright (c) 1992 Diomidis Spinellis.
5f789fee2SBen Gras  * Copyright (c) 1992, 1993
6f789fee2SBen Gras  *	The Regents of the University of California.  All rights reserved.
7f789fee2SBen Gras  *
8f789fee2SBen Gras  * This code is derived from software contributed to Berkeley by
9f789fee2SBen Gras  * Diomidis Spinellis of Imperial College, University of London.
10f789fee2SBen Gras  *
11f789fee2SBen Gras  * Redistribution and use in source and binary forms, with or without
12f789fee2SBen Gras  * modification, are permitted provided that the following conditions
13f789fee2SBen Gras  * are met:
14f789fee2SBen Gras  * 1. Redistributions of source code must retain the above copyright
15f789fee2SBen Gras  *    notice, this list of conditions and the following disclaimer.
16f789fee2SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
17f789fee2SBen Gras  *    notice, this list of conditions and the following disclaimer in the
18f789fee2SBen Gras  *    documentation and/or other materials provided with the distribution.
19f789fee2SBen Gras  * 3. Neither the name of the University nor the names of its contributors
20f789fee2SBen Gras  *    may be used to endorse or promote products derived from this software
21f789fee2SBen Gras  *    without specific prior written permission.
22f789fee2SBen Gras  *
23f789fee2SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24f789fee2SBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25f789fee2SBen Gras  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26f789fee2SBen Gras  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27f789fee2SBen Gras  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28f789fee2SBen Gras  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29f789fee2SBen Gras  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30f789fee2SBen Gras  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31f789fee2SBen Gras  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32f789fee2SBen Gras  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33f789fee2SBen Gras  * SUCH DAMAGE.
34f789fee2SBen Gras  *
35*0a6a1f1dSLionel Sambuc  *	@(#)extern.h	8.1 (Berkeley) 6/6/93
36*0a6a1f1dSLionel Sambuc  * $FreeBSD: head/usr.bin/sed/extern.h 170608 2007-06-12 12:05:24Z yar $
37f789fee2SBen Gras  */
38f789fee2SBen Gras 
39f789fee2SBen Gras extern struct s_command *prog;
40f789fee2SBen Gras extern struct s_appends *appends;
41f789fee2SBen Gras extern regmatch_t *match;
42f789fee2SBen Gras extern size_t maxnsub;
43f789fee2SBen Gras extern u_long linenum;
44*0a6a1f1dSLionel Sambuc extern size_t appendnum;
45f789fee2SBen Gras extern int aflag, eflag, nflag;
46*0a6a1f1dSLionel Sambuc extern const char *fname, *outfname;
47*0a6a1f1dSLionel Sambuc extern FILE *infile, *outfile;
48*0a6a1f1dSLionel Sambuc extern int rflags;	/* regex flags to use */
49f789fee2SBen Gras 
50f789fee2SBen Gras void	 cfclose(struct s_command *, struct s_command *);
51f789fee2SBen Gras void	 compile(void);
52f789fee2SBen Gras void	 cspace(SPACE *, const char *, size_t, enum e_spflag);
53*0a6a1f1dSLionel Sambuc char	*cu_fgets(char *, int, int *);
54f789fee2SBen Gras int	 mf_fgets(SPACE *, enum e_spflag);
55*0a6a1f1dSLionel Sambuc int	 lastline(void);
56f789fee2SBen Gras void	 process(void);
57*0a6a1f1dSLionel Sambuc void	 resetstate(void);
58f789fee2SBen Gras char	*strregerror(int, regex_t *);
59f789fee2SBen Gras void	*xmalloc(size_t);
60f789fee2SBen Gras void	*xrealloc(void *, size_t);
61*0a6a1f1dSLionel Sambuc void	*xcalloc(size_t, size_t);
62