4.6  WindNet STREAMS Utility Routines

Table 7 summarizes the STREAMS utility routines provided with WindNet STREAMS. For details on how to use these routines, consult Programmer's Guide: STREAMS by UNIX Press. Table 7 includes only implementation notes and clarifications of possible ambiguities.

Routines included in Table 7 that are indicated as no-op for WindNet STREAMS provide compatibility with other STREAMS implementations.

Table 7.   WindNet STREAMS Utility Routines


Routine
Description


adjmsg( )
Trim bytes from a message.
allocb( )
Allocate a message block.
backq( )
Pointer to queue whose q_next field points at queue argument.
bcanput( )
Test flow control on a specified band.
bcanputnext( )
Test flow control on a specified band of the next queue in the stream.
bufcall( )
Recover from allocb( ) failure.
canput( )
Test flow control on band 0.
canputnext( )
SVR4 multi-threaded version of canput( ). 1
copyb( )
Copy a message block.
copymsg( )
Copy a message.
datamsg( )
Test if a message is a data message.
dupb( )
Duplicate a message block.
dupmsg( )
Duplicate a message.
enableok( )
Permit a queue to be scheduled.
esballoc( )
Allocate message and data blocks referencing a user-supplied buffer.
flushband( )
Flush messages from a specified band.
flushq( )
Flush messages on a message queue.
freeb( )
Free a message block.
freemsg( )
Free all blocks in a message.
freezestr( )
Disable message processing on a stream for purposes of updating queue structure fields. This is a no-op for WindNet STREAMS.
getadmin( )
Return pointer to module's qadmin structure.
getmid( )
Return module ID value.
getq( )
Remove first message from message queue.
insq( )
Insert a message on the message queue.
linkb( )
Concatenate two messages.
msgdsize( )
Compute number of data bytes in a message.
msgpullup( )
Copies a message into a newly-allocated single message block.
noenable( )
Prevent a queue from being scheduled.
OTHERQ( )
Return a pointer to the other queue of the pair.
pullupmsg( )
Concatenate and align bytes into a single message block.
putbq( )
Replace a message on the front of the message queue.
putctl( )
Pass a control message to a queue (by calling its put procedure).
putctl1( )
Pass a 1-byte control message to a queue (by calling its put procedure).
putctl2( )
Pass a 2-byte control message to a queue (by calling its put procedure).
putnext( )
Pass a message to the next module in the stream (by calling its put procedure).
putnextctl( )
Pass a control message to the next module in the stream (by calling its put procedure).
putnextctl1( )
Pass a 1-byte control message to the next module in the stream (by calling its put procedure).
putq( )
Place a message at the end of the message queue.
qenable( )
Enable a queue.
qprocson( )
Make a module visible to the stream. This is a no-op for WindNet STREAMS.
qprocsoff( )
Make a module invisible to the stream. This is a no-op for WindNet STREAMS.
qreply( )
Pass a message to the previous module in the stream (by calling its put procedure).
qsize( )
Obtain the number of messages on a message queue.
RD( )
The read-side queue of a specified write-side queue.
rmvb( )
Remove a message block from a message.
rmvq( )
Remove a specified message from anywhere on the message queue.
strlog( )
Pass a message to the STREAMS log device.
strqget( )
Obtain information from the queue structure.
strqset( )
Set information in the queue structure.
testb( )
Check for buffer availability.
unbufcall( )
Cancel a previous bufcall( ) request.
unlinkb( )
Remove a message block from the front of a message.
unfreezestr( )
Cancel a freezestr( ) call. This is a no-op for WindNet STREAMS.
WR( )
Return a pointer to the write-side queue of the specified read-side queue.

1 In multi-threaded versions of SVR4 STREAMS, there is no guarantee that q->q_next will not change. Therefore, the routine canputnext( ) was introduced. The current queue parameter is passed and canputnext( ) extracts q->q_next under whatever lock is necessary to ensure that it isn't changing. This is not necessary in WindNet STREAMS because q->q_next cannot change while in the put or service routine for q. The canputnext( ) routine is provided for compatibility, but there is no functional difference between canput(q->q_next) and canputnext(q).