'\"macro stdmacro
.if n .pH ddi_dki.canput @(#)canput	40.8 of 10/10/89
.\" Copyright 1989 AT&T
.de IX
.ie '\\n(.z'' .tm .Index: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9	\\n%
.el \\!.IX \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.nr X
.if \nX=0 .ds x} canput D3DK "STREAMS" "DDI/DKI" "\&"
.if \nX=1 .ds x} canput D3DK "STREAMS" "DDI/DKI"
.if \nX=2 .ds x} canput D3DK "" "\&"
.if \nX=3 .ds x} canput "" "" "\&"
.TH \*(x}
.IX "\f4canput\fP(D3DK)"
.IX "STREAMS message queues"
.IX "message (STREAMS)"
.SH NAME
\f4canput\f1 \- test for room in a message queue
.SH SYNOPSIS
.nf
.na
\f4#include <sys/stream.h>
.sp 0.5
int canput(\f4queue_t *\f1\f2cq\f4);\f1
.SH ARGUMENT
.RS 0n 10
.IP "\f2*cq\f1" 10n
The pointer to the message queue.  \f4queue_t\f1 is an alias for the
\f4queue\f1(D4DK) structure.
.RE
.SH DESCRIPTION
\f4canput\f1 searches through the stream (starting at \f2cq\f1)
until it finds a queue containing
a service routine where the message can be enqueued, or until it reaches
the end of the stream.  If found, the queue containing the service routine
is tested to see if there is room for a message in the queue.
If the queue is full, \f4canput\f1 sets the \f4QWANTW\f1 flag
to back-enable the caller's service routine.
.P
\f3NOTE:\f1
You are responsible for both testing a queue with
\f4canput\f1 and refraining from placing a message on the queue if
\f4canput\f1 fails.
.SH RETURN VALUE
If the message queue is not full,
\f41\f1 is returned.  A \f40\f1 is returned if the queue is full.
.SH LEVEL
Base or Interrupt
.SH SEE ALSO
\f2BCI Driver Development Guide\f1, Chapter 7, ``STREAMS''
.P
.na
\f4bcanput\f1(D3DK),
\f4putbq\f1(D3DK),
\f4putnext\f1(D3DK)
.ad
.SH EXAMPLE
See the \f4bufcall\f1(D3DK) function page for an example of 
\f4canput\f1.
