initial commit
This commit is contained in:
342
tools/vision/LDV/doc/english/vapi/in.htm
Normal file
342
tools/vision/LDV/doc/english/vapi/in.htm
Normal file
@@ -0,0 +1,342 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
||||
<title>Documentation VISION (VAPI) : INI Interface</title></head>
|
||||
<body background="../images/conc2.gif" bgcolor="#ffffff">
|
||||
<div align="center"><center>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tbody><tr>
|
||||
<td align="center" width="17%"><a href="co.htm"><img src="../images/cprev.jpg" alt="Chapitre pr<70>c<EFBFBD>dent" border="0" height="26" hspace="2" width="46"></a><a href="index.htm"><img src="../images/csom.jpg" alt="Retour au sommaire" border="0" height="27" hspace="2" width="32"></a><a href="lo.htm"><img style="border: 0px solid ; width: 43px; height: 26px;" src="../images/csuiv.jpg" alt="Chapitre suivant" hspace="2"></a></td>
|
||||
<td rowspan="2" align="center" valign="top" width="8%"><p align="center"><img src="../images/icoprinc.gif" height="71" width="59"></p>
|
||||
</td>
|
||||
<td width="33%"><p align="center"><font color="#0000ff" size="5"><strong>Documentation </strong><em><strong>VISION
|
||||
(VAPI)</strong></em></font></p>
|
||||
</td>
|
||||
<td rowspan="2" align="center" valign="top" width="8%"><p align="center"><img src="../images/icointro.gif" height="71" width="59"></p>
|
||||
</td>
|
||||
<td valign="top" width="17%"><p align="left">Last update: 19/05/18</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="17%"><p align="center"><a href="..%5C..%5C..%5Cdownload/dvldv.zip"><br></a></p>
|
||||
</td>
|
||||
<td width="33%"><p align="center"><font size="4"><strong>INI
|
||||
INTERFACE</strong></font></p>
|
||||
</td>
|
||||
<td align="center" width="17%"></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
|
||||
<hr>
|
||||
<div align="center"><center>
|
||||
|
||||
<table border="2" width="100%">
|
||||
<tbody><tr>
|
||||
<td colspan="2" align="center"><strong>Abstract</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Interface Prefix</strong></td>
|
||||
<td width="85%">In</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Number of functions</strong></td>
|
||||
<td width="85%">6</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Description</strong></td>
|
||||
<td width="85%">Set of functions to manipulate INI files. A maximum of 3 INI files can be simulataneously managed.</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
|
||||
<p> </p>
|
||||
<div align="center"><center>
|
||||
|
||||
<table border="2" width="100%">
|
||||
<tbody><tr>
|
||||
<td width="15%"><a name="InOpen"></a><strong>Prototype</strong></td>
|
||||
<td width="85%">long cdecl <strong>InOpen</strong>(char
|
||||
*file)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Parameters</strong></td>
|
||||
<td width="85%"><strong>[IN]</strong> file : INI file name </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Return</strong></td>
|
||||
<td width="85%">If >= 0 : a INI handle<br>
|
||||
If < 0, No more INI handle available</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Description</strong></td>
|
||||
<td width="85%">Reserve a INI handle to operate later on. If file does not exist, a valid handle is returned, file can then be saved by calling <a href="#InSaveAndClose">InSaveAndClose</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Comments</strong><strong></strong></td>
|
||||
<td width="85%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>VAPI </strong><strong>Version</strong></td>
|
||||
<td width="85%">1.02 or greater</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
|
||||
<p> </p>
|
||||
<div align="center"><center>
|
||||
|
||||
<table border="2" width="100%">
|
||||
<tbody><tr>
|
||||
<td width="15%"><a name="InClose"></a><strong>Prototype</strong></td>
|
||||
<td width="85%">long cdecl <strong>InClose</strong>(long
|
||||
hini)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Parameters</strong></td>
|
||||
<td width="85%"><strong>[IN]</strong> hini : A INI handle previously returned by <a href="#InOpen">InOpen</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Return</strong></td>
|
||||
<td width="85%">0 : Success<br>
|
||||
-1 : Invalid handle</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Description</strong></td>
|
||||
<td width="85%">Free INI handle. Does not save modifications, use <a href="#InSaveAndClose">InSaveAndClose</a> to save them.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Comments</strong></td>
|
||||
<td width="85%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>VAPI </strong><strong>Version</strong></td>
|
||||
<td width="85%">1.02 or greater</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
|
||||
<p> </p>
|
||||
<div align="center"><center>
|
||||
|
||||
<table border="2" width="100%">
|
||||
<tbody><tr>
|
||||
<td width="15%"><a name="InSaveAndClose"></a><strong>Prototype</strong></td>
|
||||
<td width="85%">long cdecl <strong>InSaveAndClose</strong>(long
|
||||
hini, char *new_name)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Parameters</strong></td>
|
||||
<td width="85%"><strong>[IN]</strong> hini : A INI handle previously returned by <a href="in.htm#InOpen">InOpen</a><a href="#InOpen"></a><br>
|
||||
<strong>[IN]</strong> new_name : new filename to use for saving. If NULL, this function will use the one passed to <a href="#InOpen">InOpen</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Return</strong></td>
|
||||
<td width="85%">0 : Success<br>
|
||||
-1 : Invalid handle, won't save.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Description</strong></td>
|
||||
<td width="85%">Generate a INI file by commiting all modifications made since last call to <a href="#InOpen">InOpen</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Comments</strong></td>
|
||||
<td width="85%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>VAPI </strong><strong>Version</strong></td>
|
||||
<td width="85%">1.02 or greater</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
|
||||
<p> </p>
|
||||
<div align="center"><center>
|
||||
|
||||
<table border="2" width="100%">
|
||||
<tbody><tr>
|
||||
<td width="15%"><a name="InGetKey"></a><strong>Prototype</strong></td>
|
||||
<td width="85%">long cdecl <strong>InGetKey</strong>(long
|
||||
hini, char *section, char *key, char *val_key)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Parameters</strong></td>
|
||||
<td width="85%"><strong>[IN]</strong> hini : A INI handle previously returned by <a href="in.htm#InOpen">InOpen</a><a href="#InOpen"></a><br>
|
||||
<strong>[IN]</strong> section : section name<br>
|
||||
<strong>[IN] </strong>key : key name<br>
|
||||
<strong>[OUT]</strong> val_key : buffer which will hold the key value in ASCII</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Return</strong></td>
|
||||
<td width="85%">0 : Error : key or section does not exist<br>
|
||||
1 : Success, ASCII value for this key in the section is hold in val_key</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Description</strong></td>
|
||||
<td width="85%">Retrieves a specific key in a specific section</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Comments</strong></td>
|
||||
<td width="85%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>VAPI </strong><strong>Version</strong></td>
|
||||
<td width="85%">1.02 or greater</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
|
||||
<p> </p>
|
||||
<div align="center"><center>
|
||||
|
||||
<table border="2" width="100%">
|
||||
<tbody><tr>
|
||||
<td width="15%"><a name="InSetKey"></a><strong>Prototype</strong></td>
|
||||
<td width="85%">long cdecl <strong>InSetKey</strong>(long
|
||||
hini, char *section, char *key, char *val_key)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Parameters</strong></td>
|
||||
<td width="85%"><strong>[IN]</strong> hini : A INI handle previously returned by <a href="in.htm#InOpen">InOpen</a><br>
|
||||
<strong>[IN]</strong> section : section name<br>
|
||||
<strong>[IN] </strong>key : key name<br>
|
||||
<strong>[OUT]</strong> val_key : buffer which holds the key value in ASCII</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Return</strong></td>
|
||||
<td width="85%">0 : Error : key or section could not be created or changed due to insufficient memory<br>
|
||||
1 : Success</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Description</strong></td>
|
||||
<td width="85%">Adds or modify a key within a section</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Comments</strong></td>
|
||||
<td width="85%">If section r key does not exist, it is created</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>VAPI </strong><strong>Version</strong></td>
|
||||
<td width="85%">1.02 or greater</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
|
||||
<p> </p>
|
||||
<div align="center"><center>
|
||||
|
||||
<table border="2" width="100%">
|
||||
<tbody><tr>
|
||||
<td width="15%"><a name="InGetOrSetKey"></a><strong>Prototype</strong></td>
|
||||
<td width="85%">long cdecl <strong>InGetOrSetKey</strong>(long
|
||||
hini, char *section, char *key, char *val_key)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Parameters</strong></td>
|
||||
<td width="85%"><strong>[IN]</strong> hini : A INI handle previously returned by <a href="in.htm#InOpen">InOpen</a><br>
|
||||
<strong>[IN]</strong> section : section name<br>
|
||||
<strong>[IN] </strong>key : key name<br>
|
||||
<strong>[IN/OUT] </strong>val_key : buffer holding the default key value in ASCII [IN] or/and the key value [OUT]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Return</strong></td>
|
||||
<td width="85%">0 : Key has been sucessfully retrieved<br>
|
||||
1 : Key has been created.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Description</strong></td>
|
||||
<td width="85%">Used to retrieve an existing key in a given section or create it with a default value.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Comments</strong></td>
|
||||
<td width="85%">Pretty useful!</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>VAPI </strong><strong>Version</strong></td>
|
||||
<td width="85%">1.02 or greater</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
|
||||
<pre><br></pre><div align="center"><center>
|
||||
|
||||
<table border="2" width="100%">
|
||||
<tbody><tr>
|
||||
<td width="15%"><strong><a name="GetKeyFromFile"></a>Prototype</strong></td>
|
||||
<td width="85%">long<strong> InGetKeyFromFile</strong>(char *file, char *section, char *key, char *val_key)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Parameters</strong></td>
|
||||
<td width="85%"><strong>[IN]</strong> file : INI file name<a href="in.htm#InOpen"></a><br>
|
||||
<strong>[IN]</strong> section : section name<br>
|
||||
<strong>[IN] </strong>key : key name<br>
|
||||
<strong>[IN/OUT] </strong>val_key : buffer holding the default key value in ASCII [IN] or/and the key value [OUT]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Return</strong></td>
|
||||
<td width="85%">0 : Key could not be retrieved (filename, section or key not found)<br>
|
||||
1 : Key has been succesfully read.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Description</strong></td>
|
||||
<td width="85%">Used
|
||||
to read a key value directly from a file without the need to create the
|
||||
key if not present (as previous function). Typically this is used to
|
||||
read a setting from a file.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>Comments</strong></td>
|
||||
<td width="85%">Pretty useful!</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%"><strong>VAPI </strong><strong>Version</strong></td>
|
||||
<td width="85%">1.04 or greater</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
|
||||
<font size="3"><br></font><pre><font size="3">Example: find a proprietary key in a LDV INI file<br>long hini, must_save ;<br>short angle = 90; </font><font color="#000080" size="3"><em>/* Default value */</em></font><font size="3">
|
||||
char buffer[256] ;
|
||||
char *path_ldv, *language ;
|
||||
|
||||
path_ldv = Vapi-></font><a href="co.htm#CoGetLDVPath"><font size="3">CoGetLDVPath</font></a><font size="3">() ; </font><font color="#000080" size="3">/* Get LDV current path */</font><font size="3">
|
||||
language = Vapi-></font><a href="co.htm#CoGetCurrentLanguage"><font size="3">CoGetCurrentLanguage</font></a><font size="3">() ; </font><font color="#000080" size="3">/* Get current language */</font><font size="3">
|
||||
if ( path_ldv && language )
|
||||
{
|
||||
sprintf( buffer, "%s\\%s\\MYLDV.INI", path_ldv, language ) ;
|
||||
hini = Vapi-></font><a href="#InOpen"><font size="3">InOpen</font></a><font size="3">( buffer ) ;<br> if ( hini >= 0 )<br> {<br> sprintf( buffer, "%d", angle ) ; </font><font color="#000080" size="3"><em>/* Setting default value */</em></font><font size="3">
|
||||
must_save = Vapi-></font><a href="#InGetOrSetKey"><font size="3">InGetOrSetKey</font></a><font size="3">( hini, "Parameters", "Angle", buffer ) ;<br> angle = atoi( buffer ) ; </font><font color="#000080" size="3"><em>/* Either angle will be set to 90 (default value), or value retrieved from INI file */</em></font><font size="3">
|
||||
if ( must_save ) Vapi-></font><a href="#InSaveAndClose"><font size="3">InSaveAndClose</font></a><font size="3">( hini ) ; </font><font color="#000080" size="3"><em>/* Save if key did not exist */</em></font><font size="3">
|
||||
else Vapi-></font><a href="#InClose"><font size="3">InClose</font></a><font size="3">( hini ) ; </font><font color="#000080" size="3"><em>/* Else regular close */</em></font><font size="3">
|
||||
}
|
||||
}</font></pre>
|
||||
|
||||
<hr>
|
||||
<div align="center"><center>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tbody><tr>
|
||||
<td align="center" width="17%"><a href="co.htm"><img src="../images/cprev.jpg" alt="Chapitre pr<70>c<EFBFBD>dent" border="0" height="26" hspace="2" width="46"></a><a href="index.htm"><img src="../images/csom.jpg" alt="Retour au sommaire" border="0" height="26" hspace="2" width="26"></a><a href="lo.htm"><img style="border: 0px solid ; width: 43px; height: 26px;" src="../images/csuiv.jpg" alt="Chapitre suivant" hspace="2"></a></td>
|
||||
<td rowspan="2" align="center" valign="top" width="8%"><p align="center"><img src="../images/icoprinc.gif" height="71" width="59"></p>
|
||||
</td>
|
||||
<td width="33%"><p align="center"><font color="#0000ff" size="5"><strong>Documentation </strong><em><strong>VISION
|
||||
(VAPI)</strong></em></font></p>
|
||||
</td>
|
||||
<td rowspan="2" align="center" valign="top" width="8%"><p align="center"><img src="../images/icointro.gif" height="71" width="59"></p>
|
||||
</td>
|
||||
<td valign="top" width="17%"><p align="left">Last update : 19/05/18</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="17%"><p align="center"><a href="..%5C..%5C..%5Cdownload/dvldv.zip"><br></a></p>
|
||||
</td>
|
||||
<td width="33%"><p align="center"><font size="4"><strong>INI
|
||||
INTERFACE</strong></font></p>
|
||||
</td>
|
||||
<td valign="top" width="17%"> </td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</center></div>
|
||||
</body></html>
|
||||
Reference in New Issue
Block a user