Changeset 341 for SH_SHM/trunk


Ignore:
Timestamp:
03/09/2011 04:55:49 PM (13 years ago)
Author:
marcus
Message:

r180 | walther | 2011-03-09 16:27:03 +0100 (Mi, 09 Mär 2011) | 3 lines

Merging most of the changes from marcus' branch. For full details please see
http://www.seismic-handler.org/portal/log/SH_SHM/branches/marcus?revs=101-106,123-171

Location:
SH_SHM/trunk
Files:
27 deleted
68 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/source/basecnst.h

    r16 r341  
    6464 ******************************************************************/ 
    6565 
    66 /* possible flags for operating system are 
    67  * SH_SETUP_SUNOS 
    68  * SH_SETUP_LINUX 
    69  * SH_SETUP_AIX 
    70  * SH_SETUP_HPUX 
    71  * SH_SETUP_ATARITOS 
    72  * SH_SETUP_VMS 
    73  * default is SH_SETUP_SUNOS 
    74  */ 
    75  
    76 #if defined(SH_SETUP_SUNOS) 
    77 #define cBc_OS_UNIX 
    78 #define cBc_OS_SUNOS 
    79 #elif defined(SH_SETUP_LINUX) 
    80 #define cBc_OS_UNIX 
    81 #define cBc_OS_LINUX 
    82 #elif defined(SH_SETUP_AIX) 
    83 #define cBc_OS_UNIX 
    84 #define cBc_OS_AIX 
    85 #elif defined(SH_SETUP_HPUX) 
    86 #define cBc_OS_UNIX 
    87 #define cBc_OS_HPUX 
    88 #elif defined(SH_SETUP_VMS) 
    89 #define cBc_OS_VMS 
    90 #define BC_VAX            /* for compatibility */ 
    91 #elif defined(SH_SETUP_ATARITOS) 
    92 #define cBc_OS_ATARITOS 
    93 #define BC_ATARI          /* for compatibility */ 
    94 #else 
    95 #define cBc_OS_UNIX 
    96 #define cBc_OS_SUNOS 
    97 #endif 
    98  
    99 /* for compatibility (should be removed some time) */ 
    100 #ifdef cBc_OS_UNIX 
    101 #define BC_SUN 
    102 #define cBc_SUN 
    103 #endif 
    104  
    105  
    106  
    10766/* select graphics */ 
    108 /* #define BC_G_GEM */ 
    10967#define BC_G_MEM 
    11068#define cBc_G_MEM 
    111 /* #define BC_G_BGI */ 
    11269#define BC_G_POSTSCRIPT 
    11370#define cBc_G_POSTSCRIPT 
    114 /* #define BC_G_DESKJET */ 
    11571#define BC_G_XWINDOW 
    11672#define cBc_G_XWINDOW 
    117 /* #define BC_G_CALCOMP */ 
    118 #define BC_G_HPGL 
    119 #define cBc_G_HPGL 
    120 /* #define BC_G_VWS */ 
    121 /* #define BC_G_TEK */ 
    12273 
    12374/* general flags */ 
     
    13990 
    14091/* special settings */ 
    141 /* #define BC_GRFVAX */ 
    142         /* special GRF version, only valid on VAX/VMS version */ 
    143 /* #define BC_USE_READK */ 
    144         /* enables readk command, only valid on Sun/UNIX version at SZGRF */ 
    14592#define BC_REVERSECROSS 
    14693#define cBc_REVERSECROSS 
     
    15198/* #define BC_CLOCK_T_AVAILABLE */ 
    15299        /* type clock_t is available */ 
    153  
    154  
    155  
    156  
    157 /****************************************************************** 
    158  ***                        ATARI version                       *** 
    159  ******************************************************************/ 
    160  
    161  
    162  
    163 #ifdef BC_ATARI 
    164  
    165 #define BC_KS_PRIVATE 
    166         /* K.S. private ATARI TT030/8 MultiGEM version */ 
    167  
    168 /* #define BC_SHARE_CPU */ 
    169         /* share CPU time by calling AES routine evnt_timer */ 
    170         /* only in combination with BC_KS_PRIVATE ! */ 
    171         /* only together with DEBUG_SHARE_CPU in module syscall.c, */ 
    172    /* because also used in module gemevent.c */ 
    173  
    174 /* include files */ 
    175 #define BC_SYSBASE "E:\PC\sh\source\SYSBASE.H" 
    176 #define BC_SYERRORS "E:\PC\sh\source\SYERRORS.H" 
    177 #define BC_GCUSRDEF "E:\PC\sh\source\newgraph\GCUSRDEF.H" 
    178 #define BC_FOREIGN "E:\PC\sh\source\SHFRGN.H" 
    179 #define BC_SHDIRS "E:\PC\sh\source\SHDIRS.H" 
    180 #define BC_ASCII "E:\PC\sh\source\ASCII.H" 
    181 #define BC_GRAPHBAS "E:\PC\sh\source\newgraph\GRAPHBAS.H" 
    182 #define BC_SHCONST "E:\PC\sh\source\SHCONST.H" 
    183 #define BC_FOUSRDEF "e:\PC\sh\source\fousrdef.h" 
    184 #define BC_QFUSRDEF "e:\PC\sh\source\qfusrdef.h" 
    185 #define BC_QFERRORS "e:\PC\sh\source\qferrors.h" 
    186 #define BC_CPAR "e:\PC\util\cpar.h" 
    187 #define BC_EARTHLOC "e:\PC\sh\source\earthloc.h" 
    188 #define BC_UTUSRDEF "e:\PC\sh\source\utusrdef.h" 
    189 #define BC_GLUSRDEF "e:\PC\sh\source\glusrdef.h" 
    190 #define BC_TCUSRDEF "e:\pc\sh\source\tcusrdef.h" 
    191 #define BC_INPFILES "e:\PC\util\inpfiles.h" 
    192 #define BC_DFQENTRY "e:\PC\sh\source\dfqentry.h" 
    193 #define BC_ERUSRDEF "e:\PC\sh\source\erusrdef.h" 
    194 #define BC_FLERRORS "e:\PC\sh\source\flerrors.h" 
    195 #define BC_READGRN "e:\PC\sh\source\readgrn.h" 
    196 #define BC_PTUSRDEF "e:\PC\sh\source\ptusrdef.h" 
    197  
    198  
    199 #endif /* BC_ATARI */ 
    200  
    201  
    202  
    203 /****************************************************************** 
    204  ***                        IBM PC version                      *** 
    205  ******************************************************************/ 
    206  
    207  
    208  
    209 #ifdef BC_IBM 
    210  
    211 /* include files */ 
    212 #define BC_SYSBASE "d:\gast\SH\SYSBASE.H" 
    213 #define BC_SYERRORS "d:\gast\SH\SYERRORS.H" 
    214 #define BC_GCUSRDEF "d:\gast\SH\LOCAL\GCUSRDEF.H" 
    215 /* #define BC_GCERRORS "LOCAL\GCERRORS.H" */ 
    216 #define BC_FOREIGN "d:\gast\SH\SHFRGN.H" 
    217 #define BC_SHDIRS "d:\gast\SH\SHDIRS.H" 
    218 #define BC_ASCII "d:\gast\SH\ASCII.H" 
    219 #define BC_GRAPHBAS "d:\gast\SH\LOCAL\GRAPHBAS.H" 
    220 #define BC_SHCONST "d:\gast\SH\SHCONST.H" 
    221 #define BC_QFUSRDEF "d:\gast\sh\qfusrdef.h" 
    222 #define BC_QFERRORS "d:\gast\sh\qferrors.h" 
    223 #define BC_CPAR "d:\gast\util\cpar.h" 
    224 #define BC_EARTHLOC "d:\gast\sh\earthloc.h" 
    225 #define BC_UTUSRDEF "d:\gast\sh\utusrdef.h" 
    226 #define BC_GLUSRDEF "d:\gast\sh\glusrdef.h" 
    227 #define BC_INPFILES "d:\gast\util\inpfiles.h" 
    228 #define BC_DFQENTRY "d:\gast\sh\dfqentry.h" 
    229 #define BC_ERUSRDEF "d:\gast\sh\erusrdef.h" 
    230 #define BC_FLERRORS "d:\gast\sh\flerrors.h" 
    231 #define BC_READGRN "d:\gast\sh\readgrn.h" 
    232 #define BC_PTUSRDEF "d:\gast\sh\ptusrdef.h" 
    233  
    234  
    235 #endif /* BC_IBM */ 
    236  
    237  
    238  
    239 /****************************************************************** 
    240  ***                         VAX version                        *** 
    241  ******************************************************************/ 
    242  
    243  
    244  
    245 #ifdef BC_VAX 
    246  
    247  
    248 #define BC_SYSBASE "SHC_MAIN:SYSBASE.H" 
    249 #define BC_SYERRORS "SHC_MAIN:SYERRORS.H" 
    250 #define BC_GCUSRDEF "SHC_newgraph:GCUSRDEF.H" 
    251 #define BC_FOREIGN "SHC_FOREIGN:SHFRGN.H" 
    252 #define BC_SHDIRS "SHC_MAIN:SHDIRS.H" 
    253 #define BC_ASCII "SHC_MAIN:ASCII.H" 
    254 #define BC_GRAPHBAS "shc_newgraph:GRAPHBAS.H" 
    255 #define BC_SHCONST "SHC_MAIN:SHCONST.H" 
    256 #define BC_CPAR "shc_main:cpar.h" 
    257 #define BC_EARTHLOC "shc_main:earthloc.h" 
    258 #define BC_UTUSRDEF "shc_main:utusrdef.h" 
    259 #define BC_GLUSRDEF "shc_main:glusrdef.h" 
    260 #define BC_INPFILES "shc_utilsrc:inpfiles.h" 
    261 #define BC_TCUSRDEF "shc_main:tcusrdef.h" 
    262 #define BC_QFUSRDEF "shc_main:qfusrdef.h" 
    263 #define BC_QFERRORS "shc_main:qferrors.h" 
    264 #define BC_DFQENTRY "shc_main:dfqentry.h" 
    265 #define BC_ERUSRDEF "shc_main:erusrdef.h" 
    266 #define BC_FLERRORS "shc_main:flerrors.h" 
    267 #define BC_READGRN "shc_main:readgrn.h" 
    268 #define BC_PTUSRDEF "shc_main:ptusrdef.h" 
    269  
    270  
    271 #endif /* BC_VAX */ 
    272  
    273  
    274 /****************************************************************** 
    275  ***                         SUN version                        *** 
    276  ******************************************************************/ 
    277  
    278  
    279 #ifdef BC_SUN 
    280  
    281100 
    282101/* only old style names */ 
     
    311130 
    312131 
    313  
    314 #endif /* BC_SUN */ 
    315  
    316  
    317132/****************************************************************** 
    318133 ***                              END                           *** 
  • SH_SHM/trunk/source/cpar.c

    r16 r341  
    3838#include "cpar.h" 
    3939 
    40  
    41 #ifdef BC_SUN 
    4240#define QUALCHAR1 '-' 
    4341#define QUALCHAR2 '-' 
    44 #else 
    45 #define QUALCHAR1 '-' 
    46 #define QUALCHAR2 '/' 
    47 #endif 
    48  
    49  
    5042 
    5143/* global variables */ 
     
    5850                                      /* parameters and qualifiers */ 
    5951                                      /* are numbered from 1 to N */ 
    60  
    61  
    62 #ifdef XXXYYY 
    63 int main( int argc, char *argv[] ) 
    64 { 
    65         /* local variables */ 
    66         int      i;        /* counter */ 
    67         char     *ptr;     /* string pointer */ 
    68         char     str[BC_LINELTH+1]; 
    69  
    70         /* executable code */ 
    71  
    72         pa_init( argc, argv ); 
    73  
    74         printf( "parameters\n" ); 
    75         for  (i=1; i<=pa_pnumber(); i++) 
    76                 printf( "%2d: %s\n", i, pa_pvalue(i) ); 
    77  
    78         printf( "\n%d qualifiers\n", pa_qnumber() ); 
    79  
    80         if  (pa_qspecified("-x"))  { 
    81                 ptr = pa_qvalue( "-x" ); 
    82                 if  (ptr == NULL)  { 
    83                         printf( "\n   -x (no value)\n" ); 
    84                 } else { 
    85                         printf( "\n   -x value >%s<\n", ptr ); 
    86                 } /*endif*/ 
    87         } else { 
    88                 printf( "\n   -x not specified\n" ); 
    89         } /*endif*/ 
    90  
    91         if  (pa_qspecified("-test"))  { 
    92                 ptr = pa_qvalue( "-test" ); 
    93                 if  (ptr == NULL)  { 
    94                         printf( "\n   -test (no value)\n" ); 
    95                 } else { 
    96                         printf( "\n   -test value >%s<\n", ptr ); 
    97                 } /*endif*/ 
    98         } else { 
    99                 printf( "\n   -test not specified\n" ); 
    100         } /*endif*/ 
    101  
    102         if  (pa_qunchecked(str) > 0) 
    103                 printf( "\n   %d unchecked qualifers.   first: %s\n", 
    104                         pa_qunchecked(str), str ); 
    105  
    106         return 0; 
    107  
    108 } /* end of main */ 
    109 #endif 
    110  
    11152 
    11253 
  • SH_SHM/trunk/source/earthloc.c

    r16 r341  
    7373 
    7474 
    75 /* test main module */ 
    76  
    77  
    78 #ifdef XXX 
    79 int main( int argc, char *argv[] ) 
    80 { 
    81         /* local variables */ 
    82         double   slat, slon;             /* station coordinates */ 
    83         double   elat, elon;             /* epicentre coordinates */ 
    84         double   dist, azim, bazim;      /* results */ 
    85         int      feridx;                 /* FER index */ 
    86         STATUS   status;                 /* return status */ 
    87         char     fername[BC_LINELTH+1];  /* FER name */ 
    88  
    89         /* executable code */ 
    90  
    91         status = BC_NOERROR; 
    92  
    93         if  (argc != 5)  { 
    94                 printf( "*** Usage: mbdis <slat> <slon> <elat> <elon> ***\n" ); 
    95                 return 0; 
    96         } /*endif*/ 
    97  
    98         sscanf( argv[1], "%lf", &slat ); 
    99         sscanf( argv[2], "%lf", &slon ); 
    100         sscanf( argv[3], "%lf", &elat ); 
    101         sscanf( argv[4], "%lf", &elon ); 
    102  
    103         mb_locdiff( slat, slon, elat, elon, &dist, &azim, &bazim ); 
    104  
    105         printf( "   distance:     %6.2f deg\n", dist ); 
    106         printf( "   azimuth:      %6.2f deg\n", azim ); 
    107         printf( "   back-azimuth: %6.2f deg\n", bazim ); 
    108  
    109         mb_ferindex( elat, elon, &feridx, &status ); 
    110         printf( "   FER index: %d\n", feridx ); 
    111         mb_fername( feridx, BC_LINELTH, fername, &status ); 
    112         printf( "   FER name: %s\n", fername ); 
    113         return 0; 
    114  
    115 } /* end of main */ 
    116 #endif /* XXX */ 
    117  
    118 #ifdef YYY 
    119 /* second test main module */ 
    120 int main( int argc, char *argv[] ) 
    121 { 
    122         /* local variables */ 
    123         float    slo_in, az_in; 
    124         float    slo_out, az_out; 
    125         float    slo_dist, az_dist; 
    126         STATUS   status; 
    127  
    128         /* executable code */ 
    129  
    130         status = BC_NOERROR; 
    131         if  (argc != 3)  { 
    132                 printf( "*** Usage: earthloc <slo> <az> ***\n" ); 
    133                 return 0; 
    134         } /*endif*/ 
    135  
    136         sscanf( argv[1], "%f", &slo_in ); 
    137         sscanf( argv[2], "%f", &az_in ); 
    138         mb_statcorr( slo_in, az_in, &slo_out, &az_out, &slo_dist, 
    139                 &az_dist, &status ); 
    140  
    141         if  (Severe(&status))  { 
    142                 printf( "*** status code %d ***\n", status ); 
    143         } else { 
    144                 printf( "   corr: slo %5.2f,  az %6.3f\n", slo_out, az_out ); 
    145                 printf( "   dist: slo %5.2f,  az %6.3f\n", slo_dist, az_dist ); 
    146         } /*endif*/ 
    147  
    148         return 0; 
    149  
    150 } /* end of main */ 
    151 #endif /* YYY */ 
    152  
    153  
    154  
    155 /*---------------------------------------------------------------------*/ 
    156  
    157  
    158  
    15975void mb_locdiff( double slat, double slon, double elat, double elon, 
    16076        double *distance, double *azim, double *bazim ) 
     
    326242/*---------------------------------------------------------------------*/ 
    327243 
    328 #ifdef XXX 
    329  
    330 /* this is old version with old names */ 
    331  
    332 void mb_ferindex( float lat, float lon, int *feridx, STATUS *status ) 
    333  
    334 /* returns FER index from given location (lat,lon) in degrees 
    335  * 
    336  * parameters of routine 
    337  * float      lat, lon;     input; location in degrees 
    338  */ 
    339 { 
    340         /* local variables */ 
    341         int      in, ie, i, j; 
    342         float    zu, eloni, re; 
    343         FILE     *reg; 
    344         int      ferrec[IDXRECLTH]; 
    345         char     line[BC_LINELTH]; 
    346  
    347         /* executable code */ 
    348  
    349         if  (lat < -90.0 || lat > 90.0)  { 
    350                 *feridx = -1; 
    351                 *status = MBE_ILLLAT; 
    352                 return; 
    353         } else if  (lon < -180.0 || lon > 180.0)  { 
    354                 *feridx = -1; 
    355                 *status = MBE_ILLLON; 
    356                 return; 
    357         } /*endif*/ 
    358  
    359         ie = in = 0; 
    360         if  (lat < 0.0)  in = 180; 
    361         if  (lon < 0.0)  ie = 90; 
    362         lat = fabs( lat ); 
    363         lon = fabs( lon ); 
    364         zu = (float)ie + (float)in + lat + 0.0001; 
    365         i = (int)zu + 1; 
    366  
    367         eloni = lon + 0.0001; 
    368  
    369         reg = sy_fopen( mbv_indexfile, "r" ); 
    370         if  (reg == NULL)  { 
    371                 *status = MBE_OPNIDX; 
    372                 return; 
    373         } /*endif*/ 
    374         j = 1; 
    375         while  (j < i)  { 
    376                 if  (fgets( line, BC_LINELTH, reg ) == NULL)  { 
    377                         *status = MBE_EOF; 
    378                         fclose( reg ); 
    379                         return; 
    380                 } /*endif*/ 
    381                 if  (*line == '\n')  j++; 
    382         } /*endwhile*/ 
    383         fscanf( reg, "%d\n", ferrec ); 
    384         for  (j=1; j<=ferrec[0]; j++) 
    385                 fscanf( reg, "%d\n", ferrec+j ); 
    386         /* fseek( reg, (i-1)*IDXRECLTH*sizeof(int), 0 ); */ 
    387         /* fread( ferrec, sizeof(int), IDXRECLTH, reg ); */ 
    388         fclose( reg ); 
    389  
    390         j = ferrec[0]; 
    391         for  (i=2; i<j; i += 3)  { 
    392                 re = (float)(ferrec[i]) + (float)(ferrec[i+1])*0.001; 
    393                 if  (eloni < re)  { 
    394                         *feridx = ferrec[i-1]; 
    395                         break; 
    396                 } /*endif*/ 
    397         } /*endfor*/ 
    398  
    399 } /* end of mb_ferindex */ 
    400  
    401 #endif 
    402  
    403 /*---------------------------------------------------------------------*/ 
    404  
    405  
    406244 
    407245void mb_ferindex( float lat, float lon, int *feridx, STATUS *status ) 
     
    425263 
    426264/*---------------------------------------------------------------------*/ 
    427  
    428 #ifdef XXX 
    429  
    430 /* this is old version with old names */ 
    431  
    432 void mb_fername( int ferindex, int maxlth, char fername[], STATUS *status ) 
    433  
    434 /* returns name of FER 
    435  * 
    436  * parameters of routine 
    437  * int        ferindex;       input; FER index 
    438  * char       fername[];      output; FER name 
    439  * STATUS     *status;        output; return status 
    440  */ 
    441 { 
    442         /* local variables */ 
    443         FILE     *fn;      /* file pointer */ 
    444         int      slth;     /* string length */ 
    445  
    446         /* executable code */ 
    447  
    448         if  (maxlth < 79)  { 
    449                 *status = MBE_SHORTSTR; 
    450                 return; 
    451         } /*endif*/ 
    452  
    453         fn = sy_fopen( mbv_namefile, "r" ); 
    454         if  (fn == NULL)  { 
    455                 *status = MBE_OPNNAM; 
    456                 return; 
    457         } /*endif*/ 
    458  
    459         while  (ferindex-- > 0) 
    460                 fgets( fername, maxlth, fn ); 
    461  
    462         sy_fclose( fn ); 
    463  
    464         slth = (int)strlen( fername ) - 1; 
    465         if  (fername[slth] == '\n') 
    466                 fername[slth] = '\0'; 
    467  
    468 } /* end of mb_fername */ 
    469  
    470 #endif 
    471  
    472 /*---------------------------------------------------------------------*/ 
    473  
    474265 
    475266 
  • SH_SHM/trunk/source/errmsg.c

    r16 r341  
    9494        int      errline;                /* line number */ 
    9595        char     errfile[BC_LINELTH+1];  /* error file */ 
    96 #       ifdef BC_SUN                     /* needed on sun only */ 
    9796        char     *eptr;                  /* pointer to environment variable */ 
    98 #       endif 
    9997 
    10098        /* executable code */ 
     
    102100        /* check error path */ 
    103101        if  (*emv_errdir == '\0')  { 
    104 #               ifdef BC_VAX 
    105                 strcpy( emv_errdir, "shc_errors:" ); 
    106 #               endif 
    107 #               ifdef BC_SUN 
    108102                eptr = GpGetString( cGpS_defpath_errors ); 
    109103                if  (eptr == NULL)  { 
     
    116110                        strcpy( emv_errdir, eptr ); 
    117111                } /*endif*/ 
    118 #               endif 
    119 #               ifdef BC_ATARI 
    120                 strcpy( emv_errdir, "e:\\pc\\sh\\errors\\" ); 
    121 #               endif 
    122112        } /*endif*/ 
    123113 
  • SH_SHM/trunk/source/fctxmn5.h

    r16 r341  
    194194/*--------------------------------------------------------------------*/ 
    195195 
    196 #ifdef XXX 
    197 void mn5_set_shmsetup_pointer( SHT_GLOBAL_SET *ptr ); 
    198 #endif 
    199  
    200 /* special routine to set pointer to global variable of motif modules 
    201  * 
    202  * parameters of routine 
    203  * SHT_GLOBAL_SET *ptr;      input; specifies address of global paramters 
    204  */ 
    205  
    206  
    207 /*--------------------------------------------------------------------*/ 
    208  
    209196 
    210197void mn5_shmsetup( PARAM *par, STATUS *status ); 
     
    255242void mn5_fixgap( PARAM *par, STATUS *status ); 
    256243 
    257 /* removes  zeros from traces introducing a straight line  
     244/* removes  zeros from traces introducing a straight line 
    258245        connecting non-zero values 
    259246 * par 1:    trace list 
  • SH_SHM/trunk/source/fctxmt.h

    r16 r341  
    297297 */ 
    298298 
    299  
    300 /*--------------------------------------------------------------------------*/ 
    301  
    302 #ifdef XXX 
    303 void mt_fft( long lx, COMPLEX cx[], REAL signi ); 
    304  
    305 /* fast fourier transformation of array "cx" of length "lx" 
    306  * Source code was transferred directly from an old-fashioned 
    307  * FORTRAN routine. 
    308  * 
    309  * parameters of routine 
    310  * long       lx;    input; length of complex array 
    311  * COMPLEX    cx[];  modify; array to be fourier transformed 
    312  * REAL       signi; input; sign of transformation 
    313  */ 
    314 #endif /* XXX */ 
    315299 
    316300/*--------------------------------------------------------------------------*/ 
     
    641625        int maxiter, REAL *pos, REAL *width, int *iter, STATUS *status ); 
    642626 
    643 /* fits a gauss function of position "*pos" and width "*width" to  
     627/* fits a gauss function of position "*pos" and width "*width" to 
    644628 * the data given in x[0..ndata-1] and y[0..ndata-]. 
    645629 * 
     
    711695 
    712696 
    713 void mt_fix_gap( SAMPLE dat[], long lth, REAL const_value, BOOLEAN konst,  
     697void mt_fix_gap( SAMPLE dat[], long lth, REAL const_value, BOOLEAN konst, 
    714698               BOOLEAN one); 
    715699 
  • SH_SHM/trunk/source/fftfiltr.c

    r16 r341  
    264264 
    265265/* reads complex coefficients from file 
    266  *  
     266 * 
    267267 * parameters of routine 
    268268 * FILE       *f;       input; file pointer 
     
    13791379/*-------------------------------------------------------------------------*/ 
    13801380 
    1381 #ifdef XXX 
    1382  
    1383 static void ff_lintaper( float taper, long lth, COMPLEX dat[] ) 
    1384  
    1385 /* tapers the end of data array (linear taper) 
    1386  * 
    1387  * parameters of routine 
    1388  * float      taper;       input; taper start [0..1] 
    1389  * long       lth;         input; length of data array 
    1390  * COMPLEX    dat[];       modify; data array to be tapered 
    1391  */ 
    1392 { 
    1393         /* local variables */ 
    1394         long     start;    /* start index */ 
    1395         long     i;        /* index counter */ 
    1396         float    step;     /*  */ 
    1397         float    r;        /* scratch */ 
    1398  
    1399         /* executable code */ 
    1400  
    1401         start = Nlong( (float)lth * taper ); 
    1402         if  (start >= (lth-1))  return; 
    1403         step = 1.0 / (float)(lth-start-1); 
    1404  
    1405         for  (i=start+1; i<lth-1; i++)  { 
    1406                 r = 1.0 - (float)(i-start) * step; 
    1407                 dat[i+1].re *= r; 
    1408                 dat[i+1].im *= r; 
    1409         } /*endfor*/ 
    1410         dat[0].im = 0.0; 
    1411  
    1412 } /* end of ff_lintaper */ 
    1413  
    1414 #endif /* XXX */ 
    1415  
    1416 /*-------------------------------------------------------------------------*/ 
    1417  
    1418  
    1419  
    14201381static void ff_costaper( float taper, long lth, COMPLEX dat[] ) 
    14211382 
  • SH_SHM/trunk/source/fileopen.c

    r16 r341  
    6262 
    6363 
    64  
    6564/*----------------------------------------------------------------------*/ 
    66  
    67 #ifdef XXX 
    68 int main( void ) 
    69 { 
    70         STATUS s; 
    71         char   str[200]; 
    72         int    i; 
    73  
    74         fo_readtable( "shpaths.lnt", &s ); 
    75         fo_translate( "SHC_INPUTS:s.shc", TRUE, 199, str, &i ); 
    76         while  (i == FOC_ANOTHER) 
    77                 fo_translate( "x", FALSE, 199, str, &i ); 
    78         return 0; 
    79 } 
    80 #endif 
    81  
    82  
    83 /*----------------------------------------------------------------------*/ 
    84  
    8565 
    8666 
     
    201181        } /*endwhile*/ 
    202182 
    203 #       ifdef BC_SUN 
    204183        cptr = getenv( logname ); 
    205184        if  (cptr != NULL)  { 
     
    211190                if  (fp != NULL)  return fp; 
    212191        } /*endif*/ 
    213 #       endif 
    214192 
    215193        /* not found, open without translation */ 
  • SH_SHM/trunk/source/foreign/sh_gse.c

    r16 r341  
    353353 
    354354        /* read date and other info from this line */ 
    355 #       ifdef XXX 
    356         strncpy( str, line+5, 4 ); 
    357         str[4] = '\0'; 
    358         sscanf( str, "%d", &(nstart.year) ); 
    359         strncpy( str, line+9, 3 ); 
    360         str[3] = '\0'; 
    361         sscanf( str, "%d", &julday ); 
    362         tc_dayofmn( nstart.year, julday, &(nstart.month), &(nstart.day), status ); 
    363         if  (Severe(status))  return; 
    364         sscanf( line+14, "%d\n%d\n%d\n%d\n%ld\n%s", 
    365                 &(nstart.hour), &(nstart.min), &(nstart.sec), &(nstart.ms), 
    366                 gsv_length+trcno, str ); 
    367 #       endif 
    368355        s = 4; 
    369356        while  (line[s] == ' ')  s++; 
  • SH_SHM/trunk/source/gcf/gcflib.c

    r164 r341  
    370370/* skips data block (jumps to next header or EOF) after a raw header has been 
    371371 * read 
    372  *  
     372 * 
    373373 * parameters of routine 
    374374 * FILE          *gcf; input; GCF data input file 
     
    837837                fd->pos -= 2; 
    838838                if  (fd->pos < 0)  { 
    839 #ifdef XXX 
    840                         if  ((tdiff_start > ((-1.5)*(float)(gcfv_blk->timecorr)/TIMECORRUNIT)) 
    841                                 && gcfv_use_timecorr)  { 
    842                                 /* This may happen if the gfdfile does not contain possible time  */ 
    843                                 /* corrections of the data.  Try to fix this by positioning to    */ 
    844                                 /* a time shifted by the correction.  The samples before this time*/ 
    845                                 /* are not read.  Call this routine recursively.                  */ 
    846                                 { 
    847                                         char  newtime[cBcTimeLth+1];    /* new time position */ 
    848                                         tc_tadd( req_start, (float)(gcfv_blk->timecorr)/TIMECORRUNIT, 
    849                                                 newtime, status ); 
    850                                         if  (SySevere(status))  { 
    851                                                 fprintf( stderr, 
    852                                                         "*** GcfSearchPosition: error in time calc\n"); 
    853                                                 *status = GcfERR_BUG; 
    854                                                 return; 
    855                                         } /*endif*/ 
    856                                         fprintf( stderr, 
    857                                                 "GcfSearchPosition: try to fix time correction bug\n" ); 
    858                                         GcfSearchPosition( chan, gfdfile, stream_str, newtime, 
    859                                                 act_start, status ); 
    860                                         return; 
    861                                 } 
    862                         } else { 
    863 #endif 
    864839                                fprintf( stderr, "*** GcfSearchPosition: check gfdfile\n" ); 
    865840                                *status = GcfERR_BUG; 
    866841                                return; 
    867 #ifdef XXX 
    868                         } /*endif*/ 
    869 #endif 
    870842                } /*endif*/ 
    871843                seek_pos = (INT32)(fd->pos) * (INT32)(fd->blklth); 
     
    11561128                        GcfDecodeBlock( &rhdr, blk, blksmp, &actblksmp, status ); 
    11571129                        ON_ERROR_RETURN 
    1158 #ifdef XXX 
    1159                         if  (actblksmp != gcfv_blk->no_of_samples)  { 
    1160                                 fprintf( stderr, 
    1161                                         "*** GCF block samples: expected %d, actual: %d\n", 
    1162                                         gcfv_blk->no_of_samples, actblksmp ); 
    1163                                 if  (gcfv_decerr_abort)  { 
    1164                                         sy_deallocmem( *ldat ); 
    1165                                         *ldat = NULL; 
    1166                                         GcfFreeMem( blksmp ); 
    1167                                         GcfFreeMem( blk ); 
    1168                                         *status = SeedERR_DECODE_ERR; 
    1169                                         return; 
    1170                                 } else { 
    1171                                         INT32    zeronum;       /* number of sample to zero */ 
    1172                                         zeronum = gcfv_blk->no_of_samples; 
    1173                                         if  (zeronum > maxblksmp)  zeronum = maxblksmp; 
    1174                                         fprintf( stderr, "   zero %d samples and continue\n", zeronum ); 
    1175                                         for  (i=0; i<zeronum; i++) 
    1176                                                 blksmp[i] = 0; 
    1177                                 } /*endif*/ 
    1178                                 actblksmp = gcfv_blk->no_of_samples; 
    1179                         } /*endif*/ 
    1180 #endif 
    11811130                        lsrc = blksmp + fd->sample; 
    11821131                        actblksmp -= fd->sample; 
     
    12061155                        GcfDecodeBlock( &rhdr, blk, blksmp, &actblksmp, status ); 
    12071156                        ON_ERROR_RETURN 
    1208 #ifdef XXX 
    1209                         if  (actblksmp != gcfv_blk->no_of_samples)  { 
    1210                                 fprintf( stderr, 
    1211                                         "*** GCF block samples: expected %d, actual: %d\n", 
    1212                                         gcfv_blk->no_of_samples, actblksmp ); 
    1213                                 if  (gcfv_decerr_abort)  { 
    1214                                         sy_deallocmem( *ldat ); 
    1215                                         *ldat = NULL; 
    1216                                         GcfFreeMem( blksmp ); 
    1217                                         GcfFreeMem( blk ); 
    1218                                         *status = GcfERR_DECODE_ERR; 
    1219                                         return; 
    1220                                 } else { 
    1221                                         INT32    zeronum;       /* number of sample to zero */ 
    1222                                         zeronum = gcfv_blk->no_of_samples; 
    1223                                         if  (zeronum > maxblksmp)  zeronum = maxblksmp; 
    1224                                         fprintf( stderr, "   zero %d samples and continue\n", zeronum ); 
    1225                                         for  (i=0; i<zeronum; i++) 
    1226                                                 blksmp[i] = 0; 
    1227                                 } /*endif*/ 
    1228                                 actblksmp = gcfv_blk->no_of_samples; 
    1229                         } /*endif*/ 
    1230 #endif 
    12311157                        lsrc = blksmp; 
    12321158 
     
    12751201                                                GcfFreeMem( blksmp ); 
    12761202                                                GcfFreeMem( blk ); 
    1277                                                 fprintf( stderr,  
     1203                                                fprintf( stderr, 
    12781204                                                        "   padding aborted, %ld zeroes remaining\n", padcnt ); 
    12791205                                                return; 
  • SH_SHM/trunk/source/gcf/gcftest.c

    r16 r341  
    4242 
    4343 
    44 #ifdef XXX 
    45  
    46         /* test GcfFindFileInGfd */ 
    47  
    48         GcfFindFileInGfd( stream_str, start, gfdfile, 
    49                 &fdescr, &status ); 
    50  
    51         printf( "stream %s\n", fdescr.stream ); 
    52         printf( "t_start %s\n", fdescr.t_start ); 
    53         printf( "t_end %s\n", fdescr.t_end ); 
    54         printf( "name %s\n", fdescr.name ); 
    55         printf( "gfdfile %s\n", fdescr.gfdfile ); 
    56         printf( "recno %d\n", fdescr.recno ); 
    57         printf( "pos %s\n", fdescr.pos ); 
    58         printf( "sample %s\n", fdescr.sample ); 
    59         printf( "calib %g\n", fdescr.calib ); 
    60  
    61  
    62 #endif 
    63  
    6444        /* test GcfSearchPosition */ 
    6545 
     
    7050        printf( "act_start %s\n", act_start ); 
    7151        printf( "status %d\n", status ); 
    72  
    73  
    74  
    75 #ifdef XXX 
    76  
    77         /* test GcfReadStream */ 
    78  
    79         printf( "\n" ); 
    80  
    81         GcfReadStream( 0, gfdfile, stream_str, FALSE, start, 300.0, &ldat, 
    82                 &smplth, act_start, &dt, &calib, &status ); 
    83  
    84         printf( "\n" ); 
    85         printf( "smplth %d\n", smplth ); 
    86         printf( "dt %g\n", dt ); 
    87         printf( "calib %g\n", calib ); 
    88         printf( "act_start %s\n", act_start ); 
    89         printf( "status %d\n", status ); 
    90         printf( "\n" ); 
    91         printf( "%d %d %d %d %d ...\n", ldat[0], ldat[1], ldat[2], ldat[3], ldat[4] ); 
    92  
    93 #endif 
    94  
    95  
    9652} /* end of main */ 
  • SH_SHM/trunk/source/gmusrdef.h

    r16 r341  
    137137 * 
    138138 * parameters of routine 
    139  * int        wdw;       input; wdw number (dummy in the ATARI version) 
     139 * int        wdw;       input; wdw number 
    140140 * int        style;     input; style block number 
    141141 * char       item[];    input; name of attribute 
  • SH_SHM/trunk/source/infoidx.h

    r16 r341  
    4747 
    4848/* infos stored in memory */ 
    49 #ifdef XXX 
    50 /* old values up to 15-Mar-2006 */ 
    51 #define EMAX_LONG  5 
    52 #define EMAX_INT   6 
    53 #define EMAX_BYTE  2 
    54 #define EMAX_REAL  12 
    55 #define EMAX_STR   4 
    56 #define EMAX_CHAR  4 
    57 #define EMAX_TIME  3 
    58 #define EMAX_PTR   8 
    59 #define EMAX_FLAG  16 
    60 #endif 
    61  
    6249#define EMAX_LONG  30 
    6350#define EMAX_INT   30 
     
    7158 
    7259/* info not read from file */ 
    73 #ifdef XXX 
    74 /* old values up to 15-Mar-2006 */ 
    75 #define ENF_LONG   2 
    76 #define ENF_INT    2 
    77 #define ENF_BYTE   0 
    78 #define ENF_REAL   5 
    79 #define ENF_STR    3 
    80 #define ENF_CHAR   3 
    81 #define ENF_TIME   3 
    82 #define ENF_PTR    0 
    83 #define ENF_FLAG   6 
    84 #endif 
    85  
    8660#define ENF_LONG   27 
    8761#define ENF_INT    26 
     
    348322 
    349323/* parameters of routine */ 
    350 /* MEMBLC   *ptr;           input; info block pointer */  
     324/* MEMBLC   *ptr;           input; info block pointer */ 
    351325/* unsigned ientry;         input; info entry */ 
    352326/* int      *status;        output; return status */ 
     
    361335 
    362336/* parameters of routine */ 
    363 /* MEMBLC   *ptr;           input; info block pointer */  
     337/* MEMBLC   *ptr;           input; info block pointer */ 
    364338/* unsigned ientry;         input; info entry */ 
    365339/* int      *status;        output; return status */ 
     
    374348 
    375349/* parameters of routine */ 
    376 /* MEMBLC   *ptr;           input; info block pointer */  
     350/* MEMBLC   *ptr;           input; info block pointer */ 
    377351/* unsigned ientry;         input; info entry */ 
    378352/* int      *status;        output; return status */ 
     
    387361 
    388362/* parameters of routine */ 
    389 /* MEMBLC   *ptr;           input; info block pointer */  
     363/* MEMBLC   *ptr;           input; info block pointer */ 
    390364/* unsigned ientry;         input; info entry */ 
    391365/* int      *status;        output; return status */ 
     
    400374 
    401375/* parameters of routine */ 
    402 /* MEMBLC   *ptr;           input; info block pointer */  
     376/* MEMBLC   *ptr;           input; info block pointer */ 
    403377/* unsigned ientry;         input; info entry */ 
    404378/* int          maxlth;                  input; maximum length of output string */ 
     
    415389 
    416390/* parameters of routine */ 
    417 /* MEMBLC   *ptr;           input; info block pointer */  
     391/* MEMBLC   *ptr;           input; info block pointer */ 
    418392/* unsigned ientry;         input; info entry */ 
    419393/* int      *status;        output; return status */ 
     
    428402 
    429403/* parameters of routine */ 
    430 /* MEMBLC   *ptr;           input; info block pointer */  
     404/* MEMBLC   *ptr;           input; info block pointer */ 
    431405/* unsigned ientry;         input; info entry */ 
    432406/* TIME         *time;                   output; time returned */ 
     
    442416 
    443417/* parameters of routine */ 
    444 /* MEMBLC   *ptr;           input; info block pointer */  
     418/* MEMBLC   *ptr;           input; info block pointer */ 
    445419/* unsigned ientry;         input; info entry */ 
    446420/* int      *status;        output; return status */ 
     
    455429 
    456430/* parameters of routine */ 
    457 /* MEMBLC   *ptr;           input; info block pointer */  
     431/* MEMBLC   *ptr;           input; info block pointer */ 
    458432/* unsigned ientry;         input; info entry */ 
    459433/* int      *status;        output; return status */ 
  • SH_SHM/trunk/source/newgraph/Makefile

    r200 r341  
    1616LIB_GRAPH       =       $(SH_LIB)libgraph.a 
    1717 
    18 LOCAL_SRCS      =       graphch.c hpch.c memch.c memfile.c psch.c xwch.c 
     18LOCAL_SRCS      =       graphch.c memch.c memfile.c psch.c xwch.c 
    1919#LOCAL_OBJS     =       $(LOCAL_SRCS:%.c=%.o) 
    2020LOCAL_OBJS      =       $(LOCAL_SRCS:.c=.o) 
  • SH_SHM/trunk/source/newgraph/gcusrdef.h

    r16 r341  
    2121 
    2222/* channel bits */ 
    23 #define GCF_GEM       0x100 
    2423#define GCF_MEM       0x200 
    2524#define GCF_PSF       0x400 
    26 #define GCF_DJ        0x800 
    27 #define GCF_BGI       0x0000 
    28 #define GCF_CALCOMP   0x4000 
    29 #define GCF_TEK       0x8000 
    30 #define GCF_VWS       0x80 
    3125#define GCF_XWDW      0x2000 
    32 #define GCF_HPGL      0x20 
    3326#define GCF_STDCH     0x10        /* standard text channel */ 
    3427#define GCF_FILE      0x00        /* text file channel */ 
    3528#define GCF_NOECHO    0x40        /* no echo bit */ 
    3629#define GCF_EXTERN    0x1000      /* external routine */ 
    37 #define GCF_ALLCHAN   (GCF_GEM|GCF_MEM|GCF_PSF|GCF_DJ|GCF_BGI|GCF_CALCOMP|GCF_TEK|GCF_VWS|GCF_XWDW|GCF_HPGL)      /* all channels */ 
     30#define GCF_ALLCHAN   (GCF_MEM|GCF_PSF|GCF_XWDW)      /* all channels */ 
    3831#define GCF_NUMMASK   7 
    3932 
     
    487480/*------------------------------------------------------------------------*/ 
    488481 
    489 #ifdef BC_KS_PRIVATE 
    490 #ifdef BC_G_GEM 
    491 void gm_pixhardcopy( int wdw, int mag, char outfile[] ); 
    492 #define gc_pixhardcopy(w,m,f) gm_pixhardcopy(w&GCF_NUMMASK,m,f) 
    493 #else 
    494 #define gc_pixhardcopy(w,m,f) 
    495 #endif 
    496 #endif 
    497  
    498  /*------------------------------------------------------------------------*/ 
    499  
    500482#endif  /* __GCUSRDEF */ 
  • SH_SHM/trunk/source/newgraph/graphch.c

    r16 r341  
    1616#include BC_SYSBASE 
    1717#include "graphbas.h" 
    18 #include "gmusrdef.h" 
    1918#include "mmusrdef.h" 
    2019#include "psusrdef.h" 
    21 #include "ccusrdef.h" 
    22 #include "tkusrdef.h" 
    23 #include "hpusrdef.h" 
    24 #include "djusrdef.h" 
    25 #include "bgusrdef.h" 
    2620#include "xwusrdef.h" 
    27 #include "vwusrdef.h" 
    2821#include BC_GCUSRDEF 
    2922 
     
    7972        } /*endif*/ 
    8073 
    81         if  (GCF_GEM & map)  { 
    82                 gm_init( map & WDWMASK, attribs, xlo, ylo, width, height, status ); 
    83                 if  (Severe(status))  return; 
    84                 gcv_initmap |= GCF_GEM; 
    85         } /*endif*/ 
    86  
    8774        if  (GCF_XWDW & map)  { 
    8875                xw_init( map & WDWMASK, attribs, xlo, ylo, width, height, status ); 
     
    9178        } /*endif*/ 
    9279 
    93         if  (GCF_BGI & map)  { 
    94                 bg_init( map & WDWMASK, attribs, xlo, ylo, width, height, status ); 
    95                 if  (Severe(status))  return; 
    96                 gcv_initmap |= GCF_BGI; 
    97         } /*endif*/ 
    98  
    9980        if  (GCF_MEM & map)  { 
    10081                mm_init( map & WDWMASK, status ); 
     
    10990        } /*endif*/ 
    11091 
    111         if  (GCF_CALCOMP & map)  { 
    112                 cc_init( attribs, xlo, ylo, width, height, status ); 
    113                 if  (Severe(status))  return; 
    114                 gcv_initmap |= GCF_CALCOMP; 
    115         } /*endif*/ 
    116  
    117         if  (GCF_TEK & map)  { 
    118                 tk_init( attribs, xlo, ylo, width, height, status ); 
    119                 if  (Severe(status))  return; 
    120                 gcv_initmap |= GCF_TEK; 
    121         } /*endif*/ 
    122  
    123         if  (GCF_HPGL & map)  { 
    124                 hp_init( attribs, xlo, ylo, width, height, status ); 
    125                 if  (Severe(status))  return; 
    126                 gcv_initmap |= GCF_HPGL; 
    127         } /*endif*/ 
    128  
    129         if  (GCF_DJ & map)  { 
    130                 dj_init( attribs, xlo, ylo, width, height, status ); 
    131                 if  (Severe(status))  return; 
    132                 gcv_initmap |= GCF_DJ; 
    133         } /*endif*/ 
    134  
    135         if  (GCF_VWS & map)  { 
    136                 vw_init( map & WDWMASK, attribs, xlo, ylo, width, height, status ); 
    137                 if  (Severe(status))  return; 
    138                 gcv_initmap |= GCF_VWS; 
    139         } /*endif*/ 
    140  
    14192} /* end of gc_init */ 
    14293 
     
    157108        /* executable code */ 
    158109 
    159         if  (GCF_GEM & map) 
    160                 gm_exit( map & WDWMASK ); 
    161  
    162110        if  (GCF_XWDW & map) 
    163111                xw_exit( map & WDWMASK ); 
    164  
    165         if  (GCF_BGI & map) 
    166                 bg_exit( map & WDWMASK ); 
    167112 
    168113        if  (GCF_MEM & map) 
     
    172117                ps_exit(); 
    173118 
    174         if  (GCF_CALCOMP & map) 
    175                 cc_exit(); 
    176  
    177         if  (GCF_TEK & map) 
    178                 tk_exit(); 
    179  
    180         if  (GCF_HPGL & map) 
    181                 hp_exit(); 
    182  
    183         if  (GCF_DJ & map) 
    184                 dj_exit(); 
    185  
    186         if  (GCF_VWS & map) 
    187                 vw_exit( map & WDWMASK ); 
    188  
    189119} /* end of gc_exit */ 
    190120 
     
    204134        /* executable code */ 
    205135 
    206         gm_finish(); 
    207136        xw_finish(); 
    208         bg_finish(); 
    209137        mm_finish(); 
    210138        ps_finish(); 
    211         cc_finish(); 
    212         tk_finish(); 
    213         hp_finish(); 
    214         dj_finish(); 
    215         vw_finish(); 
    216139        gcv_initmap = 0; 
    217140 
     
    238161        /* executable code */ 
    239162 
    240         if  (GCF_GEM & map)  { 
    241                 gm_resizewdw( map & WDWMASK, xpos, ypos, width, height, status ); 
    242                 if  (Severe(status))  return; 
    243         } /*endif*/ 
    244  
    245163        if  (GCF_XWDW & map)  { 
    246164                xw_resizewdw( map & WDWMASK, xpos, ypos, width, height, status ); 
     
    248166        } /*endif*/ 
    249167 
    250         if  (GCF_BGI & map)  { 
    251                 bg_resizewdw( map & WDWMASK, xpos, ypos, width, height, status ); 
    252                 if  (Severe(status))  return; 
    253         } /*endif*/ 
    254  
    255168        if  (GCF_PSF & map)  { 
    256169                ps_resize( xpos, ypos, width, height, status ); 
     
    258171        } /*endif*/ 
    259172 
    260         if  (GCF_CALCOMP & map)  { 
    261                 cc_resize( xpos, ypos, width, height, status ); 
    262                 if  (Severe(status))  return; 
    263         } /*endif*/ 
    264  
    265         if  (GCF_TEK & map)  { 
    266                 tk_resize( xpos, ypos, width, height, status ); 
    267                 if  (Severe(status))  return; 
    268         } /*endif*/ 
    269  
    270         if  (GCF_HPGL & map)  { 
    271                 hp_resize( xpos, ypos, width, height, status ); 
    272                 if  (Severe(status))  return; 
    273         } /*endif*/ 
    274  
    275         if  (GCF_DJ & map)  { 
    276                 dj_resize( xpos, ypos, width, height, status ); 
    277                 if  (Severe(status))  return; 
    278         } /*endif*/ 
    279  
    280         if  (GCF_VWS & map)  { 
    281                 vw_resizewdw( map & WDWMASK, xpos, ypos, width, height, status ); 
    282                 if  (Severe(status))  return; 
    283         } /*endif*/ 
    284  
    285173} /* end of gc_resizewdw */ 
    286174 
     
    301189        /* executable code */ 
    302190 
    303         if  (GCF_GEM & map) 
    304                 gm_popwdw( map & WDWMASK ); 
    305  
    306191        if  (GCF_XWDW & map) 
    307192                xw_popwdw( map & WDWMASK ); 
    308  
    309         if  (GCF_VWS & map) 
    310                 vw_popwdw( map & WDWMASK ); 
    311193 
    312194} /* end of gc_popwdw */ 
     
    329211        /* executable code */ 
    330212 
    331         if  (GCF_GEM & map) 
    332                 gm_setwdwname( map & WDWMASK, name ); 
    333  
    334213        if  (GCF_XWDW & map) 
    335214                xw_setwdwname( map & WDWMASK, name ); 
    336  
    337         if  (GCF_BGI & map) 
    338                 bg_setwdwname( map & WDWMASK, name ); 
    339  
    340         if  (GCF_VWS & map) 
    341                 vw_setwdwname( map & WDWMASK, name ); 
    342215 
    343216} /* end of gc_setwdwname */ 
     
    364237        /* executable code */ 
    365238 
    366         if  (GCF_GEM & map)  { 
    367                 gm_setstyle( map & WDWMASK, style, item, value, status ); 
    368                 if  (Severe(status))  return; 
    369         } /*endif*/ 
    370  
    371239        if  (GCF_XWDW & map)  { 
    372240                xw_setstyle( map & WDWMASK, style, item, value, status ); 
     
    374242        } /*endif*/ 
    375243 
    376         if  (GCF_BGI & map)  { 
    377                 bg_setstyle( map & WDWMASK, style, item, value, status ); 
    378                 if  (Severe(status))  return; 
    379         } /*endif*/ 
    380  
    381         if  (GCF_MEM & map)  { 
    382                 mm_setstyle( map & WDWMASK, style, item, value, status ); 
    383                 if  (Severe(status))  return; 
    384         } /*endif*/ 
    385  
    386244        if  (GCF_PSF & map)  { 
    387245                ps_setstyle( style, item, value, status ); 
    388                 if  (Severe(status))  return; 
    389         } /*endif*/ 
    390  
    391         if  (GCF_CALCOMP & map)  { 
    392                 cc_setstyle( style, item, value, status ); 
    393                 if  (Severe(status))  return; 
    394         } /*endif*/ 
    395  
    396         if  (GCF_TEK & map)  { 
    397                 tk_setstyle( style, item, value, status ); 
    398                 if  (Severe(status))  return; 
    399         } /*endif*/ 
    400  
    401         if  (GCF_HPGL & map)  { 
    402                 hp_setstyle( style, item, value, status ); 
    403                 if  (Severe(status))  return; 
    404         } /*endif*/ 
    405  
    406         if  (GCF_DJ & map)  { 
    407                 dj_setstyle( style, item, value, status ); 
    408                 if  (Severe(status))  return; 
    409         } /*endif*/ 
    410  
    411         if  (GCF_VWS & map)  { 
    412                 vw_setstyle( map & WDWMASK, style, item, value, status ); 
    413246                if  (Severe(status))  return; 
    414247        } /*endif*/ 
     
    439272        CSWAP(w,h) 
    440273 
    441         if  (GCF_GEM & map)  { 
    442                 gm_setcoo( map & WDWMASK, x, y, w, h, status ); 
    443                 if  (Severe(status))  return; 
    444         } /*endif*/ 
    445  
    446274        if  (GCF_XWDW & map)  { 
    447275                xw_setcoo( map & WDWMASK, x, y, w, h, status ); 
     
    449277        } /*endif*/ 
    450278 
    451         if  (GCF_BGI & map)  { 
    452                 bg_setcoo( map & WDWMASK, x, y, w, h, status ); 
    453                 if  (Severe(status))  return; 
    454         } /*endif*/ 
    455  
    456279        if  (GCF_MEM & map)  { 
    457280                mm_setcoo( map & WDWMASK, x, y, w, h, status ); 
     
    464287        } /*endif*/ 
    465288 
    466         if  (GCF_CALCOMP & map)  { 
    467                 cc_setcoo( x, y, w, h, status ); 
    468                 if  (Severe(status))  return; 
    469         } /*endif*/ 
    470  
    471         if  (GCF_TEK & map)  { 
    472                 tk_setcoo( x, y, w, h, status ); 
    473                 if  (Severe(status))  return; 
    474         } /*endif*/ 
    475  
    476         if  (GCF_HPGL & map)  { 
    477                 hp_setcoo( x, y, w, h, status ); 
    478                 if  (Severe(status))  return; 
    479         } /*endif*/ 
    480  
    481         if  (GCF_DJ & map)  { 
    482                 dj_setcoo( x, y, w, h, status ); 
    483                 if  (Severe(status))  return; 
    484         } /*endif*/ 
    485  
    486         if  (GCF_VWS & map)  { 
    487                 vw_setcoo( map & WDWMASK, x, y, w, h, status ); 
    488                 if  (Severe(status))  return; 
    489         } /*endif*/ 
    490  
    491289} /* end of gc_setcoo */ 
    492290 
     
    508306        /* executable code */ 
    509307 
    510         if  (GCF_GEM & map) 
    511                 return gm_aspectratio( map & WDWMASK ); 
    512  
    513308        if  (GCF_XWDW & map) 
    514309                return xw_aspectratio( map & WDWMASK ); 
    515  
    516         if  (GCF_BGI & map) 
    517                 return bg_aspectratio( map & WDWMASK ); 
    518310 
    519311        if  (GCF_PSF & map) 
    520312                return ps_aspectratio(); 
    521313 
    522         if  (GCF_CALCOMP & map) 
    523                 return cc_aspectratio(); 
    524  
    525         if  (GCF_TEK & map) 
    526                 return tk_aspectratio(); 
    527  
    528         if  (GCF_HPGL & map) 
    529                 return hp_aspectratio(); 
    530  
    531         if  (GCF_DJ & map) 
    532                 return dj_aspectratio(); 
    533  
    534         if  (GCF_VWS & map) 
    535                 return vw_aspectratio( map & WDWMASK ); 
    536  
    537314        return 1.0; 
    538315 
     
    558335        CSWAP(x,y) 
    559336 
    560         if  (GCF_GEM & map) 
    561                 gm_moveto( map & WDWMASK, x, y ); 
    562  
    563337        if  (GCF_XWDW & map) 
    564338                xw_moveto( map & WDWMASK, x, y ); 
    565  
    566         if  (GCF_BGI & map) 
    567                 bg_moveto( map & WDWMASK, x, y ); 
    568339 
    569340        if  (GCF_MEM & map) 
     
    572343        if  (GCF_PSF & map) 
    573344                ps_moveto( x, y ); 
    574  
    575         if  (GCF_CALCOMP & map) 
    576                 cc_moveto( x, y ); 
    577  
    578         if  (GCF_TEK & map) 
    579                 tk_moveto( x, y ); 
    580  
    581         if  (GCF_HPGL & map) 
    582                 hp_moveto( x, y ); 
    583  
    584         if  (GCF_DJ & map) 
    585                 dj_moveto( x, y ); 
    586  
    587         if  (GCF_VWS & map) 
    588                 vw_moveto( map & WDWMASK, x, y ); 
    589345 
    590346} /* end of gc_moveto */ 
     
    610366        CSWAP(x,y) 
    611367 
    612         if  (GCF_GEM & map) 
    613                 gm_drawto( map & WDWMASK, style, x, y ); 
    614  
    615368        if  (GCF_XWDW & map) 
    616369                xw_drawto( map & WDWMASK, style, x, y ); 
    617  
    618         if  (GCF_BGI & map) 
    619                 bg_drawto( map & WDWMASK, style, x, y ); 
    620370 
    621371        if  (GCF_MEM & map) 
     
    624374        if  (GCF_PSF & map) 
    625375                ps_drawto( style, x, y ); 
    626  
    627         if  (GCF_CALCOMP & map) 
    628                 cc_drawto( style, x, y ); 
    629  
    630         if  (GCF_TEK & map) 
    631                 tk_drawto( style, x, y ); 
    632  
    633         if  (GCF_HPGL & map) 
    634                 hp_drawto( style, x, y ); 
    635  
    636         if  (GCF_DJ & map) 
    637                 dj_drawto( style, x, y ); 
    638  
    639         if  (GCF_VWS & map) 
    640                 vw_drawto( map & WDWMASK, style, x, y ); 
    641376 
    642377} /* end of gc_drawto */ 
     
    661396 
    662397        CSWAP(x,y) 
    663  
    664         if  (GCF_GEM & map) 
    665                 gm_setpixel( map & WDWMASK, style, x, y ); 
    666398 
    667399        if  (GCF_MEM & map) 
     
    698430        if  (cnt < 2)  return; 
    699431 
    700         if  (GCF_GEM & map)  { 
    701                 gm_arrayplot( map & WDWMASK, style, cnt, red, xoff, xinc, 
    702                         yoff, yarr, yzoom, status ); 
    703                 if  (Severe(status))  return; 
    704         } /*endif*/ 
    705  
    706432        if  (GCF_XWDW & map)  { 
    707433                xw_arrayplot( map & WDWMASK, style, cnt, red, xoff, xinc, 
     
    710436        } /*endif*/ 
    711437 
    712         if  (GCF_BGI & map)  { 
    713                 bg_arrayplot( map & WDWMASK, style, cnt, red, xoff, xinc, 
    714                         yoff, yarr, yzoom, status ); 
    715                 if  (Severe(status))  return; 
    716         } /*endif*/ 
    717  
    718438        if  (GCF_MEM & map)  { 
    719439                mm_arrayplot( map & WDWMASK, style, cnt, red, xoff, xinc, 
     
    728448        } /*endif*/ 
    729449 
    730         if  (GCF_CALCOMP & map)  { 
    731                 cc_arrayplot( style, cnt, red, xoff, xinc, yoff, yarr, 
    732                         yzoom, status ); 
    733                 if  (Severe(status))  return; 
    734         } /*endif*/ 
    735  
    736         if  (GCF_TEK & map)  { 
    737                 tk_arrayplot( style, cnt, red, xoff, xinc, yoff, yarr, 
    738                         yzoom, status ); 
    739                 if  (Severe(status))  return; 
    740         } /*endif*/ 
    741  
    742         if  (GCF_HPGL & map)  { 
    743                 hp_arrayplot( style, cnt, red, xoff, xinc, yoff, yarr, 
    744                         yzoom, status ); 
    745                 if  (Severe(status))  return; 
    746         } /*endif*/ 
    747  
    748         if  (GCF_DJ & map)  { 
    749                 dj_arrayplot( style, cnt, red, xoff, xinc, yoff, yarr, 
    750                         yzoom, status ); 
    751                 if  (Severe(status))  return; 
    752         } /*endif*/ 
    753  
    754         if  (GCF_VWS & map)  { 
    755                 vw_arrayplot( map & WDWMASK, style, cnt, red, xoff, xinc, 
    756                         yoff, yarr, yzoom, status ); 
    757                 if  (Severe(status))  return; 
    758         } /*endif*/ 
    759  
    760450} /* end of gc_arrayplot */ 
    761451 
     
    776466        /* executable code */ 
    777467 
    778         if  (GCF_GEM & map) 
    779                 gm_erase( map & WDWMASK ); 
    780  
    781468        if  (GCF_XWDW & map) 
    782469                xw_erase( map & WDWMASK ); 
    783  
    784         if  (GCF_BGI & map) 
    785                 bg_erase( map & WDWMASK ); 
    786470 
    787471        if  (GCF_MEM & map) 
     
    790474        if  (GCF_PSF & map) 
    791475                ps_erase(); 
    792  
    793         if  (GCF_CALCOMP & map) 
    794                 cc_erase(); 
    795  
    796         if  (GCF_TEK & map) 
    797                 tk_erase(); 
    798  
    799         if  (GCF_HPGL & map) 
    800                 hp_erase(); 
    801  
    802         if  (GCF_DJ & map) 
    803                 dj_erase(); 
    804  
    805         if  (GCF_VWS & map) 
    806                 vw_erase( map & WDWMASK ); 
    807476 
    808477} /* end of gc_erase */ 
     
    829498        CSWAP(x,y) 
    830499 
    831         if  (GCF_GEM & map) 
    832                 gm_text( map & WDWMASK, style, x, y, text ); 
    833  
    834500        if  (GCF_XWDW & map) 
    835501                xw_text( map & WDWMASK, style, x, y, text ); 
    836  
    837         if  (GCF_BGI & map) 
    838                 bg_text( map & WDWMASK, style, x, y, text ); 
    839502 
    840503        if  (GCF_MEM & map) 
     
    844507                ps_text( style, x, y, text ); 
    845508 
    846         if  (GCF_CALCOMP & map) 
    847                 cc_text( style, x, y, text ); 
    848  
    849         if  (GCF_TEK & map) 
    850                 tk_text( style, x, y, text ); 
    851  
    852         if  (GCF_HPGL & map) 
    853                 hp_text( style, x, y, text ); 
    854  
    855         if  (GCF_DJ & map) 
    856                 dj_text( style, x, y, text ); 
    857  
    858         if  (GCF_VWS & map) 
    859                 vw_text( map & WDWMASK, style, x, y, text ); 
    860  
    861509} /* end of gc_text */ 
    862510 
     
    878526        /* executable code */ 
    879527 
    880         if  (GCF_GEM & map) 
    881                 gm_write( map & WDWMASK, text ); 
    882  
    883528        if  (GCF_XWDW & map) 
    884529                xw_write( map & WDWMASK, text ); 
    885  
    886         if  (GCF_BGI & map) 
    887                 bg_write( map & WDWMASK, text ); 
    888530 
    889531        if  (GCF_STDCH & map) 
    890532                printf( "%s", text ); 
    891533 
    892         if  (GCF_VWS & map) 
    893                 vw_write( map & WDWMASK, text ); 
    894  
    895         if  (GCF_TEK & map) 
    896                 tk_write( text ); 
    897  
    898534        if  (GCF_EXTERN & map && gcv_writeext != NULL) 
    899535                (*gcv_writeext)( text ); 
     
    918554        /* executable code */ 
    919555 
    920         if  (GCF_GEM & map) 
    921                 gm_wrtch( map & WDWMASK, ch ); 
    922  
    923556        if  (GCF_XWDW & map) 
    924557                xw_wrtch( map & WDWMASK, ch ); 
    925  
    926         if  (GCF_BGI & map) 
    927                 bg_wrtch( map & WDWMASK, ch ); 
    928558 
    929559        if  (GCF_STDCH & map) 
    930560                printf( "%c", ch ); 
    931561 
    932         if  (GCF_VWS & map) 
    933                 vw_wrtch( map & WDWMASK, ch ); 
    934  
    935         if  (GCF_TEK & map) 
    936                 tk_wrtch( ch ); 
    937  
    938562} /* end of gc_wrtch */ 
    939563 
     
    953577{ 
    954578        /* executable code */ 
    955  
    956         if  (GCF_GEM & map) 
    957                 return gm_txtwidth( map & WDWMASK ); 
    958  
    959         if  (GCF_BGI & map) 
    960                 return bg_txtwidth( map & WDWMASK ); 
    961579 
    962580        if  (GCF_STDCH & map) 
     
    983601        /* executable code */ 
    984602 
    985         if  (GCF_GEM & map) 
    986                 return gm_txtheight( map & WDWMASK ); 
    987  
    988         if  (GCF_BGI & map) 
    989                 return bg_txtheight( map & WDWMASK ); 
    990  
    991603        if  (GCF_STDCH & map) 
    992604                return 24; 
     
    1012624        /* executable code */ 
    1013625 
    1014         if  (GCF_GEM & map) 
    1015                 return gm_chheight( map & WDWMASK ); 
    1016  
    1017626        if  (GCF_XWDW & map) 
    1018627                return xw_chheight( map & WDWMASK ); 
    1019  
    1020         if  (GCF_BGI & map) 
    1021                 return bg_chheight( map & WDWMASK ); 
    1022628 
    1023629        return 0.0; 
     
    1043649        /* executable code */ 
    1044650 
    1045         if  (GCF_GEM & map)  { 
    1046                 gm_read( map & WDWMASK, maxlth, text ); 
    1047                 return; 
    1048         } /*endif*/ 
    1049  
    1050651        if  (GCF_XWDW & map)  { 
    1051652                xw_read( map & WDWMASK, maxlth, text ); 
     
    1053654        } /*endif*/ 
    1054655 
    1055         if  (GCF_BGI & map)  { 
    1056                 bg_read( map & WDWMASK, maxlth, text ); 
    1057                 return; 
    1058         } /*endif*/ 
    1059  
    1060         if  (GCF_VWS & map)  { 
    1061                 vw_read( map & WDWMASK, maxlth, text ); 
    1062                 return; 
    1063         } /*endif*/ 
    1064  
    1065656        fgets( text, maxlth, stdin ); 
    1066657 
     
    1084675{ 
    1085676        /* executable code */ 
    1086  
    1087         if  (GCF_GEM & map)  { 
    1088                 gm_getloc( map & WDWMASK, x, y, ch ); 
    1089                 CSWAP(*x,*y) 
    1090                 return; 
    1091         } /*endif*/ 
    1092677 
    1093678        if  (GCF_XWDW & map)  { 
     
    1097682        } /*endif*/ 
    1098683 
    1099         if  (GCF_BGI & map)  { 
    1100                 bg_getloc( map & WDWMASK, x, y, ch ); 
    1101                 CSWAP(*x,*y) 
    1102                 return; 
    1103         } /*endif*/ 
    1104  
    1105         if  (GCF_VWS & map)  { 
    1106                 vw_getloc( map & WDWMASK, x, y, ch ); 
    1107                 CSWAP(*x,*y) 
    1108                 return; 
    1109         } /*endif*/ 
    1110  
    1111         if  (GCF_TEK & map)  { 
    1112                 tk_getloc( x, y, ch ); 
    1113                 CSWAP(*x,*y) 
    1114                 return; 
    1115         } /*endif*/ 
    1116  
    1117684} /* end of gc_getloc */ 
    1118685 
     
    1134701        /* executable code */ 
    1135702 
    1136         gm_set_outputdir( dir, status ); 
    1137         if  (Severe(status))   return; 
    1138         bg_set_outputdir( dir, status ); 
    1139         if  (Severe(status))   return; 
    1140703        ps_set_outputdir( dir, status ); 
    1141         if  (Severe(status))   return; 
    1142         cc_set_outputdir( dir, status ); 
    1143         if  (Severe(status))   return; 
    1144         tk_set_outputdir( dir, status ); 
    1145         if  (Severe(status))   return; 
    1146         hp_set_outputdir( dir, status ); 
    1147         if  (Severe(status))   return; 
    1148         dj_set_outputdir( dir, status ); 
    1149704        if  (Severe(status))   return; 
    1150705        xw_set_outputdir( dir, status ); 
    1151706        if  (Severe(status))  return; 
    1152         vw_set_outputdir( dir, status ); 
    1153         if  (Severe(status))  return; 
    1154707 
    1155708} /* end of gc_set_outputdir */ 
     
    1172725        /* executable code */ 
    1173726 
    1174         gm_set_inputdir( dir, status ); 
    1175         if  (Severe(status))   return; 
    1176         bg_set_inputdir( dir, status ); 
    1177         if  (Severe(status))   return; 
    1178727        ps_set_inputdir( dir, status ); 
    1179728        if  (Severe(status))   return; 
    1180         cc_set_inputdir( dir, status ); 
    1181         if  (Severe(status))   return; 
    1182         tk_set_inputdir( dir, status ); 
    1183         if  (Severe(status))   return; 
    1184         hp_set_inputdir( dir, status ); 
    1185         if  (Severe(status))   return; 
    1186         dj_set_inputdir( dir, status ); 
    1187         if  (Severe(status))   return; 
    1188729        xw_set_inputdir( dir, status ); 
    1189         if  (Severe(status))  return; 
    1190         vw_set_inputdir( dir, status ); 
    1191730        if  (Severe(status))  return; 
    1192731 
     
    1212751        /* executable code */ 
    1213752 
    1214         if  (GCF_GEM & map)  { 
    1215                 gm_setpar( item, value, status ); 
    1216                 if  (Severe(status))  return; 
    1217         } /*endif*/ 
    1218  
    1219         if  (GCF_BGI & map)  { 
    1220                 bg_setpar( item, value, status ); 
    1221                 if  (Severe(status))  return; 
    1222         } /*endif*/ 
    1223  
    1224753        if  (GCF_PSF & map)  { 
    1225754                ps_setpar( item, value, status ); 
    1226                 if  (Severe(status))  return; 
    1227         } /*endif*/ 
    1228  
    1229         if  (GCF_CALCOMP & map)  { 
    1230                 cc_setpar( item, value, status ); 
    1231                 if  (Severe(status))  return; 
    1232         } /*endif*/ 
    1233  
    1234         if  (GCF_TEK & map)  { 
    1235                 tk_setpar( item, value, status ); 
    1236                 if  (Severe(status))  return; 
    1237         } /*endif*/ 
    1238  
    1239         if  (GCF_HPGL & map)  { 
    1240                 hp_setpar( item, value, status ); 
    1241                 if  (Severe(status))  return; 
    1242         } /*endif*/ 
    1243  
    1244         if  (GCF_DJ & map)  { 
    1245                 dj_setpar( item, value, status ); 
    1246                 if  (Severe(status))  return; 
    1247         } /*endif*/ 
    1248  
    1249         if  (GCF_VWS & map)  { 
    1250                 vw_setpar( item, value, status ); 
    1251755                if  (Severe(status))  return; 
    1252756        } /*endif*/ 
     
    1314818 
    1315819        /* executable code */ 
    1316  
    1317 #       ifdef BC_G_GEM 
    1318         if  (GCF_GEM & dst)  { 
    1319                 pb.wpb.pbtype = GBC_WPAINT; 
    1320                 pb.wpb.prepare = gm_prepare; 
    1321                 pb.wpb.moveto = gm_moveto; 
    1322                 pb.wpb.drawto = gm_drawto; 
    1323                 pb.wpb.arrayplot = gm_arrayplot; 
    1324                 pb.wpb.text = gm_text; 
    1325                 pb.wpb.setstyle = gm_setstyle; 
    1326                 pb.wpb.setcoo = gm_setcoo; 
    1327                 pb.wpb.cleanup = gm_cleanup; 
    1328                 mm_playback( src & WDWMASK, dst & WDWMASK, &pb, outf, status ); 
    1329                 if  (Severe(status))  return; 
    1330         } /*endif*/ 
    1331 #       endif  /* BC_G_GEM */ 
    1332820 
    1333821#       ifdef BC_G_XWDW 
     
    1347835#       endif  /* BC_G_XWDW */ 
    1348836 
    1349 #       ifdef BC_G_BGI 
    1350         if  (GCF_BGI & dst)  { 
    1351                 pb.wpb.pbtype = GBC_WPAINT; 
    1352                 pb.wpb.prepare = bg_prepare; 
    1353                 pb.wpb.moveto = bg_moveto; 
    1354                 pb.wpb.drawto = bg_drawto; 
    1355                 pb.wpb.arrayplot = bg_arrayplot; 
    1356                 pb.wpb.text = bg_text; 
    1357                 pb.wpb.setstyle = bg_setstyle; 
    1358                 pb.wpb.setcoo = bg_setcoo; 
    1359                 pb.wpb.cleanup = bg_cleanup; 
    1360                 mm_playback( src & WDWMASK, dst & WDWMASK, &pb, outf, status ); 
    1361                 if  (Severe(status))  return; 
    1362         } /*endif*/ 
    1363 #       endif  /* BC_G_BGI */ 
    1364  
    1365837#       ifdef BC_G_POSTSCRIPT 
    1366838        if  (GCF_PSF & dst)  { 
     
    1379851#       endif  /* BC_G_POSTSCRIPT */ 
    1380852 
    1381 #       ifdef BC_G_CALCOMP 
    1382         if  (GCF_CALCOMP & dst)  { 
    1383                 pb.ppb.pbtype = GBC_PPAINT; 
    1384                 pb.ppb.prepare = cc_prepare; 
    1385                 pb.ppb.moveto = cc_moveto; 
    1386                 pb.ppb.drawto = cc_drawto; 
    1387                 pb.ppb.arrayplot = cc_arrayplot; 
    1388                 pb.ppb.text = cc_text; 
    1389                 pb.ppb.setstyle = cc_setstyle; 
    1390                 pb.ppb.setcoo = cc_setcoo; 
    1391                 pb.ppb.cleanup = cc_cleanup; 
    1392                 mm_playback( src & WDWMASK, dst & WDWMASK, &pb, outf, status ); 
    1393                 if  (Severe(status))  return; 
    1394         } /*endif*/ 
    1395 #       endif  /* BC_G_CALCOMP */ 
    1396  
    1397 #       ifdef BC_G_TEK 
    1398         if  (GCF_TEK & dst)  { 
    1399                 pb.ppb.pbtype = GBC_PPAINT; 
    1400                 pb.ppb.prepare = tk_prepare; 
    1401                 pb.ppb.moveto = tk_moveto; 
    1402                 pb.ppb.drawto = tk_drawto; 
    1403                 pb.ppb.arrayplot = tk_arrayplot; 
    1404                 pb.ppb.text = tk_text; 
    1405                 pb.ppb.setstyle = tk_setstyle; 
    1406                 pb.ppb.setcoo = tk_setcoo; 
    1407                 pb.ppb.cleanup = tk_cleanup; 
    1408                 mm_playback( src & WDWMASK, dst & WDWMASK, &pb, outf, status ); 
    1409                 if  (Severe(status))  return; 
    1410         } /*endif*/ 
    1411 #       endif  /* BC_G_TEK */ 
    1412  
    1413 #       ifdef BC_G_HPGL 
    1414         if  (GCF_HPGL & dst)  { 
    1415                 pb.ppb.pbtype = GBC_PPAINT; 
    1416                 pb.ppb.prepare = hp_prepare; 
    1417                 pb.ppb.moveto = hp_moveto; 
    1418                 pb.ppb.drawto = hp_drawto; 
    1419                 pb.ppb.arrayplot = hp_arrayplot; 
    1420                 pb.ppb.text = hp_text; 
    1421                 pb.ppb.setstyle = hp_setstyle; 
    1422                 pb.ppb.setcoo = hp_setcoo; 
    1423                 pb.ppb.cleanup = hp_cleanup; 
    1424                 mm_playback( src & WDWMASK, dst & WDWMASK, &pb, outf, status ); 
    1425                 if  (Severe(status))  return; 
    1426         } /*endif*/ 
    1427 #       endif  /* BC_G_HPGL */ 
    1428  
    1429 #       ifdef BC_G_DESKJET 
    1430         if  (GCF_DJ & dst)  { 
    1431                 pb.ppb.pbtype = GBC_PPAINT; 
    1432                 pb.ppb.prepare = dj_prepare; 
    1433                 pb.ppb.moveto = dj_moveto; 
    1434                 pb.ppb.drawto = dj_drawto; 
    1435                 pb.ppb.arrayplot = dj_arrayplot; 
    1436                 pb.ppb.text = dj_text; 
    1437                 pb.ppb.setstyle = dj_setstyle; 
    1438                 pb.ppb.setcoo = dj_setcoo; 
    1439                 pb.ppb.cleanup = dj_cleanup; 
    1440                 mm_playback( src & WDWMASK, dst & WDWMASK, &pb, outf, status ); 
    1441                 if  (Severe(status))  return; 
    1442         } /*endif*/ 
    1443 #       endif  /* BC_G_DESKJET */ 
    1444  
    1445 #       ifdef BC_G_VWS 
    1446         if  (GCF_VWS & dst)  { 
    1447                 vw_cleanup( src & WDWMASK, outf, status ); 
    1448         } /*endif*/ 
    1449 #       endif /* BC_G_VWS */ 
    1450  
    1451853} /* end of gc_playback */ 
    1452854 
     
    1494896        } /*endif*/ 
    1495897 
    1496         if  (GCF_CALCOMP & map)  { 
    1497                 cc_cleanup( outf, status ); 
    1498                 if  (Severe(status))  return; 
    1499         } /*endif*/ 
    1500  
    1501         if  (GCF_HPGL & map)  { 
    1502                 hp_cleanup( outf, status ); 
    1503                 if  (Severe(status))  return; 
    1504         } /*endif*/ 
    1505  
    1506         if  (GCF_DJ & map)  { 
    1507                 dj_cleanup( outf, status ); 
    1508                 if  (Severe(status))  return; 
    1509         } /*endif*/ 
    1510  
    1511         if  (GCF_VWS & map)  { 
    1512                 vw_cleanup( map & WDWMASK, outf, status ); 
    1513                 if  (Severe(status))  return; 
    1514         } /*endif*/ 
    1515  
    1516898} /* end of gc_closeplot */ 
    1517899 
    1518900 
    1519   
     901 
    1520902/*------------------------------------------------------------------------*/ 
    1521903 
     
    1539921   ps_arrayswap( on_off ); 
    1540922#  endif 
    1541 #  ifdef BC_G_CALCOMP 
    1542    cc_arrayswap( on_off ); 
    1543 #  endif 
    1544 #  ifdef BC_G_TEK 
    1545    tk_arrayswap( on_off ); 
    1546 #  endif 
    1547 #  ifdef BC_G_HPGL 
    1548    hp_arrayswap( on_off ); 
    1549 #  endif 
    1550 #  ifdef BC_G_BGI 
    1551    bg_arrayswap( on_off ); 
    1552 #  endif 
    1553 #  ifdef BC_G_GEM 
    1554    gm_arrayswap( on_off ); 
    1555 #  endif 
    1556 #  ifdef BC_G_DESKJET 
    1557    dj_arrayswap( on_off ); 
    1558 #  endif 
    1559 #  ifdef BC_G_VWS 
    1560    vw_arrayswap( on_off ); 
    1561 #  endif 
    1562923 
    1563924} /* end of gc_swap */ 
  • SH_SHM/trunk/source/newgraph/memfile.c

    r16 r341  
    357357                sy_fbwrite( &r, (int)sizeof(MFC_REAL), 1L, mfv_file[id] ); 
    358358        } else { 
    359 #ifdef XXX 
    360                 mf_open( id, mfv_defswitch, "a", status ); 
    361                 if  (*status != MFE_NOERROR)  return; 
    362                 mf_writereal( id, r, status ); 
    363 #endif 
    364359                /* fprintf( stderr, "mf_writereal: ignored output for chan %d\n", id ); */ 
    365360        } /*endif*/ 
     
    403398                sy_fbwrite( &i, (int)sizeof(int), 1L, mfv_file[id] ); 
    404399        } else { 
    405 #ifdef XXX 
    406                 mf_open( id, mfv_defswitch, "a", status ); 
    407                 if  (*status != MFE_NOERROR)  return; 
    408                 mf_writeint( id, i, status ); 
    409 #endif 
    410400                /* fprintf( stderr, "mf_writeint: ignored output for chan %d\n", id ); */ 
    411401        } /*endif*/ 
     
    449439                sy_fbwrite( &l, (int)sizeof(long), 1L, mfv_file[id] ); 
    450440        } else { 
    451 #ifdef XXX 
    452                 mf_open( id, mfv_defswitch, "a", status ); 
    453                 if  (*status != MFE_NOERROR)  return; 
    454                 mf_writelong( id, l, status ); 
    455 #endif 
    456441                /* fprintf( stderr, "mf_writelong: ignored output for chan %d\n", id ); */ 
    457442        } /*endif*/ 
  • SH_SHM/trunk/source/newgraph/psch.c

    r16 r341  
    7373static int     psv_strokenum=5000; /* max number of lineto's between stroke's */ 
    7474static char    psv_headerfile[BC_FILELTH+1]=PSHEADER; /* PS header file */ 
    75 #ifdef XXX 
    76 static char    psv_printfmt[BC_LINELTH+1]=  /* print command */ 
    77                                         {"lpr -P lj %s"}; 
    78 #endif 
    7975 
    8076/* prototypes of local routines */ 
     
    641637        if  (outf != NULL)  strcpy( outf, str ); 
    642638 
    643 #   ifdef XXX 
    644         /* send it to the printer */ 
    645         if  (*psv_printfmt != '\0')  { 
    646                 sprintf( cmd, psv_printfmt, str ); 
    647                 sy_system( cmd, status ); 
    648         } /*endif*/ 
    649 #   endif 
    650  
    651639        /* open PostScript file */ 
    652640        psv_pf = sy_fopen( psv_currpsf, "w" ); 
  • SH_SHM/trunk/source/newgraph/psusrdef.h

    r16 r341  
    222222 
    223223#define ps_charsize(s,x,t) 
    224 #ifdef XXX 
    225 void ps_charsize( int style, float size, STATUS *status ); 
    226  
    227 /* sets character size in units of display height 
    228  * 
    229  * parameters of routine 
    230  * int        style;     input; style number 
    231  * float      size;      input; size of character in units of display height 
    232  * STATUS     *status;   output; return status 
    233  */ 
    234 #endif 
    235  
    236 /*----------------------------------------------------------------------------*/ 
    237  
    238224 
    239225#define ps_linestyle(s,l,t) 
    240 #ifdef XXX 
    241 void ps_linestyle( int style, int linestyle, STATUS *status ); 
    242  
    243 /* sets line linestyle in style block number "style" 
    244  * 
    245  * parameters of routine 
    246  * int        style;      input; style block number 
    247  * int        linestyle;  input; number of line style 
    248  * STATUS     *status;    output; return status 
    249  */ 
    250 #endif 
    251226 
    252227#define ps_linewidth(s,l,t) 
    253228 
    254 /*----------------------------------------------------------------------------*/ 
    255  
    256  
    257229#define ps_color(s,r,g,b,t) 
    258 #ifdef XXX 
    259 void ps_color( int style, float red, float green, float blue, STATUS *status ); 
    260  
    261 /* sets color of style block "style" 
    262  * 
    263  * parameters of routine 
    264  * int        style;            input; style block number 
    265  * float      red, green, blue; input; red, green and blue intensities (0..1) 
    266  * STATUS     *status;          output; return status 
    267  */ 
    268 #endif 
    269230 
    270231/*----------------------------------------------------------------------------*/ 
     
    286247 
    287248#define ps_aspectratio() 1.0 
    288 #ifdef XXX 
    289 float ps_aspectratio(); 
    290  
    291 /* returns ratio of width to height of output 
    292  * no parameters 
    293  */ 
    294 #endif 
    295  
    296 /*----------------------------------------------------------------------------*/ 
    297249 
    298250 
  • SH_SHM/trunk/source/newgraph/xwch.c

    r48 r341  
    1313#include <ctype.h> 
    1414#include BASECNST 
    15 #ifdef BC_VAX 
    16 #include <decw$include:xlib.h> 
    17 #include <decw$include:xutil.h> 
    18 #include <decw$include:xatom.h> 
    19 #include <decw$include:cursorfont.h> 
    20 #endif 
    21 #ifdef BC_SUN 
    2215#include <X11/Xlib.h> 
    2316#include <X11/Xatom.h> 
    2417#include <X11/cursorfont.h> 
    25 /* typedef char *caddr_t; */  /* I really don't know why this is necessary on HP */ 
    2618#include <X11/Xutil.h> 
    27 #endif 
    2819#include BC_SYSBASE 
    2920#include "graphbas.h" 
     
    155146        int                  i;        /* counter */ 
    156147        XSetWindowAttributes xswa;     /* set attribute block */ 
    157         XSizeHints           xsh;      /* size hints */  
     148        XSizeHints           xsh;      /* size hints */ 
    158149        XWMHints             xwmh;     /* window manager hints */ 
    159150        char                 str[MAXSTRLTH+1]; /* scratch string */ 
     
    17981789                        &exact_color ); 
    17991790        } /*endif*/ 
    1800 #ifdef XXX 
    1801         if  (xstatus == 0)  { 
    1802                 *status = XWE_COLALLOC; 
    1803                 return; 
    1804         } /*endif*/ 
    1805 #endif 
    18061791        XSetForeground( xwv_dsp, xwv_gc[style], screen_color.pixel ); 
    18071792 
  • SH_SHM/trunk/source/qfileio.c

    r16 r341  
    8484#define POSIDX (QFCL_POS&IDXMASK)  /* index number of position */ 
    8585#define LTHIDX (QFCL_LTH&IDXMASK)  /* index number of length */ 
    86 #ifdef XXX 
    87 /* this was not portable, K.S. 17-Mar-2006 */ 
    88 #define R_EMPTY 0xffffffffL 
    89 #endif 
    9086#define R_EMPTY     5.37531e-38 
    9187#define R_EMPTY_MIN 5.375e-38 
     
    21702166                *b++ = *(b+1); 
    21712167                *b++ = tmp; 
    2172         } /*endwhile*/  
     2168        } /*endwhile*/ 
    21732169 
    21742170} /* end of qf_dobyteswap */ 
  • SH_SHM/trunk/source/qfusrdef.h

    r16 r341  
    3535#ifndef __QFUSRDEF 
    3636#define __QFUSRDEF 
    37  
    38 /* old values up to 15-Mar-2006 */ 
    39 #ifdef XXX 
    40 #define QFC_IENTRY 50   /* number of integer entries */ 
    41 #define QFC_LENTRY 20   /* number of long entries */ 
    42 #define QFC_RENTRY 50   /* number of float entries */ 
    43 #define QFC_SENTRY 30   /* number of string entries */ 
    44 #define QFC_CENTRY 16   /* number of character entries */ 
    45 #endif 
    4637 
    4738#define QFC_IENTRY 500   /* number of integer entries */ 
  • SH_SHM/trunk/source/readgrn.c

    r16 r341  
    5050 
    5151/* separation character between root path and GRN subdirectories: */ 
    52 #ifdef BC_VAX 
    53 #define EODEV ':' 
    54 #else 
    55 #ifdef BC_ATARI 
    56 #define EODEV '\\' 
    57 #else 
    5852#define EODEV '/' 
    59 #endif 
    60 #endif 
    61  
    6253 
    6354 
     
    770761        NTIME    nt2;                  /* time values of test record */ 
    771762        long     testlth;              /* number of records for test span */ 
    772 #       ifdef BC_VAX                   /* need this on VAX only: */ 
    773         char     str[BC_FILELTH+1];    /* file name to re-open file */ 
    774 #       endif 
    775763 
    776764        /* executable code */ 
     
    780768                grn_readlog( "." ); 
    781769                fstat = fseek( grn, testlth*GRN_RECLTH, 0 ); 
    782 #               ifdef BC_ATARI                 /* for ATARI special test            */ 
    783                 if  (feof(grn))  fstat = -1;   /* because fseek here also returns 0 */ 
    784 #               endif                          /*                                   */ 
    785770                if  (fstat != 0)  { 
    786771                        *status = GRNE_FREAD; 
     
    837822        grn_readlog( "-" ); 
    838823        fstat = fseek( grn, testlth*GRN_RECLTH, 0 ); 
    839 #       ifdef BC_ATARI                 /* for ATARI special test            */ 
    840         if  (feof(grn))  fstat = -1;   /* because fseek here also returns 0 */ 
    841 #       endif                          /*                                   */ 
    842824        if  (fstat != 0)  { 
    843 #               ifdef BC_VAX                /* VAX-routine does not recover from */ 
    844                 fgetname( grn, str );       /* this status.  Therefore close and */ 
    845                 fclose( grn );              /* reopen GRN file                   */ 
    846                 grn = sy_fopen( str, "r" ); /*                                   */ 
    847 #               endif                       /*                                   */ 
    848825                testlth = 20; 
    849826                grn_readlog( "t" ); 
    850827                fstat = fseek( grn, testlth*GRN_RECLTH, 0 ); 
    851 #               ifdef BC_ATARI               /* Again special ATARI test          */ 
    852                 if  (feof(grn))  fstat = -1; /* because fseek here also returns 0 */ 
    853 #               endif                        /*                                   */ 
    854828                if  (fstat != 0)  {          /* very short file, just rewind it   */ 
    855829                        grn_readlog( "s" ); 
    856 #                       ifdef BC_VAX                 /* Again close and reopen on VAX   */ 
    857                         sy_fclose( grn );            /* Silly routine !                 */ 
    858                         grn = sy_fopen( str, "r" );  /*                                 */ 
    859 #                       else                         /*                                 */ 
    860830                        fseek( grn, 0, 0 );          /* on other machines a simple      */ 
    861 #                       endif                        /* rewind should be ok             */ 
    862831                        return; 
    863832                } /*endif*/ 
    864833        } /*endif*/ 
    865834        if  (fstat != 0)  { 
    866 #               ifdef BC_VAX                 /* No more comment on VAX          */ 
    867                 fgetname( grn, str );        /* routine ...                     */ 
    868                 sy_fclose( grn );            /*                                 */ 
    869                 grn = sy_fopen( str, "r" );  /*                                 */ 
    870 #               endif                        /*                                 */ 
    871835                meansmp = GRN_MEANSMPREC; 
    872836                grn_readlog( "m" ); 
     
    915879        /* if  (fstat != 0)  {*status = GRNE_TOOSHORT; return;} */ 
    916880        if  (fstat != 0)  { 
    917 #               ifdef BC_VAX                 /* No more comment on VAX          */ 
    918                 fgetname( grn, str );        /* routine ...                     */ 
    919                 sy_fclose( grn );            /*                                 */ 
    920                 grn = sy_fopen( str, "r" );  /*                                 */ 
    921 #               endif                        /*                                 */ 
    922881                setpos = (long)((tmp*0.8)-1)*GRN_RECLTH; 
    923882                grn_readlog( "_" ); 
     
    925884                if  (fstat != 0)  {*status = GRNE_TOOSHORT; return;} 
    926885        } /*endif*/ 
    927 #       ifdef XXX 
    928         if  (fstat != 0)  { /*{*status = GRNE_TOOSHORT; return;}*/ 
    929                 grn_warning( "\n--- jump: file too short" ); 
    930                 do  { 
    931                         setpos -= GRN_RECLTH; 
    932                         if  (setpos < 0)  { 
    933                                 *status = GRNE_TOOSHORT; 
    934                                 return; 
    935                         } /*endif*/ 
    936                         grn_readlog( "-" ); 
    937                         fstat = fseek( grn, setpos, 0 ); 
    938                 }  while (fstat != 0); 
    939                 grn_warning( "    jump: now found last record" ); 
    940         } /*endif*/ 
    941 #       endif 
    942886 
    943887        /* try this record */ 
     
    12831227                        diff[(*lth)++] = si; 
    12841228                        frame += 2; 
    1285 #                       ifdef XXX 
    1286                         diff[(*lth)++] = (int)grn_get2bytes( frame, swap ); 
    1287                         frame += 2; 
    1288                         diff[(*lth)++] = (int)grn_get2bytes( frame, swap ); 
    1289                         frame += 2; 
    1290 #                       endif 
    12911229                        break; 
    12921230                case 3: 
     
    13251263 
    13261264        /* executable code */ 
    1327  
    1328 #       ifdef XXX 
    1329         if  (strncmp(grnname,"gr",2) == 0 || strncmp(grnname,"GR",2) == 0)  { 
    1330                 grnname += 4; 
    1331         } else { 
    1332                 while  (isalpha(*grnname)) 
    1333                         grnname++; 
    1334         } /*endif*/ 
    1335 #       endif 
    13361265 
    13371266        slen = (int)strlen( station ); 
     
    13921321 *   If the label is an empty string, device is assumed to hold the complete 
    13931322 * path of the data directory.  In this case the list file is searched on 
    1394  * "grnv_glsdir" with the name "device"_dirfile.gls (VAX) or on the data 
    1395  * directory with the name dirfile.gls (all others). 
     1323 * on the data directory with the name dirfile.gls. 
    13961324 *   The syntax of the list file is explained in the following example 
    13971325 * (please remind that the first three characters in each line " * " are 
     
    14661394 
    14671395        if  (*label == '\0')  { 
    1468 #               ifdef BC_VAX                                   /* on the VAX, the list */ 
    1469                 strcpy( glsname, grnv_glsdir );                /* file is on the same  */ 
    1470                 strcat( glsname, device );                     /* directory as all     */ 
    1471                 i = (int)strlen( glsname ) - 1;                /* other list files     */ 
    1472                 if  (glsname[i] == EODEV)  glsname[i] = '\0';  /*                      */ 
    1473                 strcat( glsname, "_dirfile" );                 /*                      */ 
    1474 #               else 
    14751396                strcpy( glsname, device );               /* this is different on other */ 
    14761397                i = (int)strlen( glsname ) - 1;          /* machines.  Here the list   */ 
    14771398                if  (glsname[i] != EODEV &&              /* file is on the data        */ 
    1478                         glsname[i] != ':')  {            /* directory                  */           
     1399                        glsname[i] != ':')  {            /* directory                  */ 
    14791400                        glsname[i+1] = EODEV;            /*                            */ 
    14801401                        glsname[i+2] = '\0';             /*                            */ 
    14811402                } /*endif*/                              /*                            */ 
    14821403                strcat( glsname, "dirfile" );            /*                            */ 
    1483 #               endif 
    14841404                strcat( glsname, GRN_LISTFILEEXT ); 
    14851405        } else { 
     
    15561476        strcpy( glsname, device ); 
    15571477        if  (*label != '\0')  {  /* on WORM disk the path must be generated */ 
    1558 #               ifdef BC_VAX 
    1559                 if  (*chan == 'H')  strcat( glsname, "[GRN_80." ); 
    1560                 else if  (*chan == 'B')  strcat( glsname, "[GRN_20." ); 
    1561                 else  strcat( glsname, "[GRN_01." ); 
    1562                 strcat( glsname, station ); 
    1563                 strcat( glsname, "]" ); 
    1564 #               else    /* different file syntax in UNIX */ 
    15651478                if  (*chan == 'H')  strcat( glsname, "grn_80/" ); 
    15661479                else if  (*chan == 'B')  strcat( glsname, "grn_20/" ); 
     
    15681481                strcat( glsname, station ); 
    15691482                strcat( glsname, "/" ); 
    1570 #               endif   /* no need for ATARI here */ 
    15711483        } /*endif*/ 
    15721484        for  (i=0; i<filenum; i++)  { 
     
    22422154 
    22432155/*----------------------------------------------------------------------------*/ 
    2244  
    2245  
    2246  
    2247 void grn_set_vax_label_file( char fname[] ) 
    2248  
    2249 /* changes VAX name of VAX label file 
    2250  * 
    2251  * parameters of routine 
    2252  * char       fname[];         input; name of label file 
    2253  */ 
    2254 { 
    2255         /* execitable code */ 
    2256  
    2257         if  (strlen(fname) < BC_FILELTH) 
    2258                 strcpy( grnv_labelfile, fname ); 
    2259  
    2260 } /* end of grn_set_vax_label_file */ 
    2261  
    2262  
    2263  
    2264 /*----------------------------------------------------------------------------*/ 
  • SH_SHM/trunk/source/readgrn.h

    r16 r341  
    4141#endif 
    4242 
    43  
    44 #ifdef BC_SUN 
    4543#define SBYTE signed char 
    46 #else 
    47 #define SBYTE char 
    48 #endif 
    49  
    50  
    5144 
    5245/* error codes */ 
     
    251244 * subsequent files on the volume. 
    252245 *   If the label is an empty string, device is assumed to hold the complete 
    253  * path of the data directory.  In this case the list file is searched on 
    254  * "grnv_glsdir" with the name "device"_dirfile.gls (VAX) or on the data 
    255  * directory with the name dirfile.gls (all others). 
     246 * path of the data directory.  In this case the list file is searched on the data 
     247 * directory with the name dirfile.gls. 
    256248 *   The syntax of the list file is explained in the following example 
    257249 * (please remind that the first three characters in each line " * " are 
     
    408400 
    409401/*----------------------------------------------------------------------------*/ 
    410  
    411  
    412 void grn_set_vax_label_file( char fname[] ); 
    413  
    414 /* changes VAX name of VAX label file 
    415  * 
    416  * parameters of routine 
    417  * char       fname[];         input; name of label file 
    418  */ 
    419  
    420  
    421 /*----------------------------------------------------------------------------*/ 
  • SH_SHM/trunk/source/seed_io/Makefile

    r200 r341  
    4040                                        pcname \ 
    4141                                        copy_recs \ 
    42                                         swap_vax_recs \ 
    4342                                        split_seed \ 
    4443                                        edit_rectime \ 
     
    110109                $(LINK.c) -o $@ $@.o $(LDFLAGS) $(LIBS) 
    111110 
    112 swap_vax_recs: swap_vax_recs.o $(LIB_SOURCE) $(LIB_SEED) 
    113                 $(LINK.c) -o $@ $@.o $(LDFLAGS) $(LIBS) 
    114  
    115111split_seed: split_seed.o $(LIB_SOURCE) $(LIB_SEED) 
    116112                $(LINK.c) -o $@ $@.o $(LDFLAGS) $(LIBS) 
  • SH_SHM/trunk/source/seed_io/fir_resample.c

    r16 r341  
    453453{ 
    454454        /* local variables */ 
    455 #ifdef XXX 
    456         /*------------------------------------------*/ 
    457         FILE     *fp;            /* pointer to output file */ 
    458         /*------------------------------------------*/ 
    459 #endif 
    460455        static TSyBoolean first_call=TRUE;/* first call to routine */ 
    461456        static TSyBoolean new_hdr=TRUE;   /* new header required */ 
     
    515510        /* return if this is final call */ 
    516511        if  (dat == NULL)  return; 
    517  
    518 #ifdef XXX 
    519         /*------------------------------------------*/ 
    520         /* this will be removed after testing */ 
    521         fp = fopen( "resample.dat", "a" ); 
    522         if  (fp == NULL)  { 
    523                 fprintf( stderr, "error opening test file\n" ); 
    524                 exit( 1 ); 
    525         } /*endif*/ 
    526         fprintf( fp, "LENGTH: %d\n", dat[stageno-1].lth ); 
    527         fprintf( fp, "DELTA: %e\n", stage_dt ); 
    528         fprintf( fp, "START: %s\n", outtime ); 
    529         for  (i=0; i<dat[stageno-1].lth; i++) 
    530                 fprintf( fp, "%d\n", dat[stageno-1].ptr[i] ); 
    531         fclose( fp ); 
    532         /*------------------------------------------*/ 
    533 #endif 
    534512 
    535513        /* initialize header and open output file if not yet done */ 
  • SH_SHM/trunk/source/seed_io/seed_lib.c

    r326 r341  
    33 *      ========== 
    44 * 
    5  * $Revision: 165 $, $Date: 2011-02-17 12:03:57 +0100 (Do, 17 Feb 2011) $ 
     5 * $Revision: 180 $, $Date: 2011-03-09 16:27:03 +0100 (Mi, 09 MÀr 2011) $ 
    66 * 
    77 * SEED library 
     
    4747 * v 82, 13-Feb-07, K. Stammler, swap blockette 1000 in SwapHeader 
    4848 * v 83, 28-Nov-07, K. Stammler, accept also Q and R as data record identifier 
     49 * v 84, 19-Feb-08, M. Walther, removed VAX support 
    4950 */ 
    5051 
     
    5455#include <math.h> 
    5556#include "basecnst.h" 
     57 
    5658#ifdef BC_INC_UNISTD 
    5759#include BC_INC_UNISTD 
    5860#endif 
     61 
    5962#ifdef BC_INC_STDLIB 
    6063#include BC_INC_STDLIB 
    6164#endif 
    62 #ifdef BC_SUN 
     65 
    6366#include <fcntl.h> 
    6467#include <sys/types.h> 
    65 /* #include <sys/uio.h> */ 
    66 #endif 
    67 #ifdef BC_VAX 
    68 #include <file.h> 
    69 #endif 
    7068#include "sysbase.h" 
    7169#include "tcusrdef.h" 
     
    7977#include "steim1.h" 
    8078#undef ANSI_EXTENSIONS 
    81  
    82 #ifdef BC_VAX 
    83 #define SEEK_SET 0 
    84 #endif 
    85  
    8679 
    8780 
     
    773766                if  (Severe(status))  {fclose(sfd); return;} 
    774767                if  (strcmp(curr.stream,lstream_str) != 0)  continue; 
    775                 if  (strcmp(xaddinf,Seed_C_EmptyAddinfStr) != 0  
     768                if  (strcmp(xaddinf,Seed_C_EmptyAddinfStr) != 0 
    776769                        && strcmp(xaddinf,curr.addinf) != 0)  continue; 
    777770                tdiff = tc_tdiff( start, curr.t_start, status ); 
     
    856849/*---------------------------------------------------------------------*/ 
    857850 
    858 #ifdef XXX 
    859  
    860 static void SeedFindFileInDatabase( char stream_str[], char start[], 
    861         char dbfile[], SeedFileDescrT *fdescr, STATUS *status ) 
    862  
    863 /* Finds SEED file in sfdb database. If no file is found the file with the 
    864  * next possible time is returned 
    865  * 
    866  * parameters of routine 
    867  * char       stream_str[];      input; stream string like "bfo-vbb-z" 
    868  * char       start[];           input; start time 
    869  * char       dbfile[];          input; DB output file 
    870  * SeedFileDescrT *fdescr;       output; SEED file descriptor 
    871  * STATUS     *status;           output; return status 
    872  */ 
    873 { 
    874         /* local variables */ 
    875         static char last_start[cBcTimeLth+1]="";  /* last start time */ 
    876         char     shellcmd[cBcVeryLongStrLth+1];   /* shell command */ 
    877         char     tmpfileb[cBcFileLth+1];          /* scratch file 2 */ 
    878         FILE     *fp;                             /* pointer to file */ 
    879         char     tmpstr[cBcShortStrLth+1];        /* scratch string */ 
    880         char     station[cBcShortStrLth+1];       /* passed station name */ 
    881         char     chan[cBcShortStrLth+1];          /* passed channel name */ 
    882         char     comp;                            /* passed component name */ 
    883         char     tstation[cBcShortStrLth+1];      /* current station name */ 
    884         char     tchan[cBcShortStrLth+1];         /* current channel name */ 
    885         char     tcomp;                           /* current component name */ 
    886         int      i;                               /* counter */ 
    887         NTIME    ntime, ntimeb;                   /* numeric read time */ 
    888         char     line[cBcLineLth+1];              /* current line of file */ 
    889         int      pathid, pathidx;                 /* path ID */ 
    890         char     relpath[cBcLineLth+1];           /* relative pathname */ 
    891         SeedFileDescrT descr, descrx;             /* Seed file descr */ 
    892         float    tdiff;                           /* time difference */ 
    893         char     *rootpath;                       /* pointer to root path */ 
    894         int      pri, prix;                       /* priority of entry */ 
    895         int      dataformat;                      /* data format (not used yet) */ 
    896         int      datea, dateb;                    /* dates of seed entry */ 
    897         double   timea, timeb;                    /* times of entry */ 
    898         int      rddate;                          /* read date as integer */ 
    899         double   rdtime;                          /* read time as double */ 
    900  
    901         /* executable code */ 
    902  
    903         /* parse stream string */ 
    904         if  (strlen(stream_str) > cBcShortStrLth)  { 
    905                 *status = SeedERR_STROVFL; 
    906                 return; 
    907         } /*endif*/ 
    908         strcpy( tmpstr, stream_str ); 
    909         ut_uncap( tmpstr ); 
    910         for  (i=0; tmpstr[i] != '\0'; i++) 
    911                 if  (tmpstr[i] == '-')  tmpstr[i] = ' '; 
    912         i = sscanf( tmpstr, "%s %s %c", station, chan, &comp ); 
    913         if  (i < 3)  comp = ' '; 
    914         if  (i < 2)  strcpy( chan , "  " ); 
    915         if  (i < 1)  strcpy( station , "   " ); 
    916  
    917         fp = fopen( dbfile, "r" ); 
    918         if  (fp == NULL)  { 
    919                 *status = SeedERR_BUG; 
    920                 err_setcontext( " ## error opening database file " ); 
    921                 err_setcontext( dbfile ); 
    922                 return; 
    923         } /*endif*/ 
    924         /* read off header */ 
    925         fgets( line, cBcLineLth, fp ); 
    926  
    927         /* read through all entries (shouldn't be more than 2) */ 
    928         descr.ufd = Seed_C_ILLEGAL; 
    929         descr.pos = 0; 
    930         descr.sample = 0; 
    931         strcpy( descr.addinf, Seed_C_EmptyAddinfStr ); 
    932         descr.sfdfile[0] = descrx.sfdfile[0] = '\0'; 
    933         descr.calib = 0.0; 
    934         pri = prix = 0; 
    935         while  (fgets(line,cBcLineLth,fp) != NULL)  { 
    936                 /* parse line read */ 
    937                 if  (sscanf(line,"%s %s %c %d %s %d %lf %d %lf %d %d %d %d %d %d %d", 
    938                         tstation,tchan,&tcomp,&pathid,relpath,&datea,&timea,&dateb,&timeb, 
    939                         &descr.recno,&descr.swap_hdr,&descr.reclth,&descr.byteoff, 
    940                         &descr.dataflags,&pri,&dataformat) != 16)  { 
    941                         *status = SeedERR_DBREAD; 
    942                         fclose( fp ); 
    943                         return; 
    944                 } /*endif*/ 
    945                 if  (strcmp(station,tstation) != 0)  continue; 
    946                 if  (strcmp(chan,tchan) != 0)  continue; 
    947                 if  (comp != tcomp )  continue; 
    948                 if  (GpGetInt(cGpI_debug_level) > 5) 
    949                         printf( "SHM-dbg6: got line %sSHM-dbg6: read times %d,%lf %d,%lf\n", 
    950                                 line, datea, timea, dateb, timeb ); 
    951                 ntime.year = datea / 10000; 
    952                 ntime.month = (datea % 10000) / 100; 
    953                 ntime.day = datea % 100; 
    954                 ntime.hour = Nint( timea / 10000.0 - 0.499 ); 
    955                 timea -= (double)ntime.hour*10000.0; 
    956                 ntime.min = Nint( timea / 100.0 - 0.499 ); 
    957                 timea -= (double)ntime.min*100.0; 
    958                 ntime.sec = Nint( timea - 0.499 ); 
    959                 timea -= (double)ntime.sec; 
    960                 ntime.ms = Nint( timea*1000.0 ); 
    961                 if  (GpGetInt(cGpI_debug_level) > 5) 
    962                         printf( "SHM-dbg6: start ntime: %d,%d,%d,%d,%d,%d,%d\n", ntime.year, 
    963                                 ntime.month, ntime.day, ntime.hour, ntime.min, ntime.sec, ntime.ms); 
    964                 tc_n2t( &ntime, descr.t_start, status ); 
    965                 if  (SySevere(status))  {fclose(fp); return;} 
    966                 ntime.year = dateb / 10000; 
    967                 ntime.month = (dateb % 10000) / 100; 
    968                 ntime.day = dateb % 100; 
    969                 ntime.hour = Nint( timeb / 10000.0 - 0.499 ); 
    970                 timeb -= (double)ntime.hour*10000.0; 
    971                 ntime.min = Nint( timeb / 100.0 - 0.499 ); 
    972                 timeb -= (double)ntime.min*100.0; 
    973                 ntime.sec = Nint( timeb - 0.499 ); 
    974                 timeb -= (double)ntime.sec; 
    975                 ntime.ms = Nint( timeb*1000.0 ); 
    976                 if  (GpGetInt(cGpI_debug_level) > 5) 
    977                         printf( "SHM-dbg6: start ntime: %d,%d,%d,%d,%d,%d,%d\n", ntime.year, 
    978                                 ntime.month, ntime.day, ntime.hour, ntime.min, ntime.sec, ntime.ms); 
    979                 tc_n2t( &ntime, descr.t_end, status ); 
    980                 if  (SySevere(status))  {fclose(fp); return;} 
    981                 if  (strlen(station)+strlen(chan)+3 > cBcShortStrLth)  { 
    982                         *status = SeedERR_STROVFL; 
    983                         return;          
    984                 } /*endif*/ 
    985                 /* database list may contain files which do not match the requested time */ 
    986                 /* if priority is lower than the one we have, ignore entry */ 
    987                 if  (pri < prix)  continue; 
    988                 /* if we already have a matching entry, compare with this here */ 
    989                 if  (descrx.sfdfile[0] != '\0')  { 
    990                         /* take the one with earlier start time */ 
    991                         tdiff = tc_tdiff( descr.t_start, descrx.t_start, status ); 
    992                         if  (SySevere(status))  return; 
    993                         if  (tdiff > 0.0)  continue; 
    994                 } /*endif*/ 
    995                 sprintf( descr.stream, "%s-%s-%c", station, chan, comp ); 
    996                 strcpy( descr.name, relpath ); 
    997                 strcpy( descr.sfdfile, "db:" ); 
    998                 descrx = descr; 
    999                 prix = pri; 
    1000                 pathidx = pathid; 
    1001         } /*endfor*/ 
    1002  
    1003         fclose( fp ); 
    1004  
    1005         if  (descrx.sfdfile[0] == '\0')  { 
    1006                 *status = SeedERR_SFD_NOTFOUND; 
    1007                 return; 
    1008         } /*endif*/ 
    1009         descr = descrx; 
    1010         strcpy( relpath, descr.name ); 
    1011         pathid = pathidx; 
    1012  
    1013         /* now find absolute path, first look in cache */ 
    1014         rootpath = SeedGetRootPath( pathid ); 
    1015         if  (rootpath == NULL)  { 
    1016                 /* second temporary file */ 
    1017                 i = 1; 
    1018                 FOREVER  { 
    1019                         sprintf( tmpfileb, "/tmp/sfdb_read_b_%d.000", i++ ); 
    1020                         fp = fopen( tmpfileb, "r" ); 
    1021                         if  (fp == NULL)  break; 
    1022                         fclose( fp ); 
    1023                 } /*endfor*/ 
    1024                 /* create empty file to reserve name */ 
    1025                 fp = fopen( tmpfileb, "w" ); 
    1026                 fclose( fp ); 
    1027                 /* not in cache, get it from database */ 
    1028                 sprintf( shellcmd, 
    1029                         "\\rm %s; %s %s \"select rootpath from pathtab where id = \'%d\'\" >%s", 
    1030                         tmpfileb, GpGetString(cGpS_sfdb_command), 
    1031                         GpGetString(cGpS_sfdb_exec_qual), pathid, tmpfileb ); 
    1032                 /*printf( "--> executing %s\n", shellcmd );*/ 
    1033                 system( shellcmd ); 
    1034  
    1035                 /* read output file */ 
    1036                 fp = fopen( tmpfileb, "r" ); 
    1037                 if  (fp == NULL)  { 
    1038                         *status = SeedERR_BUG; 
    1039                         err_setcontext( " ## error opening scratch file" ); 
    1040                         return; 
    1041                 } /*endif*/ 
    1042                 /* read off header */ 
    1043                 fgets( line, cBcLineLth, fp ); 
    1044                 fgets( descr.name, cBcFileLth, fp ); 
    1045                 i = strlen( descr.name ); 
    1046                 if  (i > 0 && descr.name[i-1] == '\n')  descr.name[i-1] = '\0'; 
    1047                 fclose( fp ); 
    1048                 /* put it to cache */ 
    1049                 SeedCacheRootPath( pathid, descr.name, status ); 
    1050                 sy_fdelete( tmpfileb ); 
    1051         } else { 
    1052                 strcpy( descr.name, rootpath ); 
    1053         } /*endif*/ 
    1054  
    1055         strcat( descr.name, "/" ); 
    1056         strcat( descr.name, relpath ); 
    1057  
    1058         if  (strlen(start) > cBcTimeLth)  { 
    1059                 *status = SeedERR_BUG; 
    1060                 err_setcontext( " ## time tring too long" ); 
    1061                 return; 
    1062         } /*endif*/ 
    1063  
    1064         descr.calib = SeedFindStreamCalibration( descr.stream, start, status ); 
    1065         if  (*status == SeedERR_NOCALIB)  { 
    1066                 *status = cBcNoError; 
    1067                 descr.dataflags |= Seed_F_QUAL_NOCALIB; 
    1068         } /*endif*/ 
    1069         if  (seedv_invert_swap_hdr)  descr.swap_hdr = ! descr.swap_hdr; 
    1070         *fdescr = descr; 
    1071  
    1072 } /* end of SeedFindFileInDatabase */ 
    1073  
    1074 #endif 
    1075  
    1076 /*---------------------------------------------------------------------*/ 
    1077  
    1078 #ifdef XXX 
    1079  
    1080 static void SeedFindFileInDatabaseOld( char stream_str[], char start[], 
    1081         SeedFileDescrT *fdescr, STATUS *status ) 
    1082  
    1083 /* Finds SEED file in sfdb database. If no file is found the file with the 
    1084  * next possible time is returned 
    1085  * 
    1086  * parameters of routine 
    1087  * char       stream_str[];      input; stream string like "bfo-vbb-z" 
    1088  * char       start[];           input; start time 
    1089  * char       sfdfile[];         input; SEED file directory 
    1090  * SeedFileDescrT *fdescr;       output; SEED file descriptor 
    1091  * STATUS     *status;           output; return status 
    1092  */ 
    1093 { 
    1094         /* local variables */ 
    1095         static char last_start[cBcTimeLth+1]="";  /* last start time */ 
    1096         char     shellcmd[cBcVeryLongStrLth+1];   /* shell command */ 
    1097         char     tmpfileb[cBcFileLth+1];          /* scratch file 2 */ 
    1098         FILE     *fp;                             /* pointer to file */ 
    1099         char     tmpstr[cBcShortStrLth+1];        /* scratch string */ 
    1100         char     station[cBcShortStrLth+1];       /* passed station name */ 
    1101         char     chan[cBcShortStrLth+1];          /* passed channel name */ 
    1102         char     comp;                            /* passed component name */ 
    1103         char     tstation[cBcShortStrLth+1];      /* current station name */ 
    1104         char     tchan[cBcShortStrLth+1];         /* current channel name */ 
    1105         char     tcomp;                           /* current component name */ 
    1106         int      i;                               /* counter */ 
    1107         NTIME    ntime, ntimeb;                   /* numeric read time */ 
    1108         char     line[cBcLineLth+1];              /* current line of file */ 
    1109         int      pathid, pathidx;                 /* path ID */ 
    1110         char     relpath[cBcLineLth+1];           /* relative pathname */ 
    1111         SeedFileDescrT descr, descrx;             /* Seed file descr */ 
    1112         float    tdiff;                           /* time difference */ 
    1113         char     *rootpath;                       /* pointer to root path */ 
    1114         int      pri, prix;                       /* priority of entry */ 
    1115         int      dataformat;                      /* data format (not used yet) */ 
    1116 #ifdef USE_DATETIME 
    1117         char     datea[cBcShortStrLth+1];         /* date 1 */ 
    1118         char     timea[cBcShortStrLth+1];         /* time 1 */ 
    1119         int      msa;                             /* millisecs 1 */ 
    1120         char     dateb[cBcShortStrLth+1];         /* date 2 */ 
    1121         char     timeb[cBcShortStrLth+1];         /* time 2 */ 
    1122         int      msb;                             /* millisecs 2 */ 
    1123 #else 
    1124         int      datea, dateb;                    /* dates of seed entry */ 
    1125         double   timea, timeb;                    /* times of entry */ 
    1126         int      rddate;                          /* read date as integer */ 
    1127         double   rdtime;                          /* read time as double */ 
    1128 #endif 
    1129  
    1130         /* executable code */ 
    1131  
    1132         /* parse stream string */ 
    1133         if  (strlen(stream_str) > cBcShortStrLth)  { 
    1134                 *status = SeedERR_STROVFL; 
    1135                 return; 
    1136         } /*endif*/ 
    1137         strcpy( tmpstr, stream_str ); 
    1138         ut_uncap( tmpstr ); 
    1139         for  (i=0; tmpstr[i] != '\0'; i++) 
    1140                 if  (tmpstr[i] == '-')  tmpstr[i] = ' '; 
    1141         i = sscanf( tmpstr, "%s %s %c", station, chan, &comp ); 
    1142         if  (i < 3)  comp = ' '; 
    1143         if  (i < 2)  strcpy( chan , "  " ); 
    1144         if  (i < 1)  strcpy( station , "   " ); 
    1145  
    1146         /* static temporary file, create if no call to db before */ 
    1147         if  (last_start[0] == '\0')  { 
    1148                 i = 1; 
    1149                 FOREVER  { 
    1150                         sprintf( seedv_sfdb_tmp, "/tmp/sfdb_read_a_%d.000", i++ ); 
    1151                         fp = fopen( seedv_sfdb_tmp, "r" ); 
    1152                         if  (fp == NULL)  break; 
    1153                         fclose( fp ); 
    1154                 } /*endfor*/ 
    1155                 /* create empty file to reserve name */ 
    1156                 fp = fopen( seedv_sfdb_tmp, "w" ); 
    1157                 fclose( fp ); 
    1158         } /*endif*/ 
    1159  
    1160         /* convert time to numeric format */ 
    1161         tc_t2n( start, &ntime, status ); 
    1162         if  (SySevere(status))  return; 
    1163         tc_nadd( &ntime, 1.0, &ntimeb, status ); 
    1164         if  (SySevere(status))  return; 
    1165  
    1166         if  (strcmp(start,last_start) != 0)  { 
    1167                 /* call to db if new start time given */ 
    1168 #ifdef USE_DATETIME 
    1169                 sprintf( shellcmd, 
    1170                         "\\rm %s; %s %s \"select * from sftab where stime <= \'%4d-%02d-%02d %02d:%02d:%02d\' and etime >= \'%4d-%02d-%02d %02d:%02d:%02d\'\" >%s", 
    1171                         seedv_sfdb_tmp, GpGetString(cGpS_sfdb_command), GpGetString(cGpS_sfdb_exec_qual), 
    1172                         ntime.year, ntime.month, ntime.day, 
    1173                         ntime.hour, ntime.min, ntime.sec, ntimeb.year, ntimeb.month, ntimeb.day, 
    1174                         ntimeb.hour, ntimeb.min, ntimeb.sec, seedv_sfdb_tmp ); 
    1175 #else 
    1176                 rddate = ntime.year*10000 + ntime.month*100 + ntime.day; 
    1177                 rdtime = (double)ntime.hour*10000.0 + (double)ntime.min*100.0 
    1178                         + (double)ntime.sec + (double)ntime.ms/1000.0; 
    1179                 sprintf( shellcmd, 
    1180                         "\\rm %s; %s %s \"select * from sftab where ((sdate < %d) OR (sdate = %d AND stime <= %10.3f)) AND ((%d < edate) OR (%d = edate AND %10.3f <= etime))\" >%s", 
    1181                         seedv_sfdb_tmp, GpGetString(cGpS_sfdb_command), 
    1182                         GpGetString(cGpS_sfdb_exec_qual), rddate, rddate, rdtime, rddate, 
    1183                         rddate, rdtime, seedv_sfdb_tmp ); 
    1184 #endif 
    1185                 if  (GpGetInt(cGpI_debug_level) > 3) 
    1186                         printf( "SH-dbg4: executing %s\n", shellcmd ); 
    1187                 system( shellcmd ); 
    1188                 strcpy( last_start, start ); 
    1189         } /*endif*/ 
    1190  
    1191         fp = fopen( seedv_sfdb_tmp, "r" ); 
    1192         if  (fp == NULL)  { 
    1193                 *status = SeedERR_BUG; 
    1194                 err_setcontext( " ## error opening scratch file " ); 
    1195                 err_setcontext( seedv_sfdb_tmp ); 
    1196                 return; 
    1197         } /*endif*/ 
    1198         /* read off header */ 
    1199         fgets( line, cBcLineLth, fp ); 
    1200  
    1201         /* read through all entries (shouldn't be more than 2) */ 
    1202         descr.ufd = Seed_C_ILLEGAL; 
    1203         descr.pos = 0; 
    1204         descr.sample = 0; 
    1205         strcpy( descr.addinf, Seed_C_EmptyAddinfStr ); 
    1206         descr.sfdfile[0] = descrx.sfdfile[0] = '\0'; 
    1207         descr.calib = 0.0; 
    1208         pri = prix = 0; 
    1209         while  (fgets(line,cBcLineLth,fp) != NULL)  { 
    1210                 /* parse line read */ 
    1211 #ifdef USE_DATETIME 
    1212                 if  (sscanf(line,"%s %s %c %d %s %s %s %d %s %s %d %d %d %d %d %d %d", 
    1213                         tstation,tchan,&tcomp,&pathid,relpath,datea,timea,&msa,dateb,timeb, 
    1214                         &msb,&descr.recno,&descr.swap_hdr,&descr.reclth,&descr.byteoff, 
    1215                         &descr.dataflags,&pri) != 17)  { 
    1216                         *status = SeedERR_DBREAD; 
    1217                         fclose( fp ); 
    1218                         return; 
    1219                 } /*endif*/ 
    1220 #else 
    1221                 if  (sscanf(line,"%s %s %c %d %s %d %lf %d %lf %d %d %d %d %d %d %d", 
    1222                         tstation,tchan,&tcomp,&pathid,relpath,&datea,&timea,&dateb,&timeb, 
    1223                         &descr.recno,&descr.swap_hdr,&descr.reclth,&descr.byteoff, 
    1224                         &descr.dataflags,&pri,&dataformat) != 16)  { 
    1225                         *status = SeedERR_DBREAD; 
    1226                         fclose( fp ); 
    1227                         return; 
    1228                 } /*endif*/ 
    1229 #endif 
    1230                 if  (strcmp(station,tstation) != 0)  continue; 
    1231                 if  (strcmp(chan,tchan) != 0)  continue; 
    1232                 if  (comp != tcomp )  continue; 
    1233                 if  (GpGetInt(cGpI_debug_level) > 5) 
    1234                         printf( "SHM-dbg6: got line %sSHM-dbg6: read times %d,%lf %d,%lf\n", 
    1235                                 line, datea, timea, dateb, timeb ); 
    1236 #ifdef USE_DATETIME 
    1237                 /* change '-'s to '/'s in dates, so that tc_... routines can read it */ 
    1238                 for  (i=0; datea[i] != '\0'; i++) 
    1239                         if  (datea[i] == '-')  datea[i] = '/'; 
    1240                 for  (i=0; dateb[i] != '\0'; i++) 
    1241                         if  (dateb[i] == '-')  dateb[i] = '/'; 
    1242                 sprintf( descr.t_start, "%s_%s", datea, timea ); 
    1243                 sprintf( descr.t_end, "%s_%s", dateb, timeb ); 
    1244                 /* add the milliseconds, which were not used in DB search */ 
    1245                 tc_tadd( descr.t_start, (float)msa/1000.0, descr.t_start, status ); 
    1246                 if  (SySevere(status))  {fclose(fp); return;} 
    1247                 tc_tadd( descr.t_end, (float)msb/1000.0, descr.t_end, status ); 
    1248                 if  (SySevere(status))  {fclose(fp); return;} 
    1249                 tdiff = tc_tdiff( start, descr.t_start, status ); 
    1250                 if  (SySevere(status))  {fclose(fp); return;} 
    1251                 if  (tdiff < 0.0)  continue;  /* then the milliseconds didn't match */ 
    1252                 tdiff = tc_tdiff( descr.t_end, start, status ); 
    1253                 if  (SySevere(status))  {fclose(fp); return;} 
    1254                 if  (tdiff < 0.0)  continue;  /* then the milliseconds didn't match */ 
    1255 #else 
    1256                 ntime.year = datea / 10000; 
    1257                 ntime.month = (datea % 10000) / 100; 
    1258                 ntime.day = datea % 100; 
    1259                 ntime.hour = Nint( timea / 10000.0 - 0.499 ); 
    1260                 timea -= (double)ntime.hour*10000.0; 
    1261                 ntime.min = Nint( timea / 100.0 - 0.499 ); 
    1262                 timea -= (double)ntime.min*100.0; 
    1263                 ntime.sec = Nint( timea - 0.499 ); 
    1264                 timea -= (double)ntime.sec; 
    1265                 ntime.ms = Nint( timea*1000.0 ); 
    1266                 if  (GpGetInt(cGpI_debug_level) > 5) 
    1267                         printf( "SHM-dbg6: start ntime: %d,%d,%d,%d,%d,%d,%d\n", ntime.year, 
    1268                                 ntime.month, ntime.day, ntime.hour, ntime.min, ntime.sec, ntime.ms); 
    1269                 tc_n2t( &ntime, descr.t_start, status ); 
    1270                 if  (SySevere(status))  {fclose(fp); return;} 
    1271                 ntime.year = dateb / 10000; 
    1272                 ntime.month = (dateb % 10000) / 100; 
    1273                 ntime.day = dateb % 100; 
    1274                 ntime.hour = Nint( timeb / 10000.0 - 0.499 ); 
    1275                 timeb -= (double)ntime.hour*10000.0; 
    1276                 ntime.min = Nint( timeb / 100.0 - 0.499 ); 
    1277                 timeb -= (double)ntime.min*100.0; 
    1278                 ntime.sec = Nint( timeb - 0.499 ); 
    1279                 timeb -= (double)ntime.sec; 
    1280                 ntime.ms = Nint( timeb*1000.0 ); 
    1281                 if  (GpGetInt(cGpI_debug_level) > 5) 
    1282                         printf( "SHM-dbg6: start ntime: %d,%d,%d,%d,%d,%d,%d\n", ntime.year, 
    1283                                 ntime.month, ntime.day, ntime.hour, ntime.min, ntime.sec, ntime.ms); 
    1284                 tc_n2t( &ntime, descr.t_end, status ); 
    1285                 if  (SySevere(status))  {fclose(fp); return;} 
    1286 #endif 
    1287                 if  (strlen(station)+strlen(chan)+3 > cBcShortStrLth)  { 
    1288                         *status = SeedERR_STROVFL; 
    1289                         return;          
    1290                 } /*endif*/ 
    1291                 /* if priority is lower than the one we have, ignore entry */ 
    1292                 if  (pri < prix)  continue; 
    1293                 /* if we already have a matching entry, compare with this here */ 
    1294                 if  (descrx.sfdfile[0] != '\0')  { 
    1295                         /* take the one with earlier start time */ 
    1296                         tdiff = tc_tdiff( descr.t_start, descrx.t_start, status ); 
    1297                         if  (SySevere(status))  return; 
    1298                         if  (tdiff > 0.0)  continue; 
    1299                 } /*endif*/ 
    1300                 sprintf( descr.stream, "%s-%s-%c", station, chan, comp ); 
    1301                 strcpy( descr.name, relpath ); 
    1302                 strcpy( descr.sfdfile, "db:" ); 
    1303                 descrx = descr; 
    1304                 prix = pri; 
    1305                 pathidx = pathid; 
    1306         } /*endfor*/ 
    1307  
    1308         fclose( fp ); 
    1309  
    1310         if  (descrx.sfdfile[0] == '\0')  { 
    1311                 *status = SeedERR_SFD_NOTFOUND; 
    1312                 return; 
    1313         } /*endif*/ 
    1314         descr = descrx; 
    1315         strcpy( relpath, descr.name ); 
    1316         pathid = pathidx; 
    1317  
    1318         /* now find absolute path, first look in cache */ 
    1319         rootpath = SeedGetRootPath( pathid ); 
    1320         if  (rootpath == NULL)  { 
    1321                 /* second temporary file */ 
    1322                 i = 1; 
    1323                 FOREVER  { 
    1324                         sprintf( tmpfileb, "/tmp/sfdb_read_b_%d.000", i++ ); 
    1325                         fp = fopen( tmpfileb, "r" ); 
    1326                         if  (fp == NULL)  break; 
    1327                         fclose( fp ); 
    1328                 } /*endfor*/ 
    1329                 /* create empty file to reserve name */ 
    1330                 fp = fopen( tmpfileb, "w" ); 
    1331                 fclose( fp ); 
    1332                 /* not in cache, get it from database */ 
    1333                 sprintf( shellcmd, 
    1334                         "\\rm %s; %s %s \"select rootpath from pathtab where id = \'%d\'\" >%s", 
    1335                         tmpfileb, GpGetString(cGpS_sfdb_command), 
    1336                         GpGetString(cGpS_sfdb_exec_qual), pathid, tmpfileb ); 
    1337                 /*printf( "--> executing %s\n", shellcmd );*/ 
    1338                 system( shellcmd ); 
    1339  
    1340                 /* read output file */ 
    1341                 fp = fopen( tmpfileb, "r" ); 
    1342                 if  (fp == NULL)  { 
    1343                         *status = SeedERR_BUG; 
    1344                         err_setcontext( " ## error opening scratch file" ); 
    1345                         return; 
    1346                 } /*endif*/ 
    1347                 /* read off header */ 
    1348                 fgets( line, cBcLineLth, fp ); 
    1349                 fgets( descr.name, cBcFileLth, fp ); 
    1350                 i = strlen( descr.name ); 
    1351                 if  (i > 0 && descr.name[i-1] == '\n')  descr.name[i-1] = '\0'; 
    1352                 fclose( fp ); 
    1353                 /* put it to cache */ 
    1354                 SeedCacheRootPath( pathid, descr.name, status ); 
    1355                 sy_fdelete( tmpfileb ); 
    1356         } else { 
    1357                 strcpy( descr.name, rootpath ); 
    1358         } /*endif*/ 
    1359  
    1360         strcat( descr.name, "/" ); 
    1361         strcat( descr.name, relpath ); 
    1362  
    1363         if  (strlen(start) > cBcTimeLth)  { 
    1364                 *status = SeedERR_BUG; 
    1365                 err_setcontext( " ## time tring too long" ); 
    1366                 return; 
    1367         } /*endif*/ 
    1368  
    1369         descr.calib = SeedFindStreamCalibration( descr.stream, start, status ); 
    1370         if  (*status == SeedERR_NOCALIB)  { 
    1371                 *status = cBcNoError; 
    1372                 descr.dataflags |= Seed_F_QUAL_NOCALIB; 
    1373         } /*endif*/ 
    1374         if  (seedv_invert_swap_hdr)  descr.swap_hdr = ! descr.swap_hdr; 
    1375         *fdescr = descr; 
    1376  
    1377 } /* end of SeedFindFileInDatabaseOld */ 
    1378  
    1379 #endif 
    1380  
    1381 /*---------------------------------------------------------------------*/ 
    1382  
    1383  
    1384851 
    1385852void SeedSearchPosition( int chan, char sfdfile[], char stream_str[], 
     
    21301597 
    21311598 
    2132 /* #ifdef XXX */ 
    2133  
    21341599#define BUFLTH 4096 
    21351600/* should be enough for decoding one record */ 
     
    22351700        /* !!! set record number !!! */ 
    22361701        /* !!! apply time correction !!! */ 
    2237          
     1702 
    22381703        idx = 0; 
    22391704        quit = FALSE; 
     
    23131778#undef FREE_AND_RETURN 
    23141779 
    2315 /* #endif */ 
    23161780 
    23171781/*---------------------------------------------------------------------*/ 
     
    25682032                                                recsmp[i] = 0; 
    25692033                                } /*endif*/ 
    2570 #                               ifdef XXX 
    2571                                 /* excluded this on 1-Jul-98, K.S. */ 
    2572                                 fd->sample = 0; 
    2573                                 fprintf( stderr, 
    2574                                         "   read position within zeroed record set to zero\n" ); 
    2575 #                               endif 
    25762034                                actrecsmp = seedv_rec->no_of_samples; 
    25772035                        } /*endif*/ 
     
    26722130                                        if  (*smplth == getlth)  { 
    26732131                                                sy_deallocmem( recsmp ); 
    2674                                                 fprintf( stderr,  
     2132                                                fprintf( stderr, 
    26752133                                                        "   padding aborted, %ld zeroes remaining\n", padcnt ); 
    26762134                                                return; 
     
    33682826        if  (!seedv_warnings)  return; 
    33692827 
    3370 #ifdef XXX 
    3371         i = 0; 
    3372         while  (i < cBcLineLth && text[i] != '\0')  { 
    3373                 if  ((text[i] >= ' ' && text[i] <= 'z') || text[i] == '\n')  { 
    3374                         str[i] = text[i]; 
    3375                 } else { 
    3376                         str[i] = '.'; 
    3377                 } /*endif*/ 
    3378                 i++; 
    3379         } /*endwhile*/ 
    3380         str[i] = '\0'; 
    3381  
    3382         fprintf( stderr, "%s", str ); 
    3383 #endif 
    33842828        fprintf( stderr, "%s", text ); 
    33852829 
  • SH_SHM/trunk/source/seed_io/seed_tidy.c

    r306 r341  
    2222#include <string.h> 
    2323#include "basecnst.h" 
     24 
    2425#ifdef BC_INC_STDLIB 
    2526#include BC_INC_STDLIB 
    2627#endif 
    27 #ifdef BC_SUN 
     28 
    2829#include <fcntl.h> 
    2930#include <sys/types.h> 
    3031#include <sys/uio.h> 
    31 #endif 
    3232#include "sysbase.h" 
    3333#include "erusrdef.h" 
     
    405405        qsort( dsc, dsclth, sizeof(SeedFileDescrT), &TdQsortCompare ); 
    406406 
    407 #ifdef XXX 
    408  
    409         do  { 
    410                 again = FALSE; 
    411                 for  (i=1; i<dsclth; i++)  { 
    412                         tdiff = tc_tdiff( dsc[i].t_start, dsc[i-1].t_start, status ); 
    413                         if  (Severe(status))  return; 
    414                         if  (tdiff < 0.0)  { 
    415                                 /* exchange i and i-1 and set again */ 
    416                                 xdsc = dsc[i-1]; 
    417                                 dsc[i-1] = dsc[i]; 
    418                                 dsc[i] = xdsc; 
    419                                 again = TRUE; 
    420                         } /*endif*/ 
    421                 } /*endfor*/ 
    422         }  while  (again); 
    423  
    424 #endif 
    425  
    426407} /* end of TdSortSfdList */ 
    427408 
     
    684665                } /*endif*/ 
    685666                SeedStoreReclth( (SeedDataHeaderT *)tdv_seedrec, dsc->reclth ); 
    686 #ifdef XXX 
    687                 if  (F_LINUXDATA & flags)  { 
    688                         SeedSwapHeader( (SeedDataHeaderT *)tdv_seedrec ); 
    689                 } /*endif*/ 
    690 #endif 
    691667                TdPutRecord( tdv_seedrec, flags ); 
    692668        } /*endif*/ 
  • SH_SHM/trunk/source/seed_io/seedquickdump.c

    r260 r341  
    33 *      =============== 
    44 * 
    5  * $Revision: 133 $, $Date: 2010-08-11 09:50:01 +0200 (Mi, 11 Aug 2010) $ 
     5 * $Revision: 180 $, $Date: 2011-03-09 16:27:03 +0100 (Mi, 09 MÀr 2011) $ 
    66 * 
    77 * Dumps out Headerinfo of SEED files. 
     
    242242                if  (seedhdr->first != 0)  { 
    243243                        donly = (SeedDataOnlyBlocketteT *)(seedrec+(seedhdr->first)); 
    244 #ifdef XXX 
    245                         /* this is done in SeedSwapHeader now */ 
    246                         if  (sfd_swap_hdr)  { 
    247                                 tmp = (UWORD)(donly->block_id); 
    248                                 donly->block_id = (tmp & 0xff) * 0x100; 
    249                                 donly->block_id += (UWORD)(tmp & 0xff00) / (UWORD)0x100; 
    250                                 tmp = (UWORD)(donly->next_block); 
    251                                 donly->next_block = (tmp & 0xff) * 0x100; 
    252                                 donly->next_block += (UWORD)(tmp & 0xff00) / (UWORD)0x100; 
    253                         } /*endif*/ 
    254 #endif 
    255244                        b1000found = (donly->block_id == 1000); 
    256245                        if  (b1000found && donly->next_block > 0)  { 
    257246                                dext = (SeedDataExtBlocketteT *)(seedrec+(donly->next_block)); 
    258 #ifdef XXX 
    259                                 /* this is done in SeedSwapHeader now */ 
    260                                 if  (sfd_swap_hdr)  { 
    261                                         tmp = (UWORD)(dext->block_id); 
    262                                         dext->block_id = (tmp & 0xff) * 0x100; 
    263                                         dext->block_id += (UWORD)(tmp & 0xff00) / (UWORD)0x100; 
    264                                 } /*endif*/ 
    265 #endif 
    266247                                if  (dext->block_id == 1001)  { 
    267248                                        time_quality = dext->timequal; 
     
    344325        return 0; 
    345326 
    346 #ifdef XXX 
    347  
    348  
    349         /* get length of file */ 
    350         fseek( fp, 0, 2 ); 
    351         fsize = ftell( fp ) - byteoff; 
    352         if  (fsize % recsize != 0)  { 
    353                 fprintf( stderr, "*** %s: illegal size %ld bytes of SEED file %s\n", 
    354                         pa_progname(), fsize, seedfile ); 
    355                 fclose( fp ); 
    356                 fclose( out ); 
    357                 return 1 ; 
    358         } /*endif*/ 
    359         sfd_recno = (int)(fsize / (long)recsize); 
    360  
    361         /* get last record */ 
    362         fseek( fp, 
    363                 (long)(sfd_recno-1)*(long)recsize + (long)byteoff, 0 ); 
    364         read_ret = (int)fread( (char *)seedrec, recsize, 1, fp ); 
    365         if  (read_ret != 1)  { 
    366                 fprintf( stderr, "*** %s: read error on file %s (end)\n", 
    367                         pa_progname(), seedfile ); 
    368                 fclose( fp ); 
    369                 fclose( out ); 
    370                 return 1; 
    371         } /*endif*/ 
    372         seedhdr = (SeedDataHeaderT *)seedrec; 
    373         if  (SeedSwapNecessary(seedhdr))  SeedSwapHeader(seedhdr); 
    374         errcnt = 0; 
    375         SeedBtimeToNtime( &(seedhdr->starttime), &ntime, &status ); 
    376         while  (Severe(&status))  { 
    377                 errcnt++; 
    378                 fprintf( stderr, 
    379                         "%s: unreadable last record, take %d before in file %s\n", 
    380                         pa_progname(), errcnt, seedfile ); 
    381                 status = BC_NOERROR; 
    382                 /* get previous record */ 
    383                 sfd_recno--; 
    384                 fseek( fp, 
    385                         (long)(sfd_recno-1)*(long)recsize + (long)byteoff, 
    386                         0 ); 
    387                 read_ret = (int)fread( (char *)seedrec, recsize, 1, fp); 
    388                 if  (read_ret != 1)  { 
    389                         fprintf( stderr, "%s: read error on file %s (end)\n", 
    390                                 pa_progname(), seedfile ); 
    391                         fclose( fp ); 
    392                         fclose( out ); 
    393                         return 1; 
    394                 } /*endif*/ 
    395                 seedhdr = (SeedDataHeaderT *)seedrec; 
    396                 if  (SeedSwapNecessary(seedhdr))  SeedSwapHeader(seedhdr); 
    397                 SeedBtimeToNtime( &(seedhdr->starttime), &ntime, &status ); 
    398                 if  (Severe(&status) && errcnt > 10)  { 
    399                         fprintf( stderr, 
    400                                 "%s: could not read start time of last record in file %s\n", 
    401                                 pa_progname(), seedfile ); 
    402                         fclose( fp ); 
    403                         fclose( out ); 
    404                         return 1; 
    405                 } /*endif*/ 
    406         } /*endwhile*/ 
    407         tc_nadd( &ntime, (float)(seedhdr->no_of_samples)*dt, &ntime, &status ); 
    408         if  (Severe(&status))  { 
    409                 fprintf( stderr, "%s: could not compute end time in file\n", 
    410                         pa_progname(), seedfile ); 
    411                 fclose( fp ); 
    412                 fclose( out ); 
    413                 return 1; 
    414         } /*endif*/ 
    415         tc_n2t( &ntime, sfd_t_end, &status ); 
    416         if  (Severe(&status))  { 
    417                 fprintf( stderr, "%s: could not convert end time in file %s\n", 
    418                         pa_progname(), seedfile ); 
    419                 fclose( fp ); 
    420                 fclose( out ); 
    421                 return 1; 
    422         } /*endif*/ 
    423  
    424         fclose( fp ); 
    425  
    426         fprintf( out, "%c>%s %c>%s %c>%s %c>%s %c>%d %c>%d %c>%d %c>%d\n", 
    427                 Seed_C_SfdStream, sfd_stream, Seed_C_SfdName, seedfile, 
    428                 Seed_C_SfdTStart, sfd_t_start, Seed_C_SfdTEnd, sfd_t_end, 
    429                 Seed_C_SfdRecno, sfd_recno, Seed_C_SfdSwapH, sfd_swap_hdr, 
    430                 Seed_C_SfdReclth, recsize, Seed_C_SfdOffset, byteoff ); 
    431  
    432         if  (out != stdout)  fclose( out ); 
    433  
    434         return 0; 
    435  
    436 #endif 
    437  
    438327} /* end of main */ 
  • SH_SHM/trunk/source/seed_io/sfdlist_l.csh

    r16 r341  
    2626if  ("$6" != "")  set byteoff="$6" 
    2727 
    28 set oscrfile=x.$$.$outfile 
     28set oscrfile=$outfile.x.$$ 
    2929 
    3030if  (-e $scrfile)  \rm $scrfile 
  • SH_SHM/trunk/source/seed_io/steim1.h

    r16 r341  
    3737 
    3838 
    39 #ifdef IBM_PC 
    40 #define XHUGE huge 
    41 #define GM_ALLOC(NUM, SIZE) halloc(NUM, SIZE) 
    42 #define GM_FREE hfree 
    43 #else 
    4439#define XHUGE 
    4540#define GM_ALLOC(NUM, SIZE) malloc((NUM)*(SIZE)) 
    4641#define GM_FREE free 
    47 #endif 
    4842 
    4943#ifdef ANSI_EXTENSIONS 
  • SH_SHM/trunk/source/seismhan.c

    r322 r341  
    33 *      ========== 
    44 * 
    5  * $Revision: 161 $, $Date: 2011-02-10 17:00:59 +0100 (Do, 10 Feb 2011) $ 
     5 * $Revision: 180 $, $Date: 2011-03-09 16:27:03 +0100 (Mi, 09 MÀr 2011) $ 
    66 * 
    77 * main module of seismhandler program, command line version 
     
    5959#endif 
    6060 
    61 /* VAX specific routines (usually FORTRAN subroutines) */ 
    62 #ifdef BC_GRFVAX 
    63 #include "[-.local]fctxmngrf.h" 
    64 #endif /* BC_GRFVAX */ 
    65  
    6661/* machine dependent path strings */ 
    6762#include BC_SHDIRS 
     
    231226        SqlDeleteScratchFile(); 
    232227 
    233 #       ifndef BC_VAX 
    234         return 0; 
    235 #       endif /* BC_VAX */ 
    236228 
    237229} /* end of main */ 
  • SH_SHM/trunk/source/seusrdef.h

    r16 r341  
    165165 
    166166 
    167 #ifdef BC_SUN 
    168  
    169167void se_get_sh_environment( void ); 
    170168 
     
    174172 */ 
    175173 
    176 #endif 
    177  
    178174 
    179175/*------------------------------------------------------------------------*/ 
  • SH_SHM/trunk/source/shconst.h

    r320 r341  
    33 *      ========= 
    44 * 
    5  * $Revision: 159 $, $Date: 2011-02-10 15:46:45 +0100 (Do, 10 Feb 2011) $ 
     5 * $Revision: 180 $, $Date: 2011-03-09 16:27:03 +0100 (Mi, 09 MÀr 2011) $ 
    66 * 
    77 * constants of seismhandler program 
     
    4242#define GW 2 
    4343        /* graphics window */ 
    44 #ifdef BC_SUN 
    4544#define SHC_FILE_PREFIX "SH_" 
    46 #else 
    47 #define SHC_FILE_PREFIX "SH$" 
    48 #endif 
    4945        /* file prefix of all SeismicHandler files */ 
    5046#define SHC_FILE_PREFIX_LENGTH 3 
     
    176172 
    177173 
    178  
    179 /* ---------------------------------------------------- */ 
    180 /* the following type is used in the motif version only */ 
    181 /* ---------------------------------------------------- */ 
    182  
    183  
    184 #ifdef XXX 
    185  
    186 typedef struct { 
    187         float     red;       /* red fraction */ 
    188         float     green;     /* green fraction */ 
    189         float     blue;      /* blue fraction,  all fractions are between 0 and 1 */ 
    190 } SHT_COLOR; 
    191  
    192  
    193 /* definition of structure for global parameter set */ 
    194 typedef struct { 
    195         char      depth_phase_list[BC_LINELTH+1];   /* list of depth phases */ 
    196         char      theo_phase_list[BC_LINELTH+1];    /* list of theo. phases */ 
    197         char      diff_phase_list[BC_LINELTH+1];    /* list of diff. phases */ 
    198         float     close_phase_resol;     /* close phase resolution in pixel */ 
    199         int       min_drag_box_width; /* minimum width of drag box in pixel */ 
    200         char      defpath_filter[BC_FILELTH+1]; /* default path for filters */ 
    201         char      defpath_events[BC_FILELTH+1]; /* def.path for event files */ 
    202         char      defpath_gse[BC_FILELTH+1];     /* def. path for GSE files */ 
    203         char      defpath_gse2[BC_FILELTH+1];   /* def. path for GSE2 files */ 
    204         char      defpath_ah[BC_FILELTH+1];       /* def. path for AH files */ 
    205         char      defpath_q[BC_FILELTH+1];         /* def. path for Q files */ 
    206         char      defpath_evid[BC_FILELTH+1];    /* path for event ID files */ 
    207         char      defpath_evtout[BC_FILELTH+1];   /* event info output path */ 
    208         char      defpath_data[BC_FILELTH+1];     /* def.path for SEED data */ 
    209    BOOLEAN   top_down_order;       /* arrange trace from top to bottom */ 
    210         long      double_click_time;  /* maximum time diff. of clicks in ms */ 
    211         float     trace_zoom_base;            /* base of trace zoom formula */ 
    212         float     trace_zoom_exp;  /* exponent factor of trace zoom formula */ 
    213         SHT_COLOR color_mark;                               /* marker color */ 
    214         SHT_COLOR color_theo;                  /* theoretical phase markers */ 
    215         SHT_COLOR color_auto;           /* automatically picked phase color */ 
    216         SHT_COLOR color_crsr;                               /* cursor color */ 
    217         char      refstation[BC_SHORTSTRLTH+1];        /* reference station */ 
    218         BOOLEAN   autopick_first;         /* take first or bigger amplitude */ 
    219         char      edit_cmd[BC_LINELTH+1];     /* call to system text editor */ 
    220         float     calib_wdw_width;           /* width of calibration window */ 
    221         float     calib_wdw_height;         /* height of calibration window */ 
    222         float     calib_azimuth_grid;      /* azimuth grid in calib diagram */ 
    223         float     calib_slowness_grid;    /* slowness grid in calib diagram */ 
    224         BOOLEAN   auto_scaling;    /* scale traces on display automatically */ 
    225         BOOLEAN   use_rec_filters;  /* use recursive filters instead of FFT */ 
    226         char      analyst[BC_SHORTSTRLTH+1];      /* analyst's abbreviation */ 
    227         BOOLEAN   prompt_analyst;              /* prompt for analyst's name */ 
    228         char      motif_log[BC_FILELTH+1];         /* motif action log file */ 
    229         float     phase_ampl_diff;  /* max. seconds between phase and ampl. */ 
    230         BOOLEAN   reverse_xors;         /* reverse back/foreground on XOR's */ 
    231         int       x_max_drawlth;    /* max. no of samples in one XDrawLines */ 
    232         int       default_quality;           /* default phase quality value */ 
    233         int       drag_box_rubber_val; /* no of pixels to enable rubber box */ 
    234         char      default_filter[BC_FILELTH+1];   /* def. filter after read */ 
    235         int       default_phase_type;      /* default phase type, like tele */ 
    236         int       default_phase_flags;               /* default phase flags */ 
    237         int       default_depth_type;                 /* default depth type */ 
    238         float     default_depth;                     /* default depth in km */ 
    239         int       default_loc_quality;          /* default location quality */ 
    240         int       max_cursor_form;                /* maximum cursor form ID */ 
    241         char      event_check_proc[BC_FILELTH+1]; /* routine to check event */ 
    242         char      screendump_proc[BC_FILELTH+1];      /* screendump routine */ 
    243         char      evtview_proc[BC_FILELTH+1];  /* evt result view prcoedure */ 
    244         char      remreqhost[BC_SHORTSTRLTH+1];      /* request remote host */ 
    245         BOOLEAN   full_phase_names;             /* display full phase names */ 
    246         char      default_source[BC_SHORTSTRLTH+1];  /* default info source */ 
    247         float     move_wdw_step;        /* step size of move window command */ 
    248         int       top_margin;             /* top margin of display in pixel */ 
    249         char      auto_phase[cBcShortStrLth+1];   /* name of autopick phase */ 
    250         int       draw_area_height;      /* height of drawing area in pixel */ 
    251         int       draw_area_width;        /* width of drawing area in pixel */ 
    252         float     area_zoom_base;              /* drawing area resize, base */ 
    253         float     area_zoom_exp;           /* drawing area resize, exponent */ 
    254         char      reformat_proc[cBcFileLth+1];  /* routine to reformat data */ 
    255         char      final_proc[cBcFileLth+1];/* postprocessing 'final params' */ 
    256         BOOLEAN   own_accelerators;             /* use own accelerator code */ 
    257         char      filter_type;     /* filter type, replaces use_rec_filters */ 
    258 } SHT_GLOBAL_SET; 
    259  
    260 #endif 
    261  
    262  
    263174#endif /* __SHCONST */ 
  • SH_SHM/trunk/source/shdataba.c

    r16 r341  
    7474/*------------------------------------------------------------------------*/ 
    7575 
     76MEMBLC db_root() 
     77 
     78/* returns root pointer to MEMBLC in memory 
     79 * 
     80 * function is only used in shared lib context, since it's the only way to access statically defined variables 
     81 * 
     82 * no parameters 
     83 */ 
     84{ 
     85        return root_dbv[0]; 
     86 
     87} /* end of db_root */ 
     88 
     89 
     90int db_crelist(MEMBLC *created) 
     91 
     92/* returns created list pointer 
     93 * 
     94 * function is only used in shared lib context, since it's the only way to access statically defined variables 
     95 * 
     96 * parameters of routine 
     97 * MEMBLC  *created (block info pointer) 
     98 */ 
     99{ 
     100    created = (MEMBLC*)crelist_dbv; 
     101        return crelistlth_dbv; 
     102 
     103} /* end of db_crelist */ 
     104 
     105 
     106 
     107/*------------------------------------------------------------------------*/ 
    76108 
    77109 
     
    89121 
    90122/*------------------------------------------------------------------------*/ 
    91  
    92123 
    93124 
     
    110141        p = (MEMBLC *)sy_allocmem( 1L, (int)sizeof(MEMBLC), status ); 
    111142        if  (Severe(status))  return NULL; 
     143 
    112144        /* initialise entries */ 
    113145        for  (i=0;i<EMAX_LONG; p->lm[i++]=MLEMPTY ){} 
     
    122154 
    123155        /* append to basic list */ 
     156    /* mwa: in fact, the first structure is never used */ 
    124157        if  (root_dbv[0].pm[EPN_NEXT] == NULL)  { 
    125158                p->pm[EPN_NEXT] = NULL; 
     
    136169        } /*endif*/ 
    137170 
    138         root_dbv[0].im[LISTCNT]++; 
     171        /* mwa: number of traces is cached in root[0]->im */ 
     172    root_dbv[0].im[LISTCNT]++; 
    139173        if  (crelistlth_dbv == SHC_ILISTLTH)  { 
    140174                *status = SHE_TLOVFL; 
    141175                return p; 
    142176        } /*endif*/ 
     177 
     178    /* mwa: addresses of newly created traces are stored separately */ 
    143179        crelist_dbv[crelistlth_dbv++] = p; 
    144180        return p; 
     
    462498 
    463499        if  (map == 0)  return MEMDLN; 
    464         if  (GCF_TEK & map)  return TEKDLN; 
    465         if  (GCF_CALCOMP & map)  return CCDLN; 
    466500        return (map & GCF_NUMMASK); 
    467501 
     
    792826 
    793827/* returns pointer info value 
    794  *  
     828 * 
    795829 * parameters of routine 
    796830 * MEMBLC   *ptr;           input; info block pointer 
  • SH_SHM/trunk/source/shdirs.h

    r16 r341  
    3737 
    3838/*=================================================================*/ 
    39 #ifdef BC_ATARI 
    40  
    41  
    42  
    43 #define DD_SCRATCH "SHC_SCRATCH:" 
    44 #define DD_HELP "SHC_HELP:" 
    45 #define DD_CMD  "SHC_COMMAND:" 
    46 #define DD_FILTER "SHC_FILTER:" 
    47 #define DD_GLOBALS "SHC_GLOBALS:" 
    48 #define DD_ERRORS "SHC_ERRORS:" 
    49 #define DD_INPUTS "SHC_INPUTS:" 
    50 #define DD_EXTPROG "SHC_EXTPROG:" 
    51  
    52  
    53  
    54 #endif /* BC_ATARI */ 
    55 /*=================================================================*/ 
    56 #ifdef BC_VAX 
    57  
    58  
    59  
    60 #define DD_SCRATCH "SYS$LOGIN:" 
    61 #define DD_HELP "SHC_HELP:" 
    62 #define DD_CMD  "SHC_COMMAND:" 
    63 #define DD_FILTER "SHC_FILTER:" 
    64 #define DD_GLOBALS "SHC_GLOBALS:" 
    65 #define DD_ERRORS "SHC_ERRORS:" 
    66 #define DD_INPUTS "SHC_MAIN:" 
    67 #define DD_EXTPROG "SHC_EXTPROG:" 
    68  
    69  
    70  
    71 #endif /* BC_VAX */ 
    72 /*=================================================================*/ 
    73 #ifdef BC_SUN 
    74  
    75  
    76  
    7739/* These values are not really needed.  The SH_... environment variables 
    7840 * have precedence over these definitions 
     
    8850#define DD_EXTPROG "/home/geo/ks/shc/util/" 
    8951 
    90  
    91  
    92 #endif /* BC_SUN */ 
    9352/*=================================================================*/ 
  • SH_SHM/trunk/source/shexec.c

    r30 r341  
    33 *      ======== 
    44 * 
    5  * $Revision: 15 $, $Date: 2008-01-25 11:48:08 +0100 (Fr, 25 Jan 2008) $ 
     5 * $Revision: 180 $, $Date: 2011-03-09 16:27:03 +0100 (Mi, 09 MÀr 2011) $ 
    66 * 
    77 * main subroutines of SH 
     
    6767 
    6868 
    69 /* prototype for readk if used */ 
    70 #ifdef SH_SETUP_READK 
    71 void mngrf_readk( PARAM *cmd, STATUS *status ); 
    72 #endif 
    73  
    74  
    75  
    7669/*------------------------------------------------------------------------*/ 
    7770 
     
    10497 
    10598        /* get path names: either from UNIX environment ... */ 
    106 #       ifdef BC_SUN 
    10799        se_get_sh_environment(); 
    108 #       endif 
    109100 
    110101        /* get session ID string */ 
    111102        strcpy( id_shv, SHC_FILE_PREFIX ); 
    112 #       ifdef BC_VAX 
    113103        mt_randomstr( 4, id_shv+SHC_FILE_PREFIX_LENGTH ); 
    114104        strcat( id_shv, "_" ); 
    115 #       endif  /* BC_VAX */ 
    116 #       ifdef BC_SUN 
    117         mt_randomstr( 4, id_shv+SHC_FILE_PREFIX_LENGTH ); 
    118         strcat( id_shv, "_" ); 
    119 #       endif  /* BC_SUN */ 
    120 #       ifdef BC_ATARI 
    121         id_shv[SHC_FILE_PREFIX_LENGTH] = '0'+Nint(4.5+mt_random(5.0)); 
    122         id_shv[SHC_FILE_PREFIX_LENGTH+1] = '\0'; 
    123 #       endif /* BC_ATARI */ 
    124105 
    125106        strcpy( str, shd_scratch ); 
     
    293274                } else if  (cp_cmdverb(cmd,"CUT"))  { 
    294275                        mn3_cut( cmd, status ); 
     276            *redraw = TRUE; 
    295277                } else { 
    296278                        mn0_callproc( cmd, status ); 
     
    372354                        mn3_fold( cmd, status ); 
    373355                        *redraw = TRUE; 
    374 #               ifdef BC_GRFVAX 
    375                 } else if  (cp_cmdverb(cmd,"FOLDN"))  { 
    376                         mngrf_fold( cmd, status ); 
    377                         *redraw = TRUE; 
    378 #               endif /* BC_GRFVAX */ 
    379356                } else { 
    380357                        mn0_callproc( cmd, status ); 
     
    411388                        mn4_int( cmd, status ); 
    412389                        *redraw = TRUE; 
    413 #               ifdef XXX 
    414                 } else if  (cp_cmdverb(cmd,"INVERSE"))  { 
    415                         mngrf_inverse( cmd, status ); 
    416                         *redraw = TRUE; 
    417 #               endif /* XXX */ 
    418390                } else { 
    419391                        mn0_callproc( cmd, status ); 
     
    523495                        mni_readf( cmd, status ); 
    524496                        *redraw = TRUE; 
    525 #ifdef XXX 
    526                 } else if  (cp_cmdverb(cmd,"READG"))  { 
    527                         mn5_readg( cmd, status ); 
    528                         *redraw = TRUE; 
    529 #endif 
    530 #               ifdef SH_SETUP_READK 
    531                 } else if  (cp_cmdverb(cmd,"READK"))  { 
    532                         mngrf_readk( cmd, status ); 
    533                         *redraw = TRUE; 
    534 #               endif /* SH_SETUP_READK */ 
    535497                } else if  (cp_cmdverb(cmd,"READS"))  { 
    536498                        mni_reads( cmd, status ); 
    537499                        *redraw = TRUE; 
    538 #               ifdef BC_GRFVAX 
    539                 } else if  (cp_cmdverb(cmd,"READV"))  { 
    540                         mngrf_readv( cmd, status ); 
    541                         *redraw = TRUE; 
    542                 } else if  (cp_cmdverb(cmd,"READO"))  { 
    543                         mngrf_reado( cmd, status ); 
    544                         *redraw = TRUE; 
    545 #               endif /* BC_GRFVAX */ 
    546500                } else if  (cp_cmdverb(cmd,"REPLACE"))  { 
    547501                        mn5_replace( cmd, status ); 
     
    942896 
    943897 
    944 #ifdef BC_SUN 
    945  
    946  
    947898void se_get_sh_environment( void ) 
    948899 
     
    969920 
    970921 
    971 #endif 
    972  
    973  
    974922 
    975923/*------------------------------------------------------------------------*/ 
  • SH_SHM/trunk/source/shlib.c

    r16 r341  
    213213                case 'S':  *flagbits |= GCF_STDCH;     break; 
    214214                case 'F':  *flagbits |= GCF_FILE;      break; 
    215                 case 'V':  *flagbits |= GCF_VWS;       break; 
    216215                case 'X':  *flagbits |= GCF_XWDW;      break; 
    217                 case 'C':  *flagbits |= GCF_CALCOMP;   break; 
    218                 case 'T':  *flagbits |= GCF_TEK;       break; 
    219216                case 'P':  *flagbits |= GCF_PSF;       break; 
    220                 case 'L':  *flagbits |= GCF_HPGL;      break; 
    221                 case 'D':  *flagbits |= GCF_DJ;        break; 
    222                 case 'G':  *flagbits |= GCF_GEM;       break; 
    223                 case 'B':  *flagbits |= GCF_BGI;       break; 
    224217                case 'E':  *flagbits |= GCF_EXTERN;    break; 
    225218                default: 
     
    866859 
    867860        if  (nomean)  { 
    868 #ifdef XXX 
    869                 /* this is the plain decimation, is not recommended */ 
    870                 ocnt = 0; 
    871                 for  (ncnt=0; ncnt<new_lth; ncnt++)  { 
    872                         new[ncnt] = old[ocnt]; 
    873                         ocnt += decimation; 
    874                         if  (ocnt >= old_lth)  ocnt -= decimation; 
    875                 } /*endfor*/ 
    876 #endif 
    877861                /* take here the maximum value out of the decimation window */ 
    878862                ocnt = 0; 
  • SH_SHM/trunk/source/shmath.c

    r16 r341  
    422422                aez = 0.0;          aen =  sina;          aee = -cosa; 
    423423        } else if  (type == SHC_ROT_ZNE_TO_UVW)  { 
    424 #               ifdef XXX 
    425                 if  (sina != 0.0)   sina = 1.0 / sina; 
    426                 if  (cosa != 0.0)   cosa = 1.0 / cosa; 
    427                 azz = cosa/3.0;     anz = cosa/3.0;       aez = cosa/3.0; 
    428                 azn = 0.;           ann = sina/SQRT3;     aen = -sina/SQRT3; 
    429                 aze = -sina*2.0/3.0;ane = sina/3.0;       aee = sina/3.0; 
    430 #               endif 
    431424                azz = SQRT1_3;      anz = SQRT1_3;        aez = SQRT1_3; 
    432425                azn = 0.0;          ann = SQRT1_2;        aen = -SQRT1_2; 
    433426                aze = -SQRT2_3;     ane = 0.5*SQRT2_3;    aee = 0.5*SQRT2_3; 
    434427        } else if  (type == SHC_ROT_UVW_TO_ZNE)  { 
    435 #               ifdef XXX 
    436                 azz = cosa;         anz = cosa;           aez = cosa; 
    437                 azn = 0.;           ann = sina*SQRT3_2;   aen = -sina*SQRT3_2; 
    438                 aze = -sina;        ane = sina*0.5;       aee = sina*0.5; 
    439 #               endif 
    440428                azz = SQRT1_3;      azn = SQRT1_3;        aze = SQRT1_3; 
    441429                anz = 0.0;          ann = SQRT1_2;        ane = -SQRT1_2; 
     
    733721/*--------------------------------------------------------------------------*/ 
    734722 
    735 #ifdef XXX 
    736  
    737 void mt_fft( long lx, COMPLEX cx[], REAL signi ) 
    738  
    739 /* fast fourier transformation of array "cx" of length "lx" 
    740  * Source code was transferred directly from an old-fashioned 
    741  * FORTRAN routine. 
    742  * 
    743  * parameters of routine 
    744  * long       lx;    input; length of complex array 
    745  * COMPLEX    cx[];  modify; array to be fourier transformed 
    746  * REAL       signi; input; sign of transformation 
    747  */ 
    748 { 
    749         /* local variables */ 
    750         long     i, j, m, l;   /* counters */ 
    751         long     istep; 
    752         REAL     sc; 
    753         COMPLEX  cw, ctemp; 
    754  
    755         /* executable code */ 
    756  
    757         cx--;   /* fortan array start with 1 */ 
    758  
    759         j = 1; 
    760         sc = sqrt( 1.0 / (float)lx ); 
    761         for  (i=1; i<=lx; i++)  { 
    762                 if  (i > j)  goto m2; 
    763                 mt_rmulcmplx( &ctemp, cx+j, sc ); 
    764                 mt_rmulcmplx( cx+j, cx+i, sc ); 
    765                 cx[i] = ctemp; 
    766 m2:   m = lx/2; 
    767 m3:   if  (j <= m)  goto m5; 
    768                 j -= m; 
    769                 m /= 2; 
    770                 if  (m >= 1)  goto m3; 
    771 m5:   j += m; 
    772         } /*endfor*/ 
    773         l = 1; 
    774 m6: istep = 2*l; 
    775         for  (m=1; m<=l; m++)  { 
    776                 mt_imexp( &cw, (SHC_PI * signi * (float)(m-1) / (float)l) ); 
    777                 for  (i=m; i<=lx; i += istep)  { 
    778                         mt_mulcmplx( &ctemp, &cw, cx+i+l ); 
    779                         cx[i+l].re = cx[i].re - ctemp.re; 
    780                         cx[i+l].im = cx[i].im - ctemp.im; 
    781                         cx[i].re += ctemp.re; 
    782                         cx[i].im += ctemp.im; 
    783                 } /*endfor*/ 
    784         } /*endfor*/ 
    785         l = istep; 
    786         if  (l < lx)  goto m6; 
    787  
    788 } /* end of mt_fft */ 
    789  
    790 #endif /* XXX */ 
    791  
    792 /*--------------------------------------------------------------------------*/ 
    793  
    794  
    795723 
    796724void mt_deg_to_km( int listlth, STATLOC lat[], STATLOC lon[], 
     
    814742        /* executable code */ 
    815743 
    816 #ifdef XXX 
    817         /* this was changed at 20-Dec-2004 */ 
    818         /* reference location is first element */ 
    819         ref_lat = *lat; 
    820         ref_lon = *lon; 
    821 #endif 
    822744        /* reference location is last element */ 
    823745        ref_lat = lat[listlth-1]; 
     
    825747 
    826748        while  (listlth-- > 0)  { 
    827                 *x++ = (REAL)((*lon++ - ref_lon) *  
     749                *x++ = (REAL)((*lon++ - ref_lon) * 
    828750                        SHC_DEG_TO_KM * cos((*lat)/SHC_RAD_TO_DEG)); 
    829751                *y++ = (REAL)((*lat++ - ref_lat) * SHC_DEG_TO_KM); 
     
    924846                y[i] -= ymean; 
    925847        } /*endfor*/ 
    926  
    927 #       ifdef SH_DEBUGXXX 
    928         for  (i=0; i<listlth; i++) 
    929                 printf( "--sh-debug->  %f %f %f\n", x[i], y[i], time[i] ); 
    930 #       endif 
    931848 
    932849        tx = ty = tq = 0.0; 
     
    12831200        printf( "--sh-debug-> (err) sx,sy: %f,%f\n", sx, sy ); 
    12841201#       endif 
    1285          
     1202 
    12861203        /* compute center */ 
    12871204        xc = yc = 0.0; 
     
    13061223                xc -= refx; 
    13071224                yc -= refy; 
    1308          
     1225 
    13091226                tx = ty = 0.0; 
    13101227                axx = axy = ayx = ayy = 0.0; 
    1311          
     1228 
    13121229                if  (listlth == 3)  { 
    13131230                        tx = time[1]; 
     
    13271244                        ayx = axy; 
    13281245                } /*endif */ 
    1329          
     1246 
    13301247                /* compute determinant, Cramer's rule */ 
    13311248                det = axx*ayy - axy*ayx; 
     
    13461263 
    13471264                if  (resid != NULL)  *resid++ = dkx; 
    1348          
     1265 
    13491266#               ifdef SH_DEBUG 
    13501267                printf( "--sh-debug-> (ref%02d) dkx: %f, dky: %f\n", refstat, dkx, dky ); 
     
    18181735/*----------------------------------------------------------------------------*/ 
    18191736 
    1820 #ifdef XXX 
    1821  
    1822 void mt_locdiff( REAL lat1, REAL lon1, REAL lat2, REAL lon2, 
    1823         REAL *dist, REAL *azim ) 
    1824  
    1825 /* returns distance in degrees and azimuth of two locations given 
    1826  * by (lat1,lon1) and (lat2,lon2) 
    1827  * 
    1828  * parameters of routine 
    1829  * REAL       lat1, lon1;    input; first location in degrees 
    1830  * REAL       lat2, lon2;    input; second location in degrees 
    1831  * REAL       *dist;         output; distance in degrees 
    1832  * REAL       *azim;         output; azimuth from loc1 to loc2 (in deg) 
    1833  */ 
    1834 { 
    1835         /* local variables */ 
    1836         double     b1, b2, dl, d, alpha; 
    1837  
    1838         /* executable code */ 
    1839  
    1840         b1 = (double)lat1 / SHC_RAD_TO_DEG; 
    1841         b2 = (double)lat2 / SHC_RAD_TO_DEG; 
    1842  
    1843         b1 = BC_PI/2.0 - b1; 
    1844         b2 = BC_PI/2.0 - b2; 
    1845         dl = Abs((double)lon1-(double)lon2) / SHC_RAD_TO_DEG; 
    1846         if  (dl > BC_PI)  dl = 2.0*BC_PI - dl; 
    1847         d = acos( cos(b1)*cos(b2) + sin(b1)*sin(b2)*cos(dl) ); 
    1848         if  (Abs(b1) < SHC_EPSILON  ||  Abs(dl) < SHC_EPSILON)  { 
    1849                 alpha = 0.0; 
    1850         } else { 
    1851                 alpha = acos( (cos(b2)-cos(b1)*cos(d)) / (sin(b1)*sin(d)) ); 
    1852         } /*endif*/ 
    1853  
    1854         *dist = (REAL)(d*SHC_RAD_TO_DEG); 
    1855         *azim = (REAL)((BC_PI/2.0 - alpha)*SHC_RAD_TO_DEG); 
    1856  
    1857 } /* end of mt_locdiff */ 
    1858  
    1859  
    1860  
    1861 /*----------------------------------------------------------------------------*/ 
    1862  
    1863  
    1864  
    1865 void mt_locadd( REAL lat, REAL lon, REAL dist, REAL azim, 
    1866         REAL *latx, REAL *lonx ) 
    1867  
    1868 /* computes location (*latx,*lonx) from point (lat,lon) and 
    1869  * a distance "dist" in direction "azim" 
    1870  * 
    1871  * parameters of routine 
    1872  * REAL       lat, lon;      input; input location in degrees 
    1873  * REAL       dist;          input; distance in degrees 
    1874  * REAL       azim;          input; direction 
    1875  * REAL       *latx, *lonx;  output; output location 
    1876  */ 
    1877 { 
    1878         /* local variables */ 
    1879         double   b, d, bx, cosbx, alpha, sinbx, sinb, dl; 
    1880  
    1881         /* executable code */ 
    1882  
    1883         b = BC_PI/2.0 - (double)lat/SHC_RAD_TO_DEG; 
    1884         d = (double)dist / SHC_RAD_TO_DEG; 
    1885         alpha = BC_PI/2.0 - (double)azim/SHC_RAD_TO_DEG; 
    1886  
    1887         sinb = sin(b); 
    1888         cosbx = cos(b)*cos(d) + sinb*sin(d)*cos(alpha); 
    1889         sinbx = sqrt( 1.0 - cosbx*cosbx ); 
    1890  
    1891         if  (Abs(sinbx) < SHC_EPSILON)  { 
    1892                 bx = 0.0; 
    1893                 dl = 0.0; 
    1894         } else if  (Abs(sinb) < SHC_EPSILON)  { 
    1895                 bx = d; 
    1896                 dl = 0.0; 
    1897         } else { 
    1898                 dl = acos( (cos(d) - cos(b)*cosbx) / (sinbx*sinb) ); 
    1899                 bx = acos( cosbx ); 
    1900         } /*endif*/ 
    1901  
    1902         bx = BC_PI/2.0 - bx; 
    1903         dl += (double)lon/SHC_RAD_TO_DEG; 
    1904  
    1905         *latx = (REAL)(bx*SHC_RAD_TO_DEG); 
    1906         *lonx = (REAL)(dl*SHC_RAD_TO_DEG); 
    1907  
    1908 } /* end of mt_locadd */ 
    1909  
    1910 #endif 
    1911  
    1912 /*----------------------------------------------------------------------------*/ 
    1913  
    1914  
    19151737 
    19161738void mt_fit_gauss( REAL x[], SAMPLE y[], int ndata, REAL ampl, 
    19171739        int maxiter, REAL *pos, REAL *width, int *iter, STATUS *status ) 
    19181740 
    1919 /* fits a gauss function of position "*pos" and width "*width" to  
     1741/* fits a gauss function of position "*pos" and width "*width" to 
    19201742 * the data given in x[0..ndata-1] and y[0..ndata-]. 
    19211743 * 
     
    22612083 
    22622084 
    2263 void mt_fix_gap( SAMPLE dat[], long lth, REAL const_value, BOOLEAN konst,  
     2085void mt_fix_gap( SAMPLE dat[], long lth, REAL const_value, BOOLEAN konst, 
    22642086               BOOLEAN one) 
    22652087 
     
    23062128                                next_value = dat[s]; 
    23072129                                if (start_cnt==0) last_value=next_value; 
    2308                                 slope=(next_value - last_value)/(REAL)(value_counter+1);  
     2130                                slope=(next_value - last_value)/(REAL)(value_counter+1); 
    23092131                                if (konst) { 
    23102132                                        slope=0.0; 
    2311                                         last_value=(next_value + last_value)/2.0;  
     2133                                        last_value=(next_value + last_value)/2.0; 
    23122134                                }  /*endif*/ 
    23132135            if (value_counter> (int) !one) 
    2314                                         for (i=0; i<value_counter; i++)  
     2136                                        for (i=0; i<value_counter; i++) 
    23152137                                                dat[start_cnt++] = last_value + (REAL)(i+1)*slope; 
    23162138                                value_counter = 0; 
     
    23362158                if (konst) { 
    23372159                        slope=0.0; 
    2338                         last_value=(next_value + last_value)/2.0;  
     2160                        last_value=(next_value + last_value)/2.0; 
    23392161                }  /*endif*/ 
    23402162      if (value_counter> (int) !one) 
  • SH_SHM/trunk/source/shmenu0.c

    r16 r341  
    273273                        printf( 
    274274                                "*SH: obsolete command PATH COMMAND2, consider using string list in COMMAND path\n" ); 
    275                         printf(  
     275                        printf( 
    276276                                "*SH: translated in FCT PATH COMMAND |.|,|$SH_COMMAND|,|%s|\n", s_par ); 
    277277                        if  (strlen(s_par) > cBcLongStrLth-14)  { 
     
    513513                if  (*status != SHE_NOERROR)  return; 
    514514                strcpy( str, "UNKNOWN" ); 
    515 #               ifdef BC_VAX 
    516                 strcpy( str, "VAX-VMS" ); 
    517 #               endif 
    518 #               ifdef BC_SUN 
    519515                strcpy( str, "UNIX" ); 
    520 #               endif 
    521 #               ifdef BC_ATARI 
    522                 strcpy( str, "ATARI-TOS" ); 
    523 #               endif 
    524 #               ifdef BC_IBM 
    525                 strcpy( str, "MS-DOS" ); 
    526 #               endif 
    527516                sl_setsymbol( str2, str, &locstat ); 
    528517        } else if  (strcmp(str,"OSCALL") == 0)  { 
     
    548537                sl_setsymbol( str2, str, &locstat );  /* save output if possible */ 
    549538        } else { 
    550 #ifdef XXX 
    551                 *status = SHE_UKFCT; 
    552                 err_setcontext( " ## subfct " ); err_setcontext( str ); 
    553 #endif 
    554539                printf( "*SH: illegal fct item %s\n", str ); 
    555540        } /*endif*/ 
  • SH_SHM/trunk/source/shmenu3.c

    r16 r341  
    470470                sprintf( str, "%e", res ); 
    471471                sl_setsymbol( symbol, str, status ); 
    472                 if  (Severe(status))  return;            
     472                if  (Severe(status))  return; 
    473473        } else { 
    474474                *status = SHE_UKKEY; 
     
    639639 
    640640                /* perform filtering */ 
    641                 mt_fold( itrclth, (SAMPLE *)db_getp(trc[t],EP_DATA,NULL)+loidx,  
     641                mt_fold( itrclth, (SAMPLE *)db_getp(trc[t],EP_DATA,NULL)+loidx, 
    642642                        flth, db_getp(fil,EP_DATA,NULL), datptr ); 
    643643 
     
    10991099        start -= loff; 
    11001100        trclth += roff+loff; 
    1101         mt_mend( start, trclth, loff, roff, widening,  
     1101        mt_mend( start, trclth, loff, roff, widening, 
    11021102                db_getr(trc,ER_DELTA,NULL), pol, status ); 
    11031103 
     
    12571257                *mov++ = 0.; 
    12581258 
    1259 #       ifdef XXX 
    1260         for  (i=0; i<outlth; ccr[i++] = 0.) {} 
    1261         ccr[t0] = 1.0; 
    1262 #       endif 
    1263  
    12641259        mt_levinson( ac, ccr, f, outlth, status ); 
    12651260        if  (Severe(status))  { 
  • SH_SHM/trunk/source/shmenu4.c

    r70 r341  
    441441 
    442442 
    443   
     443 
    444444/*--------------------------------------------------------------------*/ 
    445445 
     
    12151215                /* compute FFT */ 
    12161216                nr_spctrm( smp-1, datptr-1, m, k, overlap ); 
    1217                 /*         ^--- this is ok, I made it compatible to other     */  
     1217                /*         ^--- this is ok, I made it compatible to other     */ 
    12181218                /*              array arguments                               */ 
    12191219                /*              originally this data array was read from file */ 
    12201220 
    1221 #ifdef XXX 
    1222                 /* normalization */ 
    1223                 tmp = (float)trclth; 
    1224                 for  (i=0; i<m; i++)  { 
    1225                         datptr[i] *= tmp; 
    1226                         if  (datptr[i] >= 0)  { 
    1227                                 datptr[i] = sqrt( datptr[i] ) * dt; 
    1228                         } else { 
    1229                                 datptr[i] = 0.0; 
    1230                         } /*endif*/ 
    1231                 } /*endfor*/ 
    1232 #endif 
    12331221 
    12341222                /* initialise trace parameters */ 
  • SH_SHM/trunk/source/shmenu5.c

    r16 r341  
    6161 
    6262/* global variables */ 
    63 #ifdef XXX 
    64 SHT_GLOBAL_SET *mn5v_global=NULL;      /* for use in motif version only */ 
    65 #endif 
    6663void (*mn5v_external_routine)( char cmd[], STATUS *status)=NULL; 
    6764        /* external routine */ 
     
    410407/*----------------------------------------------------------------------------*/ 
    411408 
    412 #ifdef XXX 
    413  
    414 void mn5_readg( PARAM *par, STATUS *status ) 
    415  
    416 /* reads traces from GRN files 
    417  * par 1:  device 
    418  * par 2:  start time 
    419  * par 3:  length in seconds 
    420  * par 4:  station list 
    421  * par 5:  component list 
    422  * par 6:  sample rate 
    423  * 
    424  * parameters of routine 
    425  * PARAM    *par;           input; command parameter 
    426  * int      *status;        output; return status 
    427  */ 
    428 { 
    429         /* local variables */ 
    430         char     device[BC_FILELTH+1];     /* device name */ 
    431         char     tstart[BC_LINELTH+1];     /* start time */ 
    432         REAL     seclength;                /* length in seconds */ 
    433         char     statlist[BC_LINELTH+1];   /* station list */ 
    434         char     cmpl[BC_SHORTSTRLTH+1];   /* component list */ 
    435         int      smprate;                  /* sample rate */ 
    436         char     stations[GRNC_MAXSTATION][GRNC_STATNAMELTH+1]; /*station list*/ 
    437         int      statno;                   /* number of stations */ 
    438         int      cmpno;                    /* number of components */ 
    439         int      s, c;                     /* station and component counters */ 
    440         char     label[BC_FILELTH+1];      /* volume label */ 
    441         long     length;                   /* length of trace in samples */ 
    442         long     *ldatptr;                 /* pointer to data array */ 
    443         GRN_TRCINFO inf;                   /* trace info */ 
    444         float    *fdat;                    /* floating array pointer */ 
    445         long     i, j;                     /* counters */ 
    446         TRACE    *trc;                     /* trace pointer */ 
    447         TIME     atime;                    /* absolute start time */ 
    448         char     msg[BC_LINELTH+1];        /* error message */ 
    449         BOOLEAN  swap;                     /* swap data bytes */ 
    450         int      firstrec;                 /* first records */ 
    451         char     grnfile[BC_FILELTH+1];    /* specified file name */ 
    452  
    453         /* executable code */ 
    454  
    455         /* get parameters */ 
    456         if  (cp_pnexc(par,6,status))  return; 
    457         cp_getstr( par, 1, tc, "  device: ", BC_FILELTH, device, status ); 
    458         if  (Severe(status))  return; 
    459         cp_getstr( par, 2, tc, "  start time: ", BC_LINELTH, tstart, status ); 
    460         if  (Severe(status))  return; 
    461         cp_getfloat( par, 3, tc, "  length in seconds: ", &seclength, status ); 
    462         if  (Severe(status))  return; 
    463         cp_getstr( par, 4, tc, "  station list: ", BC_LINELTH, statlist, status ); 
    464         if  (Severe(status))  return; 
    465         cp_getstr( par, 5, tc, "  comp list: ", BC_SHORTSTRLTH, cmpl, status ); 
    466         if  (Severe(status))  return; 
    467         cp_getint( par, 6, tc, "  sample rate: ", &smprate, status ); 
    468         if  (Severe(status))  return; 
    469  
    470         swap = TRUE;   /* default */ 
    471         if  (cp_qexist(par,"NOSWAP"))  swap = FALSE; 
    472         if  (cp_qexist(par,"SWAP"))  swap = TRUE; 
    473         if  (!sl_quals(par,"FILE",BC_FILELTH,grnfile,status)) 
    474                 *grnfile = '\0'; 
    475         if  (Severe(status))  return; 
    476         if  (!sl_quali(par,"FIRST",&firstrec,status)) 
    477                 firstrec = -1; 
    478         if  (Severe(status))  return; 
    479  
    480         if  (cp_qexist(par,"CURRENT") || *grnfile != '\0')  { 
    481                 *label = '\0'; 
    482         } else if  (!sl_quals(par,"LABEL",BC_FILELTH,label,status))  { 
    483                 if  (Severe(status))  return; 
    484                 grn_getlabel( tstart, BC_FILELTH, label, status ); 
    485                 if  (*status == GRNE_LABNOTIME)  { 
    486                         if  (SHF_CHATTY & shflags_shv) 
    487                                 printf( "%s no WORM available, try disk %s\n", 
    488                                         SHC_CHATTXT, device ); 
    489                         *label = '\0'; 
    490                         *status = BC_NOERROR; 
    491                 } else { 
    492 #                       ifdef BC_SUN 
    493                         *status = BC_NOERROR; 
    494 #                       else 
    495                         if  (Severe(status))  return; 
    496 #                       endif 
    497                         if  (SHF_CHATTY & shflags_shv) 
    498                                 printf( "%s label is %s\n", SHC_CHATTXT, label ); 
    499                 } /*endif*/ 
    500         } /*endif*/ 
    501  
    502         grn_parse_stations( statlist, stations, &statno ); 
    503         ut_cap( cmpl ); 
    504         cmpno = (int)strlen( cmpl ); 
    505         db_newlist(); 
    506  
    507         /* remove commas from component list */ 
    508         j = 0; 
    509         for  (i=0; i<cmpno; i++)  { 
    510                 if  (cmpl[i] != ',') 
    511                         if  (i == j)  { 
    512                                 j++; 
    513                         } else { 
    514                                 cmpl[j++] = cmpl[i]; 
    515                         } /*endif*/ 
    516         } /*endfor*/ 
    517         cmpl[j] = '\0'; 
    518         cmpno = (int)j; 
    519  
    520         if  (*grnfile != '\0' && (statno != 1 || cmpno != 1))  { 
    521                 gc_write( cc, "*** only 1 station and 1 component makes sense ***\n" ); 
    522                 return; 
    523         } /*endif*/ 
    524  
    525         for  (s=0; s<statno; s++)  { 
    526                 for  (c=0; c<cmpno; c++)  { 
    527                         if  (cmpl[c] == 'N' || cmpl[c] == 'E')  { 
    528                                 if  (strcmp(stations[s],"GRA2") == 0)  continue; 
    529                                 if  (strcmp(stations[s],"GRA3") == 0)  continue; 
    530                                 if  (strcmp(stations[s],"GRA4") == 0)  continue; 
    531                                 /*if  (strcmp(stations[s],"GRB2") == 0)  continue;*/ 
    532                                 if  (strcmp(stations[s],"GRB3") == 0)  continue; 
    533                                 if  (strcmp(stations[s],"GRB4") == 0)  continue; 
    534                                 if  (strcmp(stations[s],"GRB5") == 0)  continue; 
    535                                 /*if  (strcmp(stations[s],"GRC2") == 0)  continue;*/ 
    536                                 if  (strcmp(stations[s],"GRC3") == 0)  continue; 
    537                                 if  (strcmp(stations[s],"GRC4") == 0)  continue; 
    538                         } /*endif*/ 
    539                         if  (SHF_CHATTY & shflags_shv) 
    540                                 printf( "%s reading %s-%c ",  /* no cr/lf */ 
    541                                         SHC_CHATTXT, stations[s], cmpl[c] ); 
    542                         if  (*grnfile == '\0')  { 
    543                                 grn_read( device, label, tstart, seclength, stations[s], 
    544                                         cmpl[c], smprate, swap, &length, &ldatptr, 
    545                                         &inf, status ); 
    546                         } else { 
    547                                 grn_readfile( grnfile, tstart, seclength, swap, 
    548                                         firstrec, &length, &ldatptr, &inf, status ); 
    549                         } /*endif*/ 
    550                         if  (Severe(status))  { 
    551                                 err_msg( *status, msg ); gc_write( cc, "\n" ); 
    552                                 gc_write( cc, msg ); gc_write( cc, "\n" ); 
    553                                 length = 0; 
    554                                 *status = BC_NOERROR; 
    555                         } /*endif*/ 
    556                         if  (length > 0)  { 
    557                                 /* copy to real array */ 
    558                                 fdat = (float *)ldatptr; 
    559                                 for  (i=0; i<length; i++) 
    560                                         fdat[i] = (float)ldatptr[i] * inf.calib; 
    561                                 trc = db_create( status ); 
    562                                 if  (Severe(status))  return; 
    563                                 ml_inittrc( trc, fdat, length, inf.dt ); 
    564                                 ut_cap( inf.station ); 
    565                                 db_sets( trc, ES_STATION, inf.station, NULL ); 
    566                                 db_setc( trc, EC_COMP, cmpl[c], NULL ); 
    567                                 tc_t2a( inf.tstart, &atime, status ); 
    568                                 if  (Severe(status))  return; 
    569                                 db_sett( trc, ET_START, &atime, status ); 
    570                                 if  (Severe(status))  return; 
    571                                 db_setr( trc, ER_TORIG, 0.0, NULL ); 
    572                                 db_sets( trc, ES_FILE, "FROM-GRN-FILE", NULL ); 
    573                                 db_seti( trc, EI_RECNO, 0, NULL ); 
    574                                 db_setf( trc, EF_MODIF, FALSE, NULL ); 
    575                                 db_setf( trc, EF_FROMQ, FALSE, NULL ); 
    576                                 db_setr( trc, ER_CALIB, inf.calib, status ); 
    577                                 if  (Severe(status))  return; 
    578                                 sprintf( msg, "%f", inf.calib ); 
    579                                 db_sets( trc, ES_OPINFO, msg, status ); 
    580                                 if  (Severe(status))  return; 
    581                         } /*endif*/ 
    582                 } /*endfor*/ 
    583         } /*endfor*/ 
    584  
    585 } /* end of mn5_readg */ 
    586  
    587 #endif 
    588  
    589 /*----------------------------------------------------------------------------*/ 
    590  
    591  
    592  
    593409void mn5_decimate( PARAM *par, STATUS *status ) 
    594410 
     
    949765/*--------------------------------------------------------------------*/ 
    950766 
    951 #ifdef XXX 
    952  
    953 void mn5_set_shmsetup_pointer( SHT_GLOBAL_SET *ptr ) 
    954  
    955 /* special routine to set pointer to global variable of motif modules 
    956  * 
    957  * parameters of routine 
    958  * SHT_GLOBAL_SET *ptr;      input; specifies address of global paramters 
    959  */ 
    960 { 
    961         /* executable code */ 
    962  
    963         mn5v_global = ptr; 
    964  
    965 } /* end of mn5_shmsetup_pointer */ 
    966  
    967 #endif 
    968  
    969 /*--------------------------------------------------------------------*/ 
    970  
    971  
    972  
    973767void mn5_shmsetup( PARAM *par, STATUS *status ) 
    974768 
     
    982776 */ 
    983777{ 
    984         /* local variables */ 
    985 #ifdef XXX 
    986         char     item[BC_LINELTH+1];    /* item name */ 
    987         char     str[BC_LINELTH+1];     /* scratch string */ 
    988         char     path[BC_FILELTH+1];    /* path name */ 
    989         int      itmp;                  /* scratch */ 
    990 #endif 
    991  
    992778        /* executable code */ 
    993779 
    994780        printf( "*SHM: command SHMSETUP obsolete, please use 'Configure' instead\n" ); 
    995781        return; 
    996  
    997 #ifdef XXX 
    998         if  (mn5v_global == NULL)  { 
    999                 *status = SHE_NOTIMPL; 
    1000                 return; 
    1001         } /*endif*/ 
    1002  
    1003         if  (cp_pnexc(par,2,status))  return; 
    1004         cp_getstr( par, 1, tc, "   item name :", BC_LINELTH, item, status ); 
    1005         if  (Severe(status))  return; 
    1006  
    1007         if  (strcmp(item,"DEPTH_PHASE_LIST") == 0)  { 
    1008                 cp_getstr( par, 2, tc, "   phase list: ", BC_LINELTH, str, status ); 
    1009                 if  (Severe(status))  return; 
    1010                 if  (strchr(str,' ') != NULL)  { 
    1011                         *status = SHE_ILPAR; 
    1012                         return; 
    1013                 } /*endif*/ 
    1014                 strcpy( mn5v_global->depth_phase_list, str ); 
    1015         } else if  (strcmp(item,"THEO_PHASE_LIST") == 0)  { 
    1016                 cp_getstr( par, 2, tc, "   phase list: ", BC_LINELTH, str, status ); 
    1017                 if  (Severe(status))  return; 
    1018                 if  (strchr(str,' ') != NULL)  { 
    1019                         *status = SHE_ILPAR; 
    1020                         return; 
    1021                 } /*endif*/ 
    1022                 strcpy( mn5v_global->theo_phase_list, str ); 
    1023         } else if  (strcmp(item,"DIFF_PHASE_LIST") == 0)  { 
    1024                 cp_getstr( par, 2, tc, "   phase list: ", BC_LINELTH, str, status ); 
    1025                 if  (Severe(status))  return; 
    1026                 if  (strchr(str,' ') != NULL)  { 
    1027                         *status = SHE_ILPAR; 
    1028                         return; 
    1029                 } /*endif*/ 
    1030                 strcpy( mn5v_global->diff_phase_list, str ); 
    1031         } else if  (strcmp(item,"CLOSE_PHASE_RESOL") == 0)  { 
    1032                 cp_getfloat( par, 2, tc, "   resol. in pixels: ", 
    1033                         &(mn5v_global->close_phase_resol), status ); 
    1034         } else if  (strcmp(item,"MIN_DRAG_BOX_WIDTH") == 0)  { 
    1035                 cp_getint( par, 2, tc, "   width in pixels: ", 
    1036                         &(mn5v_global->min_drag_box_width), status ); 
    1037         } else if  (strcmp(item,"DEFPATH_FILTER") == 0)  { 
    1038                 cp_getstr( par, 2, tc, "   path name: ", BC_FILELTH, path, status ); 
    1039                 if  (Severe(status))  return; 
    1040                 strcpy( mn5v_global->defpath_filter, path ); 
    1041         } else if  (strcmp(item,"DEFPATH_EVENTS") == 0)  { 
    1042                 cp_getstr( par, 2, tc, "   path name: ", BC_FILELTH, path, status ); 
    1043                 if  (Severe(status))  return; 
    1044                 strcpy( mn5v_global->defpath_events, path ); 
    1045         } else if  (strcmp(item,"DEFPATH_GSE") == 0)  { 
    1046                 cp_getstr( par, 2, tc, "   path name: ", BC_FILELTH, path, status ); 
    1047                 if  (Severe(status))  return; 
    1048                 strcpy( mn5v_global->defpath_gse, path ); 
    1049         } else if  (strcmp(item,"DEFPATH_GSE2") == 0)  { 
    1050                 cp_getstr( par, 2, tc, "   path name: ", BC_FILELTH, path, status ); 
    1051                 if  (Severe(status))  return; 
    1052                 strcpy( mn5v_global->defpath_gse2, path ); 
    1053         } else if  (strcmp(item,"DEFPATH_AH") == 0)  { 
    1054                 cp_getstr( par, 2, tc, "   path name: ", BC_FILELTH, path, status ); 
    1055                 if  (Severe(status))  return; 
    1056                 strcpy( mn5v_global->defpath_ah, path ); 
    1057         } else if  (strcmp(item,"DEFPATH_Q") == 0)  { 
    1058                 cp_getstr( par, 2, tc, "   path name: ", BC_FILELTH, path, status ); 
    1059                 if  (Severe(status))  return; 
    1060                 strcpy( mn5v_global->defpath_q, path ); 
    1061         } else if  (strcmp(item,"DEFPATH_EVID") == 0)  { 
    1062                 cp_getstr( par, 2, tc, "   path name: ", BC_FILELTH, path, status ); 
    1063                 if  (Severe(status))  return; 
    1064                 strcpy( mn5v_global->defpath_evid, path ); 
    1065         } else if  (strcmp(item,"DEFPATH_EVTOUT") == 0)  { 
    1066                 cp_getstr( par, 2, tc, "   path name: ", BC_FILELTH, path, status ); 
    1067                 if  (Severe(status))  return; 
    1068                 strcpy( mn5v_global->defpath_evtout, path ); 
    1069         } else if  (strcmp(item,"DEFPATH_DATA") == 0)  { 
    1070                 cp_getstr( par, 2, tc, "   path name: ", BC_FILELTH, path, status ); 
    1071                 if  (Severe(status))  return; 
    1072                 strcpy( mn5v_global->defpath_data, path ); 
    1073         } else if  (strcmp(item,"TOP_DOWN_ORDER") == 0)  { 
    1074                 cp_getstr( par, 2, tc, "   TRUE/FALSE: ", BC_LINELTH, str, status ); 
    1075                 if  (Severe(status))  return; 
    1076                 if  (strcmp(str,"TRUE") == 0)  { 
    1077                         mn5v_global->top_down_order = TRUE; 
    1078                 } else if  (strcmp(str,"FALSE") == 0)  { 
    1079                         mn5v_global->top_down_order = FALSE; 
    1080                 } else { 
    1081                         *status = SHE_ILPAR; 
    1082                         return; 
    1083                 } /*endif*/ 
    1084         } else if  (strcmp(item,"DOUBLE_CLICK_TIME") == 0)  { 
    1085                 cp_getint( par, 2, tc, "   time in ms: ", &itmp, status ); 
    1086                 mn5v_global->double_click_time = (long)itmp; 
    1087         } else if  (strcmp(item,"TRACE_ZOOM_BASE") == 0)  { 
    1088                 cp_getfloat( par, 2, tc, "   base: ", 
    1089                         &(mn5v_global->trace_zoom_base), status ); 
    1090         } else if  (strcmp(item,"TRACE_ZOOM_EXP") == 0)  { 
    1091                 cp_getfloat( par, 2, tc, "   exponent: ", 
    1092                         &(mn5v_global->trace_zoom_exp), status ); 
    1093         } else if  (strcmp(item,"COLOR_MARK") == 0)  { 
    1094                 cp_getstr( par, 2, tc, "   color values: ", BC_LINELTH, str, status ); 
    1095                 if  (Severe(status))  return; 
    1096                 if  (strchr(str,' ') != NULL)  { 
    1097                         *status = SHE_ILPAR; 
    1098                         return; 
    1099                 } /*endif*/ 
    1100                 if  (sscanf(str,"%f,%f,%f",&(mn5v_global->color_mark.red), 
    1101                         &(mn5v_global->color_mark.green),&(mn5v_global->color_mark.blue)) != 3) 
    1102                         *status = SHE_REALCNV; 
    1103         } else if  (strcmp(item,"COLOR_THEO") == 0)  { 
    1104                 cp_getstr( par, 2, tc, "   color values: ", BC_LINELTH, str, status ); 
    1105                 if  (Severe(status))  return; 
    1106                 if  (strchr(str,' ') != NULL)  { 
    1107                         *status = SHE_ILPAR; 
    1108                         return; 
    1109                 } /*endif*/ 
    1110                 if  (sscanf(str,"%f,%f,%f",&(mn5v_global->color_theo.red), 
    1111                         &(mn5v_global->color_theo.green),&(mn5v_global->color_theo.blue)) != 3) 
    1112                         *status = SHE_REALCNV; 
    1113         } else if  (strcmp(item,"COLOR_AUTO") == 0)  { 
    1114                 cp_getstr( par, 2, tc, "   color values: ", BC_LINELTH, str, status ); 
    1115                 if  (Severe(status))  return; 
    1116                 if  (strchr(str,' ') != NULL)  { 
    1117                         *status = SHE_ILPAR; 
    1118                         return; 
    1119                 } /*endif*/ 
    1120                 if  (sscanf(str,"%f,%f,%f",&(mn5v_global->color_auto.red), 
    1121                         &(mn5v_global->color_auto.green),&(mn5v_global->color_auto.blue)) != 3) 
    1122                         *status = SHE_REALCNV; 
    1123         } else if  (strcmp(item,"COLOR_CRSR") == 0)  { 
    1124                 cp_getstr( par, 2, tc, "   color values: ", BC_LINELTH, str, status ); 
    1125                 if  (Severe(status))  return; 
    1126                 if  (strchr(str,' ') != NULL)  { 
    1127                         *status = SHE_ILPAR; 
    1128                         return; 
    1129                 } /*endif*/ 
    1130                 if  (sscanf(str,"%f,%f,%f",&(mn5v_global->color_crsr.red), 
    1131                         &(mn5v_global->color_crsr.green),&(mn5v_global->color_crsr.blue)) != 3) 
    1132                         *status = SHE_REALCNV; 
    1133         } else if  (strcmp(item,"REFSTATION") == 0)  { 
    1134                 cp_getstr( par, 2, tc, "   reference station: ", BC_LINELTH, str, status); 
    1135                 if  (Severe(status))  return; 
    1136                 if  (strlen(str) > BC_SHORTSTRLTH)  { 
    1137                         *status = SHE_STROVFL; 
    1138                         return; 
    1139                 } /*endif*/ 
    1140                 strcpy( mn5v_global->refstation, str ); 
    1141         } else if  (strcmp(item,"AUTOPICK_FIRST") == 0)  { 
    1142                 cp_getstr( par, 2, tc, "   TRUE/FALSE: ", BC_LINELTH, str, status ); 
    1143                 if  (Severe(status))  return; 
    1144                 if  (strcmp(str,"TRUE") == 0)  { 
    1145                         mn5v_global->autopick_first = TRUE; 
    1146                 } else if  (strcmp(str,"FALSE") == 0)  { 
    1147                         mn5v_global->autopick_first = FALSE; 
    1148                 } else { 
    1149                         *status = SHE_ILPAR; 
    1150                         return; 
    1151                 } /*endif*/ 
    1152         } else if  (strcmp(item,"CALIB_WDW_WIDTH") == 0)  { 
    1153                 cp_getfloat( par, 2, tc, "   calib wdw width: ", 
    1154                         &(mn5v_global->calib_wdw_width), status ); 
    1155         } else if  (strcmp(item,"CALIB_WDW_HEIGHT") == 0)  { 
    1156                 cp_getfloat( par, 2, tc, "   calib wdw height: ", 
    1157                         &(mn5v_global->calib_wdw_height), status ); 
    1158         } else if  (strcmp(item,"CALIB_SLOWNESS_GRID") == 0)  { 
    1159                 cp_getfloat( par, 2, tc, "   calib slowness grid: ", 
    1160                         &(mn5v_global->calib_slowness_grid), status ); 
    1161         } else if  (strcmp(item,"CALIB_AZIMUTH_GRID") == 0)  { 
    1162                 cp_getfloat( par, 2, tc, "   calib azimuth grid: ", 
    1163                         &(mn5v_global->calib_azimuth_grid), status ); 
    1164         } else if  (strcmp(item,"AUTO_SCALING") == 0)  { 
    1165                 cp_getstr( par, 2, tc, "   TRUE/FALSE: ", BC_LINELTH, str, status ); 
    1166                 if  (Severe(status))  return; 
    1167                 if  (strcmp(str,"TRUE") == 0)  { 
    1168                         mn5v_global->auto_scaling = TRUE; 
    1169                 } else if  (strcmp(str,"FALSE") == 0)  { 
    1170                         mn5v_global->auto_scaling = FALSE; 
    1171                 } else { 
    1172                         *status = SHE_ILPAR; 
    1173                         return; 
    1174                 } /*endif*/ 
    1175         } else if  (strcmp(item,"USE_REC_FILTERS") == 0)  { 
    1176                 cp_getstr( par, 2, tc, "   TRUE/FALSE: ", BC_LINELTH, str, status ); 
    1177                 if  (Severe(status))  return; 
    1178                 if  (strcmp(str,"TRUE") == 0)  { 
    1179                         mn5v_global->use_rec_filters = TRUE; 
    1180                 } else if  (strcmp(str,"FALSE") == 0)  { 
    1181                         mn5v_global->use_rec_filters = FALSE; 
    1182                 } else { 
    1183                         *status = SHE_ILPAR; 
    1184                         return; 
    1185                 } /*endif*/ 
    1186         } else if  (strcmp(item,"ANALYST") == 0)  { 
    1187                 cp_getstr( par, 2, tc, "   analyst: ", BC_LINELTH, str, status); 
    1188                 if  (Severe(status))  return; 
    1189                 if  (strlen(str) > BC_SHORTSTRLTH)  { 
    1190                         *status = SHE_STROVFL; 
    1191                         return; 
    1192                 } /*endif*/ 
    1193                 strcpy( mn5v_global->analyst, str ); 
    1194         } else if  (strcmp(item,"EDIT_CMD") == 0)  { 
    1195                 cp_getstr( par, 2, tc, "   edit_cmd: ", BC_LINELTH, str, status); 
    1196                 if  (Severe(status))  return; 
    1197                 strcpy( mn5v_global->edit_cmd, str ); 
    1198                 if  (strncmp(mn5v_global->edit_cmd,"DEFAULT",7) == 0 
    1199                         || strncmp(mn5v_global->edit_cmd,"default",7) == 0)  { 
    1200                         /* local variables */ 
    1201                         char *env;      /* pointer to environment variable */ 
    1202                         /* executable code */ 
    1203                         env = getenv( "SH_TEXTEDIT" ); 
    1204                         if  (env != NULL && strlen(env) < cBcLineLth-3) 
    1205                                 sprintf( mn5v_global->edit_cmd, "%s %%s", env ); 
    1206                 } /*endif*/ 
    1207         } else if  (strcmp(item,"PROMPT_ANALYST") == 0)  { 
    1208                 cp_getstr( par, 2, tc, "   TRUE/FALSE: ", BC_LINELTH, str, status ); 
    1209                 if  (Severe(status))  return; 
    1210                 if  (strcmp(str,"TRUE") == 0)  { 
    1211                         mn5v_global->prompt_analyst = TRUE; 
    1212                 } else if  (strcmp(str,"FALSE") == 0)  { 
    1213                         mn5v_global->prompt_analyst = FALSE; 
    1214                 } else { 
    1215                         *status = SHE_ILPAR; 
    1216                         return; 
    1217                 } /*endif*/ 
    1218         } else if  (strcmp(item,"MOTIF_LOG") == 0)  { 
    1219                 cp_getstr( par, 2, tc, "   motif log: ", BC_LINELTH, str, status); 
    1220                 if  (Severe(status))  return; 
    1221                 if  (strlen(str) > BC_FILELTH)  { 
    1222                         *status = SHE_STROVFL; 
    1223                         return; 
    1224                 } /*endif*/ 
    1225                 strcpy( mn5v_global->motif_log, str ); 
    1226         } else if  (strcmp(item,"PHASE_AMPL_DIFF") == 0)  { 
    1227                 cp_getfloat( par, 2, tc, "   phase-ampl diff (sec): ", 
    1228                         &(mn5v_global->phase_ampl_diff), status ); 
    1229         } else if  (strcmp(item,"REVERSE_XORS") == 0)  { 
    1230                 cp_getstr( par, 2, tc, "   TRUE/FALSE: ", BC_LINELTH, str, status ); 
    1231                 if  (Severe(status))  return; 
    1232                 if  (strcmp(str,"TRUE") == 0)  { 
    1233                         mn5v_global->reverse_xors = TRUE; 
    1234                 } else if  (strcmp(str,"FALSE") == 0)  { 
    1235                         mn5v_global->reverse_xors = FALSE; 
    1236                 } else { 
    1237                         *status = SHE_ILPAR; 
    1238                         return; 
    1239                 } /*endif*/ 
    1240         } else if  (strcmp(item,"X_MAX_DRAWLTH") == 0)  { 
    1241                 cp_getint( par, 2, tc, "   max draw length: ", 
    1242                         &(mn5v_global->x_max_drawlth), status ); 
    1243         } else if  (strcmp(item,"DEFAULT_QUALITY") == 0)  { 
    1244                 cp_getint( par, 2, tc, "   default quality: ", 
    1245                         &(mn5v_global->default_quality), status ); 
    1246                 if  (mn5v_global->default_quality < 1)  mn5v_global->default_quality = 1; 
    1247                 if  (mn5v_global->default_quality > 9)  mn5v_global->default_quality = 9; 
    1248         } else if  (strcmp(item,"DRAG_BOX_RUBBER_VAL") == 0)  { 
    1249                 cp_getint( par, 2, tc, "   drag box rubber val: ", 
    1250                         &(mn5v_global->drag_box_rubber_val), status ); 
    1251         } else if  (strcmp(item,"DEFAULT_FILTER") == 0)  { 
    1252                 cp_getstr( par, 2, tc, "   default_filter: ", BC_LINELTH, str, status); 
    1253                 if  (Severe(status))  return; 
    1254                 if  (strlen(str) > BC_FILELTH)  { 
    1255                         *status = SHE_STROVFL; 
    1256                         return; 
    1257                 } /*endif*/ 
    1258                 strcpy( mn5v_global->default_filter, str ); 
    1259         } else if  (strcmp(item,"DEFAULT_PHASE_TYPE") == 0)  { 
    1260                 cp_getstr( par, 2, tc, "   def. phase type: ", BC_LINELTH, str, status); 
    1261                 if  (Severe(status))  return; 
    1262                 if  (strcmp(str,"OTHER") == 0)  { 
    1263                         mn5v_global->default_phase_type = 0;  /* PIC_TYPE_OTHER */ 
    1264                 } else if  (strcmp(str,"TELE_QUAKE") == 0)  { 
    1265                         mn5v_global->default_phase_type = 1;  /* PIC_TYPE_TELE_QUAKE */ 
    1266                 } else if  (strcmp(str,"NUCLEAR") == 0)  { 
    1267                         mn5v_global->default_phase_type = 2;  /* PIC_TYPE_NUCLEAR */ 
    1268                 } else if  (strcmp(str,"REGIO_QUAKE") == 0)  { 
    1269                         mn5v_global->default_phase_type = 3;  /* PIC_TYPE_REGIO_QUAKE */ 
    1270                 } else if  (strcmp(str,"LOCAL_QUAKE") == 0)  { 
    1271                         mn5v_global->default_phase_type = 4;  /* PIC_TYPE_LOCAL_QUAKE */ 
    1272                 } else if  (strcmp(str,"BLAST") == 0)  { 
    1273                         mn5v_global->default_phase_type = 5;  /* PIC_TYPE_BLAST */ 
    1274                 } else if  (strcmp(str,"MINING") == 0)  { 
    1275                         mn5v_global->default_phase_type = 6;  /* PIC_TYPE_MINING */ 
    1276                 } else { 
    1277                         *status = SHE_ILPAR; 
    1278                         return; 
    1279                 } /*endif*/ 
    1280         } else if  (strcmp(item,"DEFAULT_PHASE_FLAGS") == 0)  { 
    1281                 cp_getstr( par, 2, tc, "   def. phase flags: ", BC_LINELTH, str, status); 
    1282                 if  (Severe(status))  return; 
    1283                 if  (strcmp(str,"CLEAR") == 0)  { 
    1284                         mn5v_global->default_phase_flags = 0; 
    1285                 } else if  (strcmp(str,"CALIB") == 0)  { 
    1286                         mn5v_global->default_phase_flags |= 0x01; /* CUC_F_EVENT_CALIB */ 
    1287                 } else if  (strcmp(str,"IGNORE") == 0)  { 
    1288                         mn5v_global->default_phase_flags |= 0x02; /* CUC_F_EVENT_IGNORE */ 
    1289                 } else if  (strcmp(str,"TELEX_ALL") == 0)  { 
    1290                         mn5v_global->default_phase_flags |= 0x04; /* CUC_F_EVENT_TELEX_ALL */ 
    1291                 } else { 
    1292                         *status = SHE_ILPAR; 
    1293                         return; 
    1294                 } /*endif*/ 
    1295         } else if  (strcmp(item,"DEFAULT_DEPTH_TYPE") == 0)  { 
    1296                 cp_getstr( par, 2, tc, "   def. depth type: ", BC_LINELTH, str, status); 
    1297                 if  (Severe(status))  return; 
    1298                 if  (strcmp(str,"UNDEFINED") == 0)  { 
    1299                         mn5v_global->default_depth_type = 0;  /* CUC_DEPTH_UNDEFINED */ 
    1300                 } else if  (strcmp(str,"PRESET") == 0)  { 
    1301                         mn5v_global->default_depth_type = 1;  /* CUC_DEPTH_PRESET */ 
    1302                 } else if  (strcmp(str,"ESTIMATED") == 0)  { 
    1303                         mn5v_global->default_depth_type = 2;  /* CUC_DEPTH_ESTIMATED */ 
    1304                 } else if  (strcmp(str,"FREE") == 0)  { 
    1305                         mn5v_global->default_depth_type = 3;  /* CUC_DEPTH_FREE */ 
    1306                 } else if  (strcmp(str,"POOR") == 0)  { 
    1307                         mn5v_global->default_depth_type = 4;  /* CUC_DEPTH_POOR */ 
    1308                 } else if  (strcmp(str,"LESSWELL") == 0)  { 
    1309                         mn5v_global->default_depth_type = 5;  /* CUC_DEPTH_LESSWELL */ 
    1310                 } else if  (strcmp(str,"RELIABLE") == 0)  { 
    1311                         mn5v_global->default_depth_type = 6;  /* CUC_DEPTH_RELIABLE */ 
    1312                 } else if  (strcmp(str,"EXTERNAL") == 0)  { 
    1313                         mn5v_global->default_depth_type = 7;  /* CUC_DEPTH_EXTERNAL */ 
    1314                 } else { 
    1315                         *status = SHE_ILPAR; 
    1316                         return; 
    1317                 } /*endif*/ 
    1318         } else if  (strcmp(item,"DEFAULT_DEPTH") == 0)  { 
    1319                 cp_getfloat( par, 2, tc, "   default depth (km): ", 
    1320                         &(mn5v_global->default_depth), status ); 
    1321         } else if  (strcmp(item,"DEFAULT_LOC_QUALITY") == 0)  { 
    1322                 cp_getstr( par, 2, tc, "   def. loc qual.: ", BC_LINELTH, str, status); 
    1323                 if  (Severe(status))  return; 
    1324                 if  (strcmp(str,"UNDEFINED") == 0)  { 
    1325                         mn5v_global->default_loc_quality = 0;  /* CUC_LOCQ_UNDEFINED */ 
    1326                 } else if  (strcmp(str,"TOOWEAK") == 0)  { 
    1327                         mn5v_global->default_loc_quality = 1;  /* CUC_LOCQ_TOOWEAK */ 
    1328                 } else if  (strcmp(str,"INCOHERENT") == 0)  { 
    1329                         mn5v_global->default_loc_quality = 2;  /* CUC_LOCQ_INCOHERENT */ 
    1330                 } else if  (strcmp(str,"NOBEARING") == 0)  { 
    1331                         mn5v_global->default_loc_quality = 3;  /* CUC_LOCQ_NOBEARING */ 
    1332                 } else if  (strcmp(str,"REGION") == 0)  { 
    1333                         mn5v_global->default_loc_quality = 4;  /* CUC_LOCQ_REGION */ 
    1334                 } else if  (strcmp(str,"RELIABLE") == 0)  { 
    1335                         mn5v_global->default_loc_quality = 5;  /* CUC_LOCQ_RELIABLE */ 
    1336                 } else { 
    1337                         *status = SHE_ILPAR; 
    1338                         return; 
    1339                 } /*endif*/ 
    1340         } else if  (strcmp(item,"MAX_CURSOR_FORM") == 0)  { 
    1341                 cp_getstr( par, 2, tc, "   max crsr form: ", BC_LINELTH, str, status); 
    1342                 if  (Severe(status))  return; 
    1343                 if  (strcmp(str,"CROSSHAIR") == 0)  { 
    1344                         mn5v_global->max_cursor_form = 2;  /* MGC_CRSR_CROSSHAIR */ 
    1345                 } else if  (strcmp(str,"WAVEFORM") == 0)  { 
    1346                         mn5v_global->max_cursor_form = 3;  /* MGC_CRSR_WAVEFORM */ 
    1347                 } else if  (strcmp(str,"WAVEFORM_NEG") == 0)  { 
    1348                         mn5v_global->max_cursor_form = 4;  /* MGC_CRSR_WAVEFORM_NEG */ 
    1349                 } else if  (strcmp(str,"WAVEFORM_HILB") == 0)  { 
    1350                         mn5v_global->max_cursor_form = 5;  /* MGC_CRSR_WAVEFORM_HILB */ 
    1351                 } else if  (strcmp(str,"WAVEFORM_NEGHILB") == 0)  { 
    1352                         mn5v_global->max_cursor_form = 6;  /* MGC_CRSR_WAVEFORM_NEGHILB */ 
    1353                 } else { 
    1354                         *status = SHE_ILPAR; 
    1355                         return; 
    1356                 } /*endif*/ 
    1357         } else if  (strcmp(item,"EVENT_CHECK_PROC") == 0)  { 
    1358                 cp_getstr( par, 2, tc, "   event check proc: ", BC_FILELTH, str, status ); 
    1359                 if  (Severe(status))  return; 
    1360                 strcpy( mn5v_global->event_check_proc, str ); 
    1361         } else if  (strcmp(item,"SCREENDUMP_PROC") == 0)  { 
    1362                 cp_getstr( par, 2, tc, "   screendump proc: ", BC_FILELTH, str, status ); 
    1363                 if  (Severe(status))  return; 
    1364                 strcpy( mn5v_global->screendump_proc, str ); 
    1365         } else if  (strcmp(item,"EVTVIEW_PROC") == 0)  { 
    1366                 cp_getstr( par, 2, tc, "   evtview proc: ", BC_FILELTH, str, status ); 
    1367                 if  (Severe(status))  return; 
    1368                 strcpy( mn5v_global->evtview_proc, str ); 
    1369         } else if  (strcmp(item,"REFORMAT_PROC") == 0)  { 
    1370                 cp_getstr( par, 2, tc, "   reformat proc: ", BC_FILELTH, str, status ); 
    1371                 if  (Severe(status))  return; 
    1372                 strcpy( mn5v_global->reformat_proc, str ); 
    1373         } else if  (strcmp(item,"FINAL_PROC") == 0)  { 
    1374                 cp_getstr( par, 2, tc, "   postprocessing proc: ", BC_FILELTH, str, status ); 
    1375                 if  (Severe(status))  return; 
    1376                 strcpy( mn5v_global->final_proc, str ); 
    1377         } else if  (strcmp(item,"REMREQHOST") == 0)  { 
    1378                 cp_getstr( par, 2, tc, "   remreqhost: ", BC_SHORTSTRLTH, str, status ); 
    1379                 if  (Severe(status))  return; 
    1380                 strcpy( mn5v_global->remreqhost, str ); 
    1381         } else if  (strcmp(item,"FULL_PHASE_NAMES") == 0)  { 
    1382                 cp_getstr( par, 2, tc, "   TRUE/FALSE: ", BC_LINELTH, str, status ); 
    1383                 if  (Severe(status))  return; 
    1384                 if  (strcmp(str,"TRUE") == 0)  { 
    1385                         mn5v_global->full_phase_names = TRUE; 
    1386                 } else if  (strcmp(str,"FALSE") == 0)  { 
    1387                         mn5v_global->full_phase_names = FALSE; 
    1388                 } else { 
    1389                         *status = SHE_ILPAR; 
    1390                         return; 
    1391                 } /*endif*/ 
    1392         } else if  (strcmp(item,"DEFAULT_SOURCE") == 0)  { 
    1393                 cp_getstr( par, 2, tc, "   default source: ", BC_SHORTSTRLTH, 
    1394                         str, status ); 
    1395                 if  (Severe(status))  return; 
    1396                 strcpy( mn5v_global->default_source, str ); 
    1397         } else if  (strcmp(item,"AUTO_PHASE") == 0)  { 
    1398                 cp_getstr( par, 2, tc, "   auto phase: ", cBcShortStrLth, str, status ); 
    1399                 if  (Severe(status))  return; 
    1400                 strcpy( mn5v_global->auto_phase, str ); 
    1401         } else if  (strcmp(item,"MOVE_WDW_STEP") == 0)  { 
    1402                 cp_getfloat( par, 2, tc, "   move wdw step: ", 
    1403                         &(mn5v_global->move_wdw_step), status ); 
    1404         } else if  (strcmp(item,"TOP_MARGIN") == 0)  { 
    1405                 cp_getint( par, 2, tc, "   top margin: ", 
    1406                         &(mn5v_global->top_margin), status ); 
    1407         } else if  (strcmp(item,"DRAW_AREA_HEIGHT") == 0)  { 
    1408                 cp_getint( par, 2, tc, "   draw area height: ", 
    1409                         &(mn5v_global->draw_area_height), status ); 
    1410         } else if  (strcmp(item,"DRAW_AREA_WIDTH") == 0)  { 
    1411                 cp_getint( par, 2, tc, "   draw area width: ", 
    1412                         &(mn5v_global->draw_area_width), status ); 
    1413         } else if  (strcmp(item,"AREA_ZOOM_BASE") == 0)  { 
    1414                 cp_getfloat( par, 2, tc, "   area zoom base: ", 
    1415                         &(mn5v_global->area_zoom_base), status ); 
    1416         } else if  (strcmp(item,"AREA_ZOOM_EXP") == 0)  { 
    1417                 cp_getfloat( par, 2, tc, "   area zoom exponent: ", 
    1418                         &(mn5v_global->area_zoom_exp), status ); 
    1419         } else if  (strcmp(item,"OWN_ACCELERATORS") == 0)  { 
    1420                 cp_getstr( par, 2, tc, "   TRUE/FALSE: ", BC_LINELTH, str, status ); 
    1421                 if  (Severe(status))  return; 
    1422                 if  (strcmp(str,"TRUE") == 0)  { 
    1423                         mn5v_global->own_accelerators = TRUE; 
    1424                 } else if  (strcmp(str,"FALSE") == 0)  { 
    1425                         mn5v_global->own_accelerators = FALSE; 
    1426                 } else { 
    1427                         *status = SHE_ILPAR; 
    1428                         return; 
    1429                 } /*endif*/ 
    1430         } else if  (strcmp(item,"FILTER_TYPE") == 0)  { 
    1431                 cp_getstr( par, 2, tc, "   filter type: ", BC_LINELTH, str, status ); 
    1432                 if  (Severe(status))  return; 
    1433                 mn5v_global->filter_type = *str; 
    1434         } else { 
    1435                 /* *status = SHE_UKKEY; */ 
    1436                 printf( "SH: SHMSETUP item %s unknown.  Command ignored.\n", item ); 
    1437                 return; 
    1438         } /*endif*/ 
    1439 #endif 
    1440782 
    1441783} /* end of mn5_shmsetup */ 
     
    17001042void mn5_fixgap( PARAM *par, STATUS *status ) 
    17011043 
    1702 /* removes  zeros from traces introducing a straight line  
     1044/* removes  zeros from traces introducing a straight line 
    17031045        connecting non-zero values 
    17041046 * par 1:    trace list 
  • SH_SHM/trunk/source/shmenuio.c

    r69 r341  
    262262                        datlth = qf_getl( QFCL_LTH, NULL ); 
    263263                } /*endif*/ 
    264          
     264 
    265265                ml_inittrc( blcptr, sdatptr, datlth, dt ); 
    266266 
     
    13191319        FILE     *flagf;                   /* pointer to flag file */ 
    13201320        int      flags;                    /* data flags */ 
    1321 #ifdef XXX 
    1322         BOOLEAN  no_bugfix;                /* do not call jukebox bugfix */ 
    1323 #endif 
    13241321 
    13251322        /* executable code */ 
     
    16901687                } /*endif*/ 
    16911688                if  (Severe(status))  {if (ef != NULL) sy_fclose(ef); return;} 
    1692          
     1689 
    16931690                db_newlist(); 
    16941691                trc = db_create( status ); 
    16951692                if  (Severe(status))  {if (ef != NULL) sy_fclose(ef); return;} 
    1696          
     1693 
    16971694                if  (ef != NULL)  { 
    16981695                        while  (fgets(entstr,BC_LINELTH,ef) != NULL)  { 
     
    17551752                        fseek( ef, 0, 0 ); 
    17561753                } /*endif*/ 
    1757          
     1754 
    17581755                sh_frgn_geti( "LENGTH", &trclth, status ); 
    17591756                if  (Severe(status))  {db_delete(trc); return;} 
    17601757                sh_frgn_getr( "DELTA", &dt, status ); 
    17611758                if  (Severe(status))  {db_delete(trc); return;} 
    1762          
     1759 
    17631760                datptr = (SAMPLE *)sy_allocmem( trclth, (int)sizeof(SAMPLE), status ); 
    17641761                if  (Severe(status))  {db_delete(trc); return;} 
    17651762                sh_frgn_read( datptr ); 
    1766          
     1763 
    17671764                ml_inittrc( trc, datptr, trclth, dt ); 
    17681765                db_setr( trc, ER_TORIG, 0.0, NULL ); 
  • SH_SHM/trunk/source/shmidlev.c

    r16 r341  
    179179                } /*endfor*/ 
    180180                return; 
    181 #  ifdef XXX 
    182         } else if  (*liststr == 'H')  { 
    183                 if  (liststr[1] == ':')  { 
    184                         map = SHC_HIDDENLIST; 
    185                         liststr += 2; 
    186                         prevtrc = EP_PREV; 
    187                         nexttrc = EP_NEXT; 
    188                 } else { 
    189                         prevtrc = EP_DSPP; 
    190                         nexttrc = EP_DSPN; 
    191                         map = gc; 
    192                 } /*endif*/ 
    193 #  endif  /* XXX */ 
    194181        } else { 
    195182                map = gc; 
     
    361348 * 
    362349 * parameters of routine 
    363  * PARAM      *par;            input; menu parameter  
     350 * PARAM      *par;            input; menu parameter 
    364351 * int        pos;             input; parameter number 
    365352 * int        wdw;             input; window number for prompting 
  • SH_SHM/trunk/source/shsymbol.c

    r86 r341  
    4646 
    4747 
    48 #define MAXNAMELTH 15 
     48#define MAXNAMELTH 50 
    4949                  /* maximum length of symbol name */ 
    50 #define MAXSYMNUM  20 
     50#define MAXSYMNUM  50 
    5151                  /* maximum number of symbols */ 
    5252#define MAXSET     2 
  • SH_SHM/trunk/source/shtransl.c

    r16 r341  
    367367                        return; 
    368368                } /*endif*/ 
    369 #  ifdef XXX 
    370         } else if  (*idxstr == 'H')  { 
    371                 if  (idxstr[1] == ':')  { 
    372                         dln = SHC_HIDDENLIST; 
    373                         idxstr += 2; 
    374                 } else { 
    375                         dln = gc; 
    376                 } /*endif*/ 
    377 #  endif  /* XXX */ 
    378369        } else { 
    379370                dln = gc; /* (gc == 0) ? SHC_HIDDENLIST : gc; */ 
     
    469460        STATUS *status ) 
    470461 
    471 /* returns internal variable  
     462/* returns internal variable 
    472463 * 
    473464 * parameters of routine 
  • SH_SHM/trunk/source/sysbase.h

    r16 r341  
    4242#include "basecnst.h" 
    4343#endif 
    44  
    45  
    46  
    47 /****************************************************************** 
    48  ***                        ATARI version                       *** 
    49  ******************************************************************/ 
    50  
    51  
    52  
    53 #ifdef BC_ATARI 
    54  
    55  
    56 /* one byte integer */ 
    57 #define BYTE char 
    58  
    59 /* boolean type */ 
    60 #define BOOLEAN int 
    61  
    62 /* boolean values TRUE & FALSE */ 
    63 #ifdef BC_DEFINE_TRUE_FALSE 
    64 #define TRUE (1) 
    65 #define FALSE (0) 
    66 #endif 
    67  
    68 /* infinite loop declaration   */ 
    69 #define FOREVER for(;;) 
    70  
    71 /* status type */ 
    72 typedef int STATUS;    /* status value */ 
    73 #define Severe(s) (*(s) != 0) 
    74  
    75 /* nearest integer number to floating number */ 
    76 #define Nint(x) (int)(((x)>0)?(x)+0.5:(x)-0.5) 
    77 #define Nint32(x) (int)(((x)>0)?(x)+0.5:(x)-0.5) 
    78  
    79 /* nearest long number to floating number */ 
    80 #define Nlong(x) (long)(((x)>0)?(x)+0.5:(x)-0.5) 
    81  
    82 /* capitalize character */ 
    83 #define Cap(c) (((c)>='a' && (c)<='z') ? ((c)-32) : (c)) 
    84 #define Uncap(c) (((c)>='A' && (c)<='Z') ? ((c)+32) : (c)) 
    85  
    86 /* NULL address */ 
    87 /* #define NULL ( ( void * ) 0L ) */ 
    88  
    89 /* absolute value of number */ 
    90 #define Abs(x) ((x)<0?-(x):(x)) 
    91  
    92 /* sy_findfile parameter */ 
    93 #define SYC_FF_NAME 1 
    94 #define SYC_FF_DIR 2 
    95 #define SYC_FF_EXT 4 
    96  
    97 /* binary file type, uses GEMDOS file handle, because of mistake in FILE */ 
    98 typedef int BFILE; 
    99  
    100 /* open existing file for writing, is not yet used */ 
    101 #define SYC_OPEN_OVWR "w" 
    102  
    103 /* read logical name table */ 
    104 #define sy_lognames(f,s) fo_readtable(f,s) 
    105  
    106 /* open text file */ 
    107 #define sy_fopen(f,a) fo_fopen(f,a) 
    108  
    109 /* close text file */ 
    110 #define sy_fclose(f) fclose(f) 
    111  
    112 /* read from text file, is not yet used */ 
    113 #define sy_fread fread 
    114  
    115 /* write to text file, is not yet used */ 
    116 #define sy_fwrite fwrite 
    117  
    118 /* binary file operation failed */ 
    119 #define sy_fbfailed(f) ((f)<0) 
    120  
    121 /* delete file                   */ 
    122 /* call: sy_fdelete( filename )  */ 
    123 /*       char   *filename;  input; file to be deleted */ 
    124 /* #define sy_fdelete(a) Fdelete(a) */ 
    125 /* int Fdelete( const char fname[] ); */ 
    126 /* is now implemented as routine: */ 
    127 void sy_fdelete( char fname[] ); 
    128  
    129 /* rename file                                     */ 
    130 /* call: sy_frename( from, to )                    */ 
    131 /*       char   *from;   input; file to be renamed */ 
    132 /*       char   *to;     input; new name of file   */ 
    133 /* #define sy_frename(a,b) Frename(0,a,b) */ 
    134 /* int Frename( int zero, const char oldname[], const char newname[] ); */ 
    135 /* is now implemented as routine: */ 
    136 void sy_frename( char from[], char to[] ); 
    137  
    138 /* random string generator, not implemented */ 
    139 #define sy_randomstr(l,s) 
    140  
    141  
    142 /* system constants */ 
    143 /* ---------------- */ 
    144  
    145 /* maximum unsigned */ 
    146 #define SYC_MAXUNSG 0xffffL 
    147  
    148 /* maximum integer */ 
    149 #define SYC_MAXINT 0x7fffL 
    150  
    151 /* minimum integer */ 
    152 #define SYC_MININT 0x8000L 
    153  
    154 /* maximum long */ 
    155 #define SYC_MAXLONG 0x7fffffffL 
    156  
    157 /* minimum long */ 
    158 #define SYC_MINLONG 0x80000000L 
    159  
    160  
    161 /* system specific types */ 
    162 /* --------------------- */ 
    163  
    164 /* difference time, to measure time differences */ 
    165 typedef float DIFFTIME; 
    166  
    167  
    168 /* one global variable: Application ID */ 
    169 #ifndef __FROM_SYSCALL 
    170 extern int syv_apid; 
    171 #endif 
    172  
    173 /* include fileopen */ 
    174 #ifndef __FOUSRDEF 
    175 #include BC_FOUSRDEF 
    176 #endif 
    177  
    178  
    179  
    180 /*------------------------------------------------------------------------*/ 
    181 /*                                      prototypes of routines of module SYSCALL.C                                */ 
    182 /*------------------------------------------------------------------------*/ 
    183  
    184  
    185 void sy_initprocess( void ); 
    186  
    187 /* initialises process (ATARI AES, global memory area) 
    188  * 
    189  * no parameters 
    190  */ 
    191  
    192  
    193 /*------------------------------------------------------------------------*/ 
    194  
    195  
    196 #ifdef BC_SHARE_CPU 
    197  
    198  
    199 /*------------------------------------------------------------------------*/ 
    200  
    201  
    202  
    203 void sy_sharecpu( void ); 
    204  
    205 /* let other process get some CPU time (call to evnt_timer) 
    206  * 
    207  * no parameters 
    208  */ 
    209  
    210  
    211 /*------------------------------------------------------------------------*/ 
    212  
    213  
    214 void sy_debuginfo( char info[] ); 
    215  
    216 /* transfers debug information 
    217  * 
    218  * parameters of routine 
    219  * char          info[];   input; info string 
    220  */ 
    221  
    222  
    223 /*------------------------------------------------------------------------*/ 
    224  
    225  
    226 char *sy_getmessage( void ); 
    227  
    228 /* returns message string from external source 
    229  * 
    230  * no parameters 
    231  */ 
    232  
    233  
    234 /*------------------------------------------------------------------------*/ 
    235  
    236  
    237 #else  /* BC_SHARE_CPU */ 
    238  
    239  
    240 #define sy_sharecpu() 
    241 #define sy_debuginfo(i) 
    242 #define sy_getmessage() NULL 
    243  
    244  
    245 #endif /* BC_SHARE_CPU */