version 1.70, 2007/09/17 10:06:44 |
version 1.71, 2007/09/17 12:50:59 |
|
|
static bool parse_archive(Buffer, const char **, Lst, SymTable *); |
static bool parse_archive(Buffer, const char **, Lst, SymTable *); |
static void add_archive_node(Lst, const char *); |
static void add_archive_node(Lst, const char *); |
|
|
#ifdef SVR4ARCHIVES |
|
struct SVR4namelist { |
struct SVR4namelist { |
char *fnametab; /* Extended name table strings */ |
char *fnametab; /* Extended name table strings */ |
size_t fnamesize; /* Size of the string table */ |
size_t fnamesize; /* Size of the string table */ |
|
|
static const char *svr4list = "Archive list"; |
static const char *svr4list = "Archive list"; |
|
|
static char *ArchSVR4Entry(struct SVR4namelist *, const char *, size_t, FILE *); |
static char *ArchSVR4Entry(struct SVR4namelist *, const char *, size_t, FILE *); |
#endif |
|
|
|
static struct arch_member * |
static struct arch_member * |
new_arch_member(struct ar_hdr *hdr, const char *name) |
new_arch_member(struct ar_hdr *hdr, const char *name) |
|
|
FILE *arch; /* Stream to archive */ |
FILE *arch; /* Stream to archive */ |
char magic[SARMAG]; |
char magic[SARMAG]; |
Arch *ar; |
Arch *ar; |
#ifdef SVR4ARCHIVES |
|
struct SVR4namelist list; |
struct SVR4namelist list; |
|
|
list.fnametab = NULL; |
list.fnametab = NULL; |
#endif |
|
|
|
/* When we encounter an archive for the first time, we read its |
/* When we encounter an archive for the first time, we read its |
* whole contents, to place it in the cache. */ |
* whole contents, to place it in the cache. */ |
|
|
|
|
/* Whole archive read ok. */ |
/* Whole archive read ok. */ |
if (n == 0 && feof(arch)) { |
if (n == 0 && feof(arch)) { |
#ifdef SVR4ARCHIVES |
|
efree(list.fnametab); |
efree(list.fnametab); |
#endif |
|
fclose(arch); |
fclose(arch); |
return ar; |
return ar; |
} |
} |
|
|
|
|
fclose(arch); |
fclose(arch); |
ohash_delete(&ar->members); |
ohash_delete(&ar->members); |
#ifdef SVR4ARCHIVES |
|
efree(list.fnametab); |
efree(list.fnametab); |
#endif |
|
free(ar); |
free(ar); |
return NULL; |
return NULL; |
} |
} |
|
|
char *cp; |
char *cp; |
char magic[SARMAG]; |
char magic[SARMAG]; |
size_t length; |
size_t length; |
#ifdef SVR4ARCHIVES |
|
struct SVR4namelist list; |
struct SVR4namelist list; |
|
|
list.fnametab = NULL; |
list.fnametab = NULL; |
#endif |
|
|
|
arch = fopen(archive, mode); |
arch = fopen(archive, mode); |
if (arch == NULL) |
if (arch == NULL) |
|
|
#endif |
#endif |
if (length == sizeof(arHeaderPtr->ar_name) || |
if (length == sizeof(arHeaderPtr->ar_name) || |
memberName[length] == ' ') { |
memberName[length] == ' ') { |
#ifdef SVR4ARCHIVES |
|
efree(list.fnametab); |
efree(list.fnametab); |
#endif |
|
return arch; |
return arch; |
} |
} |
} |
} |
|
|
printf("ArchFind: Extended format entry for %s\n", ename); |
printf("ArchFind: Extended format entry for %s\n", ename); |
/* Found as extended name. */ |
/* Found as extended name. */ |
if (strcmp(ename, member) == 0) { |
if (strcmp(ename, member) == 0) { |
#ifdef SVR4ARCHIVES |
|
efree(list.fnametab); |
efree(list.fnametab); |
#endif |
|
return arch; |
return arch; |
} |
} |
} |
} |