.TH queue "" "" "STREAMS Data Structure"
.PC "Structure of a STREAMS queue"
.B "#include <sys/stream.h>"
.B "#include <sys/types.h>"
.PP
The structure
.B queue
holds the information with which a \*(ST queue is managed.
A \*(ST driver or module has two such structures:
one for the stream's read queue and one for its write queue.
.PP
A driver or module can access
the following fields within
.BR queue :
.IP "\fBstruct qinit *q_qinfo\fR" 1.25i
The address of the structure
.BR qinfo ,
which holds the addresses of the routines with which the driver or module
processes this queue.
This field must not be altered.
.IP "\fBstruct msgb *q_first\fR"
.IS "\fBstruct msgb *q_last\fR"
The addresses of, respectively, the first and last messages in a queue.
If the queue is empty, both are initialized to NULL.
No driver or module should modify these fields.
.IP "\fBstruct queue *q_next\fR"
The address of the next queue in the stream, should there be one.
No driver or module should modify this field.
.IP "\fBvoid *q_ptr\fR"
This field is reserved for use by the driver or module.
.IP "\fBulong_t q_count\fR"
The number of bytes of all data messages in the queue's priority-band 0.
Note that this band normally holds messages with normal or high priority.
.IP "\fBulong_t q_flag\fR"
Flags that define the characteristics of the queue.
A driver or module cannot set or clear a flag; it can, however, test for the
presence of flags.
At present, only one flag is recognized for this field:
.B QREADR ,
which indicates that this is a read queue.
.IP "\fBlong q_minpsz\fR"
.IS "\fBlong q_maxpsz\fR"
Respectively, the minimum and maximum sizes for a packet.
These fields are initialized from, respectively, fields
.B mi_minpsz
and
.B mi_maxpsz
within structure
.BR module_info .
A driver or module may alter these fields.
For more information on these fields, see the entry for
.B module_info
in this manual.
.IP "\fBulong_t q_hiwat\fR"
.IS "\fBulong_t q_lowat\fR"
Respectively, the high- and low-water marks for this queue.
These fields are initialized from, respectively, fields
.B mi_hiwat
and
.B mi_lowat
within structure
.BR module_info .
A driver or module may alter these fields.
For more information on these fields, see the entry for
.B module_info
in this manual.
.SH "See Also"
.B
bcanputnext(),
canputnext(),
DDI/DKI data structures,
getq(),
insq(),
module_info,
msgb,
putq(),
qinit,
qsize(),
rmvq()
strqget(),
strqset()
.R
.SH Notes
The structure
.B queue
is defined as type
.BR queue_t .
