Annotation of 43BSDReno/contrib/isode-beta/psap/pe_cpy.c, revision 1.1

1.1     ! root        1: /* pe_cpy.c - copy a presentation element */
        !             2: 
        !             3: #ifndef        lint
        !             4: static char *rcsid = "$Header: /f/osi/psap/RCS/pe_cpy.c,v 7.0 89/11/23 22:13:02 mrose Rel $";
        !             5: #endif
        !             6: 
        !             7: /* 
        !             8:  * $Header: /f/osi/psap/RCS/pe_cpy.c,v 7.0 89/11/23 22:13:02 mrose Rel $
        !             9:  *
        !            10:  *
        !            11:  * $Log:       pe_cpy.c,v $
        !            12:  * Revision 7.0  89/11/23  22:13:02  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: 
        !            33: /*  */
        !            34: 
        !            35: PE     pe_cpy (pe)
        !            36: register PE    pe;
        !            37: {
        !            38:     register PE            p,
        !            39:                   *q,
        !            40:                    r;
        !            41: 
        !            42:     if ((p = pe_alloc (pe -> pe_class, pe -> pe_form, pe -> pe_id)) == NULLPE)
        !            43:        return NULLPE;
        !            44: 
        !            45:     p -> pe_context = pe -> pe_context;
        !            46: 
        !            47:     p -> pe_len = pe -> pe_len;
        !            48:     switch (p -> pe_form) {
        !            49:        case PE_FORM_ICONS:
        !            50:            p -> pe_ilen = pe -> pe_ilen;
        !            51:            /* and fall */
        !            52:        case PE_FORM_PRIM: 
        !            53:            if (pe -> pe_prim == NULLPED)
        !            54:                break;
        !            55:            if ((p -> pe_prim = PEDalloc (p -> pe_len)) == NULLPED)
        !            56:                goto you_lose;
        !            57:            PEDcpy (pe -> pe_prim, p -> pe_prim, p -> pe_len);
        !            58:            break;
        !            59: 
        !            60:        case PE_FORM_CONS: 
        !            61:            for (q = &p -> pe_cons, r = pe -> pe_cons;
        !            62:                    r;
        !            63:                    q = &((*q) -> pe_next), r = r -> pe_next)
        !            64:                if ((*q = pe_cpy (r)) == NULLPE)
        !            65:                    goto you_lose;
        !            66:            break;
        !            67:     }
        !            68: 
        !            69:     p -> pe_nbits = pe -> pe_nbits;
        !            70: 
        !            71:     return p;
        !            72: 
        !            73: you_lose: ;
        !            74:     pe_free (p);
        !            75:     return NULLPE;
        !            76: }

unix.superglobalmegacorp.com

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