![Silicon Graphics IRIS Workstation User Manual Download Page 84](http://html.mh-extra.com/html/silicon-graphics/iris-workstation/iris-workstation_user-manual_1271586084.webp)
80 IRIS WORKSTATION GUIDE
Version 1.0
Appendix D:
int
and will also be passed as a 32-bit value. Storing into any of these
parameters will not have any effect on the original FORTRAN data.
• A copy of the character string whose address is
str1
would be
passed. C may store into this freely without affecting FORTRAN.
The character string will be null-terminated.
• A pointer to each of the character arrays
str2
and
str3
will be passed
to C. These character arrays will not be null-terminated, and storing
into them will affect the original FORTRAN data.
If this was a function passed to
mkc2f
, calling FORTRAN from C would cause
all of the parameters to be transformed to
reference
parameters but storing into
the parameters
s
,
c
,
f
, or
d
would not affect the original C variables. FORTRAN
would be passed
one
as the length of elements of the array
str2
, and
thirty
as the
length of elements of the array
str3
.
Lengths of FORTRAN Character Arrays
When FORTRAN is calling C, a character string that is specified as
char *
in the
C parameter list is
copied
and null-terminated. C may thus determine the
length of the string by use of the standard C function
strlen
. If a character
variable is specified as a character
array
in the C parameter list, it may be
impossible for C to determine its length, as it is not null-terminated. When the
call occurs, the wrapper code receives this length from FORTRAN. For those C
functions that need this information, the wrapper will pass it by extending the
C parameter list. For example, if the C function header is specified as:
func1(str1,i,cptr,j,str2)
char str1[],*cptr,str2[];
int i,j;
{}
mkf2c
will pass a total of
seven
parameters to C. The sixth parameter will be the
length of the FORTRAN character variable corresponding to
str1
, and the
seventh will be the length
str2
. The C function
func1()
must index off of the
stack to retrieve these hidden parameters. In the case above, the length of
strl
as
passed by FORTRAN could be copied into
str1_len
by
char **s;
int str1_1en;
s = &(char *)str2; str1_1en = (int)(*(s+1))
Similarly, the length of the array
str2
can be accessed by
(int)(*(s+2))
Summary of Contents for IRIS Workstation
Page 1: ...IRIS Workstation Guide Version 1 0 Silicon Graphics Inc Mountain View California 94043 ...
Page 6: ...2 IRIS WORKSTATION GUIDE Version 1 0 Introduction ...
Page 24: ...20 IRIS WORKSTATION GUIDE Version 1 0 Hardware Installation ...
Page 30: ...26 IRIS WORKSTATION GUIDE Version 1 0 Operation ...
Page 48: ...44 IRIS WORKSTATION GUIDE Version 1 0 System Administration ...
Page 50: ...46 IRIS WORKSTATION GUIDE Version 1 0 Appendix A ...
Page 74: ...70 IRIS WORKSTATION GUIDE Version 1 0 Appendix B ...
Page 77: ...Version 1 0 IRIS WORKSTATION GUIDE 73 Appendix C e random gr error f wnrepaint ...
Page 78: ...74 IRIS WORKSTATION GUIDE Version 1 0 Appendix C ...
Page 92: ...88 IRIS WORKSTATION GUIDE Version 1 0 Appendix D ...
Page 102: ...98 IRIS WORKSTATION GUIDE Version 1 0 Appendix E ...
Page 103: ...Appendix F Manual Pages ...
Page 104: ......
Page 131: ...Version 1 0 126 IRIS WORKSTATION GUIDE Appendix F ...
Page 132: ......
Page 136: ...130 IRIS WORKSTATION GUIDE Version 1 0 Appendix H ...
Page 152: ...146 IRIS WORKSTATION GUIDE Version 1 0 Appendix J ...