aboutsummaryrefslogtreecommitdiff
path: root/osrc/getosfile.c
blob: a1d03580e8c14cb2aec527046c1d79c42ff21bff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* Handle various system requirements for trailing underscores, or other 
   fortran-to-C interface shenanigans thru defines for routine names  
   The provided set gives the option of setting a compile flag -DUNDERSCORE
   to include underscores on C routine name symbols */

#ifdef UNDERSCORE

#define GETOSFILE  getosfile_ 

#endif

void
GETOSFILE(osfile,len)
     char *osfile;
     int  *len;
{  
   char *bufp;
   int l;

/* get environment variable OSMAP for location of OS map data file */
   bufp = getenv("OSMAP");

   /* printf("bufp: %s\n",bufp);
      printf("osfile: %s\n",osfile); */

   if(bufp){ 
      strcpy(osfile,bufp);
      l = strlen(bufp);
      }
    else {
      l = 0;
      }

   *len = l;

   /*   printf("len %d\n",*len); */
}