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