1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
/* These are the lowest-level output routines in libplot/libplotter.
Plotters that write to output streams use these. */
#include "sys-defines.h"
#include "extern.h"
void
#ifdef _HAVE_PROTOS
_write_byte (const plPlotterData *data, unsigned char c)
#else
_write_byte (data, c)
const plPlotterData *data;
unsigned char c;
#endif
{
if (data->outfp)
putc ((int)c, data->outfp);
#ifdef LIBPLOTTER
else if (data->outstream)
data->outstream->put (c);
#endif
}
void
#ifdef _HAVE_PROTOS
_write_bytes (const plPlotterData *data, int n, const unsigned char *c)
#else
_write_bytes (data, n, c)
const plPlotterData *data;
int n;
const unsigned char *c;
#endif
{
int i;
if (data->outfp)
{
for (i = 0; i < n; i++)
putc ((int)(c[i]), data->outfp);
}
#ifdef LIBPLOTTER
else if (data->outstream)
data->outstream->write((char*)c, n);
#endif
}
void
#ifdef _HAVE_PROTOS
_write_string (const plPlotterData *data, const char *s)
#else
_write_string (data, s)
const plPlotterData *data;
const char *s;
#endif
{
if (data->outfp)
fputs (s, data->outfp);
#ifdef LIBPLOTTER
else if (data->outstream)
(*(data->outstream)) << s;
#endif
}
|