|
|
1.1 ! root 1: ... ! 2: ! 3: static int op_name (sd, ryo, rox, in, roi) ! 4: int sd; ! 5: struct RyOperation *ryo; ! 6: struct RoSAPinvoke *rox; ! 7: caddr_t in; ! 8: struct RoSAPindication *roi; ! 9: { ! 10: int result, ! 11: won; ! 12: register struct type_MODULE_argument *arg = ! 13: (struct type_MODULE_argument *) in; ! 14: ! 15: /* this check should *not* be made if linking of operations is expected */ ! 16: if (rox -> rox_nolinked == 0) { ! 17: advise (LLOG_EXCEPTIONS, NULLCP, ! 18: "RO-INVOKE.INDICATION/%d: %s, unknown linkage %d", ! 19: sd, ryo -> ryo_name, rox -> rox_linkid); ! 20: return ureject (sd, ROS_IP_LINKED, rox, roi); ! 21: } ! 22: if (debug) ! 23: advise (LLOG_DEBUG, NULLCP, "RO-INVOKE.INDICATION/%d: %s", ! 24: sd, ryo -> ryo_name); ! 25: ! 26: /* do something with ``arg'' here and decide if won... */ ! 27: ! 28: if (won) { ! 29: register struct type_MODULE_result *res; ! 30: ! 31: /* allocate and initialize the result ``res'' here... */ ! 32: ! 33: if (RyDsResult (sd, rox -> rox_id, (caddr_t) res, ROS_NOPRIO, roi) ! 34: == NOTOK) ! 35: ros_adios (&roi -> roi_preject, "RESULT"); ! 36: result = OK; ! 37: ! 38: free_MODULE_result (res); ! 39: } ! 40: else { ! 41: struct type_MODULE_parameter *parm; ! 42: ! 43: /* allocate and initialize ``parm'' here... */ ! 44: ! 45: result = error (sd, error_MODULE_error1, (caddr_t) parm, rox, roi); ! 46: ! 47: free_MODULE_parameter (parm); ! 48: } ! 49: ! 50: /* ``arg'' will be automatically free'd when op_name returns */ ! 51: ! 52: return result; ! 53: } ! 54: ! 55: ... ! 56: ! 57: static int error (sd, err, param, rox, roi) ! 58: int sd, ! 59: err; ! 60: caddr_t param; ! 61: struct RoSAPinvoke *rox; ! 62: struct RoSAPindication *roi; ! 63: { ! 64: if (RyDsError (sd, rox -> rox_id, err, param, ROS_NOPRIO, roi) == NOTOK) ! 65: ros_adios (&roi -> roi_preject, "ERROR"); ! 66: ! 67: return OK; ! 68: } ! 69: ! 70: ! 71: static int ureject (sd, reason, rox, roi) ! 72: int sd, ! 73: reason; ! 74: struct RoSAPinvoke *rox; ! 75: struct RoSAPindication *roi; ! 76: { ! 77: if (RyDsUReject (sd, rox -> rox_id, reason, ROS_NOPRIO, roi) == NOTOK) ! 78: ros_adios (&roi -> roi_preject, "U-REJECT"); ! 79: ! 80: return OK; ! 81: } ! 82: ! 83: ...
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.