/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#ifndef SH_INTERACTIVE
/*
* David Korn
* AT&T Labs
*
* Interface definitions for shell command language
*
*/
#include <ast.h>
#include <cdt.h>
#ifdef _SH_PRIVATE
# include "name.h"
#else
# include <nval.h>
#endif /* _SH_PRIVATE */
/* options */
typedef struct
{
unsigned long v[4];
}
#include <shcmd.h>
#ifndef SH_wait_f_defined
typedef int (*Shwait_f)(int, long, int);
# define SH_wait_f_defined
#endif
union Shnode_u;
#define SH_CFLAG 0
/*
* passed as flags to builtins in Nambltin_t struct when BLT_OPTIM is on
*/
/* The following type is used for error messages */
/* error messages */
extern const char e_defpath[];
extern const char e_found[];
extern const char e_nospace[];
extern const char e_format[];
extern const char e_number[];
extern const char e_restricted[];
extern const char e_recursive[];
extern char e_version[];
typedef struct sh_scope
{
int argc;
char **argv;
char *cmdname;
char *filename;
char *funname;
int lineno;
} Shscope_t;
/*
* Saves the state of the shell
*/
struct Shell_s
{
#ifdef _SH_PRIVATE
#endif /* _SH_PRIVATE */
};
/* flags for sh_parse */
/* symbolic values for sh_iogetiop */
#include <cmd.h>
/* symbolic value for sh_fdnotify */
#if defined(__EXPORT__) && defined(_DLL)
# ifdef _BLD_shell
# define extern __EXPORT__
# endif /* _BLD_shell */
#endif /* _DLL */
extern Dt_t *sh_bltin_tree(void);
extern void sh_subfork(void);
extern int sh_reinit(char*[]);
extern void sh_delay(double);
extern int sh_trap(const char*,int);
extern int sh_funscope(int,char*[],int(*)(void*),void*,int);
extern Sfio_t *sh_iogetiop(int,int);
extern int sh_run(int, char*[]);
extern char *sh_fmtq(const char*);
extern char *sh_fmtqf(const char*, int, int);
extern Sfdouble_t sh_strnum(const char*, char**, int);
extern int sh_access(const char*,int);
extern int sh_close(int);
extern int sh_chdir(const char*);
extern int sh_dup(int);
extern void sh_exit(int);
extern int sh_fchdir(int);
extern int sh_fcntl(int, int, ...);
extern Sfio_t *sh_fd2sfio(int);
extern int (*sh_fdnotify(int(*)(int,int)))(int,int);
extern Shell_t *sh_getinterp(void);
extern int sh_open(const char*, int, ...);
extern int sh_openmax(void);
extern Sfio_t *sh_pathopen(const char*);
extern int sh_pipe(int[]);
extern void *sh_waitnotify(Shwait_f);
extern Shscope_t *sh_getscope(int,int);
extern void sh_sigcheck(Shell_t*);
extern unsigned long sh_isoption(int);
extern unsigned long sh_onoption(int);
extern unsigned long sh_offoption(int);
extern int sh_waitsafe(void);
/*
* direct access to sh is obsolete, use sh_getinterp() instead
*/
#else
#endif
#ifdef _DLL
# undef extern
#endif /* _DLL */
#ifndef _SH_PRIVATE
# if _lib_lseek64
# else
# endif
#endif /* !_SH_PRIVATE */
#endif /* SH_INTERACTIVE */