1
/*===========================================================================
2
Copyright (C) 1995-2009 European Southern Observatory (ESO)
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of
7
the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public
15
License along with this program; if not, write to the Free
16
Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
19
Correspondence concerning ESO-MIDAS should be addressed as follows:
20
Internet e-mail: midas@eso.org
21
Postal address: European Southern Observatory
22
Data Management Division
23
Karl-Schwarzschild-Strasse 2
24
D 85748 Garching bei Muenchen
26
===========================================================================*/
28
/*++++++++++++++++++++++++ stloc.fc +++++++++++++++++++++++++++++++++++++++
30
.IDENTIFICATION Module stloc.fc
32
Module contains layer between the keyword related FORTRAN STxxxx interfaces
33
and the SC_interfaces written in (hopefully independent) C
34
.AUTHOR K. Banse ESO - Garching
35
.KEYWORDS standard interfaces.
36
.ENVIRONMENT FORTRAN and C standards
37
.VERSION [1.00] 871207: created from SXFTOC.C
38
.VERSION [2.60] 880411: modified new version - the last one
39
.VERSION [2.70] 900316: fix problems with TEXT_LEN+2
42
-----------------------------------------------------------------------------*/
48
#include <midas_def.h>
51
static char Strip1[258];
52
static char *str_strip1 = Strip1;
53
static char Strip2[258];
54
static char *str_strip2 = Strip2;
55
static char Strip3[258];
56
static char *str_strip3 = Strip3;
58
static char *str_loc1;
59
static char *str_loc2;
60
static char *str_loc3;
61
static int lenloc1, lenloc2, lenloc3;
67
/*==========================================================================*/
69
ROUTINE STLOC(idx,flag,str,lstr)
72
char *str; /* F77 String */
96
printf("idx = %d, flag = %d, str = %x, lstr = %d\n",*idx,*flag,str,lstr);
97
printf("str_loc1 = %x, lenloc1 = %d\n",str_loc1,lenloc1);
98
...goes into the next block...
99
printf("str[0...3] as int =%d,%d,%d,%d,\n",*str,*(str+1),*(str+2),*(str+3));
100
printf("str[0...3] =%c,%c,%c,%c, kk = %d\n",
101
*str,*(str+1),*(str+2),*(str+3),kk);
108
memset((void *)str,32,kk); /* blank out char_loc */
115
/*==========================================================================*/
117
ROUTINE STSTR(idx,str,lstr)
119
char *str; /* F77 String */
135
"!OJO! STRSTR called with string of length = %d, i.e. > 256",ln);
141
for (m=ln-1; m>0 ;m--)
144
if ((cc != ' ') && (cc != '\0') && (cc != '\t'))
154
(void) strncpy(Strip1,str,ln);
159
(void) strncpy(Strip2,str,ln);
164
(void) strncpy(Strip3,str,ln);
171
/*==========================================================================*/
173
char * strp_pntr(jdx)
187
/*==========================================================================*/
189
char * loc_pntr(jdx,loclen)