104 typedef char * caddr_t;
115 #ifdef PL_HAVE_UNISTD_H
123 #if !defined ( M_PI )
124 #define M_PI 3.14159265358979323846
141 #define FPOS_T fpos_t
142 #define pl_fsetpos( a, b ) fsetpos( a, b )
143 #define pl_fgetpos( a, b ) fgetpos( a, b )
147 #define pl_fsetpos( a, b ) fseek( a, *b, 0 )
148 #define pl_fgetpos( a, b ) ( -1L == ( *b = ftell( a ) ) )
187 #define free_mem( a ) \
188 if ( a != NULL ) { free( (void *) a ); a = NULL; }
192 #define plsetvar( a, b ) \
193 if ( b != PL_NOTSET ) a = b;
198 #define MAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
201 #define MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
204 #define ABS( a ) ( ( a ) < 0 ? -( a ) : ( a ) )
207 #define ROUND( a ) (PLINT) ( ( a ) < 0. ? ( ( a ) - .5 ) : ( ( a ) + .5 ) )
210 #define BETW( ix, ia, ib ) ( ( ( ix ) <= ( ia ) && ( ix ) >= ( ib ) ) || ( ( ix ) >= ( ia ) && ( ix ) <= ( ib ) ) )
213 #define SSQR( a, b ) sqrt( ( a ) * ( a ) + ( b ) * ( b ) )
216 #define SIGN( a ) ( ( a ) < 0 ? -1 : 1 )
219 #define TRANSFORM( x, y, xnew, ynew ) if ( plsc->coordinate_transform ) { plsc->coordinate_transform( ( x ), ( y ), ( xnew ), ( ynew ), plsc->coordinate_transform_data ); } else { *xnew = x; *ynew = y; }
224 #define PL_UNDEFINED -9999999
228 #ifdef PL_HAVE_SNPRINTF
231 #ifdef _PL_HAVE_SNPRINTF
232 #define snprintf _snprintf
233 #define snscanf _snscanf
234 #endif // _PL_HAVE_SNPRINTF
235 #else // !PL_HAVE_SNPRINTF
240 #define snprintf plsnprintf
241 #define snscanf plsnscanf
242 #endif // PL_HAVE_SNPRINTF
248 #if defined ( PL__HAVE_ISNAN )
249 # define isnan _isnan
250 # if defined ( _MSC_VER )
254 #if defined ( PL__HAVE_ISINF )
255 # define isinf _isinf
257 #if defined ( PL_HAVE_FINITE )
258 # define isfinite finite
260 #if defined ( PL__HAVE_FINITE )
261 # define isfinite _finite
266 #if !defined ( PL_HAVE_ISNAN )
267 # define isnan( x ) ( ( x ) != ( x ) )
269 #if !defined ( PL_HAVE_ISINF )
270 # define isinf( x ) ( !isnan( x ) && isnan( x - x ) )
272 #if !defined ( PL_HAVE_ISFINITE )
273 # define isfinite( x ) ( !isnan( x - x ) )
279 #define HUGE_VAL ( 1.0 / 0.0 )
288 #define PL_MAXPOLY 256 // Max segments in polyline or polygon
289 #define PL_NSTREAMS 100 // Max number of concurrent streams.
290 #define PL_RGB_COLOR -1 // A hack
293 #define GRAPHICS_MODE 1
295 #define PI 3.1415926535897932384
309 #define PIXELS_X 32768 // Number of virtual pixels in x
310 #define PIXELS_Y 24576 // Number of virtual pixels in x
311 #define DPMM 4. // dots per mm
312 #define VDPMM ( DPMM * 32 ) // virtual dots per mm
313 #define LPAGE_X ( PIXELS_X / VDPMM ) // virtual page length in x in mm (256)
314 #define LPAGE_Y ( PIXELS_Y / VDPMM ) // virtual page length in y in mm (192)
325 #define ORIENTATION 3
329 #define PLSTATE_WIDTH 1 // pen width
330 #define PLSTATE_COLOR0 2 // change to color in cmap 0
331 #define PLSTATE_COLOR1 3 // change to color in cmap 1
332 #define PLSTATE_FILL 4 // set area fill attribute
333 #define PLSTATE_CMAP0 5 // change to cmap 0
334 #define PLSTATE_CMAP1 6 // change to cmap 1
338 #define PLDI_MAP 0x01
339 #define PLDI_ORI 0x02
340 #define PLDI_PLT 0x04
341 #define PLDI_DEV 0x08
345 #ifndef PL_FILESIZE_KB
346 #define PL_FILESIZE_KB 1000
351 #define PLPLOT5_FONTS
354 #define PL_XFONT "plxtnd5.fnt"
355 #define PL_SFONT "plstnd5.fnt"
357 #define PL_XFONT "plxtnd4.fnt"
358 #define PL_SFONT "plstnd4.fnt"
400 #define PLPLOT_BIN_ENV "PLPLOT_BIN"
401 #define PLPLOT_LIB_ENV "PLPLOT_LIB"
402 #define PLPLOT_TCL_ENV "PLPLOT_TCL"
403 #define PLPLOT_HOME_ENV "PLPLOT_HOME"
406 #define PLPLOT_MAX_PATH 1024
487 PLFLT *affine_vectorA,
488 const PLFLT *affine_vectorB,
489 const PLFLT *affine_vectorC );
518 void ( *draw )(
short *,
short *,
PLINT ) );
525 void ( *draw )(
short *,
short *,
PLINT ) );
554 plexit(
const char *errormsg );
564 plwarn(
const char *errormsg );
569 plabort(
const char *errormsg );
707 #define LINE_ITEMS 20
856 plstrl(
const char *
string );
1189 plio_fread(
void *,
size_t,
size_t, FILE * );
1206 #ifdef ENABLE_DYNDRIVERS
1208 plGetDrvDir(
void );
1211 #ifdef PL_HAVE_FREETYPE
1219 plD_FreeType_Destroy(
PLStream * );
1222 pl_set_extended_cmap0(
PLStream *,
int,
int );
1234 #endif // __PLPLOTP_H__