gnuplot.shar.02
John Campbell
jdc at naucse.UUCP
Tue Sep 5 02:38:50 AEST 1989
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 2 (of 7)."
# Contents: ./corgraph.asm ./docs/hlp2ms.c ./docs/termdrvr.doc
# ./eval.c ./help/README ./help/global.h ./help/help.1
# ./help/input_choice.c ./help/scan_topics.c ./iris4d.trm
# ./makefile.3b1 ./makefile.unx ./pcgraph.asm ./plot.c
# ./postscpt.trm ./regis.trm
# Wrapped by jdc at naucse on Mon Sep 4 09:22:31 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f './corgraph.asm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./corgraph.asm'\"
else
echo shar: Extracting \"'./corgraph.asm'\" \(2272 characters\)
sed "s/^X//" >'./corgraph.asm' <<'END_OF_FILE'
XTITLE Corona graphics module
X; Colin Kelley
X; January 1987
X
Xinclude header.mac
X
Xif1
Xinclude lineproc.mac
Xendif
X
X
X_text segment
X
Xpublic _GrInit,_GrReset,_GrOnly,_TxOnly,_GrandTx,_Cor_line,_Cor_mask
X
Xcorpixel proc near
X ror word ptr linemask,1
X jc cont
X ret
Xcont: push bp
X mov bp,sp
X push ax
X push bx
X push cx
X mov es,ScSeg
X shl bx,1 ; y
X mov bx,word ptr LookUp[bx] ; bx has y mem address
X mov cl,al ; x
X and cl,7
X shr ax,1
X shr ax,1
X shr ax,1 ; ax /= 8
X add bx,ax
X mov al,1
X shl al,cl ; al contains bit mask
X or byte ptr es:[bx],al
X pop cx
X pop bx
X pop ax
X pop bp
X ret
X
Xlineproc _Cor_line, corpixel
X
Xbeginproc _GrInit
X push bp
X mov bp,sp
X push di
X mov ax, [bp+X] ; screen number (0 - 7)
X mov cl,11
X shl ax,cl ; multiply by 2048 to get segment
X mov ScSeg,ax ; save segment for later
X push ax
X mov es, ax
X xor ax,ax
X mov di,ax
X mov cx, 4000h
X cld
X rep stosw
X pop cx
X call near ptr GrAddr
X mov ax,es
X pop di
X pop bp
X ret
X_GrInit endp
X
Xbeginproc _GrReset
X mov cx, 0
X call near ptr GrAddr
X ret
X_GrReset endp
X
XGrAddr proc near
X mov dx,3b4h ; address of 6845
X mov al,0ch ; register 12
X out dx,al
X inc dx
X mov al,ch ; Graphics Segment High
X out dx,al
X dec dx
X mov al,0dh ; register 13
X out dx,al
X mov al,cl ; Graphics Segment Low
X inc dx
X out dx,al
X ret
XGrAddr endp
X
Xbeginproc _GrOnly
X mov dx,3b8h
X mov al,0a0h
X out dx,al
X ret
X_GrOnly endp
X
Xbeginproc _TxOnly
X mov dx,3b8h
X mov al,28h
X out dx,al
X ret
X_TxOnly endp
X
Xbeginproc _GrandTx
X mov dx,3b8h
X mov al,0a8h
X out dx,al
X ret
X_GrandTx endp
X
Xbeginproc _Cor_mask
X push bp
X mov bp,sp
X mov ax,[bp+x] ; mask
X mov linemask,ax
X pop bp
X ret
X_Cor_mask endp
X
Xcorpixel endp
X
X_text ends
X
X
X_data segment
Xlinemask dw -1
XScSeg dw 0
X_data ends
X
Xconst segment
X
XK equ 1024
X
Xmem_mac MACRO x
X dw x,2*K+x,4*K+x,6*K+x,8*K+x,10*K+x,12*K+x,14*K+x,16*K+x
X dw 18*K+x,20*K+x,22*K+x,24*K+x
X ENDM
XLookUp equ $
X mem_mac 0
X mem_mac 80
X mem_mac (80*2)
X mem_mac (80*3)
X mem_mac (80*4)
X mem_mac (80*5)
X mem_mac (80*6)
X mem_mac (80*7)
X mem_mac (80*8)
X mem_mac (80*9)
X mem_mac (80*10)
X mem_mac (80*11)
X mem_mac (80*12)
X mem_mac (80*13)
X mem_mac (80*14)
X mem_mac (80*15)
X mem_mac (80*16)
X mem_mac (80*17)
X mem_mac (80*18)
X mem_mac (80*19)
X mem_mac (80*20)
X mem_mac (80*21)
X mem_mac (80*22)
X mem_mac (80*23)
X mem_mac (80*24)
X
Xconst ends
X
X end
END_OF_FILE
if test 2272 -ne `wc -c <'./corgraph.asm'`; then
echo shar: \"'./corgraph.asm'\" unpacked with wrong size!
fi
# end of './corgraph.asm'
fi
if test -f './docs/hlp2ms.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./docs/hlp2ms.c'\"
else
echo shar: Extracting \"'./docs/hlp2ms.c'\" \(2140 characters\)
sed "s/^X//" >'./docs/hlp2ms.c' <<'END_OF_FILE'
X/*
X * hlp2ms.c -- program to convert VMS .HLP format to *roff -ms document
X * Thomas Williams
X *
X * usage: hlp2ms < file.hlp > file.ms
X *
X * where file.hlp is a VMS .HLP file, and file.ms will be a [nt]roff
X * document suitable for printing with nroff -ms or troff -ms
X *
X * typical usage for GNUPLOT:
X *
X * vmshelp.csh /usr/help/gnuplot/* | hlp2ms | troff -ms
X */
X
X#include <stdio.h>
X#include <ctype.h>
X
X#define MAX_NAME_LEN 256
X#define MAX_LINE_LEN 256
X#define LINE_SKIP 3
X
X
Xmain()
X{
X init(stdout);
X convert(stdin,stdout);
X finish(stdout);
X exit(0);
X}
X
X
Xinit(b)
XFILE *b;
X{
X /* in nroff, increase line length by 8 and don't adjust lines */
X (void) fputs(".if n \\{.nr LL +8m\n.na \\}\n",b);
X (void) fputs(".nr PO +0.3i\n",b);
X (void) fputs(".so titlepage\n",b);
X (void) fputs(".pn 1\n",b);
X (void) fputs(".ds CH GNUPLOT\n",b);
X (void) fputs(".ds RH Page %\n",b);
X (void) fputs(".bp\n",b);
X (void) fputs(".nr PS 12\n",b);
X (void) fputs(".nr VS 13\n",b);
X (void) fputs(".ta 1.5i 3.0i 4.5i 6.0i 7.5i\n",b);
X (void) fputs("\\&\n.sp 3\n.PP\n",b);
X (void) fputs(".so intro\n",b);
X}
X
X
Xconvert(a,b)
XFILE *a,*b;
X{
Xstatic char string[MAX_LINE_LEN],line[MAX_LINE_LEN];
Xint old = 1;
Xint sh_i, i;
X
X while (fgets(line,MAX_LINE_LEN,a)) {
X
X if (isdigit(line[0])) {
X (void) sscanf(line,"%d %[^\n]s",&sh_i,string);
X
X (void) fprintf(b,".sp %d\n",(sh_i == 1) ? LINE_SKIP : LINE_SKIP-1);
X
X if (sh_i > old) {
X do
X (void) fputs(".RS\n.IP\n",b);
X while (++old < sh_i);
X }
X else if (sh_i < old) {
X do
X (void) fputs(".RE\n.br\n",b);
X while (--old > sh_i);
X }
X
X (void) fprintf(b,".NH %d\n%s\n.sp 1\n.LP\n",sh_i,string);
X old = sh_i;
X
X (void) fputs(".XS\n",b);
X (void) fputs(string,b);
X (void) fputs("\n.XE\n",b);
X
X } else {
X switch (line[1]) {
X case ' ' : fputs(".br\n",b); fputs(line+1,b); fputs(".br\n",b);
X break;
X case '\'': fputs("\\&",b);
X default : (void) fputs(line+1,b);
X }
X }
X
X }
X}
X
X
Xfinish(b) /* spit out table of contents */
XFILE *b;
X{
X (void) fputs(".pn 1\n",b);
X (void) fputs(".ds RH %\n",b);
X (void) fputs(".af % i\n",b);
X (void) fputs(".bp\n.PX\n",b);
X}
END_OF_FILE
if test 2140 -ne `wc -c <'./docs/hlp2ms.c'`; then
echo shar: \"'./docs/hlp2ms.c'\" unpacked with wrong size!
fi
# end of './docs/hlp2ms.c'
fi
if test -f './docs/termdrvr.doc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./docs/termdrvr.doc'\"
else
echo shar: Extracting \"'./docs/termdrvr.doc'\" \(2024 characters\)
sed "s/^X//" >'./docs/termdrvr.doc' <<'END_OF_FILE'
XHere's a brief description of what each term.c procedure does:
X
X_init() Called once, when the device is first selected. This procedure
Xshould set up things that only need to be set once, like handshaking and
Xcharacter sets etc...
X
X_graphics() Called just before a plot is going to be displayed. This
Xprocedure should set the device into graphics mode. Devices which can't
Xbe used as terminals (like plotters) will probably be in graphics mode always
Xand therefore won't need this.
X
X_text() Called after a plot is displayed. This procedure should set the
Xdevice back into text mode if it is also a terminal, so that commands can
Xbe seen as they're typed. Again, this will probably do nothing if the
Xdevice can't be used as a terminal.
X
X_linetype(lt) Called to set the line type before text is displayed or line(s)
Xplotted. This procedure should select a pen color or line style if the
Xdevice has these capabilities. lt is an integer from -2 to 8. An lt of
X-2 is used for the border of the plot. An lt of -1 is used for the X and Y
Xaxes. lt 0 through 8 are used for plots 0 through 8.
X
X_move(x,y) Called at the start of a line. The cursor should move to the
X(x,y) position without drawing.
X
X_vector(x,y) Called when a line is to be drawn. This should display a line
Xfrom the last (x,y) position given by _move() or _vector() to this new (x,y)
Xposition.
X
X_ulput_text(row,str) Called to display text in the upper-left corner of
Xthe screen/page. row is an integer from 0 through 8. The row starts
Xat the upper-left with 0 and proceed down. str is the string to be displayed.
X
X_lrput_text(row,str) Called to display text in the lower-right corner of
Xthe screen/page. This is the same as ulput_text(), except that the string
Xshould be displayed right-justified in the lower right corner of the screen.
XThe row starts at the lower-right with 0 and proceeds up.
X
X_reset() Called when Gnuplot is exited. This procedure should reset the
Xdevice, possibly flushing a buffer somewhere or generating a form feed.
END_OF_FILE
if test 2024 -ne `wc -c <'./docs/termdrvr.doc'`; then
echo shar: \"'./docs/termdrvr.doc'\" unpacked with wrong size!
fi
# end of './docs/termdrvr.doc'
fi
if test -f './eval.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./eval.c'\"
else
echo shar: Extracting \"'./eval.c'\" \(3101 characters\)
sed "s/^X//" >'./eval.c' <<'END_OF_FILE'
X/*
X *
X * G N U P L O T -- eval.c
X *
X * Copyright (C) 1986, 1987 Colin Kelley, Thomas Williams
X *
X * You may use this code as you wish if credit is given and this message
X * is retained.
X *
X * Please e-mail any useful additions to vu-vlsi!plot so they may be
X * included in later releases.
X *
X * This file should be edited with 4-column tabs! (:set ts=4 sw=4 in vi)
X */
X
X#include <stdio.h>
X#include "plot.h"
X
Xchar *malloc();
X
Xextern int c_token;
Xextern struct ft_entry ft[];
Xextern struct udvt_entry *first_udv;
Xextern struct udft_entry *first_udf;
Xextern struct at_type at;
Xextern struct lexical_unit token[];
X
Xstruct value *integer();
X
X
X
Xstruct udvt_entry *
Xadd_udv(t_num) /* find or add value and return pointer */
Xint t_num;
X{
Xregister struct udvt_entry **udv_ptr = &first_udv;
X
X /* check if it's already in the table... */
X
X while (*udv_ptr) {
X if (equals(t_num,(*udv_ptr)->udv_name))
X return(*udv_ptr);
X udv_ptr = &((*udv_ptr)->next_udv);
X }
X
X if (!(*udv_ptr = (struct udvt_entry *)
X malloc((unsigned int)sizeof(struct udvt_entry))))
X int_error("not enought memory for value",t_num);
X (*udv_ptr)->next_udv = NULL;
X copy_str((*udv_ptr)->udv_name,t_num);
X (*udv_ptr)->udv_value.type = INT; /* not necessary, but safe! */
X (*udv_ptr)->udv_undef = TRUE;
X return(*udv_ptr);
X}
X
X
Xstruct udft_entry *
Xadd_udf(t_num) /* find or add function and return pointer */
Xint t_num; /* index to token[] */
X{
Xregister struct udft_entry **udf_ptr = &first_udf;
X
X while (*udf_ptr) {
X if (equals(t_num,(*udf_ptr)->udf_name))
X return(*udf_ptr);
X udf_ptr = &((*udf_ptr)->next_udf);
X }
X if (!(*udf_ptr = (struct udft_entry *)
X malloc((unsigned int)sizeof(struct udft_entry))))
X int_error("not enought memory for function",t_num);
X (*udf_ptr)->next_udf = (struct udft_entry *) NULL;
X (*udf_ptr)->definition = NULL;
X (*udf_ptr)->at = NULL;
X copy_str((*udf_ptr)->udf_name,t_num);
X (void) integer(&((*udf_ptr)->dummy_value), 0);
X return(*udf_ptr);
X}
X
X
Xunion argument *
Xadd_action(sf_index)
Xenum operators sf_index; /* index of p-code function */
X{
X if (at.a_count >= MAX_AT_LEN)
X int_error("action table overflow",NO_CARET);
X at.actions[at.a_count].index = sf_index;
X return(&(at.actions[at.a_count++].arg));
X}
X
X
Xint standard(t_num) /* return standard function index or 0 */
X{
Xregister int i;
X for (i = (int)SF_START; ft[i].f_name != NULL; i++) {
X if (equals(t_num,ft[i].f_name))
X return(i);
X }
X return(0);
X}
X
X
X
Xexecute_at(at_ptr)
Xstruct at_type *at_ptr;
X{
Xregister int i,index,count,offset;
X
X count = at_ptr->a_count;
X for (i = 0; i < count;) {
X index = (int)at_ptr->actions[i].index;
X offset = (*ft[index].func)(&(at_ptr->actions[i].arg));
X if (is_jump(index))
X i += offset;
X else
X i++;
X }
X}
X
X/*
X
X 'ft' is a table containing C functions within this program.
X
X An 'action_table' contains pointers to these functions and arguments to be
X passed to them.
X
X at_ptr is a pointer to the action table which must be executed (evaluated)
X
X so the iterated line exectues the function indexed by the at_ptr and
X passes the address of the argument which is pointed to by the arg_ptr
X
X*/
END_OF_FILE
if test 3101 -ne `wc -c <'./eval.c'`; then
echo shar: \"'./eval.c'\" unpacked with wrong size!
fi
# end of './eval.c'
fi
if test -f './help/README' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./help/README'\"
else
echo shar: Extracting \"'./help/README'\" \(4091 characters\)
sed "s/^X//" >'./help/README' <<'END_OF_FILE'
XHello,
X
XThis is the first distribution of any sort out of me. This program,
XI believe, will find genuine use on almost all machines, versions of
XUN*X, and environments. This system implements a VMS-like help facility
Xfor any and all commands, procedures, etc.
X
XI hereby release this code into the public domain. Please don't remove
Xthe file headers that have my name in them, and don't make profit with
Xthis system. Rather, customize it to your own local uses and
X
X TEACH PEOPLE UN*X WITH THIS SYSTEM!!!
X
XThis later goal is by FAR more important to me than some stupid copyright
Xnotice that could be deleted by anyone anyway. Also, I will not be libel
Xfor any damages done to your system, period. AS IS WHERE IS is the motto.
X
XThis system is NOT intended to replace "man(1)" but rather to supplement
Xthe information in the manual pages to first time users. For instance,
Xhere at OSU, we use this system on the undergraduate machine to try and
Xguide the freshman through the gore of printing, editors, etc. rather
Xthan having a professor do it. Also, most of the more often used
Xcommands have their manual pages ripped up and stuffed into this format
Xto aid the student (you must admit that "help" is a more natural thing
Xto type when in need as a first time UN*X user than is "man").
X
XBecause we have 43 hosts here in the Computer and Information Sciences
Xdepartment, all running some flavor of UN*X, a LARGE amount of time
Xwas taken to make this as simple and portable as possible. Therefore,
X"curses(3)" was not used (not all systems support it in the same way
Xor even have it in a few cases). Also things like ISAM were not used
X(portability problems). This implies that this package does not have
Xthe 'spiffyness' that some of you may be looking for.
X
XIn short, this is not going to impress the boss, code-wise. Rather, the
Xcontent of the help directorys (the actual text of the various help
Xmessages) are what should be devoted a fair amount of time. This is also
Xwhere this system shines. True flexibility is achieved by the "DIR" files
Xwithin this system. They allow you to setup acronyms for traversing the
Xdirectory tree of "TEXT" files. This allows you to have help topics like
X"printing a file" or "using the printer in the basement" both point to
Xthe help screen on using the "lp" command. This file also allows SYS5
Xsites to use any length 'help file' name and still map it into the small
Xfile name SYS5 allows you (14 characters?).
X
XHidden aliases can also be used. This allows you to also have such things
Xas "lp" be a 'help topic' as in the previous paragraph. This makes the
Xsystem less painful for those who really do know UN*X, but have forgotten
Xone simple flag on "_XXXX_".
X
XThese are the instructions to compile "help(L)":
X
X1. Edit the file "global.h" and change the #define's
X for ROOTDIR, HELPFILE, and DIRFILE to be locally
X acceptable.
X
X2. Edit the file "Makefile" and fix the definitions of BIN, HELPDIR,
X HELPOWN, and HELPGRP so that "make install" will work.
X
X3. Type "make all".
X
X4. IF the make completes, play around with it for a while
X and make sure it works...
X
X5. Type "make install". This will install a copy of our help
X files, complete with typo's & bad grammar. Most of the
X files were typed in by various volunteers here within
X the university. You may want to look at them as an
X example, you may want to delete them, who knows...
X
XI bet you think you are done... HA! HA! HA! That's a computer joke!
XYou are just barely beginning. Now comes the fun part. :-)
X
X6. Type "cd <ROOTDIR>".
X
X7. Start making your "./TEXT" and "./DIR" files. The examples
X in this shell archive should prove adequate for examples.
X For a subtopic, type "mkdir <subtopic>" and then
X "cd <subtopic>" and goto step 7.
X
XIf you have any questions or further enhancements (or help subtrees :-),
Xplease e-mail them to me. I really would like to hear how this thing
Xfairs in the big wide world...
X
XRoland Stolfa
XComputing and Information Sciences Department
XOklahoma State University
X219 Math Sciences Building
XStillwater OK 74078
X
Xrjs at a.cs.okstate.edu
END_OF_FILE
if test 4091 -ne `wc -c <'./help/README'`; then
echo shar: \"'./help/README'\" unpacked with wrong size!
fi
# end of './help/README'
fi
if test -f './help/global.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./help/global.h'\"
else
echo shar: Extracting \"'./help/global.h'\" \(2295 characters\)
sed "s/^X//" >'./help/global.h' <<'END_OF_FILE'
X/*
X * Program : help
X * Module : global.h
X * Programmer : R. Stolfa
X *
X * Modification History:
X * 08/27/87 Created
X * 07/13/88 Cleaned up for distribution
X */
X
X#include <stdio.h>
X#ifdef __TURBOC__
X#include <stdlib.h>
X#endif
X#include <signal.h>
X#include <ctype.h>
X#undef toupper /* to get the non-macro version */
X
X#define TRUE 1
X#define FALSE 0
X#define UP 2
X
X#define BSIZE 80
X
X#define PRINT 0
X#define ACRON 1
X#define TOPIC 2
X
X/*
X * ROOTDIR is the anchor point for the help tree. It should be a
X * publically accessable directory, with all it's submembers being
X * readable and executable by all.
X */
X#define ROOTDIR "/usr/local/help"
X
X/*
X * HELPFILE is the basename of the file that will contain the
X * text of the actual help information. It should have
X * permissions 444.
X */
X#define HELPFILE "/TEXT"
X
X/*
X * DIRFILE is the basename of a file that contains the help
X * index to file name mappings for the current level of the
X * help tree. The format of the data contained in this file
X * is as follows....
X *
X * <basename><print_flag><help_index_string>
X *
X * where:
X * <basename> relative directory name for help
X * <print_flag> is a:
X * * for printable
X * : for acronym
X * <help_index_string>
X * text to present as a choice (or use as an
X * acronym) at any level in the help tree
X */
X#define DIRFILE "/DIR"
X
X/*
X * LIST structure.
X *
X * This is the standard format of help file lists.
X */
Xstruct LIST {
X char base[BSIZE];
X char topic[BSIZE];
X char cmd[BSIZE];
X struct LIST *prev;
X};
X#define prt_list (_list[PRINT])
X#define acr_list (_list[ACRON])
X#define top_list (_list[TOPIC])
X
X/*------------------------------------------------------------*/
X
X/*
X * MACROS
X */
X
X#define gen_path(x) sprintf (Path, "%s%s%s", Root_Dir, cur_path, (x))
X
X/*------------------------------------------------------------*/
X
X/*
X * Variables
X */
X
X#ifdef MAIN
X#define extern /* global */
X#endif
X
Xextern struct LIST *_list[3]; /* list of printable topics */
Xextern char Path[BSIZE], /* true path to help file */
X cur_path[BSIZE];/* curent help path */
Xextern int lines; /* number of lines on the screen */
X#ifdef __TURBOC__
X void catch(); /* interrupt handler */
X#else
X int catch();
X#endif
Xextern char Root_Dir[BSIZE];/* location of root directory */
END_OF_FILE
if test 2295 -ne `wc -c <'./help/global.h'`; then
echo shar: \"'./help/global.h'\" unpacked with wrong size!
fi
# end of './help/global.h'
fi
if test -f './help/help.1' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./help/help.1'\"
else
echo shar: Extracting \"'./help/help.1'\" \(2516 characters\)
sed "s/^X//" >'./help/help.1' <<'END_OF_FILE'
X.TH HELP L
X.SH NAME
Xhelp - a VMS-like help facility for XENIX
X.SH SYNOPSIS
X.B help
X.br
X.SH DESCRIPTION
X.I help
Xis intended to be a more useful system than the native
X.I man(1)
Xsupplied with
X.I XENIX.
XIt is styled after the very popular and useful VMS HELP facility, in that
Xit is tree structured and interactive.
X.PP
X.I help
Xis very configurable. In essence, you decide what help "topics" map
Xto what files. I.E. you can have more than one topic, or acronym, map
Xto the same help subtopic. An example would be having the words "lp"
Xand "printing" both map to the
X.I help
Xsubtopic "lp-command". Also, you need not have the subtopic "lp" even
Xshow up in the help screen. If you wish to have acronyms, as described
Xabove, it is site taylorable using the DIRFILE (as described below in
XINTERNALS).
X.PP
XAll of the files and directories contained in the system are all plain
Xtext files, with an easy format that can be used to your advantage.
X.sp 1
X.SH "INTERNALS"
X.I help
Xuses a tree structured file data-base to store all help. Each node (or
Xdirectory) has at least one file. This file, called
X.I ./TEXT
Xcontains the actual text of the help message for this subtopic. If there
Xare any subtopics below this one, their
X.I ./TEXT
Xfiles are held in subdirectories of this one, and then there is a file
X.I ./DIR
Xthat maps the directory name to the subtopic to display. This will allow
X.I SYSV
Xsystems with limited directory name lengths map much longer descriptions
Xto shorter file names.
X.PP
XAlso contained in the
X.I ./DIR
Xfile is a similar mapping for acronyms of the subsequent subtopics. In the
Xexample above with lp, a sample portion of a help file would be
X.sp 1
X lp-command*lp
X.br
X lp-command:printing
X.br
X lp-command:getting output
X.sp 1
XWhere the "*" in the first line implies that the "topic" name "lp" is to
Xbe printed as a possible topic for help, and the subtopics "printing" and
X"getting output" are acronyms for traversing the to the "lp-command"
Xsubdirectory to get at the next
X.I ./TEXT
Xfile.
X.sp 1
X.SH "FILES"
X"/usr/help/...." - Root directory for help
X.br
X"./TEXT" - Help text
X.br
X"./DIR" - Directory files for next subtopic
X.PP
X.SH DIAGNOSTICS
XThere are no real diagnostics. However, if you reach a point in the
Xhelp system where you know you have a "subtopic" but cannot reach it,
Xsearch for correct premissions (0444 for
X.I ./TEXT
Xfiles, and (0555 for
X.I ./DIR
Xfiles).
X.sp 1
X.SH AUTHOR
XRoland J. Stolfa
X.br
XDepartment of Computing and Information Sciences
X.br
XOklahoma State University
X
END_OF_FILE
if test 2516 -ne `wc -c <'./help/help.1'`; then
echo shar: \"'./help/help.1'\" unpacked with wrong size!
fi
# end of './help/help.1'
fi
if test -f './help/input_choice.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./help/input_choice.c'\"
else
echo shar: Extracting \"'./help/input_choice.c'\" \(2709 characters\)
sed "s/^X//" >'./help/input_choice.c' <<'END_OF_FILE'
X/*
X * Program : help
X * Module : input_choice.c
X * Programmer : R. Stolfa
X *
X * Purpose : To selectively change the current help subject
X * based on what topic the user chooses to learn
X * about next.
X *
X * Modification History:
X * 08/26/87 Created
X */
X
X#include "global.h"
X
Xinput_choice ()
X{
X int done, /* need to parse DIRFILE again */
X i, /* temp */
X j, /* temp */
X count, /* num. of acronym topics that mached */
X topics; /* num. of topics at this level */
X char buff[BSIZE], /* input buffer */
X tmp_path[BSIZE]; /* holding place for cur_path */
X struct LIST *p; /* temp */
X
X done = FALSE;
X do {
X present ("HELP ", " > ");
X
X if (fgets (buff, BSIZE, stdin) == NULL)
X /*
X * End help on EOF
X */
X return (TRUE);
X
X /*
X * Strip junk out of line
X */
X for (i = 0, j = 0; i < strlen(buff); i ++) {
X if (buff[i] == '\n')
X buff[i] = '\0';
X if (!isspace(buff[i]))
X buff[j++] = toupper(buff[i]);
X }
X
X if (strlen(buff) == 0) {
X /*
X * At this point, we have a request to recurse
X * back out of the help tree by one level.
X */
X for (i = strlen (cur_path); cur_path[i] != '/'; --i)
X ;
X cur_path[i] = '\0';
X return (UP);
X /* NOT REACHED */
X }
X
X /*
X * OK. We have the topic that the user has requested.
X * Now let's try to find some reference to it
X */
X count = 0;
X topics = 0;
X free_list (TOPIC);
X for (p = acr_list; p != NULL ; p = p->prev) {
X if (strncmp (buff, p->topic, strlen(buff)) == 0) {
X insert (TOPIC,
X p->base, p->topic, p->cmd);
X count ++;
X }
X topics ++;
X }
X
X if (count == 0) {
X if (strcmp (buff, "?") != 0) {
X present ("Sorry, no documentation on ", " ");
X printf ("%s\n", buff);
X }
X if (topics > 0) {
X printf ("Additional information available:\n");
X lines = 2;
X format_help();
X }
X done = FALSE;
X } else if (count == 1) {
X if (top_list->cmd[0] == '\0') {
X /*
X * We have only one help subtopic, so traverse
X * the tree down that link.
X */
X sprintf (cur_path, "%s/%s", cur_path,
X top_list->base);
X done = TRUE;
X }
X else {
X system(top_list->cmd);
X return (UP);
X }
X } else {
X /*
X * We have several matches. Therefore, page the
X * HELPFILE for each to the screen and stay where
X * we are.
X */
X lines = 0;
X strcpy (tmp_path, cur_path);
X for (p = top_list; p != NULL ; p = p->prev) {
X if (p->cmd[0] == '\0') {
X sprintf (cur_path, "%s/%s", tmp_path,
X p->base);
X gen_path(HELPFILE);
X help();
X strcpy (cur_path, tmp_path);
X }
X }
X }
X
X } while (done != TRUE);
X return (FALSE);
X}
END_OF_FILE
if test 2709 -ne `wc -c <'./help/input_choice.c'`; then
echo shar: \"'./help/input_choice.c'\" unpacked with wrong size!
fi
# end of './help/input_choice.c'
fi
if test -f './help/scan_topics.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./help/scan_topics.c'\"
else
echo shar: Extracting \"'./help/scan_topics.c'\" \(2536 characters\)
sed "s/^X//" >'./help/scan_topics.c' <<'END_OF_FILE'
X/*
X * Program : help
X * Module : scan_topics.c
X * Programmer : R. Stolfa
X *
X * Purpose : To scan the current directory for all "topic"
X * directories in the DIRFILE file.
X *
X * Modification History:
X * 08/26/87 Created
X * 08/31/87 Changed input routine to change spaces in the topic
X * field to be underscores.
X */
X
X#include "global.h"
X
Xscan_topics ()
X{
X FILE *fd; /* DIRFILE descriptor */
X int i,j,k, /* temp */
X cmd, /* directed to man page? */
X count; /* is there any help? */
X char buff[BSIZE], /* for reading DIRFILE */
X help_topic[BSIZE], /* used to parse DIRFILE lines */
X base_path[BSIZE], /* used to parse DIRFILE lines */
X cmd_buf[BSIZE], /* used to parse DIRFILE lines */
X prt_flag; /* used to parse DIRFILE lines */
X
X count = 0;
X gen_path(DIRFILE);
X
X if ((fd = fopen (Path, "r")) == NULL) {
X printf ("There are no subtopics for this area.\n");
X return;
X }
X
X /*
X * Here we need to read in the lines in DIRFILE
X * that are of the format
X * <basename><print_flag><help_topic_string>
X * and capitalize the <help_topic_string>.
X *
X * if <print_flag> is a "*" then the <help_topic_string> is
X * for viewing.
X *
X * if <print_flag> is a ":" then it is an acronym for lookups.
X *
X * if find "!" before <print_flag> then there's a command.
X */
X
X while (fgets (buff, BSIZE, fd) != NULL) {
X
X cmd = 0;
X k = j = 0;
X for (i = 0;
X i < strlen(buff) && buff[i] != ':' && buff[i] != '*';
X i ++) {
X if (buff[i] == '!')
X ++cmd;
X else if (!cmd)
X base_path[j++] = buff[i];
X else
X cmd_buf[k++] = buff[i];
X }
X base_path[j] = '\0';
X cmd_buf[k] = '\0';
X
X if (i < strlen (buff))
X prt_flag = buff[i];
X else
X /* Bad input line */
X continue;
X
X strcpy (help_topic, &buff[i+1]);
X for (i = 0; i < strlen (help_topic); i ++) {
X help_topic[i] = toupper (help_topic[i]);
X if (help_topic[i] == ' ')
X help_topic[i] = '_';
X if (help_topic[i] == '\n')
X help_topic[i] = '\0';
X }
X
X /*
X * At this point, we have a fairly legal line,
X * so, let's finish it off...
X */
X
X if ((strlen (base_path) == 0) || (strlen (help_topic) == 0))
X continue;
X count ++;
X
X if (prt_flag == '*')
X /*
X * Append this line to the list of things to
X * output as topics
X */
X append (PRINT, base_path, help_topic, cmd_buf);
X
X /*
X * Append this line to the list of acronymns
X * for reference later...
X */
X append (ACRON, base_path, help_topic, cmd_buf);
X }
X
X fclose (fd);
X
X if (count == 0) {
X printf ("There are no subtopics for this area.\n");
X return;
X }
X}
END_OF_FILE
if test 2536 -ne `wc -c <'./help/scan_topics.c'`; then
echo shar: \"'./help/scan_topics.c'\" unpacked with wrong size!
fi
# end of './help/scan_topics.c'
fi
if test -f './iris4d.trm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./iris4d.trm'\"
else
echo shar: Extracting \"'./iris4d.trm'\" \(2282 characters\)
sed "s/^X//" >'./iris4d.trm' <<'END_OF_FILE'
X/*
XHere are the additions to GNUplot so it runs on an IRIS4D series computer.
XDon't forget to compile with -DIRIS4D and include -Zg as one of the
Xlibraries. The window that the plot goes to can be reshaped and moved, but
Xyou will have to replot the data.
X
X+----------------------------------+-----------------------------+
X|John H. Merritt | Yesterday I knew nothing, |
X|Applied Research Corporation | Today I know that. |
X|merritt at iris613.gsfc.nasa.gov | |
X+----------------------------------+-----------------------------+
X*/
X
X/* Provided by John H. Merritt (Applied Research Corporation) 7/1/89 */
X/* INTERNET: merritt at iris613.gsfc.nasa.gov */
X
X#include <gl.h>
X#define IRIS4D_XMAX 1024
X#define IRIS4D_YMAX 1024
X
X#define IRIS4D_XLAST (IRIS4D_XMAX - 1)
X#define IRIS4D_YLAST (IRIS4D_YMAX - 1)
X
X#define IRIS4D_VCHAR (IRIS4D_YMAX/30)
X#define IRIS4D_HCHAR (IRIS4D_XMAX/72)
X#define IRIS4D_VTIC (IRIS4D_YMAX/80)
X#define IRIS4D_HTIC (IRIS4D_XMAX/80)
X
XIRIS4D_init()
X{
X foreground();
X winopen("Gnuplot");
X deflinestyle(1, 0x3FFF); /* Long dash */
X deflinestyle(2, 0x5555); /* dotted */
X deflinestyle(3, 0x3333); /* short dash */
X deflinestyle(4, 0xB5AD); /* dotdashed */
X return;
X}
X
XIRIS4D_graphics()
X{
X reshapeviewport();
X ortho2((Coord)0, (Coord)IRIS4D_XMAX, (Coord)0, (Coord)IRIS4D_YMAX);
X color(WHITE);
X clear();
X
X return;
X}
X
XIRIS4D_text()
X{
X return; /* enter text from another window!!! */
X}
X
XIRIS4D_linetype(linetype)
Xint linetype;
X{
X static int pen_color[5] = {1, 2, 3, 4, 5};
X
X linetype = linetype % 5;
X color((Colorindex) pen_color[linetype]);
X setlinestyle(linetype);
X return;
X}
X
XIRIS4D_move(x, y)
Xunsigned int x, y;
X{
X move2i(x, y);
X return;
X}
X
XIRIS4D_cmove(x, y)
Xunsigned int x, y;
X{
X cmov2i(x, y);
X return;
X}
X
XIRIS4D_vector(x, y)
Xunsigned x, y;
X{
X draw2i(x, y);
X return;
X}
X
XIRIS4D_lrput_text(row, str)
Xunsigned int row;
Xchar *str;
X{
X IRIS4D_cmove(IRIS4D_XMAX - IRIS4D_HTIC - IRIS4D_HCHAR*(strlen(str)+1),
X IRIS4D_VTIC + IRIS4D_VCHAR*(row+1)) ;
X charstr(str);
X return;
X}
X
X
XIRIS4D_ulput_text(row,str)
Xunsigned int row ;
Xchar *str ;
X{
X IRIS4D_cmove(IRIS4D_HTIC, IRIS4D_YMAX - IRIS4D_VTIC - IRIS4D_VCHAR*(row+1)) ;
X charstr(str);
X return;
X}
X
XIRIS4D_reset()
X{
X return;
X}
END_OF_FILE
if test 2282 -ne `wc -c <'./iris4d.trm'`; then
echo shar: \"'./iris4d.trm'\" unpacked with wrong size!
fi
# end of './iris4d.trm'
fi
if test -f './makefile.3b1' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./makefile.3b1'\"
else
echo shar: Extracting \"'./makefile.3b1'\" \(3747 characters\)
sed "s/^X//" >'./makefile.3b1' <<'END_OF_FILE'
X# "make all" will compile all the necessary programs, gnuplot itself, the
X# help system and helptree (to make the help tree out of the flat file.)
X#
X# "make install will install all the necessary pieces to run gnuplot
X# successfully. This includes creating the help tree in /usr/local/help.
X
X# If you do not wish the destinations of the executable and manual page to
X# be at the default locations (see below), feel free to change them.
X# The location of the help system and help tree also have default values.
X# If you want them somewhere else or would like to test the whole system
X# before you run "make install", you have to set environment variables so
X# that gnuplot finds them. See README.3B1 for details.
X
X# where to install executable on 'make install'
XDEST=/usr/local/bin/gnuplot
X# where to install man page on 'make man_install'
XMANDEST=/usr/man/man1/gnuplot.1
X
X# -DFORK if you have vfork()
X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
X# -DNOCOPY if you don't have a memcpy() by any name
X# -DGAMMA if you've got gamma(3)
X# -O if you trust your compiler's optimizer
XCFLAGS = -DGAMMA -DUNIXPC -O # -gx # debug it.
X
X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
X# -DAED AED 512 and AED 767
X# -DBITGRAPH BBN BitGraph
X# -DHP26 HP2623A and maybe others
X# -DHP75 HP7580, and probably other HPs
X# -DHPLJET HP LaserJet laserprinter
X# -DPOSTSCRIPT Postscript
X# -DQMS QMS/QUIC laserprinter (Talaris 1200 and others)
X# -DREGIS ReGis graphics (vt125, vt220, vt240, Gigis...)
X# -DSELANAR Selanar
X# -DTEK Tektronix 4010, and probably others
X# -DUNIXPC unixpc (ATT 3b1 or ATT 7300)
X# -DUNIXPLOT unixplot
X# -DV384 Vectrix 384 and tandy color printer
X
XTERMFLAGS = -DUNIXPC -DUNIXPLOT
X
X
XOBJS = command.o eval.o graphics.o internal.o misc.o parse.o plot.o scanner.o\
X standard.o term.o util.o
X
X# -lplot if you have -DUNIXPLOT
XLIBS = -lm -lplot
X
X# If you do not wish to compile the help system or make the help directory
X# tree, feel free to comment out the appropriate lines that do it.
X
Xall: gnuplot help_system doc_tree
X
Xgnuplot: $(OBJS) version.o
X ld /lib/crt0s.o /lib/shlib.ifile $(OBJS) version.o $(LIBS) -o gnuplot
X
Xhelp_system:
X ( cd help ; make )
X
Xdoc_tree:
X ( cd docs ; make helptree )
X
X# note that directory /usr/local/help must exist for the help tree
X# to be created
Xinstall: gnuplot help_system doc_tree man_install
X cp gnuplot $(DEST)
X strip $(DEST)
X docs/helptree -t /usr/local/help/gnuplot < docs/gnuplot.hlp
X cd help; make install
X
Xman_install: gnuplot.1
X cp gnuplot.1 $(MANDEST)
X
Xterm.o: term.c aed.trm bitgraph.trm hp26.trm hp75.trm hpljet.trm pc.trm \
X postscpt.trm qms.trm regis.trm selanar.trm tek.trm unixpc.trm \
X unixplot.trm v384.trm
X cc $(CFLAGS) $(TERMFLAGS) -c term.c
X
X
X$(OBJS): plot.h
X
Xclean:
X rm -f *.o gnuplot
X
X ( cd help ; make clean )
X ( cd docs ; make clean )
X
Xspotless:
X rm -f *.o gnuplot Makefile help/Makefile
X
X ( cd help ; make clean -f makefile.unx )
X ( cd docs ; make clean )
X
X#
X# if you have the Rich $alz shar package, you can use this make shar section.
X#
X
Xshars: spotless shar/gnuplot.shar.1 shar/gnuplot.shar.2 shar/gnuplot.shar.3 \
X shar/gnuplot.shar.4 shar/gnuplot.shar.5 shar/gnuplot.shar.6
X
Xshar/gnuplot.shar.1: [1-9]* [A-Z]* [a-e]*
X shar -n1 -e6 [1-9]* [A-Z]* [a-e]* > shar/gnuplot.shar.1
X
Xshar/gnuplot.shar.2: [f-m]*
X shar -n2 -e6 [f-m]* > shar/gnuplot.shar.2
X
Xshar/gnuplot.shar.3: [p-s]*
X shar -n3 -e6 [p-s]* > shar/gnuplot.shar.3
X
Xshar/gnuplot.shar.4: [t-z]*
X shar -n4 -e6 [t-z]* > shar/gnuplot.shar.4
X
Xshar/gnuplot.shar.5: docs/*
X cd docs; make clean; cd ..
X shar -n5 -e6 docs docs/* > shar/gnuplot.shar.5
X
Xshar/gnuplot.shar.6: help/*
X shar -n6 -e6 help help/* > shar/gnuplot.shar.6
END_OF_FILE
if test 3747 -ne `wc -c <'./makefile.3b1'`; then
echo shar: \"'./makefile.3b1'\" unpacked with wrong size!
fi
# end of './makefile.3b1'
fi
if test -f './makefile.unx' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./makefile.unx'\"
else
echo shar: Extracting \"'./makefile.unx'\" \(3784 characters\)
sed "s/^X//" >'./makefile.unx' <<'END_OF_FILE'
X# "make all" will compile all the necessary programs, gnuplot itself, the
X# help system and helptree (to make the help tree out of the flat file.)
X#
X# "make install will install all the necessary pieces to run gnuplot
X# successfully. This includes creating the help tree in /usr/local/help.
X
X# If you do not wish the destinations of the executable and manual page to
X# be at the default locations (see below), feel free to change them.
X# The location of the help system and help tree also have default values.
X# If you want them somewhere else or would like to test the whole system
X# before you run "make install", you have to set environment variables so
X# that gnuplot finds them. See README.3B1 for details.
X
X# where to install executable on 'make install'
XDEST=/usr/local/bin/gnuplot
X# where to install man page on 'make man_install'
XMANDEST=/usr/man/man1/gnuplot.1
X
X# -DFORK if you have vfork()
X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
X# -DNOCOPY if you don't have a memcpy() by any name
X# -DGAMMA if you've got gamma(3)
X# -O if you trust your compiler's optimizer
XCFLAGS = -DVFORK -DBCOPY -DGAMMA #-gx #-O
X
X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
X# -DAED AED 512 and AED 767
X# -DBITGRAPH BBN BitGraph
X# -DHP26 HP2623A and maybe others
X# -DHP75 HP7580, and probably other HPs
X# -DHPLJET HP LaserJet laserprinter
X# -DPOSTSCRIPT Postscript
X# -DQMS QMS/QUIC laserprinter (Talaris 1200 and others)
X# -DREGIS ReGis graphics (vt125, vt220, vt240, Gigis...)
X# -DSELANAR Selanar
X# -DTEK Tektronix 4010, and probably others
X# -DUNIXPC unixpc (ATT 3b1 or ATT 7300)
X# -DUNIXPLOT unixplot
X# -DV384 Vectrix 384 and tandy color printer
X
XTERMFLAGS = -DAED -DBITGRAPH -DHP26 -DHP75 -DPOSTSCRIPT -DQMS -DREGIS -DSELANAR -DTEK -DUNIXPLOT -DV384
X
X
XOBJS = command.o eval.o graphics.o internal.o misc.o parse.o plot.o scanner.o\
X standard.o term.o util.o
X
X# -lplot if you have -DUNIXPLOT
XLIBS = -lm -lplot
X
X# If you do not wish to compile the help system or make the help directory
X# tree, feel free to comment out the appropriate lines that do it.
X
Xall: gnuplot help_system doc_tree
X
Xgnuplot: $(OBJS) version.o
X cc $(OBJS) version.o $(LIBS) -o gnuplot
X
Xhelp_system:
X ( cd help ; make )
X
Xdoc_tree:
X ( cd docs ; make helptree )
X
X# note that directory /usr/local/help must exist for the help tree
X# to be created
Xinstall: gnuplot help_system doc_tree man_install
X cp gnuplot $(DEST)
X strip $(DEST)
X docs/helptree -t /usr/local/help/gnuplot < docs/gnuplot.hlp
X cd help; make install
X
Xman_install: gnuplot.1
X cp gnuplot.1 $(MANDEST)
X
Xterm.o: term.c aed.trm bitgraph.trm hp26.trm hp75.trm hpljet.trm pc.trm \
X postscpt.trm qms.trm regis.trm selanar.trm tek.trm unixpc.trm \
X unixplot.trm v384.trm
X cc $(CFLAGS) $(TERMFLAGS) -c term.c
X
X
X$(OBJS): plot.h
X
Xclean:
X rm -f *.o gnuplot
X
X ( cd help ; make clean )
X ( cd docs ; make clean )
X
Xspotless:
X rm -f *.o gnuplot Makefile help/Makefile
X
X ( cd help ; make clean -f makefile.unx )
X ( cd docs ; make clean )
X
X#
X# if you have the Rich $alz shar package, you can use this make shar section.
X#
X
Xshars: spotless shar/gnuplot.shar.1 shar/gnuplot.shar.2 shar/gnuplot.shar.3 \
X shar/gnuplot.shar.4 shar/gnuplot.shar.5 shar/gnuplot.shar.6
X
Xshar/gnuplot.shar.1: [1-9]* [A-Z]* [a-e]*
X shar -n1 -e6 [1-9]* [A-Z]* [a-e]* > shar/gnuplot.shar.1
X
Xshar/gnuplot.shar.2: [f-m]*
X shar -n2 -e6 [f-m]* > shar/gnuplot.shar.2
X
Xshar/gnuplot.shar.3: [p-s]*
X shar -n3 -e6 [p-s]* > shar/gnuplot.shar.3
X
Xshar/gnuplot.shar.4: [t-z]*
X shar -n4 -e6 [t-z]* > shar/gnuplot.shar.4
X
Xshar/gnuplot.shar.5: docs/*
X cd docs; make clean; cd ..
X shar -n5 -e6 docs docs/* > shar/gnuplot.shar.5
X
Xshar/gnuplot.shar.6: help/*
X shar -n6 -e6 help help/* > shar/gnuplot.shar.6
END_OF_FILE
if test 3784 -ne `wc -c <'./makefile.unx'`; then
echo shar: \"'./makefile.unx'\" unpacked with wrong size!
fi
# end of './makefile.unx'
fi
if test -f './pcgraph.asm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./pcgraph.asm'\"
else
echo shar: Extracting \"'./pcgraph.asm'\" \(3165 characters\)
sed "s/^X//" >'./pcgraph.asm' <<'END_OF_FILE'
XTITLE PC graphics module
X; Colin Kelley
X; December 22, 1986
X; modified January 1987 to use LINEPROC.MAC
X
Xinclude header.mac
X
Xif1
Xinclude lineproc.mac
Xendif
X
X
X_text segment
X
X public _PC_line, _PC_color, _PC_mask, _PC_curloc, _PC_puts, _Vmode
X public _save_stack, _ss_interrupt
X extrn _interrupt:near
X
Xpcpixel proc near
X ror word ptr linemask,1
X jc cont
X ret
Xcont:
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
Xpcpixel endp
X
Xlineproc _PC_line, pcpixel
X
X_PC_color proc near
X push bp
X mov bp,sp
X mov al,[bp+X] ; color
X mov byte ptr color,al
X pop bp
X ret
X_PC_color endp
X
X_PC_mask proc near
X push bp
X mov bp,sp
X mov ax,[bp+X] ; mask
X mov word ptr linemask,ax
X pop bp
X ret
X_PC_mask endp
X
X_Vmode proc near
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
X_Vmode endp
X
X_PC_curloc proc near
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
X_PC_curloc endp
X
X;
X; thanks to watale!broehl for finding a bug here--I wasn't pushing BP
X; and reloading AH before INT 10H, which is necessary on genuine IBM
X; boards...
X;
X_PC_puts proc near
X push bp
X mov bp,sp
X push si
X mov bl,byte ptr color
X mov si,[bp+X] ; offset
X
Xifdef LARGE_DATA
X mov es,[bp+X+2] ; segment if large or compact data model
Xendif
X
Xputs2:
X
Xifdef LARGE_DATA
X mov al,es:[si]
Xelse
X mov al,[si]
Xendif
X or al,al
X jz puts3
X mov ah,0eh ; write TTY char
X int 10h
X inc si
X jmp short puts2
Xputs3: pop si
X pop bp
X ret
X_PC_puts endp
X
X
X; int kbhit();
X; for those without MSC 4.0
X; Use BIOS interrupt 16h to determine if a key is waiting in the buffer.
X; Return nonzero if so.
X;
X
Xbeginproc _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.
Xkbfin: ret
X_kbhit endp
X
X
X; _save_stack and _ss_interrupt are needed due to a bug in the MSC 4.0
X; code when run under MS-DOS 3.x. Starting with 3.0, MS-DOS automatically
X; switches to an internal stack during system calls. This leaves SS:SP
X; pointing at MS-DOS's stack when the ^C interrupt (INT 23H) is triggered.
X; MSC should restore its own stack before calling the user signal() routine,
X; but it doesn't.
X;
X; Presumably this code will be unnecessary in later releases of the compiler.
X;
X
X; _save_stack saves the current SS:SP to be loaded later by _ss_interrupt.
X;
X
Xbeginproc _save_stack
X mov ax,ss
X mov cs:save_ss,ax
X mov ax,sp
X mov cs:save_sp,ax
X ret
X_save_stack endp
X
X
X; _ss_interrupt is called on ^C (INT 23H). It restores SS:SP as saved in
X; _save_stack and then jumps to the C routine interrupt().
X;
Xbeginproc _ss_interrupt
X cli ; no interrupts while the stack is changed!
X mov ax,-1 ; self-modifying code again
Xsave_ss equ this word - 2
X mov ss,ax
X mov sp,-1 ; here too
Xsave_sp equ this word - 2
X sti
X jmp _interrupt ; now it's safe to call the real routine
X_ss_interrupt endp
X
X
X_text ends
X
X
Xconst segment
Xlinemask dw -1
Xcolor db 1
Xconst ends
X
X end
END_OF_FILE
if test 3165 -ne `wc -c <'./pcgraph.asm'`; then
echo shar: \"'./pcgraph.asm'\" unpacked with wrong size!
fi
# end of './pcgraph.asm'
fi
if test -f './plot.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./plot.c'\"
else
echo shar: Extracting \"'./plot.c'\" \(5472 characters\)
sed "s/^X//" >'./plot.c' <<'END_OF_FILE'
X/*
X *
X * G N U P L O T -- plot.c
X *
X * Copyright (C) 1986, 1987 Thomas Williams, Colin Kelley
X *
X * You may use this code as you wish if credit is given and this message
X * is retained.
X *
X * Please e-mail any useful additions to vu-vlsi!plot so they may be
X * included in later releases.
X *
X * This file should be edited with 4-column tabs! (:set ts=4 sw=4 in vi)
X *
X * The Turbo C code was supplied by William E Wilson, 1988-1989
X *
X */
X
X#include <stdio.h>
X#include <setjmp.h>
X#include <signal.h>
X#include "plot.h"
X
X/* on some compilers (Turbo C) interrupt is a reserved word */
X#ifdef MSDOS
X#define interrupt intrrtn /*something different*/
X#endif
X
Xchar *getenv(),*strcat(),*strcpy(),*strncpy();
X
Xextern char input_line[];
Xextern FILE *outfile;
Xextern int term;
Xextern struct termentry term_tbl[];
X
X#ifndef STDOUT
X#define STDOUT 1
X#endif
X
Xjmp_buf env;
X
Xstruct value *integer(),*complex();
X
X
Xextern f_push(),f_pushc(),f_pushd(),f_call(),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
Xextern 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(),
X#ifdef GAMMA
X f_gamma(),
X#endif
X f_floor(),f_ceil();
X
X
Xstruct ft_entry ft[] = { /* built-in function table */
X
X/* internal functions: */
X {"push", f_push}, {"pushc", f_pushc}, {"pushd", f_pushd},
X {"call", f_call}, {"lnot", f_lnot}, {"bnot", f_bnot},
X {"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
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},
X#ifdef GAMMA
X {"gamma", f_gamma},
X#endif
X {"floor", f_floor}, {"ceil", f_ceil},
X {NULL, NULL}
X};
X
Xstatic struct udvt_entry udv_pi = {NULL, "pi",FALSE};
X/* first in linked list */
Xstruct udvt_entry *first_udv = &udv_pi;
Xstruct udft_entry *first_udf = NULL;
X
X
X
X#ifdef vms
X
X#define HOME "sys$login:"
X
X#else /* vms */
X#ifdef MSDOS
X
X#define HOME "GNUPLOT"
X
X#else /* MSDOS */
X
X#define HOME "HOME"
X
X#endif /* MSDOS */
X#endif /* vms */
X
X#ifdef unix
X#define PLOTRC ".gnuplot"
X#else
X#define PLOTRC "gnuplot.ini"
X#endif
X
X
X#ifdef __TURBOC__
Xvoid interrupt()
X#else
Xinterrupt()
X#endif
X{
X#ifdef MSDOS
X#ifdef __TURBOC__
X (void) signal(SIGINT, interrupt);
X#else
X void ss_interrupt();
X (void) signal(SIGINT, ss_interrupt);
X#endif
X#else
X (void) signal(SIGINT, interrupt);
X#endif
X (void) signal(SIGFPE, SIG_DFL); /* turn off FPE trapping */
X if (term)
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
X
Xmain()
X{
Xregister FILE *plotrc;
Xregister char *gnuterm=NULL;
Xstatic char home[sizeof(PLOTRC)+80];
X
X setbuf(stderr,(char *)NULL);
X#ifdef VMS
X outfile = stdout; /* never close stdout--even if duped. */
X#else
X outfile = fdopen(dup(STDOUT),"w");
X#endif
X (void) complex(&udv_pi.udv_value, Pi, 0.0);
X show_version();
X init(); /* Can set term if it wishes. */
X
X/* thanks to osupyr!alden (Dave Alden) for the GNUTERM code */
X
X if (!(gnuterm = getenv("GNUTERM")) && term == 0)
X gnuterm = TERM;
X if (gnuterm != NULL)
X (void) strcat(input_line,gnuterm); /* input_line has "set term " */
X else
X input_line[0] = '\0'; /* No SET TERM command needed. */
X
X if (!setjmp(env)) /* come back here from printerror() */
X do_line();
X
X if (!setjmp(env)) {
X#ifdef MSDOS
X#ifdef __TURBOC__
X (void) signal(SIGINT, interrupt); /* go there on interrupt char */
X#else
X void ss_interrupt();
X save_stack(); /* work-around for MSC 4.0/MSDOS 3.x bug */
X (void) signal(SIGINT, ss_interrupt);
X#endif
X#else /* MSDOS */
X (void) signal(SIGINT, interrupt); /* go there on interrupt char */
X#endif /* MSDOS */
X if (!(plotrc = (fopen(PLOTRC,"r")))) {
X#ifdef vms
X (void) strncpy(home,HOME,sizeof(home));
X plotrc = fopen(strcat(home,PLOTRC),"r");
X#else /* vms */
X (void) strcat(strncpy(home,getenv(HOME),sizeof(home)),"/");
X plotrc = fopen(strcat(home,PLOTRC),"r");
X#endif /* vms */
X }
X if (plotrc)
X load_file(plotrc);
X }
X
Xloop: com_line();
X goto loop;
X}
END_OF_FILE
if test 5472 -ne `wc -c <'./plot.c'`; then
echo shar: \"'./plot.c'\" unpacked with wrong size!
fi
# end of './plot.c'
fi
if test -f './postscpt.trm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./postscpt.trm'\"
else
echo shar: Extracting \"'./postscpt.trm'\" \(2014 characters\)
sed "s/^X//" >'./postscpt.trm' <<'END_OF_FILE'
X/* thanks to richb at yarra.OZ (Rich Burridge) for the Postscript driver */
X#define PS_XMAX 540
X#define PS_YMAX 720
X
X#define PS_XLAST (PS_XMAX - 1)
X#define PS_YLAST (PS_YMAX - 1)
X
X#define PS_VCHAR (PS_YMAX/30)
X#define PS_HCHAR (PS_XMAX/72)
X#define PS_VTIC (PS_YMAX/80)
X#define PS_HTIC (PS_XMAX/80)
X
X
XPS_init()
X{
X (void) fprintf(outfile,"%%!\n") ;
X (void) fprintf(outfile,"/off {36 add} def\n") ;
X (void) fprintf(outfile,"/mv {off exch off moveto} def\n") ;
X (void) fprintf(outfile,"/ln {off exch off lineto} def\n") ;
X (void) fprintf(outfile,"/Times-Roman findfont 12 scalefont setfont\n") ;
X (void) fprintf(outfile,"0.25 setlinewidth\n") ;
X}
X
X
XPS_graphics()
X{
X (void) fprintf(outfile,"newpath\n") ;
X}
X
X
XPS_text()
X{
X (void) fprintf(outfile,"stroke\n") ;
X (void) fprintf(outfile,"showpage\n") ;
X}
X
X
XPS_linetype(linetype)
Xint linetype ;
X{
X (void) fprintf(outfile,"stroke [") ;
X switch ((linetype+2)%7)
X {
X case 0 : /* solid. */
X case 2 : break ;
X case 1 : /* longdashed. */
X case 6 : (void) fprintf(outfile,"9 3") ;
X break ;
X case 3 : (void) fprintf(outfile,"3") ; /* dotted. */
X break ;
X case 4 : (void) fprintf(outfile,"6 3") ; /* shortdashed. */
X break ;
X case 5 : (void) fprintf(outfile,"3 3 6 3") ; /* dotdashed. */
X }
X (void) fprintf(outfile,"] 0 setdash\n") ;
X}
X
X
XPS_move(x,y)
Xunsigned int x,y ;
X{
X (void) fprintf(outfile,"%1d %1d mv\n",y,x) ;
X}
X
X
XPS_vector(x,y)
Xunsigned int x,y ;
X{
X (void) fprintf(outfile,"%1d %1d ln\n",y,x) ;
X}
X
X
XPS_lrput_text(row,str)
Xunsigned int row ;
Xchar str[] ;
X{
X PS_move(PS_XMAX - PS_HTIC - PS_HCHAR*(strlen(str)+1),
X PS_VTIC + PS_VCHAR*(row+1)) ;
X (void) fprintf(outfile,"(%s) show\n",str) ;
X}
X
X
XPS_ulput_text(row,str)
Xunsigned int row ;
Xchar str[] ;
X{
X PS_move(PS_HTIC, PS_YMAX - PS_VTIC - PS_VCHAR*(row+1)) ;
X (void) fprintf(outfile,"(%s) show\n",str) ;
X}
X
X
XPS_reset()
X{
X}
X
X
END_OF_FILE
if test 2014 -ne `wc -c <'./postscpt.trm'`; then
echo shar: \"'./postscpt.trm'\" unpacked with wrong size!
fi
# end of './postscpt.trm'
fi
if test -f './regis.trm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./regis.trm'\"
else
echo shar: Extracting \"'./regis.trm'\" \(2172 characters\)
sed "s/^X//" >'./regis.trm' <<'END_OF_FILE'
X#define REGISXMAX 800
X#define REGISYMAX 440
X
X#define REGISXLAST (REGISXMAX - 1)
X#define REGISYLAST (REGISYMAX - 1)
X
X#define REGISVCHAR 20
X#define REGISHCHAR 8
X#define REGISVTIC 8
X#define REGISHTIC 6
X
XREGISinit()
X{
X fprintf(outfile,"\033[r\033[24;1H");
X/* 1 2
X 1. reset scrolling region
X 2. locate cursor on bottom line
X*/
X}
X
X
X/* thanks to calmasd!dko (Dan O'Neill) for adding S(E) for vt125s */
XREGISgraphics()
X{
X fprintf(outfile,"\033[2J\033P1pS(C0)S(E)");
X/* 1 2 3 4
X 1. clear screen
X 2. enter ReGIS graphics
X 3. turn off graphics diamond cursor
X 4. clear graphics screen
X*/
X}
X
X
XREGIStext()
X{
X fprintf(outfile,"\033\\\033[24;1H");
X/* 1 2
X 1. Leave ReGIS graphics mode
X 2. locate cursor on last line of screen
X*/
X}
X
X
XREGISlinetype(linetype)
Xint linetype;
X{
X /* This will change color in order G,R,B,G-dot,R-dot,B-dot */
Xstatic int in_map[9 + 2] = {2, 2, 3, 2, 1, 3, 2, 1, 3, 2, 1};
Xstatic int lt_map[9 + 2] = {1, 4, 1, 1, 1, 4, 4, 4, 6, 6, 6};
X
X if (linetype >= 9)
X linetype %= 9;
X fprintf(outfile, "W(I%d)", in_map[linetype + 2]);
X fprintf(outfile, "W(P%d)", lt_map[linetype + 2]);
X}
X
X
XREGISmove(x,y)
Xint x,y;
X{
X fprintf(outfile,"P[%d,%d]",x,REGISYLAST-y,x,REGISYLAST-y);
X}
X
X
XREGISvector(x,y)
Xint x,y;
X{
X fprintf(outfile,"v[]v[%d,%d]",x,REGISYLAST - y);
X/* the initial v[] is needed to get the first pixel plotted */
X}
X
X
XREGISlrput_text(row,str)
Xint row;
Xchar *str;
X{
X REGISmove(REGISXMAX-REGISHTIC-REGISHCHAR*(strlen(str)+3),
X REGISVTIC+REGISVCHAR*(row+1));
X (void) putc('T',outfile); (void) putc('\'',outfile);
X while (*str) {
X (void) putc(*str,outfile);
X if (*str == '\'')
X (void) putc('\'',outfile); /* send out another one */
X str++;
X }
X (void) putc('\'',outfile);
X}
X
X
XREGISulput_text(row,str)
Xint row;
Xchar *str;
X{
X REGISmove(REGISVTIC,REGISYMAX-REGISVTIC*2-REGISVCHAR*row);
X (void) putc('T',outfile); (void) putc('\'',outfile);
X while (*str) {
X (void) putc(*str,outfile);
X if (*str == '\'')
X (void) putc('\'',outfile); /* send out another one */
X str++;
X }
X (void) putc('\'',outfile);
X}
X
X
XREGISreset()
X{
X fprintf(outfile,"\033[2J\033[24;1H");
X}
X
X
END_OF_FILE
if test 2172 -ne `wc -c <'./regis.trm'`; then
echo shar: \"'./regis.trm'\" unpacked with wrong size!
fi
# end of './regis.trm'
fi
echo shar: End of archive 2 \(of 7\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 7 archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
--
John Campbell ...!arizona!naucse!jdc
CAMPBELL at NAUVAX.bitnet
unix? Sure send me a dozen, all different colors.
More information about the Unix-pc.sources
mailing list