Annotation of 43BSDReno/contrib/isode-beta/doc/manual/ryinit-async.c, revision 1.1.1.1

1.1       root        1: ...
                      2: 
                      3: int    do_result (), do_error ();
                      4: 
                      5: ...
                      6: 
                      7:     int            result;
                      8:     struct RoSAPindication rois;
                      9:     register struct RoSAPindication *roi = &rois;
                     10:     register struct RoSAPpreject   *rop = &roi -> roi_preject;
                     11: 
                     12:     /* allocate and initialize ``arg'' here... */
                     13: 
                     14:     switch (result = stub_MODULE_operation (sd, RyGenID (sd), arg, do_result,
                     15:                                            do_error, ROS_SYNC, roi)) {
                     16:        case NOTOK:             /* failure */
                     17:            if (ROS_FATAL (rop -> rop_reason))
                     18:                ros_adios (rop, "STUB");
                     19:            ros_advise (rop, "STUB");
                     20:            break;
                     21: 
                     22:        case OK:
                     23:            break;
                     24: 
                     25:        case DONE:              /* got RO-END? */
                     26:            adios (NULLCP, "got RO-END.INDICATION");
                     27:            /* NOTREACHED */
                     28: 
                     29:        default:
                     30:            adios (NULLCP, "unknown return from RyStub=%d", result);
                     31:            /* NOTREACHED */
                     32:     }
                     33: 
                     34:     free_MODULE_argument (arg);
                     35: 
                     36: ...
                     37: 
                     38: do_result (sd, id, dummy, result, roi)
                     39: int    sd;
                     40: int    id,
                     41:        dummy;
                     42: struct type_MODULE_result *result;
                     43: struct RoSAPindication *roi;
                     44: {
                     45:     /* do something with ``result'' here... */
                     46: 
                     47:     /* ``result'' will be automatically free'd when do_result returns */
                     48: 
                     49:     return OK;
                     50: }
                     51: 
                     52: ...
                     53: 
                     54: 
                     55: do_error (sd, id, error, parameter, roi)
                     56: int    sd;
                     57: int    id,
                     58:        error;
                     59: caddr_t parameter;
                     60: struct RoSAPindication *roi;
                     61: {
                     62:     switch (error) {
                     63:        case error_MODULE_error1:
                     64:        {
                     65:            register struct type_MODULE_parameter *parm =
                     66:                            (struct type_MODULE_parameter *) parameter;
                     67: 
                     68:            /* do something with ``parm'' here... */
                     69: 
                     70:            break;
                     71:        }
                     72: 
                     73:        /* other errors are handled here... */
                     74:        
                     75: 
                     76:        default:
                     77:            adios (NULLCP, "unknown error returned (%d)", error);
                     78:            /* NOTREACHED */
                     79:     }
                     80:     
                     81:     /* ``parameter'' will be automatically free'd when do_error returns */
                     82: 
                     83:     return OK;
                     84: }
                     85: 
                     86: ...

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.