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

1.1       root        1: #include <stdio.h>
                      2: #include <isode/rtsap.h>
                      3: #include <isode/isoservent.h>
                      4: 
                      5: 
                      6: main (argc, argv, envp)
                      7: int    argc;
                      8: char  **argv,
                      9:       **envp;
                     10: {
                     11:     int            result,
                     12:            sd;
                     13:     struct RoSAPindication  rois;
                     14:     register struct RoSAPindication *roi = &rois;
                     15:     register struct RoSAPpreject   *rop = &roi -> roi_preject;
                     16:     struct RtSAPstart   rtss;
                     17:     register struct RtSAPstart *rts = &rtss;
                     18:     struct RtSAPindication  rtis;
                     19:     register struct RtSAPindication *rti = &rtis;
                     20:     register struct RtSAPabort   *rta = &rti -> rti_abort;
                     21: 
                     22:     if (RtInit (argc, argv, rts, rti) == NOTOK)
                     23:        error ("initialization fails: %s", RtErrString (rta -> rta_reason));
                     24: 
                     25:     sd = rts -> rts_sd;
                     26: /*  do authentication using rts -> rts_data here... */
                     27:     RTSFREE (rts);
                     28:     
                     29: /* read command line arguments here... */
                     30: 
                     31: /* could use RTS_BUSY, RTS_VALIDATE, or RTS_MODE instead and then exit */
                     32: 
                     33:     if (RtBeginResponse (sd, RTS_ACCEPT, NULLPE, rti) == NOTOK)
                     34:        error ("RT-BEGIN.RESPONSE: %s", RtErrString (rta -> rta_reason));
                     35: 
                     36:     if (RoSetService (sd, RoPService, roi) == NOTOK)
                     37:        error ("RoSetService: %s", RoErrString (rop -> rop_reason));
                     38: 
                     39:     for (;;)
                     40:        switch (result = RoWaitRequest (sd, NOTOK, roi)) {
                     41:            case NOTOK: 
                     42:            case OK: 
                     43:            case DONE: 
                     44:                ros_indication (sd, roi);
                     45:                break;
                     46: 
                     47:            default: 
                     48:                error ("unknown return from RoWaitRequest=%d", result);
                     49:        }
                     50: }

unix.superglobalmegacorp.com

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