'\" te .\" Copyright (c) 1998, Sun Microsystems, Inc. All Rights Reserved .TH di_prom_prop_lookup_bytes 3DEVINFO "1 Dec 1998" "SunOS 5.11" "Device Information Library Functions" .SH NAME di_prom_prop_lookup_bytes, di_prom_prop_lookup_ints, di_prom_prop_lookup_strings \- search for a PROM property .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevinfo\fR [ \fIlibrary\fR... ] #include \fBint\fR \fBdi_prom_prop_lookup_bytes\fR(\fBdi_prom_handle_t\fR \fIph\fR, \fBdi_node_t\fR \fInode\fR, \fBconst char *\fR\fIprop_name\fR, \fBuchar_t **\fR\fIprop_data\fR); .fi .LP .nf \fBint\fR \fBdi_prom_prop_lookup_ints\fR(\fBdi_prom_handle_t\fR \fIph\fR, \fBdi_node_t\fR \fInode\fR, \fBconst char *\fR\fIprop_name\fR, \fBint **\fR\fIprop_data\fR); .fi .LP .nf \fBint\fR \fBdi_prom_prop_lookup_strings\fR(\fBdi_prom_handle_t\fR \fIph\fR, \fBdi_node_t\fR \fInode\fR, \fBconst char *\fR\fIprop_name\fR, \fBchar **\fR\fIprop_data\fR); .fi .SH PARAMETERS .sp .ne 2 .mk .na \fB\fInode\fR\fR .ad .RS 13n .rt Handle to device node in snapshot created by \fBdi_init\fR(3DEVINFO). .RE .sp .ne 2 .mk .na \fB\fIph\fR\fR .ad .RS 13n .rt Handle returned by \fBdi_prom_init\fR(3DEVINFO). .RE .sp .ne 2 .mk .na \fB\fIprop_data\fR\fR .ad .RS 13n .rt For \fBdi_prom_prop_lookup_bytes()\fR, the address of a pointer to an array of unsigned characters. .sp For \fBdi_prom_prop_lookup_ints()\fR, the address of a pointer to an integer. .sp For \fBdi_prom_prop_lookup_strings()\fR, the address of pointer to a buffer. .RE .sp .ne 2 .mk .na \fB\fIprop_name\fR\fR .ad .RS 13n .rt The name of the property being searched. .RE .SH DESCRIPTION .sp .LP These functions return the value of a known \fBPROM\fR property name and value type and update the \fIprop_data\fR pointer to reference memory that contains the property value. All memory allocated by these functions is managed by the library and must not be freed by the caller. .SH RETURN VALUES .sp .LP If the property is found, the number of entries in \fIprop_data\fR is returned. If the property is a boolean type, 0 is returned and the existence of this property indicates the value is true. Otherwise, -1 is returned and \fIerrno\fR is set to indicate the error. .sp .LP For \fBdi_prom_prop_lookup_bytes()\fR, the number of entries is the number of unsigned characters contained in the buffer pointed to by \fIprop_data\fR. .sp .LP For \fBdi_prom_prop_lookup_ints()\fR, the number of entries is the number of integers contained in the buffer pointed to by \fIprop_data\fR. .sp .LP For \fBdi_prom_prop_lookup_strings()\fR, the number of entries is the number of null-terminated strings contained in the buffer. The strings are stored in a concatenated format in the buffer. .SH ERRORS .sp .LP These functions will fail if:: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt Invalid argument. .RE .sp .ne 2 .mk .na \fB\fBENXIO\fR\fR .ad .RS 10n .rt The property does not exist. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelSafe .TE .SH SEE ALSO .sp .LP \fBdi_init\fR(3DEVINFO), \fBdi_prom_prop_next\fR(3DEVINFO), \fBlibdevinfo\fR(3LIB), \fBattributes\fR(5), \fBopenprom\fR(7D) .sp .LP \fIWriting Device Drivers for Oracle Solaris 11.2\fR