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

⟦afeb9d046⟧ TextFile

    Length: 3060 (0xbf4)
    Types: TextFile
    Names: »rosapinvoke.c«

Derivation

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

TextFile

/* rosapinvoke.c - ROPM: invoke */

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

/* 
 * $Header: /f/osi/rosap/RCS/rosapinvoke.c,v 6.0 89/03/18 23:42:26 mrose Rel $
 *
 * Based on an TCP-based implementation by George Michaelson of University
 * College London.
 *
 *
 * $Log:	rosapinvoke.c,v $
 * Revision 6.0  89/03/18  23:42:26  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 <stdio.h>
#include <signal.h>
#include "ropkt.h"

/* \f

   RO-INVOKE.REQUEST */

int	RoInvokeRequest (sd, op, class, args, invokeID, linkedID, priority, roi)
int	sd;
int	op,
	class,
	invokeID,
       *linkedID,
	priority;
PE	args;
struct RoSAPindication *roi;
{
    SBV	    smask;
    int     result;
    register struct assocblk   *acb;

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

	default: 
	    return rosaplose (roi, ROS_PARAMETER, NULLCP,
		    "bad value for class parameter");
    }
    missingP (roi);

    smask = sigioblock ();

    rosapPsig (acb, sd);

    result = RoInvokeRequestAux (acb, op, class, args, invokeID, linkedID,
		priority, roi);

    (void) sigiomask (smask);

    return result;
}

/* \f

 */

static int  RoInvokeRequestAux (acb, op, class, args, invokeID, linkedID,
		priority, roi)
register struct assocblk   *acb;
int	op,
	class,
	invokeID,
       *linkedID,
	priority;
PE	args;
struct RoSAPindication *roi;
{
    register PE	pe,
		p;

    if (!(acb -> acb_flags & ACB_INIT) && (acb -> acb_flags & ACB_ROS))
	return rosaplose (roi, ROS_OPERATION, NULLCP, "not initiator");
    if (!(acb -> acb_flags & ACB_ACS)) {
	missingP (args);
	if (linkedID)
	    return rosaplose (roi, ROS_OPERATION, NULLCP,
			"linked operations not permitted");
    }
		    
    if (acb -> acb_ready
	    && !(acb -> acb_flags & ACB_TURN)
	    && (*acb -> acb_ready) (acb, priority, roi) == NOTOK)
	return NOTOK;

/* begin Invoke APDU */
    if ((pe = pe_alloc (PE_CLASS_CONT, PE_FORM_CONS, APDU_INVOKE)) == NULLPE
	    || ((acb -> acb_flags & ACB_ACS)
		    ? (p = pe, 0)
		    : set_add (pe, p = pe_alloc (PE_CLASS_UNIV, PE_FORM_CONS,
			PE_CONS_SEQ)) == NOTOK)
	    || seq_add (p, int2prim (invokeID), -1) == NOTOK
	    || (linkedID
		    && seq_add (p, num2prim (*linkedID, PE_CLASS_CONT, 0), -1)
			    == NOTOK)
	    || seq_add (p, int2prim (op), -1) == NOTOK
	    || (args && seq_add (p, args, -1) == NOTOK)) {
	if (pe) {
	    if (args)
		(void) pe_extract (pe, args);
	    pe_free (pe);
	}
	freeacblk (acb);
	return rosaplose (roi, ROS_CONGEST, NULLCP, "out of memory");
    }
/* end Invoke APDU */

    if ((*acb -> acb_putosdu) (acb, pe, args, priority, roi) == NOTOK)
	return NOTOK;

    return (class == ROS_SYNC
	    ? (*acb -> acb_rowaitrequest)  (acb, &invokeID, NOTOK, roi)
	    : OK);
}