~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to incl/ftoc_hpr.h

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)ftoc_hpr.h       19.1 (ESO-IPG) 02/25/03 13:49:32 */
 
2
/*++++++++++++++
 
3
.IDENTIFICATION ftoc_hpr.h
 
4
.LANGUAGE       C
 
5
.AUTHOR         Francois Ochsenbein
 
6
.ENVIRONMENT    HP9000s800 . Risc CPU. (Tested on a HP720)
 
7
.KEYWORDS       
 
8
.VERSION  1.0   10-Sep-1990
 
9
.VERSION  2.0   29-Oct-1991 CG. 
 
10
.COMMENTS       The length of fortran strings are extra integers
 
11
                FOLLOWING the other arguments.
 
12
---------------*/
 
13
 
 
14
#ifndef  FTOC_DEF               /* Avoid redefinitions */
 
15
#define  FTOC_DEF       0
 
16
 
 
17
typedef int fint2c;             /* Fortran INT passed to C */
 
18
typedef int flong2c;            /* Fortran LONG passed to C */
 
19
 
 
20
#include <stdarg.h>
 
21
char *ftoc_get();
 
22
 
 
23
        /* In the following definitions:
 
24
           p  is the positional argument number (starting from 1)
 
25
           a  is the total number of FORTRAN arguments
 
26
           s  counts how many CHARACTER arguments exist before p
 
27
           t  is the data type
 
28
 
 
29
           Example: if s' are CHARACTER arguments in the calling sequence
 
30
           CALL SSP(a,b,s1,d,s2,s3)
 
31
           ==> a  is defined by (p=1, a=6, s=0)
 
32
           ==> b  is defined by (p=2, a=6, s=0)
 
33
           ==> s1 is defined by (p=3, a=6, s=0)
 
34
           ==> d  is defined by (p=4, a=6, s=1)
 
35
           ==> s2 is defined by (p=5, a=6, s=1)
 
36
           ==> s3 is defined by (p=6, a=6, s=2)
 
37
         */
 
38
 
 
39
#define PARAM(p,a,s,t)          (((t *)(Cargs))[-(p)])
 
40
#define CHAR_LOC(p,a,s)         PARAM(p,a,s,char *)
 
41
#define CHAR_LEN(p,a,s)         PARAM(s+a+1,a,s,int)
 
42
 
 
43
#define C_STRING(p,a,s)         ftoc_get(CHAR_LOC(p,a,s),CHAR_LEN(p,a,s),0)
 
44
#define STRIPPED_STRING(p,a,s)  ftoc_get(CHAR_LOC(p,a,s),CHAR_LEN(p,a,s),1)
 
45
#define STRFCOPY(p,a,s,cs)      ftoc_cpy(CHAR_LOC(p,a,s),cs,CHAR_LEN(p,a,s))
 
46
 
 
47
#endif