- Exemple 001 :
- #include <llist.h>
-
- LLIST
*Lentier;
/* ne pas faire : LLIST Lentier
*/
-
- void main(void)
- {
-
if ( initlist(
&Lentier, LINT,LINT) == LOK ) /* LINT : voir
llist.h : LINT = sizeof(INT) */
-
{
-
fprintf(stdout,"Creation de la liste Lentier !!");
- close_list(&Lentier);
- }
- else
-
fprintf(stdout,"Erreur initialisation liste !!");
- exit(0);
- }
- #include <llist.h>
-
- LLIST
*L;
-
- typedef struct
- {
- int NumClient;
- long
CodePostal;
- char
Nom[40];
-
- /* etc. */
-
- }MONTYPE;
- void main(void)
- {
-
-
if ( initlist(
&L, sizeof(MONTYPE) , LINT+ LLONG ) == LOK )
- {
/* La longueur de la clef = NumClient
+ CodePostal
*/
-
/* La liste L
contiendra des éléments de type MONTYPE
dont la clef */
-
/* est NumClient +
CodePostal !!!
*/
-
fprintf(stdout,"Creation de la liste L !!");
- close_list(&L);
-
}
-
else
- fprintf(stdout,"Erreur
initialisation liste !!");
-
- exit(0);
- }