|
|
1.1 root 1: /* rydsresult.c - ROSY: return result to invocation */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/rosy/RCS/rydsresult.c,v 7.1 90/07/01 21:06:32 mrose Exp $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/rosy/RCS/rydsresult.c,v 7.1 90/07/01 21:06:32 mrose Exp $
9: *
10: *
11: * $Log: rydsresult.c,v $
12: * Revision 7.1 90/07/01 21:06:32 mrose
13: * pepsy
14: *
15: * Revision 7.0 89/11/23 22:21:57 mrose
16: * Release 6.0
17: *
18: */
19:
20: /*
21: * NOTICE
22: *
23: * Acquisition, use, and distribution of this module and related
24: * materials are subject to the restrictions of a license agreement.
25: * Consult the Preface in the User's Manual for the full terms of
26: * this agreement.
27: *
28: */
29:
30:
31: /* LINTLIBRARY */
32:
33: #include <stdio.h>
34: #include "rosy.h"
35:
36:
37: #define missingP(p) \
38: { \
39: if (p == NULL) \
40: return rosaplose (roi, ROS_PARAMETER, NULLCP, \
41: "mandatory parameter \"%s\" missing", "p"); \
42: }
43:
44: /* RESULT */
45:
46: int RyDsResult (sd, id, out, priority, roi)
47: int sd;
48: int id,
49: priority;
50: caddr_t out;
51: struct RoSAPindication *roi;
52: {
53: int result;
54: PE pe;
55: register struct opsblk *opb;
56: register struct RyOperation *ryo;
57:
58: missingP (roi);
59:
60: if ((opb = findopblk (sd, id, OPB_RESPONDER)) == NULLOPB)
61: return rosaplose (roi, ROS_PARAMETER, NULLCP,
62: "invocation %d not in progress on association %d",
63: id, sd);
64:
65: ryo = opb -> opb_ryo;
66: if (!ryo -> ryo_result)
67: return rosaplose (roi, ROS_PARAMETER, NULLCP,
68: "result not permitted with operation %s/%d",
69: ryo -> ryo_name, ryo -> ryo_op);
70:
71: #ifdef PEPSY_DEFINITIONS
72: if (ryo -> ryo_res_mod) {
73: #else
74: if (ryo -> ryo_res_encode) {
75: #endif
76: #ifdef notdef
77: missingP (out);
78: #endif
79: PY_pepy[0] = 0;
80: #ifdef PEPSY_DEFINITIONS
81: if (enc_f (ryo -> ryo_res_index, ryo -> ryo_res_mod, &pe, 1, NULL,
82: NULLCP, out) == NOTOK)
83: #else
84: if ((*ryo -> ryo_res_encode) (&pe, 1, NULL, NULLCP, out) == NOTOK)
85: #endif
86: return rosaplose (roi, ROS_CONGEST, NULLCP,
87: "error encoding result for invocation %d of operation %s/%d [%s]",
88: opb -> opb_id, ryo -> ryo_name, ryo -> ryo_op, PY_pepy);
89: }
90: else {
91: if (out)
92: return rosaplose (roi, ROS_PARAMETER, NULLCP,
93: "result value not permitted with operation %s/%d",
94: ryo -> ryo_name, ryo -> ryo_op);
95:
96: pe = NULLPE;
97: }
98:
99: if ((result = RoResultRequest (sd, id, ryo -> ryo_op, pe, priority, roi))
100: != NOTOK)
101: freeopblk (opb);
102:
103: if (pe)
104: pe_free (pe);
105:
106: return result;
107: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.