[BACK]Return to shell.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Diff for /OpenXM/src/kan96xx/Kan/shell.c between version 1.1 and 1.2

version 1.1, 2003/11/24 12:38:17 version 1.2, 2003/12/03 01:21:43
Line 1 
Line 1 
 /* $OpenXM$ */  /* $OpenXM: OpenXM/src/kan96xx/Kan/shell.c,v 1.1 2003/11/24 12:38:17 takayama Exp $ */
 #include <stdio.h>  #include <stdio.h>
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/stat.h>  #include <sys/stat.h>
Line 16 
Line 16 
 #include <ctype.h>  #include <ctype.h>
 #include "ox_pathfinder.h"  #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<n; i++) {
           if (getoa(ob,i).tag != Sdollar) errorKan1("%s\n","KoxShell requires an array of string as an argument.");
     }
   
     if (n == 0) return(rob);
     cmd = KopString(getoa(ob,0));
     if (strcmp(cmd,"which")==0) {
           if (n == 2) {
             rob = KoxWhich(getoa(ob,1),KpoInteger(0));
           }else if (n==3) {
             rob = KoxWhich(getoa(ob,1),getoa(ob,2));
           }else{
             errorKan1("%s\n","shell: << which command-name >> or << which command-name path >>");
           }
           return(rob);
     }else if (strcmp(cmd,"export")==0) {
     }else{
     }
     return(rob);
   }
   
 /* Functions for ox_shell */  /* Functions for ox_shell */
 struct object KoxWhich(struct object cmdo,struct object patho) {  struct object KoxWhich(struct object cmdo,struct object patho) {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>