[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Wed, 22 May 2024 15:43:25 -0400 (EDT) |
branch: master
commit dc5302412db0f7f18f843e973372b5f61c989e58
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed May 22 21:29:52 2024 +0200
* tp/Texinfo/XS/parsetexi/input.c (parser_include_directories)
(parser_locate_include_file), tp/Texinfo/XS/parsetexi/api.c
(initialize_parsing, parse_file): add parser_include_directories,
initialized from a copy of global_parser_conf.include_directories
to add the input file directory for the parsing only and not to the
configuration.
---
tp/Texinfo/XS/parsetexi/api.c | 9 ++++++---
tp/Texinfo/XS/parsetexi/input.c | 4 +++-
tp/Texinfo/XS/parsetexi/input.h | 1 +
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 2022310386..3f5ef3c6b1 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -32,12 +32,11 @@
#include "input.h"
#include "source_marks.h"
#include "errors.h"
+#include "utils.h"
/* for wipe_user_commands */
#include "commands.h"
#include "command_stack.h"
#include "context_stack.h"
-/* for clear_parser_expanded_formats and add_parser_expanded_format */
-#include "handle_commands.h"
/* for wipe_macros store_value init_values wipe_values */
#include "macro.h"
#include "document.h"
@@ -62,6 +61,10 @@ initialize_parsing (void)
init_values ();
+ clear_strings_list (&parser_include_directories);
+ copy_strings (&parser_include_directories,
+ &global_parser_conf.include_directories);
+
free (global_documentlanguage);
if (global_parser_conf.global_documentlanguage_fixed
&& global_parser_conf.documentlanguage)
@@ -155,7 +158,7 @@ parse_file (const char *filename, const char
*input_file_name,
{
char saved = *p;
*p = '\0';
- parser_conf_add_include_directory (filename);
+ add_include_directory (filename, &parser_include_directories);
*p = saved;
}
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index 8cd4c5553a..ebae9122fc 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -89,6 +89,8 @@ set_input_encoding (const char *encoding)
return encoding_set;
}
+/* list of include directories for parsing (@*include files) */
+STRING_LIST parser_include_directories;
static INPUT *input_stack = 0;
int input_number = 0;
@@ -545,7 +547,7 @@ char *
parser_locate_include_file (const char *filename)
{
return locate_include_file (filename,
- &global_parser_conf.include_directories);
+ &parser_include_directories);
}
/* Try to open a file called FILENAME */
diff --git a/tp/Texinfo/XS/parsetexi/input.h b/tp/Texinfo/XS/parsetexi/input.h
index 681f8b8f0d..24e5508f40 100644
--- a/tp/Texinfo/XS/parsetexi/input.h
+++ b/tp/Texinfo/XS/parsetexi/input.h
@@ -27,6 +27,7 @@ int set_input_encoding (const char *encoding);
char *save_string (const char *string);
+extern STRING_LIST parser_include_directories;
extern int input_number;
extern int macro_expansion_nr;
extern int value_expansion_nr;