\subsection{\funcnameXBvarfind{}}

\begin{expara}

int \funcnameXBvarfind{}(const int fd,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const unsigned flags,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const char *vname,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const netid\_t nid,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ slotno\_t *slot,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ apiBtvar *vard)

\bigskip


int \funcnameXBvarfindslot{}(const int fd,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const unsigned flags,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const char *vname,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const netid\_t nid,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ slotno\_t *slot)

\end{expara}

The function \funcXBvarfind{} is used to retrieve the
details of a variable, starting from its name, in one operation.

The function \funcXBvarfindslot{} is used to retrieve
just the slot number of a variable, starting from its name.

\exampletext{fd} is a file descriptor which was previously
returned by a successful call to \funcXBopen{} or equivalent.

\exampletext{flags} is zero or the logical OR of one or more of
the following bits:

\begin{tabular}{ll}
\filename{\constprefix{}FLAG\_LOCALONLY} & Search for variables local to the server only.\\
\filename{\constprefix{}FLAG\_USERONLY} & Search for variables owned by the user only.\\
\filename{\constprefix{}FLAG\_GROUPONLY} & Search for variables owned by the group only.\\
\end{tabular}

\exampletext{vname} is the variable name to be searched for.

\exampletext{nid} is the IP address (in network byte order) of
the host on which the searched-for variable is to be located. It should
be correct even if \filename{\constprefix{}FLAG\_LOCALONLY} is
specified.

\exampletext{slot} is assigned the slot number corresponding to
the variable. It may be null is not required, but this would be nearly
pointless with \funcnameXBvarfindslot{} (other than reporting that the variable
was unknown).

\exampletext{vard} is a pointer to a structure which will
contain the details of the variable for
\filename{\funcnameXBvarfind{}}. The definition of the variable
structure is given on page \pageref{bkm:Varstructure} onwards.

\subsubsection{Return values}
The function returns 0 if successful otherwise one of the error codes
listed on page \pageref{errorcodes} onwards.

\subsection{\funcnameXBvarread{}}

\begin{expara}

int \funcnameXBvarread{}(const int fd,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const unsigned flags,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const slotno\_t slot,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ apiBtvar *vard)

\end{expara}

The function \funcXBvarread{} is used to read the
details for a variable

\exampletext{fd} is a file descriptor which was previously
returned by a successful call to \funcXBopen{} or equivalent.

\exampletext{flags} is zero or
\filename{\constprefix{}FLAG\_IGNORESEQ} to ignore recent changes to
the variable list.

\exampletext{slot} is the slot number corresponding to the
variable as returned by \funcXBvarlist{} or
\funcXBvarfind{}.

\exampletext{vard} is a pointer to a structure which will
contain the details of the variable. The definition of the variable
structure is given on page \pageref{bkm:Varstructure} onwards.

\subsubsection{Return values}
The function returns 0 if successful otherwise one of the error codes
listed on page \pageref{errorcodes} onwards.

