Skip to content

Commit

Permalink
Closes #2279
Browse files Browse the repository at this point in the history
Clarify ModelicaAllocateString
  • Loading branch information
HansOlsson committed May 11, 2019
1 parent 021bcd6 commit bd169e1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2435,10 +2435,8 @@ \subsection{Utility Functions}\doublelabel{utility-functions}
\lstinline!ModelicaAllocateString! &
\begin{tabular}{@{}p{8.cm}@{}}
\emph{char* ModelicaAllocateString(size\_t len)} \\
Allocate memory for a Modelica string which is used as return argument
of an external Modelica function. Note, that the storage for string
arrays (= pointer to string array) is still provided by the calling
program, as for any other array. If an error occurs, this function does
Allocate memory for a non-literal string which is used as a return argument of an external Modelica function.
If an error occurs, this function does
not return, but calls "\lstinline!ModelicaError!".
\end{tabular}\\ \hline
\lstinline!ModelicaAllocateStringWithErrorReturn! &
Expand All @@ -2453,6 +2451,13 @@ \subsection{Utility Functions}\doublelabel{utility-functions}
\end{tabular}\\ \hline
\end{longtable}
The valid return values for an external function returning a string are:
\begin{itemize}
\item A literal string.
\item A string given as String input to the external function
\item A string pointer returned by \lstinline!ModelicaAllocateString! or \lstinline!ModelicaAllocateStringWithErrorReturn!.
\end{itemize}
\subsection{External Objects}\doublelabel{external-objects}
External functions may have internal memory reported between function
Expand Down

0 comments on commit bd169e1

Please sign in to comment.