home *** CD-ROM | disk | FTP | other *** search
Wrap
From: hagenl@cs.tu-berlin.de (Lars Hagen) Newsgroups: comp.sources.misc,sci.astro,sci.space Subject: v42i078: sacdrt - SAC-Database-Reader for DeepSky Objects, Part01/04 Date: 6 May 1994 14:45:11 -0500 Organization: Technical University of Berlin, Germany Sender: kent@sparky.sterling.com Approved: kent@sparky.sterling.com Message-ID: <csm-v42i078=sacdrt.144402@sparky.sterling.com> X-Md4-Signature: 26da66d841f26a2969727c3ac444f46b Submitted-by: hagenl@cs.tu-berlin.de (Lars Hagen) Posting-number: Volume 42, Issue 78 Archive-name: sacdrt/part01 Environment: ncurses, a2ps, gmake, SunOS, Linux SACDRT Version 3.1 SAC-Database-Reader for DeepSky Objects Sacdrt is a reader and translater for the sac databse version 5.2 and version 6.0. Lower versions might work, but not tested. Sacdrt will input the databse, parse the entries and show them on the screen (one bye one). You can mark objects, search (by name and other), sort the marked objects (by name, declination, rektaszension, magnitude, type and const) and you can do a complex search (see manual page), e.g. to get all objects with NGC in the name and magnutide from 4 up to 8. The marked objects could be printed, wether in a file or to a printer (ascii or ps). For further information refer to the manual page. The installation of this program requires the NCURSES package (version 1.8 or greater, lower versions may be work but they are not tested) and GMAKE (don't know if the makefiles will work with the normal make). When you want to print ps you need also the A2PS from Miguel SANTANA. Tested under: SunOS and Linux pl.12 THANKS TO: Zeyd (and every one who helped improve the ncurses)!!! Sven Mathing and Stefan Arbanowski. Steve Coe for a lot of help by the realisation of the parsers. Carsten Borman for new ideas. Hellmuth Michaelis for initrc[c,h] code. Miguel SANTANA for the a2ps. have fun. hagenl@cs.tu-berlin.de vdmeer@cs.tu-berlin.de -- ================================= = Lars Hagen = = Technical University = = Berlin, Germany = ---------------------------------- #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # Contents: sacdrt3.1 sacdrt3.1/COPYING sacdrt3.1/man # sacdrt3.1/man/sacdrt.1 sacdrt3.1/sacdrt_term # sacdrt3.1/sacdrt_term/input.c sacdrt3.1/sacdrt_term/mark_objects.c # sacdrt3.1/sacdrt_term/p_cord.c sacdrt3.1/sacdrt_term/p_descr.c # Wrapped by kent@sparky on Fri May 6 14:38:19 1994 PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH echo If this archive is complete, you will see the following message: echo ' "shar: End of archive 1 (of 4)."' if test ! -d 'sacdrt3.1' ; then echo shar: Creating directory \"'sacdrt3.1'\" mkdir 'sacdrt3.1' fi if test -f 'sacdrt3.1/COPYING' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sacdrt3.1/COPYING'\" else echo shar: Extracting \"'sacdrt3.1/COPYING'\" \(17982 characters\) sed "s/^X//" >'sacdrt3.1/COPYING' <<'END_OF_FILE' X GNU GENERAL PUBLIC LICENSE X Version 2, June 1991 X X Copyright (C) 1989, 1991 Free Software Foundation, Inc. X 675 Mass Ave, Cambridge, MA 02139, USA X Everyone is permitted to copy and distribute verbatim copies X of this license document, but changing it is not allowed. X X Preamble X X The licenses for most software are designed to take away your Xfreedom to share and change it. By contrast, the GNU General Public XLicense is intended to guarantee your freedom to share and change free Xsoftware--to make sure the software is free for all its users. This XGeneral Public License applies to most of the Free Software XFoundation's software and to any other program whose authors commit to Xusing it. (Some other Free Software Foundation software is covered by Xthe GNU Library General Public License instead.) You can apply it to Xyour programs, too. X X When we speak of free software, we are referring to freedom, not Xprice. Our General Public Licenses are designed to make sure that you Xhave the freedom to distribute copies of free software (and charge for Xthis service if you wish), that you receive source code or can get it Xif you want it, that you can change the software or use pieces of it Xin new free programs; and that you know you can do these things. X X To protect your rights, we need to make restrictions that forbid Xanyone to deny you these rights or to ask you to surrender the rights. XThese restrictions translate to certain responsibilities for you if you Xdistribute copies of the software, or if you modify it. X X For example, if you distribute copies of such a program, whether Xgratis or for a fee, you must give the recipients all the rights that Xyou have. You must make sure that they, too, receive or can get the Xsource code. And you must show them these terms so they know their Xrights. X X We protect your rights with two steps: (1) copyright the software, and X(2) offer you this license which gives you legal permission to copy, Xdistribute and/or modify the software. X X Also, for each author's protection and ours, we want to make certain Xthat everyone understands that there is no warranty for this free Xsoftware. If the software is modified by someone else and passed on, we Xwant its recipients to know that what they have is not the original, so Xthat any problems introduced by others will not reflect on the original Xauthors' reputations. X X Finally, any free program is threatened constantly by software Xpatents. We wish to avoid the danger that redistributors of a free Xprogram will individually obtain patent licenses, in effect making the Xprogram proprietary. To prevent this, we have made it clear that any Xpatent must be licensed for everyone's free use or not licensed at all. X X The precise terms and conditions for copying, distribution and Xmodification follow. X X GNU GENERAL PUBLIC LICENSE X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION X X 0. This License applies to any program or other work which contains Xa notice placed by the copyright holder saying it may be distributed Xunder the terms of this General Public License. The "Program", below, Xrefers to any such program or work, and a "work based on the Program" Xmeans either the Program or any derivative work under copyright law: Xthat is to say, a work containing the Program or a portion of it, Xeither verbatim or with modifications and/or translated into another Xlanguage. (Hereinafter, translation is included without limitation in Xthe term "modification".) Each licensee is addressed as "you". X XActivities other than copying, distribution and modification are not Xcovered by this License; they are outside its scope. The act of Xrunning the Program is not restricted, and the output from the Program Xis covered only if its contents constitute a work based on the XProgram (independent of having been made by running the Program). XWhether that is true depends on what the Program does. X X 1. You may copy and distribute verbatim copies of the Program's Xsource code as you receive it, in any medium, provided that you Xconspicuously and appropriately publish on each copy an appropriate Xcopyright notice and disclaimer of warranty; keep intact all the Xnotices that refer to this License and to the absence of any warranty; Xand give any other recipients of the Program a copy of this License Xalong with the Program. X XYou may charge a fee for the physical act of transferring a copy, and Xyou may at your option offer warranty protection in exchange for a fee. X X 2. You may modify your copy or copies of the Program or any portion Xof it, thus forming a work based on the Program, and copy and Xdistribute such modifications or work under the terms of Section 1 Xabove, provided that you also meet all of these conditions: X X a) You must cause the modified files to carry prominent notices X stating that you changed the files and the date of any change. X X b) You must cause any work that you distribute or publish, that in X whole or in part contains or is derived from the Program or any X part thereof, to be licensed as a whole at no charge to all third X parties under the terms of this License. X X c) If the modified program normally reads commands interactively X when run, you must cause it, when started running for such X interactive use in the most ordinary way, to print or display an X announcement including an appropriate copyright notice and a X notice that there is no warranty (or else, saying that you provide X a warranty) and that users may redistribute the program under X these conditions, and telling the user how to view a copy of this X License. (Exception: if the Program itself is interactive but X does not normally print such an announcement, your work based on X the Program is not required to print an announcement.) X XThese requirements apply to the modified work as a whole. If Xidentifiable sections of that work are not derived from the Program, Xand can be reasonably considered independent and separate works in Xthemselves, then this License, and its terms, do not apply to those Xsections when you distribute them as separate works. But when you Xdistribute the same sections as part of a whole which is a work based Xon the Program, the distribution of the whole must be on the terms of Xthis License, whose permissions for other licensees extend to the Xentire whole, and thus to each and every part regardless of who wrote it. X XThus, it is not the intent of this section to claim rights or contest Xyour rights to work written entirely by you; rather, the intent is to Xexercise the right to control the distribution of derivative or Xcollective works based on the Program. X XIn addition, mere aggregation of another work not based on the Program Xwith the Program (or with a work based on the Program) on a volume of Xa storage or distribution medium does not bring the other work under Xthe scope of this License. X X 3. You may copy and distribute the Program (or a work based on it, Xunder Section 2) in object code or executable form under the terms of XSections 1 and 2 above provided that you also do one of the following: X X a) Accompany it with the complete corresponding machine-readable X source code, which must be distributed under the terms of Sections X 1 and 2 above on a medium customarily used for software interchange; or, X X b) Accompany it with a written offer, valid for at least three X years, to give any third party, for a charge no more than your X cost of physically performing source distribution, a complete X machine-readable copy of the corresponding source code, to be X distributed under the terms of Sections 1 and 2 above on a medium X customarily used for software interchange; or, X X c) Accompany it with the information you received as to the offer X to distribute corresponding source code. (This alternative is X allowed only for noncommercial distribution and only if you X received the program in object code or executable form with such X an offer, in accord with Subsection b above.) X XThe source code for a work means the preferred form of the work for Xmaking modifications to it. For an executable work, complete source Xcode means all the source code for all modules it contains, plus any Xassociated interface definition files, plus the scripts used to Xcontrol compilation and installation of the executable. However, as a Xspecial exception, the source code distributed need not include Xanything that is normally distributed (in either source or binary Xform) with the major components (compiler, kernel, and so on) of the Xoperating system on which the executable runs, unless that component Xitself accompanies the executable. X XIf distribution of executable or object code is made by offering Xaccess to copy from a designated place, then offering equivalent Xaccess to copy the source code from the same place counts as Xdistribution of the source code, even though third parties are not Xcompelled to copy the source along with the object code. X X 4. You may not copy, modify, sublicense, or distribute the Program Xexcept as expressly provided under this License. Any attempt Xotherwise to copy, modify, sublicense or distribute the Program is Xvoid, and will automatically terminate your rights under this License. XHowever, parties who have received copies, or rights, from you under Xthis License will not have their licenses terminated so long as such Xparties remain in full compliance. X X 5. You are not required to accept this License, since you have not Xsigned it. However, nothing else grants you permission to modify or Xdistribute the Program or its derivative works. These actions are Xprohibited by law if you do not accept this License. Therefore, by Xmodifying or distributing the Program (or any work based on the XProgram), you indicate your acceptance of this License to do so, and Xall its terms and conditions for copying, distributing or modifying Xthe Program or works based on it. X X 6. Each time you redistribute the Program (or any work based on the XProgram), the recipient automatically receives a license from the Xoriginal licensor to copy, distribute or modify the Program subject to Xthese terms and conditions. You may not impose any further Xrestrictions on the recipients' exercise of the rights granted herein. XYou are not responsible for enforcing compliance by third parties to Xthis License. X X 7. If, as a consequence of a court judgment or allegation of patent Xinfringement or for any other reason (not limited to patent issues), Xconditions are imposed on you (whether by court order, agreement or Xotherwise) that contradict the conditions of this License, they do not Xexcuse you from the conditions of this License. If you cannot Xdistribute so as to satisfy simultaneously your obligations under this XLicense and any other pertinent obligations, then as a consequence you Xmay not distribute the Program at all. For example, if a patent Xlicense would not permit royalty-free redistribution of the Program by Xall those who receive copies directly or indirectly through you, then Xthe only way you could satisfy both it and this License would be to Xrefrain entirely from distribution of the Program. X XIf any portion of this section is held invalid or unenforceable under Xany particular circumstance, the balance of the section is intended to Xapply and the section as a whole is intended to apply in other Xcircumstances. X XIt is not the purpose of this section to induce you to infringe any Xpatents or other property right claims or to contest validity of any Xsuch claims; this section has the sole purpose of protecting the Xintegrity of the free software distribution system, which is Ximplemented by public license practices. Many people have made Xgenerous contributions to the wide range of software distributed Xthrough that system in reliance on consistent application of that Xsystem; it is up to the author/donor to decide if he or she is willing Xto distribute software through any other system and a licensee cannot Ximpose that choice. X XThis section is intended to make thoroughly clear what is believed to Xbe a consequence of the rest of this License. X X 8. If the distribution and/or use of the Program is restricted in Xcertain countries either by patents or by copyrighted interfaces, the Xoriginal copyright holder who places the Program under this License Xmay add an explicit geographical distribution limitation excluding Xthose countries, so that distribution is permitted only in or among Xcountries not thus excluded. In such case, this License incorporates Xthe limitation as if written in the body of this License. X X 9. The Free Software Foundation may publish revised and/or new versions Xof the General Public License from time to time. Such new versions will Xbe similar in spirit to the present version, but may differ in detail to Xaddress new problems or concerns. X XEach version is given a distinguishing version number. If the Program Xspecifies a version number of this License which applies to it and "any Xlater version", you have the option of following the terms and conditions Xeither of that version or of any later version published by the Free XSoftware Foundation. If the Program does not specify a version number of Xthis License, you may choose any version ever published by the Free Software XFoundation. X X 10. If you wish to incorporate parts of the Program into other free Xprograms whose distribution conditions are different, write to the author Xto ask for permission. For software which is copyrighted by the Free XSoftware Foundation, write to the Free Software Foundation; we sometimes Xmake exceptions for this. Our decision will be guided by the two goals Xof preserving the free status of all derivatives of our free software and Xof promoting the sharing and reuse of software generally. X X NO WARRANTY X X 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, XREPAIR OR CORRECTION. X X 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE XPOSSIBILITY OF SUCH DAMAGES. X X END OF TERMS AND CONDITIONS X X Appendix: How to Apply These Terms to Your New Programs X X If you develop a new program, and you want it to be of the greatest Xpossible use to the public, the best way to achieve this is to make it Xfree software which everyone can redistribute and change under these terms. X X To do so, attach the following notices to the program. It is safest Xto attach them to the start of each source file to most effectively Xconvey the exclusion of warranty; and each file should have at least Xthe "copyright" line and a pointer to where the full notice is found. X X <one line to give the program's name and a brief idea of what it does.> X Copyright (C) 19yy <name of author> X X This program is free software; you can redistribute it and/or modify X it under the terms of the GNU General Public License as published by X the Free Software Foundation; either version 2 of the License, or X (at your option) any later version. X X This program is distributed in the hope that it will be useful, X but WITHOUT ANY WARRANTY; without even the implied warranty of X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X GNU General Public License for more details. X X You should have received a copy of the GNU General Public License X along with this program; if not, write to the Free Software X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X XAlso add information on how to contact you by electronic and paper mail. X XIf the program is interactive, make it output a short notice like this Xwhen it starts in an interactive mode: X X Gnomovision version 69, Copyright (C) 19yy name of author X Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. X This is free software, and you are welcome to redistribute it X under certain conditions; type `show c' for details. X XThe hypothetical commands `show w' and `show c' should show the appropriate Xparts of the General Public License. Of course, the commands you use may Xbe called something other than `show w' and `show c'; they could even be Xmouse-clicks or menu items--whatever suits your program. X XYou should also get your employer (if you work as a programmer) or your Xschool, if any, to sign a "copyright disclaimer" for the program, if Xnecessary. Here is a sample; alter the names: X X Yoyodyne, Inc., hereby disclaims all copyright interest in the program X `Gnomovision' (which makes passes at compilers) written by James Hacker. X X <signature of Ty Coon>, 1 April 1989 X Ty Coon, President of Vice X XThis General Public License does not permit incorporating your program into Xproprietary programs. If your program is a subroutine library, you may Xconsider it more useful to permit linking proprietary applications with the Xlibrary. If this is what you want to do, use the GNU Library General XPublic License instead of this License. END_OF_FILE if test 17982 -ne `wc -c <'sacdrt3.1/COPYING'`; then echo shar: \"'sacdrt3.1/COPYING'\" unpacked with wrong size! fi # end of 'sacdrt3.1/COPYING' fi if test ! -d 'sacdrt3.1/man' ; then echo shar: Creating directory \"'sacdrt3.1/man'\" mkdir 'sacdrt3.1/man' fi if test -f 'sacdrt3.1/man/sacdrt.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sacdrt3.1/man/sacdrt.1'\" else echo shar: Extracting \"'sacdrt3.1/man/sacdrt.1'\" \(11826 characters\) sed "s/^X//" >'sacdrt3.1/man/sacdrt.1' <<'END_OF_FILE' X.\" @(#)sacdrt.1 3.0 02/13/94 X.\" X.TH SACDRT 1L "13 February 1994" X.UC 4 X.SH NAME Xsacdrt \- Saguaro Astronomy Club Database Reader and Translator for SAC version 5.2 and version 6.0 X.SH SYNOPSIS X.B sacdrt X[ X.B -f database X] [ X.B -o output_file X] [ X.B -P printer X] [ X.B -L maxlines X] [ X.B -t X] [ X.I -a|-p X] [ X.B -O X] ... X.SH DESCRIPTION X.I Sacdrt Xreads the X.I SAC-Database Xversion 5.2 and version 6.0, parse the entries in it and print them interactive Xto the screen. Objects could be printed (either to file or printer) and Xsearched. X.I Sacdrt Xwill test on the startup if a X-Server is running. Then the program will run in Xit's own X-Window, else it uses ncurses routines for screen-output (see X.B -t Xoption). X.br X.I Sacdrt Xwill try to parse and translate (to normal readable form) following: X.PP X.B Name Xis the object name and object number from an given catalog. Whitch catalog it is, X.I sacdrt Xyou will show in X.B Info. XSome objects are known by other catalogs. These designations you will show in X.B Other Xfield. This field is displayed (if exists) in clamps (...), in the same line like X.B Name. XIn X.B Type Xfield is the object type given, e.g. galaxy, open cluster .... X.B Constellation, Rektaszension, Xand X.B Declination Xshow you the position of the object. X.B Brightness Xdisplays the magnitude of the object. Many objects brightnesses are declared as X.I unknown. XThese objects hasn't a published magnitude. Also no magnitude hasn't X.I dark nebulae. XIn the fields X.B U2000 Xand X.B Tirion Xare the charts in the Uranometria 2000.0 and Tirion Sky Atlas 2000.0 displayed. In X.B Brightest Star Xand X.B Number of Stars Xwill values be showed, when the object type is an X.I open cluster, Xso that the magnitude of the X.B brightest star Xand the X.B number of stars Xin this cluster are given. X.B Brightest Star Xalso given, when the object is a planetary nebula, so it has a central star. X.B Size Xfield of objects show you the size of it in minutes of arc (') or seconds of arc (''). XIs your X.I SAC-Database Xof version 6.0, there is a new field - called X.B Surface brightness. XThese values are given in the X.I Reference Catalog of Galaxies 3. XOnly in database version 5.2 is the X.B Source Xfield contained. It will show from where the informations are. In X.B Classification Xseveral professional classification schemes are contained. X.B Description Xgives you visual description of the object. In X.B Notes Xare additional object information given, e.g. position angel. X.PP X.B ATTENTION! X.I Sacdrt Xdon't guarantee for the 100% correctly translation. But we still working! X.PP X.I Sacdrt Xaccepts the following command line options: X.TP 0.6i X.B -f databse Xuse X.I database Xas input-file. This will overrule the input-file given in the environment Xvariable X.B SACDRT_INPUT. X.I Database Xmust be the whole path, including the filename, e.g.: X X/home/ftp/pub/astro/SAC.TXT or X X~ftp/pub/astro/SAC.TXT. X XThe default (instead of environment or command line) is X.I SAC.TXT Xin the current working directory. X.TP 0.6i X.B -o output_file Xuse X.I output_file Xas destination when writing X.I marked objects Xto a file. This will overrule the X.I output_file Xgiven in the environment variable X.B SACDRT_OUTPUT. X.I Output_file Xmust be the whole path, including the filename, e.g: X X~hagenl/SAC.OUTPUT. X XThe default (instead of environment or command line) is X.I SAC.OUTPUT Xin the current working directory. X.TP 0.6i X.B -P printer Xuse X.I printer Xwhen printing X.I marked objects Xinstead of the printer specified in the enviroment variable X.B PRINTER. XYou must have defined a printer (in the environment or in the command line), else X.I sacdrt Xwill terminate with an error message. X.TP 0.6i X.B -L maxlines Xdefines the maximum lines to be used for one page when printing. XThe default is X.B 65. X.TP 0.6i X.B -t XForce X.I sacdrt Xto run in term mode, instead of use it's own X-Window. This has of course only Xeffect if there is a X-Server running. X.TP 0.6i X.B -a XWhen invoked, X.I sacdrt Xwill not use X.I a2ps Xas filter for output for the printer. This is for line printers. X.I Sacdrt Xwill print with the folloing command: X X.B lpr sac_print -Pprinter. X.TP 0.6i X.B -p XForce X.I sacdrt Xto use X.I a2ps Xas filter for output for the printer. This is for postscript printer. X.I Sacdrt Xwill print with the folloing command: X X.B a2ps -p -nn -nh -ns sac_print | lpr -Pprinter. X.TP 0.6i X.B -h XPrint usage information. X.TP 0.6i X.B -O XWhen invoked, X.I sacdrt Xwill not use the included parsers. The output is then none parsed. XSee also X.I Key-Commands Xin X.I Main-Mode. X.SH USAGE X.PP XWhen started X.I sacdrt Xat first it will initialize the intern data structures. This will need few seconds, Xbut save a lot of time when searching or printing. After this, the first object Xin the database is printed to the screen. Please note that the X.I sacdrt Xwill X.I NOT Xchange the orginal database. X.I Sacdrt Xonly read and parse the entries in it. XNow you can move through the database, Xsearch for objects and mark objects (press X.B h Xfor help on keys or commands). For further X.I keys Xsee X.I Key-Commands Xin X.I Main-Mode Xor X.I Complex-Mode Xetc. X.PP XWhen the X.I sacdrt Xis started and the initialisation is completed you are in the X.I Main-Mode. X.PP XAll X.I Key-Commands Xare non-case sensitive. You can also use the upper-cases. X.PP XFollowing X.I Key-Commands Xare possible in the X.I Main-Mode: X.TP 0.5i X.B c XComplex Search Window (see below X.I Complex-Mode X) X.TP 0.5i X.B f XTurn Filter for X.I marked objects (on/off). XThis has only an effect when objects are marked. When the filter is X.I on, Xthe program will working only with these X.I marked objects. XAll other objects are disabled. X.TP 0.5i X.B h XHelp window. All possible keys are quoted in it. X.TP 0.5i X.B i XInfo window. Short information about the writer of X.I sacdrt Xprogram and the main feedback E-Mail adress. X.TP 0.5i X.B m Xmark the current object. The object will be inserted in the X.I marked object list X(see X.I Print-Mode X). X.TP 0.5i X.B o XTurn X.I Parse-Mode (on/off). XWhen the X.I Parse-Mode Xis X.I on Xall object entries will be translated to a normal, readable form. Otherwise not! X.TP 0.5i X.B p XSwitch to X.I Print-Mode X(see below X.I Print-Mode X). X.TP 0.5i X.B q XQuit. Will terminate the X.I sacdrt Xprogram. X.TP 0.5i X.B s XSwitch to X.I Search-Mode X(see below X.I Search-Mode X). X.TP 0.5i X.B w XWrite commandline options to startup file X.I $HOME/.sacdrtrc X.PP XWith key X.B s Xyou come to the X.I Search-Mode. XThe searching of X.I sacdrt Xis different from other programs. At first (that's not different of course) searching is non-case sensitive. At second (now come's the difference!) the search function will eleminate all blanks in the search string. This means that you can type one of the following to search, e.g for X.B Berk 59: X<berk 59>, <berk59>, <Berk 59>, <Berk59>, <BERK 59>, <BERK59>, <b e r k 5 9> or any other combination. For every input will be found the object X.B Berk 59 X(Berkeley No.59). X.PP XWhen you use X.B p, Xyou will come to the X.I Print-Mode. XThis will only be possible, when you have previously marked some (more than 0) objects. A new window will be opened. X.PP XFollowing X.I Key-Commands Xare possible in the X.I Print-Mode: X.TP 0.5i X.B a Xdelete all object entries. The X.I marked object list Xis then destroyed and the X.I filter Xis turned X.I off. X.TP 0.5i X.B f Xwrite all X.I marked objects Xto given file (see enviroment variable X.I SACDRT_OUTPUT, Xcommandline or initfile). X.TP 0.5i X.B o Xdelete the current object. X.TP 0.5i X.B p Xprint all X.I marked objects Xto given printer (see enviroment variable X.I PRINTER, Xcommandline or initfile). X.TP 0.5i X.B q Xwill quit the X.I Print-Mode Xand return to X.I Main-Mode. XThe X.I marked objects Xwill X.I not Xbe deleted. X.TP 0.5i X.B s XSwitch to X.I Sort-Mode X(see below X.I Sort-Mode X). X.TP 0.5i X.B Return/Space Xwill return to the X.I Main-Mode Xand show you the current object. X.PP XWith using X.B c Xyou will come to the X.I Complex-Mode. XIn this mode the X.I sacdrt Xenable you to select objects with definable conditions. E.g. you will select all Messier objects from magnitude 5.0m to 8.0m in a rektaszension between 12h00.0 and 18h34.0 and so one. X.I Sacdrt Xwill find all the objects whitch perform the conditions and mark these. X.PP X.B WARNING! XAn existing list of X.I marked objects Xwill be deleted when you start the search. XWhen X.I complex search Xis ready, the program returns to X.I Main-Mode Xand enable the X.I filter (on). XNow you can work with these new X.I marked object list, Xlike before with other lists (see X.I Print-Mode X). X.PP XFollowing X.I Key-Commands Xare possible in the X.I Complex-Mode: X.TP 0.5i X.B i Xswitch to invers marking X.TP 0.5i X.B h Xwill get you an own help window with the possibilities of X.I complex search. X.TP 0.5i X.B Return/m XMark/Unmark/Edit value. X.TP 0.5i X.B o XDefault values. Set all parameters to X.I default. X.TP 0.5i X.B q XTerminate input sequence and return to X.I Main-Mode Xwithout searching and deleting an old X.I marked object list. X.TP 0.5i X.B s XStart search. X.PP XIn X.I Sort-Mode Xyou can sort a list of X.I marked objects Xto a specified criterion. These criterions are: X.br X.PP X.I Rektaszension X(default) X.br X.I Deklination X.br X.I Magnitude X.br X.I Name X.br X.I Type X.br X.I Constellation X.PP XAlso it is possible to sort in X.I ascending X(default) or X.I descending Xdirection. X.PP XFollowing X.I Key-Commands Xare also possible in X.I Sort-Mode: X.TP 0.6i X.B q XQuit. Leave the X.I Sort-Mode Xand return (without sorting) to X.I Print-Mode. X.TP 0.6i X.B s XStart sort. After this, program returns to X.I Print-Mode. XThere you can work again with the X.I sorted marked object list. X.TP 0.6i X.B Return/Space Xactivate sort criterion. X.PP X.B Moving Xwith cursor-keys through the different modies are the same everywhere (nearly everywhere). X.TP 0.6i X.B Cursor up/down or u/d XIn X.I Main-Mode Xit will bring you to the X.I next/previous Xentry. X.br XIn X.I Print-Mode Xand in X.I Complex-Mode X(only for Name/Type/Const) this will move the scollbar X.I up/down. X.br XIn X.I Sort-Mode Xit moves to the X.I upper/lower Xcriterion. X.TP 0.6i X.B Cursor left/right or p/n XIn X.I Complex-Mode. XThis will bring you to the X.I next/previous Xitem for edit or mark. X.br XIn X.I Sort-Mode Xthis will bring to a righter/lefter position. X.TP 0.6i X.B PgUp/PgDn or +/- XWill move X.I +100/-100 Xentries X.I forward/backward Xin X.I Main-Mode. XIn X.I Print-Mode Xand in X.I Complex-Mode X(only for Name/Type/Const) it will move the scrollbar X.I +10/-10 Xitems X.I up/down. X.TP 0.6i X.B Home/End or b/e XIn X.I Main-Mode Xand in X.I Print-Mode Xit will bring you to the X.I last/first Xdatabase entry. X.SH FILES XInstead of commandline options or environment variables you can use a config Xfile. This will be X.I $HOME/.sacdrtrc XIn this file you can use the following entries: X.TP 0.6i X.B term=[on|off] XSame as X.B -t Xin commandline. X.TP 0.6i X.B print_ascii=[on|off] XSame as X.B -a Xin commandline. X.TP 0.6i X.B print_ps=[on|off] XSame as X.B -p Xin commandline. X.TP 0.6i X.B output_file=outputfile XSame as X.B -o Xin commandline. X.TP 0.6i X.B inpute_file=inputfile XSame as X.B -f Xin commandline. X.TP 0.6i X.B printer=printer XSame as X.B -P Xin commandline. X.TP 0.6i X.B max_lines=maxlines XSame as X.B -L Xin commandline. X.PP X.SH "SEE ALSO" Xlpr(1) a2ps(1L) X.SH BUGS XBackspace for clearing wrong inputs in searching mode will not work (Try Crtl+h). X.br XX application will still not work. X.SH AUTHORS XLars Hagen (hagenl@cs.tu-berlin.de) idea, parser & man-page. X.br XSven van der Meer (vdmeer@cs.tu-berlin.de) data structures & term layout. X.SH THANKS TO XVery, very special thanks to Sven Mathing and Stefan Arbanowski for helps and the lot of very well ideas by theoretical problems solutions. X.PP XA special thanks to Steve Coe for a lot of help by the realisation of the parsers. X.PP XThanks to Carsten Borman for well new ideas. X.PP XAlso, thanks to all people for putting up with, reporting bugs in, and suggesting new additions to the old X.I sacdrt. END_OF_FILE if test 11826 -ne `wc -c <'sacdrt3.1/man/sacdrt.1'`; then echo shar: \"'sacdrt3.1/man/sacdrt.1'\" unpacked with wrong size! fi # end of 'sacdrt3.1/man/sacdrt.1' fi if test ! -d 'sacdrt3.1/sacdrt_term' ; then echo shar: Creating directory \"'sacdrt3.1/sacdrt_term'\" mkdir 'sacdrt3.1/sacdrt_term' fi if test -f 'sacdrt3.1/sacdrt_term/input.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sacdrt3.1/sacdrt_term/input.c'\" else echo shar: Extracting \"'sacdrt3.1/sacdrt_term/input.c'\" \(12464 characters\) sed "s/^X//" >'sacdrt3.1/sacdrt_term/input.c' <<'END_OF_FILE' X/* X * SACDRT Version 3.1 SAC-Database-Reader for DeepSky Objects X * Module INPUT.C is written by Sven van der Meer for the SACDRT. X * X * Copyright (C) 1994 Lars Hagen & Sven van der Meer X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X * X * Problems or comments to hagenl@cs.tu-berlin.de X * X */ X X#include <string.h> X#include <stdlib.h> X#include "sacdrt.h" X#include "database.h" X#include "layout.h" X X XFILE *file_ptr; /* pointer to the input file */ Xvoid insert_sac(char *,int); Xvoid delete_waste(char *,char *); X X X/* X * int INPUT(int, int) input works for all other function, which need X * parsed information from the database. X * NEW_CURRENT indicates the new offset, if there it is X * new needed (searching and printing will call this) X * TO_DO tells input what todo. see the switch for X * possible calls X * X */ Xint input(int new_current, int to_do) X{ Xstatic char name[80], name_info[80], other[80], type[80], con[80], ra[10], X dec[10], mag[80], u2000[30], tirion[30], descr[500], size[20], X clas[200], nsts[20], brstr[10], notes[200], source[100], subr[5]; X Xint i=0, j=0, ret=TRUE; Xchar *tmp_ptr; Xchar help_ptr[MAXPATHLEN]; Xstruct core_list *sac_core=&head_core; Xstruct mark_list *tmp_mark=&head_mark; Xchar c; X X switch(to_do){ X case output_first: sac_core=sac_core->next; X status.core_current=sac_core->core_count; X break; X case output_next: if(!config.filter){ X if (status.core_current+new_current<status.max_core) X i=status.core_current+new_current; X else X i=status.max_core; X } X else{ X if (status.mark_current+new_current<status.max_mark-1) X i=status.mark_current+new_current; X else X i=status.max_mark-1; X while (tmp_mark->mark_count!=i) X tmp_mark=tmp_mark->next_mark; X i=tmp_mark->mark_core; X status.mark_current=tmp_mark->mark_count; X } X while (sac_core->core_count!=i) X sac_core=sac_core->next; X status.core_current=sac_core->core_count; X break; X case output_prev: if(!config.filter){ X if (status.core_current-new_current>0) X i=status.core_current-new_current; X else X i=1; X } X else{ X if (status.mark_current-new_current>0) X i=status.mark_current-new_current; X else X i=1; X while (tmp_mark->mark_count!=i) X tmp_mark=tmp_mark->next_mark; X i=tmp_mark->mark_core; X status.mark_current=tmp_mark->mark_count; X } X while (sac_core->core_count!=i) X sac_core=sac_core->next; X status.core_current=sac_core->core_count; X break; X case file_current: X case print_current: sac_core=status.next_core; X break; X case search_found: while (sac_core->core_count!=new_current) X sac_core=sac_core->next; X status.core_current=sac_core->core_count; X break; X default: break; X } X status.next_core=sac_core; X X i=0; X tmp_ptr=sac_core->sac_line; X X while(i<16){ X c=*tmp_ptr++; X if (c=='"'||c=='\0'||c==0x0a||c==0x0d){ X help_ptr[j++]='\0'; X if(config.base_version==v52){ X switch(i){ X case 0: strcpy((char *)name,(const char *)help_ptr); X break; X case 1: strcpy((char *)other,(const char *)help_ptr); X break; X case 2: strcpy((char *)type,(const char *)help_ptr); X break; X case 3: strcpy((char *)con,(const char *)help_ptr); X break; X case 4: strcpy((char *)ra,(const char *)help_ptr); X break; X case 5: strcpy((char *)dec,(const char *)help_ptr); X break; X case 6: strcpy((char *)mag,(const char *)help_ptr); X break; X case 7: strcpy((char *)u2000,(const char *)help_ptr); X break; X case 8: strcpy((char *)tirion,(const char *)help_ptr); X break; X case 9: strcpy((char *)descr,(const char *)help_ptr); X break; X case 10: strcpy((char *)size,(const char *)help_ptr); X break; X case 11: strcpy((char *)clas,(const char *)help_ptr); X break; X case 12: strcpy((char *)nsts,(const char *)help_ptr); X break; X case 13: strcpy((char *)brstr,(const char *)help_ptr); X break; X case 14: strcpy((char *)notes,(const char *)help_ptr); X break; X case 15: strcpy((char *)source,(const char *)help_ptr); X break; X } X } X else{ X switch(i){ X case 0: strcpy((char *)name,(const char *)help_ptr); X break; X case 1: strcpy((char *)other,(const char *)help_ptr); X break; X case 2: strcpy((char *)type,(const char *)help_ptr); X break; X case 3: strcpy((char *)con,(const char *)help_ptr); X break; X case 4: strcpy((char *)ra,(const char *)help_ptr); X break; X case 5: strcpy((char *)dec,(const char *)help_ptr); X break; X case 6: strcpy((char *)mag,(const char *)help_ptr); X break; X case 7: strcpy((char *)subr,(const char *)help_ptr); X break; X case 8: strcpy((char *)u2000,(const char *)help_ptr); X break; X case 9: strcpy((char *)tirion,(const char *)help_ptr); X break; X case 10: strcpy((char *)descr,(const char *)help_ptr); X break; X case 11: strcpy((char *)size,(const char *)help_ptr); X break; X case 12: strcpy((char *)clas,(const char *)help_ptr); X break; X case 13: strcpy((char *)nsts,(const char *)help_ptr); X break; X case 14: strcpy((char *)brstr,(const char *)help_ptr); X break; X case 15: strcpy((char *)notes,(const char *)help_ptr); X break; X } X } X i++; j=0; X } X else{ X help_ptr[j++]=c; X } X } X X parse_name(name_info, name); X if (config.parse){ X parse_type(type); X parse_con(con); X parse_ra (ra); X parse_dec(dec); X parse_mag(mag,FALSE); X parse_class(clas); X parse_descr(descr); X parse_brstr(brstr); X parse_nsts(nsts); X parse_notes(notes); X parse_size(size); X if(config.base_version==v52) X parse_source(source); X if(config.base_version==v6) X parse_mag(subr,TRUE); X } X X if ((to_do==output_first) || (to_do==output_next) || X (to_do==output_prev) || (to_do==search_found)){ X output(name, name_info, other, type, con, X ra, dec, mag, u2000, tirion, X descr, size, clas, nsts, X brstr, notes, source, subr); X } X X if (to_do==print_current){ X print_page(name, name_info, other, type, con, X ra, dec, mag, u2000, tirion, X descr, size, clas, nsts, X brstr, notes, source, subr, print_current); X } X X if (to_do==file_current){ X print_page(name, name_info, other, type, con, X ra, dec, mag, u2000, tirion, X descr, size, clas, nsts, X brstr, notes, source, subr, file_current); X } Xreturn ret; X} X X X X/* X * void SAC_END() is called from main when the user wants to leave the program X * close the files, end curses end then exit 0 X * X */ Xvoid sac_end() X{ X message_window(" Cleaning up",normal); X delete_all_marked(); X delete_core_list(); X if(config.rc_input!=NULL) free(config.rc_input); X if(config.rc_output!=NULL) free(config.rc_output); X if(config.rc_printer!=NULL) free(config.rc_printer); X free(status.time); X close_message_window(normal); X close_layout(); X ending_message(); X exit (0); X} X X X X/* X * void OPEN_FILE() opens the input file for function input(..). at first X * the file given from the init file will be used, then X * the file given from command-line will be used, then X * the file specified in the environment SACBASE_INPUT X * and at last the file SAC.TXT in the current working X * directory. When there are errors, a aproporiate message X * will be printed to stderr and the sacdrt terminates X * X */ Xvoid open_file() X{ Xchar *enviroment=NULL; X X if (config.input!=NULL) X file_ptr = fopen(config.input, "r"); X else if (config.rc_input!=NULL) X file_ptr = fopen(config.rc_input, "r"); X else if ((enviroment = getenv(SAC_DEFAULT_ENV_INPUT)) != NULL) X file_ptr = fopen(enviroment, "r"); X else X file_ptr = fopen(SAC_DEFAULT_INPUT, "r"); X X if (!file_ptr){ X fprintf(stderr,"sac: unable to open file -> "); X if (config.input!=NULL) X fprintf(stderr,"%s given from command-line\n",config.input); X if (config.rc_input!=NULL) X fprintf(stderr,"%s given from .sacdrt file\n",config.rc_input); X else if (enviroment!=NULL) X fprintf(stderr,"%s given from environment\n",enviroment); X else X fprintf(stderr,"%s no such file in current directory\n",SAC_DEFAULT_INPUT); X exit (1); X } X if (getc(file_ptr)=='"') X config.base_version=v6; X else X config.base_version=v52; X fseek(file_ptr,0,SEEK_SET); Xreturn; X} X X X X/* X * void INITIALIZE() when a file opened, this function will build the X * structure core_list. X * Every entry in core_list is one line from the X * database. So we have the whole database as core X * in the memory (this saves a lot of time when X * searching, but needs about 2meg for running the X * sacdrt). X * X */ Xvoid initialize() X{ Xchar *tmp_ptr=(char *)malloc(MAXPATHLEN); Xint i=0; X X head_core.mark_flag=FALSE; X while(fgets(tmp_ptr,MAXPATHLEN,file_ptr)&&++i) X insert_sac(tmp_ptr,i); X X status.max_core=i; X X free(tmp_ptr); X fclose(file_ptr); Xreturn; X} X X X X/* X * void INSERT_SAC(char*,int) called from initialize to insert the new object X * in the existing list X * DELETE_WASTE is used to delete '",' from X * version 6. X * X */ Xvoid insert_sac(char *tmp_ptr,int count) X{ Xstruct core_list *tmp_core; Xchar *tmp_line; X X tmp_core=(struct core_list *)malloc(sizeof(struct core_list)); X tmp_line=(char *)malloc(strlen(tmp_ptr)+1); X delete_waste(tmp_line,tmp_ptr); X X tmp_core->sac_line=(char *)malloc(strlen(tmp_line)+1); X if (tmp_core==NULL) X sac_exit(7," in function insert_sac"); X strcpy((char *)tmp_core->sac_line,(const char *)tmp_line); X X tmp_core->core_count=count; X tmp_core->mark_flag=FALSE; X X tail_core.next->next=tmp_core; X tmp_core->next=&tail_core; X tail_core.next=tmp_core; X X free(tmp_line); Xreturn; X} X X X Xvoid delete_waste(char *ptr1,char *ptr2) X{ X if(config.base_version==v6) X ptr2++; X while (*ptr2!='\0'){ X if(*ptr2=='"'){ X ptr2++; X if(*ptr2==',') X ptr2++; X else X ptr2--; X } X *ptr1++=*ptr2++; X } Xreturn; X} END_OF_FILE if test 12464 -ne `wc -c <'sacdrt3.1/sacdrt_term/input.c'`; then echo shar: \"'sacdrt3.1/sacdrt_term/input.c'\" unpacked with wrong size! fi # end of 'sacdrt3.1/sacdrt_term/input.c' fi if test -f 'sacdrt3.1/sacdrt_term/mark_objects.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sacdrt3.1/sacdrt_term/mark_objects.c'\" else echo shar: Extracting \"'sacdrt3.1/sacdrt_term/mark_objects.c'\" \(14528 characters\) sed "s/^X//" >'sacdrt3.1/sacdrt_term/mark_objects.c' <<'END_OF_FILE' X/* X * SACDRT Version 3.1 SAC-Database-Reader for DeepSky Objects X * Module MARKED_OBJECTS.C is written by Sven van der Meer for SACDRT. X * X * Copyright (C) 1994 Lars Hagen & Sven van der Meer X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X * X * Problems or comments to hagenl@cs.tu-berlin.de X * X */ X X#include <string.h> X#include <stdlib.h> X#include <ctype.h> X#include <math.h> X#include "database.h" X#include "sacdrt.h" X#include "layout.h" X X Xvoid sacdrt_qsort(struct core_list *v[],int,int); Xvoid sacdrt_swap(struct core_list *v[],int,int); Xint sacdrt_cmp(struct core_list *,struct core_list *); Xvoid sacdrt_shell(struct core_list *v[],int); X X/* X * void INSERT_MARKED (int) will insert a marked object in the marked list X * using status.next_core X * X */ Xvoid insert_marked(int todo) X{ Xstruct core_list *sac_core=&head_core; Xstruct mark_list *tmp_mark; Xchar tmp_ptr[MAXPATHLEN]; X X tmp_mark=(struct mark_list *)malloc(sizeof(struct mark_list)); X if (tmp_mark==NULL) X sac_exit(7," in function insert_object"); X X sac_core=status.next_core; X X sac_core->mark_flag=todo; X switch(todo){ X case use_name: strcpy((char *)tmp_ptr,(const char *)(parse_core(sac_core->sac_line,8))); X break; X case use_other: strcpy((char *)tmp_ptr,(const char *)(parse_core(sac_core->sac_line,9))); X break; X } X tmp_mark->mark_name=(char *)malloc(strlen(tmp_ptr)+1); X strcpy((char *)tmp_mark->mark_name,tmp_ptr); X tmp_mark->mark_core=sac_core->core_count; X tmp_mark->mark_count=status.max_mark; X tmp_mark->next_core=sac_core; X X tail_mark.next_mark->next_mark=tmp_mark; X tmp_mark->next_mark=&tail_mark; X tail_mark.next_mark=tmp_mark; X X status.max_mark++; Xreturn; X} X X X X/* X * void DELETE_ONE_MARKED (int) delete one marked object from the marked list X * called from show_marked (layout.c) with the X * count from the object to delete X * X */ Xvoid delete_one_marked(int delete) X{ Xstruct mark_list *tmp_mark=&head_mark; Xstruct mark_list *del=&head_mark; Xstruct core_list *fil=&head_core; Xint i; X X while((delete!=del->mark_count)&&(del!=&tail_mark)) X del=del->next_mark; X X while((tmp_mark!=&tail_mark)&&(tmp_mark->next_mark!=del)) X tmp_mark=tmp_mark->next_mark; X X if (tmp_mark->next_mark!=del) X return; X X tmp_mark->next_mark=del->next_mark; X while (fil->core_count!=del->mark_core) X fil=fil->next; X fil->mark_flag=FALSE; X free(del->mark_name); X free(del); X status.max_mark--; X if (status.max_mark<2){ X status.max_mark=1; X sac_filter(OFF); X head_mark.next_mark=&tail_mark; X tail_mark.next_mark=&head_mark; X } X else{ X tmp_mark=head_mark.next_mark; X for(i=1;tmp_mark!=&tail_mark;i++){ X tmp_mark->mark_count=i; X tmp_mark=tmp_mark->next_mark; X } X status.max_mark=i; X } X Xreturn; X} X X X/* X * void DELETE_ALL_MARKED() will delete all marked objects and free up the X * memory allocated for the marked list X * X */ Xvoid delete_all_marked() X{ Xstruct mark_list *tmp_mark; Xstruct mark_list *tmp_swap; Xstruct core_list *tmp_core=&head_core; X X for (tmp_mark=head_mark.next_mark;tmp_mark!=&tail_mark;tmp_mark=tmp_swap){ X tmp_swap=tmp_mark->next_mark; X free(tmp_mark->mark_name); X free(tmp_mark); X } X head_mark.next_mark=&tail_mark; X tail_mark.next_mark=&head_mark; X X if(tmp_core!=&tail_core){ X while((tmp_core=tmp_core->next)!=&tail_core) X tmp_core->mark_flag=FALSE; X } X X status.max_mark=1; X sac_filter(OFF); Xreturn; X} X X X X/* X * void DELETE_CORE_LIST() free up all allocated memory for the core list X * and delete the core list. called when sacdrt X * terminates X * X */ Xvoid delete_core_list() X{ Xstruct core_list *tmp_core; Xstruct core_list *tmp_swap; X X for (tmp_core=head_core.next;tmp_core!=&tail_core;tmp_core=tmp_swap){ X tmp_swap=tmp_core->next; X free(tmp_core->sac_line); X free(tmp_core); X } X Xreturn; X} X X X X/* X * int CS_DO_SEARCH(int) called from cs_search to search for the requested X * objects. i hope this will not need a lot of time X * (on my computer about 10 seconds for all marked). X * X */ Xint cs_do_search() X{ Xint ret=FALSE,i,test,cs_count=1; Xdouble mag_db,ra_db,decl_db; Xdouble min_mag_cmp,max_mag_cmp,min_ra_cmp,max_ra_cmp,min_decl_cmp,max_decl_cmp; Xdouble min_mag_default,max_mag_default; Xstruct core_list *sac_core=&head_core; Xchar tmp[10]; X X min_mag_cmp=atof(cs_values.min_mag)-0.1; X max_mag_cmp=atof(cs_values.max_mag)+0.1; X min_ra_cmp=atof(cs_values.min_ra)-0.1; X max_ra_cmp=atof(cs_values.max_ra)+0.1; X min_decl_cmp=atof(cs_values.min_decl)-0.1; X max_decl_cmp=atof(cs_values.max_decl)+0.1; X X min_mag_default=atof(CS_MIN_MAG); X max_mag_default=atof(CS_MAX_MAG); X X delete_all_marked(); X sac_core=sac_core->next; X X while(sac_core!=&tail_core){ X if((config.curses)&&(fmod((double)cs_count,(double)100)==0)){ X mvwprintw(message_win,1,13,"%i",cs_count); X wrefresh(message_win); X } X X strcpy((char *)cs_tmp.tmp_ptr,(const char *)sac_core->sac_line); X X strcpy(tmp,parse_core(cs_tmp.tmp_ptr,6)); X mag_db=atof(tmp); X strcpy(tmp,parse_core(cs_tmp.tmp_ptr,4)); X ra_db=atof(tmp); X strcpy(tmp,parse_core(cs_tmp.tmp_ptr,5)); X decl_db=atof(tmp); X X strcpy((char *)cs_tmp.name_ptr,(const char *)parse_core(cs_tmp.tmp_ptr,0)); X strcpy((char *)cs_tmp.type_ptr,(const char *)parse_core(cs_tmp.tmp_ptr,2)); X strcpy((char *)cs_tmp.con_ptr,(const char *)parse_core(cs_tmp.tmp_ptr,3)); X strcpy((char *)cs_tmp.other_ptr,(const char *)parse_core(cs_tmp.tmp_ptr,1)); X X if((min_mag_cmp==min_mag_default)&&(max_mag_cmp==max_mag_default)) X sac_core->mark_flag=use_name; X else{ X if((mag_db<max_mag_cmp)&&(mag_db>min_mag_cmp)) X sac_core->mark_flag=use_name; X else X sac_core->mark_flag=FALSE; X } X X if((ra_db<max_ra_cmp)&&(ra_db>min_ra_cmp)&&(sac_core->mark_flag)) X sac_core->mark_flag=use_name; X else X sac_core->mark_flag=FALSE; X X if((decl_db<max_decl_cmp)&&(decl_db>min_decl_cmp)&&(sac_core->mark_flag)) X sac_core->mark_flag=use_name; X else X sac_core->mark_flag=FALSE; X X test=FALSE; X if ((cs_values.mark_name)&&(sac_core->mark_flag)){ X for (i=1;i<max_name;i++){ X if((object_data[i].marked)&&(strcmp(cs_tmp.name_ptr,object_data[i].short_name)==0)) X test=use_name; X else if((object_data[i].marked)&&(strcmp(cs_tmp.other_ptr,object_data[i].short_name)==0)) X test=use_other; X else if((object_data[i].marked)&&(strcmp(object_data[i].short_name,"M1")==0)&&(strcmp(cs_tmp.other_ptr,"M1")==0)) X test=use_other; X else if((object_data[i].marked)&&(strcmp(object_data[i].short_name,"M1")==0)&&(strcmp(cs_tmp.name_ptr,"M1")==0)) X test=use_other; X if(test) X break; X } X sac_core->mark_flag=test; X } X X test=FALSE; X if ((cs_values.mark_type)&&(sac_core->mark_flag)){ X for (i=1;i<max_type;i++){ X if((type_data[i].marked)&&(strcmp(cs_tmp.type_ptr,type_data[i].short_type)==0)){ X test=sac_core->mark_flag; X break; X } X } X sac_core->mark_flag=test; X } X X test=FALSE; X if ((cs_values.mark_con)&&(sac_core->mark_flag)){ X for (i=1;i<max_con;i++){ X if((const_data[i].marked)&&(strcmp(cs_tmp.con_ptr,const_data[i].short_con)==0)){ X test=sac_core->mark_flag; X break; X } X } X sac_core->mark_flag=test; X } X X if (sac_core->mark_flag){ X status.next_core=sac_core; X insert_marked(sac_core->mark_flag); X } X sac_core=sac_core->next; X cs_count++; X } X if (status.max_mark==1) X ret=FALSE; X else{ X sac_filter(ON); X ret=TRUE; X } Xreturn ret; X} X X X X/* X * char *PARSE_CORE(char *,int) input is sac_line and this function will X * return the reqeusted value (name,type,const, X * decl,mag,ra or other). to save time, the X * returned pointers will be not parsed X * X */ Xchar *parse_core(char *tmp_ptr,int ret) X{ Xchar return_ptr[80]; Xint i=0,j=0; Xchar help_ptr[MAXPATHLEN]; Xchar c; X X while(i<7){ X c=*tmp_ptr++; X if (c=='"'||c=='\0'){ X help_ptr[j++]='\0'; X if (i==ret){ X strcpy((char *)return_ptr,(const char *)help_ptr); X break; X } X if ((ret==8)&&(i==0)){ X strcpy((char *)return_ptr,(const char *)help_ptr); X break; X } X if ((ret==9)&&(i==1)){ X strcpy((char *)return_ptr,(const char *)help_ptr); X break; X } X i++; j=0; X } X else{ X help_ptr[j++]=c; X } X } X X if(ret==0){ X if((return_ptr[0]=='M')&&(return_ptr[2]=='-')) X return "M1"; X else X i=0; X while(return_ptr[i]!='\0'){ X if((!isspace(return_ptr[i]))&&!(isdigit(return_ptr[i]))&&(return_ptr[i]!='\'')) X i++; X else{ X return_ptr[i]='\0'; X break; X } X } X } X if(ret==1){ X if((return_ptr[0]=='M')&&(return_ptr[2]=='-')) X return "M1"; X else X i=0; X while(return_ptr[i]!='\0'){ X if(!isspace(return_ptr[i])) X i++; X else{ X return_ptr[i]='\0'; X break; X } X } X } Xreturn return_ptr; X} X X X X/* X * X * X * X */ Xvoid sort_marked() X{ Xint i=0,n=status.max_mark; Xstruct mark_list *test_mark=head_mark.next_mark; Xstruct mark_list *tmp_mark; Xstruct core_list *sac_core; Xchar tmp_ptr[MAXPATHLEN]; Xstruct core_list *sort_tmp[status.max_mark+1]; X X while(test_mark!=&tail_mark){ X sort_tmp[i]=test_mark->next_core; X tmp_mark=test_mark; X test_mark=test_mark->next_mark; X free(tmp_mark->mark_name); X free(tmp_mark); X i++; X } X head_mark.next_mark=&tail_mark; X tail_mark.next_mark=&head_mark; X status.max_mark=1; X X if(config.sort_mode) X sacdrt_shell(sort_tmp,n-1); X else{ X /*qsort((void *)sort_tmp,n-2,sizeof(head_core.next), X (int(*)(const void *,const void *))sacdrt_cmp);*/ X /*qsort((void **)sort_tmp,n-1,sizeof(struct core_list *), X (int(*)(const void *,const void *))sacdrt_cmp);*/ X sacdrt_qsort(sort_tmp,0,n-2); X } X X if(sort.up_down) X i=0; X else{ X i=n-2; X n=0; X } X X while(i!=n-1){ X tmp_mark=(struct mark_list *)malloc(sizeof(struct mark_list)); X if (tmp_mark==NULL) X sac_exit(7," in function sort_marked"); X X sac_core=sort_tmp[i]; X switch(sac_core->mark_flag){ X case use_name: strcpy((char *)tmp_ptr,(const char *)(parse_core(sac_core->sac_line,8))); X break; X case use_other: strcpy((char *)tmp_ptr,(const char *)(parse_core(sac_core->sac_line,9))); X break; X } X X tmp_mark->mark_name=(char *)malloc(strlen(tmp_ptr)+1); X strcpy((char *)tmp_mark->mark_name,tmp_ptr); X tmp_mark->mark_core=sac_core->core_count; X tmp_mark->mark_count=status.max_mark; X tmp_mark->next_core=sac_core; X X tail_mark.next_mark->next_mark=tmp_mark; X tmp_mark->next_mark=&tail_mark; X tail_mark.next_mark=tmp_mark; X X status.max_mark++; X if(sort.up_down) X i++; X else X i--; X } Xreturn; X} X X X X/* X * X * void SACDRT_QSORT(...) X * void SACDRT_SHELL(...) X * void SACDRT_CMP(...) X * void SACDRT_SWAP(...) these are the functions for sorting an existing X * list of marked objects. the shell sort will need X * about 25sec for 10600 objects on a slow computer X * (386DX25) the quick sort works only faster up to X * 2000 objects. then it is abnormally slow (still X * don't know why, may be sacdrt_cmp is the reaseon). X * you can switch between the 2 sorting functions be- X * fore you start a sort. when you save your config X * to the init file, the current sort-function is X * saved, too. X * The following functions are from K&R (with some X * small changes). X * X */ Xvoid sacdrt_qsort(struct core_list *v[],int left,int right) X{ Xint i,last; X X if(left>=right) X return; X sacdrt_swap(v,left,(left+right)/2); X last=left; X for(i=left+1;i<=right;i++) X if(sacdrt_cmp(v[i],v[left])<0) X sacdrt_swap(v,++last,i); X sacdrt_swap(v,left,last); X sacdrt_qsort(v,left,last-1); X sacdrt_qsort(v,last+1,right); Xreturn; X} X X X Xvoid sacdrt_swap(struct core_list *v[],int i,int j) X{ Xstruct core_list *tmp; X tmp=v[i]; X v[i]=v[j]; X v[j]=tmp; Xreturn; X} X X X Xint sacdrt_cmp(struct core_list *s1,struct core_list *s2) X{ Xchar ptr1[MAXPATHLEN]; Xchar ptr2[MAXPATHLEN]; X X switch(sort.sort_to){ X case sort_name: if(s1->mark_flag==use_name) X strcpy(ptr1,parse_core(s1->sac_line,8)); X else X strcpy(ptr1,parse_core(s1->sac_line,9)); X if(s2->mark_flag==use_name) X strcpy(ptr2,parse_core(s2->sac_line,8)); X else X strcpy(ptr2,parse_core(s2->sac_line,9)); X break; X case sort_ra: strcpy(ptr1,parse_core(s1->sac_line,4)); X strcpy(ptr2,parse_core(s2->sac_line,4)); X break; X case sort_mag: strcpy(ptr1,parse_core(s1->sac_line,6)); X strcpy(ptr2,parse_core(s2->sac_line,6)); X break; X case sort_decl: strcpy(ptr1,parse_core(s1->sac_line,5)); X strcpy(ptr2,parse_core(s2->sac_line,5)); X break; X case sort_type: strcpy(ptr1,parse_core(s1->sac_line,2)); X strcpy(ptr2,parse_core(s2->sac_line,2)); X break; X case sort_con: strcpy(ptr1,parse_core(s1->sac_line,3)); X strcpy(ptr2,parse_core(s2->sac_line,3)); X break; X } Xreturn (strcmp(ptr1,ptr2)); X} X X X Xvoid sacdrt_shell(struct core_list *v[],int n) X{ Xint gap,i,j; Xstruct core_list *tmp; X X for(gap=n/2;gap>0;gap/=2){ X if(config.curses){ X mvwprintw(message_win,1,13,"%i ",gap); X wrefresh(message_win); X } X for(i=gap;i<n;i++) X for(j=i-gap;j>=0&&(sacdrt_cmp(v[j],v[j+gap])>0);j-=gap){ X tmp=v[j]; X v[j]=v[j+gap]; X v[j+gap]=tmp; X } X } Xreturn; X} END_OF_FILE if test 14528 -ne `wc -c <'sacdrt3.1/sacdrt_term/mark_objects.c'`; then echo shar: \"'sacdrt3.1/sacdrt_term/mark_objects.c'\" unpacked with wrong size! fi # end of 'sacdrt3.1/sacdrt_term/mark_objects.c' fi if test -f 'sacdrt3.1/sacdrt_term/p_cord.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sacdrt3.1/sacdrt_term/p_cord.c'\" else echo shar: Extracting \"'sacdrt3.1/sacdrt_term/p_cord.c'\" \(4988 characters\) sed "s/^X//" >'sacdrt3.1/sacdrt_term/p_cord.c' <<'END_OF_FILE' X/* X * SACDRT Version 3.1 SAC-Database-Reader for DeepSky Objects X * Module P_CORD.C is written by Lars Hagen for the SACDRT. X * X * Copyright (C) 1994 Lars Hagen & Sven van der Meer X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X * X * Problems or comments to hagenl@cs.tu-berlin.de X * X */ X X/* BUG: DEGREE CHARACTER NOT POSSIBLE !!! */ X X#include <string.h> X#include <stdlib.h> X#include <ctype.h> X#include "sacdrt.h" Xvoid is_empty(char *s); X Xint parse_ra(char *string) /* PARSE RA */ X{ X int i=0; X while (string[i] != '\0') /* if not EndOfString */ X { /* compare of " ", when */ X if (string[i] == ' ') /* found change */ X string[i] = 'h'; /* " " -> "h" */ X i++; X } X return 0; X} X X/***************************************************************************/ X Xint parse_dec(char *string) /* PARSE DEC */ X{ /* if not EndOfString */ X int i=0; /* compare of " ", when */ X while (string[i] != '\0') /* found change */ X { /* " " -> "o" */ X if (string[i] == ' ') X string[i] = 'o'; /* DEGREE CHARACTER */ X i++; X } X strcat(string,"'"); /* append to string "'" */ X return 0; X} X X/***************************************************************************/ X Xint parse_mag(char *string,int call) /* PARSE MAG */ X{ /* append to value of mag*/ X char *dark = "Dark nebula hasn't a magnitude"; /* " mag". */ X char *likedark = "(see brightness)"; X char *unknown = "unknown"; X X if (*string == '0') X { X string++; X if (*string != '.') X { X string--; X *string = ' '; X } X else X string--; X } X X X if (strcmp(string,"79.9") == 0) X { X if(call == 1) X strcpy(string, likedark); X else X strcpy(string,dark); X } X else X if (strcmp(string,"99.9") == 0) X strcpy(string,unknown); X else X strcat(string," mag"); X return 0; X} X X/***************************************************************************/ X Xint parse_brstr(char *string) /* PARSE BRSTR */ X{ /* if 1st char in string */ X if (*string != '\0') /* not EndOfString append*/ X strcat(string," mag"); /* " mag" to string */ X else X is_empty(string); X return 0; X} X X/***************************************************************************/ X Xint parse_size(char *string) /* PARSE SIZE */ X{ X static char *helpstring; X static char *oldstringbegin; X X oldstringbegin = string; /* secure string-pointer to begin */ X helpstring = (char *)malloc(30+sizeof(string)); X helpstring[0] = '\0'; X X while (*string != '\0') /* if not EndOfString check string */ X { /* "X". When found change this to */ X switch(*string) X { X case 'X': X strcat(helpstring," x "); X break; X case '.': X string--; X if(isdigit(*string++)) X strcat(helpstring,"."); X else X strcat(helpstring,"0."); X break; X default: X { X static char helpchar[1]; X helpchar[1] = '\0'; X helpchar[0] = *string; X strcat(helpstring,helpchar); X } X } X string++; X } X string = oldstringbegin; /* rewrite orginal string-pointer */ X strcpy(string, helpstring); /* copy Sizehelp string to string */ X X if (*string == '\0') X is_empty(string); X free(helpstring); X return 0; X} X X/****************************************************************************/ X Xint parse_nsts(char *string) X{ X if (*string == '\0') X is_empty(string); X return 0; X} X X/****************************************************************************/ X Xvoid is_empty(char *s) X{ X if(*s == '\0') X strcpy(s, "N/A"); X} X X X X X X X X END_OF_FILE if test 4988 -ne `wc -c <'sacdrt3.1/sacdrt_term/p_cord.c'`; then echo shar: \"'sacdrt3.1/sacdrt_term/p_cord.c'\" unpacked with wrong size! fi # end of 'sacdrt3.1/sacdrt_term/p_cord.c' fi if test -f 'sacdrt3.1/sacdrt_term/p_descr.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sacdrt3.1/sacdrt_term/p_descr.c'\" else echo shar: Extracting \"'sacdrt3.1/sacdrt_term/p_descr.c'\" \(16070 characters\) sed "s/^X//" >'sacdrt3.1/sacdrt_term/p_descr.c' <<'END_OF_FILE' X/* X * SACDRT Version 3.1 SAC-Database-Reader for DeepSky Objects X * Module P_DESCR.C is written by Lars Hagen for the SACDRT. X * X * Copyright (C) 1994 Lars Hagen & Sven van der Meer X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X * X * Problems or comments to hagenl@cs.tu-berlin.de X * X */ X X#include <string.h> X#include <stdlib.h> X#include <ctype.h> X#include "sacdrt.h" X X#define YES 1 X#define NO 0 X#define NOT_SET 1 X#define KOMMA_SET 0 X X/* use this function later in this module */ X Xvoid parse_descr_string(char *short_string, char *helpstring); Xint numbers(char *short_string, char *helpstring); Xint default_descr(char *s,char *oldhelpstringend,char *old_s,int oldhelpstringlenght, char *helpstring); Xint cat_2_helpstring(char *short_string, char *long_string, char *helpstring, char *s); X Xint komma = NOT_SET; Xint star_FLAG = NO; Xint elogated_FLAG = NO; Xint paired_FLAG = NO; Xint degree_FLAG = NO; Xint klammer_op_FLAG = NO; Xint klammer_cl_FLAG = NO; Xint EOS_FLAG = NO; Xint mag_FLAG = NO; X Xint parse_descr(char *string) X{ X static int i; X static char *helpstring; X static char *short_string; X static char *oldstringbegin; X X i = 0; X star_FLAG = NO; X elogated_FLAG = NO; X oldstringbegin = string; X X short_string = (char *) malloc(100+sizeof(string)); X helpstring = (char *) malloc(500+sizeof(string)); X *short_string = '\0'; X *helpstring = '\0'; X X while(*string != '\0') /* cat the string to many shorter */ X { X while(*string != ',' && *string != '\0' && *string != ' ' && X *string != '(' && *string != ')') X { X short_string[i] = *string++; X i++; X } X short_string[i] = '\0'; /* mark end */ X i = 0; X X if (*string == ',') /* set FLAG's */ X komma = 1; X else X komma = 0; X if (*string == '(') X klammer_op_FLAG = YES; X if (*string == ')') X klammer_cl_FLAG = YES; X X if (*string != '\0') X string++; X else X EOS_FLAG = 1; X X parse_descr_string(short_string,helpstring); /* call parser for these shorter */ X } X string = oldstringbegin; X strcpy(string, helpstring); X X if (*string == '\0') X is_empty(string); X free(short_string); X free(helpstring); X return 0; X} X Xvoid parse_descr_string(char *s, char *helpstring) X{ X static int getorginal; X int oldhelpstringlenght; X char *oldhelpstringend; X char *old_s; X old_s = s; X getorginal = 0; X X oldhelpstringlenght = strlen(helpstring); X oldhelpstringend = helpstring + oldhelpstringlenght; X X if(elogated_FLAG == YES && (isdigit(*s))) X { X strcat(helpstring,"in position angel of "); X (int)s = numbers(s, helpstring); X s++; X strcat(helpstring, " degrees"); X elogated_FLAG = NO; X degree_FLAG = YES; X } X if(paired_FLAG == YES && *s == 'w') X { X s++; X strcat(helpstring,"paired with"); X } X paired_FLAG = NO; X if((degree_FLAG == YES) && ((strcmp(s, "deg") == 0) || ((strcmp(s, "degrees") == 0)))) X { X degree_FLAG = NO; X *s = '\0'; X } X X /* parse for each character the string and find the correct contens els take the orginalstring */ X X while (*s != '\0') X { X switch(*s) X { X case 'a': X if(strcmp(s,"am") == 0) X (int)s = cat_2_helpstring("am", "among", helpstring, s); X else X if(strcmp(s,"att") == 0) X (int)s = cat_2_helpstring("att", "attached", helpstring, s); X else X if(strcmp(s,"alm") == 0) X (int)s = cat_2_helpstring("alm", "almost", helpstring, s); X else X if(strcmp(s,"approx") == 0) X (int)s = cat_2_helpstring("approx", "approximately", helpstring, s); X else X { X getorginal = 1; X default_descr(s,oldhelpstringend,old_s,oldhelpstringlenght,helpstring); X } X break; X case 'b': X if(strcmp(s,"bet") == 0) X (int)s = cat_2_helpstring("bet", "between", helpstring, s); X else X strcat(helpstring, "brighter"); X break; X case 'c': X if(strcmp(s,"cent") == 0) X (int)s = cat_2_helpstring("cent", "center", helpstring, s); X else X if(strcmp(s,"centre") == 0) X (int)s = cat_2_helpstring("centre", "center", helpstring, s); X else X if(strcmp(s,"centri") == 0) X (int)s = cat_2_helpstring("centri", "center", helpstring, s); X else X if(strcmp(s,"comp") == 0) X (int)s = cat_2_helpstring("comp", "complex", helpstring, s); X else X if(strcmp(s,"cont") == 0) X (int)s = cat_2_helpstring("cont", "contact", helpstring, s); X else X strcat(helpstring, "considerably"); X break; X case 'd': X if(strcmp(s,"def") == 0) X (int)s = cat_2_helpstring("def", "defined", helpstring, s); X else X if(strcmp(s,"diam") == 0) X (int)s = cat_2_helpstring("diam", "diameter", helpstring, s); X else X if(strcmp(s,"dif") == 0) X (int)s = cat_2_helpstring("dif", "diffuse", helpstring, s); X else X if(strcmp(s,"diffic") == 0) X (int)s = cat_2_helpstring("diffic", "difficult", helpstring, s); X else X if(strcmp(s,"diff") == 0) X (int)s = cat_2_helpstring("diff", "diffuse", helpstring, s); X else X if(strcmp(s,"decl") == 0) X (int)s = cat_2_helpstring("decl", "declination", helpstring, s); X else X if((strcmp(s,"deg") == 0) && degree_FLAG == NO) X (int)s = cat_2_helpstring("deg", "degrees", helpstring, s); X else X if(strcmp(s,"degrees") == 0) X (int)s = cat_2_helpstring("degrees", "degrees", helpstring, s); X else X { X getorginal = 1; X default_descr(s,oldhelpstringend,old_s,oldhelpstringlenght,helpstring); X } X break; X case 'e': X if(strcmp(s,"end") == 0) X (int)s = cat_2_helpstring("end", "end", helpstring, s); X else X { X if(*++s == 'r') X strcat(helpstring, "easily resolved"); X else X { X if(*s == 'e') X strcat(helpstring, "very extremely"); X else X { X strcat(helpstring, "extremely"); X s--; X } X } X } X break; X case 'f': X strcat(helpstring, "following"); X break; X case 'g': X strcat(helpstring, "gradually"); X break; X X case 'I': X case 'i': X if(strcmp(s,"inv") == 0) X (int)s = cat_2_helpstring("inv", "involved", helpstring, s); X else X if(strcmp(s,"irr") == 0) X (int)s = cat_2_helpstring("irr", "irregular", helpstring, s); X else X if(strcmp(s,"in") == 0) X (int)s = cat_2_helpstring("in", "in", helpstring, s); X else X { X if(*++s == 'F') X strcat(helpstring, "irregular figure"); X else X { X s--; X strcat(helpstring, "irregular"); X } X } X break; X case 'l': X if(strcmp(s,"line") == 0) X (int)s = cat_2_helpstring("line", "line", helpstring, s); X else X strcat(helpstring, "little"); X break; X case 'm': X if(mag_FLAG == NO) X if(strcmp(s,"mag") == 0) X (int)s = cat_2_helpstring("mag", "mag", helpstring, s); X else X strcat(helpstring, "much"); X break; X case 'n': X if(strcmp(s,"neb") == 0) X (int)s = cat_2_helpstring("neb", "nebulosity", helpstring, s); X else X if(strcmp(s,"neb?") == 0) X (int)s = cat_2_helpstring("neb?", "nebulous ?", helpstring, s); X else X if(strcmp(s,"neby") == 0) X (int)s = cat_2_helpstring("neby", "nebulosity", helpstring, s); X else X if(strcmp(s,"nebulous?") == 0) X (int)s = cat_2_helpstring("nebulous?", "nebulous ?", helpstring, s); X else X if(strcmp(s,"nebs?") == 0) X (int)s = cat_2_helpstring("nebs?", "nebulous ?", helpstring, s); X else X if(strcmp(s,"nr") == 0) X (int)s = cat_2_helpstring("nr", "near", helpstring, s); X else X strcat(helpstring, "north"); X break; X case 'p': X if(strcmp(s,"pts") == 0) X (int)s = cat_2_helpstring("pts", "points", helpstring, s); X else X s++; X if(*s == 'F' || *s == 'S' || X *s == 'L' || *s == 'B') X strcat(helpstring, "pretty"); X else X strcat(helpstring, "preceding"); X s--; X break; X case 'r': X s++;s++; X if(*s == 'r') X strcat(helpstring, "well resolved"); X else X { X if (*--s == 'r') X strcat(helpstring, "partially resolved"); X else X { X s--; X strcat(helpstring, "not well resolved"); X } X } X break; X case 's': X if(strcmp(s,"struct") == 0) X (int)s = cat_2_helpstring("struct", "structure", helpstring, s); X else X if(strcmp(s,"susp") == 0) X (int)s = cat_2_helpstring("susp", "suspected", helpstring, s); X else X if(strcmp(s,"stell") == 0) X (int)s = cat_2_helpstring("stell", "stellar", helpstring, s); X else X if(strcmp(s,"stellar") == 0) X (int)s = cat_2_helpstring("stellar", "stellar", helpstring, s); X else X if(strcmp(s,"sev") == 0) X (int)s = cat_2_helpstring("sev", "several", helpstring, s); X else X if(strcmp(s,"several") == 0) X (int)s = cat_2_helpstring("several", "several", helpstring, s); X else X { X s++; X if(*s == 'c') X { X strcat(helpstring, "scattered"); X s++; X } X else X if(*s == 't') X { X strcat(helpstring, "star or stellar"); X star_FLAG = YES; X s++; X } X else X { X char *secure_s; X secure_s = s; X while(*s != '\0' && *s != 'b') X s++; X if(*s == 'b') X strcat(helpstring,"suddenly"); X else X strcat(helpstring, "south"); X s = secure_s; X } X s--; X } X break; X case 't': X if(strcmp(s,"tri") == 0) X (int)s = cat_2_helpstring("tri", "triple", helpstring, s); X else X { X getorginal = 1; X default_descr(s,oldhelpstringend,old_s,oldhelpstringlenght,helpstring); X } X break; X case 'v': X if(strcmp(s,"var") == 0) X (int)s = cat_2_helpstring("var", "variable", helpstring, s); X else X strcat(helpstring, "very"); X break; X case 'w': X strcat(helpstring, "with"); X break; X case 'B': X strcat(helpstring, "bright"); X break; X case 'C': X if(*++s == 'l') X strcat(helpstring, "cluster"); X else X { X strcat(helpstring, "compressed"); X s--; X } X break; X case 'D': X strcat(helpstring, "double"); X break; X case 'E': X strcat(helpstring, "elongated"); X switch(*++s) X { X case '1': X case '2': X case '3': X case '4': X case '5': X case '6': X case '7': X case '8': X case '9': X case '0': X { X strcat(helpstring," in position angel of "); X (int)s = numbers(s,helpstring); X strcat(helpstring, " degrees"); X s++; X } X default: X if(komma == KOMMA_SET) X elogated_FLAG = YES; X s--; X } X break; X case 'F': strcat(helpstring, "faint"); X break; X case 'L': strcat(helpstring, "large"); X break; X case 'M': strcat(helpstring, "middle"); X break; X case 'N': strcat(helpstring, "nucleus"); X break; X case 'P': strcat(helpstring, "poor"); X paired_FLAG = YES; X break; X case 'R': X if(*++s == 'i' || *s == 'I') X strcat(helpstring, "rich"); X else X { X strcat(helpstring, "round"); X s--; X } X break; X case 'S': strcat(helpstring, "small"); X break; X case '-': strcat(helpstring, "to"); X break; X case '*': X if(*++s == '*') X strcat(helpstring, "double"); X else X s--; X strcat(helpstring, "star"); X star_FLAG = YES; X break; X case '=': strcat(helpstring, "equal"); X break; X case '&': strcat(helpstring, "and"); X break; X case '?': strcat(helpstring,"(it's uncertain)"); X break; X case '+': strcat(helpstring,"+"); X break; X case '(': strcat(helpstring,"("); X break; X case ')': strcat(helpstring,")"); X break; X case ';': strcat(helpstring,";"); X break; X case '!': s++; X if(*++s == '!') X strcat(helpstring, "well remarkable object"); X else X { X if (*--s == '!') X strcat(helpstring, "very remarkable object"); X else X { X s--; X strcat(helpstring, "remarkable object"); X } X } X break; X case '1': X case '2': X case '3': X case '4': X case '5': X case '6': X case '7': X case '8': X case '9': X case '0': X case '.': X case 0x27: X { X (int)s = numbers(s, helpstring); X break; X } X default : { X default_descr(s,oldhelpstringend,old_s,oldhelpstringlenght,helpstring); X getorginal = 1; X } X } X if (getorginal == 1) X { X if (komma == 0) strcat(helpstring, " "); X *s = '\0'; X } X else X { X s++; X if (*s != '\0' || komma == 0) strcat(helpstring," "); X } X } X X if(klammer_op_FLAG == YES) /* check the flag settings and action then */ X { X strcat(helpstring, "("); X klammer_op_FLAG = NO; X } X if(klammer_cl_FLAG == YES) X { X char *old_help_secure; X old_help_secure = helpstring; X while(*helpstring++ != '\0'); X --helpstring; X *--helpstring = ')'; X *++helpstring = '\0'; X helpstring = old_help_secure; X klammer_cl_FLAG = NO; X } X if (komma == NOT_SET) X { X strcat(helpstring,","); /* if komma-flag is set */ X degree_FLAG = NO; X } X if (star_FLAG == YES && komma == NOT_SET) X star_FLAG = NO; X X} X X/* spezial parser for numbers and to correct the mistakes from the database */ X Xint numbers(char *s, char *helpstring) X{ X static int i; X int counter; X counter = 0; X i = 0; X X while (*s != '\0' && (isdigit(*s) || *s == '.' || *s == 0x27 || *s == 'm')) X { X char *numhelp; X numhelp = (char *)malloc(sizeof(s)+10); X X *numhelp = *s; X *++numhelp = '\0'; X numhelp--; X X switch(*s) X { X case '.': X X while((*s == '.') && (*s != '\0')) {s++; counter++; } X if(counter == 1) X { X strcat(helpstring, "."); X if (*s != '\0') s--; X } X else X if(*s != '\0' && (isdigit(*s))) X { X strcat(helpstring, "th to "); X while(*s != '\0' && (isdigit(*s))) X { X *numhelp = *s; *++numhelp = '\0'; numhelp--; X strcat(helpstring, numhelp); X if (*s != '\0') s++; X } X strcat(helpstring, "th magnitude"); X star_FLAG = NO; X } X else X { X strcat(helpstring, "th magnitude and fainther"); X star_FLAG = NO; X } X break; X X case 'm': X if(star_FLAG == YES) X star_FLAG = NO; X strcat(helpstring, "th magnitude"); X break; X X case 0x27: X if(star_FLAG == YES) X star_FLAG = NO; X if(*++s == 0x27) X { X strcat(helpstring, " seconds"); X } X else X { X strcat(helpstring," minutes"); X s--; X } X break; X X default: strcat(helpstring,numhelp); X } X if(*s != '\0') X s++; X free(numhelp); X } X if (star_FLAG == YES) X { X strcat(helpstring, "th magnitude"); X mag_FLAG = YES; X star_FLAG = NO; X } X (int)s = s-1; X return (int)s; X} X X/* if parsing not possible write the orginal to the helpstring */ X Xint default_descr(char *s,char *oldhelpstringend,char *old_s,int oldhelpstringlenght, char *helpstring) X{ X helpstring = oldhelpstringend; X *helpstring = '\0'; X s = old_s; X strcat(helpstring, s); X return 0; X} X X/* append to helpstring */ X Xint cat_2_helpstring(char *short_string, char *long_string, char *helpstring, char *s) X{ X strcat(helpstring, long_string); X s = s+strlen(short_string)-1; X return (int)s; X} END_OF_FILE if test 16070 -ne `wc -c <'sacdrt3.1/sacdrt_term/p_descr.c'`; then echo shar: \"'sacdrt3.1/sacdrt_term/p_descr.c'\" unpacked with wrong size! fi # end of 'sacdrt3.1/sacdrt_term/p_descr.c' fi echo shar: End of archive 1 \(of 4\). cp /dev/null ark1isdone MISSING="" for I in 1 2 3 4 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 4 archives. rm -f ark[1-9]isdone else echo You still must unpack the following archives: echo " " ${MISSING} fi exit 0 exit 0 # Just in case...