Présentation
Documentation
L'équipe
Sérialisation
 
Programmes
Objets
Libs Utilitaires
Libs Internes
   
 
Editeur
Syntaxes
Windows
Versions
   

SCR/AL1 - TOME III. Les librairies utilitaires

5. Le groupe s_strs

5.114 PciGetInfos (file s_pcinfo.c:189)

Syntax

int PciGetInfos(pci)
PCINFOS *pci;

Description

Analyse le PC et retourne dans une structure PCINFOS différentes informations utiles notamment pour une installation de programme.

La structure PCINFOS doit être passée comme paramètre et est modifiée par la fonction. Ses éléments sont définis comme suit :

##define MAXFDISKS  26

typedef struct _pcfdisk_ {
char drive; Lettre identifiant le drive
unsigned long total; Espace total du disque (bytes)
unsigned long free; Espace restant sur le disque (bytes)
unsigned long KBtotal; Espace total du disque (Kbytes)
unsigned long KBfree; Espace restant sur le disque (Kbytes)
} PCFDISK;

typedef struct _pcinfos_ {
short fpu; 1 si un processeur math. est présent
short nbfdisks; Nbre de disques logiques (fixes)
PCFDISK fdisks[MAXFDISKS]; Infos sur chaque disque
short lpts[3]; Etat de chaque imprimante parallèle
short nbcoms; Nombre de portes séries COMx
} PCINFOS;

Exemple

    PCINFOS         pci;
int i;

PciGetInfos(&pci);
printf("Nb coms : %d\n", pci.nbcoms);
printf("FPU : %d\n", pci.fpu);
printf("Nb disks : %d\n", pci.nbfdisks);
for(i = 0 ; i < pci.nbfdisks ; i++)
printf("Disk %c : %ld/%ld bytes free\n", pci.fdisks[i].drive,
pci.fdisks[i].free,
pci.fdisks[i].total);
for(i = 0 ; i < 3 ; i++) {
printf("LPT%d : ", i + 1);
switch(pci.lpts[i]) {
case 1 : printf("Out of paper\n"); break;
case -1 : printf("Not present\n"); break;
case 0 : printf("Ready\n"); break;
}
}

Voir également

PciGetDriveInfo(), PciParalTest()

5.114.1 File s_pcinfo.c

PciGetDriveInfo(disk, total, free)
PciGetDriveInfoKB(disk, total, free, KBtotal, KBfree)
int PciGetInfos(pci)

Copyright © 1998-2015 Jean-Marc Paul and Bernard PAUL - Envoyez vos remarques ou commentaires à bernard@xon.be