version 1.35, 2000/06/23 16:41:53 |
version 1.36, 2000/09/14 13:32:07 |
|
|
* SUCH DAMAGE. |
* SUCH DAMAGE. |
*/ |
*/ |
|
|
#ifndef lint |
|
#if 0 |
|
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; |
|
#else |
|
static char rcsid[] = "$OpenBSD$"; |
|
#endif |
|
#endif /* not lint */ |
|
|
|
/*- |
/*- |
* suff.c -- |
* suff.c -- |
* Functions to maintain suffix lists and find implicit dependents |
* Functions to maintain suffix lists and find implicit dependents |
|
|
#include "hash.h" |
#include "hash.h" |
#include "dir.h" |
#include "dir.h" |
|
|
|
#ifndef lint |
|
#if 0 |
|
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; |
|
#else |
|
UNUSED |
|
static char rcsid[] = "$OpenBSD$"; |
|
#endif |
|
#endif /* not lint */ |
|
|
static LIST sufflist; /* Lst of suffixes */ |
static LIST sufflist; /* Lst of suffixes */ |
#ifdef CLEANUP |
#ifdef CLEANUP |
static LIST suffClean; /* Lst of suffixes to be cleaned */ |
static LIST suffClean; /* Lst of suffixes to be cleaned */ |
|
|
static int SuffSuffIsPrefix __P((void *, void *)); |
static int SuffSuffIsPrefix __P((void *, void *)); |
static int SuffGNHasNameP __P((void *, void *)); |
static int SuffGNHasNameP __P((void *, void *)); |
static void SuffUnRef __P((Lst, Suff *)); |
static void SuffUnRef __P((Lst, Suff *)); |
static void SuffFree __P((void *)); |
|
static void SuffInsert __P((Lst, Suff *)); |
static void SuffInsert __P((Lst, Suff *)); |
static void SuffRemove __P((Lst, Suff *)); |
static void SuffRemove __P((Lst, Suff *)); |
static Boolean SuffParseTransform __P((char *, Suff **, Suff **)); |
static Boolean SuffParseTransform __P((char *, Suff **, Suff **)); |
|
|
|
|
/*- |
/*- |
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
* SuffFree -- |
|
* Free up all memory associated with the given suffix structure. |
|
* |
|
* Results: |
|
* none |
|
* |
|
* Side Effects: |
|
* the suffix entry is detroyed |
|
*----------------------------------------------------------------------- |
|
*/ |
|
static void |
|
SuffFree(sp) |
|
void *sp; |
|
{ |
|
Suff *s = (Suff *) sp; |
|
|
|
if (s == suffNull) |
|
suffNull = NULL; |
|
|
|
if (s == emptySuff) |
|
emptySuff = NULL; |
|
|
|
Lst_Destroy(&s->ref, NOFREE); |
|
Lst_Destroy(&s->children, NOFREE); |
|
Lst_Destroy(&s->parents, NOFREE); |
|
Lst_Destroy(&s->searchPath, Dir_Destroy); |
|
|
|
free(s->name); |
|
free(s); |
|
} |
|
|
|
/*- |
|
*----------------------------------------------------------------------- |
|
* SuffRemove -- |
* SuffRemove -- |
* Remove the suffix from the list |
* Remove the suffix from the list |
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
|
|
char *eoarch; /* End of archive portion */ |
char *eoarch; /* End of archive portion */ |
char *eoname; /* End of member portion */ |
char *eoname; /* End of member portion */ |
GNode *mem; /* Node for member */ |
GNode *mem; /* Node for member */ |
int i; /* Index into copy and vals */ |
|
Suff *ms; /* Suffix descriptor for member */ |
Suff *ms; /* Suffix descriptor for member */ |
char *name; /* Start of member's name */ |
char *name; /* Start of member's name */ |
|
|