redir.h revision 90111
1166255Sdelphij/*- 2166255Sdelphij * Copyright (c) 1991, 1993 3222210Sdelphij * The Regents of the University of California. All rights reserved. 4222210Sdelphij * 5166255Sdelphij * This code is derived from software contributed to Berkeley by 6166255Sdelphij * Kenneth Almquist. 7166255Sdelphij * 8166255Sdelphij * Redistribution and use in source and binary forms, with or without 9222210Sdelphij * modification, are permitted provided that the following conditions 10166255Sdelphij * are met: 11166255Sdelphij * 1. Redistributions of source code must retain the above copyright 12166255Sdelphij * notice, this list of conditions and the following disclaimer. 13166255Sdelphij * 2. Redistributions in binary form must reproduce the above copyright 14166255Sdelphij * notice, this list of conditions and the following disclaimer in the 15166255Sdelphij * documentation and/or other materials provided with the distribution. 16166255Sdelphij * 3. All advertising materials mentioning features or use of this software 17166255Sdelphij * must display the following acknowledgement: 18166255Sdelphij * This product includes software developed by the University of 19166255Sdelphij * California, Berkeley and its contributors. 20166255Sdelphij * 4. Neither the name of the University nor the names of its contributors 21166255Sdelphij * may be used to endorse or promote products derived from this software 22166255Sdelphij * without specific prior written permission. 23166255Sdelphij * 24166255Sdelphij * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25166255Sdelphij * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26166255Sdelphij * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27166255Sdelphij * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28166255Sdelphij * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29166255Sdelphij * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30166255Sdelphij * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31166255Sdelphij * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32166255Sdelphij * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33166255Sdelphij * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34166255Sdelphij * SUCH DAMAGE. 35166255Sdelphij * 36222210Sdelphij * @(#)redir.h 8.2 (Berkeley) 5/4/95 37166255Sdelphij * $FreeBSD: head/bin/sh/redir.h 90111 2002-02-02 06:50:57Z imp $ 38222210Sdelphij */ 39222210Sdelphij 40222210Sdelphij/* flags passed to redirect */ 41222210Sdelphij#define REDIR_PUSH 01 /* save previous values of file descriptors */ 42222210Sdelphij#define REDIR_BACKQ 02 /* save the command output in memory */ 43222210Sdelphij 44222210Sdelphijunion node; 45222210Sdelphijvoid redirect(union node *, int); 46222210Sdelphijvoid popredir(void); 47222210Sdelphijint fd0_redirected_p(void); 48222210Sdelphijvoid clearredir(void); 49222210Sdelphijint copyfd(int, int); 50222210Sdelphij 51222210Sdelphij