33 #define MAX_BUFFER 256 // Character buffer size for reading records
38 #define PLFLT2COORD( a ) ( (short) ceil( a ) )
146 *(uint8_t *) dest = x;
149 *(
unsigned char *) dest = x;
167 plwarn(
"Unhandled datatype conversion in set_plp_value." );
186 *(uint8_t *) dest = x;
189 *(
unsigned char *) dest = x;
207 plwarn(
"Unhandled datatype conversion in set_plp_value." );
226 *(uint8_t *) dest = x;
229 *(
unsigned char *) dest = x;
247 plwarn(
"Unhandled datatype conversion in set_plp_value." );
266 *(uint8_t *) dest = x;
269 *(
unsigned char *) dest = x;
287 plwarn(
"Unhandled datatype conversion in set_plp_value." );
336 plwarn(
"Unhandled datatype conversion in read_entry." );
387 version < num_format_entries
392 if ( version >= num_format_entries )
407 if ( dev->
buffer != NULL )
410 dev->
buffer = malloc( need_size );
411 if ( dev->
buffer == NULL )
413 plexit(
"plmetafie: Insufficient memory for temporary storage" );
438 header[entry].
name != NULL;
443 if ( strcmp( header[entry].
name, buffer ) != 0 )
451 dest + header[entry].
offset );
468 PLFLT x1, y1, x2, y2;
498 dev->
xold = (short) x[1];
499 dev->
yold = (short) y[1];
538 dev->
xold = (short) x[1];
539 dev->
yold = (short) y[1];
565 xd = (
short *) ( dev->
buffer );
566 yd = ( (
short *) ( dev->
buffer ) ) + npts;
570 for ( i = 0; i < npts; i++ )
581 dev->
xold = xd[npts - 1];
584 for ( i = 0; i < npts; i++ )
595 dev->
yold = yd[npts - 1];
634 xd = (
short *) ( dev->
buffer );
635 yd = ( (
short *) ( dev->
buffer ) ) + npts;
637 for ( i = 0; i < npts; i++ )
671 PLFLT x, y, refx, refy;
701 plwarn(
"plmetafile: Serious library error! text_type != U_LONG" );
757 plwarn(
"plmetafile: Alternate Unicode text handling is not implemented" );
786 pldebug(
"state: WIDTH" );
796 pldebug(
"state: COLOR0/COLOR1" );
850 pldebug(
"state: FILL" );
861 pldebug(
"state: CMAP0/CMAP1" );
877 sizeof (
PLINT ) * ncol * 3
878 +
sizeof (
PLFLT ) * ncol );
881 ptr = ( (
PLINT *) ptr ) + ncol;
883 ptr = ( (
PLINT *) ptr ) + ncol;
885 ptr = ( (
PLINT *) ptr ) + ncol;
886 alpha = (
PLFLT *) ptr;
889 for ( i = 0; i < ncol; i++ )
920 pldebug(
"state: CHR" );
936 pldebug(
"state: SYM" );
952 pldebug(
"state: INVALID STATE" );
982 pldebug(
"cmd: INITIALIZE" );
987 pldebug(
"cmd: CLOSE" );
992 pldebug(
"cmd: EOP" );
999 pldebug(
"cmd: BOP/BOP0" );
1005 (uint8_t *) dev + page_2005_header[0].
offset );
1010 page_2005_header[1].pdf_type,
1011 page_2005_header[1].plp_type,
1012 (uint8_t *) dev + page_2005_header[1].offset );
1017 page_2005_header[2].pdf_type,
1018 page_2005_header[2].plp_type,
1019 (uint8_t *) dev + page_2005_header[2].offset );
1028 pldebug(
"cmd: LINE" );
1034 pldebug(
"cmd: LINETO" );
1040 pldebug(
"cmd: ESCAPE" );
1046 pldebug(
"cmd: POLYLINE" );
1052 pldebug(
"cmd: CHANGE_STATE" );
1058 pldebug(
"cmd: EOF" );
1070 pldebug(
"cmd: OBSOLETE CMD" );
1076 pldebug(
"cmd: INVALID CMD" );
1123 if ( plsc->mf_infile == NULL && infile == NULL )
1125 plexit(
"No PLplot metafile set for input" );
1127 else if ( infile != NULL )
1133 plm =
pdf_fopen( plsc->mf_infile,
"rb" );
1137 plexit(
"Unable to open PLplot metafile for input" );
1148 plwarn(
"Failed to parse PLplot metafile, ignoring file." );
1159 plwarn(
"Corrupted index in metafile, ignoring file." );
1170 plwarn(
"Corrupted device information in metafile, ignoring file." );
1185 plwarn(
"Corrupted device information in metafile, ignoring file." );
1190 if ( plsc->level == 0 )
1203 plwarn(
"Corrupted plot information in metafile, ignoring file." );
1210 if ( mf_dev.
buffer != NULL )