|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T f
Length: 1622 (0x656)
Types: TextFile
Names: »ftambits.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z«
└─⟦de7628f85⟧
└─⟦this⟧ »isode-6.0/ftam/ftambits.c«
/* ftambits.c - FPM: encode/decode BIT STRINGs */
#ifndef lint
static char *rcsid = "$Header: /f/osi/ftam/RCS/ftambits.c,v 7.0 89/11/23 21:53:25 mrose Rel $";
#endif
/*
* $Header: /f/osi/ftam/RCS/ftambits.c,v 7.0 89/11/23 21:53:25 mrose Rel $
*
*
* $Log: ftambits.c,v $
* Revision 7.0 89/11/23 21:53:25 mrose
* Release 6.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;
}