|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T r
Length: 3177 (0xc69)
Types: TextFile
Names: »ryopinvoke.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
└─⟦eba4602b1⟧ »./isode-5.0.tar.Z«
└─⟦d3ac74d73⟧
└─⟦this⟧ »isode-5.0/rosy/ryopinvoke.c«
/* ryopinvoke.c - ROSY: invoke */
#ifndef lint
static char *rcsid = "$Header: /f/osi/rosy/RCS/ryopinvoke.c,v 6.0 89/03/18 23:42:57 mrose Rel $";
#endif
/*
* $Header: /f/osi/rosy/RCS/ryopinvoke.c,v 6.0 89/03/18 23:42:57 mrose Rel $
*
*
* $Log: ryopinvoke.c,v $
* Revision 6.0 89/03/18 23:42:57 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 "rosy.h"
#define missingP(p) \
{ \
if (p == NULL) \
return rosaplose (roi, ROS_PARAMETER, NULLCP, \
"mandatory parameter \"%s\" missing", "p"); \
}
/* \f
INVOKE */
int RyOpInvoke (sd, ryo, op, in, out, rfx, efx, class, invokeID, linkedID,
priority, roi)
int sd;
register struct RyOperation *ryo;
int op,
class,
invokeID,
*linkedID,
priority;
caddr_t in,
*out;
IFP rfx,
efx;
struct RoSAPindication *roi;
{
int result;
PE pe;
register struct opsblk *opb;
missingP (ryo);
missingP (roi);
if (opb = findopblk (sd, invokeID, OPB_INITIATOR))
return rosaplose (roi, ROS_IP_DUP, NULLCP, NULLCP);
for (; ryo -> ryo_name; ryo++)
if (ryo -> ryo_op == op)
break;
if (!ryo -> ryo_name)
return rosaplose (roi, ROS_PARAMETER, NULLCP,
"unknown operation code %d", op);
if (ryo -> ryo_arg_encode) {
#ifdef notdef
missingP (in);
#endif
if ((*ryo -> ryo_arg_encode) (&pe, 1, NULL, NULLCP, in) == NOTOK)
return rosaplose (roi, ROS_CONGEST, NULLCP,
"error encoding argument for invocation %d operation %s/%d",
invokeID, ryo -> ryo_name, ryo -> ryo_op);
}
else {
if (in)
return rosaplose (roi, ROS_PARAMETER, NULLCP,
"argument not permitted with operation %s/%d",
ryo -> ryo_name, ryo -> ryo_op);
pe = NULLPE;
}
if (ryo -> ryo_result || ryo -> ryo_errors) {
if (out) {
if (rfx || efx)
return rosaplose (roi, ROS_PARAMETER, NULLCP,
"out is exclusive with rfx/efx parameters");
}
else {
if (ryo -> ryo_result) {
missingP (rfx);
}
missingP (efx);
}
if ((opb = newopblk (sd, invokeID)) == NULLOPB) {
if (pe)
pe_free (pe);
return rosaplose (roi, ROS_CONGEST, NULLCP, NULLCP);
}
opb -> opb_ryo = ryo;
opb -> opb_resfnx = rfx, opb -> opb_errfnx = efx;
}
else {
if (class != ROS_ASYNC) {
if (pe)
pe_free (pe);
return rosaplose (roi, ROS_PARAMETER, NULLCP,
"ASYNC class must be used with operation %s/%d",
ryo -> ryo_name, ryo -> ryo_op);
}
opb = NULLOPB;
}
result = RoInvokeRequest (sd, ryo -> ryo_op, class, pe, invokeID, linkedID,
priority, roi);
if (pe)
pe_free (pe);
switch (result) {
case NOTOK:
case DONE:
break;
case OK:
if (class == ROS_ASYNC)
return OK;
return RyWaitAux (sd, opb, out, NOTOK, roi);
default:
result = rosaplose (roi, ROS_PROTOCOL, NULLCP,
"unknown return from RoInvokeRequest=%d", result);
break;
}
freeopblk (opb);
return result;
}