-+-+-+-+-+-+-+-+ START OF PART 225 -+-+-+-+-+-+-+-+ X found = inlist(Peltypenames, 70, enumstring, &enumval); X break; X X case PTKEEDITMODE: X found = inlist(Peditmodenames, 2, enumstring, &enumval); X break; X X case PTKEREFF: X found = inlist(Preffnames, 2, enumstring, &enumval); X break; X X case PTKECOVALID: X found = inlist(Pcovalidnames, 2, enumstring, &enumval); X break; X X case PTKEERRORMODE: X found = inlist(Perrormodenames, 2, enumstring, &enumval); X break; X X case PTKESRCHDIR: X found = inlist(Psrchdirnames, 2, enumstring, &enumval); X break; X X case PTKESRCHSTATUS: X found = inlist(Psrchstatusnames, 2, enumstring, &enumval); X break; X X case PTKESRCHELTYPE: X found = inlist(Psrcheltypenames, 71, enumstring, &enumval); X break; X X#ifdef SUN X case PTKEBASENAME: X found = inlist(Pbasenames, 4, enumstring, &enumval); X break; X X case PTKEWSTYPEATTR: X found = inlist(Pwsattrnames, 41, enumstring, &enumval); X break; X X case PTKEDBLBUFF: X found = inlist(Pdblbuffnames, 3, enumstring, &enumval); X break; X X case PTKEUSAGE: X found = inlist(Pusagenames, 3, enumstring, &enumval); X break; X X case PTKEACCUSAGE: X found = inlist(Paccusagenames, 11, enumstring, &enumval); X break; X X case PTKECOLOURMODE: X found = inlist(Pcolourmodenames, 2, enumstring, &enumval); X break; X X case PTKECGMENCODING: X found = inlist(Pcgmencodingnames, 3, enumstring, &enumval); X break; X X case PTKECGMCONFORMANCE: X found = inlist(Pcgmconformancenames, 3, enumstring, &enumval); X break; X X case PTKECGMVDCPRECISION: X found = inlist(Pcgmvdcprecisionnames, 2, enumstring, &enumval); X break; X X case PTKEBGCLEAR: X found = inlist(Pbgclearnames, 2, enumstring, &enumval); X break; X X case PTKEUSEDECOMP: X found = inlist(Pdcmpnames, 2, enumstring, &enumval); X break; X#endif X `7D X return enumval; X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic Pint readphigsenum(C(ptkephigsenum) phigsenum, C(Pchar *) prom) XPreANSI(ptkephigsenum phigsenum) XPreANSI(Pchar *prom) X/* X** description:`20 X** input params:`20 X** output params:`20 X** return value:`20 X*/ X`7B X Pint enumval; X Pchar enumstring`5B80`5D; X X readstring(enumstring, prom); X stripstr(enumstring, '"'); X /* make upper case */ X strupper(enumstring); X enumval = getphigsenum(phigsenum, enumstring); X if (writingscript) X phinprintf(PTKEOUTPUT, "%s ", enumstring); X return enumval; X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readenumlist(C(Pint) length, C(Pint *) enumlist,`20 X C(ptkephigsenum) enumtype, C(Pchar *) prom) XPreANSI(Pint length) XPreANSI(Pint *enumlist) XPreANSI(ptkephigsenum enumtype) XPreANSI(Pchar *prom) X`7B X Pint i; X Pchar prompt`5B255`5D; X X for (i = 0; i < length; i++) X `7B X sprintf(prompt, "%s `5B%d`5D ", prom, i); X enumlist`5Bi`5D = readphigsenum(enumtype, prompt); X `7D X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readwstype(C(Pwstype *) wstype) XPreANSI(Pwstype *wstype) X`7B X Pchar str`5B80`5D; X X readstring(str, "workstation type"); X if (strncmp(str, "WST", 3) == 0) X *wstype = wst; X else X#ifdef SUN X `7B X Phigs_base_name base; X X base = getphigsenum(PTKEBASENAME, str); X switch (base) X `7B X case PHIGS_SUN_TOOL:`20 X *wstype = phigs_ws_type_create(phigs_ws_type_sun_tool, 0); X break; X X case PHIGS_SUN_CANVAS:`20 X *wstype = phigs_ws_type_create(phigs_ws_type_sun_canvas, 0); X break; X X#ifndef PRESUN1PT3 X case PHIGS_SUN_CANVAS_REGION:`20 X *wstype = phigs_ws_type_create(phigs_ws_type_sun_canvas_region, 0); X break; X#endif X X case PHIGS_CGM_OUT:`20 X *wstype = phigs_ws_type_create(phigs_ws_type_cgm_out, 0); X break; X `7D X `7D X#endif X#ifdef VMS X `7B X Pint wsint; X `20 X wsint = atoi(str); X *wstype = wsint; X `7D X#endif X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readlnbundl(C(Plnbundl *) bundl) XPreANSI(Plnbundl *bundl) X`7B X bundl->type = readinteger("linetype"); X bundl->width = readreal("linewidth scale factor"); X bundl->colour = readinteger("line colour index"); X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readmkbundl(C(Pmkbundl *) bundl) XPreANSI(Pmkbundl *bundl) X`7B X bundl->type = readinteger("marker type"); X bundl->size = readreal("marker size scale factor"); X bundl->colour = readinteger("marker colour index"); X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readtxbundl(C(Ptxbundl *) bundl) XPreANSI(Ptxbundl *bundl) X`7B X bundl->font = readinteger("text font"); X bundl->precision = readphigsenum(PTKETXPREC, "text precision"); X bundl->exp = readreal("character expansion factor"); X bundl->space = readreal("character spacing"); X bundl->colour = readinteger("text colour index"); X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readinterbundl(C(Pinterbundl *) bundl) XPreANSI(Pinterbundl *bundl) X`7B X bundl->style = readphigsenum(PTKEINTERSTYLE, "interior style"); X bundl->index = readinteger("interior style index"); X bundl->colour = readinteger("interior colour index"); X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readedgebundl(C(Pedgebundl *) bundl) XPreANSI(Pedgebundl *bundl) X`7B X bundl->flag = readphigsenum(PTKEEDGEF, "edge flag"); X bundl->type = readinteger("edgetype"); X bundl->scale = readreal("edgewidth scale factor"); X bundl->colour = readinteger("edge colour index"); X`7D X X/*-------------------------------------------------------------------------- V*/ X X#ifdef VMS Xstatic void readlnattr(C(Plnattr *) attr) XPreANSI(Plnattr *attr) X`7B X attr->type = readphigsenum(PTKEASF, "linetype asf"); `20 X attr->width = readphigsenum(PTKEASF, "line width asf"); `20 X attr->colour = readphigsenum(PTKEASF, "line colour asf"); X attr->index = readinteger("line index"); X readlnbundl(&attr->bundl); `20 X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readinterattr(C(Pinterattr *) attr) XPreANSI(Pinterattr *attr) X`7B X attr->interior = readphigsenum(PTKEASF, "interior asf"); `20 X attr->style = readphigsenum(PTKEASF, "interior style asf"); `20 X attr->colour = readphigsenum(PTKEASF, "interior colour asf"); X attr->index = readinteger("interior index"); X readinterbundl(&attr->bundl); `20 X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readedgeattr(C(Pedgeattr *) attr) XPreANSI(Pedgeattr *attr) X`7B X attr->flag = readphigsenum(PTKEASF, "edge flag asf"); `20 X attr->width = readphigsenum(PTKEASF, "edge width asf"); `20 X attr->colour = readphigsenum(PTKEASF, "edge colour asf"); X attr->index = readinteger("edge index"); X readedgebundl(&attr->bundl); `20 X`7D X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readmkattr(C(Pmkattr *) attr) XPreANSI(Pmkattr *attr) X`7B X attr->type = readphigsenum(PTKEASF, "marker type asf"); `20 X attr->size = readphigsenum(PTKEASF, "marker size asf"); `20 X attr->colour = readphigsenum(PTKEASF, "marker colour asf"); X attr->index = readinteger("marker index"); X readmkbundl(&attr->bundl); `20 X`7D X#endif X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readchoicerec(C(Pint) device, C(Pint) pet, C(Pchoicerec *) rec) XPreANSI(Pint device) XPreANSI(Pint pet) XPreANSI(Pchoicerec *rec) X`7B X#ifdef SUN X switch (device) X `7B X case 1:`20 X case 2: X case 3:`20 X switch (pet) X `7B X case 1: X break; X X case 3: X `7B X Pint i, len; X Pchar **chstrings; X X rec->choicepet3_datarec.number =`20 X readinteger("number of choice strings ? "); X chstrings = (Pchar **)calloc(rec->choicepet3_datarec.number, X sizeof(Pchar *)); X rec->choicepet3_datarec.strings = chstrings; X for (i = 0; i < rec->choicepet3_datarec.number; i++) X`09 `7B X len = readinteger("choice string length ? "); X chstrings`5Bi`5D = (Pchar *)calloc(len, sizeof(Pchar)); `20 X readquote(chstrings`5Bi`5D, "choice string ? "); X `7D X `7D X break; X `7D X break; X X default: break; X `7D X#endif X#ifdef VMS X switch (device) X `7B X case 1: `20 X case 2: X case 3: X case 4: X case 5: X case 6: X case 7: X case 8:`20 X switch (pet) X `7B X case 1: X `7B X Pint i, len; X Pchar **chstrings; X Pchar *title; X X rec->choicepet1_datarec.number =`20 X readinteger("number of choice strings ? "); X chstrings = (Pchar **)calloc(rec->choicepet1_datarec.number, X sizeof(Pchar *)); X rec->choicepet1_datarec.strings = chstrings; X for (i = 0; i < rec->choicepet1_datarec.number; i++) X`09 `7B X len = readinteger("choice string length ? "); X chstrings`5Bi`5D = (Pchar *)malloc(len); `20 X readquote(chstrings`5Bi`5D, "choice string ? "); X `7D X len = readinteger("title string length ? "); X title = (Pchar *)malloc(len); X rec->choicepet1_datarec.title_string = title; X readquote(title, "title string ? "); X `7D X break; X X case 3: X `7B X Pint i, len; X Pchar **chstrings; X Pchar *title; X X rec->choicepet3_datarec.number =`20 X readinteger("number of choice strings ? "); X chstrings = (Pchar **)calloc(rec->choicepet3_datarec.number, X sizeof(Pchar *)); X rec->choicepet3_datarec.strings = chstrings; X for (i = 0; i < rec->choicepet3_datarec.number; i++) X`09 `7B X len = readinteger("choice string length ? "); X chstrings`5Bi`5D = (Pchar *)calloc(len, sizeof(Pchar)); `20 X readquote(chstrings`5Bi`5D, "choice string ? "); X `7D X len = readinteger("title string length ? "); X title = (Pchar *)malloc(len); X rec->choicepet3_datarec.title_string = title; X readquote(title, "title string ? "); X `7D X break; X X case -1: X `7B X Pint i, len; X Pchar **chstrings; X Pchar *title; X X rec->choicepet_1_datarec.number =`20 X readinteger("number of choice strings ? "); X chstrings = (Pchar **)calloc(rec->choicepet_1_datarec.number, X sizeof(Pchar *)); X rec->choicepet_1_datarec.strings = chstrings; X for (i = 0; i < rec->choicepet_1_datarec.number; i++) X`09 `7B X len = readinteger("choice string length ? "); X chstrings`5Bi`5D = (Pchar *)calloc(len, sizeof(Pchar)); `20 X readquote(chstrings`5Bi`5D, "choice string ? "); X `7D X len = readinteger("title string length ? "); X title = (Pchar *)malloc(len); X rec->choicepet_1_datarec.title_string = title; X readquote(title, "title string ? "); X `7D X break; X `7D X break; X X default: break; X `7D X#endif X`7D /* readchoicerec */ X X/*-------------------------------------------------------------------------- V*/ X Xstatic void readlocrec(C(Pint) device, C(Pint) pet, C(Plocrec *) rec) XPreANSI(Pint device) XPreANSI(Pint pet) XPreANSI(Plocrec *rec) X`7B X#ifdef SUN X switch (device) X `7B X case 1:`20 X case 2: X case 3:`20 X case 4: X case 5: X switch (pet) X `7B X case 1: X case 2: X case 3: X break; X X case -2: X rec->ulocpet2_datarec.crosshair_colour = X readinteger("crosshair colour index ? "); X break; X X case -4: X readlnbundl(&rec->ulocpet4_datarec.ln_bundl); X break; X X case -5: X readlnbundl(&rec->ulocpet5_datarec.ln_bundl); X break; X `7D X X default: break; X `7D X#endif X#ifdef VMS X switch (device) X `7B X case 1:`20 X case 2: X case 3:`20 X case 4: X switch (pet) X `7B X case 1: X case 2: X case 3: X break; X X case 4: X readlnattr(&rec->locpet4_datarec.ln); X break; X X case 5: X readphigsenum(PTKEPFCF, rec->locpet5_datarec.pfcf,`20 X "polyline/fillarea control flag"); X switch(rec->locpet5_datarec.pfcf) X`09 `7B X case PPF_POLYLINE: X readlnattr(&rec->locpet5_datarec.attr.ln); X break; X X case PPF_FILLAREA: X readinterattr(&rec->locpet5_datarec.attr.in); X break; X X case PPF_FILLAREA_SET: X readinterattr(&rec->locpet5_datarec.attr.fas.in); X readedgeattr(&rec->locpet5_datarec.attr.fas.edge); X break; X`09 `7D X break; X X case 6: X `7B X Pint len; X Pchar *title; X X len = readinteger("title string length ? "); X title = (Pchar *)malloc(len); X rec->locpet6_datarec.title_string = title; X readquote(title, "title string ? "); X `7D X break; X `20 X case -1: +-+-+-+-+-+-+-+- END OF PART 225 +-+-+-+-+-+-+-+-