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

1.1     ! root        1: /* pe_alloc.c - allocate a presentation element */
        !             2: 
        !             3: #ifndef        lint
        !             4: static char *rcsid = "$Header: /f/osi/psap/RCS/pe_alloc.c,v 7.0 89/11/23 22:13:00 mrose Rel $";
        !             5: #endif
        !             6: 
        !             7: /* 
        !             8:  * $Header: /f/osi/psap/RCS/pe_alloc.c,v 7.0 89/11/23 22:13:00 mrose Rel $
        !             9:  *
        !            10:  *
        !            11:  * $Log:       pe_alloc.c,v $
        !            12:  * Revision 7.0  89/11/23  22:13:00  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: /* A Presentation Element (or PElement) is an internal representation for
        !            35:    a presentation type from ISO8825.  The fields of the structure are:
        !            36: 
        !            37:        pe_class:       UNIVersal, APPLication, CONText, or PRIVate
        !            38:        pe_form:        PRIMative, CONStructor, InlineCONStructor
        !            39:        pe_id:          identifier
        !            40: 
        !            41:        pe_len:         if a PRIMative, then the length of pe_prim,
        !            42:                        else a scratch value; "indefinite" length elements
        !            43:                        have a pe_len of -1 (PE_LEN_INDF)
        !            44:        pe_ilen:        if an InlineCONStructor, then the offset to the real
        !            45:                        data portion
        !            46: 
        !            47:        pe_prim:        if a PRIMative or an Inline CONStructor, the
        !            48:                        byte-string
        !            49:        pe_cons:        if a CONStructor, the first element in the
        !            50:                        singly-linked list of elements
        !            51: 
        !            52:        pe_next:        if the immediate parent is a constructor, the
        !            53:                        next element in the singly-linked list of elements
        !            54: 
        !            55:        pe_cardinal:    if a LIST (SET or SEQ CONStructor), the cardinality
        !            56:                        of the list
        !            57:        pe_offset:      if a member of a SEQ LIST, the offset in the SEQUENCE
        !            58: 
        !            59:        pe_nbits:       if a BITSTRING, the number of bits in the string
        !            60: 
        !            61:        pe_refcnt:      a hack for ANYs in pepy
        !            62:  */
        !            63: 
        !            64: /*  */
        !            65: 
        !            66: PE     pe_alloc (class, form, id)
        !            67: PElementClass class;
        !            68: PElementForm  form;
        !            69: PElementID id;
        !            70: {
        !            71:     register PE            pe;
        !            72: 
        !            73:     if ((pe = (PE) calloc (1, sizeof *pe)) == NULLPE)
        !            74:        return NULLPE;
        !            75: 
        !            76:     pe -> pe_class = class;
        !            77:     pe -> pe_form = form;
        !            78:     pe -> pe_id = id;
        !            79: 
        !            80:     return pe;
        !            81: }

unix.superglobalmegacorp.com

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