2 #define __LIBSCOUT_INTERNAL__
5 typedef struct scnode scnode;
6 typedef struct scway scway;
7 typedef struct scwaypoint scwaypoint;
9 scway *scaddway(scnode *from, const scnode *to, int len)
11 scway *way = malloc(sizeof(scway));
15 scway *apar, *par = NULL;
16 for (apar = from->way; apar != NULL; par = apar, apar = apar->alt);
24 scwaypoint *scout(const scnode *from, const scnode *to, scwaypoint *stack)
26 scwaypoint *wayp = NULL;
28 return __scallocwayp(from, NULL);
29 for (scway *way = from->way; way != NULL; way = way->alt) {
31 if ((stackend = __scstackfindgetend(stack, way)) == NULL)
33 scwaypoint *twayp = __scallocwayp(from, way);
34 stackend->nxt = twayp;
35 scwaypoint *nwayp = scout(way->lto, to, stack)
36 if (wayp && wayp->len <= (twayp->len = __scstackgetlen(twayp)))
43 scwaypoint *__scallocwayp(const scnode *node, const scway *way)
45 scwaypoint *wayp = malloc(sizeof(scwaypoint));
52 scwaypoint *__scstackfindgetend(scwaypoint *stack, const scway *way)
54 scwaypoint *asptr, *sptr;
55 for (asptr = stack; asptr != NULL; sptr = asptr, asptr = asptr->nxt)
56 if (asptr->nod == way->lto)
61 void __scstackfree(scwaypoint *stack)
63 for (scwaypoint *sptr = stack; sptr != NULL; sptr = sptr->nxt)