]> git.ipfire.org Git - ipfire-2.x.git/blob - src/hwinfo/doc/example1.c
7de3e477df6e4b39deda2b7d58b2ab7113b3e4f9
[ipfire-2.x.git] / src / hwinfo / doc / example1.c
1 #include <stdio.h>
2 #include <stdlib.h>
3
4 #include <hd.h>
5
6 int main(int argc, char **argv)
7 {
8 hd_data_t *hd_data;
9 hd_t *hd;
10
11 hd_data = calloc(1, sizeof *hd_data);
12
13 hd = hd_list(hd_data, hw_scsi, 1, NULL);
14
15 for(; hd; hd = hd->next) {
16 hd_dump_entry(hd_data, hd, stdout)
17 }
18
19 hd_free_hd_list(hd); /* free it */
20 hd_free_hd_data(hd_data);
21
22 free(hd_data);
23
24 return 0;
25 }
26