DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T r

⟦32ff8dd5f⟧ TextFile

    Length: 3097 (0xc19)
    Types: TextFile
    Names: »rystub.c«

Derivation

└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
    └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« 
        └─⟦d3ac74d73⟧ 
            └─⟦this⟧ »isode-5.0/rosy/rystub.c« 

TextFile

/* rystub.c - ROSY: stubs */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/rosy/RCS/rystub.c,v 6.0 89/03/18 23:42:58 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/rosy/RCS/rystub.c,v 6.0 89/03/18 23:42:58 mrose Rel $
 *
 *
 * $Log:	rystub.c,v $
 * Revision 6.0  89/03/18  23:42:58  mrose
 * Release 5.0
 * 
 */

/*
 *				  NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


/* LINTLIBRARY */

#include <signal.h>
#include <stdio.h>
#include "rosy.h"


#define	missingP(p) \
{ \
    if (p == NULL) \
	return rosaplose (roi, ROS_PARAMETER, NULLCP, \
			    "mandatory parameter \"%s\" missing", "p"); \
}

/* \f

 */

static int interrupted;
SFD	intrser ();

/* \f

   stub */

int	RyStub (sd, ryo, op, id, linked, in, rfx, efx, class, roi)
int	sd;
register struct RyOperation *ryo;
int	op,
	id,
       *linked,
    	class;
caddr_t	in;
IFP	rfx,
    	efx;
struct RoSAPindication *roi;
{
    int     firstime,
	    opclass,
	    result;
    SFP	    istat;

#ifdef	notdef			/* let RyOpInvoke check these as necessary */
    missingP (ryo);
    missingP (in);
    missingP (rfx);
    missingP (efx);
#endif
    missingP (roi);

    if ((opclass = class) == ROS_INTR) {
	interrupted = 0;
	istat = signal (SIGINT, intrser);

	opclass = ROS_ASYNC;
    }
    
    result = RyOpInvoke (sd, ryo, op, in, (caddr_t *) NULL, rfx, efx,
			 opclass, id, linked, ROS_NOPRIO, roi);
    firstime = 1;

again: ;
    switch (result) {
	case NOTOK: 
	    break;

	case OK:
	    switch (class) {
		case ROS_ASYNC:
		    break;

		case ROS_INTR:
		    if (firstime) {
			for (;;) {
			    if (!interrupted) {
				int	nfds;
				fd_set	rfds;

				nfds = 0;
				FD_ZERO (&rfds);

						/* interrupt causes EINTR */
				if (RoSelectMask (sd, &rfds, &nfds, roi) == OK)
				    (void) xselect (nfds, &rfds, NULLFD,
						    NULLFD, NOTOK);
			    }
			    if (interrupted) {
				result = rosaplose (roi, ROS_INTERRUPTED,
						    NULLCP, NULLCP);
				break;
			    }
			    if ((result = RyWait (sd, &id, (caddr_t *) NULL,
						  OK, roi)) != NOTOK
			            || roi -> roi_preject.rop_reason
					    != ROS_TIMER) {
				firstime = 0;
				goto again;
			    }
			}
			break;
		    }
		    /* else fall */
		    
		default:
		    switch (roi -> roi_type) {
		        case ROI_RESULT:
		        case ROI_ERROR:
		        case ROI_UREJECT:
			    result = OK;
			    break;

			default:
			    result = rosaplose (roi, ROS_PROTOCOL, NULLCP,
						"unknown indication type=%d",
						roi -> roi_type);
			    break;
		    }
		    break;
	    }

	case DONE:
	    break;

	default: 
	    result = rosaplose (roi, ROS_PROTOCOL, NULLCP,
				"unknown return from RyInvoke=%d", result);
	    break;
    }

    if (class == ROS_INTR)
	(void) signal (SIGINT, istat);

    return result;
}

/* \f

 */

/* ARGSUSED */

static  SFD intrser (sig)
int	sig;
{
#ifndef	BSDSIGS
    (void) signal (SIGINT, intrser);
#endif

    interrupted++;
}