]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add tlname variable to store pointer to name of file being parsed
authorTed Lemon <source@isc.org>
Thu, 23 May 1996 22:21:12 +0000 (22:21 +0000)
committerTed Lemon <source@isc.org>
Thu, 23 May 1996 22:21:12 +0000 (22:21 +0000)
common/conflex.c
common/errwarn.c
conflex.c
dhcpd.h
errwarn.c
includes/dhcpd.h

index 461c21697ed2f10ebcf1f9c3d008ba1eab583244..06c54fc381af232ae7c00736965ece277dceca80 100644 (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;
index 89752d03cc9a7639ccf2808765771dcc1b54d6d4..779c92afb02858acd89bceac7ef03f7d22ec8a07 100644 (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);
index 461c21697ed2f10ebcf1f9c3d008ba1eab583244..06c54fc381af232ae7c00736965ece277dceca80 100644 (file)
--- a/conflex.c
+++ b/conflex.c
@@ -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;
diff --git a/dhcpd.h b/dhcpd.h
index 7545a6e22d1cd973bd8db47a19e187e0f1cdd0af..9c586030f2601f041cc79c4d8a4b27ae8d600985 100644 (file)
--- a/dhcpd.h
+++ b/dhcpd.h
@@ -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 *));
 
index 89752d03cc9a7639ccf2808765771dcc1b54d6d4..779c92afb02858acd89bceac7ef03f7d22ec8a07 100644 (file)
--- a/errwarn.c
+++ b/errwarn.c
@@ -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);
index 7545a6e22d1cd973bd8db47a19e187e0f1cdd0af..9c586030f2601f041cc79c4d8a4b27ae8d600985 100644 (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 *));