\File{ryinit\-invoke.c},{22:23},{Jun 12 1988}
\L{\LB{...}}
\L{\LB{}}
\L{\LB{    \K{int}}\Tab{8}{    result,}}
\L{\LB{}\Tab{8}{    response;}}
\L{\LB{    \K{struct} type\_MODULE\_argument *arg;}}
\L{\LB{    caddr\_t out;}}
\L{\LB{    \K{struct} RoSAPindication rois;}}
\L{\LB{    \K{register} \K{struct} RoSAPindication *roi = \&rois;}}
\L{\LB{    \K{register} \K{struct} RoSAPpreject   *rop = \&roi \-\> roi\_preject;}}
\L{\LB{}}
\L{\LB{    \C{}\/* allocate and initialize ``arg\'\' here... *\/\CE{}}}
\L{\LB{}}
\L{\LB{\Proc{switch}    \K{switch} (result = op\_MODULE\_operation (sd, arg, \&out, \&response, roi)) \{}}
\L{\LB{}\Tab{8}{\K{case} NOTOK:}\Tab{32}{\C{}\/* failure *\/\CE{}}}
\L{\LB{}\Tab{8}{    \K{if} (ROS\_FATAL (rop \-\> rop\_reason))}}
\L{\LB{}\Tab{16}{ros\_adios (rop, \S{}\"OPERATION\"\SE{});}}
\L{\LB{}\Tab{8}{    ros\_advise (rop, \S{}\"OPERATION\"\SE{});}}
\L{\LB{}\Tab{8}{    \K{break};}}
\L{\LB{}}
\L{\LB{}\Tab{8}{\K{case} OK:}\Tab{32}{\C{}\/* got a result\/error response *\/\CE{}}}
\L{\LB{}\Tab{8}{    \K{switch} (response) \{}}
\L{\LB{}\Tab{16}{\K{case} RY\_RESULT:}\Tab{32}{\C{}\/* got a result *\/\CE{}}}
\L{\LB{}\Tab{16}{    \{}}
\L{\LB{}\Tab{24}{\K{register} \K{struct} type\_MODULE\_result *res =}}
\L{\LB{}\Tab{32}{    (\K{struct} type\_MODULE\_result *) out;}}
\L{\LB{}}
\L{\LB{\C{}\/* do something with ``res\'\' here... *\/\CE{}}}
\L{\LB{}}
\L{\LB{}\Tab{24}{free\_MODULE\_result (res);}}
\L{\LB{}\Tab{24}{\K{break};}}
\L{\LB{}\Tab{16}{    \}}}
\L{\LB{}\Tab{8}{}}
\L{\LB{}\Tab{16}{\K{case} error\_MODULE\_error1:}}
\L{\LB{}\Tab{16}{    \{}}
\L{\LB{}\Tab{24}{\K{register} \K{struct} type\_MODULE\_parameter *parm =}}
\L{\LB{}\Tab{32}{    (\K{struct} type\_MODULE\_parameter *) out;}}
\L{\LB{}}
\L{\LB{\C{}\/* do something with ``parm\'\' here... *\/\CE{}}}
\L{\LB{}}
\L{\LB{}\Tab{24}{free\_MODULE\_parameter (parm);}}
\L{\LB{}\Tab{24}{\K{break};}}
\L{\LB{}\Tab{16}{    \}}}
\L{\LB{}}
\L{\LB{}\Tab{16}{\C{}\/* other errors are handled here... *\/\CE{}}}
\L{\LB{}}
\L{\LB{}\Tab{16}{\K{default}:}}
\L{\LB{}\Tab{16}{    adios (NULLCP, \S{}\"unknown result\/error returned (\%d)\"\SE{},}}
\L{\LB{}\Tab{32}{response);}}
\L{\LB{}\Tab{16}{    \C{}\/* NOTREACHED *\/\CE{}}}
\L{\LB{}\Tab{8}{    \}}}
\L{\LB{}\Tab{8}{    \K{break};}}
\L{\LB{}}
\L{\LB{}\Tab{8}{\K{case} DONE:}\Tab{32}{\C{}\/* got RO\-END? *\/\CE{}}}
\L{\LB{}\Tab{8}{    adios (NULLCP, \S{}\"got RO\-END.INDICATION\"\SE{});}}
\L{\LB{}\Tab{8}{    \C{}\/* NOTREACHED *\/\CE{}}}
\L{\LB{}}
\L{\LB{}\Tab{8}{\K{default}:}}
\L{\LB{}\Tab{8}{    adios (NULLCP, \S{}\"unknown return from RyOperation=\%d\"\SE{}, result);}}
\L{\LB{}\Tab{8}{    \C{}\/* NOTREACHED *\/\CE{}}}
\L{\LB{    \}}}
\L{\LB{}}
\L{\LB{    free\_MODULE\_argument (arg);}}
\L{\LB{}}
\L{\LB{...}}
