home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / fchart.lzh / fchart.1 next >
Encoding:
Text File  |  1990-06-09  |  42.1 KB  |  1,430 lines

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