MINOR: config: keep up-to-date current file/line/section in the global struct

Let's add a few fields to the global struct to store information about
the current file being processed, the current line number and the current
section. This will be used to retrieve them using special variables.
diff --git a/include/haproxy/global-t.h b/include/haproxy/global-t.h
index bea97dd..8df1349 100644
--- a/include/haproxy/global-t.h
+++ b/include/haproxy/global-t.h
@@ -159,6 +159,10 @@
 	} unix_bind;
 	struct proxy *cli_fe;           /* the frontend holding the stats settings */
 	int numa_cpu_mapping;
+	int cfg_curr_line;              /* line number currently being parsed */
+	const char *cfg_curr_file;      /* config file currently being parsed or NULL */
+	char *cfg_curr_section;         /* config section name currently being parsed or NULL */
+
 	/* The info above is config stuff, it doesn't change during the process' life */
 	/* A number of the elements below are updated by all threads in real time and
 	 * suffer high contention, so we need to put them in their own cache lines, if
diff --git a/src/cfgparse.c b/src/cfgparse.c
index e5585ff..168cabb 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1685,6 +1685,9 @@
 	int non_global_section_parsed = 0;
 	char *errmsg = NULL;
 
+	global.cfg_curr_line = 0;
+	global.cfg_curr_file = file;
+
 	if ((thisline = malloc(sizeof(*thisline) * linesize)) == NULL) {
 		ha_alert("Out of memory trying to allocate a buffer for a configuration line.\n");
 		err_code = -1;
@@ -1720,6 +1723,7 @@
 		}
 
 		linenum++;
+		global.cfg_curr_line = linenum;
 
 		if (fatal >= 50) {
 			ha_alert("parsing [%s:%d]: too many fatal errors (%d), stopping now.\n", file, linenum, fatal);
@@ -2049,6 +2053,8 @@
 				cursection = ics->section_name;
 				pcs = cs;
 				cs = ics;
+				free(global.cfg_curr_section);
+				global.cfg_curr_section = strdup(*args[1] ? args[1] : args[0]);
 
 				if (global.mode & MODE_DIAG) {
 					check_section_position(args[0], file, linenum,
@@ -2095,6 +2101,7 @@
 		err_code |= ERR_ALERT | ERR_FATAL;
 	}
 
+	ha_free(&global.cfg_curr_section);
 	if (cs && cs->post_section_parser)
 		err_code |= cs->post_section_parser();
 
@@ -2113,6 +2120,9 @@
 	cursection = NULL;
 	free(thisline);
 	free(outline);
+	global.cfg_curr_line = 0;
+	global.cfg_curr_file = NULL;
+
 	if (f)
 		fclose(f);