00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #define _MULTIFLD_SOURCE_
00029
00030 #include <stdio.h>
00031 #define _STDIO_INCLUDED_
00032
00033 #include "setup.h"
00034
00035 #include "constant.h"
00036 #include "memalloc.h"
00037 #include "envrnmnt.h"
00038 #include "evaluatn.h"
00039 #include "scanner.h"
00040 #include "router.h"
00041 #include "strngrtr.h"
00042 #include "utility.h"
00043 #if OBJECT_SYSTEM
00044 #include "object.h"
00045 #endif
00046
00047 #include "multifld.h"
00048
00049
00050
00051
00052
00053 static void DeallocateMultifieldData(void *);
00054
00055
00056
00057
00058
00059 globle void InitializeMultifieldData(
00060 void *theEnv)
00061 {
00062 AllocateEnvironmentData(theEnv,MULTIFIELD_DATA,sizeof(struct multifieldData),DeallocateMultifieldData);
00063 }
00064
00065
00066
00067
00068
00069 static void DeallocateMultifieldData(
00070 void *theEnv)
00071 {
00072 struct multifield *tmpPtr, *nextPtr;
00073
00074 tmpPtr = MultifieldData(theEnv)->ListOfMultifields;
00075 while (tmpPtr != NULL)
00076 {
00077 nextPtr = tmpPtr->next;
00078 ReturnMultifield(theEnv,tmpPtr);
00079 tmpPtr = nextPtr;
00080 }
00081 }
00082
00083
00084
00085
00086 globle void *CreateMultifield2(
00087 void *theEnv,
00088 long size)
00089 {
00090 struct multifield *theSegment;
00091 long newSize = size;
00092
00093 if (size <= 0) newSize = 1;
00094
00095 theSegment = get_var_struct(theEnv,multifield,(long) sizeof(struct field) * (newSize - 1L));
00096
00097 theSegment->multifieldLength = size;
00098 theSegment->depth = (short) EvaluationData(theEnv)->CurrentEvaluationDepth;
00099 theSegment->busyCount = 0;
00100 theSegment->next = NULL;
00101
00102 return((void *) theSegment);
00103 }
00104
00105
00106
00107
00108 globle void ReturnMultifield(
00109 void *theEnv,
00110 struct multifield *theSegment)
00111 {
00112 unsigned long newSize;
00113
00114 if (theSegment == NULL) return;
00115
00116 if (theSegment->multifieldLength == 0) newSize = 1;
00117 else newSize = theSegment->multifieldLength;
00118
00119 rtn_var_struct(theEnv,multifield,sizeof(struct field) * (newSize - 1),theSegment);
00120 }
00121
00122
00123
00124
00125 globle void MultifieldInstall(
00126 void *theEnv,
00127 struct multifield *theSegment)
00128 {
00129 unsigned long length, i;
00130 struct field *theFields;
00131
00132 if (theSegment == NULL) return;
00133
00134 length = theSegment->multifieldLength;
00135
00136 theSegment->busyCount++;
00137 theFields = theSegment->theFields;
00138
00139 for (i = 0 ; i < length ; i++)
00140 { AtomInstall(theEnv,theFields[i].type,theFields[i].value); }
00141 }
00142
00143
00144
00145
00146 globle void MultifieldDeinstall(
00147 void *theEnv,
00148 struct multifield *theSegment)
00149 {
00150 unsigned long length, i;
00151 struct field *theFields;
00152
00153 if (theSegment == NULL) return;
00154
00155 length = theSegment->multifieldLength;
00156 theSegment->busyCount--;
00157 theFields = theSegment->theFields;
00158
00159 for (i = 0 ; i < length ; i++)
00160 { AtomDeinstall(theEnv,theFields[i].type,theFields[i].value); }
00161 }
00162
00163
00164
00165
00166
00167 globle struct multifield *StringToMultifield(
00168 void *theEnv,
00169 char *theString)
00170 {
00171 struct token theToken;
00172 struct multifield *theSegment;
00173 struct field *theFields;
00174 unsigned long numberOfFields = 0;
00175 struct expr *topAtom = NULL, *lastAtom = NULL, *theAtom;
00176
00177
00178
00179
00180
00181
00182 OpenStringSource(theEnv,"multifield-str",theString,0);
00183
00184 GetToken(theEnv,"multifield-str",&theToken);
00185 while (theToken.type != STOP)
00186 {
00187 if ((theToken.type == SYMBOL) || (theToken.type == STRING) ||
00188 (theToken.type == FLOAT) || (theToken.type == INTEGER) ||
00189 (theToken.type == INSTANCE_NAME))
00190 { theAtom = GenConstant(theEnv,theToken.type,theToken.value); }
00191 else
00192 { theAtom = GenConstant(theEnv,STRING,EnvAddSymbol(theEnv,theToken.printForm)); }
00193
00194 numberOfFields++;
00195 if (topAtom == NULL) topAtom = theAtom;
00196 else lastAtom->nextArg = theAtom;
00197
00198 lastAtom = theAtom;
00199 GetToken(theEnv,"multifield-str",&theToken);
00200 }
00201
00202 CloseStringSource(theEnv,"multifield-str");
00203
00204
00205
00206
00207
00208 theSegment = (struct multifield *) EnvCreateMultifield(theEnv,numberOfFields);
00209 theFields = theSegment->theFields;
00210
00211
00212
00213
00214
00215 theAtom = topAtom;
00216 numberOfFields = 0;
00217 while (theAtom != NULL)
00218 {
00219 theFields[numberOfFields].type = theAtom->type;
00220 theFields[numberOfFields].value = theAtom->value;
00221 numberOfFields++;
00222 theAtom = theAtom->nextArg;
00223 }
00224
00225
00226
00227
00228
00229 ReturnExpression(theEnv,topAtom);
00230
00231
00232
00233
00234
00235 return(theSegment);
00236 }
00237
00238
00239
00240
00241
00242 globle void *EnvCreateMultifield(
00243 void *theEnv,
00244 long size)
00245 {
00246 struct multifield *theSegment;
00247 long newSize;
00248
00249 if (size <= 0) newSize = 1;
00250 else newSize = size;
00251
00252 theSegment = get_var_struct(theEnv,multifield,(long) sizeof(struct field) * (newSize - 1L));
00253
00254 theSegment->multifieldLength = size;
00255 theSegment->depth = (short) EvaluationData(theEnv)->CurrentEvaluationDepth;
00256 theSegment->busyCount = 0;
00257 theSegment->next = NULL;
00258
00259 theSegment->next = MultifieldData(theEnv)->ListOfMultifields;
00260 MultifieldData(theEnv)->ListOfMultifields = theSegment;
00261
00262 UtilityData(theEnv)->EphemeralItemCount++;
00263 UtilityData(theEnv)->EphemeralItemSize += sizeof(struct multifield) + (sizeof(struct field) * newSize);
00264
00265 return((void *) theSegment);
00266 }
00267
00268
00269
00270
00271 globle void *DOToMultifield(
00272 void *theEnv,
00273 DATA_OBJECT *theValue)
00274 {
00275 struct multifield *dst, *src;
00276
00277 if (theValue->type != MULTIFIELD) return(NULL);
00278
00279 dst = (struct multifield *) CreateMultifield2(theEnv,(unsigned long) GetpDOLength(theValue));
00280
00281 src = (struct multifield *) theValue->value;
00282 GenCopyMemory(struct field,dst->multifieldLength,
00283 &(dst->theFields[0]),&(src->theFields[GetpDOBegin(theValue) - 1]));
00284
00285 return((void *) dst);
00286 }
00287
00288
00289
00290
00291 globle void AddToMultifieldList(
00292 void *theEnv,
00293 struct multifield *theSegment)
00294 {
00295 theSegment->depth = (short) EvaluationData(theEnv)->CurrentEvaluationDepth;
00296 theSegment->next = MultifieldData(theEnv)->ListOfMultifields;
00297 MultifieldData(theEnv)->ListOfMultifields = theSegment;
00298
00299 UtilityData(theEnv)->EphemeralItemCount++;
00300 UtilityData(theEnv)->EphemeralItemSize += sizeof(struct multifield) + (sizeof(struct field) * theSegment->multifieldLength);
00301 }
00302
00303
00304
00305
00306 globle void FlushMultifields(
00307 void *theEnv)
00308 {
00309 struct multifield *theSegment, *nextPtr, *lastPtr = NULL;
00310 unsigned long newSize;
00311
00312 theSegment = MultifieldData(theEnv)->ListOfMultifields;
00313 while (theSegment != NULL)
00314 {
00315 nextPtr = theSegment->next;
00316 if ((theSegment->depth > EvaluationData(theEnv)->CurrentEvaluationDepth) && (theSegment->busyCount == 0))
00317 {
00318 UtilityData(theEnv)->EphemeralItemCount--;
00319 UtilityData(theEnv)->EphemeralItemSize -= sizeof(struct multifield) +
00320 (sizeof(struct field) * theSegment->multifieldLength);
00321 if (theSegment->multifieldLength == 0) newSize = 1;
00322 else newSize = theSegment->multifieldLength;
00323 rtn_var_struct(theEnv,multifield,sizeof(struct field) * (newSize - 1),theSegment);
00324 if (lastPtr == NULL) MultifieldData(theEnv)->ListOfMultifields = nextPtr;
00325 else lastPtr->next = nextPtr;
00326 }
00327 else
00328 { lastPtr = theSegment; }
00329
00330 theSegment = nextPtr;
00331 }
00332 }
00333
00334
00335
00336
00337
00338 globle void DuplicateMultifield(
00339 void *theEnv,
00340 DATA_OBJECT_PTR dst,
00341 DATA_OBJECT_PTR src)
00342 {
00343 dst->type = MULTIFIELD;
00344 dst->begin = 0;
00345 dst->end = src->end - src->begin;
00346 dst->value = (void *) CreateMultifield2(theEnv,(unsigned long) dst->end + 1);
00347 GenCopyMemory(struct field,dst->end + 1,&((struct multifield *) dst->value)->theFields[0],
00348 &((struct multifield *) src->value)->theFields[src->begin]);
00349 }
00350
00351
00352
00353
00354 globle void *CopyMultifield(
00355 void *theEnv,
00356 struct multifield *src)
00357 {
00358 struct multifield *dst;
00359
00360 dst = (struct multifield *) CreateMultifield2(theEnv,src->multifieldLength);
00361 GenCopyMemory(struct field,src->multifieldLength,&(dst->theFields[0]),&(src->theFields[0]));
00362 return((void *) dst);
00363 }
00364
00365
00366
00367
00368 globle void PrintMultifield(
00369 void *theEnv,
00370 char *fileid,
00371 struct multifield *segment,
00372 long begin,
00373 long end,
00374 int printParens)
00375 {
00376 struct field *theMultifield;
00377 int i;
00378
00379 theMultifield = segment->theFields;
00380 if (printParens)
00381 EnvPrintRouter(theEnv,fileid,"(");
00382 i = begin;
00383 while (i <= end)
00384 {
00385 PrintAtom(theEnv,fileid,theMultifield[i].type,theMultifield[i].value);
00386 i++;
00387 if (i <= end) EnvPrintRouter(theEnv,fileid," ");
00388 }
00389 if (printParens)
00390 EnvPrintRouter(theEnv,fileid,")");
00391 }
00392
00393
00394
00395
00396 globle void StoreInMultifield(
00397 void *theEnv,
00398 DATA_OBJECT *returnValue,
00399 EXPRESSION *expptr,
00400 int garbageSegment)
00401 {
00402 DATA_OBJECT val_ptr;
00403 DATA_OBJECT *val_arr;
00404 struct multifield *theMultifield;
00405 struct multifield *orig_ptr;
00406 long start, end, i,j, k, argCount;
00407 unsigned long seg_size;
00408
00409 argCount = CountArguments(expptr);
00410
00411
00412
00413
00414
00415
00416 if (argCount == 0)
00417 {
00418 SetpType(returnValue,MULTIFIELD);
00419 SetpDOBegin(returnValue,1);
00420 SetpDOEnd(returnValue,0);
00421 if (garbageSegment) theMultifield = (struct multifield *) EnvCreateMultifield(theEnv,0L);
00422 else theMultifield = (struct multifield *) CreateMultifield2(theEnv,0L);
00423 SetpValue(returnValue,(void *) theMultifield);
00424 return;
00425 }
00426
00427 else
00428 {
00429
00430
00431
00432
00433
00434 val_arr = (DATA_OBJECT *) gm3(theEnv,(long) sizeof(DATA_OBJECT) * argCount);
00435 seg_size = 0;
00436 for(i = 1 ; i <= argCount ; i++ , expptr = expptr->nextArg)
00437 {
00438 EvaluateExpression(theEnv,expptr,&val_ptr);
00439 if (EvaluationData(theEnv)->EvaluationError)
00440 {
00441 SetpType(returnValue,MULTIFIELD);
00442 SetpDOBegin(returnValue,1);
00443 SetpDOEnd(returnValue,0);
00444 if (garbageSegment)
00445 { theMultifield = (struct multifield *) EnvCreateMultifield(theEnv,0L); }
00446 else theMultifield = (struct multifield *) CreateMultifield2(theEnv,0L);
00447 SetpValue(returnValue,(void *) theMultifield);
00448 rm3(theEnv,val_arr,(long) sizeof(DATA_OBJECT) * argCount);
00449 return;
00450 }
00451 SetpType(val_arr+i-1,GetType(val_ptr));
00452 if (GetType(val_ptr) == MULTIFIELD)
00453 {
00454 SetpValue(val_arr+i-1,GetpValue(&val_ptr));
00455 start = GetDOBegin(val_ptr);
00456 end = GetDOEnd(val_ptr);
00457 }
00458 else if (GetType(val_ptr) == RVOID)
00459 {
00460 SetpValue(val_arr+i-1,GetValue(val_ptr));
00461 start = 1;
00462 end = 0;
00463 }
00464 else
00465 {
00466 SetpValue(val_arr+i-1,GetValue(val_ptr));
00467 start = end = -1;
00468 }
00469
00470 seg_size += (unsigned long) (end - start + 1);
00471 SetpDOBegin(val_arr+i-1,start);
00472 SetpDOEnd(val_arr+i-1,end);
00473 }
00474
00475 if (garbageSegment)
00476 { theMultifield = (struct multifield *) EnvCreateMultifield(theEnv,seg_size); }
00477 else theMultifield = (struct multifield *) CreateMultifield2(theEnv,seg_size);
00478
00479
00480
00481
00482
00483 for(k=0,j=1; k < argCount;k++)
00484 {
00485 if (GetpType(val_arr+k) == MULTIFIELD)
00486 {
00487 start = GetpDOBegin(val_arr+k);
00488 end = GetpDOEnd(val_arr+k);
00489 orig_ptr = (struct multifield *) GetpValue(val_arr+k);
00490 for(i=start; i< end + 1; i++,j++)
00491 {
00492 SetMFType(theMultifield,j,(GetMFType(orig_ptr,i)));
00493 SetMFValue(theMultifield,j,(GetMFValue(orig_ptr,i)));
00494 }
00495 }
00496 else if (GetpType(val_arr+k) != MULTIFIELD)
00497 {
00498 SetMFType(theMultifield,j,(short) (GetpType(val_arr+k)));
00499 SetMFValue(theMultifield,j,(GetpValue(val_arr+k)));
00500 j++;
00501 }
00502 }
00503
00504
00505
00506
00507
00508 SetpType(returnValue,MULTIFIELD);
00509 SetpDOBegin(returnValue,1);
00510 SetpDOEnd(returnValue,(long) seg_size);
00511 SetpValue(returnValue,(void *) theMultifield);
00512 rm3(theEnv,val_arr,(long) sizeof(DATA_OBJECT) * argCount);
00513 return;
00514 }
00515 }
00516
00517
00518
00519
00520 globle intBool MultifieldDOsEqual(
00521 DATA_OBJECT_PTR dobj1,
00522 DATA_OBJECT_PTR dobj2)
00523 {
00524 long extent1,extent2;
00525 FIELD_PTR e1,e2;
00526
00527 extent1 = GetpDOLength(dobj1);
00528 extent2 = GetpDOLength(dobj2);
00529 if (extent1 != extent2)
00530 { return(FALSE); }
00531
00532 e1 = (FIELD_PTR) GetMFPtr(GetpValue(dobj1),GetpDOBegin(dobj1));
00533 e2 = (FIELD_PTR) GetMFPtr(GetpValue(dobj2),GetpDOBegin(dobj2));
00534 while (extent1 != 0)
00535 {
00536 if (e1->type != e2->type)
00537 { return(FALSE); }
00538
00539 if (e1->value != e2->value)
00540 { return(FALSE); }
00541
00542 extent1--;
00543
00544 if (extent1 > 0)
00545 {
00546 e1++;
00547 e2++;
00548 }
00549 }
00550 return(TRUE);
00551 }
00552
00553
00554
00555
00556 globle int MultifieldsEqual(
00557 struct multifield *segment1,
00558 struct multifield *segment2)
00559 {
00560 struct field *elem1;
00561 struct field *elem2;
00562 long length, i = 0;
00563
00564 length = segment1->multifieldLength;
00565 if (length != segment2->multifieldLength)
00566 { return(FALSE); }
00567
00568 elem1 = segment1->theFields;
00569 elem2 = segment2->theFields;
00570
00571
00572
00573
00574
00575
00576 while (i < length)
00577 {
00578 if (elem1[i].type != elem2[i].type)
00579 { return(FALSE); }
00580
00581 if (elem1[i].type == MULTIFIELD)
00582 {
00583 if (MultifieldsEqual((struct multifield *) elem1[i].value,
00584 (struct multifield *) elem2[i].value) == FALSE)
00585 { return(FALSE); }
00586 }
00587 else if (elem1[i].value != elem2[i].value)
00588 { return(FALSE); }
00589
00590 i++;
00591 }
00592 return(TRUE);
00593 }
00594
00595
00596
00597
00598 globle unsigned long HashMultifield(
00599 struct multifield *theSegment,
00600 unsigned long theRange)
00601 {
00602 unsigned long length, i;
00603 unsigned long tvalue;
00604 unsigned long count;
00605 struct field *fieldPtr;
00606 union
00607 {
00608 double fv;
00609 void *vv;
00610 unsigned long liv;
00611 } fis;
00612
00613
00614
00615
00616
00617 count = 0;
00618 length = theSegment->multifieldLength;
00619 fieldPtr = theSegment->theFields;
00620
00621
00622
00623
00624
00625
00626 for (i = 0;
00627 i < length;
00628 i++)
00629 {
00630 switch(fieldPtr[i].type)
00631 {
00632 case MULTIFIELD:
00633 count += HashMultifield((struct multifield *) fieldPtr[i].value,theRange);
00634 break;
00635
00636 case FLOAT:
00637 fis.liv = 0;
00638 fis.fv = ValueToDouble(fieldPtr[i].value);
00639 count += (fis.liv * (i + 29)) +
00640 (unsigned long) ValueToDouble(fieldPtr[i].value);
00641 break;
00642
00643 case INTEGER:
00644 count += (((unsigned long) ValueToLong(fieldPtr[i].value)) * (i + 29)) +
00645 ((unsigned long) ValueToLong(fieldPtr[i].value));
00646 break;
00647
00648 case FACT_ADDRESS:
00649 #if OBJECT_SYSTEM
00650 case INSTANCE_ADDRESS:
00651 #endif
00652 fis.liv = 0;
00653 fis.vv = fieldPtr[i].value;
00654 count += (unsigned long) (fis.liv * (i + 29));
00655 break;
00656
00657 case EXTERNAL_ADDRESS:
00658 fis.liv = 0;
00659 fis.vv = ValueToExternalAddress(fieldPtr[i].value);
00660 count += (unsigned long) (fis.liv * (i + 29));
00661 break;
00662
00663 case SYMBOL:
00664 case STRING:
00665 #if OBJECT_SYSTEM
00666 case INSTANCE_NAME:
00667 #endif
00668 tvalue = (unsigned long) HashSymbol(ValueToString(fieldPtr[i].value),theRange);
00669 count += (unsigned long) (tvalue * (i + 29));
00670 break;
00671 }
00672 }
00673
00674
00675
00676
00677
00678 return(count);
00679 }
00680
00681
00682
00683
00684 globle struct multifield *GetMultifieldList(
00685 void *theEnv)
00686 {
00687 return(MultifieldData(theEnv)->ListOfMultifields);
00688 }
00689
00690
00691
00692
00693
00694 globle void *ImplodeMultifield(
00695 void *theEnv,
00696 DATA_OBJECT *value)
00697 {
00698 size_t strsize = 0;
00699 long i, j;
00700 char *tmp_str;
00701 char *ret_str;
00702 void *rv;
00703 struct multifield *theMultifield;
00704 DATA_OBJECT tempDO;
00705
00706
00707
00708
00709
00710 theMultifield = (struct multifield *) GetpValue(value);
00711 for (i = GetpDOBegin(value) ; i <= GetpDOEnd(value) ; i++)
00712 {
00713 if (GetMFType(theMultifield,i) == FLOAT)
00714 {
00715 tmp_str = FloatToString(theEnv,ValueToDouble(GetMFValue(theMultifield,i)));
00716 strsize += strlen(tmp_str) + 1;
00717 }
00718 else if (GetMFType(theMultifield,i) == INTEGER)
00719 {
00720 tmp_str = LongIntegerToString(theEnv,ValueToLong(GetMFValue(theMultifield,i)));
00721 strsize += strlen(tmp_str) + 1;
00722 }
00723 else if (GetMFType(theMultifield,i) == STRING)
00724 {
00725 strsize += strlen(ValueToString(GetMFValue(theMultifield,i))) + 3;
00726 tmp_str = ValueToString(GetMFValue(theMultifield,i));
00727 while(*tmp_str)
00728 {
00729 if (*tmp_str == '"')
00730 { strsize++; }
00731 else if (*tmp_str == '\\')
00732 { strsize++; }
00733 tmp_str++;
00734 }
00735 }
00736 #if OBJECT_SYSTEM
00737 else if (GetMFType(theMultifield,i) == INSTANCE_NAME)
00738 { strsize += strlen(ValueToString(GetMFValue(theMultifield,i))) + 3; }
00739 else if (GetMFType(theMultifield,i) == INSTANCE_ADDRESS)
00740 { strsize += strlen(ValueToString(((INSTANCE_TYPE *)
00741 GetMFValue(theMultifield,i))->name)) + 3; }
00742 #endif
00743
00744 else
00745 {
00746 SetType(tempDO,GetMFType(theMultifield,i));
00747 SetValue(tempDO,GetMFValue(theMultifield,i));
00748 strsize += strlen(DataObjectToString(theEnv,&tempDO)) + 1;
00749 }
00750 }
00751
00752
00753
00754
00755
00756
00757 if (strsize == 0) return(EnvAddSymbol(theEnv,""));
00758 ret_str = (char *) gm2(theEnv,strsize);
00759 for(j=0, i=GetpDOBegin(value); i <= GetpDOEnd(value) ; i++)
00760 {
00761
00762
00763
00764
00765 if (GetMFType(theMultifield,i) == FLOAT)
00766 {
00767 tmp_str = FloatToString(theEnv,ValueToDouble(GetMFValue(theMultifield,i)));
00768 while(*tmp_str)
00769 {
00770 *(ret_str+j) = *tmp_str;
00771 j++, tmp_str++;
00772 }
00773 }
00774 else if (GetMFType(theMultifield,i) == INTEGER)
00775 {
00776 tmp_str = LongIntegerToString(theEnv,ValueToLong(GetMFValue(theMultifield,i)));
00777 while(*tmp_str)
00778 {
00779 *(ret_str+j) = *tmp_str;
00780 j++, tmp_str++;
00781 }
00782 }
00783
00784
00785
00786
00787
00788
00789 else if (GetMFType(theMultifield,i) == STRING)
00790 {
00791 tmp_str = ValueToString(GetMFValue(theMultifield,i));
00792 *(ret_str+j) = '"';
00793 j++;
00794 while(*tmp_str)
00795 {
00796 if (*tmp_str == '"')
00797 {
00798 *(ret_str+j) = '\\';
00799 j++;
00800 }
00801 else if (*tmp_str == '\\')
00802 {
00803 *(ret_str+j) = '\\';
00804 j++;
00805 }
00806
00807 *(ret_str+j) = *tmp_str;
00808 j++, tmp_str++;
00809 }
00810 *(ret_str+j) = '"';
00811 j++;
00812 }
00813 #if OBJECT_SYSTEM
00814 else if (GetMFType(theMultifield,i) == INSTANCE_NAME)
00815 {
00816 tmp_str = ValueToString(GetMFValue(theMultifield,i));
00817 *(ret_str + j++) = '[';
00818 while(*tmp_str)
00819 {
00820 *(ret_str+j) = *tmp_str;
00821 j++, tmp_str++;
00822 }
00823 *(ret_str + j++) = ']';
00824 }
00825 else if (GetMFType(theMultifield,i) == INSTANCE_ADDRESS)
00826 {
00827 tmp_str = ValueToString(((INSTANCE_TYPE *) GetMFValue(theMultifield,i))->name);
00828 *(ret_str + j++) = '[';
00829 while(*tmp_str)
00830 {
00831 *(ret_str+j) = *tmp_str;
00832 j++, tmp_str++;
00833 }
00834 *(ret_str + j++) = ']';
00835 }
00836 #endif
00837 else
00838 {
00839 SetType(tempDO,GetMFType(theMultifield,i));
00840 SetValue(tempDO,GetMFValue(theMultifield,i));
00841 tmp_str = DataObjectToString(theEnv,&tempDO);
00842 while(*tmp_str)
00843 {
00844 *(ret_str+j) = *tmp_str;
00845 j++, tmp_str++;
00846 }
00847 }
00848 *(ret_str+j) = ' ';
00849 j++;
00850 }
00851 *(ret_str+j-1) = '\0';
00852
00853
00854
00855
00856
00857 rv = EnvAddSymbol(theEnv,ret_str);
00858 rm(theEnv,ret_str,strsize);
00859 return(rv);
00860 }
00861
00862
00863