srv_deletemsgq

Description

Delete a message queue.

Syntax

CS_RETCODE srv_deletemsgq(msgqnamep, msgqname_len,
              msgqid)
CS_CHAR       *msgqnamep;
CS_INT            msgqname_len;
SRV_OBJID     msgqid;

Parameters

msgqnamep

A pointer to the name of the message queue to delete. It is an error to attempt to delete a message queue that does not exist.

msgqname_len

The length of the name pointed to by msgqname. If the name is null terminated, msgqname_len can be set to CS_NULLTERM.

msgqid

A SRV_OBJID that specifies the identifier of message queue to delete.

Returns

Table 3-32: Return values (srv_deletemsgq)

Returns

To indicate

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

Examples

Example 1

#include          <ospublic.h>
/*
 ** Local Prototype.
 */
CS_RETCODE      ex_srv_deletemsgq PROTOTYPE((
CS_CHAR         *msgqname,
CS_INT          msgqname_len,
SRV_OBJID msgqid
));
/* 
 ** EX_SRV_DELETEMSGQ
**
**     Example routine using srv_deletemsgq to delete an Open
 **     Server message queue previously create by srv_createmsgq.
** This routine can be passed a value message queue name, or
 ** NULL,in which case the message queue identifier will be used.
**
** Arguments:
**  msgqname        The name of the message queue to delete. If
 **                  NULL, the msgqid is used.
 **  msgqname_len    The length of the name to which msgqname 
 **                  points.
 **  msgqid          A SRV_OBJID that specifies the identifier of
 **                  the message queue to delete.
 **
** Returns:
**
**    CS_SUCCEED    The message queue was successfully deleted.
**    CS_FAIL       An error was detected.
 */
CS_RETCODE      ex_srv_deletemsgq(msgqname, msgqname_len, msgqid)
CS_CHAR         *msgqname;
CS_INT          msgqname_len;
SRV_OBJID       msgqid;
{
     /*
      ** Delete a message queue.
      */
     if (srv_deletemsgq(msgqname, msgqname_len, msgqid) !=
           CS_SUCCEED)
     {
          return(CS_FAIL);
     }
     return(CS_SUCCEED);
}

Usage

See also

srv_createmsgq, srv_getmsgq, srv_getobjname, srv_putmsgq