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
140 plsc->page_status =
AT_EOP;
141 plsc->stream_closed =
FALSE;
144 ( *plsc->dispatch_table->pl_init )( (
struct PLStream_struct *) plsc );
147 if ( plsc->plbuf_write )
158 int skip_driver_eop = 0;
160 if ( plsc->page_status ==
AT_EOP )
163 plsc->page_status =
AT_EOP;
165 if ( plsc->plbuf_write )
170 if ( plsc->eop_handler != NULL )
171 ( *plsc->eop_handler )( plsc->eop_data, &skip_driver_eop );
173 if ( !skip_driver_eop )
176 if ( !plsc->stream_closed )
178 ( *plsc->dispatch_table->pl_eop )( (
struct PLStream_struct *) plsc );
192 int skip_driver_bop = 0;
195 if ( plsc->page_status ==
AT_BOP )
198 plsc->page_status =
AT_BOP;
203 if ( plsc->bop_handler != NULL )
204 ( *plsc->bop_handler )( plsc->bop_data, &skip_driver_bop );
206 if ( !skip_driver_bop )
209 if ( !plsc->stream_closed )
211 ( *plsc->dispatch_table->pl_bop )( (
struct PLStream_struct *) plsc );
216 if ( plsc->plbuf_write )
228 ( *plsc->tidy )( plsc->tidy_data );
230 plsc->tidy_data = NULL;
234 ( *plsc->dispatch_table->pl_tidy )( (
struct PLStream_struct *) plsc );
237 if ( plsc->plbuf_write )
242 plsc->OutFile = NULL;
251 if ( plsc->plbuf_write )
255 if ( !plsc->stream_closed )
257 ( *plsc->dispatch_table->pl_state )( (
struct PLStream_struct *) plsc, op );
268 PLINT clpxmi, clpxma, clpymi, clpyma;
272 if ( plsc->plbuf_write )
283 difilt( &( args->
x ), &( args->
y ), 1, &clpxmi, &clpxma, &clpymi, &clpyma );
288 if ( !plsc->stream_closed )
290 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc, op, ptr );
303 PLINT clpxmi, clpxma, clpymi, clpyma;
307 if ( plsc->plbuf_write )
340 if ( plsc->dev_swin )
343 if ( !plsc->stream_closed )
345 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
361 if ( !plsc->nopause && *plsc->dispatch_table->pl_wait != NULL )
364 if ( !plsc->stream_closed )
366 ( *plsc->dispatch_table->pl_wait )( (
struct PLStream_struct *) plsc );
382 PLINT i, npts = 2, clpxmi, clpxma, clpymi, clpyma;
386 if ( plsc->plbuf_write )
391 for ( i = 0; i < npts; i++ )
411 PLINT i, clpxmi, clpxma, clpymi, clpyma;
415 if ( plsc->plbuf_write )
420 for ( i = 0; i < npts; i++ )
445 PLINT i, clpxmi, clpxma, clpymi, clpyma;
449 if ( plsc->plbuf_write )
451 plsc->dev_npts = npts;
459 if ( plsc->patt == 0 && !plsc->dev_fill0 )
463 plwarn(
"Driver does not support hardware solid fills, switching to software fill.\n" );
469 if ( plsc->dev_fill1 )
471 plsc->patt = -
ABS( plsc->patt );
479 if ( plsc->patt > 0 )
486 for ( i = 0; i < npts; i++ )
510 PLINT i, clpxmi, clpxma, clpymi, clpyma;
514 if ( plsc->plbuf_write )
516 plsc->dev_npts = npts;
525 for ( i = 0; i < npts; i++ )
564 if ( !strncmp( text,
"0x", 2 ) || !strncmp( text,
"0X", 2 ) )
567 *num = (
PLUNICODE) strtoul( text, &endptr, base );
569 if ( end != endptr[0] )
572 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 );
576 return (
int) ( endptr - text );
602 unsigned char hexdigit;
603 unsigned char hexpower;
609 #define N_TextLookupTable 10
625 length = (int) strlen( lookup[i].ptext );
626 if ( !strncmp( text, lookup[i].ptext, (
size_t) length ) )
628 *hexdigit = lookup[i].hexdigit;
629 *hexpower = lookup[i].hexpower;
643 unsigned char hexdigit, hexpower;
654 len = strlen(
string );
671 for ( i = 0; i < len; i++ )
675 if (
string[i] == esc )
677 switch (
string[i + 1] )
680 i += 2 +
text2num( &
string[i + 2],
')', &code );
690 i += 2 +
text2num( &
string[i + 2],
']', &code );
697 if (
'0' <=
string[i + 2] &&
string[i + 2] <=
'9' )
699 i += 2 +
text2num( &
string[i + 2],
'>', &code );
731 i +=
text2fci( &
string[i + 1], &hexdigit, &hexpower );
753 if (
string[i + 2] ==
'n' )
758 else if (
string[i + 2] ==
'r' )
763 else if (
string[i + 2] ==
'i' )
769 else if (
string[i + 2] ==
's' )
806 else if ( ig == 634 )
808 else if ( ig == 647 )
870 #ifdef HAVE_LIBUNICODE
871 PLCHAR_VECTOR ptr = unicode_get_utf8(
string + i, &unichar );
879 strncpy( tmpstring,
string, 30 );
880 tmpstring[30] =
'\0';
882 tmpstring, strlen(
string ) > 30 ?
"[...]" :
"" );
886 i += (int) ( ptr - (
string + i ) - 1 );
891 if (
string[i] == esc &&
string[i + 1] == esc )
915 unsigned char hexdigit, hexpower;
927 len = strlen(
string );
949 for ( j = i = 0; i < len; i++ )
953 if (
string[i] == esc )
957 switch (
string[i + 1] )
960 i += ( 2 +
text2num( &
string[i + 2],
')', &code ) );
979 i += ( 2 +
text2num( &
string[i + 2],
']', &code ) );
996 if (
'0' <=
string[i + 2] &&
string[i + 2] <=
'9' )
998 i += 2 +
text2num( &
string[i + 2],
'>', &code );
1024 i +=
text2fci( &
string[i + 1], &hexdigit, &hexpower );
1043 if (
string[i + 2] ==
'n' )
1048 else if (
string[i + 2] ==
'r' )
1053 else if (
string[i + 2] ==
'i' )
1059 else if (
string[i + 2] ==
's' )
1094 else if ( ig == 634 )
1096 else if ( ig == 647 )
1122 #ifdef HAVE_LIBUNICODE
1123 PLCHAR_VECTOR ptr = unicode_get_utf8(
string + i, &unichar );
1131 strncpy( tmpstring,
string, 30 );
1132 tmpstring[30] =
'\0';
1134 tmpstring, strlen(
string ) > 30 ?
"[...]" :
"" );
1139 i += (int) ( ptr - (
string + i ) - 1 );
1145 &&
string[i + 1] == esc )
1169 if (
string == NULL )
1172 if ( plsc->dev_text )
1191 if ( plsc->dev_unicode )
1193 if ( plsc->alt_unicode )
1218 len = strlen(
string );
1230 plstr( base, xform, refx, refy,
string );
1250 if ( (
unsigned char) ( tmp & 0x80 ) == 0x00 )
1252 *unichar = (
unsigned int) tmp & 0x7F;
1255 else if ( (
unsigned char) ( tmp & 0xE0 ) == 0xC0 )
1257 *unichar = (
unsigned int) tmp & 0x1F;
1260 else if ( (
unsigned char) ( tmp & 0xF0 ) == 0xE0 )
1262 *unichar = (
unsigned char) tmp & 0x0F;
1265 else if ( (
unsigned char) ( tmp & 0xF8 ) == 0xF0 )
1267 *unichar = (
unsigned char) tmp & 0x07;
1270 else if ( (
unsigned char) ( tmp & 0xFC ) == 0xF8 )
1272 *unichar = (
unsigned char) tmp & 0x03;
1275 else if ( (
unsigned char) ( tmp & 0xFE ) == 0xFC )
1277 *unichar = (
unsigned char) tmp & 0x01;
1288 if ( (
unsigned char) ( tmp & 0xC0 ) == 0x80 )
1290 *unichar = ( *unichar << 6 ) | ( (
unsigned int) tmp & 0x3F );
1299 }
while ( cnt > 0 );
1310 tmp = (
unsigned char *) ptr;
1312 if ( ( unichar & 0xffff80 ) == 0 )
1314 *tmp = (
unsigned char) unichar;
1318 else if ( ( unichar & 0xfff800 ) == 0 )
1320 *tmp = (
unsigned char) 0xc0 | (
unsigned char) ( unichar >> 6 );
1322 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( unichar & (
PLUINT) 0x3f ) );
1326 else if ( ( unichar & 0xff0000 ) == 0 )
1328 *tmp = (
unsigned char) 0xe0 | (
unsigned char) ( unichar >> 12 );
1330 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( ( unichar >> 6 ) & 0x3f ) );
1332 *tmp = (
unsigned char) ( 0x80 | ( (
unsigned char) unichar & 0x3f ) );
1336 else if ( ( unichar & 0xe0000 ) == 0 )
1338 *tmp = (
unsigned char) 0xf0 | (
unsigned char) ( unichar >> 18 );
1340 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( ( unichar >> 12 ) & 0x3f ) );
1342 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( ( unichar >> 6 ) & 0x3f ) );
1344 *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( unichar & 0x3f ) );
1361 if ( !plsc->stream_closed )
1363 ( *plsc->dispatch_table->pl_line )( (
struct PLStream_struct *) plsc,
1364 x[0], y[0], x[1], y[1] );
1373 if ( !plsc->stream_closed )
1375 ( *plsc->dispatch_table->pl_polyline )( (
struct PLStream_struct *) plsc,
1385 plsc->dev_npts = npts;
1390 if ( !plsc->stream_closed )
1392 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
1402 plsc->dev_npts = npts;
1407 if ( !plsc->stream_closed )
1409 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
1445 for ( i = 0; i < npts; i++ )
1447 xsc[i] = (
PLINT) ( plsc->dimxax * xsc[i] + plsc->dimxb );
1448 ysc[i] = (
PLINT) ( plsc->dimyay * ysc[i] + plsc->dimyb );
1456 for ( i = 0; i < npts; i++ )
1458 x = (
PLINT) ( plsc->dioxax * xsc[i] + plsc->dioxay * ysc[i] + plsc->dioxb );
1459 y = (
PLINT) ( plsc->dioyax * xsc[i] + plsc->dioyay * ysc[i] + plsc->dioyb );
1469 for ( i = 0; i < npts; i++ )
1471 xsc[i] = (
PLINT) ( plsc->dipxax * xsc[i] + plsc->dipxb );
1472 ysc[i] = (
PLINT) ( plsc->dipyay * ysc[i] + plsc->dipyb );
1481 for ( i = 0; i < npts; i++ )
1483 xsc[i] = (
PLINT) ( plsc->didxax * xsc[i] + plsc->didxb );
1484 ysc[i] = (
PLINT) ( plsc->didyay * ysc[i] + plsc->didyb );
1486 *clpxmi = plsc->diclpxmi;
1487 *clpxma = plsc->diclpxma;
1488 *clpymi = plsc->diclpymi;
1489 *clpyma = plsc->diclpyma;
1493 *clpxmi = plsc->phyxmi;
1494 *clpxma = plsc->phyxma;
1495 *clpymi = plsc->phyymi;
1496 *clpyma = plsc->phyyma;
1581 PLINT x1c, x2c, y1c, y2c;
1595 difilt( x_coords, y_coords, 4, &x1c, &x2c, &y1c, &y2c );
1609 plsc->dipxmin = 0.0;
1610 plsc->dipxmax = 1.0;
1611 plsc->dipymin = 0.0;
1612 plsc->dipymax = 1.0;
1633 if ( plsc->level >= 1 )
1635 if ( plsc->plbuf_write )
1669 PLFLT pxmin, pymin, pxmax, pymax;
1670 PLFLT sxmin, symin, sxmax, symax;
1671 PLFLT rxmin, rymin, rxmax, rymax;
1675 pldebug(
"pldid2pc",
1676 "Relative device coordinates (in): %f, %f, %f, %f\n",
1677 *xmin, *ymin, *xmax, *ymax );
1684 sxmin = ( pxmin - plsc->didxb ) / plsc->didxax;
1685 symin = ( pymin - plsc->didyb ) / plsc->didyay;
1686 sxmax = ( pxmax - plsc->didxb ) / plsc->didxax;
1687 symax = ( pymax - plsc->didyb ) / plsc->didyay;
1694 *xmin = ( rxmin < 0 ) ? 0 : rxmin;
1695 *xmax = ( rxmax > 1 ) ? 1 : rxmax;
1696 *ymin = ( rymin < 0 ) ? 0 : rymin;
1697 *ymax = ( rymax > 1 ) ? 1 : rymax;
1699 pldebug(
"pldid2pc",
1700 "Relative plot coordinates (out): %f, %f, %f, %f\n",
1701 rxmin, rymin, rxmax, rymax );
1715 PLFLT pxmin, pymin, pxmax, pymax;
1716 PLFLT sxmin, symin, sxmax, symax;
1717 PLFLT rxmin, rymin, rxmax, rymax;
1721 pldebug(
"pldip2pc",
1722 "Relative plot coordinates (in): %f, %f, %f, %f\n",
1723 *xmin, *ymin, *xmax, *ymax );
1730 sxmin = pxmin * plsc->didxax + plsc->didxb;
1731 symin = pymin * plsc->didyay + plsc->didyb;
1732 sxmax = pxmax * plsc->didxax + plsc->didxb;
1733 symax = pymax * plsc->didyay + plsc->didyb;
1740 *xmin = ( rxmin < 0 ) ? 0 : rxmin;
1741 *xmax = ( rxmax > 1 ) ? 1 : rxmax;
1742 *ymin = ( rymin < 0 ) ? 0 : rymin;
1743 *ymax = ( rymax > 1 ) ? 1 : rymax;
1745 pldebug(
"pldip2pc",
1746 "Relative device coordinates (out): %f, %f, %f, %f\n",
1747 rxmin, rymin, rxmax, rymax );
1760 plsc->dipxmin = ( xmin < xmax ) ? xmin : xmax;
1761 plsc->dipxmax = ( xmin < xmax ) ? xmax : xmin;
1762 plsc->dipymin = ( ymin < ymax ) ? ymin : ymax;
1763 plsc->dipymax = ( ymin < ymax ) ? ymax : ymin;
1765 if ( xmin == 0. && xmax == 1. && ymin == 0. && ymax == 1. )
1786 xmin = plsc->dipxmin + ( plsc->dipxmax - plsc->dipxmin ) * xmin;
1787 ymin = plsc->dipymin + ( plsc->dipymax - plsc->dipymin ) * ymin;
1788 xmax = plsc->dipxmin + ( plsc->dipxmax - plsc->dipxmin ) * xmax;
1789 ymax = plsc->dipymin + ( plsc->dipymax - plsc->dipymin ) * ymax;
1792 plsdiplt( xmin, ymin, xmax, ymax );
1809 PLINT pxmin, pxmax, pymin, pymax, pxlen, pylen;
1814 if ( !plsc->stream_closed )
1816 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
1822 if ( !( plsc->difilt &
PLDI_PLT ) )
1830 pxlen = pxmax - pxmin;
1831 pylen = pymax - pymin;
1832 pxlen =
MAX( 1, pxlen );
1833 pylen =
MAX( 1, pylen );
1835 plsc->dipxax = plsc->phyxlen / (double) pxlen;
1836 plsc->dipyay = plsc->phyylen / (double) pylen;
1837 plsc->dipxb = plsc->phyxmi - plsc->dipxax * pxmin;
1838 plsc->dipyb = plsc->phyymi - plsc->dipyay * pymin;
1850 *p_xmin = plsc->dipxmin;
1851 *p_xmax = plsc->dipxmax;
1852 *p_ymin = plsc->dipymin;
1853 *p_ymax = plsc->dipymax;
1875 if ( mar == 0. && aspect == 0. && jx == 0. && jy == 0. &&
1896 PLFLT lx, ly, aspect, aspdev;
1897 PLFLT xmin, xmax, xlen, ymin, ymax, ylen;
1898 PLINT pxmin, pxmax, pymin, pymax, pxlen, pylen;
1903 if ( !plsc->stream_closed )
1905 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
1911 if ( !( plsc->difilt &
PLDI_DEV ) )
1916 lx = plsc->phyxlen / plsc->xpmm;
1917 ly = plsc->phyylen / plsc->ypmm;
1921 aspect = plsc->aspori;
1923 aspect = plsc->aspect;
1926 aspect = plsc->aspdev;
1930 plsc->mar = ( plsc->mar > 0.5 ) ? 0.5 : plsc->mar;
1931 plsc->mar = ( plsc->mar < 0.0 ) ? 0.0 : plsc->mar;
1932 plsc->jx = ( plsc->jx > 0.5 ) ? 0.5 : plsc->jx;
1933 plsc->jx = ( plsc->jx < -0.5 ) ? -0.5 : plsc->jx;
1934 plsc->jy = ( plsc->jy > 0.5 ) ? 0.5 : plsc->jy;
1935 plsc->jy = ( plsc->jy < -0.5 ) ? -0.5 : plsc->jy;
1939 xlen = ( aspect < aspdev ) ? ( aspect / aspdev ) : 1.0;
1940 ylen = ( aspect < aspdev ) ? 1.0 : ( aspdev / aspect );
1942 xlen *= ( 1.0 - 2. * plsc->mar );
1943 ylen *= ( 1.0 - 2. * plsc->mar );
1945 xmin = ( 1. - xlen ) * ( 0.5 + plsc->jx );
1948 ymin = ( 1. - ylen ) * ( 0.5 + plsc->jy );
1958 pxlen = pxmax - pxmin;
1959 pylen = pymax - pymin;
1960 pxlen =
MAX( 1, pxlen );
1961 pylen =
MAX( 1, pylen );
1963 plsc->didxax = pxlen / (double) plsc->phyxlen;
1964 plsc->didyay = pylen / (
double) plsc->phyylen;
1965 plsc->didxb = pxmin - plsc->didxax * plsc->phyxmi;
1966 plsc->didyb = pymin - plsc->didyay * plsc->phyymi;
1970 plsc->diclpxmi = (
PLINT) ( plsc->didxax * plsc->phyxmi + plsc->didxb );
1971 plsc->diclpxma = (
PLINT) ( plsc->didxax * plsc->phyxma + plsc->didxb );
1972 plsc->diclpymi = (
PLINT) ( plsc->didyay * plsc->phyymi + plsc->didyb );
1973 plsc->diclpyma = (
PLINT) ( plsc->didyay * plsc->phyyma + plsc->didyb );
1986 *p_aspect = plsc->aspect;
2023 PLFLT x0, y0, lx, ly, aspect;
2029 if ( !plsc->stream_closed )
2031 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
2037 if ( !( plsc->difilt &
PLDI_ORI ) )
2042 x0 = ( plsc->phyxma + plsc->phyxmi ) / 2.;
2043 y0 = ( plsc->phyyma + plsc->phyymi ) / 2.;
2047 cost =
ABS( cos( plsc->diorot *
PI / 2. ) );
2048 sint =
ABS( sin( plsc->diorot *
PI / 2. ) );
2052 aspect = plsc->aspect;
2054 aspect = plsc->aspdev;
2056 if ( plsc->freeaspect )
2057 plsc->aspori = aspect;
2059 plsc->aspori = ( aspect * cost + sint ) / ( aspect * sint + cost );
2061 if ( !( plsc->difilt &
PLDI_DEV ) )
2106 plsc->dioxax = affine_result[0];
2107 plsc->dioxay = affine_result[2];
2108 plsc->dioxb = affine_result[4];
2109 plsc->dioyax = affine_result[1];
2110 plsc->dioyay = affine_result[3];
2111 plsc->dioyb = affine_result[5];
2123 *p_rot = plsc->diorot;
2139 plsetvar( plsc->dimxmin, dimxmin );
2140 plsetvar( plsc->dimxmax, dimxmax );
2141 plsetvar( plsc->dimymin, dimymin );
2142 plsetvar( plsc->dimymax, dimymax );
2143 plsetvar( plsc->dimxpmm, dimxpmm );
2144 plsetvar( plsc->dimypmm, dimypmm );
2163 PLINT pxmin, pxmax, pymin, pymax;
2164 PLFLT dimxlen, dimylen, pxlen, pylen;
2166 if ( ( plsc->dimxmin == plsc->phyxmi ) && ( plsc->dimxmax == plsc->phyxma ) &&
2167 ( plsc->dimymin == plsc->phyymi ) && ( plsc->dimymax == plsc->phyyma ) &&
2168 ( plsc->dimxpmm == plsc->xpmm ) && ( plsc->dimypmm == plsc->ypmm ) )
2176 lx = ( plsc->dimxmax - plsc->dimxmin + 1 ) / plsc->dimxpmm;
2177 ly = ( plsc->dimymax - plsc->dimymin + 1 ) / plsc->dimypmm;
2179 plsc->aspdev = lx / ly;
2183 dimxlen = plsc->dimxmax - plsc->dimxmin;
2184 dimylen = plsc->dimymax - plsc->dimymin;
2186 pxmin = plsc->phyxmi;
2187 pxmax = plsc->phyxma;
2188 pymin = plsc->phyymi;
2189 pymax = plsc->phyyma;
2190 pxlen = pxmax - pxmin;
2191 pylen = pymax - pymin;
2193 plsc->dimxax = pxlen / dimxlen;
2194 plsc->dimyay = pylen / dimylen;
2195 plsc->dimxb = pxmin - pxlen * plsc->dimxmin / dimxlen;
2196 plsc->dimyb = pymin - pylen * plsc->dimymin / dimylen;
2208 if ( plsc->dev_flush )
2211 if ( !plsc->stream_closed )
2213 ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
2220 if ( plsc->OutFile != NULL )
2221 fflush( plsc->OutFile );
2244 #ifdef ENABLE_DYNDRIVERS
2266 if ( plsc->level != 0 )
2285 if ( plsc->level != 0 )
2303 PLFLT lx, ly, xpmm_loc, ypmm_loc, aspect_old, aspect_new;
2307 if ( plsc->level != 0 )
2323 if ( plsc->plwindow == NULL )
2325 if ( plsc->program )
2327 if ( ( plsc->plwindow = (
char *) malloc( (
size_t) ( 1 + strlen( plsc->program ) ) * sizeof (
char ) ) ) == NULL )
2329 plexit(
"plinit: Insufficient memory" );
2331 strcpy( plsc->plwindow, plsc->program );
2335 if ( ( plsc->plwindow = (
char *) malloc( (
size_t) 7 *
sizeof (
char ) ) ) == NULL )
2337 plexit(
"plinit: Insufficient memory" );
2339 strcpy( plsc->plwindow,
"PLplot" );
2366 if ( plsc->aspect > 0. )
2368 lx = plsc->phyxlen / plsc->xpmm;
2369 ly = plsc->phyylen / plsc->ypmm;
2370 aspect_old = lx / ly;
2371 aspect_new = plsc->aspect;
2372 plsc->caspfactor = sqrt( aspect_old / aspect_new );
2376 else if ( plsc->freeaspect &&
ABS( cos( plsc->diorot *
PI / 2. ) ) <= 1.e-5 )
2378 lx = plsc->phyxlen / plsc->xpmm;
2379 ly = plsc->phyylen / plsc->ypmm;
2380 aspect_old = lx / ly;
2381 aspect_new = ly / lx;
2382 plsc->caspfactor = sqrt( aspect_old / aspect_new );
2386 plsc->caspfactor = 1.;
2400 if ( plsc->xdigmax == 0 )
2403 if ( plsc->ydigmax == 0 )
2406 if ( plsc->zdigmax == 0 )
2409 if ( plsc->timefmt == NULL )
2415 if ( plsc->qsasconfig == NULL )
2416 c_plconfigtime( 0., 0., 0., 0x0, 0, 0, 0, 0, 0, 0, 0. );
2431 plsc->clpxmi = plsc->phyxmi;
2432 plsc->clpxma = plsc->phyxma;
2433 plsc->clpymi = plsc->phyymi;
2434 plsc->clpyma = plsc->phyyma;
2438 lx = plsc->phyxlen / plsc->xpmm;
2439 ly = plsc->phyylen / plsc->ypmm;
2440 plsc->aspdev = lx / ly;
2453 plP_setpxl( xpmm_loc * plsc->caspfactor, ypmm_loc / plsc->caspfactor );
2472 if (
pls[i] != NULL )
2479 #ifdef ENABLE_DYNDRIVERS
2485 free_mem( loadable_device_list[i].devnam );
2486 free_mem( loadable_device_list[i].description );
2487 free_mem( loadable_device_list[i].drvnam );
2488 free_mem( loadable_device_list[i].tag );
2491 for ( i = 0; i < nloadabledrivers; i++ )
2493 free_mem( loadable_driver_list[i].drvnam );
2523 if ( plsc->level > 0 )
2531 if ( plsc->FileName )
2544 if ( plsc->program )
2546 if ( plsc->server_name )
2548 if ( plsc->server_host )
2550 if ( plsc->server_port )
2554 if ( plsc->plserver )
2556 if ( plsc->auto_path )
2559 if ( plsc->arrow_x )
2561 if ( plsc->arrow_y )
2564 if ( plsc->timefmt )
2573 if ( plsc->mf_infile )
2575 if ( plsc->mf_outfile )
2605 "plsstrm: Illegal stream number %d, must be in [0, %d]\n",
2615 plexit(
"plsstrm: Out of memory." );
2656 if (
pls[i] == NULL )
2660 if ( i == PL_NSTREAMS )
2662 fprintf( stderr,
"plmkstrm: Cannot create new stream\n" );
2692 if ( !plsc->initialized )
2694 plsc->initialized = 1;
2696 if ( plsc->cmap0 == NULL )
2699 if ( plsc->cmap1 == NULL )
2703 plsc->cmap1_min = 0.0;
2704 plsc->cmap1_max = 1.0;
2748 fprintf( stderr,
"plcpstrm: stream %d not in use\n", (
int) iplsr );
2754 plsc->debug = plsr->
debug;
2762 if ( ( plsc->plbuf_buffer = malloc( plsc->plbuf_buffer_size ) ) == NULL )
2763 plexit(
"plcpstrm: Error allocating plot buffer." );
2780 if ( !( flags & 0x01 ) )
2782 pldebug(
"plcpstrm",
"mapping parameters: %d %d %d %d %f %f\n",
2795 plsc->icol0 = plsr->
icol0;
2796 plsc->ncol0 = plsr->
ncol0;
2797 if ( plsc->cmap0 != NULL )
2798 free( (
void *) plsc->cmap0 );
2800 if ( ( plsc->cmap0 = (
PLColor *) calloc( 1, (
size_t) plsc->ncol0 * sizeof (
PLColor ) ) ) == NULL )
2802 plexit(
"c_plcpstrm: Insufficient memory" );
2805 for ( i = 0; i < plsc->ncol0; i++ )
2810 plsc->icol1 = plsr->
icol1;
2811 plsc->ncol1 = plsr->
ncol1;
2814 if ( plsc->cmap1 != NULL )
2815 free( (
void *) plsc->cmap1 );
2817 if ( ( plsc->cmap1 = (
PLColor *) calloc( 1, (
size_t) plsc->ncol1 * sizeof (
PLColor ) ) ) == NULL )
2819 plexit(
"c_plcpstrm: Insufficient memory" );
2822 for ( i = 0; i < plsc->ncol1; i++ )
2827 if ( plsc->level == 0 )
2855 if ( plsc->dev_initialized )
2857 plsc->dev_initialized = 1;
2869 static int inited = 0;
2870 static int inBuildTree = 0;
2874 int len_currdir, len_builddir;
2881 pldebug(
"plInBuildTree():",
"Not enough buffer space" );
2885 pldebug(
"plInBuildTree(): ",
"current directory >%s<\n", currdir );
2886 pldebug(
"plInBuildTree(): ",
"build directory >%s<\n",
BUILD_DIR );
2894 pldebug(
"plInBuildTree():",
"Not enough buffer space" );
2898 len_currdir = strlen( currdir );
2899 len_builddir = strlen( builddir );
2900 #if defined ( IGNORECASE )
2901 pldebug(
"plInBuildTree(): ",
"comparing ignoring case\n" );
2904 for (; *pcurrdir; ++pcurrdir )
2906 *pcurrdir = tolower( *pcurrdir );
2907 if ( *pcurrdir ==
'\\' )
2912 for (; *pbuilddir; ++pbuilddir )
2914 *pbuilddir = tolower( *pbuilddir );
2915 if ( *pbuilddir ==
'\\' )
2928 if ( strncmp( builddir, currdir, len_builddir ) == 0 &&
2929 ( len_currdir == len_builddir || currdir[len_builddir] ==
'\\' || currdir[len_builddir] ==
'/' ) )
2931 pldebug(
"plInBuildTree(): ",
"comparing respecting case\n" );
2932 if ( strncmp( builddir, currdir, len_builddir ) == 0 &&
2933 ( len_currdir == len_builddir || currdir[len_builddir] ==
'/' ) )
2939 if ( chdir( currdir ) != 0 )
2940 pldebug(
"plInBuildTree():",
"Unable to chdir to current directory" );
2948 #ifdef ENABLE_DYNDRIVERS
2962 pldebug(
"plGetDrvDir",
"Using %s as the driver directory.\n", drvdir );
2966 pldebug(
"plGetDrvDir",
"Trying to read env var PLPLOT_DRV_DIR\n" );
2967 drvdir = getenv(
"PLPLOT_DRV_DIR" );
2969 if ( drvdir == NULL )
2971 pldebug(
"plGetDrvDir",
2972 "Will use drivers dir: " DRV_DIR "\n" );
3005 #ifdef ENABLE_DYNDRIVERS
3008 char *devnam, *devdesc, *devtype, *driver, *tag, *seqstr;
3010 int i, j, driver_found, done = 0;
3011 FILE *fp_drvdb = NULL;
3012 DIR * dp_drvdir = NULL;
3018 nloadabledrivers = 0;
3023 if ( fp_drvdb == NULL )
3025 plabort(
"plInitDispatchTable: Could not open temporary file" );
3030 drvdir = plGetDrvDir();
3031 dp_drvdir =
opendir( drvdir );
3032 if ( dp_drvdir == NULL )
3035 plabort(
"plInitDispatchTable: Could not open drivers directory" );
3041 pldebug(
"plInitDispatchTable",
"Scanning dyndrivers dir\n" );
3042 while ( ( entry =
readdir( dp_drvdir ) ) != NULL )
3046 size_t len = strlen( name ) - 12;
3048 pldebug(
"plInitDispatchTable",
3049 "Consider file %s\n", name );
3052 if ( ( len > 0 ) && ( strcmp( name + len,
".driver_info" ) == 0 ) )
3059 fd = fopen( path,
"r" );
3065 "plInitDispatchTable: Could not open driver info file %s\n",
3075 pldebug(
"plInitDispatchTable",
3076 "Opened driver info file %s\n", name );
3079 fprintf( fp_drvdb,
"%s", buf );
3080 if ( buf [strlen( buf ) - 1] !=
'\n' )
3081 fprintf( fp_drvdb,
"\n" );
3099 #ifdef ENABLE_DYNDRIVERS
3102 plexit(
"plInitDispatchTable: Insufficient memory" );
3114 #ifdef ENABLE_DYNDRIVERS
3117 plexit(
"plInitDispatchTable: Insufficient memory" );
3129 #ifdef ENABLE_DYNDRIVERS
3134 if ( ( ( loadable_device_list = malloc( (
size_t)
npldynamicdevices *
sizeof ( PLLoadableDevice ) ) ) == NULL ) ||
3135 ( ( loadable_driver_list = malloc( (
size_t)
npldynamicdevices *
sizeof ( PLLoadableDriver ) ) ) == NULL ) )
3138 plexit(
"plInitDispatchTable: Insufficient memory" );
3155 devnam = strtok( buf,
":" );
3156 devdesc = strtok( 0,
":" );
3157 devtype = strtok( 0,
":" );
3158 driver = strtok( 0,
":" );
3159 seqstr = strtok( 0,
":" );
3160 tag = strtok( 0,
"\n" );
3162 if ( devnam == NULL || devdesc == NULL || devtype == NULL || driver == NULL ||
3163 seqstr == NULL || tag == NULL )
3168 seq = atoi( seqstr );
3175 plexit(
"plInitDispatchTable: Insufficient memory" );
3190 loadable_device_list[i].devnam =
plstrdup( devnam );
3191 loadable_device_list[i].description =
plstrdup( devdesc );
3192 loadable_device_list[i].drvnam =
plstrdup( driver );
3193 loadable_device_list[i].tag =
plstrdup( tag );
3198 for ( j = 0; j < nloadabledrivers; j++ )
3199 if ( strcmp( driver, loadable_driver_list[j].drvnam ) == 0 )
3205 if ( !driver_found )
3207 loadable_driver_list[nloadabledrivers].drvnam =
plstrdup( driver );
3208 loadable_driver_list[nloadabledrivers].dlhand = 0;
3212 loadable_device_list[i].drvidx = j;
3226 plexit(
"No device drivers found - please check the environment variable PLPLOT_DRV_DIR" );
3257 if ( plsc->DevName[0] ==
'\0' )
3259 devname_env = getenv(
"PLPLOT_DEV" );
3262 strncpy( plsc->DevName, devname_env, sizeof ( plsc->DevName ) - 1 );
3263 plsc->DevName[
sizeof ( plsc->DevName ) - 1] =
'\0';
3269 if ( *( plsc->DevName ) !=
'\0' && *( plsc->DevName ) !=
'?' )
3271 length = strlen( plsc->DevName );
3275 ( strncmp( plsc->DevName,
3279 if ( i < npldrivers )
3281 plsc->device = i + 1;
3286 fprintf( stderr,
"Requested device %s not available\n",
3301 fprintf( stdout,
"\nPlotting Options:\n" );
3304 fprintf( stdout,
" <%2d> %-10s %s\n", i + 1,
3309 fprintf( stdout,
"\nEnter device number or keyword: " );
3311 fprintf( stdout,
"\nEnter device number or keyword (stream %d): ",
3314 plio_fgets( response,
sizeof ( response ), stdin );
3319 length = strlen( response );
3320 if ( *( response - 1 + length ) ==
'\n' )
3326 (
unsigned int) length ) )
3329 if ( i < npldrivers )
3335 if ( ( dev = atoi( response ) ) < 1 )
3337 fprintf( stdout,
"\nInvalid device: %s", response );
3342 plexit(
"plSelectDev: Too many tries." );
3359 #ifdef ENABLE_DYNDRIVERS
3364 int n = plsc->device - 1;
3366 PLLoadableDriver *driver = 0;
3374 pldebug(
"plLoadDriver",
"Device not loaded!\n" );
3379 if ( strcmp( dev->
pl_DevName, loadable_device_list[i].devnam ) == 0 )
3385 if ( i == npldynamicdevices )
3387 fprintf( stderr,
"No such device: %s.\n", dev->
pl_DevName );
3388 plexit(
"plLoadDriver detected device logic screwup" );
3394 tag = loadable_device_list[i].tag;
3395 drvidx = loadable_device_list[i].drvidx;
3397 pldebug(
"plLoadDriver",
"tag=%s, drvidx=%d\n", tag, drvidx );
3399 driver = &loadable_driver_list[drvidx];
3402 if ( !driver->dlhand )
3405 #if defined ( LTDL_WIN32 ) || defined ( __CYGWIN__ )
3409 #endif // LTDL_WIN32
3411 pldebug(
"plLoadDriver",
"Trying to load %s on %s\n",
3412 driver->drvnam, drvspec );
3423 if ( !( strcmp( driver->drvnam,
"mem" ) == 0 ||
3424 strcmp( driver->drvnam,
"null" ) == 0 ||
3425 strcmp( driver->drvnam,
"plmeta" ) == 0 ||
3426 strcmp( driver->drvnam,
"ps" ) == 0 ||
3427 strcmp( driver->drvnam,
"svg" ) == 0 ||
3428 strcmp( driver->drvnam,
"xfig" ) == 0 ) )
3433 if ( !driver->dlhand )
3435 pldebug(
"plLoadDriver",
"lt_dlopenext failed because of "
3436 "the following reason:\n%s\n",
lt_dlerror() );
3437 fprintf( stderr,
"Unable to load driver: %s.\n", driver->drvnam );
3438 plexit(
"Unable to load driver" );
3447 if ( !dispatch_init )
3450 "Unable to locate dispatch table initialization function for driver: %s.\n",
3455 ( *dispatch_init )( dev );
3472 if ( plsc->level > 0 )
3487 if ( plsc->plbuf_buffer != NULL )
3493 plwarn(
"plreplot: plot buffer not available" );
3509 plgFileDevs(
const char ***p_menustr,
const char ***p_devname,
int *p_ndev )
3511 plgdevlst( *p_menustr, *p_devname, p_ndev, 0 );
3521 plgDevs(
const char ***p_menustr,
const char ***p_devname,
int *p_ndev )
3523 plgdevlst( *p_menustr, *p_devname, p_ndev, -1 );
3527 plgdevlst(
const char **p_menustr,
const char **p_devname,
int *p_ndev,
int type )
3539 if ( ++j + 1 >= *p_ndev )
3541 plwarn(
"plgdevlst: too many devices" );
3546 p_menustr[j] = NULL;
3547 p_devname[j] = NULL;
3563 *p_xleng = plsc->xlength;
3564 *p_yleng = plsc->ylength;
3565 *p_xoff = plsc->xoffset;
3566 *p_yoff = plsc->yoffset;
3574 if ( plsc->level > 0 )
3575 plwarn(
"calling plspage() after plinit() may give unpredictable results" );
3583 plsc->xlength = xleng;
3585 plsc->ylength = yleng;
3588 plsc->xoffset = xoff;
3590 plsc->yoffset = yoff;
3605 if ( plsc->level > 0 )
3612 if ( plsc->plbuf_write )
3621 if ( plsc->level > 0 )
3623 plwarn(
"plsdev: Must be called before plinit." );
3626 if ( devname != NULL )
3628 strncpy( plsc->DevName, devname, sizeof ( plsc->DevName ) - 1 );
3629 plsc->DevName[
sizeof ( plsc->DevName ) - 1] =
'\0';
3639 strcpy( p_dev, plsc->DevName );
3654 plsc->dev = plotmem;
3655 plsc->dev_mem_alpha = 0;
3664 plsc->dev = plotmem;
3665 plsc->dev_mem_alpha = 1;
3688 *p_level = plsc->level;
3697 plsc->KeyEH = KeyEH;
3698 plsc->KeyEH_data = KeyEH_data;
3705 void *ButtonEH_data )
3707 plsc->ButtonEH = ButtonEH;
3708 plsc->ButtonEH_data = ButtonEH_data;
3714 plsbopH(
void ( *handler )(
void *,
int * ),
void *handler_data )
3716 plsc->bop_handler = handler;
3717 plsc->bop_data = handler_data;
3723 plseopH(
void ( *handler )(
void *,
int * ),
void *handler_data )
3725 plsc->eop_handler = handler;
3726 plsc->eop_data = handler_data;
3734 if ( errcode != NULL )
3735 plsc->errcode = errcode;
3737 if ( errmsg != NULL )
3758 if ( width != plsc->width && width >= 0. )
3760 plsc->width = width;
3762 if ( plsc->level > 0 )
3764 if ( !plsc->widthlock )
3775 *p_file = plsc->OutFile;
3783 plsc->OutFile = file;
3794 plabort(
"filename string must be preallocated to >=80 bytes" );
3799 if ( plsc->FileName != NULL )
3801 strncpy( fnam, plsc->FileName, 79 );
3825 plsc->dev_data =
data;
3841 plsc->setpre = setp;
3842 plsc->precis = prec;
3850 *p_setp = plsc->setpre;
3851 *p_prec = plsc->precis;
3886 plwarn(
"plsesc: Invalid escape character, ignoring." );
3895 if ( plsc->esc ==
'\0' )
3929 *pfci = *pfci & mask;
3931 *pfci = *pfci | mask;
3942 *phexdigit = (
unsigned char) ( ( fci & mask ) >>
3959 plsc->window_id = window_id;
3976 *p_fam = plsc->family;
3977 *p_num = plsc->member;
3978 *p_bmax = plsc->bytemax;
3986 if ( plsc->level > 0 )
3987 plwarn(
"plsfam: Must be called before plinit." );
3994 plsc->bytemax = bmax;
4015 *p_digmax = plsc->xdigmax;
4016 *p_digits = plsc->xdigits;
4024 plsc->xdigmax = digmax;
4025 plsc->xdigits = digits;
4033 *p_digmax = plsc->ydigmax;
4034 *p_digits = plsc->ydigits;
4042 plsc->ydigmax = digmax;
4043 plsc->ydigits = digits;
4051 *p_digmax = plsc->zdigmax;
4052 *p_digits = plsc->zdigits;
4060 plsc->zdigmax = digmax;
4061 plsc->zdigits = digits;
4069 *p_def = plsc->chrdef;
4070 *p_ht = plsc->chrht;
4078 *p_xmin = plsc->vpdxmi;
4079 *p_xmax = plsc->vpdxma;
4080 *p_ymin = plsc->vpdymi;
4081 *p_ymax = plsc->vpdyma;
4089 *p_xmin = plsc->vpwxmi;
4090 *p_xmax = plsc->vpwxma;
4091 *p_ymin = plsc->vpwymi;
4092 *p_ymax = plsc->vpwyma;
4101 dx = ( plsc->vpwxma - plsc->vpwxmi ) * 1.0e-5;
4102 dy = ( plsc->vpwyma - plsc->vpwymi ) * 1.0e-5;
4107 *p_xmin = plsc->vpwxmi - dx;
4108 *p_xmax = plsc->vpwxma + dx;
4109 *p_ymin = plsc->vpwymi - dy;
4110 *p_ymax = plsc->vpwyma + dy;
4122 *p_xmin = plsc->domxmi;
4123 *p_xmax = plsc->domxma;
4124 *p_ymin = plsc->domymi;
4125 *p_ymax = plsc->domyma;
4133 *p_zscl = plsc->zzscl;
4134 *p_zmin = plsc->ranmi;
4135 *p_zmax = plsc->ranma;
4155 *p_ixmin = plsc->clpxmi;
4156 *p_ixmax = plsc->clpxma;
4157 *p_iymin = plsc->clpymi;
4158 *p_iymax = plsc->clpyma;
4166 plsc->clpxmi = ixmin;
4167 plsc->clpxma = ixmax;
4168 plsc->clpymi = iymin;
4169 plsc->clpyma = iymax;
4170 if ( plsc->plbuf_write )
4179 *p_ixmin = plsc->phyxmi;
4180 *p_ixmax = plsc->phyxma;
4181 *p_iymin = plsc->phyymi;
4182 *p_iymax = plsc->phyyma;
4190 *p_nx = plsc->nsubx;
4191 *p_ny = plsc->nsuby;
4192 *p_cs = plsc->cursub;
4221 plsc->umx = (
PLINT) ( 1000.0 / plsc->xpmm );
4222 plsc->umy = (
PLINT) ( 1000.0 / plsc->ypmm );
4230 if ( xmin > xmax || ymin > ymax )
4231 plexit(
"plP_setphy: device minima must not exceed maxima" );
4233 plsc->phyxmi = xmin;
4234 plsc->phyxma = xmax;
4235 plsc->phyymi = ymin;
4236 plsc->phyyma = ymax;
4237 plsc->phyxlen = xmax - xmin;
4238 plsc->phyylen = ymax - ymin;
4251 if ( plsc->level <= 0 )
4253 plsc->dev_compression = compression;
4266 *compression = plsc->dev_compression;
4287 if (
pls[i] != NULL )
4290 strcpy( names,
pls[i]->DevName );
4293 strcat( names,
" " );
4294 strcat( names,
pls[i]->DevName );
4317 buff = (
char *) malloc( (
size_t)
PL_NSTREAMS * 8 );
4325 for ( tok = strtok( buff,
" ," );
4326 tok; tok = strtok( 0,
" ," ) )
4328 if ( strstr( names, tok ) != NULL )
4359 plimageslow( z, nx, ny, xmin, ymin, dx, dy, pltr, pltr_data );
4370 #if 0 // BEGIN dev_fastimg COMMENT
4377 if ( plsc->dev_fastimg == 0 )
4380 xmin, ymin, dx, dy, zmin, zmax );
4384 if ( plsc->plbuf_write )
4396 plsc->dev_nptsX = nx;
4397 plsc->dev_nptsY = ny;
4398 plsc->dev_zmin = zmin;
4399 plsc->dev_zmax = zmax;
4405 plbuf_write = plsc->plbuf_write;
4406 plsc->plbuf_write = 0;
4411 PLINT clpxmi, clpxma, clpymi, clpyma;
4413 if ( ( ( xscl = (
short *) malloc( nx * ny *
sizeof (
short ) ) ) == NULL ) ||
4414 ( ( yscl = (
short *) malloc( nx * ny *
sizeof (
short ) ) ) == NULL ) )
4416 plexit(
"plP_image: Insufficient memory" );
4419 for ( i = 0; i < npts; i++ )
4424 sdifilt( xscl, yscl, npts, &clpxmi, &clpxma, &clpymi, &clpyma );
4425 plsc->imclxmin = clpxmi;
4426 plsc->imclymin = clpymi;
4427 plsc->imclxmax = clpxma;
4428 plsc->imclymax = clpyma;
4429 grimage( xscl, yscl, z, nx, ny );
4435 plsc->imclxmin = plsc->phyxmi;
4436 plsc->imclymin = plsc->phyymi;
4437 plsc->imclxmax = plsc->phyxma;
4438 plsc->imclymax = plsc->phyyma;
4442 #endif // END dev_fastimg COMMENT
4454 plsc->coordinate_transform = coordinate_transform;
4455 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 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(* PLDispatchInit)(PLDispatchTable *pdt)
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)
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 xform(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data)
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)
void(* PLTRANSFORM_callback)(PLFLT x, PLFLT y, PLFLT_NC_SCALAR xp, PLFLT_NC_SCALAR yp, PLPointer data)
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)