DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T q

⟦62feb4f20⟧ TextFile

    Length: 1617 (0x651)
    Types: TextFile
    Names: »qb2prim.c«

Derivation

└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
    └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« 
        └─⟦d3ac74d73⟧ 
            └─⟦this⟧ »isode-5.0/psap/qb2prim.c« 

TextFile

/* qb2prim.c - octet string to primitive */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/psap/RCS/qb2prim.c,v 6.0 89/03/18 23:39:09 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/psap/RCS/qb2prim.c,v 6.0 89/03/18 23:39:09 mrose Rel $
 *
 *
 * $Log:	qb2prim.c,v $
 * Revision 6.0  89/03/18  23:39:09  mrose
 * Release 5.0
 * 
 */

/*
 *				  NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


/* LINTLIBRARY */

#include <stdio.h>
#include "psap.h"

/* form: PRIMitive or CONStructor --

	qb2prim  -	octet string (via qbufs) to presentation element

 */

/* \f

 */

PE	qb2prim (qb, class, id)
register struct qbuf *qb;
PElementClass	class;
PElementID	id;
{
    register PE	    pe,
		    p;
    register struct qbuf *qp;

    if (qb == NULL)
	return NULLPE;
    
    if ((qp = qb -> qb_forw) == qb || qp -> qb_forw == qb) {
	if ((pe = pe_alloc (class, PE_FORM_PRIM, id)) == NULLPE)
	    return NULLPE;

	if (pe -> pe_len = qp -> qb_len)
	    pe -> pe_prim = (PElementData) qp -> qb_data;
	pe -> pe_inline = 1;
    }
    else {
	if ((pe = pe_alloc (class, PE_FORM_CONS, id)) == NULLPE)
	    return NULLPE;

	do {
	    if (seq_add (pe, p = pe_alloc (class, PE_FORM_PRIM, id), -1)
		    == NOTOK) {
		pe_free (pe);
		return NULLPE;
	    }

	    p -> pe_len = qp -> qb_len;
	    p -> pe_prim = (PElementData) qp -> qb_data;
	    p -> pe_inline = 1;

	    qp = qp -> qb_forw;
	}
	while (qp != qb);
    }

    return pe;
}