home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-04-06 | 35.3 KB | 1,405 lines |
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 23 (of 32)."
- # Contents: starchart/starmain.c
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'starchart/starmain.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'starchart/starmain.c'\"
- else
- echo shar: Extracting \"'starchart/starmain.c'\" \(33377 characters\)
- sed "s/^X//" >'starchart/starmain.c' <<'END_OF_FILE'
- X/*
- X * starmain.c, starchart.c without routines moved to starsupp.c
- X * starchart.c -- version 2, September 1987
- X * revision 2.1 December, 1987
- X * revision 3.2 February 1990
- X * contact Craig Counterman, email: ccount@athena.mit.edu
- X *
- X * Portions Copyright (c) 1987 by Alan Paeth (awpaeth@watcgl)
- X *
- X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
- X *
- X * This software may be redistributed freely, not sold.
- X * This copyright notice and disclaimer of warranty must remain
- X * unchanged.
- X *
- X * No representation is made about the suitability of this
- X * software for any purpose. It is provided "as is" without express or
- X * implied warranty, to the extent permitted by applicable law.
- X *
- X * DISCLAIMER OF WARRANTY
- X * ----------------------
- X * The author disclaims all warranties with regard to this software to
- X * the extent permitted by applicable law, including all implied
- X * warranties of merchantability and fitness. In no event shall the
- X * author be liable for any special, indirect or consequential damages or
- X * any damages whatsoever resulting from loss of use, data or profits,
- X * whether in an action of contract, negligence or other tortious action,
- X * arising out of or in connection with the use or performance of this
- X * software.
- X *
- X */
- X
- X/*
- X ! Version 2 modification authors:
- X !
- X ! [a] Petri Launiainen, pl@intrin.FI (with Jyrki Yli-Nokari, jty@intrin.FI)
- X ! [b] Bob Tidd, inp@VIOLET.BERKELEY.EDU
- X ! [c] Alan Paeth, awpaeth@watcgl
- X !
- X */
- X
- Xstatic char rcsid[]="$Header: starmain.c,v 2.15 90/03/10 15:31:37 ccount Exp $";
- X
- X#include <stdio.h>
- X#include <math.h>
- X#ifndef SYSV
- X#include <strings.h>
- X#else
- X#include <string.h>
- X#endif
- X#include <ctype.h>
- X
- X#include "star3.h"
- X#include "parse_input.h"
- X
- X#ifndef READMODE
- X#define READMODE "r"
- X#endif
- X#define OPENFAIL 0
- X#define LINELEN 82
- X
- X#ifndef MAXPATHLEN
- X#define MAXPATHLEN 1025
- X#endif
- X
- X/* PI / 180 = .0174532925199 */
- X#define DCOS(x) (cos((x)*.0174532925199))
- X#define DSIN(x) (sin((x)*.0174532925199))
- X#define DTAN(x) (tan((x)*.0174532925199))
- X#define DASIN(x) (asin(x)/.0174532925199)
- X#define DATAN2(x,y) (atan2(x,y)/.0174532925199)
- X#define MAX(a,b) ((a)>(b)?(a):(b))
- X#define MIN(a,b) ((a)<(b)?(a):(b))
- X
- X/*
- X * default datasets are local, unless defined in Makefile
- X */
- X
- X#ifndef STARFILE
- X#define STARFILE "./yale.star"
- X#endif
- X#ifndef STARFTYPE
- X#define STARFTYPE LINEREAD
- X#endif
- X
- X#ifndef INDEXFILE
- X#define INDEXFILE "./index.indx"
- X#endif
- X#ifndef INDEXFTYPE
- X#define INDEXFTYPE INDEXTYPE
- X#endif
- X
- X#ifndef PLANETFILE
- X#define PLANETFILE "./planet.star"
- X#endif
- X#ifndef PLANETFTYPE
- X#define PLANETFTYPE LINEREAD
- X#endif
- X
- X#ifndef NEBFILE
- X#define NEBFILE "./neb.star"
- X#endif
- X#ifndef NEBFTYPE
- X#define NEBFTYPE LINEREAD
- X#endif
- X
- X#ifndef BOUNDFILE
- X#define BOUNDFILE "./boundaries.star"
- X#endif
- X#ifndef BOUNDFTYPE
- X#define BOUNDFTYPE LINEREAD
- X#endif
- X
- X#ifndef PATTERNFILE
- X#define PATTERNFILE "./pattern.star"
- X#endif
- X#ifndef PATTFTYPE
- X#define PATTFTYPE LINEREAD
- X#endif
- X
- X#ifndef CNAMEFILE
- X#define CNAMEFILE "./cnames.star"
- X#endif
- X#ifndef CNAMEFTYPE
- X#define CNAMEFTYPE LINEREAD
- X#endif
- X
- X#ifndef CONSTFILE
- X#define CONSTFILE "./con.locs"
- X#endif
- X
- X#ifndef RCFILE
- X#define RCFILE "./.starrc"
- X#endif
- X
- X
- X/* arguments */
- Xint g_argc;
- Xchar **g_argv;
- X
- X/* Globals read from command line or set by D_userinput */
- Xchar *progname;
- Xdouble ra, de, sc;
- Xchar *title = "";
- Xdouble all_lbllim, all_maglim, all_gklim;
- Xint use_lbllim = FALSE, use_maglim = FALSE, use_gklim = FALSE;
- X
- Xint user_interact = FALSE;
- X
- Xint precess = FALSE;
- Xdouble to_precess = 2000.0;
- X
- Xdouble all_vmin, all_vmax;
- Xint use_vmin = FALSE;
- Xint nomaglbls = FALSE;
- X
- Xdouble all_rstep, all_dstep;
- Xint use_rstep = FALSE;
- Xint no_ra_grid = FALSE;
- Xint no_dec_grid = FALSE;
- Xdouble all_rstrt = 0.0, all_dstrt = 0.0;
- X
- Xint all_invert = FALSE;
- X
- Xint chart_type = THREEPART;
- X
- Xint all_proj_mode = SANSONS;
- X
- Xchar *rcfile = RCFILE;
- X
- Xchar *constfile = CONSTFILE;
- Xchar *boundfile = BOUNDFILE;
- Xchar boundftype = BOUNDFTYPE;
- Xchar *patternfile = PATTERNFILE;
- Xchar pattftype = PATTFTYPE;
- Xchar *cnamefile = CNAMEFILE;
- Xchar cnameftype = CNAMEFTYPE;
- Xchar *mapfiles[MAXMAPFILES];
- Xint mapftypes[MAXMAPFILES];
- Xint nummapfiles;
- X
- Xmapwindow *mapwin[MAXWINDOWS];
- Xint numwins;
- X
- Xint cur_function;
- Xint cur_map_type;
- Xint cur_map_tag;
- Xchar *cur_tag_field;
- Xchar *cur_file_name = "";
- Xmapwindow *cur_win;
- X
- Xint read_mapwin_file;
- Xint write_mapwin_file;
- Xchar mapwin_file[MAXPATHLEN];
- X
- X
- X/* read file function indirection to allow for use of alternate file readers */
- Xint readstar();
- Xint buf_readstar();
- X/* Macintosh MPW currently doesn't support buf_readstar */
- X#ifndef macintosh
- Xint (*readfile)() = buf_readstar;
- X#else
- Xint (*readfile)() = readstar;
- X#endif
- X
- X/* Readstar globals */
- Xdouble obj_lat, obj_lon, obj_mag;
- Xchar obj_type[] ="SS", obj_color[3], obj_label[3];
- Xchar obj_constell[3], obj_name[LINELEN];
- Xchar *obj_commnt, fileline[LINELEN];
- X
- X/* xform globals */
- Xextern double xf_west, xf_east, xf_north, xf_south, xf_bottom;
- Xextern int xf_xcen, xf_ycen, xf_ybot;
- Xextern int xf_w_left, xf_w_right, xf_w_top, xf_w_bot;
- X
- Xextern double xf_c_scale;
- X
- X/* Other globals */
- Xint all_layer[MAXLAYRS];
- Xint numlayers;
- X
- X/* storage area big enough for inputs */
- Xchar a_title[MAXPATHLEN];
- Xchar a_starfile[MAXPATHLEN];
- Xchar a_indexfile[MAXPATHLEN];
- Xchar a_planetfile[MAXPATHLEN];
- Xchar a_nebfile[MAXPATHLEN];
- Xchar a_constfile[MAXPATHLEN];
- Xchar a_boundfile[MAXPATHLEN];
- Xchar a_patternfile[MAXPATHLEN];
- Xchar a_cnamefile[MAXPATHLEN];
- Xchar a_userfile[MAXMAPFILES][MAXPATHLEN];
- X
- X
- X/* externals */
- Xextern mapwindow fullpage;
- Xextern mapwindow mainmap;
- Xextern mapwindow thumbmap;
- Xextern int htick_lim, htext_lim;
- Xextern int htext_xoff, htext_yoff;
- Xextern int vtick_lim, vtext_lim;
- Xextern int vtext_xoff, vtext_yoff;
- X
- X/* the code */
- Xmain(argc, argv)
- X int argc;
- X char *argv[];
- X{
- X int i, j, k;
- X int imap;
- X int ilay;
- X mapwindow *win;
- X#define COMMBUFLEN 1000
- X char commbuf[COMMBUFLEN+2];
- X FILE *mfile;
- X
- X /* Set global arguments */
- X g_argc = argc;
- X g_argv = argv;
- X progname = g_argv[0];
- X
- X /* Set defaults */
- X ra = 0.0;
- X de = 0.0;
- X sc = 15.0;
- X
- X mapfiles[YALEF] = a_starfile;
- X strcpy(a_starfile, STARFILE);
- X mapfiles[INDXF] = a_indexfile;
- X strcpy(a_indexfile, INDEXFILE);
- X mapfiles[PLANF] = a_planetfile;
- X strcpy(a_planetfile, PLANETFILE);
- X mapfiles[NEBF] = a_nebfile;
- X strcpy(a_nebfile, NEBFILE);
- X mapftypes[YALEF] = STARFTYPE;
- X mapftypes[INDXF] = INDEXFTYPE;
- X mapftypes[PLANF] = PLANETFTYPE;
- X mapftypes[NEBF] = NEBFTYPE;
- X nummapfiles = NUMFS;
- X
- X for (i = 0; i < MAXUFILES; i++) {
- X mapfiles[NUMFS+i] = a_userfile[i];
- X mapftypes[NUMFS+i] = LINEREAD;
- X }
- X
- X all_layer[0] = OUTLINE;
- X all_layer[1] = RA_GRID;
- X all_layer[2] = DEC_GRID;
- X all_layer[3] = ECLIPTIC;
- X all_layer[4] = BOUNDARIES;
- X all_layer[5] = PATTERNS;
- X all_layer[6] = CONSTLNAMES;
- X all_layer[7] = ALLFILES;
- X all_layer[8] = LEGENDS;
- X numlayers = 9;
- X
- X /* Read .starrc or other rc file */
- X if (!rc_read(rcfile));
- X /* couldn't open rcfile, but that's OK */
- X
- X /* Read command line: may override .starrc */
- X if (!commandline());
- X /* no arguments, but that's OK */
- X
- X#ifdef INTERACTIVE_CONTROL
- X while (D_userinput()) {
- X#endif
- X
- X /* set up maps */
- X switch (chart_type) {
- X case THREEPART:
- X mapwin[0] = &mainmap;
- X/* it's okay to have thumbmap in stereographic mode now
- X if (all_proj_mode == STEREOGR) {
- X numwins = 1;
- X } else {
- X mapwin[1] = &thumbmap;
- X numwins = 2;
- X }
- X*/
- X mapwin[1] = &thumbmap;
- X numwins = 2;
- X break;
- X case FULLPAGE:
- X mapwin[0] = &fullpage;
- X numwins = 1;
- X break;
- X default:
- X numwins = 0;
- X break;
- X }
- X
- X
- X for (i = 0; i < numwins; i++) {
- X if (use_maglim)
- X mapwin[i]->maglim = all_maglim;
- X
- X if (use_lbllim) mapwin[i]->lbllim = all_lbllim;
- X if (use_gklim) mapwin[i]->gklim = all_gklim;
- X
- X mapwin[i]->racen = ra;
- X mapwin[i]->dlcen = de;
- X
- X mapwin[i]->scale = sc;
- X
- X mapwin[i]->proj_mode = all_proj_mode;
- X
- X
- X if (use_rstep) {
- X mapwin[i]->draw_ragrid = TRUE;
- X mapwin[i]->draw_decgrid = TRUE;
- X mapwin[i]->ra_step = all_rstep;
- X mapwin[i]->dec_step = all_dstep;
- X mapwin[i]->ra_strt = all_rstrt;
- X mapwin[i]->dec_strt = all_dstrt;
- X }
- X
- X if (no_ra_grid) mapwin[i]->draw_ragrid = FALSE;
- X if (no_dec_grid) mapwin[i]->draw_decgrid = FALSE;
- X
- X if (all_invert) mapwin[i]->invert = TRUE;
- X
- X for (j =0; j < numlayers; j++)
- X mapwin[i]->layer[j] = all_layer[j];
- X mapwin[i]->nlayers= numlayers;
- X
- X for (j =0; j < nummapfiles; j++) {
- X mapwin[i]->file[j].name = mapfiles[j];
- X mapwin[i]->file[j].type = mapftypes[j];
- X mapwin[i]->file[j].maglim = mapwin[i]->maglim;
- X mapwin[i]->file[j].lbllim = mapwin[i]->lbllim;
- X mapwin[i]->file[j].gklim = mapwin[i]->gklim;
- X
- X if (use_vmin) {
- X mapwin[i]->file[j].draw_maglbl = TRUE;
- X mapwin[i]->file[j].maglmin = all_vmin;
- X mapwin[i]->file[j].maglmax = all_vmax;
- X }
- X if (nomaglbls) mapwin[i]->file[j].draw_maglbl = FALSE;
- X }
- X mapwin[i]->numfiles = nummapfiles;
- X }
- X
- X /* Give driver a chance to change the mapwins */
- X fix_mapwin();
- X#ifdef INTERACTIVE_CONTROL
- X if (user_interact)
- X D_mapwininput();
- X#endif
- X
- X
- X /* Begin chart */
- X if (!D_open())
- X die("couldn't open device", "");
- X
- X k = 0;
- X commbuf[0] = '\0';
- X for (i = 0; (i < argc) && (k < COMMBUFLEN); i++) {
- X sprintf(&commbuf[strlen(commbuf)], "%s ", argv[i]);
- X }
- X D_comment(commbuf);
- X
- X /* Write the current settings to mapwin file */
- X /* Must be done here to allow D_open to change settings, esp. window size */
- X if ((write_mapwin_file) && ((mfile = fopen(mapwin_file, "w")) != NULL)) {
- X write_mfile(mfile);
- X fclose(mfile);
- X }
- X
- X if (precess)
- X initprecess(to_precess);
- X
- X
- X D_comment("Start");
- X
- X /* Draw the chart */
- X /* For each map
- X for each layer
- X draw the layer */
- X
- X for (imap = 0; imap < numwins; imap++) {
- X#ifdef INTERACTIVE_CONTROL
- X if (user_interact)
- X if (D_break()) break;
- X#endif
- X win = mapwin[imap];
- X if (!chartparms(win)) continue;
- X if (!initxform(win)) continue; /* initialize xform before using it */
- X
- X cur_map_type = win->map_type;
- X cur_map_tag = win->tag;
- X cur_tag_field = win->tag_field;
- X cur_win = mapwin[imap];
- X
- X for (ilay = 0; ilay < win->nlayers; ilay++) {
- X#ifdef INTERACTIVE_CONTROL
- X if (user_interact)
- X if (D_break()) break;
- X#endif
- X switch (win->layer[ilay]) {
- X case OUTLINE:
- X D_comment("OUTLINE");
- X chartoutline(win);
- X break;
- X case RA_GRID:
- X D_comment("RA_GRID");
- X chartragrid(win);
- X break;
- X case DEC_GRID:
- X D_comment("DEC_GRID");
- X chartdecgrid(win);
- X break;
- X case ECLIPTIC:
- X D_comment("ECLIPTIC");
- X chartecliptic(win);
- X break;
- X case BOUNDARIES:
- X D_comment("BOUNDARIES");
- X chartboundaries(win);
- X break;
- X case PATTERNS:
- X D_comment("PATTERNS");
- X chartpatterns(win);
- X break;
- X case CONSTLNAMES:
- X D_comment("CONSTLNAMES");
- X chartconstlnames(win);
- X break;
- X case ALLFILES:
- X D_comment("ALLFILES");
- X chartmain(win, ALLFILES);
- X break;
- X case ALLGLYPHS:
- X D_comment("ALLGLYPHS");
- X chartmain(win, ALLGLYPHS);
- X break;
- X case ALLNAMES:
- X D_comment("ALLNAMES");
- X chartmain(win, ALLNAMES);
- X break;
- X case ALLMAGLBLS:
- X D_comment("ALLMAGLBLS");
- X chartmain(win, ALLMAGLBLS);
- X break;
- X case ALLVECTORS:
- X D_comment("ALLVECTORS");
- X chartmain(win, ALLVECTORS);
- X break;
- X case ALLAREAS:
- X D_comment("ALLAREAS");
- X chartmain(win, ALLAREAS);
- X break;
- X case LEGENDS:
- X D_comment("LEGENDS");
- X chartlegend(win);
- X break;
- X }
- X }
- X }
- X
- X /* Done chart: close and exit */
- X D_comment("Close");
- X D_close();
- X
- X#ifdef INTERACTIVE_CONTROL
- X }
- X#endif
- X
- X
- X exit(0);
- X}
- X
- X
- Xcommandline()
- X{
- X int j, k;
- X double varmag, varrange;
- X int loc_argc;
- X/*
- X * check command line style
- X */
- X if (g_argc == 1) return (FALSE);
- X
- X if ( (g_argv[1][0] == '-') && g_argv[1][1] ) {
- X/*
- X * new style command line (using flags)
- X */
- X loc_argc = g_argc; /* in case D_control_args changes g_argc */
- X for (j=1; j<loc_argc; j++) {
- X if (g_argv[j][0] != '-') die("unknown argument - '%s'", g_argv[j]);
- X switch (g_argv[j][1]) {
- X
- X#ifdef INTERACTIVE_CONTROL
- X case 'u': user_interact = TRUE; break;
- X#endif
- X
- X case 'r': ra = htod(g_argv[++j])*15.0; break; /* hrs -> deg */
- X case 'd': de = htod(g_argv[++j]); break;
- X case 's': sc = atof(g_argv[++j]); break;
- X
- X case 'm': all_maglim = (double)(atof(g_argv[++j]));
- X use_maglim = TRUE; break;
- X case 'l': all_lbllim = (double)(atof(g_argv[++j]));
- X use_lbllim = TRUE; break;
- X case 'g': all_gklim = (double)(atof(g_argv[++j]));
- X use_gklim = TRUE; break;
- X
- X case 'p':
- X if (((j+1) < loc_argc) && (g_argv[j+1][0] != '-'))
- X {
- X if (k = tr_pmode(g_argv[++j])) {
- X all_proj_mode = k;
- X }
- X }
- X else all_proj_mode = STEREOGR;
- X break;
- X
- X case 'b': chart_type = FULLPAGE; break;
- X
- X case 'i': all_invert = TRUE; break;
- X
- X case 't': title = g_argv[++j]; break;
- X
- X /* can be filename filetype or just filename */
- X case 'y':
- X strcpy(mapfiles[YALEF], g_argv[++j]);
- X if (((j+1) < loc_argc) && (g_argv[j+1][0] != '-') &&
- X tr_fty(g_argv[j+1]))
- X mapftypes[YALEF] = tr_fty(g_argv[++j]);
- X break;
- X case 'h': strcpy(mapfiles[INDXF], g_argv[++j]); break;
- X case 'n':
- X strcpy(mapfiles[NEBF], g_argv[++j]);
- X if (((j+1) < loc_argc) && (g_argv[j+1][0] != '-') &&
- X tr_fty(g_argv[j+1]))
- X mapftypes[NEBF] = tr_fty(g_argv[++j]);
- X break;
- X case 'w':
- X strcpy(mapfiles[PLANF], g_argv[++j]);
- X if (((j+1) < loc_argc) && (g_argv[j+1][0] != '-') &&
- X tr_fty(g_argv[j+1]))
- X mapftypes[PLANF] = tr_fty(g_argv[++j]);
- X break;
- X case 'f':
- X if (nummapfiles == MAXMAPFILES) {
- X fprintf(stderr, "Too many user files\n");
- X j++;
- X } else {
- X strcpy(mapfiles[nummapfiles], g_argv[++j]);
- X if (((j+1) < loc_argc) && (g_argv[j+1][0] != '-') &&
- X tr_fty(g_argv[j+1]))
- X mapftypes[nummapfiles] = tr_fty(g_argv[++j]);
- X else
- X mapftypes[nummapfiles] = LINEREAD;
- X nummapfiles++;
- X }
- X break;
- X
- X case 'c': /* could be -c con or -c con con.locs */
- X if (((j+2) < loc_argc) && (g_argv[j+2][0] != '-'))
- X {
- X constfile = g_argv[j+2];
- X findconst(g_argv[++j]);
- X j++;
- X }
- X else findconst(g_argv[++j]);
- X break;
- X
- X
- X case 'v':
- X if (((j+2) < loc_argc) && (g_argv[j+2][0] != '-')
- X && (g_argv[j+1][0] != '-')) {
- X varmag = atof(g_argv[j+1]);
- X varrange = atof(g_argv[j+2]);
- X use_vmin = TRUE;
- X all_vmin = varmag - varrange;
- X all_vmax = varmag + varrange;
- X j += 2;
- X } else die("Need varmag varrange for -v","");
- X break;
- X
- X case 'x':
- X if (((j+2) < loc_argc) && (g_argv[j+2][0] != '-')
- X && (g_argv[j+1][0] != '-')) {
- X use_rstep = TRUE;
- X all_rstep = htod(g_argv[j+1])*15.0;
- X all_dstep = htod(g_argv[j+2]);
- X if (((j+4) < loc_argc)
- X && (!isalpha(g_argv[j+3][1]))
- X && (!isalpha(g_argv[j+4][1]))) {
- X all_rstrt = htod(g_argv[j+3])*15.0;
- X all_dstrt = htod(g_argv[j+4]);
- X j += 4;
- X } else
- X j += 2;
- X } else die("Need ra_step de_step for -x","");
- X break;
- X
- X case 'e':
- X if (!rc_read(g_argv[++j]))
- X fprintf(stderr,
- X "%s: error, couldn't read rc file '%s'\n",
- X progname, g_argv[j]);
- X break;
- X
- X case 'a':
- X D_control_arg(g_argv[++j]);
- X break;
- X
- X default:
- X if (!ident_arg(&j))
- X die("unknown switch - '%s'", g_argv[j]);
- X break;
- X }
- X if (j == loc_argc) die("trailing command line flag - '%s'", g_argv[j-1]);
- X }
- X }
- X else
- X {
- X /*
- X * old style command line (position dependent)
- X */
- X fprintf(stderr, "Old style command line no longer supported\n");
- X fprintf(stderr, "Please convert:\n");
- X fprintf(stderr, "old: Ra Dcl Scale Title Maglim Labellim\n");
- X fprintf(stderr, "new: -r Ra -d Dcl -s Scale -t Title\n");
- X }
- X return (TRUE);
- X}
- X
- Xdie(a,b)
- X char *a, *b;
- X{
- X /* Currently only Gdos needs this, there appl_exit() is always necessary */
- X#ifdef ATARI_ST
- X D_die(a,b);
- X#endif
- X fprintf(stderr,"%s: ", progname);
- X fprintf(stderr,a,b);
- X fprintf(stderr,"\n");
- X exit(1);
- X}
- X
- Xdouble htod(s)
- X char *s;
- X{
- X /*
- X * htod(str) reads floating point strings of the form {+-}hh.{mm} thus
- X * allowing for fractional values in base 60 (ie, degrees/minutes).
- X */
- X return(ftod(atof(s)));
- X}
- X
- Xdouble ftod(x)
- X double x;
- X{
- X int full;
- X full = x;
- X return(full + (x-full)*100.0/60.0);
- X}
- X
- X
- X/* dtof(x) undoes ftod */
- Xdouble dtof(x)
- X double x;
- X{
- X int full;
- X full = x;
- X return(full + (x-full)*60.0/100.0);
- X}
- X
- X/* Adapted from code from Dean Payne deanp@hplsla.hp.com */
- X/* Format of each line is
- X variable_name variable_value
- Xor variable_name=variable_value
- X
- Xvariable_value may be a string which extends to the end of line.
- XLines must be 80 chars max.
- XComments are anything after a #
- XBlank lines are allowed.
- X*/
- X
- Xrc_read(filename)
- X char *filename;
- X{
- X FILE *sfile;
- X char sbuf[LINELEN], *var_name, *c_buf;
- X double f_buf; /* value parsed as double */
- X int i_buf; /* value parsed as integer */
- X int l_buf; /* value parsed as TRUE or FALSE */
- X int ret_code, var_type;
- X
- X
- X if ((sfile = fopen(filename, READMODE)) == OPENFAIL) return(FALSE);
- X
- X fgets(sbuf, LINELEN, sfile);
- X if (!(strcmp(sbuf,
- X "#mapwin format 1 file: don't edit this line or change order of lines in this file"))) {
- X /* This file is a mapwin file */
- X strncpy(mapwin_file, filename, MAXPATHLEN-1);
- X read_mapwin_file = TRUE;
- X return TRUE;
- X };
- X
- X for (;;) {
- X /* We read the first line into sbuf above, and will read the next line
- X at the bottom of the loop */
- X
- X if (ferror(sfile)) { fprintf(stderr, "file read error\n"); break; }
- X if (feof(sfile)) break;
- X
- X if (!parse_line(sbuf, &var_name, &ret_code, &var_type,
- X &c_buf, &f_buf, &i_buf, &l_buf)) {
- X /* Not recognized by parse routine,
- X see if ident_rc can recognize it */
- X if (!(ident_rc(var_name, c_buf))) {
- X fprintf(stderr, "cannot interpret '%s = %s'\n", var_name, c_buf);
- X help_vars(var_name);
- X }
- X } else
- X switch (ret_code) {
- X case TINT:
- X fprintf(stderr, "int = %d\n", i_buf);
- X fprintf(stderr, "i_buf = %d\n", i_buf);
- X fprintf(stderr, "f_buf = %f\n", f_buf);
- X fprintf(stderr, "l_buf = %d\n", l_buf);
- X fprintf(stderr, "c_buf = %s\n", c_buf);
- X break;
- X case TFLO:
- X fprintf(stderr, "flo = %f\n", f_buf);
- X fprintf(stderr, "i_buf = %d\n", i_buf);
- X fprintf(stderr, "f_buf = %f\n", f_buf);
- X fprintf(stderr, "l_buf = %d\n", l_buf);
- X fprintf(stderr, "c_buf = %s\n", c_buf);
- X break;
- X case TBOOL:
- X fprintf(stderr, "bool = %d\n", l_buf);
- X fprintf(stderr, "i_buf = %d\n", i_buf);
- X fprintf(stderr, "f_buf = %f\n", f_buf);
- X fprintf(stderr, "l_buf = %d\n", l_buf);
- X fprintf(stderr, "c_buf = %s\n", c_buf);
- X break;
- X case TNONE:
- X fprintf(stderr, "none = %s\n", c_buf);
- X fprintf(stderr, "i_buf = %d\n", i_buf);
- X fprintf(stderr, "f_buf = %f\n", f_buf);
- X fprintf(stderr, "l_buf = %d\n", l_buf);
- X fprintf(stderr, "c_buf = %s\n", c_buf);
- X break;
- X case TCHAR:
- X fprintf(stderr, "char = %s\n", c_buf);
- X fprintf(stderr, "i_buf = %d\n", i_buf);
- X fprintf(stderr, "f_buf = %f\n", f_buf);
- X fprintf(stderr, "l_buf = %d\n", l_buf);
- X fprintf(stderr, "c_buf = %s\n", c_buf);
- X break;
- X case R_NONE:
- X /* blank line */
- X break;
- X case END_INPUT:
- X return TRUE;
- X break;
- X case EXIT:
- X exit(0);
- X break;
- X case HELP_ME:
- X help_vars("");
- X break;
- X case WRITE_RC_FILE:
- X {
- X FILE *tfile;
- X
- X if ((tfile = fopen(c_buf, "w")) != NULL)
- X if (rc_write(tfile)) {
- X fclose(tfile);
- X printf("wrote %s\n", c_buf);
- X };
- X };
- X break;
- X default:
- X /* Identified but not special to this routine,
- X try to set variables */
- X if (!set_varvals(var_name, ret_code, var_type,
- X c_buf, f_buf, i_buf, l_buf)) {
- X fprintf(stderr, "cannot interpret '%s = %s'\n", var_name, c_buf);
- X help_vars(var_name);
- X };
- X break;
- X };
- X
- X /* Always call ident_rc */
- X ident_rc(var_name, c_buf);
- X
- X
- X fgets(sbuf, LINELEN, sfile);
- X }
- X fclose(sfile);
- X return (TRUE);
- X}
- X
- X
- Xrc_write(tfile)
- XFILE *tfile;
- X{
- X int i;
- X
- X fprintf(tfile, "ra = %g\n", dtof(ra / 15.0));
- X fprintf(tfile, "dec = %g\n", dtof(de));
- X fprintf(tfile, "scale = %g\n", sc);
- X if (use_lbllim)
- X fprintf(tfile, "namelim = %g\n", all_lbllim);
- X if (use_gklim)
- X fprintf(tfile, "gklim = %g\n", all_gklim);
- X if (use_maglim)
- X fprintf(tfile, "maglim = %g\n", all_maglim);
- X
- X fprintf(tfile, "title = %s\n", title);
- X
- X for (i = 0; i < nummapfiles; i++)
- X fprintf(tfile, "mapfile = %s %s\n", mapfiles[i], inv_ftypes[mapftypes[i]]);
- X
- X fprintf(tfile, "constfile = %s\n", constfile);
- X fprintf(tfile, "boundfile = %s\n", boundfile);
- X fprintf(tfile, "patternfile = %s\n", patternfile);
- X fprintf(tfile, "constlnamefile = %s\n", cnamefile);
- X
- X for (i = 0; i < numlayers; i++)
- X fprintf(tfile, "all_layer = %s\n", inv_layrs[all_layer[i]]);
- X
- X fprintf(tfile, "projection_mode = %s\n", inv_projs[all_proj_mode]);
- X
- X fprintf(tfile, "chart_type = %s\n", inv_ctypes[chart_type]);
- X
- X fprintf(tfile, "invert = %s\n", all_invert ? "true" : "false");
- X
- X if (use_vmin)
- X fprintf(tfile, "vrange %g %g\n", all_vmin, all_vmax);
- X
- X if (use_rstep)
- X fprintf(tfile, "grid %g %g %g %g\n", dtof(all_rstep/15.0), dtof(all_dstep),
- X dtof(all_rstrt/15.0), dtof(all_dstrt));
- X
- X if (precess)
- X fprintf(tfile, "precess_to %g\n", to_precess);
- X
- X i = ferror(tfile);
- X return !i;
- X}
- X
- X
- Xset_varvals(var_name, ret_code, var_type, c_buf, f_buf, i_buf, l_buf)
- X char *var_name;
- X int ret_code, var_type;
- X char *c_buf;
- X double f_buf; /* value parsed as double */
- X int i_buf; /* value parsed as integer */
- X int l_buf; /* value parsed as TRUE or FALSE */
- X{
- X int i;
- X static int nufiles = 0;
- X static int nmapfs = 0;
- X static int nlays = 0;
- X double varmag, varrange;
- X int good_flag;
- X char tbuf1[LINELEN], tbuf2[LINELEN], tbuf3[LINELEN], tbuf4[LINELEN];
- X
- X
- X good_flag = FALSE;
- X
- X switch (ret_code) {
- X case R_RA:
- X ra = htod(c_buf)*15.0;
- X good_flag = TRUE;
- X break;
- X case R_DEC:
- X de = htod(c_buf);
- X good_flag = TRUE;
- X break;
- X case R_SCALE:
- X sc = f_buf;
- X good_flag = TRUE;
- X break;
- X case R_NAMELIM:
- X all_lbllim = f_buf;
- X use_lbllim = TRUE;
- X good_flag = TRUE;
- X break;
- X case R_MAGLIM:
- X all_maglim = f_buf;
- X use_maglim = TRUE;
- X good_flag = TRUE;
- X break;
- X case R_GKLIM:
- X all_gklim = f_buf;
- X use_gklim = TRUE;
- X good_flag = TRUE;
- X break;
- X case R_TITLE:
- X strcpy(a_title, c_buf);
- X title = a_title;
- X good_flag = TRUE;
- X break;
- X case R_STARFILE:
- X strcpy(a_starfile, c_buf);
- X mapfiles[YALEF] = a_starfile;
- X good_flag = TRUE;
- X break;
- X case R_INDEXFILE:
- X strcpy(a_indexfile, c_buf);
- X mapfiles[INDXF] = a_indexfile;
- X good_flag = TRUE;
- X break;
- X case R_NEBFILE:
- X strcpy(a_nebfile, c_buf);
- X mapfiles[NEBF] = a_nebfile;
- X good_flag = TRUE;
- X break;
- X case R_PLANETFILE:
- X strcpy(a_planetfile, c_buf);
- X mapfiles[PLANF] = a_planetfile;
- X good_flag = TRUE;
- X break;
- X case R_USERFILE:
- X if (nummapfiles == MAXMAPFILES) {
- X fprintf(stderr, "Too many user files\n");
- X } else {
- X i = sscanf(c_buf, "%s %s", a_userfile[nufiles], tbuf1);
- X if ((i == 2) && tr_fty(tbuf1)) /* There's a type specified */
- X mapftypes[nummapfiles] = tr_fty(tbuf1);
- X else mapftypes[nummapfiles] = LINEREAD;
- X
- X mapfiles[nummapfiles] = a_userfile[nufiles];
- X nufiles++;
- X nummapfiles++;
- X }
- X good_flag = TRUE;
- X break;
- X case R_MAPFILE:
- X if (nmapfs >= MAXMAPFILES)
- X fprintf(stderr, "Too many user files\n");
- X else {
- X if (nmapfs == 0) {
- X /* reset mapfiles pointers */
- X for (i = 0; i < MAXMAPFILES; i++)
- X mapfiles[i] = a_userfile[i];
- X };
- X
- X i = sscanf(c_buf, "%s %s", a_userfile[nmapfs], tbuf1);
- X if ((i == 2) && tr_fty(tbuf1)) /* There's a type specified */
- X mapftypes[nmapfs] = tr_fty(tbuf1);
- X else mapftypes[nmapfs] = LINEREAD;
- X
- X mapfiles[nmapfs] = a_userfile[nmapfs];
- X
- X nummapfiles = ++nmapfs;
- X }
- X good_flag = TRUE;
- X break;
- X case R_CONSTFILE:
- X strcpy(a_constfile, c_buf);
- X constfile = a_constfile;
- X good_flag = TRUE;
- X break;
- X case R_FINDCONST:
- X findconst(c_buf);
- X good_flag = TRUE;
- X break;
- X case R_BOUNDFILE:
- X strcpy(a_boundfile, c_buf);
- X boundfile = a_boundfile;
- X good_flag = TRUE;
- X break;
- X case R_PATTERNFILE:
- X strcpy(a_patternfile, c_buf);
- X patternfile = a_patternfile;
- X good_flag = TRUE;
- X break;
- X case R_CONSTLNAMEFILE:
- X strcpy(a_cnamefile, c_buf);
- X cnamefile = a_cnamefile;
- X good_flag = TRUE;
- X break;
- X case R_LAYERS:
- X if (nlays >= MAXLAYRS)
- X fprintf(stderr, "Too many user layers\n");
- X else {
- X if (i = tr_layr(c_buf)) {
- X all_layer[nlays] = i;
- X numlayers = ++nlays;
- X }
- X }
- X good_flag = TRUE;
- X break;
- X case R_POLARMODE:
- X if (l_buf) all_proj_mode = STEREOGR;
- X good_flag = TRUE;
- X break;
- X case R_BIGFLAG:
- X if (l_buf) chart_type = FULLPAGE;
- X good_flag = TRUE;
- X break;
- X case R_PROJECTION_MODE:
- X if (i = tr_pmode(c_buf)) {
- X all_proj_mode = i;
- X }
- X good_flag = TRUE;
- X break;
- X case R_INVERT:
- X all_invert = l_buf;
- X good_flag = TRUE;
- X break;
- X case R_CHART_TYPE:
- X if (i = tr_ctype(c_buf)) {
- X chart_type = i;
- X }
- X good_flag = TRUE;
- X break;
- X case R_VRANGE:
- X i = sscanf(c_buf, "%lf %lf", &all_vmin, &all_vmax);
- X use_vmin = (i == 2);
- X good_flag = TRUE;
- X break;
- X case R_VMAGS:
- X i = sscanf(c_buf, "%lf %lf", &varmag, &varrange);
- X if (i == 2) {
- X use_vmin = TRUE;
- X all_vmin = varmag - varrange;
- X all_vmax = varmag + varrange;
- X }
- X good_flag = TRUE;
- X break;
- X case R_GRID:
- X i = sscanf(c_buf, "%s %s %s %s", tbuf1, tbuf2, tbuf3, tbuf4);
- X all_rstep = htod(tbuf1)*15.0;
- X all_dstep = htod(tbuf2);
- X all_rstrt = htod(tbuf3)*15.0;
- X all_dstrt = htod(tbuf4);
- X use_rstep = (i > 1);
- X good_flag = TRUE;
- X break;
- X case R_NOGRID:
- X no_ra_grid = no_dec_grid = l_buf;
- X good_flag = TRUE;
- X break;
- X case R_NOGRID_RA:
- X no_ra_grid = l_buf;
- X good_flag = TRUE;
- X break;
- X case R_NOGRID_DEC:
- X no_dec_grid = l_buf;
- X good_flag = TRUE;
- X break;
- X case R_NOMAGLBLS:
- X nomaglbls = l_buf;
- X good_flag = TRUE;
- X break;
- X case R_PRECESS_TO:
- X to_precess = f_buf;
- X precess = TRUE;
- X good_flag = TRUE;
- X break;
- X case R_DRIVER_CONTROL:
- X D_control_arg(c_buf);
- X good_flag = TRUE;
- X break;
- X case R_WRITE_MAPWIN_FILE:
- X write_mapwin_file = TRUE;
- X strncpy(mapwin_file, c_buf, MAXPATHLEN-1);
- X good_flag = TRUE;
- X break;
- X case R_READ_MAPWIN_FILE:
- X read_mapwin_file = TRUE;
- X strncpy(mapwin_file, c_buf, MAXPATHLEN-1);
- X good_flag = TRUE;
- X break;
- X default:
- X break;
- X };
- X
- X return good_flag;
- X}
- X
- X
- Xint tr_layr(s)
- X char *s;
- X{
- X int i;
- X
- X for (i = 0; s[i]; i++)
- X if (isupper(s[i]))
- X s[i] = tolower(s[i]);
- X
- X if(!strcmp(s, "outline")) return OUTLINE;
- X else if (!strcmp(s, "ra_grid")) return RA_GRID;
- X else if (!strcmp(s, "dec_grid")) return DEC_GRID;
- X else if (!strcmp(s, "ecliptic")) return ECLIPTIC;
- X else if (!strcmp(s, "boundaries")) return BOUNDARIES;
- X else if (!strcmp(s, "patterns")) return PATTERNS;
- X else if (!strcmp(s, "constlnames")) return CONSTLNAMES;
- X else if (!strcmp(s, "allfiles")) return ALLFILES;
- X else if (!strcmp(s, "allglyphs")) return ALLGLYPHS;
- X else if (!strcmp(s, "allnames")) return ALLNAMES;
- X else if (!strcmp(s, "allmaglbls")) return ALLMAGLBLS;
- X else if (!strcmp(s, "allvectors")) return ALLVECTORS;
- X else if (!strcmp(s, "allareas")) return ALLAREAS;
- X else if (!strcmp(s, "legends")) return LEGENDS;
- X else return 0;
- X}
- X
- X
- Xint tr_pmode(s)
- X char *s;
- X{
- X int i;
- X
- X for (i = 0; s[i]; i++)
- X if (isupper(s[i]))
- X s[i] = tolower(s[i]);
- X
- X if(!strcmp(s, "stereogr")) return STEREOGR;
- X else if(!strcmp(s, "stereographic")) return STEREOGR;
- X else if (!strcmp(s, "sansons")) return SANSONS;
- X else if (!strcmp(s, "gnomonic")) return GNOMONIC;
- X else if (!strcmp(s, "orthogr")) return ORTHOGR;
- X else if (!strcmp(s, "orthographic")) return ORTHOGR;
- X else if (!strcmp(s, "rectangular")) return RECTANGULAR;
- X else return 0;
- X}
- X
- X
- Xint tr_ctype(s)
- X char *s;
- X{
- X int i;
- X for (i = 0; s[i]; i++)
- X if (isupper(s[i]))
- X s[i] = tolower(s[i]);
- X
- X if(!strcmp(s, "fullpage")) return FULLPAGE;
- X else if (!strcmp(s, "threepart")) return THREEPART;
- X else return 0;
- X}
- X
- Xint tr_fty(s)
- X char *s;
- X{
- X int i;
- X
- X for (i = 0; s[i]; i++)
- X if (isupper(s[i]))
- X s[i] = tolower(s[i]);
- X
- X if(!strcmp(s, "lineread")) return LINEREAD;
- X else if (!strcmp(s, "indextype")) return INDEXTYPE;
- X else if (!strcmp(s, "binfull")) return BINFULL;
- X else if (!strcmp(s, "binobj")) return BINOBJ;
- X else if (!strcmp(s, "binstar")) return BINSTAR;
- X/* else if (!strcmp(s, "saoformat")) return SAOFORMAT;*/
- X else if (!strcmp(s, "gsc")) return GSCTYPE;
- X else return 0;
- X}
- X
- X
- X
- Xstatic char title_string[LINELEN];
- X
- Xfindconst(tag)
- X char *tag;
- X{
- X/*
- X * lookup "con.locs" for a matching tag, and then substitute initial values
- X * for ra, decl, scale, and label. File layout follows:
- X *
- X * com 13 25 10 Coma Bereneces
- X * cor 15.45 28 10 Corona Borealis
- X * 0....+....1....+....2....+....3
- X */
- X FILE *cfile;
- X int taglen;
- X char cbuf[LINELEN+1];
- X int i;
- X
- X if ((cfile = fopen(constfile, "r")) == NULL)
- X die("open fail on '%s'", constfile);
- X taglen = strlen(tag);
- X if ((taglen < 3) || (taglen > 4))
- X die("constellation name must be three or four characters","");
- X for (;;)
- X {
- X fgets(cbuf, LINELEN, cfile);
- X if (ferror(cfile)) die("read error in '%s'", constfile);
- X if (feof(cfile)) break;
- X if (strncmp(tag, cbuf, taglen) == 0) /* FOUND */
- X {
- X if (4!=sscanf(cbuf,"%*5s%lf%lf%lf %[^\n]",
- X &ra, &de, &sc, title_string))
- X die("bogus line in constellation file: \"%s\"", cbuf);
- X
- X ra = ftod(ra)*15.0;
- X de = ftod(de);
- X
- X /* remove trailing \n */
- X i = strlen(title_string);
- X if (title_string[i-1] == '\n') title_string[i-1] = '\0';
- X title = title_string;
- X return;
- X }
- X }
- X die("Constellation '%s' not found", tag);
- X}
- X
- X/* check validity of win structure */
- Xchartparms(win)
- X mapwindow *win;
- X{
- X double maxdl;
- X
- X /*
- X * check for bogus ra, decl, or scale
- X */
- X if ((win->racen >= 360.0) || (win->racen < 0.0))
- X die("right ascension out of range","");
- X if ((win->dlcen > 90.0) || (win->dlcen < -90.0))
- X die("declination out of range","");
- X if (win->scale < 0.0)
- X die("scale negative","");
- X
- X /*
- X * check for pole wrapping and do a potential clip
- X */
- X if (win->proj_mode == SANSONS) {
- X maxdl = (90.0 - fabs(win->dlcen))*2.0;
- X if (win->scale > maxdl) win->scale = maxdl;
- X if (win->scale <= 0.0) { /* North pole is included in chart */
- X return(FALSE);
- X }
- X };
- X
- X return(TRUE);
- X}
- X
- X
- X
- X/* Dump current mapwin information to file. */
- Xwrite_mfile(mfile)
- X FILE *mfile;
- X{
- X int i, j;
- X
- X /* Tag file as being mapwin format */
- X fprintf(mfile,
- X "#mapwin format 1 file: don't edit this line or change order of lines in this file\n");
- X /* Write the title */
- X fprintf(mfile, "title=%s\n", title);
- X
- X /* write number of mapwins */
- X fprintf(mfile, "numwins=%d\n", numwins);
- X for (i = 0; i < numwins; i++) {
- X fprintf(mfile, "mapwin=%d\n",i);
- X
- X fprintf(mfile, "width=%d\n", mapwin[i]->width);
- X fprintf(mfile, "height=%d\n", mapwin[i]->height);
- X fprintf(mfile, "x_offset=%d\n", mapwin[i]->x_offset);
- X fprintf(mfile, "y_offset=%d\n", mapwin[i]->y_offset);
- X
- X fprintf(mfile, "maglim=%.10f\n", mapwin[i]->maglim);
- X fprintf(mfile, "lbllim=%.10f\n", mapwin[i]->lbllim);
- X fprintf(mfile, "gklim=%.10f\n", mapwin[i]->gklim);
- X
- X
- X fprintf(mfile, "map_type=%d\n", mapwin[i]->map_type);
- X
- X
- X fprintf(mfile, "tag=%d\n", mapwin[i]->tag);
- X
- X fprintf(mfile, "tag_field=%s\n", mapwin[i]->tag_field);
- X
- X
- X fprintf(mfile, "proj_mode=%d\n", mapwin[i]->proj_mode);
- X
- X
- X fprintf(mfile, "draw_ragrid=%d\n", mapwin[i]->draw_ragrid);
- X fprintf(mfile, "draw_decgrid=%d\n", mapwin[i]->draw_decgrid);
- X
- X fprintf(mfile, "ra_step=%.10f\n", mapwin[i]->ra_step);
- X fprintf(mfile, "dec_step=%.10f\n", mapwin[i]->dec_step);
- X
- X fprintf(mfile, "ra_strt=%.10f\n", mapwin[i]->ra_strt);
- X fprintf(mfile, "dec_strt=%.10f\n", mapwin[i]->dec_strt);
- X
- X
- X fprintf(mfile, "invert=%d\n", mapwin[i]->invert);
- X
- X fprintf(mfile, "racen=%.10f\n", mapwin[i]->racen);
- X fprintf(mfile, "dlcen=%.10f\n", mapwin[i]->dlcen);
- X fprintf(mfile, "scale=%.10f\n", mapwin[i]->scale);
- X
- X fprintf(mfile, "c_scale=%.10f\n", mapwin[i]->c_scale);
- X
- X fprintf(mfile, "nlayers=%d\n", mapwin[i]->nlayers);
- X for (j = 0; j < mapwin[i]->nlayers; j++)
- X fprintf(mfile, "layer[%d] = %d\n", j, mapwin[i]->layer[j]);
- X
- X fprintf(mfile, "numfiles=%d\n", mapwin[i]->numfiles);
- X for (j = 0; j < mapwin[i]->numfiles; j++) {
- X fprintf(mfile, "file=%d\n", j);
- X fprintf(mfile, "name=%s\n",mapwin[i]->file[j].name);
- X fprintf(mfile, "type=%d\n", mapwin[i]->file[j].type);
- X fprintf(mfile, "maglim=%.10f\n", mapwin[i]->file[j].maglim);
- X fprintf(mfile, "lbllim=%.10f\n", mapwin[i]->file[j].lbllim);
- X fprintf(mfile, "gklim=%.10f\n", mapwin[i]->file[j].gklim);
- X fprintf(mfile, "draw_maglbl=%d\n", mapwin[i]->file[j].draw_maglbl);
- X fprintf(mfile, "maglmin=%.10f\n", mapwin[i]->file[j].maglmin);
- X fprintf(mfile, "maglmax=%.10f\n", mapwin[i]->file[j].maglmax);
- X }
- X }
- X
- X
- X /* Tag file as being mapwin format */
- X fprintf(mfile,
- X "#mapwin format 1 file: don't edit this line or change order of lines in this file\n");
- X}
- END_OF_FILE
- if test 33377 -ne `wc -c <'starchart/starmain.c'`; then
- echo shar: \"'starchart/starmain.c'\" unpacked with wrong size!
- fi
- # end of 'starchart/starmain.c'
- fi
- echo shar: End of archive 23 \(of 32\).
- cp /dev/null ark23isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 32 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
-
-