1N/A
1N/A/* : : generated by proto : : */
1N/A/***********************************************************************
1N/A* *
1N/A* This software is part of the ast package *
1N/A* Copyright (c) 1985-2011 AT&T Intellectual Property *
1N/A* and is licensed under the *
1N/A* Common Public License, Version 1.0 *
1N/A* by AT&T Intellectual Property *
1N/A* *
1N/A* A copy of the License is available at *
1N/A* http://www.opensource.org/licenses/cpl1.0.txt *
1N/A* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
1N/A* *
1N/A* Information and Software Systems Research *
1N/A* AT&T Research *
1N/A* Florham Park NJ *
1N/A* *
1N/A* Glenn Fowler <gsf@research.att.com> *
1N/A* David Korn <dgk@research.att.com> *
1N/A* Phong Vo <kpv@research.att.com> *
1N/A* *
1N/A***********************************************************************/
1N/A
1N/A
1N/A/*
1N/A * ksh builtin command api
1N/A */
1N/A
1N/A#ifndef _SHCMD_H
1N/A#if !defined(__PROTO__)
1N/A#include <prototyped.h>
1N/A#endif
1N/A#if !defined(__LINKAGE__)
1N/A#define __LINKAGE__ /* 2004-08-11 transition */
1N/A#endif
1N/A
1N/A#define _SHCMD_H 1
1N/A
1N/A#define SH_PLUGIN_VERSION AST_PLUGIN_VERSION(20100528L)
1N/A
1N/A#if __STDC__
1N/A#define SHLIB(m) unsigned long plugin_version(void) { return SH_PLUGIN_VERSION; }
1N/A#else
1N/A#define SHLIB(m) unsigned long plugin_version() { return SH_PLUGIN_VERSION; }
1N/A#endif
1N/A
1N/A#ifndef SH_VERSION
1N/A# define Shell_t void
1N/A#endif
1N/A#ifndef NV_DEFAULT
1N/A# define Namval_t void
1N/A#endif
1N/A#ifndef ERROR_NOTIFY
1N/A# define ERROR_NOTIFY 1
1N/A#endif
1N/A
1N/Atypedef int (*Shbltin_f) __PROTO__((int, char**, __V_*));
1N/A
1N/A#undef Shbltin_t
1N/Atypedef struct Shbltin_s
1N/A{
1N/A Shell_t *shp;
1N/A __V_ *ptr;
1N/A int version;
1N/A int (*shrun) __PROTO__((int, char**));
1N/A int (*shtrap) __PROTO__((const char*, int));
1N/A void (*shexit) __PROTO__((int));
1N/A Namval_t *(*shbltin) __PROTO__((const char*, Shbltin_f, __V_*));
1N/A unsigned char notify;
1N/A unsigned char sigset;
1N/A unsigned char nosfio;
1N/A Namval_t *bnode;
1N/A Namval_t *vnode;
1N/A char *data;
1N/A int flags;
1N/A char *(*shgetenv) __PROTO__((const char*));
1N/A char *(*shsetenv) __PROTO__((const char*));
1N/A int invariant;
1N/A} Shbltin_t;
1N/A
1N/A#if defined(SH_VERSION) || defined(_SH_PRIVATE)
1N/A# undef Shell_t
1N/A# undef Namval_t
1N/A#else
1N/A# define sh_context(c) ((Shbltin_t*)(c))
1N/A# define sh_run(c, ac, av) ((c)?(*sh_context(c)->shrun)(ac,av):-1)
1N/A# define sh_system(c,str) ((c)?(*sh_context(c)->shtrap)(str,0):system(str))
1N/A# define sh_exit(c,n) ((c)?(*sh_context(c)->shexit)(n):exit(n))
1N/A# define sh_checksig(c) ((c) && sh_context(c)->sigset)
1N/A# define sh_builtin(c,n,f,p) ((c)?(*sh_context(c)->shbltin)(n,(Shbltin_f)(f),(__V_*)(p)):0)
1N/A# if defined(SFIO_VERSION) || defined(_AST_H)
1N/A# define LIB_INIT(c)
1N/A# else
1N/A# define LIB_INIT(c) ((c) && (sh_context(c)->nosfio = 1))
1N/A# endif
1N/A# ifndef _CMD_H
1N/A# define cmdinit(ac,av,c,cat,flg) do { if((ac)<=0) return(0); \
1N/A (sh_context(c)->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
1N/A# endif
1N/A#endif
1N/A
1N/A#if _BLD_ast && defined(__EXPORT__)
1N/A#undef __MANGLE__
1N/A#define __MANGLE__ __LINKAGE__ __EXPORT__
1N/A#endif
1N/A
1N/Aextern __MANGLE__ int astintercept __PROTO__((Shbltin_t*, int));
1N/A
1N/A#undef __MANGLE__
1N/A#define __MANGLE__ __LINKAGE__
1N/A
1N/A#endif