/**-- os-like / shell-like commands for pfe Copyright (C) Tektronix, Inc. 1998 - 2001. All rights reserved. @see GNU LGPL @author Tektronix CTE @(#) %derived_by: guidod % @version %version: bln_mpt1!5.27 % (%date_modified: Mon Apr 08 18:28:49 2002 %) */ /* @description These builtin words are modelled after common shell commands, so that the Portable Forth Environment can often be put in the place of a normal OS shell. @{ */ #if defined(__version_control__) && defined(__GNUC__)static char * id __attribute__((unused)) = "@(#) $Id: %full_filespec: shell-os-ext.c~bln_mpt1!5.27:csrc:bln_12xx!1 % $" #endif #define _P4_SOURCE 1 #include <pfe/pfe-base.h> #include <pfe/def-xtra.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include <fcntl.h> #include <errno.h> #ifdef PFE_HAVE_IO_H #include <io.h> #endif #ifdef PFE_HAVE_UNISTD_H #include <unistd.h> #endif /*; FIXME: remove this with a proper pfe-config.h define */ #if defined PFE_HAVE_IO_H && ! defined PFE_HAVE_UNISTD_H #define PFE_HAVE_DIRECT_H #endif #if defined PFE_HAVE_DIRECT_H #include <direct.h> /*getcwd, mkdir */ #endif #if defined NO_SYSTEM && defined PFE_HAVE_DIRENT_H #include <dirent.h> #include <sys/stat.h> #endif #ifdef PFE_HAVE_VXWORKS_H #include <ioLib.h> /*chdir */ #endif #include <pfe/def-comp.h> #include <pfe/file-sub.h> #include <pfe/_nonansi.h> #include <pfe/_missing.h> #if defined VxWorks #include <taskLib.h>extern char* getwd ( char* pathname ) ; extern STATUS cd (const char*) #endif #include <pfe/logging.h>; typedef int (*syscall_f)( const char* ) ;
/* |
/**
|
/**
|
/**
|
/**
|
/**
|
/**
|
/**
|
/**
|
/**
|
/* |
static char * p4_word_comma (char del)
|
static void do_one (char *p, int (*syscall) (const char *))
|
static void do_two (char *p1, char *p2, int (*syscall) (const char *, const char *))
|
/* |
static int md (const char *s)
|
static int touch (const char *s)
|
static int cp (const char *src, const char *dst)
|
static int ls (const char *p)
|
static int ll (const char *p)
|
static int ls (const char* p)
|
static int ll (const char* p)
|
static int mv (const char *p1, const char* p2)
|
/*
|
P4_LISTWORDS (shell) =
|
/* |