47 #ifdef ENABLE_DYNDRIVERS    59 # ifdef NEED_SYS_TYPE_H    60 #  include <sys/types.h>    63 # define NAMLEN( dirent )    strlen( ( dirent )->d_name )    65 # if defined ( _MSC_VER )    68 #  define dirent    direct    69 #  define NAMLEN( dirent )    ( dirent )->d_namlen    71 #   include <sys/ndir.h>    88 #if defined ( _MSC_VER )    90 #  define getcwd        _getcwd    94 #define BUFFER_SIZE     80    95 #define BUFFER2_SIZE    300    96 #define DRVSPEC_SIZE    400   148     plsc->page_status   = 
AT_EOP;
   149     plsc->stream_closed = 
FALSE;
   152     ( *plsc->dispatch_table->pl_init )( (
struct PLStream_struct *) plsc );
   155     if ( plsc->plbuf_write )
   166     int skip_driver_eop = 0;
   168     if ( plsc->page_status == 
AT_EOP )
   171     plsc->page_status = 
AT_EOP;
   173     if ( plsc->plbuf_write )
   178     if ( plsc->eop_handler != NULL )
   179         ( *plsc->eop_handler )( plsc->eop_data, &skip_driver_eop );
   181     if ( !skip_driver_eop )
   184         if ( !plsc->stream_closed )
   186             ( *plsc->dispatch_table->pl_eop )( (
struct PLStream_struct *) plsc );
   200     int skip_driver_bop = 0;
   203     if ( plsc->page_status == 
AT_BOP )
   206     plsc->page_status = 
AT_BOP;
   211     if ( plsc->bop_handler != NULL )
   212         ( *plsc->bop_handler )( plsc->bop_data, &skip_driver_bop );
   214     if ( !skip_driver_bop )
   217         if ( !plsc->stream_closed )
   219             ( *plsc->dispatch_table->pl_bop )( (
struct PLStream_struct *) plsc );
   224     if ( plsc->plbuf_write )
   236         ( *plsc->tidy )( plsc->tidy_data );
   238         plsc->tidy_data = NULL;
   242     ( *plsc->dispatch_table->pl_tidy )( (
struct PLStream_struct *) plsc );
   245     if ( plsc->plbuf_write )
   250     plsc->OutFile = NULL;
   259     if ( plsc->plbuf_write )
   263     if ( !plsc->stream_closed )
   265         ( *plsc->dispatch_table->pl_state )( (
struct PLStream_struct *) plsc, op );
   276     PLINT  clpxmi, clpxma, clpymi, clpyma;
   280     if ( plsc->plbuf_write )
   291             difilt( &( args->
x ), &( args->
y ), 1, &clpxmi, &clpxma, &clpymi, &clpyma );
   296     if ( !plsc->stream_closed )
   298         ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc, op, ptr );
   311     PLINT    clpxmi, clpxma, clpymi, clpyma;
   315     if ( plsc->plbuf_write )
   320     w->
dxmi = plwin->dxmi;
   321     w->
dxma = plwin->dxma;
   322     w->
dymi = plwin->dymi;
   323     w->
dyma = plwin->dyma;
   340     w->
wxmi = plwin->wxmi;
   341     w->
wxma = plwin->wxma;
   342     w->
wymi = plwin->wymi;
   343     w->
wyma = plwin->wyma;
   348     if ( plsc->dev_swin )
   351         if ( !plsc->stream_closed )
   353             ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
   369     if ( !plsc->nopause && *plsc->dispatch_table->pl_wait != NULL )
   372         if ( !plsc->stream_closed )
   374             ( *plsc->dispatch_table->pl_wait )( (
struct PLStream_struct *) plsc );
   390     PLINT i, npts = 2, clpxmi, clpxma, clpymi, clpyma;
   394     if ( plsc->plbuf_write )
   399         for ( i = 0; i < npts; i++ )
   419     PLINT i, clpxmi, clpxma, clpymi, clpyma;
   423     if ( plsc->plbuf_write )
   428         for ( i = 0; i < npts; i++ )
   453     PLINT i, clpxmi, clpxma, clpymi, clpyma;
   457     if ( plsc->plbuf_write )
   459         plsc->dev_npts = npts;
   467     if ( plsc->patt == 0 && !plsc->dev_fill0 )
   471             plwarn( 
"Driver does not support hardware solid fills, switching to software fill.\n" );
   477     if ( plsc->dev_fill1 )
   479         plsc->patt = -
ABS( plsc->patt );
   487     if ( plsc->patt > 0 )
   494             for ( i = 0; i < npts; i++ )
   518     PLINT i, clpxmi, clpxma, clpymi, clpyma;
   522     if ( plsc->plbuf_write )
   524         plsc->dev_npts = npts;
   533         for ( i = 0; i < npts; i++ )
   572     if ( !strncmp( text, 
"0x", 2 ) || !strncmp( text, 
"0X", 2 ) )
   575     *num = (
PLUNICODE) strtoul( text, &endptr, base );
   577     if ( end != endptr[0] )
   580         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 );
   584     return (
int) ( endptr - 
text );
   610         unsigned char hexdigit;
   611         unsigned char hexpower;
   617 #define N_TextLookupTable    10   633         length = (int) strlen( lookup[i].ptext );
   634         if ( !strncmp( text, lookup[i].ptext, (
size_t) length ) )
   636             *hexdigit = lookup[i].hexdigit;
   637             *hexpower = lookup[i].hexpower;
   651     unsigned char hexdigit, hexpower;
   662     len = strlen( 
string );
   679     for ( i = 0; i < len; i++ )
   683         if ( 
string[i] == esc )
   685             switch ( 
string[i + 1] )
   688                 i  += 2 + 
text2num( &
string[i + 2], 
')', &code );
   695                 pldebug( 
"alternate_unicode_processing", 
"code, idx, args->n_char = %d, %d, %#x\n", (
int) code, idx, args->
n_char );
   702                 i           += 2 + 
text2num( &
string[i + 2], 
']', &code );
   709                 if ( 
'0' <= 
string[i + 2] && 
string[i + 2] <= 
'9' )
   711                     i += 2 + 
text2num( &
string[i + 2], 
'>', &code );
   743                     i += 
