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 n

⟦a2d3c0b45⟧ TextFile

    Length: 699 (0x2bb)
    Types: TextFile
    Names: »nxtwrd.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Adv/Program/nxtwrd.c« 

TextFile

/*
 * Break off the next word from the string *s; leave *s pointing
 * to the 'separator' character that ended the scan.  Return a
 * pointer to a strsav() of the word.
 */

#include "adv.h"
#include <ctype.h>

#define	notsep(c)	(c && c != ' ' && c != ',' && c != ':')

char *nxtwrd(sp, ml)
	register char **sp;
	register int ml;	/* max length */
{
	register char *bp = buf2, *s = *sp;
	register int n = 0;

	skpwht(s);		/* skip whitespace */
	while (notsep(*s)) {
		*bp++ = islower (*s) ? toupper(*s++) : *s++;
		if (++n >= ml)
			break;
	}
	if (notsep(*s))		/* if *s is not a separator */
		while (notsep(*s))/* then search forward for one */
			s++;
	*bp = 0;
	*sp = s;
	return (strsav(buf2));
}