2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-02 07:15:44 +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; static int lpos;
int tlpos; int tlpos;
int tline; int tline;
char *tlname;
static int token; static int token;
static int ugflag; static int ugflag;
static char *tval; static char *tval;

View File

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

View File

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

View File

@@ -266,6 +266,8 @@ int main PROTO ((int, char **, char **));
void cleanup PROTO ((void)); void cleanup PROTO ((void));
/* conflex.c */ /* conflex.c */
extern int tline, tlpos;
extern char *tlname;
int next_token PROTO ((char **, FILE *)); int next_token PROTO ((char **, FILE *));
int peek_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;) KandR (char *fmt;)
va_dcl va_dcl
{ {
extern int tline, tlpos;
va_list list; va_list list;
do_percentm (mbuf, fmt); do_percentm (mbuf, fmt);
#ifndef NO_SNPRINTF #ifndef NO_SNPRINTF
snprintf (fbuf, sizeof fbuf, "dhcpd.conf line %d char %d: %s", snprintf (fbuf, sizeof fbuf, "%s line %d char %d: %s",
tline, tlpos, mbuf); tlname, tline, tlpos, mbuf);
#else #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 #endif
VA_start (list, fmt); VA_start (list, fmt);

View File

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