33 #define MAX_BUFFER 256 // Character buffer size for reading records
35 #if defined ( _MSC_VER ) && _MSC_VER <= 1500
39 typedef unsigned char uint8_t;
45 #define PLFLT2COORD( a ) ( (short) ceil( a ) )
153 *(uint8_t *) dest = x;
156 *(
unsigned char *) dest = x;
174 plwarn(
"Unhandled datatype conversion in set_plp_value." );
193 *(uint8_t *) dest = x;
196 *(
unsigned char *) dest = x;
214 plwarn(
"Unhandled datatype conversion in set_plp_value." );
233 *(uint8_t *) dest = x;
236 *(
unsigned char *) dest = x;
254 plwarn(
"Unhandled datatype conversion in set_plp_value." );
273 *(uint8_t *) dest = x;
276 *(
unsigned char *) dest = x;
294 plwarn(
"Unhandled datatype conversion in set_plp_value." );
343 plwarn(
"Unhandled datatype conversion in read_entry." );
394 version < num_format_entries
399 if ( version >= num_format_entries )
414 if ( dev->
buffer != NULL )
417 dev->
buffer = malloc( need_size );
418 if ( dev->
buffer == NULL )
420 plexit(
"plmetafie: Insufficient memory for temporary storage" );
445 header[entry].
name != NULL;
450 if ( strcmp( header[entry].
name, buffer ) != 0 )
458 dest + header[entry].
offset );
475 PLFLT x1, y1, x2, y2;
505 dev->
xold = (short) x[1];
506 dev->
yold = (short) y[1];
545 dev->
xold = (short) x[1];
546 dev->
yold = (short) y[1];
572 xd = (
short *) ( dev->
buffer );
573 yd = ( (
short *) ( dev->
buffer ) ) + npts;
577 for ( i = 0; i < npts; i++ )
588 dev->
xold = xd[npts - 1];
591 for ( i = 0; i < npts; i++ )
602 dev->
yold = yd[npts - 1];
641 xd = (
short *) ( dev->
buffer );
642 yd = ( (
short *) ( dev->
buffer ) ) + npts;
644 for ( i = 0; i < npts; i++ )
677 PLFLT xmin, xmax, ymin, ymax;
678 PLFLT x, y, refx, refy;
708 plwarn(
"plmetafile: Serious library error! text_type != U_LONG" );
764 plwarn(
"plmetafile: Alternate Unicode text handling is not implemented" );
793 pldebug(
"state: WIDTH" );
803 pldebug(
"state: COLOR0/COLOR1" );
857 pldebug(
"state: FILL" );
868 pldebug(
"state: CMAP0/CMAP1" );
884 sizeof (
PLINT ) * ncol * 3
885 +
sizeof (
PLFLT ) * ncol );
888 ptr = ( (
PLINT *) ptr ) + ncol;
890 ptr = ( (
PLINT *) ptr ) + ncol;
892 ptr = ( (
PLINT *) ptr ) + ncol;
893 alpha = (
PLFLT *) ptr;
896 for ( i = 0; i < ncol; i++ )
927 pldebug(
"state: CHR" );
943 pldebug(
"state: SYM" );
959 pldebug(
"state: INVALID STATE" );
989 pldebug(
"cmd: INITIALIZE" );
994 pldebug(
"cmd: CLOSE" );
999 pldebug(
"cmd: EOP" );
1006 pldebug(
"cmd: BOP/BOP0" );
1012 (uint8_t *) dev + page_2005_header[0].
offset );
1017 page_2005_header[1].pdf_type,
1018 page_2005_header[1].plp_type,
1019 (uint8_t *) dev + page_2005_header[1].offset );
1024 page_2005_header[2].pdf_type,
1025 page_2005_header[2].plp_type,
1026 (uint8_t *) dev + page_2005_header[2].offset );
1035 pldebug(
"cmd: LINE" );
1041 pldebug(
"cmd: LINETO" );
1047 pldebug(
"cmd: ESCAPE" );
1053 pldebug(
"cmd: POLYLINE" );
1059 pldebug(
"cmd: CHANGE_STATE" );
1065 pldebug(
"cmd: EOF" );
1077 pldebug(
"cmd: OBSOLETE CMD" );
1083 pldebug(
"cmd: INVALID CMD" );
1130 if ( plsc->mf_infile == NULL && infile == NULL )
1132 plexit(
"No PLplot metafile set for input" );
1134 else if ( infile != NULL )
1140 plm =
pdf_fopen( plsc->mf_infile,
"rb" );
1144 plexit(
"Unable to open PLplot metafile for input" );
1155 plwarn(
"Failed to parse PLplot metafile, ignoring file." );
1166 plwarn(
"Corrupted index in metafile, ignoring file." );
1177 plwarn(
"Corrupted device information in metafile, ignoring file." );
1192 plwarn(
"Corrupted device information in metafile, ignoring file." );
1197 if ( plsc->level == 0 )
1210 plwarn(
"Corrupted plot information in metafile, ignoring file." );
1217 if ( mf_dev.
buffer != NULL )
void plexit(PLCHAR_VECTOR errormsg)
#define PLESC_CONTROL_CHAR
const struct _plm_format * device_header
PDFstrm * pdf_fopen(PLCHAR_VECTOR filename, PLCHAR_VECTOR mode)
const char * PLCHAR_VECTOR
void plP_text(PLINT base, PLFLT just, PLFLT *xform, PLINT x, PLINT y, PLINT refx, PLINT refy, PLCHAR_VECTOR string)
int pdf_rd_2bytes(PDFstrm *pdfs, U_SHORT *ps)
void plabort(PLCHAR_VECTOR errormsg)
void plP_polyline(short *x, short *y, PLINT npts)
enum EscText::@5 text_type
int pdf_rd_ieeef(PDFstrm *pdfs, float *pf)
void xform(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data)
static PLStream * pls[PL_NSTREAMS]
int pdf_rd_1byte(PDFstrm *pdfs, U_CHAR *ps)
void plhrsh(PLINT ch, PLINT x, PLINT y)
void plP_fill(short *x, short *y, PLINT npts)
int pdf_close(PDFstrm *pdfs)
int pdf_rd_string(PDFstrm *pdfs, char *string, int nmax)
const struct _plm_format * index_header
void plP_line(short *x, short *y)
int pdf_rd_header(PDFstrm *pdfs, char *header)
void plwarn(PLCHAR_VECTOR errormsg)
const struct _plm_format * plot_header
int pdf_rd_4bytes(PDFstrm *pdfs, U_LONG *ps)