37 #ifdef ENABLE_DYNDRIVERS 49 # ifdef NEED_SYS_TYPE_H 50 # include <sys/types.h> 53 # define NAMLEN( dirent ) strlen( ( dirent )->d_name ) 55 # if defined ( _MSC_VER ) 58 # define dirent direct 59 # define NAMLEN( dirent ) ( dirent )->d_namlen 61 # include <sys/ndir.h> 78 #if defined ( _MSC_VER ) 80 # define getcwd _getcwd 84 #define BUFFER_SIZE 80 85 #define BUFFER2_SIZE 300 86 #define DRVSPEC_SIZE 400 138 plsc->page_status =
AT_EOP;
139 plsc->stream_closed =
FALSE;
142 ( *plsc->dispatch_table->pl_init )( (
struct PLStream_struct *) plsc );
145 if ( plsc->plbuf_write )
156 int skip_driver_eop = 0;
158 if ( plsc->page_status ==
AT_EOP )
161 plsc->page_status =
AT_EOP;
163 if ( plsc->plbuf_write )
168 if ( plsc->eop_handler != NULL )
169 ( *plsc->eop_handler )( plsc->eop_data, &skip_driver_eop );
171 if ( !skip_driver_eop )
174 if ( !plsc->stream_closed )
176 ( *plsc->dispatch_table->pl_eop )( (
struct PLStream_struct *) plsc );
190 int skip_driver_bop = 0;
193 if ( plsc->page_status ==
AT_BOP )
196 plsc->page_status =
AT_BOP;
201 if ( plsc->bop_handler != NULL )
202 ( *plsc->bop_handler )( plsc->bop_data, &skip_driver_bop );
204 if ( !skip_driver_bop )
207 if ( !plsc->stream_closed )
209 ( *plsc->dispatch_table->pl_bop )( (
struct PLStream_struct *) plsc );
214 if ( plsc->plbuf_write )
226 ( *plsc->tidy )( plsc->tidy_data );
228 plsc->tidy_data = NULL;
232 ( *plsc->dispatch_table->pl_tidy )( (
struct PLStream_struct *) plsc );
235 if ( plsc->plbuf_write )
240 plsc->OutFile = NULL;
249 if ( plsc->plbuf_write )
253 if ( !plsc->stream_closed )
255 ( *plsc->dispatch_table->pl_state )( (
struct PLStream_struct *) plsc, op );
266 PLINT clpxmi, clpxma, clpymi, clpyma;
270 if ( plsc->plbuf_write )
281 difilt( &( args->
x ), &( args->
y ), 1, &clpxmi, &clpxma, &clpymi, &clpyma );
286 if ( !plsc->stream_closed )
288 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc, op, ptr );
301 PLINT clpxmi, clpxma, clpymi, clpyma;
305 if ( plsc->plbuf_write )
310 w->
dxmi = plwin->dxmi;
311 w->
dxma = plwin->dxma;
312 w->
dymi = plwin->dymi;
313 w->
dyma = plwin->dyma;
330 w->
wxmi = plwin->wxmi;
331 w->
wxma = plwin->wxma;
332 w->
wymi = plwin->wymi;
333 w->
wyma = plwin->wyma;
338 if ( plsc->dev_swin )
341 if ( !plsc->stream_closed )
343 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
359 if ( !plsc->nopause && *plsc->dispatch_table->pl_wait != NULL )
362 if ( !plsc->stream_closed )
364 ( *plsc->dispatch_table->pl_wait )( (
struct PLStream_struct *) plsc );
380 PLINT i, npts = 2, clpxmi, clpxma, clpymi, clpyma;
384 if ( plsc->plbuf_write )
389 for ( i = 0; i < npts; i++ )
409 PLINT i, clpxmi, clpxma, clpymi, clpyma;
413 if ( plsc->plbuf_write )
418 for ( i = 0; i < npts; i++ )
443 PLINT i, clpxmi, clpxma, clpymi, clpyma;
447 if ( plsc->plbuf_write )
449 plsc->dev_npts = npts;
457 if ( plsc->patt == 0 && !plsc->dev_fill0 )
461 plwarn(
"Driver does not support hardware solid fills, switching to software fill.\n" );
467 if ( plsc->dev_fill1 )
469 plsc->patt = -
ABS( plsc->patt );
477 if ( plsc->patt > 0 )
484 for ( i = 0; i < npts; i++ )
508 PLINT i, clpxmi, clpxma, clpymi, clpyma;
512 if ( plsc->plbuf_write )
514 plsc->dev_npts = npts;
523 for ( i = 0; i < npts; i++ )
562 if ( !strncmp(
text,
"0x", 2 ) || !strncmp(
text,
"0X", 2 ) )
567 if ( end != endptr[0] )
570 snprintf( msgbuf,
BUFFER2_SIZE,
"text2num: for base = %d, strtoul found invalid non-numeric character \"%c\" detected in string \"%s\" when looking for \"%c\" ", base, *endptr,
text, end );
574 return (
int) ( endptr -
text );
600 unsigned char hexdigit;
601 unsigned char hexpower;
607 #define N_TextLookupTable 10 623 length = (int) strlen( lookup[i].ptext );
624 if ( !strncmp(
text, lookup[i].ptext, (
size_t) length ) )
626 *hexdigit = lookup[i].hexdigit;
627 *hexpower = lookup[i].hexpower;
641 unsigned char hexdigit, hexpower;
652 len = strlen(
string );
669 for ( i = 0; i < len; i++ )
673 if (
string[i] == esc )
675 switch (
string[i + 1] )
678 i += 2 +
text2num( &
string[i + 2],
')', &code );
688 i += 2 +
text2num( &
string[i + 2],
']', &code );
695 if (
'0' <=
string[i + 2] &&
string[i + 2] <=
'9' )
697 i += 2 +
text2num( &
string[i + 2],
'>', &code );
729 i +=
text2fci( &
string[i + 1], &hexdigit, &hexpower );
751 if (
string[i + 2] ==
'n' )
756 else if (
string[i + 2] ==
'r' )
761 else if (
string[i + 2] ==
'i' )
767 else if (
string[i + 2] ==
's' )
804 else if ( ig == 634 )
806 else if ( ig == 647 )
868 #ifdef HAVE_LIBUNICODE 869 PLCHAR_VECTOR ptr = unicode_get_utf8(
string + i, &unichar );
877 strncpy( tmpstring,
string, 30 );
878 tmpstring[30] =
'\0';
880 tmpstring, strlen(
string ) > 30 ?
"[...]" :
"" );
884 i += (int) ( ptr - (
string + i ) - 1 );
889 if (
string[i] == esc &&
string[i + 1] == esc )
913 unsigned char hexdigit, hexpower;
925 len = strlen(
string );
947 for ( j = i = 0; i < len; i++ )
951 if (
string[i] == esc )
955 switch (
string[i + 1] )
958 i += ( 2 +
text2num( &
string[i + 2],
')', &code ) );
977 i += ( 2 +
text2num( &
string[i + 2],
']', &code ) );
994 if (
'0' <=
string[i + 2] &&
string[i + 2] <=
'9' )
996 i += 2 +
text2num( &
string[i + 2],
'>', &code );
1022 i +=
text2fci( &
string[i + 1], &hexdigit, &hexpower );
1041 if (
string[i + 2] ==
'n' )
1046 else if (
string[i + 2] ==
'r' )
1051 else if (
string[i + 2] ==
'i' )
1057 else if (
string[i + 2] ==
's' )
1092 else if ( ig == 634 )
1094 else if ( ig == 647 )
1120 #ifdef HAVE_LIBUNICODE 1121 PLCHAR_VECTOR ptr = unicode_get_utf8(
string + i, &unichar );
1129 strncpy( tmpstring,
string, 30 );
1130 tmpstring[30] =
'\0';
1132 tmpstring, strlen(
string ) > 30 ?
"[...]" :
"" );
1137 i += (int) ( ptr - (
string + i ) - 1 );
1143 &&
string[i + 1] == esc )
1167 if (
string == NULL )
1170 if ( plsc->dev_text )
1189 if ( plsc->dev_unicode )
1191 if ( plsc->alt_unicode )
1216 len = strlen(
string );
1228 plstr( base, xform, refx, refy,
string );
1248 if ( (
unsigned char) ( tmp & 0x80 ) == 0x00 )
1250 *unichar = (
unsigned int) tmp & 0x7F;
1253 else if ( (
unsigned char) ( tmp & 0xE0 ) == 0xC0 )
1255 *unichar = (
unsigned int) tmp & 0x1F;
1258 else if ( (
unsigned char) ( tmp & 0xF0 ) == 0xE0 )
1260 *unichar = (
unsigned char) tmp & 0x0F;
1263 else if ( (
unsigned char) ( tmp & 0xF8 ) == 0xF0 )
1265 *unichar = (
unsigned char) tmp & 0x07;
1268 else if ( (
unsigned char) ( tmp & 0xFC ) == 0xF8 )
1270 *unichar = (
unsigned char) tmp & 0x03;
1273 else if ( (
unsigned char) ( tmp & 0xFE ) == 0xFC )
1275 *unichar = (
unsigned char) tmp & 0x01;
1286 if ( (
unsigned char) ( tmp & 0xC0 ) == 0x80 )
1288 *unichar = ( *unichar << 6 ) | ( (
unsigned int) tmp & 0x3F );
1297 }
while ( cnt > 0 );
1308 tmp = (
unsigned char *) ptr;
1310 if ( ( unichar & 0xffff80 ) == 0 )
1312 *tmp = (
unsigned char) unichar;
1316 else if ( ( unichar & 0xfff800 ) == 0 )
1318 *tmp = (
unsigned char) 0xc0 | (
unsigned char) ( unichar >> 6 );
1320 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( unichar & (
PLUINT) 0x3f ) );
1324 else if ( ( unichar & 0xff0000 ) == 0 )
1326 *tmp = (
unsigned char) 0xe0 | (
unsigned char) ( unichar >> 12 );
1328 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( ( unichar >> 6 ) & 0x3f ) );
1330 *tmp = (
unsigned char) ( 0x80 | ( (
unsigned char) unichar & 0x3f ) );
1334 else if ( ( unichar & 0xe0000 ) == 0 )
1336 *tmp = (
unsigned char) 0xf0 | (
unsigned char) ( unichar >> 18 );
1338 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( ( unichar >> 12 ) & 0x3f ) );
1340 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( ( unichar >> 6 ) & 0x3f ) );
1342 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( unichar & 0x3f ) );
1359 if ( !plsc->stream_closed )
1361 ( *plsc->dispatch_table->pl_line )( (
struct PLStream_struct *) plsc,
1362 x[0], y[0], x[1], y[1] );
1371 if ( !plsc->stream_closed )
1373 ( *plsc->dispatch_table->pl_polyline )( (
struct PLStream_struct *) plsc,
1383 plsc->dev_npts = npts;
1388 if ( !plsc->stream_closed )
1390 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
1400 plsc->dev_npts = npts;
1405 if ( !plsc->stream_closed )
1407 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
1443 for ( i = 0; i < npts; i++ )
1445 xsc[i] = (
PLINT) ( plsc->dimxax * xsc[i] + plsc->dimxb );
1446 ysc[i] = (
PLINT) ( plsc->dimyay * ysc[i] + plsc->dimyb );
1454 for ( i = 0; i < npts; i++ )
1456 x = (
PLINT) ( plsc->dioxax * xsc[i] + plsc->dioxay * ysc[i] + plsc->dioxb );
1457 y = (
PLINT) ( plsc->dioyax * xsc[i] + plsc->dioyay * ysc[i] + plsc->dioyb );
1467 for ( i = 0; i < npts; i++ )
1469 xsc[i] = (
PLINT) ( plsc->dipxax * xsc[i] + plsc->dipxb );
1470 ysc[i] = (
PLINT) ( plsc->dipyay * ysc[i] + plsc->dipyb );
1479 for ( i = 0; i < npts; i++ )
1481 xsc[i] = (
PLINT) ( plsc->didxax * xsc[i] + plsc->didxb );
1482 ysc[i] = (
PLINT) ( plsc->didyay * ysc[i] + plsc->didyb );
1484 *clpxmi = plsc->diclpxmi;
1485 *clpxma = plsc->diclpxma;
1486 *clpymi = plsc->diclpymi;
1487 *clpyma = plsc->diclpyma;
1491 *clpxmi = plsc->phyxmi;
1492 *clpxma = plsc->phyxma;
1493 *clpymi = plsc->phyymi;
1494 *clpyma = plsc->phyyma;
1579 PLINT x1c, x2c, y1c, y2c;
1593 difilt( x_coords, y_coords, 4, &x1c, &x2c, &y1c, &y2c );
1607 plsc->dipxmin = 0.0;
1608 plsc->dipxmax = 1.0;
1609 plsc->dipymin = 0.0;
1610 plsc->dipymax = 1.0;
1631 if ( plsc->level >= 1 )
1633 if ( plsc->plbuf_write )
1667 PLFLT pxmin, pymin, pxmax, pymax;
1668 PLFLT sxmin, symin, sxmax, symax;
1669 PLFLT rxmin, rymin, rxmax, rymax;
1673 pldebug(
"pldid2pc",
1674 "Relative device coordinates (in): %f, %f, %f, %f\n",
1675 *xmin, *ymin, *xmax, *ymax );
1682 sxmin = ( pxmin - plsc->didxb ) / plsc->didxax;
1683 symin = ( pymin - plsc->didyb ) / plsc->didyay;
1684 sxmax = ( pxmax - plsc->didxb ) / plsc->didxax;
1685 symax = ( pymax - plsc->didyb ) / plsc->didyay;
1692 *xmin = ( rxmin < 0 ) ? 0 : rxmin;
1693 *xmax = ( rxmax > 1 ) ? 1 : rxmax;
1694 *ymin = ( rymin < 0 ) ? 0 : rymin;
1695 *ymax = ( rymax > 1 ) ? 1 : rymax;
1697 pldebug(
"pldid2pc",
1698 "Relative plot coordinates (out): %f, %f, %f, %f\n",
1699 rxmin, rymin, rxmax, rymax );
1713 PLFLT pxmin, pymin, pxmax, pymax;
1714 PLFLT sxmin, symin, sxmax, symax;
1715 PLFLT rxmin, rymin, rxmax, rymax;
1719 pldebug(
"pldip2pc",
1720 "Relative plot coordinates (in): %f, %f, %f, %f\n",
1721 *xmin, *ymin, *xmax, *ymax );
1728 sxmin = pxmin * plsc->didxax + plsc->didxb;
1729 symin = pymin * plsc->didyay + plsc->didyb;
1730 sxmax = pxmax * plsc->didxax + plsc->didxb;
1731 symax = pymax * plsc->didyay + plsc->didyb;
1738 *xmin = ( rxmin < 0 ) ? 0 : rxmin;
1739 *xmax = ( rxmax > 1 ) ? 1 : rxmax;
1740 *ymin = ( rymin < 0 ) ? 0 : rymin;
1741 *ymax = ( rymax > 1 ) ? 1 : rymax;
1743 pldebug(
"pldip2pc",
1744 "Relative device coordinates (out): %f, %f, %f, %f\n",
1745 rxmin, rymin, rxmax, rymax );
1758 plsc->dipxmin = ( xmin < xmax ) ? xmin : xmax;
1759 plsc->dipxmax = ( xmin < xmax ) ? xmax : xmin;
1760 plsc->dipymin = ( ymin < ymax ) ? ymin : ymax;
1761 plsc->dipymax = ( ymin < ymax ) ? ymax : ymin;
1763 if ( xmin == 0. && xmax == 1. && ymin == 0. && ymax == 1. )
1784 xmin = plsc->dipxmin + ( plsc->dipxmax - plsc->dipxmin ) * xmin;
1785 ymin = plsc->dipymin + ( plsc->dipymax - plsc->dipymin ) * ymin;
1786 xmax = plsc->dipxmin + ( plsc->dipxmax - plsc->dipxmin ) * xmax;
1787 ymax = plsc->dipymin + ( plsc->dipymax - plsc->dipymin ) * ymax;
1790 plsdiplt( xmin, ymin, xmax, ymax );
1807 PLINT pxmin, pxmax, pymin, pymax, pxlen, pylen;
1812 if ( !plsc->stream_closed )
1814 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
1820 if ( !( plsc->difilt &
PLDI_PLT ) )
1828 pxlen = pxmax - pxmin;
1829 pylen = pymax - pymin;
1830 pxlen =
MAX( 1, pxlen );
1831 pylen =
MAX( 1, pylen );
1833 plsc->dipxax = plsc->phyxlen / (double) pxlen;
1834 plsc->dipyay = plsc->phyylen / (double) pylen;
1835 plsc->dipxb = plsc->phyxmi - plsc->dipxax * pxmin;
1836 plsc->dipyb = plsc->phyymi - plsc->dipyay * pymin;
1848 *p_xmin = plsc->dipxmin;
1849 *p_xmax = plsc->dipxmax;
1850 *p_ymin = plsc->dipymin;
1851 *p_ymax = plsc->dipymax;
1873 if ( mar == 0. && aspect == 0. && jx == 0. && jy == 0. &&
1894 PLFLT lx, ly, aspect, aspdev;
1895 PLFLT xmin, xmax, xlen, ymin, ymax, ylen;
1896 PLINT pxmin, pxmax, pymin, pymax, pxlen, pylen;
1901 if ( !plsc->stream_closed )
1903 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
1909 if ( !( plsc->difilt &
PLDI_DEV ) )
1914 lx = plsc->phyxlen / plsc->xpmm;
1915 ly = plsc->phyylen / plsc->ypmm;
1919 aspect = plsc->aspori;
1921 aspect = plsc->aspect;
1924 aspect = plsc->aspdev;
1928 plsc->mar = ( plsc->mar > 0.5 ) ? 0.5 : plsc->mar;
1929 plsc->mar = ( plsc->mar < 0.0 ) ? 0.0 : plsc->mar;
1930 plsc->jx = ( plsc->jx > 0.5 ) ? 0.5 : plsc->jx;
1931 plsc->jx = ( plsc->jx < -0.5 ) ? -0.5 : plsc->jx;
1932 plsc->jy = ( plsc->jy > 0.5 ) ? 0.5 : plsc->jy;
1933 plsc->jy = ( plsc->jy < -0.5 ) ? -0.5 : plsc->jy;
1937 xlen = ( aspect < aspdev ) ? ( aspect / aspdev ) : 1.0;
1938 ylen = ( aspect < aspdev ) ? 1.0 : ( aspdev / aspect );
1940 xlen *= ( 1.0 - 2. * plsc->mar );
1941 ylen *= ( 1.0 - 2. * plsc->mar );
1943 xmin = ( 1. - xlen ) * ( 0.5 + plsc->jx );
1946 ymin = ( 1. - ylen ) * ( 0.5 + plsc->jy );
1956 pxlen = pxmax - pxmin;
1957 pylen = pymax - pymin;
1958 pxlen =
MAX( 1, pxlen );
1959 pylen =
MAX( 1, pylen );
1961 plsc->didxax = pxlen / (double) plsc->phyxlen;
1962 plsc->didyay = pylen / (
double) plsc->phyylen;
1963 plsc->didxb = pxmin - plsc->didxax * plsc->phyxmi;
1964 plsc->didyb = pymin - plsc->didyay * plsc->phyymi;
1968 plsc->diclpxmi = (
PLINT) ( plsc->didxax * plsc->phyxmi + plsc->didxb );
1969 plsc->diclpxma = (
PLINT) ( plsc->didxax * plsc->phyxma + plsc->didxb );
1970 plsc->diclpymi = (
PLINT) ( plsc->didyay * plsc->phyymi + plsc->didyb );
1971 plsc->diclpyma = (
PLINT) ( plsc->didyay * plsc->phyyma + plsc->didyb );
1984 *p_aspect = plsc->aspect;
2021 PLFLT x0, y0, lx, ly, aspect;
2027 if ( !plsc->stream_closed )
2029 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
2035 if ( !( plsc->difilt &
PLDI_ORI ) )
2040 x0 = ( plsc->phyxma + plsc->phyxmi ) / 2.;
2041 y0 = ( plsc->phyyma + plsc->phyymi ) / 2.;
2045 cost =
ABS( cos( plsc->diorot *
PI / 2. ) );
2046 sint =
ABS( sin( plsc->diorot *
PI / 2. ) );
2050 aspect = plsc->aspect;
2052 aspect = plsc->aspdev;
2054 if ( plsc->freeaspect )
2055 plsc->aspori = aspect;
2057 plsc->aspori = ( aspect * cost + sint ) / ( aspect * sint + cost );
2059 if ( !( plsc->difilt &
PLDI_DEV ) )
2104 plsc->dioxax = affine_result[0];
2105 plsc->dioxay = affine_result[2];
2106 plsc->dioxb = affine_result[4];
2107 plsc->dioyax = affine_result[1];
2108 plsc->dioyay = affine_result[3];
2109 plsc->dioyb = affine_result[5];
2121 *p_rot = plsc->diorot;
2137 plsetvar( plsc->dimxmin, dimxmin );
2138 plsetvar( plsc->dimxmax, dimxmax );
2139 plsetvar( plsc->dimymin, dimymin );
2140 plsetvar( plsc->dimymax, dimymax );
2141 plsetvar( plsc->dimxpmm, dimxpmm );
2142 plsetvar( plsc->dimypmm, dimypmm );
2161 PLINT pxmin, pxmax, pymin, pymax;
2162 PLFLT dimxlen, dimylen, pxlen, pylen;
2164 if ( ( plsc->dimxmin == plsc->phyxmi ) && ( plsc->dimxmax == plsc->phyxma ) &&
2165 ( plsc->dimymin == plsc->phyymi ) && ( plsc->dimymax == plsc->phyyma ) &&
2166 ( plsc->dimxpmm == plsc->xpmm ) && ( plsc->dimypmm == plsc->ypmm ) )
2174 lx = ( plsc->dimxmax - plsc->dimxmin + 1 ) / plsc->dimxpmm;
2175 ly = ( plsc->dimymax - plsc->dimymin + 1 ) / plsc->dimypmm;
2177 plsc->aspdev = lx / ly;
2181 dimxlen = plsc->dimxmax - plsc->dimxmin;
2182 dimylen = plsc->dimymax - plsc->dimymin;
2184 pxmin = plsc->phyxmi;
2185 pxmax = plsc->phyxma;
2186 pymin = plsc->phyymi;
2187 pymax = plsc->phyyma;
2188 pxlen = pxmax - pxmin;
2189 pylen = pymax - pymin;
2191 plsc->dimxax = pxlen / dimxlen;
2192 plsc->dimyay = pylen / dimylen;
2193 plsc->dimxb = pxmin - pxlen * plsc->dimxmin / dimxlen;
2194 plsc->dimyb = pymin - pylen * plsc->dimymin / dimylen;
2206 if ( plsc->dev_flush )
2209 if ( !plsc->stream_closed )
2211 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
2218 if ( plsc->OutFile != NULL )
2219 fflush( plsc->OutFile );
2242 #ifdef ENABLE_DYNDRIVERS 2264 if ( plsc->level != 0 )
2283 if ( plsc->level != 0 )
2301 PLFLT lx, ly, xpmm_loc, ypmm_loc, aspect_old, aspect_new;
2305 if ( plsc->level != 0 )
2321 if ( plsc->plwindow == NULL )
2323 if ( plsc->program )
2325 if ( ( plsc->plwindow = (
char *) malloc( (
size_t) ( 1 + strlen( plsc->program ) ) * sizeof (
char ) ) ) == NULL )
2327 plexit(
"plinit: Insufficient memory" );
2329 strcpy( plsc->plwindow, plsc->program );
2333 if ( ( plsc->plwindow = (
char *) malloc( (
size_t) 7 *
sizeof (
char ) ) ) == NULL )
2335 plexit(
"plinit: Insufficient memory" );
2337 strcpy( plsc->plwindow,
"PLplot" );
2364 if ( plsc->aspect > 0. )
2366 lx = plsc->phyxlen / plsc->xpmm;
2367 ly = plsc->phyylen / plsc->ypmm;
2368 aspect_old = lx / ly;
2369 aspect_new = plsc->aspect;
2370 plsc->caspfactor = sqrt( aspect_old / aspect_new );
2374 else if ( plsc->freeaspect &&
ABS( cos( plsc->diorot *
PI / 2. ) ) <= 1.e-5 )
2376 lx = plsc->phyxlen / plsc->xpmm;
2377 ly = plsc->phyylen / plsc->ypmm;
2378 aspect_old = lx / ly;
2379 aspect_new = ly / lx;
2380 plsc->caspfactor = sqrt( aspect_old / aspect_new );
2384 plsc->caspfactor = 1.;
2398 if ( plsc->xdigmax == 0 )
2401 if ( plsc->ydigmax == 0 )
2404 if ( plsc->zdigmax == 0 )
2407 if ( plsc->timefmt == NULL )
2413 if ( plsc->qsasconfig == NULL )
2414 c_plconfigtime( 0., 0., 0., 0x0, 0, 0, 0, 0, 0, 0, 0. );
2429 plP_sclp( plsc->phyxmi, plsc->phyxma, plsc->phyymi, plsc->phyyma );
2433 lx = plsc->phyxlen / plsc->xpmm;
2434 ly = plsc->phyylen / plsc->ypmm;
2435 plsc->aspdev = lx / ly;
2448 plP_setpxl( xpmm_loc * plsc->caspfactor, ypmm_loc / plsc->caspfactor );
2467 if (
pls[i] != NULL )
2474 #ifdef ENABLE_DYNDRIVERS 2480 free_mem( loadable_device_list[i].devnam );
2481 free_mem( loadable_device_list[i].description );
2482 free_mem( loadable_device_list[i].drvnam );
2483 free_mem( loadable_device_list[i].tag );
2486 for ( i = 0; i < nloadabledrivers; i++ )
2488 free_mem( loadable_driver_list[i].drvnam );
2518 if ( plsc->level > 0 )
2526 if ( plsc->FileName )
2539 if ( plsc->program )
2541 if ( plsc->server_name )
2543 if ( plsc->server_host )
2545 if ( plsc->server_port )
2549 if ( plsc->plserver )
2551 if ( plsc->auto_path )
2554 if ( plsc->arrow_x )
2556 if ( plsc->arrow_y )
2559 if ( plsc->timefmt )
2568 if ( plsc->mf_infile )
2570 if ( plsc->mf_outfile )
2600 "plsstrm: Illegal stream number %d, must be in [0, %d]\n",
2610 plexit(
"plsstrm: Out of memory." );
2651 if (
pls[i] == NULL )
2657 fprintf( stderr,
"plmkstrm: Cannot create new stream\n" );
2687 if ( !plsc->initialized )
2689 plsc->initialized = 1;
2691 if ( plsc->cmap0 == NULL )
2694 if ( plsc->cmap1 == NULL )
2698 plsc->cmap1_min = 0.0;
2699 plsc->cmap1_max = 1.0;
2743 fprintf( stderr,
"plcpstrm: stream %d not in use\n", (
int) iplsr );
2749 plsc->debug = plsr->
debug;
2757 if ( ( plsc->plbuf_buffer = malloc( plsc->plbuf_buffer_size ) ) == NULL )
2758 plexit(
"plcpstrm: Error allocating plot buffer." );
2775 if ( !( flags & 0x01 ) )
2777 pldebug(
"plcpstrm",
"mapping parameters: %d %d %d %d %f %f\n",
2790 plsc->icol0 = plsr->
icol0;
2791 plsc->ncol0 = plsr->
ncol0;
2792 if ( plsc->cmap0 != NULL )
2793 free( (
void *) plsc->cmap0 );
2795 if ( ( plsc->cmap0 = (
PLColor *) calloc( 1, (
size_t) plsc->ncol0 * sizeof (
PLColor ) ) ) == NULL )
2797 plexit(
"c_plcpstrm: Insufficient memory" );
2800 for ( i = 0; i < plsc->ncol0; i++ )
2805 plsc->icol1 = plsr->
icol1;
2806 plsc->ncol1 = plsr->
ncol1;
2809 if ( plsc->cmap1 != NULL )
2810 free( (
void *) plsc->cmap1 );
2812 if ( ( plsc->cmap1 = (
PLColor *) calloc( 1, (
size_t) plsc->ncol1 * sizeof (
PLColor ) ) ) == NULL )
2814 plexit(
"c_plcpstrm: Insufficient memory" );
2817 for ( i = 0; i < plsc->ncol1; i++ )
2822 if ( plsc->level == 0 )
2850 if ( plsc->dev_initialized )
2852 plsc->dev_initialized = 1;
2864 static int inited = 0;
2865 static int inBuildTree = 0;
2869 int len_currdir, len_builddir;
2876 pldebug(
"plInBuildTree():",
"Not enough buffer space" );
2880 pldebug(
"plInBuildTree(): ",
"current directory >%s<\n", currdir );
2881 pldebug(
"plInBuildTree(): ",
"build directory >%s<\n",
BUILD_DIR );
2889 pldebug(
"plInBuildTree():",
"Not enough buffer space" );
2893 len_currdir = strlen( currdir );
2894 len_builddir = strlen( builddir );
2895 #if defined ( IGNORECASE ) 2896 pldebug(
"plInBuildTree(): ",
"comparing ignoring case\n" );
2899 for (; *pcurrdir; ++pcurrdir )
2901 *pcurrdir = tolower( *pcurrdir );
2902 if ( *pcurrdir ==
'\\' )
2907 for (; *pbuilddir; ++pbuilddir )
2909 *pbuilddir = tolower( *pbuilddir );
2910 if ( *pbuilddir ==
'\\' )
2923 if ( strncmp( builddir, currdir, len_builddir ) == 0 &&
2924 ( len_currdir == len_builddir || currdir[len_builddir] ==
'\\' || currdir[len_builddir] ==
'/' ) )
2926 pldebug(
"plInBuildTree(): ",
"comparing respecting case\n" );
2927 if ( strncmp( builddir, currdir, len_builddir ) == 0 &&
2928 ( len_currdir == len_builddir || currdir[len_builddir] ==
'/' ) )
2934 if ( chdir( currdir ) != 0 )
2935 pldebug(
"plInBuildTree():",
"Unable to chdir to current directory" );
2943 #ifdef ENABLE_DYNDRIVERS 2957 pldebug(
"plGetDrvDir",
"Using %s as the driver directory.\n", drvdir );
2961 pldebug(
"plGetDrvDir",
"Trying to read env var PLPLOT_DRV_DIR\n" );
2962 drvdir = getenv(
"PLPLOT_DRV_DIR" );
2964 if ( drvdir == NULL )
2966 pldebug(
"plGetDrvDir",
2967 "Will use drivers dir: " DRV_DIR "\n" );
3000 #ifdef ENABLE_DYNDRIVERS 3003 char *devnam, *devdesc, *devtype, *driver, *tag, *seqstr;
3005 int i, j, driver_found, done = 0;
3006 FILE *fp_drvdb = NULL;
3007 DIR * dp_drvdir = NULL;
3013 nloadabledrivers = 0;
3018 if ( fp_drvdb == NULL )
3020 plabort(
"plInitDispatchTable: Could not open temporary file" );
3025 drvdir = plGetDrvDir();
3026 dp_drvdir =
opendir( drvdir );
3027 if ( dp_drvdir == NULL )
3030 plabort(
"plInitDispatchTable: Could not open drivers directory" );
3036 pldebug(
"plInitDispatchTable",
"Scanning dyndrivers dir\n" );
3037 while ( ( entry =
readdir( dp_drvdir ) ) != NULL )
3041 size_t len = strlen(
name ) - 12;
3043 pldebug(
"plInitDispatchTable",
3044 "Consider file %s\n",
name );
3047 if ( ( len > 0 ) && ( strcmp(
name + len,
".driver_info" ) == 0 ) )
3054 fd = fopen( path,
"r" );
3060 "plInitDispatchTable: Could not open driver info file %s\n",
3070 pldebug(
"plInitDispatchTable",
3071 "Opened driver info file %s\n",
name );
3074 fprintf( fp_drvdb,
"%s",
buf );
3075 if (
buf [strlen(
buf ) - 1] !=
'\n' )
3076 fprintf( fp_drvdb,
"\n" );
3094 #ifdef ENABLE_DYNDRIVERS 3097 plexit(
"plInitDispatchTable: Insufficient memory" );
3109 #ifdef ENABLE_DYNDRIVERS 3112 plexit(
"plInitDispatchTable: Insufficient memory" );
3124 #ifdef ENABLE_DYNDRIVERS 3129 if ( ( ( loadable_device_list = malloc( (
size_t)
npldynamicdevices *
sizeof ( PLLoadableDevice ) ) ) == NULL ) ||
3130 ( ( loadable_driver_list = malloc( (
size_t)
npldynamicdevices *
sizeof ( PLLoadableDriver ) ) ) == NULL ) )
3133 plexit(
"plInitDispatchTable: Insufficient memory" );
3150 devnam = strtok(
buf,
":" );
3151 devdesc = strtok( 0,
":" );
3152 devtype = strtok( 0,
":" );
3153 driver = strtok( 0,
":" );
3154 seqstr = strtok( 0,
":" );
3155 tag = strtok( 0,
"\n" );
3157 if ( devnam == NULL || devdesc == NULL || devtype == NULL || driver == NULL ||
3158 seqstr == NULL || tag == NULL )
3163 seq = atoi( seqstr );
3170 plexit(
"plInitDispatchTable: Insufficient memory" );
3185 loadable_device_list[i].devnam =
plstrdup( devnam );
3186 loadable_device_list[i].description =
plstrdup( devdesc );
3187 loadable_device_list[i].drvnam =
plstrdup( driver );
3188 loadable_device_list[i].tag =
plstrdup( tag );
3193 for ( j = 0; j < nloadabledrivers; j++ )
3194 if ( strcmp( driver, loadable_driver_list[j].drvnam ) == 0 )
3200 if ( !driver_found )
3202 loadable_driver_list[nloadabledrivers].drvnam =
plstrdup( driver );
3203 loadable_driver_list[nloadabledrivers].dlhand = 0;
3207 loadable_device_list[i].drvidx = j;
3221 plexit(
"No device drivers found - please check the environment variable PLPLOT_DRV_DIR" );
3252 if ( plsc->DevName[0] ==
'\0' )
3254 devname_env = getenv(
"PLPLOT_DEV" );
3257 strncpy( plsc->DevName, devname_env, sizeof ( plsc->DevName ) - 1 );
3258 plsc->DevName[
sizeof ( plsc->DevName ) - 1] =
'\0';
3264 if ( *( plsc->DevName ) !=
'\0' && *( plsc->DevName ) !=
'?' )
3266 length = strlen( plsc->DevName );
3270 ( strncmp( plsc->DevName,
3276 plsc->device = i + 1;
3281 fprintf( stderr,
"Requested device %s not available\n",
3296 fprintf( stdout,
"\nPlotting Options:\n" );
3299 fprintf( stdout,
" <%2d> %-10s %s\n", i + 1,
3304 fprintf( stdout,
"\nEnter device number or keyword: " );
3306 fprintf( stdout,
"\nEnter device number or keyword (stream %d): ",
3309 plio_fgets( response,
sizeof ( response ), stdin );
3314 length = strlen( response );
3315 if ( *( response - 1 + length ) ==
'\n' )
3321 (
unsigned int) length ) )
3330 if ( ( dev = atoi( response ) ) < 1 )
3332 fprintf( stdout,
"\nInvalid device: %s", response );
3337 plexit(
"plSelectDev: Too many tries." );
3354 #ifdef ENABLE_DYNDRIVERS 3359 int n = plsc->device - 1;
3361 PLLoadableDriver *driver = 0;
3369 pldebug(
"plLoadDriver",
"Device not loaded!\n" );
3374 if ( strcmp( dev->
pl_DevName, loadable_device_list[i].devnam ) == 0 )
3382 fprintf( stderr,
"No such device: %s.\n", dev->
pl_DevName );
3383 plexit(
"plLoadDriver detected device logic screwup" );
3389 tag = loadable_device_list[i].tag;
3390 drvidx = loadable_device_list[i].drvidx;
3392 pldebug(
"plLoadDriver",
"tag=%s, drvidx=%d\n", tag, drvidx );
3394 driver = &loadable_driver_list[drvidx];
3397 if ( !driver->dlhand )
3400 #if defined ( LTDL_WIN32 ) || defined ( __CYGWIN__ ) 3404 #endif // LTDL_WIN32 3406 pldebug(
"plLoadDriver",
"Trying to load %s on %s\n",
3407 driver->drvnam, drvspec );
3418 if ( !( strcmp( driver->drvnam,
"mem" ) == 0 ||
3419 strcmp( driver->drvnam,
"null" ) == 0 ||
3420 strcmp( driver->drvnam,
"plmeta" ) == 0 ||
3421 strcmp( driver->drvnam,
"ps" ) == 0 ||
3422 strcmp( driver->drvnam,
"svg" ) == 0 ||
3423 strcmp( driver->drvnam,
"xfig" ) == 0 ) )
3428 if ( !driver->dlhand )
3430 pldebug(
"plLoadDriver",
"lt_dlopenext failed because of " 3431 "the following reason:\n%s\n",
lt_dlerror() );
3432 fprintf( stderr,
"Unable to load driver: %s.\n", driver->drvnam );
3433 plexit(
"Unable to load driver" );
3442 if ( !dispatch_init )
3445 "Unable to locate dispatch table initialization function for driver: %s.\n",
3450 ( *dispatch_init )( dev );
3467 if ( plsc->level > 0 )
3482 if ( plsc->plbuf_buffer != NULL )
3488 plwarn(
"plreplot: plot buffer not available" );
3504 plgFileDevs(
const char ***p_menustr,
const char ***p_devname,
int *p_ndev )
3506 plgdevlst( *p_menustr, *p_devname, p_ndev, 0 );
3516 plgDevs(
const char ***p_menustr,
const char ***p_devname,
int *p_ndev )
3518 plgdevlst( *p_menustr, *p_devname, p_ndev, -1 );
3522 plgdevlst(
const char **p_menustr,
const char **p_devname,
int *p_ndev,
int type )
3534 if ( ++j + 1 >= *p_ndev )
3536 plwarn(
"plgdevlst: too many devices" );
3541 p_menustr[j] = NULL;
3542 p_devname[j] = NULL;
3558 *p_xleng = plsc->xlength;
3559 *p_yleng = plsc->ylength;
3560 *p_xoff = plsc->xoffset;
3561 *p_yoff = plsc->yoffset;
3569 if ( plsc->level > 0 )
3570 plwarn(
"calling plspage() after plinit() may give unpredictable results" );
3578 plsc->xlength = xleng;
3580 plsc->ylength = yleng;
3583 plsc->xoffset = xoff;
3585 plsc->yoffset = yoff;
3600 if ( plsc->level > 0 )
3607 if ( plsc->plbuf_write )
3616 if ( plsc->level > 0 )
3618 plwarn(
"plsdev: Must be called before plinit." );
3621 if ( devname != NULL )
3623 strncpy( plsc->DevName, devname, sizeof ( plsc->DevName ) - 1 );
3624 plsc->DevName[
sizeof ( plsc->DevName ) - 1] =
'\0';
3634 strcpy( p_dev, plsc->DevName );
3649 plsc->dev = plotmem;
3650 plsc->dev_mem_alpha = 0;
3659 plsc->dev = plotmem;
3660 plsc->dev_mem_alpha = 1;
3683 *p_level = plsc->level;
3692 plsc->KeyEH = KeyEH;
3693 plsc->KeyEH_data = KeyEH_data;
3700 void *ButtonEH_data )
3702 plsc->ButtonEH = ButtonEH;
3703 plsc->ButtonEH_data = ButtonEH_data;
3709 plsbopH(
void ( *handler )(
void *,
int * ),
void *handler_data )
3711 plsc->bop_handler = handler;
3712 plsc->bop_data = handler_data;
3718 plseopH(
void ( *handler )(
void *,
int * ),
void *handler_data )
3720 plsc->eop_handler = handler;
3721 plsc->eop_data = handler_data;
3729 if ( errcode != NULL )
3730 plsc->errcode = errcode;
3753 if ( width != plsc->width && width >= 0. )
3755 plsc->width = width;
3757 if ( plsc->level > 0 )
3759 if ( !plsc->widthlock )
3770 *p_file = plsc->OutFile;
3778 plsc->OutFile = file;
3789 plabort(
"filename string must be preallocated to >=80 bytes" );
3794 if ( plsc->FileName != NULL )
3796 strncpy( fnam, plsc->FileName, 79 );
3820 plsc->dev_data =
data;
3836 plsc->setpre = setp;
3837 plsc->precis = prec;
3845 *p_setp = plsc->setpre;
3846 *p_prec = plsc->precis;
3881 plwarn(
"plsesc: Invalid escape character, ignoring." );
3890 if ( plsc->esc ==
'\0' )
3924 *pfci = *pfci & mask;
3926 *pfci = *pfci | mask;
3937 *phexdigit = (
unsigned char) ( ( fci & mask ) >>
3954 plsc->window_id = window_id;
3971 *p_fam = plsc->family;
3972 *p_num = plsc->member;
3973 *p_bmax = plsc->bytemax;
3981 if ( plsc->level > 0 )
3982 plwarn(
"plsfam: Must be called before plinit." );
3989 plsc->bytemax = bmax;
4010 *p_digmax = plsc->xdigmax;
4011 *p_digits = plsc->xdigits;
4019 plsc->xdigmax = digmax;
4020 plsc->xdigits = digits;
4028 *p_digmax = plsc->ydigmax;
4029 *p_digits = plsc->ydigits;
4037 plsc->ydigmax = digmax;
4038 plsc->ydigits = digits;
4046 *p_digmax = plsc->zdigmax;
4047 *p_digits = plsc->zdigits;
4055 plsc->zdigmax = digmax;
4056 plsc->zdigits = digits;
4064 *p_def = plsc->chrdef;
4065 *p_ht = plsc->chrht;
4073 *p_xmin = plsc->vpdxmi;
4074 *p_xmax = plsc->vpdxma;
4075 *p_ymin = plsc->vpdymi;
4076 *p_ymax = plsc->vpdyma;
4084 *p_xmin = plsc->vpwxmi;
4085 *p_xmax = plsc->vpwxma;
4086 *p_ymin = plsc->vpwymi;
4087 *p_ymax = plsc->vpwyma;
4096 dx = ( plsc->vpwxma - plsc->vpwxmi ) * 1.0e-5;
4097 dy = ( plsc->vpwyma - plsc->vpwymi ) * 1.0e-5;
4102 *p_xmin = plsc->vpwxmi - dx;
4103 *p_xmax = plsc->vpwxma + dx;
4104 *p_ymin = plsc->vpwymi - dy;
4105 *p_ymax = plsc->vpwyma + dy;
4117 *p_xmin = plsc->domxmi;
4118 *p_xmax = plsc->domxma;
4119 *p_ymin = plsc->domymi;
4120 *p_ymax = plsc->domyma;
4128 *p_zscl = plsc->zzscl;
4129 *p_zmin = plsc->ranmi;
4130 *p_zmax = plsc->ranma;
4150 *p_ixmin = plsc->clpxmi;
4151 *p_ixmax = plsc->clpxma;
4152 *p_iymin = plsc->clpymi;
4153 *p_iymax = plsc->clpyma;
4161 plsc->clpxmi = ixmin;
4162 plsc->clpxma = ixmax;
4163 plsc->clpymi = iymin;
4164 plsc->clpyma = iymax;
4165 if ( plsc->plbuf_write )
4174 *p_ixmin = plsc->phyxmi;
4175 *p_ixmax = plsc->phyxma;
4176 *p_iymin = plsc->phyymi;
4177 *p_iymax = plsc->phyyma;
4185 *p_nx = plsc->nsubx;
4186 *p_ny = plsc->nsuby;
4187 *p_cs = plsc->cursub;
4216 plsc->umx = (
PLINT) ( 1000.0 / plsc->xpmm );
4217 plsc->umy = (
PLINT) ( 1000.0 / plsc->ypmm );
4225 if ( xmin > xmax || ymin > ymax )
4226 plexit(
"plP_setphy: device minima must not exceed maxima" );
4228 plsc->phyxmi = xmin;
4229 plsc->phyxma = xmax;
4230 plsc->phyymi = ymin;
4231 plsc->phyyma = ymax;
4232 plsc->phyxlen = xmax - xmin;
4233 plsc->phyylen = ymax - ymin;
4246 if ( plsc->level <= 0 )
4248 plsc->dev_compression = compression;
4261 *compression = plsc->dev_compression;
4282 if (
pls[i] != NULL )
4285 strcpy( names,
pls[i]->DevName );
4288 strcat( names,
" " );
4289 strcat( names,
pls[i]->DevName );
4312 buff = (
char *) malloc( (
size_t)
PL_NSTREAMS * 8 );
4320 for ( tok = strtok( buff,
" ," );
4321 tok; tok = strtok( 0,
" ," ) )
4323 if ( strstr( names, tok ) != NULL )
4354 plimageslow( z, nx, ny, xmin, ymin, dx, dy, pltr, pltr_data );
4365 #if 0 // BEGIN dev_fastimg COMMENT 4372 if ( plsc->dev_fastimg == 0 )
4375 xmin, ymin, dx, dy, zmin, zmax );
4379 if ( plsc->plbuf_write )
4391 plsc->dev_nptsX = nx;
4392 plsc->dev_nptsY = ny;
4393 plsc->dev_zmin = zmin;
4394 plsc->dev_zmax = zmax;
4401 plsc->plbuf_write = 0;
4406 PLINT clpxmi, clpxma, clpymi, clpyma;
4408 if ( ( (
xscl = (
short *) malloc( nx * ny *
sizeof (
short ) ) ) == NULL ) ||
4409 ( (
yscl = (
short *) malloc( nx * ny *
sizeof (
short ) ) ) == NULL ) )
4411 plexit(
"plP_image: Insufficient memory" );
4414 for ( i = 0; i < npts; i++ )
4419 sdifilt(
xscl,
yscl, npts, &clpxmi, &clpxma, &clpymi, &clpyma );
4420 plsc->imclxmin = clpxmi;
4421 plsc->imclymin = clpymi;
4422 plsc->imclxmax = clpxma;
4423 plsc->imclymax = clpyma;
4430 plsc->imclxmin = plsc->phyxmi;
4431 plsc->imclymin = plsc->phyymi;
4432 plsc->imclxmax = plsc->phyxma;
4433 plsc->imclymax = plsc->phyyma;
4437 #endif // END dev_fastimg COMMENT 4449 plsc->coordinate_transform = coordinate_transform;
4450 plsc->coordinate_transform_data = coordinate_transform_data;
static int npldynamicdevices
static void pldi_ini(void)
void plsdevdata(void *data)
void c_plwidth(PLFLT width)
static void grfill(short *x, short *y, PLINT npts)
static DIR * opendir(const char *dirname)
void c_plsdidev(PLFLT mar, PLFLT aspect, PLFLT jx, PLFLT jy)
void plexit(PLCHAR_VECTOR errormsg)
void(* PLTRANSFORM_callback)(PLFLT x, PLFLT y, PLFLT_NC_SCALAR xp, PLFLT_NC_SCALAR yp, PLPointer data)
void plP_esc(PLINT op, void *ptr)
#define PLESC_CONTROL_CHAR
void c_plsyax(PLINT digmax, PLINT digits)
void c_plsdiori(PLFLT rot)
void plbuf_state(PLStream *pls, PLINT op)
void pl_cpcolor(PLColor *to, PLColor *from)
static PLDispatchInit static_device_initializers[]
void plP_fci2hex(PLUNICODE fci, unsigned char *phexdigit, unsigned char hexpower)
void c_plssub(PLINT nx, PLINT ny)
void c_plstar(PLINT nx, PLINT ny)
void c_pltimefmt(PLCHAR_VECTOR fmt)
void c_plgchr(PLFLT *p_def, PLFLT *p_ht)
void c_plgzax(PLINT *p_digmax, PLINT *p_digits)
void c_plgxax(PLINT *p_digmax, PLINT *p_digits)
void plP_pllclp(PLINT *x, PLINT *y, PLINT npts, PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax, void(*draw)(short *, short *, PLINT))
void plP_gprec(PLINT *p_setp, PLINT *p_prec)
void plbuf_di(PLStream *pls)
void c_plgstrm(PLINT *p_strm)
void plbuf_clip(PLStream *pls)
static PLINT lib_initialized
void pldid2pc(PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax)
void c_plgdev(char *p_dev)
void c_plgyax(PLINT *p_digmax, PLINT *p_digits)
void plseopH(void(*handler)(void *, int *), void *handler_data)
const char plP_greek_mnemonic[]
int ucs4_to_utf8(PLUNICODE unichar, char *ptr)
void c_plgvpw(PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax)
static void grpolyline(short *x, short *y, PLINT npts)
FILE * pl_create_tempfile(char **fname)
static PLINT yscl[PL_MAXPOLY]
void c_plsdev(PLCHAR_VECTOR devname)
void plP_grange(PLFLT *p_zscl, PLFLT *p_zmin, PLFLT *p_zmax)
const char * PLCHAR_VECTOR
void plP_swin(PLWindow *plwin)
void c_plsfnam(PLCHAR_VECTOR fnam)
void plP_text(PLINT base, PLFLT just, PLFLT *xform, PLINT x, PLINT y, PLINT refx, PLINT refy, PLCHAR_VECTOR string)
#define PL_FCI_HEXPOWER_MASK
#define PL_FCI_IMPOSSIBLE
char * plsave_set_locale(void)
static void grline(short *x, short *y, PLINT PL_UNUSED(npts))
void pldip2dc(PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax)
#define PLTEXT_SUPERSCRIPT
void plabort(PLCHAR_VECTOR errormsg)
PLINT plP_checkdriverinit(char *names)
void c_plmkstrm(PLINT *p_strm)
static void calc_didev(void)
void plimageslow(PLFLT *idata, PLINT nx, PLINT ny, PLFLT xmin, PLFLT ymin, PLFLT dx, PLFLT dy, PLTRANSFORM_callback pltr, PLPointer pltr_data)
void c_plsmem(PLINT maxx, PLINT maxy, void *plotmem)
void plP_gpixmm(PLFLT *p_x, PLFLT *p_y)
void plbuf_init(PLStream *pls)
void plsError(PLINT *errcode, char *errmsg)
void c_plgfci(PLUNICODE *p_fci)
void plstr(PLINT base, PLFLT *xform, PLINT refx, PLINT refy, PLCHAR_VECTOR string)
void plbuf_esc(PLStream *pls, PLINT op, void *ptr)
static void setdef_didev(void)
#define PLTEXT_FONTCHANGE
void c_plfontld(PLINT ifont)
static int nplstaticdevices
static void plSelectDev()
void plP_gclp(PLINT *p_ixmin, PLINT *p_ixmax, PLINT *p_iymin, PLINT *p_iymax)
void plP_polyline(short *x, short *y, PLINT npts)
void plgDevs(const char ***p_menustr, const char ***p_devname, int *p_ndev)
void c_plsdiplz(PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax)
void plrestore_locale(char *saved_lc_numeric_locale)
static PLCHAR_VECTOR utf8_to_ucs4(PLCHAR_VECTOR ptr, PLUNICODE *unichar)
void(* PLDispatchInit)(PLDispatchTable *pdt)
static void plgdevlst(const char **p_menustr, const char **p_devname, int *p_ndev, int type)
void c_plgfnam(char *fnam)
int lt_dlmakeresident(lt_dlhandle handle)
void c_plgver(char *p_ver)
void c_plsfci(PLUNICODE fci)
void plP_sfnam(PLStream *pls, PLCHAR_VECTOR fnam)
static void grgradient(short *x, short *y, PLINT npts)
void plio_fgets(char *buf, int size, FILE *stream)
void plbuf_polyline(PLStream *pls, short *xa, short *ya, PLINT npts)
void plP_ssub(PLINT nx, PLINT ny, PLINT cs)
static void calc_diori(void)
static PLDispatchTable ** dispatch_table
void c_plgfam(PLINT *p_fam, PLINT *p_num, PLINT *p_bmax)
static void plInitDispatchTable()
void c_plgdiplt(PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax)
void c_plstart(PLCHAR_VECTOR devname, PLINT nx, PLINT ny)
enum EscText::@5 text_type
void plP_gsub(PLINT *p_nx, PLINT *p_ny, PLINT *p_cs)
void c_plsstrm(PLINT strm)
int text2fci(PLCHAR_VECTOR text, unsigned char *hexdigit, unsigned char *hexpower)
void c_plgdiori(PLFLT *p_rot)
void c_plgcompression(PLINT *compression)
void plbuf_tidy(PLStream *PL_UNUSED(pls))
static void setdef_diori(void)
void difilt_clip(PLINT *x_coords, PLINT *y_coords)
static int plDispatchSequencer(const void *p1, const void *p2)
static void setdef_diplt(void)
void plsButtonEH(void(*ButtonEH)(PLGraphicsIn *, void *, int *), void *ButtonEH_data)
void difilt(PLINT *xsc, PLINT *ysc, PLINT npts, PLINT *clpxmi, PLINT *clpxma, PLINT *clpymi, PLINT *clpyma)
void c_plstransform(PLTRANSFORM_callback coordinate_transform, PLPointer coordinate_transform_data)
void plP_image(PLFLT *z, PLINT nx, PLINT ny, PLFLT xmin, PLFLT ymin, PLFLT dx, PLFLT dy, void(*pltr)(PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer), PLPointer pltr_data)
void plsxwin(PLINT window_id)
void plP_setpxl(PLFLT xpmm, PLFLT ypmm)
void c_plglevel(PLINT *p_level)
void plgFileDevs(const char ***p_menustr, const char ***p_devname, int *p_ndev)
void plbuf_ssub(PLStream *pls)
static void calc_diplt(void)
Hershey_to_Unicode_table hershey_to_unicode_lookup_table[]
void plP_affine_multiply(PLFLT *affine_vectorA, PLFLT_VECTOR affine_vectorB, PLFLT_VECTOR affine_vectorC)
static int closedir(DIR *dirp)
PLCHAR_VECTOR plP_gtimefmt()
static PLStream * pls[PL_NSTREAMS]
void plP_setphy(PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax)
void plP_affine_rotate(PLFLT *affine_vector, PLFLT angle)
void plP_affine_translate(PLFLT *affine_vector, PLFLT xtranslate, PLFLT ytranslate)
void grimage(short *x, short *y, unsigned short *z, PLINT nx, PLINT ny)
void c_plspage(PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng, PLINT xoff, PLINT yoff)
void c_plprec(PLINT setp, PLINT prec)
void plbuf_line(PLStream *pls, short x1a, short y1a, short x2a, short y2a)
static void encode_unicode(PLCHAR_VECTOR string, EscText *args)
unsigned short unicode_array_len
static void alternate_unicode_processing(PLCHAR_VECTOR string, EscText *args)
int plhershey2unicode(int in)
char PLDLLIMPEXP * plstrdup(PLCHAR_VECTOR src)
#define N_TextLookupTable
static void plLoadDriver(void)
void plP_fill(short *x, short *y, PLINT npts)
void plfill_soft(short *x, short *y, PLINT n)
void plRemakePlot(PLStream *pls)
void plP_gradient(short *x, short *y, PLINT npts)
void plP_xgvpw(PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax)
void plP_hex2fci(unsigned char hexdigit, unsigned char hexpower, PLUNICODE *pfci)
void plP_plfclp(PLINT *x, PLINT *y, PLINT npts, PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax, void(*draw)(short *, short *, PLINT))
void c_plsdimap(PLINT dimxmin, PLINT dimxmax, PLINT dimymin, PLINT dimymax, PLFLT dimxpmm, PLFLT dimypmm)
lt_dlhandle lt_dlopenext(char *dllname)
void c_plgpage(PLFLT *p_xp, PLFLT *p_yp, PLINT *p_xleng, PLINT *p_yleng, PLINT *p_xoff, PLINT *p_yoff)
static PLUNICODE unicode_buffer_static[1024]
void c_plszax(PLINT digmax, PLINT digits)
void plP_line(short *x, short *y)
void plsbopH(void(*handler)(void *, int *), void *handler_data)
static PLINT xscl[PL_MAXPOLY]
void plgfile(FILE **p_file)
void plbuf_eop(PLStream *pls)
void plsKeyEH(void(*KeyEH)(PLGraphicsIn *, void *, int *), void *KeyEH_data)
void plP_gw3wc(PLFLT *p_dxx, PLFLT *p_dxy, PLFLT *p_dyx, PLFLT *p_dyy, PLFLT *p_dyz)
void c_plsmema(PLINT maxx, PLINT maxy, void *plotmem)
PLCHAR_VECTOR lt_dlerror()
void plwarn(PLCHAR_VECTOR errormsg)
void plbuf_bop(PLStream *pls)
static struct dirent * readdir(DIR *dirp)
void plP_getinitdriverlist(char *names)
#define PL_FCI_HEXDIGIT_MASK
void c_plgvpd(PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax)
void plP_sclp(PLINT ixmin, PLINT ixmax, PLINT iymin, PLINT iymax)
void plbuf_write(PLStream *pls, void *data, size_t bytes)
void c_plgdidev(PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy)
int text2num(PLCHAR_VECTOR text, char end, PLUNICODE *num)
void c_plsxax(PLINT digmax, PLINT digits)
void closeqsas(QSASConfig **qsasconfig)
void plP_gphy(PLINT *p_ixmin, PLINT *p_ixmax, PLINT *p_iymin, PLINT *p_iymax)
PLUNICODE * unicode_array
void c_plscompression(PLINT compression)
void plgpls(PLStream **p_pls)
void c_plconfigtime(PLFLT scale, PLFLT offset1, PLFLT offset2, PLINT ccontrol, PLBOOL ifbtime_offset, PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec)
#define PL_FCI_HEXPOWER_IMPOSSIBLE
void plP_affine_scale(PLFLT *affine_vector, PLFLT xscale, PLFLT yscale)
void plP_gdom(PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax)
void c_plsfam(PLINT fam, PLINT num, PLINT bmax)
void c_plsdiplt(PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax)
void c_plcpstrm(PLINT iplsr, PLINT flags)
void * lt_dlsym(lt_dlhandle dlhandle, PLCHAR_VECTOR symbol)
PLINT plP_strpos(PLCHAR_VECTOR str, int chr)