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

Diff for /OpenXM/src/kan96xx/Kan/kanExport0.c between version 1.43 and 1.48

version 1.43, 2005/06/16 05:07:23 version 1.48, 2012/09/16 01:53:08
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport0.c,v 1.42 2005/06/09 05:46:57 takayama Exp $  */  /* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport0.c,v 1.47 2006/12/21 05:29:49 takayama Exp $  */
 #include <stdio.h>  #include <stdio.h>
   #include <stdlib.h>
   #include <string.h>
 #include "datatype.h"  #include "datatype.h"
 #include "stackm.h"  #include "stackm.h"
 #include "extern.h"  #include "extern.h"
Line 938  struct object KdataConversion(obj,key)
Line 940  struct object KdataConversion(obj,key)
       rob = newObjectArray(0);        rob = newObjectArray(0);
       return rob;        return rob;
     }else{      }else{
         /* fprintf(stderr,"key=%s\n",key); */
       warningKan("Sorry. The data conversion from null to this data type has not supported yet.\n");        warningKan("Sorry. The data conversion from null to this data type has not supported yet.\n");
     }      }
     break;      break;
Line 1657  int KsetUpRing(ob1,ob2,ob3,ob4,ob5)
Line 1660  int KsetUpRing(ob1,ob2,ob3,ob4,ob5)
   newRingp->cc = cc;    newRingp->cc = cc;
   newRingp->x = xvars;    newRingp->x = xvars;
   newRingp->D = dvars;    newRingp->D = dvars;
     newRingp->Dsmall = makeDsmall(dvars,n);
   /* You don't need to set order and orderMatrixSize here.    /* You don't need to set order and orderMatrixSize here.
      It was set by setOrder(). */       It was set by setOrder(). */
   setFromTo(newRingp);    setFromTo(newRingp);
Line 2267  struct object KstringToArgv(struct object ob) {
Line 2271  struct object KstringToArgv(struct object ob) {
   return(rob);    return(rob);
 }  }
   
   struct object KstringToArgv2(struct object ob,struct object oseparator) {
     struct object rob = OINIT;
     char *s;
     int n,wc,i,inblank;
     char **argv;
     int separator;
     if (ob.tag != Sdollar)
       errorKan1("%s\n","KstringToArgv2(): the argument must be a string.");
     if (oseparator.tag == Sinteger) {
           separator = KopInteger(oseparator);
     }else if (oseparator.tag == Sdollar) {
           s = KopString(oseparator);
           separator=s[0];
     }else {
       errorKan1("%s\n","KstringToArgv2(ob,separator):the argument must be strings.");
     }
     n = strlen(KopString(ob));
     s = (char *) sGC_malloc(sizeof(char)*(n+2));
     if (s == NULL) errorKan1("%s\n","KstringToArgv(): No memory.");
     strcpy(s,KopString(ob));
     inblank = 1;  wc = 0;
     for (i=0; i<n; i++) {
       if (inblank && (s[i] != separator)) {
         wc++; inblank = 0;
       }else if ((!inblank) && (s[i] == separator)) {
         inblank = 1;
       }
     }
     argv = (char **) sGC_malloc(sizeof(char *)*(wc+2));
     argv[0] = NULL;
     inblank = 1;  wc = 0;
     for (i=0; i<n; i++) {
       if (inblank && (s[i] != separator)) {
         argv[wc] = &(s[i]); argv[wc+1]=NULL;
         wc++; inblank = 0;
       }else if ((inblank == 0) && (s[i] == separator)) {
         inblank = 1; s[i] = 0;
       }else if (inblank && (s[i] == separator)) {
         s[i] = 0;
       }
     }
   
     rob = newObjectArray(wc);
     for (i=0; i<wc; i++) {
       putoa(rob,i,KpoString(argv[i]));
       /* printf("%s\n",argv[i]); */
     }
     return(rob);
   }
   
 static void checkDuplicateName(xvars,dvars,n)  static void checkDuplicateName(xvars,dvars,n)
      char *xvars[];       char *xvars[];
      char *dvars[];       char *dvars[];
Line 3184  struct object KgetAttributeList(struct object ob){
Line 3238  struct object KgetAttributeList(struct object ob){
   else rob = NullObject;    else rob = NullObject;
   return rob;    return rob;
 }  }
 struct object  KputAttributeList(struct object ob,struct object attr) {  struct object  KsetAttributeList(struct object ob,struct object attr) {
   ob.attr = newObject();    ob.attr = newObject();
   *(ob.attr) = attr;    *(ob.attr) = attr;
   return ob;    return ob;
Line 3213  struct object KgetAttribute(struct object ob,struct ob
Line 3267  struct object KgetAttribute(struct object ob,struct ob
   }    }
   return rob;    return rob;
 }  }
 /*  ob (key) (value) putAttribute /ob set. They are not destructive. */  /*  ob (key) (value) setAttribute /ob set. They are not destructive. */
 struct object KputAttribute(struct object ob,struct object key,struct object value) {  struct object KsetAttribute(struct object ob,struct object key,struct object value) {
   struct object rob = OINIT;    struct object rob = OINIT;
   struct object alist = OINIT;    struct object alist = OINIT;
   int n,i;    int n,i;

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.48

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