void c_plfill3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z) { PLFLT tx[PL_MAXPOLY], ty[PL_MAXPOLY], tz[PL_MAXPOLY]; PLFLT *V[3]; PLINT xpoly[PL_MAXPOLY], ypoly[PL_MAXPOLY]; PLINT i; PLFLT xmin, xmax, ymin, ymax, zmin, zmax, zscale; if (plsc->level < 3) { plabort("plfill3: Please set up window first"); return; } if (n < 3) { plabort("plfill3: Not enough points in object"); return; } if (n > PL_MAXPOLY-1) { plwarn("plfill3: too many points in polygon"); n = PL_MAXPOLY; } plP_gdom(&xmin, &xmax, &ymin, &ymax); plP_grange(&zscale, &zmin, &zmax); /* copy the vertices so we can clip without corrupting the input */ for( i=0; i < n; i++ ) { tx[i] = x[i]; ty[i] = y[i]; tz[i] = z[i]; } if (tx[0] != tx[n-1] || ty[0] != ty[n-1] || tz[0] != tz[n-1]) { tx[n] = tx[0]; ty[n] = ty[0]; tz[n] = tz[0]; n++; } V[0] = tx; V[1] = ty; V[2] = tz; n = plP_clip_poly(n, V, 0, 1, -xmin); n = plP_clip_poly(n, V, 0, -1, xmax); n = plP_clip_poly(n, V, 1, 1, -ymin); n = plP_clip_poly(n, V, 1, -1, ymax); n = plP_clip_poly(n, V, 2, 1, -zmin); n = plP_clip_poly(n, V, 2, -1, zmax); for( i=0; i < n; i++ ) { xpoly[i] = plP_wcpcx(plP_w3wcx( tx[i], ty[i], tz[i] )); ypoly[i] = plP_wcpcy(plP_w3wcy( tx[i], ty[i], tz[i] )); } /* AWI: in the past we have used * plP_fill(xpoly, ypoly, n); * here, but our educated guess is this fill should be done via the clipping * interface instead as below. * No example tests this code so one of our users will end up inadvertently * testing this for us. * * jc: I have checked, and both versions does give the same result, i.e., clipping * to the window boundaries. The reason is that the above plP_clip_poly() does * the clipping. To check this, is enough to diminish the x/y/z min/max arguments in * plw3d() in x08c. But let's keep it, although 10% slower... */ plP_plfclp(xpoly, ypoly, n, plsc->clpxmi, plsc->clpxma, plsc->clpymi, plsc->clpyma, plP_fill); }
void c_plpoin(PLINT n, PLFLT *x, PLFLT *y, PLINT code) { PLINT i, sym, ifont = plsc->cfont; if (plsc->level < 3) { plabort("plpoin: Please set up window first"); return; } if (code < -1 || code > 127) { plabort("plpoin: Invalid code"); return; } if (code == -1) { for (i = 0; i < n; i++) pljoin(x[i], y[i], x[i], y[i]); } else { if (ifont > numberfonts) ifont = 1; sym = *(fntlkup + (ifont - 1) * numberchars + code); for (i = 0; i < n; i++) plhrsh(sym, plP_wcpcx(x[i]), plP_wcpcy(y[i])); } }
void c_plvpor(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax) { if (plsc->level < 1) { plabort("plvpor: Please call plinit first"); return; } if ((xmin >= xmax) || (ymin >= ymax)) { plabort("plvpor: Invalid limits"); return; } if ((plsc->cursub <= 0) || (plsc->cursub > (plsc->nsubx * plsc->nsuby))) { plabort("plvpor: Please call pladv or plenv to go to a subpage"); return; } plsc->vpdxmi = plsc->spdxmi + (plsc->spdxma - plsc->spdxmi) * xmin; plsc->vpdxma = plsc->spdxmi + (plsc->spdxma - plsc->spdxmi) * xmax; plsc->vpdymi = plsc->spdymi + (plsc->spdyma - plsc->spdymi) * ymin; plsc->vpdyma = plsc->spdymi + (plsc->spdyma - plsc->spdymi) * ymax; plsc->vppxmi = plP_dcpcx(plsc->vpdxmi); plsc->vppxma = plP_dcpcx(plsc->vpdxma); plsc->vppymi = plP_dcpcy(plsc->vpdymi); plsc->vppyma = plP_dcpcy(plsc->vpdyma); plsc->clpxmi = MAX(plsc->vppxmi, plsc->phyxmi); plsc->clpxma = MIN(plsc->vppxma, plsc->phyxma); plsc->clpymi = MAX(plsc->vppymi, plsc->phyymi); plsc->clpyma = MIN(plsc->vppyma, plsc->phyyma); plsc->level = 2; }
void c_plscol0(PLINT icol0, PLINT r, PLINT g, PLINT b) { if (plsc->cmap0 == NULL) plscmap0n(0); if (icol0 < 0 || icol0 >= plsc->ncol0) { char buffer[256]; sprintf(buffer, "plscol0: Illegal color table value: %d", (int) icol0); plabort(buffer); return; } if ((r < 0 || r > 255) || (g < 0 || g > 255) || (b < 0 || b > 255)) { char buffer[256]; sprintf(buffer, "plscol0: Invalid RGB color: %d, %d, %d", (int) r, (int) g, (int) b); plabort(buffer); return; } plsc->cmap0[icol0].r = r; plsc->cmap0[icol0].g = g; plsc->cmap0[icol0].b = b; if (plsc->level > 0) plP_state(PLSTATE_CMAP0); }
//-------------------------------------------------------------------------- //! Advance to subpage "page" or to the next page if "page" = 0. //! //! @param page Subpage identifier or 0 //! void c_pladv( PLINT page ) { if ( m_plsc->level < 1 ) { plabort( "pladv: Please call plinit first" ); return; } if ( page > 0 && page <= m_plsc->nsubx * m_plsc->nsuby ) m_plsc->cursub = page; else if ( page == 0 ) { if ( m_plsc->cursub >= m_plsc->nsubx * m_plsc->nsuby ) { plP_eop(); plP_bop(); m_plsc->cursub = 1; } else m_plsc->cursub++; } else { plabort( "pladv: Invalid subpage number" ); return; } plP_setsub(); }
void c_plcol1(PLFLT col1) { PLINT icol1; if (plsc->level < 1) { plabort("plcol1: Please call plinit first"); return; } if (col1 < 0 || col1 > 1) { char buffer[256]; sprintf(buffer, "plcol1: Invalid color map position: %f", (PLFLT) col1); plabort(buffer); return; } icol1 = col1 * plsc->ncol1; icol1 = MIN(icol1, plsc->ncol1-1); plsc->icol1 = icol1; plsc->curcolor.r = plsc->cmap1[plsc->icol1].r; plsc->curcolor.g = plsc->cmap1[plsc->icol1].g; plsc->curcolor.b = plsc->cmap1[plsc->icol1].b; plsc->curcmap = 1; plP_state(PLSTATE_COLOR1); }
void c_plfill(PLINT n, PLFLT *x, PLFLT *y) { PLINT xpoly[PL_MAXPOLY], ypoly[PL_MAXPOLY]; PLINT i; if (plsc->level < 3) { plabort("plfill: Please set up window first"); return; } if (n < 3) { plabort("plfill: Not enough points in object"); return; } if (n > PL_MAXPOLY-1) { plwarn("plfill: too many points in polygon"); n = PL_MAXPOLY; } for (i = 0; i < n; i++) { xpoly[i] = plP_wcpcx(x[i]); ypoly[i] = plP_wcpcy(y[i]); } if (x[0] != x[n-1] || y[0] != y[n-1]) { n++; xpoly[n-1] = plP_wcpcx(x[0]); ypoly[n-1] = plP_wcpcy(y[0]); } plP_plfclp(xpoly, ypoly, n, plsc->clpxmi, plsc->clpxma, plsc->clpymi, plsc->clpyma, plP_fill); }
void c_plstyl(PLINT nms, PLINT *mark, PLINT *space) { short int i; if (plsc->level < 1) { plabort("plstyl: Please call plinit first"); return; } if ((nms < 0) || (nms > 10)) { plabort("plstyl: Broken lines cannot have <0 or >10 elements"); return; } for (i = 0; i < nms; i++) { if ((mark[i] < 0) || (space[i] < 0)) { plabort("plstyl: Mark and space lengths must be > 0"); return; } } plsc->nms = nms; for (i = 0; i < nms; i++) { plsc->mark[i] = mark[i]; plsc->space[i] = space[i]; } plsc->curel = 0; plsc->pendn = 1; plsc->timecnt = 0; plsc->alarm = nms > 0 ? mark[0] : 0; }
void c_plhist(PLINT n, PLFLT *data, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT flags) { PLINT i, bin; PLFLT *x, *y, dx, ymax; if (plsc->level < 1) { plabort("plhist: Please call plinit first"); return; } if (plsc->level < 3 && (flags & 1)) { plabort("plhist: Please set up window first"); return; } if (datmin >= datmax) { plabort("plhist: Data range invalid"); return; } if ( ! (x = (PLFLT *) malloc((size_t) nbin * sizeof(PLFLT)))) { plabort("plhist: Out of memory"); return; } if ( ! (y = (PLFLT *) malloc((size_t) nbin * sizeof(PLFLT)))) { free((void *) x); plabort("plhist: Out of memory"); return; } dx = (datmax - datmin) / nbin; for (i = 0; i < nbin; i++) { x[i] = datmin + i * dx; y[i] = 0.0; } for (i = 0; i < n; i++) { bin = (data[i] - datmin) / dx; if ((flags & 2) == 0) { bin = bin > 0 ? bin : 0; bin = bin < nbin ? bin : nbin - 1; y[bin]++; } else { if(bin >= 0 && bin < nbin) { y[bin]++; } } } if (!(flags & 1)) { ymax = 0.0; for (i = 0; i < nbin; i++) ymax = MAX(ymax, y[i]); plenv(datmin, datmax, (PLFLT) 0.0, (PLFLT) (1.1 * ymax), 0, 0); } /* We pass on the highest couple of bits to the 'plbin' routine */ plbin(nbin, x, y, (flags & (4+8+16+32)) >> 2); free((void *) x); free((void *) y); }
void c_plscmap1l(PLINT itype, PLINT npts, PLFLT *pos, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *rev) { int n; PLFLT h, l, s, r, g, b; if (npts < 2) { plabort("plscmap1l: Must specify at least two control points"); return; } if ( (pos[0] != 0) || (pos[npts-1] != 1)) { plabort("plscmap1l: First, last control points must lie on boundary"); return; } if ( npts > PL_MAX_CMAP1CP ) { plabort("plscmap1l: exceeded maximum number of control points"); return; } /* Allocate if not done yet */ if (plsc->cmap1 == NULL) plscmap1n(0); /* Save control points */ plsc->ncp1 = npts; for (n = 0; n < npts; n++) { if (itype == 0) { h = coord1[n]; l = coord2[n]; s = coord3[n]; } else { r = coord1[n]; g = coord2[n]; b = coord3[n]; c_plrgbhls(r, g, b, &h, &l, &s); } plsc->cmap1cp[n].h = h; plsc->cmap1cp[n].l = l; plsc->cmap1cp[n].s = s; plsc->cmap1cp[n].p = pos[n]; if (rev == NULL) plsc->cmap1cp[n].rev = 0; else plsc->cmap1cp[n].rev = rev[n]; } /* Calculate and set color map */ plcmap1_calc(); }
void c_plvpas(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT aspect) { PLFLT vpxmi, vpxma, vpymi, vpyma; PLFLT vpxmid, vpymid, vpxlen, vpylen, w_aspect, ratio; if (plsc->level < 1) { plabort("plvpas: Please call plinit first"); return; } if ((xmin >= xmax) || (ymin >= ymax)) { plabort("plvpas: Invalid limits"); return; } if (aspect <= 0.0) { c_plvpor(xmin, xmax, ymin, ymax); return; } vpxmi = plP_dcmmx(xmin); vpxma = plP_dcmmx(xmax); vpymi = plP_dcmmy(ymin); vpyma = plP_dcmmy(ymax); vpxmid = (vpxmi + vpxma) / 2.; vpymid = (vpymi + vpyma) / 2.; vpxlen = vpxma - vpxmi; vpylen = vpyma - vpymi; w_aspect = vpylen / vpxlen; ratio = aspect / w_aspect; /* * If ratio < 1, you are requesting an aspect ratio (y/x) less than the natural * aspect ratio of the specified window, and you will need to reduce the length * in y correspondingly. Similarly, for ratio > 1, x length must be reduced. */ if (ratio <= 0.) { plabort("plvpas: Error in aspect ratio setting"); return; } else if (ratio < 1.) vpylen = vpylen * ratio; else vpxlen = vpxlen / ratio; vpxmi = vpxmid - vpxlen / 2.; vpxma = vpxmid + vpxlen / 2.; vpymi = vpymid - vpylen / 2.; vpyma = vpymid + vpylen / 2.; plsvpa(vpxmi, vpxma, vpymi, vpyma); }
void c_pllsty(PLINT lin) { if (plsc->level < 1) { plabort("pllsty: Please call plinit first"); return; } if (lin < 1 || lin > 8) { plabort("pllsty: Invalid line style"); return; } plstyl(line[lin - 1].nels, &line[lin - 1].mark[0], &line[lin - 1].space[0]); }
void c_plpoin3(PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT code) { PLINT i, sym, ifont = plsc->cfont; PLFLT u, v; PLFLT xmin, xmax, ymin, ymax, zmin, zmax, zscale; if (plsc->level < 3) { plabort("plpoin3: Please set up window first"); return; } if (code < -1 || code > 127) { plabort("plpoin3: Invalid code"); return; } plP_gdom(&xmin, &xmax, &ymin, &ymax); plP_grange(&zscale, &zmin, &zmax); if (code == -1) { for (i = 0; i < n; i++) { if(x[i] >= xmin && x[i] <= xmax && y[i] >= ymin && y[i] <= ymax && z[i] >= zmin && z[i] <= zmax) { u = plP_wcpcx(plP_w3wcx( x[i], y[i], z[i] )); v = plP_wcpcy(plP_w3wcy( x[i], y[i], z[i] )); plP_movphy(u,v); plP_draphy(u,v); } } } else { if (ifont > numberfonts) ifont = 1; sym = *(fntlkup + (ifont - 1) * numberchars + code); for( i=0; i < n; i++ ) { if(x[i] >= xmin && x[i] <= xmax && y[i] >= ymin && y[i] <= ymax && z[i] >= zmin && z[i] <= zmax) { u = plP_wcpcx(plP_w3wcx( x[i], y[i], z[i] )); v = plP_wcpcy(plP_w3wcy( x[i], y[i], z[i] )); plhrsh(sym, u, v); } } } return; }
void c_plstripd( PLINT id ) { int i; if ((id < 0) || (id >= MAX_STRIPC) || ((stripc = strip[id]) == NULL)) { plabort("Non existent stripchart"); return; } for (i=0; i<PEN; i++) { if (stripc->npts[i]) { free((void *) stripc->x[i]); free((void *) stripc->y[i]); free(stripc->legline[i]); } } free(stripc->xspec); free(stripc->yspec); free(stripc->labx); free(stripc->laby); free(stripc->labtop); free((void *) stripc); strip[id] = NULL; }
void plio_fread( void *buf, size_t size, size_t nmemb, FILE *stream ) { size_t bytes; dbug_enter( "plio_fread" ); // If the buffer has a size of zero, we should complain if ( size == 0 || nmemb == 0 ) { plwarn( "Zero length buffer size in plio_fread, returning" ); return; } // Clear the error flag for this steam clearerr( stream ); bytes = fread( buf, size, nmemb, stream ); if ( ( bytes < nmemb ) && ferror( stream ) ) { // The read resulted in an error plabort( "Error reading from file" ); } }
void plio_fgets( char *buf, int size, FILE *stream ) { char *s; dbug_enter( "plio_fgets" ); // If the buffer has a size of zero, we should complain if ( size == 0 ) { plwarn( "Zero length buffer size in plio_fgets, returning" ); return; } // Clear the error flag for this steam clearerr( stream ); s = fgets( buf, size, stream ); if ( s == NULL && ferror( stream ) ) { // The read resulted in an error plabort( "Error reading from file" ); } }
void c_plscmap1(PLINT *r, PLINT *g, PLINT *b, PLINT ncol1) { int i; plscmap1n(ncol1); for (i = 0; i < plsc->ncol1; i++) { if ((r[i] < 0 || r[i] > 255) || (g[i] < 0 || g[i] > 255) || (b[i] < 0 || b[i] > 255)) { char buffer[256]; sprintf(buffer, "plscmap1: Invalid RGB color: %d, %d, %d", (int) r[i], (int) g[i], (int) b[i]); plabort(buffer); return; } plsc->cmap1[i].r = r[i]; plsc->cmap1[i].g = g[i]; plsc->cmap1[i].b = b[i]; } if (plsc->level > 0) plP_state(PLSTATE_CMAP1); }
void c_plvsta(void) { PLFLT xmin, xmax, ymin, ymax; PLFLT lb, rb, tb, bb; if (plsc->level < 1) { plabort("plvsta: Please call plinit first"); return; } /* Find out position of subpage boundaries in millimetres, reduce by */ /* the desired border, and convert back into normalized subpage */ /* coordinates */ lb = 8.0 * plsc->chrht; rb = 5.0 * plsc->chrht; tb = 5.0 * plsc->chrht; bb = 5.0 * plsc->chrht; xmin = plP_dcscx(plP_mmdcx((PLFLT) (plP_dcmmx(plsc->spdxmi) + lb))); xmax = plP_dcscx(plP_mmdcx((PLFLT) (plP_dcmmx(plsc->spdxma) - rb))); ymin = plP_dcscy(plP_mmdcy((PLFLT) (plP_dcmmy(plsc->spdymi) + tb))); ymax = plP_dcscy(plP_mmdcy((PLFLT) (plP_dcmmy(plsc->spdyma) - bb))); plvpor(xmin, xmax, ymin, ymax); }
//-------------------------------------------------------------------------- //! Clear current subpage. Subpages can be set with pladv before //! calling plclear. Not all drivers support this. // void c_plclear( void ) { if ( m_plsc->level < 1 ) { plabort( "plclear: Please call plinit first" ); return; } if ( m_plsc->dev_clear ) plP_esc( PLESC_CLEAR, NULL ); else // driver does not support clear, fill using background color { short x[5], y[5]; int ocolor = m_plsc->icol0; x[0] = x[3] = x[4] = (short) m_plsc->sppxmi; x[1] = x[2] = (short) m_plsc->sppxma; y[0] = y[1] = y[4] = (short) m_plsc->sppymi; y[2] = y[3] = (short) m_plsc->sppyma; plcol0( 0 ); plP_fill( x, y, 5 ); plcol0( ocolor ); } }
void c_plline(PLINT n, PLFLT *x, PLFLT *y) { if (plsc->level < 3) { plabort("plline: Please set up window first"); return; } plP_drawor_poly(x, y, n); }
void c_plfont(PLINT ifont) { PLUNICODE fci = PL_FCI_MARK; if (plsc->level < 1) { plabort("plfont: Please call plinit first"); return; } if (ifont < 1 || ifont > 4) { plabort("plfont: Invalid font"); return; } plsc->cfont = ifont; /* Provide some degree of forward compatibility if dealing with * unicode font. But better procedure is to call plsfci directly rather * than using this lame Hershey font interface. */ switch(ifont) { case 1: /* normal = (medium, upright, sans serif) */ plP_hex2fci(PL_FCI_SANS, PL_FCI_FAMILY, &fci); plsfci(fci); break; /* roman = (medium, upright, serif) */ case 2: plP_hex2fci(PL_FCI_SERIF, PL_FCI_FAMILY, &fci); plsfci(fci); break; /* italic = (medium, italic, serif) */ case 3: plP_hex2fci(PL_FCI_ITALIC, PL_FCI_STYLE, &fci); plP_hex2fci(PL_FCI_SERIF, PL_FCI_FAMILY, &fci); plsfci(fci); break; /* script = (medium, upright, script) */ case 4: plP_hex2fci(PL_FCI_SCRIPT, PL_FCI_FAMILY, &fci); plsfci(fci); break; } }
void c_plsym(PLINT n, PLFLT *x, PLFLT *y, PLINT code) { PLINT i; if (plsc->level < 3) { plabort("plsym: Please set up window first"); return; } if (code < 0) { plabort("plsym: Invalid code"); return; } for (i = 0; i < n; i++) { plhrsh(code, plP_wcpcx(x[i]), plP_wcpcy(y[i])); } }
// Calculate continuous time from broken-down time for current stream. void c_plctime( PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec, PLFLT *ctime ) { int ret; double qsas_ctime; ret = ctimeqsas( year, month, day, hour, min, sec, &qsas_ctime, plsc->qsasconfig ); *ctime = (PLFLT) qsas_ctime; if ( ret ) plabort( "plctime: ctimeqsas detected error" ); }
void plfcont(PLFLT (*f2eval) (PLINT, PLINT, PLPointer), PLPointer f2eval_data, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel, void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer), PLPointer pltr_data) { PLINT i, mx, my, nstor, *heapc; mx = lx - kx + 1; my = ly - ky + 1; if (kx < 1 || kx >= lx) { plabort("plfcont: indices must satisfy 1 <= kx <= lx <= nx"); return; } if (ky < 1 || ky >= ly) { plabort("plfcont: indices must satisfy 1 <= ky <= ly <= ny"); return; } nstor = mx * my; heapc = (PLINT *) malloc((size_t) (2*mx + 10 * nstor) * sizeof(PLINT)); if (heapc == NULL) { plabort("plfcont: out of memory in heap allocation"); return; } for (i = 0; i < nlevel; i++) { plcntr(f2eval, f2eval_data, nx, ny, kx-1, lx-1, ky-1, ly-1, clevel[i], &heapc[0], &heapc[nx], &heapc[nx + nstor], nstor, pltr, pltr_data); if (error) { error = 0; goto done; } } done: free((void *) heapc); }
char PLDLLIMPEXP * plstrdup(const char *src) { char *dest = (char *) malloc( (strlen(src) + 1) * sizeof(char) ); if (dest != NULL) strcpy(dest, src); else plabort("Out of memory"); return dest; }
void c_pleop(void) { if (plsc->level < 1) { plabort("pleop: Please call plinit first"); return; } plsc->cursub = plsc->nsubx * plsc->nsuby; plP_eop(); }
void c_plbop(void) { if (plsc->level < 1) { plabort("pladv: Please call plinit first"); return; } plP_bop(); plsc->cursub = 1; plP_setsub(); }
void c_plrgb1(PLINT r, PLINT g, PLINT b) { if (plsc->level < 1) { plabort("plrgb1: Please call plinit first"); return; } if ((r < 0 || r > 255) || (g < 0 || g > 255) || (b < 0 || b > 255)) { plabort("plrgb1: Invalid color"); return; } plsc->icol0 = PL_RGB_COLOR; plsc->curcolor.r = r; plsc->curcolor.g = g; plsc->curcolor.b = b; plsc->curcmap = 0; plP_state(PLSTATE_COLOR0); }
void plfcont(PLFLT (*f2eval) (PLINT, PLINT, PLPointer), PLPointer f2eval_data, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel, void (*pltr) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer), PLPointer pltr_data) { PLINT i, **ipts; if (kx < 1 || kx >= lx) { plabort("plfcont: indices must satisfy 1 <= kx <= lx <= nx"); return; } if (ky < 1 || ky >= ly) { plabort("plfcont: indices must satisfy 1 <= ky <= ly <= ny"); return; } ipts = (PLINT **) malloc(nx*sizeof(PLINT *)); for (i = 0; i < nx; i++) { ipts[i] = (PLINT *) malloc(ny*sizeof(PLINT *)); } for (i = 0; i < nlevel; i++) { plcntr(f2eval, f2eval_data, nx, ny, kx-1, lx-1, ky-1, ly-1, clevel[i], ipts, pltr, pltr_data); if (error) { error = 0; goto done; } } done: for (i = 0; i < nx; i++) { free((void *)ipts[i]); } free((void *)ipts); }
void c_plgspa(PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax) { if (plsc->level < 1) { plabort("plgspa: Please call plinit first"); return; } *xmin = plP_dcmmx(plsc->spdxmi); *xmax = plP_dcmmx(plsc->spdxma); *ymin = plP_dcmmy(plsc->spdymi); *ymax = plP_dcmmy(plsc->spdyma); }