version 1.15, 2007/09/05 23:55:57 |
version 1.16, 2007/09/10 19:40:49 |
|
|
# include <unistd.h> |
# include <unistd.h> |
#endif /* HAVE_UNISTD_H */ |
#endif /* HAVE_UNISTD_H */ |
#include <pwd.h> |
#include <pwd.h> |
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) |
|
# include <malloc.h> |
|
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ |
|
#if defined(YYBISON) && defined(HAVE_ALLOCA_H) && !defined(__GNUC__) |
#if defined(YYBISON) && defined(HAVE_ALLOCA_H) && !defined(__GNUC__) |
# include <alloca.h> |
# include <alloca.h> |
#endif /* YYBISON && HAVE_ALLOCA_H && !__GNUC__ */ |
#endif /* YYBISON && HAVE_ALLOCA_H && !__GNUC__ */ |
|
|
static void expand_ga_list __P((void)); |
static void expand_ga_list __P((void)); |
static void expand_match_list __P((void)); |
static void expand_match_list __P((void)); |
static aliasinfo *find_alias __P((char *, int)); |
static aliasinfo *find_alias __P((char *, int)); |
static int more_aliases __P((void)); |
static void more_aliases __P((void)); |
void init_parser __P((void)); |
void init_parser __P((void)); |
void yyerror __P((char *)); |
void yyerror __P((char *)); |
|
|
|
|
size_t onaliases; |
size_t onaliases; |
char s[512]; |
char s[512]; |
|
|
if (naliases >= nslots && !more_aliases()) { |
if (naliases >= nslots) |
(void) snprintf(s, sizeof(s), "Out of memory defining alias `%s'", |
more_aliases(); |
alias); |
|
yyerror(s); |
|
return(FALSE); |
|
} |
|
|
|
ai.type = type; |
ai.type = type; |
ai.val = val; |
ai.val = val; |
|
|
/* |
/* |
* Allocates more space for the aliases list. |
* Allocates more space for the aliases list. |
*/ |
*/ |
static int |
static void |
more_aliases() |
more_aliases() |
{ |
{ |
|
|
nslots += MOREALIASES; |
nslots += MOREALIASES; |
if (nslots == MOREALIASES) |
aliases = (aliasinfo *) erealloc3(aliases, nslots, sizeof(aliasinfo)); |
aliases = (aliasinfo *) malloc(nslots * sizeof(aliasinfo)); |
|
else |
|
aliases = (aliasinfo *) realloc(aliases, nslots * sizeof(aliasinfo)); |
|
|
|
return(aliases != NULL); |
|
} |
} |
|
|
/* |
/* |