?? data.c
字號:
/*
** Astrolog (Version 4.00) File: data.c
**
** IMPORTANT NOTICE: the graphics database and chart display routines
** used in this program are Copyright (C) 1991-1993 by Walter D. Pullen
** (cruiser1@stein.u.washington.edu). Permission is granted to freely
** use and distribute these routines provided one doesn't sell,
** restrict, or profit from them in any way. Modification is allowed
** provided these notices remain with any altered or edited versions of
** the program.
**
** The main planetary calculation routines used in this program have
** been Copyrighted and the core of this program is basically a
** conversion to C of the routines created by James Neely as listed in
** Michael Erlewine's 'Manual of Computer Programming for Astrologers',
** available from Matrix Software. The copyright gives us permission to
** use the routines for personal use but not to sell them or profit from
** them in any way.
**
** The PostScript code within the core graphics routines are programmed
** and Copyright (C) 1992-1993 by Brian D. Willoughby
** (brianw@sounds.wa.com). Conditions are identical to those above.
**
** The extended accurate ephemeris databases and formulas are from the
** calculation routines in the program "Placalc" and are programmed and
** Copyright (C) 1989,1991,1993 by Astrodienst AG and Alois Treindl
** (alois@azur.ch). The use of that source code is subject to
** regulations made by Astrodienst Zurich, and the code is not in the
** public domain. This copyright notice must not be changed or removed
** by any user of this program.
**
** Initial programming 8/28,30, 9/10,13,16,20,23, 10/3,6,7, 11/7,10,21/1991.
** X Window graphics initially programmed 10/23-29/1991.
** PostScript graphics initially programmed 11/29-30/1992.
** Last code change made 12/31/1993.
*/
#include "astrolog.h"
/*
******************************************************************************
** Global Variables.
******************************************************************************
*/
FILE *S = stdout;
#ifdef SWITCHES
int noswitches = FALSE;
#else
int noswitches = TRUE;
#endif
int total = TOTAL;
int aspects = DEFAULT_ASPECTS;
int universe = 0;
int centerplanet = _SUN;
int placalc = FALSE;
int seconds = FALSE;
int housesystem = DEFAULT_SYSTEM;
int ansi = FALSE;
int divisions = DIVISIONS;
int screenwidth = SCREENWIDTH;
int eurodate = FALSE;
int eurotime = FALSE;
int smartcusp = FALSE;
int column80 = FALSE;
int todisplay = 0x0;
int exdisplay = 0x0;
int andisplay = 0x0;
int operation = 0x0;
int relation = 0; /* What relationship chart are we doing, if any? */
int interpret = FALSE; /* Is -I switch in effect? */
int progress = FALSE; /* Are we doing a -p progressed chart? */
int multiplyfactor = 1; /* Value passed to -x switch. */
int onasc = 0; /* Value passed to -1 or -2 switch. */
int wheelrows = 4; /* Number of rows per house to use for -w wheel. */
int graphstep = 5; /* Latitude step rate passed to -L switch. */
int autom = FALSE; /* Do we need to prompt user for chart info? */
real progday = 365.25; /* Day value passed to -pd switch. */
real defzone = DEFAULT_ZONE;
real deflong = DEFAULT_LONG;
real deflat = DEFAULT_LAT;
real modulus = DEGREES;
char *progname, *filename, *filename2;
real SD = 0.0, JD, Jdp, T;
int Mon, Day, Yea, Mon2, Day2, Yea2, Delta = 0;
real Tim, Zon, Lon, Lat, Tim2, Zon2, Lon2, Lat2;
int MonX = 1, DayX = 2, YeaX = 1994;
real TimX = 12.00, ZonX = 8.0, LonX = 122.20, LatX = 47.36;
int MM = 11, DD = 19, YY = 1971;
real TT = 11.01, ZZ = 8.0, OO = 122.20, AA = 47.36;
/*
******************************************************************************
** Global Arrays.
******************************************************************************
*/
real planet[TOTAL+1], planetalt[TOTAL+1], house[SIGNS+1], ret[TOTAL+1],
spacex[BASE+1], spacey[BASE+1], spacez[BASE+1], force[TOTAL+1];
gridstruct PTR grid = NULL;
byte inhouse[TOTAL+1], inhouse1[TOTAL+1], inhouse2[TOTAL+1];
int starname[STARS+1], objectansi[TOTAL+1];
/* Restriction status of each object, as specified with -R switch. */
byte ignore[TOTAL+1] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Planets */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Minors */
0, 0, 0, 0, /* Cusps */
0, 0, 0, 0, 0, 0, 0, 0, /* Uranians */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* Stars */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
/* Restriction of objects when transiting, as specified with -RT switch. */
byte ignore2[TOTAL+1] = {
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Planets */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Minors */
0, 0, 0, 0, /* Cusps */
0, 0, 0, 0, 0, 0, 0, 0, /* Uranians */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* Stars */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
/*
******************************************************************************
** Global Tables.
******************************************************************************
*/
char *appname = APPNAME;
char *signname[] = {"",
"Aries", "Taurus", "Gemini", "Cancer", "Leo",
"Virgo", "Libra", "Scorpio",
"Sagittarius", "Capricorn", "Aquarius", "Pisces"};
char *signabbrev[] = {"",
"Ar", "Ta", "Ge", "Cn", "Le", "Vi", "Li", "Sc", "Sg", "Cp", "Aq", "Pi"};
char *signenglish[] = {"",
"Ram", "Bull", "Twins", "Crab", "Lion", "Virgin",
"Scales", "Scorpion", "Archer", "Sea-Goat", "Water-Bearer", "Fishes"};
char *housetradition[] = {"",
"Personality", "Money", "Communication", "Home",
"Children", "Servants", "Marriage", "Death",
"Long Journeys Over Water", "Career", "Friends", "Troubles"};
char *objectname[] = {
"Earth", "Sun", "Moon", "Mercury", "Venus", "Mars", /* Planets */
"Jupiter", "Saturn", "Uranus", "Neptune", "Pluto",
"Chiron", "Ceres", "Pallas", "Juno", "Vesta", /* Asteroids */
"Node", "Fortune", "Midheaven", "Ascendant", "Vertex", /* Others */
"11th Cusp", "12th Cusp", "2nd Cusp", "3rd Cusp", /* Cusps */
"Cupido", "Hades", "Zeus", "Kronos", /* Uranians */
"Apollon", "Admetos", "Vulkanus", "Poseidon",
"Achernar", "Polaris", "Zeta Retic.", "Pleiades", /* Stars */
"Aldebaran", "Capella", "Rigel", "Bellatrix", "Alnath",
"Orion", "Betelgeuse", "Menkalinan", "Murzim", "Canopus",
"Alhena", "Sirius", "Adara", "Wezen", "Castor",
"Procyon", "Pollux", "Suhail", "Avior", "Miaplacidus",
"Alphard", "Regulus", "Dubhe", "Acrux", "Gacrux",
"Becrux", "Alioth", "Spica", "Alkaid", "Agena",
"Arcturus", "Kentaurus", "Antares", "Shaula", "Sargas",
"Australis", "Vega", "Altair", "Peacock", "Deneb",
"Alnair", "Fomalhaut", "Andromeda"};
char *systemname[] = {
"Placidus", "Koch", "Equal", "Campanus", "Meridian",
"Regiomontanus", "Porphyry", "Morinus", "Topocentric", "Null"};
char *aspectname[] = {"",
"Conjunct", "Opposite", "Square", "Trine", "Sextile",
"Inconjunct", "Semisextile", "Semisquare", "Sesquiquadrate",
"Quintile", "Biquintile",
"Semiquintile", "Septile", "Novile",
"Binovile", "Biseptile", "Triseptile", "Quatronovile"};
char *aspectabbrev[] = {"",
"Con", "Opp", "Squ", "Tri", "Sex",
"Inc", "SSx", "SSq", "Ses", "Qui", "BQn",
"SQn", "Sep", "Nov", "BNv", "BSp", "TSp", "QNv"};
char *aspectglyph[] = {"",
"Circle with extending line", "Two circles joined by line",
"Quadrilateral", "Triangle", "Six pointed asterisk",
"'K' rotated right", "'K' rotated left", "Acute angle",
"Square with extending lines", "Letter 'Q'", "'+' over '-'",
"'-' over '+'", "Number '7'", "Number '9'", "'9' under Roman 'II'",
"'7' under Roman 'II'", "'7' under Roman 'III'", "'9' under Roman 'IV'"};
char *element[] = {"Fire", "Earth", "Air", "Water"};
char *mode[] = {"Cardinal", "Fixed", "Mutuable"};
char *monthname[] = {"",
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"};
char *dayname[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"};
char *post[] = {"",
"st", "nd", "rd", "th", "th", "th", "th", "th", "th", "th", "th", "th"};
real aspectangle[ASPECTS+1] = {0,
0.0, 180.0, 90.0, 120.0, 60.0, 150.0, 30.0, 45.0, 135.0, 72.0, 144.0,
36.0, DEGREES/7.0, 40.0, 80.0, 720.0/7.0, 1080.0/7.0, 160.0};
real aspectorb[ASPECTS+1] = {0,
7.0, 7.0, 7.0, 7.0, 6.0, 3.0, 3.0, 3.0, 3.0, 2.0, 2.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
real planetorb[BASE+1] = {0,
360.0, 360.0, 360.0, 360.0, 360.0, 360.0, 360.0, 360.0, 360.0, 360.0,
360.0, 360.0, 360.0, 360.0, 360.0, 2.0, 2.0, 360.0, 360.0, 2.0,
360.0, 360.0, 360.0, 360.0,
360.0, 360.0, 360.0, 360.0, 360.0, 360.0, 360.0, 360.0};
real planetadd[BASE+1] = {0,
1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
int ruler1[BASE+1] = {0,
5, 4, 3, 7, 1, 9, 10, 11, 12, 8,
12, 2, 6, 7, 8, 11, 12, 10, 1, 7,
11, 12, 2, 3,
7, 8, 5, 10, 9, 6, 1, 9};
int ruler2[BASE+1] = {0,
0, 0, 6, 2, 8, 12, 11, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};
int exalt[BASE+1] = {0,
1, 2, 11, 12, 10, 4, 7, 8, 9, 6,
4, 4, 10, 5, 11, 6, 9, 7, 10, 12,
10, 9, 7, 6,
3, 6, 1, 9, 11, 8, 5, 12};
/* This little array is the reverse of the ruler arrays: */
/* Here, given a sign, return what planet rules it. */
int rules[SIGNS+1] = {0,
5, 4, 3, 2, 1, 3, 4, 10, 6, 7, 8, 9};
int mainansi[] = {BLACK, WHITE, LTGRAY, DKGRAY, YELLOW, MAGENTA, DKBLUE};
int rainbowansi[] = {WHITE,
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -