src/sct_common.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2007 by Aleksander Morgado Juez                         *
00003  *   scitime@aleksander_morgado.mm.st                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Library General Public License as       *
00007  *   published by the Free Software Foundation; either version 2 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU Library General Public     *
00016  *   License along with this program; if not, write to the                 *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef sct_common_H
00022 #define sct_common_H
00023 
00025 #define         SCT_VERSION                     "0.0.1"
00026 
00028 #define         SCT_SECS_IN_DAY                 86400L
00029 
00031 #define         SCT_FSECS_IN_DAY                864E17L
00032 
00034 #define         SCT_FSECS_IN_SEC                1E15
00035 
00037 #define         SCT_MJD_TO_J2000                51544.0
00038 
00040 #define         SCT_JD_TO_J2000                 2451544.5
00041 
00043 #define         SCT_GPS_TAI_LEAPSECOND          19
00044 
00045 
00050 typedef enum {
00051     SCT_STATUS_NOT_INITIALISED  = 0,    
00052     SCT_STATUS_OK               = 1,    
00053     SCT_STATUS_DELTA            = 2     
00054 } SCT_STATUS;
00055 
00056 
00057 typedef enum {
00058     SCT_ACCURACY_FEMTOSECS     = -15, 
00059     SCT_ACCURACY_10FEMTOSECS   = -14, 
00060     SCT_ACCURACY_100FEMTOSECS  = -13, 
00061     SCT_ACCURACY_PICOSECS      = -12, 
00062     SCT_ACCURACY_10PICOSECS    = -11, 
00063     SCT_ACCURACY_100PICOSECS   = -10, 
00064     SCT_ACCURACY_NANOSECS      = -9,  
00065     SCT_ACCURACY_10NANOSECS    = -8,  
00066     SCT_ACCURACY_100NANOSECS   = -7,  
00067     SCT_ACCURACY_MICROSECS     = -6,  
00068     SCT_ACCURACY_10MICROSECS   = -5,  
00069     SCT_ACCURACY_100MICROSECS  = -4,  
00070     SCT_ACCURACY_MILISECS      = -3,  
00071     SCT_ACCURACY_CENTISECS     = -2,  
00072     SCT_ACCURACY_DECISECS      = -1,  
00073     SCT_ACCURACY_SECS          =  0,  
00074     SCT_ACCURACY_DECASECS      =  1,  
00075     SCT_ACCURACY_HECTOSECS     =  2,  
00076     SCT_ACCURACY_KILOSECS      =  3,  
00077     SCT_ACCURACY_MEGASECS      =  4,  
00078     SCT_ACCURACY_DAYS          =  5   
00079 } SCT_ACCURACY;
00080 
00081 
00086 typedef enum {
00087     SCT_TIMESCALE_TAI           =  0,   
00088     SCT_TIMESCALE_UTC           =  1,   
00089     SCT_TIMESCALE_GPS           =  2,   
00090     SCT_TIMESCALE_UT            =  3    
00091 } SCT_TIMESCALE;
00092 
00093 
00098 typedef enum {
00099     SCT_RET_INVALID_LEAPSECONDS = -4,   
00100     SCT_RET_INVALID_NUMBER      = -3,   
00101     SCT_RET_INVALID_PTR         = -2,   
00102     SCT_RET_NOT_INITIALISED     = -1,   
00103     SCT_RET_OK                  =  0    
00104 } SCT_RET;
00105 
00106 
00110 typedef struct _sct_time_base {
00111     SCT_STATUS      status;     
00112     SCT_ACCURACY    accuracy;   
00113     SCT_TIMESCALE   timescale;  
00114     int64_t         days;       
00115     int32_t         secs;       
00116     int64_t         fsecs;      
00117 } sct_time;
00118 
00119 typedef sct_time * sct_time_ptr;    
00120 
00121 
00122 
00123 #endif //sct_common_H

Generated on Sun May 20 15:32:42 2007 for scitime by  doxygen 1.5.1