text2fci( &
string[i + 1], &hexdigit, &hexpower );
   765                 if ( 
string[i + 2] == 
'n' )
   770                 else if ( 
string[i + 2] == 
'r' )
   775                 else if ( 
string[i + 2] == 
'i' )
   781                 else if ( 
string[i + 2] == 
's' )
   818                     else if ( ig == 634 )
   820                     else if ( ig == 647 )
   832                     pldebug( 
"alternate_unicode_processing", 
"ig, idx, args->n_char = %d, %d, %#x\n", ig, idx, args->
n_char );
   885 #ifdef HAVE_LIBUNICODE   886             PLCHAR_VECTOR ptr = unicode_get_utf8( 
string + i, &unichar );
   894                 strncpy( tmpstring, 
string, 30 );
   895                 tmpstring[30] = 
'\0';
   897                     tmpstring, strlen( 
string ) > 30 ? 
"[...]" : 
"" );
   901             i += (int) ( ptr - ( 
string + i ) - 1 );
   906             if ( 
string[i] == esc && 
string[i + 1] == esc )
   930     unsigned char hexdigit, hexpower;
   942     len = strlen( 
string );
   964     for ( j = i = 0; i < len; i++ )
   968         if ( 
string[i] == esc )
   972             switch ( 
string[i + 1] )
   975                 i  += ( 2 + 
text2num( &
string[i + 2], 
')', &code ) );
   982                 pldebug( 
"encode_unicode", 
"code, idx, args->unicode_array[j] = %d, %d, %#x\n", (
int) code, idx, args->
unicode_array[j] );
   998                 i += ( 2 + 
text2num( &
string[i + 2], 
']', &code ) );
  1015                 if ( 
'0' <= 
string[i + 2] && 
string[i + 2] <= 
'9' )
  1017                     i += 2 + 
text2num( &
string[i + 2], 
'>', &code );
  1043                     i += 
text2fci( &
string[i + 1], &hexdigit, &hexpower );
  1062                 if ( 
string[i + 2] == 
'n' )
  1067                 else if ( 
string[i + 2] == 
'r' )
  1072                 else if ( 
string[i + 2] == 
'i' )
  1078                 else if ( 
string[i + 2] == 
's' )
  1113                     else if ( ig == 634 )
  1115                     else if ( ig == 647 )
  1123                     pldebug( 
"encode_unicode", 
"ig, idx, args->unicode_array[j] = %d, %d, %#x\n", (
int) ig, idx, args->
unicode_array[j] );
  1146 #ifdef HAVE_LIBUNICODE  1147             PLCHAR_VECTOR ptr = unicode_get_utf8( 
string + i, &unichar );
  1155                 strncpy( tmpstring, 
string, 30 );
  1156                 tmpstring[30] = 
'\0';
  1158                     tmpstring, strlen( 
string ) > 30 ? 
"[...]" : 
"" );
  1163             i += (int) ( ptr - ( 
string + i ) - 1 );
  1169                  && 
string[i + 1] == esc )
  1193     if ( 
string == NULL )
  1196     if ( plsc->dev_text ) 
  1215         if ( plsc->dev_unicode )
  1217             if ( plsc->alt_unicode )
  1242             len = strlen( 
string );
  1254         plstr( base, xform, refx, refy, 
string );
  1274             if ( (
unsigned char) ( tmp & 0x80 ) == 0x00 ) 
  1276                 *unichar = (
unsigned int) tmp & 0x7F;
  1279             else if ( (
unsigned char) ( tmp & 0xE0 ) == 0xC0 ) 
  1281                 *unichar = (
unsigned int) tmp & 0x1F;
  1284             else if ( (
unsigned char) ( tmp & 0xF0 ) == 0xE0 ) 
  1286                 *unichar = (
unsigned char) tmp & 0x0F;
  1289             else if ( (
unsigned char) ( tmp & 0xF8 ) == 0xF0 ) 
  1291                 *unichar = (
unsigned char) tmp & 0x07;
  1294             else if ( (
unsigned char) ( tmp & 0xFC ) == 0xF8 ) 
  1296                 *unichar = (
unsigned char) tmp & 0x03;
  1299             else if ( (
unsigned char) ( tmp & 0xFE ) == 0xFC ) 
  1301                 *unichar = (
unsigned char) tmp & 0x01;
  1312             if ( (
unsigned char) ( tmp & 0xC0 ) == 0x80 )
  1314                 *unichar = ( *unichar << 6 ) | ( (
unsigned int) tmp & 0x3F );
  1323     } 
