mode.h revision d6b882a974afe4a3ab38793d5de10bae2e078d39
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _MODE_H
#define _MODE_H
/*
* UNIX shell
*/
#include <unistd.h>
#ifdef pdp11
typedef char BOOL;
#else
typedef short BOOL;
#endif
#define BYTESPERWORD (sizeof (char *))
#define ALIGNSIZ (sizeof (double))
#define NIL ((char *)0)
/*
* the following nonsense is required
* because casts turn an Lvalue
* into an Rvalue so two cheats
* are necessary, one for each context.
*/
#define Rcheat(a) ((int)(a))
/* address puns for storage allocation */
typedef union
{
char *_bytptr;
} address;
/* heap storage */
struct blk
{
};
/*
* largefile converson hack note.
* the shell uses the *fnxt and *fend pointers when
* parsing a script. However, it was also using the
* difference between them when doing lseeks. Because
* that doesn't work in the largefile world, I have
* added a parallel set of offset counters that need to
* be updated whenever the "buffer" offsets the shell
* uses get changed. Most of this code is in word.c.
* If you change it, have fun...
*/
#define BUFFERSIZE 128
struct fileblk
{
int fdes;
unsigned flin;
unsigned char fsiz;
unsigned char *fnxt;
unsigned char *fend;
unsigned char **feval;
unsigned char fbuf[BUFFERSIZE];
};
struct tempblk
{
int fdes;
};
/* for files not used with file descriptors */
struct filehdr
{
int fdes;
unsigned flin;
unsigned char fsiz;
unsigned char *fnxt;
unsigned char *fend;
unsigned char **feval;
unsigned char _fbuf[1];
};
struct sysnod
{
char *sysnam;
int sysval;
};
/* this node is a proforma for those that follow */
struct trenod
{
int tretyp;
};
/* dummy for access only */
struct argnod
{
unsigned char argval[1];
};
struct dolnod
{
int doluse;
unsigned char **dolarg;
};
struct forknod
{
int forktyp;
};
struct comnod
{
int comtyp;
};
struct fndnod
{
int fndtyp;
unsigned char *fndnam;
int fndref;
};
struct ifnod
{
int iftyp;
};
struct whnod
{
int whtyp;
};
struct fornod
{
int fortyp;
unsigned char *fornam;
};
struct swnod
{
int swtyp;
unsigned char *swarg;
};
struct regnod
{
};
struct parnod
{
int partyp;
};
struct lstnod
{
int lsttyp;
};
struct ionod
{
int iofile;
char *ioname;
char *iolink;
};
struct fdsave
{
int org_fd;
int dup_fd;
};
#endif /* _MODE_H */