libhd  5.0
Examples

Get list of SCSI controllers

Get primary display controller


#include <stdio.h>
#include <stdlib.h>
#include <hd.h>
int main(int argc, char **argv)
{
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 */
free(hd_data);
return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <hd.h>
int main(int argc, char **argv)
{
hd_t *hd;
unsigned display_idx;
hd_data = calloc(1, sizeof *hd_data);
hd = hd_list(hd_data, hw_display, 1, NULL);
display_idx = hd_display_adapter(hd_data);
free(hd_data);
return 0;
}