Using the HP-UX libIO Library
&count, token_array);
}
if (ret!=IO_SUCCESS) {
io_error ("ERROR:io_get_mapping:");
exit(1);
}
if (io_query (legacy_node, S_IOTREE, "hw_path", &hw_path)
==IO_ERROR ) {
io_error("ERROR:io_query");
exit(1);
}
if (io_hw_path_to_str(my_string, &hw_path)==IO_ERROR) {
io_error("io_hw_path_to_str");
exit(1);
}
if (io_query (token_array[0], S_IOTREE_EXT, "hw_path",
&hw_path1)==IO_ERROR ) {
io_error("ERROR:io_query");
exit(1);
}
if (io_hw_path_to_str(my_string1, &hw_path1)==IO_ERROR) {
io_error("io_hw_path_to_str");
exit(1);
}
printf("IO_LEGACY_2_NEW MAPPING\n------------------------
\n");
printf("%s maps %s \n\n",my_string, my_string1);
/*IO_NEW_2_LEGACY mapping */
strcpy(my_string , "");
token_array1=(io_token_t *)malloc(sizeof(io_token_t));
ret=io_get_mapping(token_array[0], IO_NEW_2_LEGACY,
&count, token_array1);
if (ret == IO_E_MEM_ALLOC) {
token_array1=(io_token_t*)
malloc(count*sizeof(io_token_t));
ret=io_get_mapping(new_node, IO_NEW_2_LEGACY, &count,
token_array1);
}
if (ret != IO_SUCCESS) {
io_error("ERROR:io_get_mapping:");
exit(1);
}
if (io_query (token_array1[0], S_IOTREE, "hw_path",
&hw_path1)==IO_ERROR ) {
io_error("ERROR:io_query");
exit(1);
}