Annotation of 43BSDReno/contrib/isode-beta/acsap/aetseq.c, revision 1.1

1.1     ! root        1: /* aetseq.c - application entity titles -- sequential lookup */
        !             2: 
        !             3: #ifndef        lint
        !             4: static char *rcsid = "$Header: /f/osi/acsap/RCS/aetseq.c,v 7.0 89/11/23 21:22:07 mrose Rel $";
        !             5: #endif
        !             6: 
        !             7: /* 
        !             8:  * $Header: /f/osi/acsap/RCS/aetseq.c,v 7.0 89/11/23 21:22:07 mrose Rel $
        !             9:  *
        !            10:  *
        !            11:  * $Log:       aetseq.c,v $
        !            12:  * Revision 7.0  89/11/23  21:22:07  mrose
        !            13:  * Release 6.0
        !            14:  * 
        !            15:  */
        !            16: 
        !            17: /*
        !            18:  *                               NOTICE
        !            19:  *
        !            20:  *    Acquisition, use, and distribution of this module and related
        !            21:  *    materials are subject to the restrictions of a license agreement.
        !            22:  *    Consult the Preface in the User's Manual for the full terms of
        !            23:  *    this agreement.
        !            24:  *
        !            25:  */
        !            26: 
        !            27: 
        !            28: /* LINTLIBRARY */
        !            29: 
        !            30: #include <stdio.h>
        !            31: #include "psap.h"
        !            32: #include "isoaddrs.h"
        !            33: 
        !            34: /*    DATA */
        !            35: 
        !            36: static char objent[BUFSIZ];
        !            37: static struct isoentity ies;
        !            38: 
        !            39: /*  */
        !            40: 
        !            41: int    str2aet_seq (designator, qualifier, iep)
        !            42: char   *designator,
        !            43:        *qualifier;
        !            44: struct isoentity *iep;
        !            45: {
        !            46:     int     hitdes,
        !            47:            hitqual;
        !            48:     char    descriptor[BUFSIZ],
        !            49:            desdflt[BUFSIZ],
        !            50:            qualdflt[BUFSIZ];
        !            51:     register struct isoentity  *ie;
        !            52:     struct isoentity ids,
        !            53:                     iqs;
        !            54: 
        !            55:     (void) sprintf (objent, "%s-%s", designator, qualifier);
        !            56:     (void) sprintf (desdflt, "%s-%s", designator, "default");
        !            57:     (void) sprintf (qualdflt, "%s-%s", "default", qualifier);
        !            58:     hitdes = hitqual = 0;
        !            59:     bzero ((char *) &ids, sizeof ids);
        !            60:     bzero ((char *) &iqs, sizeof iqs);
        !            61: 
        !            62:     ie = NULL;
        !            63: 
        !            64:     if (!setisoentity (0))
        !            65:        return NOTOK;
        !            66:     while (_startisoentity (descriptor) == OK) {
        !            67:        if (strcmp (descriptor, objent) == 0) {
        !            68:            if (_stopisoentity (descriptor, &ies) != OK)
        !            69:                continue;
        !            70: 
        !            71:            ie = &ies;
        !            72:            break;
        !            73:        }
        !            74: 
        !            75:        if (!hitdes && strcmp (descriptor, desdflt) == 0) {
        !            76:            if (_stopisoentity (descriptor, &ies) != OK)
        !            77:                continue;
        !            78:            ies.ie_descriptor = objent;
        !            79: 
        !            80:            hitdes++;
        !            81:            ids = ies;          /* struct copy */
        !            82:            continue;
        !            83:        }
        !            84: 
        !            85:        if (!hitqual && strcmp (descriptor, qualdflt) == 0) {
        !            86:            if (_stopisoentity (descriptor, &ies) != OK)
        !            87:                continue;
        !            88:            ies.ie_descriptor = objent;
        !            89: 
        !            90:            hitqual++;
        !            91:            iqs = ies;          /* struct copy */
        !            92:            continue;
        !            93:        }
        !            94:     }
        !            95:     (void) endisoentity ();
        !            96: 
        !            97:     if (!ie && hitqual) {
        !            98:        ie = &ies;
        !            99:        *ie = iqs;              /* struct copy */
        !           100: 
        !           101:        if (hitdes) {
        !           102:            bcopy ((char *) ids.ie_addr.pa_addr.sa_addr.ta_addrs,
        !           103:                   (char *) ie -> ie_addr.pa_addr.sa_addr.ta_addrs,
        !           104:                   sizeof ie -> ie_addr.pa_addr.sa_addr.ta_addrs);
        !           105:            ie -> ie_addr.pa_addr.sa_addr.ta_naddr =
        !           106:                ids.ie_addr.pa_addr.sa_addr.ta_naddr;
        !           107:        }
        !           108:     }
        !           109: 
        !           110:     if (ie) {
        !           111:        *iep = *ie;     /* struct copy */
        !           112:        return OK;
        !           113:     }
        !           114:     
        !           115:     return NOTOK;
        !           116: }

unix.superglobalmegacorp.com

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