while ( cnt > 0 );
  1334     tmp = (
unsigned char *) ptr;
  1336     if ( ( unichar & 0xffff80 ) == 0 ) 
  1338         *tmp = (
unsigned char) unichar;
  1342     else if ( ( unichar & 0xfff800 ) == 0 ) 
  1344         *tmp = (
unsigned char) 0xc0 | (
unsigned char) ( unichar >> 6 );
  1346         *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( unichar & (
PLUINT) 0x3f ) );
  1350     else if ( ( unichar & 0xff0000 ) == 0 ) 
  1352         *tmp = (
unsigned char) 0xe0 | (
unsigned char) ( unichar >> 12 );
  1354         *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( ( unichar >> 6 ) & 0x3f ) );
  1356         *tmp = (
unsigned char) ( 0x80 | ( (
unsigned char) unichar & 0x3f ) );
  1360     else if ( ( unichar & 0xe0000 ) == 0 ) 
  1362         *tmp = (
unsigned char) 0xf0 | (
unsigned char) ( unichar >> 18 );
  1364         *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( ( unichar >> 12 ) & 0x3f ) );
  1366         *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( ( unichar >> 6 ) & 0x3f ) );
  1368         *tmp = (
unsigned char) ( 0x80 | (
unsigned char) ( unichar & 0x3f ) );
  1385     if ( !plsc->stream_closed )
  1387         ( *plsc->dispatch_table->pl_line )( (
struct PLStream_struct *) plsc,
  1388             x[0], y[0], x[1], y[1] );
  1397     if ( !plsc->stream_closed )
  1399         ( *plsc->dispatch_table->pl_polyline )( (
struct PLStream_struct *) plsc,
  1409     plsc->dev_npts = npts;
  1414     if ( !plsc->stream_closed )
  1416         ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
  1426     plsc->dev_npts = npts;
  1431     if ( !plsc->stream_closed )
  1433         ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
  1469         for ( i = 0; i < npts; i++ )
  1471             xsc[i] = (
PLINT) ( plsc->dimxax * xsc[i] + plsc->dimxb );
  1472             ysc[i] = (
PLINT) ( plsc->dimyay * ysc[i] + plsc->dimyb );
  1480         for ( i = 0; i < npts; i++ )
  1482             x      = (
PLINT) ( plsc->dioxax * xsc[i] + plsc->dioxay * ysc[i] + plsc->dioxb );
  1483             y      = (
PLINT) ( plsc->dioyax * xsc[i] + plsc->dioyay * ysc[i] + plsc->dioyb );
  1493         for ( i = 0; i < npts; i++ )
  1495             xsc[i] = (
PLINT) ( plsc->dipxax * xsc[i] + plsc->dipxb );
  1496             ysc[i] = (
PLINT) ( plsc->dipyay * ysc[i] + plsc->dipyb );
  1505         for ( i = 0; i < npts; i++ )
  1507             xsc[i] = (
PLINT) ( plsc->didxax * xsc[i] + plsc->didxb );
  1508             ysc[i] = (
PLINT) ( plsc->didyay * ysc[i] + plsc->didyb );
  1510         *clpxmi = plsc->diclpxmi;
  1511         *clpxma = plsc->diclpxma;
  1512         *clpymi = plsc->diclpymi;
  1513         *clpyma = plsc->diclpyma;
  1517         *clpxmi = plsc->phyxmi;
  1518         *clpxma = plsc->phyxma;
  1519         *clpymi = plsc->phyymi;
  1520         *clpyma = plsc->phyyma;
  1605     PLINT x1c, x2c, y1c, y2c;
  1619     difilt( x_coords, y_coords, 4, &x1c, &x2c, &y1c, &y2c );
  1633     plsc->dipxmin = 0.0;
  1634     plsc->dipxmax = 1.0;
  1635     plsc->dipymin = 0.0;
  1636     plsc->dipymax = 1.0;
  1657     if ( plsc->level >= 1 )
  1659         if ( plsc->plbuf_write )
  1693     PLFLT pxmin, pymin, pxmax, pymax;
  1694     PLFLT sxmin, symin, sxmax, symax;
  1695     PLFLT rxmin, rymin, rxmax, rymax;
  1699         pldebug( 
"pldid2pc",
  1700             "Relative device coordinates (in): %f, %f, %f, %f\n",
  1701             *xmin, *ymin, *xmax, *ymax );
  1708         sxmin = ( pxmin - plsc->didxb ) / plsc->didxax;
  1709         symin = ( pymin - plsc->didyb ) / plsc->didyay;
  1710         sxmax = ( pxmax - plsc->didxb ) / plsc->didxax;
  1711         symax = ( pymax - plsc->didyb ) / plsc->didyay;
  1718         *xmin = ( rxmin < 0 ) ? 0 : rxmin;
  1719         *xmax = ( rxmax > 1 ) ? 1 : rxmax;
  1720         *ymin = ( rymin < 0 ) ? 0 : rymin;
  1721         *ymax = ( rymax > 1 ) ? 1 : rymax;
  1723         pldebug( 
"pldid2pc",
  1724             "Relative plot coordinates (out): %f, %f, %f, %f\n",
  1725             rxmin, rymin, rxmax, rymax );
  1739     PLFLT pxmin, pymin, pxmax, pymax;
  1740     PLFLT sxmin, symin, sxmax, symax;
  1741     PLFLT rxmin, rymin, rxmax, rymax;
  1745         pldebug( 
"pldip2pc",
  1746             "Relative plot coordinates (in): %f, %f, %f, %f\n",
  1747             *xmin, *ymin, *xmax, *ymax );
  1754         sxmin = pxmin * plsc->didxax + plsc->didxb;
  1755         symin = pymin * plsc->didyay + plsc->didyb;
  1756         sxmax = pxmax * plsc->didxax + plsc->didxb;
  1757         symax = pymax * plsc->didyay + plsc->didyb;
  1764         *xmin = ( rxmin < 0 ) ? 0 : rxmin;
  1765         *xmax = ( rxmax > 1 ) ? 1 : rxmax;
  1766         *ymin = ( rymin < 0 ) ? 0 : rymin;
  1767         *ymax = ( rymax > 1 ) ? 1 : rymax;
  1769         pldebug( 
"pldip2pc",
  1770             "Relative device coordinates (out): %f, %f, %f, %f\n",
  1771             rxmin, rymin, rxmax, rymax );
  1784     plsc->dipxmin = ( xmin < xmax ) ? xmin : xmax;
  1785     plsc->dipxmax = ( xmin < xmax ) ? xmax : xmin;
  1786     plsc->dipymin = ( ymin < ymax ) ? ymin : ymax;
  1787     plsc->dipymax = ( ymin < ymax ) ? ymax : ymin;
  1789     if ( xmin == 0. && xmax == 1. && ymin == 0. && ymax == 1. )
  1810         xmin = plsc->dipxmin + ( plsc->dipxmax - plsc->dipxmin ) * xmin;
  1811         ymin = plsc->dipymin + ( plsc->dipymax - plsc->dipymin ) * ymin;
  1812         xmax = plsc->dipxmin + ( plsc->dipxmax - plsc->dipxmin ) * xmax;
  1813         ymax = plsc->dipymin + ( plsc->dipymax - plsc->dipymin ) * ymax;
  1816     plsdiplt( xmin, ymin, xmax, ymax );
  1833     PLINT pxmin, pxmax, pymin, pymax, pxlen, pylen;
  1838         if ( !plsc->stream_closed )
  1840             ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
  1846     if ( !( plsc->difilt & 
PLDI_PLT ) )
  1854     pxlen = pxmax - pxmin;
  1855     pylen = pymax - pymin;
  1856     pxlen = 
MAX( 1, pxlen );
  1857     pylen = 
MAX( 1, pylen );
  1859     plsc->dipxax = plsc->phyxlen / (double) pxlen;
  1860     plsc->dipyay = plsc->phyylen / (double) pylen;
  1861     plsc->dipxb  = plsc->phyxmi - plsc->dipxax * pxmin;
  1862     plsc->dipyb  = plsc->phyymi - plsc->dipyay * pymin;
  1874     *p_xmin = plsc->dipxmin;
  1875     *p_xmax = plsc->dipxmax;
  1876     *p_ymin = plsc->dipymin;
  1877     *p_ymax = plsc->dipymax;
  1899     if ( mar == 0. && aspect == 0. && jx == 0. && jy == 0. &&
  1920     PLFLT lx, ly, aspect, aspdev;
  1921     PLFLT xmin, xmax, xlen, ymin, ymax, ylen;
  1922     PLINT pxmin, pxmax, pymin, pymax, pxlen, pylen;
  1927         if ( !plsc->stream_closed )
  1929             ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
  1935     if ( !( plsc->difilt & 
PLDI_DEV ) )
  1940     lx     = plsc->phyxlen / plsc->xpmm;
  1941     ly     = plsc->phyylen / plsc->ypmm;
  1945         aspect = plsc->aspori;
  1947         aspect = plsc->aspect;
  1950         aspect = plsc->aspdev;
  1954     plsc->mar = ( plsc->mar > 0.5 ) ? 0.5 : plsc->mar;
  1955     plsc->mar = ( plsc->mar < 0.0 ) ? 0.0 : plsc->mar;
  1956     plsc->jx  = ( plsc->jx > 0.5 ) ?  0.5 : plsc->jx;
  1957     plsc->jx  = ( plsc->jx < -0.5 ) ? -0.5 : plsc->jx;
  1958     plsc->jy  = ( plsc->jy > 0.5 ) ?  0.5 : plsc->jy;
  1959     plsc->jy  = ( plsc->jy < -0.5 ) ? -0.5 : plsc->jy;
  1963     xlen = ( aspect < aspdev ) ? ( aspect / aspdev ) : 1.0;
  1964     ylen = ( aspect < aspdev ) ? 1.0 : ( aspdev / aspect );
  1966     xlen *= ( 1.0 - 2. * plsc->mar );
  1967     ylen *= ( 1.0 - 2. * plsc->mar );
  1969     xmin = ( 1. - xlen ) * ( 0.5 + plsc->jx );
  1972     ymin = ( 1. - ylen ) * ( 0.5 + plsc->jy );
  1982     pxlen = pxmax - pxmin;
  1983     pylen = pymax - pymin;
  1984     pxlen = 
MAX( 1, pxlen );
  1985     pylen = 
MAX( 1, pylen );
  1987     plsc->didxax = pxlen / (double) plsc->phyxlen;
  1988     plsc->didyay = pylen / (
double) plsc->phyylen;
  1989     plsc->didxb  = pxmin - plsc->didxax * plsc->phyxmi;
  1990     plsc->didyb  = pymin - plsc->didyay * plsc->phyymi;
  1994     plsc->diclpxmi = (
PLINT) ( plsc->didxax * plsc->phyxmi + plsc->didxb );
  1995     plsc->diclpxma = (
PLINT) ( plsc->didxax * plsc->phyxma + plsc->didxb );
  1996     plsc->diclpymi = (
PLINT) ( plsc->didyay * plsc->phyymi + plsc->didyb );
  1997     plsc->diclpyma = (
PLINT) ( plsc->didyay * plsc->phyyma + plsc->didyb );
  2010     *p_aspect = plsc->aspect;
  2047     PLFLT x0, y0, lx, ly, aspect;
  2053         if ( !plsc->stream_closed )
  2055             ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
  2061     if ( !( plsc->difilt & 
PLDI_ORI ) )
  2066     x0 = ( plsc->phyxma + plsc->phyxmi ) / 2.;
  2067     y0 = ( plsc->phyyma + plsc->phyymi ) / 2.;
  2071     cost = 
ABS( cos( plsc->diorot * 
PI / 2. ) );
  2072     sint = 
ABS( sin( plsc->diorot * 
PI / 2. ) );
  2076     aspect = plsc->aspect;
  2078         aspect = plsc->aspdev;
  2080     if ( plsc->freeaspect )
  2081         plsc->aspori = aspect;
  2083         plsc->aspori = ( aspect * cost + sint ) / ( aspect * sint + cost );
  2085     if ( !( plsc->difilt & 
PLDI_DEV ) )
  2130     plsc->dioxax = affine_result[0];
  2131     plsc->dioxay = affine_result[2];
  2132     plsc->dioxb  = affine_result[4];
  2133     plsc->dioyax = affine_result[1];
  2134     plsc->dioyay = affine_result[3];
  2135     plsc->dioyb  = affine_result[5];
  2147     *p_rot = plsc->diorot;
  2163     plsetvar( plsc->dimxmin, dimxmin );
  2164     plsetvar( plsc->dimxmax, dimxmax );
  2165     plsetvar( plsc->dimymin, dimymin );
  2166     plsetvar( plsc->dimymax, dimymax );
  2167     plsetvar( plsc->dimxpmm, dimxpmm );
  2168     plsetvar( plsc->dimypmm, dimypmm );
  2187     PLINT pxmin, pxmax, pymin, pymax;
  2188     PLFLT dimxlen, dimylen, pxlen, pylen;
  2190     if ( ( plsc->dimxmin == plsc->phyxmi ) && ( plsc->dimxmax == plsc->phyxma ) &&
  2191          ( plsc->dimymin == plsc->phyymi ) && ( plsc->dimymax == plsc->phyyma ) &&
  2192          ( plsc->dimxpmm == plsc->xpmm ) && ( plsc->dimypmm == plsc->ypmm ) )
  2200     lx = ( plsc->dimxmax - plsc->dimxmin + 1 ) / plsc->dimxpmm;
  2201     ly = ( plsc->dimymax - plsc->dimymin + 1 ) / plsc->dimypmm;
  2203     plsc->aspdev = lx / ly;
  2207     dimxlen = plsc->dimxmax - plsc->dimxmin;
  2208     dimylen = plsc->dimymax - plsc->dimymin;
  2210     pxmin = plsc->phyxmi;
  2211     pxmax = plsc->phyxma;
  2212     pymin = plsc->phyymi;
  2213     pymax = plsc->phyyma;
  2214     pxlen = pxmax - pxmin;
  2215     pylen = pymax - pymin;
  2217     plsc->dimxax = pxlen / dimxlen;
  2218     plsc->dimyay = pylen / dimylen;
  2219     plsc->dimxb  = pxmin - pxlen * plsc->dimxmin / dimxlen;
  2220     plsc->dimyb  = pymin - pylen * plsc->dimymin / dimylen;
  2232     if ( plsc->dev_flush )
  2235         if ( !plsc->stream_closed )
  2237             ( *plsc->dispatch_table->pl_esc )( (
struct PLStream_struct *) plsc,
  2244         if ( plsc->OutFile != NULL )
  2245             fflush( plsc->OutFile );
  2268 #ifdef ENABLE_DYNDRIVERS  2290     if ( plsc->level != 0 )
  2309     if ( plsc->level != 0 )
  2327     PLFLT lx, ly, xpmm_loc, ypmm_loc, aspect_old, aspect_new;
  2331     if ( plsc->level != 0 )
  2347     if ( plsc->plwindow == NULL )
  2349         if ( plsc->program )
  2351             if ( ( plsc->plwindow = (
char *) malloc( (
size_t) ( 1 + strlen( plsc->program ) ) * sizeof ( 
char ) ) ) == NULL )
  2353                 plexit( 
"plinit: Insufficient memory" );
  2355             strcpy( plsc->plwindow, plsc->program );
  2359             if ( ( plsc->plwindow = (
char *) malloc( (
size_t) 7 * 
sizeof ( 
char ) ) ) == NULL )
  2361                 plexit( 
"plinit: Insufficient memory" );
  2363             strcpy( plsc->plwindow, 
"PLplot" );
  2390     if ( plsc->aspect > 0. )
  2392         lx               = plsc->phyxlen / plsc->xpmm;
  2393         ly               = plsc->phyylen / plsc->ypmm;
  2394         aspect_old       = lx / ly;
  2395         aspect_new       = plsc->aspect;
  2396         plsc->caspfactor = sqrt( aspect_old / aspect_new );
  2400     else if ( plsc->freeaspect && 
ABS( cos( plsc->diorot * 
PI / 2. ) ) <= 1.e-5 )
  2402         lx               = plsc->phyxlen / plsc->xpmm;
  2403         ly               = plsc->phyylen / plsc->ypmm;
  2404         aspect_old       = lx / ly;
  2405         aspect_new       = ly / lx;
  2406         plsc->caspfactor = sqrt( aspect_old / aspect_new );
  2410         plsc->caspfactor = 1.;
  2424     if ( plsc->xdigmax == 0 )
  2427     if ( plsc->ydigmax == 0 )
  2430     if ( plsc->zdigmax == 0 )
  2433     if ( plsc->timefmt == NULL )
  2439     if ( plsc->qsasconfig == NULL )
  2440         c_plconfigtime( 0., 0., 0., 0x0, 0, 0, 0, 0, 0, 0, 0. );
  2455     plP_sclp( plsc->phyxmi, plsc->phyxma, plsc->phyymi, plsc->phyyma );
  2459     lx           = plsc->phyxlen / plsc->xpmm;
  2460     ly           = plsc->phyylen / plsc->ypmm;
  2461     plsc->aspdev = lx / ly;
  2474     plP_setpxl( xpmm_loc * plsc->caspfactor, ypmm_loc / plsc->caspfactor );
  2493         if ( 
pls[i] != NULL )
  2500 #ifdef ENABLE_DYNDRIVERS  2506         free_mem( loadable_device_list[i].devnam );
  2507         free_mem( loadable_device_list[i].description );
  2508         free_mem( loadable_device_list[i].drvnam );
  2509         free_mem( loadable_device_list[i].tag );
  2512     for ( i = 0; i < nloadabledrivers; i++ )
  2514         free_mem( loadable_driver_list[i].drvnam );
  2544     if ( plsc->level > 0 )
  2552     if ( plsc->FileName )
  2565     if ( plsc->program )
  2567     if ( plsc->server_name )
  2569     if ( plsc->server_host )
  2571     if ( plsc->server_port )
  2575     if ( plsc->plserver )
  2577     if ( plsc->auto_path )
  2580     if ( plsc->arrow_x )
  2582     if ( plsc->arrow_y )
  2585     if ( plsc->timefmt )
  2594     if ( plsc->mf_infile )
  2596     if ( plsc->mf_outfile )
  2626             "plsstrm: Illegal stream number %d, must be in [0, %d]\n",
  2636                 plexit( 
"plsstrm: Out of memory." );
  2677         if ( 
pls[i] == NULL )
  2681     if ( i == PL_NSTREAMS )
  2683         fprintf( stderr, 
"plmkstrm: Cannot create new stream\n" );
  2713     if ( !plsc->initialized )
  2715         plsc->initialized = 1;
  2717         if ( plsc->cmap0 == NULL )
  2720         if ( plsc->cmap1 == NULL )
  2724         plsc->cmap1_min = 0.0;
  2725         plsc->cmap1_max = 1.0;
  2769         fprintf( stderr, 
"plcpstrm: stream %d not in use\n", (
int) iplsr );
  2775     plsc->debug = plsr->
debug;
  2783     if ( ( plsc->plbuf_buffer = malloc( plsc->plbuf_buffer_size ) ) == NULL )
  2784         plexit( 
"plcpstrm: Error allocating plot buffer." );
  2801     if ( !( flags & 0x01 ) )
  2803         pldebug( 
"plcpstrm", 
"mapping parameters: %d %d %d %d %f %f\n",
  2816     plsc->icol0 = plsr->
icol0;
  2817     plsc->ncol0 = plsr->
ncol0;
  2818     if ( plsc->cmap0 != NULL )
  2819         free( (
void *) plsc->cmap0 );
  2821     if ( ( plsc->cmap0 = (
PLColor *) calloc( 1, (
size_t) plsc->ncol0 * sizeof ( 
PLColor ) ) ) == NULL )
  2823         plexit( 
"c_plcpstrm: Insufficient memory" );
  2826     for ( i = 0; i < plsc->ncol0; i++ )
  2831     plsc->icol1     = plsr->
icol1;
  2832     plsc->ncol1     = plsr->
ncol1;
  2835     if ( plsc->cmap1 != NULL )
  2836         free( (
void *) plsc->cmap1 );
  2838     if ( ( plsc->cmap1 = (
PLColor *) calloc( 1, (
size_t) plsc->ncol1 * sizeof ( 
PLColor ) ) ) == NULL )
  2840         plexit( 
"c_plcpstrm: Insufficient memory" );
  2843     for ( i = 0; i < plsc->ncol1; i++ )
  2848     if ( plsc->level == 0 )
  2876     if ( plsc->dev_initialized )
  2878     plsc->dev_initialized = 1;
  2890     static int inited      = 0;
  2891     static int inBuildTree = 0;
  2895         int  len_currdir, len_builddir;
  2902             pldebug( 
"plInBuildTree():", 
"Not enough buffer space" );
  2906             pldebug( 
"plInBuildTree(): ", 
"current directory >%s<\n", currdir );
  2907             pldebug( 
"plInBuildTree(): ", 
"build directory >%s<\n", 
BUILD_DIR );
  2915                     pldebug( 
"plInBuildTree():", 
"Not enough buffer space" );
  2919                     len_currdir  = strlen( currdir );
  2920                     len_builddir = strlen( builddir );
  2921 #if defined ( IGNORECASE )  2922                     pldebug( 
"plInBuildTree(): ", 
"comparing ignoring case\n" );
  2925                     for (; *pcurrdir; ++pcurrdir )
  2927                         *pcurrdir = tolower( *pcurrdir );
  2928                         if ( *pcurrdir == 
'\\' )
  2933                     for (; *pbuilddir; ++pbuilddir )
  2935                         *pbuilddir = tolower( *pbuilddir );
  2936                         if ( *pbuilddir == 
'\\' )
  2949                     if ( strncmp( builddir, currdir, len_builddir ) == 0 &&
  2950                          ( len_currdir == len_builddir || currdir[len_builddir] == 
'\\' || currdir[len_builddir] == 
'/' ) )
  2952                     pldebug( 
"plInBuildTree(): ", 
"comparing respecting case\n" );
  2953                     if ( strncmp( builddir, currdir, len_builddir ) == 0 &&
  2954                          ( len_currdir == len_builddir || currdir[len_builddir] == 
'/' ) )
  2960                 if ( chdir( currdir ) != 0 )
  2961                     pldebug( 
"plInBuildTree():", 
"Unable to chdir to current directory" );
  2969 #ifdef ENABLE_DYNDRIVERS  2983         pldebug( 
"plGetDrvDir", 
"Using %s as the driver directory.\n", drvdir );
  2987         pldebug( 
"plGetDrvDir", 
"Trying to read env var PLPLOT_DRV_DIR\n" );
  2988         drvdir = getenv( 
"PLPLOT_DRV_DIR" );
  2990         if ( drvdir == NULL )
  2992             pldebug( 
"plGetDrvDir",
  2993                 "Will use drivers dir: " DRV_DIR "\n" );
  3026 #ifdef ENABLE_DYNDRIVERS  3029     char          *devnam, *devdesc, *devtype, *driver, *tag, *seqstr;
  3031     int           i, j, driver_found, done = 0;
  3032     FILE          *fp_drvdb   = NULL;
  3033     DIR           * dp_drvdir = NULL;
  3039     nloadabledrivers  = 0;
  3044     if ( fp_drvdb == NULL )
  3046         plabort( 
"plInitDispatchTable: Could not open temporary file" );
  3051     drvdir    = plGetDrvDir();
  3052     dp_drvdir = 
opendir( drvdir );
  3053     if ( dp_drvdir == NULL )
  3056         plabort( 
"plInitDispatchTable: Could not open drivers directory" );
  3062     pldebug( 
"plInitDispatchTable", 
"Scanning dyndrivers dir\n" );
  3063     while ( ( entry = 
readdir( dp_drvdir ) ) != NULL )
  3067         size_t len = strlen( name ) - 12;
  3069         pldebug( 
"plInitDispatchTable",
  3070             "Consider file %s\n", name );
  3073         if ( ( len > 0 ) && ( strcmp( name + len, 
".driver_info" ) == 0 ) )
  3080             fd = fopen( path, 
"r" );
  3086                     "plInitDispatchTable: Could not open driver info file %s\n",
  3096             pldebug( 
"plInitDispatchTable",
  3097                 "Opened driver info file %s\n", name );
  3100                 fprintf( fp_drvdb, 
"%s", buf );
  3101                 if ( buf [strlen( buf ) - 1] != 
'\n' )
  3102                     fprintf( fp_drvdb, 
"\n" );
  3120 #ifdef ENABLE_DYNDRIVERS  3123         plexit( 
"plInitDispatchTable: Insufficient memory" );
  3135 #ifdef ENABLE_DYNDRIVERS  3138             plexit( 
"plInitDispatchTable: Insufficient memory" );
  3150 #ifdef ENABLE_DYNDRIVERS  3155     if ( ( ( loadable_device_list = malloc( (
