2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 06:15:55 +00:00

Add tlname variable to store pointer to name of file being parsed

This commit is contained in:
Ted Lemon
1996-05-23 22:21:12 +00:00
parent 6638ee576b
commit ee9d710a5a
6 changed files with 12 additions and 8 deletions

View File

@@ -53,6 +53,7 @@ static int line;
static int lpos;
int tlpos;
int tline;
char *tlname;
static int token;
static int ugflag;
static char *tval;

View File

@@ -183,15 +183,14 @@ int parse_warn (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
KandR (char *fmt;)
va_dcl
{
extern int tline, tlpos;
va_list list;
do_percentm (mbuf, fmt);
#ifndef NO_SNPRINTF
snprintf (fbuf, sizeof fbuf, "dhcpd.conf line %d char %d: %s",
tline, tlpos, mbuf);
snprintf (fbuf, sizeof fbuf, "%s line %d char %d: %s",
tlname, tline, tlpos, mbuf);
#else
sprintf (fbuf, "dhcpd.conf line %d char %d: %s", tline, tlpos, mbuf);
sprintf (fbuf, "%s line %d char %d: %s", tlname, tline, tlpos, mbuf);
#endif
VA_start (list, fmt);

View File

@@ -53,6 +53,7 @@ static int line;
static int lpos;
int tlpos;
int tline;
char *tlname;
static int token;
static int ugflag;
static char *tval;

View File

@@ -266,6 +266,8 @@ int main PROTO ((int, char **, char **));
void cleanup PROTO ((void));
/* conflex.c */
extern int tline, tlpos;
extern char *tlname;
int next_token PROTO ((char **, FILE *));
int peek_token PROTO ((char **, FILE *));

View File

@@ -183,15 +183,14 @@ int parse_warn (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
KandR (char *fmt;)
va_dcl
{
extern int tline, tlpos;
va_list list;
do_percentm (mbuf, fmt);
#ifndef NO_SNPRINTF
snprintf (fbuf, sizeof fbuf, "dhcpd.conf line %d char %d: %s",
tline, tlpos, mbuf);
snprintf (fbuf, sizeof fbuf, "%s line %d char %d: %s",
tlname, tline, tlpos, mbuf);
#else
sprintf (fbuf, "dhcpd.conf line %d char %d: %s", tline, tlpos, mbuf);
sprintf (fbuf, "%s line %d char %d: %s", tlname, tline, tlpos, mbuf);
#endif
VA_start (list, fmt);

View File

@@ -266,6 +266,8 @@ int main PROTO ((int, char **, char **));
void cleanup PROTO ((void));
/* conflex.c */
extern int tline, tlpos;
extern char *tlname;
int next_token PROTO ((char **, FILE *));
int peek_token PROTO ((char **, FILE *));