llib-lshell revision da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * CDDL HEADER START
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * The contents of this file are subject to the terms of the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Common Development and Distribution License (the "License").
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * You may not use this file except in compliance with the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * or http://www.opensolaris.org/os/licensing.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * See the License for the specific language governing permissions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * and limitations under the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * When distributing Covered Code, include this CDDL HEADER in each
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * If applicable, add the following below this CDDL HEADER, with the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * fields enclosed by brackets "[]" replaced with your own identifying
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * information: Portions Copyright [yyyy] [name of copyright owner]
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * CDDL HEADER END
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Use is subject to license terms.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * lib/libshell/common/llib-lshell
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#pragma ident "%Z%%M% %I% %E% SMI"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*LINTLIBRARY*/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*PROTOLIB1*/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <shell.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <nval.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* automatically generated data start here */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_defpath[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_found[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_nospace[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_format[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_number[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_restricted[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const char e_recursive[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char e_version[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Dt_t *sh_bltin_tree (void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void sh_subfork (void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Shell_t *sh_init (int,char*[],Shinit_f);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_reinit (char*[]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_eval (Sfio_t*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void sh_delay (double);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void *sh_parse (Shell_t*, Sfio_t*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_trap (const char*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_fun (Namval_t*,Namval_t*, char*[]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_funscope (int,char*[],int(*)(void*),void*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Sfio_t *sh_iogetiop (int,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_main (int, char*[], void(*)(int));
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void sh_menu (Sfio_t*, int, char*[]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *sh_addbuiltin (const char*, int(*)(int, char*[],void*), void*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *sh_fmtq (const char*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *sh_fmtqf (const char*, int, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Sfdouble_t sh_strnum (const char*, char**, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_access (const char*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_close (int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_dup (int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void sh_exit (int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_fcntl (int, int, ...);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Sfio_t *sh_fd2sfio (int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Shell_t *sh_getinterp (void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_open (const char*, int, ...);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_openmax (void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Sfio_t *sh_pathopen (const char*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern ssize_t sh_read (int, void*, size_t);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern ssize_t sh_write (int, const void*, size_t);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern off_t sh_seek (int, off_t, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_pipe (int[]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern mode_t sh_umask (mode_t);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void *sh_waitnotify (Shwait_f);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Shscope_t *sh_getscope (int,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Shscope_t *sh_setscope (Shscope_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void sh_sigcheck (void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern unsigned long sh_isoption (int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern unsigned long sh_onoption (int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern unsigned long sh_offoption (int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_waitsafe (void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_exec (const Shnode_t*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_waitsafe(void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int sh_exec(const Shnode_t*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void **sh_getliblist(void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Shell_t sh;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namarr_t *nv_setarray (Namval_t*,void*(*)(Namval_t*,const char*,int));
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void *nv_associative (Namval_t*,const char*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int nv_aindex (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int nv_nextsub (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *nv_getsub (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *nv_putsub (Namval_t*, char*, long);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *nv_opensub (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int nv_adddisc (Namval_t*, const char**, Namval_t**);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int nv_clone (Namval_t*, Namval_t*, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void nv_close (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void *nv_context (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *nv_create (const char*, Dt_t*, int,Namfun_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Dt_t *nv_dict (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Sfdouble_t nv_getn (Namval_t*, Namfun_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Sfdouble_t nv_getnum (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *nv_getv (Namval_t*, Namfun_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *nv_getval (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namfun_t *nv_hasdisc (Namval_t*, const Namdisc_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int nv_isnull (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *nv_lastdict (void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void nv_newattr (Namval_t*,unsigned,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *nv_open (const char*,Dt_t*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void nv_putval (Namval_t*,const char*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void nv_putv (Namval_t*,const char*,int,Namfun_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int nv_scan (Dt_t*,void(*)(Namval_t*,void*),void*,int,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *nv_scoped (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *nv_setdisc (Namval_t*,const char*,Namval_t*,Namfun_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void nv_setref (Namval_t*, Dt_t*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int nv_settype (Namval_t*, Namval_t*, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void nv_setvec (Namval_t*,int,int,char*[]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void nv_setvtree (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int nv_setsize (Namval_t*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namfun_t *nv_disc (Namval_t*,Namfun_t*,int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void nv_unset (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *nv_search (const char *, Dt_t*, int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void nv_unscope (void);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *nv_name (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern Namval_t *nv_type (Namval_t*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const Namdisc_t *nv_discfun (int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* end of automatically generated data */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* Manually added based on libshell/common/include/builtins.h */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int b_printf(int, char*[],void*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int B_echo(int, char*[],void*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int b_print(int, char*[],void*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int b_pwd(int, char*[],void*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int b_sleep(int, char*[],void*);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int b_test(int, char*[],void*);