size_t) 
npldynamicdevices * 
sizeof ( PLLoadableDevice ) ) ) == NULL ) ||
  3156          ( ( loadable_driver_list = malloc( (
size_t) 
npldynamicdevices * 
sizeof ( PLLoadableDriver ) ) ) == NULL ) )
  3159         plexit( 
"plInitDispatchTable: Insufficient memory" );
  3176         devnam  = strtok( buf, 
":" );
  3177         devdesc = strtok( 0, 
":" );
  3178         devtype = strtok( 0, 
":" );
  3179         driver  = strtok( 0, 
":" );
  3180         seqstr  = strtok( 0, 
":" );
  3181         tag     = strtok( 0, 
"\n" );
  3183         if ( devnam == NULL || devdesc == NULL || devtype == NULL || driver == NULL ||
  3184              seqstr == NULL || tag == NULL )
  3189         seq = atoi( seqstr );
  3196             plexit( 
"plInitDispatchTable: Insufficient memory" );
  3211         loadable_device_list[i].devnam      = 
plstrdup( devnam );
  3212         loadable_device_list[i].description = 
plstrdup( devdesc );
  3213         loadable_device_list[i].drvnam      = 
plstrdup( driver );
  3214         loadable_device_list[i].tag         = 
plstrdup( tag );
  3219         for ( j = 0; j < nloadabledrivers; j++ )
  3220             if ( strcmp( driver, loadable_driver_list[j].drvnam ) == 0 )
  3226         if ( !driver_found )
  3228             loadable_driver_list[nloadabledrivers].drvnam = 
