\subsection{\funcnameXBvarlist{}}

\begin{expara}

int \funcnameXBvarlist{}(const int fd,

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

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int *numvars,

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ slotno\_t **slots)

\end{expara}

The function \funcXBvarlist{} is used to obtain a
vector of slots which can be used to access the details of variables
readable by the user.

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

\exampletext{flags} is zero, or a logical OR of one or more of
the following values

\begin{tabular}{ll}
\filename{\constprefix{}FLAG\_LOCALONLY} &
Ignore remote variables/hosts, i.e. not local to the server,
not the client.\\
\filename{\constprefix{}FLAG\_USERONLY} & Restrict to the user only.\\
\filename{\constprefix{}FLAG\_GROUPONLY} & Restrict to the current group (possibly as selected by
\funcXBnewgrp{}) only.\\
\end{tabular}

\exampletext{numvars} is a pointer to an integer which will
contain the number of variables in the list.

\exampletext{slots} is a pointer to an array of slots. The
memory used by this list should not be freed by the user as it is owned
by the API.

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

