File:  [Research Unix] / researchv10no / libpicfile / pic.601.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

/*
 * Type-specific code for TYPE=ccir601
 */
#include <picfile.h>
#include <libc.h>
int PRD_601(f, buf)
PICFILE *f;
char *buf;
{
	if(f->line==0){
		f->buf=malloc(f->width*2);
		if(f->buf==0){
			PIC_error="Can't allocate buffer";
			return 0;
		}
	}
	if(f->line==f->height){
		PIC_error="Read past end of picture";
		return 0;
	}
	/* read the file */
	f->line++;
	return 1;
}
int PWR_601(f, buf)
PICFILE *f;
char *buf;
{
	if(f->line==0){
		f->buf=malloc(f->width*2);
		if(f->buf==0){
			PIC_error="Can't allocate buffer";
			return 0;
		}
		PWR_header(f);
	}
	if(f->line>=f->height){
		PIC_error="Write past end of picture";
		return 0;
	}
	/* write the file */
	f->line++;
	return 1;
}
int PCL_601(f)
PICFILE *f;
{
	free(f->buf);
}

unix.superglobalmegacorp.com

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