You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include <config.h>
-#include <assert.h>
+#include "output.h"
+#include "error.h"
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include "alloc.h"
-#include "approx.h"
+#include "devind.h"
#include "error.h"
#include "filename.h"
+#include "htmlP.h"
#include "lexer.h"
#include "misc.h"
-#include "output.h"
#include "settings.h"
#include "str.h"
/* A set of OUTP_DEV_* bits indicating the devices that are
disabled. */
-int disabled_devices;
+static int disabled_devices;
static void destroy_driver (struct outp_driver *);
static void configure_driver (char *);
/* Looks for a macro with key KEY, and returns the corresponding value
if found, or NULL if not. */
-const char *
+static const char *
find_defn_value (const char *key)
{
static char buf[INT_DIGITS + 1];
return d->value;
if (!strcmp (key, "viewwidth"))
{
- sprintf (buf, "%d", set_viewwidth);
+ sprintf (buf, "%d", get_viewwidth());
return buf;
}
else if (!strcmp (key, "viewlength"))
{
- sprintf (buf, "%d", set_viewlength);
+ sprintf (buf, "%d", get_viewlength());
return buf;
}
else
extern struct outp_class postscript_class;
extern struct outp_class epsf_class;
#endif
-#if !NO_HTML
extern struct outp_class html_class;
-#endif
+ extern struct outp_class devind_class;
char def[] = "default";
add_class (&epsf_class);
add_class (&postscript_class);
#endif
+ add_class (&devind_class);
add_class (&ascii_class);
add_name (def, &def[strlen (def)], OUTP_S_INIT_FILE);
where.line_number = 0;
err_push_file_locator (&where);
+ ds_init (&line, 128);
+
if (init_fn == NULL)
{
msg (IE, _("Cannot find output initialization file. Use `-vv' to view "
goto exit;
}
- ds_init (NULL, &line, 128);
for (;;)
{
char *cp;
msg (ME, _("Reading %s: %s."), init_fn, strerror (errno));
break;
}
- for (cp = ds_value (&line); isspace ((unsigned char) *cp); cp++);
+ for (cp = ds_c_str (&line); isspace ((unsigned char) *cp); cp++);
if (!strncmp ("define", cp, 6) && isspace ((unsigned char) cp[6]))
outp_configure_macro (&cp[7]);
else if (*cp)
/* Destroys all the drivers in driver list *DL and sets *DL to
NULL. */
-void
+static void
destroy_list (struct outp_driver ** dl)
{
struct outp_driver *d, *next;
int
outp_done (void)
{
+ struct outp_driver_class_list *n = outp_class_list ;
#if GLOBAL_DEBUGGING
if (iterating_driver_list)
reentrancy ();
#endif
destroy_list (&outp_driver_list);
+ while (n)
+ {
+ struct outp_driver_class_list *next = n->next;
+ free(n);
+ n = next;
+ }
+ free (outp_title);
+ free (outp_subtitle);
+
return 1;
}
void
outp_list_classes (void)
{
- int width = set_viewwidth;
+ int width = get_viewwidth();
struct outp_driver_class_list *c;
printf (_("Driver classes:\n\t"));
if ((int) strlen (c->class->name) + 1 > width)
{
printf ("\n\t");
- width = set_viewwidth - 8;
+ width = get_viewwidth() - 8;
}
else
putc (' ', stdout);
while (*prog && *prog != quote)
{
if (*prog != '\\')
- ds_putchar (&op_tokstr, *prog++);
+ ds_putc (&op_tokstr, *prog++);
else
{
int c;
break;
default:
msg (IS, _("Syntax error in string constant."));
+ continue;
}
- ds_putchar (&op_tokstr, (unsigned char) c);
+ ds_putc (&op_tokstr, (unsigned char) c);
}
}
prog++;
}
else
while (*prog && !isspace ((unsigned char) *prog) && *prog != '=')
- ds_putchar (&op_tokstr, *prog++);
+ ds_putc (&op_tokstr, *prog++);
op_token = 'a';
}
prog = s;
op_token = -1;
- ds_init (NULL, &op_tokstr, 64);
+ ds_init (&op_tokstr, 64);
while (tokener ())
{
char key[65];
}
ds_truncate (&op_tokstr, 64);
- strcpy (key, ds_value (&op_tokstr));
+ strcpy (key, ds_c_str (&op_tokstr));
tokener ();
if (op_token != '=')
if (c <= 0.0 || ptail == s)
goto lossage;
s = ptail;
- if (approx_eq (c, 0.0))
+ if (c == 0.0)
goto lossage;
if (value > 0)
value += b / c;
double b;
s = &ptail[1];
b = strtod (s, &ptail);
- if (approx_le (b, 0.0) || ptail == s)
+ if (b <= 0.0 || ptail == s)
goto lossage;
s = ptail;
value /= b;
ptail += 2;
value *= factor;
}
- if (approx_lt (value, 0.0))
+ if (value <= 0.0)
goto lossage;
if (tail)
*tail = ptail;
where.filename = pprsz_fn;
where.line_number = 0;
err_push_file_locator (&where);
+ ds_init (&line, 128);
if (pprsz_fn == NULL)
{
goto exit;
}
- ds_init (NULL, &line, 128);
for (;;)
{
char *cp, *bp, *ep;
msg (ME, _("Reading %s: %s."), pprsz_fn, strerror (errno));
break;
}
- for (cp = ds_value (&line); isspace ((unsigned char) *cp); cp++);
+ for (cp = ds_c_str (&line); isspace ((unsigned char) *cp); cp++);
if (*cp == 0)
continue;
if (*cp != '"')