File: example1.c

package info (click to toggle)
hwinfo 16.0-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,212 kB
  • ctags: 5,187
  • sloc: ansic: 64,074; perl: 2,751; makefile: 314; sh: 146
file content (26 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <stdlib.h>

#include <hd.h>

int main(int argc, char **argv)
{
  hd_data_t *hd_data;
  hd_t *hd;

  hd_data = calloc(1, sizeof *hd_data);

  hd = hd_list(hd_data, hw_scsi, 1, NULL);

  for(; hd; hd = hd->next) {
    hd_dump_entry(hd_data, hd, stdout)
  }

  hd_free_hd_list(hd);		/* free it */
  hd_free_hd_data(hd_data);

  free(hd_data);

  return 0;
}