Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,8 @@ \subsubsection{Records}\label{records}
Records containing arrays cannot be mapped.
\end{itemize}

Scalar records are passed as pointers (by reference).
Scalar records that are the return value of the C function are returned by value.
Other scalar records are passed as pointers (by reference).
Record inputs are const-pointers, indicating that the records shall not be changed.
As stated in \cref{arrays-1}, an array of records is passed as a pointer to the first element in an array of structs (array-to-pointer decay in C).

Expand Down Expand Up @@ -2181,10 +2182,11 @@ \subsection{Return Type Mapping}\label{return-type-mapping}
{\lstinline!String!} & {\lstinline[language=C]!const char*!} & \emph{Not allowed}\\
{\lstinline!T[$\mathit{dim}_{1}$, $\ldots$, $\mathit{dim}_{n}$]!} & \emph{Not allowed} & \emph{Not allowed} \\
Enumeration type & {\lstinline[language=C]!int!} & {\lstinline[language=FORTRAN77]!INTEGER!}\\
Record & See \cref{records} & \emph{Not allowed}\\
Record & \lstinline[language=C]!struct CRec! & \emph{Not allowed}\\
Comment thread
HansOlsson marked this conversation as resolved.
\hline
\end{tabular}
\end{center}
For the contents of \lstinline[language=C]!struct CRec! see \cref{records}.
Comment thread
HansOlsson marked this conversation as resolved.

The element type {\lstinline!T!} of an array can be any simple type as defined in \cref{simple-types} or, for C, a record type is returned as a value of the record type defined in \cref{records}.

Expand Down