<!DOCTYPE File SYSTEM "doc.dtd">
<File>
<Entry dir="liblqtext">
<Function File="../../src/liblqtext/smalldb.c">
<H1 class=name>LQT_ObtainReadOnlyAccess</H1>
<H2 class="category">Class: Database/Database, Database/Files
</H2>
<pre class="decl">

API int
LQT_ObtainReadOnlyAccess(db)
    t_LQTEXT_Database *db;
</pre>

<h2 class=Purpose>Purpose</H2>
Obtains read-only access to the current database.
This is called automatically by LQT_OpenDatabase if appropriate.
If the database was previously open for writing, it should be
closed first with LQT_CloseDatabase or LQT_SyncDatabase.
<Returns>
<LIST>
<LI>zero on success
</LI>
<LI>-1 on failure or error
</LI>
</LIST>
<Errors>
A corrupt database may cause a fatal or E_BUG error.
<H2 class="SeeAlso">See Also</H2>
<Xref>LQT_OpenDatabase</Xref>
<Xref>LQT_ObtainWriteAccess</Xref>
<Xref>LQT_OpenKeyValueDatabase</Xref>
<Xref>LQT_CloseDatabase</Xref>
</Function>
</Entry>
