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

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

<h2 class=Purpose>Purpose</H2>
Grants write access to the current database.
This is called automatically by LQT_OpenDatabase if appropriate.
<Returns>
<LIST>
<LI>zero on success
<LI>-1 on error or failure
</LIST>
<H2 class="notes">Notes</H2>
Write access may on some systems be exclusive, so that no other
process can open the database, neither for reading nor for writing.
You should not rely on this, however; on some systems, multiple
clients may succeed in writing, and will corrupt the database.
<Errors>
A corrupt database may cause a fatal or E_BUG error.
<H2 class="SeeAlso">See Also</H2>
<Xref>LQT_ObtainReadOnlyAccess</Xref>
<Xref>LQT_OpenDatabase</Xref>
</Function>
</Entry>
