Get primary display controller
#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; }
00001 #include <stdio.h> 00002 #include <stdlib.h> 00003 00004 #include <hd.h> 00005 00006 int main(int argc, char **argv) 00007 { 00008 hd_data_t *hd_data; 00009 hd_t *hd; 00010 00011 hd_data = calloc(1, sizeof *hd_data); 00012 00013 hd = hd_list(hd_data, hw_scsi, 1, NULL); 00014 00015 for(; hd; hd = hd->next) { 00016 hd_dump_entry(hd_data, hd, stdout) 00017 } 00018 00019 hd_free_hd_list(hd); /* free it */ 00020 hd_free_hd_data(hd_data); 00021 00022 free(hd_data); 00023 00024 return 0; 00025 } 00026
#include <stdio.h> #include <stdlib.h> #include <hd.h> int main(int argc, char **argv) { hd_data_t *hd_data; 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); hd_dump_entry(hd_data, hd_get_device_by_idx(hd_data, display_idx), stdout) hd_free_hd_list(hd); hd_free_hd_data(hd_data); free(hd_data); return 0; }
00001 #include <stdio.h> 00002 #include <stdlib.h> 00003 00004 #include <hd.h> 00005 00006 int main(int argc, char **argv) 00007 { 00008 hd_data_t *hd_data; 00009 hd_t *hd; 00010 unsigned display_idx; 00011 00012 hd_data = calloc(1, sizeof *hd_data); 00013 00014 hd = hd_list(hd_data, hw_display, 1, NULL); 00015 display_idx = hd_display_adapter(hd_data); 00016 00017 hd_dump_entry(hd_data, hd_get_device_by_idx(hd_data, display_idx), stdout) 00018 00019 hd_free_hd_list(hd); 00020 hd_free_hd_data(hd_data); 00021 00022 free(hd_data); 00023 00024 return 0; 00025 } 00026