'\" te .\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved .TH di_prop_bytes 3DEVINFO "27 Mar 2001" "SunOS 5.11" "Device Information Library Functions" .SH NAME di_prop_bytes, di_prop_devt, di_prop_ints, di_prop_name, di_prop_strings, di_prop_type, di_prop_int64 \- access property values and attributes .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevinfo\fR [ \fIlibrary\fR... ] #include \fBint\fR \fBdi_prop_bytes\fR(\fBdi_prop_t\fR \fIprop\fR, \fBuchar_t **\fR\fIprop_data\fR); .fi .LP .nf \fBdev_t\fR \fBdi_prop_devt\fR(\fBdi_prop_t\fR \fIprop\fR); .fi .LP .nf \fBint\fR \fBdi_prop_ints\fR(\fBdi_prop_t\fR \fIprop\fR, \fBint **\fR\fIprop_data\fR); .fi .LP .nf \fBint\fR \fBdi_prop_int64\fR(\fBdi_prop_t\fR \fIprop\fR, \fBint64_t **\fR\fIprop_data\fR); .fi .LP .nf \fBchar *\fR\fBdi_prop_name\fR(\fBdi_prop_t\fR \fIprop\fR); .fi .LP .nf \fBint\fR \fBdi_prop_strings\fR(\fBdi_prop_t\fR \fIprop\fR, \fBchar **\fR\fIprop_data\fR); .fi .LP .nf \fBint\fR \fBdi_prop_type\fR(\fBdi_prop_t\fR \fIprop\fR); .fi .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIprop\fR\fR .ad .RS 13n .rt Handle to a property returned by \fBdi_prop_next\fR(3DEVINFO). .RE .sp .ne 2 .mk .na \fB\fIprop_data\fR\fR .ad .RS 13n .rt For \fBdi_prop_bytes()\fR, the address of a pointer to an unsigned character. .sp For \fBdi_prop_ints()\fR, the address of a pointer to an integer. .sp For \fBdi_prop_int64()\fR, the address of a pointer to a 64-bit integer. .sp For \fBdi_prop_strings()\fR, the address of pointer to a character. .RE .SH DESCRIPTION .sp .LP These functions access information associated with property values and attributes. All memory allocated by these functions is managed by the library and must not be freed by the caller. .sp .LP The \fBdi_prop_bytes()\fR function returns the property data as a series of unsigned characters. .sp .LP The \fBdi_prop_devt()\fR function returns the \fBdev_t\fR with which this property is associated. If the value is \fBDDI_DEV_T_NONE\fR, the property is not associated with any specific minor node. .sp .LP The \fBdi_prop_ints()\fR function returns the property data as a series of integers. .sp .LP The \fBdi_prop_int64()\fR function returns the property data as a series of 64-bit integers. .sp .LP The \fBdi_prop_name()\fR function returns the name of the property. .sp .LP The \fBdi_prop_strings()\fR function returns the property data as a concatenation of null-terminated strings. .sp .LP The \fBdi_prop_type()\fR function returns the type of the property. The type determines the appropriate interface to access property values. The following is a list of possible types: .sp .ne 2 .mk .na \fB\fBDI_PROP_TYPE_BOOLEAN\fR\fR .ad .RS 25n .rt There is no interface to call since there is no property data associated with boolean properties. The existence of the property defines a \fBTRUE\fR value. .RE .sp .ne 2 .mk .na \fB\fBDI_PROP_TYPE_INT\fR\fR .ad .RS 25n .rt Use \fBdi_prop_ints()\fR to access property data. .RE .sp .ne 2 .mk .na \fB\fBDI_PROP_TYPE_INT64\fR\fR .ad .RS 25n .rt Use \fBdi_prop_int64()\fR to access property data. .RE .sp .ne 2 .mk .na \fB\fBDI_PROP_TYPE_STRING\fR\fR .ad .RS 25n .rt Use \fBdi_prop_strings()\fR to access property data. .RE .sp .ne 2 .mk .na \fB\fBDI_PROP_TYPE_BYTE\fR\fR .ad .RS 25n .rt Use \fBdi_prop_bytes()\fR to access property data. .RE .sp .ne 2 .mk .na \fB\fBDI_PROP_TYPE_UNKNOWN \fR\fR .ad .RS 25n .rt Use \fBdi_prop_bytes()\fR to access property data. Since the type of property is unknown, the caller is responsible for interpreting the contents of the data. .RE .sp .ne 2 .mk .na \fB\fBDI_PROP_TYPE_UNDEF_IT\fR\fR .ad .RS 25n .rt The property has been undefined by the driver. No property data is available. .RE .SH RETURN VALUES .sp .LP Upon successful completion, \fBdi_prop_bytes()\fR, \fBdi_prop_ints()\fR, \fBdi_prop_int64()\fR, and \fBdi_prop_strings()\fR return a non-negative value, indicating the number of entries in the property value buffer. See \fBdi_prom_prop_lookup_bytes\fR(3DEVINFO) for a description of the return values. Otherwise, -1 is returned and \fIerrno\fR is set to indicate the error. .sp .LP The \fBdi_prop_devt()\fR function returns the \fBdev_t\fR value associated with the property. .sp .LP The \fBdi_prop_name()\fR function returns a pointer to a string containing the name of the property. .sp .LP The \fBdi_prop_type()\fR function can return one of types described in the DESCRIPTION section. .SH ERRORS .sp .LP These functions will fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt Invalid argument. For example, the property type does not match the interface. .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_prom_prop_lookup_bytes\fR(3DEVINFO), \fBdi_prop_next\fR(3DEVINFO), \fBlibdevinfo\fR(3LIB), \fBattributes\fR(5) .sp .LP \fIWriting Device Drivers for Oracle Solaris 11.2\fR