\File{Parameter.h},{18:32},{Aug 18 1990} \L{\LB{\C{}\/* \$Header: \/mit\/hst\/src\/data\/RCS\/Parameter.h,v 1.1 90\/08\/18 18:30:38 tldavis Exp \$}} \L{\LB{ * Parameter.h: Timothy L. Davis, 1990}} \L{\LB{ *}} \L{\LB{ * Header for simulation parameter database and patient database routines.}} \L{\LB{ * These are defined in parameter.c, patient.c, and format.c}} \L{\LB{ * \$Log:}\Tab{16}{Parameter.h,v \$}} \L{\LB{ * Revision 1.1 90\/08\/18 18:30:38 tldavis}} \L{\LB{ * Initial revision}} \L{\LB{ * }} \L{\LB{ *\/\CE{}}} \L{\LB{}} \L{\LB{\C{}\/*}} \L{\LB{ * parameter.c public functions:}} \L{\LB{ *\/\CE{}}} \L{\LB{}} \L{\LB{\K{extern} \K{void} LoadParameterData(\C{}\/* char *filename;*\/\CE{});}} \L{\LB{\K{extern} SIMULATION *getsimulation(\C{}\/* int pathology\_number; *\/\CE{});}} \L{\LB{\K{extern} SIMULATION *setsimulation();}} \L{\LB{\K{extern} \K{int} var\_in\_bounds(\C{}\/*int place, type, value;*\/\CE{});}} \L{\LB{\K{extern} \K{int} *get\_varlist(\C{}\/*int place, device, dep;*\/\CE{});}} \L{\LB{\K{extern} VarData *get\_vardata(\C{}\/*int place, type;*\/\CE{});}} \L{\LB{}} \L{\LB{\C{}\/*}} \L{\LB{ * patient.c: Predefined clinical patients with case history.}} \L{\LB{ * LoadPatient loads the patient simulation and returns the case history.}} \L{\LB{ *\/\CE{}}} \L{\LB{\K{extern} \K{char} *LoadPatient(\C{}\/*char *path;*\/\CE{});}} \L{\LB{}} \L{\LB{\C{}\/*}} \L{\LB{ * format.c: Formats the parameter list for printing. Returns the list.}} \L{\LB{ * Parameters different fron default are marked as such.}} \L{\LB{ *\/\CE{}}} \L{\LB{\K{extern} \K{char} *FormatParams(\C{}\/* SIMULATION *presentsim, *defaultsim *\/\CE{});}} \L{\LB{}} \File{format.c},{18:33},{Aug 18 1990} \L{\LB{\C{}\/*}} \L{\LB{ *}\Tab{8}{\$Source: \/mit\/hst\/src\/data\/RCS\/format.c,v \$}} \L{\LB{ *\/\CE{}}} \L{\LB{\K{\#ifndef} lint}} \L{\LB{\K{static} \K{char} *rcs=\S{}\"\$Header: \/mit\/hst\/src\/data\/RCS\/format.c,v 2.1 90\/08\/18 18:31:02 tldavis Exp \$\"\SE{};}} \L{\LB{\K{\#endif}}\Tab{8}{lint}} \L{\LB{}} \L{\LB{\K{\#include} \}} \L{\LB{\K{\#include} \}} \L{\LB{\K{\#include} \}} \L{\LB{\K{\#include} \S{}\"..\/sim\/CVDefs.h\"\SE{}}} \L{\LB{\K{\#include} \S{}\"Parameter.h\"\SE{}}} \L{\LB{}} \L{\LB{\K{extern} \K{char} *malloc();}} \L{\LB{}} \L{\LB{\K{static} \K{char} *page[] = \{}} \L{\LB{ \S{}\"Heart Rate: \%4.2lf\%3s\!n\"\SE{},}} \L{\LB{ \S{}\"Total Blood Volume: \%6.1lf\%3s\!n\"\SE{},}} \L{\LB{ \S{}\"Trans\-thoracic Pressure: \%4.2lf\%3s\!n\"\SE{},}} \L{\LB{}} \L{\LB{ \S{}\"\!nCapacitances: (ml\/mmHg)\!n\-\-\-\-\-\-\-\-\-\-\-\-\!n\"\SE{},}} \L{\LB{ \S{}\"LVsyst \%4.2lf\%3s LVdiast \%4.2lf\%3s Arterial \%4.2lf\%3s Venous \%4.2lf\%3s\!n\"\SE{},}} \L{\LB{ \S{}\"RVsyst \%4.2lf\%3s RVdiast \%4.2lf\%3s Pulm Art \%4.2lf\%3s Pulm V \%4.2lf\%3s\!n\"\SE{},}} \L{\LB{}} \L{\LB{ \S{}\"\!nZero\-Pressure Volumes: (ml)\!n\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\!n\"\SE{},}} \L{\LB{ \S{}\"LV \%6.1lf\%3s Arterial \%6.1lf\%3s Venous \%6.1lf\%3s\!n\"\SE{},}} \L{\LB{ \S{}\"RV \%6.1lf\%3s Pulm Art \%6.1lf\%3s Pulm V \%6.1lf\%3s\!n\"\SE{},}} \L{\LB{}} \L{\LB{ \S{}\"\!nResistances: (mmHg*sec\/ml)\!n\-\-\-\-\-\-\-\-\-\-\-\!n\"\SE{},}} \L{\LB{ \S{}\"LV Inflow \%4.2lf\%3s LV Outflow \%4.2lf\%3s Microvascular \%4.2lf\%3s\!n\"\SE{},}} \L{\LB{ \S{}\"Venous \%4.2lf\%3s RV Outflow \%4.2lf\%3s Pulmonary \%4.2lf\%3s\!n\"\SE{},}} \L{\LB{ \};}} \L{\LB{ }} \L{\LB{\K{static} \K{char} *pm(a, b)}} \L{\LB{\K{double} a, b;}} \L{\LB{\{ \K{return} (a \> b ? \S{}\"(+)\"\SE{} : ( a \< b ? \S{}\"(\-)\"\SE{} : \S{}\" \"\SE{})); }} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\/*PUBLIC*\/\CE{} \K{char} *FormatParams(n, o)}} \L{\LB{SIMULATION *n, *o;}} \L{\LB{\{}} \L{\LB{ \K{static} \K{char} line[512], buf[10000];}} \L{\LB{}} \L{\LB{ buf[0] = \S{}\'\!0\'\SE{};}} \L{\LB{ sprintf(line,page[0], n\-\>hr, pm(n\-\>hr,o\-\>hr)); strcat(buf, line);}} \L{\LB{ sprintf(line,page[1], n\-\>bv, pm(n\-\>bv,o\-\>bv)); strcat(buf, line);}} \L{\LB{ sprintf(line,page[2], n\-\>pth, pm(n\-\>pth,o\-\>pth)); strcat(buf, line);}} \L{\LB{ sprintf(line,page[3]); strcat(buf, line);}} \L{\LB{ sprintf(line,page[4],}} \L{\LB{}\Tab{8}{ n\-\>Clsys,pm(n\-\>Clsys,o\-\>Clsys), n\-\>Cldias,pm(n\-\>Cldias,o\-\>Cldias),}} \L{\LB{}\Tab{8}{ n\-\>Ca,pm(n\-\>Ca,o\-\>Ca),n\-\>Cv,pm(n\-\>Cv,o\-\>Cv)); }} \L{\LB{ strcat(buf, line);}} \L{\LB{ sprintf(line,page[5],}} \L{\LB{}\Tab{8}{ n\-\>Crsys,pm(n\-\>Crsys,o\-\>Crsys), n\-\>Crdias,pm(n\-\>Crdias,o\-\>Crdias),}} \L{\LB{}\Tab{8}{ n\-\>CPa,pm(n\-\>CPa,o\-\>CPa),n\-\>CPv,pm(n\-\>CPv,o\-\>CPv)); }} \L{\LB{ strcat(buf, line);}} \L{\LB{ sprintf(line,page[6]); }} \L{\LB{ strcat(buf, line);}} \L{\LB{ sprintf(line,page[7], n\-\>Vl0, pm(n\-\>Vl0,o\-\>Vl0),}} \L{\LB{}\Tab{8}{ n\-\>Va0, pm(n\-\>Va0,o\-\>Va0), n\-\>Vv0, pm(n\-\>Vv0,o\-\>Vv0)); }} \L{\LB{ strcat(buf, line);}} \L{\LB{ sprintf(line,page[8], n\-\>Vr0, pm(n\-\>Vr0,o\-\>Vr0),}} \L{\LB{}\Tab{8}{ n\-\>VPa0, pm(n\-\>VPa0,o\-\>VPa0), n\-\>VPv0, pm(n\-\>VPv0,o\-\>VPv0)); }} \L{\LB{ strcat(buf, line);}} \L{\LB{ sprintf(line,page[9]); }} \L{\LB{ strcat(buf, line);}} \L{\LB{ sprintf(line,page[10], n\-\>Rli,pm(n\-\>Rli,o\-\>Rli), n\-\>Rlo,pm(n\-\>Rlo,o\-\>Rlo), }} \L{\LB{}\Tab{8}{ n\-\>Ra,pm(n\-\>Ra,o\-\>Ra)); }} \L{\LB{ strcat(buf, line);}} \L{\LB{ sprintf(line,page[11], n\-\>Rv,pm(n\-\>Rv,o\-\>Rv), n\-\>Rro,pm(n\-\>Rro,o\-\>Rro), }} \L{\LB{}\Tab{8}{ n\-\>RPv,pm(n\-\>RPv,o\-\>RPv)); }} \L{\LB{ strcat(buf, line);}} \L{\LB{ }} \L{\LB{\K{\#ifdef} DEBUG}} \L{\LB{ printf(\S{}\"SIMULATION PARAMETERS:\!n\!n \%s\!n\"\SE{}, buf); fflush(stdout);}} \L{\LB{\K{\#endif}}} \L{\LB{ \K{return}(strcpy(malloc(strlen(buf)+1),buf));}} \L{\LB{\}}} \File{parameter.c},{11:45},{Mar 18 1991} \L{\LB{\C{}\/* Copyright 1988 Timothy L. Davis}} \L{\LB{ *}} \L{\LB{ * \$Source: \/mit\/hst\/src\/data\/RCS\/parameter.c,v \$}} \L{\LB{ * \$Log:}\Tab{16}{parameter.c,v \$}} \L{\LB{ * Revision 2.2 90\/08\/18 18:31:24 tldavis}} \L{\LB{ * Added ref to .h file.}} \L{\LB{ * }} \L{\LB{ * Revision 2.1 90\/08\/07 15:49:45 tldavis}} \L{\LB{ * Fixed compiler warnings.}} \L{\LB{ * }} \L{\LB{ * Revision 2.0 90\/08\/06 17:50:56 tldavis}} \L{\LB{ * Final X11R3 version.}} \L{\LB{ * }} \L{\LB{ * Revision 1.3 90\/08\/06 17:10:24 tldavis}} \L{\LB{ * No changes.}} \L{\LB{ * }} \L{\LB{ * Revision 1.2 88\/08\/16 18:11:27 tldavis}} \L{\LB{ * *** empty log message ***}} \L{\LB{ * }} \L{\LB{ *\/\CE{}}} \L{\LB{\K{\#ifndef} lint}} \L{\LB{\K{static} \K{char} }} \L{\LB{*rcs = \S{}\"\$Header: \/mit\/hst\/src\/data\/RCS\/parameter.c,v 2.2 90\/08\/18 18:31:24 tldavis Exp Locker: tldavis \$\"\SE{};}} \L{\LB{\K{\#endif}}\Tab{8}{lint}} \L{\LB{}} \L{\LB{\K{\#include} \}} \L{\LB{\K{\#include} \}} \L{\LB{\K{\#include} \S{}\"..\/sim\/CVDefs.h\"\SE{}}} \L{\LB{\K{extern} \K{char} *malloc(), *realloc();}} \L{\LB{\C{}\/* }} \L{\LB{ * Private Data}} \L{\LB{ *\/\CE{}}} \L{\LB{}} \L{\LB{\K{static} VarData *vars[15][6];}} \L{\LB{\K{static} \K{int} varCount[15][6];}} \L{\LB{SIMULATION savedsim[2];}} \L{\LB{}} \L{\LB{\K{static} \K{char} *VarUnits[] = }} \L{\LB{\{ \C{}\/*** depends on type defines in cvdefs.h ***\/\CE{}}} \L{\LB{ \S{}\"cm\/sec\"\SE{},}} \L{\LB{ \S{}\"ml\/sec\"\SE{},}} \L{\LB{ \S{}\"mmHg\"\SE{},}} \L{\LB{ \S{}\"ml\"\SE{},}} \L{\LB{ \S{}\"ml\/mmHg\"\SE{},}} \L{\LB{ \S{}\"ml\/mmHg\"\SE{},}} \L{\LB{ \S{}\"ml\/mmHg\"\SE{},}} \L{\LB{ \S{}\"ml\"\SE{},}} \L{\LB{ \S{}\"mmHg*sec\/ml\"\SE{},}} \L{\LB{ \S{}\"beats\/min\"\SE{},}} \L{\LB{ \S{}\"mmHg\"\SE{},}} \L{\LB{\};}} \L{\LB{}} \L{\LB{\C{}\/*************************************}} \L{\LB{ *}} \L{\LB{ * Public Routines}} \L{\LB{ *}} \L{\LB{ *************************************\/\CE{}}} \L{\LB{}} \L{\LB{\C{}\/*PUBLIC*\/\CE{}}} \L{\LB{VarData *get\_vardata(place, type)}} \L{\LB{\K{int} place, type;}} \L{\LB{\{}} \L{\LB{ VarData *p;}} \L{\LB{ \K{int} i;}} \L{\LB{}} \L{\LB{ \K{if} (place \< 0 \|\| type \< 0) \K{return}(NULL);}} \L{\LB{ \K{if} (type == TIME) place = SYSTEM;}} \L{\LB{ \K{for} (i=0; i\<7; i++) \{}} \L{\LB{ p = vars[place][i];}} \L{\LB{ \K{if} (p != NULL)}} \L{\LB{ \K{while} (p\-\>var != ENDVAR) \{}} \L{\LB{}\Tab{8}{\K{if} (p\-\>var == type)}} \L{\LB{}\Tab{8}{ \K{return}(p);}} \L{\LB{}\Tab{8}{\K{else} p++;}} \L{\LB{ \}}} \L{\LB{ \}}} \L{\LB{ \K{return}(NULL); \C{}\/*no such variable*\/\CE{}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\/*PUBLIC*\/\CE{}}} \L{\LB{\K{int} *get\_varlist(place, device, dep)}} \L{\LB{\K{int} place, device, dep;}} \L{\LB{\{}} \L{\LB{ \K{int} *l, n, o;}} \L{\LB{ VarData *p;}} \L{\LB{ \K{if} (place \< 0 \|\| device \< 0 \|\| place \> 8 \|\| device \> 6) \{}} \L{\LB{ printf(\S{}\"Error: get\_varlist: illegal parameter.\!n\"\SE{});}} \L{\LB{ exit(1);}} \L{\LB{ \}}} \L{\LB{ l = (\K{int} *) malloc((\K{unsigned})(5*\K{sizeof}(\K{int})));}} \L{\LB{ p = vars[place][device];}} \L{\LB{ n = o = 0;}} \L{\LB{ \K{while} (p \&\& (p+o)\-\>var != ENDVAR) \{}} \L{\LB{ \K{if} ((p+o)\-\>dep == dep) l[n++] = (p+o)\-\>var;}} \L{\LB{ o++;}} \L{\LB{ \}}} \L{\LB{ l[n] = ENDVAR;}} \L{\LB{ \K{return}(l);}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\/*PUBLIC*\/\CE{}}} \L{\LB{\K{int} var\_in\_bounds(place, type, value)}} \L{\LB{\K{int} type, place;}} \L{\LB{\K{double} value;}} \L{\LB{\{}} \L{\LB{ VarData *p;}} \L{\LB{ \K{int} i;}} \L{\LB{}} \L{\LB{ \K{for} (i = 0; i\<7; i++) \{}} \L{\LB{ p = vars[place][i];}} \L{\LB{ \K{if} (p != NULL)}} \L{\LB{ \K{while} (p\-\>var != ENDVAR)}} \L{\LB{}\Tab{8}{\K{if} (p\-\>var == type) \{}} \L{\LB{}\Tab{8}{ \K{if} (p\-\>min \<= value \&\& p\-\>max \>= value) \{}} \L{\LB{}\Tab{8}{ \K{return}(1);}} \L{\LB{}\Tab{8}{ \} \K{else} \{ }} \L{\LB{}\Tab{8}{ \K{return}(0);}} \L{\LB{}\Tab{8}{ \}}} \L{\LB{}\Tab{8}{\} \K{else} p++;}} \L{\LB{ \}}} \L{\LB{ \K{return}(0); \C{}\/* no such variable exists *\/\CE{}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\/*PUBLIC*\/\CE{}}} \L{\LB{\K{void} LoadParameterData(path)}} \L{\LB{\K{char} *path;}} \L{\LB{\{}} \L{\LB{ FILE *fp;}} \L{\LB{ VarData *vdPtr;}} \L{\LB{ \K{int} c;}} \L{\LB{ \K{char} place[80], dev[80], type[80], dep[80], name[80];}} \L{\LB{ \K{double} def, min, max, gmin, gmax;}} \L{\LB{ \K{int} placeCode = \-1, devCode = \-1, typeCode = \-1, depCode = \-1;}} \L{\LB{}} \L{\LB{ \K{if} ((fp = fopen(path, \S{}\"r\"\SE{})) == NULL) \{}} \L{\LB{ fprintf(stderr, \S{}\"Can\'t open parameter file \%s.\!n\"\SE{},path);}} \L{\LB{ exit(1);}} \L{\LB{ \}}} \L{\LB{ \{}} \L{\LB{ \K{register} \K{int} x, y;}} \L{\LB{ \K{for} (x=0; x\<15; x++)}} \L{\LB{ \K{for} (y=0; y\<6; y++)}} \L{\LB{}\Tab{8}{\{ \K{if} (vars[x][y]) free(vars[x][y]);}} \L{\LB{}\Tab{8}{ vars[x][y] = NULL;}} \L{\LB{}\Tab{8}{ varCount[x][y] = 0;}} \L{\LB{}\Tab{8}{\}}} \L{\LB{ \}}} \L{\LB{ \K{while} ((c=fgetc(fp)) != EOF) \{}} \L{\LB{ \K{if} (c==\S{}\'\#\'\SE{}) \{}} \L{\LB{ \K{while} ((c=fgetc(fp)) != \S{}\'\!n\'\SE{} \&\& c != EOF) }} \L{\LB{}\Tab{8}{;}} \L{\LB{ \} \K{else} \{}} \L{\LB{ c = fscanf(fp,\S{}\":\%[\^:]:\%[\^:]:\%[\^:]:\%[\^:]:\%lf :\%lf :\%lf :\%lf :\%lf :\%[\^\!n]\"\SE{},}} \L{\LB{}\Tab{16}{ place,dev, type, dep, \&def,\&min,\&max,\&gmin,\&gmax, name);}} \L{\LB{ \K{if} (c == 0) \K{continue};}} \L{\LB{ \K{else} \K{if} (c == EOF) \K{break};}} \L{\LB{ \K{else} \K{if} (c \< 10) \{}} \L{\LB{}\Tab{8}{fprintf(stderr, \S{}\"Bad database line: \%s :\%s :\%s :\%s: ...etc... :\%s\!n\"\SE{},}} \L{\LB{}\Tab{16}{place, dev, type, dep, name);}} \L{\LB{}\Tab{8}{\K{continue};}} \L{\LB{ \}}} \L{\LB{ \K{if} (strncmp(place, \S{}\"l\"\SE{}, 1) == 0) placeCode = LV;}} \L{\LB{ \K{else} \K{if} (strncmp(place, \S{}\"r\"\SE{}, 1) == 0) placeCode = RV;}} \L{\LB{ \K{else} \K{if} (strncmp(place, \S{}\"a\"\SE{}, 1) == 0) placeCode = SA;}} \L{\LB{ \K{else} \K{if} (strncmp(place, \S{}\"v\"\SE{}, 1) == 0) placeCode = SV;}} \L{\LB{ \K{else} \K{if} (strncmp(place, \S{}\"pa\"\SE{},2) == 0) placeCode = PA;}} \L{\LB{ \K{else} \K{if} (strncmp(place, \S{}\"pv\"\SE{},2) == 0) placeCode = PV;}} \L{\LB{ \K{else} \K{if} (strncmp(place, \S{}\"micro\"\SE{},1)==0) placeCode = SC;}} \L{\LB{ \K{else} \K{if} (strncmp(place, \S{}\"pmicro\"\SE{},2)==0)placeCode = PC;}} \L{\LB{ \K{else} \K{if} (strncmp(place,\S{}\"sys\"\SE{},3) == 0) placeCode = SYSTEM;}} \L{\LB{ \K{else} \{fprintf(stderr,\S{}\"Bad Place \%s in db \%s.\!n\"\SE{}, place, path); exit(1);\}}} \L{\LB{}} \L{\LB{ \K{if} (strncmp(dev, \S{}\"cap\"\SE{}, 3) == 0) devCode = CAPACITOR;}} \L{\LB{ \K{else} \K{if} (strncmp(dev, \S{}\"res\"\SE{}, 3) == 0) devCode = RESISTOR;}} \L{\LB{ \K{else} \K{if} (strncmp(dev, \S{}\"vcap\"\SE{},4) == 0) devCode = VARCAPACITOR;}} \L{\LB{ \K{else} \K{if} (strncmp(dev, \S{}\"system\"\SE{},6) == 0) devCode = SYSTEMOR;}} \L{\LB{ \K{else} \{fprintf(stderr,\S{}\"Bad Device \%s in db \%s.\!n\"\SE{}, dev, path); exit(1);\}}} \L{\LB{}} \L{\LB{ \K{if} (strncmp(type, \S{}\"csys\"\SE{}, 4) == 0) typeCode = CAPACITANCE\_SYS;}} \L{\LB{ \K{else} \K{if} (strncmp(type, \S{}\"cdias\"\SE{}, 4) == 0) typeCode = CAPACITANCE\_DIAS;}} \L{\LB{ \K{else} \K{if} (strncmp(type, \S{}\"cap\"\SE{}, 3) == 0) typeCode = CAPACITANCE;}} \L{\LB{ \K{else} \K{if} (strncmp(type, \S{}\"zvol\"\SE{},4) == 0) typeCode = ZPVOLUME;}} \L{\LB{ \K{else} \K{if} (strncmp(type, \S{}\"res\"\SE{}, 3) == 0) typeCode = RESISTANCE;}} \L{\LB{ \K{else} \K{if} (strncmp(type, \S{}\"hr\"\SE{}, 2) == 0) typeCode = HEARTRATE;}} \L{\LB{ \K{else} \K{if} (strncmp(type, \S{}\"pres\"\SE{}, 4) == 0) typeCode = PRESSURE;}} \L{\LB{ \K{else} \K{if} (strncmp(type, \S{}\"vol\"\SE{}, 3) == 0) typeCode = VOLUME;}} \L{\LB{ \K{else} \K{if} (strncmp(type, \S{}\"flow\"\SE{}, 4) == 0) typeCode = FLOW;}} \L{\LB{ \K{else} \K{if} (strncmp(type, \S{}\"time\"\SE{}, 4) == 0) typeCode = TIME;}} \L{\LB{ \K{else} \{fprintf(stderr,\S{}\"Bad Type \%s in db \%s.\!n\"\SE{}, type, path); exit(1);\}}} \L{\LB{}} \L{\LB{ \K{if} (dep[0] == \S{}\'i\'\SE{}) depCode = INDEPENDENT;}} \L{\LB{ \K{else} \K{if} (dep[0] == \S{}\'d\'\SE{}) depCode = DEPENDENT;}} \L{\LB{ \K{else} \{fprintf(stderr, \S{}\"Bad Dep. flag \%s in db \%s.\!n\"\SE{},dep,path); exit(1);\}}} \L{\LB{}} \L{\LB{ \K{if} (vars[placeCode][devCode] == NULL) \{}} \L{\LB{}\Tab{8}{vars[placeCode][devCode] = }} \L{\LB{}\Tab{8}{ (VarData *)malloc((\K{unsigned})(2*\K{sizeof}(VarData)));}} \L{\LB{}\Tab{8}{varCount[placeCode][devCode]++;}} \L{\LB{ \} \K{else} \{}} \L{\LB{}\Tab{8}{vars[placeCode][devCode] = }} \L{\LB{}\Tab{8}{ (VarData *)realloc((\K{char} *)vars[placeCode][devCode],}} \L{\LB{}\Tab{24}{ (\K{unsigned})((++varCount[placeCode][devCode]+1)}} \L{\LB{}\Tab{24}{ *\K{sizeof}(VarData)));}} \L{\LB{ \}}} \L{\LB{ vdPtr = vars[placeCode][devCode] + (varCount[placeCode][devCode]\-1);}} \L{\LB{ vdPtr\-\>var = typeCode;}} \L{\LB{ vdPtr\-\>dep = depCode;}} \L{\LB{ vdPtr\-\>normal = def;}} \L{\LB{ vdPtr\-\>min = min;}} \L{\LB{ vdPtr\-\>max = max;}} \L{\LB{ vdPtr\-\>gmin = gmin;}} \L{\LB{ vdPtr\-\>gmax = gmax;}} \L{\LB{ vdPtr\-\>name = malloc((\K{unsigned})((strlen(name)+1)*\K{sizeof}(\K{char})));}} \L{\LB{ strcpy(vdPtr\-\>name, name);}} \L{\LB{ vdPtr\-\>units = VarUnits[typeCode];}} \L{\LB{ (vdPtr+1)\-\>var = ENDVAR;}} \L{\LB{ \}}} \L{\LB{ \}}} \L{\LB{ \C{}\/* Set the NORMAL set: *\/\CE{}}} \L{\LB{ savedsim[1].Vl0 = get\_vardata(LV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[1].Vr0 = get\_vardata(RV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[1].Va0 = get\_vardata(SA,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[1].Vv0 = get\_vardata(SV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[1].VPa0 = get\_vardata(PA,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[1].VPv0 = get\_vardata(PV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[1].bv = get\_vardata(SYSTEM,VOLUME)\-\>normal;}} \L{\LB{ savedsim[1].Ra = get\_vardata(SC,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[1].Rv = get\_vardata(SV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[1].RPv = get\_vardata(PC,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[1].Rli = get\_vardata(PV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[1].Rlo = get\_vardata(LV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[1].Rro = get\_vardata(RV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[1].Ca = get\_vardata(SA,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[1].Cv = get\_vardata(SV,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[1].CPa = get\_vardata(PA,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[1].CPv = get\_vardata(PV,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[1].Cldias = get\_vardata(LV,CAPACITANCE\_DIAS)\-\>normal;}} \L{\LB{ savedsim[1].Clsys = get\_vardata(LV,CAPACITANCE\_SYS)\-\>normal;}} \L{\LB{ savedsim[1].Crdias = get\_vardata(RV,CAPACITANCE\_DIAS)\-\>normal;}} \L{\LB{ savedsim[1].Crsys = get\_vardata(RV,CAPACITANCE\_SYS)\-\>normal;}} \L{\LB{ savedsim[1].pth = get\_vardata(SYSTEM,PRESSURE)\-\>normal;}} \L{\LB{ savedsim[1].hr = get\_vardata(SYSTEM,HEARTRATE)\-\>normal;}} \L{\LB{}} \L{\LB{ \C{}\/* Set the CURRENT set (same as normal for now): *\/\CE{}}} \L{\LB{ savedsim[0].Vl0 = get\_vardata(LV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].Vr0 = get\_vardata(RV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].Va0 = get\_vardata(SA,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].Vv0 = get\_vardata(SV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].VPa0 = get\_vardata(PA,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].VPv0 = get\_vardata(PV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].bv = get\_vardata(SYSTEM,VOLUME)\-\>normal;}} \L{\LB{ savedsim[0].Ra = get\_vardata(SC,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Rv = get\_vardata(SV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].RPv = get\_vardata(PC,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Rli = get\_vardata(PV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Rlo = get\_vardata(LV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Rro = get\_vardata(RV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Ca = get\_vardata(SA,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[0].Cv = get\_vardata(SV,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[0].CPa = get\_vardata(PA,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[0].CPv = get\_vardata(PV,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[0].Cldias = get\_vardata(LV,CAPACITANCE\_DIAS)\-\>normal;}} \L{\LB{ savedsim[0].Clsys = get\_vardata(LV,CAPACITANCE\_SYS)\-\>normal;}} \L{\LB{ savedsim[0].Crdias = get\_vardata(RV,CAPACITANCE\_DIAS)\-\>normal;}} \L{\LB{ savedsim[0].Crsys = get\_vardata(RV,CAPACITANCE\_SYS)\-\>normal;}} \L{\LB{ savedsim[0].pth = get\_vardata(SYSTEM,PRESSURE)\-\>normal;}} \L{\LB{ savedsim[0].hr = get\_vardata(SYSTEM,HEARTRATE)\-\>normal;}} \L{\LB{\}}} \L{\LB{}} \L{\LB{}} \L{\LB{}} \L{\LB{\C{}\/***** OLD STUFF BELOW HERE ******\/\CE{}}} \L{\LB{ }} \L{\LB{\K{\#ifdef} NOTDEF}} \L{\LB{\C{}\/* The following are not used currently *\/\CE{}}} \L{\LB{\K{static} \K{struct} cvstatus cvstat[] = \{}} \L{\LB{ \{ \S{}\"Current Patient\"\SE{},}} \L{\LB{}\Tab{8}{ NVL0,NVR0,NVA0,NVV0,NVPA0,NVPV0,NBV,}} \L{\LB{}\Tab{8}{ NRA,NRV,NRPV,NRLI,NRLO,NRRO,}} \L{\LB{}\Tab{8}{ NCA,NCV,NCPA,NCPV,NCLDIAS,NCLSYS,NCRDIAS,NCRSYS,}} \L{\LB{}\Tab{8}{ NPTH,NHR\},}} \L{\LB{}\Tab{8}{\{ \S{}\"Normal\"\SE{},}} \L{\LB{}\Tab{8}{ NVL0,NVR0,NVA0,NVV0,NVPA0,NVPV0,NBV,}} \L{\LB{}\Tab{8}{ NRA,NRV,NRPV,NRLI,NRLO,NRRO,}} \L{\LB{}\Tab{8}{ NCA,NCV,NCPA,NCPV,NCLDIAS,NCLSYS,NCRDIAS,NCRSYS,}} \L{\LB{}\Tab{8}{ NPTH,NHR\},}} \L{\LB{}\Tab{8}{\{ \S{}\"Aging\"\SE{},}} \L{\LB{}\Tab{8}{ NVL0,NVR0,NVA0,NVV0,NVPA0,NVPV0,NBV,}} \L{\LB{}\Tab{8}{ NRA,NRV,NRPV,NRLI,NRLO,NRRO,}} \L{\LB{}\Tab{8}{ 0.8,NCV,NCPA,NCPV,NCLDIAS,NCLSYS,NCRDIAS,NCRSYS,}} \L{\LB{}\Tab{8}{ NPTH,NHR\},}} \L{\LB{}\Tab{8}{\{ \S{}\"Chronic Hypertension\"\SE{},}} \L{\LB{}\Tab{8}{ NVL0,NVR0,NVA0,NVV0,NVPA0,NVPV0,NBV,}} \L{\LB{}\Tab{8}{ 1.6,NRV,NRPV,NRLI,NRLO,NRRO,}} \L{\LB{}\Tab{8}{ 1.0,NCV,NCPA,NCPV,NCLDIAS,NCLSYS,NCRDIAS,NCRSYS,}} \L{\LB{}\Tab{8}{ NPTH,NHR\},}} \L{\LB{}\Tab{8}{\{ \S{}\"Aortic Stenosis\"\SE{},}} \L{\LB{}\Tab{8}{ NVL0,NVR0,NVA0,NVV0,NVPA0,NVPV0,NBV,}} \L{\LB{}\Tab{8}{ NRA,NRV,NRPV,NRLI,0.22,NRRO,}} \L{\LB{}\Tab{8}{ NCA,NCV,NCPA,NCPV,NCLDIAS,NCLSYS,NCRDIAS,NCRSYS,}} \L{\LB{}\Tab{8}{ NPTH,NHR\},}} \L{\LB{}\Tab{8}{\{ \S{}\"Hypovolemic Shock\"\SE{},}} \L{\LB{}\Tab{8}{ NVL0,NVR0,NVA0,NVV0,NVPA0,NVPV0,4500.0,}} \L{\LB{}\Tab{8}{ NRA,NRV,NRPV,NRLI,NRLO,NRRO,}} \L{\LB{}\Tab{8}{ NCA,NCV,NCPA,NCPV,NCLDIAS,NCLSYS,NCRDIAS,NCRSYS,}} \L{\LB{}\Tab{8}{ NPTH,NHR\},}} \L{\LB{}\Tab{8}{\{ \S{}\"Cardiogenic Shock\"\SE{},}} \L{\LB{}\Tab{8}{ NVL0,NVR0,NVA0,NVV0,NVPA0,NVPV0,NBV,}} \L{\LB{}\Tab{8}{ NRA,NRV,NRPV,NRLI,NRLO,NRRO,}} \L{\LB{}\Tab{8}{ NCA,NCV,NCPA,NCPV,NCLDIAS,1.2,NCRDIAS,NCRSYS,}} \L{\LB{}\Tab{8}{ NPTH,NHR\},}} \L{\LB{\};}} \L{\LB{}} \L{\LB{\K{static} \K{int} NEXAMPLES = (\K{sizeof}(cvstat) \/ \K{sizeof}(cvstat[0]));}} \L{\LB{\K{\#endif} NOTDEF}} \L{\LB{\K{static} \K{int} NEXAMPLES = 2;}} \L{\LB{}} \L{\LB{\C{}\/*PUBLIC*\/\CE{}}} \L{\LB{SIMULATION *setsimulation()}} \L{\LB{\{}} \L{\LB{ savedsim[0].Vl0 = get\_vardata(LV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].Vr0 = get\_vardata(RV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].Va0 = get\_vardata(SA,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].Vv0 = get\_vardata(SV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].VPa0 = get\_vardata(PA,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].VPv0 = get\_vardata(PV,ZPVOLUME)\-\>normal;}} \L{\LB{ savedsim[0].bv = get\_vardata(SYSTEM,VOLUME)\-\>normal;}} \L{\LB{ savedsim[0].Ra = get\_vardata(SC,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Rv = get\_vardata(SV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].RPv = get\_vardata(PC,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Rli = get\_vardata(PV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Rlo = get\_vardata(LV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Rro = get\_vardata(RV,RESISTANCE)\-\>normal;}} \L{\LB{ savedsim[0].Ca = get\_vardata(SA,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[0].Cv = get\_vardata(SV,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[0].CPa = get\_vardata(PA,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[0].CPv = get\_vardata(PV,CAPACITANCE)\-\>normal;}} \L{\LB{ savedsim[0].Cldias = get\_vardata(LV,CAPACITANCE\_DIAS)\-\>normal;}} \L{\LB{ savedsim[0].Clsys = get\_vardata(LV,CAPACITANCE\_SYS)\-\>normal;}} \L{\LB{ savedsim[0].Crdias = get\_vardata(RV,CAPACITANCE\_DIAS)\-\>normal;}} \L{\LB{ savedsim[0].Crsys = get\_vardata(RV,CAPACITANCE\_SYS)\-\>normal;}} \L{\LB{ savedsim[0].pth = get\_vardata(SYSTEM,PRESSURE)\-\>normal;}} \L{\LB{ savedsim[0].hr = get\_vardata(SYSTEM,HEARTRATE)\-\>normal;}} \L{\LB{ \K{return}(\&savedsim[0]);}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\/*PUBLIC*\/\CE{}}} \L{\LB{SIMULATION *getsimulation(pathology)}} \L{\LB{\K{int} pathology;}} \L{\LB{\{}} \L{\LB{ \K{if} (pathology \< 0 \|\| pathology \>= NEXAMPLES)}} \L{\LB{ fprintf(stderr,\S{}\"Bad physiologic state code to getsimulation.\!n\"\SE{});}} \L{\LB{ \K{return}((SIMULATION *) \&(savedsim[pathology]));}} \L{\LB{\}}} \L{\LB{}} \File{patient.c},{18:33},{Aug 18 1990} \L{\LB{\C{}\/*}} \L{\LB{ *\$Source: \/mit\/hst\/src\/data\/RCS\/patient.c,v \$}} \L{\LB{ *\/\CE{}}} \L{\LB{}} \L{\LB{\K{\#ifndef} lint}} \L{\LB{\K{static} \K{char} *rcs=\S{}\"\$Header: \/mit\/hst\/src\/data\/RCS\/patient.c,v 2.2 90\/08\/18 18:31:30 tldavis Exp \$\"\SE{};}} \L{\LB{\K{\#endif}}\Tab{8}{lint}} \L{\LB{}} \L{\LB{\K{\#include} \}} \L{\LB{\K{\#include} \}} \L{\LB{\K{\#include} \}} \L{\LB{\K{\#include} \S{}\"..\/sim\/CVDefs.h\"\SE{}}} \L{\LB{\K{\#include} \S{}\"Parameter.h\"\SE{}}} \L{\LB{}} \L{\LB{\C{}\/*************************************}} \L{\LB{ *}} \L{\LB{ * Public Routines}} \L{\LB{ *}} \L{\LB{ * ONLY ONE VARDATA STRUCTURE, RESET BEFORE EACH PATIENT CHANGE}} \L{\LB{ *************************************\/\CE{}}} \L{\LB{}} \L{\LB{\C{}\/*PUBLIC*\/\CE{}}} \L{\LB{\K{char} *LoadPatient(path)}} \L{\LB{\K{char} *path;}} \L{\LB{\{}} \L{\LB{ FILE *fp;}} \L{\LB{ \K{static} \K{char} line[256], *p, history[10000];}} \L{\LB{ \K{int} placeCode = \-1, typeCode = \-1;}} \L{\LB{ \K{double} value;}} \L{\LB{ VarData *vdPtr;}} \L{\LB{}} \L{\LB{ history[0] = \S{}\'\!0\'\SE{};}} \L{\LB{ \K{if} ((fp = fopen(path, \S{}\"r\"\SE{})) == NULL) \{}} \L{\LB{ fprintf(stderr, \S{}\"Can\'t open patient file \%s.\!n\"\SE{},path);}} \L{\LB{ exit(1);}} \L{\LB{ \}}} \L{\LB{}} \L{\LB{ \C{}\/* discard leading comments*\/\CE{}}} \L{\LB{ \K{while} (fgets(line, \K{sizeof}(line), fp) != NULL)}} \L{\LB{ \K{if} (line[0] != \S{}\'\#\'\SE{}) \K{break};}} \L{\LB{}} \L{\LB{ \C{}\/* read history up until comment *\/\CE{}}} \L{\LB{ \K{do} }} \L{\LB{ strcat(history, line);}} \L{\LB{ \K{while} (fgets(line, \K{sizeof}(line), fp) != NULL \&\& line[0] != \S{}\'\#\'\SE{});}} \L{\LB{}} \L{\LB{ \C{}\/* read parameter updates *\/\CE{}}} \L{\LB{ \K{while} (fgets(line, \K{sizeof}(line), fp) != NULL) \{}} \L{\LB{ \K{if} (line[0] == \S{}\'\#\'\SE{}) \K{continue}; \C{}\/* discard comments from now on *\/\CE{}}} \L{\LB{ \K{if} (line[0] == \S{}\'\!0\'\SE{} \|\| line[1] == \S{}\'\!0\'\SE{}) \K{break};}} \L{\LB{ p = line; \K{while} (!isalpha(*p)) p++;}} \L{\LB{}} \L{\LB{ \K{if} (strncmp(p, \S{}\"l\"\SE{}, 1) == 0) placeCode = LV;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"r\"\SE{}, 1) == 0) placeCode = RV;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"a\"\SE{}, 1) == 0) placeCode = SA;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"v\"\SE{}, 1) == 0) placeCode = SV;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"pa\"\SE{},2) == 0) placeCode = PA;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"pv\"\SE{},2) == 0) placeCode = PV;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"micro\"\SE{},1)==0) placeCode = SC;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"pmicro\"\SE{},2)==0)placeCode = PC;}} \L{\LB{ \K{else} \K{if} (strncmp(p,\S{}\"sys\"\SE{},3) == 0) placeCode = SYSTEM;}} \L{\LB{ \K{else} \{fprintf(stderr,\S{}\"Bad Place \%s in file \%s.\!n\"\SE{}, p, path); }} \L{\LB{}\Tab{8}{ exit(1);\}}} \L{\LB{ \K{while} (isalpha(*p)) p++;}} \L{\LB{ \K{while} (isspace(*p)) p++;}} \L{\LB{}} \L{\LB{ \K{if} (strncmp(p, \S{}\"csys\"\SE{}, 4) == 0) typeCode = CAPACITANCE\_SYS;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"cdias\"\SE{}, 4) == 0) typeCode = CAPACITANCE\_DIAS;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"cap\"\SE{}, 3) == 0) typeCode = CAPACITANCE;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"zvol\"\SE{},4) == 0) typeCode = ZPVOLUME;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"zp\"\SE{}, 2) == 0) typeCode = ZPVOLUME;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"res\"\SE{}, 3) == 0) typeCode = RESISTANCE;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"hr\"\SE{}, 2) == 0) typeCode = HEARTRATE;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"pres\"\SE{}, 4) == 0) typeCode = PRESSURE;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"vol\"\SE{}, 3) == 0) typeCode = VOLUME;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"flow\"\SE{}, 4) == 0) typeCode = FLOW;}} \L{\LB{ \K{else} \K{if} (strncmp(p, \S{}\"time\"\SE{}, 4) == 0) typeCode = TIME;}} \L{\LB{ \K{else} \{fprintf(stderr,\S{}\"Bad Type \%s in file \%s.\!n\"\SE{}, p, path); }} \L{\LB{}\Tab{8}{ exit(1);\}}} \L{\LB{ \K{while} (isalpha(*p)) p++;}} \L{\LB{ \K{while} (isspace(*p)) p++;}} \L{\LB{ }} \L{\LB{ sscanf(p,\S{}\"\%lf\"\SE{}, \&value);}} \L{\LB{}} \L{\LB{ vdPtr = get\_vardata(placeCode, typeCode);}} \L{\LB{\K{\#ifdef} DEBUG}} \L{\LB{ printf(\S{}\"Patient: place \%d type \%d old value \%lf new value \%lf\!n\"\SE{},placeCode,}} \L{\LB{}\Tab{8}{ typeCode, vdPtr\-\>normal, value);}} \L{\LB{\K{\#endif}}} \L{\LB{ vdPtr\-\>normal = value;}} \L{\LB{ \}}} \L{\LB{}} \L{\LB{ \K{return}(history);}} \L{\LB{\}}} \File{test.parameter.c},{18:33},{Aug 18 1990} \L{\LB{\C{}\/*}} \L{\LB{ *}\Tab{8}{\$Source: \/mit\/hst\/src\/data\/RCS\/test.parameter.c,v \$}} \L{\LB{ *}\Tab{8}{\$Header: \/mit\/hst\/src\/data\/RCS\/test.parameter.c,v 2.0 90\/08\/06 17:51:04 tldavis Stab \$}} \L{\LB{ *\/\CE{}}} \L{\LB{}} \L{\LB{\K{\#ifndef} lint}} \L{\LB{\K{static} \K{char} *rcsid\_test\_parameter\_c = \S{}\"\$Header: \/mit\/hst\/src\/data\/RCS\/test.parameter.c,v 2.0 90\/08\/06 17:51:04 tldavis Stab \$\"\SE{};}} \L{\LB{\K{\#endif}}\Tab{8}{lint}} \L{\LB{}} \L{\LB{\K{\#include} \S{}\"..\/include\/cvdefs.h\"\SE{}}} \L{\LB{}} \L{\LB{\Proc{main}main()}} \L{\LB{\{}} \L{\LB{ \K{extern} \K{int} *get\_varlist();}} \L{\LB{ \K{int} *v, place, type, n;}} \L{\LB{}} \L{\LB{ LoadParameterData(\S{}\"db\"\SE{});}} \L{\LB{ \K{for} (;;) \{}} \L{\LB{ printf(\S{}\"place, type?\!n\"\SE{});}} \L{\LB{ scanf(\S{}\"\%d \%d\"\SE{}, \&place, \&type);}} \L{\LB{ v = get\_varlist (place, type, DEPENDENT);}} \L{\LB{ printf(\S{}\"ENTERED: \%d \%d \!n\"\SE{}, place, type);}} \L{\LB{ \K{for} (n=0; v[n] != ENDVAR; n++)}} \L{\LB{ printf(\S{}\"DEPENDENT var \%d = \%d \!n\"\SE{}, n, v[n]);}} \L{\LB{ v = get\_varlist (place, type, INDEPENDENT);}} \L{\LB{ \K{for} (n=0; v[n] != ENDVAR; n++)}} \L{\LB{ printf(\S{}\"INDEPENDENT var \%d = \%d \!n\"\SE{}, n, v[n]);}} \L{\LB{ \}}} \L{\LB{\}}}