home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Science / Science.zip / gmt_os2.zip / src / test_gmt_shore.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-20  |  1.3 KB  |  35 lines

  1. /*--------------------------------------------------------------------
  2.  *    The GMT-system:    @(#)gmt_shore.c    3.9  26 Jun 1995
  3.  *
  4.  *    Copyright (c) 1991-1995 by P. Wessel and W. H. F. Smith
  5.  *    See README file for copying and redistribution conditions.
  6.  *--------------------------------------------------------------------*/
  7.  
  8. /* int find_resolutions (fh) */
  9. #include "gmt_os2.h"
  10. #include <stdlib.h>
  11. #include <stdio.h>
  12. #include <unistd.h>
  13. void main ()
  14. {
  15.     /* Checks if full and high resolution coastline files are available */
  16.  
  17.     char file[80];
  18.    int fh[2];
  19. /*----------------------------------------------------------------------
  20.  *      Modifications made to permit the use of an environmental variable
  21.  *      (defined in the header file gmt_os2.h) to be used to specify the
  22.  *      data path for the GMT data files required.
  23.  *----------------------------------------------------------------------*/
  24.    char *gmt_data_path;
  25.    gmt_data_path = getenv (GMTDATAPATH);
  26.     sprintf (file, "%s/binned_shore_l.cdf\0", gmt_data_path);
  27.    printf ("\nGMTDATAPATH is : %s\n",gmt_data_path);
  28.    printf ("\nLooking for file named %s\n",&file[0]);
  29.        fh[0] = access (file, R_OK); 
  30.     sprintf (file, "%s/binned_shore_i.cdf\0", gmt_data_path);
  31.        fh[1] = access (file, R_OK);
  32.       printf ("\nAccess codes are %d %d\n",fh[0],fh[1]);
  33.    exit (0);
  34. }
  35.