home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-28 | 48.3 KB | 1,704 lines |
- Newsgroups: comp.sources.misc
- From: gershon%gr@cs.utah.edu (Elber Gershon)
- Subject: v24i044: gnuplot3 - interactive function plotting utility, Part22/26
- Message-ID: <1991Oct29.031012.4118@sparky.imd.sterling.com>
- X-Md4-Signature: 7dfa54c568be48e0424cea0c0248a55d
- Date: Tue, 29 Oct 1991 03:10:12 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: gershon%gr@cs.utah.edu (Elber Gershon)
- Posting-number: Volume 24, Issue 44
- Archive-name: gnuplot3/part22
- Environment: UNIX, MS-DOS, VMS
- Supersedes: gnuplot2: Volume 11, Issue 65-79
-
- #!/bin/sh
- # this is Part.22 (part 22 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file gnuplot/util.c continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 22; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping gnuplot/util.c'
- else
- echo 'x - continuing file gnuplot/util.c'
- sed 's/^X//' << 'SHAR_EOF' >> 'gnuplot/util.c' &&
- X else {
- X after = 1;
- X start--; /* back up token ptr */
- X }
- X }
- X }
- X
- X /* i now beyond end of token string */
- X
- X return(after || str[i] == '$' || str[i] == '\0');
- }
- X
- X
- X
- isstring(t_num)
- int t_num;
- {
- X
- X return(token[t_num].is_token &&
- X (input_line[token[t_num].start_index] == '\'' ||
- X input_line[token[t_num].start_index] == '\"'));
- }
- X
- X
- isnumber(t_num)
- int t_num;
- {
- X return(!token[t_num].is_token);
- }
- X
- X
- isletter(t_num)
- int t_num;
- {
- X return(token[t_num].is_token &&
- X (isalpha(input_line[token[t_num].start_index])));
- }
- X
- X
- /*
- X * is_definition() returns TRUE if the next tokens are of the form
- X * identifier =
- X * -or-
- X * identifier ( identifer ) =
- X */
- is_definition(t_num)
- int t_num;
- {
- X return (isletter(t_num) &&
- X (equals(t_num+1,"=") || /* variable */
- X (equals(t_num+1,"(") && /* function */
- X isletter(t_num+2) &&
- X equals(t_num+3,")") &&
- X equals(t_num+4,"=") ) ||
- X (equals(t_num+1,"(") && /* function with */
- X isletter(t_num+2) && /* two variables */
- X equals(t_num+3,",") &&
- X isletter(t_num+4) &&
- X equals(t_num+5,")") &&
- X equals(t_num+6,"=") )
- X ));
- }
- X
- X
- X
- /*
- X * copy_str() copies the string in token number t_num into str, appending
- X * a null. No more than MAX_ID_LEN chars are copied.
- X */
- copy_str(str, t_num)
- char str[];
- int t_num;
- {
- register int i = 0;
- register int start = token[t_num].start_index;
- register int count;
- X
- X if ((count = token[t_num].length) > MAX_ID_LEN)
- X count = MAX_ID_LEN;
- X do {
- X str[i++] = input_line[start++];
- X } while (i != count);
- X str[i] = '\0';
- }
- X
- X
- /*
- X * quote_str() does the same thing as copy_str, except it ignores the
- X * quotes at both ends. This seems redundant, but is done for
- X * efficency.
- X */
- quote_str(str, t_num)
- char str[];
- int t_num;
- {
- register int i = 0;
- register int start = token[t_num].start_index + 1;
- register int count;
- X
- X if ((count = token[t_num].length - 2) > MAX_ID_LEN)
- X count = MAX_ID_LEN;
- X if (count>0) {
- X do {
- X str[i++] = input_line[start++];
- X } while (i != count);
- X }
- X str[i] = '\0';
- }
- X
- X
- /*
- X * quotel_str() does the same thing as quote_str, except it uses
- X * MAX_LINE_LEN instead of MAX_ID_LEN.
- X */
- quotel_str(str, t_num)
- char str[];
- int t_num;
- {
- register int i = 0;
- register int start = token[t_num].start_index + 1;
- register int count;
- X
- X if ((count = token[t_num].length - 2) > MAX_LINE_LEN)
- X count = MAX_LINE_LEN;
- X if (count>0) {
- X do {
- X str[i++] = input_line[start++];
- X } while (i != count);
- X }
- X str[i] = '\0';
- }
- X
- X
- /*
- X * capture() copies into str[] the part of input_line[] which lies between
- X * the begining of token[start] and end of token[end].
- X */
- capture(str,start,end)
- char str[];
- int start,end;
- {
- register int i,e;
- X
- X e = token[end].start_index + token[end].length;
- X for (i = token[start].start_index; i < e && input_line[i] != '\0'; i++)
- X *str++ = input_line[i];
- X *str = '\0';
- }
- X
- X
- /*
- X * m_capture() is similar to capture(), but it mallocs storage for the
- X * string.
- X */
- m_capture(str,start,end)
- char **str;
- int start,end;
- {
- register int i,e;
- register char *s;
- X
- X if (*str) /* previous pointer to malloc'd memory there */
- X free(*str);
- X e = token[end].start_index + token[end].length;
- X *str = alloc((unsigned int)(e - token[start].start_index + 1), "string");
- X s = *str;
- X for (i = token[start].start_index; i < e && input_line[i] != '\0'; i++)
- X *s++ = input_line[i];
- X *s = '\0';
- }
- X
- X
- /*
- X * m_quote_capture() is similar to m_capture(), but it removes
- X quotes from either end if the string.
- X */
- m_quote_capture(str,start,end)
- char **str;
- int start,end;
- {
- register int i,e;
- register char *s;
- X
- X if (*str) /* previous pointer to malloc'd memory there */
- X free(*str);
- X e = token[end].start_index + token[end].length-1;
- X *str = alloc((unsigned int)(e - token[start].start_index + 1), "string");
- X s = *str;
- X for (i = token[start].start_index + 1; i < e && input_line[i] != '\0'; i++)
- X *s++ = input_line[i];
- X *s = '\0';
- }
- X
- X
- convert(val_ptr, t_num)
- struct value *val_ptr;
- int t_num;
- {
- X *val_ptr = token[t_num].l_val;
- }
- X
- static char *num_to_str(r)
- double r;
- {
- X static i = 0;
- X static char s[4][20];
- X int j = i++;
- X
- X if ( i > 3 ) i = 0;
- X
- X sprintf( s[j], "%g", r );
- X if ( strchr( s[j], '.' ) == NULL &&
- X strchr( s[j], 'e' ) == NULL &&
- X strchr( s[j], 'E' ) == NULL )
- X strcat( s[j], ".0" );
- X
- X return s[j];
- }
- X
- disp_value(fp,val)
- FILE *fp;
- struct value *val;
- {
- X switch(val->type) {
- X case INT:
- X fprintf(fp,"%d",val->v.int_val);
- X break;
- X case CMPLX:
- X if (val->v.cmplx_val.imag != 0.0 )
- X fprintf(fp,"{%s, %s}",
- X num_to_str(val->v.cmplx_val.real),
- X num_to_str(val->v.cmplx_val.imag));
- X else
- X fprintf(fp,"%s",
- X num_to_str(val->v.cmplx_val.real));
- X break;
- X default:
- X int_error("unknown type in disp_value()",NO_CARET);
- X }
- }
- X
- X
- double
- real(val) /* returns the real part of val */
- struct value *val;
- {
- X switch(val->type) {
- X case INT:
- X return((double) val->v.int_val);
- X case CMPLX:
- X return(val->v.cmplx_val.real);
- X }
- X int_error("unknown type in real()",NO_CARET);
- X /* NOTREACHED */
- X return((double)0.0);
- }
- X
- X
- double
- imag(val) /* returns the imag part of val */
- struct value *val;
- {
- X switch(val->type) {
- X case INT:
- X return(0.0);
- X case CMPLX:
- X return(val->v.cmplx_val.imag);
- X }
- X int_error("unknown type in imag()",NO_CARET);
- X /* NOTREACHED */
- X return((double)0.0);
- }
- X
- X
- X
- double
- magnitude(val) /* returns the magnitude of val */
- struct value *val;
- {
- X switch(val->type) {
- X case INT:
- X return((double) abs(val->v.int_val));
- X case CMPLX:
- X return(sqrt(val->v.cmplx_val.real*
- X val->v.cmplx_val.real +
- X val->v.cmplx_val.imag*
- X val->v.cmplx_val.imag));
- X }
- X int_error("unknown type in magnitude()",NO_CARET);
- X /* NOTREACHED */
- X return((double)0.0);
- }
- X
- X
- X
- double
- angle(val) /* returns the angle of val */
- struct value *val;
- {
- X switch(val->type) {
- X case INT:
- X return((val->v.int_val > 0) ? 0.0 : Pi);
- X case CMPLX:
- X if (val->v.cmplx_val.imag == 0.0) {
- X if (val->v.cmplx_val.real >= 0.0)
- X return(0.0);
- X else
- X return(Pi);
- X }
- X return(atan2(val->v.cmplx_val.imag,
- X val->v.cmplx_val.real));
- X }
- X int_error("unknown type in angle()",NO_CARET);
- X /* NOTREACHED */
- X return((double)0.0);
- }
- X
- X
- struct value *
- complex(a,realpart,imagpart)
- struct value *a;
- double realpart, imagpart;
- {
- X a->type = CMPLX;
- X a->v.cmplx_val.real = realpart;
- X a->v.cmplx_val.imag = imagpart;
- X return(a);
- }
- X
- X
- struct value *
- integer(a,i)
- struct value *a;
- int i;
- {
- X a->type = INT;
- X a->v.int_val = i;
- X return(a);
- }
- X
- X
- X
- os_error(str,t_num)
- char str[];
- int t_num;
- {
- #ifdef vms
- static status[2] = {1, 0}; /* 1 is count of error msgs */
- #endif
- X
- register int i;
- X
- X /* reprint line if screen has been written to */
- X
- X if (t_num != NO_CARET) { /* put caret under error */
- X if (!screen_ok)
- X fprintf(stderr,"\n%s%s\n", PROMPT, input_line);
- X
- X for (i = 0; i < sizeof(PROMPT) - 1; i++)
- X (void) putc(' ',stderr);
- X for (i = 0; i < token[t_num].start_index; i++) {
- X (void) putc((input_line[i] == '\t') ? '\t' : ' ',stderr);
- X }
- X (void) putc('^',stderr);
- X (void) putc('\n',stderr);
- X }
- X
- X for (i = 0; i < sizeof(PROMPT) - 1; i++)
- X (void) putc(' ',stderr);
- X fprintf(stderr,"%s\n",str);
- X
- X for (i = 0; i < sizeof(PROMPT) - 1; i++)
- X (void) putc(' ',stderr);
- X if (!interactive)
- X if (infile_name != NULL)
- X fprintf(stderr,"\"%s\", line %d: ", infile_name, inline_num);
- X else
- X fprintf(stderr,"line %d: ", inline_num);
- X
- X
- #ifdef vms
- X status[1] = vaxc$errno;
- X sys$putmsg(status);
- X (void) putc('\n',stderr);
- #else
- #ifdef __ZTC__
- X fprintf(stderr,"error number %d\n\n",errno);
- #else
- X if (errno >= sys_nerr)
- X fprintf(stderr, "unknown errno %d\n\n", errno);
- X else
- X fprintf(stderr,"(%s)\n\n",sys_errlist[errno]);
- #endif
- #endif
- X
- X longjmp(env, TRUE); /* bail out to command line */
- }
- X
- X
- int_error(str,t_num)
- char str[];
- int t_num;
- {
- register int i;
- X
- X /* reprint line if screen has been written to */
- X
- X if (t_num != NO_CARET) { /* put caret under error */
- X if (!screen_ok)
- X fprintf(stderr,"\n%s%s\n", PROMPT, input_line);
- X
- X for (i = 0; i < sizeof(PROMPT) - 1; i++)
- X (void) putc(' ',stderr);
- X for (i = 0; i < token[t_num].start_index; i++) {
- X (void) putc((input_line[i] == '\t') ? '\t' : ' ',stderr);
- X }
- X (void) putc('^',stderr);
- X (void) putc('\n',stderr);
- X }
- X
- X for (i = 0; i < sizeof(PROMPT) - 1; i++)
- X (void) putc(' ',stderr);
- X if (!interactive)
- X if (infile_name != NULL)
- X fprintf(stderr,"\"%s\", line %d: ", infile_name, inline_num);
- X else
- X fprintf(stderr,"line %d: ", inline_num);
- X fprintf(stderr,"%s\n\n", str);
- X
- X longjmp(env, TRUE); /* bail out to command line */
- }
- X
- /* Lower-case the given string (DFK) */
- /* Done in place. */
- void
- lower_case(s)
- X char *s;
- {
- X register char *p = s;
- X
- X while (*p != '\0') {
- X if (isupper(*p))
- X *p = tolower(*p);
- X p++;
- X }
- }
- X
- /* Squash spaces in the given string (DFK) */
- /* That is, reduce all multiple white-space chars to single spaces */
- /* Done in place. */
- void
- squash_spaces(s)
- X char *s;
- {
- X register char *r = s; /* reading point */
- X register char *w = s; /* writing point */
- X BOOLEAN space = FALSE; /* TRUE if we've already copied a space */
- X
- X for (w = r = s; *r != '\0'; r++) {
- X if (isspace(*r)) {
- X /* white space; only copy if we haven't just copied a space */
- X if (!space) {
- X space = TRUE;
- X *w++ = ' ';
- X } /* else ignore multiple spaces */
- X } else {
- X /* non-space character; copy it and clear flag */
- X *w++ = *r;
- X space = FALSE;
- X }
- X }
- X *w = '\0'; /* null terminate string */
- }
- X
- SHAR_EOF
- echo 'File gnuplot/util.c is complete' &&
- chmod 0644 gnuplot/util.c ||
- echo 'restore of gnuplot/util.c failed'
- Wc_c="`wc -c < 'gnuplot/util.c'`"
- test 12714 -eq "$Wc_c" ||
- echo 'gnuplot/util.c: original size 12714, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= gnuplot/makefile.unx ==============
- if test -f 'gnuplot/makefile.unx' -a X"$1" != X"-c"; then
- echo 'x - skipping gnuplot/makefile.unx (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting gnuplot/makefile.unx (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/makefile.unx' &&
- ############################################################
- #
- # GNUPLOT 3.0 Makefile (Unix X11 Motif/Athena support) for
- # Apollo/Sun/Dec5000/IBMrs6000/HP9000/SGI/3B1/386IX
- #
- # Original version by:
- # oliveria@caen.engin.umich.edu (ROQUE DONIZETE DE OLIVEIRA)
- # Wed, 3 Jul 91 14:31:37 -0400
- #
- #>>> Customizing: You must customize part of this makefile for your site.
- #>>> Then type 'make' for further instructions.
- #>>> Customization instructions look like these lines do (#>>>).
- #
- X
- TARGET = All # What to make by default
- X
- ############################################################
- #>>> Decide where the binaries and manuals will go.
- # directory where to install executables on 'make install'
- DEST=/usr/local/bin
- # directory for installing man page on 'make man_install'.
- MANDEST=/usr/man/manl
- # where to install help file gnuplot.gih
- HELPDEST=/usr/local/lib/gnuplot.gih
- #HELPDEST=docs/gnuplot.gih
- # Where to send email about bugs and comments (locally)
- EMAIL=bug-gnuplot%pixar.uucp@sun.com
- X
- ############################################################
- #>>> Choose your C compiler and basic compiler flags.
- CC = cc # the C compiler
- COPTS = -O # -O if you trust your compiler's optimizer
- LD =$(CC) $(CFLAGS) # default loading command
- X
- ############################################################
- #>>> Choose some optional features.
- #>>> At this point there are only two optional features:
- # READLINE:
- # If READLINE is defined, then command-line editing is supported.
- # Otherwise, your normal terminal editing is all you get.
- # Some machines will not support this, and they will turn this
- # option off (for example, apollos running SR10.2 or SR10.3 and
- # loaded with BSD4.3 instead of SYS5).
- # NOCWDRC:
- # If NOCWDRC is defined, then any .gnuplot in the current directory
- # is not read on startup. This is a security consideration
- # especially for root users ( we recommend you define -DNOCWDRC ).
- OPTIONS = -DREADLINE -DNOCWDRC
- X
- #>>> Optionally install the lasergnu script.
- # Lasergnu is a handy shell script for creating a plot from the
- # command line and sending it directly to the printer. It currently
- # supports postscript and imagen printers, and probably would need
- # tailoring to your site.
- # Use lasergnu_install to install lasergnu.
- # Use lasergnu_noinstall to not install lasergnu (default).
- LASERGNU = lasergnu_noinstall
- X
- ############################################################
- # X11 support
- #
- X
- #>>> List your X11 libraries#
- # standard MIT X11 R4: -lXaw -lXmu -lXt -lXext -lX11
- # Apollo DomainOS 10.3 (R3/Athena): -L/usr/lib/X11 -lXaw -lXmu -lXt -lX11
- # Apollo DomainOS 10.3 (R3/Motif): -L/usr/lib/X11 -lXm -lXtm -lX11
- # IBM RS/6000 AIX 3.1 (R3/Athena): -L/usr/lpp/X11/Xamples/lib/Xmu \
- # -L/usr/lpp/X11/Xamples/lib/Xaw \
- # -lXaw -lXmu -lXt -lXext -lX11
- # IBM RS/6000 AIX 3.1 (R3/Motif): -lXm -lXt -lX11
- # HP 9000/375 HP-UX 6.5 and 7.0 (R3/Motif): -lXm -lXt -lX11
- # Interactive 386/ix with T.Roell X386 and network support:
- # -lXaw -lXm -lXt -lXext -lX11 -linet -lpt
- XX11LIBS = -lXaw -lXmu -lXt -lXext -lX11
- X
- #>>> List your X11 include directories
- # standard MIT X11 R4: -I/usr/include/X11 -I/usr/include/X11/Xaw
- # Apollo DomainOS 10.3 (R3/Athena): -I/usr/include/X11
- # Apollo DomainOS 10.3 (R3/Motif): -I/usr/include/Xm
- # IBM RS/6000 AIX 3.1 (R3/Athena): -I/usr/include/X11 \
- # -I/usr/lpp/X11/Xamples/lib/Xaw \
- # -I/usr/lpp/X11/Xamples/lib/Xaw/X11
- # IBM RS/6000 AIX 3.1 (R3/Motif): -I/usr/include/Xm
- # HP 9000/375 HP-UX 6.5 and 7.0 (R3/Motif): -I/usr/include/Xm
- # HP 9000/700 HP-UX 8.0 (R4): -I/usr/include/X11R4 \
- # -I/usr/include/X11R4/X11/Xaw
- XX11INCLUDES = -I/usr/include/X11 -I/usr/include/X11/Xaw
- X
- #>>> You shouldn't have to change these, since they are controlled by
- #>>> Machine dependent definitions below.
- # Compile option for plot.c and TERMFLAGS, to include X11 support
- PLOTXFLAG = -DX11
- # this can add to CFLAGS for X11 compilations. Probably needs no change.
- XX11FLAGS =
- # make gnuplot_x11 by default
- GNUPLOT_X11 = gnuplot_x11
- # install gnuplot_x11 by default
- XX11INSTALL = x11_install
- X
- ############################################################
- #>>> Okay, you've changed enough. Now type 'make'.
- X
- ############################################################
- # This is used to pass many of the above definitions to make
- # subprocesses. Don't change this.
- MY_FLAGS = CC="$(CC)" COPTS="$(COPTS)" DEST="$(DEST)" \
- X MANDEST="$(MANDEST)" HELPDEST="$(HELPDEST)" \
- X EMAIL="$(EMAIL)" LASERGNU="$(LASERGNU)"
- X
- ############################################################
- # Explanations of CFLAGS definitions.
- # These should not need to be changed by you.
- # They are set correctly for each machine below. If your machine
- # doesn't fit the one of the patterns, override on the make command
- # line or make a new target for it and a new _FLAGS definition.
- # -DNOVFORK if you're unix and you have don't have vfork()
- # -DMEMSET if you need to use memset() instead of bzero()
- # -DMEMCPY if your bcopy() is called memcpy()
- # -DNOCOPY if you don't have a memcpy() by any name
- # -DGAMMA=foo if your gamma function is called foo(). Apollos have
- # lgamma(3m). If you don't have gamma(), use -DNOGAMMA.
- # The default is -DGAMMA=gamma.
- # -DGETCWD if your unix uses getcwd() instead of getcd()
- # this is needed by HP-UX and Cray Unicos systems.
- # -DULTRIX_KLUDGE if you run X windows on Ultrix and experience the
- # "every other plot" problem.
- # -Dunix is required to explicitly define "unix" for SCO and IBM
- # RS/6000 running AIX 3.1
- # -fswitch if you are compiling on a Sun3 (or even -f68881)
- # (but -fswitch is buggy on some systems, so watch out)
- X
- # Defaults in case the user types 'make All' directly
- # Should match X11R4_FLAGS's CFLAGS definition
- CFLAGS = $(COPTS) $(OPTIONS)
- X
- ############################################################
- # Terminal (device) support
- #
- # All devices available to a given machine are compiled in by default.
- # This documents the flags available in TERMFLAGS, although TERMFLAGS
- # is usually controlled by the machine-dependent definitions below.
- # See other terminal defines in term.h.
- # Define ULTRIX_KLUDGE if you have the every-other plot problem in Ultrix X11.
- #
- # -DAPOLLO Apollo Graphics Primitive Resource (window resize after replot)
- # -DGPR Apollo Graphics Primitive Resource (fixed-size window)
- # -DCGI SCO CGI
- # -DIRIS4D IRIS4D series computer
- # -DSUN Sun Microsystems Workstation
- # -DUNIXPC unixpc (ATT 3b1 or ATT 7300)
- # -DUNIXPLOT unixplot
- # -DX11 X11 Window System (This is $(PLOTXFLAG))
- TERMFLAGS = -Iterm -DUNIXPLOT $(PLOTXFLAG)
- X
- ############################################################
- # Library explanations.
- # You shouldn't need to adjust this; again, it is handled by the
- # machine-dependent definitions below.
- #
- # -lplot if you have -DUNIXPLOT in TERMFLAGS
- # -lsuntool -lsunwindow -lpixrect if you have -DSUN in TERMFLAGS
- # -lgl_s if -DIRIS4D in TERMFLAGS
- # -lccgi if -DCGI in TERMFLAGS
- LIBS = -lm -lplot
- X
- ############################################################
- # Machine-dependent settings.
- #
- XX11R4_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS)" \
- X LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
- X X11LIBS="$(X11LIBS)" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="$(TERMFLAGS)"
- X
- XX11R4_M_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS)" \
- X LIBS="$(LIBS)" X11FLAGS="-DMOTIF -D_NO_PROTO" \
- X X11INCLUDES="-I/usr/include/Xm" \
- X X11LIBS="-lXm -lXt -lX11" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="$(TERMFLAGS)"
- X
- DEC_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) " \
- X LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
- X X11LIBS="$(X11LIBS)" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="$(TERMFLAGS) -DULTRIX_KLUDGE"
- X
- DEC_M_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS)" \
- X LIBS="$(LIBS)" X11FLAGS="-DMOTIF -D_NO_PROTO" \
- X X11INCLUDES="-I/usr/include/Xm" \
- X X11LIBS="-lXm -lXt -lX11" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="$(TERMFLAGS) -DULTRIX_KLUDGE"
- X
- APOLLO_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) -DGAMMA=lgamma" \
- X LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" \
- X X11INCLUDES="-I/usr/include/X11" \
- X X11LIBS="-L/usr/lib/X11 -lXaw -lXmu -lXt -lX11" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="$(TERMFLAGS) -DAPOLLO -DGPR"
- X
- APOLLO_M_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) -DGAMMA=lgamma" \
- X LIBS="$(LIBS)" X11FLAGS="-DMOTIF" X11INCLUDES="-I/usr/include/Xm" \
- X X11LIBS="-L/usr/lib/X11 -lXm -lXt -lX11" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X TERMFLAGS="$(TERMFLAGS) -DAPOLLO -DGPR"
- X
- HP_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) -DMEMSET -DMEMCPY -DGETCWD" \
- X LIBS="-lm" X11FLAGS="$(X11FLAGS)" \
- X X11INCLUDES="-I/usr/include/X11R4 -I/usr/include/X11R4/X11/Xaw" \
- X X11LIBS="-L/usr/lib/X11R4 -lXaw -lXmu -lXt -lXext -lX11" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="-Iterm -DX11"
- X
- SUN_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS)" \
- X LIBS="-lsuntool -lsunwindow -lpixrect $(LIBS)" \
- X X11FLAGS=" " X11INCLUDES=" " \
- X X11LIBS=" " \
- X PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
- X TERMFLAGS="-Iterm -DUNIXPLOT -DSUN"
- X
- SUN_X11_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS)" \
- X LIBS="-lsuntool -lsunwindow -lpixrect $(LIBS)" \
- X X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
- X X11LIBS="$(X11LIBS)" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="$(TERMFLAGS) -DSUN"
- X
- SGI_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS)" \
- X LIBS="-lgl_s -lm" X11FLAGS=" " X11INCLUDES=" " \
- X X11LIBS=" " \
- X PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
- X TERMFLAGS="-Iterm -DIRIS4D"
- X
- SGIX11_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS)" \
- X LIBS="-lm" X11FLAGS="$(X11FLAGS)" \
- X X11INCLUDES="-I/usr/include/X11 -I/usr/include/X11/Xaw" \
- X X11LIBS="-L/usr/lib/X11 -lXaw -lXmu -lXt -lXext -lX11" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="-Iterm -DX11"
- X
- CGI_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) -Dunix" \
- X LIBS="-lccgi $(LIBS)" X11FLAGS=" " X11INCLUDES=" " \
- X X11LIBS=" " PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
- X TERMFLAGS="-Iterm -DUNIXPLOT -DCGI"
- X
- 3B1_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK" \
- X LIBS="$(LIBS)" X11FLAGS=" " X11INCLUDES=" " \
- X X11LIBS=" " \
- X PLOTXFLAG=" " GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
- X LD="ld /lib/crt0s.o /lib/shlib.ifile" \
- X TERMFLAGS="-Iterm -DUNIXPC"
- X
- 386IX_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK -DTCSETSW -DTCGETS" \
- X LIBS="$(LIBS) -lcposix" X11FLAGS=" " X11INCLUDES=" " \
- X X11LIBS=" " PLOTXFLAG=" " GNUPLOT_X11=" " \
- X X11INSTALL=x11_noinstall \
- X TERMFLAGS="-Iterm -DUNIXPLOT"
- 386IX_X11_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) -DGETCWD -DMEMSET -DMEMCPY -DNOVFORK -DTCSETSW -DTCGETS" \
- X LIBS="$(LIBS) -lcposix" X11FLAGS="$(X11FLAGS)" X11INCLUDES="$(X11INCLUDES)" \
- X X11LIBS="$(X11LIBS)" PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11="$(GNUPLOT_X11)" \
- X X11INSTALL= "$(X11INSTALL)" \
- X TERMFLAGS="-Iterm -DUNIXPLOT -DX11"
- X
- AIX_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) -Dunix -DNOVFORK" \
- X LIBS="$(LIBS)" X11FLAGS="$(X11FLAGS)" \
- X X11INCLUDES="-I/usr/include/X11 -I/usr/lpp/X11/Xamples/lib/Xaw -I/usr/lpp/X11/Xamples/lib/Xaw/X11" \
- X X11LIBS="-L/usr/lpp/X11/Xamples/lib/Xmu -L/usr/lpp/X11/Xamples/lib/Xaw -lXaw -lXmu -lXt -lXext -lX11" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="$(TERMFLAGS)"
- X
- AIX_M_FLAGS = \
- X CFLAGS="$(COPTS) $(OPTIONS) -Dunix -DNOVFORK" \
- X LIBS="$(LIBS)" X11FLAGS="-DMOTIF" X11INCLUDES="-I/usr/include/Xm" \
- X X11LIBS="-lXm -lXt -lX11" \
- X PLOTXFLAG="$(PLOTXFLAG)" GNUPLOT_X11=$(GNUPLOT_X11) \
- X X11INSTALL="$(X11INSTALL)" \
- X TERMFLAGS="$(TERMFLAGS)"
- X
- NEXT_FLAGS = \
- X CFLAGS="$(COPTS) -DNOCWDRC -DGAMMA=lgamma -DNEXT" \
- X LIBS="-lm" X11FLAGS="$(X11FLAGS)" \
- X X11INCLUDES=" " X11LIBS=" " PLOTXFLAG=" " \
- X GNUPLOT_X11=" " X11INSTALL=x11_noinstall \
- X TERMFLAGS="-Iterm"
- X
- ####################################################################
- # List of object files except version.o
- OBJS = bitmap.o command.o contour.o eval.o graphics.o graph3d.o help.o \
- X internal.o misc.o parse.o plot.o readline.o scanner.o \
- X setshow.o standard.o term.o util.o
- ####################################################################
- # List of source files
- # Used for makeing shar files, lint, and some dependencies.
- DIRS = term demo docs docs/latextut
- X
- CSOURCE1 = command.c setshow.c
- CSOURCE2 = help.c graphics.c graph3d.c internal.c
- CSOURCE3 = misc.c eval.c parse.c plot.c readline.c scanner.c standard.c
- CSOURCE4 = bitmap.c term.c util.c version.c
- CSOURCE5 = term/amiga.trm term/aed.trm term/cgi.trm term/dumb.trm term/dxf.trm \
- X term/dxy.trm term/eepic.trm term/epson.trm term/fig.trm \
- X term/hp26.trm term/hp2648.trm term/hpgl.trm term/hpljii.trm \
- X term/apollo.trm term/gpr.trm
- CSOURCE6 = term/impcodes.h term/imagen.trm term/object.h \
- X term/iris4d.trm term/kyo.trm term/latex.trm term/pc.trm
- CSOURCE7 = term/post.trm term/qms.trm term/regis.trm term/sun.trm \
- X term/t410x.trm term/tek.trm term/unixpc.trm term/unixplot.trm \
- X term/v384.trm term/x11.trm term/bigfig.trm term/vws.trm gnuplot_x11.c
- CSOURCE8 = contour.c
- # not C code, but still needed
- X
- DEMOS = demo/1.dat demo/2.dat demo/3.dat demo/contours.demo demo/controls.demo \
- X demo/electron.demo demo/glass.dat demo/param.demo demo/polar.demo \
- X demo/simple.demo demo/surface1.demo demo/surface2.demo demo/using.dat \
- X demo/using.demo demo/world.cor demo/world.dat demo/world.demo \
- X demo/err.dat demo/poldat.demo demo/polar.dat demo/errorbar.demo \
- X demo/antenna.dat demo/all.demo demo/bivariat.demo
- X
- ETC = Copyright README README.gnutex README.amiga makefile.unx makefile.vms \
- X linkopt.amg makefile.amg makefile.ami linkopt.vms buildvms.com \
- X plot.h help.h setshow.h bitmap.h term.h lasergnu \
- X term/README History gnuplot.el Intergraph.x11 README.Install
- X
- #BETA files (not standard distribution files)
- BETA = BETA10
- # PC-specific files
- PC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
- X linkopt.msc linkopt.tc linkopt.tco makefile.msc makefile.tc \
- X pcgraph.asm
- X
- # Documentation and help files
- DOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
- X docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
- X docs/gnuplot.1 docs/lasergnu.1 docs/toc_entry.sty \
- X docs/titlepage.ms docs/titlepage.tex docs/Makefile.ami
- DOCS2 = docs/gnuplot.doc
- DOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
- X docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
- X docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
- X docs/latextut/header.tex docs/latextut/tutorial.tex \
- X docs/latextut/linepoint.plt
- X
- #########################################################################
- # Default target (informational)
- info:
- X @echo "Please do a 'make <MACHINE>' where <MACHINE> is one of the following:"
- X @echo
- X @echo "apollo, apollo_motif for Apollo running SR10.3 with Apollo's X11R3"
- X @echo "dec, dec_motif for Dec3100/5000 running Ultrix 3.1d with MIT's X11R4"
- X @echo "hp for HP/9000 700 series running HP/UX 8.0 with MIT's X11R4"
- X @echo "sun for Sun sparcstation running SunOS 4.1 with suntools (no X11R4) "
- X @echo "sun_x11 for Sun sparcstation running SunOS 4.1 with suntools and X11R4 "
- X @echo "sgi for Silicon Graphics IRIS4D machines (no X11R4) "
- X @echo "sgix11 for Silicon Graphics IRIS4D machines (X11R4) "
- X @echo "next for NeXT Cube and Slab running NeXTOS 2.0+ (no X11R4) "
- X @echo "3b1 for ATT 3b1 machines (no X11R4) "
- X @echo "386ix for 386 machines running 386/ix (no X11)"
- X @echo "386ix_x11 for 386 machines running 386/ix with T.Roell X386"
- X @echo "ibmrs6000, ibmrs6000_motif for IBM RS/6000 running Aix 3.1 with IBM's X11R3"
- X @echo "x11r4, x11r4_motif for a generic machine (like a sun or dec) with MIT's X11R4"
- X @echo
- X @echo "Examples:"
- X @echo
- X @echo " make x11r4"
- X @echo " make x11r4_motif"
- X @echo " make apollo"
- X @echo " make apollo OPTIONS='-DNOCWDRC' "
- X @echo " make apollo_motif DEST='/usr/um/misc/bin' "
- X @echo " make dec"
- X @echo " make hp"
- X @echo " make next"
- X @echo " make sun HELPDEST='/usr/um/misc/lib/gnuplot.gih' "
- X @echo " make sun X11INCLUDES='-I/usr/local/include -I/usr/local/include/X11 -I/usr/local/include/X11/Xaw' "
- X @echo " make sun_x11"
- X @echo " make sgi"
- X @echo " make 3b1"
- X @echo " make 386ix"
- X @echo " make ibmrs6000 MANDEST='/usr/usr/misc/man/man1' COPTS='-O' "
- X @echo
- X @echo "If you just type 'make All' , it will build gnuplot for Unix X11R4/Athena"
- X @echo "and the following variables will be used as default:"
- X @echo
- X @echo " DEST " $(DEST)
- X @echo " MANDEST " $(MANDEST)
- X @echo " HELPDEST " $(HELPDEST)
- X @echo " EMAIL " $(EMAIL)
- X @echo " CC " $(CC)
- X @echo " COPTS " $(COPTS)
- X @echo " OPTIONS " $(OPTIONS)
- X @echo " CFLAGS " $(CFLAGS)
- X @echo " LIBS " $(LIBS)
- X @echo " X11FLAGS " $(X11FLAGS)
- X @echo " X11LIBS " $(X11LIBS)
- X @echo " X11INCLUDES " $(X11INCLUDES)
- X @echo " TERMFLAGS " $(TERMFLAGS)
- X @echo " LASERGNU " $(LASERGNU)
- X @echo
- X @echo "If you are not familiar with makefiles or just want to know what"
- X @echo " 'make <MACHINE>' would do without actually doing anything, then type"
- X @echo " 'make <MACHINE> -n' "
- X @echo
- X
- ###############################################################
- # Targets for each machine
- X
- x11r4:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(X11R4_FLAGS) $(TARGET)
- X
- x11r4_motif:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(X11R4_M_FLAGS) $(TARGET)
- X
- dec:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(DEC_FLAGS) $(TARGET)
- X
- dec_motif:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(DEC_M_FLAGS) $(TARGET)
- X
- apollo:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(APOLLO_FLAGS) $(TARGET)
- X
- apollo_motif:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(APOLLO_M_FLAGS) $(TARGET)
- X
- hp:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(HP_FLAGS) $(TARGET)
- X
- next:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(NEXT_FLAGS) $(TARGET)
- X
- sun:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(SUN_FLAGS) $(TARGET)
- X
- sun_x11:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(SUN_X11_FLAGS) $(TARGET)
- X
- sgi:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(SGI_FLAGS) $(TARGET)
- X
- sgix11:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(SGIX11_FLAGS) $(TARGET)
- X
- cgi:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(CGI_FLAGS) $(TARGET)
- X
- 3b1:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(3B1_FLAGS) $(TARGET)
- X
- 386ix:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(386IX_FLAGS) $(TARGET)
- X
- 386ix_x11:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(386IX_X11_FLAGS) $(TARGET)
- X
- ibmrs6000:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(AIX_FLAGS) $(TARGET)
- X
- ibmrs6000_motif:
- X $(MAKE) $(MFLAGS) $(MY_FLAGS) $(AIX_M_FLAGS) $(TARGET)
- X
- #############################################################
- # Targets that really do something
- X
- all:
- X @echo "Please just type 'make' in order to get some information on "
- X @echo "how to build gnuplot under Unix and the X Window System."
- X
- All: gnuplot $(GNUPLOT_X11) doc
- X
- gnuplot: $(OBJS) version.o
- X $(LD) $(OBJS) version.o $(LIBS) -o gnuplot
- X
- doc:
- X ( cd docs; make $(MFLAGS) gnuplot.gih )
- X
- gnuplot_x11: gnuplot_x11.c
- X $(CC) $(CFLAGS) $(X11FLAGS) $(X11INCLUDES) -o gnuplot_x11 gnuplot_x11.c $(X11LIBS)
- X
- ################################################################
- # Installation instructions
- X
- install:
- X @echo
- X @echo "Please do a 'make <MACHINE> TARGET=Install' where <MACHINE> is one of the following:"
- X @echo
- X @echo "apollo, apollo_motif, dec, dec_motif, hp, sun, sun_x11, sgi, sgix11"
- X @echo "next, 3b1, 386ix, ibmrs6000, ibmrs6000_motif, x11r4, x11r4_motif"
- X @echo
- X @echo "Examples:"
- X @echo
- X @echo " make x11r4 TARGET=Install "
- X @echo " make apollo TARGET=Install "
- X @echo " make apollo_motif TARGET=Install DEST='/usr/um/misc/bin' "
- X @echo " make dec TARGET=Install "
- X @echo " make hp TARGET=Install "
- X @echo " make sun TARGET=Install HELPDEST='/usr/um/misc/lib/gnuplot.gih' "
- X @echo " make ibmrs6000 TARGET=Install MANDEST='/usr/um/misc/man/man1' COPTS='-O' "
- X @echo
- ################################################################
- # Installation targets
- X
- Install: All man_install $(X11INSTALL) $(LASERGNU)
- X cp gnuplot $(DEST)
- X strip $(DEST)/gnuplot
- X (cd docs; make $(MFLAGS) install-unix HELPDEST=$(HELPDEST))
- X
- x11_install: gnuplot_x11
- X cp gnuplot_x11 $(DEST)
- X strip $(DEST)/gnuplot_x11
- X
- x11_noinstall:
- X @echo "X11 not requested, so gnuplot_x11 program not installed"
- X
- man_install: docs/gnuplot.1
- X cp docs/gnuplot.1 $(MANDEST)
- X
- lasergnu_install: lasergnu docs/lasergnu.1
- X cp lasergnu $(DEST)
- X chmod 755 $(DEST)/lasergnu
- X cp docs/lasergnu.1 $(MANDEST)
- X
- lasergnu_noinstall:
- X @echo
- X @echo "Lasergnu will not be installed by default."
- X @echo "If you think you need the lasergnu script to print"
- X @echo " files on the imagen or postscript printers, then"
- X @echo " type"
- X @echo " 'make <MACHINE> TARGET=Install LASERGNU='lasergnu_install' "
- X @echo
- X @echo "Lasergnu is really not needed since within gnuplot you can"
- X @echo " can create files (in impress or postscript language) and"
- X @echo " print them through your favorite print command (lpr, lp, prf, ipr)."
- X @echo
- X
- ################################################################
- # Dependencies
- X
- plot.o: plot.c
- X $(CC) $(CFLAGS) $(PLOTXFLAG) -c plot.c
- X
- term.o: term.h term.c $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
- X $(CC) $(CFLAGS) $(TERMFLAGS) -c term.c
- X
- version.o:
- X $(CC) $(CFLAGS) -DCONTACT=\"$(EMAIL)\" -c version.c
- X
- $(OBJS): plot.h
- X
- command.o:
- X $(CC) $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"
- X
- command.o help.o misc.o: help.h
- X
- command.o graphics.o graph3d.o misc.o plot.o setshow.o term.o: setshow.h
- X
- bitmap.o term.o: bitmap.h
- X
- ################################################################
- # Miscellaneous targets
- X
- SOURCES=plot.h help.h setshow.h bitmap.h term.h $(CSOURCE1) $(CSOURCE2) \
- X $(CSOURCE3) $(CSOURCE4) $(CSOURCE5) $(CSOURCE6) $(CSOURCE7) $(CSOURCE8)
- X
- lint:
- X lint -hx $(SOURCES)
- X
- clean:
- X rm -f *.o *~ *.bak term/*~ term/*.bak
- X (cd docs; make $(MFLAGS) clean)
- X (cd docs/latextut; make $(MFLAGS) clean)
- X
- spotless:
- X rm -f *.o *~ *.bak term/*~ term/*.bak TAGS gnuplot gnuplot_x11
- X (cd docs; make $(MFLAGS) clean)
- X (cd docs/latextut; make $(MFLAGS) spotless)
- X
- ################################################################
- # Making shar files for mailing gnuplot
- X
- shar: gnuplot.sh00 gnuplot.sh01 gnuplot.sh02 gnuplot.sh03 gnuplot.sh04 \
- X gnuplot.sh05 gnuplot.sh06 gnuplot.sh07 gnuplot.sh08 \
- X gnuplot.sh09 gnuplot.sh10 gnuplot.sh11 gnuplot.sh12 \
- X gnuplot.sh13 gnuplot.sh14 gnuplot.sh15
- X
- gnuplot.sh00:
- X echo '#!/bin/sh' > gnuplot.sh00
- X echo '# This is a shell file to make directories' >> gnuplot.sh00
- X echo mkdir $(DIRS) >> gnuplot.sh00
- X
- gnuplot.sh01: $(ETC)
- X shar $(ETC) > gnuplot.sh01
- X
- gnuplot.sh02: $(DOCS1)
- X shar $(DOCS1) > gnuplot.sh02
- X
- gnuplot.sh03: $(DOCS2)
- X shar $(DOCS2) > gnuplot.sh03
- X
- gnuplot.sh04: $(DOCS3)
- X shar $(DOCS3) > gnuplot.sh04
- X
- gnuplot.sh05: $(CSOURCE1)
- X shar $(CSOURCE1) > gnuplot.sh05
- X
- gnuplot.sh06: $(CSOURCE2)
- X shar $(CSOURCE2) > gnuplot.sh06
- X
- gnuplot.sh07: $(CSOURCE3)
- X shar $(CSOURCE3) > gnuplot.sh07
- X
- gnuplot.sh08: $(CSOURCE4)
- X shar $(CSOURCE4) > gnuplot.sh08
- X
- gnuplot.sh09: $(CSOURCE5)
- X shar $(CSOURCE5) > gnuplot.sh09
- X
- gnuplot.sh10: $(CSOURCE6)
- X shar $(CSOURCE6) > gnuplot.sh10
- X
- gnuplot.sh11: $(CSOURCE7)
- X shar $(CSOURCE7) > gnuplot.sh11
- X
- gnuplot.sh12: $(PC)
- X shar $(PC) > gnuplot.sh12
- X
- gnuplot.sh13: $(CSOURCE8)
- X shar $(CSOURCE8) > gnuplot.sh13
- X
- gnuplot.sh14: $(DEMOS)
- X shar $(DEMOS) > gnuplot.sh14
- X
- gnuplot.sh15: $(BETA)
- X shar $(BETA) > gnuplot.sh15
- X
- SHAR_EOF
- chmod 0644 gnuplot/makefile.unx ||
- echo 'restore of gnuplot/makefile.unx failed'
- Wc_c="`wc -c < 'gnuplot/makefile.unx'`"
- test 25357 -eq "$Wc_c" ||
- echo 'gnuplot/makefile.unx: original size 25357, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= gnuplot/pcgraph.asm ==============
- if test -f 'gnuplot/pcgraph.asm' -a X"$1" != X"-c"; then
- echo 'x - skipping gnuplot/pcgraph.asm (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting gnuplot/pcgraph.asm (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/pcgraph.asm' &&
- TITLE PC graphics module
- ; uses LINEPROC.MAC
- X
- ; Michael Gordon - 8-Dec-86
- ;
- ; Certain routines were taken from the Hercules BIOS of Dave Tutelman - 8/86
- ; Others came from pcgraph.asm included in GNUPLOT by Colin Kelley
- ;
- ; modified slightly by Colin Kelley - 22-Dec-86
- ; added header.mac, parameterized declarations
- ; added dgroup: in HVmodem to reach HCh_Parms and HGr_Parms - 30-Jan-87
- ;
- ; modified and added to for use in plot(3) routines back end.
- ; Gil Webster.
- ;
- ; Assemble with masm ver. 4.
- X
- include header.mac
- X
- if1
- include lineproc.mac
- endif
- X
- GPg1_Base equ 0B800h ; Graphics page 1 base address
- X
- X extrn _inter:far
- X
- _text segment
- X
- X public _PC_line, _PC_color, _PC_mask, _PC_curloc, _PC_puts, _Vmode
- X public _erase, _save_stack, _ss_interrupt
- X
- pcpixel proc near
- X ror word ptr linemask,1
- X jc cont
- X ret
- cont:
- X push ax
- X push bx
- X push cx
- X push dx
- X push bp
- X mov cx,ax ; x
- X mov dx,bx ; y
- X mov ah,0ch ; ah = write pixel
- X mov al,byte ptr color
- X
- X mov bh, 0 ; page 0
- X int 10h
- X pop bp
- X pop dx
- X pop cx
- X pop bx
- X pop ax
- X ret
- pcpixel endp
- X
- lineproc _PC_line, pcpixel
- X
- ;
- ; erase - clear page 1 of the screen buffer to zero (effectively, blank
- ; the screen)
- ;
- beginproc _erase
- X push es
- X push ax
- X push cx
- X push di
- X mov ax, GPg1_Base
- X mov es, ax
- X xor di, di
- X mov cx, 4000h
- X xor ax, ax
- X cld
- X rep stosw ; zero out screen page
- X pop di
- X pop cx
- X pop ax
- X pop es
- X ret
- _erase endp
- X
- beginproc _PC_color
- X push bp
- X mov bp,sp
- X mov al,[bp+X] ; color
- X mov byte ptr color,al
- X pop bp
- X ret
- _PC_color endp
- X
- beginproc _PC_mask
- X push bp
- X mov bp,sp
- X mov ax,[bp+X] ; mask
- X mov word ptr linemask,ax
- X pop bp
- X ret
- _PC_mask endp
- X
- beginproc _Vmode
- X push bp
- X mov bp,sp
- X push si
- X push di
- X mov ax,[bp+X]
- X int 10h
- X pop di
- X pop si
- X pop bp
- X ret
- _Vmode endp
- X
- beginproc _PC_curloc
- X push bp
- X mov bp,sp
- X mov dh, byte ptr [bp+X] ; row number
- X mov dl, byte ptr [bp+X+2] ; col number
- X mov bh, 0
- X mov ah, 2
- X int 10h
- X pop bp
- X ret
- _PC_curloc endp
- X
- ;
- ; thanks to watale!broehl for finding a bug here--I wasn't pushing BP
- ; and reloading AH before INT 10H, which is necessary on genuine IBM
- ; boards...
- ;
- beginproc _PC_puts
- X push bp
- X mov bp,sp
- X push si
- X mov bl,byte ptr color
- X mov si,[bp+X] ; offset
- X
- ifdef LARGE_DATA
- X mov es,[bp+X+2] ; segment if large or compact data model
- endif
- X
- puts2:
- X
- ifdef LARGE_DATA
- X mov al,es:[si]
- else
- X mov al,[si]
- endif
- X or al,al
- X jz puts3
- X mov ah,0eh ; write TTY char
- X int 10h
- X inc si
- X jmp short puts2
- puts3: pop si
- X pop bp
- X ret
- _PC_puts endp
- X
- X
- ; int kbhit();
- ; for those without MSC 4.0
- ; Use BIOS interrupt 16h to determine if a key is waiting in the buffer.
- ; Return nonzero if so.
- ;
- X
- beginproc _kbhit
- X mov ah, 1 ; function code 1 is keyboard test
- X int 16h ; keyboard functions
- X jnz kbfin ; Exit if char available
- X xor ax, ax ; No char: return zero.
- kbfin: ret
- _kbhit endp
- X
- X
- ; _save_stack and _ss_interrupt are needed due to a bug in the MSC 4.0
- ; code when run under MS-DOS 3.x. Starting with 3.0, MS-DOS automatically
- ; switches to an internal stack during system calls. This leaves SS:SP
- ; pointing at MS-DOS's stack when the ^C interrupt (INT 23H) is triggered.
- ; MSC should restore its own stack before calling the user signal() routine,
- ; but it doesn't.
- ;
- ; Presumably this code will be unnecessary in later releases of the compiler.
- ;
- X
- ; _save_stack saves the current SS:SP to be loaded later by _ss_interrupt.
- ;
- X
- beginproc _save_stack
- X mov ax,ss
- X mov cs:save_ss,ax
- X mov ax,sp
- X mov cs:save_sp,ax
- X ret
- _save_stack endp
- X
- X
- ; _ss_interrupt is called on ^C (INT 23H). It restores SS:SP as saved in
- ; _save_stack and then jumps to the C routine interrupt().
- ;
- beginproc _ss_interrupt
- X cli ; no interrupts while the stack is changed!
- X mov ax,-1 ; self-modifying code again
- save_ss equ this word - 2
- X mov ss,ax
- X mov sp,-1 ; here too
- save_sp equ this word - 2
- X sti
- X jmp far ptr _inter; now it's safe to call the real routine
- _ss_interrupt endp
- X
- X
- _text ends
- X
- X
- const segment
- linemask dw -1
- color db 1
- const ends
- X
- X end
- SHAR_EOF
- chmod 0666 gnuplot/pcgraph.asm ||
- echo 'restore of gnuplot/pcgraph.asm failed'
- Wc_c="`wc -c < 'gnuplot/pcgraph.asm'`"
- test 3925 -eq "$Wc_c" ||
- echo 'gnuplot/pcgraph.asm: original size 3925, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= gnuplot/plot.c ==============
- if test -f 'gnuplot/plot.c' -a X"$1" != X"-c"; then
- echo 'x - skipping gnuplot/plot.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting gnuplot/plot.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/plot.c' &&
- /* GNUPLOT - plot.c */
- /*
- X * Copyright (C) 1986, 1987, 1990, 1991 Thomas Williams, Colin Kelley
- X *
- X * Permission to use, copy, and distribute this software and its
- X * documentation for any purpose with or without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and
- X * that both that copyright notice and this permission notice appear
- X * in supporting documentation.
- X *
- X * Permission to modify the software is granted, but not the right to
- X * distribute the modified code. Modifications are to be distributed
- X * as patches to released version.
- X *
- X * This software is provided "as is" without express or implied warranty.
- X *
- X *
- X * AUTHORS
- X *
- X * Original Software:
- X * Thomas Williams, Colin Kelley.
- X *
- X * Gnuplot 2.0 additions:
- X * Russell Lang, Dave Kotz, John Campbell.
- X *
- X * Gnuplot 3.0 additions:
- X * Gershon Elber and many others.
- X *
- X * Send your comments or suggestions to
- X * pixar!info-gnuplot@sun.com.
- X * This is a mailing list; to join it send a note to
- X * pixar!info-gnuplot-request@sun.com.
- X * Send bug reports to
- X * pixar!bug-gnuplot@sun.com.
- X */
- X
- #include <stdio.h>
- #include <setjmp.h>
- #include <signal.h>
- #include "plot.h"
- #include "setshow.h"
- #ifdef MSDOS
- #include <io.h>
- #endif
- #ifdef vms
- #include <unixio.h>
- #include <smgdef.h>
- extern int vms_vkid;
- extern smg$create_virtual_keyboard();
- unsigned int status[2] = {1, 0};
- #endif
- #ifdef AMIGA_LC_5_1
- #include <proto/dos.h>
- #endif
- X
- #ifdef __TURBOC__
- #include <graphics.h>
- #endif
- X
- extern char *getenv(),*strcat(),*strcpy(),*strncpy();
- X
- extern char input_line[];
- extern int c_token;
- extern FILE *outfile;
- extern int term;
- X
- BOOLEAN interactive = TRUE; /* FALSE if stdin not a terminal */
- char *infile_name = NULL; /* name of command file; NULL if terminal */
- X
- #ifndef STDOUT
- #define STDOUT 1
- #endif
- X
- jmp_buf env;
- X
- struct value *integer(),*complex();
- X
- X
- extern f_push(),f_pushc(),f_pushd1(),f_pushd2(),f_call(),f_call2(),f_lnot(),f_bnot(),f_uminus()
- X ,f_lor(),f_land(),f_bor(),f_xor(),f_band(),f_eq(),f_ne(),f_gt(),f_lt(),
- X f_ge(),f_le(),f_plus(),f_minus(),f_mult(),f_div(),f_mod(),f_power(),
- X f_factorial(),f_bool(),f_jump(),f_jumpz(),f_jumpnz(),f_jtern();
- X
- extern f_real(),f_imag(),f_arg(),f_conjg(),f_sin(),f_cos(),f_tan(),f_asin(),
- X f_acos(),f_atan(),f_sinh(),f_cosh(),f_tanh(),f_int(),f_abs(),f_sgn(),
- X f_sqrt(),f_exp(),f_log10(),f_log(),f_besj0(),f_besj1(),f_besy0(),f_besy1(),
- #ifdef GAMMA
- X f_gamma(),
- #endif
- X f_floor(),f_ceil();
- X
- X
- struct ft_entry ft[] = { /* built-in function table */
- X
- /* internal functions: */
- X {"push", f_push}, {"pushc", f_pushc},
- X {"pushd1", f_pushd1}, {"pushd2", f_pushd2},
- X {"call", f_call}, {"call2", f_call2}, {"lnot", f_lnot},
- X {"bnot", f_bnot}, {"uminus", f_uminus}, {"lor", f_lor},
- X {"land", f_land}, {"bor", f_bor}, {"xor", f_xor},
- X {"band", f_band}, {"eq", f_eq}, {"ne", f_ne},
- X {"gt", f_gt}, {"lt", f_lt}, {"ge", f_ge},
- X {"le", f_le}, {"plus", f_plus}, {"minus", f_minus},
- X {"mult", f_mult}, {"div", f_div}, {"mod", f_mod},
- X {"power", f_power}, {"factorial", f_factorial},
- X {"bool", f_bool}, {"jump", f_jump}, {"jumpz", f_jumpz},
- X {"jumpnz",f_jumpnz},{"jtern", f_jtern},
- X
- /* standard functions: */
- X {"real", f_real}, {"imag", f_imag}, {"arg", f_arg},
- X {"conjg", f_conjg}, {"sin", f_sin}, {"cos", f_cos},
- X {"tan", f_tan}, {"asin", f_asin}, {"acos", f_acos},
- X {"atan", f_atan}, {"sinh", f_sinh}, {"cosh", f_cosh},
- X {"tanh", f_tanh}, {"int", f_int}, {"abs", f_abs},
- X {"sgn", f_sgn}, {"sqrt", f_sqrt}, {"exp", f_exp},
- X {"log10", f_log10}, {"log", f_log}, {"besj0", f_besj0},
- X {"besj1", f_besj1}, {"besy0", f_besy0}, {"besy1", f_besy1},
- #ifdef GAMMA
- X {"gamma", f_gamma},
- #endif
- X {"floor", f_floor}, {"ceil", f_ceil},
- X {NULL, NULL}
- };
- X
- static struct udvt_entry udv_pi = {NULL, "pi",FALSE};
- X /* first in linked list */
- struct udvt_entry *first_udv = &udv_pi;
- struct udft_entry *first_udf = NULL;
- X
- X
- X
- #ifdef vms
- X
- #define HOME "sys$login:"
- X
- #else /* vms */
- #ifdef MSDOS
- X
- #define HOME "GNUPLOT"
- X
- #else /* MSDOS */
- X
- #if defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
- X
- #define HOME "GNUPLOT"
- #else /* AMIGA */
- X
- #define HOME "HOME"
- X
- #endif /* AMIGA */
- #endif /* MSDOS */
- #endif /* vms */
- X
- #ifdef unix
- #define PLOTRC ".gnuplot"
- #else /* unix */
- #if defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
- #define PLOTRC ".gnuplot"
- #else /* AMIGA */
- #define PLOTRC "gnuplot.ini"
- #endif /* AMIGA */
- #endif /* unix */
- X
- #ifdef __TURBOC__
- void tc_interrupt()
- #else
- #ifdef _CRAY
- void inter(an_int)
- int an_int;
- #else
- inter()
- #endif
- #endif
- {
- #ifdef MSDOS
- #ifdef __TURBOC__
- X (void) signal(SIGINT, tc_interrupt);
- #else
- X void ss_interrupt();
- X (void) signal(SIGINT, ss_interrupt);
- #endif
- #else /* MSDOS */
- X (void) signal(SIGINT, inter);
- #endif /* MSDOS */
- X (void) signal(SIGFPE, SIG_DFL); /* turn off FPE trapping */
- X if (term && term_init)
- X (*term_tbl[term].text)(); /* hopefully reset text mode */
- X (void) fflush(outfile);
- X (void) putc('\n',stderr);
- X longjmp(env, TRUE); /* return to prompt */
- }
- X
- X
- main(argc, argv)
- X int argc;
- X char **argv;
- {
- /* Register the Borland Graphics Interface drivers. If they have been */
- /* included by the linker. */
- X
- #ifdef __TURBOC__
- registerfarbgidriver(EGAVGA_driver_far);
- registerfarbgidriver(CGA_driver_far);
- registerfarbgidriver(Herc_driver_far);
- registerfarbgidriver(ATT_driver_far);
- #endif
- #ifdef X11
- X { int n = X11_args(argc, argv); argv += n; argc -= n; }
- #endif
- X
- #ifdef apollo
- X apollo_pfm_catch();
- #endif
- X
- X setbuf(stderr,(char *)NULL);
- X outfile = stdout;
- X (void) complex(&udv_pi.udv_value, Pi, 0.0);
- X
- X interactive = FALSE;
- X init_terminal(); /* can set term type if it likes */
- X
- #ifdef AMIGA_LC_5_1
- X if (IsInteractive(Input()) == DOSTRUE) interactive = TRUE;
- X else interactive = FALSE;
- #else
- X interactive = isatty(fileno(stdin));
- #endif
- X if (argc > 1)
- X interactive = FALSE;
- X
- X if (interactive)
- X show_version();
- #ifdef vms /* initialise screen management routines for command recall */
- X if (status[1] = smg$create_virtual_keyboard(&vms_vkid) != SS$_NORMAL)
- X done(status[1]);
- #endif
- X
- X if (!setjmp(env)) {
- X /* first time */
- X interrupt_setup();
- X load_rcfile();
- X
- X if (interactive && term != 0) /* not unknown */
- X fprintf(stderr, "\nTerminal type set to '%s'\n",
- X term_tbl[term].name);
- X } else {
- X /* come back here from int_error() */
- X load_file_error(); /* if we were in load_file(), cleanup */
- #ifdef vms
- X /* after catching interrupt */
- SHAR_EOF
- true || echo 'restore of gnuplot/plot.c failed'
- fi
- echo 'End of part 22'
- echo 'File gnuplot/plot.c is continued in part 23'
- echo 23 > _shar_seq_.tmp
- exit 0
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-