3
.IDENTIFICATION ftoc_solaris.h
5
.AUTHOR Carlos GuiraoSO - Garching
6
.ENVIRONMENT with Solaris 8 and g77+gcc V3.3
7
.VERSION 031107 creation
8
.COMMENTS Using &noargs instead of Cargs. Cargs[-1]=&noargs, but
9
for strange reasons Cargs is not initialized correctly
12
#ifndef FTOC_DEF /* Avoid redefinitions */
15
typedef int fint2c; /* Fortran INT passed to C */
16
typedef int flong2c; /* Fortran LONG passed to C */
22
/* In the following definitions:
23
p is the positional argument number (starting from 1)
24
a is the total number of FORTRAN arguments
25
s counts how many CHARACTER arguments exist before p
28
Example: if s' are CHARACTER arguments in the calling sequence
29
CALL SSP(a,b,s1,d,s2,s3)
30
==> a is defined by (p=1, a=6, s=0)
31
==> b is defined by (p=2, a=6, s=0)
32
==> s1 is defined by (p=3, a=6, s=0)
33
==> d is defined by (p=4, a=6, s=1)
34
==> s2 is defined by (p=5, a=6, s=1)
35
==> s3 is defined by (p=6, a=6, s=2)
38
#define PARAM(p,a,s,t) (((t *)(&noargs))[p - 1])
39
#define CHAR_LOC(p,a,s) PARAM(p,a,s,char *)
40
#define CHAR_LEN(p,a,s) PARAM(s+a+1,a,s,int)
42
#define C_STRING(p,a,s) ftoc_get(CHAR_LOC(p,a,s),CHAR_LEN(p,a,s),0)
43
#define STRIPPED_STRING(p,a,s) ftoc_get(CHAR_LOC(p,a,s),CHAR_LEN(p,a,s),1)
44
#define STRFCOPY(p,a,s,cs) ftoc_cpy(CHAR_LOC(p,a,s),cs,CHAR_LEN(p,a,s))