diff -uN original/gnuplot.35/term/latex.trm patch/gnuplot.35/term/latex.trm --- original/gnuplot.35/term/latex.trm Thu Sep 16 05:00:10 1993 +++ patch/gnuplot.35/term/latex.trm Thu Sep 15 18:12:44 1994 @@ -456,7 +456,7 @@ int x1,x2, y1,y2; { static float LATEX_left; /* fraction of space left after last dot */ -#ifndef AMIGA_AC_5 +#if !defined(AMIGA_AC_5) && !defined(MTOS) && !defined(ATARI) extern double sqrt(); #endif /* we draw a dotted line using the current dot spacing */ diff -uN original/gnuplot.35/term/metafont.trm patch/gnuplot.35/term/metafont.trm --- original/gnuplot.35/term/metafont.trm Thu Sep 16 05:00:10 1993 +++ patch/gnuplot.35/term/metafont.trm Thu Sep 15 18:12:44 1994 @@ -312,8 +312,9 @@ int MF_vector (x, y) unsigned int x, y; { +#if !defined(MTOS) && !defined(ATARI) double sqrt(), floor(); - +#endif if (MF_is_solid) { if (x == MF_last_x && y == MF_last_y) fprintf (outfile, "drawdot (%da,%db);\n", x, y); diff -uN original/gnuplot.35/term/mtos.trm patch/gnuplot.35/term/mtos.trm --- original/gnuplot.35/term/mtos.trm +++ patch/gnuplot.35/term/mtos.trm Thu Sep 15 18:12:52 1994 @@ -0,0 +1,272 @@ +/* GNUPLOT - mtos.trm */ +/* + * Copyright (C) 1994 + * + * Permission to use, copy, and distribute this software and its + * documentation for any purpose with or without fee is hereby granted, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. + * + * Permission to modify the software is granted, but not the right to + * distribute the modified code. Modifications are to be distributed + * as patches to released version. + * + * This software is provided "as is" without express or implied warranty. + * + * This file is included by ../term.c. + * + * This terminal driver supports: + * Atari Multitos Operating System (MiNT) + * + * AUTHOR + * Dirk Stadler (email: dirk_stadler@n.maus.de) + * + * send your comments or suggestions to (info-gnuplot@dartmouth.edu). + * + */ + +#include +#include +#include +#include +#include +#include + +/*function-prototypes */ + +void MTOS_options(void); +void MTOS_init(void); +void MTOS_reset(void); +void MTOS_graphics(void); +void MTOS_text(void); +void MTOS_move(unsigned int x, unsigned int y); +void MTOS_vector(unsigned int x, unsigned int y); +void MTOS_linetype(int lt); +TBOOLEAN MTOS_text_angle(int ta); +void MTOS_put_text(unsigned int x, unsigned int y, char *str); +TBOOLEAN MTOS_justify_text(enum JUSTIFY mode); +void MTOS_point(unsigned int x, unsigned int y, int number); +int MTOS_pause(char *str); +void MTOS_quit(void); + +/* default to ST high resolution */ + +#define MTOS_XMAX 640 +#define MTOS_YMAX 400 +#define MTOS_VCHAR 18 +#define MTOS_HCHAR 12 +#define MTOS_HTIC 5 +#define MTOS_VTIC MTOS_HTIC + +/* commands for GCLIENT */ + +#define SET_GRAPHICS 'G' +#define SET_TEXT 'E' +#define SET_LINE 'L' +#define SET_ANGLE 'A' +#define SET_JUSTIFY 'J' +#define SET_POINTMODE 'D' +#define GR_MOVE 'M' +#define GR_DRAW 'V' +#define GR_RESET 'R' +#define GR_TEXT 'T' +#define GR_PAUSE 'P' + +/* for creating pipename */ +#define TEMPNAME "GPXXXXXX" + +/* default name for client */ +#define GPCLIENT "GPCLIENT.PRG" + +/* environment */ +#define GNUENV "GPCLIENT" + +/* some global variables */ +static char MTOS_mode = 0; +static unsigned size; +static int handle = 0; +static int pid; + +void MTOS_options() +{ + term_options[0] = '\0'; +} + +void MTOS_init() +{ + char pipe[20], tempname[10]; + char *Env, MTOS_path[MAXPATHLEN]; + struct stat Puf; + + size = (unsigned)sizeof(short); + + if (!handle) { + strcpy(tempname, TEMPNAME); + if (mktemp(tempname) == NULL) { + fprintf(stderr,"\n\r Can't create temporary Pipename ! \n\r"); + fflush(stderr); + abort(); + } + strcpy(pipe, "U:\\PIPE\\"); + strcat(pipe, tempname); + + Env = getenv(GNUENV); + if (Env == NULL) + strcpy(MTOS_path,GPCLIENT); + else + strcpy(MTOS_path,Env); + + if ((handle = open(pipe, O_RDWR | O_CREAT)) <= 0) { + fprintf(stderr,"\n\r Can't open Pipe ! \n\r"); + fflush(stderr); + abort(); + } + + stat(pipe, &Puf); + if (!S_ISFIFO(Puf.st_mode)) { + fprintf(stderr,"\n\r The Pipe is not a PIPE (Please use MULTITOS) ! \n\r"); + fflush(stderr); + abort(); + } + + pid = spawnl(P_NOWAIT, MTOS_path, MTOS_path, pipe, NULL); + if (pid <= 0) { + fprintf(stderr, "Can't spawn %s !\n", MTOS_path); + abort(); + } + } +} + +void MTOS_reset() +{ + short buff; + buff = (short)GR_RESET; + + write(handle, &buff, size); +} + +void MTOS_text() +{ + short buff; + buff = (short)SET_TEXT; + + if (MTOS_mode != SET_TEXT) + write(handle, &buff, size); + MTOS_mode = SET_TEXT; +} + +void MTOS_graphics() +{ + short buff; + buff = (short)SET_GRAPHICS; + + write(handle, &buff, size); + MTOS_mode = SET_GRAPHICS ; +} + +void MTOS_move(unsigned int x, unsigned int y) +{ + short x_1, y_1, buff; + x_1 = (short)x; + y_1 = (short)y; + buff = (short)GR_MOVE; + + write(handle, &buff, size); + write(handle, &x_1, size); + write(handle, &y_1, size); +} + +void MTOS_vector(unsigned int x, unsigned int y) +{ + short x_1, y_1, buff; + x_1 = (short)x; + y_1 = (short)y; + buff = (short)GR_DRAW; + + write(handle, &buff, size); + write(handle, &x_1, size); + write(handle, &y_1, size); +} + +void MTOS_linetype(int lt) +{ + short lt_1, buff; + lt_1 = (short)lt; + buff = (short)SET_LINE; + + write(handle, &buff, size); + write(handle, <_1, size); +} + +TBOOLEAN MTOS_text_angle(int ta) +{ + short ta_1, buff; + ta_1 = (short)ta; + buff = (short)SET_ANGLE; + + write(handle, &buff, size); + write(handle, &ta_1, size); + return(TRUE); +} + +void MTOS_put_text(unsigned int x, unsigned int y, char *str) +{ + short x_1, y_1, len, buff; + x_1 = (short)x; + y_1 = (short)y; + len = (short)strlen(str) + 1; + buff = (short)GR_TEXT; + + write(handle, &buff, size); + write(handle, &x_1, size); + write(handle, &y_1, size); + write(handle, &len, size); + write(handle, str, (unsigned)len); +} + +TBOOLEAN MTOS_justify_text(enum JUSTIFY mode) +{ + short j_mode, buff; + j_mode = (short)mode; + buff = (short)SET_JUSTIFY; + + write(handle, &buff, size); + write(handle, &j_mode, size); + return(TRUE); +} + +void MTOS_point(unsigned int x, unsigned int y, int number) +{ + short mode, buff; + buff = (short)SET_POINTMODE; + + mode = 1; + write(handle, &buff, size); + write(handle, &mode, size); + do_point(x, y, number); + mode = 0; + write(handle, &buff, size); + write(handle, &mode, size); +} + +int MTOS_pause(char *str) +{ + short len, buff; + len = (short)strlen(str) + 1; + buff = (short)GR_PAUSE; + + write(handle, &buff, size); + write(handle, &len, size); + write(handle, str, (unsigned)len); + read (handle, &len, size); + return((int)len); +} + +void MTOS_quit() +{ + if (handle) { + kill(pid,SIGTERM); + close(handle); + } +}