1
/* @(#)ftoc_fx.h 19.1 (ESO-IPG) 02/25/03 13:49:32 */
3
.IDENTIFICATION ftoc_fx.h
5
.AUTHOR Francois Ochsenbein & Carlos Guirao
6
.ENVIRONMENT SGI/IRIX V5.2
8
.VERSION 1.0 25-Nov-1994
10
#ifndef FTOC_DEF /* Avoid redefinitions */
13
typedef int fint2c; /* Fortran INT passed to C */
14
typedef int flong2c; /* Fortran LONG passed to C */
19
/* In the following definitions:
20
p is the positional argument number (starting from 1)
21
a is the total number of FORTRAN arguments
22
s counts how many CHARACTER arguments exist before p
25
Example: if s' are CHARACTER arguments in the calling sequence
26
CALL SSP(a,b,s1,d,s2,s3)
27
==> a is defined by (p=1, a=6, s=0)
28
==> b is defined by (p=2, a=6, s=0)
29
==> s1 is defined by (p=3, a=6, s=0)
30
==> d is defined by (p=4, a=6, s=1)
31
==> s2 is defined by (p=5, a=6, s=1)
32
==> s3 is defined by (p=6, a=6, s=2)
35
#define align4(list) ((unsigned int)((list)+3) & ~(unsigned int)3)
36
#define PARAM(p,a,s,t) (((t *)(align4(Cargs)))[p - 1])
37
#define CHAR_LOC(p,a,s) PARAM(p,a,s,char *)
38
#define CHAR_LEN(p,a,s) PARAM(s+a+1,a,s,int)
40
#define C_STRING(p,a,s) ftoc_get(CHAR_LOC(p,a,s),CHAR_LEN(p,a,s),0)
41
#define STRIPPED_STRING(p,a,s) ftoc_get(CHAR_LOC(p,a,s),CHAR_LEN(p,a,s),1)
42
#define STRFCOPY(p,a,s,cs) ftoc_cpy(CHAR_LOC(p,a,s),cs,CHAR_LEN(p,a,s))