From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,d3b1c54242fdef7d X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,d3b1c54242fdef7d X-Google-Attributes: gid1164f8,public X-Google-Thread: 103734,d3b1c54242fdef7d X-Google-Attributes: gid103734,public X-Google-ArrivalTime: 1992-09-17 01:18:12 PST Xref: sparky comp.os.vms:15197 comp.windows.x:16811 comp.sys.dec:5038 Newsgroups: comp.os.vms,comp.windows.x,comp.sys.dec Path: sparky!uunet!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!samuel.enet.dec.com!marra From: marra@samuel.enet.dec.com (Dave Marra) Subject: Re: Q: VMS mailboxes and XtAppAddInput... (Short one) Message-ID: <1992Sep17.135221.18272@nntpd.lkg.dec.com> Sender: usenet@nntpd.lkg.dec.com (USENET News System) Reply-To: marra@samuel.enet.dec.com (Dave Marra) Organization: Digital Equipment Corporation, Hudson, NH References: Date: Thu, 17 Sep 1992 13:52:21 GMT To get XtAddInput to work on the VMS side do the following: read through the qio stuff on the vms books... then do this: add this to the file that will use pipe and xtaddinput... #ifdef VMS # include # include # include # include extern sys$clref(); static short IOSB[4]; static int event; char szIOBuffer[4096]; /* this is the current size of the io buffer allocated in the caller*/ static int channel; unsigned long _status; #endif note, the caller should (on VMS), if using a pipe, specify the size of the pipe, see the documentation... in the routine that performs the xtaddinput, add: #ifdef VMS struct dsc$descriptor_s MBox; char szMBox[256]; #endif then... #ifdef VMS event = 3; getname( event, szMBox ); /* printf( "Using MailBox %s\n", szMBox );*/ MBox.dsc$w_length = strlen( szMBox ); MBox.dsc$b_dtype = DSC$K_DTYPE_T; MBox.dsc$b_class = DSC$K_CLASS_S; MBox.dsc$a_pointer = szMBox; _status = sys$assign( &MBox, &channel, 0, &MBox, 0 ); if( _status != 1 ) ReportError( _status ); /*Allocate an event flag. Use flags only from cluster 0 */ _status = sys$clref(event); if( _status != 1 ) ReportError( _status ); /* register asynchronous completion routine */ XtAddInput( event, IOSB, _MsgCallback, &Msg ); _status = sys$qio( event, channel, IO$_READVBLK, &IOSB, 0, 0, &szIOBuffer, sizeof( szIOBuffer ), 0, 0, 0, 0); if( _status != 1 ) ReportError( _status ); #else XtAddInput(3, XtInputReadMask, _MsgCallback, &Msg); #endif next, in _MsgCallback (see XtAddInput above) #ifdef VMS if( IOSB[1] == 0 ) { *pfEof = TRUE; fSuccess = TRUE; goto end; } szIOBuffer[IOSB[1]] = 0; /* out message has 2 bytes of size, then the message, the total size is ** duplicated in IOSB[1].. be sure to COPY that message */ pMsg->usCurSize = IOSB[1] - 2; memcpy( pMsg->pch, &szIOBuffer[2], pMsg->usCurSize ); fSuccess = TRUE; _status = sys$qio( event, channel, IO$_READVBLK, &IOSB, 0, 0, &szIOBuffer, sizeof( szIOBuffer ), 0, 0, 0, 0); if( _status != 1 ) ReportError( _status ); goto end; #endif -- +-----------------------------------------------------------------------------+ + Dave Marra X TMF Engineering + + Software Validation Suites X 37 Carlene Drive + + X Window System / Motif / VMS X Nashua, NH 03062-1480 + +-----------------------------------------------------------------------------+ + Currently working at Digital Equipment Corporation, Littleton, MA + +-----------------------------------------------------------------------------+