Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2(pesnta.1.2) 9/5/84; site scc.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!zehntel!hplabs!pesnta!scc!steiny
From: steiny@scc.UUCP (Don Steiny)
Newsgroups: net.sources
Subject: Re: Re: OOPS - build and access database of paths to systems on map
Message-ID: <160@scc.UUCP>
Date: Mon, 17-Sep-84 20:27:04 EDT
Article-I.D.: scc.160
Posted: Mon Sep 17 20:27:04 1984
Date-Received: Tue, 25-Sep-84 07:40:48 EDT
References: <155@scc.UUCP> <159@scc.UUCP>
Distribution: net
Organization: Personetics, Inc. - Santa Cruz, Calif.
Lines: 82

-----
I did not include the following routines in the alpath stuff.
Sorry.  I am new at this!!

----------------------- Cut here -------------------------------------
: This is a shar archieve.  Extract with sh, not csh.
: The rest of this file will extract:
: strsave.c strbrk.c
echo extracting - strsave.c
sed 's/^X//' > strsave.c << '~FUNKY STUFF~'
X/* save string s and return pointer to space
X   From "The C Programming Langauge"
X */
X# include 
X
Xchar *strsave(s)  
Xchar *s;
X{ 
X	char *p, *malloc();
X	if((p = malloc(strlen(s) + 1)) != NULL)
X    		strcpy(p,s);
X  	return(p);
X}
~FUNKY STUFF~
echo extracting - strbrk.c
sed 's/^X//' > strbrk.c << '~FUNKY STUFF~'
X/* this routine takes the first argument and breaks it into
X   parts at non-null characters.  The argument 0 means any space.
X	Spaces are space, tab, newline, return, or
X   vertical tab.  The second argument must be an array of pointers
X   with enough pointers to point to the resultant list.
X
X   The routine returns the number of items in the array.
X
X   1983, Donald Steiny
X
X */
X# include 
X
Xstrbrk(li,av,ch)
Xchar *li, *av[], ch;
X{
X	register char *t, *p;
X	char buf[256];
X	int  ht = 0;
X	t = buf;
X	p = li;
X	while(*p)
X	{
X		*t = *p;
X		if((ch == 0 && isspace(*t)) || (ch && *p == ch))
X		{
X			*t = (char) 0;
X			if(!*buf)
X			{
X				++p;
X				continue;
X			}
X			av[ht++] = (char *) strsave(buf);
X			strcpy(buf,"");
X			t = buf;
X			++p;
X			continue;
X		}
X		++t;
X		++p;
X	}
X	*t = (char) 0;
X	av[ht++] = (char *) strsave(buf);
X	av[ht] = (char *) 0;
X	return(ht);
X}
~FUNKY STUFF~
exit 0;
-- 
scc!steiny
Don Steiny - Personetics @ (408) 425-0382
109 Torrey Pine Terr.
Santa Cruz, Calif. 95060
ihnp4!pesnta  -\
fortune!idsvax -> scc!steiny
ucbvax!twg    -/