|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T o
Length: 3246 (0xcae) Types: TextFile Names: »objects.tex«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« └─⟦d3ac74d73⟧ └─⟦this⟧ »isode-5.0/doc/manual/objects.tex«
% run this through LaTeX with the appropriate wrapper \f \chapter {The ISODE Objects Database}\label{isobjects} The database \file{/usr/etc/isobjects} contains a simple mapping between object descriptors and object identifiers. The database itself is an ordinary ASCII text file containing information regarding the known objects on the host. Each line contains \begin{itemize} \item the descriptor of the object, a simple string; and, \item the corresponding object identifier. \end{itemize} Blanks and/or tab characters are used to separate items. All items after the first two are interpreted as an argument vector. However, double-quotes may be used to prevent separation between arguments in the vector. The sharp character (`\verb"#"') at the beginning of a line indicates a commentary line. \f \section {Accessing the Database}\label{isobject} The \man libpsap(3) library contains the routines used to access the database. These routines ultimately manipulate an \verb"isobject" structure, which is the internal form. \begin{quote}\index{isobject}\small\begin{verbatim} struct isobject { char *io_descriptor; OIDentifier io_identity; }; \end{verbatim}\end{quote} The elements of this structure are: \begin{describe} \item[\verb"io\_descriptor":] the object descriptor; and, \item[\verb"io\_identity":] the object identifier. \end{describe} The routine \verb"getisobject" reads the next entry in the database, opening the database if necessary. \begin{quote}\index{getisobject}\small\begin{verbatim} struct isobject *getisobject () \end{verbatim}\end{quote} It returns the manifest constant \verb"NULL" on error or end-of-file. The routine \verb"setisobject" opens and rewinds the database. \begin{quote}\index{setisobject}\small\begin{verbatim} int setisobject (f) int f; \end{verbatim}\end{quote} The parameter to this procedure is: \begin{describe} \item[\verb"f":] the ``stayopen'' indicator, if non-zero, then the database will remain open over subsequent calls to the library. \end{describe} The routine \verb"endisobject" closes the database. \begin{quote}\index{endisobject}\small\begin{verbatim} int endisobject () \end{verbatim}\end{quote} Both of these routines return non-zero on success and zero otherwise. There are two routines used to fetch a particular entry in the database. The routine \verb"getisobjectbyname" maps object descriptors into the internal form. \begin{quote}\index{getisobjectbyname}\small\begin{verbatim} struct isobject *getisobjectbyname (descriptor) char *descriptor; \end{verbatim}\end{quote} The parameter to this procedure is: \begin{describe} \item[\verb"descriptor":] the descriptor of the object. \end{describe} and returns the \verb"isobject" structure describing that object. On failure, the manifest constant \verb"NULL" is returned instead. The routine \verb"getisobjectbyoid" performs the inverse function. \begin{quote}\index{getisobjectbyoid}\small\begin{verbatim} struct isobject *getisobjectbyoid (oid) OID oid; \end{verbatim}\end{quote} The parameter to this procedure is: \begin{describe} \item[\verb"oid":] the identifier of the object. \end{describe} On a successful return, an \verb"isobject" structure describing the object is returned.