-+-+-+-+-+-+-+-+ START OF PART 224 -+-+-+-+-+-+-+-+ X sprintf(pointprom, "%s, x ? ", prom); X t.x = readreal(pointprom); X sprintf(pointprom, "%s, y ? ", prom); X t.y = readreal(pointprom); X sprintf(pointprom, "%s, z ? ", prom); X t.z = readreal(pointprom); X return t; X`7D /* readvector3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic Plimit3 readlimit3(C(Pchar *) prom) XPreANSI(Pchar *prom) X/* X** description:`20 X** input params:`20 X** output params:`20 X** return value:`20 X*/ X`7B X Plimit3 t; X Pchar pointprom`5B255`5D; X X sprintf(pointprom, "%s, xmin ? ", prom); X t.xmin = readreal(pointprom); X sprintf(pointprom, "%s, ymin ? ", prom); X t.ymin = readreal(pointprom); X sprintf(pointprom, "%s, zmin ? ", prom); X t.zmin = readreal(pointprom); X sprintf(pointprom, "%s, xmax ? ", prom); X t.xmax = readreal(pointprom); X sprintf(pointprom, "%s, ymax ? ", prom); X t.ymax = readreal(pointprom); X sprintf(pointprom, "%s, zmax ? ", prom); X t.zmax = readreal(pointprom); X return t; X`7D /* readlimit3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readpickpath(C(Ppickpath *) path, C(Pchar *) desc) XPreANSI(Ppickpath *path) XPreANSI(Pchar *desc) X`7B X Pint i; X Pchar str`5B255`5D; X X sprintf(str, "%s, depth", desc); X path->depth = readinteger(str); X path->pick_path = (Ppickpathel *)calloc(path->depth, sizeof(Ppickpathel)); X for (i = 0; i < path->depth; i++) X `7B X sprintf(str, "%s, structure identifier `5B%d`5D", desc, i); `20 X path->pick_path`5Bi`5D.struct_id = readinteger(str); X sprintf(str, "%s, pick identifier `5B%d`5D", desc, i); `20 X path->pick_path`5Bi`5D.pick_id = readinteger(str); X sprintf(str, "%s, element number `5B%d`5D", desc, i); `20 X path->pick_path`5Bi`5D.el_num = readinteger(str); X `7D X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readpointlst(C(Ppointlst *) plist) XPreANSI(Ppointlst *plist) X/* X** description:`20 X** input params:`20 X** output params:`20 X** return value:`20 X*/ X`7B X Pint i, n; X Pchar prom`5B30`5D; X X plist->number = readinteger("Number of points ? "); X plist->points = (Ppoint *)calloc(plist->number, sizeof(Ppoint)); X for (i = 0; i < plist->number; i++)`20 X `7B X sprintf(prom, "Point %d", i+1); X plist->points`5Bi`5D = readpoint(prom); X if (writingscript) X phinprintf(PTKEOUTPUT, "\n"); X `7D X`7D /* readpointlst3 */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readpointlst3(C(Ppointlst3 *) plist) XPreANSI(Ppointlst3 *plist) X/* X** description:`20 X** input params:`20 X** output params:`20 X** return value:`20 X*/ X`7B X Pint i, n; X Pchar prom`5B30`5D; X X plist->number = readinteger("Number of points ? "); X plist->points = (Ppoint3 *)calloc(plist->number, sizeof(Ppoint3)); X for (i = 0; i < plist->number; i++)`20 X `7B X sprintf(prom, "Point %d", i+1); X plist->points`5Bi`5D = readpoint3(prom); X if (writingscript) X phinprintf(PTKEOUTPUT, "\n"); X `7D X`7D /* readpointlst3 */ X X/*-------------------------------------------------------------------------- V-*/ X Xstatic void readpointarray(C(Pint) numpts, C(Ppoint *) plist) XPreANSI(Pint numpts) XPreANSI(Ppoint *plist) X/* X** description:`20 X** input params:`20 X** output params:`20 X** return value:`20 X*/ X`7B X Pint i, n; X Pchar prom`5B30`5D; X X for (i = 0; i < numpts; i++)`20 X `7B X sprintf(prom, "Point %d", i+1); X plist`5Bi`5D = readpoint(prom); X if (writingscript) X phinprintf(PTKEOUTPUT, "\n"); X `7D X`7D /* readpointarray */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readpoint3array(C(Pint) numpts, C(Ppoint3 *) plist) XPreANSI(Pint numpts) XPreANSI(Ppoint3 *plist) X/* X** description:`20 X** input params:`20 X** output params:`20 X** return value:`20 X*/ X`7B X Pint i, n; X Pchar prom`5B30`5D; X X for (i = 0; i < numpts; i++)`20 X `7B X sprintf(prom, "Point %d", i+1); X plist`5Bi`5D = readpoint3(prom); X if (writingscript) X phinprintf(PTKEOUTPUT, "\n"); X `7D X`7D /* readpoint3array */ X X/*-------------------------------------------------------------------------- V-*/ X Xstatic Pcobundl readcolour() X/* X** description:`20 X** input params:`20 X** output params:`20 X** return value:`20 X*/ X`7B X Pcobundl t; X X#ifdef SUN X t.x = readreal("red ? "); X t.y = readreal("green ? "); X t.z = readreal("blue ? "); X#endif X#ifdef VMS X t.rgb.r = readreal("red ? "); X t.rgb.g = readreal("green ? "); X t.rgb.b = readreal("blue ? "); X#endif `20 X return t; X`7D /* readcolour */ X X/*-------------------------------------------------------------------------- V-*/ X Xstatic void readexecreflst(C(Pexecreflst *) reflist, C(Pchar *) prom) XPreANSI(Pexecreflst *reflist) XPreANSI(Pchar *prom) X`7B X Pint i, num; X Pchar prompt`5B255`5D; X X sprintf(prompt, "%s, number ? ", prom); X reflist->number = readinteger(prompt); X reflist->ers = (Pexecref *)calloc(reflist->number, sizeof(Pexecref)); X for (i = 0; i < reflist->number; i++) X `7B X sprintf(prompt, "%s, execute reference `5B%d`5D, structure identifier ? V ",`20 X prom, i); X reflist->ers`5Bi`5D.struct_id = readinteger(prompt); X sprintf(prompt, "%s, execute reference `5B%d`5D, element number ? ",`20 X prom, i); X reflist->ers`5Bi`5D.elem_num = readinteger(prompt); X `7D `20 X`7D X X/*-------------------------------------------------------------------------- V*/ X X#ifdef SUN Xstatic void readfilterlst(C(Pfilterlst *) filtlist, C(Pchar *) prom) XPreANSI(Pfilterlst *filtlist) XPreANSI(Pchar *prom) X`7B X Pint i, num; X Pchar prompt`5B255`5D; X X sprintf(prompt, "%s, number of filters ? ", prom); X filtlist->num_filters = readinteger(prompt); X filtlist->filters = (Pfilter *)calloc(filtlist->num_filters, X sizeof(Pfilter)); X for (i = 0; i < filtlist->num_filters; i++) X `7B X sprintf(prompt, "%s, filter `5B%d`5D, inclusion set, number ? ", prom, i V); X filtlist->filters`5Bi`5D.incl_set.number = num = readinteger(prompt); X filtlist->filters`5Bi`5D.incl_set.integers = (Pint *)calloc(num,`20 X sizeof(Pint)); X sprintf(prompt, "%s, filter `5B%d`5D, inclusion set", prom, i); X readintarray(num, filtlist->filters`5Bi`5D.incl_set.integers, prompt, X PTKENAME); X sprintf(prompt, "%s, filter `5B%d`5D, exclusion set, number ? ", prom, i V); X filtlist->filters`5Bi`5D.excl_set.number = num = readinteger(prompt); X filtlist->filters`5Bi`5D.excl_set.integers = (Pint *)calloc(num,`20 X sizeof(Pint)); X sprintf(prompt, "%s, filter `5B%d`5D, exclusion set", prom, i); X readintarray(num, filtlist->filters`5Bi`5D.excl_set.integers, prompt, X PTKENAME); X `7D `20 X`7D X#endif X X/*-------------------------------------------------------------------------- V*/ X Xstatic ptkboolean inlist(C(Pchar **) strlist, C(Pint) lenlist, C(Pchar *) st Vr, X C(Pint *) ind)`20 XPreANSI(Pchar **strlist) XPreANSI(Pint lenlist) XPreANSI(Pchar *str) XPreANSI(Pint *ind) X/* X** description: searches list of strings for given string. X** input params: strlist - pointer to string list. X** lenlist - length of string list. X** str - string to search. X** output params: none. X** return value: index of found string, -1 if not found. X** special notes:`20 X*/ X`7B X ptkboolean found; X Pint i; X X found = FALSE; X *ind = -1; X i = 0; X while ((found == FALSE) && (i < lenlist)) X `7B X if (strcmp(strlist`5Bi`5D, str) == 0) X found = TRUE; X else X i++; X `7D X if (found) X *ind = i; X return found; X`7D /* inlist */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic ptkboolean substrinlist(C(Pchar **) strlist, C(Pint) lenlist,`20 X C(Pchar *) str, C(Pint *) ind)`20 XPreANSI(Pchar **strlist) XPreANSI(Pint lenlist) XPreANSI(Pchar *str) XPreANSI(Pint *ind) X/* X** description: searches list of strings for given string. X** input params: strlist - pointer to string list. X** lenlist - length of string list. X** str - string to search. X** output params: none. X** return value: index of found string, -1 if not found. X** special notes:`20 X*/ X`7B X ptkboolean found; X Pint i; X X found = FALSE; X *ind = -1; X i = 0; X while ((found == FALSE) && (i < lenlist)) X `7B X if (strncmp(strlist`5Bi`5D, str, strlen(str)) == 0) X found = TRUE; X else X i++; X `7D X if (found) X *ind = i; X return found; X`7D /* inlist */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic Pint getphigsenum(C(ptkephigsenum) phigsenum, C(Pchar *) enumstring) XPreANSI(ptkephigsenum phigsenum) XPreANSI(Pchar *enumstring) X/* X** description:`20 X** input params:`20 X** output params:`20 X** return value:`20 X*/ X`7B X Pint enumval; X ptkboolean found; X X switch (phigsenum) X `7B X case PTKEWSDEP: X found = inlist(Pwsdepnames, 2, enumstring, &enumval); X break; X X case PTKESYSTEMSTATE: X found = inlist(Psystemstatenames, 2, enumstring, &enumval); X break; X X case PTKEWSSTATE: X found = inlist(Pwsstatenames, 2, enumstring, &enumval); X break; X X case PTKESTRUCTSTATE: X found = inlist(Pstructstatenames, 2, enumstring, &enumval); X break; X X case PTKESTRUCTSTATUS: X found = inlist(Pstructstatusnames, 3, enumstring, &enumval); X break; X X case PTKEARCHIVESTATE: X found = inlist(Parchivestatenames, 2, enumstring, &enumval); X break; X X case PTKEWSCLASS: X found = inlist(Pwsclassnames, 3, enumstring, &enumval); X break; X X case PTKEWSCAT: X found = inlist(Pwscatnames, 5, enumstring, &enumval); X break; X X case PTKECONTROL: X found = inlist(Pcontrolnames, 2, enumstring, &enumval); X break; X X case PTKEREGEN: X found = inlist(Pregennames, 2, enumstring, &enumval); X break; X X case PTKEDEFMODE: X found = inlist(Pdefmodenames, 5, enumstring, &enumval); X break; X X case PTKEMOD: X found = inlist(Pmodnames, 3, enumstring, &enumval); X break; X X case PTKESIMULTEV: X found = inlist(Psimultevnames, 2, enumstring, &enumval); X break; X X case PTKESTRUCTNETSRC: X found = inlist(Pstructnetsrcnames, 2, enumstring, &enumval); X break; X X case PTKEDSPSURF: X found = inlist(Pdspsurfnames, 2, enumstring, &enumval); X break; X X case PTKEVISUALREP: X found = inlist(Pvisualrepnames, 3, enumstring, &enumval); X break; X X case PTKETXPREC: X found = inlist(Ptxprecnames, 3, enumstring, &enumval); X break; X X case PTKETXPATH: X found = inlist(Ptxpathnames, 4, enumstring, &enumval); X break; X X case PTKETXHOR: X found = inlist(Ptxhornames, 4, enumstring, &enumval); X break; X X case PTKETXVER: X found = inlist(Ptxvernames, 5, enumstring, &enumval); X break; X X case PTKEINTERSTYLE: X found = inlist(Pinterstylenames, 5, enumstring, &enumval); X break; X X case PTKEEDGEF: X found = inlist(Pedgefnames, 2, enumstring, &enumval); X break; X X case PTKEATTRID: X found = inlist(Pattridnames, 18, enumstring, &enumval); X break; X X case PTKEASF: X found = inlist(Pasfnames, 2, enumstring, &enumval); X break; X X case PTKECOAVAIL: X found = inlist(Pcoavailnames, 2, enumstring, &enumval); X break; X X case PTKECOMPTYPE: X found = inlist(Pcomptypenames, 3, enumstring, &enumval); X break; X X case PTKEPROJTYPE: X found = inlist(Pprojtypenames, 2, enumstring, &enumval); X break; X X case PTKECLIP: X found = inlist(Pclipnames, 2, enumstring, &enumval); X break; X X case PTKEVPRI: X found = inlist(Pvprinames, 2, enumstring, &enumval); X break; X X case PTKECONFRES: X found = inlist(Pconfresnames, 3, enumstring, &enumval); X break; X X case PTKEPFCF: X found = inlist(Ppfcfnames, 3, enumstring, &enumval); X break; X X case PTKEPATHORDER: X found = inlist(Ppathordernames, 2, enumstring, &enumval); X break; X X case PTKEIMODE: X found = inlist(Pimodenames, 3, enumstring, &enumval); X break; X X case PTKEESW: X found = inlist(Peswnames, 2, enumstring, &enumval); X break; X X case PTKEISTATUS: X found = inlist(Pistatusnames, 2, enumstring, &enumval); X break; X X case PTKECHOICESTATUS: X found = inlist(Pchoicestatusnames, 2, enumstring, &enumval); X break; X X case PTKEQCHOICESTATUS: X found = inlist(Pqchoicestatusnames, 3, enumstring, &enumval); X break; X X case PTKEQPICKSTATUS: X found = inlist(Pqpickstatusnames, 3, enumstring, &enumval); X break; X X case PTKEPICKSTATUS: X found = inlist(Ppickstatusnames, 2, enumstring, &enumval); X break; X X case PTKEOPENSTRUCTSTATUS: X found = inlist(Popenstructstatusnames, 2, enumstring, &enumval); X break; X X case PTKEFCLASS: X found = inlist(Pfclassnames, 6, enumstring, &enumval); X break; X X case PTKEICLASS: X found = inlist(Piclassnames, 7, enumstring, &enumval); X break; X X case PTKEPRF: X found = inlist(Pprfnames, 2, enumstring, &enumval); X break; X X case PTKEINQTYPE: X found = inlist(Pinqtypenames, 2, enumstring, &enumval); X break; X X case PTKEUPDATEST: X found = inlist(Pupdatestnames, 2, enumstring, &enumval); X break; X X case PTKEDEVUNITS: X found = inlist(Pdevunitsnames, 2, enumstring, &enumval); X break; X X case PTKEMODTYPE: X found = inlist(Pmodtypenames, 3, enumstring, &enumval); X break; X X case PTKEATTRS: X found = inlist(Pattrsnames, 5, enumstring, &enumval); X break; X X case PTKEELTYPE: +-+-+-+-+-+-+-+- END OF PART 224 +-+-+-+-+-+-+-+-