/* $OpenXM: OpenXM/src/kan96xx/Kan/shell.c,v 1.2 2003/12/03 01:21:43 takayama Exp $ */ #include #include #include #include #include #include #include #include "datatype.h" #include "stackm.h" #include "extern.h" #include "extern2.h" #include #include "plugin.h" #include "kclass.h" #include #include "ox_pathfinder.h" static struct object KoxShell_test1(struct object ob); struct object KoxShell(struct object ob) { return KoxShell_test1(ob); } static struct object KoxShell_test1(struct object ob) { /* A simple shell. It does not implement a parser. */ struct object rob; char *cmd; char *arg1,*arg2; int i,n; rob = NullObject; cmd = NULL; arg1=NULL; arg2=NULL; if (ob.tag != Sarray) errorKan1("%s\n","KoxShell requires an array as an argument."); n = getoaSize(ob); for (i=0; i> or << which command-name path >>"); } return(rob); }else if (strcmp(cmd,"export")==0) { }else{ } return(rob); } /* Functions for ox_shell */ struct object KoxWhich(struct object cmdo,struct object patho) { struct object rob; char *sss; rob = NullObject; if (cmdo.tag != Sdollar) errorKan1("%s\n","KoxWhich(str-obj,str-obj)"); if (patho.tag == Sdollar) { sss=oxWhich(KopString(cmdo),KopString(patho)); if (sss != NULL) rob=KpoString(sss); else{ sss=getCommandPath(KopString(cmdo)); if (sss != NULL) rob=KpoString(sss); } }else{ sss=getCommandPath(KopString(cmdo)); if (sss != NULL) rob=KpoString(sss); } return(rob); }