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 u

⟦b8965a742⟧ TextFile

    Length: 2910 (0xb5e)
    Types: TextFile
    Names: »ut_p12mm.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« 
        └─⟦e5a54fb17⟧ 
            └─⟦this⟧ »pp-5.0/Lib/pp/ut_p12mm.c« 

TextFile

 /* ut_p1_mm.c: Deals with conversions between p1 structures <-> fields */

# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Lib/pp/RCS/ut_p12mm.c,v 5.0 90/09/20 16:13:06 pp Exp Locker: pp $";
# endif

/*
 * $Header: /cs/research/pp/hubris/pp-beta/Lib/pp/RCS/ut_p12mm.c,v 5.0 90/09/20 16:13:06 pp Exp Locker: pp $
 *
 * $Log:	ut_p12mm.c,v $
 * Revision 5.0  90/09/20  16:13:06  pp
 * rcsforce : 5.0 public release
 * 
 */



#include	"util.h"
#include	<isode/cmd_srch.h>
#include	"q.h"
#include	"tb_bpt84.h"
#include	"tb_p1.h"
#include	"dr.h"
#include	"list_bpt.h"

extern CMD_TABLE	bptbl_body_parts84 [/* body part types */];




/* ---------------------  Field -> Memory  -------------------------------- */




void prf2mem (prf, resp, mta, usr)	/* PerRecipientFlag -> Mem */
int	prf;
int	*resp;
int	*mta;
int	*usr;
{
	int	i;

	PP_DBG (("Lib/pp/prf2mem(%d)", prf));

	*resp = *mta = *usr = 0;

	for (i = 0; i < 5; i++)
		if (prf & (1 << i))
			switch (i) {
			case 0:
				*resp = 1;
				break;
			case 1:
				*mta |= 2;
				break;
			case 2:
				*mta |= 1;
				break;
			case 3:
				*usr |= 2;
				break;
			case 4:
				*usr |= 1;
				break;
			}


	PP_DBG (("Lib/pp/prf2mem returns %d  (%d %d %d)",
		prf, *resp, *mta, *usr));
}




void enctypes2mem (field, ptr)   /* EncodedInformationTypesBitString -> Memory */
int			field;
LIST_BPT		**ptr;
{
	LIST_BPT	*new,
			*base = NULLIST_BPT;
	char		*value;
	int		i;


	PP_DBG (("Lib/pp/enctypes2mem (%d)", field));

	if (field == 0 || field < 0) {
		value = rcmd_srch (BPT_IA5, bptbl_body_parts84);
		*ptr = list_bpt_new (value);
		return;
	}


	/* This is a temp measure because of erroneous encoding from bull */
	if (field > 1023)
		field = 1;


	for (i = EI_TOTAL - 1; i >= 0; i--)
		if (field & (1 << i)) {
			switch (i) {
			case 0:
				value = rcmd_srch (BPT_ODIF,
						   bptbl_body_parts84);
				break;
			case 1:
				value = rcmd_srch (BPT_TLX,
						   bptbl_body_parts84);
				break;
			case 2:
				value = rcmd_srch (BPT_IA5,
						   bptbl_body_parts84);
				break;
			case 3:
				value = rcmd_srch (BPT_G3FAX,
						   bptbl_body_parts84);
				break;
			case 4:
				value = rcmd_srch (BPT_TIF0,
						   bptbl_body_parts84);
				break;
			case 5:
				value = rcmd_srch (BPT_TTX,
						   bptbl_body_parts84);
				break;
			case 6:
				value = rcmd_srch (BPT_VIDEOTEX,
						   bptbl_body_parts84);
				break;
			case 7:
				value = rcmd_srch (BPT_VOICE,
						   bptbl_body_parts84);
				break;
			case 8:
				value = rcmd_srch (BPT_SFD,
						   bptbl_body_parts84);
				break;
			case 9:
				value = rcmd_srch (BPT_TIF1,
						   bptbl_body_parts84);
				break;
			default:
				PP_LOG (LLOG_EXCEPTIONS,
					("Lib/pp/enctyp2mem (i=%d) err", i));
				continue;

			}   /* -- end of switch -- */

			new = list_bpt_new (value);
			list_bpt_add (&base, new);

		}   /* -- end of if -- */

	*ptr = base;
	return;
}