379 lines
16 KiB
HTML
379 lines
16 KiB
HTML
<!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écé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">Dernière
|
|
mise à jour : 19/05/18</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="17%"><p align="center"><a href="..%5C..%5C..%5Cdownload/dvldv.zip">Télécharger la doc</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>Résumé</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Préfixe de l'interface</strong></td>
|
|
<td width="85%">In</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Nombre de fonctions</strong></td>
|
|
<td width="85%">6</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Description</strong></td>
|
|
<td width="85%">Ensemble de fonctions permettant de
|
|
manipuler des fichiers au format INI. Le nombre de
|
|
fichiers INI pouvant être gérés sumultanément est de
|
|
3.</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>Paramètres</strong></td>
|
|
<td width="85%"><strong>[IN]</strong> file : Nom du
|
|
fichier INI </td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Retour</strong></td>
|
|
<td width="85%">Si >= 0 : un identifiant de fichier
|
|
INI<br>
|
|
Si < 0, il n'y a plus d'identifiant INI disponible
|
|
(les 3 sont déjà utilisés)</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Description</strong></td>
|
|
<td width="85%">Réserve un identifiant INI en vue
|
|
d'opérations sur un fichier INI. Si le fichier file
|
|
n'existe pas, un identifiant est tout de même renvoyé,
|
|
le fichier devra ensuite être sauvé par la fonction <a href="#InSaveAndClose">InSaveAndClose</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Remarques</strong></td>
|
|
<td width="85%"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Version VAPI</strong></td>
|
|
<td width="85%">1.02 ou supérieure</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>Paramètres</strong></td>
|
|
<td width="85%"><strong>[IN]</strong> hini : un
|
|
identifiant de fichier INI précédemment renvoyé par <a href="#InOpen">InOpen</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Retour</strong></td>
|
|
<td width="85%">0 : Succès<br>
|
|
-1 : Identifiant invalide</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Description</strong></td>
|
|
<td width="85%">Libère l'identifiant de fichier INI. Ne
|
|
sauve pas les modifications, pour cela utiliser <a href="#InSaveAndClose">InSaveAndClose</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Remarques</strong></td>
|
|
<td width="85%"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Version VAPI</strong></td>
|
|
<td width="85%">1.02 ou supérieure</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>Paramètres</strong></td>
|
|
<td width="85%"><strong>[IN]</strong> hini : un
|
|
identifiant de fichier INI précédemment renvoyé par <a href="#InOpen">InOpen</a><br>
|
|
<strong>[IN]</strong> new_name : nouveau nom de
|
|
sauvegarde. NULL si inchangé par rapport à l'appel à <a href="#InOpen">InOpen</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Retour</strong></td>
|
|
<td width="85%">0 : Succès<br>
|
|
-1 : Identifiant invalide ou sauvegarde impossible</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Description</strong></td>
|
|
<td width="85%">Génère un fichier INI en validant
|
|
définitivement toutes les modifications apportées
|
|
depuis l'appel à <a href="#InOpen">InOpen</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Remarques</strong></td>
|
|
<td width="85%"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Version VAPI</strong></td>
|
|
<td width="85%">1.02 ou supérieure</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>Paramètres</strong></td>
|
|
<td width="85%"><strong>[IN]</strong> hini : un
|
|
identifiant de fichier INI précédemment renvoyé par <a href="#InOpen">InOpen</a><br>
|
|
<strong>[IN]</strong> section : nom de la section<br>
|
|
<strong>[IN] </strong>key : nom de la clé<br>
|
|
<strong>[OUT]</strong> val_key : buffer destiné à
|
|
recevoir la valeur de la clé en ASCII</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Retour</strong></td>
|
|
<td width="85%">0 : Echec : la clé ou la section n'ont
|
|
pas été trouvées<br>
|
|
1 : Succès, la valeur ASCII de la clé de cette section
|
|
est présente dans val_key</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Description</strong></td>
|
|
<td width="85%">Recherche une clé particulière dans une
|
|
section particulière</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Remarques</strong></td>
|
|
<td width="85%"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Version VAPI</strong></td>
|
|
<td width="85%">1.02 ou supérieure</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>Paramètres</strong></td>
|
|
<td width="85%"><strong>[IN]</strong> hini : un
|
|
identifiant de fichier INI précédemment renvoyé par <a href="#InOpen">InOpen</a><br>
|
|
<strong>[IN]</strong> section : nom de la section<br>
|
|
<strong>[IN] </strong>key : nom de la clé<br>
|
|
<strong>[IN] </strong>val_key : buffer contenant la
|
|
valeur de la clé en ASCII</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Retour</strong></td>
|
|
<td width="85%">0 : Echec : la clé ou la section n'ont
|
|
pas pu être crées ou modifiées par manque de mémoire<br>
|
|
1 : Succès</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Description</strong></td>
|
|
<td width="85%">Ajoute ou modifie une section et/ou une
|
|
clé</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Remarques</strong></td>
|
|
<td width="85%">Si la section ou la clé nexiste pas,
|
|
elle est crée</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Version VAPI</strong></td>
|
|
<td width="85%">1.02 ou supérieure</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>Paramètres</strong></td>
|
|
<td width="85%"><strong>[IN]</strong> hini : un
|
|
identifiant de fichier INI précédemment renvoyé par <a href="#InOpen">InOpen</a><br>
|
|
<strong>[IN]</strong> section : nom de la section<br>
|
|
<strong>[IN] </strong>key : nom de la clé<br>
|
|
<strong>[IN/OUT] </strong>val_key : buffer contenant la
|
|
valeur par défaut de la clé en ASCII (<strong>[IN]</strong>)
|
|
et/ou la valeur lue de la clé (<strong>[OUT]</strong>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Retour</strong></td>
|
|
<td width="85%">0 : La clé a été relue avec succès<br>
|
|
1 : La clé a du être créee.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Description</strong></td>
|
|
<td width="85%">Permet de retrouver la valeur d'une clé
|
|
dans une section et, si cette clé ou cette section
|
|
n'existe pas de la mettre en place avec une valeur par
|
|
défaut.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Remarques</strong></td>
|
|
<td width="85%">Très pratique !</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Version VAPI</strong></td>
|
|
<td width="85%">1.02 ou supérieure</td>
|
|
</tr>
|
|
</tbody></table>
|
|
</center></div>
|
|
|
|
<p> </p>
|
|
<div align="center"><center>
|
|
|
|
<table border="2" width="100%">
|
|
<tbody><tr>
|
|
<td width="15%"><a name="InGetKeyFromFile"></a><strong>Prototype</strong></td>
|
|
<td width="85%">long cdecl <strong>InGetKeyFromFile</strong>(char *file, char *section, char *key, char *val_key)</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Paramètres</strong></td>
|
|
<td width="85%"><strong>[IN]</strong> file : Nom du
|
|
fichier INI<a href="in.htm#InOpen"></a><br>
|
|
<strong>[IN]</strong> section : nom de la section<br>
|
|
<strong>[IN] </strong>key : nom de la clé<br>
|
|
<strong>[IN/OUT] </strong>val_key : buffer contenant la
|
|
valeur par défaut de la clé en ASCII (<strong>[IN]</strong>)
|
|
et/ou la valeur lue de la clé (<strong>[OUT]</strong>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Retour</strong></td>
|
|
<td width="85%">0 : La clé n'a pu être retrouvée (fichier/section/clé inexistant)<br>
|
|
1 : La clé a été relue avec succès.</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Description</strong></td>
|
|
<td width="85%">Permet
|
|
de retrouver la valeur d'une clé dans une section directement sans
|
|
crérer la clé comme dans la fonction précédente (pratique pour juste
|
|
relire une valeur ponctuellement)</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Remarques</strong></td>
|
|
<td width="85%">Très pratique !</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%"><strong>Version VAPI</strong></td>
|
|
<td width="85%">1.04 ou supérieure</td>
|
|
</tr>
|
|
</tbody></table>
|
|
</center></div>
|
|
|
|
<font size="3"><br></font><pre><font size="3">Exemple d'utilisation: retrouver une clé propriétaire dans un LDV<br>long hini, must_save ;<br>short angle = 90; </font><font color="#000080" size="3"><em>/* Valeur par défaut */</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">/* Récupère le chemin courant des LDV */</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">/* Récupère la langue actuelle */</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>/* Mise en place de la valeur par défaut */</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>/* Soit angle vaudra 90 (valeur par défaut), soit la valeur donnée par le fichier INI */</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>/* Sauvegarde si la clé n'existait pas */</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>/* Fermeture normale sinon */</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écé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">Dernière
|
|
mise à jour : 19/05/18</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="17%"><p align="center"><a href="..%5C..%5C..%5Cdownload/dvldv.zip">Télécharger la doc</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> |