home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: jsp@Princeton.EDU (James Plank)
- Subject: v23i100: jgraph - A filter for plotting postscript graphs, Patch06b/2
- Message-ID: <1991Oct22.031830.1456@sparky.imd.sterling.com>
- X-Md4-Signature: 0109f7867f2f4c812022aa85a8fcfcff
- Date: Tue, 22 Oct 1991 03:18:30 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: jsp@Princeton.EDU (James Plank)
- Posting-number: Volume 23, Issue 100
- Archive-name: jgraph/patch06b
- Environment: UNIX, VMS, postscript
- Patch-To: jgraph: Volume 16, Issue 20
-
- #!/bin/sh
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file patch.6 continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 2; 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 patch.6'
- else
- echo 'x - continuing file patch.6'
- sed 's/^X//' << 'SHAR_EOF' >> 'patch.6' &&
- ! x = 0.0;
- ! max_y = 0.0;
- ! min_y = 0.0;
- ! for (g = first(gs->g); g != nil(gs->g); g = next(g)) {
- ! tmp_x = ABS(g->x_translate) * 2.0 + g->x_axis->psize;
- ! x = MAX(x, tmp_x);
- ! max_y = MAX(max_y, g->y_translate + g->y_axis->psize);
- ! if (g->y_translate > 0.0)
- ! min_y = MIN(min_y, g->y_translate + g->minval);
- ! else
- ! min_y = MIN(min_y, g->minval);
- X }
- - if (gs->height <= 0.00) gs->height = max_y - min_y; else gs->height *= FCPI;
- - if (gs->width <= 0.00) gs->width = x; else gs->width *= FCPI;
- - gs->bb[0] = 0.0;
- - gs->bb[1] = min_y;
- - gs->bb[2] = gs->width;
- - gs->bb[3] = gs->height + min_y;
- X }
- --- 474,510 ----
- X process_graphs(gs)
- X Graphs gs;
- X {
- + Graphs the_g;
- X Graph g;
- X float tmp_x, x, max_y, min_y;
- + int do_bb, i;
- X
- ! for (the_g = first(gs); the_g != nil(gs); the_g = next(the_g)) {
- ! for (g = first(the_g->g); g != nil(the_g->g); g = next(g)) process_graph(g);
- ! x = 0.0;
- ! max_y = 0.0;
- ! min_y = 0.0;
- ! for (g = first(the_g->g); g != nil(the_g->g); g = next(g)) {
- ! tmp_x = ABS(g->x_translate) * 2.0 + g->x_axis->psize;
- ! x = MAX(x, tmp_x);
- ! max_y = MAX(max_y, g->y_translate + g->y_axis->psize);
- ! if (g->y_translate > 0.0)
- ! min_y = MIN(min_y, g->y_translate + g->minval);
- ! else
- ! min_y = MIN(min_y, g->minval);
- ! }
- ! if (the_g->height <= 0.00)
- ! the_g->height = max_y - min_y;
- ! else
- ! the_g->height *= FCPI;
- ! if (the_g->width <= 0.00) the_g->width = x; else the_g->width *= FCPI;
- ! do_bb = 1;
- ! for (i = 0; i < 4; i++) do_bb = (do_bb && the_g->bb[i] == FSIG);
- ! if (do_bb) {
- ! the_g->bb[0] = 0.0;
- ! the_g->bb[1] = min_y;
- ! the_g->bb[2] = the_g->width;
- ! the_g->bb[3] = the_g->height + min_y;
- ! }
- X }
- X }
- *** /dev/null Tue Oct 8 02:00:06 1991
- --- redexp.vms Tue Oct 8 16:55:17 1991
- ***************
- *** 0 ****
- --- 1,526 ----
- + /* --redexp.vms--
- + This 'C' module may be included prior to the ``main'' programs on VMS in
- + order to allow 'C' arguments to contain redirection symbols (<,>,>>) and
- + VMS wild cards (*,%, ...], [-). By including this module, two programs
- + redirect() and expand() are run prior to turning control over to
- + your main() entry point.
- +
- + redirect-- Gregg Townsend circa 1983,
- + expand-- John Campbell circa 1987
- +
- + This code is public domain, others may use it freely. Credit, however, to
- + Gregg Townsend (who wrote ``redirect()'') and John Campbell (who followed
- + with ``expand()'') would be appreciated. If someone writes the next
- + logical successor ``pipe()'', please email a copy to
- + ...!arizona!naucse!jdc (John Campbell) (Gregg works on unix :-).
- +
- + HISTORY
- +
- + */
- +
- + #include <rms.h> /* No easy way to tell if this has already been included. */
- + #ifndef ERANGE
- + #include <stdlib.h> /* Include only if missing. */
- + #endif
- + #ifndef __FILE
- + #include <stdio.h> /* Include only if missing. */
- + #endif
- + #include <ctype.h> /* Added for conversion to lower case */
- + #ifndef __STRING_LOADED
- + #include <string.h>
- + #endif /* !__STRING_LOADED */
- +
- + /* Expansion of wild cards is done using RMS. */
- + struct NAMBLK { struct NAM nam; /* VMS nam block structure */
- + char es[NAM$C_MAXRSS], /* Extended string */
- + rs[NAM$C_MAXRSS]; /* Resultant string */
- + };
- +
- + #define ErrorExit 1
- +
- + /* Allow the user to override _N_FARGS or _E_FLAG if they wish. */
- + #ifndef _N_FARGS
- + #define _N_FARGS 0 /* no automatic redirection please */
- + #endif
- + #ifndef _E_FLAG
- + #define _E_FLAG 4 /* only include dev and dir if different from default */
- + #endif
- + /*
- + Since the following will possibly be included in a single module, try
- + hard to avoid name conflicts. (Just being static doesn't cut it if
- + compiled in the same module.)
- + */
- + #define redirect _r_edirect
- + #define filearg _f_ilearg
- + #define expand _e_xpand
- + #define wild_found _w_ild_found
- + #define wild_expand _w_ild_expand
- +
- + /* forward protypes */
- + static void redirect(int *argc, char *argv[], int nfargs);
- + char **expand (int *argc, const char *argv[], const int flag);
- +
- + main(int argc, char *argv[], char *envp[])
- + {
- + redirect (&argc, argv, _N_FARGS);
- + argv = expand (&argc, argv, _E_FLAG);
- +
- + /* Make the user's main entry point this routine's entry point. */
- + #define main _user_main
- + _user_main (argc, argv, envp);
- + }
- +
- + /* ------------------------ REDIRECT code ------------------------ */
- +
- + /*
- + * redirect(&argc,argv,nfargs) - redirect standard I/O
- + * int *argc number of command arguments (from call to main)
- + * char *argv[] command argument list (from call to main)
- + * int nfargs number of filename arguments to process
- + *
- + * argc and argv will be adjusted by redirect.
- + *
- + * redirect processes a program's command argument list and handles redirection
- + * of stdin, and stdout. Any arguments which redirect I/O are removed from the
- + * argument list, and argc is adjusted accordingly. redirect would typically be
- + * called as the first statement in the main program.
- + *
- + * Files are redirected based on syntax or position of command arguments.
- + * Arguments of the following forms always redirect a file:
- + *
- + * <file redirects standard input to read the given file
- + * >file redirects standard output to write to the given file
- + * >>file redirects standard output to append to the given file
- + *
- + * It is often useful to allow alternate input and output files as the
- + * first two command arguments without requiring the <file and >file
- + * syntax. If the nfargs argument to redirect is 2 or more then the
- + * first two command arguments, if supplied, will be interpreted in this
- + * manner: the first argument replaces stdin and the second stdout.
- + * A filename of "-" may be specified to occupy a position without
- + * performing any redirection.
- + *
- + * If nfargs is 1, only the first argument will be considered and will
- + * replace standard input if given. Any arguments processed by setting
- + * nfargs > 0 will be removed from the argument list, and again argc will
- + * be adjusted. Positional redirection follows syntax-specified
- + * redirection and therefore overrides it.
- + *
- + */
- +
- + /* forward prototype for local routine */
- + static void filearg(int *argc, char *argv[], int n, int i, FILE *fp, char mode[]);
- +
- + static void redirect(int *argc, char *argv[], int nfargs)
- + {
- + int i;
- +
- + i = 1;
- + while (i < *argc) { /* for every command argument... */
- + switch (argv[i][0]) { /* check first character */
- + case '<': /* <file redirects stdin */
- + filearg(argc,argv,i,1,stdin,"r");
- + break;
- + case '>': /* >file or >>file redirects stdout */
- + if (argv[i][1] == '>')
- + filearg(argc,argv,i,2,stdout,"a");
- + else
- + filearg(argc,argv,i,1,stdout,"w");
- + break;
- + default: /* not recognized, go on to next arg */
- + i++;
- + }
- + }
- + if (nfargs >= 1 && *argc > 1) /* if positional redirection & 1 arg */
- + filearg(argc,argv,1,0,stdin,"r"); /* then redirect stdin */
- + if (nfargs >= 2 && *argc > 1) /* likewise for 2nd arg if wanted */
- + filearg(argc,argv,1,0,stdout,"w");/* redirect stdout */
- + }
- +
- + /* local routine for redirect() */
- + /* filearg(&argc,argv,n,i,fp,mode) - redirect and remove file argument
- + * int *argc number of command arguments (from call to main)
- + * char *argv[] command argument list (from call to main)
- + * int n argv entry to use as file name and then delete
- + * int i first character of file name to use (skip '<' etc.)
- + * FILE *fp file pointer for file to reopen (typically stdin etc.)
- + * char mode[] file access mode (see freopen spec)
- + */
- +
- + static void filearg(int *argc, char *argv[], int n, int i, FILE *fp, char mode[])
- + {
- + if (strcmp(argv[n]+i,"-")) /* alter file if arg not "-" */
- + fp = freopen(argv[n]+i,mode,fp,"mbf=8","mbc=16");
- + if (fp == NULL) { /* abort on error */
- + fprintf(stderr,"%%can't open %s",argv[n]+i);
- + exit(ErrorExit);
- + }
- + for ( ; n < *argc; n++) /* move down following arguments */
- + argv[n] = argv[n+1];
- + *argc = *argc - 1; /* decrement argument count */
- + }
- +
- + /* ------------------------ EXPAND code ------------------------ */
- + /*-
- + ``expand()'' is a routine to expand wild-cards to file specifications.
- + This routine is often used in conjunction with ``redirect()'' to provide
- + both wild card expansion and standard file redirection prior to doing
- + any real work in a 'C' program.
- +
- + Normal usage is to include the following line prior to using argc or
- + argv in main():
- +
- + argv = expand (&argc, argv, 0);
- +
- + ``argc'' will be adjusted by ``expand()'', the return value from expand
- + will replace ``argv''.
- +
- + ``expand()'' processes a program's command argument list and expands any
- + wild cards into zero or more argv entries. Only arguments that posses VMS
- + wild-cards are expanded. Wild cards searched for are ``*'', ``%'',
- + ``...]'', and ``[-''. If the wild-card is found inside a single or double
- + quote ("*" or '%') then they are not counted as wild-cards. Be aware that
- + the expansion of a VMS wild card will match all VMS files, including
- + directory files (".DIR;1").
- +
- + NOTE: The use of quotes in VMS requires thinking about how the CLI expands
- + things before handing the argument line over to your program. Do not
- + expect "*" to avoid expansion, use """*""" instead. Likewise, expression
- + substitution precludes the use of (') to quote wild cards:
- + $ A := HELLO
- + $ ECHO 'a' ! 'C' program that calls ``expand()''
- + hello
- + The easiest way to escape a wild-card may be "'*'". The point is that
- + ``expand()'' will only recognize quotes passed into main().
- + Note: I have added '\' as an escape character -hdd.
- +
- + ``expand()'' references the VMS runtime routines, you will need to
- + link with the 'C' RTL whenever expand is used.
- +
- + Parameters:
- +
- + argc: Pointer to the number of command arguments (from main),
- + the contents of this parameter are modified.
- +
- + argv: Pointer to the initial command argument list (from main),
- + the contents are copied into a new array which is returned
- + from this routine.
- +
- + flag: Flag indicating how to expand wild-cards:
- + 0 - Complete file name expansion
- + 1 - only file name (no directory or version).
- + 2 - directory info and file name (no version).
- + 3 - file name and version info (no directory).
- + 4 - omit fields that are the same as RMS default.
- + -*/
- +
- + /* Local prototypes. */
- + int wild_found (char *string);
- + char **wild_expand (const char *string, char **argv, int *argc,
- + int extra, int flag);
- + /*
- + General note: removing the prototyping and const keywords should
- + allow this code to compile with VMS 'C' compilers prior to version
- + 2.3-024.
- + */
- +
- + char **expand (int *argc, const char *argv[], const int flag)
- + {
- + int i, nargc;
- + char **nargv;
- + char *s1;
- +
- + /* Get an initial amount of memory for the master nargv array. */
- + if ((nargv = (char **)malloc ((*argc+1) * sizeof (char *))) == NULL) {
- + fprintf (stderr, "Not enough memory to expand argument list\n");
- + exit (ErrorExit);
- + }
- + /* Copy the command name (0th argument), but only the name of the exe */
- + nargv[0] = strchr(argv[0],']');
- + if (nargv[0] != NULL) {
- + nargv[0]++;
- + if ((s1=strrchr(nargv[0],'.')) != NULL) *s1 = '\0';
- + } else {
- + nargv[0] = argv[0]; /* if nothing suitable take original */
- + }
- +
- + /* Copy all other arguments, expanding those that have wild characters. */
- + for (nargc = i = 1; i < *argc; i++) {
- + if (wild_found(argv[i]))
- + nargv = wild_expand(argv[i], nargv, &nargc, *argc-i, flag);
- + else
- + nargv[nargc++] = argv[i];
- + }
- + *argc = nargc;
- + nargv[nargc] = NULL; /* realloc always 0 fills, but... */
- +
- + return nargv;
- + }
- +
- + static int wild_found (char *string)
- + /*
- + Routine to search the given string for a VMS wild-card pattern.
- + Returns 1 if "*", "%", "[-", or "...]" is found. (This may not
- + be all VMS wild-cards but it is enough for now--anyone that wants
- + to recognize others can change this code.)
- +
- + Parameter:
- +
- + string: '\0' terminated character array.
- + */
- + {
- + int state = 0;
- +
- + /* State of 0 is "rest" state. State 1 on our way to [-, states 2-4
- + on our way to ...], negative states indicate the two quotes (' -10,
- + " -1).
- + */
- + for ( ;*string; string++) {
- + switch (*string) {
- + case '*':
- + case '%':
- + if (state >= 0)
- + return 1; /* Unquoted % or * found. */
- + break;
- + case '[':
- + if (state >= 0)
- + state = 1;
- + break;
- + case ']':
- + if (state == 4)
- + return 1; /* Unquoted ...] found. */
- + else if (state >= 0)
- + state = 0;
- + break;
- + case '-':
- + if (state == 1)
- + return 1; /* Unquoted [- found. */
- + else if (state >= 0)
- + state = 0;
- + break;
- + case '.':
- + if (state == 1 || state == 0)
- + state = 2; /* First '.' */
- + else if (state > 1 && state < 5)
- + state++; /* ... == states 2, 3, 4 */
- + else if (state >= 0)
- + state = 0;
- + break;
- + case '\'':
- + if (state <= -10)
- + state += 10; /* One ', possibly one " also */
- + else if (state < 0)
- + state -= 10; /* 0 ', possibly one " */
- + else
- + state = -10; /* No ' or " prior to this ' */
- + break;
- + case '"':
- + if (state == -11)
- + state = -10; /* Both " and ' prior to this. */
- + else if (state == -10)
- + state = -11; /* A ' prior to this. */
- + else if (state == -1)
- + state = 0; /* A " prior to this. */
- + else
- + state = -1; /* No ' or " prior to this " */
- + break;
- + case '\\':
- + string = strcpy(string, string+1);
- + state = 0;
- + break;
- + }
- + }
- + return 0;
- + }
- +
- +
- + static char **wild_expand(const char *wild, char **argv,
- + int *argc, int extra, int flag)
- + /*
- + Routine to expand wild into new arguments appended to the end
- + of argv[*argc]. This routine must realloc in order to make room
- + for the individual arguments and malloc for enough space for each
- + of the arguments. The return value is a new **argv.
- +
- + Parameters:
- +
- + wild: '\0' terminated string that needs to be expanded.
- +
- + argv: initial starting address of the argv array.
- +
- + argc: pointer to an integer that tells the current end of the
- + argument list.
- +
- + extra: The number of extra pointers that the returned argv
- + must have available for future assignments.
- +
- + flag: Flag indicating how to expand wild-card:
- + 0 - Complete file name expansion
- + 1 - only file name (no directory or version).
- + 2 - directory info and file name (no version)
- + 3 - file name and version info (no directory).
- + 4 - omit fields that are the same as RMS default.
- + */
- + {
- + int more_to_go = 1, err, length, status, len_wild, i, ddev_l, ddir_l;
- + char *namptr;
- + struct FAB fab_blk;
- + struct NAMBLK nam_blk;
- + char path[256];
- + char *ddevice = &path[0]; /* default device and directory */
- + char *ddirectory, *ppath;
- +
- + char *env = getenv("PATH");
- + ppath = &path[0];
- + while (*env) {
- + char *p = env++;
- + if ((*ppath++ = _toupper(*p)) == ':') {
- + ddev_l = ppath - &path[0];
- + *ppath++ = 0;
- + ddirectory = ppath;
- + }
- + }
- + *ppath++ = 0;
- + ddir_l = ppath - ddirectory - 1;
- + len_wild = strlen(wild);
- +
- + /* Initialize all the fab and nam fields needed for parse and search */
- +
- + fab_blk = cc$rms_fab; /* Initialize FAB structure */
- +
- + nam_blk.nam = cc$rms_nam; /* Initialize NAM structure */
- + fab_blk.fab$l_dna = ".*"; /* Default file specif. */
- + fab_blk.fab$b_dns = 2; /* Length of default spec. */
- + fab_blk.fab$l_nam = &nam_blk.nam; /* Set address of NAM in FAB*/
- + nam_blk.nam.nam$b_ess = NAM$C_MAXRSS; /* Set extended string size*/
- + nam_blk.nam.nam$l_esa = nam_blk.es; /* and address */
- + nam_blk.nam.nam$b_rss = NAM$C_MAXRSS; /* Set resultant string size*/
- + nam_blk.nam.nam$l_rsa = nam_blk.rs; /* and address */
- + nam_blk.nam.nam$l_rlf = NULL; /* No related file address */
- +
- + fab_blk.fab$l_fna = wild; /* Address of file name string */
- + fab_blk.fab$b_fns = len_wild; /* Length of file name string */
- +
- + /* Prepare to enter the search loop, parse fab. */
- + err = SYS$PARSE (&fab_blk);
- +
- + /* Catch the directory not found error and return no files found. */
- + if (err != RMS$_NORMAL)
- + exit(err);
- +
- + while (more_to_go) {
- + err = SYS$SEARCH (&fab_blk);
- + if (err == RMS$_NMF || err == RMS$_FNF)
- + more_to_go = 0; /* Done, no more files found */
- + else if (err != RMS$_NORMAL)
- + exit (err);
- + else {
- + /* Count that we now have this many arguments. */
- + (*argc)++;
- +
- + /* Make sure there is room for a new pointer. */
- + if ((argv = realloc (argv, (*argc + extra)*sizeof(char *))) == NULL) {
- + fprintf (stderr, "Not enough memory to expand argument list\n");
- + exit(ErrorExit);
- + }
- +
- + /* Move the right name into the list. */
- + switch (flag) {
- + case 0: /* Complete file name */
- + length = nam_blk.nam.nam$b_rsl;
- + namptr = nam_blk.rs;
- + break;
- + case 1: /* File name only (no directory or version). */
- + length = nam_blk.nam.nam$b_name + nam_blk.nam.nam$b_type;
- + namptr = nam_blk.nam.nam$l_name;
- + break;
- + case 2: /* directory and file name (no version) */
- + length = nam_blk.nam.nam$b_rsl - nam_blk.nam.nam$b_ver;
- + namptr = nam_blk.rs;
- + break;
- + case 3: /* File name and version (no directory). */
- + length = nam_blk.nam.nam$b_name +
- + nam_blk.nam.nam$b_type +
- + nam_blk.nam.nam$b_ver;
- + namptr = nam_blk.nam.nam$l_name;
- + break;
- + case 4: /* Remove redundant fields, no version */
- + length = nam_blk.nam.nam$b_rsl - nam_blk.nam.nam$b_ver;
- + namptr = nam_blk.rs;
- + if ((nam_blk.nam.nam$b_dev==ddev_l) &&
- + !strncmp(namptr, ddevice, nam_blk.nam.nam$b_dev)) {
- + length -= nam_blk.nam.nam$b_dev;
- + namptr += nam_blk.nam.nam$b_dev;
- + if ((nam_blk.nam.nam$b_dir==ddir_l) &&
- + !strncmp(namptr, ddirectory, nam_blk.nam.nam$b_dir)) {
- + length -= nam_blk.nam.nam$b_dir;
- + namptr += nam_blk.nam.nam$b_dir;
- + }
- + }
- + break;
- + default:
- + fprintf (stderr, "illegal flag used in VMS expand call\n");
- + exit (ErrorExit);
- + } /* end of switch */
- + /* Copy the requested string into the argument array. */
- + if ((argv[*argc-1] = malloc (length+1)) == NULL) {
- + fprintf (stderr, "Not enough memory to expand argument list\n");
- + exit (ErrorExit);
- + }
- + /* Copy the string, translate to lower case */
- + /* strncpy (argv[*argc-1], namptr, length); */
- + for (i=0; i<length; i++) {
- + argv[*argc-1][i] = _tolower(*namptr);
- + namptr++;
- + }
- + /* End of modification */
- + argv[*argc-1][length] = '\0';
- + }
- + } /* end while (more_to_go) */
- + return (argv);
- + }
- +
- + /* Remove all the defines that might affect the user's code. */
- +
- + #undef redirect
- + #undef filearg
- + #undef expand
- + #undef wild_found
- + #undef wild_expand
- +
- + #if 0
- + /* ------------------------ ECHO sample code ------------------------ */
- +
- + #include <stdio.h>
- + /* here come the 3 lines that make this Unix program into a VMS one: */
- + #ifdef VMS
- + #include <redexp.vms>
- + #endif
- +
- + /*
- + This main program allows you to run experiments with redexp.vms.
- + Try $ echo *.*, $ echo -f1 [-...]*.*, $ echo -f[0-3] *.*.
- + Questions about using "%", "\", etc. may be answered by testing
- + with this version of echo.
- +
- + To use this, cut from the "#if 0" above up to the last #endif,
- + and put the text in echo.c. Assuming you have defined VAXC$INCLUDE
- + to also look in the directory where you put redexp.VMS, you should
- + be able to compile and link echo. Define a symbol echo as
- + echo :== $sys$disk:[]echo
- + and you are ready to run.
- +
- + */
- + main(argc, argv)
- + int argc;
- + char *argv[];
- + {
- + int i = 0;
- +
- + while (i < argc) {
- + printf("argv[%d]: %s\n", i, argv[i]);
- + i++;
- + }
- + }
- + /* ------------------------ ECHO sample code end --------------------- */
- + #endif /* if 0 */
- *** ../work/show.c Tue Oct 8 17:36:30 1991
- --- show.c Tue Oct 8 16:55:18 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/show.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:21 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/show.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:59 $
- X * $Author: jsp $
- X */
- X
- ***************
- *** 9,15 ****
- X #include <math.h>
- X #include "jgraph.h"
- X
- ! static int spaces(nsp)
- X int nsp;
- X {
- X while(nsp-- > 0) putchar(' ');
- --- 9,15 ----
- X #include <math.h>
- X #include "jgraph.h"
- X
- ! static spaces(nsp)
- X int nsp;
- X {
- X while(nsp-- > 0) putchar(' ');
- ***************
- *** 68,73 ****
- --- 68,74 ----
- X {
- X Point p;
- X int i;
- + Flist fl;
- X
- X if (c->l->label != CNULL) {
- X spaces(nsp); printf("label\n");
- ***************
- *** 99,107 ****
- X spaces(nsp); printf("linetype ");
- X if (c->linetype == '0') printf("none ");
- X else if (c->linetype == 's') printf("solid ");
- ! else if (c->linetype == '.') printf("dotted");
- X else if (c->linetype == '-') printf("dashed ");
- X printf("linethickness %f\n", c->linethick);
- X }
- X
- X show_axis(a, nsp, g)
- --- 100,137 ----
- X spaces(nsp); printf("linetype ");
- X if (c->linetype == '0') printf("none ");
- X else if (c->linetype == 's') printf("solid ");
- ! else if (c->linetype == '.') printf("dotted ");
- X else if (c->linetype == '-') printf("dashed ");
- + else if (c->linetype == 'l') printf("longdash ");
- + else if (c->linetype == 'd') printf("dotdash ");
- + else if (c->linetype == 'D') printf("dotdotdash ");
- + else if (c->linetype == '2') printf("dotdotdashdash ");
- + else if (c->linetype == 'g') {
- + printf("general\n");
- + spaces(nsp+2);
- + printf("glines ");
- + i = 0;
- + for (fl = first(c->gen_linetype); fl != nil(c->gen_linetype);
- + fl = next(fl)) {
- + if (i == 6) {
- + printf("\n");
- + spaces(nsp + 9);
- + i = 0;
- + }
- + printf("%f ", fl->f);
- + i++;
- + }
- + printf("\n");
- + spaces(nsp);
- + }
- X printf("linethickness %f\n", c->linethick);
- + spaces(nsp);
- + printf("gray %f ", c->gray);
- + if(!c->clip) printf("no"); printf("clip ");
- + if(!c->rarrows) printf("no"); printf("rarrows ");
- + if(!c->larrows) printf("no"); printf("larrows ");
- + printf("asize %f %f\n", ptodist(c->asize[0], g->x_axis),
- + ptodist(c->asize[1], g->y_axis));
- X }
- X
- X show_axis(a, nsp, g)
- ***************
- *** 135,141 ****
- --- 165,175 ----
- X spaces(nsp);
- X printf("%sdraw_hash_marks\n", (a->draw_hash_marks) ? "" : "no_");
- X spaces(nsp);
- + printf("%sgrid_lines\n", (a->grid_lines) ? "" : "no_");
- + spaces(nsp);
- X printf("%sdraw_axis_label\n", (a->draw_axis_label) ? "" : "no_");
- + spaces(nsp);
- + printf("gray %f\n", a->gray);
- X spaces(nsp);
- X
- X printf("(* The real settings for generating auto_hash_labels:\n");
- ***************
- *** 202,207 ****
- --- 236,243 ----
- X ptoin(g->x_translate), ptoin(g->y_translate));
- X spaces(nsp); printf("xaxis\n"); show_axis(g->x_axis, nsp+2, g);
- X spaces(nsp); printf("yaxis\n"); show_axis(g->y_axis, nsp+2, g);
- + spaces(nsp); if(!g->clip) printf("no"); printf("clip ");
- + if(!g->border) printf("no"); printf("border\n");
- X for (c = first(g->curves); c != nil(g->curves); c = next(c)) {
- X spaces(nsp);
- X printf("curve %d\n", c->num);
- ***************
- *** 224,235 ****
- X show_graphs(gs)
- X Graphs gs;
- X {
- X Graph g;
- X
- ! printf("X %f Y %f\n", ptoin(gs->width), ptoin(gs->height));
- ! for (g = first(gs->g); g != nil(gs->g); g = next(g)) {
- ! printf("graph %d\n", g->num);
- ! show_graph(g, 2);
- X }
- X }
- X
- --- 260,282 ----
- X show_graphs(gs)
- X Graphs gs;
- X {
- + Graphs the_g;
- X Graph g;
- + char started;
- + int i;
- X
- ! started = 0;
- ! for (the_g = first(gs); the_g != nil(gs); the_g = next(the_g)) {
- ! if (started) printf("\nnewpage\n");
- ! started = 1;
- ! printf("X %f Y %f\n", ptoin(the_g->width), ptoin(the_g->height));
- ! printf("bbox");
- ! for (i = 0; i < 4; i++) printf(" %f", the_g->bb[i]);
- ! printf("\n");
- ! for (g = first(the_g->g); g != nil(the_g->g); g = next(g)) {
- ! printf("graph %d\n", g->num);
- ! show_graph(g, 2);
- ! }
- X }
- X }
- X
- *** ../work/token.c Tue Oct 8 17:36:41 1991
- --- token.c Tue Oct 8 16:55:18 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/token.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:23 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/token.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:54:00 $
- X * $Author: jsp $
- X */
- X
- ***************
- *** 82,88 ****
- X return oldchar;
- X }
- X
- ! int ungettokenchar()
- X {
- X oldcharvalid = 1;
- X if (oldchar == '\n') line--;
- --- 82,88 ----
- X return oldchar;
- X }
- X
- ! ungettokenchar()
- X {
- X oldcharvalid = 1;
- X if (oldchar == '\n') line--;
- ***************
- *** 209,215 ****
- X push_iostack(0);
- X }
- X } else if (strcmp(INPUT, "shell") == 0) {
- - char *s, fn[30];
- X #ifdef VMS
- X fprintf(stderr, "No shell option on VMS, sorry.\n");
- X exit(1);
- --- 209,214 ----
- SHAR_EOF
- echo 'File patch.6 is complete' &&
- chmod 0664 patch.6 ||
- echo 'restore of patch.6 failed'
- Wc_c="`wc -c < 'patch.6'`"
- test 78625 -eq "$Wc_c" ||
- echo 'patch.6: original size 78625, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- rm -f _shar_seq_.tmp
- echo You have unpacked the last part
- 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.
-