File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / usr / src / usr.bin / bsc / cmd / 3270 / emreadbuf.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:26:11 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21

/*	D.L.Buck and Associates, Inc. - May, 1984
 *
 *	COPYRIGHT NOTICE:
 *		Copyright c 1984 - An unpublished work by
 *		D.L.Buck and Associates, Inc.
 *
 *	PROPRIETARY RIGHTS NOTICE:
 *		All rights reserved. This document and program contains
 *		proprietary information of D.L.Buck and Associates,Inc.
 *		of San Jose, California, U.S.A., embodying confidential
 *		information,  ideas, and expressions,  no part of which
 *		may be reproduced, or transmitted in any form or by any
 *		means,	electronic,  mechanical,  or otherwise, without
 *		the written permission of D.L.Buck and Associates, Inc.
 *
 * NAME
 *	emreadbuf
 *
 * SYNOPSIS
 *	emreadbuf()
 *
 * DESCRIPTION
 *
 */
#include <em.h>
#include "local.h"
#include <bsc/bscio.h>

#define GOZINTA(x) x/64
#define LEFTOVER(x)  x%64
#define SF	0x1d
#define	YES	1
#define	NO	0

extern int ascii;
extern int pt_to_pt;
extern char aadr_tbl[];		/* ASCII hex cursor address encoding table */
extern char eadr_tbl[];		/* EBCDIC hex cursor address encoding table */

extern int devfd;
extern int errno;
extern struct bscio p;
extern char aid_val;
extern int stationid;
extern char termid;
extern int xmitfd;
static char sccsid[] = "@(#)emreadbuf.c	1.4 REL";

emreadbuf()
{
	register char *chrptr;
	register int *xrefptr;
	char x;

	if (pt_to_pt == BSCMPT) {	/* multipoint - put in addr's */
		bput(termid);		/* controller's poll addr */
		bput (stationid);	/* subdevice address */
	}
	/* Output `read header' */
	bput(aid_val);
	bput((ascii?aadr_tbl:eadr_tbl)[GOZINTA(cursaddr)]);
	bput((ascii?aadr_tbl:eadr_tbl)[LEFTOVER(cursaddr)]);

	for (chrptr = scrn_image, xrefptr = scrn_xref;
	     chrptr < &scrn_image[MAXSCREENSIZE];
	     ++chrptr, ++xrefptr) {
		if (*chrptr == ATTRCODE)	{
			bput(SF);
			x = fldattr[*xrefptr];
		} else	{
			x = *chrptr;
			if (!ascii)
				ascebc(&x,1);
		}
		bput(x);
	}

	ioctl(devfd,BSCLAST,0);
	flushbuf();
}

unix.superglobalmegacorp.com

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