PLplot
5.15.0
Toggle main menu visibility
Loading...
Searching...
No Matches
pdf.h
Go to the documentation of this file.
1
// Copyright (C) 1992 by Maurice J. LeBrun
2
//
3
// Macros and prototypes for the PDF package.
4
//
5
// This software may be freely copied, modified and redistributed without
6
// fee provided that this copyright notice is preserved intact on all
7
// copies and modified copies.
8
//
9
// There is no warranty or other guarantee of fitness of this software.
10
// It is provided solely "as is". The author(s) disclaim(s) all
11
// responsibility and liability with respect to this software's usage or
12
// its effect upon hardware or computer systems.
13
//
14
15
#ifndef __PDF_H__
16
#define __PDF_H__
17
18
//--------------------------------------------------------------------------
19
// dll functions
20
//--------------------------------------------------------------------------
21
#include "
pldll.h
"
22
23
// Some unsigned types
24
25
#ifndef U_CHAR
26
#define U_CHAR unsigned char
27
#endif
28
29
#ifndef U_SHORT
30
#define U_SHORT unsigned short
31
#endif
32
33
#ifndef U_INT
34
#define U_INT unsigned int
35
#endif
36
37
#ifndef U_LONG
38
#define U_LONG unsigned long
39
#endif
40
41
#ifdef PLPLOT_USE_TCL_CHANNELS
42
#include <tcl.h>
43
#endif
44
45
// PDFstrm definition
46
// The low level PDF i/o routines use the transfer method appropriate for
47
// the first non-null type below
48
49
typedef
struct
50
{
51
FILE *
file
;
// Filesystem
52
unsigned
char
*
buffer
;
// Memory buffer
53
#ifdef PLPLOT_USE_TCL_CHANNELS
54
Tcl_Channel tclChan;
// Tcl channel
55
#endif
56
size_t
bp
,
bufmax
;
// Buffer pointer and max size
57
}
PDFstrm
;
58
59
// Info for the i/o device. Only used by Tcl/TK/dp drivers for now
60
61
typedef
struct
62
{
63
int
fd
;
// I/O device file descriptor
64
FILE *
file
;
// File handle
65
const
char
*
fileName
;
// Fifo or socket name (if needed)
66
const
char
*
fileHandle
;
// Handle for use from interpreter
67
int
type
;
// Communication channel type
68
const
char
*
typeName
;
// As above, but in string form
69
}
PLiodev
;
70
71
// Error numbers
72
73
#define PDF_ERROR 1
// Unknown error
74
#define PDF_FNOPEN 2
// File not open
75
#define PDF_FAOPEN 3
// File already open
76
#define PDF_BADUN 4
// Bad unit number
77
#define PDF_BADNBITS 5
// Invalid # of bits
78
#define PDF_RDERR 6
// Read error
79
#define PDF_WRERR 7
// Write error
80
#define PDF_NOTPDF 8
// Not a valid PDF file
81
82
// Prototypes
83
// Use a wrapper for the prototypes for use from K&R C
84
85
void
pdf_set
(
char
*option,
int
value );
86
PLDLLIMPEXP
PDFstrm
*
pdf_fopen
(
const
char
*fileName,
const
char
*mode );
87
PLDLLIMPEXP
PDFstrm
*
pdf_bopen
(
U_CHAR
* buffer,
size_t
bufmax );
88
PLDLLIMPEXP
PDFstrm
*
pdf_finit
( FILE * file );
89
PDFstrm
*
plLibOpenPdfstrm
(
const
char
* fn );
90
PLDLLIMPEXP
int
pdf_close
(
PDFstrm
* pdfs );
91
92
int
pdf_putc
(
int
c,
PDFstrm
* pdfs );
93
PLDLLIMPEXP
int
pdf_getc
(
PDFstrm
* pdfs );
94
PLDLLIMPEXP
int
pdf_ungetc
(
int
c,
PDFstrm
* pdfs );
95
int
pdf_rdx
(
U_CHAR
* x,
long
nitems,
PDFstrm
* pdfs );
96
97
PLDLLIMPEXP
int
pdf_rd_header
(
PDFstrm
* pdfs,
char
*
header
);
98
PLDLLIMPEXP
int
pdf_wr_header
(
PDFstrm
* pdfs,
const
char
*
header
);
99
int
pdf_wr_string
(
PDFstrm
* pdfs,
const
char
*
string
);
100
int
pdf_rd_string
(
PDFstrm
* pdfs,
char
*
string
,
int
nmax );
101
PLDLLIMPEXP
int
pdf_wr_1byte
(
PDFstrm
* pdfs,
U_CHAR
s );
102
PLDLLIMPEXP
int
pdf_rd_1byte
(
PDFstrm
* pdfs,
U_CHAR
* ps );
103
PLDLLIMPEXP
int
pdf_wr_2bytes
(
PDFstrm
* pdfs,
U_SHORT
s );
104
PLDLLIMPEXP
int
pdf_rd_2bytes
(
PDFstrm
* pdfs,
U_SHORT
* ps );
105
PLDLLIMPEXP
int
pdf_wr_2nbytes
(
PDFstrm
* pdfs,
U_SHORT
* s,
PLINT
n );
106
PLDLLIMPEXP
int
pdf_rd_2nbytes
(
PDFstrm
* pdfs,
U_SHORT
* s,
PLINT
n );
107
PLDLLIMPEXP
int
pdf_wr_4bytes
(
PDFstrm
* pdfs,
U_LONG
s );
108
PLDLLIMPEXP
int
pdf_rd_4bytes
(
PDFstrm
* pdfs,
U_LONG
* ps );
109
PLDLLIMPEXP
int
pdf_wr_ieeef
(
PDFstrm
* pdfs,
float
f );
110
PLDLLIMPEXP
int
pdf_rd_ieeef
(
PDFstrm
* pdfs,
float
*pf );
111
112
#endif
// __PDF_H__
header
const char header[]
Definition
deltaT-gen.c:41
U_LONG
#define U_LONG
Definition
pdf.h:38
U_SHORT
#define U_SHORT
Definition
pdf.h:30
U_CHAR
#define U_CHAR
Definition
pdf.h:26
pdf_rd_4bytes
int pdf_rd_4bytes(PDFstrm *pdfs, U_LONG *ps)
Definition
pdfutils.c:832
pdf_rd_header
int pdf_rd_header(PDFstrm *pdfs, char *header)
Definition
pdfutils.c:542
pdf_wr_4bytes
int pdf_wr_4bytes(PDFstrm *pdfs, U_LONG s)
Definition
pdfutils.c:804
pdf_wr_ieeef
int pdf_wr_ieeef(PDFstrm *pdfs, float f)
Definition
pdfutils.c:916
pdf_ungetc
int pdf_ungetc(int c, PDFstrm *pdfs)
Definition
pdfutils.c:365
pdf_set
void pdf_set(char *option, int value)
Definition
pdfutils.c:56
pdf_fopen
PDFstrm * pdf_fopen(PLCHAR_VECTOR filename, PLCHAR_VECTOR mode)
Definition
pdfutils.c:74
pdf_wr_1byte
int pdf_wr_1byte(PDFstrm *pdfs, U_CHAR s)
Definition
pdfutils.c:636
pdf_wr_2bytes
int pdf_wr_2bytes(PDFstrm *pdfs, U_SHORT s)
Definition
pdfutils.c:684
pdf_rd_2nbytes
int pdf_rd_2nbytes(PDFstrm *pdfs, U_SHORT *s, PLINT n)
Definition
pdfutils.c:771
pdf_finit
PDFstrm * pdf_finit(FILE *file)
Definition
pdfutils.c:204
pdf_rd_2bytes
int pdf_rd_2bytes(PDFstrm *pdfs, U_SHORT *ps)
Definition
pdfutils.c:710
pdf_wr_header
int pdf_wr_header(PDFstrm *pdfs, PLCHAR_VECTOR header)
Definition
pdfutils.c:509
pdf_rd_1byte
int pdf_rd_1byte(PDFstrm *pdfs, U_CHAR *ps)
Definition
pdfutils.c:660
pdf_putc
int pdf_putc(int c, PDFstrm *pdfs)
Definition
pdfutils.c:276
pdf_wr_2nbytes
int pdf_wr_2nbytes(PDFstrm *pdfs, U_SHORT *s, PLINT n)
Definition
pdfutils.c:741
pdf_rdx
int pdf_rdx(U_CHAR *x, long nitems, PDFstrm *pdfs)
Definition
pdfutils.c:464
pdf_close
int pdf_close(PDFstrm *pdfs)
Definition
pdfutils.c:238
pdf_rd_ieeef
int pdf_rd_ieeef(PDFstrm *pdfs, float *pf)
Definition
pdfutils.c:992
pdf_getc
int pdf_getc(PDFstrm *pdfs)
Definition
pdfutils.c:325
pdf_rd_string
int pdf_rd_string(PDFstrm *pdfs, char *string, int nmax)
Definition
pdfutils.c:604
pdf_wr_string
int pdf_wr_string(PDFstrm *pdfs, PLCHAR_VECTOR string)
Definition
pdfutils.c:574
pdf_bopen
PDFstrm * pdf_bopen(U_CHAR *buffer, size_t bufmax)
Definition
pdfutils.c:152
plLibOpenPdfstrm
PDFstrm * plLibOpenPdfstrm(PLCHAR_VECTOR fn)
Definition
plctrl.c:2263
pldll.h
PLDLLIMPEXP
#define PLDLLIMPEXP
Definition
pldll.h:49
PLINT
int PLINT
Definition
plplot.h:181
PDFstrm
Definition
pdf.h:50
PDFstrm::bufmax
size_t bufmax
Definition
pdf.h:56
PDFstrm::buffer
unsigned char * buffer
Definition
pdf.h:52
PDFstrm::bp
size_t bp
Definition
pdf.h:56
PDFstrm::file
FILE * file
Definition
pdf.h:51
PLiodev
Definition
pdf.h:62
PLiodev::fd
int fd
Definition
pdf.h:63
PLiodev::type
int type
Definition
pdf.h:67
PLiodev::file
FILE * file
Definition
pdf.h:64
PLiodev::fileHandle
const char * fileHandle
Definition
pdf.h:66
PLiodev::fileName
const char * fileName
Definition
pdf.h:65
PLiodev::typeName
const char * typeName
Definition
pdf.h:68
include
pdf.h
Generated on
for PLplot by
1.18.0