HP-UX Reference (11i v3 07/02) - 3 Library Functions A-M (vol 6)
l
libIO(3X) libIO(3X)
[IO_E_NODE_NOEXIST]
[IO_E_PARM]
[IO_E_SYSCALL]
libIO FUNCTION
Name
io_hw_path_to_str()
- converts a hardware path to a string
Synopsis
int io_hw_path_to_str(char *str,hw_path_t *hw_path);
Description
io_hw_path_to_str()
converts the hardware path specified by hw_path to the string pointed to by
str. str must have enough space (maximum hardware path length -
MAX_HW_PATH_STR
) to hold the con-
verted string. If str is NULL, then no data is transferred, and the length of the string is returned instead.
Arguments
str Pointer to string representing hardware path.
hw_path Input hardware path structure.
Example
The following prints the hardware path of the I/O tree node represented by
my_node:
hw_path_t hw_path;
char my_string[MAX_HW_PATH_STR];
if (io_init(O_RDWR) == -1) exit(1);
io_node_to_hw_path(my_node,&hw_path);
io_hw_path_to_str(my_string,&hw_path);
printf("%s", my_string);
io_end();
exit(0);
Return Value
Number of bytes in the string - Upon success.
IO_ERROR - Otherwise. io_errno is set to indicate the error.
Errors
[IO_E_DCONF_ACCESS]
[IO_E_DCONF_OPEN]
[IO_E_PARM]
[IO_E_SYSCALL]
libIO FUNCTION
Name
io_str_to_hw_path()
- converts a string representing the hardware path to hw_path_t structure
Synopsis
int io_str_to_hw_path(char *str,hw_path_t *hw_path);
Description
io_str_to_hw_path() fills hw_path with the hardware path, given a string representing the passed
path parameter.
Arguments
str Pointer to string representing hardware path.
hw_path Hardware path.
Example
char *str_path="4/16.4.0"
hw_path_t hw_path;
724 Hewlett-Packard Company − 6 − HP-UX 11i Version 3: February 2007