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 f

⟦8aca59130⟧ TextFile

    Length: 1622 (0x656)
    Types: TextFile
    Names: »ftambits.c«

Derivation

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

TextFile

/* ftambits.c - FPM: encode/decode BIT STRINGs */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/ftam/RCS/ftambits.c,v 6.0 89/03/18 23:30:27 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/ftam/RCS/ftambits.c,v 6.0 89/03/18 23:30:27 mrose Rel $
 *
 *
 * $Log:	ftambits.c,v $
 * Revision 6.0  89/03/18  23:30:27  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 "fpkt.h"

/* \f

 */

PE	bits2fpm (fsb, pairs, actions, fti)
register struct ftamblk *fsb;
struct pair pairs[];
int	actions;
struct FTAMindication *fti;
{
    register struct pair *pp;
    register PE	    fpm;

    if ((fpm = prim2bit (pe_alloc (PE_CLASS_UNIV, PE_FORM_PRIM, PE_PRIM_BITS)))
	    == NULLPE) {
no_mem: ;
	(void) ftamlose (fti, FS_GEN (fsb), 1, NULLCP, "out of memory");
	if (fpm)
	    pe_free (fpm);
	return NULLPE;
    }

    for (pp = pairs; pp -> p_mask; pp++)
	if ((actions & pp -> p_mask) && bit_on (fpm, pp -> p_bitno) == NOTOK)
	    goto no_mem;

    return fpm;
}

/* \f

 */

/* ARGSUSED */

int	fpm2bits (fsb, pairs, fpm, actions, fti)
struct ftamblk *fsb;
struct pair pairs[];
register PE  fpm;
int    *actions;
struct FTAMindication *fti;
{
    register int    i;
    register struct pair *pp;

    i = 0;
    for (pp = pairs; pp -> p_mask; pp++)
	if (bit_test (fpm, pp -> p_bitno) > OK)
	    i |= pp -> p_mask;

    *actions = i;

    return OK;
}