From c476443ffe5ada5e7af7c7b3d9271e5622f0f6e5 Mon Sep 17 00:00:00 2001 From: jthorn Date: Mon, 17 Mar 2003 11:17:14 +0000 Subject: add many const qualifiers to tell humans and compilers that these functions won't try to modify state names etc, also that looking at a state won't modify the gridfn (without the const qualifiers, C++ code can't use these functions on const data) git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SpaceMask/trunk@26 a491c6a4-70bf-4b89-8b36-d6c0cb1f094e --- doc/documentation.tex | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'doc') diff --git a/doc/documentation.tex b/doc/documentation.tex index b754047..28df841 100644 --- a/doc/documentation.tex +++ b/doc/documentation.tex @@ -75,9 +75,10 @@ Bits of the mask are allocated to a new type using the function: \indent\parbox{\linewidth}{ \vspace{\baselineskip}\noindent\texttt{ -int SpaceMask\_RegisterType(char* \emph{type\_name}, int \emph{nstates}, - char** \emph{state\_list}) -} +int SpaceMask\_RegisterType(const char* \emph{type\_name}, + \\\hspace*{10mm} + int \emph{nstates}, const char* const \emph{state\_list}[]) +}\\ \hspace*{10mm}\parbox{\linewidth}{ \begin{description} \item[\emph{type\_name}] The name of the new type to be registered; @@ -95,9 +96,10 @@ states can be added to an already allocated type using the function: \indent\parbox{\linewidth}{ \vspace{\baselineskip}\noindent\texttt{ - int SpaceMask\_AppendStatesToType(char* \emph{type\_name}, - int \emph{nstates}, char** \emph{state\_list}) -} +int SpaceMask\_AppendStatesToType(const char* \emph{type\_name}, + \\\hspace*{10mm} + int \emph{nstates}, const char* const \emph{state\_list}[]) +}\\ \hspace*{10mm}\parbox{\linewidth}{ \begin{description} \item[\emph{type\_name}] The name of an already registered type; @@ -118,8 +120,9 @@ The state of the mask at a given point is set using the function: \indent\parbox{\linewidth}{ \vspace{\baselineskip}\noindent\texttt{ void SpaceMask\_SetState(CCTK\_INT* \emph{mask}, int \emph{point}, - char* \emph{type\_name}, char* \emph{state}) -} + \\\hspace*{10mm} + const char* \emph{type\_name}, const char* \emph{state}) +}\\ \hspace*{10mm}\parbox{\linewidth}{ \begin{description} \item[\emph{mask}] A pointer to the mask grid function; @@ -134,9 +137,10 @@ The state of the mask at a given point can be checked using: \indent\parbox{\linewidth}{ \vspace{\baselineskip}\noindent\texttt{ -int SpaceMask\_CheckState(CCTK\_INT* \emph{mask}, int \emph{point}, - char* \emph{type\_name}, char* \emph{state}) -} +int SpaceMask\_CheckState(const CCTK\_INT* \emph{mask}, int \emph{point}, + \\\hspace*{10mm} + const char* \emph{type\_name}, const char* \emph{state}) +}\\ \hspace*{10mm}\parbox{\linewidth}{ \begin{description} \item[\emph{mask}] A pointer to the mask grid function; @@ -161,7 +165,7 @@ states need to be obtained using the following functions: \indent\parbox{\linewidth}{ \vspace{\baselineskip}\noindent\texttt{ -CCTK\_INT SpaceMask\_GetTypeBits(char* \emph{type\_name}) +CCTK\_INT SpaceMask\_GetTypeBits(const char* \emph{type\_name}) }\\ \hspace*{10mm}\parbox{\linewidth}{ \begin{description} @@ -172,8 +176,8 @@ CCTK\_INT SpaceMask\_GetTypeBits(char* \emph{type\_name}) \indent\parbox{\linewidth}{ \vspace{\baselineskip}\noindent\texttt{ -CCTK\_INT SpaceMask\_GetStateBits(char* \emph{type\_name}, - char* \emph{state\_name}) +CCTK\_INT SpaceMask\_GetStateBits(const char* \emph{type\_name}, + const char* \emph{state\_name}) } \hspace*{10mm}\parbox{\linewidth}{ \begin{description} @@ -195,7 +199,8 @@ of the mask by direct bitwise operations: \indent\parbox{\linewidth}{ \vspace{\baselineskip}\noindent\texttt{ void SpaceMask\_SetStateBits(CCTK\_INT* \emph{mask}, int \emph{point}, - CCTK\_INT \emph{type\_bits},\\\hspace*{10mm} CCTK\_INT \emph{state\_bits}) + \\\hspace*{10mm} + CCTK\_INT \emph{type\_bits}, CCTK\_INT \emph{state\_bits}) }\\ \hspace*{10mm}\parbox{\linewidth}{ \begin{description} @@ -211,8 +216,9 @@ void SpaceMask\_SetStateBits(CCTK\_INT* \emph{mask}, int \emph{point}, \indent\parbox{\linewidth}{ \vspace{\baselineskip}\noindent\texttt{ -int SpaceMask\_CheckStateBits(CCTK\_INT* \emph{mask}, int \emph{point}, - CCTK\_INT \emph{type\_bits},\\\hspace*{10mm} CCTK\_INT \emph{state\_bits}) +int SpaceMask\_CheckStateBits(const CCTK\_INT* \emph{mask}, int \emph{point}, + \\\hspace*{10mm} + CCTK\_INT \emph{type\_bits}, CCTK\_INT \emph{state\_bits}) }\\ \hspace*{10mm}\parbox{\linewidth}{ \begin{description} -- cgit v1.2.3