Changeset 341 for SH_SHM/trunk
- Timestamp:
- 03/09/2011 04:55:49 PM (13 years ago)
- Location:
- SH_SHM/trunk
- Files:
-
- 27 deleted
- 68 edited
Legend:
- Unmodified
- Added
- Removed
-
SH_SHM/trunk/source/basecnst.h
r16 r341 64 64 ******************************************************************/ 65 65 66 /* possible flags for operating system are67 * SH_SETUP_SUNOS68 * SH_SETUP_LINUX69 * SH_SETUP_AIX70 * SH_SETUP_HPUX71 * SH_SETUP_ATARITOS72 * SH_SETUP_VMS73 * default is SH_SETUP_SUNOS74 */75 76 #if defined(SH_SETUP_SUNOS)77 #define cBc_OS_UNIX78 #define cBc_OS_SUNOS79 #elif defined(SH_SETUP_LINUX)80 #define cBc_OS_UNIX81 #define cBc_OS_LINUX82 #elif defined(SH_SETUP_AIX)83 #define cBc_OS_UNIX84 #define cBc_OS_AIX85 #elif defined(SH_SETUP_HPUX)86 #define cBc_OS_UNIX87 #define cBc_OS_HPUX88 #elif defined(SH_SETUP_VMS)89 #define cBc_OS_VMS90 #define BC_VAX /* for compatibility */91 #elif defined(SH_SETUP_ATARITOS)92 #define cBc_OS_ATARITOS93 #define BC_ATARI /* for compatibility */94 #else95 #define cBc_OS_UNIX96 #define cBc_OS_SUNOS97 #endif98 99 /* for compatibility (should be removed some time) */100 #ifdef cBc_OS_UNIX101 #define BC_SUN102 #define cBc_SUN103 #endif104 105 106 107 66 /* select graphics */ 108 /* #define BC_G_GEM */109 67 #define BC_G_MEM 110 68 #define cBc_G_MEM 111 /* #define BC_G_BGI */112 69 #define BC_G_POSTSCRIPT 113 70 #define cBc_G_POSTSCRIPT 114 /* #define BC_G_DESKJET */115 71 #define BC_G_XWINDOW 116 72 #define cBc_G_XWINDOW 117 /* #define BC_G_CALCOMP */118 #define BC_G_HPGL119 #define cBc_G_HPGL120 /* #define BC_G_VWS */121 /* #define BC_G_TEK */122 73 123 74 /* general flags */ … … 139 90 140 91 /* 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 */145 92 #define BC_REVERSECROSS 146 93 #define cBc_REVERSECROSS … … 151 98 /* #define BC_CLOCK_T_AVAILABLE */ 152 99 /* type clock_t is available */ 153 154 155 156 157 /******************************************************************158 *** ATARI version ***159 ******************************************************************/160 161 162 163 #ifdef BC_ATARI164 165 #define BC_KS_PRIVATE166 /* 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_IBM210 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_VAX246 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_SUN280 281 100 282 101 /* only old style names */ … … 311 130 312 131 313 314 #endif /* BC_SUN */315 316 317 132 /****************************************************************** 318 133 *** END *** -
SH_SHM/trunk/source/cpar.c
r16 r341 38 38 #include "cpar.h" 39 39 40 41 #ifdef BC_SUN42 40 #define QUALCHAR1 '-' 43 41 #define QUALCHAR2 '-' 44 #else45 #define QUALCHAR1 '-'46 #define QUALCHAR2 '/'47 #endif48 49 50 42 51 43 /* global variables */ … … 58 50 /* parameters and qualifiers */ 59 51 /* are numbered from 1 to N */ 60 61 62 #ifdef XXXYYY63 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 #endif110 111 52 112 53 -
SH_SHM/trunk/source/earthloc.c
r16 r341 73 73 74 74 75 /* test main module */76 77 78 #ifdef XXX79 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 YYY119 /* 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 159 75 void mb_locdiff( double slat, double slon, double elat, double elon, 160 76 double *distance, double *azim, double *bazim ) … … 326 242 /*---------------------------------------------------------------------*/ 327 243 328 #ifdef XXX329 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 degrees335 *336 * parameters of routine337 * float lat, lon; input; location in degrees338 */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 #endif402 403 /*---------------------------------------------------------------------*/404 405 406 244 407 245 void mb_ferindex( float lat, float lon, int *feridx, STATUS *status ) … … 425 263 426 264 /*---------------------------------------------------------------------*/ 427 428 #ifdef XXX429 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 FER435 *436 * parameters of routine437 * int ferindex; input; FER index438 * char fername[]; output; FER name439 * STATUS *status; output; return status440 */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 #endif471 472 /*---------------------------------------------------------------------*/473 474 265 475 266 -
SH_SHM/trunk/source/errmsg.c
r16 r341 94 94 int errline; /* line number */ 95 95 char errfile[BC_LINELTH+1]; /* error file */ 96 # ifdef BC_SUN /* needed on sun only */97 96 char *eptr; /* pointer to environment variable */ 98 # endif99 97 100 98 /* executable code */ … … 102 100 /* check error path */ 103 101 if (*emv_errdir == '\0') { 104 # ifdef BC_VAX105 strcpy( emv_errdir, "shc_errors:" );106 # endif107 # ifdef BC_SUN108 102 eptr = GpGetString( cGpS_defpath_errors ); 109 103 if (eptr == NULL) { … … 116 110 strcpy( emv_errdir, eptr ); 117 111 } /*endif*/ 118 # endif119 # ifdef BC_ATARI120 strcpy( emv_errdir, "e:\\pc\\sh\\errors\\" );121 # endif122 112 } /*endif*/ 123 113 -
SH_SHM/trunk/source/fctxmn5.h
r16 r341 194 194 /*--------------------------------------------------------------------*/ 195 195 196 #ifdef XXX197 void mn5_set_shmsetup_pointer( SHT_GLOBAL_SET *ptr );198 #endif199 200 /* special routine to set pointer to global variable of motif modules201 *202 * parameters of routine203 * SHT_GLOBAL_SET *ptr; input; specifies address of global paramters204 */205 206 207 /*--------------------------------------------------------------------*/208 209 196 210 197 void mn5_shmsetup( PARAM *par, STATUS *status ); … … 255 242 void mn5_fixgap( PARAM *par, STATUS *status ); 256 243 257 /* removes zeros from traces introducing a straight line 244 /* removes zeros from traces introducing a straight line 258 245 connecting non-zero values 259 246 * par 1: trace list -
SH_SHM/trunk/source/fctxmt.h
r16 r341 297 297 */ 298 298 299 300 /*--------------------------------------------------------------------------*/301 302 #ifdef XXX303 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-fashioned307 * FORTRAN routine.308 *309 * parameters of routine310 * long lx; input; length of complex array311 * COMPLEX cx[]; modify; array to be fourier transformed312 * REAL signi; input; sign of transformation313 */314 #endif /* XXX */315 299 316 300 /*--------------------------------------------------------------------------*/ … … 641 625 int maxiter, REAL *pos, REAL *width, int *iter, STATUS *status ); 642 626 643 /* fits a gauss function of position "*pos" and width "*width" to 627 /* fits a gauss function of position "*pos" and width "*width" to 644 628 * the data given in x[0..ndata-1] and y[0..ndata-]. 645 629 * … … 711 695 712 696 713 void mt_fix_gap( SAMPLE dat[], long lth, REAL const_value, BOOLEAN konst, 697 void mt_fix_gap( SAMPLE dat[], long lth, REAL const_value, BOOLEAN konst, 714 698 BOOLEAN one); 715 699 -
SH_SHM/trunk/source/fftfiltr.c
r16 r341 264 264 265 265 /* reads complex coefficients from file 266 * 266 * 267 267 * parameters of routine 268 268 * FILE *f; input; file pointer … … 1379 1379 /*-------------------------------------------------------------------------*/ 1380 1380 1381 #ifdef XXX1382 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 routine1388 * float taper; input; taper start [0..1]1389 * long lth; input; length of data array1390 * COMPLEX dat[]; modify; data array to be tapered1391 */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 1420 1381 static void ff_costaper( float taper, long lth, COMPLEX dat[] ) 1421 1382 -
SH_SHM/trunk/source/fileopen.c
r16 r341 62 62 63 63 64 65 64 /*----------------------------------------------------------------------*/ 66 67 #ifdef XXX68 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 #endif81 82 83 /*----------------------------------------------------------------------*/84 85 65 86 66 … … 201 181 } /*endwhile*/ 202 182 203 # ifdef BC_SUN204 183 cptr = getenv( logname ); 205 184 if (cptr != NULL) { … … 211 190 if (fp != NULL) return fp; 212 191 } /*endif*/ 213 # endif214 192 215 193 /* not found, open without translation */ -
SH_SHM/trunk/source/foreign/sh_gse.c
r16 r341 353 353 354 354 /* read date and other info from this line */ 355 # ifdef XXX356 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 # endif368 355 s = 4; 369 356 while (line[s] == ' ') s++; -
SH_SHM/trunk/source/gcf/gcflib.c
r164 r341 370 370 /* skips data block (jumps to next header or EOF) after a raw header has been 371 371 * read 372 * 372 * 373 373 * parameters of routine 374 374 * FILE *gcf; input; GCF data input file … … 837 837 fd->pos -= 2; 838 838 if (fd->pos < 0) { 839 #ifdef XXX840 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 #endif864 839 fprintf( stderr, "*** GcfSearchPosition: check gfdfile\n" ); 865 840 *status = GcfERR_BUG; 866 841 return; 867 #ifdef XXX868 } /*endif*/869 #endif870 842 } /*endif*/ 871 843 seek_pos = (INT32)(fd->pos) * (INT32)(fd->blklth); … … 1156 1128 GcfDecodeBlock( &rhdr, blk, blksmp, &actblksmp, status ); 1157 1129 ON_ERROR_RETURN 1158 #ifdef XXX1159 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 #endif1181 1130 lsrc = blksmp + fd->sample; 1182 1131 actblksmp -= fd->sample; … … 1206 1155 GcfDecodeBlock( &rhdr, blk, blksmp, &actblksmp, status ); 1207 1156 ON_ERROR_RETURN 1208 #ifdef XXX1209 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 #endif1231 1157 lsrc = blksmp; 1232 1158 … … 1275 1201 GcfFreeMem( blksmp ); 1276 1202 GcfFreeMem( blk ); 1277 fprintf( stderr, 1203 fprintf( stderr, 1278 1204 " padding aborted, %ld zeroes remaining\n", padcnt ); 1279 1205 return; -
SH_SHM/trunk/source/gcf/gcftest.c
r16 r341 42 42 43 43 44 #ifdef XXX45 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 #endif63 64 44 /* test GcfSearchPosition */ 65 45 … … 70 50 printf( "act_start %s\n", act_start ); 71 51 printf( "status %d\n", status ); 72 73 74 75 #ifdef XXX76 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 #endif94 95 96 52 } /* end of main */ -
SH_SHM/trunk/source/gmusrdef.h
r16 r341 137 137 * 138 138 * parameters of routine 139 * int wdw; input; wdw number (dummy in the ATARI version)139 * int wdw; input; wdw number 140 140 * int style; input; style block number 141 141 * char item[]; input; name of attribute -
SH_SHM/trunk/source/infoidx.h
r16 r341 47 47 48 48 /* infos stored in memory */ 49 #ifdef XXX50 /* old values up to 15-Mar-2006 */51 #define EMAX_LONG 552 #define EMAX_INT 653 #define EMAX_BYTE 254 #define EMAX_REAL 1255 #define EMAX_STR 456 #define EMAX_CHAR 457 #define EMAX_TIME 358 #define EMAX_PTR 859 #define EMAX_FLAG 1660 #endif61 62 49 #define EMAX_LONG 30 63 50 #define EMAX_INT 30 … … 71 58 72 59 /* info not read from file */ 73 #ifdef XXX74 /* old values up to 15-Mar-2006 */75 #define ENF_LONG 276 #define ENF_INT 277 #define ENF_BYTE 078 #define ENF_REAL 579 #define ENF_STR 380 #define ENF_CHAR 381 #define ENF_TIME 382 #define ENF_PTR 083 #define ENF_FLAG 684 #endif85 86 60 #define ENF_LONG 27 87 61 #define ENF_INT 26 … … 348 322 349 323 /* parameters of routine */ 350 /* MEMBLC *ptr; input; info block pointer */ 324 /* MEMBLC *ptr; input; info block pointer */ 351 325 /* unsigned ientry; input; info entry */ 352 326 /* int *status; output; return status */ … … 361 335 362 336 /* parameters of routine */ 363 /* MEMBLC *ptr; input; info block pointer */ 337 /* MEMBLC *ptr; input; info block pointer */ 364 338 /* unsigned ientry; input; info entry */ 365 339 /* int *status; output; return status */ … … 374 348 375 349 /* parameters of routine */ 376 /* MEMBLC *ptr; input; info block pointer */ 350 /* MEMBLC *ptr; input; info block pointer */ 377 351 /* unsigned ientry; input; info entry */ 378 352 /* int *status; output; return status */ … … 387 361 388 362 /* parameters of routine */ 389 /* MEMBLC *ptr; input; info block pointer */ 363 /* MEMBLC *ptr; input; info block pointer */ 390 364 /* unsigned ientry; input; info entry */ 391 365 /* int *status; output; return status */ … … 400 374 401 375 /* parameters of routine */ 402 /* MEMBLC *ptr; input; info block pointer */ 376 /* MEMBLC *ptr; input; info block pointer */ 403 377 /* unsigned ientry; input; info entry */ 404 378 /* int maxlth; input; maximum length of output string */ … … 415 389 416 390 /* parameters of routine */ 417 /* MEMBLC *ptr; input; info block pointer */ 391 /* MEMBLC *ptr; input; info block pointer */ 418 392 /* unsigned ientry; input; info entry */ 419 393 /* int *status; output; return status */ … … 428 402 429 403 /* parameters of routine */ 430 /* MEMBLC *ptr; input; info block pointer */ 404 /* MEMBLC *ptr; input; info block pointer */ 431 405 /* unsigned ientry; input; info entry */ 432 406 /* TIME *time; output; time returned */ … … 442 416 443 417 /* parameters of routine */ 444 /* MEMBLC *ptr; input; info block pointer */ 418 /* MEMBLC *ptr; input; info block pointer */ 445 419 /* unsigned ientry; input; info entry */ 446 420 /* int *status; output; return status */ … … 455 429 456 430 /* parameters of routine */ 457 /* MEMBLC *ptr; input; info block pointer */ 431 /* MEMBLC *ptr; input; info block pointer */ 458 432 /* unsigned ientry; input; info entry */ 459 433 /* int *status; output; return status */ -
SH_SHM/trunk/source/newgraph/Makefile
r200 r341 16 16 LIB_GRAPH = $(SH_LIB)libgraph.a 17 17 18 LOCAL_SRCS = graphch.c hpch.cmemch.c memfile.c psch.c xwch.c18 LOCAL_SRCS = graphch.c memch.c memfile.c psch.c xwch.c 19 19 #LOCAL_OBJS = $(LOCAL_SRCS:%.c=%.o) 20 20 LOCAL_OBJS = $(LOCAL_SRCS:.c=.o) -
SH_SHM/trunk/source/newgraph/gcusrdef.h
r16 r341 21 21 22 22 /* channel bits */ 23 #define GCF_GEM 0x10024 23 #define GCF_MEM 0x200 25 24 #define GCF_PSF 0x400 26 #define GCF_DJ 0x80027 #define GCF_BGI 0x000028 #define GCF_CALCOMP 0x400029 #define GCF_TEK 0x800030 #define GCF_VWS 0x8031 25 #define GCF_XWDW 0x2000 32 #define GCF_HPGL 0x2033 26 #define GCF_STDCH 0x10 /* standard text channel */ 34 27 #define GCF_FILE 0x00 /* text file channel */ 35 28 #define GCF_NOECHO 0x40 /* no echo bit */ 36 29 #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 */ 38 31 #define GCF_NUMMASK 7 39 32 … … 487 480 /*------------------------------------------------------------------------*/ 488 481 489 #ifdef BC_KS_PRIVATE490 #ifdef BC_G_GEM491 void gm_pixhardcopy( int wdw, int mag, char outfile[] );492 #define gc_pixhardcopy(w,m,f) gm_pixhardcopy(w&GCF_NUMMASK,m,f)493 #else494 #define gc_pixhardcopy(w,m,f)495 #endif496 #endif497 498 /*------------------------------------------------------------------------*/499 500 482 #endif /* __GCUSRDEF */ -
SH_SHM/trunk/source/newgraph/graphch.c
r16 r341 16 16 #include BC_SYSBASE 17 17 #include "graphbas.h" 18 #include "gmusrdef.h"19 18 #include "mmusrdef.h" 20 19 #include "psusrdef.h" 21 #include "ccusrdef.h"22 #include "tkusrdef.h"23 #include "hpusrdef.h"24 #include "djusrdef.h"25 #include "bgusrdef.h"26 20 #include "xwusrdef.h" 27 #include "vwusrdef.h"28 21 #include BC_GCUSRDEF 29 22 … … 79 72 } /*endif*/ 80 73 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 87 74 if (GCF_XWDW & map) { 88 75 xw_init( map & WDWMASK, attribs, xlo, ylo, width, height, status ); … … 91 78 } /*endif*/ 92 79 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 99 80 if (GCF_MEM & map) { 100 81 mm_init( map & WDWMASK, status ); … … 109 90 } /*endif*/ 110 91 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 141 92 } /* end of gc_init */ 142 93 … … 157 108 /* executable code */ 158 109 159 if (GCF_GEM & map)160 gm_exit( map & WDWMASK );161 162 110 if (GCF_XWDW & map) 163 111 xw_exit( map & WDWMASK ); 164 165 if (GCF_BGI & map)166 bg_exit( map & WDWMASK );167 112 168 113 if (GCF_MEM & map) … … 172 117 ps_exit(); 173 118 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 189 119 } /* end of gc_exit */ 190 120 … … 204 134 /* executable code */ 205 135 206 gm_finish();207 136 xw_finish(); 208 bg_finish();209 137 mm_finish(); 210 138 ps_finish(); 211 cc_finish();212 tk_finish();213 hp_finish();214 dj_finish();215 vw_finish();216 139 gcv_initmap = 0; 217 140 … … 238 161 /* executable code */ 239 162 240 if (GCF_GEM & map) {241 gm_resizewdw( map & WDWMASK, xpos, ypos, width, height, status );242 if (Severe(status)) return;243 } /*endif*/244 245 163 if (GCF_XWDW & map) { 246 164 xw_resizewdw( map & WDWMASK, xpos, ypos, width, height, status ); … … 248 166 } /*endif*/ 249 167 250 if (GCF_BGI & map) {251 bg_resizewdw( map & WDWMASK, xpos, ypos, width, height, status );252 if (Severe(status)) return;253 } /*endif*/254 255 168 if (GCF_PSF & map) { 256 169 ps_resize( xpos, ypos, width, height, status ); … … 258 171 } /*endif*/ 259 172 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 285 173 } /* end of gc_resizewdw */ 286 174 … … 301 189 /* executable code */ 302 190 303 if (GCF_GEM & map)304 gm_popwdw( map & WDWMASK );305 306 191 if (GCF_XWDW & map) 307 192 xw_popwdw( map & WDWMASK ); 308 309 if (GCF_VWS & map)310 vw_popwdw( map & WDWMASK );311 193 312 194 } /* end of gc_popwdw */ … … 329 211 /* executable code */ 330 212 331 if (GCF_GEM & map)332 gm_setwdwname( map & WDWMASK, name );333 334 213 if (GCF_XWDW & map) 335 214 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 );342 215 343 216 } /* end of gc_setwdwname */ … … 364 237 /* executable code */ 365 238 366 if (GCF_GEM & map) {367 gm_setstyle( map & WDWMASK, style, item, value, status );368 if (Severe(status)) return;369 } /*endif*/370 371 239 if (GCF_XWDW & map) { 372 240 xw_setstyle( map & WDWMASK, style, item, value, status ); … … 374 242 } /*endif*/ 375 243 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 386 244 if (GCF_PSF & map) { 387 245 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 );413 246 if (Severe(status)) return; 414 247 } /*endif*/ … … 439 272 CSWAP(w,h) 440 273 441 if (GCF_GEM & map) {442 gm_setcoo( map & WDWMASK, x, y, w, h, status );443 if (Severe(status)) return;444 } /*endif*/445 446 274 if (GCF_XWDW & map) { 447 275 xw_setcoo( map & WDWMASK, x, y, w, h, status ); … … 449 277 } /*endif*/ 450 278 451 if (GCF_BGI & map) {452 bg_setcoo( map & WDWMASK, x, y, w, h, status );453 if (Severe(status)) return;454 } /*endif*/455 456 279 if (GCF_MEM & map) { 457 280 mm_setcoo( map & WDWMASK, x, y, w, h, status ); … … 464 287 } /*endif*/ 465 288 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 491 289 } /* end of gc_setcoo */ 492 290 … … 508 306 /* executable code */ 509 307 510 if (GCF_GEM & map)511 return gm_aspectratio( map & WDWMASK );512 513 308 if (GCF_XWDW & map) 514 309 return xw_aspectratio( map & WDWMASK ); 515 516 if (GCF_BGI & map)517 return bg_aspectratio( map & WDWMASK );518 310 519 311 if (GCF_PSF & map) 520 312 return ps_aspectratio(); 521 313 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 537 314 return 1.0; 538 315 … … 558 335 CSWAP(x,y) 559 336 560 if (GCF_GEM & map)561 gm_moveto( map & WDWMASK, x, y );562 563 337 if (GCF_XWDW & map) 564 338 xw_moveto( map & WDWMASK, x, y ); 565 566 if (GCF_BGI & map)567 bg_moveto( map & WDWMASK, x, y );568 339 569 340 if (GCF_MEM & map) … … 572 343 if (GCF_PSF & map) 573 344 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 );589 345 590 346 } /* end of gc_moveto */ … … 610 366 CSWAP(x,y) 611 367 612 if (GCF_GEM & map)613 gm_drawto( map & WDWMASK, style, x, y );614 615 368 if (GCF_XWDW & map) 616 369 xw_drawto( map & WDWMASK, style, x, y ); 617 618 if (GCF_BGI & map)619 bg_drawto( map & WDWMASK, style, x, y );620 370 621 371 if (GCF_MEM & map) … … 624 374 if (GCF_PSF & map) 625 375 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 );641 376 642 377 } /* end of gc_drawto */ … … 661 396 662 397 CSWAP(x,y) 663 664 if (GCF_GEM & map)665 gm_setpixel( map & WDWMASK, style, x, y );666 398 667 399 if (GCF_MEM & map) … … 698 430 if (cnt < 2) return; 699 431 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 706 432 if (GCF_XWDW & map) { 707 433 xw_arrayplot( map & WDWMASK, style, cnt, red, xoff, xinc, … … 710 436 } /*endif*/ 711 437 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 718 438 if (GCF_MEM & map) { 719 439 mm_arrayplot( map & WDWMASK, style, cnt, red, xoff, xinc, … … 728 448 } /*endif*/ 729 449 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 760 450 } /* end of gc_arrayplot */ 761 451 … … 776 466 /* executable code */ 777 467 778 if (GCF_GEM & map)779 gm_erase( map & WDWMASK );780 781 468 if (GCF_XWDW & map) 782 469 xw_erase( map & WDWMASK ); 783 784 if (GCF_BGI & map)785 bg_erase( map & WDWMASK );786 470 787 471 if (GCF_MEM & map) … … 790 474 if (GCF_PSF & map) 791 475 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 );807 476 808 477 } /* end of gc_erase */ … … 829 498 CSWAP(x,y) 830 499 831 if (GCF_GEM & map)832 gm_text( map & WDWMASK, style, x, y, text );833 834 500 if (GCF_XWDW & map) 835 501 xw_text( map & WDWMASK, style, x, y, text ); 836 837 if (GCF_BGI & map)838 bg_text( map & WDWMASK, style, x, y, text );839 502 840 503 if (GCF_MEM & map) … … 844 507 ps_text( style, x, y, text ); 845 508 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 861 509 } /* end of gc_text */ 862 510 … … 878 526 /* executable code */ 879 527 880 if (GCF_GEM & map)881 gm_write( map & WDWMASK, text );882 883 528 if (GCF_XWDW & map) 884 529 xw_write( map & WDWMASK, text ); 885 886 if (GCF_BGI & map)887 bg_write( map & WDWMASK, text );888 530 889 531 if (GCF_STDCH & map) 890 532 printf( "%s", text ); 891 533 892 if (GCF_VWS & map)893 vw_write( map & WDWMASK, text );894 895 if (GCF_TEK & map)896 tk_write( text );897 898 534 if (GCF_EXTERN & map && gcv_writeext != NULL) 899 535 (*gcv_writeext)( text ); … … 918 554 /* executable code */ 919 555 920 if (GCF_GEM & map)921 gm_wrtch( map & WDWMASK, ch );922 923 556 if (GCF_XWDW & map) 924 557 xw_wrtch( map & WDWMASK, ch ); 925 926 if (GCF_BGI & map)927 bg_wrtch( map & WDWMASK, ch );928 558 929 559 if (GCF_STDCH & map) 930 560 printf( "%c", ch ); 931 561 932 if (GCF_VWS & map)933 vw_wrtch( map & WDWMASK, ch );934 935 if (GCF_TEK & map)936 tk_wrtch( ch );937 938 562 } /* end of gc_wrtch */ 939 563 … … 953 577 { 954 578 /* 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 );961 579 962 580 if (GCF_STDCH & map) … … 983 601 /* executable code */ 984 602 985 if (GCF_GEM & map)986 return gm_txtheight( map & WDWMASK );987 988 if (GCF_BGI & map)989 return bg_txtheight( map & WDWMASK );990 991 603 if (GCF_STDCH & map) 992 604 return 24; … … 1012 624 /* executable code */ 1013 625 1014 if (GCF_GEM & map)1015 return gm_chheight( map & WDWMASK );1016 1017 626 if (GCF_XWDW & map) 1018 627 return xw_chheight( map & WDWMASK ); 1019 1020 if (GCF_BGI & map)1021 return bg_chheight( map & WDWMASK );1022 628 1023 629 return 0.0; … … 1043 649 /* executable code */ 1044 650 1045 if (GCF_GEM & map) {1046 gm_read( map & WDWMASK, maxlth, text );1047 return;1048 } /*endif*/1049 1050 651 if (GCF_XWDW & map) { 1051 652 xw_read( map & WDWMASK, maxlth, text ); … … 1053 654 } /*endif*/ 1054 655 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 1065 656 fgets( text, maxlth, stdin ); 1066 657 … … 1084 675 { 1085 676 /* executable code */ 1086 1087 if (GCF_GEM & map) {1088 gm_getloc( map & WDWMASK, x, y, ch );1089 CSWAP(*x,*y)1090 return;1091 } /*endif*/1092 677 1093 678 if (GCF_XWDW & map) { … … 1097 682 } /*endif*/ 1098 683 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 1117 684 } /* end of gc_getloc */ 1118 685 … … 1134 701 /* executable code */ 1135 702 1136 gm_set_outputdir( dir, status );1137 if (Severe(status)) return;1138 bg_set_outputdir( dir, status );1139 if (Severe(status)) return;1140 703 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 );1149 704 if (Severe(status)) return; 1150 705 xw_set_outputdir( dir, status ); 1151 706 if (Severe(status)) return; 1152 vw_set_outputdir( dir, status );1153 if (Severe(status)) return;1154 707 1155 708 } /* end of gc_set_outputdir */ … … 1172 725 /* executable code */ 1173 726 1174 gm_set_inputdir( dir, status );1175 if (Severe(status)) return;1176 bg_set_inputdir( dir, status );1177 if (Severe(status)) return;1178 727 ps_set_inputdir( dir, status ); 1179 728 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;1188 729 xw_set_inputdir( dir, status ); 1189 if (Severe(status)) return;1190 vw_set_inputdir( dir, status );1191 730 if (Severe(status)) return; 1192 731 … … 1212 751 /* executable code */ 1213 752 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 1224 753 if (GCF_PSF & map) { 1225 754 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 );1251 755 if (Severe(status)) return; 1252 756 } /*endif*/ … … 1314 818 1315 819 /* executable code */ 1316 1317 # ifdef BC_G_GEM1318 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 */1332 820 1333 821 # ifdef BC_G_XWDW … … 1347 835 # endif /* BC_G_XWDW */ 1348 836 1349 # ifdef BC_G_BGI1350 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 1365 837 # ifdef BC_G_POSTSCRIPT 1366 838 if (GCF_PSF & dst) { … … 1379 851 # endif /* BC_G_POSTSCRIPT */ 1380 852 1381 # ifdef BC_G_CALCOMP1382 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_TEK1398 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_HPGL1414 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_DESKJET1430 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_VWS1446 if (GCF_VWS & dst) {1447 vw_cleanup( src & WDWMASK, outf, status );1448 } /*endif*/1449 # endif /* BC_G_VWS */1450 1451 853 } /* end of gc_playback */ 1452 854 … … 1494 896 } /*endif*/ 1495 897 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 1516 898 } /* end of gc_closeplot */ 1517 899 1518 900 1519 901 1520 902 /*------------------------------------------------------------------------*/ 1521 903 … … 1539 921 ps_arrayswap( on_off ); 1540 922 # endif 1541 # ifdef BC_G_CALCOMP1542 cc_arrayswap( on_off );1543 # endif1544 # ifdef BC_G_TEK1545 tk_arrayswap( on_off );1546 # endif1547 # ifdef BC_G_HPGL1548 hp_arrayswap( on_off );1549 # endif1550 # ifdef BC_G_BGI1551 bg_arrayswap( on_off );1552 # endif1553 # ifdef BC_G_GEM1554 gm_arrayswap( on_off );1555 # endif1556 # ifdef BC_G_DESKJET1557 dj_arrayswap( on_off );1558 # endif1559 # ifdef BC_G_VWS1560 vw_arrayswap( on_off );1561 # endif1562 923 1563 924 } /* end of gc_swap */ -
SH_SHM/trunk/source/newgraph/memfile.c
r16 r341 357 357 sy_fbwrite( &r, (int)sizeof(MFC_REAL), 1L, mfv_file[id] ); 358 358 } else { 359 #ifdef XXX360 mf_open( id, mfv_defswitch, "a", status );361 if (*status != MFE_NOERROR) return;362 mf_writereal( id, r, status );363 #endif364 359 /* fprintf( stderr, "mf_writereal: ignored output for chan %d\n", id ); */ 365 360 } /*endif*/ … … 403 398 sy_fbwrite( &i, (int)sizeof(int), 1L, mfv_file[id] ); 404 399 } else { 405 #ifdef XXX406 mf_open( id, mfv_defswitch, "a", status );407 if (*status != MFE_NOERROR) return;408 mf_writeint( id, i, status );409 #endif410 400 /* fprintf( stderr, "mf_writeint: ignored output for chan %d\n", id ); */ 411 401 } /*endif*/ … … 449 439 sy_fbwrite( &l, (int)sizeof(long), 1L, mfv_file[id] ); 450 440 } else { 451 #ifdef XXX452 mf_open( id, mfv_defswitch, "a", status );453 if (*status != MFE_NOERROR) return;454 mf_writelong( id, l, status );455 #endif456 441 /* fprintf( stderr, "mf_writelong: ignored output for chan %d\n", id ); */ 457 442 } /*endif*/ -
SH_SHM/trunk/source/newgraph/psch.c
r16 r341 73 73 static int psv_strokenum=5000; /* max number of lineto's between stroke's */ 74 74 static char psv_headerfile[BC_FILELTH+1]=PSHEADER; /* PS header file */ 75 #ifdef XXX76 static char psv_printfmt[BC_LINELTH+1]= /* print command */77 {"lpr -P lj %s"};78 #endif79 75 80 76 /* prototypes of local routines */ … … 641 637 if (outf != NULL) strcpy( outf, str ); 642 638 643 # ifdef XXX644 /* send it to the printer */645 if (*psv_printfmt != '\0') {646 sprintf( cmd, psv_printfmt, str );647 sy_system( cmd, status );648 } /*endif*/649 # endif650 651 639 /* open PostScript file */ 652 640 psv_pf = sy_fopen( psv_currpsf, "w" ); -
SH_SHM/trunk/source/newgraph/psusrdef.h
r16 r341 222 222 223 223 #define ps_charsize(s,x,t) 224 #ifdef XXX225 void ps_charsize( int style, float size, STATUS *status );226 227 /* sets character size in units of display height228 *229 * parameters of routine230 * int style; input; style number231 * float size; input; size of character in units of display height232 * STATUS *status; output; return status233 */234 #endif235 236 /*----------------------------------------------------------------------------*/237 238 224 239 225 #define ps_linestyle(s,l,t) 240 #ifdef XXX241 void ps_linestyle( int style, int linestyle, STATUS *status );242 243 /* sets line linestyle in style block number "style"244 *245 * parameters of routine246 * int style; input; style block number247 * int linestyle; input; number of line style248 * STATUS *status; output; return status249 */250 #endif251 226 252 227 #define ps_linewidth(s,l,t) 253 228 254 /*----------------------------------------------------------------------------*/255 256 257 229 #define ps_color(s,r,g,b,t) 258 #ifdef XXX259 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 routine264 * int style; input; style block number265 * float red, green, blue; input; red, green and blue intensities (0..1)266 * STATUS *status; output; return status267 */268 #endif269 230 270 231 /*----------------------------------------------------------------------------*/ … … 286 247 287 248 #define ps_aspectratio() 1.0 288 #ifdef XXX289 float ps_aspectratio();290 291 /* returns ratio of width to height of output292 * no parameters293 */294 #endif295 296 /*----------------------------------------------------------------------------*/297 249 298 250 -
SH_SHM/trunk/source/newgraph/xwch.c
r48 r341 13 13 #include <ctype.h> 14 14 #include BASECNST 15 #ifdef BC_VAX16 #include <decw$include:xlib.h>17 #include <decw$include:xutil.h>18 #include <decw$include:xatom.h>19 #include <decw$include:cursorfont.h>20 #endif21 #ifdef BC_SUN22 15 #include <X11/Xlib.h> 23 16 #include <X11/Xatom.h> 24 17 #include <X11/cursorfont.h> 25 /* typedef char *caddr_t; */ /* I really don't know why this is necessary on HP */26 18 #include <X11/Xutil.h> 27 #endif28 19 #include BC_SYSBASE 29 20 #include "graphbas.h" … … 155 146 int i; /* counter */ 156 147 XSetWindowAttributes xswa; /* set attribute block */ 157 XSizeHints xsh; /* size hints */ 148 XSizeHints xsh; /* size hints */ 158 149 XWMHints xwmh; /* window manager hints */ 159 150 char str[MAXSTRLTH+1]; /* scratch string */ … … 1798 1789 &exact_color ); 1799 1790 } /*endif*/ 1800 #ifdef XXX1801 if (xstatus == 0) {1802 *status = XWE_COLALLOC;1803 return;1804 } /*endif*/1805 #endif1806 1791 XSetForeground( xwv_dsp, xwv_gc[style], screen_color.pixel ); 1807 1792 -
SH_SHM/trunk/source/qfileio.c
r16 r341 84 84 #define POSIDX (QFCL_POS&IDXMASK) /* index number of position */ 85 85 #define LTHIDX (QFCL_LTH&IDXMASK) /* index number of length */ 86 #ifdef XXX87 /* this was not portable, K.S. 17-Mar-2006 */88 #define R_EMPTY 0xffffffffL89 #endif90 86 #define R_EMPTY 5.37531e-38 91 87 #define R_EMPTY_MIN 5.375e-38 … … 2170 2166 *b++ = *(b+1); 2171 2167 *b++ = tmp; 2172 } /*endwhile*/ 2168 } /*endwhile*/ 2173 2169 2174 2170 } /* end of qf_dobyteswap */ -
SH_SHM/trunk/source/qfusrdef.h
r16 r341 35 35 #ifndef __QFUSRDEF 36 36 #define __QFUSRDEF 37 38 /* old values up to 15-Mar-2006 */39 #ifdef XXX40 #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 #endif46 37 47 38 #define QFC_IENTRY 500 /* number of integer entries */ -
SH_SHM/trunk/source/readgrn.c
r16 r341 50 50 51 51 /* separation character between root path and GRN subdirectories: */ 52 #ifdef BC_VAX53 #define EODEV ':'54 #else55 #ifdef BC_ATARI56 #define EODEV '\\'57 #else58 52 #define EODEV '/' 59 #endif60 #endif61 62 53 63 54 … … 770 761 NTIME nt2; /* time values of test record */ 771 762 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 # endif775 763 776 764 /* executable code */ … … 780 768 grn_readlog( "." ); 781 769 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 /* */785 770 if (fstat != 0) { 786 771 *status = GRNE_FREAD; … … 837 822 grn_readlog( "-" ); 838 823 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 /* */842 824 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 /* */848 825 testlth = 20; 849 826 grn_readlog( "t" ); 850 827 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 /* */854 828 if (fstat != 0) { /* very short file, just rewind it */ 855 829 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 /* */860 830 fseek( grn, 0, 0 ); /* on other machines a simple */ 861 # endif /* rewind should be ok */862 831 return; 863 832 } /*endif*/ 864 833 } /*endif*/ 865 834 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 /* */871 835 meansmp = GRN_MEANSMPREC; 872 836 grn_readlog( "m" ); … … 915 879 /* if (fstat != 0) {*status = GRNE_TOOSHORT; return;} */ 916 880 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 /* */922 881 setpos = (long)((tmp*0.8)-1)*GRN_RECLTH; 923 882 grn_readlog( "_" ); … … 925 884 if (fstat != 0) {*status = GRNE_TOOSHORT; return;} 926 885 } /*endif*/ 927 # ifdef XXX928 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 # endif942 886 943 887 /* try this record */ … … 1283 1227 diff[(*lth)++] = si; 1284 1228 frame += 2; 1285 # ifdef XXX1286 diff[(*lth)++] = (int)grn_get2bytes( frame, swap );1287 frame += 2;1288 diff[(*lth)++] = (int)grn_get2bytes( frame, swap );1289 frame += 2;1290 # endif1291 1229 break; 1292 1230 case 3: … … 1325 1263 1326 1264 /* executable code */ 1327 1328 # ifdef XXX1329 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 # endif1336 1265 1337 1266 slen = (int)strlen( station ); … … 1392 1321 * If the label is an empty string, device is assumed to hold the complete 1393 1322 * 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. 1396 1324 * The syntax of the list file is explained in the following example 1397 1325 * (please remind that the first three characters in each line " * " are … … 1466 1394 1467 1395 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 # else1475 1396 strcpy( glsname, device ); /* this is different on other */ 1476 1397 i = (int)strlen( glsname ) - 1; /* machines. Here the list */ 1477 1398 if (glsname[i] != EODEV && /* file is on the data */ 1478 glsname[i] != ':') { /* directory */ 1399 glsname[i] != ':') { /* directory */ 1479 1400 glsname[i+1] = EODEV; /* */ 1480 1401 glsname[i+2] = '\0'; /* */ 1481 1402 } /*endif*/ /* */ 1482 1403 strcat( glsname, "dirfile" ); /* */ 1483 # endif1484 1404 strcat( glsname, GRN_LISTFILEEXT ); 1485 1405 } else { … … 1556 1476 strcpy( glsname, device ); 1557 1477 if (*label != '\0') { /* on WORM disk the path must be generated */ 1558 # ifdef BC_VAX1559 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 */1565 1478 if (*chan == 'H') strcat( glsname, "grn_80/" ); 1566 1479 else if (*chan == 'B') strcat( glsname, "grn_20/" ); … … 1568 1481 strcat( glsname, station ); 1569 1482 strcat( glsname, "/" ); 1570 # endif /* no need for ATARI here */1571 1483 } /*endif*/ 1572 1484 for (i=0; i<filenum; i++) { … … 2242 2154 2243 2155 /*----------------------------------------------------------------------------*/ 2244 2245 2246 2247 void grn_set_vax_label_file( char fname[] )2248 2249 /* changes VAX name of VAX label file2250 *2251 * parameters of routine2252 * char fname[]; input; name of label file2253 */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 41 41 #endif 42 42 43 44 #ifdef BC_SUN45 43 #define SBYTE signed char 46 #else47 #define SBYTE char48 #endif49 50 51 44 52 45 /* error codes */ … … 251 244 * subsequent files on the volume. 252 245 * 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. 256 248 * The syntax of the list file is explained in the following example 257 249 * (please remind that the first three characters in each line " * " are … … 408 400 409 401 /*----------------------------------------------------------------------------*/ 410 411 412 void grn_set_vax_label_file( char fname[] );413 414 /* changes VAX name of VAX label file415 *416 * parameters of routine417 * char fname[]; input; name of label file418 */419 420 421 /*----------------------------------------------------------------------------*/ -
SH_SHM/trunk/source/seed_io/Makefile
r200 r341 40 40 pcname \ 41 41 copy_recs \ 42 swap_vax_recs \43 42 split_seed \ 44 43 edit_rectime \ … … 110 109 $(LINK.c) -o $@ $@.o $(LDFLAGS) $(LIBS) 111 110 112 swap_vax_recs: swap_vax_recs.o $(LIB_SOURCE) $(LIB_SEED)113 $(LINK.c) -o $@ $@.o $(LDFLAGS) $(LIBS)114 115 111 split_seed: split_seed.o $(LIB_SOURCE) $(LIB_SEED) 116 112 $(LINK.c) -o $@ $@.o $(LDFLAGS) $(LIBS) -
SH_SHM/trunk/source/seed_io/fir_resample.c
r16 r341 453 453 { 454 454 /* local variables */ 455 #ifdef XXX456 /*------------------------------------------*/457 FILE *fp; /* pointer to output file */458 /*------------------------------------------*/459 #endif460 455 static TSyBoolean first_call=TRUE;/* first call to routine */ 461 456 static TSyBoolean new_hdr=TRUE; /* new header required */ … … 515 510 /* return if this is final call */ 516 511 if (dat == NULL) return; 517 518 #ifdef XXX519 /*------------------------------------------*/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 #endif534 512 535 513 /* initialize header and open output file if not yet done */ -
SH_SHM/trunk/source/seed_io/seed_lib.c
r326 r341 3 3 * ========== 4 4 * 5 * $Revision: 1 65 $, $Date: 2011-02-17 12:03:57 +0100 (Do, 17 Feb2011) $5 * $Revision: 180 $, $Date: 2011-03-09 16:27:03 +0100 (Mi, 09 MÀr 2011) $ 6 6 * 7 7 * SEED library … … 47 47 * v 82, 13-Feb-07, K. Stammler, swap blockette 1000 in SwapHeader 48 48 * 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 49 50 */ 50 51 … … 54 55 #include <math.h> 55 56 #include "basecnst.h" 57 56 58 #ifdef BC_INC_UNISTD 57 59 #include BC_INC_UNISTD 58 60 #endif 61 59 62 #ifdef BC_INC_STDLIB 60 63 #include BC_INC_STDLIB 61 64 #endif 62 #ifdef BC_SUN 65 63 66 #include <fcntl.h> 64 67 #include <sys/types.h> 65 /* #include <sys/uio.h> */66 #endif67 #ifdef BC_VAX68 #include <file.h>69 #endif70 68 #include "sysbase.h" 71 69 #include "tcusrdef.h" … … 79 77 #include "steim1.h" 80 78 #undef ANSI_EXTENSIONS 81 82 #ifdef BC_VAX83 #define SEEK_SET 084 #endif85 86 79 87 80 … … 773 766 if (Severe(status)) {fclose(sfd); return;} 774 767 if (strcmp(curr.stream,lstream_str) != 0) continue; 775 if (strcmp(xaddinf,Seed_C_EmptyAddinfStr) != 0 768 if (strcmp(xaddinf,Seed_C_EmptyAddinfStr) != 0 776 769 && strcmp(xaddinf,curr.addinf) != 0) continue; 777 770 tdiff = tc_tdiff( start, curr.t_start, status ); … … 856 849 /*---------------------------------------------------------------------*/ 857 850 858 #ifdef XXX859 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 the864 * next possible time is returned865 *866 * parameters of routine867 * char stream_str[]; input; stream string like "bfo-vbb-z"868 * char start[]; input; start time869 * char dbfile[]; input; DB output file870 * SeedFileDescrT *fdescr; output; SEED file descriptor871 * STATUS *status; output; return status872 */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 #endif1075 1076 /*---------------------------------------------------------------------*/1077 1078 #ifdef XXX1079 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 the1084 * next possible time is returned1085 *1086 * parameters of routine1087 * char stream_str[]; input; stream string like "bfo-vbb-z"1088 * char start[]; input; start time1089 * char sfdfile[]; input; SEED file directory1090 * SeedFileDescrT *fdescr; output; SEED file descriptor1091 * STATUS *status; output; return status1092 */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_DATETIME1117 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 #else1124 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 #endif1129 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_DATETIME1169 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 #else1176 rddate = ntime.year*10000 + ntime.month*100 + ntime.day;1177 rdtime = (double)ntime.hour*10000.0 + (double)ntime.min*100.01178 + (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 #endif1185 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_DATETIME1212 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 #else1221 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 #endif1230 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_DATETIME1237 /* 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 #else1256 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 #endif1287 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 #endif1380 1381 /*---------------------------------------------------------------------*/1382 1383 1384 851 1385 852 void SeedSearchPosition( int chan, char sfdfile[], char stream_str[], … … 2130 1597 2131 1598 2132 /* #ifdef XXX */2133 2134 1599 #define BUFLTH 4096 2135 1600 /* should be enough for decoding one record */ … … 2235 1700 /* !!! set record number !!! */ 2236 1701 /* !!! apply time correction !!! */ 2237 1702 2238 1703 idx = 0; 2239 1704 quit = FALSE; … … 2313 1778 #undef FREE_AND_RETURN 2314 1779 2315 /* #endif */2316 1780 2317 1781 /*---------------------------------------------------------------------*/ … … 2568 2032 recsmp[i] = 0; 2569 2033 } /*endif*/ 2570 # ifdef XXX2571 /* 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 # endif2576 2034 actrecsmp = seedv_rec->no_of_samples; 2577 2035 } /*endif*/ … … 2672 2130 if (*smplth == getlth) { 2673 2131 sy_deallocmem( recsmp ); 2674 fprintf( stderr, 2132 fprintf( stderr, 2675 2133 " padding aborted, %ld zeroes remaining\n", padcnt ); 2676 2134 return; … … 3368 2826 if (!seedv_warnings) return; 3369 2827 3370 #ifdef XXX3371 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 #endif3384 2828 fprintf( stderr, "%s", text ); 3385 2829 -
SH_SHM/trunk/source/seed_io/seed_tidy.c
r306 r341 22 22 #include <string.h> 23 23 #include "basecnst.h" 24 24 25 #ifdef BC_INC_STDLIB 25 26 #include BC_INC_STDLIB 26 27 #endif 27 #ifdef BC_SUN 28 28 29 #include <fcntl.h> 29 30 #include <sys/types.h> 30 31 #include <sys/uio.h> 31 #endif32 32 #include "sysbase.h" 33 33 #include "erusrdef.h" … … 405 405 qsort( dsc, dsclth, sizeof(SeedFileDescrT), &TdQsortCompare ); 406 406 407 #ifdef XXX408 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 #endif425 426 407 } /* end of TdSortSfdList */ 427 408 … … 684 665 } /*endif*/ 685 666 SeedStoreReclth( (SeedDataHeaderT *)tdv_seedrec, dsc->reclth ); 686 #ifdef XXX687 if (F_LINUXDATA & flags) {688 SeedSwapHeader( (SeedDataHeaderT *)tdv_seedrec );689 } /*endif*/690 #endif691 667 TdPutRecord( tdv_seedrec, flags ); 692 668 } /*endif*/ -
SH_SHM/trunk/source/seed_io/seedquickdump.c
r260 r341 3 3 * =============== 4 4 * 5 * $Revision: 1 33 $, $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) $ 6 6 * 7 7 * Dumps out Headerinfo of SEED files. … … 242 242 if (seedhdr->first != 0) { 243 243 donly = (SeedDataOnlyBlocketteT *)(seedrec+(seedhdr->first)); 244 #ifdef XXX245 /* 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 #endif255 244 b1000found = (donly->block_id == 1000); 256 245 if (b1000found && donly->next_block > 0) { 257 246 dext = (SeedDataExtBlocketteT *)(seedrec+(donly->next_block)); 258 #ifdef XXX259 /* 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 #endif266 247 if (dext->block_id == 1001) { 267 248 time_quality = dext->timequal; … … 344 325 return 0; 345 326 346 #ifdef XXX347 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 #endif437 438 327 } /* end of main */ -
SH_SHM/trunk/source/seed_io/sfdlist_l.csh
r16 r341 26 26 if ("$6" != "") set byteoff="$6" 27 27 28 set oscrfile= x.$$.$outfile28 set oscrfile=$outfile.x.$$ 29 29 30 30 if (-e $scrfile) \rm $scrfile -
SH_SHM/trunk/source/seed_io/steim1.h
r16 r341 37 37 38 38 39 #ifdef IBM_PC40 #define XHUGE huge41 #define GM_ALLOC(NUM, SIZE) halloc(NUM, SIZE)42 #define GM_FREE hfree43 #else44 39 #define XHUGE 45 40 #define GM_ALLOC(NUM, SIZE) malloc((NUM)*(SIZE)) 46 41 #define GM_FREE free 47 #endif48 42 49 43 #ifdef ANSI_EXTENSIONS -
SH_SHM/trunk/source/seismhan.c
r322 r341 3 3 * ========== 4 4 * 5 * $Revision: 1 61 $, $Date: 2011-02-10 17:00:59 +0100 (Do, 10 Feb2011) $5 * $Revision: 180 $, $Date: 2011-03-09 16:27:03 +0100 (Mi, 09 MÀr 2011) $ 6 6 * 7 7 * main module of seismhandler program, command line version … … 59 59 #endif 60 60 61 /* VAX specific routines (usually FORTRAN subroutines) */62 #ifdef BC_GRFVAX63 #include "[-.local]fctxmngrf.h"64 #endif /* BC_GRFVAX */65 66 61 /* machine dependent path strings */ 67 62 #include BC_SHDIRS … … 231 226 SqlDeleteScratchFile(); 232 227 233 # ifndef BC_VAX234 return 0;235 # endif /* BC_VAX */236 228 237 229 } /* end of main */ -
SH_SHM/trunk/source/seusrdef.h
r16 r341 165 165 166 166 167 #ifdef BC_SUN168 169 167 void se_get_sh_environment( void ); 170 168 … … 174 172 */ 175 173 176 #endif177 178 174 179 175 /*------------------------------------------------------------------------*/ -
SH_SHM/trunk/source/shconst.h
r320 r341 3 3 * ========= 4 4 * 5 * $Revision: 1 59 $, $Date: 2011-02-10 15:46:45 +0100 (Do, 10 Feb2011) $5 * $Revision: 180 $, $Date: 2011-03-09 16:27:03 +0100 (Mi, 09 MÀr 2011) $ 6 6 * 7 7 * constants of seismhandler program … … 42 42 #define GW 2 43 43 /* graphics window */ 44 #ifdef BC_SUN45 44 #define SHC_FILE_PREFIX "SH_" 46 #else47 #define SHC_FILE_PREFIX "SH$"48 #endif49 45 /* file prefix of all SeismicHandler files */ 50 46 #define SHC_FILE_PREFIX_LENGTH 3 … … 176 172 177 173 178 179 /* ---------------------------------------------------- */180 /* the following type is used in the motif version only */181 /* ---------------------------------------------------- */182 183 184 #ifdef XXX185 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 #endif261 262 263 174 #endif /* __SHCONST */ -
SH_SHM/trunk/source/shdataba.c
r16 r341 74 74 /*------------------------------------------------------------------------*/ 75 75 76 MEMBLC 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 90 int 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 /*------------------------------------------------------------------------*/ 76 108 77 109 … … 89 121 90 122 /*------------------------------------------------------------------------*/ 91 92 123 93 124 … … 110 141 p = (MEMBLC *)sy_allocmem( 1L, (int)sizeof(MEMBLC), status ); 111 142 if (Severe(status)) return NULL; 143 112 144 /* initialise entries */ 113 145 for (i=0;i<EMAX_LONG; p->lm[i++]=MLEMPTY ){} … … 122 154 123 155 /* append to basic list */ 156 /* mwa: in fact, the first structure is never used */ 124 157 if (root_dbv[0].pm[EPN_NEXT] == NULL) { 125 158 p->pm[EPN_NEXT] = NULL; … … 136 169 } /*endif*/ 137 170 138 root_dbv[0].im[LISTCNT]++; 171 /* mwa: number of traces is cached in root[0]->im */ 172 root_dbv[0].im[LISTCNT]++; 139 173 if (crelistlth_dbv == SHC_ILISTLTH) { 140 174 *status = SHE_TLOVFL; 141 175 return p; 142 176 } /*endif*/ 177 178 /* mwa: addresses of newly created traces are stored separately */ 143 179 crelist_dbv[crelistlth_dbv++] = p; 144 180 return p; … … 462 498 463 499 if (map == 0) return MEMDLN; 464 if (GCF_TEK & map) return TEKDLN;465 if (GCF_CALCOMP & map) return CCDLN;466 500 return (map & GCF_NUMMASK); 467 501 … … 792 826 793 827 /* returns pointer info value 794 * 828 * 795 829 * parameters of routine 796 830 * MEMBLC *ptr; input; info block pointer -
SH_SHM/trunk/source/shdirs.h
r16 r341 37 37 38 38 /*=================================================================*/ 39 #ifdef BC_ATARI40 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_VAX57 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_SUN74 75 76 77 39 /* These values are not really needed. The SH_... environment variables 78 40 * have precedence over these definitions … … 88 50 #define DD_EXTPROG "/home/geo/ks/shc/util/" 89 51 90 91 92 #endif /* BC_SUN */93 52 /*=================================================================*/ -
SH_SHM/trunk/source/shexec.c
r30 r341 3 3 * ======== 4 4 * 5 * $Revision: 1 5 $, $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) $ 6 6 * 7 7 * main subroutines of SH … … 67 67 68 68 69 /* prototype for readk if used */70 #ifdef SH_SETUP_READK71 void mngrf_readk( PARAM *cmd, STATUS *status );72 #endif73 74 75 76 69 /*------------------------------------------------------------------------*/ 77 70 … … 104 97 105 98 /* get path names: either from UNIX environment ... */ 106 # ifdef BC_SUN107 99 se_get_sh_environment(); 108 # endif109 100 110 101 /* get session ID string */ 111 102 strcpy( id_shv, SHC_FILE_PREFIX ); 112 # ifdef BC_VAX113 103 mt_randomstr( 4, id_shv+SHC_FILE_PREFIX_LENGTH ); 114 104 strcat( id_shv, "_" ); 115 # endif /* BC_VAX */116 # ifdef BC_SUN117 mt_randomstr( 4, id_shv+SHC_FILE_PREFIX_LENGTH );118 strcat( id_shv, "_" );119 # endif /* BC_SUN */120 # ifdef BC_ATARI121 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 */124 105 125 106 strcpy( str, shd_scratch ); … … 293 274 } else if (cp_cmdverb(cmd,"CUT")) { 294 275 mn3_cut( cmd, status ); 276 *redraw = TRUE; 295 277 } else { 296 278 mn0_callproc( cmd, status ); … … 372 354 mn3_fold( cmd, status ); 373 355 *redraw = TRUE; 374 # ifdef BC_GRFVAX375 } else if (cp_cmdverb(cmd,"FOLDN")) {376 mngrf_fold( cmd, status );377 *redraw = TRUE;378 # endif /* BC_GRFVAX */379 356 } else { 380 357 mn0_callproc( cmd, status ); … … 411 388 mn4_int( cmd, status ); 412 389 *redraw = TRUE; 413 # ifdef XXX414 } else if (cp_cmdverb(cmd,"INVERSE")) {415 mngrf_inverse( cmd, status );416 *redraw = TRUE;417 # endif /* XXX */418 390 } else { 419 391 mn0_callproc( cmd, status ); … … 523 495 mni_readf( cmd, status ); 524 496 *redraw = TRUE; 525 #ifdef XXX526 } else if (cp_cmdverb(cmd,"READG")) {527 mn5_readg( cmd, status );528 *redraw = TRUE;529 #endif530 # ifdef SH_SETUP_READK531 } else if (cp_cmdverb(cmd,"READK")) {532 mngrf_readk( cmd, status );533 *redraw = TRUE;534 # endif /* SH_SETUP_READK */535 497 } else if (cp_cmdverb(cmd,"READS")) { 536 498 mni_reads( cmd, status ); 537 499 *redraw = TRUE; 538 # ifdef BC_GRFVAX539 } 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 */546 500 } else if (cp_cmdverb(cmd,"REPLACE")) { 547 501 mn5_replace( cmd, status ); … … 942 896 943 897 944 #ifdef BC_SUN945 946 947 898 void se_get_sh_environment( void ) 948 899 … … 969 920 970 921 971 #endif972 973 974 922 975 923 /*------------------------------------------------------------------------*/ -
SH_SHM/trunk/source/shlib.c
r16 r341 213 213 case 'S': *flagbits |= GCF_STDCH; break; 214 214 case 'F': *flagbits |= GCF_FILE; break; 215 case 'V': *flagbits |= GCF_VWS; break;216 215 case 'X': *flagbits |= GCF_XWDW; break; 217 case 'C': *flagbits |= GCF_CALCOMP; break;218 case 'T': *flagbits |= GCF_TEK; break;219 216 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;224 217 case 'E': *flagbits |= GCF_EXTERN; break; 225 218 default: … … 866 859 867 860 if (nomean) { 868 #ifdef XXX869 /* 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 #endif877 861 /* take here the maximum value out of the decimation window */ 878 862 ocnt = 0; -
SH_SHM/trunk/source/shmath.c
r16 r341 422 422 aez = 0.0; aen = sina; aee = -cosa; 423 423 } else if (type == SHC_ROT_ZNE_TO_UVW) { 424 # ifdef XXX425 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 # endif431 424 azz = SQRT1_3; anz = SQRT1_3; aez = SQRT1_3; 432 425 azn = 0.0; ann = SQRT1_2; aen = -SQRT1_2; 433 426 aze = -SQRT2_3; ane = 0.5*SQRT2_3; aee = 0.5*SQRT2_3; 434 427 } else if (type == SHC_ROT_UVW_TO_ZNE) { 435 # ifdef XXX436 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 # endif440 428 azz = SQRT1_3; azn = SQRT1_3; aze = SQRT1_3; 441 429 anz = 0.0; ann = SQRT1_2; ane = -SQRT1_2; … … 733 721 /*--------------------------------------------------------------------------*/ 734 722 735 #ifdef XXX736 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-fashioned741 * FORTRAN routine.742 *743 * parameters of routine744 * long lx; input; length of complex array745 * COMPLEX cx[]; modify; array to be fourier transformed746 * REAL signi; input; sign of transformation747 */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 795 723 796 724 void mt_deg_to_km( int listlth, STATLOC lat[], STATLOC lon[], … … 814 742 /* executable code */ 815 743 816 #ifdef XXX817 /* this was changed at 20-Dec-2004 */818 /* reference location is first element */819 ref_lat = *lat;820 ref_lon = *lon;821 #endif822 744 /* reference location is last element */ 823 745 ref_lat = lat[listlth-1]; … … 825 747 826 748 while (listlth-- > 0) { 827 *x++ = (REAL)((*lon++ - ref_lon) * 749 *x++ = (REAL)((*lon++ - ref_lon) * 828 750 SHC_DEG_TO_KM * cos((*lat)/SHC_RAD_TO_DEG)); 829 751 *y++ = (REAL)((*lat++ - ref_lat) * SHC_DEG_TO_KM); … … 924 846 y[i] -= ymean; 925 847 } /*endfor*/ 926 927 # ifdef SH_DEBUGXXX928 for (i=0; i<listlth; i++)929 printf( "--sh-debug-> %f %f %f\n", x[i], y[i], time[i] );930 # endif931 848 932 849 tx = ty = tq = 0.0; … … 1283 1200 printf( "--sh-debug-> (err) sx,sy: %f,%f\n", sx, sy ); 1284 1201 # endif 1285 1202 1286 1203 /* compute center */ 1287 1204 xc = yc = 0.0; … … 1306 1223 xc -= refx; 1307 1224 yc -= refy; 1308 1225 1309 1226 tx = ty = 0.0; 1310 1227 axx = axy = ayx = ayy = 0.0; 1311 1228 1312 1229 if (listlth == 3) { 1313 1230 tx = time[1]; … … 1327 1244 ayx = axy; 1328 1245 } /*endif */ 1329 1246 1330 1247 /* compute determinant, Cramer's rule */ 1331 1248 det = axx*ayy - axy*ayx; … … 1346 1263 1347 1264 if (resid != NULL) *resid++ = dkx; 1348 1265 1349 1266 # ifdef SH_DEBUG 1350 1267 printf( "--sh-debug-> (ref%02d) dkx: %f, dky: %f\n", refstat, dkx, dky ); … … 1818 1735 /*----------------------------------------------------------------------------*/ 1819 1736 1820 #ifdef XXX1821 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 given1826 * by (lat1,lon1) and (lat2,lon2)1827 *1828 * parameters of routine1829 * REAL lat1, lon1; input; first location in degrees1830 * REAL lat2, lon2; input; second location in degrees1831 * REAL *dist; output; distance in degrees1832 * 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) and1869 * a distance "dist" in direction "azim"1870 *1871 * parameters of routine1872 * REAL lat, lon; input; input location in degrees1873 * REAL dist; input; distance in degrees1874 * REAL azim; input; direction1875 * REAL *latx, *lonx; output; output location1876 */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 #endif1911 1912 /*----------------------------------------------------------------------------*/1913 1914 1915 1737 1916 1738 void mt_fit_gauss( REAL x[], SAMPLE y[], int ndata, REAL ampl, 1917 1739 int maxiter, REAL *pos, REAL *width, int *iter, STATUS *status ) 1918 1740 1919 /* fits a gauss function of position "*pos" and width "*width" to 1741 /* fits a gauss function of position "*pos" and width "*width" to 1920 1742 * the data given in x[0..ndata-1] and y[0..ndata-]. 1921 1743 * … … 2261 2083 2262 2084 2263 void mt_fix_gap( SAMPLE dat[], long lth, REAL const_value, BOOLEAN konst, 2085 void mt_fix_gap( SAMPLE dat[], long lth, REAL const_value, BOOLEAN konst, 2264 2086 BOOLEAN one) 2265 2087 … … 2306 2128 next_value = dat[s]; 2307 2129 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); 2309 2131 if (konst) { 2310 2132 slope=0.0; 2311 last_value=(next_value + last_value)/2.0; 2133 last_value=(next_value + last_value)/2.0; 2312 2134 } /*endif*/ 2313 2135 if (value_counter> (int) !one) 2314 for (i=0; i<value_counter; i++) 2136 for (i=0; i<value_counter; i++) 2315 2137 dat[start_cnt++] = last_value + (REAL)(i+1)*slope; 2316 2138 value_counter = 0; … … 2336 2158 if (konst) { 2337 2159 slope=0.0; 2338 last_value=(next_value + last_value)/2.0; 2160 last_value=(next_value + last_value)/2.0; 2339 2161 } /*endif*/ 2340 2162 if (value_counter> (int) !one) -
SH_SHM/trunk/source/shmenu0.c
r16 r341 273 273 printf( 274 274 "*SH: obsolete command PATH COMMAND2, consider using string list in COMMAND path\n" ); 275 printf( 275 printf( 276 276 "*SH: translated in FCT PATH COMMAND |.|,|$SH_COMMAND|,|%s|\n", s_par ); 277 277 if (strlen(s_par) > cBcLongStrLth-14) { … … 513 513 if (*status != SHE_NOERROR) return; 514 514 strcpy( str, "UNKNOWN" ); 515 # ifdef BC_VAX516 strcpy( str, "VAX-VMS" );517 # endif518 # ifdef BC_SUN519 515 strcpy( str, "UNIX" ); 520 # endif521 # ifdef BC_ATARI522 strcpy( str, "ATARI-TOS" );523 # endif524 # ifdef BC_IBM525 strcpy( str, "MS-DOS" );526 # endif527 516 sl_setsymbol( str2, str, &locstat ); 528 517 } else if (strcmp(str,"OSCALL") == 0) { … … 548 537 sl_setsymbol( str2, str, &locstat ); /* save output if possible */ 549 538 } else { 550 #ifdef XXX551 *status = SHE_UKFCT;552 err_setcontext( " ## subfct " ); err_setcontext( str );553 #endif554 539 printf( "*SH: illegal fct item %s\n", str ); 555 540 } /*endif*/ -
SH_SHM/trunk/source/shmenu3.c
r16 r341 470 470 sprintf( str, "%e", res ); 471 471 sl_setsymbol( symbol, str, status ); 472 if (Severe(status)) return; 472 if (Severe(status)) return; 473 473 } else { 474 474 *status = SHE_UKKEY; … … 639 639 640 640 /* 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, 642 642 flth, db_getp(fil,EP_DATA,NULL), datptr ); 643 643 … … 1099 1099 start -= loff; 1100 1100 trclth += roff+loff; 1101 mt_mend( start, trclth, loff, roff, widening, 1101 mt_mend( start, trclth, loff, roff, widening, 1102 1102 db_getr(trc,ER_DELTA,NULL), pol, status ); 1103 1103 … … 1257 1257 *mov++ = 0.; 1258 1258 1259 # ifdef XXX1260 for (i=0; i<outlth; ccr[i++] = 0.) {}1261 ccr[t0] = 1.0;1262 # endif1263 1264 1259 mt_levinson( ac, ccr, f, outlth, status ); 1265 1260 if (Severe(status)) { -
SH_SHM/trunk/source/shmenu4.c
r70 r341 441 441 442 442 443 443 444 444 /*--------------------------------------------------------------------*/ 445 445 … … 1215 1215 /* compute FFT */ 1216 1216 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 */ 1218 1218 /* array arguments */ 1219 1219 /* originally this data array was read from file */ 1220 1220 1221 #ifdef XXX1222 /* 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 #endif1233 1221 1234 1222 /* initialise trace parameters */ -
SH_SHM/trunk/source/shmenu5.c
r16 r341 61 61 62 62 /* global variables */ 63 #ifdef XXX64 SHT_GLOBAL_SET *mn5v_global=NULL; /* for use in motif version only */65 #endif66 63 void (*mn5v_external_routine)( char cmd[], STATUS *status)=NULL; 67 64 /* external routine */ … … 410 407 /*----------------------------------------------------------------------------*/ 411 408 412 #ifdef XXX413 414 void mn5_readg( PARAM *par, STATUS *status )415 416 /* reads traces from GRN files417 * par 1: device418 * par 2: start time419 * par 3: length in seconds420 * par 4: station list421 * par 5: component list422 * par 6: sample rate423 *424 * parameters of routine425 * PARAM *par; input; command parameter426 * int *status; output; return status427 */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_SUN493 *status = BC_NOERROR;494 # else495 if (Severe(status)) return;496 # endif497 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 #endif588 589 /*----------------------------------------------------------------------------*/590 591 592 593 409 void mn5_decimate( PARAM *par, STATUS *status ) 594 410 … … 949 765 /*--------------------------------------------------------------------*/ 950 766 951 #ifdef XXX952 953 void mn5_set_shmsetup_pointer( SHT_GLOBAL_SET *ptr )954 955 /* special routine to set pointer to global variable of motif modules956 *957 * parameters of routine958 * SHT_GLOBAL_SET *ptr; input; specifies address of global paramters959 */960 {961 /* executable code */962 963 mn5v_global = ptr;964 965 } /* end of mn5_shmsetup_pointer */966 967 #endif968 969 /*--------------------------------------------------------------------*/970 971 972 973 767 void mn5_shmsetup( PARAM *par, STATUS *status ) 974 768 … … 982 776 */ 983 777 { 984 /* local variables */985 #ifdef XXX986 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 #endif991 992 778 /* executable code */ 993 779 994 780 printf( "*SHM: command SHMSETUP obsolete, please use 'Configure' instead\n" ); 995 781 return; 996 997 #ifdef XXX998 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) == 01199 || 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 #endif1440 782 1441 783 } /* end of mn5_shmsetup */ … … 1700 1042 void mn5_fixgap( PARAM *par, STATUS *status ) 1701 1043 1702 /* removes zeros from traces introducing a straight line 1044 /* removes zeros from traces introducing a straight line 1703 1045 connecting non-zero values 1704 1046 * par 1: trace list -
SH_SHM/trunk/source/shmenuio.c
r69 r341 262 262 datlth = qf_getl( QFCL_LTH, NULL ); 263 263 } /*endif*/ 264 264 265 265 ml_inittrc( blcptr, sdatptr, datlth, dt ); 266 266 … … 1319 1319 FILE *flagf; /* pointer to flag file */ 1320 1320 int flags; /* data flags */ 1321 #ifdef XXX1322 BOOLEAN no_bugfix; /* do not call jukebox bugfix */1323 #endif1324 1321 1325 1322 /* executable code */ … … 1690 1687 } /*endif*/ 1691 1688 if (Severe(status)) {if (ef != NULL) sy_fclose(ef); return;} 1692 1689 1693 1690 db_newlist(); 1694 1691 trc = db_create( status ); 1695 1692 if (Severe(status)) {if (ef != NULL) sy_fclose(ef); return;} 1696 1693 1697 1694 if (ef != NULL) { 1698 1695 while (fgets(entstr,BC_LINELTH,ef) != NULL) { … … 1755 1752 fseek( ef, 0, 0 ); 1756 1753 } /*endif*/ 1757 1754 1758 1755 sh_frgn_geti( "LENGTH", &trclth, status ); 1759 1756 if (Severe(status)) {db_delete(trc); return;} 1760 1757 sh_frgn_getr( "DELTA", &dt, status ); 1761 1758 if (Severe(status)) {db_delete(trc); return;} 1762 1759 1763 1760 datptr = (SAMPLE *)sy_allocmem( trclth, (int)sizeof(SAMPLE), status ); 1764 1761 if (Severe(status)) {db_delete(trc); return;} 1765 1762 sh_frgn_read( datptr ); 1766 1763 1767 1764 ml_inittrc( trc, datptr, trclth, dt ); 1768 1765 db_setr( trc, ER_TORIG, 0.0, NULL ); -
SH_SHM/trunk/source/shmidlev.c
r16 r341 179 179 } /*endfor*/ 180 180 return; 181 # ifdef XXX182 } 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 */194 181 } else { 195 182 map = gc; … … 361 348 * 362 349 * parameters of routine 363 * PARAM *par; input; menu parameter 350 * PARAM *par; input; menu parameter 364 351 * int pos; input; parameter number 365 352 * int wdw; input; window number for prompting -
SH_SHM/trunk/source/shsymbol.c
r86 r341 46 46 47 47 48 #define MAXNAMELTH 1548 #define MAXNAMELTH 50 49 49 /* maximum length of symbol name */ 50 #define MAXSYMNUM 2050 #define MAXSYMNUM 50 51 51 /* maximum number of symbols */ 52 52 #define MAXSET 2 -
SH_SHM/trunk/source/shtransl.c
r16 r341 367 367 return; 368 368 } /*endif*/ 369 # ifdef XXX370 } 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 */378 369 } else { 379 370 dln = gc; /* (gc == 0) ? SHC_HIDDENLIST : gc; */ … … 469 460 STATUS *status ) 470 461 471 /* returns internal variable 462 /* returns internal variable 472 463 * 473 464 * parameters of routine -
SH_SHM/trunk/source/sysbase.h
r16 r341 42 42 #include "basecnst.h" 43 43 #endif 44 45 46 47 /******************************************************************48 *** ATARI version ***49 ******************************************************************/50 51 52 53 #ifdef BC_ATARI54 55 56 /* one byte integer */57 #define BYTE char58 59 /* boolean type */60 #define BOOLEAN int61 62 /* boolean values TRUE & FALSE */63 #ifdef BC_DEFINE_TRUE_FALSE64 #define TRUE (1)65 #define FALSE (0)66 #endif67 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 194 #define SYC_FF_DIR 295 #define SYC_FF_EXT 496 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 fread114 115 /* write to text file, is not yet used */116 #define sy_fwrite fwrite117 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 0xffffL147 148 /* maximum integer */149 #define SYC_MAXINT 0x7fffL150 151 /* minimum integer */152 #define SYC_MININT 0x8000L153 154 /* maximum long */155 #define SYC_MAXLONG 0x7fffffffL156 157 /* minimum long */158 #define SYC_MINLONG 0x80000000L159 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_SYSCALL170 extern int syv_apid;171 #endif172 173 /* include fileopen */174 #ifndef __FOUSRDEF175 #include BC_FOUSRDEF176 #endif177 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 parameters190 */191 192 193 /*------------------------------------------------------------------------*/194 195 196 #ifdef BC_SHARE_CPU197 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 parameters208 */209 210 211 /*------------------------------------------------------------------------*/212 213 214 void sy_debuginfo( char info[] );215 216 /* transfers debug information217 *218 * parameters of routine219 * char info[]; input; info string220 */221 222 223 /*------------------------------------------------------------------------*/224 225 226 char *sy_getmessage( void );227 228 /* returns message string from external source229 *230 * no parameters231 */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() NULL243 244 245 #endif /* BC_SHARE_CPU */