| 
            Last change
 on this file since 2774 was             2643, checked in by cmv, 21 years ago           | 
        
        
          | 
             
update pour version 3.6.3 Xephem   cmv 17/01/04 
 
           | 
        
        
          | 
            File size:
            963 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | /* aux functions so programs besides XEphem can use this library.
 | 
|---|
| 2 |  */
 | 
|---|
| 3 | 
 | 
|---|
| 4 | #include <stdio.h>
 | 
|---|
| 5 | #include <stdlib.h>
 | 
|---|
| 6 | 
 | 
|---|
| 7 | #include "astro.h"
 | 
|---|
| 8 | #include "preferences.h"
 | 
|---|
| 9 | 
 | 
|---|
| 10 | /* default preferences */
 | 
|---|
| 11 | static int prefs[NPREFS] = {
 | 
|---|
| 12 |     PREF_TOPO, PREF_METRIC, PREF_MDY, PREF_UTCTZ, PREF_HIPREC, PREF_NOMSGBELL,
 | 
|---|
| 13 |     PREF_PREFILL, PREF_TIPSON, PREF_CONFIRMON, PREF_SUN
 | 
|---|
| 14 | };
 | 
|---|
| 15 | 
 | 
|---|
| 16 | /* called anytime we want to know a preference.
 | 
|---|
| 17 |  */
 | 
|---|
| 18 | int
 | 
|---|
| 19 | pref_get(Preferences pref)
 | 
|---|
| 20 | {
 | 
|---|
| 21 |         return (prefs[pref]);
 | 
|---|
| 22 | }
 | 
|---|
| 23 | 
 | 
|---|
| 24 | /* call to force a certain preference, return the old setting.
 | 
|---|
| 25 |  */
 | 
|---|
| 26 | int
 | 
|---|
| 27 | pref_set (Preferences pref, int newp)
 | 
|---|
| 28 | {
 | 
|---|
| 29 |         int prior = pref_get(pref);
 | 
|---|
| 30 |         prefs[pref] = newp;
 | 
|---|
| 31 |         return (prior);
 | 
|---|
| 32 | }
 | 
|---|
| 33 | 
 | 
|---|
| 34 | /* given an mjd, return it modified for terrestial dynamical time */
 | 
|---|
| 35 | double
 | 
|---|
| 36 | mm_mjed (Now *np)
 | 
|---|
| 37 | {
 | 
|---|
| 38 |         return (mjd + deltat(mjd)/86400.0);
 | 
|---|
| 39 | }
 | 
|---|
| 40 | 
 | 
|---|
| 41 | /* For RCS Only -- Do Not Edit */
 | 
|---|
| 42 | static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: auxil.c,v $ $Date: 2005-01-17 10:13:03 $ $Revision: 1.4 $ $Name: not supported by cvs2svn $"};
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.