ftp.nice.ch/pub/next/unix/audio/cmusic.bs.N.tar.gz#/src/lib/libprocom/SCCS/s.cpioheader.c

This is s.cpioheader.c in view mode; [Download] [Up]

h54191
s 00000/00000/00069
d D 1.2 85/11/26 23:00:34 dgl 2 1
c eliminated LOOKED_ALREADY from getheader to cure bug 
c re. trying to add property to stdin if no header exists yet.
e
s 00069/00000/00000
d D 1.1 85/11/25 09:56:28 dgl 1 0
c original version
e
u
U
f i 
t
T
I 1
/* %M%	%I%	(CARL)	%G%	%U% */

#include <stdio.h>
#include <carl/carl.h>
#include <carl/procom.h>

/*
 * cpioheader - read input header, copy header and write on output file
 * takes:
 * 	ip - input file pointer
 * 	op - output file pointer
 * returns:
 * 	-1 on error
 * 	0 otherwise
 * side effects:
 * 	Same as cpoheader().
 * notes:
 * 	May only be used to copy a property list to an output file.
 */

cpioheader(ip, op)
	FILE *ip;
	FILE *op;
{
	register PROP *proplist;

	if (ip == NULL || op == NULL)
		return(-1);

	if ((proplist = getheader(ip)) != NULL) {	/* got header? */
		/* copy header from input to output file */
		if (cpoheader(proplist, op) != 0)
			return(-1);
		}
	return(0);
}


/*
 * cpoheader - copy property list to output file, write output header
 * takes:
 * 	pl - property list to be copied
 * 	op - output file pointer
 * returns:
 * 	-1 on error
 * 	0 otherwise
 * side effects:
 * 	Side effects are cumulative for putprop() and putheader().
 */

cpoheader(pl, op)
	PROP *pl;
	FILE *op;
{
	register PROP *p;

	if (pl == NULL || op == NULL)
		return(-1);

	for (p = pl; p != NULL; p = p->nextprop) {
		if (putprop(op, p->propname, p->propval) != 0)
			return(-1);
	}
	/* write property list we've made to output file */
	if (putheader(op) != 0)
		return(-1);

	return(0);
}
E 1

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.