plstrdup( driver );
  3229             loadable_driver_list[nloadabledrivers].dlhand = 0;
  3233         loadable_device_list[i].drvidx = j;
  3247         plexit( 
"No device drivers found - please check the environment variable PLPLOT_DRV_DIR" );
  3278     if ( plsc->DevName[0] == 
'\0' )
  3280         devname_env = getenv( 
"PLPLOT_DEV" );
  3283             strncpy( plsc->DevName, devname_env, sizeof ( plsc->DevName ) - 1 );
  3284             plsc->DevName[
sizeof ( plsc->DevName ) - 1] = 
'\0';
  3290     if ( *( plsc->DevName ) != 
'\0' && *( plsc->DevName ) != 
'?' )
  3292         length = strlen( plsc->DevName );
  3296                  ( strncmp( plsc->DevName,
  3300         if ( i < npldrivers )
  3302             plsc->device = i + 1;
  3307             fprintf( stderr, 
"Requested device %s not available\n",
  3322         fprintf( stdout, 
"\nPlotting Options:\n" );
  3325             fprintf( stdout, 
" <%2d> %-10s %s\n", i + 1,
  3330             fprintf( stdout, 
"\nEnter device number or keyword: " );
  3332             fprintf( stdout, 
"\nEnter device number or keyword (stream %d): ",
  3335         plio_fgets( response, 
sizeof ( response ), stdin );
  3340         length = strlen( response );
  3341         if ( *( response - 1 + length ) == 
'\n' )
  3347                      (
unsigned int) length ) )
  3350         if ( i < npldrivers )
  3356             if ( ( dev = atoi( response ) ) < 1 )
  3358                 fprintf( stdout, 
"\nInvalid device: %s", response );
  3363             plexit( 
"plSelectDev: Too many tries." );
  3380 #ifdef ENABLE_DYNDRIVERS  3385     int  n = plsc->device - 1;
  3387     PLLoadableDriver *driver = 0;
  3395     pldebug( 
"plLoadDriver", 
"Device not loaded!\n" );
  3400         if ( strcmp( dev->
pl_DevName, loadable_device_list[i].devnam ) == 0 )
  3406     if ( i == npldynamicdevices )
  3408         fprintf( stderr, 
"No such device: %s.\n", dev->
pl_DevName );
  3409         plexit( 
"plLoadDriver detected device logic screwup" );
  3415     tag    = loadable_device_list[i].tag;
  3416     drvidx = loadable_device_list[i].drvidx;
  3418     pldebug( 
"plLoadDriver", 
"tag=%s, drvidx=%d\n", tag, drvidx );
  3420     driver = &loadable_driver_list[drvidx];
  3423     if ( !driver->dlhand )
  3426 #if defined ( LTDL_WIN32 ) || defined ( __CYGWIN__ )  3430 #endif  // LTDL_WIN32  3432         pldebug( 
"plLoadDriver", 
"Trying to load %s on %s\n",
  3433             driver->drvnam, drvspec );
  3444         if ( !( strcmp( driver->drvnam, 
"mem" ) == 0 ||
  3445                 strcmp( driver->drvnam, 
"null" ) == 0 ||
  3446                 strcmp( driver->drvnam, 
"plmeta" ) == 0 ||
  3447                 strcmp( driver->drvnam, 
"ps" ) == 0 ||
  3448                 strcmp( driver->drvnam, 
"svg" ) == 0 ||
  3449                 strcmp( driver->drvnam, 
"xfig" ) == 0 ) )
  3454     if ( !driver->dlhand )
  3456         pldebug( 
"plLoadDriver", 
"lt_dlopenext failed because of "  3457             "the following reason:\n%s\n", 
lt_dlerror() );
  3458         fprintf( stderr, 
"Unable to load driver: %s.\n", driver->drvnam );
  3459         plexit( 
"Unable to load driver" );
  3468         if ( !dispatch_init )
  3471                 "Unable to locate dispatch table initialization function for driver: %s.\n",
  3476         ( *dispatch_init )( dev );
  3493     if ( plsc->level > 0 )
  3508     if ( plsc->plbuf_buffer != NULL )
  3514         plwarn( 
"plreplot: plot buffer not available" );
  3530 plgFileDevs( 
const char ***p_menustr, 
const char ***p_devname, 
int *p_ndev )
  3532     plgdevlst( *p_menustr, *p_devname, p_ndev, 0 );
  3542 plgDevs( 
const char ***p_menustr, 
const char ***p_devname, 
int *p_ndev )
  3544     plgdevlst( *p_menustr, *p_devname, p_ndev, -1 );
  3548 plgdevlst( 
const char **p_menustr, 
const char **p_devname, 
int *p_ndev, 
int type )
  3560             if ( ++j + 1 >= *p_ndev )
  3562                 plwarn( 
"plgdevlst:  too many devices" );
  3567     p_menustr[j] = NULL;
  3568     p_devname[j] = NULL;
  3584     *p_xleng = plsc->xlength;
  3585     *p_yleng = plsc->ylength;
  3586     *p_xoff  = plsc->xoffset;
  3587     *p_yoff  = plsc->yoffset;
  3595     if ( plsc->level > 0 )
  3596         plwarn( 
"calling plspage() after plinit() may give unpredictable results" );
  3604         plsc->xlength = xleng;
  3606         plsc->ylength = yleng;
  3609         plsc->xoffset = xoff;
  3611         plsc->yoffset = yoff;
  3626     if ( plsc->level > 0 )
  3633     if ( plsc->plbuf_write )
  3642     if ( plsc->level > 0 )
  3644         plwarn( 
"plsdev: Must be called before plinit." );
  3647     if ( devname != NULL )
  3649         strncpy( plsc->DevName, devname, sizeof ( plsc->DevName ) - 1 );
  3650         plsc->DevName[
sizeof ( plsc->DevName ) - 1] = 
'\0';
  3660     strcpy( p_dev, plsc->DevName );
  3675     plsc->dev           = plotmem;
  3676     plsc->dev_mem_alpha = 0;
  3685     plsc->dev           = plotmem;
  3686     plsc->dev_mem_alpha = 1;
  3709     *p_level = plsc->level;
  3718     plsc->KeyEH      = KeyEH;
  3719     plsc->KeyEH_data = KeyEH_data;
  3726              void *ButtonEH_data )
  3728     plsc->ButtonEH      = ButtonEH;
  3729     plsc->ButtonEH_data = ButtonEH_data;
  3735 plsbopH( 
void ( *handler )( 
void *, 
int * ), 
void *handler_data )
  3737     plsc->bop_handler = handler;
  3738     plsc->bop_data    = handler_data;
  3744 plseopH( 
void ( *handler )( 
void *, 
int * ), 
void *handler_data )
  3746     plsc->eop_handler = handler;
  3747     plsc->eop_data    = handler_data;
  3755     if ( errcode != NULL )
  3756         plsc->errcode = errcode;
  3758     if ( errmsg != NULL )
  3779     if ( width != plsc->width && width >= 0. )
  3781         plsc->width = width;
  3783         if ( plsc->level > 0 )
  3785             if ( !plsc->widthlock )
  3796     *p_file = plsc->OutFile;
  3804     plsc->OutFile = file;
  3815         plabort( 
"filename string must be preallocated to >=80 bytes" );
  3820     if ( plsc->FileName != NULL )
  3822         strncpy( fnam, plsc->FileName, 79 );
  3846     plsc->dev_data = 
data;
  3862     plsc->setpre = setp;
  3863     plsc->precis = prec;
  3871     *p_setp = plsc->setpre;
  3872     *p_prec = plsc->precis;
  3907         plwarn( 
"plsesc: Invalid escape character, ignoring." );
  3916     if ( plsc->esc == 
'\0' )
  3950     *pfci    = *pfci & mask;
  3952     *pfci    = *pfci | mask;
  3963     *phexdigit = (
unsigned char) ( ( fci & mask ) >>
  3980     plsc->window_id = window_id;
  3997     *p_fam  = plsc->family;
  3998     *p_num  = plsc->member;
  3999     *p_bmax = plsc->bytemax;
  4007     if ( plsc->level > 0 )
  4008         plwarn( 
"plsfam: Must be called before plinit." );
  4015         plsc->bytemax = bmax;
  4036     *p_digmax = plsc->xdigmax;
  4037     *p_digits = plsc->xdigits;
  4045     plsc->xdigmax = digmax;
  4046     plsc->xdigits = digits;
  4054     *p_digmax = plsc->ydigmax;
  4055     *p_digits = plsc->ydigits;
  4063     plsc->ydigmax = digmax;
  4064     plsc->ydigits = digits;
  4072     *p_digmax = plsc->zdigmax;
  4073     *p_digits = plsc->zdigits;
  4081     plsc->zdigmax = digmax;
  4082     plsc->zdigits = digits;
  4090     *p_def = plsc->chrdef;
  4091     *p_ht  = plsc->chrht;
  4099     *p_xmin = plsc->vpdxmi;
  4100     *p_xmax = plsc->vpdxma;
  4101     *p_ymin = plsc->vpdymi;
  4102     *p_ymax = plsc->vpdyma;
  4110     *p_xmin = plsc->vpwxmi;
  4111     *p_xmax = plsc->vpwxma;
  4112     *p_ymin = plsc->vpwymi;
  4113     *p_ymax = plsc->vpwyma;
  4122     dx = ( plsc->vpwxma - plsc->vpwxmi ) * 1.0e-5;
  4123     dy = ( plsc->vpwyma - plsc->vpwymi ) * 1.0e-5;
  4128     *p_xmin = plsc->vpwxmi - dx;
  4129     *p_xmax = plsc->vpwxma + dx;
  4130     *p_ymin = plsc->vpwymi - dy;
  4131     *p_ymax = plsc->vpwyma + dy;
  4143     *p_xmin = plsc->domxmi;
  4144     *p_xmax = plsc->domxma;
  4145     *p_ymin = plsc->domymi;
  4146     *p_ymax = plsc->domyma;
  4154     *p_zscl = plsc->zzscl;
  4155     *p_zmin = plsc->ranmi;
  4156     *p_zmax = plsc->ranma;
  4176     *p_ixmin = plsc->clpxmi;
  4177     *p_ixmax = plsc->clpxma;
  4178     *p_iymin = plsc->clpymi;
  4179     *p_iymax = plsc->clpyma;
  4187     plsc->clpxmi = ixmin;
  4188     plsc->clpxma = ixmax;
  4189     plsc->clpymi = iymin;
  4190     plsc->clpyma = iymax;
  4191     if ( plsc->plbuf_write )
  4200     *p_ixmin = plsc->phyxmi;
  4201     *p_ixmax = plsc->phyxma;
  4202     *p_iymin = plsc->phyymi;
  4203     *p_iymax = plsc->phyyma;
  4211     *p_nx = plsc->nsubx;
  4212     *p_ny = plsc->nsuby;
  4213     *p_cs = plsc->cursub;
  4242     plsc->umx  = (
PLINT) ( 1000.0 / plsc->xpmm );
  4243     plsc->umy  = (
PLINT) ( 1000.0 / plsc->ypmm );
  4251     if ( xmin > xmax || ymin > ymax )
  4252         plexit( 
"plP_setphy: device minima must not exceed maxima" );
  4254     plsc->phyxmi  = xmin;
  4255     plsc->phyxma  = xmax;
  4256     plsc->phyymi  = ymin;
  4257     plsc->phyyma  = ymax;
  4258     plsc->phyxlen = xmax - xmin;
  4259     plsc->phyylen = ymax - ymin;
  4272     if ( plsc->level <= 0 )
  4274         plsc->dev_compression = compression;
  4287     *compression = plsc->dev_compression;
  4308         if ( 
pls[i] != NULL )
  4311                 strcpy( names, 
pls[i]->DevName );
  4314                 strcat( names, 
" " );
  4315                 strcat( names, 
pls[i]->DevName );
  4338     buff = (
char *) malloc( (
size_t) 
PL_NSTREAMS * 8 ); 
  4346         for ( tok = strtok( buff, 
" ," );       
  4347               tok; tok = strtok( 0, 
" ," ) )    
  4349             if ( strstr( names, tok ) != NULL ) 
  4380     plimageslow( z, nx, ny, xmin, ymin, dx, dy, pltr, pltr_data );
  4391 #if 0   // BEGIN dev_fastimg COMMENT  4398     if ( plsc->dev_fastimg == 0 )
  4401             xmin, ymin, dx, dy, zmin, zmax );
  4405     if ( plsc->plbuf_write )
  4417         plsc->dev_nptsX = nx;
  4418         plsc->dev_nptsY = ny;
  4419         plsc->dev_zmin  = zmin;
  4420         plsc->dev_zmax  = zmax;
  4426     plbuf_write       = plsc->plbuf_write;
  4427     plsc->plbuf_write = 0;
  4432         PLINT clpxmi, clpxma, clpymi, clpyma;
  4434         if ( ( ( xscl = (
short *) malloc( nx * ny * 
sizeof ( 
short ) ) ) == NULL ) ||
  4435              ( ( yscl = (
short *) malloc( nx * ny * 
sizeof ( 
short ) ) ) == NULL ) )
  4437             plexit( 
"plP_image: Insufficient memory" );
  4440         for ( i = 0; i < npts; i++ )
  4445         sdifilt( xscl, yscl, npts, &clpxmi, &clpxma, &clpymi, &clpyma );
  4446         plsc->imclxmin = clpxmi;
  4447         plsc->imclymin = clpymi;
  4448         plsc->imclxmax = clpxma;
  4449         plsc->imclymax = clpyma;
  4450         grimage( xscl, yscl, z, nx, ny );
  4456         plsc->imclxmin = plsc->phyxmi;
  4457         plsc->imclymin = plsc->phyymi;
  4458         plsc->imclxmax = plsc->phyxma;
  4459         plsc->imclymax = plsc->phyyma;
  4463 #endif  // END dev_fastimg COMMENT  4475     plsc->coordinate_transform      = coordinate_transform;
  4476     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 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)
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)
int number_of_entries_in_hershey_to_unicode_table
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)