\File{grindB\-2.c},{22:23},{Jun 12 1988}
\L{\LB{\K{\#include} \<stdio.h\>}}
\L{\LB{\K{\#include} \S{}\"generic.h\"\SE{}}\Tab{32}{\C{}\/* defines OPERATIONS and ERRORS *\/\CE{}}}
\L{\LB{\K{\#include} \<isode\/rosap.h\>}}
\L{\LB{\K{\#include} \<isode\/isoservent.h\>}}
\L{\LB{}}
\L{\LB{}}
\L{\LB{\K{int}}\Tab{8}{ros\_indications ();}}
\L{\LB{}}
\L{\LB{}}
\L{\LB{\Proc{main}main (argc, argv, envp)}}
\L{\LB{\K{int}}\Tab{8}{argc;}}
\L{\LB{\K{char}  **argv,}}
\L{\LB{      **envp;}}
\L{\LB{\{}}
\L{\LB{    \K{int}}\Tab{8}{    result,}}
\L{\LB{}\Tab{8}{    sd;}}
\L{\LB{    \K{struct} RoSAPstart   ross;}}
\L{\LB{    \K{register} \K{struct} RoSAPstart *ros = \&ross;}}
\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{    \K{if} (RoInit (argc, argv, ros, roi) == NOTOK)}}
\L{\LB{}\Tab{8}{error (\S{}\"initialization fails: \%s\"\SE{}, RoErrString (rop \-\> rop\_reason));}}
\L{\LB{}}
\L{\LB{    sd = ros \-\> ros\_sd;}}
\L{\LB{\C{}\/*  do authentication using ros \-\> ros\_data here... *\/\CE{}}}
\L{\LB{    ROSFREE (ros);}}
\L{\LB{    }}
\L{\LB{\C{}\/* read command line arguments here... *\/\CE{}}}
\L{\LB{}}
\L{\LB{\C{}\/* could use ROS\_VALIDATE or ROS\_BUSY instead and then exit *\/\CE{}}}
\L{\LB{}}
\L{\LB{    \K{if} (RoBeginResponse (sd, ROS\_ACCEPT, NULLPE, roi) == NOTOK)}}
\L{\LB{}\Tab{8}{error (\S{}\"RO\-BEGIN.RESPONSE: \%s\"\SE{}, RoErrString (rop \-\> rop\_reason));}}
\L{\LB{}}
\L{\LB{    \K{if} (RoSetIndications (sd, ros\_indication, roi) == NOTOK)}}
\L{\LB{}\Tab{8}{error (\S{}\"RoSetIndications: \%s\"\SE{}, RoErrString (rop \-\> rop\_reason));}}
\L{\LB{}}
\L{\LB{    \K{for} (;;)}}
\L{\LB{}\Tab{8}{pause ();}}
\L{\LB{\}}}
