| version 1.1, 2001/09/20 14:12:00 |
version 1.2, 2002/07/07 23:57:58 |
| Line 11 void ReallocateSpecials() |
|
| Line 11 void ReallocateSpecials() |
|
| |
|
| if (theSpecialArray == NULL) |
if (theSpecialArray == NULL) |
| theSpecialArray = (SpecialType *) malloc(sizeOfSpecialArray * |
theSpecialArray = (SpecialType *) malloc(sizeOfSpecialArray * |
| sizeof(SpecialType)); |
sizeof(SpecialType)); |
| else |
else |
| theSpecialArray = (SpecialType *) realloc(theSpecialArray, |
theSpecialArray = (SpecialType *) realloc(theSpecialArray, |
| sizeOfSpecialArray * sizeof(SpecialType)); |
sizeOfSpecialArray * sizeof(SpecialType)); |
| if (theSpecialArray == NULL) { |
if (theSpecialArray == NULL) { |
| printf("Not enough memory to allocate specials\n"); |
printf("Not enough memory to allocate specials\n"); |
| exit(1); |
exit(1); |
| Line 42 void SetUpNewVar(void *spvar, char *spna |
|
| Line 42 void SetUpNewVar(void *spvar, char *spna |
|
| SpTemp->Type = CHAR; |
SpTemp->Type = CHAR; |
| else { |
else { |
| printf("Unknown special type: %s. " |
printf("Unknown special type: %s. " |
| "Must be 'integer', 'double', " |
"Must be 'integer', 'double', " |
| "'float', or 'char'.\n", type); |
"'float', or 'char'.\n", type); |
| free(SpTemp); |
free(SpTemp); |
| return; |
return; |
| } |
} |
| Line 53 void SetUpNewVar(void *spvar, char *spna |
|
| Line 53 void SetUpNewVar(void *spvar, char *spna |
|
| |
|
| theSpecialArray[numberOfSpecials] = SpTemp; |
theSpecialArray[numberOfSpecials] = SpTemp; |
| |
|
| sprintf(TclCommand,"SetUpNewVar %d \"%s\" \"%s\"\n",numberOfSpecials++, |
if (snprintf(TclCommand, TclCommand_MAX, |
| spname,type); |
"SetUpNewVar %d \"%s\" \"%s\"\n", numberOfSpecials++, |
| |
spname,type) == -1) { |
| |
fprintf(stderr, "Warning: TclCommand truncated at %s:%d\n", __FILE__, __LINE__); |
| |
} |
| if (Tcl_Eval(interp,TclCommand)!=TCL_OK) { |
if (Tcl_Eval(interp,TclCommand)!=TCL_OK) { |
| printf("Error setting up variable\n"); |
printf("Error setting up variable\n"); |
| printf("%s\n",interp->result); |
printf("%s\n",interp->result); |