version 1.9, 1998/07/02 21:32:10 |
version 1.10, 1998/07/03 18:51:14 |
|
|
static void SuffUnRef __P((ClientData, ClientData)); |
static void SuffUnRef __P((ClientData, ClientData)); |
static void SuffFree __P((ClientData)); |
static void SuffFree __P((ClientData)); |
static void SuffInsert __P((Lst, Suff *)); |
static void SuffInsert __P((Lst, Suff *)); |
static void SuffRemove __P((Lst, Suff *)); |
static Suff *SuffRemove __P((Lst, Suff *)); |
static Boolean SuffParseTransform __P((char *, Suff **, Suff **)); |
static Boolean SuffParseTransform __P((char *, Suff **, Suff **)); |
static int SuffRebuildGraph __P((ClientData, ClientData)); |
static int SuffRebuildGraph __P((ClientData, ClientData)); |
static int SuffAddSrc __P((ClientData, ClientData)); |
static int SuffAddSrc __P((ClientData, ClientData)); |
|
|
if (s == emptySuff) |
if (s == emptySuff) |
emptySuff = NULL; |
emptySuff = NULL; |
|
|
|
#ifdef notdef |
|
/* We don't delete suffixes in order, so we cannot use this */ |
|
if (s->refCount) |
|
Punt("Internal error deleting suffix `%s' with refcount = %d", s->name, |
|
s->refCount); |
|
#endif |
|
|
Lst_Destroy (s->ref, NOFREE); |
Lst_Destroy (s->ref, NOFREE); |
Lst_Destroy (s->children, NOFREE); |
Lst_Destroy (s->children, NOFREE); |
Lst_Destroy (s->parents, NOFREE); |
Lst_Destroy (s->parents, NOFREE); |
|
|
* suffix is possibly freed |
* suffix is possibly freed |
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
*/ |
*/ |
static void |
static Suff * |
SuffRemove(l, s) |
SuffRemove(l, s) |
Lst l; |
Lst l; |
Suff *s; |
Suff *s; |
{ |
{ |
SuffUnRef((ClientData) l, (ClientData) s); |
SuffUnRef((ClientData) l, (ClientData) s); |
if (s->refCount == 0) |
if (s->refCount == 0) { |
|
SuffUnRef ((ClientData) sufflist, (ClientData) s); |
SuffFree((ClientData) s); |
SuffFree((ClientData) s); |
|
s = NULL; |
|
} |
|
return (s); |
} |
} |
|
|
/*- |
/*- |
|
|
* We'll be called twice when the next target is seen, but .c and .o |
* We'll be called twice when the next target is seen, but .c and .o |
* are only linked once... |
* are only linked once... |
*/ |
*/ |
if (t != suffNull) |
s = SuffRemove(t->children, s); |
SuffRemove(t->children, s); |
|
|
|
/* |
/* |
* Remove the target from the source's parents list |
* Remove the target from the source's parents list |
*/ |
*/ |
if (s != suffNull) |
if (s != NULL) |
SuffRemove(s->parents, t); |
SuffRemove(s->parents, t); |
} else if ((gn->type & OP_TRANSFORM) && DEBUG(SUFF)) { |
} else if ((gn->type & OP_TRANSFORM) && DEBUG(SUFF)) { |
printf("transformation %s complete\n", gn->name); |
printf("transformation %s complete\n", gn->name); |