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

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

h00519
s 00000/00000/00044
d D 1.2 85/11/26 23:01:53 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 00044/00000/00000
d D 1.1 85/11/25 09:58:51 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>

/*
 * getprop - get value of property named n
 */

char *
getprop(iop, n)
	FILE *iop; 
	char *n;
{
	register PROP *p;

	return((p = getpaddr(iop, n)) != NULL ? p->propval : NULL);
}

/*
 * getpaddr - get address of property name
 */

PROP *
getpaddr(iop, n)
	FILE *iop; 
	char *n;
{
	register struct fltbuf *f;
	register PROP *cpl;

	if (iop == NULL || n == NULL)
		return(NULL);

	f = &fb[fileno(iop)];

	for (cpl = f->p; cpl != NULL; cpl = cpl->nextprop) {
		if (!strcmp(n, cpl->propname))
			return(cpl);
	}

	return(NULL);
}
E 1

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