84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore/*
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Copyright (c) 1992 Diomidis Spinellis.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Copyright (c) 1992, 1993
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * The Regents of the University of California. All rights reserved.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore *
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * This code is derived from software contributed to Berkeley by
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Diomidis Spinellis of Imperial College, University of London.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore *
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Redistribution and use in source and binary forms, with or without
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * modification, are permitted provided that the following conditions
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * are met:
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * 1. Redistributions of source code must retain the above copyright
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * notice, this list of conditions and the following disclaimer.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * 2. Redistributions in binary form must reproduce the above copyright
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * notice, this list of conditions and the following disclaimer in the
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * documentation and/or other materials provided with the distribution.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * 4. Neither the name of the University nor the names of its contributors
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * may be used to endorse or promote products derived from this software
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * without specific prior written permission.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore *
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * SUCH DAMAGE.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore#ifndef EXTERN_H
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore#define EXTERN_H
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern struct s_command *prog;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern struct s_appends *appends;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern regmatch_t *match;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern size_t maxnsub;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern ulong_t linenum;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern int appendnum;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern int aflag, eflag, nflag;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern const char *fname, *outfname;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern FILE *infile, *outfile;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreextern int rflags; /* regex flags to use */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amorevoid cfclose(struct s_command *, struct s_command *);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amorevoid compile(void);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amorevoid cspace(SPACE *, const char *, size_t, enum e_spflag);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amorechar *cu_fgets(char *, int, int *);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreint mf_fgets(SPACE *, enum e_spflag);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoreint lastline(void);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amorevoid process(void);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amorevoid resetstate(void);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amorechar *strregerror(int, regex_t *);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore/*PRINTFLIKE1*/
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amorevoid fatal(const char *, ...); /* output includes file and line # */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore#ifdef lint
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore#define _(s) s
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore#else
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore#define _(s) gettext(s)
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore#endif
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore#endif /* EXTERN_H */