Device Information Library Functions dipropbytes(3DEVINFO)
NAME
dipropbytes, dipropdevt, dipropints, dipropname,
dipropstrings, diproptype, dipropint64 - access pro-
perty values and attributes
SYNOPSIS
cc [ flag... ] file... -ldevinfo [ library... ]
#include
int dipropbytes(dipropt prop, uchart **propdata);
devt dipropdevt(dipropt prop);
int dipropints(dipropt prop, int **propdata);
int dipropint64(dipropt prop, int64t **propdata);
char *dipropname(dipropt prop);
int dipropstrings(dipropt prop, char **propdata);
int diproptype(dipropt prop);
PARAMETERS
prop Handle to a property returned by
dipropnext(3DEVINFO).
propdata For dipropbytes(), the address of a pointer
to an unsigned character.
For dipropints(), the address of a pointer to
an integer.
For dipropint64(), the address of a pointer
to a 64-bit integer.
For dipropstrings(), the address of pointer
to a character.
DESCRIPTION
These functions access information associated with property
values and attributes. All memory allocated by these func-
tions is managed by the library and must not be freed by the
SunOS 5.11 Last change: 27 Mar 2001 1
Device Information Library Functions dipropbytes(3DEVINFO)
caller.
The dipropbytes() function returns the property data as a
series of unsigned characters.
The dipropdevt() function returns the devt with which
this property is associated. If the value is DIDEVTNONE,
the property is not associated with any specific minor node.
The dipropints() function returns the property data as a
series of integers.
The dipropint64() function returns the property data as a
series of 64-bit integers.
The dipropname() function returns the name of the pro-
perty.
The dipropstrings() function returns the property data as
a concatenation of null-terminated strings.
The diproptype() function returns the type of the pro-
perty. The type determines the appropriate interface to
access property values. The following is a list of possible
types:
DIPROPTYPEBOLEAN There is no interface to call since
there is no property data associ-
ated with boolean properties. The
existence of the property defines a
TRUE value.
DIPROPTYPEINT Use dipropints() to access pro-
perty data.
DIPROPTYPEINT64 Use dipropint64() to access pro-
perty data.
DIPROPTYPESTRING Use dipropstrings() to access
property data.
SunOS 5.11 Last change: 27 Mar 2001 2
Device Information Library Functions dipropbytes(3DEVINFO)
DIPROPTYPEBYTE Use dipropbytes() to access pro-
perty data.
DIPROPTYPEUNKNOWN Use dipropbytes() to access pro-
perty data. Since the type of pro-
perty is unknown, the caller is
responsible for interpreting the
contents of the data.
DIPROPTYPEUNDEFIT The property has been undefined by
the driver. No property data is
available.
RETURN VALUES
Upon successful completion, dipropbytes(), dipropints(),
dipropint64(), and dipropstrings() return a non-negative
value, indicating the number of entries in the property
value buffer. See dipromproplookupbytes(3DEVINFO) for a
description of the return values. Otherwise, -1 is returned
and errno is set to indicate the error.
The dipropdevt() function returns the devt value associ-
ated with the property.
The dipropname() function returns a pointer to a string
containing the name of the property.
The diproptype() function can return one of types
described in the DESCRIPTION section.
ERORS
These functions will fail if:
EINVAL Invalid argument. For example, the property type
does not match the interface.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 27 Mar 2001 3
Device Information Library Functions dipropbytes(3DEVINFO)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level Safe
SEE ALSO
dipromproplookupbytes(3DEVINFO), dipropnext(3DEVINFO),
libdevinfo(3LIB), attributes(5)
Writing Device Drivers
SunOS 5.11 Last change: 27 Mar 2001 4
|