Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __PDF_H__
00018 #define __PDF_H__
00019
00020
00021
00022
00023 #include "pldll.h"
00024
00025
00026
00027 #ifndef U_CHAR
00028 #define U_CHAR unsigned char
00029 #endif
00030
00031 #ifndef U_SHORT
00032 #define U_SHORT unsigned short
00033 #endif
00034
00035 #ifndef U_INT
00036 #define U_INT unsigned int
00037 #endif
00038
00039 #ifndef U_LONG
00040 #define U_LONG unsigned long
00041 #endif
00042
00043 #ifdef PLPLOT_USE_TCL_CHANNELS
00044 #include <tcl.h>
00045 #endif
00046
00047
00048
00049
00050
00051 typedef struct
00052 {
00053 FILE *file;
00054 unsigned char *buffer;
00055 #ifdef PLPLOT_USE_TCL_CHANNELS
00056 Tcl_Channel tclChan;
00057 #endif
00058 long bp, bufmax;
00059 } PDFstrm;
00060
00061
00062
00063 typedef struct
00064 {
00065 int fd;
00066 FILE *file;
00067 const char *fileName;
00068 const char *fileHandle;
00069 int type;
00070 const char *typeName;
00071 } PLiodev;
00072
00073
00074
00075 #define PDF_ERROR 1 // Unknown error
00076 #define PDF_FNOPEN 2 // File not open
00077 #define PDF_FAOPEN 3 // File already open
00078 #define PDF_BADUN 4 // Bad unit number
00079 #define PDF_BADNBITS 5 // Invalid # of bits
00080 #define PDF_RDERR 6 // Read error
00081 #define PDF_WRERR 7 // Write error
00082 #define PDF_NOTPDF 8 // Not a valid PDF file
00083
00084
00085
00086
00087 void pdf_set PLARGS( ( char *option, int value ) );
00088 PLDLLIMPEXP PDFstrm *pdf_fopen PLARGS( ( const char *fileName, const char *mode ) );
00089 PLDLLIMPEXP PDFstrm *pdf_bopen PLARGS( ( U_CHAR * buffer, long bufmax ) );
00090 PLDLLIMPEXP PDFstrm *pdf_finit PLARGS( ( FILE * file ) );
00091 PDFstrm *plLibOpenPdfstrm PLARGS( (const char * fn) );
00092 PLDLLIMPEXP int pdf_close PLARGS( ( PDFstrm * pdfs ) );
00093
00094 int pdf_putc PLARGS( ( int c, PDFstrm * pdfs ) );
00095 PLDLLIMPEXP int pdf_getc PLARGS( ( PDFstrm * pdfs ) );
00096 PLDLLIMPEXP int pdf_ungetc PLARGS( ( int c, PDFstrm * pdfs ) );
00097 int pdf_rdx PLARGS( ( U_CHAR * x, long nitems, PDFstrm * pdfs ) );
00098
00099 PLDLLIMPEXP int pdf_rd_header PLARGS( ( PDFstrm * pdfs, char *header ) );
00100 PLDLLIMPEXP int pdf_wr_header PLARGS( ( PDFstrm * pdfs, char *header ) );
00101 int pdf_wr_string PLARGS( ( PDFstrm * pdfs, const char *string ) );
00102 int pdf_rd_string PLARGS( ( PDFstrm * pdfs, char *string, int nmax ) );
00103 PLDLLIMPEXP int pdf_wr_1byte PLARGS( ( PDFstrm * pdfs, U_CHAR s ) );
00104 PLDLLIMPEXP int pdf_rd_1byte PLARGS( ( PDFstrm * pdfs, U_CHAR * ps ) );
00105 PLDLLIMPEXP int pdf_wr_2bytes PLARGS( ( PDFstrm * pdfs, U_SHORT s ) );
00106 PLDLLIMPEXP int pdf_rd_2bytes PLARGS( ( PDFstrm * pdfs, U_SHORT * ps ) );
00107 PLDLLIMPEXP int pdf_wr_2nbytes PLARGS( ( PDFstrm * pdfs, U_SHORT * s, PLINT n ) );
00108 PLDLLIMPEXP int pdf_rd_2nbytes PLARGS( ( PDFstrm * pdfs, U_SHORT * s, PLINT n ) );
00109 PLDLLIMPEXP int pdf_wr_4bytes PLARGS( ( PDFstrm * pdfs, U_LONG s ) );
00110 PLDLLIMPEXP int pdf_rd_4bytes PLARGS( ( PDFstrm * pdfs, U_LONG * ps ) );
00111 PLDLLIMPEXP int pdf_wr_ieeef PLARGS( ( PDFstrm * pdfs, float f ) );
00112 PLDLLIMPEXP int pdf_rd_ieeef PLARGS( ( PDFstrm * pdfs, float *pf ) );
00113
00114 #endif // __PDF_H__