Skip to content

Commit

Permalink
Merge pull request modelica#3236 from henrikt-ma/external-function-pr…
Browse files Browse the repository at this point in the history
…otected

Clarify role of protected components passed to external functions
  • Loading branch information
HansOlsson committed Sep 9, 2022
2 parents d33adc1 + 9a40624 commit f19d197
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions chapters/functions.tex
Expand Up @@ -1942,11 +1942,10 @@ \section{External Function Interface}\label{external-function-interface}
\end{lstlisting}%
\indexinline{external}

Components in the public part of an external function declaration shall be declared either as {\lstinline!input!} or {\lstinline!output!}.
Just as for any other function, components in the public part of an external function declaration shall be declared either as {\lstinline!input!} or {\lstinline!output!}.

\begin{nonnormative}
This is just as for any other function. The components in the protected part allow local variables for temporary storage to be declared.
\end{nonnormative}
Protected components can be passed to the external function without being initialized by means of a declaration equation, which is useful for passing workspace memory to functions with FORTRAN style memory management, and the reason for passing them in the same (writable) way as output components (see \cref{argument-type-mapping}).
The value of a protected component passed to the external function should be considered undefined (destroyed) after the external function call.

The {\lstinline[language=grammar]!language-specification!} must currently be one of {\lstinline!"builtin"!} (deprecated), {\lstinline!"C"!}, {\lstinline!"C$\ldots$"!} (for one of the specific C standards like C89, C99, and C11 -- specifying
that it relies on the C standard library of that version) or {\lstinline!"FORTRAN 77"!}.
Expand Down

0 comments on commit f19d197

Please sign in to comment.