home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1408 < prev    next >
Internet Message Format  |  1990-12-28  |  43KB

  1. From: fs@uwasa.fi (Filip Sawicki LAKE)
  2. Newsgroups: alt.sources
  3. Subject: Fchart part 01/04
  4. Message-ID: <1990Jun4.125022.1075@uwasa.fi>
  5. Date: 4 Jun 90 12:50:22 GMT
  6.  
  7. Submitted-by: fs@chyde
  8. Archive-name: Fchart/part01
  9.  
  10. #!/bin/sh
  11. # This is Fchart, a shell archive (shar 3.24)
  12. # made 06/04/1990 12:29 UTC by fs@chyde
  13. # Source directory /home2/cc/fs/export
  14. #
  15. # existing files WILL be overwritten
  16. #
  17. # This shar contains:
  18. # length  mode       name
  19. # ------ ---------- ------------------------------------------
  20. #   3460 -rw-rw-rw- Makefile
  21. #   2949 -rw-rw-rw- README.ins
  22. #   5072 -rw-rw-rw- fchart.c
  23. #  23815 -rw-rw-rw- fchart.doc
  24. #   3906 -rw-rw-rw- fchart.h
  25. #  45623 -rw-rw-rw- fcmd.c
  26. #  22428 -rw-rw-rw- fgraf.c
  27. #  16228 -rw-rw-rw- flblarr.c
  28. #  12994 -rw-rw-rw- fmisc.c
  29. #  20937 -rw-rw-rw- font.c
  30. #  27072 -rw-rw-rw- fstyles.i
  31. #  10184 -rw-rw-rw- futil.c
  32. #   1852 -rw-rw-rw- fversion.c
  33. #    214 -rw-rw-rw- titlepage.ms
  34. #    662 -rw-rw-rw- titlepage.tex
  35. #
  36. if touch 2>&1 | fgrep '[-amc]' > /dev/null
  37.  then TOUCH=touch
  38.  else TOUCH=true
  39. fi
  40. # ============= Makefile ==============
  41. echo "x - extracting Makefile (Text)"
  42. sed 's/^X//' << 'SHAR_EOF' > Makefile &&
  43. X######################################################################
  44. X#
  45. X# WARNING:
  46. X#
  47. X# * if fchart sources are not in the gnuplot directory, define
  48. X#   following variable as a path to it:
  49. X
  50. XGNUP=../gnuplot
  51. X
  52. X#   (default is as you see)
  53. X#   Name this file 'Makefile' and just use 'make ...'
  54. X#
  55. X# * if fchart is in the gnuplot directory, define
  56. X#
  57. X# GNUP=.
  58. X#
  59. X#   and use 'make -f <this_file> ...'
  60. X#   since this file requires presence of the original Makefile
  61. X#
  62. X######################################################################
  63. X
  64. X# where to install executable and help on 'make install'
  65. XDEST=/usr/local/bin/fchart
  66. XHELPDEST=/usr/local/lib/fchart.gih
  67. X
  68. X######################################################################
  69. X
  70. X# substitute your troff command (and any flags) for this one
  71. XTROFF=itroff
  72. X
  73. X# -DFORK if you have vfork()
  74. X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  75. X# -DNOCOPY if you don't have a memcpy() by any name
  76. X# -DGAMMA if you've got gamma(3)
  77. X# -O if you trust your compiler's optimizer
  78. X# -g if you don't trust me
  79. XCFLAGS = -I$(GNUP) -DVFORK -DBCOPY -DGAMMA -O #-g
  80. X
  81. XOBJS =     fcmd.o fgraf.o fmisc.o fchart.o futil.o font.o flblarr.o
  82. XOBJG =  $(GNUP)/term.o $(GNUP)/help.o $(GNUP)/scanner.o
  83. X
  84. XCSRC =  fcmd.c fgraf.c fmisc.c fchart.c futil.c font.c flblarr.c
  85. XOSRC =  fstyles.i fchart.h README.ins Makefile fversion.c
  86. XDSRC =  fchart.doc titlepage.ms titlepage.tex
  87. X
  88. X# -lplot if you have -DUNIXPLOT in gnuplot Makefile
  89. XLIBS = -lm -lplot
  90. X
  91. Xfchart: $(OBJG) $(OBJS) fversion.o
  92. X    cc $(CFLAGS) $(OBJG) $(OBJS) fversion.o $(LIBS) -o fchart
  93. X
  94. Xall: install
  95. X
  96. X#copying requires setting TO variable and copies from cwd
  97. Xcopy:
  98. X    cp $(CSRC) $(TO)
  99. X    cp $(OSRC) $(TO)
  100. X    cp $(DSRC) $(TO)
  101. X
  102. Xdoc: gih hlp tex nroff
  103. X
  104. Xinstall: fchart install-unix
  105. X    cp fchart $(DEST)
  106. X    strip $(DEST)
  107. X
  108. X$(OBJS) $(OBJG): $(GNUP)/plot.h 
  109. X
  110. X$(OBJS): fchart.h
  111. X
  112. Xfcmd.o fmisc.o $(GNUP)/help.o: $(GNUP)/help.h
  113. X
  114. Xfgraf.o: fstyles.i
  115. X
  116. Xfcmd.o:
  117. X    cc $(CFLAGS) -c fcmd.c -DHELPFILE=\"$(HELPDEST)\"
  118. X
  119. X$(GNUP)/help.o:
  120. X    ( cd $(GNUP) ; make help.o )
  121. X
  122. X$(GNUP)/scanner.o:
  123. X    ( cd $(GNUP) ; make scanner.o )
  124. X
  125. X$(GNUP)/term.o:
  126. X    ( cd $(GNUP) ; make term.o ) 
  127. X
  128. Xclean:
  129. X    rm -f *.o fchart fchart.gih fchart.toc fchart.tex fchart.nroff
  130. X    rm -f fchart.aux fchart.log fchart.dvi fchart.hlp fchart.ms *~
  131. X
  132. X### [tn]roff documentation
  133. Xtroff: fchart.ms titlepage.ms
  134. X    tbl fchart.ms | eqn | $(TROFF) -ms
  135. X
  136. X# for screen viewing, or printers with backspace/overstrike, remove the -Tlpr
  137. Xnroff fchart.nroff: fchart.ms titlepage.ms
  138. X    tbl fchart.ms | neqn | nroff -ms -Tlpr > fchart.nroff
  139. X
  140. Xms fchart.ms: $(GNUP)/docs/doc2ms fchart.doc
  141. X    $(GNUP)/docs/doc2ms < fchart.doc > fchart.ms
  142. X
  143. X$(GNUP)/docs/doc2ms:
  144. X    ( cd $(GNUP)/docs ; make doc2ms )
  145. X
  146. X### LaTeX documentation
  147. Xtex fchart.tex: $(GNUP)/docs/doc2tex fchart.doc
  148. X    $(GNUP)/docs/doc2tex < fchart.doc > fchart.tex
  149. X
  150. Xdvi fchart.dvi: fchart.tex titlepage.tex
  151. X    ( latex fchart.tex ; latex fchart.tex )
  152. X
  153. X$(GNUP)/docs/doc2tex:
  154. X    ( cd $(GNUP)/docs ; make doc2tex )
  155. X
  156. X### this is how to make fchart.hlp
  157. Xhlp fchart.hlp: $(GNUP)/docs/doc2hlp fchart.doc
  158. X    $(GNUP)/docs/doc2hlp < fchart.doc > fchart.hlp
  159. X
  160. X$(GNUP)/docs/doc2hlp:
  161. X    ( cd $(GNUP)/docs ; make doc2hlp )
  162. X
  163. X### this is how to make fchart.gih
  164. Xgih fchart.gih: $(GNUP)/docs/doc2gih fchart.doc
  165. X    $(GNUP)/docs/doc2gih < fchart.doc > fchart.gih
  166. X
  167. X$(GNUP)/docs/doc2gih:
  168. X    ( cd $(GNUP)/docs ; make doc2gih )
  169. X
  170. X### For Unix and MSDOS only
  171. Xinstall-unix: fchart.gih
  172. X    cp fchart.gih $(HELPDEST)
  173. X
  174. X### for VMS only
  175. Xinstall-vms: fchart.hlp
  176. X    cp fchart.hlp $(HELPDEST)
  177. X
  178. X
  179. SHAR_EOF
  180. $TOUCH -am 0604152590 Makefile &&
  181. chmod 0666 Makefile ||
  182. echo "restore of Makefile failed"
  183. set `wc -c Makefile`;Wc_c=$1
  184. if test "$Wc_c" != "3460"; then
  185.     echo original size 3460, current size $Wc_c
  186. fi
  187. # ============= README.ins ==============
  188. echo "x - extracting README.ins (Text)"
  189. sed 's/^X//' << 'SHAR_EOF' > README.ins &&
  190. X   IMPORTANT!
  191. X
  192. X   This program requires some knowledge about Gnuplot 2.0 pl0, and a
  193. Xpart of its code. If you don't have it, ftp from the nearest server,
  194. Xand at least print and read the documentation.
  195. X
  196. X**********************************************************************
  197. X   DISCLAIMER 1.
  198. X
  199. X   This program has never had any claims to be The Ultimate Chart
  200. XMaker. It should be treated rather as a previewer before writing
  201. Xproper SAS program or transmitting data to Lotus 1-2-3.
  202. X   And it is no serious work, but effect of several weeks of hacking
  203. Xwell written Gnuplot code.
  204. X
  205. X**********************************************************************
  206. X
  207. X   HOW TO INSTALL FCHART
  208. X
  209. X   Fchart needs the following Gnuplot v2.0 files:
  210. X    docs/*.c
  211. X    term.o
  212. X    plot.h
  213. X    help.h
  214. X    scanner.o
  215. X    help.o
  216. X    (or sources and original Makefile)
  217. X   so there are two basic ways to make it work. Read carefully.
  218. X
  219. X---------------------------------------------
  220. X
  221. X1. Create new directory, and unshar fchart right there.
  222. X   Rename make.fil to Makefile.
  223. X   Edit Makefile:
  224. X    - set LIBS properly, according to your Gnuplot Makefile.
  225. X    - make GNUP point to Gnuplot directory. Path MUST NOT end with "/".
  226. X   Cross your fingers.
  227. X   Type "make fchart"
  228. X   If OK, it's there, named "fchart".
  229. X
  230. X2. Unshar fchart in Gnuplot directory. My files don't have conflicting
  231. X     names, so thre should be no harm done.
  232. X   Edit make.fil:
  233. X    - set LIBS as above.
  234. X    - define "GNUP=."
  235. X   DO NOT RENAME "make.fil" TO "Makefile" !
  236. X   Cross your fingers.
  237. X   Type "make -f make.fil fchart".
  238. X   If OK, it's there, named "fchart".
  239. X
  240. X---------------------------------------------
  241. X
  242. X   To make documentation, choose 'tex', 'dvi', 'troff' or 'nroff'.
  243. X   "make install" will install program as well as built-in help, but
  244. X   before set properly DEST and HELPDEST in Makefile
  245. X   If you'd like to change the code, read the warning in "fgraf.c".
  246. X
  247. X**********************************************************************
  248. X
  249. X   TERMINALS AND OPTIONS
  250. X
  251. X   Fchart takes only one option: type of terminal to produce output
  252. Xfor.  Terminal settings work like in Gnuplot, and also use GNUTERM
  253. Xenvironment variable. In addition, you can define TERM within "fcmd.c"
  254. Xto be your preferred terminal. This overrides GNUTERM, but can be
  255. Xchanged by init file ".fchart". Then the command line option is used,
  256. Xand makes the final change to the terminal.
  257. X   In this release, TERM is set to "tektronix".
  258. X
  259. X**********************************************************************
  260. X
  261. X   DISCLAIMER 2.
  262. X
  263. X   Sorry for the poor quality of the code. I am only a CS student,
  264. Xworking here on the traineeship. I have almost no experience. I don't
  265. Xlike graphics. And you know this side of student life: the only one
  266. Xplace where you have time to sleep are lectures or your work ...
  267. X
  268. X**********************************************************************
  269. X
  270. X   Please send any suggestions to "fs@uwasa.fi"
  271. X
  272. X**********************************************************************
  273. X
  274. SHAR_EOF
  275. $TOUCH -am 0604152590 README.ins &&
  276. chmod 0666 README.ins ||
  277. echo "restore of README.ins failed"
  278. set `wc -c README.ins`;Wc_c=$1
  279. if test "$Wc_c" != "2949"; then
  280.     echo original size 2949, current size $Wc_c
  281. fi
  282. # ============= fchart.c ==============
  283. echo "x - extracting fchart.c (Text)"
  284. sed 's/^X//' << 'SHAR_EOF' > fchart.c &&
  285. X/* fchart - fchart.c */
  286. X/*
  287. X * Gnuplot code
  288. X * Copyright (C) 1986, 1987, 1990   Thomas Williams, Colin Kelley
  289. X *
  290. X * Permission to use, copy, and distribute this software and its
  291. X * documentation for any purpose with or without fee is hereby granted,
  292. X * provided that the above copyright notice appear in all copies and
  293. X * that both that copyright notice and this permission notice appear
  294. X * in supporting documentation.
  295. X *
  296. X * Permission to modify the software is granted, but not the right to
  297. X * distribute the modified code.  Modifications are to be distributed
  298. X * as patches to released version.
  299. X *
  300. X * This software  is provided "as is" without express or implied warranty.
  301. X *
  302. X *
  303. X * AUTHORS
  304. X *
  305. X *   Original Software:
  306. X *     Thomas Williams,  Colin Kelley.
  307. X *
  308. X *   Gnuplot 2.0 additions:
  309. X *       Russell Lang, Dave Kotz, John Campbell.
  310. X *
  311. X *   fchart changes and additions:
  312. X *       Piotr Filip Sawicki
  313. X *
  314. X * send your comments or suggestions to fs@uwasa.fi
  315. X *
  316. X */
  317. X#include <stdio.h>
  318. X#include <setjmp.h>
  319. X#include <signal.h>
  320. X#include "plot.h"
  321. X#include "fchart.h"
  322. X
  323. X#ifdef MSDOS
  324. X#include <io.h>
  325. X#endif
  326. X#ifdef vms
  327. X#include <unixio.h>
  328. X#endif
  329. X#ifdef __TURBOC__
  330. X#include <graphics.h>
  331. X#endif
  332. X
  333. X/* on some compilers (Turbo C) interrupt is a reserved word
  334. X#ifdef MSDOS               
  335. X#define interrupt intrrtn  
  336. X#endif
  337. X*/
  338. X
  339. Xchar *getenv(),*strcat(),*strcpy(),*strncpy(),*sprintf();
  340. X
  341. Xextern char input_line[];
  342. Xextern FILE *outfile;
  343. Xextern int term;
  344. Xextern struct termentry term_tbl[];
  345. X
  346. X#ifndef STDOUT
  347. X#define STDOUT 1
  348. X#endif
  349. X
  350. Xjmp_buf env;
  351. XBOOLEAN interactive;
  352. X
  353. X#ifdef vms
  354. X
  355. X#define HOME "sys$login:"
  356. X
  357. X#else /* vms */
  358. X#ifdef MSDOS
  359. X
  360. X#define HOME "FCHART"
  361. X
  362. X#else /* MSDOS */
  363. X
  364. X#define HOME "HOME"
  365. X
  366. X#endif /* MSDOS */
  367. X#endif /* vms */
  368. X
  369. X#ifdef unix
  370. X#define PLOTRC ".fchart"
  371. X#else
  372. X#define PLOTRC "fchart.ini"
  373. X#endif
  374. X
  375. X
  376. X#ifdef __TURBOC__
  377. Xvoid tc_interrupt()
  378. X#else
  379. Xvoid inter()        /* why not void in GNUPLOT? lint cried */
  380. X#endif
  381. X{
  382. X#ifdef MSDOS
  383. X#ifdef __TURBOC__
  384. X  (void) signal(SIGINT, tc_interrupt);
  385. X#else
  386. X    void ss_interrupt();
  387. X    (void) signal(SIGINT, ss_interrupt);
  388. X#endif
  389. X#else
  390. X    (void) signal(SIGINT, inter);
  391. X#endif
  392. X    (void) signal(SIGFPE, SIG_DFL);    /* turn off FPE trapping */
  393. X    if (term)
  394. X        (*term_tbl[term].text)();    /* hopefully reset text mode */
  395. X    (void) fflush(outfile);
  396. X    (void) putc('\n',stderr);
  397. X    longjmp(env, TRUE);        /* return to prompt */
  398. X}
  399. X
  400. X
  401. Xmain(argc,argv)
  402. Xint argc;
  403. Xchar *argv[];
  404. X{
  405. X/* Register the Borland Graphics Interface drivers. If they have been */
  406. X/* included by the linker.                                            */
  407. X#ifdef __TURBOC__
  408. Xregisterbgidriver(CGA_driver);
  409. Xregisterbgidriver(EGAVGA_driver);
  410. Xregisterbgidriver(Herc_driver);
  411. X#endif
  412. X
  413. X    setbuf(stderr,(char *)NULL);
  414. X    outfile = stdout; 
  415. X
  416. X    interactive = FALSE;
  417. X    init_terminal();  /* Can set term if it wishes. */
  418. X
  419. X#ifdef TERM        /* set term according to predefined type */
  420. X    term = change_term(TERM, strlen(TERM));
  421. X    if (term < 0)
  422. X        term = 0;    /* ignore error */
  423. X#endif
  424. X
  425. X    interactive = isatty(fileno(stdin));
  426. X    if (interactive) {
  427. X        show_version();
  428. X        if (term != 0)
  429. X            fprintf(stderr,"\tTerminal type: '%s'\n\n",term_tbl[term].name);
  430. X    }
  431. X
  432. X    if (!setjmp(env)) {
  433. X        /* first time */
  434. X        interrupt_setup();
  435. X        load_rcfile();
  436. X        if (argc > 1 && change_term(argv[1],strlen(argv[1])) < 1) {
  437. X            interactive = 0;
  438. X            int_error("wrong terminal type as option, aborted",NO_CARET);
  439. X        }
  440. X    } else {
  441. X        /* come back here from int_error() */
  442. X#ifdef vms
  443. X        /* after catching interrupt */
  444. X        /* VAX stuffs up stdout on SIGINT while writing to stdout,
  445. X           so reopen stdout. */
  446. X        if (outfile = stdout) {
  447. X            if ( (stdout = freopen("SYS$OUTPUT","w",stdout))  == NULL) {
  448. X                /* couldn't reopen it so try opening it instead */
  449. X                if ( (stdout = fopen("SYS$OUTPUT","w"))  == NULL) {
  450. X                    /* don't use int_error here - causes infinite loop! */
  451. X                    fprintf(stderr,"Error opening SYS$OUTPUT as stdout\n");
  452. X                }
  453. X            }
  454. X            outfile = stdout;
  455. X        }
  456. X#endif                  /* VMS */
  457. X        if (!interactive)
  458. X            done(IO_ERROR);            /* exit on non-interactive error */
  459. X    }
  460. X
  461. X
  462. X    while(TRUE)
  463. X        com_line();
  464. X
  465. X/*    done(IO_SUCCESS);  */
  466. X}
  467. X
  468. X
  469. X/* Set up to catch interrupts */
  470. Xinterrupt_setup()
  471. X{
  472. X#ifdef MSDOS
  473. X#ifdef __TURBOC__
  474. X        (void) signal(SIGINT, tc_interrupt);    /* go there on interrupt char */
  475. X#else
  476. X        void ss_interrupt();
  477. X        save_stack();               /* work-around for MSC 4.0/MSDOS 3.x bug */
  478. X        (void) signal(SIGINT, ss_interrupt);
  479. X#endif
  480. X#else /* MSDOS */
  481. X        (void) signal(SIGINT, inter);   /* go there on interrupt char */
  482. X#endif /* MSDOS */
  483. X}
  484. X
  485. X/* Look for a fchart start-up file */
  486. Xload_rcfile()
  487. X{
  488. X    register FILE *plotrc;
  489. X    static char home[80];
  490. X    static char rcfile[sizeof(PLOTRC)+80];
  491. X
  492. X    /* Look for a fchart init file in . or home directory */
  493. X#ifdef vms
  494. X    (void) strcpy(home,HOME);
  495. X#else
  496. X    (void) strcat(strcpy(home,getenv(HOME)),"/");
  497. X#endif                  /* vms */
  498. X    (void) strcpy(rcfile, PLOTRC);
  499. X    plotrc = fopen(rcfile,"r");
  500. X    if (plotrc == (FILE *)NULL) {
  501. X       (void) sprintf(rcfile, "%s%s", home, PLOTRC);
  502. X       plotrc = fopen(rcfile,"r");
  503. X    }
  504. X    if (plotrc)
  505. X     load_file(plotrc);
  506. X}
  507. X
  508. X
  509. X
  510. X
  511. X
  512. X
  513. X
  514. X
  515. X
  516. X
  517. X
  518. X
  519. X
  520. X
  521. X
  522. SHAR_EOF
  523. $TOUCH -am 0604152590 fchart.c &&
  524. chmod 0666 fchart.c ||
  525. echo "restore of fchart.c failed"
  526. set `wc -c fchart.c`;Wc_c=$1
  527. if test "$Wc_c" != "5072"; then
  528.     echo original size 5072, current size $Wc_c
  529. fi
  530. # ============= fchart.doc ==============
  531. echo "x - extracting fchart.doc (Text)"
  532. sed 's/^X//' << 'SHAR_EOF' > fchart.doc &&
  533. X1 fchart
  534. X?
  535. X FCHART is a simple command-driven utility to make bar and pie-charts.
  536. X It should be treated as a previewer before using SAS(R). The program
  537. X is based on the gnuplot v1.2 and 2.0.
  538. X If you are a beginner, first read gnuplot documentation. Other useful
  539. X hints can be found under the following topics:
  540. X `gnuplot` - short comparision of fchart and gnuplot
  541. X `environment` - about environment variables
  542. X `general` - general description of available commands
  543. X `notation` - notation used in this manual
  544. X2 notation
  545. X?notation
  546. X NOTATION USED IN THIS MANUAL:
  547. X@start table
  548. X page     - full-size page of paper or entire screen
  549. X picture  - painted part of page, usually smaller
  550. X /        - delimiter for synonyms of something
  551. X ==       - as above, for whole expression
  552. X { ... }  - optional argument
  553. X |, *, +  - see regexp
  554. X (!)      - something important not to be missed
  555. X <pos>    - positive integer number (real will be truncated)
  556. X <int>    - integer number (real will be truncated)
  557. X <val>    - real number (value)
  558. X <frac>   - fraction of some value (dep. on context):
  559. X            < 0  - error
  560. X            <0,1> - decimal fraction of value
  561. X            > 1  - per cent (%) of value
  562. X            thus 0.5 == 50, 70 == 70%, 1 == 100 (!),
  563. X            for values smaller than 1% use fraction (rare case),
  564. X            for values greater than 1 use %'s (200 == 2 times as ...)
  565. X <range>  - range for several purposes. Two numbers in brackets with
  566. X            ":" as delimiter, eg [1:3], in relation first <= second.
  567. X            Syntax: '[' { <pos> } ':' { <pos> } ']'. First number
  568. X            if omitted is treated as zero (0), second omitted means
  569. X            "to infinity". Both numbers belong to the given range.
  570. X            (!) Omission works different than in Gnuplot.
  571. X#Notion & \  & Explanation \\ \hline
  572. X#page & - &full-size page of paper or entire screen \\
  573. X#picture & - & painted part of page, usually smaller \\
  574. X#/ & - & delimiter for synonyms of something \\
  575. X#== & - & as above, for whole expression \\
  576. X#\verb={ ... }= & - & optional argument \\
  577. X#\verb=|, *, += & - & see regexp \\
  578. X#(!) & - & something important not to be missed \\
  579. X#$<$pos$>$ & - & positive integer number (real will be truncated) \\
  580. X#$<$int$>$ & - & integer number (real will be truncated) \\
  581. X#$<$val$>$ & - & real number (value) \\
  582. X#$<$frac$>$ & - & fraction of some value (dep. on context): \\
  583. X#\ & \ & $<$ 0  - error \\
  584. X#\ & \ & $<$0,1$>$ - decimal fraction of value \\
  585. X#\ & \ & $>$ 1  - per cent (\%) of value \\
  586. X#\ & \ & thus 0.5 == 50, 70 == 70\%, 1 == 100 (!), \\
  587. X#\ & \ & for values smaller than 1\% use fraction (rare case), \\
  588. X#\ & \ & for values greater than 1 use \%'s (200 == 2 times as ...) \\
  589. X#$<$range$>$ & - & range for several purposes. Two numbers in brackets with \\
  590. X#\ & \ & `:' as delimiter, eg \verb=[1:3]=, in relation first $<=$ second. \\
  591. X#\ & \ & Syntax: \verb='[' { <pos> } ':' { <pos> } ']'=. First number \\
  592. X#\ & \ & if omitted is treated as zero (0), second omitted means \\
  593. X#\ & \ & 'to infinity'. Both numbers belong to the given range. \\
  594. X#\ & \ & (!) Omission works different than in Gnuplot. \\
  595. X%Notion@ @Explanation
  596. X%_
  597. X%page@-@full-size page of paper or entire screen
  598. X%picture@-@painted part of page, usually smaller
  599. X%/@-@delimiter for synonyms of something
  600. X%==@-@as above, for whole expression
  601. X%{ ... }@-@optional argument
  602. X%|, *, +@-@see regexp
  603. X%(!)@-@something important not to be missed
  604. X%<pos>@-@positive integer number (real will be truncated)
  605. X%<int>@-@integer number (real will be truncated)
  606. X%<val>@-@real number (value)
  607. X%<frac>@-@fraction of some value (dep. on context):
  608. X% @ @< 0  - error
  609. X% @ @<0,1> - decimal fraction of value
  610. X% @ @> 1  - per cent (%) of value
  611. X% @ @thus 0.5 == 50, 70 == 70%, 1 == 100 (!),
  612. X% @ @for values smaller than 1% use fraction (rare case),
  613. X% @ @for values greater than 1 use %'s (200 == 2 times as ...)
  614. X%<range>@-@range for several purposes. Two numbers in brackets with
  615. X% @ @`:' as delimiter, eg [1:3], in relation first <= second.
  616. X% @ @Syntax: '[' { <pos> } ':' { <pos> } ']'. First number
  617. X% @ @if omitted is treated as zero (0), second omitted means
  618. X% @ @'to infinity'. Both numbers belong to the given range.
  619. X% @ @(!) Omission works different than in Gnuplot.
  620. X
  621. X@end table
  622. X2 fchart vs. gnuplot
  623. X?gnuplot
  624. X Fchart uses the same language as gnuplot, though sometimes the
  625. X meaning of a command/expression can be quite different (!). Fchart
  626. X is data-oriented, thus has no built-in functions and does not perform
  627. X any calculations. For gnuplot compatibility, complex numbers (in
  628. X braces '{}') are accepted, but only their real part is used. Comments
  629. X (#), semicolons(;) and line continuation with backslash (\) work in
  630. X exactly the same way.
  631. X Fchart uses GNUTERM environment variable. Fchart accepts only one
  632. X command-line parameter (unlike Gnuplot (!))  -- type of terminal to
  633. X run on. This has proven to be a good idea.
  634. X2 environment
  635. X?environment
  636. X Fchart uses the same variables as gnuplot, except for FCHARTHELP,
  637. X which can be defined as a path to the help file. On VMS, FCHART$HELP
  638. X should be used instead. 
  639. X In additon, HOME directory is searched on startup for initial file
  640. X called ".fchart" (or equivalent, see "start-up").
  641. X2 commands in general
  642. X?general
  643. X?terminal
  644. X?output
  645. X?size
  646. X?title
  647. X?zero
  648. X?clear
  649. X?exit
  650. X?quit
  651. X?help
  652. X?load
  653. X?pause
  654. X?replot
  655. X?redraw
  656. X?shell
  657. X?!
  658. X?test 
  659. X?read
  660. X?set terminal
  661. X?set output
  662. X?set size
  663. X?set title
  664. X?set zero
  665. X Several commands are directly taken from Gnuplot:
  666. X        clear
  667. X        exit/quit
  668. X        help/?
  669. X        load
  670. X        pause
  671. X        replot
  672. X        shell
  673. X        !
  674. X        test
  675. X These commands are NOT described in this help.
  676. X In addition, there are two synonyms:
  677. X        load/read
  678. X        replot/redraw
  679. X Some other `set`-`show` parameters also have the same meaning:
  680. X        set terminal
  681. X        set output
  682. X        set size
  683. X        set title
  684. X        set zero
  685. X and thus are NOT described here.
  686. X2 save
  687. X?save
  688. X Syntax:
  689. X        save "filename" {{,} "string"}*
  690. X Saves all current settings in the given file. This file can be used
  691. X later with `load`/`read` command. Additional (optional) parameters
  692. X are saved in the file as leading comments, one string per line.
  693. X?set pie
  694. X?set bar
  695. X2 set-show
  696. X?set
  697. X?show
  698. X The `set` command sets LOTS of options. Type:
  699. X        set
  700. X to get names of all possible parameters. The `show` commands shows 
  701. X their settings.  `show all` shows all the settings.
  702. X In addition, `show` groups some related parameters; type:
  703. X        show general
  704. X to see parameters used for any pictures
  705. X        show bar
  706. X to see parameters affecting bar charts
  707. X        show pie
  708. X to see parameters affecting pie charts
  709. X        show version
  710. X to see the version of program you are working in.
  711. X To get information about a parameter, type
  712. X        help <parameter name>
  713. X2 general parameters
  714. X3 parameters for input
  715. X4 range
  716. X?set range
  717. X?show range
  718. X?range
  719. X Syntax:
  720. X        show range
  721. X        set range { <range> }
  722. X (initial and default: `[ : ]`)
  723. X Focuses input on a part of data file, within given range (incl.
  724. X boundaries). Skips comments, and only proper values are counted. 
  725. X Lines are numbered starting from 0.
  726. X4 input (and input format)
  727. X?set input
  728. X?show input
  729. X?input
  730. X Syntax:
  731. X        show input
  732. X        set input { gnuplot | private | customized }
  733. X (initial and default: `private`)
  734. X Sets global type of input files (this can be overriden for
  735. X individual files, and all types can be freely mixed).
  736. X Format of input files:
  737. X        gnuplot
  738. X Accepts generic gnuplot files. Comments are skipped. Empty line
  739. X produces "missing value". Only one number present is used as a value.
  740. X If two are present, the second is treated as a value, and the first is
  741. X taken as a label (for bar or slice). This produces stupidity for some
  742. X data, but works well for other, date-oriented, like "Gnu population in
  743. X Antarctica since 1965".
  744. X        private
  745. X Reverse of gnuplot format: value, blank, label (optional). 
  746. X        customized
  747. X Accepts any fixed-field-length (e.g. SAS) files. No comments. Empty 
  748. X line produces error, and the standard form of missing value (spaces 
  749. X and dot) is supported. To describe required format use `set customized`
  750. X command.
  751. X4 customized
  752. X?set customized
  753. X?show customized
  754. X?customized
  755. X Syntax:
  756. X        show customized
  757. X        set customized { <range> { {,} <range> }}
  758. X (initial and default: undefined)
  759. X Sets ranges for value and (optional) for label: where should they be
  760. X looked for in the line of data file? Ranges cannot overlap. Format is
  761. X quite flexible (see description of ranges), and the only error occurs
  762. X if the input line is shorter than that expected for given starting
  763. X place of value. Characters are numbered from 0.
  764. X3 parameters for picture
  765. X4 frame
  766. X?set frame
  767. X?show frame
  768. X?frame
  769. X Syntax:
  770. X        show frame
  771. X        set frame
  772. X        set noframe
  773. X (initial: ON)
  774. X Controls frame drawing. Frame is drawn around a page (!), not the
  775. X picture.
  776. X4 offsets
  777. X?set offsets
  778. X?show offsets
  779. X?offsets
  780. X Syntax:
  781. X        show offsets
  782. X        set offsets { <frac> {, <frac> {, <frac> {, <frac> }}}}
  783. X (initial and default: 0,0,0,0)
  784. X Sets the size and position of the picture on the page (!). Fractions
  785. X are in terms of screen size and mean, respectively, left, right, top
  786. X and bottom. Of course, it is necessary that left+right and bottom+top
  787. X are less than 100%. E.g., to get the picture in the lower right corner
  788. X of page, specify `set off 50, 0, 50, 0` == `set off 0.5, 0, 0.5, 0`.
  789. X Offsets can be useful for piecharts with very long labels, since labels
  790. X (as well as the picture title) can exceed given boundary (unlike graph
  791. X itself).
  792. X4 logarithmic scale
  793. X?set logscale
  794. X?show logscale
  795. X?logscale
  796. X Syntax:
  797. X        show logscale
  798. X        set logscale
  799. X        set nologscale
  800. X (initial: OFF)
  801. X Obvious. For logscale, all data entries must be > 0, as well as the
  802. X base for bars.
  803. X4 highlighting
  804. X?set highlight
  805. X?show highlight
  806. X?highlight
  807. X Syntax:
  808. X        show highlight
  809. X        set highlight { none | minim | maxim | <pos> }
  810. X (initial and default: `none`)
  811. X Sets global (!) highlighting, for all data. Highlighted element is
  812. X drawn in a different color for bars or explodes for piecharts. Given
  813. X number is just a number of element to be highlighted (in all the
  814. X files), and refers, counting from 0, to _the first value read-in_ (!),
  815. X not to the very first in the file . Can be also set individually for 
  816. X each file.
  817. X4 styles
  818. X?set style
  819. X?show style
  820. X?style
  821. X Syntax:
  822. X        show style
  823. X        set style piechart | adjacent_bars | stacked_bars | layered_bars
  824. X (initial: `adjacent_bars`)
  825. X Sets the style of graph. Names are obvious, go and try.
  826. X4 arrows
  827. X?set arrow
  828. X?set noarrow
  829. X?show arrow
  830. X?arrow
  831. X Syntax:
  832. X        show arrow { tag }
  833. X        set arrow { tag } 
  834. X            { from {page|picture} <val>,<val> }
  835. X            { to {page|picture} <val>,<val> }
  836. X (defaults: <first unused tag>, `picture` 0,0, `picture` 0,0)
  837. X        set noarrow { tag }
  838. X (default: all arrows)
  839. X This command allows you to add pointing arrows to the graph.
  840. X The `tag` is an integer that is used to identify the arrow. 
  841. X If no tag is given, the lowest unused tag value is assigned
  842. X automatically. The tag can be used to delete or change a specific
  843. X arrow. To change any attribute of an existing arrow, use the `set
  844. X arrow` command with the appropriate tag, and specify the parts of the
  845. X arrow to be changed.
  846. X All positions are denoted in any of two coordinate systems: either as
  847. X real numbers <0,1> on the ideal drawing area <0,1>x<0,1>, or as an
  848. X integers for virtual drawing board with resolution 100000x100000.
  849. X Coordinates can refer to physical page or the picture being drawn.
  850. X Arrows in the picture coordinate system follow the changes of the
  851. X picture size and position (see `set offsets`), while those on the page
  852. X are constant. An arrow can of course be drawn `from page` `to picture`
  853. X and vice versa.
  854. X See also `set line`.
  855. X4 lines
  856. X?set line
  857. X?set noline
  858. X?show line
  859. X?line
  860. X Syntax:
  861. X        show line { tag }
  862. X        set line { <same syntax as for arrows> }
  863. X        set noline { tag }
  864. X (defaults: see `set arrow`)
  865. X This command allows you to draw an arbitrary line. Lines are in
  866. X reality arrows without heads, and share with them the tag system.
  867. X Also `show line` == `show arrow` and `set noline` == `set noarrow`.
  868. X For more information, see `set arrow`.
  869. X To change line to arrow, type:
  870. X        set arrow <tag of existing line>
  871. X To change arrow to line, type:
  872. X        set line <tag of existing arrow>
  873. X3 parameters for printed text
  874. X4 format
  875. X?set format
  876. X?show format
  877. X?format
  878. X Syntax:
  879. X       show format
  880. X       set format { "string" }
  881. X (initial and default: "%g")
  882. X Sets format for all numerical values printed on picture (!).
  883. X Restrictions as in gnuplot. This is a very important parameter for
  884. X labeling -- if that doesn't work correctly, change format. Further
  885. X information can be found in the gnuplot manual.
  886. X4 font
  887. X?set font
  888. X?show font
  889. X?font
  890. X Syntax:
  891. X        show font
  892. X        set font { never | when_needed | rotated | always }
  893. X (initial: `when_needed`)
  894. X (default: `always`)
  895. X Sets usage of built-in vector font:
  896. X@start table
  897. X   always, never - obvious
  898. X   when_needed   - font is used when printed text:
  899. X                   * should fit within the given boundary
  900. X                   * is to be rotated, and terminal can't do that
  901. X   rotated       - as `when_needed`, but _always_(!) for rotated text;
  902. X                   useful for some terminals, like 'regis' and 'latex'
  903. X#Value & \ & Meaning \\ \hline
  904. X#\verb=always=, \verb=never= & - & obvious \\
  905. X#\verb=when_needed= & - & font is used when printed text: \\
  906. X#\ & \ & * should fit within the given boundary \\
  907. X#\ & \ & * is to be rotated, and terminal can't do that \\
  908. X#\verb=rotated= & - & as \verb=when_needed=, but \_always\_ (!) for rotated text; \\
  909. X#\ & \ & useful for some terminals, like 'regis' and 'latex' \\
  910. X%Value@ @Meaning
  911. X%always, never@-@obvious
  912. X%when_needed@-@font is used when printed text:
  913. X% @ @* should fit within the given boundary
  914. X% @ @* is to be rotated, and terminal can't do that
  915. X%rotated@-@as 'when_needed', but _always_ (!) for rotated text;
  916. X% @ @useful for some terminals, like 'regis' and 'latex'
  917. X
  918. X@end table
  919. X4 truncate
  920. X?set truncate
  921. X?show truncate
  922. X?truncate
  923. X Syntax:
  924. X        show truncate
  925. X        set notruncate
  926. X        set truncate { <pos> }
  927. X (initial: OFF)
  928. X (default: 0)
  929. X
  930. X Sets maximal length for labels from data files. Command `set truncate`
  931. X will simply ignore all the user labels (see also `set autolabeling`).
  932. X4 autolabeling
  933. X?set autolabeling
  934. X?show autolabeling
  935. X?autolabeling
  936. X Syntax:
  937. X        show autolabeling
  938. X        set autolabeling
  939. X        set noautolabeling
  940. X (initial: OFF)
  941. X Labels read from data files are striped, i.e. all leading and
  942. X trailing spaces are _always_ removed. If all labels are undefined, and
  943. X this parameter is ON, program will generate numbers starting with the
  944. X number of the first read element (i.e. left boundary from `set
  945. X range`). Rules for multiple elements (e.g. one stack or one column in
  946. X "layered style") are different:
  947. X - all undefined : autogenerate (if ON)
  948. X - all the same (with some undefined) : draw (one of) them
  949. X - different : nothing is drawn
  950. X4 labels
  951. X?set label
  952. X?set nolabel
  953. X?show label
  954. X?label
  955. X Syntax:
  956. X        show label { <tag> }
  957. X        set nolabel { <tag> }
  958. X (default: all labels)
  959. X        set label { <tag> } { "text" }
  960. X            { left | centre | right }
  961. X            { at {page|picture} <val>,<val> }
  962. X            { height <val> }
  963. X            { width <val> }
  964. X            { horizontal | vertical |
  965. X              direction left | right | up | down |
  966. X              west | east | south | north |
  967. X              rotation <val> }
  968. X (defaults: <first unused tag>, "", `left`, at `picture` 0,0,
  969. X height 0, width 0, `horizontal`)
  970. X This command places a label on the graph. Here is a brief description
  971. X of the parameters:
  972. X `<tag>` -- integer to identify a label. See also `set arrow`.
  973. X "text" -- text of the label. Defaults to empty: "".
  974. X The third parameter sets desired justification of the label around
  975. X its position. This parameter can be put also _after_ `at` phrase.
  976. X `at` phrase gives the position for the label. For the exact meaning
  977. X of its subparts, see `set arrow`.
  978. X `height` and `width` specify desired height and width of text.
  979. X Unfortunately, text cannot be stretched, so only one of them should be
  980. X given. If both are set, text will be no higher than `height` and no
  981. X wider than `width`, but nothing more is certain.
  982. X Values of `height` and `width` refer to the page or picture, in
  983. X accordance with the `at` phrase. Exact meaning of values for both is
  984. X the same as for positions (see `set arrow`).
  985. X Note: both values refer to the resulting size of character bounding
  986. X box, not character itself (boundig box is 30% higher and 20% wider).
  987. X The last parameter specifies desired direction the text should be
  988. X drawn in. The names are obvious, and `rotation` is an arbitrary angle
  989. X in radians (positive angle counts counterclockwise).
  990. X Rules for using fonts with labels:
  991. X@start table
  992. X       ----------------------------------------------
  993. X       | height & width & direction   ==> font      |
  994. X       ----------------------------------------------
  995. X       |    both  0     | horizontal,  | follows    |
  996. X       |                | east, right, | common     |
  997. X       |                | vertical,    | rules by   |
  998. X       |                | up, north    | `set font` |
  999. X       ----------------------------------------------
  1000. X       |      any       | other than   | built-in   |
  1001. X       |                | above        | vector f.  |
  1002. X       ----------------------------------------------
  1003. X       | given one of   |     any      | built-in   |
  1004. X       | them or both   |              | vector f.  |
  1005. X       ----------------------------------------------
  1006. X# height \& width & direction & resulting font \\ \hline
  1007. X# both 0 & horizontal, east, right, & follows common rules \\
  1008. X# \      & vertical, up, north & given by \verb=set font= \\ \hline
  1009. X# any    & other than above & built-in vector font \\ \hline
  1010. X# given any of them & any & built-in vector font \\
  1011. X%height & width @ direction @ resulting font
  1012. X%_
  1013. X%both 0 @ horizontal, east, right, @ follows common rules
  1014. X%       @ vertical, up, north @ given by "set font"
  1015. X%_
  1016. X%any    @ other than above @ built-in vector font
  1017. X%_
  1018. X% given any of them @ any @ built-in vector font
  1019. X@end table
  1020. X2 settings for bars
  1021. X3 autoscale
  1022. X?set bar autoscale
  1023. X?show autoscale
  1024. X?autoscale
  1025. X Syntax:
  1026. X        show autoscale
  1027. X        set bar autoscale
  1028. X        set bar noautoscale
  1029. X (initial: ON)
  1030. X Controls rounding and drawing of axes for bars. Check it. Axes are
  1031. X drawn on the left side of bars, looking from base. There's no way to
  1032. X change ticking and naming the axis. Ticking algorithm is not very
  1033. X clever, although it will never overlap ticking labels.
  1034. X3 base
  1035. X?set bar base
  1036. X?show base
  1037. X?base
  1038. X Syntax:
  1039. X        show base
  1040. X        set bar base { <val> }
  1041. X (initial and default: 0)
  1042. X Sets base for bars. Should be 0 for stacked ones and at least 1 for
  1043. X logscale ON. Sometimes useful, though eats a lot of code.
  1044. X3 clockwise
  1045. X?set bar clockwise
  1046. X?show clockwise
  1047. X?clockwise
  1048. X Syntax:
  1049. X        show clockwise
  1050. X        set bar clockwise
  1051. X        set bar counter_clockwise
  1052. X (initial: `clockwise`)
  1053. X Direction for drawing bars. "Clockwise" means left to right looking
  1054. X from base. Useful for strange gravitation.
  1055. X Parameter for pies -- painfully obvious.
  1056. X3 gravitation
  1057. X?set bar gravitation
  1058. X?show gravitation
  1059. X?gravitation
  1060. X Syntax:
  1061. X        show gravitation
  1062. X        set bar gravitation { left | top | right | bottom }
  1063. X        set bar gravitation { west | north | east | south }
  1064. X (initial and default: `bottom`/`south`)
  1065. X Sets gravitation for bars, i.e. on what side base should be drawn.
  1066. X That is different from just turning page to the left or right.
  1067. X3 width
  1068. X?set bar width
  1069. X?show width
  1070. X?width
  1071. X Syntax:
  1072. X        show width
  1073. X        set bar width { <frac> {, <frac> {, <frac> }}}
  1074. X (initial and default: 0.2, 0.2, 0.5)
  1075. X Sets bar parameters: maximal allowable width (as a fraction of
  1076. X picture size), space between bars and space between groups of bars
  1077. X (last two as a fraction of bar width chosen by program), respectively.
  1078. X If counted bar width is bigger than allowable, this value is taken and
  1079. X a smaller graph is centered within picture. There is no way to set the
  1080. X standard bar width, determined by picture size and number of bars.
  1081. X2 settings for pies
  1082. X3 clockwise
  1083. X?set pie clockwise
  1084. X?show clockwise
  1085. X Syntax:
  1086. X        show clockwise
  1087. X        set pie clockwise
  1088. X        set pie counter_clockwise
  1089. X (initial: `clockwise`)
  1090. X Obvious.
  1091. X3 explode
  1092. X?set pie explode
  1093. X?set explode
  1094. X?explode
  1095. X Syntax:
  1096. X        show explode
  1097. X        set pie explode { <params as for bar gravitation> }
  1098. X (initial and default: random)
  1099. X Sets direction of exploding slice (if highlighting != none).
  1100. X Obvious. "Random" means that pie is drawn from top, and a slice will
  1101. X explode "outside", just where it should and can.
  1102. X3 radius
  1103. X?set pie radius
  1104. X?show radius
  1105. X?radius
  1106. X Syntax:
  1107. X        show radius
  1108. X        set pie radius { <frac> }
  1109. X (initial and default: 0.3)
  1110. X Sets exploding distance (!) for hightlited slice -- as a fraction
  1111. X of the pie radius. Radius depends on the picture size and exploding
  1112. X distance, and there is no way to change it.
  1113. X3 sample
  1114. X?set pie sample
  1115. X?show sample
  1116. X?sample
  1117. X Syntax:
  1118. X        show sample
  1119. X        set pie sample <pos>
  1120. X (initial: 160)
  1121. X Number of samples for drawing arcs. Depends on screen resolution.
  1122. X3 threshold
  1123. X?set pie threshold
  1124. X?show threshold
  1125. X?threshold
  1126. X Syntax:
  1127. X        show threshold
  1128. X        set pie threshold { <frac> { "name" }}
  1129. X (initial and default: 0, "other")
  1130. X Threshold for combining slices that are too small into one. Expressed
  1131. X as a fraction of whole pie (i.e. 360 deg or 2Pi rad). Must be < 100.
  1132. X If highlighting is != none, sices are not combined (!). Combined slice
  1133. X is labeled with the given "name".
  1134. X2 getting picture -- plot command
  1135. X?plot
  1136. X?draw
  1137. X?tplot
  1138. X?tdraw
  1139. X There are 6 commands to do that, but in two ways only:
  1140. X        plot/draw
  1141. X        tplot/tdraw/trans_plot/trans_draw
  1142. X They differ in treating incoming values:
  1143. X * In `plot`, data from one file create one unit (pie, layer, stack or
  1144. X group, depending on style).
  1145. X * In `tplot`, one unit is created from many files, thus first value
  1146. X from all the files forms one unit, second value next one, and so on.
  1147. X It is just like trasposition of data matrix, and hence the name.
  1148. X Of course, files need not be the same length, since units can be of
  1149. X different size. Files can be of different input style, also.
  1150. X Full syntax:
  1151. X        plot/tplot
  1152. X            { <range> }
  1153. X            { (style) } "filename" 
  1154. X                { as "name" }
  1155. X                { highlighting <type of highlighting> } 
  1156. X            { , <same syntax as above> }*
  1157. X where :
  1158. X `range` overrides `set range` (permanently (!)),
  1159. X `style` is the name of style in parenthesis (which means that though
  1160. X styles can be freely mixed, only one customized style can be used at
  1161. X once -- this limitation probably should be changed), e.g. "(gnu)",
  1162. X `as` phrase gives the label to be used instead of filename, and
  1163. X `highlighting` sets _local_ highlighting (bogus for `tplot`).
  1164. X Note: to turn off highlighting, `none` must be specified explicitly.
  1165. X2 start-up
  1166. X?startup
  1167. X?start
  1168. X?.fchart
  1169. X?fchart.ini
  1170. X When fchart is run, it looks for an initialization file to load. 
  1171. X This file is called `.fchart` on Unix , and `FCHART.INI` on other
  1172. X systems.  If this file is not found in the current directory, the
  1173. X program will look for it in your home directory (under MS-DOS, the
  1174. X environment variable `FCHART` should contain the name of this
  1175. X directory).
  1176. X If this file is found, fchart executes the commands in this file.
  1177. X This is most useful for setting your terminal type and other
  1178. X parameters.
  1179. X By default, output is sent to "stdout", and thus can be redirected.
  1180. X All messages go to "stderr".
  1181. X2 bugs
  1182. X?bugs
  1183. X Lots of, probably. The most important is wrong bar centering.
  1184. SHAR_EOF
  1185. $TOUCH -am 0604152590 fchart.doc &&
  1186. chmod 0666 fchart.doc ||
  1187. echo "restore of fchart.doc failed"
  1188. set `wc -c fchart.doc`;Wc_c=$1
  1189. if test "$Wc_c" != "23815"; then
  1190.     echo original size 23815, current size $Wc_c
  1191. fi
  1192. # ============= fchart.h ==============
  1193. echo "x - extracting fchart.h (Text)"
  1194. sed 's/^X//' << 'SHAR_EOF' > fchart.h &&
  1195. X/* Fchart - fchart.h 
  1196. X *
  1197. X * Copyright (C) 1990 Piotr Filip Sawicki
  1198. X *
  1199. X * Permission to use, copy, and distribute this software and its
  1200. X * documentation for any purpose with or without fee is hereby granted,
  1201. X * provided that the above copyright notice appear in all copies and
  1202. X * that both that copyright notice and this permission notice appear
  1203. X * in supporting documentation.
  1204. X *
  1205. X * Permission to modify the software is granted, but not the right to
  1206. X * distribute the modified code.  Modifications are to be distributed
  1207. X * as patches to released version.
  1208. X *
  1209. X * This software  is provided "as is" without express or implied warranty.
  1210. X *
  1211. X * send your comments or suggestions to fs@uwasa.fi
  1212. X *
  1213. X */
  1214. X
  1215. X#ifdef PROGRAM
  1216. X#undef PROGRAM
  1217. X#endif
  1218. X#ifdef PROMPT
  1219. X#undef PROMPT
  1220. X#endif
  1221. X#ifdef HELP
  1222. X#undef HELP
  1223. X#endif
  1224. X
  1225. X#define PROGRAM "FCHART"
  1226. X#define PROMPT "command> "
  1227. X#define EXP_PROMPT "cont: "
  1228. X
  1229. X#ifdef vms
  1230. X#define HELP  "fchart "
  1231. X#else /* vms */
  1232. X#define HELP  "/usr/local/bin/help fchart"
  1233. X#endif /* vms */
  1234. X
  1235. X#ifdef TERM
  1236. X#undef TERM
  1237. X#endif
  1238. X
  1239. X#ifdef PC
  1240. X#define TERM "egalib"
  1241. X#else
  1242. X#ifdef UNIXPC
  1243. X#define TERM "unixpc"
  1244. X#else
  1245. X#define TERM "tek40xx"        /* put your most common term type here! */    
  1246. X#endif 
  1247. X#endif
  1248. X
  1249. Xenum DRAW_STYLE {
  1250. X    SBAR, ABARS, LAYB, PIECHART
  1251. X};
  1252. X
  1253. Xenum GRAV_DIR {
  1254. X    NORTH=0, WEST=1, SOUTH=2, EAST=3, DEFAULT   /* for exploding parts of piechart only */
  1255. X};
  1256. X
  1257. Xenum INP_STYLE {
  1258. X    GNUPLOT, PRIVATE, CUSTOMD
  1259. X};
  1260. X
  1261. Xenum FONT_STYLE {
  1262. X    F_NEVER=0, F_WHENN=1, F_ROTAT=2, F_ALWYS=3
  1263. X};
  1264. X
  1265. X#define HL_MIN -3
  1266. X#define HL_MAX -2
  1267. X#define HL_NON -1
  1268. Xextern int HLitem;
  1269. X
  1270. Xstruct pair {
  1271. X    int from, upto;
  1272. X};    
  1273. X
  1274. X#ifdef PC
  1275. Xtypedef float vreal;        /* "virtual" real */
  1276. X#define CH_INIT_SIZE 50        /* initial size of data chunk */
  1277. X
  1278. X#else
  1279. Xtypedef double vreal;
  1280. X#define CH_INIT_SIZE 200
  1281. X
  1282. X#endif
  1283. X
  1284. Xstruct chunk {            /* chunk of data */
  1285. X    vreal *dval;        /* array of values */
  1286. X    char **vlbl;        /* array of labels */
  1287. X    int    used;        /* number of used elements */
  1288. X    struct chunk *next;    /* next chunk */
  1289. X};
  1290. X
  1291. Xstruct dfile {                /* NORMAL FILE record */            /* DATA_HEAD */
  1292. X    char *fname;            /* name of data file */                /* title of the picture */
  1293. X    vreal d_min, d_max;        /* min & max data value */            /* min & max of all values */
  1294. X    int  points, chunks;    /* number of points and chunks */    /* total num. of points and files */
  1295. X    int  makeHL;            /* item to highlit */                /* global HL request */
  1296. X    BOOLEAN labels;            /* can we generate labels? */        /* global autolabel request */ 
  1297. X    struct chunk *data;        /* head of chunk list */            /* used for indexes when xploting */
  1298. X    struct dfile *dnxt;        /* next data file */                /* begining of file list */
  1299. X};
  1300. X
  1301. Xstruct xptr {                /* structure for cross ploting thru several data files */
  1302. X    struct chunk *chnp;        /* pointer to current chunk */
  1303. X    int vindex;                /* index to current element in it */
  1304. X};
  1305. X
  1306. X#ifdef NO_ROMAN_FONT
  1307. Xstruct Char {
  1308. X    int wid;
  1309. X    unsigned char *def[3];
  1310. X};
  1311. X#define CHAR_OFF 100
  1312. X#define CHAR_GRD 256
  1313. X#else
  1314. Xstruct Char {
  1315. X    int wid;
  1316. X    int *def;
  1317. X};
  1318. X#define CHAR_OFF 10
  1319. X#define CHAR_GRD 80
  1320. X#endif
  1321. X
  1322. Xtypedef double MATRIX[3][3];
  1323. X
  1324. Xextern BOOLEAN interactive;
  1325. X
  1326. Xenum LAB_ROT {                    /* order sagnificant */
  1327. X    L_NORMAL, L_BOTTOM, L_UPSIDE, L_TOP, L_RANDOM
  1328. X};
  1329. X
  1330. Xstruct label_def {
  1331. X    struct label_def *next;    /* pointer to next label in linked list */
  1332. X    int tag;                    /* identifies the label */
  1333. X    double x,y;                    /* position ... */
  1334. X    BOOLEAN paged;                /* on page or picture */
  1335. X    enum JUSTIFY pos;
  1336. X    char text[MAX_LINE_LEN+1];
  1337. X    enum LAB_ROT rot;
  1338. X    double h, w, a;                /* height, width, angle */
  1339. X};
  1340. X
  1341. X#define RESOLUTION 100000        /* ideal resolution for labels */
  1342. X
  1343. Xstruct linearrow_def {
  1344. X    struct linearrow_def *next; /* pointer to next arrow in linked list */
  1345. X    BOOLEAN arrow;                /* arrow or line */
  1346. X    int tag;                    /* identifies the arrow */
  1347. X    double sx,sy;               /* start position ... */
  1348. X    BOOLEAN startp;                /* ... on page ? */
  1349. X    double ex,ey;                  /* end position ... */
  1350. X    BOOLEAN endp;                /* ... on page ? */
  1351. X};
  1352. X
  1353. X
  1354. SHAR_EOF
  1355. $TOUCH -am 0604152590 fchart.h &&
  1356. chmod 0666 fchart.h ||
  1357. echo "restore of fchart.h failed"
  1358. set `wc -c fchart.h`;Wc_c=$1
  1359. if test "$Wc_c" != "3906"; then
  1360.     echo original size 3906, current size $Wc_c
  1361. fi
  1362. echo "End of part 1, continue with part 2"
  1363. exit 0
  1364.